@inkeep/open-knowledge 0.0.0-dev-20260424035908 → 0.0.0-dev-20260424071819

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (99) hide show
  1. package/dist/{banner-C51OKbnz.mjs → banner-cxbl_Ely.mjs} +2 -2
  2. package/dist/{chokidar-CUkbt9Pk.mjs → chokidar-C6yIgAJZ.mjs} +1 -1
  3. package/dist/chunk-FK9Q3tQk.mjs +1 -0
  4. package/dist/cli.mjs +4 -4
  5. package/dist/colors-CDmFQ1jq.mjs +1 -0
  6. package/dist/{colors-DBw0yZBh.mjs → colors-CEQEtnHQ.mjs} +1 -1
  7. package/dist/constants-CXDXntb9.mjs +2 -0
  8. package/dist/esm-BbkJd7ro.mjs +2 -0
  9. package/dist/execAsync-DPeftusp.mjs +2 -0
  10. package/dist/execAsync-DhDvXMWQ.mjs +2 -0
  11. package/dist/execAsync-RJZP-H-A.mjs +2 -0
  12. package/dist/getMachineId-bsd-B-D2bOSl.mjs +2 -0
  13. package/dist/getMachineId-bsd-DcLiB1Fb.mjs +2 -0
  14. package/dist/getMachineId-bsd-Dl-xGqjV.mjs +2 -0
  15. package/dist/getMachineId-darwin-A7Xy885j.mjs +3 -0
  16. package/dist/getMachineId-darwin-BQro2RrT.mjs +3 -0
  17. package/dist/getMachineId-darwin-DPoYqu2E.mjs +3 -0
  18. package/dist/getMachineId-linux-B6DWkXLm.mjs +2 -0
  19. package/dist/getMachineId-linux-BwDCbiIf.mjs +2 -0
  20. package/dist/getMachineId-linux-DLyT3DBf.mjs +2 -0
  21. package/dist/getMachineId-unsupported-CQbaY6vv.mjs +2 -0
  22. package/dist/getMachineId-unsupported-CnUw0N-q.mjs +2 -0
  23. package/dist/getMachineId-unsupported-VfwZ1yF9.mjs +2 -0
  24. package/dist/getMachineId-win-BYymgu0m.mjs +2 -0
  25. package/dist/getMachineId-win-Bmzw0GhO.mjs +2 -0
  26. package/dist/getMachineId-win-DHI6zfnJ.mjs +2 -0
  27. package/dist/{git-handle-C_GYoScT.mjs → git-handle-C7se1dk0.mjs} +1 -1
  28. package/dist/git-handle-DmfLnwyi.mjs +1 -0
  29. package/dist/index.mjs +1 -1
  30. package/dist/{init-CZVmUT87.mjs → init-BBVwEA2N.mjs} +3 -3
  31. package/dist/init-DsXM9hPp.mjs +1 -0
  32. package/dist/init-DvES_bXI.mjs +1 -0
  33. package/dist/{init-CdVyKGV2.mjs → init-QQvPB0Au.mjs} +2 -2
  34. package/dist/{is-object-DaHwJLOe.mjs → is-object-DVVYT5oa.mjs} +1 -1
  35. package/dist/{keepalive-UJIeMtkM.mjs → keepalive-BqSeN73F.mjs} +1 -1
  36. package/dist/{loader-CIZooq1K.mjs → loader-C-EaZX2e.mjs} +2 -2
  37. package/dist/loader-Ck-HQgHI.mjs +1 -0
  38. package/dist/{open-browser-CfwaLBtR.mjs → open-browser-T-bOz6ZQ.mjs} +1 -1
  39. package/dist/paths-B483looM.mjs +1 -0
  40. package/dist/paths-BPoLusOz.mjs +2 -0
  41. package/dist/preview-C5sfPOVh.mjs +1 -0
  42. package/dist/{preview-C08icR9q.mjs → preview-T_RVYqtF.mjs} +2 -2
  43. package/dist/public/assets/{GraphPanel-CdNqMYNB.js → GraphPanel-CMj_CKRD.js} +2 -2
  44. package/dist/public/assets/McpConsentDialogBody-Dg7gdIrj.js +1 -0
  45. package/dist/public/assets/SourceEditor-BSUZdSkZ.js +3 -0
  46. package/dist/public/assets/__vite-browser-external-BFtnoaxY.js +1 -0
  47. package/dist/public/assets/button-D7O9FEkM.js +1 -0
  48. package/dist/public/assets/chunk-DECur_0Z.js +1 -0
  49. package/dist/public/assets/{clipboard-Bau-T9ly.js → clipboard-B0g7jEdf.js} +20 -20
  50. package/dist/public/assets/dialog-DzmWgC4p.js +45 -0
  51. package/dist/public/assets/{dist-B90Tbt-G.js → dist-BCB7v76S.js} +1 -1
  52. package/dist/public/assets/{dist-BJa-wTjR.js → dist-CDhLtkvx.js} +1 -1
  53. package/dist/public/assets/{dist-yRCb9u34.js → dist-CjujjdB3.js} +1 -1
  54. package/dist/public/assets/{dist-DQmXHI9Z.js → dist-Crc5NE1l.js} +1 -1
  55. package/dist/public/assets/{dist-D96Jocj9.js → dist-DF16X4DB.js} +1 -1
  56. package/dist/public/assets/{dist-1RA1Ivz5.js → dist-DRn8lLJe.js} +1 -1
  57. package/dist/public/assets/{dist-CsuK1sJe.js → dist-Dx3W_u4i.js} +1 -1
  58. package/dist/public/assets/index-B33JcCrk.js +27 -0
  59. package/dist/public/assets/index-Cj5uVVs3.css +1 -0
  60. package/dist/public/assets/{panel-B3Oezbzt.js → panel-jSlO39XJ.js} +4 -4
  61. package/dist/public/assets/propagation-api-CQodqriD.js +1 -0
  62. package/dist/public/assets/telemetry-impl-D_lLX0fS.js +2 -0
  63. package/dist/public/assets/toggle-group-D0c1wSh_.js +1 -0
  64. package/dist/public/index.html +13 -11
  65. package/dist/{server-lock-BI-SqMWk.mjs → server-lock-4vgF5yho.mjs} +1 -1
  66. package/dist/server-lock-CJkiM3qX.mjs +1 -0
  67. package/dist/{src-CQw-HNNM.mjs → src-CB-sXsMW.mjs} +2 -2
  68. package/dist/src-DN3CCqaD.mjs +1 -0
  69. package/dist/src-DQq7h88V.mjs +119 -0
  70. package/dist/src-DuGm387u.mjs +1 -0
  71. package/dist/{start-vt9sWCTs.mjs → start-B84Wdu83.mjs} +2 -2
  72. package/dist/start-h-f1SVhW.mjs +1 -0
  73. package/dist/{wrapper-_sZfvZ-v.mjs → wrapper-DhAZwCvI.mjs} +3 -3
  74. package/package.json +1 -1
  75. package/dist/chunk-tuRmWmEN.mjs +0 -1
  76. package/dist/colors-xJqYhQcY.mjs +0 -1
  77. package/dist/constants-B1LmGu5f.mjs +0 -2
  78. package/dist/git-handle-BIUIUt1r.mjs +0 -1
  79. package/dist/init-B8Z-IjIA.mjs +0 -1
  80. package/dist/init-DC07qP1u.mjs +0 -1
  81. package/dist/loader-DAQz-nAq.mjs +0 -1
  82. package/dist/paths-DLSUqXZB.mjs +0 -1
  83. package/dist/paths-DdB3Wb6U.mjs +0 -2
  84. package/dist/preview-MIvvysI9.mjs +0 -1
  85. package/dist/public/assets/McpConsentDialogBody-DKKOCaBA.js +0 -1
  86. package/dist/public/assets/SourceEditor-DFAP44AB.js +0 -3
  87. package/dist/public/assets/button-BuHZQnlF.js +0 -1
  88. package/dist/public/assets/dialog-XDohhbSr.js +0 -45
  89. package/dist/public/assets/index-C7yqVgG5.css +0 -1
  90. package/dist/public/assets/index-qVqYnv_K.js +0 -27
  91. package/dist/public/assets/toggle-group-DRnV5hAP.js +0 -1
  92. package/dist/server-lock-zOHsiWX-.mjs +0 -1
  93. package/dist/src-C1Um6yPF.mjs +0 -92
  94. package/dist/src-C445dwsE.mjs +0 -1
  95. package/dist/src-D75Kyk5s.mjs +0 -1
  96. package/dist/start-CX76iOVK.mjs +0 -1
  97. /package/dist/public/assets/{go-C_J4XPHz.js → go-BL7jA4zR.js} +0 -0
  98. /package/dist/public/assets/{shell-Cp2AENBi.js → shell-DKDblpGA.js} +0 -0
  99. /package/dist/public/assets/{w3c-keyname-DGDXsZN5.js → w3c-keyname-B56rf6AD.js} +0 -0
@@ -0,0 +1 @@
1
+ var e=`modulepreload`,t=function(e){return`/`+e},n={},r=function(r,i,a){let o=Promise.resolve();if(i&&i.length>0){let r=document.getElementsByTagName(`link`),s=document.querySelector(`meta[property=csp-nonce]`),c=s?.nonce||s?.getAttribute(`nonce`);function l(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}o=l(i.map(i=>{if(i=t(i,a),i in n)return;n[i]=!0;let o=i.endsWith(`.css`),s=o?`[rel="stylesheet"]`:``;if(a)for(let e=r.length-1;e>=0;e--){let t=r[e];if(t.href===i&&(!o||t.rel===`stylesheet`))return}else if(document.querySelector(`link[href="${i}"]${s}`))return;let l=document.createElement(`link`);if(l.rel=o?`stylesheet`:e,o||(l.as=`script`),l.crossOrigin=``,l.href=i,c&&l.setAttribute(`nonce`,c),document.head.appendChild(l),o)return new Promise((e,t)=>{l.addEventListener(`load`,e),l.addEventListener(`error`,()=>t(Error(`Unable to preload CSS for ${i}`)))})}))}function s(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return o.then(e=>{for(let t of e||[])t.status===`rejected`&&s(t.reason);return r().catch(s)})},i=`1.9.1`,a=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;function o(e){let t=new Set([e]),n=new Set,r=e.match(a);if(!r)return()=>!1;let i={major:+r[1],minor:+r[2],patch:+r[3],prerelease:r[4]};if(i.prerelease!=null)return function(t){return t===e};function o(e){return n.add(e),!1}function s(e){return t.add(e),!0}return function(e){if(t.has(e))return!0;if(n.has(e))return!1;let r=e.match(a);if(!r)return o(e);let c={major:+r[1],minor:+r[2],patch:+r[3],prerelease:r[4]};return c.prerelease!=null||i.major!==c.major?o(e):i.major===0?i.minor===c.minor&&i.patch<=c.patch?s(e):o(e):i.minor<=c.minor?s(e):o(e)}}var s=o(i),c=i.split(`.`)[0],l=Symbol.for(`opentelemetry.js.api.${c}`),u=typeof globalThis==`object`?globalThis:typeof self==`object`?self:typeof window==`object`?window:typeof global==`object`?global:{};function d(e,t,n,r=!1){let a=u[l]=u[l]??{version:i};if(!r&&a[e]){let t=Error(`@opentelemetry/api: Attempted duplicate registration of API: ${e}`);return n.error(t.stack||t.message),!1}if(a.version!==`1.9.1`){let t=Error(`@opentelemetry/api: Registration of version v${a.version} for ${e} does not match previously registered API v${i}`);return n.error(t.stack||t.message),!1}return a[e]=t,n.debug(`@opentelemetry/api: Registered a global for ${e} v${i}.`),!0}function f(e){let t=u[l]?.version;if(!(!t||!s(t)))return u[l]?.[e]}function p(e,t){t.debug(`@opentelemetry/api: Unregistering a global for ${e} v${i}.`);let n=u[l];n&&delete n[e]}var m=class{constructor(e){this._namespace=e.namespace||`DiagComponentLogger`}debug(...e){return h(`debug`,this._namespace,e)}error(...e){return h(`error`,this._namespace,e)}info(...e){return h(`info`,this._namespace,e)}warn(...e){return h(`warn`,this._namespace,e)}verbose(...e){return h(`verbose`,this._namespace,e)}};function h(e,t,n){let r=f(`diag`);if(r)return r[e](t,...n)}var g;(function(e){e[e.NONE=0]=`NONE`,e[e.ERROR=30]=`ERROR`,e[e.WARN=50]=`WARN`,e[e.INFO=60]=`INFO`,e[e.DEBUG=70]=`DEBUG`,e[e.VERBOSE=80]=`VERBOSE`,e[e.ALL=9999]=`ALL`})(g||={});function _(e,t){e<g.NONE?e=g.NONE:e>g.ALL&&(e=g.ALL),t||={};function n(n,r){let i=t[n];return typeof i==`function`&&e>=r?i.bind(t):function(){}}return{error:n(`error`,g.ERROR),warn:n(`warn`,g.WARN),info:n(`info`,g.INFO),debug:n(`debug`,g.DEBUG),verbose:n(`verbose`,g.VERBOSE)}}var v=`diag`,y=class e{static instance(){return this._instance||=new e,this._instance}constructor(){function e(e){return function(...t){let n=f(`diag`);if(n)return n[e](...t)}}let t=this;t.setLogger=(e,n={logLevel:g.INFO})=>{if(e===t){let e=Error(`Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation`);return t.error(e.stack??e.message),!1}typeof n==`number`&&(n={logLevel:n});let r=f(`diag`),i=_(n.logLevel??g.INFO,e);if(r&&!n.suppressOverrideMessage){let e=Error().stack??`<failed to generate stacktrace>`;r.warn(`Current logger will be overwritten from ${e}`),i.warn(`Current logger will overwrite one already registered from ${e}`)}return d(`diag`,i,t,!0)},t.disable=()=>{p(v,t)},t.createComponentLogger=e=>new m(e),t.verbose=e(`verbose`),t.debug=e(`debug`),t.info=e(`info`),t.warn=e(`warn`),t.error=e(`error`)}},b=class e{constructor(e){this._entries=e?new Map(e):new Map}getEntry(e){let t=this._entries.get(e);if(t)return Object.assign({},t)}getAllEntries(){return Array.from(this._entries.entries())}setEntry(t,n){let r=new e(this._entries);return r._entries.set(t,n),r}removeEntry(t){let n=new e(this._entries);return n._entries.delete(t),n}removeEntries(...t){let n=new e(this._entries);for(let e of t)n._entries.delete(e);return n}clear(){return new e}},x=Symbol(`BaggageEntryMetadata`),S=y.instance();function C(e={}){return new b(new Map(Object.entries(e)))}function w(e){return typeof e!=`string`&&(S.error(`Cannot create baggage metadata from unknown type: ${typeof e}`),e=``),{__TYPE__:x,toString(){return e}}}function T(e){return Symbol.for(e)}var E=new class e{constructor(t){let n=this;n._currentContext=t?new Map(t):new Map,n.getValue=e=>n._currentContext.get(e),n.setValue=(t,r)=>{let i=new e(n._currentContext);return i._currentContext.set(t,r),i},n.deleteValue=t=>{let r=new e(n._currentContext);return r._currentContext.delete(t),r}}},D={get(e,t){if(e!=null)return e[t]},keys(e){return e==null?[]:Object.keys(e)}},O={set(e,t,n){e!=null&&(e[t]=n)}},k=class{active(){return E}with(e,t,n,...r){return t.call(n,...r)}bind(e,t){return t}enable(){return this}disable(){return this}},A=`context`,j=new k,M=class e{constructor(){}static getInstance(){return this._instance||=new e,this._instance}setGlobalContextManager(e){return d(A,e,y.instance())}active(){return this._getContextManager().active()}with(e,t,n,...r){return this._getContextManager().with(e,t,n,...r)}bind(e,t){return this._getContextManager().bind(e,t)}_getContextManager(){return f(A)||j}disable(){this._getContextManager().disable(),p(A,y.instance())}},N=M.getInstance(),P=class{inject(e,t){}extract(e,t){return e}fields(){return[]}},F=T(`OpenTelemetry Baggage Key`);function I(e){return e.getValue(F)||void 0}function L(){return I(M.getInstance().active())}function R(e,t){return e.setValue(F,t)}function z(e){return e.deleteValue(F)}var B=`propagation`,V=new P,H=class e{constructor(){this.createBaggage=C,this.getBaggage=I,this.getActiveBaggage=L,this.setBaggage=R,this.deleteBaggage=z}static getInstance(){return this._instance||=new e,this._instance}setGlobalPropagator(e){return d(B,e,y.instance())}inject(e,t,n=O){return this._getGlobalPropagator().inject(e,t,n)}extract(e,t,n=D){return this._getGlobalPropagator().extract(e,t,n)}fields(){return this._getGlobalPropagator().fields()}disable(){p(B,y.instance())}_getGlobalPropagator(){return f(B)||V}}.getInstance();export{T as a,f as c,r as d,E as i,d as l,N as n,w as o,M as r,y as s,H as t,p as u};
@@ -0,0 +1,2 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/__vite-browser-external-BFtnoaxY.js","assets/chunk-DECur_0Z.js"])))=>i.map(i=>d[i]);
2
+ import{r as e}from"./chunk-DECur_0Z.js";import{a as t,c as n,d as r,i,l as a,n as o,o as s,r as c,s as l,t as u,u as d}from"./propagation-api-CQodqriD.js";var f=class{constructor(){}createGauge(e,t){return ue}createHistogram(e,t){return de}createCounter(e,t){return le}createUpDownCounter(e,t){return fe}createObservableGauge(e,t){return me}createObservableCounter(e,t){return pe}createObservableUpDownCounter(e,t){return he}addBatchObservableCallback(e,t){}removeBatchObservableCallback(e){}},p=class{},ee=class extends p{add(e,t){}},te=class extends p{add(e,t){}},ne=class extends p{record(e,t){}},re=class extends p{record(e,t){}},ie=class{addCallback(e){}removeCallback(e){}},ae=class extends ie{},oe=class extends ie{},se=class extends ie{},ce=new f,le=new ee,ue=new ne,de=new re,fe=new te,pe=new ae,me=new oe,he=new se;function ge(){return ce}var m;(function(e){e[e.NONE=0]=`NONE`,e[e.SAMPLED=1]=`SAMPLED`})(m||={});var _e={traceId:`00000000000000000000000000000000`,spanId:`0000000000000000`,traceFlags:m.NONE},h=class{constructor(e=_e){this._spanContext=e}spanContext(){return this._spanContext}setAttribute(e,t){return this}setAttributes(e){return this}addEvent(e,t){return this}addLink(e){return this}addLinks(e){return this}setStatus(e){return this}updateName(e){return this}end(e){}isRecording(){return!1}recordException(e,t){}},ve=t(`OpenTelemetry Context Key SPAN`);function ye(e){return e.getValue(ve)||void 0}function be(){return ye(c.getInstance().active())}function xe(e,t){return e.setValue(ve,t)}function Se(e){return e.deleteValue(ve)}function Ce(e,t){return xe(e,new h(t))}function we(e){return ye(e)?.spanContext()}var Te=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1]);function Ee(e,t){if(typeof e!=`string`||e.length!==t)return!1;let n=0;for(let t=0;t<e.length;t+=4)n+=(Te[e.charCodeAt(t)]|0)+(Te[e.charCodeAt(t+1)]|0)+(Te[e.charCodeAt(t+2)]|0)+(Te[e.charCodeAt(t+3)]|0);return n===t}function De(e){return Ee(e,32)&&e!==`00000000000000000000000000000000`}function Oe(e){return Ee(e,16)&&e!==`0000000000000000`}function ke(e){return De(e.traceId)&&Oe(e.spanId)}function Ae(e){return new h(e)}var je=c.getInstance(),Me=class{startSpan(e,t,n=je.active()){if(t?.root)return new h;let r=n&&we(n);return Ne(r)&&ke(r)?new h(r):new h}startActiveSpan(e,t,n,r){let i,a,o;if(arguments.length<2)return;arguments.length===2?o=t:arguments.length===3?(i=t,o=n):(i=t,a=n,o=r);let s=a??je.active(),c=this.startSpan(e,i,s),l=xe(s,c);return je.with(l,o,void 0,c)}};function Ne(e){return typeof e==`object`&&!!e&&`spanId`in e&&typeof e.spanId==`string`&&`traceId`in e&&typeof e.traceId==`string`&&`traceFlags`in e&&typeof e.traceFlags==`number`}var Pe=new Me,Fe=class{constructor(e,t,n,r){this._provider=e,this.name=t,this.version=n,this.options=r}startSpan(e,t,n){return this._getTracer().startSpan(e,t,n)}startActiveSpan(e,t,n,r){let i=this._getTracer();return Reflect.apply(i.startActiveSpan,i,arguments)}_getTracer(){if(this._delegate)return this._delegate;let e=this._provider.getDelegateTracer(this.name,this.version,this.options);return e?(this._delegate=e,this._delegate):Pe}},Ie=new class{getTracer(e,t,n){return new Me}},Le=class{getTracer(e,t,n){return this.getDelegateTracer(e,t,n)??new Fe(this,e,t,n)}getDelegate(){return this._delegate??Ie}setDelegate(e){this._delegate=e}getDelegateTracer(e,t,n){return this._delegate?.getTracer(e,t,n)}},Re;(function(e){e[e.NOT_RECORD=0]=`NOT_RECORD`,e[e.RECORD=1]=`RECORD`,e[e.RECORD_AND_SAMPLED=2]=`RECORD_AND_SAMPLED`})(Re||={});var ze;(function(e){e[e.INTERNAL=0]=`INTERNAL`,e[e.SERVER=1]=`SERVER`,e[e.CLIENT=2]=`CLIENT`,e[e.PRODUCER=3]=`PRODUCER`,e[e.CONSUMER=4]=`CONSUMER`})(ze||={});var g;(function(e){e[e.UNSET=0]=`UNSET`,e[e.OK=1]=`OK`,e[e.ERROR=2]=`ERROR`})(g||={});var _=l.instance(),Be=new class{getMeter(e,t,n){return ce}},Ve=`metrics`,He=class e{constructor(){}static getInstance(){return this._instance||=new e,this._instance}setGlobalMeterProvider(e){return a(Ve,e,l.instance())}getMeterProvider(){return n(Ve)||Be}getMeter(e,t,n){return this.getMeterProvider().getMeter(e,t,n)}disable(){d(Ve,l.instance())}}.getInstance(),Ue=`trace`,v=class e{constructor(){this._proxyTracerProvider=new Le,this.wrapSpanContext=Ae,this.isSpanContextValid=ke,this.deleteSpan=Se,this.getSpan=ye,this.getActiveSpan=be,this.getSpanContext=we,this.setSpan=xe,this.setSpanContext=Ce}static getInstance(){return this._instance||=new e,this._instance}setGlobalTracerProvider(e){let t=a(Ue,this._proxyTracerProvider,l.instance());return t&&this._proxyTracerProvider.setDelegate(e),t}getTracerProvider(){return n(Ue)||this._proxyTracerProvider}getTracer(e,t){return this.getTracerProvider().getTracer(e,t)}disable(){d(Ue,l.instance()),this._proxyTracerProvider=new Le}}.getInstance(),We=class{_delegate;constructor(e){this._delegate=e}export(e,t){this._delegate.export(e,t)}forceFlush(){return this._delegate.forceFlush()}shutdown(){return this._delegate.shutdown()}},Ge=class extends Error{code;name=`OTLPExporterError`;data;constructor(e,t,n){super(e),this.data=n,this.code=t}};function Ke(e){if(Number.isFinite(e)&&e>0)return e;throw Error(`Configuration: timeoutMillis is invalid, expected number greater than 0 (actual: '${e}')`)}function qe(e){if(e!=null)return()=>e}function Je(e,t,n){return{timeoutMillis:Ke(e.timeoutMillis??t.timeoutMillis??n.timeoutMillis),concurrencyLimit:e.concurrencyLimit??t.concurrencyLimit??n.concurrencyLimit,compression:e.compression??t.compression??n.compression}}function Ye(){return{timeoutMillis:1e4,concurrencyLimit:30,compression:`none`}}var Xe=class{_concurrencyLimit;_sendingPromises=[];constructor(e){this._concurrencyLimit=e}pushPromise(e){if(this.hasReachedLimit())throw Error(`Concurrency Limit reached`);this._sendingPromises.push(e);let t=()=>{let t=this._sendingPromises.indexOf(e);this._sendingPromises.splice(t,1)};e.then(t,t)}hasReachedLimit(){return this._sendingPromises.length>=this._concurrencyLimit}async awaitAll(){await Promise.all(this._sendingPromises)}};function Ze(e){return new Xe(e.concurrencyLimit)}var Qe=`http.url`,$e=`http.user_agent`,et=Qe,tt=$e,nt=`error.type`,rt=`exception.message`,it=`exception.stacktrace`,at=`exception.type`,ot=`http.request.method`,st=`http.request.method_original`,ct=`http.response.status_code`,lt=`server.address`,ut=`server.port`,dt=`service.name`,ft=`service.version`,pt=`telemetry.sdk.language`,mt=`webjs`,ht=`telemetry.sdk.name`,gt=`telemetry.sdk.version`,_t=`url.full`,y;(function(e){e[e.SUCCESS=0]=`SUCCESS`,e[e.FAILED=1]=`FAILED`})(y||={});function vt(e){return Object.prototype.hasOwnProperty.call(e,`partialSuccess`)}function yt(){return{handleResponse(e){e==null||!vt(e)||e.partialSuccess==null||Object.keys(e.partialSuccess).length===0||_.warn(`Received Partial Success response:`,JSON.stringify(e.partialSuccess))}}}var bt=class{_transport;_serializer;_responseHandler;_promiseQueue;_timeout;_diagLogger;constructor(e,t,n,r,i){this._transport=e,this._serializer=t,this._responseHandler=n,this._promiseQueue=r,this._timeout=i,this._diagLogger=_.createComponentLogger({namespace:`OTLPExportDelegate`})}export(e,t){if(this._diagLogger.debug(`items to be sent`,e),this._promiseQueue.hasReachedLimit()){t({code:y.FAILED,error:Error(`Concurrent export limit reached`)});return}let n=this._serializer.serializeRequest(e);if(n==null){t({code:y.FAILED,error:Error(`Nothing to send`)});return}this._promiseQueue.pushPromise(this._transport.send(n,this._timeout).then(e=>{if(e.status===`success`){if(e.data!=null)try{this._responseHandler.handleResponse(this._serializer.deserializeResponse(e.data))}catch(t){this._diagLogger.warn(`Export succeeded but could not deserialize response - is the response specification compliant?`,t,e.data)}t({code:y.SUCCESS});return}else if(e.status===`failure`&&e.error){t({code:y.FAILED,error:e.error});return}else e.status===`retryable`?t({code:y.FAILED,error:new Ge(`Export failed with retryable status`)}):t({code:y.FAILED,error:new Ge(`Export failed with unknown error`)})},e=>t({code:y.FAILED,error:e})))}forceFlush(){return this._promiseQueue.awaitAll()}async shutdown(){this._diagLogger.debug(`shutdown started`),await this.forceFlush(),this._transport.shutdown()}};function xt(e,t){return new bt(e.transport,e.serializer,yt(),e.promiseHandler,t.timeout)}function St(e,t,n){return xt({transport:n,serializer:t,promiseHandler:Ze(e)},{timeout:e.timeoutMillis})}var Ct=10**9;function wt(e){return e[0]*Ct+e[1]}function Tt(e){return e>=48&&e<=57?e-48:e>=97&&e<=102?e-87:e-55}function Et(e){let t=new Uint8Array(e.length/2),n=0;for(let r=0;r<e.length;r+=2){let i=Tt(e.charCodeAt(r)),a=Tt(e.charCodeAt(r+1));t[n++]=i<<4|a}return t}function Dt(e){let t=BigInt(1e9);return BigInt(e[0])*t+BigInt(e[1])}function Ot(e){return{low:Number(BigInt.asUintN(32,e)),high:Number(BigInt.asUintN(32,e>>BigInt(32)))}}function kt(e){return Ot(Dt(e))}function At(e){return Dt(e).toString()}var jt=typeof BigInt<`u`?At:wt;function Mt(e){return e}function Nt(e){if(e!==void 0)return Et(e)}var Pt={encodeHrTime:kt,encodeSpanContext:Et,encodeOptionalSpanContext:Nt};function Ft(e){if(e===void 0)return Pt;let t=e.useLongBits??!0,n=e.useHex??!1;return{encodeHrTime:t?kt:jt,encodeSpanContext:n?Mt:Et,encodeOptionalSpanContext:n?Mt:Nt}}function It(e){let t={attributes:b(e.attributes),droppedAttributesCount:0},n=e.schemaUrl;return n&&n!==``&&(t.schemaUrl=n),t}function Lt(e){return{name:e.name,version:e.version}}function b(e){return Object.keys(e).map(t=>Rt(t,e[t]))}function Rt(e,t){return{key:e,value:zt(t)}}function zt(e){let t=typeof e;return t===`string`?{stringValue:e}:t===`number`?Number.isInteger(e)?{intValue:e}:{doubleValue:e}:t===`boolean`?{boolValue:e}:e instanceof Uint8Array?{bytesValue:e}:Array.isArray(e)?{arrayValue:{values:e.map(zt)}}:t===`object`&&e!=null?{kvlistValue:{values:Object.entries(e).map(([e,t])=>Rt(e,t))}}:{}}function Bt(e,t){let n=e.spanContext(),r=e.status,i=e.parentSpanContext?.spanId?t.encodeSpanContext(e.parentSpanContext?.spanId):void 0;return{traceId:t.encodeSpanContext(n.traceId),spanId:t.encodeSpanContext(n.spanId),parentSpanId:i,traceState:n.traceState?.serialize(),name:e.name,kind:e.kind==null?0:e.kind+1,startTimeUnixNano:t.encodeHrTime(e.startTime),endTimeUnixNano:t.encodeHrTime(e.endTime),attributes:b(e.attributes),droppedAttributesCount:e.droppedAttributesCount,events:e.events.map(e=>Ht(e,t)),droppedEventsCount:e.droppedEventsCount,status:{code:r.code,message:r.message},links:e.links.map(e=>Vt(e,t)),droppedLinksCount:e.droppedLinksCount}}function Vt(e,t){return{attributes:e.attributes?b(e.attributes):[],spanId:t.encodeSpanContext(e.context.spanId),traceId:t.encodeSpanContext(e.context.traceId),traceState:e.context.traceState?.serialize(),droppedAttributesCount:e.droppedAttributesCount||0}}function Ht(e,t){return{attributes:e.attributes?b(e.attributes):[],name:e.name,timeUnixNano:t.encodeHrTime(e.time),droppedAttributesCount:e.droppedAttributesCount||0}}function Ut(e,t){return{resourceSpans:Gt(e,Ft(t))}}function Wt(e){let t=new Map;for(let n of e){let e=t.get(n.resource);e||(e=new Map,t.set(n.resource,e));let r=`${n.instrumentationScope.name}@${n.instrumentationScope.version||``}:${n.instrumentationScope.schemaUrl||``}`,i=e.get(r);i||(i=[],e.set(r,i)),i.push(n)}return t}function Gt(e,t){let n=Wt(e),r=[],i=n.entries(),a=i.next();for(;!a.done;){let[e,n]=a.value,o=[],s=n.values(),c=s.next();for(;!c.done;){let e=c.value;if(e.length>0){let n=e.map(e=>Bt(e,t));o.push({scope:Lt(e[0].instrumentationScope),spans:n,schemaUrl:e[0].instrumentationScope.schemaUrl})}c=s.next()}let l=It(e),u={resource:l,scopeSpans:o,schemaUrl:l.schemaUrl};r.push(u),a=i.next()}return r}var Kt={serializeRequest:e=>{let t=Ut(e,{useHex:!0,useLongBits:!1});return new TextEncoder().encode(JSON.stringify(t))},deserializeResponse:e=>{if(e.length===0)return{};let t=new TextDecoder;return JSON.parse(t.decode(e))}},qt=5,Jt=1e3,Yt=5e3,Xt=1.5,Zt=.2;function Qt(){return 2*Zt*Math.random()-Zt}var $t=class{_transport;constructor(e){this._transport=e}retry(e,t,n){return new Promise((r,i)=>{setTimeout(()=>{this._transport.send(e,t).then(r,i)},n)})}async send(e,t){let n=Date.now()+t,r=await this._transport.send(e,t),i=qt,a=Jt;for(;r.status===`retryable`&&i>0;){i--;let t=Math.max(Math.min(a,Yt)+Qt(),0);a*=Xt;let o=r.retryInMillis??t,s=n-Date.now();if(o>s)return r;r=await this.retry(e,s,o)}return r}shutdown(){return this._transport.shutdown()}};function en(e){return new $t(e.transport)}function tn(e){return[429,502,503,504].includes(e)}function nn(e){if(e==null)return;let t=Number.parseInt(e,10);if(Number.isInteger(t))return t>0?t*1e3:-1;let n=new Date(e).getTime()-Date.now();return n>=0?n:0}var rn=class{_parameters;constructor(e){this._parameters=e}send(e,t){return new Promise(n=>{let r=new XMLHttpRequest;r.timeout=t,r.open(`POST`,this._parameters.url);let i=this._parameters.headers();Object.entries(i).forEach(([e,t])=>{r.setRequestHeader(e,t)}),r.ontimeout=e=>{n({status:`failure`,error:Error(`XHR request timed out`)})},r.onreadystatechange=()=>{r.status>=200&&r.status<=299?(_.debug(`XHR success`),n({status:`success`})):r.status&&tn(r.status)?n({status:`retryable`,retryInMillis:nn(r.getResponseHeader(`Retry-After`))}):r.status!==0&&n({status:`failure`,error:Error(`XHR request failed with non-retryable status`)})},r.onabort=()=>{n({status:`failure`,error:Error(`XHR request aborted`)})},r.onerror=()=>{n({status:`failure`,error:Error(`XHR request errored`)})},r.send(e)})}shutdown(){}};function an(e){return new rn(e)}var on=class{_params;constructor(e){this._params=e}send(e){return new Promise(t=>{navigator.sendBeacon(this._params.url,new Blob([e],{type:this._params.blobType}))?(_.debug(`SendBeacon success`),t({status:`success`})):t({status:`failure`,error:Error(`SendBeacon failed`)})})}shutdown(){}};function sn(e){return new on(e)}var cn=class{_parameters;constructor(e){this._parameters=e}async send(e,t){let n=new AbortController,r=setTimeout(()=>n.abort(),t);try{let t=!!globalThis.location,r=new URL(this._parameters.url),i=await fetch(r.href,{method:`POST`,headers:this._parameters.headers(),body:e,signal:n.signal,keepalive:t,mode:t?globalThis.location?.origin===r.origin?`same-origin`:`cors`:`no-cors`});return i.status>=200&&i.status<=299?(_.debug(`response success`),{status:`success`}):tn(i.status)?{status:`retryable`,retryInMillis:nn(i.headers.get(`Retry-After`))}:{status:`failure`,error:Error(`Fetch request failed with non-retryable status`)}}catch(e){return e?.name===`AbortError`?{status:`failure`,error:Error(`Fetch request timed out`,{cause:e})}:{status:`failure`,error:Error(`Fetch request errored`,{cause:e})}}finally{clearTimeout(r)}}shutdown(){}};function ln(e){return new cn(e)}function un(e,t){return St(e,t,en({transport:an(e)}))}function dn(e,t){return St(e,t,en({transport:ln(e)}))}function fn(e,t){return St(e,t,en({transport:sn({url:e.url,blobType:e.headers()[`Content-Type`]})}))}function pn(e){return()=>{let t={};return Object.entries(e?.()??{}).forEach(([e,n])=>{n===void 0?_.warn(`Header "${e}" has invalid value (${n}) and will be ignored`):t[e]=String(n)}),t}}function mn(e,t,n){let r={...n()},i={};return()=>(t!=null&&Object.assign(i,t()),e!=null&&Object.assign(i,e()),Object.assign(i,r))}function hn(e){if(e!=null)try{let t=globalThis.location?.href;return new URL(e,t).href}catch{throw Error(`Configuration: Could not parse user-provided export URL: '${e}'`)}}function gn(t){return async n=>{let{Agent:i}=await r(()=>import(`./__vite-browser-external-BFtnoaxY.js`).then(t=>e(t.default)),__vite__mapDeps([0,1]));return new i(t)}}function _n(e,t,n){return{...Je(e,t,n),headers:mn(pn(e.headers),t.headers,n.headers),url:hn(e.url)??t.url??n.url,agentFactory:e.agentFactory??t.agentFactory??n.agentFactory}}function vn(e,t){return{...Ye(),headers:()=>e,url:`http://localhost:4318/`+t,agentFactory:gn({keepAlive:!0})}}function yn(e,t,n){return _n({url:e.url,timeoutMillis:e.timeoutMillis,headers:qe(e.headers),concurrencyLimit:e.concurrencyLimit},{},vn(n,t))}function bn(e,t,n,r){return xn(e.headers)(yn(e,n,r),t)}function xn(e){return!e&&typeof navigator.sendBeacon==`function`?fn:globalThis.fetch===void 0?un:dn}var Sn=class extends We{constructor(e={}){super(bn(e,Kt,`v1/traces`,{"Content-Type":`application/json`}))}},Cn=class{emit(e){}},wn=new Cn,Tn=new class{getLogger(e,t,n){return new Cn}},En=class{constructor(e,t,n,r){this._provider=e,this.name=t,this.version=n,this.options=r}emit(e){this._getLogger().emit(e)}_getLogger(){if(this._delegate)return this._delegate;let e=this._provider._getDelegateLogger(this.name,this.version,this.options);return e?(this._delegate=e,this._delegate):wn}},Dn=class{getLogger(e,t,n){return this._getDelegateLogger(e,t,n)??new En(this,e,t,n)}_getDelegate(){return this._delegate??Tn}_setDelegate(e){this._delegate=e}_getDelegateLogger(e,t,n){return this._delegate?.getLogger(e,t,n)}},On=typeof globalThis==`object`?globalThis:typeof self==`object`?self:typeof window==`object`?window:typeof global==`object`?global:{},x=Symbol.for(`io.opentelemetry.js.api.logs`),S=On;function kn(e,t,n){return r=>r===e?t:n}var An=class e{constructor(){this._proxyLoggerProvider=new Dn}static getInstance(){return this._instance||=new e,this._instance}setGlobalLoggerProvider(e){return S[x]?this.getLoggerProvider():(S[x]=kn(1,e,Tn),this._proxyLoggerProvider._setDelegate(e),e)}getLoggerProvider(){return S[x]?.call(S,1)??this._proxyLoggerProvider}getLogger(e,t,n){return this.getLoggerProvider().getLogger(e,t,n)}disable(){delete S[x],this._proxyLoggerProvider=new Dn}}.getInstance();function jn(e,t,n,r){for(let i=0,a=e.length;i<a;i++){let a=e[i];t&&a.setTracerProvider(t),n&&a.setMeterProvider(n),r&&a.setLoggerProvider&&a.setLoggerProvider(r),a.getConfig().enabled||a.enable()}}function Mn(e){e.forEach(e=>e.disable())}function Nn(e){let t=e.tracerProvider||v.getTracerProvider(),n=e.meterProvider||He.getMeterProvider(),r=e.loggerProvider||An.getLoggerProvider(),i=e.instrumentations?.flat()??[];return jn(i,t,n,r),()=>{Mn(i)}}var C=console.error.bind(console);function w(e,t,n){let r=!!e[t]&&Object.prototype.propertyIsEnumerable.call(e,t);Object.defineProperty(e,t,{configurable:!0,enumerable:r,writable:!0,value:n})}var Pn=(e,t,n)=>{if(!e||!e[t]){C(`no original function `+String(t)+` to wrap`);return}if(!n){C(`no wrapper function`),C(Error().stack);return}let r=e[t];if(typeof r!=`function`||typeof n!=`function`){C(`original object and wrapper must be functions`);return}let i=n(r,t);return w(i,`__original`,r),w(i,`__unwrap`,()=>{e[t]===i&&w(e,t,r)}),w(i,`__wrapped`,!0),w(e,t,i),i},Fn=(e,t,n)=>{if(e)Array.isArray(e)||(e=[e]);else{C(`must provide one or more modules to patch`),C(Error().stack);return}if(!(t&&Array.isArray(t))){C(`must provide one or more functions to wrap on modules`);return}e.forEach(e=>{t.forEach(t=>{Pn(e,t,n)})})},In=(e,t)=>{if(!e||!e[t]){C(`no function to unwrap.`),C(Error().stack);return}let n=e[t];if(!n.__unwrap)C(`no original to unwrap to -- has `+String(t)+` already been unwrapped?`);else{n.__unwrap();return}},Ln=(e,t)=>{if(e)Array.isArray(e)||(e=[e]);else{C(`must provide one or more modules to patch`),C(Error().stack);return}if(!(t&&Array.isArray(t))){C(`must provide one or more functions to unwrap on modules`);return}e.forEach(e=>{t.forEach(t=>{In(e,t)})})};function T(e){e&&e.logger&&(typeof e.logger==`function`?C=e.logger:C(`new logger isn't a function, not replacing`))}T.wrap=Pn,T.massWrap=Fn,T.unwrap=In,T.massUnwrap=Ln;var Rn=class{instrumentationName;instrumentationVersion;_config={};_tracer;_meter;_logger;_diag;constructor(e,t,n){this.instrumentationName=e,this.instrumentationVersion=t,this.setConfig(n),this._diag=_.createComponentLogger({namespace:e}),this._tracer=v.getTracer(e,t),this._meter=He.getMeter(e,t),this._logger=An.getLogger(e,t),this._updateMetricInstruments()}_wrap=Pn;_unwrap=In;_massWrap=Fn;_massUnwrap=Ln;get meter(){return this._meter}setMeterProvider(e){this._meter=e.getMeter(this.instrumentationName,this.instrumentationVersion),this._updateMetricInstruments()}get logger(){return this._logger}setLoggerProvider(e){this._logger=e.getLogger(this.instrumentationName,this.instrumentationVersion)}getModuleDefinitions(){let e=this.init()??[];return Array.isArray(e)?e:[e]}_updateMetricInstruments(){}getConfig(){return this._config}setConfig(e){this._config={enabled:!0,...e}}setTracerProvider(e){this._tracer=e.getTracer(this.instrumentationName,this.instrumentationVersion)}get tracer(){return this._tracer}_runSpanCustomizationHook(e,t,n,r){if(e)try{e(n,r)}catch(e){this._diag.error(`Error running span customization hook due to exception in handler`,{triggerName:t},e)}}},zn=class extends Rn{constructor(e,t,n){super(e,t,n),this._config.enabled&&this.enable()}};function E(e,t,n){let r,i;try{i=e()}catch(e){r=e}finally{if(t(r,i),r&&!n)throw r;return i}}function D(e){return typeof e==`function`&&typeof e.__original==`function`&&typeof e.__unwrap==`function`&&e.__wrapped===!0}var O;(function(e){e[e.STABLE=1]=`STABLE`,e[e.OLD=2]=`OLD`,e[e.DUPLICATE=3]=`DUPLICATE`})(O||={});function Bn(e,t){let n=O.OLD,r=t?.split(`,`).map(e=>e.trim()).filter(e=>e!==``);for(let t of r??[])if(t.toLowerCase()===e+`/dup`){n=O.DUPLICATE;break}else t.toLowerCase()===e&&(n=O.STABLE);return n}var Vn=t(`OpenTelemetry SDK Context Key SUPPRESS_TRACING`);function Hn(e){return e.setValue(Vn,!0)}function Un(e){return e.getValue(Vn)===!0}var Wn=`baggage`,Gn=4096;function Kn(e){return e.reduce((e,t)=>{let n=`${e}${e===``?``:`,`}${t}`;return n.length>8192?e:n},``)}function qn(e){return e.getAllEntries().map(([e,t])=>{let n=`${encodeURIComponent(e)}=${encodeURIComponent(t.value)}`;return t.metadata!==void 0&&(n+=`;`+t.metadata.toString()),n})}function Jn(e){if(!e)return;let t=e.indexOf(`;`),n=t===-1?e:e.substring(0,t),r=n.indexOf(`=`);if(r<=0)return;let i=n.substring(0,r).trim(),a=n.substring(r+1).trim();if(!i||!a)return;let o,c;try{o=decodeURIComponent(i),c=decodeURIComponent(a)}catch{return}let l;return t!==-1&&t<e.length-1&&(l=s(e.substring(t+1))),{key:o,value:c,metadata:l}}var Yn=class{inject(e,t,n){let r=u.getBaggage(e);if(!r||Un(e))return;let i=Kn(qn(r).filter(e=>e.length<=Gn).slice(0,180));i.length>0&&n.set(t,Wn,i)}extract(e,t,n){let r=n.get(t,Wn),i=Array.isArray(r)?r.join(`,`):r;if(!i)return e;let a={};return i.length===0||(i.split(`,`).forEach(e=>{let t=Jn(e);if(t){let e={value:t.value};t.metadata&&(e.metadata=t.metadata),a[t.key]=e}}),Object.entries(a).length===0)?e:u.setBaggage(e,u.createBaggage(a))}fields(){return[Wn]}};function k(e){let t={};if(typeof e!=`object`||!e)return t;for(let n in e){if(!Object.prototype.hasOwnProperty.call(e,n))continue;if(!Xn(n)){_.warn(`Invalid attribute key: ${n}`);continue}let r=e[n];if(!Zn(r)){_.warn(`Invalid attribute value set for key: ${n}`);continue}Array.isArray(r)?t[n]=r.slice():t[n]=r}return t}function Xn(e){return typeof e==`string`&&e!==``}function Zn(e){return e==null?!0:Array.isArray(e)?Qn(e):$n(typeof e)}function Qn(e){let t;for(let n of e){if(n==null)continue;let e=typeof n;if(e!==t){if(!t){if($n(e)){t=e;continue}return!1}return!1}}return!0}function $n(e){switch(e){case`number`:case`boolean`:case`string`:return!0}return!1}function er(){return e=>{_.error(tr(e))}}function tr(e){return typeof e==`string`?e:JSON.stringify(nr(e))}function nr(e){let t={},n=e;for(;n!==null;)Object.getOwnPropertyNames(n).forEach(e=>{if(t[e])return;let r=n[e];r&&(t[e]=String(r))}),n=Object.getPrototypeOf(n);return t}var rr=er();function A(e){try{rr(e)}catch{}}var ir=`2.7.0`,ar=`process.runtime.name`,or={[ht]:`opentelemetry`,[ar]:`browser`,[pt]:mt,[gt]:ir},j=performance,sr=9,cr=10**6,lr=10**sr;function M(e){let t=e/1e3;return[Math.trunc(t),Math.round(e%1e3*cr)]}function ur(e){return mr(M(j.timeOrigin),M(typeof e==`number`?e:j.now()))}function dr(e,t){let n=t[0]-e[0],r=t[1]-e[1];return r<0&&(--n,r+=lr),[n,r]}function fr(e){return Array.isArray(e)&&e.length===2&&typeof e[0]==`number`&&typeof e[1]==`number`}function pr(e){return fr(e)||typeof e==`number`||e instanceof Date}function mr(e,t){let n=[e[0]+t[0],e[1]+t[1]];return n[1]>=lr&&(n[1]-=lr,n[0]+=1),n}var hr;(function(e){e[e.SUCCESS=0]=`SUCCESS`,e[e.FAILED=1]=`FAILED`})(hr||={});var gr=class{_propagators;_fields;constructor(e={}){this._propagators=e.propagators??[],this._fields=Array.from(new Set(this._propagators.map(e=>typeof e.fields==`function`?e.fields():[]).reduce((e,t)=>e.concat(t),[])))}inject(e,t,n){for(let r of this._propagators)try{r.inject(e,t,n)}catch(e){_.warn(`Failed to inject with ${r.constructor.name}. Err: ${e.message}`)}}extract(e,t,n){return this._propagators.reduce((e,r)=>{try{return r.extract(e,t,n)}catch(e){_.warn(`Failed to extract with ${r.constructor.name}. Err: ${e.message}`)}return e},e)}fields(){return this._fields.slice()}},_r=`[_0-9a-z-*/]`,vr=`[a-z]${_r}{0,255}`,yr=`[a-z0-9]${_r}{0,240}@[a-z]${_r}{0,13}`,br=RegExp(`^(?:${vr}|${yr})$`),xr=/^[ -~]{0,255}[!-~]$/,Sr=/,|=/;function Cr(e){return br.test(e)}function wr(e){return xr.test(e)&&!Sr.test(e)}var Tr=32,Er=512,Dr=`,`,Or=`=`,kr=class e{_internalState=new Map;constructor(e){e&&this._parse(e)}set(e,t){let n=this._clone();return n._internalState.has(e)&&n._internalState.delete(e),n._internalState.set(e,t),n}unset(e){let t=this._clone();return t._internalState.delete(e),t}get(e){return this._internalState.get(e)}serialize(){return this._keys().reduce((e,t)=>(e.push(t+Or+this.get(t)),e),[]).join(Dr)}_parse(e){e.length>Er||(this._internalState=e.split(Dr).reverse().reduce((e,t)=>{let n=t.trim(),r=n.indexOf(Or);if(r!==-1){let i=n.slice(0,r),a=n.slice(r+1,t.length);Cr(i)&&wr(a)&&e.set(i,a)}return e},new Map),this._internalState.size>Tr&&(this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,Tr))))}_keys(){return Array.from(this._internalState.keys()).reverse()}_clone(){let t=new e;return t._internalState=new Map(this._internalState),t}},N=`traceparent`,Ar=`tracestate`,jr=`00`,Mr=RegExp(`^\\s?((?!ff)[\\da-f]{2})-((?![0]{32})[\\da-f]{32})-((?![0]{16})[\\da-f]{16})-([\\da-f]{2})(-.*)?\\s?$`);function Nr(e){let t=Mr.exec(e);return!t||t[1]===`00`&&t[5]?null:{traceId:t[2],spanId:t[3],traceFlags:parseInt(t[4],16)}}var Pr=class{inject(e,t,n){let r=v.getSpanContext(e);if(!r||Un(e)||!ke(r))return;let i=`${jr}-${r.traceId}-${r.spanId}-0${Number(r.traceFlags||m.NONE).toString(16)}`;n.set(t,N,i),r.traceState&&n.set(t,Ar,r.traceState.serialize())}extract(e,t,n){let r=n.get(t,N);if(!r)return e;let i=Array.isArray(r)?r[0]:r;if(typeof i!=`string`)return e;let a=Nr(i);if(!a)return e;a.isRemote=!0;let o=n.get(t,Ar);if(o){let e=Array.isArray(o)?o.join(`,`):o;a.traceState=new kr(typeof e==`string`?e:void 0)}return v.setSpanContext(e,a)}fields(){return[N,Ar]}},Fr=`[object Object]`,Ir=`[object Null]`,Lr=`[object Undefined]`,Rr=Function.prototype.toString,zr=Rr.call(Object),Br=Object.getPrototypeOf,Vr=Object.prototype,Hr=Vr.hasOwnProperty,P=Symbol?Symbol.toStringTag:void 0,Ur=Vr.toString;function Wr(e){if(!Gr(e)||Kr(e)!==Fr)return!1;let t=Br(e);if(t===null)return!0;let n=Hr.call(t,`constructor`)&&t.constructor;return typeof n==`function`&&n instanceof n&&Rr.call(n)===zr}function Gr(e){return typeof e==`object`&&!!e}function Kr(e){return e==null?e===void 0?Lr:Ir:P&&P in Object(e)?qr(e):Jr(e)}function qr(e){let t=Hr.call(e,P),n=e[P],r=!1;try{e[P]=void 0,r=!0}catch{}let i=Ur.call(e);return r&&(t?e[P]=n:delete e[P]),i}function Jr(e){return Ur.call(e)}var Yr=20;function Xr(...e){let t=e.shift(),n=new WeakMap;for(;e.length>0;)t=Qr(t,e.shift(),0,n);return t}function Zr(e){return F(e)?e.slice():e}function Qr(e,t,n=0,r){let i;if(!(n>Yr)){if(n++,L(e)||L(t)||ei(t))i=Zr(t);else if(F(e)){if(i=e.slice(),F(t))for(let e=0,n=t.length;e<n;e++)i.push(Zr(t[e]));else if(I(t)){let e=Object.keys(t);for(let n=0,r=e.length;n<r;n++){let r=e[n];r===`__proto__`||r===`constructor`||r===`prototype`||(i[r]=Zr(t[r]))}}}else if(I(e))if(I(t)){if(!ti(e,t))return t;i=Object.assign({},e);let a=Object.keys(t);for(let o=0,s=a.length;o<s;o++){let s=a[o];if(s===`__proto__`||s===`constructor`||s===`prototype`)continue;let c=t[s];if(L(c))c===void 0?delete i[s]:i[s]=c;else{let a=i[s],o=c;if($r(e,s,r)||$r(t,s,r))delete i[s];else{if(I(a)&&I(o)){let n=r.get(a)||[],i=r.get(o)||[];n.push({obj:e,key:s}),i.push({obj:t,key:s}),r.set(a,n),r.set(o,i)}i[s]=Qr(i[s],c,n,r)}}}}else i=t;return i}}function $r(e,t,n){let r=n.get(e[t])||[];for(let n=0,i=r.length;n<i;n++){let i=r[n];if(i.key===t&&i.obj===e)return!0}return!1}function F(e){return Array.isArray(e)}function ei(e){return typeof e==`function`}function I(e){return!L(e)&&!F(e)&&!ei(e)&&typeof e==`object`}function L(e){return typeof e==`string`||typeof e==`number`||typeof e==`boolean`||e===void 0||e instanceof Date||e instanceof RegExp||e===null}function ti(e,t){return!(!Wr(e)||!Wr(t))}var ni=class{_promise;_resolve;_reject;constructor(){this._promise=new Promise((e,t)=>{this._resolve=e,this._reject=t})}get promise(){return this._promise}resolve(e){this._resolve(e)}reject(e){this._reject(e)}},ri=class{_isCalled=!1;_deferred=new ni;_callback;_that;constructor(e,t){this._callback=e,this._that=t}get isCalled(){return this._isCalled}get promise(){return this._deferred.promise}call(...e){if(!this._isCalled){this._isCalled=!0;try{Promise.resolve(this._callback.call(this._that,...e)).then(e=>this._deferred.resolve(e),e=>this._deferred.reject(e))}catch(e){this._deferred.reject(e)}}return this._deferred.promise}},R;function ii(){if(R===void 0)try{let e=globalThis.process.argv0;R=e?`unknown_service:${e}`:`unknown_service`}catch{R=`unknown_service`}return R}var z=e=>typeof e==`object`&&!!e&&typeof e.then==`function`,ai=class e{_rawAttributes;_asyncAttributesPending=!1;_schemaUrl;_memoizedAttributes;static FromAttributeList(t,n){let r=new e({},n);return r._rawAttributes=ci(t),r._asyncAttributesPending=t.filter(([e,t])=>z(t)).length>0,r}constructor(e,t){let n=e.attributes??{};this._rawAttributes=Object.entries(n).map(([e,t])=>(z(t)&&(this._asyncAttributesPending=!0),[e,t])),this._rawAttributes=ci(this._rawAttributes),this._schemaUrl=li(t?.schemaUrl)}get asyncAttributesPending(){return this._asyncAttributesPending}async waitForAsyncAttributes(){if(this.asyncAttributesPending){for(let e=0;e<this._rawAttributes.length;e++){let[t,n]=this._rawAttributes[e];this._rawAttributes[e]=[t,z(n)?await n:n]}this._asyncAttributesPending=!1}}get attributes(){if(this.asyncAttributesPending&&_.error(`Accessing resource attributes before async attributes settled`),this._memoizedAttributes)return this._memoizedAttributes;let e={};for(let[t,n]of this._rawAttributes){if(z(n)){_.debug(`Unsettled resource attribute ${t} skipped`);continue}n!=null&&(e[t]??=n)}return this._asyncAttributesPending||(this._memoizedAttributes=e),e}getRawAttributes(){return this._rawAttributes}get schemaUrl(){return this._schemaUrl}merge(t){if(t==null)return this;let n=ui(this,t),r=n?{schemaUrl:n}:void 0;return e.FromAttributeList([...t.getRawAttributes(),...this.getRawAttributes()],r)}};function oi(e,t){return ai.FromAttributeList(Object.entries(e),t)}function si(){return oi({[dt]:ii(),[pt]:or[pt],[ht]:or[ht],[gt]:or[gt]})}function ci(e){return e.map(([e,t])=>z(t)?[e,t.catch(t=>{_.debug(`promise rejection for resource attribute: %s - %s`,e,t)})]:[e,t])}function li(e){if(typeof e==`string`||e===void 0)return e;_.warn(`Schema URL must be string or undefined, got %s. Schema URL will be ignored.`,e)}function ui(e,t){let n=e?.schemaUrl,r=t?.schemaUrl,i=n===void 0||n===``,a=r===void 0||r===``;if(i)return r;if(a||n===r)return n;_.warn(`Schema URL merge conflict: old resource has "%s", updating resource has "%s". Resulting resource will have undefined Schema URL.`,n,r)}var di=`exception`,fi=class{_spanContext;kind;parentSpanContext;attributes={};links=[];events=[];startTime;resource;instrumentationScope;_droppedAttributesCount=0;_droppedEventsCount=0;_droppedLinksCount=0;_attributesCount=0;name;status={code:g.UNSET};endTime=[0,0];_ended=!1;_duration=[-1,-1];_spanProcessor;_spanLimits;_attributeValueLengthLimit;_recordEndMetrics;_performanceStartTime;_performanceOffset;_startTimeProvided;constructor(e){let t=Date.now();if(this._spanContext=e.spanContext,this._performanceStartTime=j.now(),this._performanceOffset=t-(this._performanceStartTime+j.timeOrigin),this._startTimeProvided=e.startTime!=null,this._spanLimits=e.spanLimits,this._attributeValueLengthLimit=this._spanLimits.attributeValueLengthLimit??0,this._spanProcessor=e.spanProcessor,this.name=e.name,this.parentSpanContext=e.parentSpanContext,this.kind=e.kind,e.links)for(let t of e.links)this.addLink(t);this.startTime=this._getTime(e.startTime??t),this.resource=e.resource,this.instrumentationScope=e.scope,this._recordEndMetrics=e.recordEndMetrics,e.attributes!=null&&this.setAttributes(e.attributes),this._spanProcessor.onStart(this,e.context)}spanContext(){return this._spanContext}setAttribute(e,t){if(t==null||this._isSpanEnded())return this;if(e.length===0)return _.warn(`Invalid attribute key: ${e}`),this;if(!Zn(t))return _.warn(`Invalid attribute value set for key: ${e}`),this;let{attributeCountLimit:n}=this._spanLimits,r=!Object.prototype.hasOwnProperty.call(this.attributes,e);return n!==void 0&&this._attributesCount>=n&&r?(this._droppedAttributesCount++,this):(this.attributes[e]=this._truncateToSize(t),r&&this._attributesCount++,this)}setAttributes(e){for(let t in e)Object.prototype.hasOwnProperty.call(e,t)&&this.setAttribute(t,e[t]);return this}addEvent(e,t,n){if(this._isSpanEnded())return this;let{eventCountLimit:r}=this._spanLimits;if(r===0)return _.warn(`No events allowed.`),this._droppedEventsCount++,this;r!==void 0&&this.events.length>=r&&(this._droppedEventsCount===0&&_.debug(`Dropping extra events.`),this.events.shift(),this._droppedEventsCount++),pr(t)&&(pr(n)||(n=t),t=void 0);let i=k(t),{attributePerEventCountLimit:a}=this._spanLimits,o={},s=0,c=0;for(let e in i){if(!Object.prototype.hasOwnProperty.call(i,e))continue;let t=i[e];if(a!==void 0&&c>=a){s++;continue}o[e]=this._truncateToSize(t),c++}return this.events.push({name:e,attributes:o,time:this._getTime(n),droppedAttributesCount:s}),this}addLink(e){if(this._isSpanEnded())return this;let{linkCountLimit:t}=this._spanLimits;if(t===0)return this._droppedLinksCount++,this;t!==void 0&&this.links.length>=t&&(this._droppedLinksCount===0&&_.debug(`Dropping extra links.`),this.links.shift(),this._droppedLinksCount++);let{attributePerLinkCountLimit:n}=this._spanLimits,r=k(e.attributes),i={},a=0,o=0;for(let e in r){if(!Object.prototype.hasOwnProperty.call(r,e))continue;let t=r[e];if(n!==void 0&&o>=n){a++;continue}i[e]=this._truncateToSize(t),o++}let s={context:e.context};return o>0&&(s.attributes=i),a>0&&(s.droppedAttributesCount=a),this.links.push(s),this}addLinks(e){for(let t of e)this.addLink(t);return this}setStatus(e){if(this._isSpanEnded()||e.code===g.UNSET||this.status.code===g.OK)return this;let t={code:e.code};return e.code===g.ERROR&&(typeof e.message==`string`?t.message=e.message:e.message!=null&&_.warn(`Dropping invalid status.message of type '${typeof e.message}', expected 'string'`)),this.status=t,this}updateName(e){return this._isSpanEnded()||(this.name=e),this}end(e){if(this._isSpanEnded()){_.error(`${this.name} ${this._spanContext.traceId}-${this._spanContext.spanId} - You can only call end() on a span once.`);return}this.endTime=this._getTime(e),this._duration=dr(this.startTime,this.endTime),this._duration[0]<0&&(_.warn(`Inconsistent start and end time, startTime > endTime. Setting span duration to 0ms.`,this.startTime,this.endTime),this.endTime=this.startTime.slice(),this._duration=[0,0]),this._droppedEventsCount>0&&_.warn(`Dropped ${this._droppedEventsCount} events because eventCountLimit reached`),this._droppedLinksCount>0&&_.warn(`Dropped ${this._droppedLinksCount} links because linkCountLimit reached`),this._spanProcessor.onEnding&&this._spanProcessor.onEnding(this),this._recordEndMetrics?.(),this._ended=!0,this._spanProcessor.onEnd(this)}_getTime(e){if(typeof e==`number`&&e<=j.now())return ur(e+this._performanceOffset);if(typeof e==`number`)return M(e);if(e instanceof Date)return M(e.getTime());if(fr(e))return e;if(this._startTimeProvided)return M(Date.now());let t=j.now()-this._performanceStartTime;return mr(this.startTime,M(t))}isRecording(){return this._ended===!1}recordException(e,t){let n={};typeof e==`string`?n[rt]=e:e&&(e.code?n[at]=e.code.toString():e.name&&(n[at]=e.name),e.message&&(n[rt]=e.message),e.stack&&(n[it]=e.stack)),n[`exception.type`]||n[`exception.message`]?this.addEvent(di,n,t):_.warn(`Failed to record an exception ${e}`)}get duration(){return this._duration}get ended(){return this._ended}get droppedAttributesCount(){return this._droppedAttributesCount}get droppedEventsCount(){return this._droppedEventsCount}get droppedLinksCount(){return this._droppedLinksCount}_isSpanEnded(){if(this._ended){let e=Error(`Operation attempted on ended Span {traceId: ${this._spanContext.traceId}, spanId: ${this._spanContext.spanId}}`);_.warn(`Cannot execute the operation on ended Span {traceId: ${this._spanContext.traceId}, spanId: ${this._spanContext.spanId}}`,e)}return this._ended}_truncateToLimitUtil(e,t){return e.length<=t?e:e.substring(0,t)}_truncateToSize(e){let t=this._attributeValueLengthLimit;return t<=0?(_.warn(`Attribute value limit must be positive, got ${t}`),e):typeof e==`string`?this._truncateToLimitUtil(e,t):Array.isArray(e)?e.map(e=>typeof e==`string`?this._truncateToLimitUtil(e,t):e):e}},B;(function(e){e[e.NOT_RECORD=0]=`NOT_RECORD`,e[e.RECORD=1]=`RECORD`,e[e.RECORD_AND_SAMPLED=2]=`RECORD_AND_SAMPLED`})(B||={});var V=class{shouldSample(){return{decision:B.NOT_RECORD}}toString(){return`AlwaysOffSampler`}},H=class{shouldSample(){return{decision:B.RECORD_AND_SAMPLED}}toString(){return`AlwaysOnSampler`}},pi=class{_root;_remoteParentSampled;_remoteParentNotSampled;_localParentSampled;_localParentNotSampled;constructor(e){this._root=e.root,this._root||=(A(Error(`ParentBasedSampler must have a root sampler configured`)),new H),this._remoteParentSampled=e.remoteParentSampled??new H,this._remoteParentNotSampled=e.remoteParentNotSampled??new V,this._localParentSampled=e.localParentSampled??new H,this._localParentNotSampled=e.localParentNotSampled??new V}shouldSample(e,t,n,r,i,a){let o=v.getSpanContext(e);return!o||!ke(o)?this._root.shouldSample(e,t,n,r,i,a):o.isRemote?o.traceFlags&m.SAMPLED?this._remoteParentSampled.shouldSample(e,t,n,r,i,a):this._remoteParentNotSampled.shouldSample(e,t,n,r,i,a):o.traceFlags&m.SAMPLED?this._localParentSampled.shouldSample(e,t,n,r,i,a):this._localParentNotSampled.shouldSample(e,t,n,r,i,a)}toString(){return`ParentBased{root=${this._root.toString()}, remoteParentSampled=${this._remoteParentSampled.toString()}, remoteParentNotSampled=${this._remoteParentNotSampled.toString()}, localParentSampled=${this._localParentSampled.toString()}, localParentNotSampled=${this._localParentNotSampled.toString()}}`}},mi=class{_ratio;_upperBound;constructor(e=0){this._ratio=this._normalize(e),this._upperBound=Math.floor(this._ratio*4294967295)}shouldSample(e,t){return{decision:De(t)&&this._accumulate(t)<this._upperBound?B.RECORD_AND_SAMPLED:B.NOT_RECORD}}toString(){return`TraceIdRatioBased{${this._ratio}}`}_normalize(e){return typeof e!=`number`||isNaN(e)?0:e>=1?1:e<=0?0:e}_accumulate(e){let t=0;for(let n=0;n<e.length/8;n++){let r=n*8,i=parseInt(e.slice(r,r+8),16);t=(t^i)>>>0}return t}},U;(function(e){e.AlwaysOff=`always_off`,e.AlwaysOn=`always_on`,e.ParentBasedAlwaysOff=`parentbased_always_off`,e.ParentBasedAlwaysOn=`parentbased_always_on`,e.ParentBasedTraceIdRatio=`parentbased_traceidratio`,e.TraceIdRatio=`traceidratio`})(U||={});var hi=1;function gi(){return{sampler:_i(),forceFlushTimeoutMillis:3e4,generalLimits:{attributeValueLengthLimit:1/0,attributeCountLimit:128},spanLimits:{attributeValueLengthLimit:1/0,attributeCountLimit:128,linkCountLimit:128,eventCountLimit:128,attributePerEventCountLimit:128,attributePerLinkCountLimit:128}}}function _i(){let e=U.ParentBasedAlwaysOn;switch(e){case U.AlwaysOn:return new H;case U.AlwaysOff:return new V;case U.ParentBasedAlwaysOn:return new pi({root:new H});case U.ParentBasedAlwaysOff:return new pi({root:new V});case U.TraceIdRatio:return new mi(vi());case U.ParentBasedTraceIdRatio:return new pi({root:new mi(vi())});default:return _.error(`OTEL_TRACES_SAMPLER value "${e}" invalid, defaulting to "${U.ParentBasedAlwaysOn}".`),new pi({root:new H})}}function vi(){return _.error(`OTEL_TRACES_SAMPLER_ARG is blank, defaulting to ${hi}.`),hi}function yi(e){let t={sampler:_i()},n=gi(),r=Object.assign({},n,t,e);return r.generalLimits=Object.assign({},n.generalLimits,e.generalLimits||{}),r.spanLimits=Object.assign({},n.spanLimits,e.spanLimits||{}),r}function bi(e){let t=Object.assign({},e.spanLimits);return t.attributeCountLimit=e.spanLimits?.attributeCountLimit??e.generalLimits?.attributeCountLimit??void 0??void 0??128,t.attributeValueLengthLimit=e.spanLimits?.attributeValueLengthLimit??e.generalLimits?.attributeValueLengthLimit??void 0??void 0??1/0,Object.assign({},e,{spanLimits:t})}var xi=class{_maxExportBatchSize;_maxQueueSize;_scheduledDelayMillis;_exportTimeoutMillis;_exporter;_isExporting=!1;_finishedSpans=[];_timer;_shutdownOnce;_droppedSpansCount=0;constructor(e,t){this._exporter=e,this._maxExportBatchSize=typeof t?.maxExportBatchSize==`number`?t.maxExportBatchSize:512,this._maxQueueSize=typeof t?.maxQueueSize==`number`?t.maxQueueSize:2048,this._scheduledDelayMillis=typeof t?.scheduledDelayMillis==`number`?t.scheduledDelayMillis:5e3,this._exportTimeoutMillis=typeof t?.exportTimeoutMillis==`number`?t.exportTimeoutMillis:3e4,this._shutdownOnce=new ri(this._shutdown,this),this._maxExportBatchSize>this._maxQueueSize&&(_.warn(`BatchSpanProcessor: maxExportBatchSize must be smaller or equal to maxQueueSize, setting maxExportBatchSize to match maxQueueSize`),this._maxExportBatchSize=this._maxQueueSize)}forceFlush(){return this._shutdownOnce.isCalled?this._shutdownOnce.promise:this._flushAll()}onStart(e,t){}onEnd(e){this._shutdownOnce.isCalled||(e.spanContext().traceFlags&m.SAMPLED)!==0&&this._addToBuffer(e)}shutdown(){return this._shutdownOnce.call()}_shutdown(){return Promise.resolve().then(()=>this.onShutdown()).then(()=>this._flushAll()).then(()=>this._exporter.shutdown())}_addToBuffer(e){if(this._finishedSpans.length>=this._maxQueueSize){this._droppedSpansCount===0&&_.debug(`maxQueueSize reached, dropping spans`),this._droppedSpansCount++;return}this._droppedSpansCount>0&&(_.warn(`Dropped ${this._droppedSpansCount} spans because maxQueueSize reached`),this._droppedSpansCount=0),this._finishedSpans.push(e),this._maybeStartTimer()}_flushAll(){return new Promise((e,t)=>{let n=[],r=Math.ceil(this._finishedSpans.length/this._maxExportBatchSize);for(let e=0,t=r;e<t;e++)n.push(this._flushOneBatch());Promise.all(n).then(()=>{e()}).catch(t)})}_flushOneBatch(){return this._clearTimer(),this._finishedSpans.length===0?Promise.resolve():new Promise((e,t)=>{let n=setTimeout(()=>{t(Error(`Timeout`))},this._exportTimeoutMillis);o.with(Hn(o.active()),()=>{let r;this._finishedSpans.length<=this._maxExportBatchSize?(r=this._finishedSpans,this._finishedSpans=[]):r=this._finishedSpans.splice(0,this._maxExportBatchSize);let i=()=>this._exporter.export(r,r=>{clearTimeout(n),r.code===hr.SUCCESS?e():t(r.error??Error(`BatchSpanProcessor: span export failed`))}),a=null;for(let e=0,t=r.length;e<t;e++){let t=r[e];t.resource.asyncAttributesPending&&t.resource.waitForAsyncAttributes&&(a??=[],a.push(t.resource.waitForAsyncAttributes()))}a===null?i():Promise.all(a).then(i,e=>{A(e),t(e)})})})}_maybeStartTimer(){if(this._isExporting)return;let e=()=>{this._isExporting=!0,this._flushOneBatch().finally(()=>{this._isExporting=!1,this._finishedSpans.length>0&&(this._clearTimer(),this._maybeStartTimer())}).catch(e=>{this._isExporting=!1,A(e)})};if(this._finishedSpans.length>=this._maxExportBatchSize)return e();this._timer===void 0&&(this._timer=setTimeout(()=>e(),this._scheduledDelayMillis),typeof this._timer!=`number`&&this._timer.unref())}_clearTimer(){this._timer!==void 0&&(clearTimeout(this._timer),this._timer=void 0)}},Si=class extends xi{_visibilityChangeListener;_pageHideListener;constructor(e,t){super(e,t),this.onInit(t)}onInit(e){e?.disableAutoFlushOnDocumentHide!==!0&&typeof document<`u`&&(this._visibilityChangeListener=()=>{document.visibilityState===`hidden`&&this.forceFlush().catch(e=>{A(e)})},this._pageHideListener=()=>{this.forceFlush().catch(e=>{A(e)})},document.addEventListener(`visibilitychange`,this._visibilityChangeListener),document.addEventListener(`pagehide`,this._pageHideListener))}onShutdown(){typeof document<`u`&&(this._visibilityChangeListener&&document.removeEventListener(`visibilitychange`,this._visibilityChangeListener),this._pageHideListener&&document.removeEventListener(`pagehide`,this._pageHideListener))}},Ci=16,wi=8,Ti=new Uint8Array(Ci),Ei=new Uint8Array(wi),Di=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,`0`));function Oi(e){for(let t=0;t<e.length;t++)e[t]=Math.random()*256>>>0;for(let t=0;t<e.length;t++)if(e[t]>0)return;e[e.length-1]=1}function ki(e){let t=``;for(let n=0;n<e.length;n++)t+=Di[e[n]];return t}var Ai=class{generateTraceId(){return Oi(Ti),ki(Ti)}generateSpanId(){return Oi(Ei),ki(Ei)}},ji=`otel.span.parent.origin`,Mi=`otel.span.sampling_result`,Ni=`otel.sdk.span.live`,Pi=`otel.sdk.span.started`,Fi=class{startedSpans;liveSpans;constructor(e){this.startedSpans=e.createCounter(Pi,{unit:`{span}`,description:`The number of created spans.`}),this.liveSpans=e.createUpDownCounter(Ni,{unit:`{span}`,description:`The number of currently live spans.`})}startSpan(e,t){let n=Li(t);if(this.startedSpans.add(1,{[ji]:Ii(e),[Mi]:n}),t===B.NOT_RECORD)return()=>{};let r={[Mi]:n};return this.liveSpans.add(1,r),()=>{this.liveSpans.add(-1,r)}}};function Ii(e){return e?e.isRemote?`remote`:`local`:`none`}function Li(e){switch(e){case B.RECORD_AND_SAMPLED:return`RECORD_AND_SAMPLE`;case B.RECORD:return`RECORD_ONLY`;case B.NOT_RECORD:return`DROP`}}var Ri=`2.7.0`,zi=class{_sampler;_generalLimits;_spanLimits;_idGenerator;instrumentationScope;_resource;_spanProcessor;_tracerMetrics;constructor(e,t,n,r){let i=yi(t);this._sampler=i.sampler,this._generalLimits=i.generalLimits,this._spanLimits=i.spanLimits,this._idGenerator=t.idGenerator||new Ai,this._resource=n,this._spanProcessor=r,this.instrumentationScope=e,this._tracerMetrics=new Fi(i.meterProvider?i.meterProvider.getMeter(`@opentelemetry/sdk-trace`,Ri):ge())}startSpan(e,t={},n=o.active()){t.root&&(n=v.deleteSpan(n));let r=v.getSpan(n);if(Un(n))return _.debug(`Instrumentation suppressed, returning Noop Span`),v.wrapSpanContext(_e);let i=r?.spanContext(),a=this._idGenerator.generateSpanId(),s,c,l;!i||!v.isSpanContextValid(i)?c=this._idGenerator.generateTraceId():(c=i.traceId,l=i.traceState,s=i);let u=t.kind??ze.INTERNAL,d=(t.links??[]).map(e=>({context:e.context,attributes:k(e.attributes)})),f=k(t.attributes),p=this._sampler.shouldSample(n,c,e,u,f,d),ee=this._tracerMetrics.startSpan(i,p.decision);l=p.traceState??l;let te=p.decision===Re.RECORD_AND_SAMPLED?m.SAMPLED:m.NONE,ne={traceId:c,spanId:a,traceFlags:te,traceState:l};if(p.decision===Re.NOT_RECORD)return _.debug(`Recording is off, propagating context in a non-recording span`),v.wrapSpanContext(ne);let re=k(Object.assign(f,p.attributes));return new fi({resource:this._resource,scope:this.instrumentationScope,context:n,spanContext:ne,name:e,kind:u,links:d,parentSpanContext:s,attributes:re,startTime:t.startTime,spanProcessor:this._spanProcessor,spanLimits:this._spanLimits,recordEndMetrics:ee})}startActiveSpan(e,t,n,r){let i,a,s;if(arguments.length<2)return;arguments.length===2?s=t:arguments.length===3?(i=t,s=n):(i=t,a=n,s=r);let c=a??o.active(),l=this.startSpan(e,i,c),u=v.setSpan(c,l);return o.with(u,s,void 0,l)}getGeneralLimits(){return this._generalLimits}getSpanLimits(){return this._spanLimits}},Bi=class{_spanProcessors;constructor(e){this._spanProcessors=e}forceFlush(){let e=[];for(let t of this._spanProcessors)e.push(t.forceFlush());return new Promise(t=>{Promise.all(e).then(()=>{t()}).catch(e=>{A(e||Error(`MultiSpanProcessor: forceFlush failed`)),t()})})}onStart(e,t){for(let n of this._spanProcessors)n.onStart(e,t)}onEnding(e){for(let t of this._spanProcessors)t.onEnding&&t.onEnding(e)}onEnd(e){for(let t of this._spanProcessors)t.onEnd(e)}shutdown(){let e=[];for(let t of this._spanProcessors)e.push(t.shutdown());return new Promise((t,n)=>{Promise.all(e).then(()=>{t()},n)})}},W;(function(e){e[e.resolved=0]=`resolved`,e[e.timeout=1]=`timeout`,e[e.error=2]=`error`,e[e.unresolved=3]=`unresolved`})(W||={});var Vi=class{_config;_tracers=new Map;_resource;_activeSpanProcessor;constructor(e={}){let t=Xr({},gi(),bi(e));this._resource=t.resource??si(),this._config=Object.assign({},t,{resource:this._resource});let n=[];e.spanProcessors?.length&&n.push(...e.spanProcessors),this._activeSpanProcessor=new Bi(n)}getTracer(e,t,n){let r=`${e}@${t||``}:${n?.schemaUrl||``}`;return this._tracers.has(r)||this._tracers.set(r,new zi({name:e,version:t,schemaUrl:n?.schemaUrl},this._config,this._resource,this._activeSpanProcessor)),this._tracers.get(r)}forceFlush(){let e=this._config.forceFlushTimeoutMillis,t=this._activeSpanProcessor._spanProcessors.map(t=>new Promise(n=>{let r,i=setTimeout(()=>{n(Error(`Span processor did not completed within timeout period of ${e} ms`)),r=W.timeout},e);t.forceFlush().then(()=>{clearTimeout(i),r!==W.timeout&&(r=W.resolved,n(r))}).catch(e=>{clearTimeout(i),r=W.error,n(e)})}));return new Promise((e,n)=>{Promise.all(t).then(t=>{let r=t.filter(e=>e!==W.resolved);r.length>0?n(r):e()}).catch(e=>n([e]))})}shutdown(){return this._activeSpanProcessor.shutdown()}},Hi=class{_enabled=!1;_currentContext=i;_bindFunction(e=i,t){let n=this,r=function(...r){return n.with(e,()=>t.apply(this,r))};return Object.defineProperty(r,`length`,{enumerable:!1,configurable:!0,writable:!1,value:t.length}),r}active(){return this._currentContext}bind(e,t){return e===void 0&&(e=this.active()),typeof t==`function`?this._bindFunction(e,t):t}disable(){return this._currentContext=i,this._enabled=!1,this}enable(){return this._enabled?this:(this._enabled=!0,this._currentContext=i,this)}with(e,t,n,...r){let a=this._currentContext;this._currentContext=e||i;try{return t.call(n,...r)}finally{this._currentContext=a}}};function Ui(e){if(e!==null){if(e===void 0){let e=new Hi;e.enable(),o.setGlobalContextManager(e);return}e.enable(),o.setGlobalContextManager(e)}}function Wi(e){if(e!==null){if(e===void 0){u.setGlobalPropagator(new gr({propagators:[new Pr,new Yn]}));return}u.setGlobalPropagator(e)}}var Gi=class extends Vi{constructor(e={}){super(e)}register(e={}){v.setGlobalTracerProvider(this),Wi(e.propagator),Ui(e.contextManager)}},G;(function(e){e.CONNECT_END=`connectEnd`,e.CONNECT_START=`connectStart`,e.DECODED_BODY_SIZE=`decodedBodySize`,e.DOM_COMPLETE=`domComplete`,e.DOM_CONTENT_LOADED_EVENT_END=`domContentLoadedEventEnd`,e.DOM_CONTENT_LOADED_EVENT_START=`domContentLoadedEventStart`,e.DOM_INTERACTIVE=`domInteractive`,e.DOMAIN_LOOKUP_END=`domainLookupEnd`,e.DOMAIN_LOOKUP_START=`domainLookupStart`,e.ENCODED_BODY_SIZE=`encodedBodySize`,e.FETCH_START=`fetchStart`,e.LOAD_EVENT_END=`loadEventEnd`,e.LOAD_EVENT_START=`loadEventStart`,e.NAVIGATION_START=`navigationStart`,e.REDIRECT_END=`redirectEnd`,e.REDIRECT_START=`redirectStart`,e.REQUEST_START=`requestStart`,e.RESPONSE_END=`responseEnd`,e.RESPONSE_START=`responseStart`,e.SECURE_CONNECTION_START=`secureConnectionStart`,e.START_TIME=`startTime`,e.UNLOAD_EVENT_END=`unloadEventEnd`,e.UNLOAD_EVENT_START=`unloadEventStart`})(G||={});var Ki=`http.response_content_length`,qi=`http.response_content_length_uncompressed`;function K(e,t){return t in e}function q(e,t,n,r=!0){if(K(n,t)&&typeof n[t]==`number`&&!(r&&n[t]===0))return e.addEvent(t,n[t])}function Ji(e,t,n=!1,r,i){if(r===void 0&&(r=t[G.START_TIME]!==0),n||(q(e,G.FETCH_START,t,r),q(e,G.DOMAIN_LOOKUP_START,t,r),q(e,G.DOMAIN_LOOKUP_END,t,r),q(e,G.CONNECT_START,t,r),q(e,G.SECURE_CONNECTION_START,t,r),q(e,G.CONNECT_END,t,r),q(e,G.REQUEST_START,t,r),q(e,G.RESPONSE_START,t,r),q(e,G.RESPONSE_END,t,r)),!i){let n=t[G.ENCODED_BODY_SIZE];n!==void 0&&e.setAttribute(Ki,n);let r=t[G.DECODED_BODY_SIZE];r!==void 0&&n!==r&&e.setAttribute(qi,r)}}function Yi(e,t){if(e.nodeType===Node.DOCUMENT_NODE)return`/`;let n=Zi(e,t);if(t&&n.indexOf(`@id`)>0)return n;let r=``;return e.parentNode&&(r+=Yi(e.parentNode,t)),r+=n,r}function Xi(e){if(!e.parentNode)return 0;let t=[e.nodeType];e.nodeType===Node.CDATA_SECTION_NODE&&t.push(Node.TEXT_NODE);let n=Array.from(e.parentNode.childNodes);return n=n.filter(n=>{let r=n.localName;return t.indexOf(n.nodeType)>=0&&r===e.localName}),n.length>=1?n.indexOf(e)+1:0}function Zi(e,t){let n=e.nodeType,r=Xi(e),i=``;if(n===Node.ELEMENT_NODE){let n=e.getAttribute(`id`);if(t&&n)return`//*[@id="${n}"]`;i=e.localName}else if(n===Node.TEXT_NODE||n===Node.CDATA_SECTION_NODE)i=`text()`;else if(n===Node.COMMENT_NODE)i=`comment()`;else return``;return i&&r>1?`/${i}[${r}]`:`/${i}`}var Qi;(function(e){e.DOCUMENT_LOAD=`documentLoad`,e.DOCUMENT_FETCH=`documentFetch`,e.RESOURCE_FETCH=`resourceFetch`})(Qi||={});var $i=`0.49.0`,ea=`@opentelemetry/instrumentation-document-load`,ta;(function(e){e.FIRST_PAINT=`firstPaint`,e.FIRST_CONTENTFUL_PAINT=`firstContentfulPaint`})(ta||={});var na=()=>{let e={},t=j.getEntriesByType?.(`navigation`)[0];if(t)Object.values(G).forEach(n=>{if(K(t,n)){let r=t[n];typeof r==`number`&&(e[n]=r)}});else{let t=j.timing;t&&Object.values(G).forEach(n=>{if(K(t,n)){let r=t[n];typeof r==`number`&&(e[n]=r)}})}return e},ra={"first-paint":ta.FIRST_PAINT,"first-contentful-paint":ta.FIRST_CONTENTFUL_PAINT},ia=e=>{let t=j.getEntriesByType?.(`paint`);t&&t.forEach(({name:t,startTime:n})=>{K(ra,t)&&e.addEvent(ra[t],n)})},aa=class extends zn{component=`document-load`;version=`1`;moduleName=this.component;constructor(e={}){super(ea,$i,e)}init(){}_onDocumentLoaded(){window.setTimeout(()=>{this._collectPerformance()})}_addResourcesSpans(e){let t=j.getEntriesByType?.(`resource`);t&&t.forEach(t=>{this._initResourceSpan(t,e)})}_collectPerformance(){let e=Array.from(document.getElementsByTagName(`meta`)).find(e=>e.getAttribute(`name`)===N),t=na(),n=e&&e.content||``;o.with(u.extract(i,{traceparent:n}),()=>{let e=this._startSpan(Qi.DOCUMENT_LOAD,G.FETCH_START,t);e&&(o.with(v.setSpan(o.active(),e),()=>{let e=this._startSpan(Qi.DOCUMENT_FETCH,G.FETCH_START,t);e&&(e.setAttribute(et,location.href),o.with(v.setSpan(o.active(),e),()=>{Ji(e,t,this.getConfig().ignoreNetworkEvents),this._addCustomAttributesOnSpan(e,this.getConfig().applyCustomAttributesOnSpan?.documentFetch),this._endSpan(e,G.RESPONSE_END,t)}))}),e.setAttribute(et,location.href),e.setAttribute(tt,navigator.userAgent),this._addResourcesSpans(e),this.getConfig().ignoreNetworkEvents||(q(e,G.FETCH_START,t),q(e,G.UNLOAD_EVENT_START,t),q(e,G.UNLOAD_EVENT_END,t),q(e,G.DOM_INTERACTIVE,t),q(e,G.DOM_CONTENT_LOADED_EVENT_START,t),q(e,G.DOM_CONTENT_LOADED_EVENT_END,t),q(e,G.DOM_COMPLETE,t),q(e,G.LOAD_EVENT_START,t),q(e,G.LOAD_EVENT_END,t)),this.getConfig().ignorePerformancePaintEvents||ia(e),this._addCustomAttributesOnSpan(e,this.getConfig().applyCustomAttributesOnSpan?.documentLoad),this._endSpan(e,G.LOAD_EVENT_END,t))})}_endSpan(e,t,n){e&&(K(n,t)?e.end(n[t]):e.end())}_initResourceSpan(e,t){let n=this._startSpan(Qi.RESOURCE_FETCH,G.FETCH_START,e,t);n&&(n.setAttribute(et,e.name),Ji(n,e,this.getConfig().ignoreNetworkEvents),this._addCustomAttributesOnResourceSpan(n,e,this.getConfig().applyCustomAttributesOnSpan?.resourceFetch),this._endSpan(n,G.RESPONSE_END,e))}_startSpan(e,t,n,r){if(K(n,t)&&typeof n[t]==`number`)return this.tracer.startSpan(e,{startTime:n[t]},r?v.setSpan(o.active(),r):void 0)}_waitForPageLoad(){window.document.readyState===`complete`?this._onDocumentLoaded():(this._onDocumentLoaded=this._onDocumentLoaded.bind(this),window.addEventListener(`load`,this._onDocumentLoaded))}_addCustomAttributesOnSpan(e,t){t&&E(()=>t(e),e=>{e&&this._diag.error(`addCustomAttributesOnSpan`,e)},!0)}_addCustomAttributesOnResourceSpan(e,t,n){n&&E(()=>n(e,t),e=>{e&&this._diag.error(`addCustomAttributesOnResourceSpan`,e)},!0)}enable(){window.removeEventListener(`load`,this._onDocumentLoaded),this._waitForPageLoad()}disable(){window.removeEventListener(`load`,this._onDocumentLoaded)}},oa=typeof globalThis==`object`?globalThis:typeof self==`object`?self:typeof window==`object`?window:typeof global==`object`?global:{},sa=performance,ca=9,la=10**6,ua=10**ca;function J(e){let t=e/1e3;return[Math.trunc(t),Math.round(e%1e3*la)]}function da(){let e=sa.timeOrigin;if(typeof e!=`number`){let t=sa;e=t.timing&&t.timing.fetchStart}return e}function fa(e){return ma(J(da()),J(typeof e==`number`?e:sa.now()))}function Y(e){if(pa(e))return e;if(typeof e==`number`)return e<da()?fa(e):J(e);if(e instanceof Date)return J(e.getTime());throw TypeError(`Invalid input type`)}function X(e){return e[0]*ua+e[1]}function pa(e){return Array.isArray(e)&&e.length===2&&typeof e[0]==`number`&&typeof e[1]==`number`}function ma(e,t){let n=[e[0]+t[0],e[1]+t[1]];return n[1]>=ua&&(n[1]-=ua,n[0]+=1),n}function ha(e,t){return typeof t==`string`?e===t:!!e.match(t)}function ga(e,t){if(!t)return!1;for(let n of t)if(ha(e,n))return!0;return!1}var Z;(function(e){e.CONNECT_END=`connectEnd`,e.CONNECT_START=`connectStart`,e.DECODED_BODY_SIZE=`decodedBodySize`,e.DOM_COMPLETE=`domComplete`,e.DOM_CONTENT_LOADED_EVENT_END=`domContentLoadedEventEnd`,e.DOM_CONTENT_LOADED_EVENT_START=`domContentLoadedEventStart`,e.DOM_INTERACTIVE=`domInteractive`,e.DOMAIN_LOOKUP_END=`domainLookupEnd`,e.DOMAIN_LOOKUP_START=`domainLookupStart`,e.ENCODED_BODY_SIZE=`encodedBodySize`,e.FETCH_START=`fetchStart`,e.LOAD_EVENT_END=`loadEventEnd`,e.LOAD_EVENT_START=`loadEventStart`,e.NAVIGATION_START=`navigationStart`,e.REDIRECT_END=`redirectEnd`,e.REDIRECT_START=`redirectStart`,e.REQUEST_START=`requestStart`,e.RESPONSE_END=`responseEnd`,e.RESPONSE_START=`responseStart`,e.SECURE_CONNECTION_START=`secureConnectionStart`,e.START_TIME=`startTime`,e.UNLOAD_EVENT_END=`unloadEventEnd`,e.UNLOAD_EVENT_START=`unloadEventStart`})(Z||={});var _a=`http.response_content_length`,va=`http.response_content_length_uncompressed`,ya;function ba(){return ya||=document.createElement(`a`),ya}function xa(e,t){return t in e}function Q(e,t,n,r=!0){if(xa(n,t)&&typeof n[t]==`number`&&!(r&&n[t]===0))return e.addEvent(t,n[t])}function Sa(e,t,n=!1,r,i){if(r===void 0&&(r=t[Z.START_TIME]!==0),n||(Q(e,Z.FETCH_START,t,r),Q(e,Z.DOMAIN_LOOKUP_START,t,r),Q(e,Z.DOMAIN_LOOKUP_END,t,r),Q(e,Z.CONNECT_START,t,r),Q(e,Z.SECURE_CONNECTION_START,t,r),Q(e,Z.CONNECT_END,t,r),Q(e,Z.REQUEST_START,t,r),Q(e,Z.RESPONSE_START,t,r),Q(e,Z.RESPONSE_END,t,r)),!i){let n=t[Z.ENCODED_BODY_SIZE];n!==void 0&&e.setAttribute(_a,n);let r=t[Z.DECODED_BODY_SIZE];r!==void 0&&n!==r&&e.setAttribute(va,r)}}function Ca(e){return e.slice().sort((e,t)=>{let n=e[Z.FETCH_START],r=t[Z.FETCH_START];return n>r?1:n<r?-1:0})}function wa(){return typeof location<`u`?location.origin:void 0}function Ta(e,t,n,r,i=new WeakSet,a){let o=Oa(e);e=o.toString();let s=Da(e,t,n,r,i,a);if(s.length===0)return{mainRequest:void 0};if(s.length===1)return{mainRequest:s[0]};let c=Ca(s);if(o.origin!==wa()&&c.length>1){let e=c[0],t=Ea(c,e[Z.RESPONSE_END],n),r=e[Z.RESPONSE_END];return t[Z.FETCH_START]<r&&(t=e,e=void 0),{corsPreFlightRequest:e,mainRequest:t}}else return{mainRequest:s[0]}}function Ea(e,t,n){let r=X(n),i=X(Y(t)),a=e[1],o,s=e.length;for(let t=1;t<s;t++){let n=e[t],s=X(Y(n[Z.FETCH_START])),c=r-X(Y(n[Z.RESPONSE_END]));s>=i&&(!o||c<o)&&(o=c,a=n)}return a}function Da(e,t,n,r,i,a){let o=X(t),s=X(n),c=r.filter(t=>{let n=X(Y(t[Z.FETCH_START])),r=X(Y(t[Z.RESPONSE_END]));return t.initiatorType.toLowerCase()===(a||`xmlhttprequest`)&&t.name===e&&n>=o&&r<=s});return c.length>0&&(c=c.filter(e=>!i.has(e))),c}function Oa(e){if(typeof URL==`function`)return new URL(e,typeof document<`u`?document.baseURI:typeof location<`u`?location.href:void 0);let t=ba();return t.href=e,t}function ka(e,t){let n=t||[];return(typeof n==`string`||n instanceof RegExp)&&(n=[n]),Oa(e).origin===wa()?!0:n.some(t=>ha(e,t))}var Aa;(function(e){e.COMPONENT=`component`,e.HTTP_STATUS_TEXT=`http.status_text`})(Aa||={});var ja=`http.host`,Ma=`http.method`,Na=`http.request.body.size`,Pa=`http.request_content_length_uncompressed`,Fa=`http.scheme`,Ia=`http.status_code`,La=`http.url`,Ra=`http.user_agent`,za=_.createComponentLogger({namespace:`@opentelemetry/opentelemetry-instrumentation-fetch/utils`});function Ba(...e){if(e[0]instanceof URL||typeof e[0]==`string`){let t=e[1];if(!t?.body)return Promise.resolve();if(t.body instanceof ReadableStream){let{body:e,length:n}=Va(t.body);return t.body=e,n}else return Promise.resolve(Ua(t.body))}else{let t=e[0];return t?.body?t.clone().text().then(e=>Ga(e)):Promise.resolve()}}function Va(e){if(!e.pipeThrough)return za.warn(`Platform has ReadableStream but not pipeThrough!`),{body:e,length:Promise.resolve(void 0)};let t=0,n,r=new Promise(e=>{n=e}),i=new TransformStream({start(){},async transform(e,n){let r=await e;t+=r.byteLength,n.enqueue(e)},flush(){n(t)}});return{body:e.pipeThrough(i),length:r}}function Ha(e){return typeof Document<`u`&&e instanceof Document}function Ua(e){if(Ha(e))return new XMLSerializer().serializeToString(document).length;if(typeof e==`string`)return Ga(e);if(e instanceof Blob)return e.size;if(e instanceof FormData)return Ka(e);if(e instanceof URLSearchParams)return Ga(e.toString());if(e.byteLength!==void 0)return e.byteLength;za.warn(`unknown body type`)}var Wa=new TextEncoder;function Ga(e){return Wa.encode(e).byteLength}function Ka(e){let t=0;for(let[n,r]of e.entries())t+=n.length,r instanceof Blob?t+=r.size:t+=r.length;return t}function qa(e){let t=Xa(),n=e.toUpperCase();return n in t?n:`_OTHER`}var Ja={CONNECT:!0,DELETE:!0,GET:!0,HEAD:!0,OPTIONS:!0,PATCH:!0,POST:!0,PUT:!0,TRACE:!0},Ya;function Xa(){return Ya===void 0&&(Ya=Ja),Ya}var Za={"https:":`443`,"http:":`80`};function Qa(e){let t=Number(e.port||Za[e.protocol]);if(t&&!isNaN(t))return t}var $a=`0.204.0`,eo=300,to=typeof process==`object`&&process.release?.name===`node`,no=class extends zn{component=`fetch`;version=$a;moduleName=this.component;_usedResources=new WeakSet;_tasksCount=0;_semconvStability;constructor(e={}){super(`@opentelemetry/instrumentation-fetch`,$a,e),this._semconvStability=Bn(`http`,e?.semconvStabilityOptIn)}init(){}_addChildSpan(e,t){let n=this.tracer.startSpan(`CORS Preflight`,{startTime:t[Z.FETCH_START]},v.setSpan(o.active(),e)),r=!(this._semconvStability&O.OLD);Sa(n,t,this.getConfig().ignoreNetworkEvents,void 0,r),n.end(t[Z.RESPONSE_END])}_addFinalSpanAttributes(e,t){let n=Oa(t.url);if(this._semconvStability&O.OLD&&(e.setAttribute(Ia,t.status),t.statusText!=null&&e.setAttribute(Aa.HTTP_STATUS_TEXT,t.statusText),e.setAttribute(ja,n.host),e.setAttribute(Fa,n.protocol.replace(`:`,``)),typeof navigator<`u`&&e.setAttribute(Ra,navigator.userAgent)),this._semconvStability&O.STABLE){e.setAttribute(ct,t.status),e.setAttribute(lt,n.hostname);let r=Qa(n);r&&e.setAttribute(ut,r)}}_addHeaders(e,t){if(!ka(t,this.getConfig().propagateTraceHeaderCorsUrls)){let e={};u.inject(o.active(),e),Object.keys(e).length>0&&this._diag.debug(`headers inject skipped due to CORS policy`);return}if(e instanceof Request)u.inject(o.active(),e.headers,{set:(e,t,n)=>e.set(t,typeof n==`string`?n:String(n))});else if(e.headers instanceof Headers)u.inject(o.active(),e.headers,{set:(e,t,n)=>e.set(t,typeof n==`string`?n:String(n))});else if(e.headers instanceof Map)u.inject(o.active(),e.headers,{set:(e,t,n)=>e.set(t,typeof n==`string`?n:String(n))});else{let t={};u.inject(o.active(),t),e.headers=Object.assign({},t,e.headers||{})}}_clearResources(){this._tasksCount===0&&this.getConfig().clearTimingResources&&(performance.clearResourceTimings(),this._usedResources=new WeakSet)}_createSpan(e,t={}){if(ga(e,this.getConfig().ignoreUrls)){this._diag.debug(`ignoring span as url matches ignored url`);return}let n=``,r={};if(this._semconvStability&O.OLD){let i=(t.method||`GET`).toUpperCase();n=`HTTP ${i}`,r[Aa.COMPONENT]=this.moduleName,r[Ma]=i,r[La]=e}if(this._semconvStability&O.STABLE){let i=t.method,a=qa(t.method||`GET`);n||=a,r[ot]=a,a!==i&&(r[st]=i),r[_t]=e}return this.tracer.startSpan(n,{kind:ze.CLIENT,attributes:r})}_findResourceAndAddNetworkEvents(e,t,n){let r=t.entries;if(!r.length){if(!performance.getEntriesByType)return;r=performance.getEntriesByType(`resource`)}let i=Ta(t.spanUrl,t.startTime,n,r,this._usedResources,`fetch`);if(i.mainRequest){let t=i.mainRequest;this._markResourceAsUsed(t);let n=i.corsPreFlightRequest;n&&(this._addChildSpan(e,n),this._markResourceAsUsed(n));let r=!(this._semconvStability&O.OLD);Sa(e,t,this.getConfig().ignoreNetworkEvents,void 0,r)}}_markResourceAsUsed(e){this._usedResources.add(e)}_endSpan(e,t,n){let r=J(Date.now()),i=fa();this._addFinalSpanAttributes(e,n),this._semconvStability&O.STABLE&&n.status>=400&&(e.setStatus({code:g.ERROR}),e.setAttribute(nt,String(n.status))),setTimeout(()=>{t.observer?.disconnect(),this._findResourceAndAddNetworkEvents(e,t,i),this._tasksCount--,this._clearResources(),e.end(r)},eo)}_patchConstructor(){return e=>{let t=this;return function(...n){let r=this,i=Oa(n[0]instanceof Request?n[0].url:String(n[0])).href,a=n[0]instanceof Request?n[0]:n[1]||{},s=t._createSpan(i,a);if(!s)return e.apply(this,n);let c=t._prepareSpanData(i);t.getConfig().measureRequestSize&&Ba(...n).then(e=>{e&&(t._semconvStability&O.OLD&&s.setAttribute(Pa,e),t._semconvStability&O.STABLE&&s.setAttribute(Na,e))}).catch(e=>{t._diag.warn(`getFetchBodyLength`,e)});function l(e,n){t._applyAttributesAfterFetch(e,a,n),t._endSpan(e,c,{status:n.status||0,statusText:n.message,url:i})}function u(e,n){t._applyAttributesAfterFetch(e,a,n),n.status>=200&&n.status<400?t._endSpan(e,c,n):t._endSpan(e,c,{status:n.status,statusText:n.statusText,url:i})}function d(e,t,n){try{let t=n.clone().body;if(t){let r=t.getReader(),i=()=>{r.read().then(({done:t})=>{t?u(e,n):i()},t=>{l(e,t)})};i()}else u(e,n)}finally{t(n)}}function f(e,t,n){try{l(e,n)}finally{t(n)}}return new Promise((n,c)=>o.with(v.setSpan(o.active(),s),()=>(t._addHeaders(a,i),t._callRequestHook(s,a),t._tasksCount++,e.apply(r,a instanceof Request?[a]:[i,a]).then(d.bind(r,s,n),f.bind(r,s,c)))))}}}_applyAttributesAfterFetch(e,t,n){let r=this.getConfig().applyCustomAttributesOnSpan;r&&E(()=>r(e,t,n),e=>{e&&this._diag.error(`applyCustomAttributesOnSpan`,e)},!0)}_callRequestHook(e,t){let n=this.getConfig().requestHook;n&&E(()=>n(e,t),e=>{e&&this._diag.error(`requestHook`,e)},!0)}_prepareSpanData(e){let t=fa(),n=[];if(typeof PerformanceObserver!=`function`)return{entries:n,startTime:t,spanUrl:e};let r=new PerformanceObserver(t=>{t.getEntries().forEach(t=>{t.initiatorType===`fetch`&&t.name===e&&n.push(t)})});return r.observe({entryTypes:[`resource`]}),{entries:n,observer:r,startTime:t,spanUrl:e}}enable(){if(to){this._diag.warn(`this instrumentation is intended for web usage only, it does not instrument Node.js's fetch()`);return}D(fetch)&&(this._unwrap(oa,`fetch`),this._diag.debug(`removing previous patch for constructor`)),this._wrap(oa,`fetch`,this._patchConstructor())}disable(){to||(this._unwrap(oa,`fetch`),this._usedResources=new WeakSet)}},$;(function(e){e.EVENT_TYPE=`event_type`,e.TARGET_ELEMENT=`target_element`,e.TARGET_XPATH=`target_xpath`,e.HTTP_URL=`http.url`})($||={});var ro=`0.49.0`,io=`@opentelemetry/instrumentation-user-interaction`,ao=`OT_ZONE_CONTEXT`,oo=`Navigation:`,so=[`click`];function co(){return!1}var lo=class extends zn{version=ro;moduleName=`user-interaction`;_spansData=new WeakMap;_wrappedListeners=new WeakMap;_eventsSpanMap=new WeakMap;_eventNames;_shouldPreventSpanCreation;constructor(e={}){super(io,ro,e),this._eventNames=new Set(e?.eventNames??so),this._shouldPreventSpanCreation=typeof e?.shouldPreventSpanCreation==`function`?e.shouldPreventSpanCreation:co}init(){}_checkForTimeout(e,t){let n=this._spansData.get(t);n&&(e.source===`setTimeout`?n.hrTimeLastTimeout=ur():e.source!==`Promise.then`&&e.source!==`setTimeout`&&(n.hrTimeLastTimeout=void 0))}_allowEventName(e){return this._eventNames.has(e)}_createSpan(e,t,n){if(!(e instanceof HTMLElement)||!e.getAttribute||e.hasAttribute(`disabled`)||!this._allowEventName(t))return;let r=Yi(e,!0);try{let i=this.tracer.startSpan(t,{attributes:{[$.EVENT_TYPE]:t,[$.TARGET_ELEMENT]:e.tagName,[$.TARGET_XPATH]:r,[$.HTTP_URL]:window.location.href}},n?v.setSpan(o.active(),n):void 0);return this._shouldPreventSpanCreation(t,e,i)===!0?void 0:(this._spansData.set(i,{taskCount:0}),i)}catch(e){this._diag.error(`failed to start create new user interaction span`,e)}}_decrementTask(e){let t=this._spansData.get(e);t&&(t.taskCount--,t.taskCount===0&&this._tryToEndSpan(e,t.hrTimeLastTimeout))}_getCurrentSpan(e){let t=e.get(ao);return t&&v.getSpan(t)}_incrementTask(e){let t=this._spansData.get(e);t&&t.taskCount++}addPatchedListener(e,t,n,r){let i=this._wrappedListeners.get(n);i||(i=new Map,this._wrappedListeners.set(n,i));let a=i.get(t);return a||(a=new Map,i.set(t,a)),a.has(e)?!1:(a.set(e,r),!0)}removePatchedListener(e,t,n){let r=this._wrappedListeners.get(n);if(!r)return;let i=r.get(t);if(!i)return;let a=i.get(e);return a&&(i.delete(e),i.size===0&&(r.delete(t),r.size===0&&this._wrappedListeners.delete(n))),a}_invokeListener(e,t,n){return typeof e==`function`?e.apply(t,n):e.handleEvent(n[0])}_patchAddEventListener(){let e=this;return t=>function(n,r,i){if(!r)return t.call(this,n,r,i);let a=i&&typeof i==`object`&&i.once,s=function(...t){let i,s=t[0],c=s?.target;s&&(i=e._eventsSpanMap.get(s)),a&&e.removePatchedListener(this,n,r);let l=e._createSpan(c,n,i);return l?(s&&e._eventsSpanMap.set(s,l),o.with(v.setSpan(o.active(),l),()=>{let n=e._invokeListener(r,this,t);return l.end(),n})):e._invokeListener(r,this,t)};if(e.addPatchedListener(this,n,r,s))return t.call(this,n,s,i)}}_patchRemoveEventListener(){let e=this;return t=>function(n,r,i){let a=e.removePatchedListener(this,n,r);return a?t.call(this,n,a,i):t.call(this,n,r,i)}}_getPatchableEventTargets(){return window.EventTarget?[EventTarget.prototype]:[Node.prototype,Window.prototype]}_patchHistoryApi(){this._unpatchHistoryApi(),this._wrap(history,`replaceState`,this._patchHistoryMethod()),this._wrap(history,`pushState`,this._patchHistoryMethod()),this._wrap(history,`back`,this._patchHistoryMethod()),this._wrap(history,`forward`,this._patchHistoryMethod()),this._wrap(history,`go`,this._patchHistoryMethod())}_patchHistoryMethod(){let e=this;return t=>function(...n){let r=`${location.pathname}${location.hash}${location.search}`,i=t.apply(this,n),a=`${location.pathname}${location.hash}${location.search}`;return r!==a&&e._updateInteractionName(a),i}}_unpatchHistoryApi(){D(history.replaceState)&&this._unwrap(history,`replaceState`),D(history.pushState)&&this._unwrap(history,`pushState`),D(history.back)&&this._unwrap(history,`back`),D(history.forward)&&this._unwrap(history,`forward`),D(history.go)&&this._unwrap(history,`go`)}_updateInteractionName(e){let t=v.getSpan(o.active());t&&typeof t.updateName==`function`&&t.updateName(`${oo} ${e}`)}_patchZoneCancelTask(){let e=this;return t=>function(n){let r=Zone.current,i=e._getCurrentSpan(r);return i&&e._shouldCountTask(n,r)&&e._decrementTask(i),t.call(this,n)}}_patchZoneScheduleTask(){let e=this;return t=>function(n){let r=Zone.current,i=e._getCurrentSpan(r);return i&&e._shouldCountTask(n,r)&&(e._incrementTask(i),e._checkForTimeout(n,i)),t.call(this,n)}}_patchZoneRunTask(){let e=this;return t=>function(n,r,i){let a=(Array.isArray(i)&&i[0]instanceof Event?i[0]:void 0)?.target,s,c=this;if(a){if(s=e._createSpan(a,n.eventName),s)return e._incrementTask(s),c.run(()=>{try{return o.with(v.setSpan(o.active(),s),()=>{let e=Zone.current;return n._zone=e,t.call(e,n,r,i)})}finally{e._decrementTask(s)}})}else s=e._getCurrentSpan(c);try{return t.call(c,n,r,i)}finally{s&&e._shouldCountTask(n,c)&&e._decrementTask(s)}}}_shouldCountTask(e,t){if(e._zone&&(t=e._zone),!t||!e.data||e.data.isPeriodic)return!1;let n=this._getCurrentSpan(t);return!n||!this._spansData.get(n)?!1:e.type===`macroTask`||e.type===`microTask`}_tryToEndSpan(e,t){e&&this._spansData.get(e)&&(e.end(t),this._spansData.delete(e))}enable(){let e=this._getZoneWithPrototype();this._diag.debug(`applying patch to`,this.moduleName,this.version,`zone:`,!!e),e?(D(e.prototype.runTask)&&(this._unwrap(e.prototype,`runTask`),this._diag.debug(`removing previous patch from method runTask`)),D(e.prototype.scheduleTask)&&(this._unwrap(e.prototype,`scheduleTask`),this._diag.debug(`removing previous patch from method scheduleTask`)),D(e.prototype.cancelTask)&&(this._unwrap(e.prototype,`cancelTask`),this._diag.debug(`removing previous patch from method cancelTask`)),this._zonePatched=!0,this._wrap(e.prototype,`runTask`,this._patchZoneRunTask()),this._wrap(e.prototype,`scheduleTask`,this._patchZoneScheduleTask()),this._wrap(e.prototype,`cancelTask`,this._patchZoneCancelTask())):(this._zonePatched=!1,this._getPatchableEventTargets().forEach(e=>{D(e.addEventListener)&&(this._unwrap(e,`addEventListener`),this._diag.debug(`removing previous patch from method addEventListener`)),D(e.removeEventListener)&&(this._unwrap(e,`removeEventListener`),this._diag.debug(`removing previous patch from method removeEventListener`)),this._wrap(e,`addEventListener`,this._patchAddEventListener()),this._wrap(e,`removeEventListener`,this._patchRemoveEventListener())})),this._patchHistoryApi()}disable(){let e=this._getZoneWithPrototype();this._diag.debug(`removing patch from`,this.moduleName,this.version,`zone:`,!!e),e&&this._zonePatched?(D(e.prototype.runTask)&&this._unwrap(e.prototype,`runTask`),D(e.prototype.scheduleTask)&&this._unwrap(e.prototype,`scheduleTask`),D(e.prototype.cancelTask)&&this._unwrap(e.prototype,`cancelTask`)):this._getPatchableEventTargets().forEach(e=>{D(e.addEventListener)&&this._unwrap(e,`addEventListener`),D(e.removeEventListener)&&this._unwrap(e,`removeEventListener`)}),this._unpatchHistoryApi()}_getZoneWithPrototype(){return window.Zone}},uo=`deployment.environment.name`,fo=!1;function po(){return{BASE_URL:`/`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1}?.VITE_OTEL_COLLECTOR_URL??`http://localhost:4318`}function mo(){if(fo)return;fo=!0;let e=null,t=!1;try{let n=po(),r={BASE_URL:`/`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1};e=new Gi({resource:oi({[dt]:`open-knowledge-app`,[ft]:r?.VITE_APP_VERSION??`dev`,[uo]:r?.MODE??`dev`}),spanProcessors:[new Si(new Sn({url:`${n}/v1/traces`}),{maxExportBatchSize:50,scheduledDelayMillis:2e3})]}),e.register(),t=!0,Nn({instrumentations:[new aa,new lo({eventNames:[`click`,`submit`]}),new no({propagateTraceHeaderCorsUrls:[/^https?:\/\/localhost(:\d+)?\/api\//,/^https?:\/\/127\.0\.0\.1(:\d+)?\/api\//,/^\/api\//],clearTimingResources:!0})]}),console.info(`[otel] frontend telemetry initialized — OTLP/HTTP → ${n}/v1/traces`)}catch(n){console.warn(`[otel] frontend telemetry init failed — continuing without`,n),t&&e&&e.shutdown().catch(()=>{}),fo=!1}}export{mo as install};
@@ -0,0 +1 @@
1
+ import{r as e}from"./chunk-DECur_0Z.js";import{C as t,S as n,T as r,_ as i,a,b as o,c as s,f as c,g as l,i as u,l as d,n as f,o as p,p as m,r as h,s as g,u as _,w as v,x as y,y as b}from"./button-D7O9FEkM.js";import{Bt as x,Gt as S,Ht as C,Jt as w,Kt as T,Rt as E,Ut as D,Vt as O,et as k,qt as A}from"./panel-jSlO39XJ.js";var j=y(`arrow-up-right`,[[`path`,{d:`M7 7h10v10`,key:`1tivn9`}],[`path`,{d:`M7 17 17 7`,key:`1vkiza`}]]),M=y(`circle-check`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),N=y(`globe`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20`,key:`13o1zl`}],[`path`,{d:`M2 12h20`,key:`9i4pu4`}]]),P=y(`triangle-alert`,[[`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`,key:`wmoenq`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),ee=e(t(),1),F=e(v(),1),I=r(),te=Object.freeze({position:`absolute`,border:0,width:1,height:1,padding:0,margin:-1,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,wordWrap:`normal`}),ne=`VisuallyHidden`,L=F.forwardRef((e,t)=>(0,I.jsx)(m.span,{...e,ref:t,style:{...te,...e.style}}));L.displayName=ne;var R=L;function z(e){let t=e+`CollectionProvider`,[n,r]=c(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=e=>{let{scope:t,children:n}=e,r=F.useRef(null),a=F.useRef(new Map).current;return(0,I.jsx)(i,{scope:t,itemMap:a,collectionRef:r,children:n})};o.displayName=t;let s=e+`CollectionSlot`,u=l(s),d=F.forwardRef((e,t)=>{let{scope:n,children:r}=e;return(0,I.jsx)(u,{ref:b(t,a(s,n).collectionRef),children:r})});d.displayName=s;let f=e+`CollectionItemSlot`,p=`data-radix-collection-item`,m=l(f),h=F.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=F.useRef(null),s=b(t,o),c=a(f,n);return F.useEffect(()=>(c.itemMap.set(o,{ref:o,...i}),()=>void c.itemMap.delete(o))),(0,I.jsx)(m,{[p]:``,ref:s,children:r})});h.displayName=f;function g(t){let n=a(e+`CollectionConsumer`,t);return F.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${p}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return[{Provider:o,Slot:d,ItemSlot:h},g,r]}var re=F.createContext(void 0);function B(e){let t=F.useContext(re);return e||t||`ltr`}function ie(e){let[t,n]=F.useState(void 0);return d(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{if(!Array.isArray(t)||!t.length)return;let r=t[0],i,a;if(`borderBoxSize`in r){let e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;i=t.inlineSize,a=t.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return t.observe(e,{box:`border-box`}),()=>t.unobserve(e)}else n(void 0)},[e]),t}var V=typeof document<`u`?F.useLayoutEffect:function(){};function H(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!H(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!H(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function ae(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function oe(e,t){let n=ae(e);return Math.round(t*n)/n}function U(e){let t=F.useRef(e);return V(()=>{t.current=e}),t}function se(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=F.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=F.useState(r);H(f,r)||p(r);let[m,h]=F.useState(null),[g,_]=F.useState(null),v=F.useCallback(e=>{e!==S.current&&(S.current=e,h(e))},[]),y=F.useCallback(e=>{e!==C.current&&(C.current=e,_(e))},[]),b=a||m,x=o||g,S=F.useRef(null),C=F.useRef(null),w=F.useRef(u),T=c!=null,E=U(c),D=U(i),k=U(l),A=F.useCallback(()=>{if(!S.current||!C.current)return;let e={placement:t,strategy:n,middleware:f};D.current&&(e.platform=D.current),O(S.current,C.current,e).then(e=>{let t={...e,isPositioned:k.current!==!1};j.current&&!H(w.current,t)&&(w.current=t,ee.flushSync(()=>{d(t)}))})},[f,t,n,D,k]);V(()=>{l===!1&&w.current.isPositioned&&(w.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let j=F.useRef(!1);V(()=>(j.current=!0,()=>{j.current=!1}),[]),V(()=>{if(b&&(S.current=b),x&&(C.current=x),b&&x){if(E.current)return E.current(b,x,A);A()}},[b,x,A,E,T]);let M=F.useMemo(()=>({reference:S,floating:C,setReference:v,setFloating:y}),[v,y]),N=F.useMemo(()=>({reference:b,floating:x}),[b,x]),P=F.useMemo(()=>{let e={position:n,left:0,top:0};if(!N.floating)return e;let t=oe(N.floating,u.x),r=oe(N.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...ae(N.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,N.floating,u.x,u.y]);return F.useMemo(()=>({...u,update:A,refs:M,elements:N,floatingStyles:P}),[u,A,M,N,P])}var ce=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:E({element:r.current,padding:i}).fn(n):r?E({element:r,padding:i}).fn(n):{}}}},le=(e,t)=>{let n=T(e);return{name:n.name,fn:n.fn,options:[e,t]}},ue=(e,t)=>{let n=A(e);return{name:n.name,fn:n.fn,options:[e,t]}},de=(e,t)=>({fn:S(e).fn,options:[e,t]}),fe=(e,t)=>{let n=C(e);return{name:n.name,fn:n.fn,options:[e,t]}},pe=(e,t)=>{let n=w(e);return{name:n.name,fn:n.fn,options:[e,t]}},me=(e,t)=>{let n=D(e);return{name:n.name,fn:n.fn,options:[e,t]}},he=(e,t)=>{let n=ce(e);return{name:n.name,fn:n.fn,options:[e,t]}},ge=`Arrow`,_e=F.forwardRef((e,t)=>{let{children:n,width:r=10,height:i=5,...a}=e;return(0,I.jsx)(m.svg,{...a,ref:t,width:r,height:i,viewBox:`0 0 30 10`,preserveAspectRatio:`none`,children:e.asChild?n:(0,I.jsx)(`polygon`,{points:`0,0 30,0 15,10`})})});_e.displayName=ge;var ve=_e,ye=`Popper`,[be,xe]=c(ye),[Se,Ce]=be(ye),we=e=>{let{__scopePopper:t,children:n}=e,[r,i]=F.useState(null);return(0,I.jsx)(Se,{scope:t,anchor:r,onAnchorChange:i,children:n})};we.displayName=ye;var Te=`PopperAnchor`,Ee=F.forwardRef((e,t)=>{let{__scopePopper:n,virtualRef:r,...i}=e,a=Ce(Te,n),o=F.useRef(null),s=b(t,o),c=F.useRef(null);return F.useEffect(()=>{let e=c.current;c.current=r?.current||o.current,e!==c.current&&a.onAnchorChange(c.current)}),r?null:(0,I.jsx)(m.div,{...i,ref:s})});Ee.displayName=Te;var W=`PopperContent`,[De,Oe]=be(W),ke=F.forwardRef((e,t)=>{let{__scopePopper:n,side:r=`bottom`,sideOffset:i=0,align:o=`center`,alignOffset:s=0,arrowPadding:c=0,avoidCollisions:l=!0,collisionBoundary:u=[],collisionPadding:f=0,sticky:p=`partial`,hideWhenDetached:h=!1,updatePositionStrategy:g=`optimized`,onPlaced:_,...v}=e,y=Ce(W,n),[S,C]=F.useState(null),w=b(t,e=>C(e)),[T,E]=F.useState(null),D=ie(T),O=D?.width??0,k=D?.height??0,A=r+(o===`center`?``:`-`+o),j=typeof f==`number`?f:{top:0,right:0,bottom:0,left:0,...f},M=Array.isArray(u)?u:[u],N=M.length>0,P={padding:j,boundary:M.filter(Ne),altBoundary:N},{refs:ee,floatingStyles:te,placement:ne,isPositioned:L,middlewareData:R}=se({strategy:`fixed`,placement:A,whileElementsMounted:(...e)=>x(...e,{animationFrame:g===`always`}),elements:{reference:y.anchor},middleware:[le({mainAxis:i+k,alignmentAxis:s}),l&&ue({mainAxis:!0,crossAxis:!1,limiter:p===`partial`?de():void 0,...P}),l&&fe({...P}),pe({...P,apply:({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--radix-popper-available-width`,`${n}px`),o.setProperty(`--radix-popper-available-height`,`${r}px`),o.setProperty(`--radix-popper-anchor-width`,`${i}px`),o.setProperty(`--radix-popper-anchor-height`,`${a}px`)}}),T&&he({element:T,padding:c}),Pe({arrowWidth:O,arrowHeight:k}),h&&me({strategy:`referenceHidden`,...P})]}),[z,re]=Fe(ne),B=a(_);d(()=>{L&&B?.()},[L,B]);let V=R.arrow?.x,H=R.arrow?.y,ae=R.arrow?.centerOffset!==0,[oe,U]=F.useState();return d(()=>{S&&U(window.getComputedStyle(S).zIndex)},[S]),(0,I.jsx)(`div`,{ref:ee.setFloating,"data-radix-popper-content-wrapper":``,style:{...te,transform:L?te.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:oe,"--radix-popper-transform-origin":[R.transformOrigin?.x,R.transformOrigin?.y].join(` `),...R.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,I.jsx)(De,{scope:n,placedSide:z,onArrowChange:E,arrowX:V,arrowY:H,shouldHideArrow:ae,children:(0,I.jsx)(m.div,{"data-side":z,"data-align":re,...v,ref:w,style:{...v.style,animation:L?void 0:`none`}})})})});ke.displayName=W;var Ae=`PopperArrow`,je={top:`bottom`,right:`left`,bottom:`top`,left:`right`},Me=F.forwardRef(function(e,t){let{__scopePopper:n,...r}=e,i=Oe(Ae,n),a=je[i.placedSide];return(0,I.jsx)(`span`,{ref:i.onArrowChange,style:{position:`absolute`,left:i.arrowX,top:i.arrowY,[a]:0,transformOrigin:{top:``,right:`0 0`,bottom:`center 0`,left:`100% 0`}[i.placedSide],transform:{top:`translateY(100%)`,right:`translateY(50%) rotate(90deg) translateX(-50%)`,bottom:`rotate(180deg)`,left:`translateY(50%) rotate(-90deg) translateX(50%)`}[i.placedSide],visibility:i.shouldHideArrow?`hidden`:void 0},children:(0,I.jsx)(ve,{...r,ref:t,style:{...r.style,display:`block`}})})});Me.displayName=Ae;function Ne(e){return e!==null}var Pe=e=>({name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=Fe(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}});function Fe(e){let[t,n=`center`]=e.split(`-`);return[t,n]}var Ie=we,Le=Ee,Re=ke,ze=Me,Be=`rovingFocusGroup.onEntryFocus`,Ve={bubbles:!1,cancelable:!0},G=`RovingFocusGroup`,[He,Ue,We]=z(G),[Ge,Ke]=c(G,[We]),[qe,Je]=Ge(G),Ye=F.forwardRef((e,t)=>(0,I.jsx)(He.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,I.jsx)(He.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,I.jsx)(Xe,{...e,ref:t})})}));Ye.displayName=G;var Xe=F.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:o,currentTabStopId:c,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:u,onEntryFocus:d,preventScrollOnEntryFocus:f=!1,...p}=e,h=F.useRef(null),g=b(t,h),v=B(o),[y,x]=s({prop:c,defaultProp:l??null,onChange:u,caller:G}),[S,C]=F.useState(!1),w=a(d),T=Ue(n),E=F.useRef(!1),[D,O]=F.useState(0);return F.useEffect(()=>{let e=h.current;if(e)return e.addEventListener(Be,w),()=>e.removeEventListener(Be,w)},[w]),(0,I.jsx)(qe,{scope:n,orientation:r,dir:v,loop:i,currentTabStopId:y,onItemFocus:F.useCallback(e=>x(e),[x]),onItemShiftTab:F.useCallback(()=>C(!0),[]),onFocusableItemAdd:F.useCallback(()=>O(e=>e+1),[]),onFocusableItemRemove:F.useCallback(()=>O(e=>e-1),[]),children:(0,I.jsx)(m.div,{tabIndex:S||D===0?-1:0,"data-orientation":r,...p,ref:g,style:{outline:`none`,...e.style},onMouseDown:_(e.onMouseDown,()=>{E.current=!0}),onFocus:_(e.onFocus,e=>{let t=!E.current;if(e.target===e.currentTarget&&t&&!S){let t=new CustomEvent(Be,Ve);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=T().filter(e=>e.focusable);nt([e.find(e=>e.active),e.find(e=>e.id===y),...e].filter(Boolean).map(e=>e.ref.current),f)}}E.current=!1}),onBlur:_(e.onBlur,()=>C(!1))})})}),Ze=`RovingFocusGroupItem`,Qe=F.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:a,children:o,...s}=e,c=p(),l=a||c,u=Je(Ze,n),d=u.currentTabStopId===l,f=Ue(n),{onFocusableItemAdd:h,onFocusableItemRemove:g,currentTabStopId:v}=u;return F.useEffect(()=>{if(r)return h(),()=>g()},[r,h,g]),(0,I.jsx)(He.ItemSlot,{scope:n,id:l,focusable:r,active:i,children:(0,I.jsx)(m.span,{tabIndex:d?0:-1,"data-orientation":u.orientation,...s,ref:t,onMouseDown:_(e.onMouseDown,e=>{r?u.onItemFocus(l):e.preventDefault()}),onFocus:_(e.onFocus,()=>u.onItemFocus(l)),onKeyDown:_(e.onKeyDown,e=>{if(e.key===`Tab`&&e.shiftKey){u.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let t=tt(e,u.orientation,u.dir);if(t!==void 0){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let n=f().filter(e=>e.focusable).map(e=>e.ref.current);if(t===`last`)n.reverse();else if(t===`prev`||t===`next`){t===`prev`&&n.reverse();let r=n.indexOf(e.currentTarget);n=u.loop?rt(n,r+1):n.slice(r+1)}setTimeout(()=>nt(n))}}),children:typeof o==`function`?o({isCurrentTabStop:d,hasTabStop:v!=null}):o})})});Qe.displayName=Ze;var $e={ArrowLeft:`prev`,ArrowUp:`prev`,ArrowRight:`next`,ArrowDown:`next`,PageUp:`first`,Home:`first`,PageDown:`last`,End:`last`};function et(e,t){return t===`rtl`?e===`ArrowLeft`?`ArrowRight`:e===`ArrowRight`?`ArrowLeft`:e:e}function tt(e,t,n){let r=et(e.key,n);if(!(t===`vertical`&&[`ArrowLeft`,`ArrowRight`].includes(r))&&!(t===`horizontal`&&[`ArrowUp`,`ArrowDown`].includes(r)))return $e[r]}function nt(e,t=!1){let n=document.activeElement;for(let r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function rt(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var it=Ye,at=Qe,ot=`Toggle`,st=F.forwardRef((e,t)=>{let{pressed:n,defaultPressed:r,onPressedChange:i,...a}=e,[o,c]=s({prop:n,onChange:i,defaultProp:r??!1,caller:ot});return(0,I.jsx)(m.button,{type:`button`,"aria-pressed":o,"data-state":o?`on`:`off`,"data-disabled":e.disabled?``:void 0,...a,ref:t,onClick:_(e.onClick,()=>{e.disabled||c(!o)})})});st.displayName=ot;var K=`ToggleGroup`,[ct,lt]=c(K,[Ke]),ut=Ke(),dt=F.forwardRef((e,t)=>{let{type:n,...r}=e;if(n===`single`)return(0,I.jsx)(mt,{...r,ref:t});if(n===`multiple`)return(0,I.jsx)(ht,{...r,ref:t});throw Error(`Missing prop \`type\` expected on \`${K}\``)});dt.displayName=K;var[ft,pt]=ct(K),mt=F.forwardRef((e,t)=>{let{value:n,defaultValue:r,onValueChange:i=()=>{},...a}=e,[o,c]=s({prop:n,defaultProp:r??``,onChange:i,caller:K});return(0,I.jsx)(ft,{scope:e.__scopeToggleGroup,type:`single`,value:F.useMemo(()=>o?[o]:[],[o]),onItemActivate:c,onItemDeactivate:F.useCallback(()=>c(``),[c]),children:(0,I.jsx)(vt,{...a,ref:t})})}),ht=F.forwardRef((e,t)=>{let{value:n,defaultValue:r,onValueChange:i=()=>{},...a}=e,[o,c]=s({prop:n,defaultProp:r??[],onChange:i,caller:K}),l=F.useCallback(e=>c((t=[])=>[...t,e]),[c]),u=F.useCallback(e=>c((t=[])=>t.filter(t=>t!==e)),[c]);return(0,I.jsx)(ft,{scope:e.__scopeToggleGroup,type:`multiple`,value:o,onItemActivate:l,onItemDeactivate:u,children:(0,I.jsx)(vt,{...a,ref:t})})});dt.displayName=K;var[gt,_t]=ct(K),vt=F.forwardRef((e,t)=>{let{__scopeToggleGroup:n,disabled:r=!1,rovingFocus:i=!0,orientation:a,dir:o,loop:s=!0,...c}=e,l=ut(n),u=B(o),d={role:`group`,dir:u,...c};return(0,I.jsx)(gt,{scope:n,rovingFocus:i,disabled:r,children:i?(0,I.jsx)(it,{asChild:!0,...l,orientation:a,dir:u,loop:s,children:(0,I.jsx)(m.div,{...d,ref:t})}):(0,I.jsx)(m.div,{...d,ref:t})})}),q=`ToggleGroupItem`,yt=F.forwardRef((e,t)=>{let n=pt(q,e.__scopeToggleGroup),r=_t(q,e.__scopeToggleGroup),i=ut(e.__scopeToggleGroup),a=n.value.includes(e.value),o=r.disabled||e.disabled,s={...e,pressed:a,disabled:o},c=F.useRef(null);return r.rovingFocus?(0,I.jsx)(at,{asChild:!0,...i,focusable:!o,active:a,ref:c,children:(0,I.jsx)(bt,{...s,ref:t})}):(0,I.jsx)(bt,{...s,ref:t})});yt.displayName=q;var bt=F.forwardRef((e,t)=>{let{__scopeToggleGroup:n,value:r,...i}=e,a=pt(q,n),o={role:`radio`,"aria-checked":e.pressed,"aria-pressed":void 0};return(0,I.jsx)(st,{...a.type===`single`?o:void 0,...i,ref:t,onPressedChange:e=>{e?a.onItemActivate(r):a.onItemDeactivate(r)}})}),xt=dt,St=yt,[J,Ct]=c(`Tooltip`,[xe]),Y=xe(),wt=`TooltipProvider`,Tt=700,Et=`tooltip.open`,[Dt,Ot]=J(wt),kt=e=>{let{__scopeTooltip:t,delayDuration:n=Tt,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:a}=e,o=F.useRef(!0),s=F.useRef(!1),c=F.useRef(0);return F.useEffect(()=>{let e=c.current;return()=>window.clearTimeout(e)},[]),(0,I.jsx)(Dt,{scope:t,isOpenDelayedRef:o,delayDuration:n,onOpen:F.useCallback(()=>{window.clearTimeout(c.current),o.current=!1},[]),onClose:F.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.current=!0,r)},[r]),isPointerInTransitRef:s,onPointerInTransitChange:F.useCallback(e=>{s.current=e},[]),disableHoverableContent:i,children:a})};kt.displayName=wt;var X=`Tooltip`,[At,Z]=J(X),jt=e=>{let{__scopeTooltip:t,children:n,open:r,defaultOpen:i,onOpenChange:a,disableHoverableContent:o,delayDuration:c}=e,l=Ot(X,e.__scopeTooltip),u=Y(t),[d,f]=F.useState(null),m=p(),h=F.useRef(0),g=o??l.disableHoverableContent,_=c??l.delayDuration,v=F.useRef(!1),[y,b]=s({prop:r,defaultProp:i??!1,onChange:e=>{e?(l.onOpen(),document.dispatchEvent(new CustomEvent(Et))):l.onClose(),a?.(e)},caller:X}),x=F.useMemo(()=>y?v.current?`delayed-open`:`instant-open`:`closed`,[y]),S=F.useCallback(()=>{window.clearTimeout(h.current),h.current=0,v.current=!1,b(!0)},[b]),C=F.useCallback(()=>{window.clearTimeout(h.current),h.current=0,b(!1)},[b]),w=F.useCallback(()=>{window.clearTimeout(h.current),h.current=window.setTimeout(()=>{v.current=!0,b(!0),h.current=0},_)},[_,b]);return F.useEffect(()=>()=>{h.current&&=(window.clearTimeout(h.current),0)},[]),(0,I.jsx)(Ie,{...u,children:(0,I.jsx)(At,{scope:t,contentId:m,open:y,stateAttribute:x,trigger:d,onTriggerChange:f,onTriggerEnter:F.useCallback(()=>{l.isOpenDelayedRef.current?w():S()},[l.isOpenDelayedRef,w,S]),onTriggerLeave:F.useCallback(()=>{g?C():(window.clearTimeout(h.current),h.current=0)},[C,g]),onOpen:S,onClose:C,disableHoverableContent:g,children:n})})};jt.displayName=X;var Mt=`TooltipTrigger`,Nt=F.forwardRef((e,t)=>{let{__scopeTooltip:n,...r}=e,i=Z(Mt,n),a=Ot(Mt,n),o=Y(n),s=b(t,F.useRef(null),i.onTriggerChange),c=F.useRef(!1),l=F.useRef(!1),u=F.useCallback(()=>c.current=!1,[]);return F.useEffect(()=>()=>document.removeEventListener(`pointerup`,u),[u]),(0,I.jsx)(Le,{asChild:!0,...o,children:(0,I.jsx)(m.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:s,onPointerMove:_(e.onPointerMove,e=>{e.pointerType!==`touch`&&!l.current&&!a.isPointerInTransitRef.current&&(i.onTriggerEnter(),l.current=!0)}),onPointerLeave:_(e.onPointerLeave,()=>{i.onTriggerLeave(),l.current=!1}),onPointerDown:_(e.onPointerDown,()=>{i.open&&i.onClose(),c.current=!0,document.addEventListener(`pointerup`,u,{once:!0})}),onFocus:_(e.onFocus,()=>{c.current||i.onOpen()}),onBlur:_(e.onBlur,i.onClose),onClick:_(e.onClick,i.onClose)})})});Nt.displayName=Mt;var Pt=`TooltipPortal`,[Ft,It]=J(Pt,{forceMount:void 0}),Lt=e=>{let{__scopeTooltip:t,forceMount:n,children:r,container:i}=e,a=Z(Pt,t);return(0,I.jsx)(Ft,{scope:t,forceMount:n,children:(0,I.jsx)(g,{present:n||a.open,children:(0,I.jsx)(h,{asChild:!0,container:i,children:r})})})};Lt.displayName=Pt;var Q=`TooltipContent`,Rt=F.forwardRef((e,t)=>{let n=It(Q,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i=`top`,...a}=e,o=Z(Q,e.__scopeTooltip);return(0,I.jsx)(g,{present:r||o.open,children:o.disableHoverableContent?(0,I.jsx)(Ut,{side:i,...a,ref:t}):(0,I.jsx)(zt,{side:i,...a,ref:t})})}),zt=F.forwardRef((e,t)=>{let n=Z(Q,e.__scopeTooltip),r=Ot(Q,e.__scopeTooltip),i=F.useRef(null),a=b(t,i),[o,s]=F.useState(null),{trigger:c,onClose:l}=n,u=i.current,{onPointerInTransitChange:d}=r,f=F.useCallback(()=>{s(null),d(!1)},[d]),p=F.useCallback((e,t)=>{let n=e.currentTarget,r={x:e.clientX,y:e.clientY},i=qt(r,Kt(r,n.getBoundingClientRect())),a=Jt(t.getBoundingClientRect());s(Xt([...i,...a])),d(!0)},[d]);return F.useEffect(()=>()=>f(),[f]),F.useEffect(()=>{if(c&&u){let e=e=>p(e,u),t=e=>p(e,c);return c.addEventListener(`pointerleave`,e),u.addEventListener(`pointerleave`,t),()=>{c.removeEventListener(`pointerleave`,e),u.removeEventListener(`pointerleave`,t)}}},[c,u,p,f]),F.useEffect(()=>{if(o){let e=e=>{let t=e.target,n={x:e.clientX,y:e.clientY},r=c?.contains(t)||u?.contains(t),i=!Yt(n,o);r?f():i&&(f(),l())};return document.addEventListener(`pointermove`,e),()=>document.removeEventListener(`pointermove`,e)}},[c,u,o,l,f]),(0,I.jsx)(Ut,{...e,ref:a})}),[Bt,Vt]=J(X,{isInside:!1}),Ht=i(`TooltipContent`),Ut=F.forwardRef((e,t)=>{let{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:a,onPointerDownOutside:o,...s}=e,c=Z(Q,n),l=Y(n),{onClose:d}=c;return F.useEffect(()=>(document.addEventListener(Et,d),()=>document.removeEventListener(Et,d)),[d]),F.useEffect(()=>{if(c.trigger){let e=e=>{e.target?.contains(c.trigger)&&d()};return window.addEventListener(`scroll`,e,{capture:!0}),()=>window.removeEventListener(`scroll`,e,{capture:!0})}},[c.trigger,d]),(0,I.jsx)(u,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:e=>e.preventDefault(),onDismiss:d,children:(0,I.jsxs)(Re,{"data-state":c.stateAttribute,...l,...s,ref:t,style:{...s.style,"--radix-tooltip-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-tooltip-content-available-width":`var(--radix-popper-available-width)`,"--radix-tooltip-content-available-height":`var(--radix-popper-available-height)`,"--radix-tooltip-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-tooltip-trigger-height":`var(--radix-popper-anchor-height)`},children:[(0,I.jsx)(Ht,{children:r}),(0,I.jsx)(Bt,{scope:n,isInside:!0,children:(0,I.jsx)(R,{id:c.contentId,role:`tooltip`,children:i||r})})]})})});Rt.displayName=Q;var Wt=`TooltipArrow`,Gt=F.forwardRef((e,t)=>{let{__scopeTooltip:n,...r}=e,i=Y(n);return Vt(Wt,n).isInside?null:(0,I.jsx)(ze,{...i,...r,ref:t})});Gt.displayName=Wt;function Kt(e,t){let n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,i,a)){case a:return`left`;case i:return`right`;case n:return`top`;case r:return`bottom`;default:throw Error(`unreachable`)}}function qt(e,t,n=5){let r=[];switch(t){case`top`:r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case`bottom`:r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case`left`:r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case`right`:r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function Jt(e){let{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}function Yt(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}function Xt(e){let t=e.slice();return t.sort((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:+(e.y>t.y)),Zt(t)}function Zt(e){if(e.length<=1)return e.slice();let t=[];for(let n=0;n<e.length;n++){let r=e[n];for(;t.length>=2;){let e=t[t.length-1],n=t[t.length-2];if((e.x-n.x)*(r.y-n.y)>=(e.y-n.y)*(r.x-n.x))t.pop();else break}t.push(r)}t.pop();let n=[];for(let t=e.length-1;t>=0;t--){let r=e[t];for(;n.length>=2;){let e=n[n.length-1],t=n[n.length-2];if((e.x-t.x)*(r.y-t.y)>=(e.y-t.y)*(r.x-t.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var Qt=kt,$t=jt,en=Nt,tn=Lt,nn=Rt,rn=Gt,$=n();function an(e){let t=(0,$.c)(6),n,r;t[0]===e?(n=t[1],r=t[2]):({delayDuration:r,...n}=e,t[0]=e,t[1]=n,t[2]=r);let i=r===void 0?0:r,a;return t[3]!==i||t[4]!==n?(a=(0,I.jsx)(Qt,{"data-slot":`tooltip-provider`,delayDuration:i,...n}),t[3]=i,t[4]=n,t[5]=a):a=t[5],a}function on(e){let t=(0,$.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,I.jsx)($t,{"data-slot":`tooltip`,...n}),t[2]=n,t[3]=r),r}function sn(e){let t=(0,$.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,I.jsx)(en,{"data-slot":`tooltip-trigger`,...n}),t[2]=n,t[3]=r),r}function cn(e){let t=(0,$.c)(13),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:r,sideOffset:a,children:n,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o=a===void 0?0:a,s;t[5]===r?s=t[6]:(s=f(`z-50 inline-flex w-fit max-w-xs origin-(--radix-tooltip-content-transform-origin) items-center gap-1.5 rounded-md bg-foreground px-3 py-1.5 text-xs text-background has-data-[slot=kbd]:pr-1.5 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 **:data-[slot=kbd]:relative **:data-[slot=kbd]:isolate **:data-[slot=kbd]:z-50 **:data-[slot=kbd]:rounded-sm data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,r),t[5]=r,t[6]=s);let c;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,I.jsx)(rn,{className:`z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground`}),t[7]=c):c=t[7];let l;return t[8]!==n||t[9]!==i||t[10]!==o||t[11]!==s?(l=(0,I.jsx)(tn,{children:(0,I.jsxs)(nn,{"data-slot":`tooltip-content`,sideOffset:o,className:s,...i,children:[n,c]})}),t[8]=n,t[9]=i,t[10]=o,t[11]=s,t[12]=l):l=t[12],l}function ln(e){switch(e.kind){case`doc`:return`doc`;case`folder`:case`folder-index`:return`folder`;case`missing`:return`missing`}}function un(e,t){let n=k(e,t);return{resolvedTarget:n,hashDocName:n.target,displayState:ln(n)}}var dn=o(`group/toggle inline-flex items-center justify-center gap-1 rounded-lg text-sm font-medium whitespace-nowrap transition-all outline-none hover:bg-muted hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 aria-pressed:bg-muted data-[state=on]:bg-muted dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,{variants:{variant:{default:`bg-transparent`,outline:`border border-input bg-transparent hover:bg-muted`,segmented:`text-muted-foreground hover:bg-muted-foreground/10 data-[state=on]:bg-background data-[state=on]:shadow-sm data-[state=on]:text-foreground dark:data-[state=on]:bg-muted`},size:{default:`h-8 min-w-8 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`,sm:`h-7 min-w-7 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5`,lg:`h-9 min-w-9 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`}},defaultVariants:{variant:`default`,size:`default`}}),fn=F.createContext({size:`default`,variant:`default`,spacing:0,orientation:`horizontal`});function pn(e){let t=(0,$.c)(29),n,r,i,a,o,s,c;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6],c=t[7]):({className:r,variant:c,size:a,spacing:o,orientation:s,children:n,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=s,t[7]=c);let l=o===void 0?0:o,u=s===void 0?`horizontal`:s,d;t[8]===l?d=t[9]:(d={"--gap":l},t[8]=l,t[9]=d);let p=d,m;t[10]===r?m=t[11]:(m=f(`group/toggle-group flex w-fit flex-row items-center gap-[--spacing(var(--gap))] rounded-lg data-[size=sm]:rounded-[min(var(--radius-md),10px)] data-vertical:flex-col data-vertical:items-stretch`,r),t[10]=r,t[11]=m);let h;t[12]!==u||t[13]!==a||t[14]!==l||t[15]!==c?(h={variant:c,size:a,spacing:l,orientation:u},t[12]=u,t[13]=a,t[14]=l,t[15]=c,t[16]=h):h=t[16];let g;t[17]!==n||t[18]!==h?(g=(0,I.jsx)(fn.Provider,{value:h,children:n}),t[17]=n,t[18]=h,t[19]=g):g=t[19];let _;return t[20]!==u||t[21]!==i||t[22]!==a||t[23]!==l||t[24]!==p||t[25]!==m||t[26]!==g||t[27]!==c?(_=(0,I.jsx)(xt,{"data-slot":`toggle-group`,"data-variant":c,"data-size":a,"data-spacing":l,"data-orientation":u,style:p,className:m,...i,children:g}),t[20]=u,t[21]=i,t[22]=a,t[23]=l,t[24]=p,t[25]=m,t[26]=g,t[27]=c,t[28]=_):_=t[28],_}function mn(e){let t=(0,$.c)(19),n,r,i,a,o;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5]):({className:r,children:n,variant:a,size:o,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o);let s=a===void 0?`default`:a,c=o===void 0?`default`:o,l=F.use(fn),u=l.variant||s,d=l.size||c,p=l.spacing,m;t[6]!==r||t[7]!==l.size||t[8]!==l.variant||t[9]!==c||t[10]!==s?(m=f(`shrink-0 group-data-[spacing=0]/toggle-group:rounded-none group-data-[spacing=0]/toggle-group:px-2 focus:z-10 focus-visible:z-10 group-data-[spacing=0]/toggle-group:has-data-[icon=inline-end]:pr-1.5 group-data-[spacing=0]/toggle-group:has-data-[icon=inline-start]:pl-1.5 group-data-horizontal/toggle-group:data-[spacing=0]:first:rounded-l-lg group-data-vertical/toggle-group:data-[spacing=0]:first:rounded-t-lg group-data-horizontal/toggle-group:data-[spacing=0]:last:rounded-r-lg group-data-vertical/toggle-group:data-[spacing=0]:last:rounded-b-lg group-data-horizontal/toggle-group:data-[spacing=0]:data-[variant=outline]:border-l-0 group-data-vertical/toggle-group:data-[spacing=0]:data-[variant=outline]:border-t-0 group-data-horizontal/toggle-group:data-[spacing=0]:data-[variant=outline]:first:border-l group-data-vertical/toggle-group:data-[spacing=0]:data-[variant=outline]:first:border-t text-muted-foreground data-[state=on]:text-foreground`,dn({variant:l.variant||s,size:l.size||c}),r),t[6]=r,t[7]=l.size,t[8]=l.variant,t[9]=c,t[10]=s,t[11]=m):m=t[11];let h;return t[12]!==n||t[13]!==l.spacing||t[14]!==i||t[15]!==u||t[16]!==d||t[17]!==m?(h=(0,I.jsx)(St,{"data-slot":`toggle-group-item`,"data-variant":u,"data-size":d,"data-spacing":p,className:m,...i,children:n}),t[12]=n,t[13]=l.spacing,t[14]=i,t[15]=u,t[16]=d,t[17]=m,t[18]=h):h=t[18],h}export{j as S,B as _,cn as a,N as b,at as c,Le as d,ze as f,ie as g,xe as h,on as i,it as l,Ie as m,mn as n,an as o,Re as p,un as r,sn as s,pn as t,Ke as u,z as v,M as x,P as y};
@@ -20,17 +20,19 @@
20
20
  nothing for the formatter to reindent.
21
21
  -->
22
22
  <script>(() => { let mode = 'wysiwyg'; try { const raw = localStorage.getItem('ok-editor-mode-v1'); if (raw === 'wysiwyg' || raw === 'source') mode = raw; } catch {} window.__OK_EDITOR_MODE__ = mode; })();</script>
23
- <script type="module" crossorigin src="/assets/index-qVqYnv_K.js"></script>
24
- <link rel="modulepreload" crossorigin href="/assets/button-BuHZQnlF.js">
25
- <link rel="modulepreload" crossorigin href="/assets/w3c-keyname-DGDXsZN5.js">
26
- <link rel="modulepreload" crossorigin href="/assets/dist-1RA1Ivz5.js">
27
- <link rel="modulepreload" crossorigin href="/assets/dist-B90Tbt-G.js">
28
- <link rel="modulepreload" crossorigin href="/assets/panel-B3Oezbzt.js">
29
- <link rel="modulepreload" crossorigin href="/assets/dist-BJa-wTjR.js">
30
- <link rel="modulepreload" crossorigin href="/assets/dialog-XDohhbSr.js">
31
- <link rel="modulepreload" crossorigin href="/assets/clipboard-Bau-T9ly.js">
32
- <link rel="modulepreload" crossorigin href="/assets/toggle-group-DRnV5hAP.js">
33
- <link rel="stylesheet" crossorigin href="/assets/index-C7yqVgG5.css">
23
+ <script type="module" crossorigin src="/assets/index-B33JcCrk.js"></script>
24
+ <link rel="modulepreload" crossorigin href="/assets/chunk-DECur_0Z.js">
25
+ <link rel="modulepreload" crossorigin href="/assets/propagation-api-CQodqriD.js">
26
+ <link rel="modulepreload" crossorigin href="/assets/w3c-keyname-B56rf6AD.js">
27
+ <link rel="modulepreload" crossorigin href="/assets/dist-DRn8lLJe.js">
28
+ <link rel="modulepreload" crossorigin href="/assets/dist-BCB7v76S.js">
29
+ <link rel="modulepreload" crossorigin href="/assets/button-D7O9FEkM.js">
30
+ <link rel="modulepreload" crossorigin href="/assets/panel-jSlO39XJ.js">
31
+ <link rel="modulepreload" crossorigin href="/assets/dist-CDhLtkvx.js">
32
+ <link rel="modulepreload" crossorigin href="/assets/dialog-DzmWgC4p.js">
33
+ <link rel="modulepreload" crossorigin href="/assets/clipboard-B0g7jEdf.js">
34
+ <link rel="modulepreload" crossorigin href="/assets/toggle-group-D0c1wSh_.js">
35
+ <link rel="stylesheet" crossorigin href="/assets/index-Cj5uVVs3.css">
34
36
  </head>
35
37
 
36
38
  <body class="antialiased">
@@ -1,2 +1,2 @@
1
1
  import{closeSync as e,existsSync as t,mkdirSync as n,openSync as r,readFileSync as i,unlinkSync as a,writeFileSync as o,writeSync as s}from"node:fs";import{hostname as c}from"node:os";import{resolve as l}from"node:path";function u(e){try{return process.kill(e,0),!0}catch(e){return!!(e&&typeof e==`object`&&`code`in e&&e.code===`EPERM`)}}var d=class extends Error{existing;lockPath;lockName;constructor(e,t,n){super(`Open Knowledge ${n} already running on port ${e.port} (pid ${e.pid}, started ${e.startedAt}). Stop it first or use a different directory. Lock: ${t}`),this.name=`ProcessLockCollisionError`,this.existing=e,this.lockPath=t,this.lockName=n}};function f(e,t){return l(e,`${t}.lock`)}const p=new Map;function m(e){p.set(e,(p.get(e)??0)+1)}function h(e){let t=p.get(e);return t===void 0||t<=1?(p.delete(e),!0):(p.set(e,t-1),!1)}function g(e,t){try{let n=JSON.parse(i(e,`utf-8`));return n&&typeof n==`object`&&typeof n.pid==`number`?n:(console.warn(`${t} Corrupt lock file at ${e} — replacing`),null)}catch{return console.warn(`${t} Corrupt lock file at ${e} — replacing`),null}}function _(i){let{lockName:l,lockDir:p,metadata:h}=i,_=`[${l}-lock]`;n(p,{recursive:!0});let y=f(p,l),b={pid:process.pid,hostname:c(),port:h.port,startedAt:new Date().toISOString(),worktreeRoot:h.worktreeRoot},x=JSON.stringify(b,null,2);for(let n=0;n<3;n++){if(!t(y))try{let t=r(y,`wx`,384);try{s(t,x)}finally{e(t)}return m(y),v({lockName:l,lockDir:p,lockPath:y})}catch(e){if(e.code!==`EEXIST`)throw e}let n=g(y,_);if(n){let e=n.hostname===c();if(e&&n.pid===process.pid)return o(y,x,{encoding:`utf-8`,mode:384}),m(y),v({lockName:l,lockDir:p,lockPath:y});if(e&&u(n.pid))throw new d(n,y,l);console.warn(`${_} Stale lock detected (pid=${n.pid}, host=${n.hostname}) — replacing`)}try{a(y)}catch{}}throw Error(`${_} Failed to acquire ${y} after 3 attempts (concurrent acquire contention).`)}function v(e){let{lockName:t,lockDir:n,lockPath:r}=e;return{lockPath:r,release:()=>x({lockName:t,lockDir:n}),updatePort:e=>y({lockName:t,lockDir:n,port:e})}}function y(e){let{lockName:n,lockDir:r,port:a}=e,s=`[${n}-lock]`,l=f(r,n);if(!t(l)){console.warn(`${s} Lock file missing at ${l} during port update — skipping`);return}let u;try{let e=JSON.parse(i(l,`utf-8`));if(!e||typeof e!=`object`||typeof e.pid!=`number`){console.warn(`${s} Corrupt lock at ${l} during port update — skipping`);return}u=e}catch{console.warn(`${s} Unreadable lock at ${l} during port update — skipping`);return}if(u.pid===process.pid&&!(typeof u.hostname==`string`&&u.hostname!==c())){u.port=a;try{o(l,JSON.stringify(u,null,2),{encoding:`utf-8`,mode:384})}catch(e){console.warn(`${s} Failed to update port in ${l}: ${e instanceof Error?e.message:String(e)}`)}}}function b(e){let{lockName:n,lockDir:r}=e,o=f(r,n);if(!t(o))return null;let s;try{let e=JSON.parse(i(o,`utf-8`));if(!e||typeof e!=`object`||typeof e.pid!=`number`)return null;s=e}catch{return null}if(s.hostname!==c())return null;if(!u(s.pid)){try{a(o)}catch{}return null}return s}function x(e){let{lockName:n,lockDir:r}=e,o=`[${n}-lock]`,s=f(r,n);if(h(s)&&t(s))try{let e=JSON.parse(i(s,`utf-8`));if(!e||typeof e!=`object`||typeof e.pid!=`number`||e.pid!==process.pid||typeof e.hostname==`string`&&e.hostname!==c())return;a(s)}catch(e){console.warn(`${o} Failed to release ${s}: ${e instanceof Error?e.message:String(e)}`)}}var S=class extends d{constructor(e,t){super(e,t,`server`),this.name=`ServerLockCollisionError`}};function C(e,t){try{return _({lockName:`server`,lockDir:e,metadata:t}).lockPath}catch(e){throw e instanceof d&&e.lockName===`server`?new S(e.existing,e.lockPath):e}}function w(e,t){y({lockName:`server`,lockDir:e,port:t})}function T(e){return b({lockName:`server`,lockDir:e})}function E(e){x({lockName:`server`,lockDir:e})}export{w as a,f as c,y as d,u as f,E as i,b as l,C as n,d as o,T as r,_ as s,S as t,x as u};
2
- //# sourceMappingURL=server-lock-BI-SqMWk.mjs.map
2
+ //# sourceMappingURL=server-lock-4vgF5yho.mjs.map
@@ -0,0 +1 @@
1
+ import{a as e}from"./server-lock-4vgF5yho.mjs";export{e as updateServerLockPort};
@@ -1,4 +1,4 @@
1
- import{i as e,n as t,t as n}from"./chunk-tuRmWmEN.mjs";import r from"node:path";import i from"node:process";import{fileURLToPath as a}from"node:url";function o(e){return!e||typeof e!=`object`?``:`position`in e||`type`in e?c(e.position):`start`in e||`end`in e?c(e):`line`in e||`column`in e?s(e):``}function s(e){return l(e&&e.line)+`:`+l(e&&e.column)}function c(e){return s(e&&e.start)+`-`+s(e&&e.end)}function l(e){return e&&typeof e==`number`?e:1}var u=class extends Error{constructor(e,t,n){super(),typeof t==`string`&&(n=t,t=void 0);let r=``,i={},a=!1;if(t&&(i=`line`in t&&`column`in t||`start`in t&&`end`in t?{place:t}:`type`in t?{ancestors:[t],place:t.position}:{...t}),typeof e==`string`?r=e:!i.cause&&e&&(a=!0,r=e.message,i.cause=e),!i.ruleId&&!i.source&&typeof n==`string`){let e=n.indexOf(`:`);e===-1?i.ruleId=n:(i.source=n.slice(0,e),i.ruleId=n.slice(e+1))}if(!i.place&&i.ancestors&&i.ancestors){let e=i.ancestors[i.ancestors.length-1];e&&(i.place=e.position)}let s=i.place&&`start`in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=s?s.column:void 0,this.fatal=void 0,this.file=``,this.message=r,this.line=s?s.line:void 0,this.name=o(i.place)||`1:1`,this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=a&&i.cause&&typeof i.cause.stack==`string`?i.cause.stack:``,this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}};u.prototype.file=``,u.prototype.name=``,u.prototype.reason=``,u.prototype.message=``,u.prototype.stack=``,u.prototype.column=void 0,u.prototype.line=void 0,u.prototype.ancestors=void 0,u.prototype.cause=void 0,u.prototype.fatal=void 0,u.prototype.place=void 0,u.prototype.ruleId=void 0,u.prototype.source=void 0;const d=`__system__`,f=[`incoming`,`outgoing`,`both`];function p(e){return f.includes(e)}const m=`.open-knowledge`,h=[`image/jpeg`,`image/png`,`image/gif`,`image/webp`,`image/svg+xml`],g=new Set([`png`,`jpg`,`jpeg`,`gif`,`webp`,`svg`]);function _(e){this.content=e}_.prototype={constructor:_,find:function(e){for(var t=0;t<this.content.length;t+=2)if(this.content[t]===e)return t;return-1},get:function(e){var t=this.find(e);return t==-1?void 0:this.content[t+1]},update:function(e,t,n){var r=n&&n!=e?this.remove(n):this,i=r.find(e),a=r.content.slice();return i==-1?a.push(n||e,t):(a[i+1]=t,n&&(a[i]=n)),new _(a)},remove:function(e){var t=this.find(e);if(t==-1)return this;var n=this.content.slice();return n.splice(t,2),new _(n)},addToStart:function(e,t){return new _([e,t].concat(this.remove(e).content))},addToEnd:function(e,t){var n=this.remove(e).content.slice();return n.push(e,t),new _(n)},addBefore:function(e,t,n){var r=this.remove(t),i=r.content.slice(),a=r.find(e);return i.splice(a==-1?i.length:a,0,t,n),new _(i)},forEach:function(e){for(var t=0;t<this.content.length;t+=2)e(this.content[t],this.content[t+1])},prepend:function(e){return e=_.from(e),e.size?new _(e.content.concat(this.subtract(e).content)):this},append:function(e){return e=_.from(e),e.size?new _(this.subtract(e).content.concat(e.content)):this},subtract:function(e){var t=this;e=_.from(e);for(var n=0;n<e.content.length;n+=2)t=t.remove(e.content[n]);return t},toObject:function(){var e={};return this.forEach(function(t,n){e[t]=n}),e},get size(){return this.content.length>>1}},_.from=function(e){if(e instanceof _)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new _(t)};function v(e,t,n){for(let r=0;;r++){if(r==e.childCount||r==t.childCount)return e.childCount==t.childCount?null:n;let i=e.child(r),a=t.child(r);if(i==a){n+=i.nodeSize;continue}if(!i.sameMarkup(a))return n;if(i.isText&&i.text!=a.text){for(let e=0;i.text[e]==a.text[e];e++)n++;return n}if(i.content.size||a.content.size){let e=v(i.content,a.content,n+1);if(e!=null)return e}n+=i.nodeSize}}function y(e,t,n,r){for(let i=e.childCount,a=t.childCount;;){if(i==0||a==0)return i==a?null:{a:n,b:r};let o=e.child(--i),s=t.child(--a),c=o.nodeSize;if(o==s){n-=c,r-=c;continue}if(!o.sameMarkup(s))return{a:n,b:r};if(o.isText&&o.text!=s.text){let e=0,t=Math.min(o.text.length,s.text.length);for(;e<t&&o.text[o.text.length-e-1]==s.text[s.text.length-e-1];)e++,n--,r--;return{a:n,b:r}}if(o.content.size||s.content.size){let e=y(o.content,s.content,n-1,r-1);if(e)return e}n-=c,r-=c}}var b=class e{constructor(e,t){if(this.content=e,this.size=t||0,t==null)for(let t=0;t<e.length;t++)this.size+=e[t].nodeSize}nodesBetween(e,t,n,r=0,i){for(let a=0,o=0;o<t;a++){let s=this.content[a],c=o+s.nodeSize;if(c>e&&n(s,r+o,i||null,a)!==!1&&s.content.size){let i=o+1;s.nodesBetween(Math.max(0,e-i),Math.min(s.content.size,t-i),n,r+i)}o=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,n,r){let i=``,a=!0;return this.nodesBetween(e,t,(o,s)=>{let c=o.isText?o.text.slice(Math.max(e,s)-s,t-s):o.isLeaf?r?typeof r==`function`?r(o):r:o.type.spec.leafText?o.type.spec.leafText(o):``:``;o.isBlock&&(o.isLeaf&&c||o.isTextblock)&&n&&(a?a=!1:i+=n),i+=c},0),i}append(t){if(!t.size)return this;if(!this.size)return t;let n=this.lastChild,r=t.firstChild,i=this.content.slice(),a=0;for(n.isText&&n.sameMarkup(r)&&(i[i.length-1]=n.withText(n.text+r.text),a=1);a<t.content.length;a++)i.push(t.content[a]);return new e(i,this.size+t.size)}cut(t,n=this.size){if(t==0&&n==this.size)return this;let r=[],i=0;if(n>t)for(let e=0,a=0;a<n;e++){let o=this.content[e],s=a+o.nodeSize;s>t&&((a<t||s>n)&&(o=o.isText?o.cut(Math.max(0,t-a),Math.min(o.text.length,n-a)):o.cut(Math.max(0,t-a-1),Math.min(o.content.size,n-a-1))),r.push(o),i+=o.nodeSize),a=s}return new e(r,i)}cutByIndex(t,n){return t==n?e.empty:t==0&&n==this.content.length?this:new e(this.content.slice(t,n))}replaceChild(t,n){let r=this.content[t];if(r==n)return this;let i=this.content.slice(),a=this.size+n.nodeSize-r.nodeSize;return i[t]=n,new e(i,a)}addToStart(t){return new e([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new e(this.content.concat(t),this.size+t.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let t=this.content[e];if(!t)throw RangeError(`Index `+e+` out of range for `+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,n=0;t<this.content.length;t++){let r=this.content[t];e(r,n,t),n+=r.nodeSize}}findDiffStart(e,t=0){return v(this,e,t)}findDiffEnd(e,t=this.size,n=e.size){return y(this,e,t,n)}findIndex(e){if(e==0)return S(0,e);if(e==this.size)return S(this.content.length,e);if(e>this.size||e<0)throw RangeError(`Position ${e} outside of fragment (${this})`);for(let t=0,n=0;;t++){let r=this.child(t),i=n+r.nodeSize;if(i>=e)return i==e?S(t+1,i):S(t,n);n=i}}toString(){return`<`+this.toStringInner()+`>`}toStringInner(){return this.content.join(`, `)}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(t,n){if(!n)return e.empty;if(!Array.isArray(n))throw RangeError(`Invalid input for Fragment.fromJSON`);return new e(n.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return e.empty;let n,r=0;for(let e=0;e<t.length;e++){let i=t[e];r+=i.nodeSize,e&&i.isText&&t[e-1].sameMarkup(i)?(n||=t.slice(0,e),n[n.length-1]=i.withText(n[n.length-1].text+i.text)):n&&n.push(i)}return new e(n||t,r)}static from(t){if(!t)return e.empty;if(t instanceof e)return t;if(Array.isArray(t))return this.fromArray(t);if(t.attrs)return new e([t],t.nodeSize);throw RangeError(`Can not convert `+t+` to a Fragment`+(t.nodesBetween?` (looks like multiple versions of prosemirror-model were loaded)`:``))}};b.empty=new b([],0);const x={index:0,offset:0};function S(e,t){return x.index=e,x.offset=t,x}function C(e,t){if(e===t)return!0;if(!(e&&typeof e==`object`)||!(t&&typeof t==`object`))return!1;let n=Array.isArray(e);if(Array.isArray(t)!=n)return!1;if(n){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!C(e[n],t[n]))return!1}else{for(let n in e)if(!(n in t)||!C(e[n],t[n]))return!1;for(let n in t)if(!(n in e))return!1}return!0}var w=class e{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,n=!1;for(let r=0;r<e.length;r++){let i=e[r];if(this.eq(i))return e;if(this.type.excludes(i.type))t||=e.slice(0,r);else if(i.type.excludes(this.type))return e;else !n&&i.type.rank>this.type.rank&&(t||=e.slice(0,r),t.push(this),n=!0),t&&t.push(i)}return t||=e.slice(),n||t.push(this),t}removeFromSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e}isInSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1}eq(e){return this==e||this.type==e.type&&C(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,t){if(!t)throw RangeError(`Invalid input for Mark.fromJSON`);let n=e.marks[t.type];if(!n)throw RangeError(`There is no mark type ${t.type} in this schema`);let r=n.create(t.attrs);return n.checkAttrs(r.attrs),r}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].eq(t[n]))return!1;return!0}static setFrom(t){if(!t||Array.isArray(t)&&t.length==0)return e.none;if(t instanceof e)return[t];let n=t.slice();return n.sort((e,t)=>e.type.rank-t.type.rank),n}};w.none=[];var T=class extends Error{},E=class e{constructor(e,t,n){this.content=e,this.openStart=t,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(t,n){let r=O(this.content,t+this.openStart,n);return r&&new e(r,this.openStart,this.openEnd)}removeBetween(t,n){return new e(D(this.content,t+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+`(`+this.openStart+`,`+this.openEnd+`)`}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(t,n){if(!n)return e.empty;let r=n.openStart||0,i=n.openEnd||0;if(typeof r!=`number`||typeof i!=`number`)throw RangeError(`Invalid input for Slice.fromJSON`);return new e(b.fromJSON(t,n.content),r,i)}static maxOpen(t,n=!0){let r=0,i=0;for(let e=t.firstChild;e&&!e.isLeaf&&(n||!e.type.spec.isolating);e=e.firstChild)r++;for(let e=t.lastChild;e&&!e.isLeaf&&(n||!e.type.spec.isolating);e=e.lastChild)i++;return new e(t,r,i)}};E.empty=new E(b.empty,0,0);function D(e,t,n){let{index:r,offset:i}=e.findIndex(t),a=e.maybeChild(r),{index:o,offset:s}=e.findIndex(n);if(i==t||a.isText){if(s!=n&&!e.child(o).isText)throw RangeError(`Removing non-flat range`);return e.cut(0,t).append(e.cut(n))}if(r!=o)throw RangeError(`Removing non-flat range`);return e.replaceChild(r,a.copy(D(a.content,t-i-1,n-i-1)))}function O(e,t,n,r){let{index:i,offset:a}=e.findIndex(t),o=e.maybeChild(i);if(a==t||o.isText)return r&&!r.canReplace(i,i,n)?null:e.cut(0,t).append(n).append(e.cut(t));let s=O(o.content,t-a-1,n,o);return s&&e.replaceChild(i,o.copy(s))}function ee(e,t,n){if(n.openStart>e.depth)throw new T(`Inserted content deeper than insertion position`);if(e.depth-n.openStart!=t.depth-n.openEnd)throw new T(`Inconsistent open depths`);return te(e,t,n,0)}function te(e,t,n,r){let i=e.index(r),a=e.node(r);if(i==t.index(r)&&r<e.depth-n.openStart){let o=te(e,t,n,r+1);return a.copy(a.content.replaceChild(i,o))}else if(!n.content.size)return ie(a,oe(e,t,r));else if(!n.openStart&&!n.openEnd&&e.depth==r&&t.depth==r){let r=e.parent,i=r.content;return ie(r,i.cut(0,e.parentOffset).append(n.content).append(i.cut(t.parentOffset)))}else{let{start:i,end:o}=se(n,e);return ie(a,ae(e,i,o,t,r))}}function ne(e,t){if(!t.type.compatibleContent(e.type))throw new T(`Cannot join `+t.type.name+` onto `+e.type.name)}function re(e,t,n){let r=e.node(n);return ne(r,t.node(n)),r}function k(e,t){let n=t.length-1;n>=0&&e.isText&&e.sameMarkup(t[n])?t[n]=e.withText(t[n].text+e.text):t.push(e)}function A(e,t,n,r){let i=(t||e).node(n),a=0,o=t?t.index(n):i.childCount;e&&(a=e.index(n),e.depth>n?a++:e.textOffset&&(k(e.nodeAfter,r),a++));for(let e=a;e<o;e++)k(i.child(e),r);t&&t.depth==n&&t.textOffset&&k(t.nodeBefore,r)}function ie(e,t){return e.type.checkContent(t),e.copy(t)}function ae(e,t,n,r,i){let a=e.depth>i&&re(e,t,i+1),o=r.depth>i&&re(n,r,i+1),s=[];return A(null,e,i,s),a&&o&&t.index(i)==n.index(i)?(ne(a,o),k(ie(a,ae(e,t,n,r,i+1)),s)):(a&&k(ie(a,oe(e,t,i+1)),s),A(t,n,i,s),o&&k(ie(o,oe(n,r,i+1)),s)),A(r,null,i,s),new b(s)}function oe(e,t,n){let r=[];return A(null,e,n,r),e.depth>n&&k(ie(re(e,t,n+1),oe(e,t,n+1)),r),A(t,null,n,r),new b(r)}function se(e,t){let n=t.depth-e.openStart,r=t.node(n).copy(e.content);for(let e=n-1;e>=0;e--)r=t.node(e).copy(b.from(r));return{start:r.resolveNoCache(e.openStart+n),end:r.resolveNoCache(r.content.size-e.openEnd-n)}}var ce=class e{constructor(e,t,n){this.pos=e,this.path=t,this.parentOffset=n,this.depth=t.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw RangeError(`There is no position before the top-level node`);return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw RangeError(`There is no position after the top-level node`);return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let n=this.pos-this.path[this.path.length-1],r=e.child(t);return n?e.child(t).cut(n):r}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):e==0?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let n=this.path[t*3],r=t==0?0:this.path[t*3-1]+1;for(let t=0;t<e;t++)r+=n.child(t).nodeSize;return r}marks(){let e=this.parent,t=this.index();if(e.content.size==0)return w.none;if(this.textOffset)return e.child(t).marks;let n=e.maybeChild(t-1),r=e.maybeChild(t);if(!n){let e=n;n=r,r=e}let i=n.marks;for(var a=0;a<i.length;a++)i[a].type.spec.inclusive===!1&&(!r||!i[a].isInSet(r.marks))&&(i=i[a--].removeFromSet(i));return i}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let n=t.marks,r=e.parent.maybeChild(e.index());for(var i=0;i<n.length;i++)n[i].type.spec.inclusive===!1&&(!r||!n[i].isInSet(r.marks))&&(n=n[i--].removeFromSet(n));return n}sharedDepth(e){for(let t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos<this.pos)return e.blockRange(this);for(let n=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);n>=0;n--)if(e.pos<=this.end(n)&&(!t||t(this.node(n))))return new fe(this,e,n);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e=``;for(let t=1;t<=this.depth;t++)e+=(e?`/`:``)+this.node(t).type.name+`_`+this.index(t-1);return e+`:`+this.parentOffset}static resolve(t,n){if(!(n>=0&&n<=t.content.size))throw RangeError(`Position `+n+` out of range`);let r=[],i=0,a=n;for(let e=t;;){let{index:t,offset:n}=e.content.findIndex(a),o=a-n;if(r.push(e,t,i+n),!o||(e=e.child(t),e.isText))break;a=o-1,i+=n+1}return new e(n,r,a)}static resolveCached(t,n){let r=de.get(t);if(r)for(let e=0;e<r.elts.length;e++){let t=r.elts[e];if(t.pos==n)return t}else de.set(t,r=new le);let i=r.elts[r.i]=e.resolve(t,n);return r.i=(r.i+1)%ue,i}},le=class{constructor(){this.elts=[],this.i=0}};const ue=12,de=new WeakMap;var fe=class{constructor(e,t,n){this.$from=e,this.$to=t,this.depth=n}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}};const pe=Object.create(null);var me=class e{constructor(e,t,n,r=w.none){this.type=e,this.attrs=t,this.marks=r,this.content=n||b.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,t,n,r=0){this.content.nodesBetween(e,t,n,r,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,``)}textBetween(e,t,n,r){return this.content.textBetween(e,t,n,r)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,t,n){return this.type==e&&C(this.attrs,t||e.defaultAttrs||pe)&&w.sameSet(this.marks,n||w.none)}copy(t=null){return t==this.content?this:new e(this.type,this.attrs,t,this.marks)}mark(t){return t==this.marks?this:new e(this.type,this.attrs,this.content,t)}cut(e,t=this.content.size){return e==0&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,n=!1){if(e==t)return E.empty;let r=this.resolve(e),i=this.resolve(t),a=n?0:r.sharedDepth(t),o=r.start(a);return new E(r.node(a).content.cut(r.pos-o,i.pos-o),r.depth-a,i.depth-a)}replace(e,t,n){return ee(this.resolve(e),this.resolve(t),n)}nodeAt(e){for(let t=this;;){let{index:n,offset:r}=t.content.findIndex(e);if(t=t.maybeChild(n),!t)return null;if(r==e||t.isText)return t;e-=r+1}}childAfter(e){let{index:t,offset:n}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:n}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:t,offset:n}=this.content.findIndex(e);if(n<e)return{node:this.content.child(t),index:t,offset:n};let r=this.content.child(t-1);return{node:r,index:t-1,offset:n-r.nodeSize}}resolve(e){return ce.resolveCached(this,e)}resolveNoCache(e){return ce.resolve(this,e)}rangeHasMark(e,t,n){let r=!1;return t>e&&this.nodesBetween(e,t,e=>(n.isInSet(e.marks)&&(r=!0),!r)),r}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+=`(`+this.content.toStringInner()+`)`),ge(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw Error(`Called contentMatchAt on a node with invalid content`);return t}canReplace(e,t,n=b.empty,r=0,i=n.childCount){let a=this.contentMatchAt(e).matchFragment(n,r,i),o=a&&a.matchFragment(this.content,t);if(!o||!o.validEnd)return!1;for(let e=r;e<i;e++)if(!this.type.allowsMarks(n.child(e).marks))return!1;return!0}canReplaceWith(e,t,n,r){if(r&&!this.type.allowsMarks(r))return!1;let i=this.contentMatchAt(e).matchType(n),a=i&&i.matchFragment(this.content,t);return a?a.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=w.none;for(let t=0;t<this.marks.length;t++){let n=this.marks[t];n.type.checkAttrs(n.attrs),e=n.addToSet(e)}if(!w.sameSet(e,this.marks))throw RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(e=>e.type.name)}`);this.content.forEach(e=>e.check())}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(e=>e.toJSON())),e}static fromJSON(e,t){if(!t)throw RangeError(`Invalid input for Node.fromJSON`);let n;if(t.marks){if(!Array.isArray(t.marks))throw RangeError(`Invalid mark data for Node.fromJSON`);n=t.marks.map(e.markFromJSON)}if(t.type==`text`){if(typeof t.text!=`string`)throw RangeError(`Invalid text node in JSON`);return e.text(t.text,n)}let r=b.fromJSON(e,t.content),i=e.nodeType(t.type).create(t.attrs,r,n);return i.type.checkAttrs(i.attrs),i}};me.prototype.text=void 0;var he=class e extends me{constructor(e,t,n,r){if(super(e,t,null,r),!n)throw RangeError(`Empty text nodes are not allowed`);this.text=n}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):ge(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(t){return t==this.marks?this:new e(this.type,this.attrs,this.text,t)}withText(t){return t==this.text?this:new e(this.type,this.attrs,t,this.marks)}cut(e=0,t=this.text.length){return e==0&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}};function ge(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+`(`+t+`)`;return t}var _e=class e{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(t,n){let r=new ve(t,n);if(r.next==null)return e.empty;let i=ye(r);r.next&&r.err(`Unexpected trailing text`);let a=ke(Ee(i));return j(a,r),a}matchType(e){for(let t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}matchFragment(e,t=0,n=e.childCount){let r=this;for(let i=t;r&&i<n;i++)r=r.matchType(e.child(i).type);return r}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:t}=this.next[e];if(!(t.isText||t.hasRequiredAttrs()))return t}return null}compatible(e){for(let t=0;t<this.next.length;t++)for(let n=0;n<e.next.length;n++)if(this.next[t].type==e.next[n].type)return!0;return!1}fillBefore(e,t=!1,n=0){let r=[this];function i(a,o){let s=a.matchFragment(e,n);if(s&&(!t||s.validEnd))return b.from(o.map(e=>e.createAndFill()));for(let e=0;e<a.next.length;e++){let{type:t,next:n}=a.next[e];if(!(t.isText||t.hasRequiredAttrs())&&r.indexOf(n)==-1){r.push(n);let e=i(n,o.concat(t));if(e)return e}}return null}return i(this,[])}findWrapping(e){for(let t=0;t<this.wrapCache.length;t+=2)if(this.wrapCache[t]==e)return this.wrapCache[t+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),n=[{match:this,type:null,via:null}];for(;n.length;){let r=n.shift(),i=r.match;if(i.matchType(e)){let e=[];for(let t=r;t.type;t=t.via)e.push(t.type);return e.reverse()}for(let e=0;e<i.next.length;e++){let{type:a,next:o}=i.next[e];!a.isLeaf&&!a.hasRequiredAttrs()&&!(a.name in t)&&(!r.type||o.validEnd)&&(n.push({match:a.contentMatch,type:a,via:r}),t[a.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function t(n){e.push(n);for(let r=0;r<n.next.length;r++)e.indexOf(n.next[r].next)==-1&&t(n.next[r].next)}return t(this),e.map((t,n)=>{let r=n+(t.validEnd?`*`:` `)+` `;for(let n=0;n<t.next.length;n++)r+=(n?`, `:``)+t.next[n].type.name+`->`+e.indexOf(t.next[n].next);return r}).join(`
1
+ import{o as e,r as t,t as n}from"./chunk-FK9Q3tQk.mjs";import r from"node:path";import i from"node:process";import{fileURLToPath as a}from"node:url";function o(e){return!e||typeof e!=`object`?``:`position`in e||`type`in e?c(e.position):`start`in e||`end`in e?c(e):`line`in e||`column`in e?s(e):``}function s(e){return l(e&&e.line)+`:`+l(e&&e.column)}function c(e){return s(e&&e.start)+`-`+s(e&&e.end)}function l(e){return e&&typeof e==`number`?e:1}var u=class extends Error{constructor(e,t,n){super(),typeof t==`string`&&(n=t,t=void 0);let r=``,i={},a=!1;if(t&&(i=`line`in t&&`column`in t||`start`in t&&`end`in t?{place:t}:`type`in t?{ancestors:[t],place:t.position}:{...t}),typeof e==`string`?r=e:!i.cause&&e&&(a=!0,r=e.message,i.cause=e),!i.ruleId&&!i.source&&typeof n==`string`){let e=n.indexOf(`:`);e===-1?i.ruleId=n:(i.source=n.slice(0,e),i.ruleId=n.slice(e+1))}if(!i.place&&i.ancestors&&i.ancestors){let e=i.ancestors[i.ancestors.length-1];e&&(i.place=e.position)}let s=i.place&&`start`in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=s?s.column:void 0,this.fatal=void 0,this.file=``,this.message=r,this.line=s?s.line:void 0,this.name=o(i.place)||`1:1`,this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=a&&i.cause&&typeof i.cause.stack==`string`?i.cause.stack:``,this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}};u.prototype.file=``,u.prototype.name=``,u.prototype.reason=``,u.prototype.message=``,u.prototype.stack=``,u.prototype.column=void 0,u.prototype.line=void 0,u.prototype.ancestors=void 0,u.prototype.cause=void 0,u.prototype.fatal=void 0,u.prototype.place=void 0,u.prototype.ruleId=void 0,u.prototype.source=void 0;const d=`__system__`,f=[`incoming`,`outgoing`,`both`];function p(e){return f.includes(e)}const m=`.open-knowledge`,h=[`image/jpeg`,`image/png`,`image/gif`,`image/webp`,`image/svg+xml`],g=new Set([`png`,`jpg`,`jpeg`,`gif`,`webp`,`svg`]);function _(e){this.content=e}_.prototype={constructor:_,find:function(e){for(var t=0;t<this.content.length;t+=2)if(this.content[t]===e)return t;return-1},get:function(e){var t=this.find(e);return t==-1?void 0:this.content[t+1]},update:function(e,t,n){var r=n&&n!=e?this.remove(n):this,i=r.find(e),a=r.content.slice();return i==-1?a.push(n||e,t):(a[i+1]=t,n&&(a[i]=n)),new _(a)},remove:function(e){var t=this.find(e);if(t==-1)return this;var n=this.content.slice();return n.splice(t,2),new _(n)},addToStart:function(e,t){return new _([e,t].concat(this.remove(e).content))},addToEnd:function(e,t){var n=this.remove(e).content.slice();return n.push(e,t),new _(n)},addBefore:function(e,t,n){var r=this.remove(t),i=r.content.slice(),a=r.find(e);return i.splice(a==-1?i.length:a,0,t,n),new _(i)},forEach:function(e){for(var t=0;t<this.content.length;t+=2)e(this.content[t],this.content[t+1])},prepend:function(e){return e=_.from(e),e.size?new _(e.content.concat(this.subtract(e).content)):this},append:function(e){return e=_.from(e),e.size?new _(this.subtract(e).content.concat(e.content)):this},subtract:function(e){var t=this;e=_.from(e);for(var n=0;n<e.content.length;n+=2)t=t.remove(e.content[n]);return t},toObject:function(){var e={};return this.forEach(function(t,n){e[t]=n}),e},get size(){return this.content.length>>1}},_.from=function(e){if(e instanceof _)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new _(t)};function v(e,t,n){for(let r=0;;r++){if(r==e.childCount||r==t.childCount)return e.childCount==t.childCount?null:n;let i=e.child(r),a=t.child(r);if(i==a){n+=i.nodeSize;continue}if(!i.sameMarkup(a))return n;if(i.isText&&i.text!=a.text){for(let e=0;i.text[e]==a.text[e];e++)n++;return n}if(i.content.size||a.content.size){let e=v(i.content,a.content,n+1);if(e!=null)return e}n+=i.nodeSize}}function y(e,t,n,r){for(let i=e.childCount,a=t.childCount;;){if(i==0||a==0)return i==a?null:{a:n,b:r};let o=e.child(--i),s=t.child(--a),c=o.nodeSize;if(o==s){n-=c,r-=c;continue}if(!o.sameMarkup(s))return{a:n,b:r};if(o.isText&&o.text!=s.text){let e=0,t=Math.min(o.text.length,s.text.length);for(;e<t&&o.text[o.text.length-e-1]==s.text[s.text.length-e-1];)e++,n--,r--;return{a:n,b:r}}if(o.content.size||s.content.size){let e=y(o.content,s.content,n-1,r-1);if(e)return e}n-=c,r-=c}}var b=class e{constructor(e,t){if(this.content=e,this.size=t||0,t==null)for(let t=0;t<e.length;t++)this.size+=e[t].nodeSize}nodesBetween(e,t,n,r=0,i){for(let a=0,o=0;o<t;a++){let s=this.content[a],c=o+s.nodeSize;if(c>e&&n(s,r+o,i||null,a)!==!1&&s.content.size){let i=o+1;s.nodesBetween(Math.max(0,e-i),Math.min(s.content.size,t-i),n,r+i)}o=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,n,r){let i=``,a=!0;return this.nodesBetween(e,t,(o,s)=>{let c=o.isText?o.text.slice(Math.max(e,s)-s,t-s):o.isLeaf?r?typeof r==`function`?r(o):r:o.type.spec.leafText?o.type.spec.leafText(o):``:``;o.isBlock&&(o.isLeaf&&c||o.isTextblock)&&n&&(a?a=!1:i+=n),i+=c},0),i}append(t){if(!t.size)return this;if(!this.size)return t;let n=this.lastChild,r=t.firstChild,i=this.content.slice(),a=0;for(n.isText&&n.sameMarkup(r)&&(i[i.length-1]=n.withText(n.text+r.text),a=1);a<t.content.length;a++)i.push(t.content[a]);return new e(i,this.size+t.size)}cut(t,n=this.size){if(t==0&&n==this.size)return this;let r=[],i=0;if(n>t)for(let e=0,a=0;a<n;e++){let o=this.content[e],s=a+o.nodeSize;s>t&&((a<t||s>n)&&(o=o.isText?o.cut(Math.max(0,t-a),Math.min(o.text.length,n-a)):o.cut(Math.max(0,t-a-1),Math.min(o.content.size,n-a-1))),r.push(o),i+=o.nodeSize),a=s}return new e(r,i)}cutByIndex(t,n){return t==n?e.empty:t==0&&n==this.content.length?this:new e(this.content.slice(t,n))}replaceChild(t,n){let r=this.content[t];if(r==n)return this;let i=this.content.slice(),a=this.size+n.nodeSize-r.nodeSize;return i[t]=n,new e(i,a)}addToStart(t){return new e([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new e(this.content.concat(t),this.size+t.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let t=this.content[e];if(!t)throw RangeError(`Index `+e+` out of range for `+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,n=0;t<this.content.length;t++){let r=this.content[t];e(r,n,t),n+=r.nodeSize}}findDiffStart(e,t=0){return v(this,e,t)}findDiffEnd(e,t=this.size,n=e.size){return y(this,e,t,n)}findIndex(e){if(e==0)return S(0,e);if(e==this.size)return S(this.content.length,e);if(e>this.size||e<0)throw RangeError(`Position ${e} outside of fragment (${this})`);for(let t=0,n=0;;t++){let r=this.child(t),i=n+r.nodeSize;if(i>=e)return i==e?S(t+1,i):S(t,n);n=i}}toString(){return`<`+this.toStringInner()+`>`}toStringInner(){return this.content.join(`, `)}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(t,n){if(!n)return e.empty;if(!Array.isArray(n))throw RangeError(`Invalid input for Fragment.fromJSON`);return new e(n.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return e.empty;let n,r=0;for(let e=0;e<t.length;e++){let i=t[e];r+=i.nodeSize,e&&i.isText&&t[e-1].sameMarkup(i)?(n||=t.slice(0,e),n[n.length-1]=i.withText(n[n.length-1].text+i.text)):n&&n.push(i)}return new e(n||t,r)}static from(t){if(!t)return e.empty;if(t instanceof e)return t;if(Array.isArray(t))return this.fromArray(t);if(t.attrs)return new e([t],t.nodeSize);throw RangeError(`Can not convert `+t+` to a Fragment`+(t.nodesBetween?` (looks like multiple versions of prosemirror-model were loaded)`:``))}};b.empty=new b([],0);const x={index:0,offset:0};function S(e,t){return x.index=e,x.offset=t,x}function C(e,t){if(e===t)return!0;if(!(e&&typeof e==`object`)||!(t&&typeof t==`object`))return!1;let n=Array.isArray(e);if(Array.isArray(t)!=n)return!1;if(n){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!C(e[n],t[n]))return!1}else{for(let n in e)if(!(n in t)||!C(e[n],t[n]))return!1;for(let n in t)if(!(n in e))return!1}return!0}var w=class e{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,n=!1;for(let r=0;r<e.length;r++){let i=e[r];if(this.eq(i))return e;if(this.type.excludes(i.type))t||=e.slice(0,r);else if(i.type.excludes(this.type))return e;else !n&&i.type.rank>this.type.rank&&(t||=e.slice(0,r),t.push(this),n=!0),t&&t.push(i)}return t||=e.slice(),n||t.push(this),t}removeFromSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e}isInSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1}eq(e){return this==e||this.type==e.type&&C(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,t){if(!t)throw RangeError(`Invalid input for Mark.fromJSON`);let n=e.marks[t.type];if(!n)throw RangeError(`There is no mark type ${t.type} in this schema`);let r=n.create(t.attrs);return n.checkAttrs(r.attrs),r}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].eq(t[n]))return!1;return!0}static setFrom(t){if(!t||Array.isArray(t)&&t.length==0)return e.none;if(t instanceof e)return[t];let n=t.slice();return n.sort((e,t)=>e.type.rank-t.type.rank),n}};w.none=[];var T=class extends Error{},E=class e{constructor(e,t,n){this.content=e,this.openStart=t,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(t,n){let r=O(this.content,t+this.openStart,n);return r&&new e(r,this.openStart,this.openEnd)}removeBetween(t,n){return new e(D(this.content,t+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+`(`+this.openStart+`,`+this.openEnd+`)`}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(t,n){if(!n)return e.empty;let r=n.openStart||0,i=n.openEnd||0;if(typeof r!=`number`||typeof i!=`number`)throw RangeError(`Invalid input for Slice.fromJSON`);return new e(b.fromJSON(t,n.content),r,i)}static maxOpen(t,n=!0){let r=0,i=0;for(let e=t.firstChild;e&&!e.isLeaf&&(n||!e.type.spec.isolating);e=e.firstChild)r++;for(let e=t.lastChild;e&&!e.isLeaf&&(n||!e.type.spec.isolating);e=e.lastChild)i++;return new e(t,r,i)}};E.empty=new E(b.empty,0,0);function D(e,t,n){let{index:r,offset:i}=e.findIndex(t),a=e.maybeChild(r),{index:o,offset:s}=e.findIndex(n);if(i==t||a.isText){if(s!=n&&!e.child(o).isText)throw RangeError(`Removing non-flat range`);return e.cut(0,t).append(e.cut(n))}if(r!=o)throw RangeError(`Removing non-flat range`);return e.replaceChild(r,a.copy(D(a.content,t-i-1,n-i-1)))}function O(e,t,n,r){let{index:i,offset:a}=e.findIndex(t),o=e.maybeChild(i);if(a==t||o.isText)return r&&!r.canReplace(i,i,n)?null:e.cut(0,t).append(n).append(e.cut(t));let s=O(o.content,t-a-1,n,o);return s&&e.replaceChild(i,o.copy(s))}function ee(e,t,n){if(n.openStart>e.depth)throw new T(`Inserted content deeper than insertion position`);if(e.depth-n.openStart!=t.depth-n.openEnd)throw new T(`Inconsistent open depths`);return te(e,t,n,0)}function te(e,t,n,r){let i=e.index(r),a=e.node(r);if(i==t.index(r)&&r<e.depth-n.openStart){let o=te(e,t,n,r+1);return a.copy(a.content.replaceChild(i,o))}else if(!n.content.size)return ie(a,oe(e,t,r));else if(!n.openStart&&!n.openEnd&&e.depth==r&&t.depth==r){let r=e.parent,i=r.content;return ie(r,i.cut(0,e.parentOffset).append(n.content).append(i.cut(t.parentOffset)))}else{let{start:i,end:o}=se(n,e);return ie(a,ae(e,i,o,t,r))}}function ne(e,t){if(!t.type.compatibleContent(e.type))throw new T(`Cannot join `+t.type.name+` onto `+e.type.name)}function re(e,t,n){let r=e.node(n);return ne(r,t.node(n)),r}function k(e,t){let n=t.length-1;n>=0&&e.isText&&e.sameMarkup(t[n])?t[n]=e.withText(t[n].text+e.text):t.push(e)}function A(e,t,n,r){let i=(t||e).node(n),a=0,o=t?t.index(n):i.childCount;e&&(a=e.index(n),e.depth>n?a++:e.textOffset&&(k(e.nodeAfter,r),a++));for(let e=a;e<o;e++)k(i.child(e),r);t&&t.depth==n&&t.textOffset&&k(t.nodeBefore,r)}function ie(e,t){return e.type.checkContent(t),e.copy(t)}function ae(e,t,n,r,i){let a=e.depth>i&&re(e,t,i+1),o=r.depth>i&&re(n,r,i+1),s=[];return A(null,e,i,s),a&&o&&t.index(i)==n.index(i)?(ne(a,o),k(ie(a,ae(e,t,n,r,i+1)),s)):(a&&k(ie(a,oe(e,t,i+1)),s),A(t,n,i,s),o&&k(ie(o,oe(n,r,i+1)),s)),A(r,null,i,s),new b(s)}function oe(e,t,n){let r=[];return A(null,e,n,r),e.depth>n&&k(ie(re(e,t,n+1),oe(e,t,n+1)),r),A(t,null,n,r),new b(r)}function se(e,t){let n=t.depth-e.openStart,r=t.node(n).copy(e.content);for(let e=n-1;e>=0;e--)r=t.node(e).copy(b.from(r));return{start:r.resolveNoCache(e.openStart+n),end:r.resolveNoCache(r.content.size-e.openEnd-n)}}var ce=class e{constructor(e,t,n){this.pos=e,this.path=t,this.parentOffset=n,this.depth=t.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw RangeError(`There is no position before the top-level node`);return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw RangeError(`There is no position after the top-level node`);return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let n=this.pos-this.path[this.path.length-1],r=e.child(t);return n?e.child(t).cut(n):r}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):e==0?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let n=this.path[t*3],r=t==0?0:this.path[t*3-1]+1;for(let t=0;t<e;t++)r+=n.child(t).nodeSize;return r}marks(){let e=this.parent,t=this.index();if(e.content.size==0)return w.none;if(this.textOffset)return e.child(t).marks;let n=e.maybeChild(t-1),r=e.maybeChild(t);if(!n){let e=n;n=r,r=e}let i=n.marks;for(var a=0;a<i.length;a++)i[a].type.spec.inclusive===!1&&(!r||!i[a].isInSet(r.marks))&&(i=i[a--].removeFromSet(i));return i}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let n=t.marks,r=e.parent.maybeChild(e.index());for(var i=0;i<n.length;i++)n[i].type.spec.inclusive===!1&&(!r||!n[i].isInSet(r.marks))&&(n=n[i--].removeFromSet(n));return n}sharedDepth(e){for(let t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos<this.pos)return e.blockRange(this);for(let n=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);n>=0;n--)if(e.pos<=this.end(n)&&(!t||t(this.node(n))))return new fe(this,e,n);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e=``;for(let t=1;t<=this.depth;t++)e+=(e?`/`:``)+this.node(t).type.name+`_`+this.index(t-1);return e+`:`+this.parentOffset}static resolve(t,n){if(!(n>=0&&n<=t.content.size))throw RangeError(`Position `+n+` out of range`);let r=[],i=0,a=n;for(let e=t;;){let{index:t,offset:n}=e.content.findIndex(a),o=a-n;if(r.push(e,t,i+n),!o||(e=e.child(t),e.isText))break;a=o-1,i+=n+1}return new e(n,r,a)}static resolveCached(t,n){let r=de.get(t);if(r)for(let e=0;e<r.elts.length;e++){let t=r.elts[e];if(t.pos==n)return t}else de.set(t,r=new le);let i=r.elts[r.i]=e.resolve(t,n);return r.i=(r.i+1)%ue,i}},le=class{constructor(){this.elts=[],this.i=0}};const ue=12,de=new WeakMap;var fe=class{constructor(e,t,n){this.$from=e,this.$to=t,this.depth=n}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}};const pe=Object.create(null);var me=class e{constructor(e,t,n,r=w.none){this.type=e,this.attrs=t,this.marks=r,this.content=n||b.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,t,n,r=0){this.content.nodesBetween(e,t,n,r,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,``)}textBetween(e,t,n,r){return this.content.textBetween(e,t,n,r)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,t,n){return this.type==e&&C(this.attrs,t||e.defaultAttrs||pe)&&w.sameSet(this.marks,n||w.none)}copy(t=null){return t==this.content?this:new e(this.type,this.attrs,t,this.marks)}mark(t){return t==this.marks?this:new e(this.type,this.attrs,this.content,t)}cut(e,t=this.content.size){return e==0&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,n=!1){if(e==t)return E.empty;let r=this.resolve(e),i=this.resolve(t),a=n?0:r.sharedDepth(t),o=r.start(a);return new E(r.node(a).content.cut(r.pos-o,i.pos-o),r.depth-a,i.depth-a)}replace(e,t,n){return ee(this.resolve(e),this.resolve(t),n)}nodeAt(e){for(let t=this;;){let{index:n,offset:r}=t.content.findIndex(e);if(t=t.maybeChild(n),!t)return null;if(r==e||t.isText)return t;e-=r+1}}childAfter(e){let{index:t,offset:n}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:n}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:t,offset:n}=this.content.findIndex(e);if(n<e)return{node:this.content.child(t),index:t,offset:n};let r=this.content.child(t-1);return{node:r,index:t-1,offset:n-r.nodeSize}}resolve(e){return ce.resolveCached(this,e)}resolveNoCache(e){return ce.resolve(this,e)}rangeHasMark(e,t,n){let r=!1;return t>e&&this.nodesBetween(e,t,e=>(n.isInSet(e.marks)&&(r=!0),!r)),r}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+=`(`+this.content.toStringInner()+`)`),ge(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw Error(`Called contentMatchAt on a node with invalid content`);return t}canReplace(e,t,n=b.empty,r=0,i=n.childCount){let a=this.contentMatchAt(e).matchFragment(n,r,i),o=a&&a.matchFragment(this.content,t);if(!o||!o.validEnd)return!1;for(let e=r;e<i;e++)if(!this.type.allowsMarks(n.child(e).marks))return!1;return!0}canReplaceWith(e,t,n,r){if(r&&!this.type.allowsMarks(r))return!1;let i=this.contentMatchAt(e).matchType(n),a=i&&i.matchFragment(this.content,t);return a?a.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=w.none;for(let t=0;t<this.marks.length;t++){let n=this.marks[t];n.type.checkAttrs(n.attrs),e=n.addToSet(e)}if(!w.sameSet(e,this.marks))throw RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(e=>e.type.name)}`);this.content.forEach(e=>e.check())}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(e=>e.toJSON())),e}static fromJSON(e,t){if(!t)throw RangeError(`Invalid input for Node.fromJSON`);let n;if(t.marks){if(!Array.isArray(t.marks))throw RangeError(`Invalid mark data for Node.fromJSON`);n=t.marks.map(e.markFromJSON)}if(t.type==`text`){if(typeof t.text!=`string`)throw RangeError(`Invalid text node in JSON`);return e.text(t.text,n)}let r=b.fromJSON(e,t.content),i=e.nodeType(t.type).create(t.attrs,r,n);return i.type.checkAttrs(i.attrs),i}};me.prototype.text=void 0;var he=class e extends me{constructor(e,t,n,r){if(super(e,t,null,r),!n)throw RangeError(`Empty text nodes are not allowed`);this.text=n}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):ge(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(t){return t==this.marks?this:new e(this.type,this.attrs,this.text,t)}withText(t){return t==this.text?this:new e(this.type,this.attrs,t,this.marks)}cut(e=0,t=this.text.length){return e==0&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}};function ge(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+`(`+t+`)`;return t}var _e=class e{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(t,n){let r=new ve(t,n);if(r.next==null)return e.empty;let i=ye(r);r.next&&r.err(`Unexpected trailing text`);let a=ke(Ee(i));return j(a,r),a}matchType(e){for(let t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}matchFragment(e,t=0,n=e.childCount){let r=this;for(let i=t;r&&i<n;i++)r=r.matchType(e.child(i).type);return r}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:t}=this.next[e];if(!(t.isText||t.hasRequiredAttrs()))return t}return null}compatible(e){for(let t=0;t<this.next.length;t++)for(let n=0;n<e.next.length;n++)if(this.next[t].type==e.next[n].type)return!0;return!1}fillBefore(e,t=!1,n=0){let r=[this];function i(a,o){let s=a.matchFragment(e,n);if(s&&(!t||s.validEnd))return b.from(o.map(e=>e.createAndFill()));for(let e=0;e<a.next.length;e++){let{type:t,next:n}=a.next[e];if(!(t.isText||t.hasRequiredAttrs())&&r.indexOf(n)==-1){r.push(n);let e=i(n,o.concat(t));if(e)return e}}return null}return i(this,[])}findWrapping(e){for(let t=0;t<this.wrapCache.length;t+=2)if(this.wrapCache[t]==e)return this.wrapCache[t+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),n=[{match:this,type:null,via:null}];for(;n.length;){let r=n.shift(),i=r.match;if(i.matchType(e)){let e=[];for(let t=r;t.type;t=t.via)e.push(t.type);return e.reverse()}for(let e=0;e<i.next.length;e++){let{type:a,next:o}=i.next[e];!a.isLeaf&&!a.hasRequiredAttrs()&&!(a.name in t)&&(!r.type||o.validEnd)&&(n.push({match:a.contentMatch,type:a,via:r}),t[a.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function t(n){e.push(n);for(let r=0;r<n.next.length;r++)e.indexOf(n.next[r].next)==-1&&t(n.next[r].next)}return t(this),e.map((t,n)=>{let r=n+(t.validEnd?`*`:` `)+` `;for(let n=0;n<t.next.length;n++)r+=(n?`, `:``)+t.next[n].type.name+`->`+e.indexOf(t.next[n].next);return r}).join(`
2
2
  `)}};_e.empty=new _e(!0);var ve=class{constructor(e,t){this.string=e,this.nodeTypes=t,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==``&&this.tokens.pop(),this.tokens[0]==``&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw SyntaxError(e+` (in content expression '`+this.string+`')`)}};function ye(e){let t=[];do t.push(be(e));while(e.eat(`|`));return t.length==1?t[0]:{type:`choice`,exprs:t}}function be(e){let t=[];do t.push(xe(e));while(e.next&&e.next!=`)`&&e.next!=`|`);return t.length==1?t[0]:{type:`seq`,exprs:t}}function xe(e){let t=Te(e);for(;;)if(e.eat(`+`))t={type:`plus`,expr:t};else if(e.eat(`*`))t={type:`star`,expr:t};else if(e.eat(`?`))t={type:`opt`,expr:t};else if(e.eat(`{`))t=Ce(e,t);else break;return t}function Se(e){/\D/.test(e.next)&&e.err(`Expected number, got '`+e.next+`'`);let t=Number(e.next);return e.pos++,t}function Ce(e,t){let n=Se(e),r=n;return e.eat(`,`)&&(r=e.next==`}`?-1:Se(e)),e.eat(`}`)||e.err(`Unclosed braced range`),{type:`range`,min:n,max:r,expr:t}}function we(e,t){let n=e.nodeTypes,r=n[t];if(r)return[r];let i=[];for(let e in n){let r=n[e];r.isInGroup(t)&&i.push(r)}return i.length==0&&e.err(`No node type or group '`+t+`' found`),i}function Te(e){if(e.eat(`(`)){let t=ye(e);return e.eat(`)`)||e.err(`Missing closing paren`),t}else if(/\W/.test(e.next))e.err(`Unexpected token '`+e.next+`'`);else{let t=we(e,e.next).map(t=>(e.inline==null?e.inline=t.isInline:e.inline!=t.isInline&&e.err(`Mixing inline and block content`),{type:`name`,value:t}));return e.pos++,t.length==1?t[0]:{type:`choice`,exprs:t}}}function Ee(e){let t=[[]];return i(a(e,0),n()),t;function n(){return t.push([])-1}function r(e,n,r){let i={term:r,to:n};return t[e].push(i),i}function i(e,t){e.forEach(e=>e.to=t)}function a(e,t){if(e.type==`choice`)return e.exprs.reduce((e,n)=>e.concat(a(n,t)),[]);if(e.type==`seq`)for(let r=0;;r++){let o=a(e.exprs[r],t);if(r==e.exprs.length-1)return o;i(o,t=n())}else if(e.type==`star`){let o=n();return r(t,o),i(a(e.expr,o),o),[r(o)]}else if(e.type==`plus`){let o=n();return i(a(e.expr,t),o),i(a(e.expr,o),o),[r(o)]}else if(e.type==`opt`)return[r(t)].concat(a(e.expr,t));else if(e.type==`range`){let o=t;for(let t=0;t<e.min;t++){let t=n();i(a(e.expr,o),t),o=t}if(e.max==-1)i(a(e.expr,o),o);else for(let t=e.min;t<e.max;t++){let t=n();r(o,t),i(a(e.expr,o),t),o=t}return[r(o)]}else if(e.type==`name`)return[r(t,void 0,e.value)];else throw Error(`Unknown expr type`)}}function De(e,t){return t-e}function Oe(e,t){let n=[];return r(t),n.sort(De);function r(t){let i=e[t];if(i.length==1&&!i[0].term)return r(i[0].to);n.push(t);for(let e=0;e<i.length;e++){let{term:t,to:a}=i[e];!t&&n.indexOf(a)==-1&&r(a)}}}function ke(e){let t=Object.create(null);return n(Oe(e,0));function n(r){let i=[];r.forEach(t=>{e[t].forEach(({term:t,to:n})=>{if(!t)return;let r;for(let e=0;e<i.length;e++)i[e][0]==t&&(r=i[e][1]);Oe(e,n).forEach(e=>{r||i.push([t,r=[]]),r.indexOf(e)==-1&&r.push(e)})})});let a=t[r.join(`,`)]=new _e(r.indexOf(e.length-1)>-1);for(let e=0;e<i.length;e++){let r=i[e][1].sort(De);a.next.push({type:i[e][0],next:t[r.join(`,`)]||n(r)})}return a}}function j(e,t){for(let n=0,r=[e];n<r.length;n++){let e=r[n],i=!e.validEnd,a=[];for(let t=0;t<e.next.length;t++){let{type:n,next:o}=e.next[t];a.push(n.name),i&&!(n.isText||n.hasRequiredAttrs())&&(i=!1),r.indexOf(o)==-1&&r.push(o)}i&&t.err(`Only non-generatable nodes (`+a.join(`, `)+`) in a required position (see https://prosemirror.net/docs/guide/#generatable)`)}}function Ae(e){let t=Object.create(null);for(let n in e){let r=e[n];if(!r.hasDefault)return null;t[n]=r.default}return t}function je(e,t){let n=Object.create(null);for(let r in e){let i=t&&t[r];if(i===void 0){let t=e[r];if(t.hasDefault)i=t.default;else throw RangeError(`No value supplied for attribute `+r)}n[r]=i}return n}function Me(e,t,n,r){for(let r in t)if(!(r in e))throw RangeError(`Unsupported attribute ${r} for ${n} of type ${r}`);for(let n in e){let r=e[n];r.validate&&r.validate(t[n])}}function Ne(e,t){let n=Object.create(null);if(t)for(let r in t)n[r]=new Ie(e,r,t[r]);return n}var Pe=class e{constructor(e,t,n){this.name=e,this.schema=t,this.spec=n,this.markSet=null,this.groups=n.group?n.group.split(` `):[],this.attrs=Ne(e,n.attrs),this.defaultAttrs=Ae(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(n.inline||e==`text`),this.isText=e==`text`}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==_e.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(e){return this.groups.indexOf(e)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?`pre`:`normal`)}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:je(this.attrs,e)}create(e=null,t,n){if(this.isText)throw Error(`NodeType.create can't construct text nodes`);return new me(this,this.computeAttrs(e),b.from(t),w.setFrom(n))}createChecked(e=null,t,n){return t=b.from(t),this.checkContent(t),new me(this,this.computeAttrs(e),t,w.setFrom(n))}createAndFill(e=null,t,n){if(e=this.computeAttrs(e),t=b.from(t),t.size){let e=this.contentMatch.fillBefore(t);if(!e)return null;t=e.append(t)}let r=this.contentMatch.matchFragment(t),i=r&&r.fillBefore(b.empty,!0);return i?new me(this,e,t.append(i),w.setFrom(n)):null}validContent(e){let t=this.contentMatch.matchFragment(e);if(!t||!t.validEnd)return!1;for(let t=0;t<e.childCount;t++)if(!this.allowsMarks(e.child(t).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}checkAttrs(e){Me(this.attrs,e,`node`,this.name)}allowsMarkType(e){return this.markSet==null||this.markSet.indexOf(e)>-1}allowsMarks(e){if(this.markSet==null)return!0;for(let t=0;t<e.length;t++)if(!this.allowsMarkType(e[t].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let t;for(let n=0;n<e.length;n++)this.allowsMarkType(e[n].type)?t&&t.push(e[n]):t||=e.slice(0,n);return t?t.length?t:w.none:e}static compile(t,n){let r=Object.create(null);t.forEach((t,i)=>r[t]=new e(t,n,i));let i=n.spec.topNode||`doc`;if(!r[i])throw RangeError(`Schema is missing its top node type ('`+i+`')`);if(!r.text)throw RangeError(`Every schema needs a 'text' type`);for(let e in r.text.attrs)throw RangeError(`The text node type should not have attributes`);return r}};function Fe(e,t,n){let r=n.split(`|`);return n=>{let i=n===null?`null`:typeof n;if(r.indexOf(i)<0)throw RangeError(`Expected value of type ${r} for attribute ${t} on type ${e}, got ${i}`)}}var Ie=class{constructor(e,t,n){this.hasDefault=Object.prototype.hasOwnProperty.call(n,`default`),this.default=n.default,this.validate=typeof n.validate==`string`?Fe(e,t,n.validate):n.validate}get isRequired(){return!this.hasDefault}},Le=class e{constructor(e,t,n,r){this.name=e,this.rank=t,this.schema=n,this.spec=r,this.attrs=Ne(e,r.attrs),this.excluded=null;let i=Ae(this.attrs);this.instance=i?new w(this,i):null}create(e=null){return!e&&this.instance?this.instance:new w(this,je(this.attrs,e))}static compile(t,n){let r=Object.create(null),i=0;return t.forEach((t,a)=>r[t]=new e(t,i++,n,a)),r}removeFromSet(e){for(var t=0;t<e.length;t++)e[t].type==this&&(e=e.slice(0,t).concat(e.slice(t+1)),t--);return e}isInSet(e){for(let t=0;t<e.length;t++)if(e[t].type==this)return e[t]}checkAttrs(e){Me(this.attrs,e,`mark`,this.name)}excludes(e){return this.excluded.indexOf(e)>-1}},Re=class{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let t=this.spec={};for(let n in e)t[n]=e[n];t.nodes=_.from(e.nodes),t.marks=_.from(e.marks||{}),this.nodes=Pe.compile(this.spec.nodes,this),this.marks=Le.compile(this.spec.marks,this);let n=Object.create(null);for(let e in this.nodes){if(e in this.marks)throw RangeError(e+` can not be both a node and a mark`);let t=this.nodes[e],r=t.spec.content||``,i=t.spec.marks;if(t.contentMatch=n[r]||(n[r]=_e.parse(r,this.nodes)),t.inlineContent=t.contentMatch.inlineContent,t.spec.linebreakReplacement){if(this.linebreakReplacement)throw RangeError(`Multiple linebreak nodes defined`);if(!t.isInline||!t.isLeaf)throw RangeError(`Linebreak replacement nodes must be inline leaf nodes`);this.linebreakReplacement=t}t.markSet=i==`_`?null:i?ze(this,i.split(` `)):i==``||!t.inlineContent?[]:null}for(let e in this.marks){let t=this.marks[e],n=t.spec.excludes;t.excluded=n==null?[t]:n==``?[]:ze(this,n.split(` `))}this.nodeFromJSON=e=>me.fromJSON(this,e),this.markFromJSON=e=>w.fromJSON(this,e),this.topNodeType=this.nodes[this.spec.topNode||`doc`],this.cached.wrappings=Object.create(null)}node(e,t=null,n,r){if(typeof e==`string`)e=this.nodeType(e);else if(!(e instanceof Pe))throw RangeError(`Invalid node type: `+e);else if(e.schema!=this)throw RangeError(`Node type from different schema used (`+e.name+`)`);return e.createChecked(t,n,r)}text(e,t){let n=this.nodes.text;return new he(n,n.defaultAttrs,e,w.setFrom(t))}mark(e,t){return typeof e==`string`&&(e=this.marks[e]),e.create(t)}nodeType(e){let t=this.nodes[e];if(!t)throw RangeError(`Unknown node type: `+e);return t}};function ze(e,t){let n=[];for(let r=0;r<t.length;r++){let i=t[r],a=e.marks[i],o=a;if(a)n.push(a);else for(let t in e.marks){let r=e.marks[t];(i==`_`||r.spec.group&&r.spec.group.split(` `).indexOf(i)>-1)&&n.push(o=r)}if(!o)throw SyntaxError(`Unknown mark type: '`+t[r]+`'`)}return n}function Be(e){return e.tag!=null}function Ve(e){return e.style!=null}var He=class e{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[];let n=this.matchedStyles=[];t.forEach(e=>{if(Be(e))this.tags.push(e);else if(Ve(e)){let t=/[^=]*/.exec(e.style)[0];n.indexOf(t)<0&&n.push(t),this.styles.push(e)}}),this.normalizeLists=!this.tags.some(t=>{if(!/^(ul|ol)\b/.test(t.tag)||!t.node)return!1;let n=e.nodes[t.node];return n.contentMatch.matchType(n)})}parse(e,t={}){let n=new Je(this,t,!1);return n.addAll(e,w.none,t.from,t.to),n.finish()}parseSlice(e,t={}){let n=new Je(this,t,!0);return n.addAll(e,w.none,t.from,t.to),E.maxOpen(n.finish())}matchTag(e,t,n){for(let r=n?this.tags.indexOf(n)+1:0;r<this.tags.length;r++){let n=this.tags[r];if(Xe(e,n.tag)&&(n.namespace===void 0||e.namespaceURI==n.namespace)&&(!n.context||t.matchesContext(n.context))){if(n.getAttrs){let t=n.getAttrs(e);if(t===!1)continue;n.attrs=t||void 0}return n}}}matchStyle(e,t,n,r){for(let i=r?this.styles.indexOf(r)+1:0;i<this.styles.length;i++){let r=this.styles[i],a=r.style;if(!(a.indexOf(e)!=0||r.context&&!n.matchesContext(r.context)||a.length>e.length&&(a.charCodeAt(e.length)!=61||a.slice(e.length+1)!=t))){if(r.getAttrs){let e=r.getAttrs(t);if(e===!1)continue;r.attrs=e||void 0}return r}}}static schemaRules(e){let t=[];function n(e){let n=e.priority==null?50:e.priority,r=0;for(;r<t.length;r++){let e=t[r];if((e.priority==null?50:e.priority)<n)break}t.splice(r,0,e)}for(let t in e.marks){let r=e.marks[t].spec.parseDOM;r&&r.forEach(e=>{n(e=Ze(e)),e.mark||e.ignore||e.clearMark||(e.mark=t)})}for(let t in e.nodes){let r=e.nodes[t].spec.parseDOM;r&&r.forEach(e=>{n(e=Ze(e)),e.node||e.ignore||e.mark||(e.node=t)})}return t}static fromSchema(t){return t.cached.domParser||(t.cached.domParser=new e(t,e.schemaRules(t)))}};const Ue={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},We={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},Ge={ol:!0,ul:!0};function Ke(e,t,n){return t==null?e&&e.whitespace==`pre`?3:n&-5:(t?1:0)|(t===`full`?2:0)}var qe=class{constructor(e,t,n,r,i,a){this.type=e,this.attrs=t,this.marks=n,this.solid=r,this.options=a,this.content=[],this.activeMarks=w.none,this.match=i||(a&4?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(b.from(e));if(t)this.match=this.type.contentMatch.matchFragment(t);else{let t=this.type.contentMatch,n;return(n=t.findWrapping(e.type))?(this.match=t,n):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&1)){let e=this.content[this.content.length-1],t;if(e&&e.isText&&(t=/[ \t\r\n\u000c]+$/.exec(e.text))){let n=e;e.text.length==t[0].length?this.content.pop():this.content[this.content.length-1]=n.withText(n.text.slice(0,n.text.length-t[0].length))}}let t=b.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(b.empty,!0))),this.type?this.type.create(this.attrs,t,this.marks):t}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!Ue.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}},Je=class{constructor(e,t,n){this.parser=e,this.options=t,this.isOpen=n,this.open=0,this.localPreserveWS=!1;let r=t.topNode,i,a=Ke(null,t.preserveWhitespace,0)|(n?4:0);i=r?new qe(r.type,r.attrs,w.none,!0,t.topMatch||r.type.contentMatch,a):n?new qe(null,null,w.none,!0,null,a):new qe(e.schema.topNodeType,null,w.none,!0,null,a),this.nodes=[i],this.find=t.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,t){e.nodeType==3?this.addTextNode(e,t):e.nodeType==1&&this.addElement(e,t)}addTextNode(e,t){let n=e.nodeValue,r=this.top,i=r.options&2?`full`:this.localPreserveWS||(r.options&1)>0,{schema:a}=this.parser;if(i===`full`||r.inlineContext(e)||/[^ \t\r\n\u000c]/.test(n)){if(!i){if(n=n.replace(/[ \t\r\n\u000c]+/g,` `),/^[ \t\r\n\u000c]/.test(n)&&this.open==this.nodes.length-1){let t=r.content[r.content.length-1],i=e.previousSibling;(!t||i&&i.nodeName==`BR`||t.isText&&/[ \t\r\n\u000c]$/.test(t.text))&&(n=n.slice(1))}}else if(i===`full`)n=n.replace(/\r\n?/g,`
3
3
  `);else if(a.linebreakReplacement&&/[\r\n]/.test(n)&&this.top.findWrapping(a.linebreakReplacement.create())){let e=n.split(/\r?\n|\r/);for(let n=0;n<e.length;n++)n&&this.insertNode(a.linebreakReplacement.create(),t,!0),e[n]&&this.insertNode(a.text(e[n]),t,!/\S/.test(e[n]));n=``}else n=n.replace(/\r?\n|\r/g,` `);n&&this.insertNode(a.text(n),t,!/\S/.test(n)),this.findInText(e)}else this.findInside(e)}addElement(e,t,n){let r=this.localPreserveWS,i=this.top;(e.tagName==`PRE`||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let a=e.nodeName.toLowerCase(),o;Ge.hasOwnProperty(a)&&this.parser.normalizeLists&&Ye(e);let s=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(o=this.parser.matchTag(e,this,n));out:if(s?s.ignore:We.hasOwnProperty(a))this.findInside(e),this.ignoreFallback(e,t);else if(!s||s.skip||s.closeParent){s&&s.closeParent?this.open=Math.max(0,this.open-1):s&&s.skip.nodeType&&(e=s.skip);let n,r=this.needsBlock;if(Ue.hasOwnProperty(a))i.content.length&&i.content[0].isInline&&this.open&&(this.open--,i=this.top),n=!0,i.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,t);break out}let o=s&&s.skip?t:this.readStyles(e,t);o&&this.addAll(e,o),n&&this.sync(i),this.needsBlock=r}else{let n=this.readStyles(e,t);n&&this.addElementByRule(e,s,n,s.consuming===!1?o:void 0)}this.localPreserveWS=r}leafFallback(e,t){e.nodeName==`BR`&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
4
4
  `),t)}ignoreFallback(e,t){e.nodeName==`BR`&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text(`-`),t,!0)}readStyles(e,t){let n=e.style;if(n&&n.length)for(let e=0;e<this.parser.matchedStyles.length;e++){let r=this.parser.matchedStyles[e],i=n.getPropertyValue(r);if(i)for(let e;;){let n=this.parser.matchStyle(r,i,this,e);if(!n)break;if(n.ignore)return null;if(t=n.clearMark?t.filter(e=>!n.clearMark(e)):t.concat(this.parser.schema.marks[n.mark].create(n.attrs)),n.consuming===!1)e=n;else break}}return t}addElementByRule(e,t,n,r){let i,a;if(t.node)if(a=this.parser.schema.nodes[t.node],a.isLeaf)this.insertNode(a.create(t.attrs),n,e.nodeName==`BR`)||this.leafFallback(e,n);else{let e=this.enter(a,t.attrs||null,n,t.preserveWhitespace);e&&(i=!0,n=e)}else{let e=this.parser.schema.marks[t.mark];n=n.concat(e.create(t.attrs))}let o=this.top;if(a&&a.isLeaf)this.findInside(e);else if(r)this.addElement(e,n,r);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach(e=>this.insertNode(e,n,!1));else{let r=e;typeof t.contentElement==`string`?r=e.querySelector(t.contentElement):typeof t.contentElement==`function`?r=t.contentElement(e):t.contentElement&&(r=t.contentElement),this.findAround(e,r,!0),this.addAll(r,n),this.findAround(e,r,!1)}i&&this.sync(o)&&this.open--}addAll(e,t,n,r){let i=n||0;for(let a=n?e.childNodes[n]:e.firstChild,o=r==null?null:e.childNodes[r];a!=o;a=a.nextSibling,++i)this.findAtPoint(e,i),this.addDOM(a,t);this.findAtPoint(e,i)}findPlace(e,t,n){let r,i;for(let t=this.open,a=0;t>=0;t--){let o=this.nodes[t],s=o.findWrapping(e);if(s&&(!r||r.length>s.length+a)&&(r=s,i=o,!s.length))break;if(o.solid){if(n)break;a+=2}}if(!r)return null;this.sync(i);for(let e=0;e<r.length;e++)t=this.enterInner(r[e],null,t,!1);return t}insertNode(e,t,n){if(e.isInline&&this.needsBlock&&!this.top.type){let e=this.textblockFromContext();e&&(t=this.enterInner(e,null,t))}let r=this.findPlace(e,t,n);if(r){this.closeExtra();let t=this.top;t.match&&=t.match.matchType(e.type);let n=w.none;for(let i of r.concat(e.marks))(t.type?t.type.allowsMarkType(i.type):Qe(i.type,e.type))&&(n=i.addToSet(n));return t.content.push(e.mark(n)),!0}return!1}enter(e,t,n,r){let i=this.findPlace(e.create(t),n,!1);return i&&=this.enterInner(e,t,n,!0,r),i}enterInner(e,t,n,r=!1,i){this.closeExtra();let a=this.top;a.match=a.match&&a.match.matchType(e);let o=Ke(e,i,a.options);a.options&4&&a.content.length==0&&(o|=4);let s=w.none;return n=n.filter(t=>(a.type?a.type.allowsMarkType(t.type):Qe(t.type,e))?(s=t.addToSet(s),!1):!0),this.nodes.push(new qe(e,t,s,r,null,o)),this.open++,n}closeExtra(e=!1){let t=this.nodes.length-1;if(t>this.open){for(;t>this.open;t--)this.nodes[t-1].content.push(this.nodes[t].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(e){for(let t=this.open;t>=0;t--)if(this.nodes[t]==e)return this.open=t,!0;else this.localPreserveWS&&(this.nodes[t].options|=1);return!1}get currentPos(){this.closeExtra();let e=0;for(let t=this.open;t>=0;t--){let n=this.nodes[t].content;for(let t=n.length-1;t>=0;t--)e+=n[t].nodeSize;t&&e++}return e}findAtPoint(e,t){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&this.find[n].offset==t&&(this.find[n].pos=this.currentPos)}findInside(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].pos==null&&e.nodeType==1&&e.contains(this.find[t].node)&&(this.find[t].pos=this.currentPos)}findAround(e,t,n){if(e!=t&&this.find)for(let r=0;r<this.find.length;r++)this.find[r].pos==null&&e.nodeType==1&&e.contains(this.find[r].node)&&t.compareDocumentPosition(this.find[r].node)&(n?2:4)&&(this.find[r].pos=this.currentPos)}findInText(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].node==e&&(this.find[t].pos=this.currentPos-(e.nodeValue.length-this.find[t].offset))}matchesContext(e){if(e.indexOf(`|`)>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let t=e.split(`/`),n=this.options.context,r=!this.isOpen&&(!n||n.parent.type==this.nodes[0].type),i=-(n?n.depth+1:0)+(r?0:1),a=(e,o)=>{for(;e>=0;e--){let s=t[e];if(s==``){if(e==t.length-1||e==0)continue;for(;o>=i;o--)if(a(e-1,o))return!0;return!1}else{let e=o>0||o==0&&r?this.nodes[o].type:n&&o>=i?n.node(o-i).type:null;if(!e||e.name!=s&&!e.isInGroup(s))return!1;o--}}return!0};return a(t.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let t=e.depth;t>=0;t--){let n=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(let e in this.parser.schema.nodes){let t=this.parser.schema.nodes[e];if(t.isTextblock&&t.defaultAttrs)return t}}};function Ye(e){for(let t=e.firstChild,n=null;t;t=t.nextSibling){let e=t.nodeType==1?t.nodeName.toLowerCase():null;e&&Ge.hasOwnProperty(e)&&n?(n.appendChild(t),t=n):e==`li`?n=t:e&&(n=null)}}function Xe(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function Ze(e){let t={};for(let n in e)t[n]=e[n];return t}function Qe(e,t){let n=t.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(e))continue;let a=[],o=e=>{a.push(e);for(let n=0;n<e.edgeCount;n++){let{type:r,next:i}=e.edge(n);if(r==t||a.indexOf(i)<0&&o(i))return!0}};if(o(i.contentMatch))return!0}}var $e=class e{constructor(e,t){this.nodes=e,this.marks=t}serializeFragment(e,t={},n){n||=tt(t).createDocumentFragment();let r=n,i=[];return e.forEach(e=>{if(i.length||e.marks.length){let n=0,a=0;for(;n<i.length&&a<e.marks.length;){let t=e.marks[a];if(!this.marks[t.type.name]){a++;continue}if(!t.eq(i[n][0])||t.type.spec.spanning===!1)break;n++,a++}for(;n<i.length;)r=i.pop()[1];for(;a<e.marks.length;){let n=e.marks[a++],o=this.serializeMark(n,e.isInline,t);o&&(i.push([n,r]),r.appendChild(o.dom),r=o.contentDOM||o.dom)}}r.appendChild(this.serializeNodeInner(e,t))}),n}serializeNodeInner(e,t){let{dom:n,contentDOM:r}=at(tt(t),this.nodes[e.type.name](e),null,e.attrs);if(r){if(e.isLeaf)throw RangeError(`Content hole not allowed in a leaf node spec`);this.serializeFragment(e.content,t,r)}return n}serializeNode(e,t={}){let n=this.serializeNodeInner(e,t);for(let r=e.marks.length-1;r>=0;r--){let i=this.serializeMark(e.marks[r],e.isInline,t);i&&((i.contentDOM||i.dom).appendChild(n),n=i.dom)}return n}serializeMark(e,t,n={}){let r=this.marks[e.type.name];return r&&at(tt(n),r(e,t),null,e.attrs)}static renderSpec(e,t,n=null,r){return at(e,t,n,r)}static fromSchema(t){return t.cached.domSerializer||(t.cached.domSerializer=new e(this.nodesFromSchema(t),this.marksFromSchema(t)))}static nodesFromSchema(e){let t=et(e.nodes);return t.text||=e=>e.text,t}static marksFromSchema(e){return et(e.marks)}};function et(e){let t={};for(let n in e){let r=e[n].spec.toDOM;r&&(t[n]=r)}return t}function tt(e){return e.document||window.document}const nt=new WeakMap;function rt(e){let t=nt.get(e);return t===void 0&&nt.set(e,t=it(e)),t}function it(e){let t=null;function n(e){if(e&&typeof e==`object`)if(Array.isArray(e))if(typeof e[0]==`string`)t||=[],t.push(e);else for(let t=0;t<e.length;t++)n(e[t]);else for(let t in e)n(e[t])}return n(e),t}function at(e,t,n,r){if(typeof t==`string`)return{dom:e.createTextNode(t)};if(t.nodeType!=null)return{dom:t};if(t.dom&&t.dom.nodeType!=null)return t;let i=t[0],a;if(typeof i!=`string`)throw RangeError(`Invalid array passed to renderSpec`);if(r&&(a=rt(r))&&a.indexOf(t)>-1)throw RangeError(`Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.`);let o=i.indexOf(` `);o>0&&(n=i.slice(0,o),i=i.slice(o+1));let s,c=n?e.createElementNS(n,i):e.createElement(i),l=t[1],u=1;if(l&&typeof l==`object`&&l.nodeType==null&&!Array.isArray(l)){u=2;for(let e in l)if(l[e]!=null){let t=e.indexOf(` `);t>0?c.setAttributeNS(e.slice(0,t),e.slice(t+1),l[e]):e==`style`&&c.style?c.style.cssText=l[e]:c.setAttribute(e,l[e])}}for(let i=u;i<t.length;i++){let a=t[i];if(a===0){if(i<t.length-1||i>u)throw RangeError(`Content hole must be the only child of its parent node`);return{dom:c,contentDOM:c}}else{let{dom:t,contentDOM:i}=at(e,a,n,r);if(c.appendChild(t),i){if(s)throw RangeError(`Multiple content holes`);s=i}}}return{dom:c,contentDOM:s}}const M=65535,ot=2**16;function st(e,t){return e+t*ot}function ct(e){return e&M}function lt(e){return(e-(e&M))/ot}var ut=class{constructor(e,t,n){this.pos=e,this.delInfo=t,this.recover=n}get deleted(){return(this.delInfo&8)>0}get deletedBefore(){return(this.delInfo&5)>0}get deletedAfter(){return(this.delInfo&6)>0}get deletedAcross(){return(this.delInfo&4)>0}},dt=class e{constructor(t,n=!1){if(this.ranges=t,this.inverted=n,!t.length&&e.empty)return e.empty}recover(e){let t=0,n=ct(e);if(!this.inverted)for(let e=0;e<n;e++)t+=this.ranges[e*3+2]-this.ranges[e*3+1];return this.ranges[n*3]+t+lt(e)}mapResult(e,t=1){return this._map(e,t,!1)}map(e,t=1){return this._map(e,t,!0)}_map(e,t,n){let r=0,i=this.inverted?2:1,a=this.inverted?1:2;for(let o=0;o<this.ranges.length;o+=3){let s=this.ranges[o]-(this.inverted?r:0);if(s>e)break;let c=this.ranges[o+i],l=this.ranges[o+a],u=s+c;if(e<=u){let i=c?e==s?-1:e==u?1:t:t,a=s+r+(i<0?0:l);if(n)return a;let d=e==(t<0?s:u)?null:st(o/3,e-s),f=e==s?2:e==u?1:4;return(t<0?e!=s:e!=u)&&(f|=8),new ut(a,f,d)}r+=l-c}return n?e+r:new ut(e+r,0,null)}touches(e,t){let n=0,r=ct(t),i=this.inverted?2:1,a=this.inverted?1:2;for(let t=0;t<this.ranges.length;t+=3){let o=this.ranges[t]-(this.inverted?n:0);if(o>e)break;let s=this.ranges[t+i];if(e<=o+s&&t==r*3)return!0;n+=this.ranges[t+a]-s}return!1}forEach(e){let t=this.inverted?2:1,n=this.inverted?1:2;for(let r=0,i=0;r<this.ranges.length;r+=3){let a=this.ranges[r],o=a-(this.inverted?i:0),s=a+(this.inverted?0:i),c=this.ranges[r+t],l=this.ranges[r+n];e(o,o+c,s,s+l),i+=l-c}}invert(){return new e(this.ranges,!this.inverted)}toString(){return(this.inverted?`-`:``)+JSON.stringify(this.ranges)}static offset(t){return t==0?e.empty:new e(t<0?[0,-t,0]:[0,0,t])}};dt.empty=new dt([]);var ft=class e{constructor(e,t,n=0,r=e?e.length:0){this.mirror=t,this.from=n,this.to=r,this._maps=e||[],this.ownData=!(e||t)}get maps(){return this._maps}slice(t=0,n=this.maps.length){return new e(this._maps,this.mirror,t,n)}appendMap(e,t){this.ownData||=(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),!0),this.to=this._maps.push(e),t!=null&&this.setMirror(this._maps.length-1,t)}appendMapping(e){for(let t=0,n=this._maps.length;t<e._maps.length;t++){let r=e.getMirror(t);this.appendMap(e._maps[t],r!=null&&r<t?n+r:void 0)}}getMirror(e){if(this.mirror){for(let t=0;t<this.mirror.length;t++)if(this.mirror[t]==e)return this.mirror[t+(t%2?-1:1)]}}setMirror(e,t){this.mirror||=[],this.mirror.push(e,t)}appendMappingInverted(e){for(let t=e.maps.length-1,n=this._maps.length+e._maps.length;t>=0;t--){let r=e.getMirror(t);this.appendMap(e._maps[t].invert(),r!=null&&r>t?n-r-1:void 0)}}invert(){let t=new e;return t.appendMappingInverted(this),t}map(e,t=1){if(this.mirror)return this._map(e,t,!0);for(let n=this.from;n<this.to;n++)e=this._maps[n].map(e,t);return e}mapResult(e,t=1){return this._map(e,t,!1)}_map(e,t,n){let r=0;for(let n=this.from;n<this.to;n++){let i=this._maps[n].mapResult(e,t);if(i.recover!=null){let t=this.getMirror(n);if(t!=null&&t>n&&t<this.to){n=t,e=this._maps[t].recover(i.recover);continue}}r|=i.delInfo,e=i.pos}return n?e:new ut(e,r,null)}};const pt=Object.create(null);var mt=class{getMap(){return dt.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw RangeError(`Invalid input for Step.fromJSON`);let n=pt[t.stepType];if(!n)throw RangeError(`No step type ${t.stepType} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in pt)throw RangeError(`Duplicate use of step JSON ID `+e);return pt[e]=t,t.prototype.jsonID=e,t}},ht=class e{constructor(e,t){this.doc=e,this.failed=t}static ok(t){return new e(t,null)}static fail(t){return new e(null,t)}static fromReplace(t,n,r,i){try{return e.ok(t.replace(n,r,i))}catch(t){if(t instanceof T)return e.fail(t.message);throw t}}};function gt(e,t,n){let r=[];for(let i=0;i<e.childCount;i++){let a=e.child(i);a.content.size&&(a=a.copy(gt(a.content,t,a))),a.isInline&&(a=t(a,n,i)),r.push(a)}return b.fromArray(r)}var _t=class e extends mt{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=e.resolve(this.from),r=n.node(n.sharedDepth(this.to)),i=new E(gt(t.content,(e,t)=>!e.isAtom||!t.type.allowsMarkType(this.mark.type)?e:e.mark(this.mark.addToSet(e.marks)),r),t.openStart,t.openEnd);return ht.fromReplace(e,this.from,this.to,i)}invert(){return new vt(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new e(n.pos,r.pos,this.mark)}merge(t){return t instanceof e&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new e(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:`addMark`,mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!=`number`||typeof n.to!=`number`)throw RangeError(`Invalid input for AddMarkStep.fromJSON`);return new e(n.from,n.to,t.markFromJSON(n.mark))}};mt.jsonID(`addMark`,_t);var vt=class e extends mt{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=new E(gt(t.content,e=>e.mark(this.mark.removeFromSet(e.marks)),e),t.openStart,t.openEnd);return ht.fromReplace(e,this.from,this.to,n)}invert(){return new _t(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new e(n.pos,r.pos,this.mark)}merge(t){return t instanceof e&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new e(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:`removeMark`,mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!=`number`||typeof n.to!=`number`)throw RangeError(`Invalid input for RemoveMarkStep.fromJSON`);return new e(n.from,n.to,t.markFromJSON(n.mark))}};mt.jsonID(`removeMark`,vt);var yt=class e extends mt{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return ht.fail(`No node at mark step's position`);let n=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return ht.fromReplace(e,this.pos,this.pos+1,new E(b.from(n),0,t.isLeaf?0:1))}invert(t){let n=t.nodeAt(this.pos);if(n){let t=this.mark.addToSet(n.marks);if(t.length==n.marks.length){for(let r=0;r<n.marks.length;r++)if(!n.marks[r].isInSet(t))return new e(this.pos,n.marks[r]);return new e(this.pos,this.mark)}}return new bt(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new e(n.pos,this.mark)}toJSON(){return{stepType:`addNodeMark`,pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if(typeof n.pos!=`number`)throw RangeError(`Invalid input for AddNodeMarkStep.fromJSON`);return new e(n.pos,t.markFromJSON(n.mark))}};mt.jsonID(`addNodeMark`,yt);var bt=class e extends mt{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return ht.fail(`No node at mark step's position`);let n=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return ht.fromReplace(e,this.pos,this.pos+1,new E(b.from(n),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);return!t||!this.mark.isInSet(t.marks)?this:new yt(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new e(n.pos,this.mark)}toJSON(){return{stepType:`removeNodeMark`,pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if(typeof n.pos!=`number`)throw RangeError(`Invalid input for RemoveNodeMarkStep.fromJSON`);return new e(n.pos,t.markFromJSON(n.mark))}};mt.jsonID(`removeNodeMark`,bt);var xt=class e extends mt{constructor(e,t,n,r=!1){super(),this.from=e,this.to=t,this.slice=n,this.structure=r}apply(e){return this.structure&&Ct(e,this.from,this.to)?ht.fail(`Structure replace would overwrite content`):ht.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new dt([this.from,this.to-this.from,this.slice.size])}invert(t){return new e(this.from,this.from+this.slice.size,t.slice(this.from,this.to))}map(t){let n=t.mapResult(this.to,-1),r=this.from==this.to&&e.MAP_BIAS<0?n:t.mapResult(this.from,1);return r.deletedAcross&&n.deletedAcross?null:new e(r.pos,Math.max(r.pos,n.pos),this.slice,this.structure)}merge(t){if(!(t instanceof e)||t.structure||this.structure)return null;if(this.from+this.slice.size==t.from&&!this.slice.openEnd&&!t.slice.openStart){let n=this.slice.size+t.slice.size==0?E.empty:new E(this.slice.content.append(t.slice.content),this.slice.openStart,t.slice.openEnd);return new e(this.from,this.to+(t.to-t.from),n,this.structure)}else if(t.to==this.from&&!this.slice.openStart&&!t.slice.openEnd){let n=this.slice.size+t.slice.size==0?E.empty:new E(t.slice.content.append(this.slice.content),t.slice.openStart,this.slice.openEnd);return new e(t.from,this.to,n,this.structure)}else return null}toJSON(){let e={stepType:`replace`,from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(t,n){if(typeof n.from!=`number`||typeof n.to!=`number`)throw RangeError(`Invalid input for ReplaceStep.fromJSON`);return new e(n.from,n.to,E.fromJSON(t,n.slice),!!n.structure)}};xt.MAP_BIAS=1,mt.jsonID(`replace`,xt);var St=class e extends mt{constructor(e,t,n,r,i,a,o=!1){super(),this.from=e,this.to=t,this.gapFrom=n,this.gapTo=r,this.slice=i,this.insert=a,this.structure=o}apply(e){if(this.structure&&(Ct(e,this.from,this.gapFrom)||Ct(e,this.gapTo,this.to)))return ht.fail(`Structure gap-replace would overwrite content`);let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return ht.fail(`Gap is not a flat range`);let n=this.slice.insertAt(this.insert,t.content);return n?ht.fromReplace(e,this.from,this.to,n):ht.fail(`Content does not fit in gap`)}getMap(){return new dt([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(t){let n=this.gapTo-this.gapFrom;return new e(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,t.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1),i=this.from==this.gapFrom?n.pos:t.map(this.gapFrom,-1),a=this.to==this.gapTo?r.pos:t.map(this.gapTo,1);return n.deletedAcross&&r.deletedAcross||i<n.pos||a>r.pos?null:new e(n.pos,r.pos,i,a,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:`replaceAround`,from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(t,n){if(typeof n.from!=`number`||typeof n.to!=`number`||typeof n.gapFrom!=`number`||typeof n.gapTo!=`number`||typeof n.insert!=`number`)throw RangeError(`Invalid input for ReplaceAroundStep.fromJSON`);return new e(n.from,n.to,n.gapFrom,n.gapTo,E.fromJSON(t,n.slice),n.insert,!!n.structure)}};mt.jsonID(`replaceAround`,St);function Ct(e,t,n){let r=e.resolve(t),i=n-t,a=r.depth;for(;i>0&&a>0&&r.indexAfter(a)==r.node(a).childCount;)a--,i--;if(i>0){let e=r.node(a).maybeChild(r.indexAfter(a));for(;i>0;){if(!e||e.isLeaf)return!0;e=e.firstChild,i--}}return!1}function wt(e,t,n,r){let i=[],a=[],o,s;e.doc.nodesBetween(t,n,(e,c,l)=>{if(!e.isInline)return;let u=e.marks;if(!r.isInSet(u)&&l.type.allowsMarkType(r.type)){let l=Math.max(c,t),d=Math.min(c+e.nodeSize,n),f=r.addToSet(u);for(let e=0;e<u.length;e++)u[e].isInSet(f)||(o&&o.to==l&&o.mark.eq(u[e])?o.to=d:i.push(o=new vt(l,d,u[e])));s&&s.to==l?s.to=d:a.push(s=new _t(l,d,r))}}),i.forEach(t=>e.step(t)),a.forEach(t=>e.step(t))}function Tt(e,t,n,r){let i=[],a=0;e.doc.nodesBetween(t,n,(e,o)=>{if(!e.isInline)return;a++;let s=null;if(r instanceof Le){let t=e.marks,n;for(;n=r.isInSet(t);)(s||=[]).push(n),t=n.removeFromSet(t)}else r?r.isInSet(e.marks)&&(s=[r]):s=e.marks;if(s&&s.length){let r=Math.min(o+e.nodeSize,n);for(let e=0;e<s.length;e++){let n=s[e],c;for(let e=0;e<i.length;e++){let t=i[e];t.step==a-1&&n.eq(i[e].style)&&(c=t)}c?(c.to=r,c.step=a):i.push({style:n,from:Math.max(o,t),to:r,step:a})}}}),i.forEach(t=>e.step(new vt(t.from,t.to,t.style)))}function Et(e,t,n,r=n.contentMatch,i=!0){let a=e.doc.nodeAt(t),o=[],s=t+1;for(let t=0;t<a.childCount;t++){let c=a.child(t),l=s+c.nodeSize,u=r.matchType(c.type);if(!u)o.push(new xt(s,l,E.empty));else{r=u;for(let t=0;t<c.marks.length;t++)n.allowsMarkType(c.marks[t].type)||e.step(new vt(s,l,c.marks[t]));if(i&&c.isText&&n.whitespace!=`pre`){let e,t=/\r?\n|\r/g,r;for(;e=t.exec(c.text);)r||=new E(b.from(n.schema.text(` `,n.allowedMarks(c.marks))),0,0),o.push(new xt(s+e.index,s+e.index+e[0].length,r))}}s=l}if(!r.validEnd){let t=r.fillBefore(b.empty,!0);e.replace(s,s,new E(t,0,0))}for(let t=o.length-1;t>=0;t--)e.step(o[t])}function Dt(e,t,n){return(t==0||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function Ot(e){let t=e.parent.content.cutByIndex(e.startIndex,e.endIndex);for(let n=e.depth,r=0,i=0;;--n){let a=e.$from.node(n),o=e.$from.index(n)+r,s=e.$to.indexAfter(n)-i;if(n<e.depth&&a.canReplace(o,s,t))return n;if(n==0||a.type.spec.isolating||!Dt(a,o,s))break;o&&(r=1),s<a.childCount&&(i=1)}return null}function kt(e,t,n){let{$from:r,$to:i,depth:a}=t,o=r.before(a+1),s=i.after(a+1),c=o,l=s,u=b.empty,d=0;for(let e=a,t=!1;e>n;e--)t||r.index(e)>0?(t=!0,u=b.from(r.node(e).copy(u)),d++):c--;let f=b.empty,p=0;for(let e=a,t=!1;e>n;e--)t||i.after(e+1)<i.end(e)?(t=!0,f=b.from(i.node(e).copy(f)),p++):l++;e.step(new St(c,l,o,s,new E(u.append(f),d,p),u.size-d,!0))}function At(e,t,n=null,r=e){let i=Mt(e,t),a=i&&Nt(r,t);return a?i.map(jt).concat({type:t,attrs:n}).concat(a.map(jt)):null}function jt(e){return{type:e,attrs:null}}function Mt(e,t){let{parent:n,startIndex:r,endIndex:i}=e,a=n.contentMatchAt(r).findWrapping(t);if(!a)return null;let o=a.length?a[0]:t;return n.canReplaceWith(r,i,o)?a:null}function Nt(e,t){let{parent:n,startIndex:r,endIndex:i}=e,a=n.child(r),o=t.contentMatch.findWrapping(a.type);if(!o)return null;let s=(o.length?o[o.length-1]:t).contentMatch;for(let e=r;s&&e<i;e++)s=s.matchType(n.child(e).type);return!s||!s.validEnd?null:o}function Pt(e,t,n){let r=b.empty;for(let e=n.length-1;e>=0;e--){if(r.size){let t=n[e].type.contentMatch.matchFragment(r);if(!t||!t.validEnd)throw RangeError(`Wrapper type given to Transform.wrap does not form valid content of its parent wrapper`)}r=b.from(n[e].type.create(n[e].attrs,r))}let i=t.start,a=t.end;e.step(new St(i,a,i,a,new E(r,0,0),n.length,!0))}function Ft(e,t,n,r,i){if(!r.isTextblock)throw RangeError(`Type given to setBlockType should be a textblock`);let a=e.steps.length;e.doc.nodesBetween(t,n,(t,n)=>{let o=typeof i==`function`?i(t):i;if(t.isTextblock&&!t.hasMarkup(r,o)&&Rt(e.doc,e.mapping.slice(a).map(n),r)){let i=null;if(r.schema.linebreakReplacement){let e=r.whitespace==`pre`,t=!!r.contentMatch.matchType(r.schema.linebreakReplacement);e&&!t?i=!1:!e&&t&&(i=!0)}i===!1&&Lt(e,t,n,a),Et(e,e.mapping.slice(a).map(n,1),r,void 0,i===null);let s=e.mapping.slice(a),c=s.map(n,1),l=s.map(n+t.nodeSize,1);return e.step(new St(c,l,c+1,l-1,new E(b.from(r.create(o,null,t.marks)),0,0),1,!0)),i===!0&&It(e,t,n,a),!1}})}function It(e,t,n,r){t.forEach((i,a)=>{if(i.isText){let o,s=/\r?\n|\r/g;for(;o=s.exec(i.text);){let i=e.mapping.slice(r).map(n+1+a+o.index);e.replaceWith(i,i+1,t.type.schema.linebreakReplacement.create())}}})}function Lt(e,t,n,r){t.forEach((i,a)=>{if(i.type==i.type.schema.linebreakReplacement){let i=e.mapping.slice(r).map(n+1+a);e.replaceWith(i,i+1,t.type.schema.text(`
@@ -158,4 +158,4 @@ ${t.slice(l+2)}`,d+=1;else break}t.push({indent:l,number:parseInt(s,10),content:
158
158
  `).replace(/\n{3,}/g,`
159
159
 
160
160
  `).replace(/\n+$/,``)}const KM={setTimeout:(e,t)=>globalThis.setTimeout(e,t),clearTimeout:e=>globalThis.clearTimeout(e),now:()=>Date.now()};function qM(){let e=!1,t=``,n=0;return r=>{let i=JM(r);return e?(i&&i.char===t&&i.len>=n&&!i.hasInfo&&(e=!1,t=``,n=0),!0):i?(e=!0,t=i.char,n=i.len,!0):!1}}function JM(e){let t=(e.endsWith(`\r`)?e.slice(0,-1):e).match(/^ {0,3}([`~])(\1{2,})(.*)$/);return t?{char:t[1],len:1+t[2].length,hasInfo:t[3].trim()!==``}:null}const YM=[`#D97757`,`#1B1912`,`#F9F3E9`,`#7A9DFF`,`#8534F3`,`#9663F0`,`#727CF3`],XM={claude:`#D97757`,cursor:`#1B1912`,windsurf:`#0B100F`,openai:`#7A9DFF`,github:`#8534F3`,cline:`#9663F0`,bot:`#727CF3`};function ZM(e){let t=0;for(let n of e)t=(t<<5)-t+n.charCodeAt(0)|0;return YM[Math.abs(t)%YM.length]}const QM={"claude-code":`claude`,"claude-ai":`claude`,cursor:`cursor`,"cursor-vscode":`cursor`,cascade:`windsurf`,codex:`openai`,copilot:`github`,cline:`cline`};function $M(e){return e?QM[e]??`bot`:`bot`}function eN(e,t){let n=e.trim();if(!n||/^[a-zA-Z][a-zA-Z\d+\-.]*:/.test(n)||n.startsWith(`//`)||n.startsWith(`/`)||n.startsWith(`#`))return null;let r=n.indexOf(`#`),i=r>=0?n.slice(0,r):n,a=r>=0?n.slice(r+1):null,o=(i.split(`?`)[0]??``).trim();if(!o)return null;let s=o.endsWith(`.md`)?o.slice(0,-3):o,c=t.includes(`/`)?t.split(`/`).slice(0,-1):[];for(let e of s.split(`/`))if(e===`..`){if(c.length===0)return null;c.pop()}else e!==`.`&&e!==``&&c.push(e);return c.length===0?null:{docName:c.join(`/`),anchor:a||null}}const tN=/^[a-zA-Z][a-zA-Z\d+\-.]*:/;function nN(e){let t=e.trim();return tN.test(t)||t.startsWith(`//`)}function rN(e,t){let n=e.trim();if(!n)return null;if(n.startsWith(`#`)){let e=n.slice(1).trim();return e?{kind:`anchor`,anchor:e}:null}let r=eN(n,t);return r?{kind:`doc`,docName:r.docName,anchor:r.anchor}:n.startsWith(`/`)||nN(n)?{kind:`external`,url:n}:null}function iN(e,t){let n=e.trim();return n?nN(n)?{kind:`external`,url:t?`${n}#${t}`:n}:{kind:`doc`,docName:n,anchor:t?.trim()||null}:null}export{p as A,Vl as C,g as D,h as E,u as M,m as O,qd as S,b as T,fM as _,ZM as a,xg as b,KM as c,IM as d,AM as f,xM as g,CM as h,XM as i,d as j,f as k,GM as l,OM as m,iN as n,$M as o,kM as p,eN as r,qM as s,rN as t,BM as u,AO as v,jn as w,Jd as x,Sg as y};
161
- //# sourceMappingURL=src-CQw-HNNM.mjs.map
161
+ //# sourceMappingURL=src-CB-sXsMW.mjs.map
@@ -0,0 +1 @@
1
+ import"./init-BBVwEA2N.mjs";import"./loader-C-EaZX2e.mjs";export{};