@prismicio/editor-fields 0.1.0-rc.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. package/README.md +1 -0
  2. package/dist/DocumentEditor.d.ts +14 -0
  3. package/dist/GroupEditor.d.ts +12 -0
  4. package/dist/NestableWidgetSwitch.d.ts +12 -0
  5. package/dist/SectionEditor.d.ts +12 -0
  6. package/dist/domain/Document.d.ts +8 -0
  7. package/dist/domain/Field.d.ts +5 -0
  8. package/dist/domain/Group.d.ts +6 -0
  9. package/dist/domain/NestableWidget.d.ts +12 -0
  10. package/dist/domain/Section.d.ts +10 -0
  11. package/dist/domain/SharedSlices.d.ts +3 -0
  12. package/dist/domain/StaticWidget.d.ts +7 -0
  13. package/dist/domain/Widget.d.ts +10 -0
  14. package/dist/domain/slices/CompositeSlice.d.ts +6 -0
  15. package/dist/domain/slices/LegacySlice.d.ts +4 -0
  16. package/dist/domain/slices/SharedSlice.d.ts +9 -0
  17. package/dist/domain/zones/NonRepeatableZone.d.ts +5 -0
  18. package/dist/domain/zones/RepeatableZone.d.ts +8 -0
  19. package/dist/domain/zones/SliceZone.d.ts +8 -0
  20. package/dist/domain/zones/StaticZone.d.ts +5 -0
  21. package/dist/fields/KeyTextField.d.ts +12 -0
  22. package/dist/fields/RichTextField/BubbleMenu.d.ts +8 -0
  23. package/dist/fields/RichTextField/RichTextField.d.ts +12 -0
  24. package/dist/fields/RichTextField/coreExtensions/Document.d.ts +3 -0
  25. package/dist/fields/RichTextField/coreExtensions/HardBreak.d.ts +12 -0
  26. package/dist/fields/RichTextField/coreExtensions/ListItem.d.ts +45 -0
  27. package/dist/fields/RichTextField/coreExtensions/Placeholder.d.ts +3 -0
  28. package/dist/fields/RichTextField/coreExtensions/SlashCommands.d.ts +4 -0
  29. package/dist/fields/RichTextField/coreExtensions/Text.d.ts +15 -0
  30. package/dist/fields/RichTextField/coreExtensions/index.d.ts +9 -0
  31. package/dist/fields/RichTextField/extensions/Bold.d.ts +3 -0
  32. package/dist/fields/RichTextField/extensions/BulletList.d.ts +3 -0
  33. package/dist/fields/RichTextField/extensions/CodeBlock.d.ts +3 -0
  34. package/dist/fields/RichTextField/extensions/Embed/EmbedView.d.ts +3 -0
  35. package/dist/fields/RichTextField/extensions/Embed/index.d.ts +10 -0
  36. package/dist/fields/RichTextField/extensions/Heading.d.ts +21 -0
  37. package/dist/fields/RichTextField/extensions/Italic.d.ts +3 -0
  38. package/dist/fields/RichTextField/extensions/Link.d.ts +4 -0
  39. package/dist/fields/RichTextField/extensions/OrderedList.d.ts +3 -0
  40. package/dist/fields/RichTextField/extensions/Paragraph.d.ts +3 -0
  41. package/dist/fields/RichTextField/extensions/index.d.ts +14 -0
  42. package/dist/fields/RichTextField/globalExtensions/TextDirection.d.ts +40 -0
  43. package/dist/fields/RichTextField/globalExtensions/index.d.ts +1 -0
  44. package/dist/fields/RichTextField/index.d.ts +1 -0
  45. package/dist/fields/RichTextField/models/EditorExtension.d.ts +109 -0
  46. package/dist/fields/RichTextField/models/MenuItems.d.ts +24 -0
  47. package/dist/fields/RichTextField/models/RichTextConfig.d.ts +10 -0
  48. package/dist/fields/RichTextField/models/Span.d.ts +12 -0
  49. package/dist/fields/RichTextField/models/helpers/NodeUtils.d.ts +15 -0
  50. package/dist/fields/RichTextField/models/helpers/index.d.ts +1 -0
  51. package/dist/fields/RichTextField/models/index.d.ts +3 -0
  52. package/dist/fields/SelectField.d.ts +12 -0
  53. package/dist/index.d.ts +3 -0
  54. package/dist/index.es.js +48794 -0
  55. package/dist/index.umd.js +121 -0
  56. package/dist/slices/CompositeSliceEditor.d.ts +12 -0
  57. package/dist/slices/LegacySliceEditor.d.ts +12 -0
  58. package/dist/slices/SharedSliceEditor.d.ts +12 -0
  59. package/dist/zones/NonRepeatableZoneEditor.d.ts +11 -0
  60. package/dist/zones/RepeatableZoneEditor.d.ts +11 -0
  61. package/dist/zones/SliceZoneEditor.d.ts +12 -0
  62. package/dist/zones/StaticZoneEditor.d.ts +11 -0
  63. package/package.json +82 -0
@@ -0,0 +1,121 @@
1
+ var D1t=Object.defineProperty,L1t=Object.defineProperties;var U1t=Object.getOwnPropertyDescriptors;var qy=Object.getOwnPropertySymbols;var B3=Object.prototype.hasOwnProperty,z3=Object.prototype.propertyIsEnumerable;var DR=(At,tt,Y)=>tt in At?D1t(At,tt,{enumerable:!0,configurable:!0,writable:!0,value:Y}):At[tt]=Y,_=(At,tt)=>{for(var Y in tt||(tt={}))B3.call(tt,Y)&&DR(At,Y,tt[Y]);if(qy)for(var Y of qy(tt))z3.call(tt,Y)&&DR(At,Y,tt[Y]);return At},K=(At,tt)=>L1t(At,U1t(tt));var Wn=(At,tt)=>{var Y={};for(var ln in At)B3.call(At,ln)&&tt.indexOf(ln)<0&&(Y[ln]=At[ln]);if(At!=null&&qy)for(var ln of qy(At))tt.indexOf(ln)<0&&z3.call(At,ln)&&(Y[ln]=At[ln]);return Y};var xc=(At,tt,Y)=>(DR(At,typeof tt!="symbol"?tt+"":tt,Y),Y);(function(At,tt){typeof exports=="object"&&typeof module!="undefined"?tt(exports,require("react"),require("@prismicio/editor-ui"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","@prismicio/editor-ui","react-dom"],tt):(At=typeof globalThis!="undefined"?globalThis:At||self,tt(At.EditorFields={},At.React,At.EditorUi,At.ReactDOM))})(this,function(At,tt,Y,ln){"use strict";function LR(t){return t&&typeof t=="object"&&"default"in t?t:{default:t}}function UR(t){if(t&&t.__esModule)return t;var e={__proto__:null,[Symbol.toStringTag]:"Module"};return t&&Object.keys(t).forEach(function(r){if(r!=="default"){var n=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(e,r,n.get?n:{enumerable:!0,get:function(){return t[r]}})}}),e.default=t,Object.freeze(e)}var rl=LR(tt),bt=UR(tt),q3=LR(ln),K3=UR(ln);let V3=(t=21)=>{let e="",r=crypto.getRandomValues(new Uint8Array(t));for(;t--;){let n=r[t]&63;n<36?e+=n.toString(36):n<62?e+=(n-26).toString(36).toUpperCase():n<63?e+="_":e+="-"}return e};function H3(t){const e=tt.useRef(t);return tt.useEffect(()=>{e.current=t}),tt.useMemo(()=>(...r)=>{var n;return(n=e.current)==null?void 0:n.call(e,...r)},[])}function Ky(){return tt.useRef(V3()).current}var ut=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{};function Li(t){if(t.__esModule)return t;var e=Object.defineProperty({},"__esModule",{value:!0});return Object.keys(t).forEach(function(r){var n=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(e,r,n.get?n:{enumerable:!0,get:function(){return t[r]}})}),e}var jR={},X={exports:{}};/*! *****************************************************************************
2
+ Copyright (c) Microsoft Corporation.
3
+
4
+ Permission to use, copy, modify, and/or distribute this software for any
5
+ purpose with or without fee is hereby granted.
6
+
7
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
8
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
9
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
10
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
11
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
12
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
13
+ PERFORMANCE OF THIS SOFTWARE.
14
+ ***************************************************************************** */(function(t){var e,r,n,o,i,a,u,c,s,f,l,p,d,h,m,g,b,$,w,y,I,S,k,C;(function(B){var q=typeof ut=="object"?ut:typeof self=="object"?self:typeof this=="object"?this:{};B(G(q,G(t.exports)));function G(O,R){return O!==q&&(typeof Object.create=="function"?Object.defineProperty(O,"__esModule",{value:!0}):O.__esModule=!0),function(x,F){return O[x]=R?R(x,F):F}}})(function(B){var q=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(O,R){O.__proto__=R}||function(O,R){for(var x in R)Object.prototype.hasOwnProperty.call(R,x)&&(O[x]=R[x])};e=function(O,R){if(typeof R!="function"&&R!==null)throw new TypeError("Class extends value "+String(R)+" is not a constructor or null");q(O,R);function x(){this.constructor=O}O.prototype=R===null?Object.create(R):(x.prototype=R.prototype,new x)},r=Object.assign||function(O){for(var R,x=1,F=arguments.length;x<F;x++){R=arguments[x];for(var L in R)Object.prototype.hasOwnProperty.call(R,L)&&(O[L]=R[L])}return O},n=function(O,R){var x={};for(var F in O)Object.prototype.hasOwnProperty.call(O,F)&&R.indexOf(F)<0&&(x[F]=O[F]);if(O!=null&&typeof Object.getOwnPropertySymbols=="function")for(var L=0,F=Object.getOwnPropertySymbols(O);L<F.length;L++)R.indexOf(F[L])<0&&Object.prototype.propertyIsEnumerable.call(O,F[L])&&(x[F[L]]=O[F[L]]);return x},o=function(O,R,x,F){var L=arguments.length,U=L<3?R:F===null?F=Object.getOwnPropertyDescriptor(R,x):F,rt;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")U=Reflect.decorate(O,R,x,F);else for(var T=O.length-1;T>=0;T--)(rt=O[T])&&(U=(L<3?rt(U):L>3?rt(R,x,U):rt(R,x))||U);return L>3&&U&&Object.defineProperty(R,x,U),U},i=function(O,R){return function(x,F){R(x,F,O)}},a=function(O,R){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(O,R)},u=function(O,R,x,F){function L(U){return U instanceof x?U:new x(function(rt){rt(U)})}return new(x||(x=Promise))(function(U,rt){function T(at){try{N(F.next(at))}catch(cr){rt(cr)}}function M(at){try{N(F.throw(at))}catch(cr){rt(cr)}}function N(at){at.done?U(at.value):L(at.value).then(T,M)}N((F=F.apply(O,R||[])).next())})},c=function(O,R){var x={label:0,sent:function(){if(U[0]&1)throw U[1];return U[1]},trys:[],ops:[]},F,L,U,rt;return rt={next:T(0),throw:T(1),return:T(2)},typeof Symbol=="function"&&(rt[Symbol.iterator]=function(){return this}),rt;function T(N){return function(at){return M([N,at])}}function M(N){if(F)throw new TypeError("Generator is already executing.");for(;x;)try{if(F=1,L&&(U=N[0]&2?L.return:N[0]?L.throw||((U=L.return)&&U.call(L),0):L.next)&&!(U=U.call(L,N[1])).done)return U;switch(L=0,U&&(N=[N[0]&2,U.value]),N[0]){case 0:case 1:U=N;break;case 4:return x.label++,{value:N[1],done:!1};case 5:x.label++,L=N[1],N=[0];continue;case 7:N=x.ops.pop(),x.trys.pop();continue;default:if(U=x.trys,!(U=U.length>0&&U[U.length-1])&&(N[0]===6||N[0]===2)){x=0;continue}if(N[0]===3&&(!U||N[1]>U[0]&&N[1]<U[3])){x.label=N[1];break}if(N[0]===6&&x.label<U[1]){x.label=U[1],U=N;break}if(U&&x.label<U[2]){x.label=U[2],x.ops.push(N);break}U[2]&&x.ops.pop(),x.trys.pop();continue}N=R.call(O,x)}catch(at){N=[6,at],L=0}finally{F=U=0}if(N[0]&5)throw N[1];return{value:N[0]?N[1]:void 0,done:!0}}},s=function(O,R){for(var x in O)x!=="default"&&!Object.prototype.hasOwnProperty.call(R,x)&&C(R,O,x)},C=Object.create?function(O,R,x,F){F===void 0&&(F=x),Object.defineProperty(O,F,{enumerable:!0,get:function(){return R[x]}})}:function(O,R,x,F){F===void 0&&(F=x),O[F]=R[x]},f=function(O){var R=typeof Symbol=="function"&&Symbol.iterator,x=R&&O[R],F=0;if(x)return x.call(O);if(O&&typeof O.length=="number")return{next:function(){return O&&F>=O.length&&(O=void 0),{value:O&&O[F++],done:!O}}};throw new TypeError(R?"Object is not iterable.":"Symbol.iterator is not defined.")},l=function(O,R){var x=typeof Symbol=="function"&&O[Symbol.iterator];if(!x)return O;var F=x.call(O),L,U=[],rt;try{for(;(R===void 0||R-- >0)&&!(L=F.next()).done;)U.push(L.value)}catch(T){rt={error:T}}finally{try{L&&!L.done&&(x=F.return)&&x.call(F)}finally{if(rt)throw rt.error}}return U},p=function(){for(var O=[],R=0;R<arguments.length;R++)O=O.concat(l(arguments[R]));return O},d=function(){for(var O=0,R=0,x=arguments.length;R<x;R++)O+=arguments[R].length;for(var F=Array(O),L=0,R=0;R<x;R++)for(var U=arguments[R],rt=0,T=U.length;rt<T;rt++,L++)F[L]=U[rt];return F},h=function(O,R,x){if(x||arguments.length===2)for(var F=0,L=R.length,U;F<L;F++)(U||!(F in R))&&(U||(U=Array.prototype.slice.call(R,0,F)),U[F]=R[F]);return O.concat(U||Array.prototype.slice.call(R))},m=function(O){return this instanceof m?(this.v=O,this):new m(O)},g=function(O,R,x){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var F=x.apply(O,R||[]),L,U=[];return L={},rt("next"),rt("throw"),rt("return"),L[Symbol.asyncIterator]=function(){return this},L;function rt(Ut){F[Ut]&&(L[Ut]=function(_e){return new Promise(function(Ir,jo){U.push([Ut,_e,Ir,jo])>1||T(Ut,_e)})})}function T(Ut,_e){try{M(F[Ut](_e))}catch(Ir){cr(U[0][3],Ir)}}function M(Ut){Ut.value instanceof m?Promise.resolve(Ut.value.v).then(N,at):cr(U[0][2],Ut)}function N(Ut){T("next",Ut)}function at(Ut){T("throw",Ut)}function cr(Ut,_e){Ut(_e),U.shift(),U.length&&T(U[0][0],U[0][1])}},b=function(O){var R,x;return R={},F("next"),F("throw",function(L){throw L}),F("return"),R[Symbol.iterator]=function(){return this},R;function F(L,U){R[L]=O[L]?function(rt){return(x=!x)?{value:m(O[L](rt)),done:L==="return"}:U?U(rt):rt}:U}},$=function(O){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var R=O[Symbol.asyncIterator],x;return R?R.call(O):(O=typeof f=="function"?f(O):O[Symbol.iterator](),x={},F("next"),F("throw"),F("return"),x[Symbol.asyncIterator]=function(){return this},x);function F(U){x[U]=O[U]&&function(rt){return new Promise(function(T,M){rt=O[U](rt),L(T,M,rt.done,rt.value)})}}function L(U,rt,T,M){Promise.resolve(M).then(function(N){U({value:N,done:T})},rt)}},w=function(O,R){return Object.defineProperty?Object.defineProperty(O,"raw",{value:R}):O.raw=R,O};var G=Object.create?function(O,R){Object.defineProperty(O,"default",{enumerable:!0,value:R})}:function(O,R){O.default=R};y=function(O){if(O&&O.__esModule)return O;var R={};if(O!=null)for(var x in O)x!=="default"&&Object.prototype.hasOwnProperty.call(O,x)&&C(R,O,x);return G(R,O),R},I=function(O){return O&&O.__esModule?O:{default:O}},S=function(O,R,x,F){if(x==="a"&&!F)throw new TypeError("Private accessor was defined without a getter");if(typeof R=="function"?O!==R||!F:!R.has(O))throw new TypeError("Cannot read private member from an object whose class did not declare it");return x==="m"?F:x==="a"?F.call(O):F?F.value:R.get(O)},k=function(O,R,x,F,L){if(F==="m")throw new TypeError("Private method is not writable");if(F==="a"&&!L)throw new TypeError("Private accessor was defined without a setter");if(typeof R=="function"?O!==R||!L:!R.has(O))throw new TypeError("Cannot write private member to an object whose class did not declare it");return F==="a"?L.call(O,x):L?L.value=x:R.set(O,x),x},B("__extends",e),B("__assign",r),B("__rest",n),B("__decorate",o),B("__param",i),B("__metadata",a),B("__awaiter",u),B("__generator",c),B("__exportStar",s),B("__createBinding",C),B("__values",f),B("__read",l),B("__spread",p),B("__spreadArrays",d),B("__spreadArray",h),B("__await",m),B("__asyncGenerator",g),B("__asyncDelegator",b),B("__asyncValues",$),B("__makeTemplateObject",w),B("__importStar",y),B("__importDefault",I),B("__classPrivateFieldGet",S),B("__classPrivateFieldSet",k)})})(X);var Ye={},qo={},kc={},Ce={},Ko={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.getEndomorphismMonoid=t.not=t.SK=t.hole=t.pipe=t.untupled=t.tupled=t.absurd=t.decrement=t.increment=t.tuple=t.flow=t.flip=t.constVoid=t.constUndefined=t.constNull=t.constFalse=t.constTrue=t.constant=t.unsafeCoerce=t.identity=t.apply=t.getRing=t.getSemiring=t.getMonoid=t.getSemigroup=t.getBooleanAlgebra=void 0;var e=function(I){return function(){return{meet:function(S,k){return function(C){return I.meet(S(C),k(C))}},join:function(S,k){return function(C){return I.join(S(C),k(C))}},zero:function(){return I.zero},one:function(){return I.one},implies:function(S,k){return function(C){return I.implies(S(C),k(C))}},not:function(S){return function(k){return I.not(S(k))}}}}};t.getBooleanAlgebra=e;var r=function(I){return function(){return{concat:function(S,k){return function(C){return I.concat(S(C),k(C))}}}}};t.getSemigroup=r;var n=function(I){var S=t.getSemigroup(I);return function(){return{concat:S().concat,empty:function(){return I.empty}}}};t.getMonoid=n;var o=function(I){return{add:function(S,k){return function(C){return I.add(S(C),k(C))}},zero:function(){return I.zero},mul:function(S,k){return function(C){return I.mul(S(C),k(C))}},one:function(){return I.one}}};t.getSemiring=o;var i=function(I){var S=t.getSemiring(I);return{add:S.add,mul:S.mul,one:S.one,zero:S.zero,sub:function(k,C){return function(B){return I.sub(k(B),C(B))}}}};t.getRing=i;var a=function(I){return function(S){return S(I)}};t.apply=a;function u(I){return I}t.identity=u,t.unsafeCoerce=u;function c(I){return function(){return I}}t.constant=c,t.constTrue=c(!0),t.constFalse=c(!1),t.constNull=c(null),t.constUndefined=c(void 0),t.constVoid=t.constUndefined;function s(I){return function(S,k){return I(k,S)}}t.flip=s;function f(I,S,k,C,B,q,G,O,R){switch(arguments.length){case 1:return I;case 2:return function(){return S(I.apply(this,arguments))};case 3:return function(){return k(S(I.apply(this,arguments)))};case 4:return function(){return C(k(S(I.apply(this,arguments))))};case 5:return function(){return B(C(k(S(I.apply(this,arguments)))))};case 6:return function(){return q(B(C(k(S(I.apply(this,arguments))))))};case 7:return function(){return G(q(B(C(k(S(I.apply(this,arguments)))))))};case 8:return function(){return O(G(q(B(C(k(S(I.apply(this,arguments))))))))};case 9:return function(){return R(O(G(q(B(C(k(S(I.apply(this,arguments)))))))))}}}t.flow=f;function l(){for(var I=[],S=0;S<arguments.length;S++)I[S]=arguments[S];return I}t.tuple=l;function p(I){return I+1}t.increment=p;function d(I){return I-1}t.decrement=d;function h(I){throw new Error("Called `absurd` function which should be uncallable")}t.absurd=h;function m(I){return function(S){return I.apply(void 0,S)}}t.tupled=m;function g(I){return function(){for(var S=[],k=0;k<arguments.length;k++)S[k]=arguments[k];return I(S)}}t.untupled=g;function b(I,S,k,C,B,q,G,O,R){switch(arguments.length){case 1:return I;case 2:return S(I);case 3:return k(S(I));case 4:return C(k(S(I)));case 5:return B(C(k(S(I))));case 6:return q(B(C(k(S(I)))));case 7:return G(q(B(C(k(S(I))))));case 8:return O(G(q(B(C(k(S(I)))))));case 9:return R(O(G(q(B(C(k(S(I))))))));default:for(var x=arguments[0],F=1;F<arguments.length;F++)x=arguments[F](x);return x}}t.pipe=b,t.hole=h;var $=function(I,S){return S};t.SK=$;function w(I){return function(S){return!I(S)}}t.not=w;var y=function(){return{concat:function(I,S){return f(I,S)},empty:u}};t.getEndomorphismMonoid=y})(Ko),Object.defineProperty(Ce,"__esModule",{value:!0}),Ce.sequenceS=Ce.sequenceT=Ce.getApplySemigroup=Ce.apS=Ce.apSecond=Ce.apFirst=Ce.ap=void 0;var J3=Ko;function G3(t,e){return function(r){return function(n){return t.ap(t.map(n,function(o){return function(i){return e.ap(o,i)}}),r)}}}Ce.ap=G3;function Y3(t){return function(e){return function(r){return t.ap(t.map(r,function(n){return function(){return n}}),e)}}}Ce.apFirst=Y3;function X3(t){return function(e){return function(r){return t.ap(t.map(r,function(){return function(n){return n}}),e)}}}Ce.apSecond=X3;function Z3(t){return function(e,r){return function(n){return t.ap(t.map(n,function(o){return function(i){var a;return Object.assign({},o,(a={},a[e]=i,a))}}),r)}}}Ce.apS=Z3;function Q3(t){return function(e){return{concat:function(r,n){return t.ap(t.map(r,function(o){return function(i){return e.concat(o,i)}}),n)}}}}Ce.getApplySemigroup=Q3;function Vy(t,e,r){return function(n){for(var o=Array(r.length+1),i=0;i<r.length;i++)o[i]=r[i];return o[r.length]=n,e===0?t.apply(null,o):Vy(t,e-1,o)}}var Hy={1:function(t){return[t]},2:function(t){return function(e){return[t,e]}},3:function(t){return function(e){return function(r){return[t,e,r]}}},4:function(t){return function(e){return function(r){return function(n){return[t,e,r,n]}}}},5:function(t){return function(e){return function(r){return function(n){return function(o){return[t,e,r,n,o]}}}}}};function tV(t){return Hy.hasOwnProperty(t)||(Hy[t]=Vy(J3.tuple,t-1,[])),Hy[t]}function eV(t){return function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];for(var n=e.length,o=tV(n),i=t.map(e[0],o),a=1;a<n;a++)i=t.ap(i,e[a]);return i}}Ce.sequenceT=eV;function rV(t){var e=t.length;switch(e){case 1:return function(r){var n;return n={},n[t[0]]=r,n};case 2:return function(r){return function(n){var o;return o={},o[t[0]]=r,o[t[1]]=n,o}};case 3:return function(r){return function(n){return function(o){var i;return i={},i[t[0]]=r,i[t[1]]=n,i[t[2]]=o,i}}};case 4:return function(r){return function(n){return function(o){return function(i){var a;return a={},a[t[0]]=r,a[t[1]]=n,a[t[2]]=o,a[t[3]]=i,a}}}};case 5:return function(r){return function(n){return function(o){return function(i){return function(a){var u;return u={},u[t[0]]=r,u[t[1]]=n,u[t[2]]=o,u[t[3]]=i,u[t[4]]=a,u}}}}};default:return Vy(function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];for(var o={},i=0;i<e;i++)o[t[i]]=r[i];return o},e-1,[])}}function nV(t){return function(e){for(var r=Object.keys(e),n=r.length,o=rV(r),i=t.map(e[r[0]],o),a=1;a<n;a++)i=t.ap(i,e[r[a]]);return i}}Ce.sequenceS=nV;var pn={};Object.defineProperty(pn,"__esModule",{value:!0}),pn.getFunctorComposition=pn.bindTo=pn.flap=pn.map=void 0;var oV=Ko;function BR(t,e){return function(r){return function(n){return t.map(n,function(o){return e.map(o,r)})}}}pn.map=BR;function iV(t){return function(e){return function(r){return t.map(r,function(n){return n(e)})}}}pn.flap=iV;function aV(t){return function(e){return function(r){return t.map(r,function(n){var o;return o={},o[e]=n,o})}}}pn.bindTo=aV;function uV(t,e){var r=BR(t,e);return{map:function(n,o){return oV.pipe(n,r(o))}}}pn.getFunctorComposition=uV,Object.defineProperty(kc,"__esModule",{value:!0}),kc.getApplicativeComposition=kc.getApplicativeMonoid=void 0;var zR=Ce,cV=Ko,sV=pn;function fV(t){var e=zR.getApplySemigroup(t);return function(r){return{concat:e(r).concat,empty:t.of(r.empty)}}}kc.getApplicativeMonoid=fV;function lV(t,e){var r=sV.getFunctorComposition(t,e).map,n=zR.ap(t,e);return{map:r,of:function(o){return t.of(e.of(o))},ap:function(o,i){return cV.pipe(o,n(i))}}}kc.getApplicativeComposition=lV;var Wc={};Object.defineProperty(Wc,"__esModule",{value:!0}),Wc.bind=Wc.chainFirst=void 0;function pV(t){return function(e){return function(r){return t.chain(r,function(n){return t.map(e(n),function(){return n})})}}}Wc.chainFirst=pV;function dV(t){return function(e,r){return function(n){return t.chain(n,function(o){return t.map(r(o),function(i){var a;return Object.assign({},o,(a={},a[e]=i,a))})})}}}Wc.bind=dV;var Gd={};Object.defineProperty(Gd,"__esModule",{value:!0}),Gd.tailRec=void 0;var hV=function(t,e){for(var r=e(t);r._tag==="Left";)r=e(r.left);return r.right};Gd.tailRec=hV;var Xe={},$t={},vV=ut&&ut.__spreadArray||function(t,e){for(var r=0,n=e.length,o=t.length;r<n;r++,o++)t[o]=e[r];return t};Object.defineProperty($t,"__esModule",{value:!0}),$t.fromReadonlyNonEmptyArray=$t.has=$t.emptyRecord=$t.emptyReadonlyArray=$t.tail=$t.head=$t.isNonEmpty=$t.singleton=$t.right=$t.left=$t.isRight=$t.isLeft=$t.some=$t.none=$t.isSome=$t.isNone=void 0;var mV=function(t){return t._tag==="None"};$t.isNone=mV;var gV=function(t){return t._tag==="Some"};$t.isSome=gV,$t.none={_tag:"None"};var yV=function(t){return{_tag:"Some",value:t}};$t.some=yV;var bV=function(t){return t._tag==="Left"};$t.isLeft=bV;var $V=function(t){return t._tag==="Right"};$t.isRight=$V;var _V=function(t){return{_tag:"Left",left:t}};$t.left=_V;var SV=function(t){return{_tag:"Right",right:t}};$t.right=SV;var TV=function(t){return[t]};$t.singleton=TV;var IV=function(t){return t.length>0};$t.isNonEmpty=IV;var OV=function(t){return t[0]};$t.head=OV;var MV=function(t){return t.slice(1)};$t.tail=MV,$t.emptyReadonlyArray=[],$t.emptyRecord={},$t.has=Object.prototype.hasOwnProperty;var RV=function(t){return vV([t[0]],t.slice(1))};$t.fromReadonlyNonEmptyArray=RV;var EV=ut&&ut.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),wV=ut&&ut.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),AV=ut&&ut.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&EV(e,t,r);return wV(e,t),e};Object.defineProperty(Xe,"__esModule",{value:!0}),Xe.filterOrElse=Xe.chainEitherK=Xe.fromEitherK=Xe.chainOptionK=Xe.fromOptionK=Xe.fromPredicate=Xe.fromOption=void 0;var qR=Ko,Ya=AV($t);function KR(t){return function(e){return function(r){return t.fromEither(Ya.isNone(r)?Ya.left(e()):Ya.right(r.value))}}}Xe.fromOption=KR;function CV(t){return function(e,r){return function(n){return t.fromEither(e(n)?Ya.right(n):Ya.left(r(n)))}}}Xe.fromPredicate=CV;function VR(t){var e=KR(t);return function(r){var n=e(r);return function(o){return qR.flow(o,n)}}}Xe.fromOptionK=VR;function xV(t,e){var r=VR(t);return function(n){var o=r(n);return function(i){return function(a){return e.chain(a,o(i))}}}}Xe.chainOptionK=xV;function HR(t){return function(e){return qR.flow(e,t.fromEither)}}Xe.fromEitherK=HR;function kV(t,e){var r=HR(t);return function(n){return function(o){return e.chain(o,r(n))}}}Xe.chainEitherK=kV;function WV(t,e){return function(r,n){return function(o){return e.chain(o,function(i){return t.fromEither(r(i)?Ya.right(i):Ya.left(n(i)))})}}}Xe.filterOrElse=WV;var JR={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.right=t.left=t.flap=t.Functor=t.Bifunctor=t.URI=t.bimap=t.mapLeft=t.map=t.separated=void 0;var e=Ko,r=pn,n=function(p,d){return{left:p,right:d}};t.separated=n;var o=function(p,d){return e.pipe(p,t.map(d))},i=function(p,d){return e.pipe(p,t.mapLeft(d))},a=function(p,d,h){return e.pipe(p,t.bimap(d,h))},u=function(p){return function(d){return t.separated(t.left(d),p(t.right(d)))}};t.map=u;var c=function(p){return function(d){return t.separated(p(t.left(d)),t.right(d))}};t.mapLeft=c;var s=function(p,d){return function(h){return t.separated(p(t.left(h)),d(t.right(h)))}};t.bimap=s,t.URI="Separated",t.Bifunctor={URI:t.URI,mapLeft:i,bimap:a},t.Functor={URI:t.URI,map:o},t.flap=r.flap(t.Functor);var f=function(p){return p.left};t.left=f;var l=function(p){return p.right};t.right=l})(JR);var Ui={},FV=ut&&ut.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),NV=ut&&ut.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),PV=ut&&ut.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&FV(e,t,r);return NV(e,t),e};Object.defineProperty(Ui,"__esModule",{value:!0}),Ui.filterE=Ui.witherDefault=Ui.wiltDefault=void 0;var GR=PV($t);function DV(t,e){return function(r){var n=t.traverse(r);return function(o,i){return r.map(n(o,i),e.separate)}}}Ui.wiltDefault=DV;function LV(t,e){return function(r){var n=t.traverse(r);return function(o,i){return r.map(n(o,i),e.compact)}}}Ui.witherDefault=LV;function UV(t){return function(e){var r=t.wither(e);return function(n){return function(o){return r(o,function(i){return e.map(n(i),function(a){return a?GR.some(i):GR.none})})}}}}Ui.filterE=UV,function(t){var e=ut&&ut.__createBinding||(Object.create?function(A,E,P,Rt){Rt===void 0&&(Rt=P),Object.defineProperty(A,Rt,{enumerable:!0,get:function(){return E[P]}})}:function(A,E,P,Rt){Rt===void 0&&(Rt=P),A[Rt]=E[P]}),r=ut&&ut.__setModuleDefault||(Object.create?function(A,E){Object.defineProperty(A,"default",{enumerable:!0,value:E})}:function(A,E){A.default=E}),n=ut&&ut.__importStar||function(A){if(A&&A.__esModule)return A;var E={};if(A!=null)for(var P in A)P!=="default"&&Object.prototype.hasOwnProperty.call(A,P)&&e(E,A,P);return r(E,A),E};Object.defineProperty(t,"__esModule",{value:!0}),t.fold=t.match=t.foldW=t.matchW=t.isRight=t.isLeft=t.fromOption=t.fromPredicate=t.FromEither=t.MonadThrow=t.throwError=t.ChainRec=t.Extend=t.extend=t.Alt=t.alt=t.altW=t.Bifunctor=t.mapLeft=t.bimap=t.Traversable=t.sequence=t.traverse=t.Foldable=t.reduceRight=t.foldMap=t.reduce=t.Monad=t.Chain=t.chain=t.chainW=t.Applicative=t.Apply=t.ap=t.apW=t.Pointed=t.of=t.Functor=t.map=t.getAltValidation=t.getApplicativeValidation=t.getWitherable=t.getFilterable=t.getCompactable=t.getSemigroup=t.getEq=t.getShow=t.URI=t.right=t.left=void 0,t.getValidation=t.getValidationMonoid=t.getValidationSemigroup=t.getApplyMonoid=t.getApplySemigroup=t.either=t.stringifyJSON=t.parseJSON=t.sequenceArray=t.traverseArray=t.traverseArrayWithIndex=t.traverseReadonlyArrayWithIndex=t.traverseReadonlyNonEmptyArrayWithIndex=t.ApT=t.apSW=t.apS=t.bindW=t.bind=t.bindTo=t.Do=t.exists=t.elem=t.toError=t.toUnion=t.chainNullableK=t.fromNullableK=t.tryCatchK=t.tryCatch=t.fromNullable=t.orElse=t.orElseW=t.swap=t.filterOrElseW=t.filterOrElse=t.chainOptionK=t.fromOptionK=t.duplicate=t.flatten=t.flattenW=t.chainFirstW=t.chainFirst=t.apSecond=t.apFirst=t.flap=t.getOrElse=t.getOrElseW=void 0;var o=kc,i=Ce,a=Wc,u=Gd,c=Xe,s=Ko,f=pn,l=n($t),p=JR,d=Ui;t.left=l.left,t.right=l.right;var h=function(A,E){return s.pipe(A,t.map(E))},m=function(A,E){return s.pipe(A,t.ap(E))},g=function(A,E){return s.pipe(A,t.chain(E))},b=function(A,E,P){return s.pipe(A,t.reduce(E,P))},$=function(A){return function(E,P){var Rt=t.foldMap(A);return s.pipe(E,Rt(P))}},w=function(A,E,P){return s.pipe(A,t.reduceRight(E,P))},y=function(A){var E=t.traverse(A);return function(P,Rt){return s.pipe(P,E(Rt))}},I=function(A,E,P){return s.pipe(A,t.bimap(E,P))},S=function(A,E){return s.pipe(A,t.mapLeft(E))},k=function(A,E){return s.pipe(A,t.alt(E))},C=function(A,E){return s.pipe(A,t.extend(E))},B=function(A,E){return u.tailRec(E(A),function(P){return t.isLeft(P)?t.right(t.left(P.left)):t.isLeft(P.right)?t.left(E(P.right.left)):t.right(t.right(P.right.right))})};t.URI="Either";var q=function(A,E){return{show:function(P){return t.isLeft(P)?"left("+A.show(P.left)+")":"right("+E.show(P.right)+")"}}};t.getShow=q;var G=function(A,E){return{equals:function(P,Rt){return P===Rt||(t.isLeft(P)?t.isLeft(Rt)&&A.equals(P.left,Rt.left):t.isRight(Rt)&&E.equals(P.right,Rt.right))}}};t.getEq=G;var O=function(A){return{concat:function(E,P){return t.isLeft(P)?E:t.isLeft(E)?P:t.right(A.concat(E.right,P.right))}}};t.getSemigroup=O;var R=function(A){var E=t.left(A.empty);return{URI:t.URI,_E:void 0,compact:function(P){return t.isLeft(P)?P:P.right._tag==="None"?E:t.right(P.right.value)},separate:function(P){return t.isLeft(P)?p.separated(P,P):t.isLeft(P.right)?p.separated(t.right(P.right.left),E):p.separated(E,t.right(P.right.right))}}};t.getCompactable=R;var x=function(A){var E=t.left(A.empty),P=t.getCompactable(A),Rt=P.compact,W=P.separate,Q=function(st,vt){return t.isLeft(st)||vt(st.right)?st:E},ft=function(st,vt){return t.isLeft(st)?p.separated(st,st):vt(st.right)?p.separated(E,t.right(st.right)):p.separated(t.right(st.right),E)};return{URI:t.URI,_E:void 0,map:h,compact:Rt,separate:W,filter:Q,filterMap:function(st,vt){if(t.isLeft(st))return st;var ue=vt(st.right);return ue._tag==="None"?E:t.right(ue.value)},partition:ft,partitionMap:function(st,vt){if(t.isLeft(st))return p.separated(st,st);var ue=vt(st.right);return t.isLeft(ue)?p.separated(t.right(ue.left),E):p.separated(E,t.right(ue.right))}}};t.getFilterable=x;var F=function(A){var E=t.getFilterable(A),P=t.getCompactable(A);return{URI:t.URI,_E:void 0,map:h,compact:E.compact,separate:E.separate,filter:E.filter,filterMap:E.filterMap,partition:E.partition,partitionMap:E.partitionMap,traverse:y,sequence:t.sequence,reduce:b,foldMap:$,reduceRight:w,wither:d.witherDefault(t.Traversable,P),wilt:d.wiltDefault(t.Traversable,P)}};t.getWitherable=F;var L=function(A){return{URI:t.URI,_E:void 0,map:h,ap:function(E,P){return t.isLeft(E)?t.isLeft(P)?t.left(A.concat(E.left,P.left)):E:t.isLeft(P)?P:t.right(E.right(P.right))},of:t.of}};t.getApplicativeValidation=L;var U=function(A){return{URI:t.URI,_E:void 0,map:h,alt:function(E,P){if(t.isRight(E))return E;var Rt=P();return t.isLeft(Rt)?t.left(A.concat(E.left,Rt.left)):Rt}}};t.getAltValidation=U;var rt=function(A){return function(E){return t.isLeft(E)?E:t.right(A(E.right))}};t.map=rt,t.Functor={URI:t.URI,map:h},t.of=t.right,t.Pointed={URI:t.URI,of:t.of};var T=function(A){return function(E){return t.isLeft(E)?E:t.isLeft(A)?A:t.right(E.right(A.right))}};t.apW=T,t.ap=t.apW,t.Apply={URI:t.URI,map:h,ap:m},t.Applicative={URI:t.URI,map:h,ap:m,of:t.of};var M=function(A){return function(E){return t.isLeft(E)?E:A(E.right)}};t.chainW=M,t.chain=t.chainW,t.Chain={URI:t.URI,map:h,ap:m,chain:g},t.Monad={URI:t.URI,map:h,ap:m,of:t.of,chain:g};var N=function(A,E){return function(P){return t.isLeft(P)?A:E(A,P.right)}};t.reduce=N;var at=function(A){return function(E){return function(P){return t.isLeft(P)?A.empty:E(P.right)}}};t.foldMap=at;var cr=function(A,E){return function(P){return t.isLeft(P)?A:E(P.right,A)}};t.reduceRight=cr,t.Foldable={URI:t.URI,reduce:b,foldMap:$,reduceRight:w};var Ut=function(A){return function(E){return function(P){return t.isLeft(P)?A.of(t.left(P.left)):A.map(E(P.right),t.right)}}};t.traverse=Ut;var _e=function(A){return function(E){return t.isLeft(E)?A.of(t.left(E.left)):A.map(E.right,t.right)}};t.sequence=_e,t.Traversable={URI:t.URI,map:h,reduce:b,foldMap:$,reduceRight:w,traverse:y,sequence:t.sequence};var Ir=function(A,E){return function(P){return t.isLeft(P)?t.left(A(P.left)):t.right(E(P.right))}};t.bimap=Ir;var jo=function(A){return function(E){return t.isLeft(E)?t.left(A(E.left)):E}};t.mapLeft=jo,t.Bifunctor={URI:t.URI,bimap:I,mapLeft:S};var fo=function(A){return function(E){return t.isLeft(E)?A():E}};t.altW=fo,t.alt=t.altW,t.Alt={URI:t.URI,map:h,alt:k};var Ja=function(A){return function(E){return t.isLeft(E)?E:t.right(A(E))}};t.extend=Ja,t.Extend={URI:t.URI,map:h,extend:C},t.ChainRec={URI:t.URI,map:h,ap:m,chain:g,chainRec:B},t.throwError=t.left,t.MonadThrow={URI:t.URI,map:h,ap:m,of:t.of,chain:g,throwError:t.throwError},t.FromEither={URI:t.URI,fromEither:s.identity},t.fromPredicate=c.fromPredicate(t.FromEither),t.fromOption=c.fromOption(t.FromEither),t.isLeft=l.isLeft,t.isRight=l.isRight;var Bo=function(A,E){return function(P){return t.isLeft(P)?A(P.left):E(P.right)}};t.matchW=Bo,t.foldW=t.matchW,t.match=t.matchW,t.fold=t.match;var Ga=function(A){return function(E){return t.isLeft(E)?A(E.left):E.right}};t.getOrElseW=Ga,t.getOrElse=t.getOrElseW,t.flap=f.flap(t.Functor),t.apFirst=i.apFirst(t.Apply),t.apSecond=i.apSecond(t.Apply),t.chainFirst=a.chainFirst(t.Chain),t.chainFirstW=t.chainFirst,t.flattenW=t.chainW(s.identity),t.flatten=t.flattenW,t.duplicate=t.extend(s.identity),t.fromOptionK=c.fromOptionK(t.FromEither),t.chainOptionK=c.chainOptionK(t.FromEither,t.Chain),t.filterOrElse=c.filterOrElse(t.FromEither,t.Chain),t.filterOrElseW=t.filterOrElse;var Kf=function(A){return t.isLeft(A)?t.right(A.left):t.left(A.right)};t.swap=Kf;var Mc=function(A){return function(E){return t.isLeft(E)?A(E.left):E}};t.orElseW=Mc,t.orElse=t.orElseW;var Vf=function(A){return function(E){return E==null?t.left(A):t.right(E)}};t.fromNullable=Vf;var Hf=function(A,E){try{return t.right(A())}catch(P){return t.left(E(P))}};t.tryCatch=Hf;var Rc=function(A,E){return function(){for(var P=[],Rt=0;Rt<arguments.length;Rt++)P[Rt]=arguments[Rt];return t.tryCatch(function(){return A.apply(void 0,P)},E)}};t.tryCatchK=Rc;var Ec=function(A){var E=t.fromNullable(A);return function(P){return s.flow(P,E)}};t.fromNullableK=Ec;var Jf=function(A){var E=t.fromNullableK(A);return function(P){return t.chain(E(P))}};t.chainNullableK=Jf,t.toUnion=t.foldW(s.identity,s.identity);function Gf(A){return A instanceof Error?A:new Error(String(A))}t.toError=Gf;function xn(A){return function(E,P){if(P===void 0){var Rt=xn(A);return function(W){return Rt(E,W)}}return t.isLeft(P)?!1:A.equals(E,P.right)}}t.elem=xn;var zo=function(A){return function(E){return t.isLeft(E)?!1:A(E.right)}};t.exists=zo,t.Do=t.of(l.emptyRecord),t.bindTo=f.bindTo(t.Functor),t.bind=a.bind(t.Chain),t.bindW=t.bind,t.apS=i.apS(t.Apply),t.apSW=t.apS,t.ApT=t.of(l.emptyReadonlyArray);var wc=function(A){return function(E){var P=A(0,l.head(E));if(t.isLeft(P))return P;for(var Rt=[P.right],W=1;W<E.length;W++){var Q=A(W,E[W]);if(t.isLeft(Q))return Q;Rt.push(Q.right)}return t.right(Rt)}};t.traverseReadonlyNonEmptyArrayWithIndex=wc;var Di=function(A){var E=t.traverseReadonlyNonEmptyArrayWithIndex(A);return function(P){return l.isNonEmpty(P)?E(P):t.ApT}};t.traverseReadonlyArrayWithIndex=Di,t.traverseArrayWithIndex=t.traverseReadonlyArrayWithIndex;var Ac=function(A){return t.traverseReadonlyArrayWithIndex(function(E,P){return A(P)})};t.traverseArray=Ac,t.sequenceArray=t.traverseArray(s.identity);function Yf(A,E){return t.tryCatch(function(){return JSON.parse(A)},E)}t.parseJSON=Yf;var Xf=function(A,E){return t.tryCatch(function(){var P=JSON.stringify(A);if(typeof P!="string")throw new Error("Converting unsupported structure to JSON");return P},E)};t.stringifyJSON=Xf,t.either={URI:t.URI,map:h,of:t.of,ap:m,chain:g,reduce:b,foldMap:$,reduceRight:w,traverse:y,sequence:t.sequence,bimap:I,mapLeft:S,alt:k,extend:C,chainRec:B,throwError:t.throwError},t.getApplySemigroup=i.getApplySemigroup(t.Apply),t.getApplyMonoid=o.getApplicativeMonoid(t.Applicative);var Zf=function(A,E){return i.getApplySemigroup(t.getApplicativeValidation(A))(E)};t.getValidationSemigroup=Zf;var Qf=function(A,E){return o.getApplicativeMonoid(t.getApplicativeValidation(A))(E)};t.getValidationMonoid=Qf;function FR(A){var E=t.getApplicativeValidation(A).ap,P=t.getAltValidation(A).alt;return{URI:t.URI,_E:void 0,map:h,of:t.of,chain:g,bimap:I,mapLeft:S,reduce:b,foldMap:$,reduceRight:w,extend:C,traverse:y,sequence:t.sequence,chainRec:B,throwError:t.throwError,ap:E,alt:P}}t.getValidation=FR}(qo);var YR=function(t){return function(){return{meet:function(e,r){return function(n){return t.meet(e(n),r(n))}},join:function(e,r){return function(n){return t.join(e(n),r(n))}},zero:function(){return t.zero},one:function(){return t.one},implies:function(e,r){return function(n){return t.implies(e(n),r(n))}},not:function(e){return function(r){return t.not(e(r))}}}}},Jy=function(t){return function(){return{concat:function(e,r){return function(n){return t.concat(e(n),r(n))}}}}},XR=function(t){var e=Jy(t);return function(){return{concat:e().concat,empty:function(){return t.empty}}}},Gy=function(t){return{add:function(e,r){return function(n){return t.add(e(n),r(n))}},zero:function(){return t.zero},mul:function(e,r){return function(n){return t.mul(e(n),r(n))}},one:function(){return t.one}}},ZR=function(t){var e=Gy(t);return{add:e.add,mul:e.mul,one:e.one,zero:e.zero,sub:function(r,n){return function(o){return t.sub(r(o),n(o))}}}},jV=function(t){return function(e){return e(t)}};function j(t){return t}var Fc=j;function Or(t){return function(){return t}}var Yy=Or(!0),QR=Or(!1),tE=Or(null),Xy=Or(void 0),BV=Xy;function zV(t){return function(e,r){return t(r,e)}}function H(t,e,r,n,o,i,a,u,c){switch(arguments.length){case 1:return t;case 2:return function(){return e(t.apply(this,arguments))};case 3:return function(){return r(e(t.apply(this,arguments)))};case 4:return function(){return n(r(e(t.apply(this,arguments))))};case 5:return function(){return o(n(r(e(t.apply(this,arguments)))))};case 6:return function(){return i(o(n(r(e(t.apply(this,arguments))))))};case 7:return function(){return a(i(o(n(r(e(t.apply(this,arguments)))))))};case 8:return function(){return u(a(i(o(n(r(e(t.apply(this,arguments))))))))};case 9:return function(){return c(u(a(i(o(n(r(e(t.apply(this,arguments)))))))))}}}function eE(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return t}function qV(t){return t+1}function KV(t){return t-1}function rE(t){throw new Error("Called `absurd` function which should be uncallable")}function VV(t){return function(e){return t.apply(void 0,e)}}function HV(t){return function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return t(e)}}function v(t,e,r,n,o,i,a,u,c){switch(arguments.length){case 1:return t;case 2:return e(t);case 3:return r(e(t));case 4:return n(r(e(t)));case 5:return o(n(r(e(t))));case 6:return i(o(n(r(e(t)))));case 7:return a(i(o(n(r(e(t))))));case 8:return u(a(i(o(n(r(e(t)))))));case 9:return c(u(a(i(o(n(r(e(t))))))));default:for(var s=arguments[0],f=1;f<arguments.length;f++)s=arguments[f](s);return s}}var JV=rE,zr=function(t,e){return e};function GV(t){return function(e){return!t(e)}}var YV=function(){return{concat:function(t,e){return H(t,e)},empty:j}},nE=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module",getBooleanAlgebra:YR,getSemigroup:Jy,getMonoid:XR,getSemiring:Gy,getRing:ZR,apply:jV,identity:j,unsafeCoerce:Fc,constant:Or,constTrue:Yy,constFalse:QR,constNull:tE,constUndefined:Xy,constVoid:BV,flip:zV,flow:H,tuple:eE,increment:qV,decrement:KV,absurd:rE,tupled:VV,untupled:HV,pipe:v,hole:JV,SK:zr,not:GV,getEndomorphismMonoid:YV});function Vo(t,e){return function(r){return function(n){return t.ap(t.map(n,function(o){return function(i){return e.ap(o,i)}}),r)}}}function le(t){return function(e){return function(r){return t.ap(t.map(r,function(n){return function(){return n}}),e)}}}function pe(t){return function(e){return function(r){return t.ap(t.map(r,function(){return function(n){return n}}),e)}}}function de(t){return function(e,r){return function(n){return t.ap(t.map(n,function(o){return function(i){var a;return Object.assign({},o,(a={},a[e]=i,a))}}),r)}}}function Oe(t){return function(e){return{concat:function(r,n){return t.ap(t.map(r,function(o){return function(i){return e.concat(o,i)}}),n)}}}}function Zy(t,e,r){return function(n){for(var o=Array(r.length+1),i=0;i<r.length;i++)o[i]=r[i];return o[r.length]=n,e===0?t.apply(null,o):Zy(t,e-1,o)}}var Qy={1:function(t){return[t]},2:function(t){return function(e){return[t,e]}},3:function(t){return function(e){return function(r){return[t,e,r]}}},4:function(t){return function(e){return function(r){return function(n){return[t,e,r,n]}}}},5:function(t){return function(e){return function(r){return function(n){return function(o){return[t,e,r,n,o]}}}}}};function XV(t){return Qy.hasOwnProperty(t)||(Qy[t]=Zy(eE,t-1,[])),Qy[t]}function ZV(t){return function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];for(var n=e.length,o=XV(n),i=t.map(e[0],o),a=1;a<n;a++)i=t.ap(i,e[a]);return i}}function QV(t){var e=t.length;switch(e){case 1:return function(r){var n;return n={},n[t[0]]=r,n};case 2:return function(r){return function(n){var o;return o={},o[t[0]]=r,o[t[1]]=n,o}};case 3:return function(r){return function(n){return function(o){var i;return i={},i[t[0]]=r,i[t[1]]=n,i[t[2]]=o,i}}};case 4:return function(r){return function(n){return function(o){return function(i){var a;return a={},a[t[0]]=r,a[t[1]]=n,a[t[2]]=o,a[t[3]]=i,a}}}};case 5:return function(r){return function(n){return function(o){return function(i){return function(a){var u;return u={},u[t[0]]=r,u[t[1]]=n,u[t[2]]=o,u[t[3]]=i,u[t[4]]=a,u}}}}};default:return Zy(function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];for(var o={},i=0;i<e;i++)o[t[i]]=r[i];return o},e-1,[])}}function t4(t){return function(e){for(var r=Object.keys(e),n=r.length,o=QV(r),i=t.map(e[r[0]],o),a=1;a<n;a++)i=t.ap(i,e[r[a]]);return i}}var e4=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module",ap:Vo,apFirst:le,apSecond:pe,apS:de,getApplySemigroup:Oe,sequenceT:ZV,sequenceS:t4});function Nc(t,e){return function(r){return function(n){return t.map(n,function(o){return e.map(o,r)})}}}function Et(t){return function(e){return function(r){return t.map(r,function(n){return n(e)})}}}function he(t){return function(e){return function(r){return t.map(r,function(n){var o;return o={},o[e]=n,o})}}}function Pc(t,e){var r=Nc(t,e);return{map:function(n,o){return v(n,r(o))}}}var r4=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module",map:Nc,flap:Et,bindTo:he,getFunctorComposition:Pc});function dn(t){var e=Oe(t);return function(r){return{concat:e(r).concat,empty:t.of(r.empty)}}}function oE(t,e){var r=Pc(t,e).map,n=Vo(t,e);return{map:r,of:function(o){return t.of(e.of(o))},ap:function(o,i){return v(o,n(i))}}}var n4=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module",getApplicativeMonoid:dn,getApplicativeComposition:oE});function Xt(t){return function(e){return function(r){return t.chain(r,function(n){return t.map(e(n),function(){return n})})}}}function ve(t){return function(e,r){return function(n){return t.chain(n,function(o){return t.map(r(o),function(i){var a;return Object.assign({},o,(a={},a[e]=i,a))})})}}}var o4=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module",chainFirst:Xt,bind:ve}),tb=function(t,e){for(var r=e(t);r._tag==="Left";)r=e(r.left);return r.right},i4=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module",tailRec:tb}),a4=globalThis&&globalThis.__spreadArray||function(t,e){for(var r=0,n=e.length,o=t.length;r<n;r++,o++)t[o]=e[r];return t},me=function(t){return t._tag==="None"},Zt=function(t){return t._tag==="Some"},lt={_tag:"None"},ct=function(t){return{_tag:"Some",value:t}},Me=function(t){return t._tag==="Left"},eb=function(t){return t._tag==="Right"},Ho=function(t){return{_tag:"Left",left:t}},ji=function(t){return{_tag:"Right",right:t}},nl=function(t){return[t]},Qt=function(t){return t.length>0},qr=function(t){return t[0]},Dc=function(t){return t.slice(1)},Ze=[],xe={},re=Object.prototype.hasOwnProperty,Yd=function(t){return a4([t[0]],t.slice(1))};function lo(t){return function(e){return function(r){return t.fromEither(me(r)?Ho(e()):ji(r.value))}}}function Bi(t){return function(e,r){return function(n){return t.fromEither(e(n)?ji(n):Ho(r(n)))}}}function po(t){var e=lo(t);return function(r){var n=e(r);return function(o){return H(o,n)}}}function Xa(t,e){var r=po(t);return function(n){var o=r(n);return function(i){return function(a){return e.chain(a,o(i))}}}}function ho(t){return function(e){return H(e,t.fromEither)}}function Za(t,e){var r=ho(t);return function(n){return function(o){return e.chain(o,r(n))}}}function Qa(t,e){return function(r,n){return function(o){return e.chain(o,function(i){return t.fromEither(r(i)?ji(i):Ho(n(i)))})}}}var u4=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module",fromOption:lo,fromPredicate:Bi,fromOptionK:po,chainOptionK:Xa,fromEitherK:ho,chainEitherK:Za,filterOrElse:Qa}),mt=function(t,e){return{left:t,right:e}},c4=function(t,e){return v(t,rb(e))},s4=function(t,e){return v(t,iE(e))},f4=function(t,e,r){return v(t,aE(e,r))},rb=function(t){return function(e){return mt(ol(e),t(il(e)))}},iE=function(t){return function(e){return mt(t(ol(e)),il(e))}},aE=function(t,e){return function(r){return mt(t(ol(r)),e(il(r)))}},nb="Separated",l4={URI:nb,mapLeft:s4,bimap:f4},uE={URI:nb,map:c4},p4=Et(uE),ol=function(t){return t.left},il=function(t){return t.right},d4=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module",separated:mt,map:rb,mapLeft:iE,bimap:aE,URI:nb,Bifunctor:l4,Functor:uE,flap:p4,left:ol,right:il});function Fn(t,e){return function(r){var n=t.traverse(r);return function(o,i){return r.map(n(o,i),e.separate)}}}function Nn(t,e){return function(r){var n=t.traverse(r);return function(o,i){return r.map(n(o,i),e.compact)}}}function ob(t){return function(e){var r=t.wither(e);return function(n){return function(o){return r(o,function(i){return e.map(n(i),function(a){return a?ct(i):lt})})}}}}var h4=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module",wiltDefault:Fn,witherDefault:Nn,filterE:ob}),ne=Ho,Ct=ji,Qe=function(t,e){return v(t,ru(e))},tu=function(t,e){return v(t,lE(e))},Lc=function(t,e){return v(t,hn(e))},al=function(t,e,r){return v(t,dE(e,r))},ul=function(t){return function(e,r){var n=hE(t);return v(e,n(r))}},cl=function(t,e,r){return v(t,vE(e,r))},Xd=function(t){var e=mE(t);return function(r,n){return v(r,e(n))}},ib=function(t,e,r){return v(t,lb(e,r))},ab=function(t,e){return v(t,pl(e))},cE=function(t,e){return v(t,yE(e))},ub=function(t,e){return v(t,pb(e))},cb=function(t,e){return tb(e(t),function(r){return et(r)?Ct(ne(r.left)):et(r.right)?ne(e(r.right.left)):Ct(Ct(r.right.right))})},oe="Either",v4=function(t,e){return{show:function(r){return et(r)?"left("+t.show(r.left)+")":"right("+e.show(r.right)+")"}}},m4=function(t,e){return{equals:function(r,n){return r===n||(et(r)?et(n)&&t.equals(r.left,n.left):db(n)&&e.equals(r.right,n.right))}}},sl=function(t){return{concat:function(e,r){return et(r)?e:et(e)?r:Ct(t.concat(e.right,r.right))}}},eu=function(t){var e=ne(t.empty);return{URI:oe,_E:void 0,compact:function(r){return et(r)?r:r.right._tag==="None"?e:Ct(r.right.value)},separate:function(r){return et(r)?mt(r,r):et(r.right)?mt(Ct(r.right.left),e):mt(e,Ct(r.right.right))}}},Uc=function(t){var e=ne(t.empty),r=eu(t),n=r.compact,o=r.separate,i=function(u,c){return et(u)||c(u.right)?u:e},a=function(u,c){return et(u)?mt(u,u):c(u.right)?mt(e,Ct(u.right)):mt(Ct(u.right),e)};return{URI:oe,_E:void 0,map:Qe,compact:n,separate:o,filter:i,filterMap:function(u,c){if(et(u))return u;var s=c(u.right);return s._tag==="None"?e:Ct(s.value)},partition:a,partitionMap:function(u,c){if(et(u))return mt(u,u);var s=c(u.right);return et(s)?mt(Ct(s.left),e):mt(e,Ct(s.right))}}},g4=function(t){var e=Uc(t),r=eu(t);return{URI:oe,_E:void 0,map:Qe,compact:e.compact,separate:e.separate,filter:e.filter,filterMap:e.filterMap,partition:e.partition,partitionMap:e.partitionMap,traverse:Xd,sequence:ll,reduce:al,foldMap:ul,reduceRight:cl,wither:Nn(fb,r),wilt:Fn(fb,r)}},zi=function(t){return{URI:oe,_E:void 0,map:Qe,ap:function(e,r){return et(e)?et(r)?ne(t.concat(e.left,r.left)):e:et(r)?r:Ct(e.right(r.right))},of:vo}},sE=function(t){return{URI:oe,_E:void 0,map:Qe,alt:function(e,r){if(db(e))return e;var n=r();return et(n)?ne(t.concat(e.left,n.left)):n}}},ru=function(t){return function(e){return et(e)?e:Ct(t(e.right))}},qi={URI:oe,map:Qe},vo=Ct,y4={URI:oe,of:vo},fE=function(t){return function(e){return et(e)?e:et(t)?t:Ct(e.right(t.right))}},lE=fE,jc={URI:oe,map:Qe,ap:tu},pE={URI:oe,map:Qe,ap:tu,of:vo},sb=function(t){return function(e){return et(e)?e:t(e.right)}},hn=sb,fl={URI:oe,map:Qe,ap:tu,chain:Lc},b4={URI:oe,map:Qe,ap:tu,of:vo,chain:Lc},dE=function(t,e){return function(r){return et(r)?t:e(t,r.right)}},hE=function(t){return function(e){return function(r){return et(r)?t.empty:e(r.right)}}},vE=function(t,e){return function(r){return et(r)?t:e(r.right,t)}},$4={URI:oe,reduce:al,foldMap:ul,reduceRight:cl},mE=function(t){return function(e){return function(r){return et(r)?t.of(ne(r.left)):t.map(e(r.right),Ct)}}},ll=function(t){return function(e){return et(e)?t.of(ne(e.left)):t.map(e.right,Ct)}},fb={URI:oe,map:Qe,reduce:al,foldMap:ul,reduceRight:cl,traverse:Xd,sequence:ll},lb=function(t,e){return function(r){return et(r)?ne(t(r.left)):Ct(e(r.right))}},pl=function(t){return function(e){return et(e)?ne(t(e.left)):e}},_4={URI:oe,bimap:ib,mapLeft:ab},gE=function(t){return function(e){return et(e)?t():e}},yE=gE,S4={URI:oe,map:Qe,alt:cE},pb=function(t){return function(e){return et(e)?e:Ct(t(e))}},T4={URI:oe,map:Qe,extend:ub},I4={URI:oe,map:Qe,ap:tu,chain:Lc,chainRec:cb},Zd=ne,O4={URI:oe,map:Qe,ap:tu,of:vo,chain:Lc,throwError:Zd},Bc={URI:oe,fromEither:j},M4=Bi(Bc),bE=lo(Bc),et=Me,db=eb,hb=function(t,e){return function(r){return et(r)?t(r.left):e(r.right)}},$E=hb,Ki=hb,vb=Ki,mb=function(t){return function(e){return et(e)?t(e.left):e.right}},R4=mb,E4=Et(qi),w4=le(jc),A4=pe(jc),_E=Xt(fl),C4=_E,SE=sb(j),x4=SE,k4=pb(j),W4=po(Bc),F4=Xa(Bc,fl),TE=Qa(Bc,fl),N4=TE,IE=function(t){return et(t)?Ct(t.left):ne(t.right)},OE=function(t){return function(e){return et(e)?t(e.left):e}},ME=OE,RE=function(t){return function(e){return e==null?ne(t):Ct(e)}},nu=function(t,e){try{return Ct(t())}catch(r){return ne(e(r))}},P4=function(t,e){return function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return nu(function(){return t.apply(void 0,r)},e)}},EE=function(t){var e=RE(t);return function(r){return H(r,e)}},D4=function(t){var e=EE(t);return function(r){return hn(e(r))}},wE=$E(j,j);function L4(t){return t instanceof Error?t:new Error(String(t))}function AE(t){return function(e,r){if(r===void 0){var n=AE(t);return function(o){return n(e,o)}}return et(r)?!1:t.equals(e,r.right)}}var U4=function(t){return function(e){return et(e)?!1:t(e.right)}},j4=vo(xe),B4=he(qi),CE=ve(fl),z4=CE,xE=de(jc),q4=xE,kE=vo(Ze),dl=function(t){return function(e){var r=t(0,qr(e));if(et(r))return r;for(var n=[r.right],o=1;o<e.length;o++){var i=t(o,e[o]);if(et(i))return i;n.push(i.right)}return Ct(n)}},gb=function(t){var e=dl(t);return function(r){return Qt(r)?e(r):kE}},K4=gb,WE=function(t){return gb(function(e,r){return t(r)})},V4=WE(j);function H4(t,e){return nu(function(){return JSON.parse(t)},e)}var J4=function(t,e){return nu(function(){var r=JSON.stringify(t);if(typeof r!="string")throw new Error("Converting unsupported structure to JSON");return r},e)},G4={URI:oe,map:Qe,of:vo,ap:tu,chain:Lc,reduce:al,foldMap:ul,reduceRight:cl,traverse:Xd,sequence:ll,bimap:ib,mapLeft:ab,alt:cE,extend:ub,chainRec:cb,throwError:Zd},Y4=Oe(jc),X4=dn(pE),Z4=function(t,e){return Oe(zi(t))(e)},Q4=function(t,e){return dn(zi(t))(e)};function t5(t){var e=zi(t).ap,r=sE(t).alt;return{URI:oe,_E:void 0,map:Qe,of:vo,chain:Lc,bimap:ib,mapLeft:ab,reduce:al,foldMap:ul,reduceRight:cl,extend:ub,traverse:Xd,sequence:ll,chainRec:cb,throwError:Zd,ap:e,alt:r}}var FE=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module",left:ne,right:Ct,URI:oe,getShow:v4,getEq:m4,getSemigroup:sl,getCompactable:eu,getFilterable:Uc,getWitherable:g4,getApplicativeValidation:zi,getAltValidation:sE,map:ru,Functor:qi,of:vo,Pointed:y4,apW:fE,ap:lE,Apply:jc,Applicative:pE,chainW:sb,chain:hn,Chain:fl,Monad:b4,reduce:dE,foldMap:hE,reduceRight:vE,Foldable:$4,traverse:mE,sequence:ll,Traversable:fb,bimap:lb,mapLeft:pl,Bifunctor:_4,altW:gE,alt:yE,Alt:S4,extend:pb,Extend:T4,ChainRec:I4,throwError:Zd,MonadThrow:O4,FromEither:Bc,fromPredicate:M4,fromOption:bE,isLeft:et,isRight:db,matchW:hb,foldW:$E,match:Ki,fold:vb,getOrElseW:mb,getOrElse:R4,flap:E4,apFirst:w4,apSecond:A4,chainFirst:_E,chainFirstW:C4,flattenW:SE,flatten:x4,duplicate:k4,fromOptionK:W4,chainOptionK:F4,filterOrElse:TE,filterOrElseW:N4,swap:IE,orElseW:OE,orElse:ME,fromNullable:RE,tryCatch:nu,tryCatchK:P4,fromNullableK:EE,chainNullableK:D4,toUnion:wE,toError:L4,elem:AE,exists:U4,Do:j4,bindTo:B4,bind:CE,bindW:z4,apS:xE,apSW:q4,ApT:kE,traverseReadonlyNonEmptyArrayWithIndex:dl,traverseReadonlyArrayWithIndex:gb,traverseArrayWithIndex:K4,traverseArray:WE,sequenceArray:V4,parseJSON:H4,stringifyJSON:J4,either:G4,getApplySemigroup:Y4,getApplyMonoid:X4,getValidationSemigroup:Z4,getValidationMonoid:Q4,getValidation:t5}),Wt=globalThis&&globalThis.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)Object.prototype.hasOwnProperty.call(o,i)&&(n[i]=o[i])},t(e,r)};return function(e,r){t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}(),zc=globalThis&&globalThis.__assign||function(){return zc=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++){e=arguments[r];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])}return t},zc.apply(this,arguments)},e5=globalThis&&globalThis.__spreadArrays||function(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;for(var n=Array(t),o=0,e=0;e<r;e++)for(var i=arguments[e],a=0,u=i.length;a<u;a++,o++)n[o]=i[a];return n},mo=ne,Ft=function(t,e,r){return mo([{value:t,context:e,message:r}])},ht=Ct,pt=function(){function t(e,r,n,o){this.name=e,this.is=r,this.validate=n,this.encode=o,this.decode=this.decode.bind(this)}return t.prototype.pipe=function(e,r){var n=this;return r===void 0&&(r="pipe("+this.name+", "+e.name+")"),new t(r,e.is,function(o,i){var a=n.validate(o,i);return et(a)?a:e.validate(a.right,i)},this.encode===Tt&&e.encode===Tt?Tt:function(o){return n.encode(e.encode(o))})},t.prototype.asDecoder=function(){return this},t.prototype.asEncoder=function(){return this},t.prototype.decode=function(e){return this.validate(e,[{key:"",type:this,actual:e}])},t}(),Tt=function(t){return t};function NE(t){return t.displayName||t.name||"<function"+t.length+">"}function r5(t,e){return{key:t,type:e}}function Pn(t,e,r,n){for(var o=t.length,i=Array(o+1),a=0;a<o;a++)i[a]=t[a];return i[o]={key:e,type:r,actual:n},i}function Jo(t,e){for(var r=e.length,n=0;n<r;n++)t.push(e[n])}var Qd=Object.prototype.hasOwnProperty;function yb(t){return Object.keys(t).map(function(e){return e+": "+t[e].name}).join(", ")}function hl(t){for(var e=0;e<t.length;e++)if(t[e].encode!==Tt)return!1;return!0}function PE(t){return"{ "+yb(t)+" }"}function DE(t){return"Partial<"+t+">"}function n5(t,e,r,n){n===void 0&&(n="{ [K in "+e.name+"]: "+r.name+" }");var o=t.length;return new Rb(n,function(i){return sr.is(i)&&t.every(function(a){return r.is(i[a])})},function(i,a){var u=sr.validate(i,a);if(et(u))return u;for(var c=u.right,s={},f=[],l=!1,p=0;p<o;p++){var d=t[p],h=c[d],m=r.validate(h,Pn(a,d,r,h));if(et(m))Jo(f,m.left);else{var g=m.right;l=l||g!==h,s[d]=g}}return f.length>0?mo(f):ht(l||Object.keys(c).length!==o?s:c)},r.encode===Tt?Tt:function(i){for(var a={},u=0;u<o;u++){var c=t[u];a[c]=r.encode(i[c])}return a},e,r)}function bb(t){var e;if(zE(t)){var r=t.value;if(Dn.is(r))return e={},e[r]=null,e}else{if(s5(t))return t.keys;if(KE(t)){var n=t.types.map(function(o){return bb(o)});return n.some(th.is)?void 0:Object.assign.apply(Object,e5([{}],n))}}}function o5(t,e,r){return r===void 0&&(r="{ [K in "+t.name+"]: "+e.name+" }"),new Rb(r,function(n){return sr.is(n)?Object.keys(n).every(function(o){return t.is(o)&&e.is(n[o])}):BE(e)&&Array.isArray(n)},function(n,o){if(sr.is(n)){for(var i={},a=[],u=Object.keys(n),c=u.length,s=!1,f=0;f<c;f++){var l=u[f],p=n[l],d=t.validate(l,Pn(o,l,t,l));if(et(d))Jo(a,d.left);else{var h=d.right;s=s||h!==l,l=h;var m=e.validate(p,Pn(o,l,e,p));if(et(m))Jo(a,m.left);else{var g=m.right;s=s||g!==p,i[l]=g}}}return a.length>0?mo(a):ht(s?i:n)}return BE(e)&&Array.isArray(n)?ht(n):Ft(n,o)},t.encode===Tt&&e.encode===Tt?Tt:function(n){for(var o={},i=Object.keys(n),a=i.length,u=0;u<a;u++){var c=i[u];o[String(t.encode(c))]=e.encode(n[c])}return o},t,e)}function LE(t){return"("+t.map(function(e){return e.name}).join(" | ")+")"}function $b(t,e){for(var r=!0,n=!0,o=!sr.is(t),i=0,a=e;i<a.length;i++){var u=a[i];u!==t&&(r=!1),sr.is(u)&&(n=!1)}if(r)return t;if(n)return e[e.length-1];for(var c={},s=0,f=e;s<f.length;s++){var u=f[s];for(var l in u)(!c.hasOwnProperty(l)||o||u[l]!==t[l])&&(c[l]=u[l])}return c}function _b(t){switch(t._tag){case"RefinementType":case"ReadonlyType":return _b(t.type);case"InterfaceType":case"StrictType":case"PartialType":return t.props;case"IntersectionType":return t.types.reduce(function(e,r){return Object.assign(e,_b(r))},{})}}function UE(t,e){for(var r=Object.getOwnPropertyNames(t),n=!1,o={},i=0;i<r.length;i++){var a=r[i];Qd.call(e,a)?o[a]=t[a]:n=!0}return n?o:t}function i5(t){return qE(t)?"{| "+yb(t.props)+" |}":f5(t)?DE("{| "+yb(t.props)+" |}"):"Exact<"+t.name+">"}function a5(t){return t.length>0}var Mr={};function jE(t,e){for(var r=[],n=0,o=t;n<o.length;n++){var i=o[n];e.indexOf(i)!==-1&&r.push(i)}return r}function u5(t,e){if(t===Mr)return e;if(e===Mr)return t;var r=Object.assign({},t);for(var n in e)if(t.hasOwnProperty(n)){var o=jE(t[n],e[n]);if(a5(o))r[n]=o;else{r=Mr;break}}else r[n]=e[n];return r}function c5(t,e){if(t===Mr||e===Mr)return Mr;var r=Mr;for(var n in t)if(e.hasOwnProperty(n)){var o=jE(t[n],e[n]);o.length===0&&(r===Mr&&(r={}),r[n]=t[n].concat(e[n]))}return r}function BE(t){return t._tag==="AnyType"}function zE(t){return t._tag==="LiteralType"}function s5(t){return t._tag==="KeyofType"}function qE(t){return t._tag==="InterfaceType"}function f5(t){return t._tag==="PartialType"}function l5(t){return t._tag==="StrictType"}function p5(t){return t._tag==="ExactType"}function d5(t){return t._tag==="RefinementType"}function h5(t){return t._tag==="IntersectionType"}function KE(t){return t._tag==="UnionType"}function v5(t){return t._tag==="RecursiveType"}var Sb=[];function Vi(t){if(Sb.indexOf(t)!==-1)return Mr;if(qE(t)||l5(t)){var e=Mr;for(var r in t.props){var n=t.props[r];zE(n)&&(e===Mr&&(e={}),e[r]=[n.value])}return e}else{if(p5(t)||d5(t))return Vi(t.type);if(h5(t))return t.types.reduce(function(i,a){return u5(i,Vi(a))},Mr);if(KE(t))return t.types.slice(1).reduce(function(i,a){return c5(i,Vi(a))},Vi(t.types[0]));if(v5(t)){Sb.push(t);var o=Vi(t.type);return Sb.pop(),o}}return Mr}function VE(t){var e=Vi(t[0]),r=Object.keys(e),n=t.length,o=function(s){for(var f=e[s].slice(),l=[e[s]],p=1;p<n;p++){var d=t[p],h=Vi(d),m=h[s];if(m===void 0)return"continue-keys";if(m.some(function(g){return f.indexOf(g)!==-1}))return"continue-keys";f.push.apply(f,m),l.push(m)}return{value:[s,l]}};t:for(var i=0,a=r;i<a.length;i++){var u=a[i],c=o(u);if(typeof c=="object")return c.value;switch(c){case"continue-keys":continue t}}}var HE=function(t){Wt(e,t);function e(){var r=t.call(this,"null",function(n){return n===null},function(n,o){return r.is(n)?ht(n):Ft(n,o)},Tt)||this;return r._tag="NullType",r}return e}(pt),Tb=new HE,JE=function(t){Wt(e,t);function e(){var r=t.call(this,"undefined",function(n){return n===void 0},function(n,o){return r.is(n)?ht(n):Ft(n,o)},Tt)||this;return r._tag="UndefinedType",r}return e}(pt),th=new JE,GE=function(t){Wt(e,t);function e(){var r=t.call(this,"void",th.is,th.validate,Tt)||this;return r._tag="VoidType",r}return e}(pt),YE=new GE,XE=function(t){Wt(e,t);function e(){var r=t.call(this,"unknown",function(n){return!0},ht,Tt)||this;return r._tag="UnknownType",r}return e}(pt),m5=new XE,ZE=function(t){Wt(e,t);function e(){var r=t.call(this,"string",function(n){return typeof n=="string"},function(n,o){return r.is(n)?ht(n):Ft(n,o)},Tt)||this;return r._tag="StringType",r}return e}(pt),Dn=new ZE,QE=function(t){Wt(e,t);function e(){var r=t.call(this,"number",function(n){return typeof n=="number"},function(n,o){return r.is(n)?ht(n):Ft(n,o)},Tt)||this;return r._tag="NumberType",r}return e}(pt),ou=new QE,tw=function(t){Wt(e,t);function e(){var r=t.call(this,"bigint",function(n){return typeof n=="bigint"},function(n,o){return r.is(n)?ht(n):Ft(n,o)},Tt)||this;return r._tag="BigIntType",r}return e}(pt),g5=new tw,ew=function(t){Wt(e,t);function e(){var r=t.call(this,"boolean",function(n){return typeof n=="boolean"},function(n,o){return r.is(n)?ht(n):Ft(n,o)},Tt)||this;return r._tag="BooleanType",r}return e}(pt),eh=new ew,rw=function(t){Wt(e,t);function e(){var r=t.call(this,"UnknownArray",Array.isArray,function(n,o){return r.is(n)?ht(n):Ft(n,o)},Tt)||this;return r._tag="AnyArrayType",r}return e}(pt),qc=new rw,nw=function(t){Wt(e,t);function e(){var r=t.call(this,"UnknownRecord",function(n){var o=Object.prototype.toString.call(n);return o==="[object Object]"||o==="[object Window]"},function(n,o){return r.is(n)?ht(n):Ft(n,o)},Tt)||this;return r._tag="AnyDictionaryType",r}return e}(pt),sr=new nw,ow=function(t){Wt(e,t);function e(r,n,o,i,a){var u=t.call(this,r,n,o,i)||this;return u.value=a,u._tag="LiteralType",u}return e}(pt);function vl(t,e){e===void 0&&(e=JSON.stringify(t));var r=function(n){return n===t};return new ow(e,r,function(n,o){return r(n)?ht(t):Ft(n,o)},Tt,t)}var iw=function(t){Wt(e,t);function e(r,n,o,i,a){var u=t.call(this,r,n,o,i)||this;return u.keys=a,u._tag="KeyofType",u}return e}(pt);function y5(t,e){e===void 0&&(e=Object.keys(t).map(function(n){return JSON.stringify(n)}).join(" | "));var r=function(n){return Dn.is(n)&&Qd.call(t,n)};return new iw(e,r,function(n,o){return r(n)?ht(n):Ft(n,o)},Tt,t)}var aw=function(t){Wt(e,t);function e(r,n,o,i,a,u){var c=t.call(this,r,n,o,i)||this;return c.type=a,c.predicate=u,c._tag="RefinementType",c}return e}(pt);function rh(t,e,r){return Ab(t,e,r)}var nh=rh(ou,function(t){return Number.isInteger(t)},"Int"),Ib=function(t){Wt(e,t);function e(r,n,o,i,a){var u=t.call(this,r,n,o,i)||this;return u.runDefinition=a,u._tag="RecursiveType",u}return e}(pt);Object.defineProperty(Ib.prototype,"type",{get:function(){return this.runDefinition()},enumerable:!0,configurable:!0});function Ob(t,e){var r,n=function(){return r||(r=e(o),r.name=t),r},o=new Ib(t,function(i){return n().is(i)},function(i,a){return n().validate(i,a)},function(i){return n().encode(i)},n);return o}var uw=function(t){Wt(e,t);function e(r,n,o,i,a){var u=t.call(this,r,n,o,i)||this;return u.type=a,u._tag="ArrayType",u}return e}(pt);function oh(t,e){return e===void 0&&(e="Array<"+t.name+">"),new uw(e,function(r){return qc.is(r)&&r.every(t.is)},function(r,n){var o=qc.validate(r,n);if(et(o))return o;for(var i=o.right,a=i.length,u=i,c=[],s=0;s<a;s++){var f=i[s],l=t.validate(f,Pn(n,String(s),t,f));if(et(l))Jo(c,l.left);else{var p=l.right;p!==f&&(u===i&&(u=i.slice()),u[s]=p)}}return c.length>0?mo(c):ht(u)},t.encode===Tt?Tt:function(r){return r.map(t.encode)},t)}var cw=function(t){Wt(e,t);function e(r,n,o,i,a){var u=t.call(this,r,n,o,i)||this;return u.props=a,u._tag="InterfaceType",u}return e}(pt);function Mb(t,e){e===void 0&&(e=PE(t));var r=Object.keys(t),n=r.map(function(i){return t[i]}),o=r.length;return new cw(e,function(i){if(sr.is(i)){for(var a=0;a<o;a++){var u=r[a],c=i[u];if(c===void 0&&!Qd.call(i,u)||!n[a].is(c))return!1}return!0}return!1},function(i,a){var u=sr.validate(i,a);if(et(u))return u;for(var c=u.right,s=c,f=[],l=0;l<o;l++){var p=r[l],d=s[p],h=n[l],m=h.validate(d,Pn(a,p,h,d));if(et(m))Jo(f,m.left);else{var g=m.right;(g!==d||g===void 0&&!Qd.call(s,p))&&(s===c&&(s=zc({},c)),s[p]=g)}}return f.length>0?mo(f):ht(s)},hl(n)?Tt:function(i){for(var a=zc({},i),u=0;u<o;u++){var c=r[u],s=n[u].encode;s!==Tt&&(a[c]=s(i[c]))}return a},t)}var sw=function(t){Wt(e,t);function e(r,n,o,i,a){var u=t.call(this,r,n,o,i)||this;return u.props=a,u._tag="PartialType",u}return e}(pt);function b5(t,e){e===void 0&&(e=DE(PE(t)));var r=Object.keys(t),n=r.map(function(i){return t[i]}),o=r.length;return new sw(e,function(i){if(sr.is(i)){for(var a=0;a<o;a++){var u=r[a],c=i[u];if(c!==void 0&&!t[u].is(c))return!1}return!0}return!1},function(i,a){var u=sr.validate(i,a);if(et(u))return u;for(var c=u.right,s=c,f=[],l=0;l<o;l++){var p=r[l],d=s[p],h=t[p],m=h.validate(d,Pn(a,p,h,d));if(et(m))d!==void 0&&Jo(f,m.left);else{var g=m.right;g!==d&&(s===c&&(s=zc({},c)),s[p]=g)}}return f.length>0?mo(f):ht(s)},hl(n)?Tt:function(i){for(var a=zc({},i),u=0;u<o;u++){var c=r[u],s=i[c];s!==void 0&&(a[c]=n[u].encode(s))}return a},t)}var Rb=function(t){Wt(e,t);function e(r,n,o,i,a,u){var c=t.call(this,r,n,o,i)||this;return c.domain=a,c.codomain=u,c._tag="DictionaryType",c}return e}(pt);function Eb(t,e,r){var n=bb(t);return n?n5(Object.keys(n),t,e,r):o5(t,e,r)}var wb=function(t){Wt(e,t);function e(r,n,o,i,a){var u=t.call(this,r,n,o,i)||this;return u.types=a,u._tag="UnionType",u}return e}(pt);function ml(t,e){e===void 0&&(e=LE(t));var r=VE(t);if(r!==void 0&&t.length>0){var n=r[0],o=r[1],i=o.length,a=function(u){for(var c=0;c<i;c++)if(o[c].indexOf(u)!==-1)return c};return new ih(e,function(u){if(sr.is(u)){var c=a(u[n]);return c!==void 0?t[c].is(u):!1}return!1},function(u,c){var s=sr.validate(u,c);if(et(s))return s;var f=s.right,l=a(f[n]);if(l===void 0)return Ft(u,c);var p=t[l];return p.validate(f,Pn(c,String(l),p,f))},hl(t)?Tt:function(u){var c=a(u[n]);if(c===void 0)throw new Error("no codec found to encode value in union codec "+e);return t[c].encode(u)},t,n)}else return new wb(e,function(u){return t.some(function(c){return c.is(u)})},function(u,c){for(var s=[],f=0;f<t.length;f++){var l=t[f],p=l.validate(u,Pn(c,String(f),l,u));if(et(p))Jo(s,p.left);else return ht(p.right)}return mo(s)},hl(t)?Tt:function(u){for(var c=0,s=t;c<s.length;c++){var f=s[c];if(f.is(u))return f.encode(u)}throw new Error("no codec found to encode value in union type "+e)},t)}var fw=function(t){Wt(e,t);function e(r,n,o,i,a){var u=t.call(this,r,n,o,i)||this;return u.types=a,u._tag="IntersectionType",u}return e}(pt);function $5(t,e){e===void 0&&(e="("+t.map(function(n){return n.name}).join(" & ")+")");var r=t.length;return new fw(e,function(n){return t.every(function(o){return o.is(n)})},t.length===0?ht:function(n,o){for(var i=[],a=[],u=0;u<r;u++){var c=t[u],s=c.validate(n,Pn(o,String(u),c,n));et(s)?Jo(a,s.left):i.push(s.right)}return a.length>0?mo(a):ht($b(n,i))},t.length===0?Tt:function(n){return $b(n,t.map(function(o){return o.encode(n)}))},t)}var lw=function(t){Wt(e,t);function e(r,n,o,i,a){var u=t.call(this,r,n,o,i)||this;return u.types=a,u._tag="TupleType",u}return e}(pt);function _5(t,e){e===void 0&&(e="["+t.map(function(n){return n.name}).join(", ")+"]");var r=t.length;return new lw(e,function(n){return qc.is(n)&&n.length===r&&t.every(function(o,i){return o.is(n[i])})},function(n,o){var i=qc.validate(n,o);if(et(i))return i;for(var a=i.right,u=a.length>r?a.slice(0,r):a,c=[],s=0;s<r;s++){var f=a[s],l=t[s],p=l.validate(f,Pn(o,String(s),l,f));if(et(p))Jo(c,p.left);else{var d=p.right;d!==f&&(u===a&&(u=a.slice()),u[s]=d)}}return c.length>0?mo(c):ht(u)},hl(t)?Tt:function(n){return t.map(function(o,i){return o.encode(n[i])})},t)}var pw=function(t){Wt(e,t);function e(r,n,o,i,a){var u=t.call(this,r,n,o,i)||this;return u.type=a,u._tag="ReadonlyType",u}return e}(pt);function S5(t,e){return e===void 0&&(e="Readonly<"+t.name+">"),new pw(e,t.is,t.validate,t.encode,t)}var dw=function(t){Wt(e,t);function e(r,n,o,i,a){var u=t.call(this,r,n,o,i)||this;return u.type=a,u._tag="ReadonlyArrayType",u}return e}(pt);function hw(t,e){e===void 0&&(e="ReadonlyArray<"+t.name+">");var r=oh(t);return new dw(e,r.is,r.validate,r.encode,t)}var gl=function(t,e){return mw(Mb(t),e)},vw=function(t){Wt(e,t);function e(r,n,o,i,a){var u=t.call(this,r,n,o,i)||this;return u.type=a,u._tag="ExactType",u}return e}(pt);function mw(t,e){e===void 0&&(e=i5(t));var r=_b(t);return new vw(e,t.is,function(n,o){var i=sr.validate(n,o);if(et(i))return i;var a=t.validate(n,o);return et(a)?a:Ct(UE(a.right,r))},function(n){return t.encode(UE(n,r))},t)}var gw=function(t){Wt(e,t);function e(){var r=t.call(this,"Function",function(n){return typeof n=="function"},function(n,o){return r.is(n)?ht(n):Ft(n,o)},Tt)||this;return r._tag="FunctionType",r}return e}(pt),T5=new gw,ih=function(t){Wt(e,t);function e(r,n,o,i,a,u){var c=t.call(this,r,n,o,i,a)||this;return c.tag=u,c}return e}(wb),I5=function(t,e,r){r===void 0&&(r=LE(e));var n=ml(e,r);return n instanceof ih?n:(console.warn("[io-ts] Cannot build a tagged union for "+r+", returning a de-optimized union"),new ih(r,n.is,n.validate,n.encode,e,t))},O5=function(t,e){return{value:t,context:e}},yw=function(t){return[{key:"",type:t}]},bw=function(t){Wt(e,t);function e(){var r=t.call(this,"never",function(n){return!1},function(n,o){return Ft(n,o)},function(){throw new Error("cannot encode never")})||this;return r._tag="NeverType",r}return e}(pt),M5=new bw,$w=function(t){Wt(e,t);function e(){var r=t.call(this,"any",function(n){return!0},ht,Tt)||this;return r._tag="AnyType",r}return e}(pt),R5=new $w,E5=sr,_w=function(t){Wt(e,t);function e(){var r=t.call(this,"object",function(n){return n!==null&&typeof n=="object"},function(n,o){return r.is(n)?ht(n):Ft(n,o)},Tt)||this;return r._tag="ObjectType",r}return e}(pt),w5=new _w;function Ab(t,e,r){return r===void 0&&(r="("+t.name+" | "+NE(e)+")"),new aw(r,function(n){return t.is(n)&&e(n)},function(n,o){var i=t.validate(n,o);if(et(i))return i;var a=i.right;return e(a)?ht(a):Ft(a,o)},t.encode,t,e)}var A5=Ab(ou,Number.isInteger,"Integer"),C5=Eb,x5=function(t){Wt(e,t);function e(r,n,o,i,a){var u=t.call(this,r,n,o,i)||this;return u.props=a,u._tag="StrictType",u}return e}(pt);function k5(t){return t}function W5(t){return function(){return t}}var F5=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module",failures:mo,failure:Ft,success:ht,Type:pt,identity:Tt,getFunctionName:NE,getContextEntry:r5,appendContext:Pn,getDomainKeys:bb,mergeAll:$b,emptyTags:Mr,getTags:Vi,getIndex:VE,NullType:HE,nullType:Tb,UndefinedType:JE,VoidType:GE,voidType:YE,UnknownType:XE,unknown:m5,StringType:ZE,string:Dn,NumberType:QE,number:ou,BigIntType:tw,bigint:g5,BooleanType:ew,boolean:eh,AnyArrayType:rw,UnknownArray:qc,AnyDictionaryType:nw,UnknownRecord:sr,null:Tb,undefined:th,void:YE,LiteralType:ow,literal:vl,KeyofType:iw,keyof:y5,RefinementType:aw,brand:rh,Int:nh,RecursiveType:Ib,recursion:Ob,ArrayType:uw,array:oh,InterfaceType:cw,type:Mb,PartialType:sw,partial:b5,DictionaryType:Rb,record:Eb,UnionType:wb,union:ml,IntersectionType:fw,intersection:$5,TupleType:lw,tuple:_5,ReadonlyType:pw,readonly:S5,ReadonlyArrayType:dw,readonlyArray:hw,strict:gl,ExactType:vw,exact:mw,FunctionType:gw,Function:T5,TaggedUnionType:ih,taggedUnion:I5,Array:qc,interface:Mb,getValidationError:O5,getDefaultContext:yw,NeverType:bw,never:M5,AnyType:$w,any:R5,Dictionary:E5,ObjectType:_w,object:w5,refinement:Ab,Integer:A5,dictionary:C5,StrictType:x5,clean:k5,alias:W5}),nt=Li(F5),Kc={},ah={},uh={};Object.defineProperty(uh,"__esModule",{value:!0}),uh.clone=void 0;function N5(t){var e=Object.create(Object.getPrototypeOf(t));return Object.assign(e,t),e}uh.clone=N5;var P5=ut&&ut.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),D5=ut&&ut.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),L5=ut&&ut.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)Object.hasOwnProperty.call(t,r)&&P5(e,t,r);return D5(e,t),e};Object.defineProperty(ah,"__esModule",{value:!0}),ah.withValidate=void 0;var U5=L5(nt),j5=uh;function B5(t,e,r){r===void 0&&(r=t.name);var n=j5.clone(t);return n.validate=e,n.decode=function(o){return e(o,U5.getDefaultContext(n))},n.name=r,n}ah.withValidate=B5;var z5=ut&&ut.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),q5=ut&&ut.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),K5=ut&&ut.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)Object.hasOwnProperty.call(t,r)&&z5(e,t,r);return q5(e,t),e};Object.defineProperty(Kc,"__esModule",{value:!0}),Kc.withFallback=void 0;var V5=K5(nt),H5=ah,J5=qo;function G5(t,e,r){return r===void 0&&(r="withFallback("+t.name+")"),H5.withValidate(t,function(n,o){return J5.orElse(function(){return V5.success(e)})(t.validate(n,o))},r)}Kc.withFallback=G5;var Pt={},Cb={},fr=Li(FE),Kr=Li(nE);Object.defineProperty(Cb,"__esModule",{value:!0});const Y5=X.exports,X5=fr,Z5=Kr,ch=(0,Y5.__importStar)(nt);Cb.default=new ch.Type("dateFromString",t=>t instanceof Date,(t,e)=>(0,Z5.pipe)(ch.string.validate(t,e),(0,X5.chain)(r=>{const n=new Date(r);return isNaN(n.getTime())?ch.failure(t,e):ch.success(n)})),t=>t.toISOString());var xb={};Object.defineProperty(xb,"__esModule",{value:!0});const Q5=X.exports,tH=fr,eH=Kr,Vc=(0,Q5.__importStar)(nt);xb.default=new Vc.Type("dateFromStringOrNumber",t=>t instanceof Date,(t,e)=>(0,eH.pipe)(Vc.union([Vc.number,Vc.string]).validate(t,e),(0,tH.chain)(r=>{const n=new Date(r);return isNaN(n.getTime())?Vc.failure(t,e):Vc.success(n)})),t=>t);var kb={};Object.defineProperty(kb,"__esModule",{value:!0});const rH=X.exports,nH=fr,oH=Kr,sh=(0,rH.__importStar)(nt);kb.default=new sh.Type("dateFromTsMs",t=>t instanceof Date,(t,e)=>(0,oH.pipe)(sh.number.validate(t,e),(0,nH.chain)(r=>{const n=new Date(r);return isNaN(n.getTime())?sh.failure(t,e):sh.success(n)})),t=>t.getTime());var xt={};function Sw(t){return function(e){return function(r){return r.reduce(function(n,o){return t.alt(n,function(){return o})},e)}}}var iH=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module",altAll:Sw});function aH(t){return Sw(t)(t.zero())}var uH=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module",altAll:aH}),vn=function(t){return{equals:function(e,r){return e===r||t(e,r)}}},Tw=function(t){return vn(function(e,r){for(var n in t)if(!t[n].equals(e[n],r[n]))return!1;return!0})},Iw=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return vn(function(r,n){return t.every(function(o,i){return o.equals(r[i],n[i])})})},cH=function(t,e){return v(t,Ow(e))},Ow=function(t){return function(e){return vn(function(r,n){return e.equals(t(r),t(n))})}},Mw="Eq",Hc={equals:function(t,e){return t===e}},sH={equals:function(){return!0}},Rw=function(){return{concat:function(t,e){return vn(function(r,n){return t.equals(r,n)&&e.equals(r,n)})}}},fH=function(){return{concat:Rw().concat,empty:sH}},Ew={URI:Mw,contramap:cH},lH=Iw,pH=Tw,dH=Hc.equals,hH=Ew,vH=Hc,mH=Hc,gH=Hc,yH={equals:function(t,e){return t.valueOf()===e.valueOf()}},bH=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module",fromEquals:vn,struct:Tw,tuple:Iw,contramap:Ow,URI:Mw,eqStrict:Hc,getSemigroup:Rw,getMonoid:fH,Contravariant:Ew,getTupleEq:lH,getStructEq:pH,strictEqual:dH,eq:hH,eqBoolean:vH,eqString:mH,eqNumber:gH,eqDate:yH}),ww=function(t){return function(e,r){return e===r||t(e,r)===0}},iu=function(t){return{equals:ww(t),compare:function(e,r){return e===r?0:t(e,r)}}},Aw=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return iu(function(r,n){for(var o=0;o<t.length-1;o++){var i=t[o].compare(r[o],n[o]);if(i!==0)return i}return t[o].compare(r[o],n[o])})},Cw=function(t){return iu(function(e,r){return t.compare(r,e)})},$H=function(t,e){return v(t,fh(e))},fh=function(t){return function(e){return iu(function(r,n){return e.compare(t(r),t(n))})}},xw="Ord",kw=function(){return{concat:function(t,e){return iu(function(r,n){var o=t.compare(r,n);return o!==0?o:e.compare(r,n)})}}},Wb=function(){return{concat:kw().concat,empty:iu(function(){return 0})}},Ww={URI:xw,contramap:$H},_H={equals:Yy,compare:Or(0)},SH=function(t){return function(e){return function(r){return r===e||t.compare(r,e)===0}}},Fw=function(t){return function(e,r){return t.compare(e,r)===-1}},Nw=function(t){return function(e,r){return t.compare(e,r)===1}},TH=function(t){return function(e,r){return t.compare(e,r)!==1}},IH=function(t){return function(e,r){return t.compare(e,r)!==-1}},lh=function(t){return function(e,r){return e===r||t.compare(e,r)<1?e:r}},ph=function(t){return function(e,r){return e===r||t.compare(e,r)>-1?e:r}},OH=function(t){var e=lh(t),r=ph(t);return function(n,o){return function(i){return r(e(i,o),n)}}},MH=function(t){var e=Fw(t),r=Nw(t);return function(n,o){return function(i){return!(e(i,n)||r(i,o))}}},RH=Aw,EH=Cw,wH=Ww;function AH(t,e){return t<e?-1:t>e?1:0}var Fb={equals:Hc.equals,compare:AH},CH=Fb,xH=Fb,dh=Fb,kH=v(dh,fh(function(t){return t.valueOf()})),WH=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module",equalsDefault:ww,fromCompare:iu,tuple:Aw,reverse:Cw,contramap:fh,URI:xw,getSemigroup:kw,getMonoid:Wb,Contravariant:Ww,trivial:_H,equals:SH,lt:Fw,gt:Nw,leq:TH,geq:IH,min:lh,max:ph,clamp:OH,between:MH,getTupleOrd:RH,getDualOrd:EH,ord:wH,ordBoolean:CH,ordString:xH,ordNumber:dh,ordDate:kH}),Pw=function(t){return{concat:function(e,r){return t.concat(r,e)}}},FH=function(t){return function(e){return{concat:function(r,n){return t(r)?e.concat(r,n):n}}}},NH=function(t){return function(e){return{concat:function(r,n){return t(n)?e.concat(r,n):r}}}},PH=function(t){return function(e){return{concat:function(r,n){return e.concat(t(r),t(n))}}}},Dw=function(t){return function(e){return function(r){return r.reduce(function(n,o){return t.concat(n,o)},e)}}},DH=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module",reverse:Pw,filterFirst:FH,filterSecond:NH,endo:PH,concatAll:Dw}),hh=function(t){return{concat:lh(t)}},vh=function(t){return{concat:ph(t)}},Nb=function(t){return{concat:function(){return t}}},Pb=Pw,Db=function(t){return{concat:function(e,r){var n={};for(var o in t)re.call(t,o)&&(n[o]=t[o].concat(e[o],r[o]));return n}}},Lb=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return{concat:function(r,n){return t.map(function(o,i){return o.concat(r[i],n[i])})}}},Lw=function(t){return function(e){return{concat:function(r,n){return e.concat(r,e.concat(t,n))}}}},Ub=function(){return{concat:j}},jb=function(){return{concat:function(t,e){return e}}},Bb=Dw,Uw=Nb(void 0),LH=function(){return{concat:function(t,e){return Object.assign({},t,e)}}},UH=jb,jH=Ub,BH=Lb,zH=Db,qH=Pb,KH=vh,VH=hh,HH=Lw;function JH(t){var e=Bb(t);return function(r,n){return n===void 0?e(r):e(r)(n)}}var jw={concat:function(t,e){return t&&e}},Bw={concat:function(t,e){return t||e}},GH=Jy,zw={concat:function(t,e){return t+e}},qw={concat:function(t,e){return t+e}},Kw={concat:function(t,e){return t*e}},Vw=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module",min:hh,max:vh,constant:Nb,reverse:Pb,struct:Db,tuple:Lb,intercalate:Lw,first:Ub,last:jb,concatAll:Bb,semigroupVoid:Uw,getObjectSemigroup:LH,getLastSemigroup:UH,getFirstSemigroup:jH,getTupleSemigroup:BH,getStructSemigroup:zH,getDualSemigroup:qH,getJoinSemigroup:KH,getMeetSemigroup:VH,getIntercalateSemigroup:HH,fold:JH,semigroupAll:jw,semigroupAny:Bw,getFunctionSemigroup:GH,semigroupString:zw,semigroupSum:qw,semigroupProduct:Kw}),yl=globalThis&&globalThis.__spreadArray||function(t,e){for(var r=0,n=e.length,o=t.length;r<n;r++,o++)t[o]=e[r];return t},bl=Ze,go=Qt,mh=function(t,e){return t<0||t>=e.length},zb=function(t){return function(e){return yl([t],e)}},Jc=zb,qb=function(t){return function(e){return yl(yl([],e),[t])}},gh=qb,yh=function(t,e,r){if(go(r)){var n=Yd(r);return n.splice(t,0,e),n}return[e]},Kb=function(t,e,r){if(r[t]===e)return r;var n=Yd(r);return n[t]=e,n},Vb=function(t){return function(e){if(e.length===1)return e;for(var r=[pr(e)],n=Un(e),o=function(c){r.every(function(s){return!t.equals(s,c)})&&r.push(c)},i=0,a=n;i<a.length;i++){var u=a[i];o(u)}return r}},Hw=function(t){if(go(t)){var e=Wb();return Gb(t.reduce(e.concat,e.empty))}return j},Hb=function(t){var e=Vb(t);return function(r){return function(n){return e(v(n,_l(r)))}}},Jb=function(t){return function(e){var r=e.length,n=Math.round(t)%r;if(mh(Math.abs(n),e)||n===0)return e;if(n<0){var o=_h(-n)(e),i=o[0],a=o[1];return v(a,_l(i))}else return Jb(n-r)(e)}},$l=function(t){return go(t)?ct(t):lt},bh=function(t){return function(e){for(var r=Math.max(0,Math.floor(e)),n=[t(0)],o=1;o<r;o++)n.push(t(o));return n}},YH=function(t){return bh(function(){return t})},Jw=function(t,e){return t<=e?bh(function(r){return t+r})(e-t+1):[t]},Gw=function(t){return[pr(t),Un(t)]},Yw=function(t){return[Gc(t),Ji(t)]},XH=function(t){return $l(t.slice())};function Xw(t){return function(e){return e.concat(t)}}function _l(t,e){return e?t.concat(e):function(r){return r.concat(t)}}var ZH=function(t){return t.length===1?t:yl([Ji(t)],t.slice(0,-1).reverse())};function Zw(t){return function(e){var r=e.length;if(r===0)return bl;for(var n=[],o=e[0],i=[o],a=1;a<r;a++){var u=e[a];t.equals(u,o)?i.push(u):(n.push(i),o=u,i=[o])}return n.push(i),n}}var QH=function(t){return function(e){for(var r={},n=0,o=e;n<o.length;n++){var i=o[n],a=t(i);r.hasOwnProperty(a)?r[a].push(i):r[a]=[i]}return r}},Gb=function(t){return function(e){return e.length===1?e:e.slice().sort(t.compare)}},t6=function(t,e){return Qw(t,function(){return e})},Qw=function(t,e){return function(r){return mh(t,r)?lt:ct(Kb(t,e(r[t]),r))}},tA=function(t,e,r){for(var n=[r(t[0],e[0])],o=Math.min(t.length,e.length),i=1;i<o;i++)n[i]=r(t[i],e[i]);return n};function eA(t,e){return e===void 0?function(r){return eA(r,t)}:tA(t,e,function(r,n){return[r,n]})}var e6=function(t){for(var e=[t[0][0]],r=[t[0][1]],n=1;n<t.length;n++)e[n]=t[n][0],r[n]=t[n][1];return[e,r]},$h=function(t){return function(e){for(var r=[t,e[0]],n=1;n<e.length;n++)r.push(t,e[n]);return r}},rA=function(t){return function(e){var r=Un(e);return go(r)?v(r,$h(t),Jc(pr(e))):e}},nA=function(t){return function(e){for(var r=Yd(t(0,pr(e))),n=1;n<e.length;n++)r.push.apply(r,t(n,e[n]));return r}},Yb=function(t){return function(e){for(var r=t(e),n=r[0],o=r[1],i=[n],a=o;go(a);){var u=t(a),c=u[0],s=u[1];i.push(c),a=s}return i}},_h=function(t){return function(e){var r=Math.max(1,t);return r>=e.length?[e,bl]:[v(e.slice(1,r),Jc(pr(e))),e.slice(r)]}},oA=function(t){return Yb(_h(t))},Ln=function(t,e){return v(t,o$(e))},Xb=function(t,e){return v(t,i$(e))},Sl=function(t,e){return v(t,fA(e))},Zb=function(t,e){return v(t,Sh(e))},iA=function(t,e){return v(t,n$(e))},Tl=function(t,e,r){return v(t,a$(e,r))},Il=function(t){var e=u$(t);return function(r,n){return v(r,e(n))}},Ol=function(t,e,r){return v(t,c$(e,r))},Qb=function(t){var e=lA(t);return function(r,n){return v(r,e(n))}},aA=function(t,e){return v(t,sA(e))},t$=function(t,e,r){return v(t,Th(e,r))},e$=function(t){var e=s$(t);return function(r,n){return v(r,e(n))}},r$=function(t,e,r){return v(t,Ih(e,r))},uA=function(t){var e=Mh(t);return function(r,n){return v(r,e(n))}},Hi=nl,cA=function(t){return function(e){return v(e,Xw(t()))}},sA=cA,fA=function(t){return Sh(function(e){return v(t,o$(e))})},Sh=function(t){return nA(function(e,r){return t(r)})},n$=function(t){return function(e){for(var r=Un(e),n=[t(e)];go(r);)n.push(t(r)),r=Un(r);return n}},r6=n$(j),n6=Sh(j),o$=function(t){return i$(function(e,r){return t(r)})},i$=function(t){return function(e){for(var r=[t(0,pr(e))],n=1;n<e.length;n++)r.push(t(n,e[n]));return r}},a$=function(t,e){return Th(t,function(r,n,o){return e(n,o)})},u$=function(t){return function(e){return function(r){return r.slice(1).reduce(function(n,o){return t.concat(n,e(o))},e(r[0]))}}},c$=function(t,e){return Ih(t,function(r,n,o){return e(n,o)})},Th=function(t,e){return function(r){return r.reduce(function(n,o,i){return e(i,n,o)},t)}},s$=function(t){return function(e){return function(r){return r.slice(1).reduce(function(n,o,i){return t.concat(n,e(i+1,o))},e(0,r[0]))}}},Ih=function(t,e){return function(r){return r.reduceRight(function(n,o,i){return e(i,o,n)},t)}},lA=function(t){var e=Mh(t);return function(r){return e(function(n,o){return r(o)})}},Oh=function(t){return Mh(t)(zr)},Mh=function(t){return function(e){return function(r){for(var n=t.map(e(0,pr(r)),Hi),o=1;o<r.length;o++)n=t.ap(t.map(n,function(i){return function(a){return v(i,gh(a))}}),e(o,r[o]));return n}}},Rh=qr,lr="ReadonlyNonEmptyArray",pA=function(t){return{show:function(e){return"["+e.map(t.show).join(", ")+"]"}}},o6=function(){return{concat:_l}},dA=function(t){return vn(function(e,r){return e.length===r.length&&e.every(function(n,o){return t.equals(n,r[o])})})},i6=function(t){var e=Hb(t);return{concat:function(r,n){return e(n)(r)}}},f$={URI:lr,map:Ln},a6=Et(f$),u6={URI:lr,of:Hi},c6={URI:lr,map:Ln,mapWithIndex:Xb},Eh={URI:lr,map:Ln,ap:Sl},s6=le(Eh),f6=pe(Eh),l6={URI:lr,map:Ln,ap:Sl,of:Hi},l$={URI:lr,map:Ln,ap:Sl,chain:Zb},p6=Xt(l$),d6={URI:lr,map:Ln,ap:Sl,of:Hi,chain:Zb},h6={URI:lr,reduce:Tl,foldMap:Il,reduceRight:Ol},v6={URI:lr,reduce:Tl,foldMap:Il,reduceRight:Ol,reduceWithIndex:t$,foldMapWithIndex:e$,reduceRightWithIndex:r$},m6={URI:lr,map:Ln,reduce:Tl,foldMap:Il,reduceRight:Ol,traverse:Qb,sequence:Oh},g6={URI:lr,map:Ln,mapWithIndex:Xb,reduce:Tl,foldMap:Il,reduceRight:Ol,traverse:Qb,sequence:Oh,reduceWithIndex:t$,foldMapWithIndex:e$,reduceRightWithIndex:r$,traverseWithIndex:uA},y6={URI:lr,map:Ln,alt:aA},b6={URI:lr,map:Ln,extend:iA,extract:Rh},$6=Hi(xe),_6=he(f$),S6=ve(l$),T6=de(Eh),pr=Rh,Un=Dc,Ji=function(t){return t[t.length-1]},Gc=function(t){return t.slice(0,-1)},hA=function(t){var e=hh(t);return function(r){return r.reduce(e.concat)}},vA=function(t){var e=vh(t);return function(r){return r.reduce(e.concat)}},p$=function(t){return function(e){return e.reduce(t.concat)}},I6=function(t){return function(e){return t(pr(e),Un(e))}},O6=function(t){return function(e){return t(Gc(e),Ji(e))}},mA=function(t){return function(e){return yl([t(pr(e))],Un(e))}},M6=function(t){return mA(function(){return t})},gA=function(t){return function(e){return v(Gc(e),gh(t(Ji(e))))}},R6=function(t){return gA(function(){return t})};function E6(t){var e=Gb(t),r=Zw(t);return function(n){return go(n)?r(e(n)):bl}}function w6(t){return yA(function(e,r){return t(r)})}var yA=function(t){return function(e){return $l(e.filter(function(r,n){return t(n,r)}))}},A6=Gw,C6=Yw;function bA(t,e){return e===void 0?Jc(t):v(e,Jc(t))}var $A=function(t,e){return v(t,_l([e]))},x6=function(t,e){return function(r){return t<0||t>r.length?lt:ct(yh(t,e,r))}},k6=$h,W6=p$,F6={URI:lr,of:Hi,map:Ln,mapWithIndex:Xb,ap:Sl,chain:Zb,extend:iA,extract:Rh,reduce:Tl,foldMap:Il,reduceRight:Ol,traverse:Qb,sequence:Oh,reduceWithIndex:t$,foldMapWithIndex:e$,reduceRightWithIndex:r$,traverseWithIndex:uA,alt:aA},N6=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module",empty:bl,isNonEmpty:go,isOutOfBound:mh,prependW:zb,prepend:Jc,appendW:qb,append:gh,unsafeInsertAt:yh,unsafeUpdateAt:Kb,uniq:Vb,sortBy:Hw,union:Hb,rotate:Jb,fromReadonlyArray:$l,makeBy:bh,replicate:YH,range:Jw,unprepend:Gw,unappend:Yw,fromArray:XH,concatW:Xw,concat:_l,reverse:ZH,group:Zw,groupBy:QH,sort:Gb,updateAt:t6,modifyAt:Qw,zipWith:tA,zip:eA,unzip:e6,prependAll:$h,intersperse:rA,chainWithIndex:nA,chop:Yb,splitAt:_h,chunksOf:oA,of:Hi,altW:cA,alt:sA,ap:fA,chain:Sh,extend:n$,duplicate:r6,flatten:n6,map:o$,mapWithIndex:i$,reduce:a$,foldMap:u$,reduceRight:c$,reduceWithIndex:Th,foldMapWithIndex:s$,reduceRightWithIndex:Ih,traverse:lA,sequence:Oh,traverseWithIndex:Mh,extract:Rh,URI:lr,getShow:pA,getSemigroup:o6,getEq:dA,getUnionSemigroup:i6,Functor:f$,flap:a6,Pointed:u6,FunctorWithIndex:c6,Apply:Eh,apFirst:s6,apSecond:f6,Applicative:l6,Chain:l$,chainFirst:p6,Monad:d6,Foldable:h6,FoldableWithIndex:v6,Traversable:m6,TraversableWithIndex:g6,Alt:y6,Comonad:b6,Do:$6,bindTo:_6,bind:S6,apS:T6,head:pr,tail:Un,last:Ji,init:Gc,min:hA,max:vA,concatAll:p$,matchLeft:I6,matchRight:O6,modifyHead:mA,updateHead:M6,modifyLast:gA,updateLast:R6,groupSort:E6,filter:w6,filterWithIndex:yA,uncons:A6,unsnoc:C6,cons:bA,snoc:$A,insertAt:x6,prependToAll:k6,fold:W6,readonlyNonEmptyArray:F6}),Ml=globalThis&&globalThis.__spreadArray||function(t,e){for(var r=0,n=e.length,o=t.length;r<n;r++,o++)t[o]=e[r];return t},Go=function(t){return t.length>0},wh=function(t,e){return t<0||t>=e.length},d$=function(t){return function(e){return Ml([t],e)}},Yc=d$,h$=function(t){return function(e){return Ml(Ml([],e),[t])}},Rl=h$,v$=function(t,e,r){if(Go(r)){var n=El(r);return n.splice(t,0,e),n}return[e]},m$=function(t,e,r){var n=El(r);return n[t]=e,n},g$=function(t){return function(e){if(e.length===1)return Xc(e);for(var r=[mn(e)],n=Bn(e),o=function(c){r.every(function(s){return!t.equals(s,c)})&&r.push(c)},i=0,a=n;i<a.length;i++){var u=a[i];o(u)}return r}},_A=function(t){if(Go(t)){var e=Wb();return _$(t.reduce(e.concat,e.empty))}return Xc},y$=function(t){var e=g$(t);return function(r){return function(n){return e(v(n,Ch(r)))}}},b$=function(t){return function(e){var r=e.length,n=Math.round(t)%r;if(wh(Math.abs(n),e)||n===0)return Xc(e);if(n<0){var o=kh(-n)(e),i=o[0],a=o[1];return v(a,Ch(i))}else return b$(n-r)(e)}},El=Yd,$$=function(t){return Go(t)?ct(t):lt},Ah=function(t){return function(e){for(var r=Math.max(0,Math.floor(e)),n=[t(0)],o=1;o<r;o++)n.push(t(o));return n}},P6=function(t){return Ah(function(){return t})},SA=function(t,e){return t<=e?Ah(function(r){return t+r})(e-t+1):[t]},TA=function(t){return[mn(t),Bn(t)]},IA=function(t){return[Qc(t),Zc(t)]};function OA(t){return function(e){return e.concat(t)}}function Ch(t,e){return e?t.concat(e):function(r){return r.concat(t)}}var D6=function(t){return Ml([Zc(t)],t.slice(0,-1).reverse())};function MA(t){return function(e){var r=e.length;if(r===0)return[];for(var n=[],o=e[0],i=[o],a=1;a<r;a++){var u=e[a];t.equals(u,o)?i.push(u):(n.push(i),o=u,i=[o])}return n.push(i),n}}var L6=function(t){return function(e){for(var r={},n=0,o=e;n<o.length;n++){var i=o[n],a=t(i);r.hasOwnProperty(a)?r[a].push(i):r[a]=[i]}return r}},_$=function(t){return function(e){return e.slice().sort(t.compare)}},U6=function(t,e){return function(r){return t<0||t>r.length?lt:ct(v$(t,e,r))}},j6=function(t,e){return RA(t,function(){return e})},RA=function(t,e){return function(r){return wh(t,r)?lt:ct(m$(t,e(r[t]),r))}},Xc=El,Gi=function(t){return[t]},EA=function(t,e,r){for(var n=[r(t[0],e[0])],o=Math.min(t.length,e.length),i=1;i<o;i++)n[i]=r(t[i],e[i]);return n};function wA(t,e){return e===void 0?function(r){return wA(r,t)}:EA(t,e,function(r,n){return[r,n]})}var B6=function(t){for(var e=[t[0][0]],r=[t[0][1]],n=1;n<t.length;n++)e[n]=t[n][0],r[n]=t[n][1];return[e,r]},xh=function(t){return function(e){for(var r=[t,e[0]],n=1;n<e.length;n++)r.push(t,e[n]);return r}},AA=function(t){return function(e){var r=Bn(e);return Go(r)?v(r,xh(t),Yc(mn(e))):Xc(e)}},CA=s$,xA=u$,kA=function(t){return function(e){for(var r=El(t(0,mn(e))),n=1;n<e.length;n++)r.push.apply(r,t(n,e[n]));return r}},S$=function(t){return function(e){for(var r=t(e),n=r[0],o=r[1],i=[n],a=o;Go(a);){var u=t(a),c=u[0],s=u[1];i.push(c),a=s}return i}},kh=function(t){return function(e){var r=Math.max(1,t);return r>=e.length?[Xc(e),[]]:[v(e.slice(1,r),Yc(mn(e))),e.slice(r)]}},WA=function(t){return S$(kh(t))},jn=function(t,e){return v(t,A$(e))},T$=function(t,e){return v(t,C$(e))},wl=function(t,e){return v(t,UA(e))},I$=function(t,e){return v(t,Wh(e))},FA=function(t,e){return v(t,w$(e))},Al=function(t,e,r){return v(t,jA(e,r))},Cl=function(t){var e=xA(t);return function(r,n){return v(r,e(n))}},xl=function(t,e,r){return v(t,zA(e,r))},O$=function(t){var e=KA(t);return function(r,n){return v(r,e(n))}},NA=function(t,e){return v(t,LA(e))},M$=function(t,e,r){return v(t,BA(e,r))},R$=function(t){var e=CA(t);return function(r,n){return v(r,e(n))}},E$=function(t,e,r){return v(t,qA(e,r))},PA=function(t){var e=Nh(t);return function(r,n){return v(r,e(n))}},DA=function(t){return function(e){return v(e,OA(t()))}},LA=DA,UA=function(t){return Wh(function(e){return v(t,A$(e))})},Wh=function(t){return kA(function(e,r){return t(r)})},w$=function(t){return function(e){for(var r=Bn(e),n=[t(e)];Go(r);)n.push(t(r)),r=Bn(r);return n}},z6=w$(j),q6=Wh(j),A$=function(t){return C$(function(e,r){return t(r)})},C$=function(t){return function(e){for(var r=[t(0,mn(e))],n=1;n<e.length;n++)r.push(t(n,e[n]));return r}},jA=a$,BA=Th,zA=c$,qA=Ih,KA=function(t){var e=Nh(t);return function(r){return e(function(n,o){return r(o)})}},Fh=function(t){return Nh(t)(function(e,r){return r})},Nh=function(t){return function(e){return function(r){for(var n=t.map(e(0,mn(r)),Gi),o=1;o<r.length;o++)n=t.ap(t.map(n,function(i){return function(a){return v(i,Rl(a))}}),e(o,r[o]));return n}}},x$=pr,dr="NonEmptyArray",K6=pA,V6=function(){return{concat:Ch}},H6=dA,J6=function(t){var e=y$(t);return{concat:function(r,n){return e(n)(r)}}},k$={URI:dr,map:jn},G6=Et(k$),Y6={URI:dr,of:Gi},X6={URI:dr,map:jn,mapWithIndex:T$},Ph={URI:dr,map:jn,ap:wl},Z6=le(Ph),Q6=pe(Ph),tJ={URI:dr,map:jn,ap:wl,of:Gi},W$={URI:dr,map:jn,ap:wl,chain:I$},eJ=Xt(W$),rJ={URI:dr,map:jn,ap:wl,of:Gi,chain:I$},nJ={URI:dr,reduce:Al,foldMap:Cl,reduceRight:xl},oJ={URI:dr,reduce:Al,foldMap:Cl,reduceRight:xl,reduceWithIndex:M$,foldMapWithIndex:R$,reduceRightWithIndex:E$},iJ={URI:dr,map:jn,reduce:Al,foldMap:Cl,reduceRight:xl,traverse:O$,sequence:Fh},aJ={URI:dr,map:jn,mapWithIndex:T$,reduce:Al,foldMap:Cl,reduceRight:xl,traverse:O$,sequence:Fh,reduceWithIndex:M$,foldMapWithIndex:R$,reduceRightWithIndex:E$,traverseWithIndex:PA},uJ={URI:dr,map:jn,alt:NA},cJ={URI:dr,map:jn,extend:FA,extract:x$},sJ=Gi(xe),fJ=he(k$),lJ=ve(W$),pJ=de(Ph),mn=pr,Bn=function(t){return t.slice(1)},Zc=Ji,Qc=function(t){return t.slice(0,-1)},dJ=hA,hJ=vA,vJ=function(t){return function(e){return e.reduce(t.concat)}},mJ=function(t){return function(e){return t(mn(e),Bn(e))}},gJ=function(t){return function(e){return t(Qc(e),Zc(e))}},VA=function(t){return function(e){return Ml([t(mn(e))],Bn(e))}},yJ=function(t){return VA(function(){return t})},HA=function(t){return function(e){return v(Qc(e),Rl(t(Zc(e))))}},bJ=function(t){return HA(function(){return t})};function $J(t){var e=_$(t),r=MA(t);return function(n){return Go(n)?r(e(n)):[]}}function _J(t){return JA(function(e,r){return t(r)})}var JA=function(t){return function(e){return $$(e.filter(function(r,n){return t(n,r)}))}},SJ=TA,TJ=IA;function GA(t,e){return e===void 0?Yc(t):v(e,Yc(t))}var YA=function(t,e){return v(t,Rl(e))},IJ=xh,OJ=p$,MJ={URI:dr,of:Gi,map:jn,mapWithIndex:T$,ap:wl,chain:I$,extend:FA,extract:x$,reduce:Al,foldMap:Cl,reduceRight:xl,traverse:O$,sequence:Fh,reduceWithIndex:M$,foldMapWithIndex:R$,reduceRightWithIndex:E$,traverseWithIndex:PA,alt:NA},RJ=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module",isNonEmpty:Go,isOutOfBound:wh,prependW:d$,prepend:Yc,appendW:h$,append:Rl,unsafeInsertAt:v$,unsafeUpdateAt:m$,uniq:g$,sortBy:_A,union:y$,rotate:b$,fromReadonlyNonEmptyArray:El,fromArray:$$,makeBy:Ah,replicate:P6,range:SA,unprepend:TA,unappend:IA,concatW:OA,concat:Ch,reverse:D6,group:MA,groupBy:L6,sort:_$,insertAt:U6,updateAt:j6,modifyAt:RA,copy:Xc,of:Gi,zipWith:EA,zip:wA,unzip:B6,prependAll:xh,intersperse:AA,foldMapWithIndex:CA,foldMap:xA,chainWithIndex:kA,chop:S$,splitAt:kh,chunksOf:WA,altW:DA,alt:LA,ap:UA,chain:Wh,extend:w$,duplicate:z6,flatten:q6,map:A$,mapWithIndex:C$,reduce:jA,reduceWithIndex:BA,reduceRight:zA,reduceRightWithIndex:qA,traverse:KA,sequence:Fh,traverseWithIndex:Nh,extract:x$,URI:dr,getShow:K6,getSemigroup:V6,getEq:H6,getUnionSemigroup:J6,Functor:k$,flap:G6,Pointed:Y6,FunctorWithIndex:X6,Apply:Ph,apFirst:Z6,apSecond:Q6,Applicative:tJ,Chain:W$,chainFirst:eJ,Monad:rJ,Foldable:nJ,FoldableWithIndex:oJ,Traversable:iJ,TraversableWithIndex:aJ,Alt:uJ,Comonad:cJ,Do:sJ,bindTo:fJ,bind:lJ,apS:pJ,head:mn,tail:Bn,last:Zc,init:Qc,min:dJ,max:hJ,concatAll:vJ,matchLeft:mJ,matchRight:gJ,modifyHead:VA,updateHead:yJ,modifyLast:HA,updateLast:bJ,groupSort:$J,filter:_J,filterWithIndex:JA,uncons:SJ,unsnoc:TJ,cons:GA,snoc:YA,prependToAll:IJ,fold:OJ,nonEmptyArray:MJ}),EJ=function(t){return typeof t=="number"},F$={equals:function(t,e){return t===e}},Dh={equals:F$.equals,compare:function(t,e){return t<e?-1:t>e?1:0}},wJ={equals:F$.equals,compare:Dh.compare,top:1/0,bottom:-1/0},AJ={show:function(t){return JSON.stringify(t)}},XA={concat:function(t,e){return t-e}},N$={concat:function(t,e){return t+e}},P$={concat:function(t,e){return t*e}},CJ={concat:N$.concat,empty:0},xJ={concat:P$.concat,empty:1},kJ={add:N$.concat,zero:0,mul:P$.concat,one:1,sub:XA.concat,degree:function(t){return 1},div:function(t,e){return t/e},mod:function(t,e){return t%e}},WJ=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module",isNumber:EJ,Eq:F$,Ord:Dh,Bounded:wJ,Show:AJ,MagmaSub:XA,SemigroupSum:N$,SemigroupProduct:P$,MonoidSum:CJ,MonoidProduct:xJ,Field:kJ});function kl(t,e){return function(r){return r?e.of(void 0):t.zero()}}var FJ=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module",guard:kl}),NJ=globalThis&&globalThis.__spreadArray||function(t,e){for(var r=0,n=e.length,o=t.length;r<n;r++,o++)t[o]=e[r];return t},yo=function(t){return t.length===0},ce=go,PJ=Jc,DJ=zb,Lh=gh,LJ=qb,ZA=function(t,e){return t<=0?ie:bh(e)(t)},UJ=function(t,e){return ZA(t,function(){return e})};function jJ(t){return function(e){return t(e)?[e]:ie}}var QA=function(t){return me(t)?ie:[t.value]},tC=function(t){return Me(t)?ie:[t.right]},eC=function(t,e){return function(r){return ce(r)?e(r):t()}},BJ=eC,rC=function(t,e){return function(r){return ce(r)?e(pr(r),Un(r)):t()}},nC=rC,zJ=nC,oC=function(t,e){return function(r){return ce(r)?e(Gc(r),Ji(r)):t()}},iC=oC,qJ=iC,aC=function(t){return function(e){if(yo(e))return ie;for(var r=[],n=0;n<e.length;n++)r.push.apply(r,t(n,e[n]));return r}},KJ=function(t,e){return function(r){var n=r.length,o=new Array(n+1);o[0]=t;for(var i=0;i<n;i++)o[i+1]=e(o[i],r[i]);return o}},VJ=function(t,e){return function(r){var n=r.length,o=new Array(n+1);o[n]=t;for(var i=n-1;i>=0;i--)o[i]=e(r[i],o[i+1]);return o}},HJ=function(t){return t.length},ts=mh;function au(t,e){return e===void 0?function(r){return au(t,r)}:ts(t,e)?lt:ct(e[t])}var uC=function(t){return ce(t)?ct(pr(t)):lt},D$=function(t){return ce(t)?ct(Ji(t)):lt},JJ=function(t){return ce(t)?ct(Un(t)):lt},GJ=function(t){return ce(t)?ct(Gc(t)):lt},YJ=function(t){return function(e){return ts(t,e)?e:t===0?ie:e.slice(0,t)}},XJ=function(t){return function(e){return ts(t,e)?e:t===0?ie:e.slice(-t)}};function ZJ(t){return function(e){for(var r=[],n=0,o=e;n<o.length;n++){var i=o[n];if(!t(i))break;r.push(i)}var a=r.length;return a===e.length?e:a===0?ie:r}}var cC=function(t,e){for(var r=t.length,n=0;n<r&&e(t[n]);n++);return n};function QJ(t){return function(e){var r=L$(cC(e,t))(e),n=r[0],o=r[1];return{init:n,rest:o}}}var t7=function(t){return function(e){return t<=0||yo(e)?e:t>=e.length?ie:e.slice(t,e.length)}},e7=function(t){return function(e){return t<=0||yo(e)?e:t>=e.length?ie:e.slice(0,e.length-t)}};function r7(t){return function(e){var r=cC(e,t);return r===0?e:r===e.length?ie:e.slice(r)}}var Uh=function(t){return function(e){for(var r=0;r<e.length;r++)if(t(e[r]))return ct(r);return lt}};function jh(t){return function(e){for(var r=0;r<e.length;r++)if(t(e[r]))return ct(e[r]);return lt}}var sC=function(t){return function(e){for(var r=0;r<e.length;r++){var n=t(e[r]);if(Zt(n))return n}return lt}};function fC(t){return function(e){for(var r=e.length-1;r>=0;r--)if(t(e[r]))return ct(e[r]);return lt}}var lC=function(t){return function(e){for(var r=e.length-1;r>=0;r--){var n=t(e[r]);if(Zt(n))return n}return lt}},pC=function(t){return function(e){for(var r=e.length-1;r>=0;r--)if(t(e[r]))return ct(r);return lt}},n7=function(t,e){return function(r){return t<0||t>r.length?lt:ct(yh(t,e,r))}},o7=function(t,e){return dC(t,function(){return e})},i7=function(t){return function(e){return ts(t,e)?lt:ct(jC(t,e))}},dC=function(t,e){return function(r){return ts(t,r)?lt:ct(Qh(t,e(r[t]),r))}},a7=function(t){return t.length<=1?t:t.slice().reverse()},u7=function(t){for(var e=[],r=0;r<t.length;r++){var n=t[r];n._tag==="Right"&&e.push(n.right)}return e},c7=function(t){for(var e=[],r=0;r<t.length;r++){var n=t[r];n._tag==="Left"&&e.push(n.left)}return e},s7=function(t){return function(e){return e.length<=1?e:e.slice().sort(t.compare)}},hC=function(t,e,r){for(var n=[],o=Math.min(t.length,e.length),i=0;i<o;i++)n[i]=r(t[i],e[i]);return n};function vC(t,e){return e===void 0?function(r){return vC(r,t)}:hC(t,e,function(r,n){return[r,n]})}var f7=function(t){for(var e=[],r=[],n=0;n<t.length;n++)e[n]=t[n][0],r[n]=t[n][1];return[e,r]},mC=function(t){var e=$h(t);return function(r){return ce(r)?e(r):r}},l7=function(t){var e=rA(t);return function(r){return ce(r)?e(r):r}},p7=function(t){var e=Jb(t);return function(r){return ce(r)?e(r):r}};function Wl(t){return function(e,r){if(r===void 0){var n=Wl(t);return function(a){return n(e,a)}}for(var o=function(a){return t.equals(a,e)},i=0;i<r.length;i++)if(o(r[i]))return!0;return!1}}var d7=function(t){var e=Vb(t);return function(r){return ce(r)?e(r):r}},h7=function(t){var e=Hw(t);return function(r){return ce(r)?e(r):r}},v7=function(t){var e=Yb(t);return function(r){return ce(r)?e(r):ie}},L$=function(t){return function(e){return t>=1&&ce(e)?_h(t)(e):yo(e)?[e,ie]:[ie,e]}},m7=function(t){var e=oA(t);return function(r){return ce(r)?e(r):ie}},g7=function(t){return function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return QA(t.apply(void 0,e))}};function y7(t,e,r){r===void 0&&(r=function(){return!0});var n=function(o,i){return ce(i)?v(pr(i),Nl(function(a){return n(v(o,Lh(a)),Un(i))})):r.apply(void 0,o)?[e.apply(void 0,o)]:ie};return n(ie,t)}var gC=function(t){return function(e){return yo(e)?t:yo(t)?e:e.concat(t)}},b7=gC;function U$(t){var e=Hb(t);return function(r,n){if(n===void 0){var o=U$(t);return function(i){return o(i,r)}}return ce(r)&&ce(n)?e(n)(r):ce(r)?r:n}}function j$(t){var e=Wl(t);return function(r,n){if(n===void 0){var o=j$(t);return function(i){return o(i,r)}}return r.filter(function(i){return e(i,n)})}}function B$(t){var e=Wl(t);return function(r,n){if(n===void 0){var o=B$(t);return function(i){return o(i,r)}}return r.filter(function(i){return!e(i,n)})}}var ke=function(t,e){return v(t,Jh(e))},Bh=function(t,e){return v(t,RC(e))},Yi=function(t,e){return v(t,MC(e))},Fl=function(t,e){return v(t,Nl(e))},zh=function(t,e){return v(t,zn(e))},qh=function(t,e){return v(t,X$(e))},Kh=function(t,e){return v(t,EC(e))},Vh=function(t,e){return v(t,wC(e))},yC=function(t,e){return v(t,Z$(e))},bC=function(t,e){return v(t,Q$(e))},z$=function(t,e){return v(t,OC(e))},uu=function(t,e,r){return v(t,Yh(e,r))},es=function(t){var e=e_(t);return function(r,n){return v(r,e(n))}},rs=function(t,e,r){return v(t,r_(e,r))},q$=function(t,e,r){return v(t,Pl(e,r))},K$=function(t){var e=Gh(t);return function(r,n){return v(r,e(n))}},V$=function(t,e,r){return v(t,Xh(e,r))},$C=function(t,e){return v(t,Y$(e))},_C=function(t,e){return v(t,AC(e))},SC=function(t,e){return v(t,t_(e))},Hh=function(t){var e=CC(t);return function(r,n){return v(r,e(n))}},TC=function(t){var e=n_(t);return function(r,n){return v(r,e(n))}},H$=function(t,e){return v(t,s_(e))},J$=function(t,e){return v(t,f_(e))},cu=Hi,ns=function(){return ie},IC=function(t){return function(e){return e.concat(t())}},OC=IC,MC=function(t){return Nl(function(e){return v(t,Jh(e))})},Nl=function(t){return function(e){return v(e,aC(function(r,n){return t(n)}))}},G$=Nl(j),Jh=function(t){return function(e){return e.map(function(r){return t(r)})}},RC=function(t){return function(e){return e.map(function(r,n){return t(n,r)})}},is=function(t){for(var e=[],r=[],n=0,o=t;n<o.length;n++){var i=o[n];i._tag==="Left"?e.push(i.left):r.push(i.right)}return mt(e,r)},zn=function(t){return function(e){return e.filter(t)}},Y$=function(t){return function(e){for(var r=[],n=0;n<e.length;n++){var o=t(n,e[n]);Zt(o)&&r.push(o.value)}return r}},X$=function(t){return Y$(function(e,r){return t(r)})},as=X$(j),EC=function(t){return Z$(function(e,r){return t(r)})},Z$=function(t){return function(e){for(var r=[],n=[],o=0;o<e.length;o++){var i=e[o];t(o,i)?n.push(i):r.push(i)}return mt(r,n)}},wC=function(t){return Q$(function(e,r){return t(r)})},Q$=function(t){return function(e){for(var r=[],n=[],o=0;o<e.length;o++){var i=t(o,e[o]);i._tag==="Left"?r.push(i.left):n.push(i.right)}return mt(r,n)}},AC=function(t){return function(e){return e.filter(function(r,n){return t(n,r)})}},t_=function(t){return function(e){return e.map(function(r,n){return t(e.slice(n))})}},$7=t_(j),Gh=function(t){return function(e){return function(r){return r.reduce(function(n,o,i){return t.concat(n,e(i,o))},t.empty)}}},Yh=function(t,e){return Pl(t,function(r,n,o){return e(n,o)})},e_=function(t){var e=Gh(t);return function(r){return e(function(n,o){return r(o)})}},Pl=function(t,e){return function(r){for(var n=r.length,o=t,i=0;i<n;i++)o=e(i,o,r[i]);return o}},r_=function(t,e){return Xh(t,function(r,n,o){return e(n,o)})},Xh=function(t,e){return function(r){return r.reduceRight(function(n,o,i){return e(i,o,n)},t)}},CC=function(t){var e=n_(t);return function(r){return e(function(n,o){return r(o)})}},Dl=function(t){return function(e){return uu(e,t.of(ns()),function(r,n){return t.ap(t.map(r,function(o){return function(i){return v(o,Lh(i))}}),n)})}},n_=function(t){return function(e){return Pl(t.of(ns()),function(r,n,o){return t.ap(t.map(n,function(i){return function(a){return v(i,Lh(a))}}),e(r,o))})}},_7=function(t){var e=l_(t);return function(r){return function(n){return e(n,r)}}},S7=function(t){var e=p_(t);return function(r){return function(n){return e(n,r)}}},o_=function(t,e){for(var r=[],n=t;;){var o=e(n);if(Zt(o)){var i=o.value,a=i[0],u=i[1];r.push(a),n=u}else break}return r},qt="ReadonlyArray",xC=function(t){return{show:function(e){return"["+e.map(t.show).join(", ")+"]"}}},kC=function(){return{concat:function(t,e){return yo(t)?e:yo(e)?t:t.concat(e)}}},T7=function(){return{concat:kC().concat,empty:ie}},WC=function(t){return vn(function(e,r){return e.length===r.length&&e.every(function(n,o){return t.equals(n,r[o])})})},FC=function(t){return iu(function(e,r){for(var n=e.length,o=r.length,i=Math.min(n,o),a=0;a<i;a++){var u=t.compare(e[a],r[a]);if(u!==0)return u}return Dh.compare(n,o)})},NC=function(t){var e=U$(t);return{concat:function(r,n){return e(n)(r)}}},I7=function(t){return{concat:NC(t).concat,empty:ie}},O7=function(t){var e=j$(t);return{concat:function(r,n){return e(n)(r)}}},M7=function(t){var e=B$(t);return{concat:function(r,n){return e(n)(r)}}},i_={URI:qt,map:ke},R7=Et(i_),PC={URI:qt,of:cu},E7={URI:qt,map:ke,mapWithIndex:Bh},Zh={URI:qt,map:ke,ap:Yi},w7=le(Zh),A7=pe(Zh),C7={URI:qt,map:ke,ap:Yi,of:cu},a_={URI:qt,map:ke,ap:Yi,chain:Fl},x7={URI:qt,map:ke,ap:Yi,of:cu,chain:Fl},k7=Xt(a_),W7={URI:qt,unfold:o_},F7={URI:qt,map:ke,alt:z$},DC={URI:qt,zero:ns},N7=kl(DC,PC),P7={URI:qt,map:ke,ap:Yi,of:cu,alt:z$,zero:ns},D7={URI:qt,map:ke,extend:SC},u_={URI:qt,compact:as,separate:is},L7={URI:qt,map:ke,compact:as,separate:is,filter:zh,filterMap:qh,partition:Kh,partitionMap:Vh},U7={URI:qt,map:ke,mapWithIndex:Bh,compact:as,separate:is,filter:zh,filterMap:qh,partition:Kh,partitionMap:Vh,partitionMapWithIndex:bC,partitionWithIndex:yC,filterMapWithIndex:$C,filterWithIndex:_C},j7={URI:qt,reduce:uu,foldMap:es,reduceRight:rs},B7={URI:qt,reduce:uu,foldMap:es,reduceRight:rs,reduceWithIndex:q$,foldMapWithIndex:K$,reduceRightWithIndex:V$},c_={URI:qt,map:ke,reduce:uu,foldMap:es,reduceRight:rs,traverse:Hh,sequence:Dl},z7={URI:qt,map:ke,mapWithIndex:Bh,reduce:uu,foldMap:es,reduceRight:rs,reduceWithIndex:q$,foldMapWithIndex:K$,reduceRightWithIndex:V$,traverse:Hh,sequence:Dl,traverseWithIndex:TC},s_=function(t){return function(e){for(var r=NJ([],t(e)),n=[];r.length>0;){var o=r.shift();Me(o)?r.unshift.apply(r,t(o.left)):n.push(o.right)}return n}},q7={URI:qt,map:ke,ap:Yi,chain:Fl,chainRec:H$},f_=function(t){return function(e){var r=t(e),n=[],o=[];function i(s){Me(s)?t(s.left).forEach(function(f){return n.push(f)}):o.push(s.right)}for(var a=0,u=r;a<u.length;a++){var c=u[a];i(c)}for(;n.length>0;)i(n.shift());return o}},K7={URI:qt,map:ke,ap:Yi,chain:Fl,chainRec:J$},l_=Nn(c_,u_),p_=Fn(c_,u_),LC={URI:qt,map:ke,compact:as,separate:is,filter:zh,filterMap:qh,partition:Kh,partitionMap:Vh,reduce:uu,foldMap:es,reduceRight:rs,traverse:Hh,sequence:Dl,wither:l_,wilt:p_},V7=ob(LC),UC={URI:qt,fromEither:tC},H7=ho(UC),J7=yh,Qh=function(t,e,r){return ce(r)?Kb(t,e,r):r},jC=function(t,e){var r=e.slice();return r.splice(t,1),r},G7=function(t){return t.slice()},Y7=function(t){return yo(t)?ie:t.slice()},ie=bl,BC=function(t){return function(e){return e.every(t)}},zC=function(t){return function(e){return e.some(t)}},X7=zC,Z7=cu(xe),Q7=he(i_),t8=ve(a_),e8=de(Zh),r8=Jw,n8=bA,o8=$A,i8=mC,a8={URI:qt,compact:as,separate:is,map:ke,ap:Yi,of:cu,chain:Fl,filter:zh,filterMap:qh,partition:Kh,partitionMap:Vh,mapWithIndex:Bh,partitionMapWithIndex:bC,partitionWithIndex:yC,filterMapWithIndex:$C,filterWithIndex:_C,alt:z$,zero:ns,unfold:o_,reduce:uu,foldMap:es,reduceRight:rs,traverse:Hh,sequence:Dl,reduceWithIndex:q$,foldMapWithIndex:K$,reduceRightWithIndex:V$,traverseWithIndex:TC,extend:SC,wither:l_,wilt:p_},u8=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module",isEmpty:yo,isNonEmpty:ce,prepend:PJ,prependW:DJ,append:Lh,appendW:LJ,makeBy:ZA,replicate:UJ,fromPredicate:jJ,fromOption:QA,fromEither:tC,matchW:eC,match:BJ,matchLeftW:rC,matchLeft:nC,foldLeft:zJ,matchRightW:oC,matchRight:iC,foldRight:qJ,chainWithIndex:aC,scanLeft:KJ,scanRight:VJ,size:HJ,isOutOfBound:ts,lookup:au,head:uC,last:D$,tail:JJ,init:GJ,takeLeft:YJ,takeRight:XJ,takeLeftWhile:ZJ,spanLeft:QJ,dropLeft:t7,dropRight:e7,dropLeftWhile:r7,findIndex:Uh,findFirst:jh,findFirstMap:sC,findLast:fC,findLastMap:lC,findLastIndex:pC,insertAt:n7,updateAt:o7,deleteAt:i7,modifyAt:dC,reverse:a7,rights:u7,lefts:c7,sort:s7,zipWith:hC,zip:vC,unzip:f7,prependAll:mC,intersperse:l7,rotate:p7,elem:Wl,uniq:d7,sortBy:h7,chop:v7,splitAt:L$,chunksOf:m7,fromOptionK:g7,comprehension:y7,concatW:gC,concat:b7,union:U$,intersection:j$,difference:B$,_chainRecDepthFirst:H$,_chainRecBreadthFirst:J$,of:cu,zero:ns,altW:IC,alt:OC,ap:MC,chain:Nl,flatten:G$,map:Jh,mapWithIndex:RC,separate:is,filter:zn,filterMapWithIndex:Y$,filterMap:X$,compact:as,partition:EC,partitionWithIndex:Z$,partitionMap:wC,partitionMapWithIndex:Q$,filterWithIndex:AC,extend:t_,duplicate:$7,foldMapWithIndex:Gh,reduce:Yh,foldMap:e_,reduceWithIndex:Pl,reduceRight:r_,reduceRightWithIndex:Xh,traverse:CC,sequence:Dl,traverseWithIndex:n_,wither:_7,wilt:S7,unfold:o_,URI:qt,getShow:xC,getSemigroup:kC,getMonoid:T7,getEq:WC,getOrd:FC,getUnionSemigroup:NC,getUnionMonoid:I7,getIntersectionSemigroup:O7,getDifferenceMagma:M7,Functor:i_,flap:R7,Pointed:PC,FunctorWithIndex:E7,Apply:Zh,apFirst:w7,apSecond:A7,Applicative:C7,Chain:a_,Monad:x7,chainFirst:k7,Unfoldable:W7,Alt:F7,Zero:DC,guard:N7,Alternative:P7,Extend:D7,Compactable:u_,Filterable:L7,FilterableWithIndex:U7,Foldable:j7,FoldableWithIndex:B7,Traversable:c_,TraversableWithIndex:z7,chainRecDepthFirst:s_,ChainRecDepthFirst:q7,chainRecBreadthFirst:f_,ChainRecBreadthFirst:K7,Witherable:LC,filterE:V7,FromEither:UC,fromEitherK:H7,unsafeInsertAt:J7,unsafeUpdateAt:Qh,unsafeDeleteAt:jC,toArray:G7,fromArray:Y7,empty:ie,every:BC,some:zC,exists:X7,Do:Z7,bindTo:Q7,bind:t8,apS:e8,range:r8,cons:n8,snoc:o8,prependToAll:i8,readonlyArray:a8}),Xi=function(t){return t.length===0},ge=Go,c8=Yc,s8=d$,tv=Rl,f8=h$,qC=function(t,e){return t<=0?[]:Ah(e)(t)},l8=function(t,e){return qC(t,function(){return e})};function p8(t){return function(e){return t(e)?[e]:[]}}var KC=function(t){return me(t)?[]:[t.value]},VC=function(t){return Me(t)?[]:[t.right]},HC=function(t,e){return function(r){return ge(r)?e(r):t()}},d8=HC,JC=function(t,e){return function(r){return ge(r)?e(mn(r),Bn(r)):t()}},GC=JC,h8=GC,YC=function(t,e){return function(r){return ge(r)?e(Qc(r),Zc(r)):t()}},XC=YC,v8=XC,ZC=function(t){return function(e){for(var r=[],n=0;n<e.length;n++)r.push.apply(r,t(n,e[n]));return r}},m8=function(t,e){return function(r){var n=r.length,o=new Array(n+1);o[0]=t;for(var i=0;i<n;i++)o[i+1]=e(o[i],r[i]);return o}},g8=function(t,e){return function(r){var n=r.length,o=new Array(n+1);o[n]=t;for(var i=n-1;i>=0;i--)o[i]=e(r[i],o[i+1]);return o}},y8=function(t){return t.length},Ll=wh,b8=au,$8=uC,_8=D$,S8=function(t){return ge(t)?ct(Bn(t)):lt},T8=function(t){return ge(t)?ct(Qc(t)):lt},I8=function(t){return function(e){return Ll(t,e)?tr(e):e.slice(0,t)}},O8=function(t){return function(e){return Ll(t,e)?tr(e):t===0?[]:e.slice(-t)}};function M8(t){return function(e){for(var r=[],n=0,o=e;n<o.length;n++){var i=o[n];if(!t(i))break;r.push(i)}return r}}var QC=function(t,e){for(var r=t.length,n=0;n<r&&e(t[n]);n++);return n};function R8(t){return function(e){var r=ox(QC(e,t))(e),n=r[0],o=r[1];return{init:n,rest:o}}}var E8=function(t){return function(e){return t<=0||Xi(e)?tr(e):t>=e.length?[]:e.slice(t,e.length)}},w8=function(t){return function(e){return t<=0||Xi(e)?tr(e):t>=e.length?[]:e.slice(0,e.length-t)}};function A8(t){return function(e){return e.slice(QC(e,t))}}var C8=Uh;function x8(t){return jh(t)}var k8=sC;function W8(t){return fC(t)}var F8=lC,N8=pC,tr=function(t){return t.slice()},P8=function(t,e){return function(r){return t<0||t>r.length?lt:ct(xx(t,e,r))}},D8=function(t,e){return tx(t,function(){return e})},L8=function(t){return function(e){return Ll(t,e)?lt:ct(Wx(t,e))}},tx=function(t,e){return function(r){return Ll(t,r)?lt:ct(kx(t,e(r[t]),r))}},U8=function(t){return Xi(t)?[]:t.slice().reverse()},j8=function(t){for(var e=[],r=0;r<t.length;r++){var n=t[r];n._tag==="Right"&&e.push(n.right)}return e},B8=function(t){for(var e=[],r=0;r<t.length;r++){var n=t[r];n._tag==="Left"&&e.push(n.left)}return e},z8=function(t){return function(e){return e.length<=1?tr(e):e.slice().sort(t.compare)}},ex=function(t,e,r){for(var n=[],o=Math.min(t.length,e.length),i=0;i<o;i++)n[i]=r(t[i],e[i]);return n};function rx(t,e){return e===void 0?function(r){return rx(r,t)}:ex(t,e,function(r,n){return[r,n]})}var q8=function(t){for(var e=[],r=[],n=0;n<t.length;n++)e[n]=t[n][0],r[n]=t[n][1];return[e,r]},nx=function(t){var e=xh(t);return function(r){return ge(r)?e(r):[]}},K8=function(t){var e=AA(t);return function(r){return ge(r)?e(r):tr(r)}},V8=function(t){var e=b$(t);return function(r){return ge(r)?e(r):tr(r)}},d_=Wl,H8=function(t){var e=g$(t);return function(r){return ge(r)?e(r):tr(r)}},J8=function(t){var e=_A(t);return function(r){return ge(r)?e(r):tr(r)}},G8=function(t){var e=S$(t);return function(r){return ge(r)?e(r):[]}},ox=function(t){return function(e){return t>=1&&ge(e)?kh(t)(e):Xi(e)?[tr(e),[]]:[[],tr(e)]}},Y8=function(t){var e=WA(t);return function(r){return ge(r)?e(r):[]}},X8=function(t){return function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return KC(t.apply(void 0,e))}};function Z8(t,e,r){r===void 0&&(r=function(){return!0});var n=function(o,i){return ge(i)?v(mn(i),jl(function(a){return n(v(o,tv(a)),Bn(i))})):r.apply(void 0,o)?[e.apply(void 0,o)]:[]};return n([],t)}var ix=function(t){return function(e){return Xi(e)?tr(t):Xi(t)?tr(e):e.concat(t)}},Q8=ix;function h_(t){var e=y$(t);return function(r,n){if(n===void 0){var o=h_(t);return function(i){return o(i,r)}}return ge(r)&&ge(n)?e(n)(r):ge(r)?tr(r):tr(n)}}function v_(t){var e=d_(t);return function(r,n){if(n===void 0){var o=v_(t);return function(i){return o(i,r)}}return r.filter(function(i){return e(i,n)})}}function m_(t){var e=d_(t);return function(r,n){if(n===void 0){var o=m_(t);return function(i){return o(i,r)}}return r.filter(function(i){return!e(i,n)})}}var We=function(t,e){return v(t,__(e))},ev=function(t,e){return v(t,dx(e))},Zi=function(t,e){return v(t,px(e))},Ul=function(t,e){return v(t,jl(e))},rv=function(t,e){return v(t,hx(e))},nv=function(t,e){return v(t,I_(e))},ov=function(t,e){return v(t,vx(e))},iv=function(t,e){return v(t,mx(e))},ax=function(t,e){return v(t,O_(e))},ux=function(t,e){return v(t,M_(e))},g_=function(t,e){return v(t,yx(e))},su=function(t,e,r){return v(t,Sx(e,r))},us=function(t){var e=$x(t);return function(r,n){return v(r,e(n))}},cs=function(t,e,r){return v(t,Tx(e,r))},y_=function(t,e,r){return v(t,E_(e,r))},b_=function(t){var e=_x(t);return function(r,n){return v(r,e(n))}},$_=function(t,e,r){return v(t,Ix(e,r))},cx=function(t,e){return v(t,T_(e))},sx=function(t,e){return v(t,bx(e))},fx=function(t,e){return v(t,R_(e))},av=function(t){var e=uv(t);return function(r,n){return v(r,e(n))}},lx=function(t){var e=w_(t);return function(r,n){return v(r,e(n))}},tG=H$,eG=J$,Qi=Gi,ss=function(){return[]},__=function(t){return function(e){return e.map(function(r){return t(r)})}},px=function(t){return jl(function(e){return v(t,__(e))})},jl=function(t){return function(e){return v(e,ZC(function(r,n){return t(n)}))}},S_=jl(j),dx=function(t){return function(e){return e.map(function(r,n){return t(n,r)})}},T_=function(t){return function(e){for(var r=[],n=0;n<e.length;n++){var o=t(n,e[n]);Zt(o)&&r.push(o.value)}return r}},I_=function(t){return T_(function(e,r){return t(r)})},fs=I_(j),ls=function(t){for(var e=[],r=[],n=0,o=t;n<o.length;n++){var i=o[n];i._tag==="Left"?e.push(i.left):r.push(i.right)}return mt(e,r)},hx=function(t){return function(e){return e.filter(t)}},vx=function(t){return O_(function(e,r){return t(r)})},O_=function(t){return function(e){for(var r=[],n=[],o=0;o<e.length;o++){var i=e[o];t(o,i)?n.push(i):r.push(i)}return mt(r,n)}},mx=function(t){return M_(function(e,r){return t(r)})},M_=function(t){return function(e){for(var r=[],n=[],o=0;o<e.length;o++){var i=t(o,e[o]);i._tag==="Left"?r.push(i.left):n.push(i.right)}return mt(r,n)}},gx=function(t){return function(e){return e.concat(t())}},yx=gx,bx=function(t){return function(e){return e.filter(function(r,n){return t(n,r)})}},R_=function(t){return function(e){return e.map(function(r,n){return t(e.slice(n))})}},rG=R_(j),$x=e_,_x=Gh,Sx=Yh,E_=Pl,Tx=r_,Ix=Xh,uv=function(t){var e=w_(t);return function(r){return e(function(n,o){return r(o)})}},Bl=function(t){return function(e){return su(e,t.of(ss()),function(r,n){return t.ap(t.map(r,function(o){return function(i){return v(o,tv(i))}}),n)})}},w_=function(t){return function(e){return E_(t.of(ss()),function(r,n,o){return t.ap(t.map(n,function(i){return function(a){return v(i,tv(a))}}),e(r,o))})}},nG=function(t){var e=N_(t);return function(r){return function(n){return e(n,r)}}},oG=function(t){var e=P_(t);return function(r){return function(n){return e(n,r)}}},A_=function(t,e){for(var r=[],n=t;;){var o=e(n);if(Zt(o)){var i=o.value,a=i[0],u=i[1];r.push(a),n=u}else break}return r},Kt="Array",iG=xC,Ox=function(){return{concat:function(t,e){return t.concat(e)}}},C_=function(){return{concat:Ox().concat,empty:[]}},Mx=WC,aG=FC,Rx=function(t){var e=h_(t);return{concat:function(r,n){return e(n)(r)}}},uG=function(t){return{concat:Rx(t).concat,empty:[]}},cG=function(t){var e=v_(t);return{concat:function(r,n){return e(n)(r)}}},sG=function(t){var e=m_(t);return{concat:function(r,n){return e(n)(r)}}},x_={URI:Kt,map:We},fG=Et(x_),Ex={URI:Kt,of:Qi},lG={URI:Kt,map:We,mapWithIndex:ev},cv={URI:Kt,map:We,ap:Zi},pG=le(cv),dG=pe(cv),hG={URI:Kt,map:We,ap:Zi,of:Qi},k_={URI:Kt,map:We,ap:Zi,chain:Ul},vG=Xt(k_),mG={URI:Kt,map:We,ap:Zi,of:Qi,chain:Ul},gG={URI:Kt,unfold:A_},yG={URI:Kt,map:We,alt:g_},wx={URI:Kt,zero:ss},bG=kl(wx,Ex),$G={URI:Kt,map:We,ap:Zi,of:Qi,alt:g_,zero:ss},_G={URI:Kt,map:We,extend:fx},W_={URI:Kt,compact:fs,separate:ls},SG={URI:Kt,map:We,compact:fs,separate:ls,filter:rv,filterMap:nv,partition:ov,partitionMap:iv},TG={URI:Kt,map:We,mapWithIndex:ev,compact:fs,separate:ls,filter:rv,filterMap:nv,partition:ov,partitionMap:iv,partitionMapWithIndex:ux,partitionWithIndex:ax,filterMapWithIndex:cx,filterWithIndex:sx},IG={URI:Kt,reduce:su,foldMap:us,reduceRight:cs},OG={URI:Kt,reduce:su,foldMap:us,reduceRight:cs,reduceWithIndex:y_,foldMapWithIndex:b_,reduceRightWithIndex:$_},F_={URI:Kt,map:We,reduce:su,foldMap:us,reduceRight:cs,traverse:av,sequence:Bl},MG={URI:Kt,map:We,mapWithIndex:ev,reduce:su,foldMap:us,reduceRight:cs,reduceWithIndex:y_,foldMapWithIndex:b_,reduceRightWithIndex:$_,traverse:av,sequence:Bl,traverseWithIndex:lx},N_=Nn(F_,W_),P_=Fn(F_,W_),Ax={URI:Kt,map:We,compact:fs,separate:ls,filter:rv,filterMap:nv,partition:ov,partitionMap:iv,reduce:su,foldMap:us,reduceRight:cs,traverse:av,sequence:Bl,wither:N_,wilt:P_},RG=s_,EG={URI:Kt,map:We,ap:Zi,chain:Ul,chainRec:tG},wG=f_,AG={URI:Kt,map:We,ap:Zi,chain:Ul,chainRec:eG},CG=ob(Ax),Cx={URI:Kt,fromEither:VC},xG=ho(Cx),xx=v$,kx=function(t,e,r){return ge(r)?m$(t,e,r):[]},Wx=function(t,e){var r=e.slice();return r.splice(t,1),r},kG=BC,Fx=function(t){return function(e){return e.some(t)}},WG=Fx,FG=Qi(xe),NG=he(x_),PG=ve(k_),DG=de(cv),LG=SA,UG=[],jG=GA,BG=YA,zG=nx,qG={URI:Kt,compact:fs,separate:ls,map:We,ap:Zi,of:Qi,chain:Ul,filter:rv,filterMap:nv,partition:ov,partitionMap:iv,mapWithIndex:ev,partitionMapWithIndex:ux,partitionWithIndex:ax,filterMapWithIndex:cx,filterWithIndex:sx,alt:g_,zero:ss,unfold:A_,reduce:su,foldMap:us,reduceRight:cs,traverse:av,sequence:Bl,reduceWithIndex:y_,foldMapWithIndex:b_,reduceRightWithIndex:$_,traverseWithIndex:lx,extend:fx,wither:N_,wilt:P_},Nx=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module",isEmpty:Xi,isNonEmpty:ge,prepend:c8,prependW:s8,append:tv,appendW:f8,makeBy:qC,replicate:l8,fromPredicate:p8,fromOption:KC,fromEither:VC,matchW:HC,match:d8,matchLeftW:JC,matchLeft:GC,foldLeft:h8,matchRightW:YC,matchRight:XC,foldRight:v8,chainWithIndex:ZC,scanLeft:m8,scanRight:g8,size:y8,isOutOfBound:Ll,lookup:b8,head:$8,last:_8,tail:S8,init:T8,takeLeft:I8,takeRight:O8,takeLeftWhile:M8,spanLeft:R8,dropLeft:E8,dropRight:w8,dropLeftWhile:A8,findIndex:C8,findFirst:x8,findFirstMap:k8,findLast:W8,findLastMap:F8,findLastIndex:N8,copy:tr,insertAt:P8,updateAt:D8,deleteAt:L8,modifyAt:tx,reverse:U8,rights:j8,lefts:B8,sort:z8,zipWith:ex,zip:rx,unzip:q8,prependAll:nx,intersperse:K8,rotate:V8,elem:d_,uniq:H8,sortBy:J8,chop:G8,splitAt:ox,chunksOf:Y8,fromOptionK:X8,comprehension:Z8,concatW:ix,concat:Q8,union:h_,intersection:v_,difference:m_,of:Qi,zero:ss,map:__,ap:px,chain:jl,flatten:S_,mapWithIndex:dx,filterMapWithIndex:T_,filterMap:I_,compact:fs,separate:ls,filter:hx,partition:vx,partitionWithIndex:O_,partitionMap:mx,partitionMapWithIndex:M_,altW:gx,alt:yx,filterWithIndex:bx,extend:R_,duplicate:rG,foldMap:$x,foldMapWithIndex:_x,reduce:Sx,reduceWithIndex:E_,reduceRight:Tx,reduceRightWithIndex:Ix,traverse:uv,sequence:Bl,traverseWithIndex:w_,wither:nG,wilt:oG,unfold:A_,URI:Kt,getShow:iG,getSemigroup:Ox,getMonoid:C_,getEq:Mx,getOrd:aG,getUnionSemigroup:Rx,getUnionMonoid:uG,getIntersectionSemigroup:cG,getDifferenceMagma:sG,Functor:x_,flap:fG,Pointed:Ex,FunctorWithIndex:lG,Apply:cv,apFirst:pG,apSecond:dG,Applicative:hG,Chain:k_,chainFirst:vG,Monad:mG,Unfoldable:gG,Alt:yG,Zero:wx,guard:bG,Alternative:$G,Extend:_G,Compactable:W_,Filterable:SG,FilterableWithIndex:TG,Foldable:IG,FoldableWithIndex:OG,Traversable:F_,TraversableWithIndex:MG,Witherable:Ax,chainRecDepthFirst:RG,ChainRecDepthFirst:EG,chainRecBreadthFirst:wG,ChainRecBreadthFirst:AG,filterE:CG,FromEither:Cx,fromEitherK:xG,unsafeInsertAt:xx,unsafeUpdateAt:kx,unsafeDeleteAt:Wx,every:kG,some:Fx,exists:WG,Do:FG,bindTo:NG,bind:PG,apS:DG,range:LG,empty:UG,cons:jG,snoc:BG,prependToAll:zG,array:qG}),KG=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module"}),VG=function(t){return typeof t=="boolean"},Px=function(t,e){return function(r){return r?e():t()}},Dx=Px,Lx=Dx,HG=Lx,Ux={equals:function(t,e){return t===e}},JG={meet:function(t,e){return t&&e},join:function(t,e){return t||e},zero:!1,one:!0,implies:function(t,e){return!t||e},not:function(t){return!t}},jx={concat:function(t,e){return t&&e}},Bx={concat:function(t,e){return t||e}},GG={concat:jx.concat,empty:!0},YG={concat:Bx.concat,empty:!1},XG={equals:Ux.equals,compare:function(t,e){return t<e?-1:t>e?1:0}},ZG={show:function(t){return JSON.stringify(t)}},QG=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module",isBoolean:VG,matchW:Px,foldW:Dx,match:Lx,fold:HG,Eq:Ux,BooleanAlgebra:JG,SemigroupAll:jx,SemigroupAny:Bx,MonoidAll:GG,MonoidAny:YG,Ord:XG,Show:ZG}),zx=function(t){return{meet:function(e,r){return t.join(e,r)},join:function(e,r){return t.meet(e,r)},zero:t.one,one:t.zero,implies:function(e,r){return t.join(t.not(e),r)},not:t.not}},t9={meet:function(){},join:function(){},zero:void 0,one:void 0,implies:function(){},not:function(){}},e9=zx,r9={meet:function(t,e){return t&&e},join:function(t,e){return t||e},zero:!1,one:!0,implies:function(t,e){return!t||e},not:function(t){return!t}},n9=YR,o9=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module",reverse:zx,booleanAlgebraVoid:t9,getDualBooleanAlgebra:e9,booleanAlgebraBoolean:r9,getFunctionBooleanAlgebra:n9}),i9={equals:dh.equals,compare:dh.compare,top:1/0,bottom:-1/0},a9=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module",boundedNumber:i9});function qx(t){return{meet:lh(t),join:ph(t)}}var u9=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module",getMinMaxDistributiveLattice:qx});function c9(t){var e=qx(t);return function(r,n){return{join:e.join,meet:e.meet,zero:r,one:n}}}var s9=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module",getMinMaxBoundedDistributiveLattice:c9}),f9=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module"}),l9=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module"}),p9=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module"}),d9=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module"});function D_(t,e){return function(r,n){return e.compose(t.right(n),t.left(r))}}function Kx(t,e){var r=D_(t,e);return function(n,o){return e.compose(t.promap(e.id(),function(i){return i._tag==="Left"?i.left:i.right},j),r(n,o))}}function h9(t){return D_(t,t)}function v9(t){return Kx(t,t)}var m9=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module",split:D_,fanIn:Kx,splitChoice:h9,fanin:v9}),g9=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module"}),y9=function(t,e){return v(t,Vx(e))},Vx=function(t){return function(e){return H(t,e)}},Hx="Predicate",Jx=function(){return{concat:function(t,e){return v(t,Yx(e))}}},b9=function(){return{concat:Jx().concat,empty:QR}},Gx=function(){return{concat:function(t,e){return v(t,Xx(e))}}},$9=function(){return{concat:Gx().concat,empty:Yy}},_9={URI:Hx,contramap:y9},zl=function(t){return function(e){return!t(e)}},Yx=function(t){return function(e){return function(r){return e(r)||t(r)}}},Xx=function(t){return function(e){return function(r){return e(r)&&t(r)}}},S9=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module",contramap:Vx,URI:Hx,getSemigroupAny:Jx,getMonoidAny:b9,getSemigroupAll:Gx,getMonoidAll:$9,Contravariant:_9,not:zl,or:Yx,and:Xx}),Dt=lt,Jt=ct;function sv(t){return function(e){return t(e)?Jt(e):Dt}}var fv=function(t){return t._tag==="Right"?Dt:Jt(t.left)},ql=function(t){return t._tag==="Left"?Dt:Jt(t.right)},Vr=function(t,e){return v(t,bo(e))},fu=function(t,e){return v(t,ek(e))},lv=function(t,e){return v(t,Hl(e))},pv=function(t,e,r){return v(t,nk(e,r))},dv=function(t){var e=ok(t);return function(r,n){return v(r,e(n))}},hv=function(t,e,r){return v(t,ik(e,r))},L_=function(t){var e=dk(t);return function(r,n){return v(r,e(n))}},U_=function(t,e){return v(t,uk(e))},Kl=function(t,e){return v(t,sk(e))},j_=function(t,e){return v(t,fk(e))},Zx=function(t,e){return v(t,K_(e))},B_=function(t,e){return v(t,lk(e))},z_=function(t,e){return v(t,pk(e))},Se="Option",T9=function(t){return{show:function(e){return It(e)?"none":"some("+t.show(e.value)+")"}}},Qx=function(t){return{equals:function(e,r){return e===r||(It(e)?It(r):It(r)?!1:t.equals(e.value,r.value))}}},I9=function(t){return{equals:Qx(t).equals,compare:function(e,r){return e===r?0:yv(e)?yv(r)?t.compare(e.value,r.value):1:-1}}},q_=function(t){return{concat:function(e,r){return It(e)?r:It(r)?e:Jt(t.concat(e.value,r.value))},empty:Dt}},bo=function(t){return function(e){return It(e)?Dt:Jt(t(e.value))}},Vl={URI:Se,map:Vr},Yo=Jt,tk={URI:Se,of:Yo},ek=function(t){return function(e){return It(e)||It(t)?Dt:Jt(e.value(t.value))}},ps={URI:Se,map:Vr,ap:fu},rk={URI:Se,map:Vr,ap:fu,of:Yo},Hl=function(t){return function(e){return It(e)?Dt:t(e.value)}},vv={URI:Se,map:Vr,ap:fu,chain:lv},O9={URI:Se,map:Vr,ap:fu,of:Yo,chain:lv},nk=function(t,e){return function(r){return It(r)?t:e(t,r.value)}},ok=function(t){return function(e){return function(r){return It(r)?t.empty:e(r.value)}}},ik=function(t,e){return function(r){return It(r)?t:e(r.value,t)}},M9={URI:Se,reduce:pv,foldMap:dv,reduceRight:hv},ak=function(t){return function(e){return It(e)?t():e}},uk=ak,R9={URI:Se,map:Vr,alt:U_},mv=function(){return Dt},ck={URI:Se,zero:mv},E9=kl(ck,tk),w9={URI:Se,map:Vr,ap:fu,of:Yo,alt:U_,zero:mv},K_=function(t){return function(e){return It(e)?Dt:Jt(t(e))}},A9={URI:Se,map:Vr,extend:Zx},ds=Hl(j),C9=mt(Dt,Dt),hs=function(t){return It(t)?C9:mt(fv(t.value),ql(t.value))},Jl={URI:Se,compact:ds,separate:hs},sk=function(t){return function(e){return It(e)?Dt:t(e.value)?e:Dt}},fk=function(t){return function(e){return It(e)?Dt:t(e.value)}},lk=function(t){return function(e){return mt(Kl(e,zl(t)),Kl(e,t))}},pk=function(t){return H(bo(t),hs)},Gl={URI:Se,map:Vr,compact:ds,separate:hs,filter:Kl,filterMap:j_,partition:B_,partitionMap:z_},dk=function(t){return function(e){return function(r){return It(r)?t.of(Dt):t.map(e(r.value),Jt)}}},gv=function(t){return function(e){return It(e)?t.of(Dt):t.map(e.value,Jt)}},V_={URI:Se,map:Vr,reduce:pv,foldMap:dv,reduceRight:hv,traverse:L_,sequence:gv},H_=Nn(V_,Jl),J_=Fn(V_,Jl),x9=function(t){var e=H_(t);return function(r){return function(n){return e(n,r)}}},k9=function(t){var e=J_(t);return function(r){return function(n){return e(n,r)}}},W9={URI:Se,map:Vr,reduce:pv,foldMap:dv,reduceRight:hv,traverse:L_,sequence:gv,compact:ds,separate:hs,filter:Kl,filterMap:j_,partition:B_,partitionMap:z_,wither:H_,wilt:J_},G_=function(){return Dt},F9={URI:Se,map:Vr,ap:fu,of:Yo,chain:lv,throwError:G_},Yl=ql,Y_={URI:Se,fromEither:Yl},yv=Zt,It=function(t){return t._tag==="None"},X_=function(t,e){return function(r){return It(r)?t():e(r.value)}},N9=X_,Xo=X_,Zo=Xo,Z_=function(t){return function(e){return It(e)?t():e.value}},Q_=Z_,P9=Et(Vl),D9=le(ps),L9=pe(ps),U9=ds,j9=Xt(vv),B9=K_(j),z9=ho(Y_),q9=Za(Y_,vv),lu=function(t){return t==null?Dt:Jt(t)},hk=function(t){try{return Jt(t())}catch{return Dt}},K9=function(t){return function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return hk(function(){return t.apply(void 0,e)})}},V9=function(t){return H(t,lu)},vk=function(t){return function(e){return It(e)?Dt:lu(t(e.value))}},mk=Xo(tE,j),H9=Xo(Xy,j);function gk(t){return function(e,r){if(r===void 0){var n=gk(t);return function(o){return n(e,o)}}return It(r)?!1:t.equals(e,r.value)}}var J9=function(t){return function(e){return It(e)?!1:t(e.value)}},G9=Yo(xe),Y9=he(Vl),X9=ve(vv),Z9=de(ps),yk=Yo(Ze),tS=function(t){return function(e){var r=t(0,qr(e));if(It(r))return Dt;for(var n=[r.value],o=1;o<e.length;o++){var i=t(o,e[o]);if(It(i))return Dt;n.push(i.value)}return Jt(n)}},eS=function(t){var e=tS(t);return function(r){return Qt(r)?e(r):yk}},Q9=eS,bk=function(t){return eS(function(e,r){return t(r)})},tY=bk(j);function eY(t){return function(e){return yv(t(e))}}var rY=vk,$k={URI:Se,map:Vr,of:Yo,ap:fu,chain:lv,reduce:pv,foldMap:dv,reduceRight:hv,traverse:L_,sequence:gv,zero:mv,alt:U_,extend:Zx,compact:ds,separate:hs,filter:Kl,filterMap:j_,partition:B_,partitionMap:z_,wither:H_,wilt:J_,throwError:G_},nY=Oe(ps),oY=dn(rk),_k=function(){return q_(Ub())},iY=function(){return q_(jb())},Sk=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module",none:Dt,some:Jt,fromPredicate:sv,getLeft:fv,getRight:ql,URI:Se,getShow:T9,getEq:Qx,getOrd:I9,getMonoid:q_,map:bo,Functor:Vl,of:Yo,Pointed:tk,ap:ek,Apply:ps,Applicative:rk,chain:Hl,Chain:vv,Monad:O9,reduce:nk,foldMap:ok,reduceRight:ik,Foldable:M9,altW:ak,alt:uk,Alt:R9,zero:mv,Zero:ck,guard:E9,Alternative:w9,extend:K_,Extend:A9,compact:ds,separate:hs,Compactable:Jl,filter:sk,filterMap:fk,partition:lk,partitionMap:pk,Filterable:Gl,traverse:dk,sequence:gv,Traversable:V_,wither:x9,wilt:k9,Witherable:W9,throwError:G_,MonadThrow:F9,fromEither:Yl,FromEither:Y_,isSome:yv,isNone:It,matchW:X_,foldW:N9,match:Xo,fold:Zo,getOrElseW:Z_,getOrElse:Q_,flap:P9,apFirst:D9,apSecond:L9,flatten:U9,chainFirst:j9,duplicate:B9,fromEitherK:z9,chainEitherK:q9,fromNullable:lu,tryCatch:hk,tryCatchK:K9,fromNullableK:V9,chainNullableK:vk,toNullable:mk,toUndefined:H9,elem:gk,exists:J9,Do:G9,bindTo:Y9,bind:X9,apS:Z9,ApT:yk,traverseReadonlyNonEmptyArrayWithIndex:tS,traverseReadonlyArrayWithIndex:eS,traverseArrayWithIndex:Q9,traverseArray:bk,sequenceArray:tY,getRefinement:eY,mapNullable:rY,option:$k,getApplySemigroup:nY,getApplyMonoid:oY,getFirstMonoid:_k,getLastMonoid:iY});function Qo(t,e){return function(r){return t.map(r,e.compact)}}function ta(t,e,r){var n=Qo(t,e),o=Nc(t,r);return function(i){return mt(n(v(i,o(fv))),n(v(i,o(ql))))}}function aY(t,e){var r=Pc(t,e).map;return{map:r,compact:Qo(t,e),separate:ta(t,e,e)}}var uY=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module",compact:Qo,separate:ta,getCompactableComposition:aY}),cY=function(t){return function(){return console.log(t)}},sY=function(t){return function(){return console.warn(t)}},fY=function(t){return function(){return console.error(t)}},lY=function(t){return function(){return console.info(t)}},pY=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module",log:cY,warn:sY,error:fY,info:lY}),vs=Fc;function dY(t){return{show:function(e){return"make("+t.show(e)+")"}}}var hY=j,vY=j,mY=j,gY=j,yY=j,bY=j,$Y=j,_Y=j,SY=j;function Tk(t){return{URI:pu,_E:void 0,map:rS,ap:function(e,r){return vs(t.concat(e,r))}}}function Ik(t){var e=Tk(t);return{URI:pu,_E:void 0,map:e.map,ap:e.ap,of:function(){return vs(t.empty)}}}var Ok=function(t,e){return v(t,Ek())},rS=function(t,e){return v(t,wk(e))},Mk=function(t,e,r){return v(t,Ak(e))},Rk=function(t,e){return v(t,Ck(e))},Ek=function(){return Fc},wk=function(){return Fc},Ak=function(t){return function(e){return vs(t(e))}},Ck=function(t){return function(e){return vs(t(e))}},pu="Const",xk={URI:pu,map:rS},TY=Et(xk),IY={URI:pu,contramap:Ok},OY={URI:pu,bimap:Mk,mapLeft:Rk},MY={URI:pu,map:rS,contramap:Ok,bimap:Mk,mapLeft:Rk},RY=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module",make:vs,getShow:dY,getEq:hY,getOrd:vY,getBounded:mY,getSemigroup:gY,getMonoid:yY,getSemiring:bY,getRing:$Y,getHeytingAlgebra:_Y,getBooleanAlgebra:SY,getApply:Tk,getApplicative:Ik,contramap:Ek,map:wk,bimap:Ak,mapLeft:Ck,URI:pu,Functor:xk,flap:TY,Contravariant:IY,Bifunctor:OY,const_:MY}),EY=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module"}),wY={equals:function(t,e){return t.valueOf()===e.valueOf()}},AY={equals:function(t,e){return t.getDate()===e.getDate()}},CY={equals:function(t,e){return t.getMonth()===e.getMonth()}},xY={equals:function(t,e){return t.getFullYear()===e.getFullYear()}},kY=v(Dh,fh(function(t){return t.valueOf()})),WY=function(){return new Date},FY=function(){return new Date().getTime()},NY=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module",Eq:wY,eqDate:AY,eqMonth:CY,eqYear:xY,Ord:kY,create:WY,now:FY});function du(t){return H(Ct,t.of)}function ms(t){return H(ne,t.of)}function gs(t){return function(e){return t.map(e,Ct)}}function ys(t){return function(e){return t.map(e,ne)}}function bs(t){return Nc(t,qi)}function $s(t){return Vo(t,jc)}function _s(t){return function(e){return function(r){return t.chain(r,function(n){return et(n)?t.of(n):e(n.right)})}}}function Ss(t){return function(e){return function(r){return t.chain(r,function(n){return et(n)?e():t.of(n)})}}}function Ts(t){return function(e,r){return function(n){return t.map(n,lb(e,r))}}}function Is(t){return function(e){return function(r){return t.map(r,pl(e))}}}function Xl(t,e){return function(r){return function(n){return t.chain(n,Ki(function(o){return t.map(r(),pl(function(i){return e.concat(o,i)}))},du(t)))}}}function Zl(t){return function(e,r){return function(n){return t.map(n,Ki(e,r))}}}function Os(t){return function(e,r){return function(n){return t.chain(n,Ki(e,r))}}}function Ms(t){return function(e){return function(r){return t.chain(r,Ki(e,t.of))}}}function hu(t){return function(e){return function(r){return t.chain(r,function(n){return et(n)?e(n.left):t.of(n)})}}}function Ql(t){var e=hu(t);return function(r){return e(function(n){return t.map(r(n),function(o){return et(o)?o:ne(n)})})}}function tp(t){return function(e){return function(r){return t.chain(r,Ki(function(n){return t.map(e(n),ne)},function(n){return t.of(Ct(n))}))}}}function Rs(t){return function(e){return t.map(e,IE)}}function ep(t){return function(e){return t.map(e,wE)}}function PY(t){var e=$s(t),r=bs(t),n=_s(t),o=Ss(t),i=Ts(t),a=Is(t),u=Os(t),c=Ms(t),s=hu(t);return{map:function(f,l){return v(f,r(l))},ap:function(f,l){return v(f,e(l))},of:du(t),chain:function(f,l){return v(f,n(l))},alt:function(f,l){return v(f,o(l))},bimap:function(f,l,p){return v(f,i(l,p))},mapLeft:function(f,l){return v(f,a(l))},fold:function(f,l,p){return v(f,u(l,p))},getOrElse:function(f,l){return v(f,c(l))},orElse:function(f,l){return v(f,s(l))},swap:Rs(t),rightM:gs(t),leftM:ys(t),left:ms(t)}}var DY=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module",right:du,left:ms,rightF:gs,leftF:ys,map:bs,ap:$s,chain:_s,alt:Ss,bimap:Ts,mapLeft:Is,altValidation:Xl,match:Zl,matchE:Os,getOrElse:Ms,orElse:hu,orElseFirst:Ql,orLeft:tp,swap:Rs,toUnion:ep,getEitherM:PY}),LY="Endomorphism",kk=function(){return{concat:function(t,e){return H(t,e)}}},Wk=function(){return{concat:kk().concat,empty:j}},UY=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module",URI:LY,getSemigroup:kk,getMonoid:Wk}),jY=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module"});function Fk(t,e){var r=e.zero,n=function(o,i){return t.equals(i,r)?o:n(i,e.mod(o,i))};return n}function BY(t,e){var r=e.zero,n=Fk(t,e);return function(o,i){return t.equals(o,r)||t.equals(i,r)?r:e.div(e.mul(o,i),n(o,i))}}var zY={add:function(t,e){return t+e},zero:0,mul:function(t,e){return t*e},one:1,sub:function(t,e){return t-e},degree:function(t){return 1},div:function(t,e){return t/e},mod:function(t,e){return t%e}},qY=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module",gcd:Fk,lcm:BY,fieldNumber:zY});function ea(t,e){return function(r){return function(n){return t.map(n,function(o){return e.filter(o,r)})}}}function ra(t,e){return function(r){return function(n){return t.map(n,function(o){return e.filterMap(o,r)})}}}function vu(t,e){var r=ea(t,e);return function(n){var o=r(zl(n)),i=r(n);return function(a){return mt(o(a),i(a))}}}function mu(t,e){var r=ra(t,e);return function(n){return function(o){return mt(v(o,r(function(i){return fv(n(i))})),v(o,r(function(i){return ql(n(i))})))}}}function KY(t,e){var r=Pc(t,e).map,n=Qo(t,e),o=ta(t,e,e),i=ea(t,e),a=ra(t,e),u=vu(t,e),c=mu(t,e);return{map:r,compact:n,separate:o,filter:function(s,f){return v(s,i(f))},filterMap:function(s,f){return v(s,a(f))},partition:function(s,f){return v(s,u(f))},partitionMap:function(s,f){return v(s,c(f))}}}var VY=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module",filter:ea,filterMap:ra,partition:vu,partitionMap:mu,getFilterableComposition:KY}),HY=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module"});function Nk(t,e){return function(r,n){return function(o){return t.reduce(o,r,function(i,a){return e.reduce(a,i,n)})}}}function Pk(t,e){return function(r){var n=t.foldMap(r),o=e.foldMap(r);return function(i){return function(a){return n(a,function(u){return o(u,i)})}}}}function Dk(t,e){return function(r,n){return function(o){return t.reduceRight(o,r,function(i,a){return e.reduceRight(i,a,n)})}}}function JY(t,e){return function(r,n){return function(o){return e.reduce(o,t.of(r),function(i,a){return t.chain(i,function(u){return n(u,a)})})}}}function GY(t,e){return function(r,n){var o=function(i,a){var u=i.init,c=i.acc;return u?{init:!1,acc:a}:{init:!1,acc:t.concat(t.concat(c,r),a)}};return e.reduce(n,{init:!0,acc:t.empty},o).acc}}function Lk(t){return function(e){return t.reduce(e,[],function(r,n){return r.push(n),r})}}function YY(t,e){var r=function(o,i){return t.ap(t.map(o,Or),i)},n=t.of(void 0);return function(o,i){return e.reduce(o,n,function(a,u){return r(a,i(u))})}}function XY(t,e){return function(r,n,o){return e.reduce(r,t.of(n),function(i,a){return t.chain(i,function(u){return o(u,a)})})}}var ZY=Lk;function nS(t,e){var r=Nk(t,e),n=Pk(t,e),o=Dk(t,e);return{reduce:function(i,a,u){return v(i,r(a,u))},foldMap:function(i){var a=n(i);return function(u,c){return v(u,a(c))}},reduceRight:function(i,a,u){return v(i,o(a,u))}}}var QY=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module",reduce:Nk,foldMap:Pk,reduceRight:Dk,reduceM:JY,intercalate:GY,toReadonlyArray:Lk,traverse_:YY,foldM:XY,toArray:ZY,getFoldableComposition:nS});function Uk(t,e){return function(r,n){return function(o){return t.reduceWithIndex(o,r,function(i,a,u){return e.reduceWithIndex(u,a,function(c,s,f){return n([i,c],s,f)})})}}}function jk(t,e){return function(r){var n=t.foldMapWithIndex(r),o=e.foldMapWithIndex(r);return function(i){return function(a){return n(a,function(u,c){return o(c,function(s,f){return i([u,s],f)})})}}}}function Bk(t,e){return function(r,n){return function(o){return t.reduceRightWithIndex(o,r,function(i,a,u){return e.reduceRightWithIndex(a,u,function(c,s,f){return n([i,c],s,f)})})}}}function tX(t,e){var r=nS(t,e),n=Uk(t,e),o=jk(t,e),i=Bk(t,e);return{reduce:r.reduce,foldMap:r.foldMap,reduceRight:r.reduceRight,reduceWithIndex:function(a,u,c){return v(a,n(u,c))},foldMapWithIndex:function(a){var u=o(a);return function(c,s){return v(c,u(s))}},reduceRightWithIndex:function(a,u,c){return v(a,i(u,c))}}}var eX=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module",reduceWithIndex:Uk,foldMapWithIndex:jk,reduceRightWithIndex:Bk,getFoldableWithIndexComposition:tX});function ti(t){return function(e){return H(e,t.fromIO)}}function na(t,e){return function(r){var n=H(r,t.fromIO);return function(o){return e.chain(o,n)}}}function oa(t,e){var r=Xt(e);return function(n){return r(H(n,t.fromIO))}}var rX=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module",fromIOK:ti,chainIOK:na,chainFirstIOK:oa}),zk=function(){return j},nX=j,rp=function(t){return function(e){return function(r){return e(t(r))}}},np=function(t){return function(e){return t(e)(e)}},oX=np,ei=function(t,e){return v(t,gu(e))},op=function(t,e){return v(t,Vk(e))},oS=function(t,e){return v(t,Hk(e))},qk=function(t,e){return v(t,Gk(e))},bv=function(t,e,r){return v(t,Yk(e,r))},gu=function(t){return function(e){return function(r){return t(e(r))}}},Kk=function(t){return function(e){return function(r){return e(r)(t(r))}}},Vk=Kk,$o=Or,iS=function(t){return function(e){return function(r){return t(e(r))(r)}}},Hk=iS,Jk=iS(j),iX=Jk,Gk=function(t){return function(e){return H(t,e)}},Yk=function(t,e){return function(r){return function(n){return e(r(t(n)))}}},aS=function(){return j},uS=function(t){return function(e){var r=e[0],n=e[1];return[t(r),n]}},cS=function(t){return function(e){var r=e[0],n=e[1];return[r,t(n)]}},sS=function(t){return vb(function(e){return Ho(t(e))},Ct)},fS=function(t){return vb(ne,function(e){return ji(t(e))})},gn="Reader",Fe={URI:gn,map:ei},aX=Et(Fe),lS={URI:gn,of:$o},ri={URI:gn,map:ei,ap:op},uX=le(ri),cX=pe(ri),Xk={URI:gn,map:ei,ap:op,of:$o},pS={URI:gn,map:ei,ap:op,chain:oS},ni={URI:gn,map:ei,of:$o,ap:op,chain:oS},Zk=Xt(pS),sX=Zk,fX={URI:gn,map:ei,promap:bv},lX={URI:gn,compose:qk,id:aS},pX={URI:gn,map:ei,promap:bv,first:uS,second:cS},dX={URI:gn,map:ei,promap:bv,left:sS,right:fS},hX=he(Fe),Qk=ve(pS),vX=Qk,mX=$o(xe),tW=de(ri),gX=tW,eW=$o(Ze),yu=function(t){return function(e){return function(r){for(var n=[t(0,qr(e))(r)],o=1;o<e.length;o++)n.push(t(o,e[o])(r));return n}}},dS=function(t){var e=yu(t);return function(r){return Qt(r)?e(r):eW}},yX=dS,rW=function(t){return dS(function(e,r){return t(r)})},bX=rW(j),$X={URI:gn,map:ei,of:$o,ap:op,chain:oS,promap:bv,compose:qk,id:aS,first:uS,second:cS,left:sS,right:fS},_X=Oe(ri),SX=dn(Xk),TX=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module",ask:zk,asks:nX,local:rp,asksReaderW:np,asksReader:oX,map:gu,apW:Kk,ap:Vk,of:$o,chainW:iS,chain:Hk,flattenW:Jk,flatten:iX,compose:Gk,promap:Yk,id:aS,first:uS,second:cS,left:sS,right:fS,URI:gn,Functor:Fe,flap:aX,Pointed:lS,Apply:ri,apFirst:uX,apSecond:cX,Applicative:Xk,Chain:pS,Monad:ni,chainFirst:Zk,chainFirstW:sX,Profunctor:fX,Category:lX,Strong:pX,Choice:dX,bindTo:hX,bind:Qk,bindW:vX,Do:mX,apS:tW,apSW:gX,ApT:eW,traverseReadonlyNonEmptyArrayWithIndex:yu,traverseReadonlyArrayWithIndex:dS,traverseArrayWithIndex:yX,traverseArray:rW,sequenceArray:bX,reader:$X,getSemigroup:_X,getMonoid:SX});function ip(t){return function(){return t.fromReader(zk())}}function ap(t){return t.fromReader}function bu(t){return function(e){return H(e,t.fromReader)}}function up(t,e){var r=bu(t);return function(n){return function(o){return e.chain(o,r(n))}}}function cp(t,e){return H(bu(t),Xt(e))}var IX=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module",ask:ip,asks:ap,fromReaderK:bu,chainReaderK:up,chainFirstReaderK:cp}),nW=function(){return function(t){return[t,t]}},oW=function(t){return function(){return[void 0,t]}},iW=function(t){return function(e){return[void 0,t(e)]}},aW=function(t){return function(e){return[t(e),e]}},sp=function(t,e){return v(t,cW(e))},$v=function(t,e){return v(t,sW(e))},uW=function(t,e){return v(t,hS(e))},cW=function(t){return function(e){return function(r){var n=e(r),o=n[0],i=n[1];return[t(o),i]}}},sW=function(t){return function(e){return function(r){var n=e(r),o=n[0],i=n[1],a=t(i),u=a[0],c=a[1];return[o(u),c]}}},fp=function(t){return function(e){return[t,e]}},hS=function(t){return function(e){return function(r){var n=e(r),o=n[0],i=n[1];return t(o)(i)}}},OX=hS(j),ia="State",vS={URI:ia,map:sp},MX=Et(vS),RX={URI:ia,of:fp},_v={URI:ia,map:sp,ap:$v},EX=le(_v),wX=pe(_v),AX={URI:ia,map:sp,ap:$v,of:fp},mS={URI:ia,map:sp,ap:$v,chain:uW},fW={URI:ia,map:sp,ap:$v,of:fp,chain:uW},CX=Xt(mS),xX={URI:ia,fromState:j},kX=function(t){return function(e){return e(t)[0]}},WX=function(t){return function(e){return e(t)[1]}},FX=he(vS),NX=ve(mS),PX=de(_v),lW=function(t){return function(e){return function(r){for(var n=t(0,qr(e))(r),o=n[0],i=n[1],a=[o],u=i,c=1;c<e.length;c++){var s=t(c,e[c])(u),f=s[0],l=s[1];a.push(f),u=l}return[a,u]}}},gS=function(t){var e=lW(t);return function(r){return Qt(r)?e(r):fp(Ze)}},DX=gS,pW=function(t){return gS(function(e,r){return t(r)})},LX=pW(j),UX=function(t,e){return t(e)[0]},jX=function(t,e){return t(e)[1]},BX=fW,zX=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module",get:nW,put:oW,modify:iW,gets:aW,map:cW,ap:sW,of:fp,chain:hS,flatten:OX,URI:ia,Functor:vS,flap:MX,Pointed:RX,Apply:_v,apFirst:EX,apSecond:wX,Applicative:AX,Chain:mS,Monad:fW,chainFirst:CX,FromState:xX,evaluate:kX,execute:WX,bindTo:FX,bind:NX,apS:PX,traverseReadonlyNonEmptyArrayWithIndex:lW,traverseReadonlyArrayWithIndex:gS,traverseArrayWithIndex:DX,traverseArray:pW,sequenceArray:LX,evalState:UX,execState:jX,state:BX});function dW(t){return function(){return t.fromState(nW())}}function hW(t){return function(e){return t.fromState(oW(e))}}function vW(t){return H(iW,t.fromState)}function mW(t){return H(aW,t.fromState)}function yS(t){return function(e){return H(e,t.fromState)}}function gW(t,e){var r=yS(t);return function(n){return function(o){return e.chain(o,r(n))}}}var qX=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module",get:dW,put:hW,modify:vW,gets:mW,fromStateK:yS,chainStateK:gW});function $u(t){return function(e){return H(e,t.fromTask)}}function Es(t,e){return function(r){var n=H(r,t.fromTask);return function(o){return e.chain(o,n)}}}function ws(t,e){var r=Xt(e);return function(n){return r(H(n,t.fromTask))}}var KX=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module",fromTaskK:$u,chainTaskK:Es,chainFirstTaskK:ws});function yW(t){return function(e){return H(e,t.fromThese)}}var VX=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module",fromTheseK:yW});function bW(t,e){return function(r){return function(n){return t.mapWithIndex(n,function(o,i){return e.mapWithIndex(i,function(a,u){return r([o,a],u)})})}}}function HX(t,e){var r=Pc(t,e).map,n=bW(t,e);return{map:r,mapWithIndex:function(o,i){return v(o,n(i))}}}var JX=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module",mapWithIndex:bW,getFunctorWithIndexComposition:HX}),GX=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module"}),YX=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module"}),XX=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module"}),_o=function(t,e){return v(t,IW(e))},As=function(t,e){return v(t,OW(e))},Sv=function(t,e){return v(t,SS(e))},bS=function(t,e,r){return v(t,MW(e,r))},$S=function(t){return function(e,r){return v(e,RW()(r))}},_S=function(t,e,r){return v(t,EW(e,r))},$W=function(t,e){return v(t,CW())},_W=function(t,e){return v(t,TS(e))},SW=function(t){var e=wW(t);return function(r,n){return v(r,e(n))}},TW=tb,IW=function(t){return function(e){return t(e)}},OW=function(t){return function(e){return e(t)}},Cs=j,SS=function(t){return function(e){return t(e)}},TS=function(t){return function(e){return t(e)}},IS=j,ZX=TS(j),QX=SS(j),MW=function(t,e){return function(r){return e(t,r)}},RW=function(){return function(t){return function(e){return t(e)}}},EW=function(t,e){return function(r){return e(r,t)}},wW=function(t){return function(e){return function(r){return t.map(e(r),j)}}},OS=function(t){return function(e){return t.map(e,j)}},AW=function(){return j},CW=AW,Hr="Identity",tZ=j,eZ=j,MS={URI:Hr,map:_o},rZ=Et(MS),nZ={URI:Hr,of:Cs},Tv={URI:Hr,map:_o,ap:As},oZ=le(Tv),iZ=pe(Tv),aZ={URI:Hr,map:_o,ap:As,of:Cs},RS={URI:Hr,map:_o,ap:As,chain:Sv},uZ={URI:Hr,map:_o,ap:As,of:Cs,chain:Sv},cZ=Xt(RS),sZ={URI:Hr,reduce:bS,foldMap:$S,reduceRight:_S},fZ={URI:Hr,map:_o,reduce:bS,foldMap:$S,reduceRight:_S,traverse:SW,sequence:OS},lZ={URI:Hr,map:_o,alt:$W},pZ={URI:Hr,map:_o,extend:_W,extract:IS},dZ={URI:Hr,map:_o,ap:As,chain:Sv,chainRec:TW},hZ=Cs(xe),vZ=he(MS),mZ=ve(RS),gZ=de(Tv),yZ={URI:Hr,map:_o,ap:As,of:Cs,chain:Sv,reduce:bS,foldMap:$S,reduceRight:_S,traverse:SW,sequence:OS,alt:$W,extract:IS,extend:_W,chainRec:TW},bZ=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module",map:IW,ap:OW,of:Cs,chain:SS,extend:TS,extract:IS,duplicate:ZX,flatten:QX,reduce:MW,foldMap:RW,reduceRight:EW,traverse:wW,sequence:OS,altW:AW,alt:CW,URI:Hr,getShow:tZ,getEq:eZ,Functor:MS,flap:rZ,Pointed:nZ,Apply:Tv,apFirst:oZ,apSecond:iZ,Applicative:aZ,Chain:RS,Monad:uZ,chainFirst:cZ,Foldable:sZ,Traversable:fZ,Alt:lZ,Comonad:pZ,ChainRec:dZ,Do:hZ,bindTo:vZ,bind:mZ,apS:gZ,identity:yZ}),$Z=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module"}),oi=function(t,e){return function(){return e(t())}},aa=function(t,e){return function(){return t()(e())}},xs=function(t,e){return function(){return e(t())()}},xW=function(t,e){return function(){for(var r=e(t)();r._tag==="Left";)r=e(r.left)();return r.right}},ks=function(t){return function(e){return oi(e,t)}},_Z=function(t){return function(e){return aa(e,t)}},So=Or,ES=function(t){return function(e){return xs(e,t)}},SZ=ES(j),qn="IO",Ne={URI:qn,map:oi},TZ=Et(Ne),wS={URI:qn,of:So},ua={URI:qn,map:oi,ap:aa},IZ=le(ua),OZ=pe(ua),kW={URI:qn,map:oi,ap:aa,of:So},AS={URI:qn,map:oi,ap:aa,chain:xs},ii={URI:qn,map:oi,ap:aa,of:So,chain:xs},MZ=Xt(AS),CS=j,RZ={URI:qn,map:oi,ap:aa,of:So,chain:xs,fromIO:CS},EZ={URI:qn,map:oi,ap:aa,chain:xs,chainRec:xW},wZ={URI:qn,fromIO:j},AZ=So(xe),CZ=he(Ne),xZ=ve(AS),kZ=de(ua),WW=So(Ze),xS=function(t){return function(e){return function(){for(var r=[t(0,qr(e))()],n=1;n<e.length;n++)r.push(t(n,e[n])());return r}}},kS=function(t){var e=xS(t);return function(r){return Qt(r)?e(r):WW}},WZ=kS,FW=function(t){return kS(function(e,r){return t(r)})},FZ=FW(j),NZ={URI:qn,map:oi,of:So,ap:aa,chain:xs,fromIO:CS,chainRec:xW},PZ=Oe(ua),DZ=dn(kW),LZ=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module",map:ks,ap:_Z,of:So,chain:ES,flatten:SZ,URI:qn,Functor:Ne,flap:TZ,Pointed:wS,Apply:ua,apFirst:IZ,apSecond:OZ,Applicative:kW,Chain:AS,Monad:ii,chainFirst:MZ,fromIO:CS,MonadIO:RZ,ChainRec:EZ,FromIO:wZ,Do:AZ,bindTo:CZ,bind:xZ,apS:kZ,ApT:WW,traverseReadonlyNonEmptyArrayWithIndex:xS,traverseReadonlyArrayWithIndex:kS,traverseArrayWithIndex:WZ,traverseArray:FW,sequenceArray:FZ,io:NZ,getSemigroup:PZ,getMonoid:DZ}),NW=ms(wS),PW=du(wS),DW=gs(Ne),UZ=ys(Ne),LW=So,lp=DW,UW=Zl(Ne),jZ=UW,WS=Os(ii),BZ=WS,jW=WS,zZ=jW,BW=Ms(ii),qZ=BW,zW=function(t,e){return function(){return nu(t,e)}},KZ=function(t,e){return function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return zW(function(){return t.apply(void 0,r)},e)}},VZ=ep(Ne),qW=hu(ii),HZ=qW,KW=Ql(ii),JZ=KW,GZ=tp(ii),YZ=Rs(Ne),Rr=function(t,e){return v(t,PS(e))},_u=function(t,e){return v(t,DS(e))},XZ=function(t,e){return v(t,Fs(function(r){return v(e,PS(r))}))},Ws=function(t,e){return v(t,Fs(e))},FS=function(t,e,r){return v(t,HW(e,r))},NS=function(t,e){return v(t,JW(e))},VW=function(t,e){return v(t,LS(e))},PS=bs(Ne),HW=Ts(Ne),JW=Is(Ne),DS=$s(ua),ZZ=DS,yn=PW,Fs=_s(ii),GW=Fs,YW=GW(j),QZ=YW,LS=Ss(ii),tQ=LS,Iv=NW,ye="IOEither";function XW(t){var e=Vo(ua,zi(t));return{URI:ye,_E:void 0,map:Rr,ap:function(r,n){return v(r,e(n))},of:yn}}function ZW(t){var e=Xl(ii,t);return{URI:ye,_E:void 0,map:Rr,alt:function(r,n){return v(r,e(n))}}}var QW=function(t){var e=eu(t);return{URI:ye,_E:void 0,compact:Qo(Ne,e),separate:ta(Ne,e,qi)}};function eQ(t){var e=Uc(t),r=QW(t),n=ea(Ne,e),o=ra(Ne,e),i=vu(Ne,e),a=mu(Ne,e);return{URI:ye,_E:void 0,map:Rr,compact:r.compact,separate:r.separate,filter:function(u,c){return v(u,n(c))},filterMap:function(u,c){return v(u,o(c))},partition:function(u,c){return v(u,i(c))},partitionMap:function(u,c){return v(u,a(c))}}}var US={URI:ye,map:Rr},rQ=Et(US),nQ={URI:ye,of:yn},oQ={URI:ye,bimap:FS,mapLeft:NS},pp={URI:ye,map:Rr,ap:_u},iQ=le(pp),aQ=pe(pp),jS={URI:ye,map:Rr,ap:_u,of:yn},uQ={URI:ye,map:Rr,ap:XZ,of:yn},ca={URI:ye,map:Rr,ap:_u,chain:Ws},cQ={URI:ye,map:Rr,ap:_u,of:yn,chain:Ws},tF=Xt(ca),sQ=tF,fQ={URI:ye,map:Rr,alt:VW},lQ={URI:ye,map:Rr,ap:_u,of:yn,chain:Ws,fromIO:lp},pQ={URI:ye,map:Rr,ap:_u,of:yn,chain:Ws,throwError:Iv},Ov={URI:ye,fromIO:lp},dQ=ti(Ov),hQ=na(Ov,ca),vQ=oa(Ov,ca),sa={URI:ye,fromEither:LW},mQ=lo(sa),gQ=po(sa),yQ=Xa(sa,ca),eF=Za(sa,ca),bQ=eF,$Q=Bi(sa),rF=Qa(sa,ca),_Q=rF,SQ=ho(sa),TQ=function(t,e,r){return v(t,Fs(function(n){return v(e(n),ES(function(o){return v(r(n,o),Fs(function(){return So(o)}))}))}))},IQ=yn(xe),OQ=he(US),nF=ve(ca),MQ=nF,oF=de(pp),RQ=oF,BS=yn(Ze),iF=function(t){return H(xS(t),ks(dl(zr)))},zS=function(t){var e=iF(t);return function(r){return Qt(r)?e(r):BS}},aF=function(t){return function(e){return function(){var r=t(0,qr(e))();if(Me(r))return r;for(var n=[r.right],o=1;o<e.length;o++){var i=t(o,e[o])();if(Me(i))return i;n.push(i.right)}return ji(n)}}},qS=function(t){var e=aF(t);return function(r){return Qt(r)?e(r):BS}},EQ=zS,uF=function(t){return zS(function(e,r){return t(r)})},wQ=uF(j),AQ=qS,cF=function(t){return qS(function(e,r){return t(r)})},CQ=cF(j),xQ=jS,kQ={URI:ye,bimap:FS,mapLeft:NS,map:Rr,of:yn,ap:_u,chain:Ws,alt:VW,fromIO:lp,throwError:Iv},WQ=Oe(pp),FQ=dn(jS),NQ=function(t){return Oe(ua)(sl(t))};function PQ(t){var e=XW(t),r=ZW(t);return{URI:ye,_E:void 0,map:Rr,ap:e.ap,of:yn,chain:Ws,bimap:FS,mapLeft:NS,alt:r.alt,fromIO:lp,throwError:Iv}}var DQ=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module",left:NW,right:PW,rightIO:DW,leftIO:UZ,fromEither:LW,fromIO:lp,match:UW,matchW:jZ,matchE:WS,fold:BZ,matchEW:jW,foldW:zZ,getOrElse:BW,getOrElseW:qZ,tryCatch:zW,tryCatchK:KZ,toUnion:VZ,orElse:qW,orElseW:HZ,orElseFirst:KW,orElseFirstW:JZ,orLeft:GZ,swap:YZ,map:PS,bimap:HW,mapLeft:JW,ap:DS,apW:ZZ,of:yn,chain:Fs,chainW:GW,flattenW:YW,flatten:QZ,alt:LS,altW:tQ,throwError:Iv,URI:ye,getApplicativeIOValidation:XW,getAltIOValidation:ZW,getCompactable:QW,getFilterable:eQ,Functor:US,flap:rQ,Pointed:nQ,Bifunctor:oQ,ApplyPar:pp,apFirst:iQ,apSecond:aQ,ApplicativePar:jS,ApplicativeSeq:uQ,Chain:ca,Monad:cQ,chainFirst:tF,chainFirstW:sQ,Alt:fQ,MonadIO:lQ,MonadThrow:pQ,FromIO:Ov,fromIOK:dQ,chainIOK:hQ,chainFirstIOK:vQ,FromEither:sa,fromOption:mQ,fromOptionK:gQ,chainOptionK:yQ,chainEitherK:eF,chainEitherKW:bQ,fromPredicate:$Q,filterOrElse:rF,filterOrElseW:_Q,fromEitherK:SQ,bracket:TQ,Do:IQ,bindTo:OQ,bind:nF,bindW:MQ,apS:oF,apSW:RQ,ApT:BS,traverseReadonlyNonEmptyArrayWithIndex:iF,traverseReadonlyArrayWithIndex:zS,traverseReadonlyNonEmptyArrayWithIndexSeq:aF,traverseReadonlyArrayWithIndexSeq:qS,traverseArrayWithIndex:EQ,traverseArray:uF,sequenceArray:wQ,traverseSeqArrayWithIndex:AQ,traverseSeqArray:cF,sequenceSeqArray:CQ,Applicative:xQ,ioEither:kQ,getApplySemigroup:WQ,getApplyMonoid:FQ,getSemigroup:NQ,getIOValidation:PQ}),sF=function(){function t(e){var r=this;this.value=e,this.read=function(){return r.value},this.write=this.write.bind(this),this.modify=this.modify.bind(this)}return t.prototype.write=function(e){var r=this;return function(){r.value=e}},t.prototype.modify=function(e){var r=this;return function(){r.value=e(r.value)}},t}();function LQ(t){return function(){return new sF(t)}}var UQ=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module",IORef:sF,newIORef:LQ}),jQ=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module"}),BQ=function(t){return nu(function(){return JSON.parse(t)},j)},zQ=function(t){return nu(function(){var e=JSON.stringify(t);if(typeof e!="string")throw new Error("Converting unsupported structure to JSON");return e},j)},qQ=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module",parse:BQ,stringify:zQ}),KQ=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module"}),VQ=function(t){return new Map(t)};function HQ(t){return new Map(t)}function fF(t,e){return{show:function(r){var n=[];return r.forEach(function(o,i){n.push("["+t.show(i)+", "+e.show(o)+"]")}),"new Map(["+n.sort().join(", ")+"])"}}}var lF=function(t){return t.size},To=function(t){return t.size===0};function Mv(t){var e=Su(t);return function(r,n){if(n===void 0){var o=Mv(t);return function(i){return o(r,i)}}return Zt(e(r,n))}}function KS(t){return function(e,r){if(r===void 0){var n=KS(t);return function(u){return n(e,u)}}for(var o=r.values(),i;!(i=o.next()).done;){var a=i.value;if(t.equals(e,a))return!0}return!1}}var Ns=function(t){return function(e){return Array.from(e.keys()).sort(t.compare)}},JQ=function(t){return function(e){return Array.from(e.values()).sort(t.compare)}};function pF(t){var e=Ns(t);return function(r){return function(n){for(var o=[],i=e(n),a=0,u=i;a<u.length;a++){var c=u[a];o.push(r(c,n.get(c)))}return o}}}var dF=function(t){return pF(t)(function(e,r){return[e,r]})};function GQ(t,e){var r=dF(t);return function(n){var o=r(n),i=o.length;return e.unfold(0,function(a){return a<i?ct([o[a],a+1]):lt})}}var hF=function(t){var e=ai(t);return function(r,n){var o=e(r);return function(i){var a=o(i);if(me(a)){var u=new Map(i);return u.set(r,n),u}else if(a.value[1]!==n){var u=new Map(i);return u.set(a.value[0],n),u}return i}}},vF=function(t){var e=ai(t);return function(r){return function(n){var o=e(r,n);if(Zt(o)){var i=new Map(n);return i.delete(o.value[0]),i}return n}}},YQ=function(t){var e=mF(t);return function(r,n){return e(r,function(){return n})}},mF=function(t){var e=ai(t);return function(r,n){return function(o){var i=e(r,o);if(me(i))return lt;var a=i.value,u=a[0],c=a[1],s=n(c);if(s===c)return ct(o);var f=new Map(o);return f.set(u,s),ct(f)}}};function XQ(t){var e=Su(t),r=vF(t);return function(n){var o=r(n);return function(i){return v(e(n,i),bo(function(a){return[a,o(i)]}))}}}function ai(t){return function(e,r){if(r===void 0){var n=ai(t);return function(s){return n(e,s)}}for(var o=r.entries(),i;!(i=o.next()).done;){var a=i.value,u=a[0],c=a[1];if(t.equals(u,e))return ct([u,c])}return lt}}function Su(t){var e=ai(t);return function(r,n){if(n===void 0){var o=Su(t);return function(i){return o(r,i)}}return v(e(r,n),bo(function(i){i[0];var a=i[1];return a}))}}function Rv(t,e){var r=ai(t);return function(n,o){if(o===void 0){var i=Rv(t,e);return function(p){return i(p,n)}}for(var a=n.entries(),u;!(u=a.next()).done;){var c=u.value,s=c[0],f=c[1],l=r(s,o);if(me(l)||!t.equals(s,l.value[0])||!e.equals(f,l.value[1]))return!1}return!0}}var Ev=new Map;function gF(t,e){var r=Rv(t,e);return vn(function(n,o){return r(n,o)&&r(o,n)})}function ZQ(t,e){var r=ai(t);return{concat:function(n,o){if(To(n))return o;if(To(o))return n;for(var i=new Map(n),a=o.entries(),u;!(u=a.next()).done;){var c=u.value,s=c[0],f=c[1],l=r(s,n);Zt(l)?i.set(l.value[0],e.concat(l.value[1],f)):i.set(s,f)}return i},empty:Ev}}var QQ=function(t,e){return new Map([[t,e]])};function ttt(t,e,r){return function(n){var o=ai(t);return r.reduce(n,new Map,function(i,a){var u=a[0],c=a[1],s=o(u,i);return Zt(s)?i.set(s.value[0],e.concat(s.value[1],c)):i.set(u,c),i})}}var Ps=function(t,e){for(var r=new Map,n=t.entries(),o;!(o=n.next()).done;){var i=o.value,a=i[0],u=i[1];r.set(a,e(a,u))}return r},yF=function(t){return function(e){for(var r=new Map,n=new Map,o=e.entries(),i;!(i=o.next()).done;){var a=i.value,u=a[0],c=a[1],s=t(u,c);Me(s)?r.set(u,s.left):n.set(u,s.right)}return mt(r,n)}};function bF(t){return function(e){for(var r=new Map,n=new Map,o=e.entries(),i;!(i=o.next()).done;){var a=i.value,u=a[0],c=a[1];t(u,c)?n.set(u,c):r.set(u,c)}return mt(r,n)}}var $F=function(t){return function(e){for(var r=new Map,n=e.entries(),o;!(o=n.next()).done;){var i=o.value,a=i[0],u=i[1],c=t(a,u);Zt(c)&&r.set(a,c.value)}return r}};function _F(t){return function(e){for(var r=new Map,n=e.entries(),o;!(o=n.next()).done;){var i=o.value,a=i[0],u=i[1];t(a,u)&&r.set(a,u)}return r}}var ui=function(t,e){return Ps(t,function(r,n){return e(n)})},dp=function(t,e){return SF(t,function(r,n){return e(n)})},hp=function(t,e){return TF(t,function(r,n){return e(n)})},vp=function(t,e){return IF(t,function(r,n){return e(n)})},mp=function(t,e){return OF(t,function(r,n){return e(n)})},SF=function(t,e){return v(t,_F(e))},TF=function(t,e){return v(t,$F(e))},IF=function(t,e){return v(t,bF(e))},OF=function(t,e){return v(t,yF(e))},Ds=function(t){for(var e=new Map,r=t.entries(),n;!(n=r.next()).done;){var o=n.value,i=o[0],a=o[1];Zt(a)&&e.set(i,a.value)}return e},ett=function(t){return function(e){return dp(e,t)}},rtt=function(t){return function(e){return hp(e,t)}},ntt=function(t){return function(e){return ui(e,t)}},ott=function(t){return function(e){return Ps(e,t)}},itt=function(t){return function(e){return vp(e,t)}},att=function(t){return function(e){return mp(e,t)}},Ls=function(t){for(var e=new Map,r=new Map,n=t.entries(),o;!(o=n.next()).done;){var i=o.value,a=i[0],u=i[1];Me(u)?e.set(a,u.left):r.set(a,u.right)}return mt(e,r)},bn="ReadonlyMap",MF=function(t,e){var r=ZS(t,e);return{concat:function(n,o){return r(o)(n)}}},utt=function(t,e){return{concat:MF(t,e).concat,empty:Ev}},ctt=function(t,e){var r=QS(t,e);return{concat:function(n,o){return r(o)(n)}}},stt=function(t){return function(){var e=t0(t);return{concat:function(r,n){return e(n)(r)}}}};function ftt(){return{URI:bn,_E:void 0,map:ui,mapWithIndex:Ps,compact:Ds,separate:Ls,filter:dp,filterMap:hp,partition:vp,partitionMap:mp,partitionMapWithIndex:OF,partitionWithIndex:IF,filterMapWithIndex:TF,filterWithIndex:SF}}var RF={URI:bn,map:ui},ltt=Et(RF),ptt=function(){return{URI:bn,_E:void 0,map:ui,mapWithIndex:Ps}},VS={URI:bn,compact:Ds,separate:Ls},dtt={URI:bn,map:ui,compact:Ds,separate:Ls,filter:dp,filterMap:hp,partition:vp,partitionMap:mp},HS=function(t){var e=Av(t);return function(r,n){return e(r,function(o,i,a){return n(i,a)})}},JS=function(t){var e=Cv(t);return function(r){var n=e(r);return function(o){return n(function(i,a){return o(a)})}}},GS=function(t){var e=xv(t);return function(r,n){return e(r,function(o,i,a){return n(i,a)})}},wv=function(t){var e=HS(t),r=JS(t),n=GS(t);return{URI:bn,_E:void 0,reduce:function(o,i,a){return v(o,e(i,a))},foldMap:function(o){var i=r(o);return function(a,u){return v(a,i(u))}},reduceRight:function(o,i,a){return v(o,n(i,a))}}},Av=function(t){var e=Ns(t);return function(r,n){return function(o){for(var i=r,a=0,u=e(o);a<u.length;a++){var c=u[a];i=n(c,i,o.get(c))}return i}}},Cv=function(t){var e=Ns(t);return function(r){return function(n){return function(o){for(var i=r.empty,a=0,u=e(o);a<u.length;a++){var c=u[a];i=r.concat(i,n(c,o.get(c)))}return i}}}},xv=function(t){var e=Ns(t);return function(r,n){return function(o){for(var i=r,a=e(o),u=a.length,c=u-1;c>=0;c--){var s=a[c];i=n(s,o.get(s),i)}return i}}},YS=function(t){var e=wv(t),r=Av(t),n=Cv(t),o=xv(t);return{URI:bn,_E:void 0,reduce:e.reduce,foldMap:e.foldMap,reduceRight:e.reduceRight,reduceWithIndex:function(i,a,u){return v(i,r(a,u))},foldMapWithIndex:function(i){var a=n(i);return function(u,c){return v(u,a(c))}},reduceRightWithIndex:function(i,a,u){return v(i,o(a,u))}}},htt=function(t){var e=XS(t),r=wv(t);return{URI:bn,_E:void 0,map:ui,reduce:r.reduce,foldMap:r.foldMap,reduceRight:r.reduceRight,traverse:e.traverse,sequence:e.sequence}},XS=function(t){var e=YS(t),r=Ns(t),n=function(a){return function(u,c){for(var s=a.of(new Map),f=r(u),l=f.length,p=function(h){var m=f[h],g=u.get(m);s=a.ap(a.map(s,function(b){return function($){return b.set(m,$)}}),c(m,g))},d=0;d<l;d++)p(d);return s}},o=function(a){var u=n(a);return function(c,s){return u(c,function(f,l){return s(l)})}},i=function(a){var u=n(a);return function(c){return u(c,zr)}};return{URI:bn,_E:void 0,map:ui,mapWithIndex:Ps,reduce:e.reduce,foldMap:e.foldMap,reduceRight:e.reduceRight,reduceWithIndex:e.reduceWithIndex,foldMapWithIndex:e.foldMapWithIndex,reduceRightWithIndex:e.reduceRightWithIndex,traverse:o,sequence:i,traverseWithIndex:n}};function vtt(t){var e=XS(t);return{URI:bn,_E:void 0,map:ui,compact:Ds,separate:Ls,filter:dp,filterMap:hp,partition:vp,partitionMap:mp,reduce:e.reduce,foldMap:e.foldMap,reduceRight:e.reduceRight,traverse:e.traverse,sequence:e.sequence,mapWithIndex:Ps,reduceWithIndex:e.reduceWithIndex,foldMapWithIndex:e.foldMapWithIndex,reduceRightWithIndex:e.reduceRightWithIndex,traverseWithIndex:e.traverseWithIndex,wilt:Fn(e,VS),wither:Nn(e,VS)}}var ZS=function(t,e){var r=Su(t);return function(n){return function(o){if(To(o))return n;if(To(n))return o;for(var i=new Map,a=o.entries(),u;!(u=a.next()).done;){var c=u.value,s=c[0],f=c[1],l=r(s)(n);Zt(l)?i.set(s,e.concat(f,l.value)):i.set(s,f)}for(var p=n.entries();!(u=p.next()).done;){var d=u.value,s=d[0],f=d[1],l=r(s)(i);me(l)&&i.set(s,f)}return i}}},QS=function(t,e){var r=Su(t);return function(n){return function(o){if(To(o)||To(n))return Ev;for(var i=new Map,a=o.entries(),u;!(u=a.next()).done;){var c=u.value,s=c[0],f=c[1],l=r(s)(n);Zt(l)&&i.set(s,e.concat(f,l.value))}return i}}},t0=function(t){var e=Mv(t);return function(r){return function(n){if(To(n))return r;if(To(r))return n;for(var o=new Map,i=n.entries(),a;!(a=i.next()).done;){var u=a.value,c=u[0],s=u[1];e(c)(r)||o.set(c,s)}for(var f=r.entries();!(a=f.next()).done;){var l=a.value,c=l[0],s=l[1];e(c)(n)||o.set(c,s)}return o}}},mtt=hF,gtt={URI:bn,map:ui,compact:Ds,separate:Ls,filter:dp,filterMap:hp,partition:vp,partitionMap:mp},ytt=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module",fromMap:VQ,toMap:HQ,getShow:fF,size:lF,isEmpty:To,member:Mv,elem:KS,keys:Ns,values:JQ,collect:pF,toReadonlyArray:dF,toUnfoldable:GQ,upsertAt:hF,deleteAt:vF,updateAt:YQ,modifyAt:mF,pop:XQ,lookupWithKey:ai,lookup:Su,isSubmap:Rv,empty:Ev,getEq:gF,getMonoid:ZQ,singleton:QQ,fromFoldable:ttt,partitionMapWithIndex:yF,partitionWithIndex:bF,filterMapWithIndex:$F,filterWithIndex:_F,compact:Ds,filter:ett,filterMap:rtt,map:ntt,mapWithIndex:ott,partition:itt,partitionMap:att,separate:Ls,URI:bn,getUnionSemigroup:MF,getUnionMonoid:utt,getIntersectionSemigroup:ctt,getDifferenceMagma:stt,getFilterableWithIndex:ftt,Functor:RF,flap:ltt,getFunctorWithIndex:ptt,Compactable:VS,Filterable:dtt,reduce:HS,foldMap:JS,reduceRight:GS,getFoldable:wv,reduceWithIndex:Av,foldMapWithIndex:Cv,reduceRightWithIndex:xv,getFoldableWithIndex:YS,getTraversable:htt,getTraversableWithIndex:XS,getWitherable:vtt,union:ZS,intersection:QS,difference:t0,insertAt:mtt,readonlyMap:gtt}),Us=globalThis&&globalThis.__assign||function(){return Us=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++){e=arguments[r];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])}return t},Us.apply(this,arguments)},btt=fF,$tt=lF,ci=To,_tt=Mv,Stt=KS,e0=function(t){return function(e){return Array.from(e.keys()).sort(t.compare)}},Ttt=function(t){return function(e){return Array.from(e.values()).sort(t.compare)}};function EF(t){var e=e0(t);return function(r){return function(n){for(var o=[],i=e(n),a=0,u=i;a<u.length;a++){var c=u[a];o.push(r(c,n.get(c)))}return o}}}function wF(t){return EF(t)(function(e,r){return[e,r]})}function Itt(t,e){var r=wF(t);return function(n){var o=r(n),i=o.length;return e.unfold(0,function(a){return a<i?ct([o[a],a+1]):lt})}}var AF=function(t){var e=Tu(t);return function(r,n){var o=e(r);return function(i){var a=o(i);if(me(a)){var u=new Map(i);return u.set(r,n),u}else if(a.value[1]!==n){var u=new Map(i);return u.set(a.value[0],n),u}return i}}},CF=function(t){var e=Tu(t);return function(r){return function(n){var o=e(r,n);if(Zt(o)){var i=new Map(n);return i.delete(o.value[0]),i}return n}}},Ott=function(t){var e=xF(t);return function(r,n){return e(r,function(){return n})}},xF=function(t){var e=Tu(t);return function(r,n){return function(o){var i=e(r,o);if(me(i))return lt;var a=new Map(o);return a.set(i.value[0],n(i.value[1])),ct(a)}}};function Mtt(t){var e=kF(t),r=CF(t);return function(n){var o=r(n);return function(i){return v(e(n,i),bo(function(a){return[a,o(i)]}))}}}function Tu(t){return function(e,r){if(r===void 0){var n=Tu(t);return function(s){return n(e,s)}}for(var o=r.entries(),i;!(i=o.next()).done;){var a=i.value,u=a[0],c=a[1];if(t.equals(u,e))return ct([u,c])}return lt}}var kF=Su,Rtt=Rv,Ett=gF;function wtt(t,e){var r=Tu(t);return{concat:function(n,o){if(ci(n))return o;if(ci(o))return n;for(var i=new Map(n),a=o.entries(),u;!(u=a.next()).done;){var c=u.value,s=c[0],f=c[1],l=r(s,n);Zt(l)?i.set(l.value[0],e.concat(l.value[1],f)):i.set(s,f)}return i},empty:new Map}}var Att=function(t,e){return new Map([[t,e]])};function Ctt(t,e,r){return function(n){var o=Tu(t);return r.reduce(n,new Map,function(i,a){var u=a[0],c=a[1],s=o(u,i);return Zt(s)?i.set(s.value[0],e.concat(s.value[1],c)):i.set(u,c),i})}}var gp=function(t,e){for(var r=new Map,n=t.entries(),o;!(o=n.next()).done;){var i=o.value,a=i[0],u=i[1];r.set(a,e(a,u))}return r},WF=function(t){return function(e){for(var r=new Map,n=new Map,o=e.entries(),i;!(i=o.next()).done;){var a=i.value,u=a[0],c=a[1],s=t(u,c);Me(s)?r.set(u,s.left):n.set(u,s.right)}return mt(r,n)}};function FF(t){return function(e){for(var r=new Map,n=new Map,o=e.entries(),i;!(i=o.next()).done;){var a=i.value,u=a[0],c=a[1];t(u,c)?n.set(u,c):r.set(u,c)}return mt(r,n)}}var NF=function(t){return function(e){for(var r=new Map,n=e.entries(),o;!(o=n.next()).done;){var i=o.value,a=i[0],u=i[1],c=t(a,u);Zt(c)&&r.set(a,c.value)}return r}};function PF(t){return function(e){for(var r=new Map,n=e.entries(),o;!(o=n.next()).done;){var i=o.value,a=i[0],u=i[1];t(a,u)&&r.set(a,u)}return r}}var js=function(t,e){return gp(t,function(r,n){return e(n)})},kv=function(t,e){return DF(t,function(r,n){return e(n)})},Wv=function(t,e){return LF(t,function(r,n){return e(n)})},Fv=function(t,e){return UF(t,function(r,n){return e(n)})},Nv=function(t,e){return jF(t,function(r,n){return e(n)})},DF=function(t,e){return v(t,PF(e))},LF=function(t,e){return v(t,NF(e))},UF=function(t,e){return v(t,FF(e))},jF=function(t,e){return v(t,WF(e))},yp=function(t){for(var e=new Map,r=t.entries(),n;!(n=r.next()).done;){var o=n.value,i=o[0],a=o[1];Zt(a)&&e.set(i,a.value)}return e},xtt=function(t){return function(e){return kv(e,t)}},ktt=function(t){return function(e){return Wv(e,t)}},Wtt=function(t){return function(e){return js(e,t)}},Ftt=function(t){return function(e){return gp(e,t)}},Ntt=function(t){return function(e){return Fv(e,t)}},Ptt=function(t){return function(e){return Nv(e,t)}},bp=function(t){for(var e=new Map,r=new Map,n=t.entries(),o;!(o=n.next()).done;){var i=o.value,a=i[0],u=i[1];Me(u)?e.set(a,u.left):r.set(a,u.right)}return mt(e,r)},si="Map",BF=function(t,e){var r=HF(t,e);return{concat:function(n,o){return r(o)(n)}}},Dtt=function(t,e){return{concat:BF(t,e).concat,empty:new Map}},Ltt=function(t,e){var r=JF(t,e);return{concat:function(n,o){return r(o)(n)}}},Utt=function(t){return function(){var e=GF(t);return{concat:function(r,n){return e(n)(r)}}}};function jtt(){return{URI:si,_E:void 0,map:js,mapWithIndex:gp,compact:yp,separate:bp,filter:kv,filterMap:Wv,partition:Fv,partitionMap:Nv,partitionMapWithIndex:jF,partitionWithIndex:UF,filterMapWithIndex:LF,filterWithIndex:DF}}function Btt(t){var e=qF(t);return{URI:si,_E:void 0,map:js,compact:yp,separate:bp,filter:kv,filterMap:Wv,partition:Fv,partitionMap:Nv,reduce:e.reduce,foldMap:e.foldMap,reduceRight:e.reduceRight,traverse:e.traverse,sequence:e.sequence,mapWithIndex:gp,reduceWithIndex:e.reduceWithIndex,foldMapWithIndex:e.foldMapWithIndex,reduceRightWithIndex:e.reduceRightWithIndex,traverseWithIndex:e.traverseWithIndex,wilt:Fn(e,r0),wither:Nn(e,r0)}}var ztt=HS,qtt=JS,Ktt=GS,Vtt=function(t){return Us(Us({},wv(t)),{URI:si})},Htt=Av,Jtt=Cv,Gtt=xv,zF=function(t){return Us(Us({},YS(t)),{URI:si})},qF=function(t){var e=zF(t),r=e0(t),n=function(a){return function(u,c){for(var s=a.of(new Map),f=r(u),l=f.length,p=function(h){var m=f[h],g=u.get(m);s=a.ap(a.map(s,function(b){return function($){return b.set(m,$)}}),c(m,g))},d=0;d<l;d++)p(d);return s}},o=function(a){var u=n(a);return function(c,s){return u(c,function(f,l){return s(l)})}},i=function(a){var u=n(a);return function(c){return u(c,function(s,f){return f})}};return{URI:si,_E:void 0,map:js,mapWithIndex:gp,reduce:e.reduce,foldMap:e.foldMap,reduceRight:e.reduceRight,reduceWithIndex:e.reduceWithIndex,foldMapWithIndex:e.foldMapWithIndex,reduceRightWithIndex:e.reduceRightWithIndex,traverse:o,sequence:i,traverseWithIndex:n}},KF={URI:si,map:js},Ytt=Et(KF),r0={URI:si,compact:yp,separate:bp},VF={URI:si,map:js,compact:yp,separate:bp,filter:kv,filterMap:Wv,partition:Fv,partitionMap:Nv},Pv=function(t){return new Map(t)},HF=function(t,e){var r=ZS(t,e);return function(n){return function(o){return ci(o)?Pv(n):ci(n)?Pv(o):r(n)(o)}}},JF=function(t,e){var r=QS(t,e);return function(n){return function(o){return ci(o)||ci(n)?new Map:r(n)(o)}}},GF=function(t){var e=t0(t);return function(r){return function(n){return ci(n)?Pv(r):ci(r)?Pv(n):e(r)(n)}}},Xtt=new Map,Ztt=AF,Qtt=VF,tet=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module",getShow:btt,size:$tt,isEmpty:ci,member:_tt,elem:Stt,keys:e0,values:Ttt,collect:EF,toArray:wF,toUnfoldable:Itt,upsertAt:AF,deleteAt:CF,updateAt:Ott,modifyAt:xF,pop:Mtt,lookupWithKey:Tu,lookup:kF,isSubmap:Rtt,getEq:Ett,getMonoid:wtt,singleton:Att,fromFoldable:Ctt,partitionMapWithIndex:WF,partitionWithIndex:FF,filterMapWithIndex:NF,filterWithIndex:PF,compact:yp,filter:xtt,filterMap:ktt,map:Wtt,mapWithIndex:Ftt,partition:Ntt,partitionMap:Ptt,separate:bp,URI:si,getUnionSemigroup:BF,getUnionMonoid:Dtt,getIntersectionSemigroup:Ltt,getDifferenceMagma:Utt,getFilterableWithIndex:jtt,getWitherable:Btt,reduce:ztt,foldMap:qtt,reduceRight:Ktt,getFoldable:Vtt,reduceWithIndex:Htt,foldMapWithIndex:Jtt,reduceRightWithIndex:Gtt,getFoldableWithIndex:zF,getTraversableWithIndex:qF,Functor:KF,flap:Ytt,Compactable:r0,Filterable:VF,union:HF,intersection:JF,difference:GF,empty:Xtt,insertAt:Ztt,map_:Qtt}),eet=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module"}),ret=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module"}),net=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module"}),oet=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module"}),iet=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module"}),YF=function(t){return{concat:hh(t).concat,empty:t.top}},XF=function(t){return{concat:vh(t).concat,empty:t.bottom}},n0=function(t){return{concat:Pb(t).concat,empty:t.empty}},ZF=function(t){var e={};for(var r in t)re.call(t,r)&&(e[r]=t[r].empty);return{concat:Db(t).concat,empty:e}},QF=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return{concat:Lb.apply(Vw,t).concat,empty:t.map(function(r){return r.empty})}},tN=function(t){return Bb(t)(t.empty)},aet={concat:Uw.concat,empty:void 0},uet=QF,cet=ZF,set=n0,fet=XF,pet=YF,det=tN,eN={concat:jw.concat,empty:!0},rN={concat:Bw.concat,empty:!1},het=XR,vet=function(){return n0(Wk())},met={concat:zw.concat,empty:""},get={concat:qw.concat,empty:0},yet={concat:Kw.concat,empty:1},bet=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module",min:YF,max:XF,reverse:n0,struct:ZF,tuple:QF,concatAll:tN,monoidVoid:aet,getTupleMonoid:uet,getStructMonoid:cet,getDualMonoid:set,getJoinMonoid:fet,getMeetMonoid:pet,fold:det,monoidAll:eN,monoidAny:rN,getFunctionMonoid:het,getEndomorphismMonoid:vet,monoidString:met,monoidSum:get,monoidProduct:yet}),$et=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module"});function Dv(t){return H(Jt,t.of)}function Lv(t){return Or(t.of(Dt))}function o0(t){return function(e){return t.map(e,Jt)}}function i0(t){return H(lu,t.of)}function a0(t){var e=i0(t);return function(r){return H(r,e)}}function nN(t){var e=$p(t),r=a0(t);return function(n){return e(r(n))}}function u0(t){return function(e){return H(e,t.of)}}function oN(t){var e=$p(t),r=u0(t);return function(n){return e(r(n))}}function iN(t){return function(e){return function(r){return t.of(sv(e)(r))}}}function aN(t){return H(Yl,t.of)}function uN(t){return function(e,r){return function(n){return t.map(n,Xo(e,r))}}}function c0(t){return function(e,r){return function(n){return t.chain(n,Xo(e,r))}}}function s0(t){return function(e){return function(r){return t.chain(r,Xo(e,t.of))}}}function f0(t){return Nc(t,Vl)}function l0(t){return Vo(t,ps)}function $p(t){var e=Lv(t);return function(r){return function(n){return t.chain(n,Xo(function(){return e()},r))}}}function p0(t){var e=Dv(t);return function(r){return function(n){return t.chain(n,Xo(r,e))}}}function _et(t){var e=l0(t),r=f0(t),n=$p(t),o=p0(t),i=c0(t),a=s0(t),u=Lv(t);return{map:function(c,s){return v(c,r(s))},ap:function(c,s){return v(c,e(s))},of:Dv(t),chain:function(c,s){return v(c,n(s))},alt:function(c,s){return v(c,o(s))},fold:function(c,s,f){return v(c,i(s,f))},getOrElse:function(c,s){return v(c,a(s))},fromM:o0(t),none:function(){return u()}}}var Tet=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module",some:Dv,zero:Lv,fromF:o0,fromNullable:i0,fromNullableK:a0,chainNullableK:nN,fromOptionK:u0,chainOptionK:oN,fromPredicate:iN,fromEither:aN,match:uN,matchE:c0,getOrElse:s0,map:f0,ap:l0,chain:$p,alt:p0,getOptionM:_et}),Iet=function(t,e,r){return function(n){return n===-1?t():n===0?e():r()}},cN=function(t){return t===-1?1:t===1?-1:0},sN={equals:function(t,e){return t===e}},d0={concat:function(t,e){return t!==0?t:e}},fN={concat:d0.concat,empty:0},Oet=function(t){return t<=-1?-1:t>=1?1:0},Met=cN,Ret=d0,Eet=sN,wet=fN,Aet=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module",match:Iet,reverse:cN,Eq:sN,Semigroup:d0,Monoid:fN,sign:Oet,invert:Met,semigroupOrdering:Ret,eqOrdering:Eet,monoidOrdering:wet}),Cet=function(t){return typeof t.map=="function"},xet=function(t){return typeof t.contramap=="function"},ket=function(t){return typeof t.mapWithIndex=="function"},Wet=function(t){return typeof t.ap=="function"},Fet=function(t){return typeof t.chain=="function"},Net=function(t){return typeof t.bimap=="function"},Pet=function(t){return typeof t.extend=="function"},Det=function(t){return typeof t.reduce=="function"},Let=function(t){return typeof t.reduceWithIndex=="function"},Uet=function(t){return typeof t.alt=="function"},jet=function(t){return typeof t.compact=="function"},Bet=function(t){return typeof t.filter=="function"},zet=function(t){return typeof t.filterWithIndex=="function"},qet=function(t){return typeof t.promap=="function"},Ket=function(t){return typeof t.compose=="function"},Vet=function(t){return typeof t.throwError=="function"};function Het(t){var e={};if(Cet(t)){var r=function(T){return function(M){return t.map(M,T)}};e.map=r}if(xet(t)){var n=function(T){return function(M){return t.contramap(M,T)}};e.contramap=n}if(ket(t)){var o=function(T){return function(M){return t.mapWithIndex(M,T)}};e.mapWithIndex=o}if(Wet(t)){var i=function(T){return function(M){return t.ap(M,T)}},a=function(T){return function(M){return t.ap(t.map(M,function(N){return function(){return N}}),T)}};e.ap=i,e.apFirst=a,e.apSecond=function(T){return function(M){return t.ap(t.map(M,function(){return function(N){return N}}),T)}}}if(Fet(t)){var u=function(T){return function(M){return t.chain(M,T)}},c=function(T){return function(M){return t.chain(M,function(N){return t.map(T(N),function(){return N})})}},s=function(T){return t.chain(T,j)};e.chain=u,e.chainFirst=c,e.flatten=s}if(Net(t)){var f=function(T,M){return function(N){return t.bimap(N,T,M)}},l=function(T){return function(M){return t.mapLeft(M,T)}};e.bimap=f,e.mapLeft=l}if(Pet(t)){var p=function(T){return function(M){return t.extend(M,T)}},d=function(T){return t.extend(T,j)};e.extend=p,e.duplicate=d}if(Det(t)){var h=function(T,M){return function(N){return t.reduce(N,T,M)}},m=function(T){var M=t.foldMap(T);return function(N){return function(at){return M(at,N)}}},g=function(T,M){return function(N){return t.reduceRight(N,T,M)}};e.reduce=h,e.foldMap=m,e.reduceRight=g}if(Let(t)){var b=function(T,M){return function(N){return t.reduceWithIndex(N,T,M)}},$=function(T){var M=t.foldMapWithIndex(T);return function(N){return function(at){return M(at,N)}}},w=function(T,M){return function(N){return t.reduceRightWithIndex(N,T,M)}};e.reduceWithIndex=b,e.foldMapWithIndex=$,e.reduceRightWithIndex=w}if(Uet(t)){var y=function(T){return function(M){return t.alt(M,T)}};e.alt=y}if(jet(t)&&(e.compact=t.compact,e.separate=t.separate),Bet(t)){var I=function(T){return function(M){return t.filter(M,T)}},S=function(T){return function(M){return t.filterMap(M,T)}},k=function(T){return function(M){return t.partition(M,T)}},C=function(T){return function(M){return t.partitionMap(M,T)}};e.filter=I,e.filterMap=S,e.partition=k,e.partitionMap=C}if(zet(t)){var B=function(T){return function(M){return t.filterWithIndex(M,T)}},q=function(T){return function(M){return t.filterMapWithIndex(M,T)}},G=function(T){return function(M){return t.partitionWithIndex(M,T)}},O=function(T){return function(M){return t.partitionMapWithIndex(M,T)}};e.filterWithIndex=B,e.filterMapWithIndex=q,e.partitionWithIndex=G,e.partitionMapWithIndex=O}if(qet(t)){var R=function(T,M){return function(N){return t.promap(N,T,M)}};e.promap=R}if(Ket(t)){var x=function(T){return function(M){return t.compose(M,T)}};e.compose=x}if(Vet(t)){var F=function(T){return function(M){return M._tag==="None"?t.throwError(T()):t.of(M.value)}},L=function(T){return T._tag==="Left"?t.throwError(T.left):t.of(T.right)},U=function(T,M){return function(N){return T(N)?t.of(N):t.throwError(M(N))}},rt=function(T,M){return function(N){return t.chain(N,function(at){return T(at)?t.of(at):t.throwError(M(at))})}};e.fromOption=F,e.fromEither=L,e.fromPredicate=U,e.filterOrElse=rt}return e}var it=v,Jet=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module",pipeable:Het,pipe:it}),Get=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module"}),Yet=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module"}),Uv=function(){return Math.random()};function lN(t,e){return v(Uv,ks(function(r){return Math.floor((e-t+1)*r+t)}))}function Xet(t,e){return v(Uv,ks(function(r){return(e-t)*r+t}))}var Zet=v(Uv,ks(function(t){return t<.5})),Qet=function(t){return v(lN(0,t.length-1),ks(function(e){return t[e]}))},trt=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module",random:Uv,randomInt:lN,randomRange:Xet,randomBool:Zet,randomElem:Qet}),h0=ms(lS),pN=du(lS),dN=gs(Fe),ert=ys(Fe),hN=$o,vN=dN,mN=Zl(Fe),rrt=mN,v0=Os(ni),nrt=v0,gN=v0,ort=gN,yN=Ms(ni),irt=yN,art=ep(Fe),urt=rp,bN=np,crt=bN,$N=hu(ni),srt=$N,_N=Ql(ni),frt=_N,lrt=tp(ni),prt=Rs(Fe),$n=function(t,e){return v(t,TN(e))},m0=function(t,e,r){return v(t,IN(e,r))},g0=function(t,e){return v(t,ON(e))},Bs=function(t,e){return v(t,y0(e))},_p=function(t,e){return v(t,b0(e))},SN=function(t,e){return v(t,$0(e))},TN=bs(Fe),IN=Ts(Fe),ON=Is(Fe),y0=$s(ri),drt=y0,Io=pN,b0=_s(ni),MN=b0,RN=MN(j),hrt=RN,$0=Ss(ni),vrt=$0,_0=h0,Re="ReaderEither",EN=function(t){var e=eu(t);return{URI:Re,_E:void 0,compact:Qo(Fe,e),separate:ta(Fe,e,qi)}};function mrt(t){var e=Uc(t),r=EN(t),n=ea(Fe,e),o=ra(Fe,e),i=vu(Fe,e),a=mu(Fe,e);return{URI:Re,_E:void 0,map:$n,compact:r.compact,separate:r.separate,filter:function(u,c){return v(u,n(c))},filterMap:function(u,c){return v(u,o(c))},partition:function(u,c){return v(u,i(c))},partitionMap:function(u,c){return v(u,a(c))}}}function wN(t){var e=Vo(ri,zi(t));return{URI:Re,_E:void 0,map:$n,ap:function(r,n){return v(r,e(n))},of:Io}}function AN(t){var e=Xl(ni,t);return{URI:Re,_E:void 0,map:$n,alt:function(r,n){return v(r,e(n))}}}var S0={URI:Re,map:$n},grt=Et(S0),yrt={URI:Re,of:Io},Sp={URI:Re,map:$n,ap:Bs},brt=le(Sp),$rt=pe(Sp),CN={URI:Re,map:$n,ap:Bs,of:Io},fa={URI:Re,map:$n,ap:Bs,chain:_p},_rt={URI:Re,map:$n,ap:Bs,of:Io,chain:_p},xN=Xt(fa),Srt=xN,Trt={URI:Re,bimap:m0,mapLeft:g0},Irt={URI:Re,map:$n,alt:SN},zs={URI:Re,fromReader:vN},Ort=ip(zs),Mrt=ap(zs),Rrt=bu(zs),kN=up(zs,fa),Ert=kN,WN=cp(zs,fa),wrt=WN,Art={URI:Re,map:$n,ap:Bs,of:Io,chain:_p,throwError:_0},la={URI:Re,fromEither:hN},Crt=lo(la),xrt=po(la),krt=Xa(la,fa),FN=Za(la,fa),Wrt=FN,Frt=Bi(la),NN=Qa(la,fa),Nrt=NN,Prt=ho(la),Drt=Io(xe),Lrt=he(S0),PN=ve(fa),Urt=PN,DN=de(Sp),jrt=DN,LN=Io(Ze),UN=function(t){return H(yu(t),gu(dl(zr)))},T0=function(t){var e=UN(t);return function(r){return Qt(r)?e(r):LN}},Brt=T0,jN=function(t){return T0(function(e,r){return t(r)})},zrt=jN(j),qrt={URI:Re,bimap:m0,mapLeft:g0,map:$n,of:Io,ap:Bs,chain:_p,alt:SN,throwError:h0},Krt=Oe(Sp),Vrt=dn(CN),Hrt=function(t){return Oe(ri)(sl(t))};function Jrt(t){var e=wN(t),r=AN(t);return{URI:Re,_E:void 0,map:$n,ap:e.ap,of:Io,chain:_p,bimap:m0,mapLeft:g0,alt:r.alt,throwError:_0}}var Grt=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module",left:h0,right:pN,rightReader:dN,leftReader:ert,fromEither:hN,fromReader:vN,match:mN,matchW:rrt,matchE:v0,fold:nrt,matchEW:gN,foldW:ort,getOrElse:yN,getOrElseW:irt,toUnion:art,local:urt,asksReaderEitherW:bN,asksReaderEither:crt,orElse:$N,orElseW:srt,orElseFirst:_N,orElseFirstW:frt,orLeft:lrt,swap:prt,map:TN,bimap:IN,mapLeft:ON,ap:y0,apW:drt,of:Io,chain:b0,chainW:MN,flattenW:RN,flatten:hrt,alt:$0,altW:vrt,throwError:_0,URI:Re,getCompactable:EN,getFilterable:mrt,getApplicativeReaderValidation:wN,getAltReaderValidation:AN,Functor:S0,flap:grt,Pointed:yrt,Apply:Sp,apFirst:brt,apSecond:$rt,Applicative:CN,Chain:fa,Monad:_rt,chainFirst:xN,chainFirstW:Srt,Bifunctor:Trt,Alt:Irt,FromReader:zs,ask:Ort,asks:Mrt,fromReaderK:Rrt,chainReaderK:kN,chainReaderKW:Ert,chainFirstReaderK:WN,chainFirstReaderKW:wrt,MonadThrow:Art,FromEither:la,fromOption:Crt,fromOptionK:xrt,chainOptionK:krt,chainEitherK:FN,chainEitherKW:Wrt,fromPredicate:Frt,filterOrElse:NN,filterOrElseW:Nrt,fromEitherK:Prt,Do:Drt,bindTo:Lrt,bind:PN,bindW:Urt,apS:DN,apSW:jrt,ApT:LN,traverseReadonlyNonEmptyArrayWithIndex:UN,traverseReadonlyArrayWithIndex:T0,traverseArrayWithIndex:Brt,traverseArray:jN,sequenceArray:zrt,readerEither:qrt,getApplySemigroup:Krt,getApplyMonoid:Vrt,getSemigroup:Hrt,getReaderValidation:Jrt});function I0(t){return function(e){return function(){return t.of(e)}}}function O0(t){return function(e){return function(r){return function(n){return t.map(r(n),e)}}}}function M0(t){return function(e){return function(r){return function(n){return t.ap(r(n),e(n))}}}}function R0(t){return function(e){return function(r){return function(n){return t.chain(r(n),function(o){return e(o)(n)})}}}}function E0(t){return function(e){return H(e,t.of)}}function Yrt(t){return function(e){return H(e,t)}}function Xrt(t){var e=M0(t),r=O0(t),n=R0(t);return{map:function(o,i){return v(o,r(i))},ap:function(o,i){return v(o,e(i))},of:I0(t),chain:function(o,i){return v(o,n(i))},ask:function(){return t.of},asks:function(o){return H(o,t.of)},local:function(o,i){return function(a){return o(i(a))}},fromReader:E0(t),fromM:function(o){return function(){return o}}}}var Zrt=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module",of:I0,map:O0,ap:M0,chain:R0,fromReader:E0,fromNaturalTransformation:Yrt,getReaderM:Xrt}),hr=function(t){return function(){return Promise.resolve().then(t)}};function Qrt(t){return function(e){return function(){return new Promise(function(r){setTimeout(function(){Promise.resolve().then(e).then(r)},t)})}}}var Kn=function(t,e){return v(t,pa(e))},Iu=function(t,e){return v(t,BN(e))},w0=function(t,e){return v(t,Tp(function(r){return v(e,pa(r))}))},qs=function(t,e){return v(t,Tp(e))},pa=function(t){return function(e){return function(){return Promise.resolve().then(e).then(t)}}},BN=function(t){return function(e){return function(){return Promise.all([Promise.resolve().then(e),Promise.resolve().then(t)]).then(function(r){var n=r[0],o=r[1];return n(o)})}}},er=function(t){return function(){return Promise.resolve(t)}},Tp=function(t){return function(e){return function(){return Promise.resolve().then(e).then(function(r){return t(r)()})}}},tnt=Tp(j),vr="Task";function ent(){return{concat:function(t,e){return function(){return Promise.race([Promise.resolve().then(t),Promise.resolve().then(e)])}},empty:qN}}var Ot={URI:vr,map:Kn},rnt=Et(Ot),mr={URI:vr,of:er},Ou={URI:vr,map:Kn,ap:Iu},nnt=le(Ou),ont=pe(Ou),Ip={URI:vr,map:Kn,ap:Iu,of:er},jv={URI:vr,map:Kn,ap:w0},zN={URI:vr,map:Kn,ap:w0,of:er},Ks={URI:vr,map:Kn,ap:Iu,chain:qs},Pe={URI:vr,map:Kn,of:er,ap:Iu,chain:qs},int={URI:vr,map:Kn,of:er,ap:Iu,chain:qs,fromIO:hr},Op=j,ant={URI:vr,map:Kn,of:er,ap:Iu,chain:qs,fromIO:hr,fromTask:Op},unt=Xt(Ks),Bv={URI:vr,fromIO:hr},cnt=ti(Bv),snt=na(Bv,Ks),fnt=oa(Bv,Ks),lnt={URI:vr,fromIO:hr,fromTask:Op},qN=function(){return new Promise(function(t){})},pnt=er(xe),dnt=he(Ot),hnt=ve(Ks),vnt=de(Ou),A0=er(Ze),Vs=function(t){return function(e){return function(){return Promise.all(e.map(function(r,n){return Promise.resolve().then(function(){return t(n,r)()})}))}}},C0=function(t){var e=Vs(t);return function(r){return Qt(r)?e(r):A0}},x0=function(t){return function(e){return function(){return Dc(e).reduce(function(r,n,o){return r.then(function(i){return Promise.resolve().then(t(o+1,n)).then(function(a){return i.push(a),i})})},Promise.resolve().then(t(0,qr(e))).then(nl))}}},k0=function(t){var e=x0(t);return function(r){return Qt(r)?e(r):A0}},mnt=C0,KN=function(t){return C0(function(e,r){return t(r)})},gnt=KN(j),ynt=k0,VN=function(t){return k0(function(e,r){return t(r)})},bnt=VN(j),$nt={URI:vr,map:Kn,of:er,ap:Iu,chain:qs,fromIO:hr,fromTask:Op},_nt={URI:vr,map:Kn,of:er,ap:w0,chain:qs,fromIO:hr,fromTask:Op},Snt=Oe(jv),Tnt=dn(zN),Int=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module",fromIO:hr,delay:Qrt,map:pa,ap:BN,of:er,chain:Tp,flatten:tnt,URI:vr,getRaceMonoid:ent,Functor:Ot,flap:rnt,Pointed:mr,ApplyPar:Ou,apFirst:nnt,apSecond:ont,ApplicativePar:Ip,ApplySeq:jv,ApplicativeSeq:zN,Chain:Ks,Monad:Pe,MonadIO:int,fromTask:Op,MonadTask:ant,chainFirst:unt,FromIO:Bv,fromIOK:cnt,chainIOK:snt,chainFirstIOK:fnt,FromTask:lnt,never:qN,Do:pnt,bindTo:dnt,bind:hnt,apS:vnt,ApT:A0,traverseReadonlyNonEmptyArrayWithIndex:Vs,traverseReadonlyArrayWithIndex:C0,traverseReadonlyNonEmptyArrayWithIndexSeq:x0,traverseReadonlyArrayWithIndexSeq:k0,traverseArrayWithIndex:mnt,traverseArray:KN,sequenceArray:gnt,traverseSeqArrayWithIndex:ynt,traverseSeqArray:VN,sequenceSeqArray:bnt,task:$nt,taskSeq:_nt,getSemigroup:Snt,getMonoid:Tnt}),HN=E0(mr),Hs=$o,Mu=H(hr,Hs),Ont=rp,JN=np,Mnt=JN,Vn=function(t,e){return v(t,F0(e))},Ru=function(t,e){return v(t,N0(e))},W0=function(t,e){return v(t,zv(function(r){return v(e,F0(r))}))},Js=function(t,e){return v(t,zv(e))},F0=O0(Ot),N0=M0(Ou),Rnt=N0,_n=I0(mr),zv=R0(Pe),GN=zv,YN=GN(j),Ent=YN,rr="ReaderTask",De={URI:rr,map:Vn},wnt=Et(De),P0={URI:rr,of:_n},Mp={URI:rr,map:Vn,ap:Ru},Ant=le(Mp),Cnt=pe(Mp),xnt={URI:rr,map:Vn,ap:Ru,of:_n},D0={URI:rr,map:Vn,ap:W0},XN={URI:rr,map:Vn,ap:W0,of:_n},Oo={URI:rr,map:Vn,ap:Ru,chain:Js},da={URI:rr,map:Vn,of:_n,ap:Ru,chain:Js},knt={URI:rr,map:Vn,of:_n,ap:Ru,chain:Js,fromIO:Mu},Wnt={URI:rr,map:Vn,of:_n,ap:Ru,chain:Js,fromIO:Mu,fromTask:Hs},ZN=Xt(Oo),Fnt=ZN,qv={URI:rr,fromIO:Mu},Nnt=ti(qv),Pnt=na(qv,Oo),Dnt=oa(qv,Oo),Gs={URI:rr,fromReader:HN},Lnt=ip(Gs),Unt=ap(Gs),jnt=bu(Gs),QN=up(Gs,Oo),Bnt=QN,tP=cp(Gs,Oo),znt=tP,Kv={URI:rr,fromIO:Mu,fromTask:Hs},qnt=$u(Kv),Knt=Es(Kv,Oo),Vnt=ws(Kv,Oo),Hnt=_n(xe),Jnt=he(De),eP=ve(Oo),Gnt=eP,rP=de(Mp),Ynt=rP,L0=_n(Ze),nP=function(t){return H(yu(t),gu(Vs(zr)))},U0=function(t){var e=nP(t);return function(r){return Qt(r)?e(r):L0}},oP=function(t){return H(yu(t),gu(x0(zr)))},j0=function(t){var e=oP(t);return function(r){return Qt(r)?e(r):L0}},Xnt=U0,iP=function(t){return U0(function(e,r){return t(r)})},Znt=iP(j),Qnt=j0,aP=function(t){return j0(function(e,r){return t(r)})},tot=aP(j),eot={URI:rr,map:Vn,of:_n,ap:Ru,chain:Js,fromIO:Mu,fromTask:Hs},rot={URI:rr,map:Vn,of:_n,ap:W0,chain:Js,fromIO:Mu,fromTask:Hs},not=Oe(D0),oot=dn(XN);function iot(t,e){return t(e)()}var aot=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module",fromReader:HN,fromTask:Hs,fromIO:Mu,local:Ont,asksReaderTaskW:JN,asksReaderTask:Mnt,map:F0,ap:N0,apW:Rnt,of:_n,chain:zv,chainW:GN,flattenW:YN,flatten:Ent,URI:rr,Functor:De,flap:wnt,Pointed:P0,ApplyPar:Mp,apFirst:Ant,apSecond:Cnt,ApplicativePar:xnt,ApplySeq:D0,ApplicativeSeq:XN,Chain:Oo,Monad:da,MonadIO:knt,MonadTask:Wnt,chainFirst:ZN,chainFirstW:Fnt,FromIO:qv,fromIOK:Nnt,chainIOK:Pnt,chainFirstIOK:Dnt,FromReader:Gs,ask:Lnt,asks:Unt,fromReaderK:jnt,chainReaderK:QN,chainReaderKW:Bnt,chainFirstReaderK:tP,chainFirstReaderKW:znt,FromTask:Kv,fromTaskK:qnt,chainTaskK:Knt,chainFirstTaskK:Vnt,Do:Hnt,bindTo:Jnt,bind:eP,bindW:Gnt,apS:rP,apSW:Ynt,ApT:L0,traverseReadonlyNonEmptyArrayWithIndex:nP,traverseReadonlyArrayWithIndex:U0,traverseReadonlyNonEmptyArrayWithIndexSeq:oP,traverseReadonlyArrayWithIndexSeq:j0,traverseArrayWithIndex:Xnt,traverseArray:iP,sequenceArray:Znt,traverseSeqArrayWithIndex:Qnt,traverseSeqArray:aP,sequenceSeqArray:tot,readerTask:eot,readerTaskSeq:rot,getSemigroup:not,getMonoid:oot,run:iot}),B0=ms(mr),z0=du(mr),Vv=gs(Ot),q0=ys(Ot),K0=H(hr,Vv),uP=H(hr,q0),ha=K0,Ys=Vv,V0=er,H0=hr,cP=function(t){return pa(bE(t))},sP=Zl(Ot),uot=sP,J0=Os(Pe),cot=J0,fP=J0,sot=fP,lP=Ms(Pe),fot=lP,pP=function(t,e){return function(){return t().then(ji,function(r){return Ho(e(r))})}},lot=function(t,e){return function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return pP(function(){return t.apply(void 0,r)},e)}},pot=ep(Ot),dP=hu(Pe),dot=dP,hP=Ql(Pe),hot=hP,vot=tp(Pe),mot=Rs(Ot),vP=function(t){var e=cP(t);return function(r){return H(r,e)}},got=function(t){return H(vP(t),Eu)},mP=function(t){return H(t,H0)},gP=function(t){return Q0(mP(t))},yot=gP,Le=function(t,e){return v(t,X0(e))},va=function(t,e){return v(t,Z0(e))},G0=function(t,e){return v(t,Eu(function(r){return v(e,X0(r))}))},ma=function(t,e){return v(t,Eu(e))},Hv=function(t,e,r){return v(t,yP(e,r))},Jv=function(t,e){return v(t,bP(e))},Y0=function(t,e){return v(t,tT(e))},X0=bs(Ot),yP=Ts(Ot),bP=Is(Ot),Z0=$s(Ou),bot=Z0,Eu=_s(Pe),Q0=Eu,$P=Q0(j),$ot=$P,tT=Ss(Pe),_ot=tT,Er=z0,Rp=B0,Gt="TaskEither";function eT(t,e){var r=Vo(t,zi(e));return{URI:Gt,_E:void 0,map:Le,ap:function(n,o){return v(n,r(o))},of:Er}}function _P(t){var e=Xl(Pe,t);return{URI:Gt,_E:void 0,map:Le,alt:function(r,n){return v(r,e(n))}}}var SP=function(t){var e=eu(t);return{URI:Gt,_E:void 0,compact:Qo(Ot,e),separate:ta(Ot,e,qi)}};function Sot(t){var e=Uc(t),r=SP(t),n=ea(Ot,e),o=ra(Ot,e),i=vu(Ot,e),a=mu(Ot,e);return{URI:Gt,_E:void 0,map:Le,compact:r.compact,separate:r.separate,filter:function(u,c){return v(u,n(c))},filterMap:function(u,c){return v(u,o(c))},partition:function(u,c){return v(u,i(c))},partitionMap:function(u,c){return v(u,a(c))}}}var rT={URI:Gt,map:Le},Tot=Et(rT),Iot={URI:Gt,of:Er},Gv={URI:Gt,map:Le,ap:va},Oot=le(Gv),Mot=pe(Gv),Rot={URI:Gt,map:Le,ap:va,of:Er},TP={URI:Gt,map:Le,ap:G0},IP={URI:Gt,map:Le,ap:G0,of:Er},Mo={URI:Gt,map:Le,ap:va,chain:ma},Eot={URI:Gt,map:Le,ap:va,chain:ma,of:Er},wot={URI:Gt,map:Le,ap:va,chain:ma,of:Er,fromIO:ha},Aot={URI:Gt,map:Le,ap:va,chain:ma,of:Er,fromIO:ha,fromTask:Ys},Cot={URI:Gt,map:Le,ap:va,chain:ma,of:Er,throwError:Rp},OP=Xt(Mo),xot=OP,kot={URI:Gt,bimap:Hv,mapLeft:Jv},Wot={URI:Gt,map:Le,alt:Y0},ga={URI:Gt,fromEither:V0},Fot=lo(ga),Not=po(ga),Pot=Xa(ga,Mo),MP=Za(ga,Mo),Dot=MP,Lot=Bi(ga),RP=Qa(ga,Mo),Uot=RP,jot=ho(ga),Yv={URI:Gt,fromIO:ha},Bot=ti(Yv),zot=na(Yv,Mo),qot=oa(Yv,Mo),Xv={URI:Gt,fromIO:ha,fromTask:Ys},Kot=$u(Xv),Vot=Es(Xv,Mo),Hot=ws(Xv,Mo);function Jot(t){return function(){var e=Array.prototype.slice.call(arguments);return function(){return new Promise(function(r){var n=function(o,i){return o!=null?r(Ho(o)):r(ji(i))};t.apply(null,e.concat(n))})}}}var EP=function(t,e,r){return v(t,Eu(function(n){return v(e(n),Tp(function(o){return v(r(n,o),Eu(function(){return er(o)}))}))}))},Got=Er(xe),Yot=he(rT),wP=ve(Mo),Xot=wP,AP=de(Gv),Zot=AP,nT=Er(Ze),oT=function(t){return H(Vs(t),pa(dl(zr)))},iT=function(t){var e=oT(t);return function(r){return Qt(r)?e(r):nT}},aT=function(t){return function(e){return function(){return Dc(e).reduce(function(r,n,o){return r.then(function(i){return Me(i)?r:t(o+1,n)().then(function(a){return Me(a)?a:(i.right.push(a.right),i)})})},t(0,qr(e))().then(ru(nl)))}}},uT=function(t){var e=aT(t);return function(r){return Qt(r)?e(r):nT}},Qot=iT,CP=function(t){return iT(function(e,r){return t(r)})},tit=CP(j),eit=uT,xP=function(t){return uT(function(e,r){return t(r)})},rit=xP(j),nit={URI:Gt,bimap:Hv,mapLeft:Jv,map:Le,of:Er,ap:va,chain:ma,alt:Y0,fromIO:ha,fromTask:Ys,throwError:Rp},oit={URI:Gt,bimap:Hv,mapLeft:Jv,map:Le,of:Er,ap:G0,chain:ma,alt:Y0,fromIO:ha,fromTask:Ys,throwError:Rp},iit=Oe(TP),ait=dn(IP),uit=function(t){return Oe(jv)(sl(t))};function cit(t){var e=eT(Ip,t),r=_P(t);return{URI:Gt,_E:void 0,map:Le,ap:e.ap,of:Er,chain:ma,bimap:Hv,mapLeft:Jv,alt:r.alt,fromIO:ha,fromTask:Ys,throwError:Rp}}var sit=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module",left:B0,right:z0,rightTask:Vv,leftTask:q0,rightIO:K0,leftIO:uP,fromIO:ha,fromTask:Ys,fromEither:V0,fromIOEither:H0,fromTaskOption:cP,match:sP,matchW:uot,matchE:J0,fold:cot,matchEW:fP,foldW:sot,getOrElse:lP,getOrElseW:fot,tryCatch:pP,tryCatchK:lot,toUnion:pot,orElse:dP,orElseW:dot,orElseFirst:hP,orElseFirstW:hot,orLeft:vot,swap:mot,fromTaskOptionK:vP,chainTaskOptionK:got,fromIOEitherK:mP,chainIOEitherKW:gP,chainIOEitherK:yot,map:X0,bimap:yP,mapLeft:bP,ap:Z0,apW:bot,chain:Eu,chainW:Q0,flattenW:$P,flatten:$ot,alt:tT,altW:_ot,of:Er,throwError:Rp,URI:Gt,getApplicativeTaskValidation:eT,getAltTaskValidation:_P,getCompactable:SP,getFilterable:Sot,Functor:rT,flap:Tot,Pointed:Iot,ApplyPar:Gv,apFirst:Oot,apSecond:Mot,ApplicativePar:Rot,ApplySeq:TP,ApplicativeSeq:IP,Chain:Mo,Monad:Eot,MonadIO:wot,MonadTask:Aot,MonadThrow:Cot,chainFirst:OP,chainFirstW:xot,Bifunctor:kot,Alt:Wot,FromEither:ga,fromOption:Fot,fromOptionK:Not,chainOptionK:Pot,chainEitherK:MP,chainEitherKW:Dot,fromPredicate:Lot,filterOrElse:RP,filterOrElseW:Uot,fromEitherK:jot,FromIO:Yv,fromIOK:Bot,chainIOK:zot,chainFirstIOK:qot,FromTask:Xv,fromTaskK:Kot,chainTaskK:Vot,chainFirstTaskK:Hot,taskify:Jot,bracket:EP,Do:Got,bindTo:Yot,bind:wP,bindW:Xot,apS:AP,apSW:Zot,ApT:nT,traverseReadonlyNonEmptyArrayWithIndex:oT,traverseReadonlyArrayWithIndex:iT,traverseReadonlyNonEmptyArrayWithIndexSeq:aT,traverseReadonlyArrayWithIndexSeq:uT,traverseArrayWithIndex:Qot,traverseArray:CP,sequenceArray:tit,traverseSeqArrayWithIndex:eit,traverseSeqArray:xP,sequenceSeqArray:rit,taskEither:nit,taskEitherSeq:oit,getApplySemigroup:iit,getApplyMonoid:ait,getSemigroup:uit,getTaskValidation:cit}),ya=$o,Zv=ms(P0),cT=du(P0),sT=H(Vv,ya),kP=H(q0,ya),fT=function(t){return H(t,z0)},WP=function(t){return H(t,B0)},FP=gs(De),fit=ys(De),lT=H(K0,ya),NP=H(uP,ya),PP=_n,DP=fT,ba=lT,Xs=sT,pT=H(H0,ya),dT=function(t){return H(t,V0)},LP=Zl(De),lit=LP,hT=Os(Oo),pit=hT,UP=hT,dit=UP,jP=Ms(da),hit=jP,vit=ep(De),mit=rp,BP=np,git=BP,zP=hu(da),yit=zP,qP=Ql(da),bit=qP,$it=tp(da),_it=Rs(De),KP=function(t){return H(t,pT)},VP=function(t){return Zs(KP(t))},Sit=VP,vT=function(t){return H(t,ya)},HP=function(t){return Zs(vT(t))},Tit=HP,JP=function(t){return om(vT(t))},Iit=JP,mT=function(t){return H(t,dT)},GP=function(t){return Zs(mT(t))},Oit=GP,YP=function(t){return om(mT(t))},Mit=YP,Ue=function(t,e){return v(t,Ep(e))},$a=function(t,e){return v(t,_T(e))},gT=function(t,e){return v(t,em(function(r){return v(e,Ep(r))}))},_a=function(t,e){return v(t,em(e))},yT=function(t,e){return v(t,rm(e))},Qv=function(t,e,r){return v(t,bT(e,r))},tm=function(t,e){return v(t,$T(e))},Ep=bs(De),bT=Ts(De),$T=Is(De),_T=$s(Mp),Rit=_T,wr=cT,em=_s(da),Zs=em,XP=Zs(j),Eit=XP,rm=Ss(da),ZP=rm,wp=Zv,Vt="ReaderTaskEither",QP=function(t){var e=eu(t);return{URI:Vt,_E:void 0,compact:Qo(De,e),separate:ta(De,e,qi)}};function wit(t){var e=Uc(t),r=QP(t),n=ea(De,e),o=ra(De,e),i=vu(De,e),a=mu(De,e);return{URI:Vt,_E:void 0,map:Ue,compact:r.compact,separate:r.separate,filter:function(u,c){return v(u,n(c))},filterMap:function(u,c){return v(u,o(c))},partition:function(u,c){return v(u,i(c))},partitionMap:function(u,c){return v(u,a(c))}}}function tD(t,e){var r=Vo(ri,eT(t,e));return{URI:Vt,_E:void 0,map:Ue,ap:function(n,o){return v(n,r(o))},of:wr}}function eD(t){var e=Xl(da,t);return{URI:Vt,_E:void 0,map:Ue,alt:function(r,n){return v(r,e(n))}}}var wu={URI:Vt,map:Ue},Ait=Et(wu),ST={URI:Vt,of:wr},nm={URI:Vt,map:Ue,ap:$a},Cit=le(nm),xit=pe(nm),kit={URI:Vt,map:Ue,ap:$a,of:wr},rD={URI:Vt,map:Ue,ap:gT},nD={URI:Vt,map:Ue,ap:gT,of:wr},Ar={URI:Vt,map:Ue,ap:$a,chain:_a},Wit={URI:Vt,map:Ue,ap:$a,chain:_a,of:wr},Fit={URI:Vt,map:Ue,ap:$a,chain:_a,of:wr,fromIO:ba},Nit={URI:Vt,map:Ue,ap:$a,chain:_a,of:wr,fromIO:ba,fromTask:Xs},Pit={URI:Vt,map:Ue,ap:$a,chain:_a,of:wr,throwError:wp},oD=Xt(Ar),om=oD,Dit={URI:Vt,bimap:Qv,mapLeft:tm},Lit={URI:Vt,map:Ue,alt:yT},Qs={URI:Vt,fromReader:DP},Uit=ip(Qs),jit=ap(Qs),Bit=bu(Qs),iD=up(Qs,Ar),zit=iD,aD=cp(Qs,Ar),qit=aD,TT=function(t){return function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return FP(t.apply(void 0,e))}},uD=function(t){return Zs(TT(t))},Kit=uD,cD=function(t){return om(TT(t))},Vit=cD,Sa={URI:Vt,fromEither:PP},Hit=lo(Sa),Jit=po(Sa),Git=Xa(Sa,Ar),sD=Za(Sa,Ar),Yit=sD,Xit=Bi(Sa),fD=Qa(Sa,Ar),Zit=fD,Qit=ho(Sa),im={URI:Vt,fromIO:ba},tat=ti(im),eat=na(im,Ar),rat=oa(im,Ar),am={URI:Vt,fromIO:ba,fromTask:Xs},nat=$u(am),oat=Es(am,Ar),iat=ws(am,Ar);function aat(t,e,r){return function(n){return EP(t(n),function(o){return e(o)(n)},function(o,i){return r(o,i)(n)})}}var uat=wr(xe),cat=he(wu),lD=ve(Ar),sat=lD,pD=de(nm),fat=pD,IT=wr(Ze),dD=function(t){return H(yu(t),gu(oT(zr)))},OT=function(t){var e=dD(t);return function(r){return Qt(r)?e(r):IT}},hD=function(t){return H(yu(t),gu(aT(zr)))},MT=function(t){var e=hD(t);return function(r){return Qt(r)?e(r):IT}},lat=OT,vD=function(t){return OT(function(e,r){return t(r)})},pat=vD(j),dat=MT,mD=function(t){return MT(function(e,r){return t(r)})},hat=mD(j),vat={URI:Vt,map:Ue,of:wr,ap:$a,chain:_a,alt:yT,bimap:Qv,mapLeft:tm,fromIO:ba,fromTask:Xs,throwError:wp},mat={URI:Vt,map:Ue,of:wr,ap:gT,chain:_a,alt:yT,bimap:Qv,mapLeft:tm,fromIO:ba,fromTask:Xs,throwError:wp},gat=Oe(rD),yat=dn(nD),bat=function(t){return Oe(D0)(sl(t))};function $at(t){var e=tD(Ip,t),r=eD(t);return{URI:Vt,_E:void 0,map:Ue,of:wr,chain:_a,bimap:Qv,mapLeft:tm,ap:e.ap,alt:r.alt,fromIO:ba,fromTask:Xs,throwError:wp}}function _at(t,e){return t(e)()}var Sat=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module",fromTaskEither:ya,left:Zv,right:cT,rightTask:sT,leftTask:kP,rightReader:fT,leftReader:WP,rightReaderTask:FP,leftReaderTask:fit,rightIO:lT,leftIO:NP,fromEither:PP,fromReader:DP,fromIO:ba,fromTask:Xs,fromIOEither:pT,fromReaderEither:dT,match:LP,matchW:lit,matchE:hT,fold:pit,matchEW:UP,foldW:dit,getOrElse:jP,getOrElseW:hit,toUnion:vit,local:mit,asksReaderTaskEitherW:BP,asksReaderTaskEither:git,orElse:zP,orElseW:yit,orElseFirst:qP,orElseFirstW:bit,orLeft:$it,swap:_it,fromIOEitherK:KP,chainIOEitherKW:VP,chainIOEitherK:Sit,fromTaskEitherK:vT,chainTaskEitherKW:HP,chainTaskEitherK:Tit,chainFirstTaskEitherKW:JP,chainFirstTaskEitherK:Iit,fromReaderEitherK:mT,chainReaderEitherKW:GP,chainReaderEitherK:Oit,chainFirstReaderEitherKW:YP,chainFirstReaderEitherK:Mit,map:Ep,bimap:bT,mapLeft:$T,ap:_T,apW:Rit,of:wr,chain:em,chainW:Zs,flattenW:XP,flatten:Eit,alt:rm,altW:ZP,throwError:wp,URI:Vt,getCompactable:QP,getFilterable:wit,getApplicativeReaderTaskValidation:tD,getAltReaderTaskValidation:eD,Functor:wu,flap:Ait,Pointed:ST,ApplyPar:nm,apFirst:Cit,apSecond:xit,ApplicativePar:kit,ApplySeq:rD,ApplicativeSeq:nD,Chain:Ar,Monad:Wit,MonadIO:Fit,MonadTask:Nit,MonadThrow:Pit,chainFirst:oD,chainFirstW:om,Bifunctor:Dit,Alt:Lit,FromReader:Qs,ask:Uit,asks:jit,fromReaderK:Bit,chainReaderK:iD,chainReaderKW:zit,chainFirstReaderK:aD,chainFirstReaderKW:qit,fromReaderTaskK:TT,chainReaderTaskKW:uD,chainReaderTaskK:Kit,chainFirstReaderTaskKW:cD,chainFirstReaderTaskK:Vit,FromEither:Sa,fromOption:Hit,fromOptionK:Jit,chainOptionK:Git,chainEitherK:sD,chainEitherKW:Yit,fromPredicate:Xit,filterOrElse:fD,filterOrElseW:Zit,fromEitherK:Qit,FromIO:im,fromIOK:tat,chainIOK:eat,chainFirstIOK:rat,FromTask:am,fromTaskK:nat,chainTaskK:oat,chainFirstTaskK:iat,bracket:aat,Do:uat,bindTo:cat,bind:lD,bindW:sat,apS:pD,apSW:fat,ApT:IT,traverseReadonlyNonEmptyArrayWithIndex:dD,traverseReadonlyArrayWithIndex:OT,traverseReadonlyNonEmptyArrayWithIndexSeq:hD,traverseReadonlyArrayWithIndexSeq:MT,traverseArrayWithIndex:lat,traverseArray:vD,sequenceArray:pat,traverseSeqArrayWithIndex:dat,traverseSeqArray:mD,sequenceSeqArray:hat,readerTaskEither:vat,readerTaskEitherSeq:mat,getApplySemigroup:gat,getApplyMonoid:yat,getSemigroup:bat,getReaderTaskValidation:$at,run:_at}),gD={equals:function(t,e){return t===e}},yD={concat:function(t,e){return t+e}},Tat={concat:yD.concat,empty:""},V={equals:gD.equals,compare:function(t,e){return t<e?-1:t>e?1:0}},Iat={show:function(t){return JSON.stringify(t)}},Oat=function(t){return typeof t=="string"},Mat=function(t){return t.toUpperCase()},Rat=function(t){return t.toLowerCase()},Eat=function(t,e){return function(r){return r.replace(t,e)}},wat=function(t){return t.trim()},Aat=function(t){return t.trimLeft()},Cat=function(t){return t.trimRight()},xat=function(t,e){return function(r){return r.slice(t,e)}},kat="",Wat=function(t){return t.length===0},Fat=function(t){return t.length},Nat=function(t){return function(e){var r=e.split(t);return go(r)?r:[e]}},Pat=function(t,e){return function(r){return r.includes(t,e)}},Dat=function(t,e){return function(r){return r.startsWith(t,e)}},Lat=function(t,e){return function(r){return r.endsWith(t,e)}},Uat=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module",Eq:gD,Semigroup:yD,Monoid:Tat,Ord:V,Show:Iat,isString:Oat,toUpperCase:Mat,toLowerCase:Rat,replace:Eat,trim:wat,trimLeft:Aat,trimRight:Cat,slice:xat,empty:kat,isEmpty:Wat,size:Fat,split:Nat,includes:Pat,startsWith:Dat,endsWith:Lat}),jat=function(t){return Object.assign({},t)},Bat=function(t){return Object.assign({},t)},bD=function(t){return Object.keys(t).length},Hn=function(t){for(var e in t)if(re.call(t,e))return!1;return!0},tf=function(t){return function(e){return Object.keys(e).sort(t.compare)}},zat=tf(V);function um(t){if(typeof t=="function")return um(V)(t);var e=tf(t);return function(r){return function(n){for(var o=[],i=0,a=e(n);i<a.length;i++){var u=a[i];o.push(r(u,n[u]))}return o}}}var cm=um(V)(function(t,e){return[t,e]});function qat(t){return function(e){var r=cm(e),n=r.length;return t.unfold(0,function(o){return o<n?ct([r[o],o+1]):lt})}}var RT=function(t,e){return function(r){if(re.call(r,t)&&r[t]===e)return r;var n=Object.assign({},r);return n[t]=e,n}},fi=function(t,e){return re.call(e,t)};function sm(t){return function(e){if(!re.call(e,t))return e;var r=Object.assign({},e);return delete r[t],r}}var Kat=function(t,e){return function(r){if(!fi(t,r))return lt;if(r[t]===e)return ct(r);var n=Object.assign({},r);return n[t]=e,ct(n)}},Vat=function(t,e){return function(r){if(!fi(t,r))return lt;var n=e(r[t]);if(n===r[t])return ct(r);var o=Object.assign({},r);return o[t]=n,ct(o)}};function Hat(t){var e=sm(t);return function(r){var n=Au(t,r);return me(n)?lt:ct([n.value,e(r)])}}function fm(t){return function(e,r){if(r===void 0){var n=fm(t);return function(i){return n(i,e)}}for(var o in e)if(!re.call(r,o)||!t.equals(e[o],r[o]))return!1;return!0}}function Au(t,e){return e===void 0?function(r){return Au(t,r)}:re.call(e,t)?ct(e[t]):lt}var Ap={};function lm(t){return function(e){var r={};for(var n in e)re.call(e,n)&&(r[n]=t(n,e[n]));return r}}function ET(t){return lm(function(e,r){return t(r)})}function ef(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];if(t.length===2)return ef(V).apply(void 0,t);var r=tf(t[0]);return function(n,o){return function(i){for(var a=n,u=r(i),c=u.length,s=0;s<c;s++){var f=u[s];a=o(f,a,i[f])}return a}}}function rf(t){if("compare"in t){var e=tf(t);return function(r){return function(n){return function(o){for(var i=r.empty,a=e(o),u=a.length,c=0;c<u;c++){var s=a[c];i=r.concat(i,n(s,o[s]))}return i}}}}return rf(V)(t)}function nf(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];if(t.length===2)return nf(V).apply(void 0,t);var r=tf(t[0]);return function(n,o){return function(i){for(var a=n,u=r(i),c=u.length,s=c-1;s>=0;s--){var f=u[s];a=o(f,i[f],a)}return a}}}var $D=function(t,e){var r;return r={},r[t]=e,r};function _D(t){var e=xp(V)(t);return function(r){return function(n){return e(n,r)}}}function pm(t){var e=Ro(V)(t);return function(r){return function(n){return e(n,r)}}}function of(t){return Cp(V)(t)}var Jat=function(t){var e=pm(t);return function(r){return function(n){return t.map(v(n,e(r)),li)}}},Gat=function(t){var e=pm(t);return function(r){return function(n){return t.map(v(n,e(r)),pi)}}};function dm(t){return function(e){var r={},n={};for(var o in e)if(re.call(e,o)){var i=t(o,e[o]);switch(i._tag){case"Left":r[o]=i.left;break;case"Right":n[o]=i.right;break}}return mt(r,n)}}function hm(t){return function(e){var r={},n={};for(var o in e)if(re.call(e,o)){var i=e[o];t(o,i)?n[o]=i:r[o]=i}return mt(r,n)}}function vm(t){return function(e){var r={};for(var n in e)if(re.call(e,n)){var o=t(n,e[n]);Zt(o)&&(r[n]=o.value)}return r}}function af(t){return function(e){var r={},n=!1;for(var o in e)if(re.call(e,o)){var i=e[o];t(o,i)?r[o]=i:n=!0}return n?r:e}}function SD(t,e){var r=wT(t,e);return function(n){return r(n,j)}}function wT(t,e){return function(r,n){return e.reduce(r,{},function(o,i){var a=n(i),u=a[0],c=a[1];return o[u]=re.call(o,u)?t.concat(o[u],c):c,o})}}function TD(t){return function(e){for(var r in e)if(!t(e[r]))return!1;return!0}}function ID(t){return function(e){for(var r in e)if(t(e[r]))return!0;return!1}}function AT(t){return function(e,r){if(r===void 0){var n=AT(t);return function(i){return n(e,i)}}for(var o in r)if(t.equals(r[o],e))return!0;return!1}}var CT=function(t){return function(e){return function(r){if(Hn(r))return e;if(Hn(e))return r;var n={};for(var o in r)fi(o,e)?n[o]=t.concat(r[o],e[o]):n[o]=r[o];for(var o in e)fi(o,n)||(n[o]=e[o]);return n}}},xT=function(t){return function(e){return function(r){if(Hn(r)||Hn(e))return Ap;var n={};for(var o in r)fi(o,e)&&(n[o]=t.concat(r[o],e[o]));return n}}},kT=function(t){return function(e){if(Hn(e))return t;if(Hn(t))return e;var r={};for(var n in e)fi(n,t)||(r[n]=e[n]);for(var n in t)fi(n,e)||(r[n]=t[n]);return r}},Jr=function(t,e){return v(t,ET(e))},Cu=function(t,e){return v(t,lm(e))},Gr=function(t){var e=kp(t);return function(r,n,o){return v(r,e(n,o))}},Yr=function(t){return function(e){var r=Wp(t)(e);return function(n,o){return v(n,r(o))}}},Xr=function(t){var e=Fp(t);return function(r,n,o){return v(r,e(n,o))}},xu=function(t,e){return v(t,$m(e))},ku=function(t,e){return v(t,WT(e))},Wu=function(t,e){return v(t,_m(e))},Fu=function(t,e){return v(t,FT(e))},Nu=function(t){var e=ef(t);return function(r,n,o){return v(r,e(n,o))}},Pu=function(t){var e=rf(t);return function(r){var n=e(r);return function(o,i){return v(o,n(i))}}},Du=function(t){var e=nf(t);return function(r,n,o){return v(r,e(n,o))}},mm=function(t,e){return v(t,dm(e))},gm=function(t,e){return v(t,hm(e))},ym=function(t,e){return v(t,vm(e))},bm=function(t,e){return v(t,af(e))},Ro=function(t){var e=xp(t);return function(r){var n=e(r);return function(o,i){return n(o,H(zr,i))}}},Cp=function(t){var e=Ro(t);return function(r){var n=e(r);return function(o){return n(o,j)}}},xp=function(t){return function(e){var r=tf(t);return function(n,o){var i=r(n);if(i.length===0)return e.of(Ap);for(var a=e.of({}),u=function(l){a=e.ap(e.map(a,function(p){return function(d){return p[l]=d,p}}),o(l,n[l]))},c=0,s=i;c<s.length;c++){var f=s[c];u(f)}return a}}},$m=function(t){return af(function(e,r){return t(r)})},WT=function(t){return vm(function(e,r){return t(r)})},_m=function(t){return hm(function(e,r){return t(r)})},FT=function(t){return dm(function(e,r){return t(r)})};function kp(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];if(t.length===1){var r=ef(t[0]);return function(n,o){return r(n,function(i,a,u){return o(a,u)})}}return kp(V).apply(void 0,t)}function Wp(t){if("compare"in t){var e=rf(t);return function(r){var n=e(r);return function(o){return n(function(i,a){return o(a)})}}}return Wp(V)(t)}function Fp(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];if(t.length===1){var r=nf(t[0]);return function(n,o){return r(n,function(i,a,u){return o(a,u)})}}return Fp(V).apply(void 0,t)}var li=function(t){var e={};for(var r in t)if(re.call(t,r)){var n=t[r];Zt(n)&&(e[r]=n.value)}return e},pi=function(t){var e={},r={};for(var n in t)if(re.call(t,n)){var o=t[n];Me(o)?e[n]=o.left:r[n]=o.right}return mt(e,r)},je="ReadonlyRecord";function Sm(t){return"compare"in t?function(e){return{show:function(r){var n=um(t)(function(o,i){return JSON.stringify(o)+": "+e.show(i)})(r).join(", ");return n===""?"{}":"{ "+n+" }"}}}:Sm(V)(t)}function OD(t){var e=fm(t);return vn(function(r,n){return e(r)(n)&&e(n)(r)})}function MD(t){return{concat:function(e,r){if(Hn(e))return r;if(Hn(r))return e;var n=Object.assign({},e);for(var o in r)re.call(r,o)&&(n[o]=re.call(e,o)?t.concat(e[o],r[o]):r[o]);return n},empty:Ap}}var RD={URI:je,map:Jr},Yat=Et(RD),Xat={URI:je,map:Jr,mapWithIndex:Cu},Zat=function(t){return{URI:je,reduce:Gr(t),foldMap:Yr(t),reduceRight:Xr(t)}},Qat=function(t){return{URI:je,reduce:Gr(t),foldMap:Yr(t),reduceRight:Xr(t),reduceWithIndex:Nu(t),foldMapWithIndex:Pu(t),reduceRightWithIndex:Du(t)}},Np={URI:je,compact:li,separate:pi},tut={URI:je,map:Jr,compact:li,separate:pi,filter:xu,filterMap:ku,partition:Wu,partitionMap:Fu},eut={URI:je,map:Jr,mapWithIndex:Cu,compact:li,separate:pi,filter:xu,filterMap:ku,partition:Wu,partitionMap:Fu,filterMapWithIndex:ym,filterWithIndex:bm,partitionMapWithIndex:mm,partitionWithIndex:gm},ED=function(t){return{URI:je,map:Jr,reduce:Gr(t),foldMap:Yr(t),reduceRight:Xr(t),traverse:Ro(t),sequence:Cp(t)}},rut=function(t){return{URI:je,map:Jr,mapWithIndex:Cu,reduce:Gr(t),foldMap:Yr(t),reduceRight:Xr(t),reduceWithIndex:Nu(t),foldMapWithIndex:Pu(t),reduceRightWithIndex:Du(t),traverse:Ro(t),sequence:Cp(t),traverseWithIndex:xp(t)}},nut=function(t){var e=ED(t);return{URI:je,map:Jr,reduce:Gr(t),foldMap:Yr(t),reduceRight:Xr(t),traverse:e.traverse,sequence:e.sequence,compact:li,separate:pi,filter:xu,filterMap:ku,partition:Wu,partitionMap:Fu,wither:Nn(e,Np),wilt:Fn(e,Np)}},wD=function(t){var e=CT(t);return{concat:function(r,n){return e(n)(r)}}},out=function(t){return{concat:wD(t).concat,empty:Ap}},iut=function(t){var e=xT(t);return{concat:function(r,n){return e(n)(r)}}},aut=function(){return{concat:function(t,e){return kT(e)(t)}}},uut={URI:je,reduce:Gr(V),foldMap:Yr(V),reduceRight:Xr(V)},cut={URI:je,reduce:Gr(V),foldMap:Yr(V),reduceRight:Xr(V),reduceWithIndex:Nu(V),foldMapWithIndex:Pu(V),reduceRightWithIndex:Du(V)},NT={URI:je,map:Jr,reduce:Gr(V),foldMap:Yr(V),reduceRight:Xr(V),traverse:Ro(V),sequence:of},sut={URI:je,map:Jr,mapWithIndex:Cu,reduce:Gr(V),foldMap:Yr(V),reduceRight:Xr(V),reduceWithIndex:Nu(V),foldMapWithIndex:Pu(V),reduceRightWithIndex:Du(V),traverse:Ro(V),sequence:of,traverseWithIndex:xp(V)},AD=Nn(NT,Np),CD=Fn(NT,Np),fut={URI:je,map:Jr,reduce:Gr(V),foldMap:Yr(V),reduceRight:Xr(V),traverse:Ro(V),sequence:of,compact:li,separate:pi,filter:xu,filterMap:ku,partition:Wu,partitionMap:Fu,wither:AD,wilt:CD},PT=RT;function xD(t,e){return re.call(e===void 0?this:e,t)}var lut={URI:je,map:Jr,reduce:Gr(V),foldMap:Yr(V),reduceRight:Xr(V),traverse:Ro(V),sequence:of,compact:li,separate:pi,filter:xu,filterMap:ku,partition:Wu,partitionMap:Fu,mapWithIndex:Cu,reduceWithIndex:Nu(V),foldMapWithIndex:Pu(V),reduceRightWithIndex:Du(V),filterMapWithIndex:ym,filterWithIndex:bm,partitionMapWithIndex:mm,partitionWithIndex:gm,traverseWithIndex:xp(V),wither:AD,wilt:CD},put=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module",fromRecord:jat,toRecord:Bat,size:bD,isEmpty:Hn,keys:zat,collect:um,toReadonlyArray:cm,toUnfoldable:qat,upsertAt:RT,has:fi,deleteAt:sm,updateAt:Kat,modifyAt:Vat,pop:Hat,isSubrecord:fm,lookup:Au,empty:Ap,mapWithIndex:lm,map:ET,reduceWithIndex:ef,foldMapWithIndex:rf,reduceRightWithIndex:nf,singleton:$D,traverseWithIndex:_D,traverse:pm,sequence:of,wither:Jat,wilt:Gat,partitionMapWithIndex:dm,partitionWithIndex:hm,filterMapWithIndex:vm,filterWithIndex:af,fromFoldable:SD,fromFoldableMap:wT,every:TD,some:ID,elem:AT,union:CT,intersection:xT,difference:kT,_map:Jr,_mapWithIndex:Cu,_reduce:Gr,_foldMap:Yr,_reduceRight:Xr,_filter:xu,_filterMap:ku,_partition:Wu,_partitionMap:Fu,_reduceWithIndex:Nu,_foldMapWithIndex:Pu,_reduceRightWithIndex:Du,_partitionMapWithIndex:mm,_partitionWithIndex:gm,_filterMapWithIndex:ym,_filterWithIndex:bm,_traverse:Ro,_sequence:Cp,filter:$m,filterMap:WT,partition:_m,partitionMap:FT,reduce:kp,foldMap:Wp,reduceRight:Fp,compact:li,separate:pi,URI:je,getShow:Sm,getEq:OD,getMonoid:MD,Functor:RD,flap:Yat,FunctorWithIndex:Xat,getFoldable:Zat,getFoldableWithIndex:Qat,Compactable:Np,Filterable:tut,FilterableWithIndex:eut,getTraversable:ED,getTraversableWithIndex:rut,getWitherable:nut,getUnionSemigroup:wD,getUnionMonoid:out,getIntersectionSemigroup:iut,getDifferenceMagma:aut,Foldable:uut,FoldableWithIndex:cut,Traversable:NT,TraversableWithIndex:sut,Witherable:fut,insertAt:PT,hasOwnProperty:xD,readonlyRecord:lut}),dut=function(t){return new Set(t)},hut=function(t){return new Set([t])},kD=function(t){return function(e){for(var r=e.length,n=new Set,o=Be(t),i=0;i<r;i++){var a=e[i];o(a,n)||n.add(a)}return n}};function vut(t){return new Set(t)}function mut(t){var e=Be(t);return function(r){return function(n){var o=new Set;return n.forEach(function(i){var a=r(i);e(a,o)||o.add(a)}),o}}}function gut(t){var e=Be(t);return function(r){return function(n){var o=new Set;return n.forEach(function(i){r(i).forEach(function(a){e(a,o)||o.add(a)})}),o}}}function DT(t){return function(e){for(var r=e.values(),n,o=new Set;!(n=r.next()).done;){var i=n.value;t(i)&&o.add(i)}return o}}function yut(t){return function(e){for(var r=e.values(),n,o=new Set,i=new Set;!(n=r.next()).done;){var a=n.value;t(a)?o.add(a):i.add(a)}return mt(i,o)}}function LT(t){var e=Be(t);return function(r,n){if(n===void 0){var o=LT(t);return function(a){return o(r,a)}}if(Pp(r))return n;if(Pp(n))return r;var i=new Set(r);return n.forEach(function(a){e(a,i)||i.add(a)}),i}}function UT(t){var e=Be(t);return function(r,n){if(n===void 0){var o=UT(t);return function(a){return o(a,r)}}if(Pp(r)||Pp(n))return BT;var i=new Set;return r.forEach(function(a){e(a,n)&&i.add(a)}),i}}function but(t,e){return function(r){return function(n){for(var o=n.values(),i,a=new Set,u=new Set,c=Be(t),s=Be(e);!(i=o.next()).done;){var f=r(i.value);switch(f._tag){case"Left":c(f.left,a)||a.add(f.left);break;case"Right":s(f.right,u)||u.add(f.right);break}}return mt(a,u)}}}function jT(t){var e=Be(t);return function(r,n){if(n===void 0){var o=jT(t);return function(i){return o(i,r)}}return DT(function(i){return!e(i,n)})(r)}}function WD(t){var e=Tm(t);return function(r,n){return function(o){return e(o).reduce(n,r)}}}function FD(t,e){var r=Tm(t);return function(n){return function(o){return r(o).reduce(function(i,a){return e.concat(i,n(a))},e.empty)}}}var ND=function(t){var e=Tm(t);return function(r,n){return function(o){return e(o).reduceRight(function(i,a){return n(a,i)},r)}}};function PD(t){var e=Be(t);return function(r){return function(n){if(e(r)(n))return n;var o=new Set(n);return o.add(r),o}}}var DD=function(t){return function(e){return function(r){return DT(function(n){return!t.equals(e,n)})(r)}}},$ut=function(t){var e=Be(t),r=DD(t),n=PD(t);return function(o){return function(i){return(e(o,i)?r:n)(o)(i)}}},_ut=function(t){return LD(t)(j)};function Sut(t,e){return function(r){var n=Be(t),o=Be(e),i=new Set,a=new Set;return r.forEach(function(u){switch(u._tag){case"Left":n(u.left,i)||i.add(u.left);break;case"Right":o(u.right,a)||a.add(u.right);break}}),mt(i,a)}}function LD(t){var e=Be(t);return function(r){return function(n){var o=new Set;return n.forEach(function(i){var a=r(i);a._tag==="Some"&&!e(a.value,o)&&o.add(a.value)}),o}}}var BT=new Set,Pp=function(t){return t.size===0},Tut=function(t){return t.size},zT=function(t){return function(e){for(var r=e.values(),n,o=!1;!o&&!(n=r.next()).done;)o=t(n.value);return o}},qT=function(t){return zl(zT(zl(t)))};function Dp(t){var e=Be(t);return function(r,n){if(n===void 0){var o=Dp(t);return function(i){return o(i,r)}}return qT(function(i){return e(i,n)})(r)}}function Be(t){return function(e,r){if(r===void 0){var n=Be(t);return function(u){return n(e,u)}}for(var o=r.values(),i,a=!1;!a&&!(i=o.next()).done;)a=t.equals(e,i.value);return a}}var Tm=function(t){return function(e){var r=[];return e.forEach(function(n){return r.push(n)}),r.sort(t.compare)}},Iut="ReadonlySet";function UD(t){return{show:function(e){var r=[];return e.forEach(function(n){r.push(t.show(n))}),"new Set(["+r.sort().join(", ")+"])"}}}function jD(t){var e=Dp(t);return vn(function(r,n){return e(r,n)&&e(n,r)})}var BD=function(t){return{concat:LT(t)}},Out=function(t){return{concat:BD(t).concat,empty:BT}},Mut=function(t){return{concat:UT(t)}},Rut=function(t){return{concat:jT(t)}},Eut=kD,wut=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module",fromSet:dut,singleton:hut,fromReadonlyArray:kD,toSet:vut,map:mut,chain:gut,filter:DT,partition:yut,union:LT,intersection:UT,partitionMap:but,difference:jT,reduce:WD,foldMap:FD,reduceRight:ND,insert:PD,remove:DD,toggle:$ut,compact:_ut,separate:Sut,filterMap:LD,empty:BT,isEmpty:Pp,size:Tut,some:zT,every:qT,isSubset:Dp,elem:Be,toReadonlyArray:Tm,URI:Iut,getShow:UD,getEq:jD,getUnionSemigroup:BD,getUnionMonoid:Out,getIntersectionSemigroup:Mut,getDifferenceMagma:Rut,fromArray:Eut});function Ee(t){return t[0]}function nr(t){return t[1]}var Aut=function(t){return[nr(t),Ee(t)]};function KT(t){return{URI:Zr,_E:void 0,map:Lp,ap:function(e,r){return[Ee(e)(Ee(r)),t.concat(nr(e),nr(r))]}}}var zD=function(t){return function(e){return[e,t.empty]}};function Cut(t){var e=KT(t);return{URI:Zr,_E:void 0,map:e.map,ap:e.ap,of:zD(t)}}function VT(t){var e=KT(t);return{URI:Zr,_E:void 0,map:e.map,ap:e.ap,chain:function(r,n){var o=n(Ee(r)),i=o[0],a=o[1];return[i,t.concat(nr(r),a)]}}}function xut(t){var e=VT(t);return{URI:Zr,_E:void 0,map:e.map,ap:e.ap,chain:e.chain,of:zD(t)}}function kut(t){var e=function(n,o){for(var i=o(n),a=t.empty,u=Ee(i);u._tag==="Left";)a=t.concat(a,nr(i)),i=o(u.left),u=Ee(i);return[u.right,t.concat(a,nr(i))]},r=VT(t);return{URI:Zr,_E:void 0,map:r.map,ap:r.ap,chain:r.chain,chainRec:e}}var qD=function(t,e){return v(t,YD(e))},Lp=function(t,e){return v(t,YT(e))},KD=function(t,e,r){return v(t,GD(e,r))},VD=function(t,e){return v(t,XT(e))},HD=function(t,e){return v(t,ZT(e))},HT=function(t,e,r){return v(t,QT(e,r))},JT=function(t){var e=tI();return function(r,n){return v(r,e(n))}},GT=function(t,e,r){return v(t,eI(e,r))},JD=function(t){var e=XD(t);return function(r,n){return v(r,e(n))}},GD=function(t,e){return function(r){return[e(Ee(r)),t(nr(r))]}},YT=function(t){return function(e){return[t(Ee(e)),nr(e)]}},XT=function(t){return function(e){return[Ee(e),t(nr(e))]}},YD=function(t){return function(e){return[Ee(e),nr(t)]}},ZT=function(t){return function(e){return[t(e),nr(e)]}},Im=Ee,Wut=ZT(j),QT=function(t,e){return function(r){return e(t,Ee(r))}},tI=function(){return function(t){return function(e){return t(Ee(e))}}},eI=function(t,e){return function(r){return e(Ee(r),t)}},XD=function(t){return function(e){return function(r){return t.map(e(Ee(r)),function(n){return[n,nr(r)]})}}},rI=function(t){return function(e){return t.map(Ee(e),function(r){return[r,nr(e)]})}},Zr="ReadonlyTuple",ZD={URI:Zr,map:Lp},Fut=Et(ZD),Nut={URI:Zr,bimap:KD,mapLeft:VD},Put={URI:Zr,compose:qD},Dut={URI:Zr,map:Lp,extend:HD,extract:Im},Lut={URI:Zr,reduce:HT,foldMap:JT,reduceRight:GT},Uut={URI:Zr,map:Lp,reduce:HT,foldMap:JT,reduceRight:GT,traverse:JD,sequence:rI},jut=YT,But=XT,zut={URI:Zr,compose:qD,map:Lp,bimap:KD,mapLeft:VD,extract:Im,extend:HD,reduce:HT,foldMap:JT,reduceRight:GT,traverse:JD,sequence:rI},qut=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module",fst:Ee,snd:nr,swap:Aut,getApply:KT,getApplicative:Cut,getChain:VT,getMonad:xut,getChainRec:kut,bimap:GD,mapFst:YT,mapSnd:XT,compose:YD,extend:ZT,extract:Im,duplicate:Wut,reduce:QT,foldMap:tI,reduceRight:eI,traverse:XD,sequence:rI,URI:Zr,Functor:ZD,flap:Fut,Bifunctor:Nut,Semigroupoid:Put,Comonad:Dut,Foldable:Lut,Traversable:Uut,map:jut,mapLeft:But,readonlyTuple:zut}),uf=globalThis&&globalThis.__assign||function(){return uf=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++){e=arguments[r];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])}return t},uf.apply(this,arguments)},Kut=bD,Lu=Hn,nI=function(t){return function(e){return Object.keys(e).sort(t.compare)}},Vut=nI(V);function oI(t){if(typeof t=="function")return oI(V)(t);var e=nI(t);return function(r){return function(n){for(var o=[],i=0,a=e(n);i<a.length;i++){var u=a[i];o.push(r(u,n[u]))}return o}}}var QD=oI(V)(function(t,e){return[t,e]});function Hut(t){return function(e){var r=QD(e),n=r.length;return t.unfold(0,function(o){return o<n?ct([r[o],o+1]):lt})}}var tL=RT,eL=fi;function rL(t){return function(e){if(!re.call(e,t))return e;var r=Object.assign({},e);return delete r[t],r}}var Jut=function(t,e){return nL(t,function(){return e})},nL=function(t,e){return function(r){if(!eL(t,r))return lt;var n=Object.assign({},r);return n[t]=e(r[t]),ct(n)}};function Gut(t){var e=rL(t);return function(r){var n=oL(t,r);return me(n)?lt:ct([n.value,e(r)])}}var Yut=fm,oL=Au,Xut=lm,Zut=ET;function Qut(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return t.length===1?ef(t[0]):ef(V).apply(void 0,t)}function tct(t){return"compare"in t?rf(t):rf(V)(t)}function ect(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return t.length===1?nf(t[0]):nf(V).apply(void 0,t)}var rct=$D;function nct(t){return _D(t)}function iI(t){return pm(t)}function Up(t){return of(t)}var oct=function(t){var e=iI(t);return function(r){return function(n){return t.map(v(n,e(r)),Ta)}}},ict=function(t){var e=iI(t);return function(r){return function(n){return t.map(v(n,e(r)),Ia)}}},act=dm;function uct(t){return hm(t)}var cct=vm;function sct(t){return af(t)}function fct(t,e){return SD(t,e)}function lct(t,e){return wT(t,e)}var pct=TD,dct=ID,hct=AT,iL=function(t){var e=CT(t);return function(r){return function(n){return Lu(n)?uf({},r):Lu(r)?uf({},n):e(r)(n)}}},aL=function(t){return function(e){return function(r){return Lu(r)||Lu(e)?{}:xT(t)(e)(r)}}},uL=function(t){return function(e){return Lu(e)?uf({},t):Lu(t)?uf({},e):kT(t)(e)}},Jn=Jr,jp=Cu,Gn=Gr,Yn=Yr,Xn=Xr,Bp=xu,zp=ku,qp=Wu,Kp=Fu,Vp=Nu,Hp=Pu,Jp=Du,cL=mm,sL=gm,fL=ym,lL=bm,cf=Ro,pL=Cp,aI=function(t){return function(e){var r=nI(t);return function(n,o){var i=r(n);if(i.length===0)return e.of({});for(var a=e.of({}),u=function(l){a=e.ap(e.map(a,function(p){return function(d){return p[l]=d,p}}),o(l,n[l]))},c=0,s=i;c<s.length;c++){var f=s[c];u(f)}return a}}},vct=$m,mct=WT,gct=_m,yct=FT;function bct(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return t.length===1?kp(t[0]):kp(V).apply(void 0,t)}function $ct(t){return"compare"in t?Wp(t):Wp(V)(t)}function _ct(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return t.length===1?Fp(t[0]):Fp(V).apply(void 0,t)}var Ta=li,Ia=pi,ze="Record";function Sct(t){return"compare"in t?Sm(t):Sm(V)(t)}var Tct=OD,Ict=MD,dL={URI:ze,map:Jn},Oct=Et(dL),Mct={URI:ze,map:Jn,mapWithIndex:jp},Rct=function(t){return{URI:ze,reduce:Gn(t),foldMap:Yn(t),reduceRight:Xn(t)}},Ect=function(t){return{URI:ze,reduce:Gn(t),foldMap:Yn(t),reduceRight:Xn(t),reduceWithIndex:Vp(t),foldMapWithIndex:Hp(t),reduceRightWithIndex:Jp(t)}},Gp={URI:ze,compact:Ta,separate:Ia},wct={URI:ze,map:Jn,compact:Ta,separate:Ia,filter:Bp,filterMap:zp,partition:qp,partitionMap:Kp},Act={URI:ze,map:Jn,mapWithIndex:jp,compact:Ta,separate:Ia,filter:Bp,filterMap:zp,partition:qp,partitionMap:Kp,filterMapWithIndex:fL,filterWithIndex:lL,partitionMapWithIndex:cL,partitionWithIndex:sL},hL=function(t){return{URI:ze,map:Jn,reduce:Gn(t),foldMap:Yn(t),reduceRight:Xn(t),traverse:cf(t),sequence:pL(t)}},Cct=function(t){return{URI:ze,map:Jn,mapWithIndex:jp,reduce:Gn(t),foldMap:Yn(t),reduceRight:Xn(t),reduceWithIndex:Vp(t),foldMapWithIndex:Hp(t),reduceRightWithIndex:Jp(t),traverse:cf(t),sequence:pL(t),traverseWithIndex:aI(t)}},xct=function(t){var e=hL(t);return{URI:ze,map:Jn,reduce:Gn(t),foldMap:Yn(t),reduceRight:Xn(t),traverse:e.traverse,sequence:e.sequence,compact:Ta,separate:Ia,filter:Bp,filterMap:zp,partition:qp,partitionMap:Kp,wither:Nn(e,Gp),wilt:Fn(e,Gp)}},vL=function(t){var e=iL(t);return{concat:function(r,n){return e(n)(r)}}},kct=function(t){return{concat:vL(t).concat,empty:{}}},Wct=function(t){var e=aL(t);return{concat:function(r,n){return e(n)(r)}}},Fct=function(){return{concat:function(t,e){return uL(e)(t)}}},Nct={URI:ze,reduce:Gn(V),foldMap:Yn(V),reduceRight:Xn(V)},Pct={URI:ze,reduce:Gn(V),foldMap:Yn(V),reduceRight:Xn(V),reduceWithIndex:Vp(V),foldMapWithIndex:Hp(V),reduceRightWithIndex:Jp(V)},uI={URI:ze,map:Jn,reduce:Gn(V),foldMap:Yn(V),reduceRight:Xn(V),traverse:cf(V),sequence:Up},Dct={URI:ze,map:Jn,mapWithIndex:jp,reduce:Gn(V),foldMap:Yn(V),reduceRight:Xn(V),reduceWithIndex:Vp(V),foldMapWithIndex:Hp(V),reduceRightWithIndex:Jp(V),traverse:cf(V),sequence:Up,traverseWithIndex:aI(V)},mL=Nn(uI,Gp),gL=Fn(uI,Gp),Lct={URI:ze,map:Jn,reduce:Gn(V),foldMap:Yn(V),reduceRight:Xn(V),traverse:cf(V),sequence:Up,compact:Ta,separate:Ia,filter:Bp,filterMap:zp,partition:qp,partitionMap:Kp,wither:mL,wilt:gL},Uct={},jct=tL,Bct=xD,zct={URI:ze,map:Jn,reduce:Gn(V),foldMap:Yn(V),reduceRight:Xn(V),traverse:cf(V),sequence:Up,compact:Ta,separate:Ia,filter:Bp,filterMap:zp,partition:qp,partitionMap:Kp,mapWithIndex:jp,reduceWithIndex:Vp(V),foldMapWithIndex:Hp(V),reduceRightWithIndex:Jp(V),filterMapWithIndex:fL,filterWithIndex:lL,partitionMapWithIndex:cL,partitionWithIndex:sL,traverseWithIndex:aI(V),wither:mL,wilt:gL},qct=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module",size:Kut,isEmpty:Lu,keys:Vut,collect:oI,toArray:QD,toUnfoldable:Hut,upsertAt:tL,has:eL,deleteAt:rL,updateAt:Jut,modifyAt:nL,pop:Gut,isSubrecord:Yut,lookup:oL,mapWithIndex:Xut,map:Zut,reduceWithIndex:Qut,foldMapWithIndex:tct,reduceRightWithIndex:ect,singleton:rct,traverseWithIndex:nct,traverse:iI,sequence:Up,wither:oct,wilt:ict,partitionMapWithIndex:act,partitionWithIndex:uct,filterMapWithIndex:cct,filterWithIndex:sct,fromFoldable:fct,fromFoldableMap:lct,every:pct,some:dct,elem:hct,union:iL,intersection:aL,difference:uL,filter:vct,filterMap:mct,partition:gct,partitionMap:yct,reduce:bct,foldMap:$ct,reduceRight:_ct,compact:Ta,separate:Ia,URI:ze,getShow:Sct,getEq:Tct,getMonoid:Ict,Functor:dL,flap:Oct,FunctorWithIndex:Mct,getFoldable:Rct,getFoldableWithIndex:Ect,Compactable:Gp,Filterable:wct,FilterableWithIndex:Act,getTraversable:hL,getTraversableWithIndex:Cct,getWitherable:xct,getUnionSemigroup:vL,getUnionMonoid:kct,getIntersectionSemigroup:Wct,getDifferenceMagma:Fct,Foldable:Nct,FoldableWithIndex:Pct,Traversable:uI,TraversableWithIndex:Dct,Witherable:Lct,empty:Uct,insertAt:jct,hasOwnProperty:Bct,record:zct}),Kct=function(t){return function(e){return Zt(t(e))}},Vct=function(t){return function(e){return eb(t(e))}},Hct=function(){return function(t){return!0}},Jct=function(t){return function(e){return!t(e)}},Gct=function(t){return function(e){return function(r){return e(r)||t(r)}}},Yct=function(t){return function(e){return function(r){return e(r)&&t(r)}}},Xct=function(){return function(t){return!1}},Zct=function(t){return function(e){return function(r){return e(r)&&t(r)}}},Qct=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module",fromOptionK:Kct,fromEitherK:Vct,id:Hct,not:Jct,or:Gct,and:Yct,zero:Xct,compose:Zct}),yL=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return{add:function(r,n){return t.map(function(o,i){return o.add(r[i],n[i])})},zero:t.map(function(r){return r.zero}),mul:function(r,n){return t.map(function(o,i){return o.mul(r[i],n[i])})},one:t.map(function(r){return r.one}),sub:function(r,n){return t.map(function(o,i){return o.sub(r[i],n[i])})}}},tst=function(t){return function(e){return t.sub(t.zero,e)}},est=yL,rst=ZR,nst=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module",tuple:yL,negate:tst,getTupleRing:est,getFunctionRing:rst}),ost=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module"}),ist=Gy,ast=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module",getFunctionSemiring:ist}),ust=UD,cst=jD;function sst(t){var e=Cr(t);return function(r){return function(n){var o=new Set;return n.forEach(function(i){var a=r(i);e(a,o)||o.add(a)}),o}}}function fst(t){var e=Cr(t);return function(r){return function(n){var o=new Set;return n.forEach(function(i){r(i).forEach(function(a){e(a,o)||o.add(a)})}),o}}}function cI(t){return function(e){for(var r=e.values(),n,o=new Set;!(n=r.next()).done;){var i=n.value;t(i)&&o.add(i)}return o}}function lst(t){return function(e){for(var r=e.values(),n,o=new Set,i=new Set;!(n=r.next()).done;){var a=n.value;t(a)?o.add(a):i.add(a)}return mt(i,o)}}function sI(t){var e=Cr(t);return function(r,n){if(n===void 0){var o=sI(t);return function(a){return o(r,a)}}if(Yp(r))return n;if(Yp(n))return r;var i=new Set(r);return n.forEach(function(a){e(a,i)||i.add(a)}),i}}function fI(t){var e=Cr(t);return function(r,n){if(n===void 0){var o=fI(t);return function(a){return o(a,r)}}if(Yp(r)||Yp(n))return new Set;var i=new Set;return r.forEach(function(a){e(a,n)&&i.add(a)}),i}}function pst(t,e){return function(r){return function(n){for(var o=n.values(),i,a=new Set,u=new Set,c=Cr(t),s=Cr(e);!(i=o.next()).done;){var f=r(i.value);switch(f._tag){case"Left":c(f.left,a)||a.add(f.left);break;case"Right":s(f.right,u)||u.add(f.right);break}}return mt(a,u)}}}function lI(t){var e=Cr(t);return function(r,n){if(n===void 0){var o=lI(t);return function(i){return o(i,r)}}return cI(function(i){return!e(i,n)})(r)}}var bL=function(t){return{concat:sI(t)}},dst=function(t){return{concat:bL(t).concat,empty:new Set}},hst=function(t){return{concat:fI(t)}},vst=function(t){return{concat:lI(t)}},mst=WD,gst=FD,yst=ND,bst=function(t){return new Set([t])};function $L(t){var e=Cr(t);return function(r){return function(n){if(e(r)(n))return n;var o=new Set(n);return o.add(r),o}}}var _L=function(t){return function(e){return function(r){return cI(function(n){return!t.equals(e,n)})(r)}}},$st=function(t){var e=Cr(t),r=_L(t),n=$L(t);return function(o){return function(i){return(e(o,i)?r:n)(o)(i)}}},SL=function(t){return function(e){for(var r=e.length,n=new Set,o=Cr(t),i=0;i<r;i++){var a=e[i];o(a,n)||n.add(a)}return n}},_st=function(t){return TL(t)(j)};function Sst(t,e){return function(r){var n=Cr(t),o=Cr(e),i=new Set,a=new Set;return r.forEach(function(u){switch(u._tag){case"Left":n(u.left,i)||i.add(u.left);break;case"Right":o(u.right,a)||a.add(u.right);break}}),mt(i,a)}}function TL(t){var e=Cr(t);return function(r){return function(n){var o=new Set;return n.forEach(function(i){var a=r(i);a._tag==="Some"&&!e(a.value,o)&&o.add(a.value)}),o}}}var Tst=new Set,Yp=function(t){return t.size===0},Ist=function(t){return t.size},Ost=zT,IL=qT,Mst=Dp,Cr=Be,OL=function(t){return function(e){var r=[];return e.forEach(function(n){return r.push(n)}),r.sort(t.compare)}},Rst=Dp,Est=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module",getShow:ust,getEq:cst,map:sst,chain:fst,filter:cI,partition:lst,union:sI,intersection:fI,partitionMap:pst,difference:lI,getUnionSemigroup:bL,getUnionMonoid:dst,getIntersectionSemigroup:hst,getDifferenceMagma:vst,reduce:mst,foldMap:gst,reduceRight:yst,singleton:bst,insert:$L,remove:_L,toggle:$st,fromArray:SL,compact:_st,separate:Sst,filterMap:TL,empty:Tst,isEmpty:Yp,size:Ist,some:Ost,every:IL,isSubset:Mst,elem:Cr,toArray:OL,subset:Rst}),ML=function(t){return{show:function(e){var r="{";for(var n in t)re.call(t,n)&&(r+=" "+n+": "+t[n].show(e[n])+",");return r.length>1&&(r=r.slice(0,-1)+" "),r+="}",r}}},RL=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return{show:function(r){return"["+r.map(function(n,o){return t[o].show(n)}).join(", ")+"]"}}},wst=RL,Ast=ML,Cst={show:function(t){return JSON.stringify(t)}},xst={show:function(t){return JSON.stringify(t)}},kst={show:function(t){return JSON.stringify(t)}},Wst=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module",struct:ML,tuple:RL,getTupleShow:wst,getStructShow:Ast,showBoolean:Cst,showString:xst,showNumber:kst});function pI(t){return function(e){return function(r){return t.of([e,r])}}}function dI(t){return function(e){return function(r){return function(n){return t.map(r(n),function(o){var i=o[0],a=o[1];return[e(i),a]})}}}}function hI(t){return function(e){return function(r){return function(n){return t.chain(r(n),function(o){var i=o[0],a=o[1];return t.map(e(a),function(u){var c=u[0],s=u[1];return[i(c),s]})})}}}}function vI(t){return function(e){return function(r){return function(n){return t.chain(r(n),function(o){var i=o[0],a=o[1];return e(i)(a)})}}}}function mI(t){return function(e){return function(r){return t.of(e(r))}}}function gI(t){return function(e){return function(r){return t.map(e,function(n){return[n,r]})}}}function yI(t){return function(e){return function(r){return t.map(r(e),function(n){var o=n[0];return o})}}}function bI(t){return function(e){return function(r){return t.map(r(e),nr)}}}function Fst(t){var e=hI(t),r=dI(t),n=vI(t),o=yI(t),i=bI(t);return{map:function(a,u){return v(a,r(u))},ap:function(a,u){return v(a,e(u))},of:pI(t),chain:function(a,u){return v(a,n(u))},get:function(){return function(a){return t.of([a,a])}},put:function(a){return function(){return t.of([void 0,a])}},modify:function(a){return function(u){return t.of([void 0,a(u)])}},gets:function(a){return function(u){return t.of([a(u),u])}},fromState:mI(t),fromM:gI(t),evalState:function(a,u){return v(a,o(u))},execState:function(a,u){return v(a,i(u))}}}var Nst=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module",of:pI,map:dI,ap:hI,chain:vI,fromState:mI,fromF:gI,evaluate:yI,execute:bI,getStateM:Fst}),$I=function(t){return function(){return Zv(t)}},_I=pI(ST);function EL(t){return Zn(sT(t))}function Pst(t){return Zn(kP(t))}function wL(t){return Zn(fT(t))}function Dst(t){return Zn(WP(t))}function AL(t){return Zn(lT(t))}function Lst(t){return Zn(NP(t))}var Ust=function(t){return H(t,cT)},jst=function(t){return function(e){return Zv(t(e)[0])}},CL=Ki(function(t){return $I(t)},_I),xL=wL,Uu=AL,Xp=EL,kL=mI(ST),WL=function(t){return Zn(ya(t))},FL=function(t){return Zn(pT(t))},Bst=function(t){return Zn(dT(t))},Zn=gI(wu),zst=function(t){return function(e){return H(e,rp(t))}},NL=function(t){return function(e){return function(r){return t(r)(e)(r)}}},qst=NL,PL=function(t){return function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return FL(t.apply(void 0,e))}},DL=function(t){return function(e){return v(e,Zp(PL(t)))}},Kst=DL,LL=function(t){return function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return WL(t.apply(void 0,e))}},UL=function(t){return function(e){return v(e,Zp(LL(t)))}},Vst=UL,jL=function(t){return function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return Zn(t.apply(void 0,e))}},BL=function(t){return function(e){return v(e,Zp(jL(t)))}},Hst=BL,Qn=function(t,e){return v(t,zL(e))},di=function(t,e){return v(t,TI(e))},ju=function(t,e){return v(t,II(e))},SI=function(t,e){return function(r){return v(t(r),rm(function(){return e()(r)}))}},Om=function(t,e,r){return function(n){return v(t(n),bT(e,function(o){var i=o[0],a=o[1];return[r(i),a]}))}},Mm=function(t,e){return function(r){return v(t(r),$T(e))}},zL=dI(wu),Jst=function(t,e){return function(r){return Om(r,t,e)}},Gst=function(t){return function(e){return Mm(e,t)}},TI=hI(Ar),Yst=TI,Eo=_I,II=vI(Ar),Zp=II,qL=Zp(j),Xst=qL,KL=function(t){return function(e){return function(r){return v(e(r),ZP(function(){return t()(r)}))}}},Zst=KL,Rm=$I,Te="StateReaderTaskEither",OI={URI:Te,map:Qn},Qst=Et(OI),tft={URI:Te,of:Eo},Em={URI:Te,map:Qn,ap:di},eft=le(Em),rft=pe(Em),nft={URI:Te,map:Qn,ap:di,of:Eo},Qr={URI:Te,map:Qn,ap:di,chain:ju},Bu={URI:Te,fromState:kL},oft=dW(Bu),ift=hW(Bu),aft=vW(Bu),uft=mW(Bu),cft=yS(Bu),sft=gW(Bu,Qr),fft={URI:Te,map:Qn,ap:di,of:Eo,chain:ju},lft={URI:Te,map:Qn,ap:di,of:Eo,chain:ju,fromIO:Uu},pft={URI:Te,map:Qn,ap:di,of:Eo,chain:ju,fromIO:Uu,fromTask:Xp},dft={URI:Te,map:Qn,ap:di,of:Eo,chain:ju,throwError:Rm},VL=Xt(Qr),hft=VL,vft={URI:Te,bimap:Om,mapLeft:Mm},mft={URI:Te,map:Qn,alt:SI},sf={URI:Te,fromReader:xL},gft=ip(sf),yft=ap(sf),bft=bu(sf),HL=up(sf,Qr),$ft=HL,JL=cp(sf,Qr),_ft=JL,Oa={URI:Te,fromEither:CL},Sft=lo(Oa),Tft=po(Oa),Ift=Xa(Oa,Qr),GL=Za(Oa,Qr),Oft=GL,Mft=Bi(Oa),YL=Qa(Oa,Qr),Rft=YL,Eft=ho(Oa),wm={URI:Te,fromIO:Uu},wft=ti(wm),Aft=na(wm,Qr),Cft=oa(wm,Qr),Am={URI:Te,fromIO:Uu,fromTask:Xp},xft=$u(Am),kft=Es(Am,Qr),Wft=ws(Am,Qr),Fft=yI(wu),Nft=bI(wu),Pft=he(OI),XL=ve(Qr),Dft=XL,ZL=de(Em),Lft=ZL,QL=function(t){return function(e){return function(r){return function(n){return function(){return Dc(e).reduce(function(o,i,a){return o.then(function(u){return Me(u)?o:t(a+1,i)(u.right[1])(n)().then(function(c){if(Me(c))return c;var s=c.right,f=s[0],l=s[1];return u.right[0].push(f),u.right[1]=l,u})})},t(0,qr(e))(r)(n)().then(ru(function(o){var i=o[0],a=o[1];return[[i],a]})))}}}}},MI=function(t){var e=QL(t);return function(r){return Qt(r)?e(r):Eo(Ze)}},Uft=MI,tU=function(t){return MI(function(e,r){return t(r)})},jft=tU(j),Bft={URI:Te,map:Qn,of:Eo,ap:di,chain:ju,bimap:Om,mapLeft:Mm,alt:SI,fromIO:Uu,fromTask:Xp,throwError:Rm},zft={URI:Te,map:Qn,of:Eo,ap:di,chain:ju,bimap:Om,mapLeft:Mm,alt:SI,fromIO:Uu,fromTask:Xp,throwError:Rm},qft=function(t,e){return v(t(e),Ep(function(r){var n=r[0];return n}))},Kft=function(t,e){return v(t(e),Ep(function(r){r[0];var n=r[1];return n}))};function Vft(t,e,r){return t(e)(r)()}var Hft=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module",left:$I,right:_I,rightTask:EL,leftTask:Pst,rightReader:wL,leftReader:Dst,rightIO:AL,leftIO:Lst,rightState:Ust,leftState:jst,fromEither:CL,fromReader:xL,fromIO:Uu,fromTask:Xp,fromState:kL,fromTaskEither:WL,fromIOEither:FL,fromReaderEither:Bst,fromReaderTaskEither:Zn,local:zst,asksStateReaderTaskEitherW:NL,asksStateReaderTaskEither:qst,fromIOEitherK:PL,chainIOEitherKW:DL,chainIOEitherK:Kst,fromTaskEitherK:LL,chainTaskEitherKW:UL,chainTaskEitherK:Vst,fromReaderTaskEitherK:jL,chainReaderTaskEitherKW:BL,chainReaderTaskEitherK:Hst,map:zL,bimap:Jst,mapLeft:Gst,ap:TI,apW:Yst,of:Eo,chain:II,chainW:Zp,flattenW:qL,flatten:Xst,altW:KL,alt:Zst,throwError:Rm,URI:Te,Functor:OI,flap:Qst,Pointed:tft,Apply:Em,apFirst:eft,apSecond:rft,Applicative:nft,Chain:Qr,FromState:Bu,get:oft,put:ift,modify:aft,gets:uft,fromStateK:cft,chainStateK:sft,Monad:fft,MonadIO:lft,MonadTask:pft,MonadThrow:dft,chainFirst:VL,chainFirstW:hft,Bifunctor:vft,Alt:mft,FromReader:sf,ask:gft,asks:yft,fromReaderK:bft,chainReaderK:HL,chainReaderKW:$ft,chainFirstReaderK:JL,chainFirstReaderKW:_ft,FromEither:Oa,fromOption:Sft,fromOptionK:Tft,chainOptionK:Ift,chainEitherK:GL,chainEitherKW:Oft,fromPredicate:Mft,filterOrElse:YL,filterOrElseW:Rft,fromEitherK:Eft,FromIO:wm,fromIOK:wft,chainIOK:Aft,chainFirstIOK:Cft,FromTask:Am,fromTaskK:xft,chainTaskK:kft,chainFirstTaskK:Wft,evaluate:Fft,execute:Nft,bindTo:Pft,bind:XL,bindW:Dft,apS:ZL,apSW:Lft,traverseReadonlyNonEmptyArrayWithIndex:QL,traverseReadonlyArrayWithIndex:MI,traverseArrayWithIndex:Uft,traverseArray:tU,sequenceArray:jft,stateReaderTaskEither:Bft,stateReaderTaskEitherSeq:zft,evalState:qft,execState:Kft,run:Vft});function Jft(t){return function(e){return{peek:e.peek,pos:t}}}function Gft(t){return function(e){return{peek:e.peek,pos:t(e.pos)}}}function Yft(t){return function(e){return e.peek(t(e.pos))}}function Xft(t){return function(e){return function(r){return t.map(e(r.pos),function(n){return r.peek(n)})}}}var eU=function(t,e){return v(t,nU(e))},Zft=function(t,e){return v(t,RI(e))},RI=function(t){return function(e){return{peek:function(r){return t({peek:e.peek,pos:r})},pos:e.pos}}},rU=function(t){return t.peek(t.pos)},Qft=RI(j),nU=function(t){return function(e){return{peek:function(r){return t(e.peek(r))},pos:e.pos}}},EI="Store",oU={URI:EI,map:eU},tlt=Et(oU),iU={URI:EI,map:eU,extend:Zft,extract:rU},elt=iU,rlt=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module",seek:Jft,seeks:Gft,peeks:Yft,experiment:Xft,extend:RI,extract:rU,duplicate:Qft,map:nU,URI:EI,Functor:oU,flap:tlt,Comonad:iU,store:elt});function wI(t,e){return function(r,n){return e.compose(t.second(n),t.first(r))}}function aU(t,e){var r=wI(t,e);return function(n,o){return e.compose(r(n,o),t.promap(e.id(),j,function(i){return[i,i]}))}}function nlt(t){return wI(t,t)}function olt(t){return aU(t,t)}var ilt=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module",split:wI,fanOut:aU,splitStrong:nlt,fanout:olt}),alt=function(){return{concat:function(t,e){return Object.assign({},t,e)}}},ult=function(t){return function(e){var r={};for(var n in e)re.call(e,n)&&(r[n]=t[n](e[n]));return r}},clt=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module",getAssignSemigroup:alt,evolve:ult}),uU=Dv(mr),slt=iN(mr),flt=er,cU=aN(mr),Qp=function(t){return Cm(hr(t))},Cm=o0(Ot),llt=pa(Yl),sU=uN(Ot),plt=sU,AI=c0(Ks),dlt=AI,fU=AI,hlt=fU,lU=s0(Pe),vlt=lU,mlt=i0(mr),pU=function(t){return function(){return t().then(function(e){return Jt(e)},function(){return Dt})}},glt=function(t){return function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return pU(function(){return t.apply(void 0,e)})}},ylt=a0(mr),blt=nN(Pe),$lt=u0(mr),_lt=oN(Pe),CI=f0(Ot),dU=l0(Ou),wo=uU,xm=$p(Pe),Slt=xm(j),xI=p0(Pe),Tlt=xI,km=Lv(mr),Ilt=km(),kI=Qo(Ot,Jl),WI=ta(Ot,Jl,Vl),hU=ea(Ot,Gl),vU=ra(Ot,Gl),mU=vu(Ot,Gl),gU=mu(Ot,Gl),Sn=function(t,e){return v(t,CI(e))},zu=function(t,e){return v(t,dU(e))},Wm=function(t,e){return v(t,xm(e))},yU=function(t,e){return v(t,xI(e))},Olt=function(t,e){return v(t,hU(e))},Mlt=function(t,e){return v(t,vU(e))},Rlt=function(t,e){return v(t,mU(e))},Elt=function(t,e){return v(t,gU(e))},we="TaskOption",FI={URI:we,map:Sn},wlt=Et(FI),bU={URI:we,of:wo},Fm={URI:we,map:Sn,ap:zu},Alt=le(Fm),Clt=pe(Fm),xlt={URI:we,map:Sn,ap:zu,of:wo},$U=function(t,e){return v(t,xm(function(r){return v(e,CI(r))}))},klt={URI:we,map:Sn,ap:$U},Wlt={URI:we,map:Sn,ap:$U,of:wo},qu={URI:we,map:Sn,ap:zu,chain:Wm},Flt=Xt(qu),Nlt={URI:we,map:Sn,alt:yU},_U={URI:we,zero:km},Plt=kl(_U,bU),Dlt={URI:we,map:Sn,ap:zu,of:wo,alt:yU,zero:km},Llt={URI:we,map:Sn,ap:zu,of:wo,chain:Wm},Ult={URI:we,map:Sn,ap:zu,of:wo,chain:Wm,fromIO:Qp},jlt={URI:we,map:Sn,ap:zu,of:wo,chain:Wm,fromIO:Qp,fromTask:Cm},Blt={URI:we,compact:kI,separate:WI},zlt={URI:we,map:Sn,compact:kI,separate:WI,filter:Olt,filterMap:Mlt,partition:Rlt,partitionMap:Elt},Nm={URI:we,fromIO:Qp},qlt=ti(Nm),Klt=na(Nm,qu),Vlt=oa(Nm,qu),Hlt={URI:we,fromEither:cU},Pm={URI:we,fromIO:Qp,fromTask:Cm},Jlt=$u(Pm),Glt=Es(Pm,qu),Ylt=ws(Pm,qu),Xlt=wo(xe),Zlt=he(FI),Qlt=ve(qu),tpt=de(Fm),NI=wo(Ze),SU=function(t){return H(Vs(t),pa(tS(zr)))},PI=function(t){var e=SU(t);return function(r){return Qt(r)?e(r):NI}},TU=function(t){return function(e){return function(){return Dc(e).reduce(function(r,n,o){return r.then(function(i){return me(i)?r:t(o+1,n)().then(function(a){return me(a)?a:(i.value.push(a.value),i)})})},t(0,qr(e))().then(bo(nl)))}}},DI=function(t){var e=TU(t);return function(r){return Qt(r)?e(r):NI}},ept=PI,IU=function(t){return PI(function(e,r){return t(r)})},rpt=IU(j),npt=DI,OU=function(t){return DI(function(e,r){return t(r)})},opt=OU(j),ipt=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module",some:uU,fromPredicate:slt,fromOption:flt,fromEither:cU,fromIO:Qp,fromTask:Cm,fromTaskEither:llt,match:sU,matchW:plt,matchE:AI,fold:dlt,matchEW:fU,foldW:hlt,getOrElse:lU,getOrElseW:vlt,fromNullable:mlt,tryCatch:pU,tryCatchK:glt,fromNullableK:ylt,chainNullableK:blt,fromOptionK:$lt,chainOptionK:_lt,map:CI,ap:dU,of:wo,chain:xm,flatten:Slt,alt:xI,altW:Tlt,zero:km,none:Ilt,compact:kI,separate:WI,filter:hU,filterMap:vU,partition:mU,partitionMap:gU,Functor:FI,flap:wlt,Pointed:bU,ApplyPar:Fm,apFirst:Alt,apSecond:Clt,ApplicativePar:xlt,ApplySeq:klt,ApplicativeSeq:Wlt,Chain:qu,chainFirst:Flt,Alt:Nlt,Zero:_U,guard:Plt,Alternative:Dlt,Monad:Llt,MonadIO:Ult,MonadTask:jlt,Compactable:Blt,Filterable:zlt,FromIO:Nm,fromIOK:qlt,chainIOK:Klt,chainFirstIOK:Vlt,FromEither:Hlt,FromTask:Pm,fromTaskK:Jlt,chainTaskK:Glt,chainFirstTaskK:Ylt,Do:Xlt,bindTo:Zlt,bind:Qlt,apS:tpt,ApT:NI,traverseReadonlyNonEmptyArrayWithIndex:SU,traverseReadonlyArrayWithIndex:PI,traverseReadonlyNonEmptyArrayWithIndexSeq:TU,traverseReadonlyArrayWithIndexSeq:DI,traverseArrayWithIndex:ept,traverseArray:IU,sequenceArray:rpt,traverseSeqArrayWithIndex:npt,traverseSeqArray:OU,sequenceSeqArray:opt}),kt=function(t){return t._tag==="Left"},se=function(t){return t._tag==="Right"};function Ku(t){return t._tag==="Both"}function qe(t){return{_tag:"Left",left:t}}function xr(t){return{_tag:"Right",right:t}}function Lt(t,e){return{_tag:"Both",left:t,right:e}}var LI=function(t,e,r){return function(n){switch(n._tag){case"Left":return t(n.left);case"Right":return e(n.right);case"Both":return r(n.left,n.right)}}},apt=LI,Ma=LI,upt=Ma,MU=Ma(xr,qe,function(t,e){return Lt(e,t)});function cpt(t,e){return{show:Ma(function(r){return"left("+t.show(r)+")"},function(r){return"right("+e.show(r)+")"},function(r,n){return"both("+t.show(r)+", "+e.show(n)+")"})}}function spt(t,e){return vn(function(r,n){return kt(r)?kt(n)&&t.equals(r.left,n.left):se(r)?se(n)&&e.equals(r.right,n.right):Ku(n)&&t.equals(r.left,n.left)&&e.equals(r.right,n.right)})}function RU(t,e){return{concat:function(r,n){return kt(r)?kt(n)?qe(t.concat(r.left,n.left)):se(n)?Lt(r.left,n.right):Lt(t.concat(r.left,n.left),n.right):se(r)?kt(n)?Lt(n.left,r.right):se(n)?xr(e.concat(r.right,n.right)):Lt(n.left,e.concat(r.right,n.right)):kt(n)?Lt(t.concat(r.left,n.left),r.right):se(n)?Lt(r.left,e.concat(r.right,n.right)):Lt(t.concat(r.left,n.left),e.concat(r.right,n.right))}}}var Dm=function(t){return{URI:tn,_E:void 0,map:Vu,ap:function(e,r){return kt(e)?kt(r)?qe(t.concat(e.left,r.left)):se(r)?qe(e.left):qe(t.concat(e.left,r.left)):se(e)?kt(r)?qe(r.left):se(r)?xr(e.right(r.right)):Lt(r.left,e.right(r.right)):kt(r)?qe(t.concat(e.left,r.left)):se(r)?Lt(e.left,e.right(r.right)):Lt(t.concat(e.left,r.left),e.right(r.right))}}};function fpt(t){var e=Dm(t);return{URI:tn,_E:void 0,map:Vu,ap:e.ap,of:td}}function EU(t){var e=Dm(t),r=function(n,o){if(kt(n))return n;if(se(n))return o(n.right);var i=o(n.right);return kt(i)?qe(t.concat(n.left,i.left)):se(i)?Lt(n.left,i.right):Lt(t.concat(n.left,i.left),i.right)};return{URI:tn,_E:void 0,map:Vu,ap:e.ap,chain:r}}function lpt(t){var e=EU(t);return{URI:tn,_E:void 0,map:Vu,of:td,ap:e.ap,chain:e.chain,throwError:qe}}function ppt(t){return kt(t)?ct(t.left):se(t)?lt:ct(t.left)}function dpt(t){return kt(t)?lt:(se(t),ct(t.right))}function hpt(t){return function(e){return me(e)?qe(t):Lt(t,e.value)}}function vpt(t){return function(e){return me(e)?xr(t):Lt(e.value,t)}}function mpt(t){return kt(t)?ct(t.left):lt}function gpt(t){return se(t)?ct(t.right):lt}var ypt=function(t,e){return me(t)?me(e)?lt:ct(xr(e.value)):me(e)?ct(qe(t.value)):ct(Lt(t.value,e.value))},Vu=function(t,e){return v(t,KI(e))},wU=function(t,e,r){return v(t,zI(e,r))},AU=function(t,e){return v(t,qI(e))},UI=function(t,e,r){return v(t,xU(e,r))},jI=function(t){var e=kU(t);return function(r,n){return v(r,e(n))}},BI=function(t,e,r){return v(t,WU(e,r))},CU=function(t){var e=FU(t);return function(r,n){return v(r,e(n))}},zI=function(t,e){return function(r){return kt(r)?qe(t(r.left)):se(r)?xr(e(r.right)):Lt(t(r.left),e(r.right))}},qI=function(t){return function(e){return kt(e)?qe(t(e.left)):Ku(e)?Lt(t(e.left),e.right):e}},KI=function(t){return function(e){return kt(e)?e:se(e)?xr(t(e.right)):Lt(e.left,t(e.right))}},xU=function(t,e){return function(r){return kt(r)?t:e(t,r.right)}},kU=function(t){return function(e){return function(r){return kt(r)?t.empty:e(r.right)}}},WU=function(t,e){return function(r){return kt(r)?t:e(r.right,t)}},FU=function(t){return function(e){return function(r){return kt(r)?t.of(r):se(r)?t.map(e(r.right),xr):t.map(e(r.right),function(n){return Lt(r.left,n)})}}},VI=function(t){return function(e){return kt(e)?t.of(e):se(e)?t.map(e.right,xr):t.map(e.right,function(r){return Lt(e.left,r)})}},td=xr,tn="These",HI={URI:tn,map:Vu},bpt=Et(HI),$pt={URI:tn,of:td},_pt={URI:tn,bimap:wU,mapLeft:AU},Spt={URI:tn,fromThese:j},Tpt={URI:tn,reduce:UI,foldMap:jI,reduceRight:BI},Ipt={URI:tn,map:Vu,reduce:UI,foldMap:jI,reduceRight:BI,traverse:CU,sequence:VI},JI={URI:tn,fromEither:j},Opt=lo(JI),Mpt=po(JI),Rpt=function(t){return function(e){return function(r){return kt(r)?!1:t.equals(e,r.right)}}},Ept=function(t){return function(e){return kt(e)?!1:t(e.right)}},GI=function(t,e){return function(r){return kt(r)?[r.left,e()]:se(r)?[t(),r.right]:[r.left,r.right]}},wpt=function(t,e){return GI(function(){return t},function(){return e})},NU=td(Ze),YI=function(t){return function(e){return function(r){var n=lt,o=e(0,qr(r));if(kt(o))return o;Ku(o)&&(n=ct(o.left));for(var i=[o.right],a=1;a<r.length;a++){var u=e(a,r[a]);if(kt(u))return u;Ku(u)&&(n=me(n)?ct(u.left):ct(t.concat(n.value,u.left))),i.push(u.right)}return me(n)?xr(i):Lt(n.value,i)}}},Apt=function(t){return function(e){var r=YI(t)(e);return function(n){return Qt(n)?r(n):NU}}},Cpt={URI:tn,map:Vu,bimap:wU,mapLeft:AU,reduce:UI,foldMap:jI,reduceRight:BI,traverse:CU,sequence:VI},xpt=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module",isLeft:kt,isRight:se,isBoth:Ku,left:qe,right:xr,both:Lt,matchW:LI,foldW:apt,match:Ma,fold:upt,swap:MU,getShow:cpt,getEq:spt,getSemigroup:RU,getApply:Dm,getApplicative:fpt,getChain:EU,getMonad:lpt,getLeft:ppt,getRight:dpt,leftOrBoth:hpt,rightOrBoth:vpt,getLeftOnly:mpt,getRightOnly:gpt,fromOptions:ypt,bimap:zI,mapLeft:qI,map:KI,reduce:xU,foldMap:kU,reduceRight:WU,traverse:FU,sequence:VI,of:td,URI:tn,Functor:HI,flap:bpt,Pointed:$pt,Bifunctor:_pt,FromThese:Spt,Foldable:Tpt,Traversable:Ipt,FromEither:JI,fromOption:Opt,fromOptionK:Mpt,elem:Rpt,exists:Ept,toTuple2:GI,toTuple:wpt,ApT:NU,traverseReadonlyNonEmptyArrayWithIndex:YI,traverseReadonlyArrayWithIndex:Apt,these:Cpt});function Lm(t){return H(xr,t.of)}function Um(t){return H(qe,t.of)}function XI(t){return H(Lt,t.of)}function ZI(t){return function(e){return t.map(e,xr)}}function QI(t){return function(e){return t.map(e,qe)}}function tO(t){return Nc(t,HI)}function eO(t,e){return Vo(t,Dm(e))}function rO(t,e){var r=Um(t);return function(n){return function(o){return t.chain(o,Ma(r,n,function(i,a){return t.map(n(a),Ma(function(u){return qe(e.concat(i,u))},function(u){return Lt(i,u)},function(u,c){return Lt(e.concat(i,u),c)}))}))}}}function nO(t){return function(e,r){return function(n){return t.map(n,zI(e,r))}}}function oO(t){return function(e){return function(r){return t.map(r,qI(e))}}}function PU(t){return function(e,r,n){return function(o){return t.map(o,Ma(e,r,n))}}}function iO(t){return function(e,r,n){return function(o){return t.chain(o,Ma(e,r,n))}}}function aO(t){return function(e){return t.map(e,MU)}}function uO(t){return function(e,r){return function(n){return t.map(n,GI(e,r))}}}function kpt(t){var e=tO(t),r=nO(t),n=oO(t),o=iO(t),i=uO(t),a=Lm(t),u=function(c,s){return v(c,e(s))};return{map:u,bimap:function(c,s,f){return v(c,r(s,f))},mapLeft:function(c,s){return v(c,n(s))},fold:function(c,s,f,l){return v(c,o(s,f,l))},swap:aO(t),rightM:ZI(t),leftM:QI(t),left:Um(t),right:Lm(t),both:XI(t),toTuple:function(c,s,f){return v(c,i(function(){return s},function(){return f}))},getMonad:function(c){var s=eO(t,c),f=rO(t,c);return{_E:void 0,map:u,of:a,ap:function(l,p){return v(l,s(p))},chain:function(l,p){return v(l,f(p))}}}}}var Wpt=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module",right:Lm,left:Um,both:XI,rightF:ZI,leftF:QI,map:tO,ap:eO,chain:rO,bimap:nO,mapLeft:oO,match:PU,matchE:iO,swap:aO,toTuple2:uO,getTheseM:kpt}),Fpt=Um(mr),DU=Lm(mr),Npt=XI(mr),cO=ZI(Ot),LU=QI(Ot),UU=H(hr,cO),Ppt=H(hr,LU),jU=er,BU=er,jm=UU,Dpt=hr,sO=cO,zU=PU(Ot),Lpt=zU,qU=iO(Pe),KU=qU,VU=KU,Upt=VU,jpt=aO(Ot),Hu=function(t,e){return v(t,HU(e))},fO=function(t,e,r){return v(t,JU(e,r))},lO=function(t,e){return v(t,GU(e))},HU=tO(Ot),JU=nO(Ot),GU=oO(Ot),ed=DU,gr="TaskThese",pO=function(t,e){var r=eO(t,e);return{URI:gr,_E:void 0,map:Hu,ap:function(n,o){return v(n,r(o))}}};function YU(t,e){var r=pO(t,e).ap;return{URI:gr,_E:void 0,map:Hu,ap:r,of:ed}}function XU(t){var e=pO(Ip,t),r=rO(Pe,t);return{URI:gr,_E:void 0,map:Hu,ap:e.ap,chain:function(n,o){return v(n,r(o))}}}function Bpt(t){var e=YU(Ip,t),r=XU(t);return{URI:gr,_E:void 0,map:Hu,ap:e.ap,of:ed,chain:r.chain,fromIO:jm,fromTask:sO}}var ZU={URI:gr,map:Hu},zpt=Et(ZU),qpt={URI:gr,of:ed},Kpt={URI:gr,bimap:fO,mapLeft:lO},Bm={URI:gr,fromEither:jU},Vpt=lo(Bm),Hpt=po(Bm),Jpt=Bi(Bm),QU={URI:gr,fromThese:BU},Gpt=yW(QU),tj={URI:gr,fromIO:jm},Ypt=ti(tj),ej={URI:gr,fromIO:jm,fromTask:sO},Xpt=$u(ej),rj=uO(Ot),dO=ed(Ze),nj=function(t){var e=YI(t);return function(r){return H(Vs(r),pa(e(zr)))}},Zpt=function(t){return function(e){var r=nj(t)(e);return function(n){return Qt(n)?r(n):dO}}},oj=function(t){return function(e){return function(r){return function(){return Dc(r).reduce(function(n,o,i){return n.then(function(a){return kt(a)?n:e(i+1,o)().then(function(u){if(kt(u))return u;if(Ku(u)){var c=a.right;return c.push(u.right),Ku(a)?Lt(t.concat(a.left,u.left),c):Lt(u.left,c)}return a.right.push(u.right),a})})},e(0,qr(r))().then(KI(nl)))}}}},Qpt=function(t){return function(e){var r=oj(t)(e);return function(n){return Qt(n)?r(n):dO}}},tdt={URI:gr,map:Hu},edt={URI:gr,bimap:fO,mapLeft:lO},rdt=function(t,e){return rj(function(){return t},function(){return e})},ndt={URI:gr,map:Hu,bimap:fO,mapLeft:lO},odt=function(t,e){return Oe(jv)(RU(t,e))},idt=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module",left:Fpt,right:DU,both:Npt,rightTask:cO,leftTask:LU,rightIO:UU,leftIO:Ppt,fromEither:jU,fromThese:BU,fromIO:jm,fromIOEither:Dpt,fromTask:sO,match:zU,matchW:Lpt,matchE:qU,fold:KU,matchEW:VU,foldW:Upt,swap:jpt,map:HU,bimap:JU,mapLeft:GU,of:ed,URI:gr,getApply:pO,getApplicative:YU,getChain:XU,getMonad:Bpt,Functor:ZU,flap:zpt,Pointed:qpt,Bifunctor:Kpt,FromEither:Bm,fromOption:Vpt,fromOptionK:Hpt,fromPredicate:Jpt,FromThese:QU,fromTheseK:Gpt,FromIO:tj,fromIOK:Ypt,FromTask:ej,fromTaskK:Xpt,toTuple2:rj,ApT:dO,traverseReadonlyNonEmptyArrayWithIndex:nj,traverseReadonlyArrayWithIndex:Zpt,traverseReadonlyNonEmptyArrayWithIndexSeq:oj,traverseReadonlyArrayWithIndexSeq:Qpt,functorTaskThese:tdt,bifunctorTaskThese:edt,toTuple:rdt,taskThese:ndt,getSemigroup:odt});function adt(t,e){return function(r){return r(e(r(t.empty)))}}function udt(t){return function(e){return[t(e),e]}}function cdt(t){return function(e){return function(r){return[e(r),t(r)]}}}function sdt(t){return function(e){return function(r){return e(t(r))}}}function fdt(t){function e(n,o){return function(i){return o(function(a){return n(t.concat(i,a))})}}function r(n){return n(t.empty)}return{URI:hO,_E:void 0,map:ij,extend:e,extract:r}}var ij=function(t,e){return v(t,aj(e))},aj=function(t){return function(e){return function(r){return t(e(r))}}},hO="Traced",vO={URI:hO,map:ij},ldt=Et(vO),pdt=vO,ddt=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module",tracks:adt,listen:udt,listens:cdt,censor:sdt,getComonad:fdt,map:aj,URI:hO,Functor:vO,flap:ldt,traced:pdt});function uj(t,e){return function(r){var n=t.traverse(r),o=e.traverse(r);return function(i){return function(a){return n(a,function(u){return o(u,i)})}}}}function cj(t,e){return function(r){var n=t.sequence(r),o=e.sequence(r);return function(i){return n(t.map(i,o))}}}function hdt(t,e){var r=Pc(t,e).map,n=nS(t,e),o=uj(t,e),i=cj(t,e);return{map:r,reduce:n.reduce,foldMap:n.foldMap,reduceRight:n.reduceRight,traverse:function(a){var u=o(a);return function(c,s){return v(c,u(s))}},sequence:function(a){var u=i(a);return function(c){return v(c,u)}}}}var vdt=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module",traverse:uj,sequence:cj,getTraversableComposition:hdt}),mdt=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module"});function sj(t,e){return e===void 0&&(e=[]),{value:t,forest:e}}function gdt(t){var e=function(r){return Xi(r.forest)?"make("+t.show(r.value)+")":"make("+t.show(r.value)+", ["+r.forest.map(e).join(", ")+"])"};return{show:e}}function ydt(t){var e,r=vn(function(n,o){return t.equals(n.value,o.value)&&e.equals(n.forest,o.forest)});return e=Mx(r),r}var fj=function(t,e){for(var r="",n=e.length,o,i=0;i<n;i++){o=e[i];var a=i===n-1;r+=t+(a?"\u2514":"\u251C")+"\u2500 "+o.value,r+=fj(t+(n>1&&!a?"\u2502 ":" "),o.forest)}return r};function lj(t){return fj(`
15
+ `,t)}function bdt(t){return t.value+lj(t.forest)}function pj(t,e){var r=e(t),n=r[0],o=r[1];return{value:n,forest:dj(o,e)}}function dj(t,e){return t.map(function(r){return pj(r,e)})}function hj(t){var e=vj(t);return function(r,n){return t.chain(n(r),function(o){var i=o[0],a=o[1];return t.map(e(a,n),function(u){return{value:i,forest:u}})})}}function vj(t){var e=uv(t);return function(r,n){return v(r,e(function(o){return hj(t)(o,n)}))}}function $dt(t){var e=function(r){return t(r.value,r.forest.map(e))};return e}var Ra=function(t,e){return v(t,qm(e))},ff=function(t,e){return v(t,rd(function(r){return v(e,qm(r))}))},mO=function(t,e){return v(t,rd(e))},gO=function(t,e,r){return v(t,Km(e,r))},yO=function(t){var e=yj(t);return function(r,n){return v(r,e(n))}},bO=function(t,e,r){return v(t,$O(e,r))},mj=function(t,e){return v(t,zm(e))},gj=function(t){var e=SO(t);return function(r,n){return v(r,e(n))}},_dt=function(t){return function(e){return ff(e,t)}},rd=function(t){return function(e){var r=t(e.value),n=r.value,o=r.forest,i=C_().concat;return{value:n,forest:i(o,e.forest.map(rd(t)))}}},zm=function(t){return function(e){return{value:t(e),forest:e.forest.map(zm(t))}}},Sdt=zm(j),Tdt=rd(j),qm=function(t){return function(e){return{value:t(e.value),forest:e.forest.map(qm(t))}}},Km=function(t,e){return function(r){for(var n=e(t,r.value),o=r.forest.length,i=0;i<o;i++)n=v(r.forest[i],Km(n,e));return n}},yj=function(t){return function(e){return Km(t.empty,function(r,n){return t.concat(r,e(n))})}},$O=function(t,e){return function(r){for(var n=t,o=r.forest.length,i=o-1;i>=0;i--)n=v(r.forest[i],$O(n,e));return e(r.value,n)}},_O=function(t){return t.value},SO=function(t){var e=uv(t),r=function(n){return function(o){return t.ap(t.map(n(o.value),function(i){return function(a){return{value:i,forest:a}}}),v(o.forest,e(r(n))))}};return r},TO=function(t){return SO(t)(j)},lf=function(t){return sj(t)},to="Tree",IO={URI:to,map:Ra},Idt=Et(IO),Odt={URI:to,of:lf},Vm={URI:to,map:Ra,ap:ff},Mdt=le(Vm),Rdt=pe(Vm),Edt={URI:to,map:Ra,ap:ff,of:lf},OO={URI:to,map:Ra,ap:ff,chain:mO},wdt={URI:to,map:Ra,ap:ff,of:lf,chain:mO},Adt=Xt(OO),Cdt={URI:to,reduce:gO,foldMap:yO,reduceRight:bO},xdt={URI:to,map:Ra,reduce:gO,foldMap:yO,reduceRight:bO,traverse:gj,sequence:TO},kdt={URI:to,map:Ra,extend:mj,extract:_O},Wdt=lf(xe),Fdt=he(IO),Ndt=ve(OO),Pdt=de(Vm);function Ddt(t){var e=function(r,n){return t.equals(r,n.value)||n.forest.some(function(o){return e(r,o)})};return e}var bj=function(t){return function(e){return t(e.value)||e.forest.some(bj(t))}},Ldt={URI:to,map:Ra,of:lf,ap:ff,chain:mO,reduce:gO,foldMap:yO,reduceRight:bO,traverse:gj,sequence:TO,extract:_O,extend:mj},Udt=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module",make:sj,getShow:gdt,getEq:ydt,drawForest:lj,drawTree:bdt,unfoldTree:pj,unfoldForest:dj,unfoldTreeM:hj,unfoldForestM:vj,fold:$dt,ap:_dt,chain:rd,extend:zm,duplicate:Sdt,flatten:Tdt,map:qm,reduce:Km,foldMap:yj,reduceRight:$O,extract:_O,traverse:SO,sequence:TO,of:lf,URI:to,Functor:IO,flap:Idt,Pointed:Odt,Apply:Vm,apFirst:Mdt,apSecond:Rdt,Applicative:Edt,Chain:OO,Monad:wdt,chainFirst:Adt,Foldable:Cdt,Traversable:xdt,Comonad:kdt,Do:Wdt,bindTo:Fdt,bind:Ndt,apS:Pdt,elem:Ddt,exists:bj,tree:Ldt}),en=Ee,kr=nr,jdt=function(t){return[kr(t),en(t)]};function MO(t){return{URI:rn,_E:void 0,map:nd,ap:function(e,r){return[en(e)(en(r)),t.concat(kr(e),kr(r))]}}}var $j=function(t){return function(e){return[e,t.empty]}};function Bdt(t){var e=MO(t);return{URI:rn,_E:void 0,map:e.map,ap:e.ap,of:$j(t)}}function RO(t){var e=MO(t);return{URI:rn,_E:void 0,map:e.map,ap:e.ap,chain:function(r,n){var o=n(en(r)),i=o[0],a=o[1];return[i,t.concat(kr(r),a)]}}}function zdt(t){var e=RO(t);return{URI:rn,_E:void 0,map:e.map,ap:e.ap,chain:e.chain,of:$j(t)}}function qdt(t){var e=function(n,o){for(var i=o(n),a=t.empty,u=en(i);u._tag==="Left";)a=t.concat(a,kr(i)),i=o(u.left),u=en(i);return[u.right,t.concat(a,kr(i))]},r=RO(t);return{URI:rn,_E:void 0,map:r.map,ap:r.ap,chain:r.chain,chainRec:e}}var _j=function(t,e){return v(t,Rj(e))},nd=function(t,e){return v(t,CO(e))},Sj=function(t,e,r){return v(t,Mj(e,r))},Tj=function(t,e){return v(t,xO(e))},Ij=function(t,e){return v(t,kO(e))},EO=function(t,e,r){return v(t,wj(e,r))},wO=function(t){var e=Ej();return function(r,n){return v(r,e(n))}},AO=function(t,e,r){return v(t,Aj(e,r))};function Oj(t){var e=Cj(t);return function(r,n){return v(r,e(n))}}var Mj=function(t,e){return function(r){return[e(en(r)),t(kr(r))]}},CO=function(t){return function(e){return[t(en(e)),kr(e)]}},xO=function(t){return function(e){return[en(e),t(kr(e))]}},Rj=function(t){return function(e){return[en(e),kr(t)]}},kO=function(t){return function(e){return[t(e),kr(e)]}},Kdt=kO(j),WO=Im,Ej=tI,wj=QT,Aj=eI,Cj=function(t){return function(e){return function(r){return t.map(e(en(r)),function(n){return[n,kr(r)]})}}},FO=function(t){return function(e){return t.map(en(e),function(r){return[r,kr(e)]})}},rn="Tuple",xj={URI:rn,map:nd},Vdt=Et(xj),Hdt={URI:rn,bimap:Sj,mapLeft:Tj},Jdt={URI:rn,compose:_j},Gdt={URI:rn,map:nd,extend:Ij,extract:WO},Ydt={URI:rn,reduce:EO,foldMap:wO,reduceRight:AO},Xdt={URI:rn,map:nd,reduce:EO,foldMap:wO,reduceRight:AO,traverse:Oj,sequence:FO},Zdt=CO,Qdt=xO,tht={URI:rn,compose:_j,map:nd,bimap:Sj,mapLeft:Tj,extract:WO,extend:Ij,reduce:EO,foldMap:wO,reduceRight:AO,traverse:Oj,sequence:FO},eht=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module",fst:en,snd:kr,swap:jdt,getApply:MO,getApplicative:Bdt,getChain:RO,getMonad:zdt,getChainRec:qdt,bimap:Mj,mapFst:CO,mapSnd:xO,compose:Rj,extend:kO,duplicate:Kdt,extract:WO,foldMap:Ej,reduce:wj,reduceRight:Aj,traverse:Cj,sequence:FO,URI:rn,Functor:xj,flap:Vdt,Bifunctor:Hdt,Semigroupoid:Jdt,Comonad:Gdt,Foldable:Ydt,Traversable:Xdt,map:Zdt,mapLeft:Qdt,tuple:tht}),rht=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module"});function nht(t,e){var r=oE(e,zi(t));return{map:r.map,ap:r.ap,of:r.of,chain:function(n,o){return e.chain(n,function(i){return Me(i)?e.of(Ho(i.left)):o(i.right)})},alt:function(n,o){return e.chain(n,function(i){return eb(i)?e.of(i):e.map(o(),function(a){return Me(a)?Ho(t.concat(i.left,a.left)):a})})}}}var oht=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module",getValidationM:nht}),kj=Nb(void 0),iht={concat:kj.concat,empty:void 0},aht=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module",Semigroup:kj,Monoid:iht}),uht=function(t){return function(){return[void 0,t]}},cht=function(t){return function(){var e=t(),r=e[0],n=e[1];return[[r,n],n]}},sht=function(t){return function(){var e=t(),r=e[0],n=r[0],o=r[1],i=e[1];return[n,o(i)]}},fht=function(t){return function(e){return function(){var r=e(),n=r[0],o=r[1];return[[n,t(o)],o]}}},lht=function(t){return function(e){return function(){var r=e(),n=r[0],o=r[1];return[n,t(o)]}}},od=function(t,e){return v(t,Wj(e))},Wj=function(t){return function(e){return function(){var r=e(),n=r[0],o=r[1];return[t(n),o]}}},Ju="Writer",Fj=function(t){return{URI:Ju,_E:void 0,of:function(e){return function(){return[e,t.empty]}}}},NO=function(t){return{URI:Ju,_E:void 0,map:od,ap:function(e,r){return function(){var n=e(),o=n[0],i=n[1],a=r(),u=a[0],c=a[1];return[o(u),t.concat(i,c)]}}}},Nj=function(t){var e=NO(t),r=Fj(t);return{URI:Ju,_E:void 0,map:od,ap:e.ap,of:r.of}};function Pj(t){var e=NO(t);return{URI:Ju,_E:void 0,map:od,ap:e.ap,chain:function(r,n){return function(){var o=r(),i=o[0],a=o[1],u=n(i)(),c=u[0],s=u[1];return[c,t.concat(a,s)]}}}}function pht(t){var e=Nj(t),r=Pj(t);return{URI:Ju,_E:void 0,map:od,ap:e.ap,of:e.of,chain:r.chain}}var PO={URI:Ju,map:od},dht=Et(PO),hht=function(t){return t()[0]},vht=function(t){return t()[1]},mht=function(t){return t()[0]},ght=function(t){return t()[1]},yht=PO,bht=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module",tell:uht,listen:cht,pass:sht,listens:fht,censor:lht,map:Wj,URI:Ju,getPointed:Fj,getApply:NO,getApplicative:Nj,getChain:Pj,getMonad:pht,Functor:PO,flap:dht,evaluate:hht,execute:vht,evalWriter:mht,execWriter:ght,writer:yht});function $ht(t){var e=function(r,n){return function(){return t.map(r(),function(o){var i=o[0],a=o[1];return[n(i),a]})}};return{map:e,evalWriter:function(r){return t.map(r(),function(n){var o=n[0];return o})},execWriter:function(r){return t.map(r(),function(n){n[0];var o=n[1];return o})},tell:function(r){return function(){return t.of([void 0,r])}},listen:function(r){return function(){return t.map(r(),function(n){var o=n[0],i=n[1];return[[o,i],i]})}},pass:function(r){return function(){return t.map(r(),function(n){var o=n[0],i=o[0],a=o[1],u=n[1];return[i,a(u)]})}},listens:function(r,n){return function(){return t.map(r(),function(o){var i=o[0],a=o[1];return[[i,n(a)],a]})}},censor:function(r,n){return function(){return t.map(r(),function(o){var i=o[0],a=o[1];return[i,n(a)]})}},getMonad:function(r){return{_E:void 0,map:e,of:function(n){return function(){return t.of([n,r.empty])}},ap:function(n,o){return function(){return t.chain(n(),function(i){var a=i[0],u=i[1];return t.map(o(),function(c){var s=c[0],f=c[1];return[a(s),r.concat(u,f)]})})}},chain:function(n,o){return function(){return t.chain(n(),function(i){var a=i[0],u=i[1];return t.map(o(a)(),function(c){var s=c[0],f=c[1];return[s,r.concat(u,f)]})})}}}}}}var _ht=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module",getWriterM:$ht}),Sht=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module",alt:iH,alternative:uH,applicative:n4,apply:e4,array:Nx,bifunctor:KG,boolean:QG,booleanAlgebra:o9,bounded:a9,boundedDistributiveLattice:s9,boundedJoinSemilattice:f9,boundedLattice:l9,boundedMeetSemilattice:p9,category:d9,chain:o4,chainRec:i4,choice:m9,comonad:g9,compactable:uY,console:pY,const:RY,contravariant:EY,date:NY,distributiveLattice:u9,either:FE,eitherT:DY,endomorphism:UY,extend:jY,field:qY,filterable:VY,filterableWithIndex:HY,foldable:QY,foldableWithIndex:eX,fromEither:u4,fromIO:rX,fromReader:IX,fromState:qX,fromTask:KX,fromThese:VX,function:nE,functor:r4,functorWithIndex:JX,group:GX,heytingAlgebra:YX,hkt:XX,identity:bZ,invariant:$Z,io:LZ,ioEither:DQ,ioRef:UQ,joinSemilattice:jQ,json:qQ,lattice:KQ,magma:DH,map:tet,meetSemilattice:eet,monad:ret,monadIO:net,monadTask:oet,monadThrow:iet,monoid:bet,naturalTransformation:$et,nonEmptyArray:RJ,number:WJ,option:Sk,optionT:Tet,ord:WH,ordering:Aet,pipeable:Jet,pointed:Get,predicate:S9,profunctor:Yet,random:trt,reader:TX,readerEither:Grt,readerT:Zrt,readerTaskEither:Sat,readonlyArray:u8,readonlyMap:ytt,readonlyNonEmptyArray:N6,readonlyRecord:put,readonlySet:wut,readonlyTuple:qut,readerTask:aot,record:qct,refinement:Qct,ring:nst,semigroup:Vw,semigroupoid:ost,semiring:ast,separated:d4,set:Est,eq:bH,show:Wst,state:zX,stateReaderTaskEither:Hft,stateT:Nst,store:rlt,string:Uat,strong:ilt,struct:clt,task:Int,taskEither:sit,taskOption:ipt,taskThese:idt,these:xpt,theseT:Wpt,traced:ddt,traversable:vdt,traversableWithIndex:mdt,tree:Udt,tuple:eht,unfoldable:rht,validationT:oht,void:aht,witherable:h4,writer:bht,writerT:_ht,zero:FJ}),Dj=Li(Sht);function Lj(t,e,r){return r===void 0&&(r=t.name),new pt(r,t.is,t.validate,function(n){return e(t.encode(n))})}var Tht=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module",mapOutput:Lj}),Iht=Li(Tht);Object.defineProperty(xt,"__esModule",{value:!0}),xt.addType=xt.isEmpty=xt.objectToMap=xt.grouped=xt.formatDate=xt.formatDateTime=xt.filterDouble=xt.refineType=xt.nullable=void 0;const Oht=X.exports,Mht=Dj,Rht=Kr,pf=(0,Oht.__importStar)(nt),Eht=Iht;function wht(t){return pf.union([t,pf.null,pf.undefined])}xt.nullable=wht;function Aht(t,e,r){return new pf.Type(e,t.is,(n,o)=>(0,Rht.pipe)(t.validate(n,o),Mht.either.chain(i=>r(i)?pf.success(i):pf.failure(n,o))),t.encode)}xt.refineType=Aht;function Cht(t){if(t==="")return null;const e=Number(t);return Number.isNaN(e)?null:e}xt.filterDouble=Cht;function xht(t){return t.toISOString().replace(/\.\d{3}Z$/,"+0000")}xt.formatDateTime=xht;function kht(t){return t.toISOString().replace(/T.*/,"")}xt.formatDate=kht;function Wht(t,e){return t.reduce((r,n,o)=>(o%e==0?r.push([n]):r[Math.floor(o/e)].push(n),r),new Array)}xt.grouped=Wht;function Fht(t){return new Map(Object.entries(t))}xt.objectToMap=Fht;function Nht(t){for(const e in t)return!1;return!0}xt.isEmpty=Nht;function Pht(t,e){return(0,Eht.mapOutput)(t,r=>K(_({},r),{__TYPE__:e}))}xt.addType=Pht;var DO={};Object.defineProperty(DO,"__esModule",{value:!0});const Dht=X.exports,Lht=fr,Uht=Kr,Gu=(0,Dht.__importStar)(nt);DO.default=new Gu.Type("IntFromNumber",Gu.Int.is,(t,e)=>(0,Uht.pipe)(Gu.number.validate(t,e),(0,Lht.chain)(r=>Gu.Int.is(r)?Gu.success(r):Gu.success(Math.round(r)))),Gu.Int.encode);var LO={};Object.defineProperty(LO,"__esModule",{value:!0});const jht=X.exports,Bht=fr,zht=Kr,df=(0,jht.__importStar)(nt),qht=/^([0-9]+)px$/;LO.default=new df.Type("IntFromPixels",df.Int.is,(t,e)=>(0,zht.pipe)(df.string.validate(t,e),(0,Bht.chain)(r=>{try{const n=r.match(qht);if(!n)return df.failure(t,e);const o=parseInt(n[1]);return df.success(o)}catch{return df.failure(t,e)}})),String);var UO={};Object.defineProperty(UO,"__esModule",{value:!0});const Kht=X.exports,Vht=(0,Kht.__importStar)(nt),Hht=xt;UO.default=(0,Hht.refineType)(Vht.string,"nonEmptyString",t=>t.trim().length>0);var jO={},Hm={};Object.defineProperty(Hm,"__esModule",{value:!0});const Jht=X.exports,Ght=(0,Jht.__importStar)(nt),Yht=xt;Hm.default=(0,Yht.nullable)(Ght.string),Object.defineProperty(jO,"__esModule",{value:!0});const Xht=X.exports,Zht=fr,Qht=Kr,BO=nt,tvt=(0,Xht.__importDefault)(Hm);jO.default=new BO.Type("nonEmptyStringOrNull",t=>typeof t=="string"||t===null,(t,e)=>(0,Qht.pipe)(tvt.default.validate(t,e),(0,Zht.chain)(r=>typeof r=="string"&&r.length>0?(0,BO.success)(r):(0,BO.success)(null))),t=>t);var zO={};Object.defineProperty(zO,"__esModule",{value:!0});const evt=X.exports,rvt=(0,evt.__importStar)(nt),nvt=xt;zO.default=(0,nvt.nullable)(rvt.number);var qO={};Object.defineProperty(qO,"__esModule",{value:!0});const ovt=X.exports,ivt=fr,avt=Kr,Jm=(0,ovt.__importStar)(nt);qO.default=new Jm.Type("StringFromInt",Jm.string.is,(t,e)=>(0,avt.pipe)(Jm.boolean.validate(t,e),(0,ivt.chain)(r=>Jm.success(r.toString()))),t=>t);var KO={};Object.defineProperty(KO,"__esModule",{value:!0});const uvt=X.exports,cvt=fr,svt=Kr,Gm=(0,uvt.__importStar)(nt);KO.default=new Gm.Type("StringFromInt",Gm.string.is,(t,e)=>(0,svt.pipe)(Gm.number.validate(t,e),(0,cvt.chain)(r=>Gm.success(r.toString()))),t=>t),function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.StringOrNull=t.StringFromNumber=t.StringFromBoolean=t.NumberOrNull=t.NonEmptyStringOrNull=t.NonEmptyString=t.IntFromPixels=t.IntFromNumber=t.Function=t.DateFromTsMs=t.DateFromStringOrNumber=t.DateFromString=void 0;const e=X.exports;var r=Cb;Object.defineProperty(t,"DateFromString",{enumerable:!0,get:function(){return(0,e.__importDefault)(r).default}});var n=xb;Object.defineProperty(t,"DateFromStringOrNumber",{enumerable:!0,get:function(){return(0,e.__importDefault)(n).default}});var o=kb;Object.defineProperty(t,"DateFromTsMs",{enumerable:!0,get:function(){return(0,e.__importDefault)(o).default}}),t.Function=(0,e.__importStar)(xt);var i=DO;Object.defineProperty(t,"IntFromNumber",{enumerable:!0,get:function(){return(0,e.__importDefault)(i).default}});var a=LO;Object.defineProperty(t,"IntFromPixels",{enumerable:!0,get:function(){return(0,e.__importDefault)(a).default}});var u=UO;Object.defineProperty(t,"NonEmptyString",{enumerable:!0,get:function(){return(0,e.__importDefault)(u).default}});var c=jO;Object.defineProperty(t,"NonEmptyStringOrNull",{enumerable:!0,get:function(){return(0,e.__importDefault)(c).default}});var s=zO;Object.defineProperty(t,"NumberOrNull",{enumerable:!0,get:function(){return(0,e.__importDefault)(s).default}});var f=qO;Object.defineProperty(t,"StringFromBoolean",{enumerable:!0,get:function(){return(0,e.__importDefault)(f).default}});var l=KO;Object.defineProperty(t,"StringFromNumber",{enumerable:!0,get:function(){return(0,e.__importDefault)(l).default}});var p=Hm;Object.defineProperty(t,"StringOrNull",{enumerable:!0,get:function(){return(0,e.__importDefault)(p).default}})}(Pt);var eo={},ro={},id={},Ea={},Ym={},te={};Object.defineProperty(te,"__esModule",{value:!0});var VO;(function(t){t.Text="Text",t.RichText="StructuredText",t.Color="Color",t.Image="Image",t.Date="Date",t.Timestamp="Timestamp",t.Number="Number",t.Range="Range",t.Select="Select",t.Link="Link",t.Embed="Embed",t.GeoPoint="GeoPoint",t.Separator="Separator",t.UID="UID",t.BooleanField="Boolean",t.IntegrationField="IntegrationFields",t.Group="Group",t.Slices="Slices",t.LegacySlices="Choice"})(VO||(VO={})),te.default=VO,Object.defineProperty(Ym,"__esModule",{value:!0});const Uj=X.exports,Ao=(0,Uj.__importStar)(nt),fvt=Pt,lvt=(0,Uj.__importDefault)(te),pvt=Ao.exact(Ao.partial({label:fvt.StringOrNull,default_value:Ao.boolean,placeholder_true:Ao.string,placeholder_false:Ao.string})),dvt=Ao.exact(Ao.intersection([Ao.type({type:Ao.literal(lvt.default.BooleanField)}),Ao.partial({config:pvt})]));Ym.default=dvt;var Xm={};Object.defineProperty(Xm,"__esModule",{value:!0});const jj=X.exports,wa=(0,jj.__importStar)(nt),Bj=Pt,hvt=(0,jj.__importDefault)(te),vvt=wa.exact(wa.partial({label:Bj.StringOrNull,placeholder:wa.string})),mvt=wa.exact(wa.intersection([wa.type({type:wa.literal(hvt.default.Color)}),wa.partial({fieldset:Bj.StringOrNull,config:vvt})]));Xm.default=mvt;var Zm={};Object.defineProperty(Zm,"__esModule",{value:!0});const zj=X.exports,hi=(0,zj.__importStar)(nt),qj=Pt,gvt=(0,zj.__importDefault)(te),yvt=hi.exact(hi.partial({label:qj.StringOrNull,placeholder:hi.string,default:hi.string})),bvt=hi.exact(hi.intersection([hi.type({type:hi.literal(gvt.default.Date)}),hi.partial({fieldset:qj.StringOrNull,config:yvt})]));Zm.default=bvt;var Qm={};Object.defineProperty(Qm,"__esModule",{value:!0});const Kj=X.exports,vi=(0,Kj.__importStar)(nt),Vj=Pt,$vt=(0,Kj.__importDefault)(te),_vt=vi.exact(vi.partial({label:Vj.StringOrNull,placeholder:vi.string,useAsTitle:vi.boolean})),Svt=vi.exact(vi.intersection([vi.type({type:vi.literal($vt.default.Embed)}),vi.partial({fieldset:Vj.StringOrNull,config:_vt})]));Qm.default=Svt;var tg={};Object.defineProperty(tg,"__esModule",{value:!0});const Hj=X.exports,Yu=(0,Hj.__importStar)(nt),Jj=Pt,Tvt=(0,Hj.__importDefault)(te),Ivt=Yu.exact(Yu.partial({label:Jj.StringOrNull})),Ovt=Yu.exact(Yu.intersection([Yu.type({type:Yu.literal(Tvt.default.GeoPoint)}),Yu.partial({fieldset:Jj.StringOrNull,config:Ivt})]));tg.default=Ovt;var eg={},ad={},rg={},hf={},Xu={};Object.defineProperty(Xu,"__esModule",{value:!0}),Xu.pipe=Xu.pipeable=void 0;var HO=Ko,Mvt=function(t){return typeof t.map=="function"},Rvt=function(t){return typeof t.contramap=="function"},Evt=function(t){return typeof t.mapWithIndex=="function"},wvt=function(t){return typeof t.ap=="function"},Avt=function(t){return typeof t.chain=="function"},Cvt=function(t){return typeof t.bimap=="function"},xvt=function(t){return typeof t.extend=="function"},kvt=function(t){return typeof t.reduce=="function"},Wvt=function(t){return typeof t.reduceWithIndex=="function"},Fvt=function(t){return typeof t.alt=="function"},Nvt=function(t){return typeof t.compact=="function"},Pvt=function(t){return typeof t.filter=="function"},Dvt=function(t){return typeof t.filterWithIndex=="function"},Lvt=function(t){return typeof t.promap=="function"},Uvt=function(t){return typeof t.compose=="function"},jvt=function(t){return typeof t.throwError=="function"};function Bvt(t){var e={};if(Mvt(t)){var r=function(T){return function(M){return t.map(M,T)}};e.map=r}if(Rvt(t)){var n=function(T){return function(M){return t.contramap(M,T)}};e.contramap=n}if(Evt(t)){var o=function(T){return function(M){return t.mapWithIndex(M,T)}};e.mapWithIndex=o}if(wvt(t)){var i=function(T){return function(M){return t.ap(M,T)}},a=function(T){return function(M){return t.ap(t.map(M,function(N){return function(){return N}}),T)}};e.ap=i,e.apFirst=a,e.apSecond=function(T){return function(M){return t.ap(t.map(M,function(){return function(N){return N}}),T)}}}if(Avt(t)){var u=function(T){return function(M){return t.chain(M,T)}},c=function(T){return function(M){return t.chain(M,function(N){return t.map(T(N),function(){return N})})}},s=function(T){return t.chain(T,HO.identity)};e.chain=u,e.chainFirst=c,e.flatten=s}if(Cvt(t)){var f=function(T,M){return function(N){return t.bimap(N,T,M)}},l=function(T){return function(M){return t.mapLeft(M,T)}};e.bimap=f,e.mapLeft=l}if(xvt(t)){var p=function(T){return function(M){return t.extend(M,T)}},d=function(T){return t.extend(T,HO.identity)};e.extend=p,e.duplicate=d}if(kvt(t)){var h=function(T,M){return function(N){return t.reduce(N,T,M)}},m=function(T){var M=t.foldMap(T);return function(N){return function(at){return M(at,N)}}},g=function(T,M){return function(N){return t.reduceRight(N,T,M)}};e.reduce=h,e.foldMap=m,e.reduceRight=g}if(Wvt(t)){var b=function(T,M){return function(N){return t.reduceWithIndex(N,T,M)}},$=function(T){var M=t.foldMapWithIndex(T);return function(N){return function(at){return M(at,N)}}},w=function(T,M){return function(N){return t.reduceRightWithIndex(N,T,M)}};e.reduceWithIndex=b,e.foldMapWithIndex=$,e.reduceRightWithIndex=w}if(Fvt(t)){var y=function(T){return function(M){return t.alt(M,T)}};e.alt=y}if(Nvt(t)&&(e.compact=t.compact,e.separate=t.separate),Pvt(t)){var I=function(T){return function(M){return t.filter(M,T)}},S=function(T){return function(M){return t.filterMap(M,T)}},k=function(T){return function(M){return t.partition(M,T)}},C=function(T){return function(M){return t.partitionMap(M,T)}};e.filter=I,e.filterMap=S,e.partition=k,e.partitionMap=C}if(Dvt(t)){var B=function(T){return function(M){return t.filterWithIndex(M,T)}},q=function(T){return function(M){return t.filterMapWithIndex(M,T)}},G=function(T){return function(M){return t.partitionWithIndex(M,T)}},O=function(T){return function(M){return t.partitionMapWithIndex(M,T)}};e.filterWithIndex=B,e.filterMapWithIndex=q,e.partitionWithIndex=G,e.partitionMapWithIndex=O}if(Lvt(t)){var R=function(T,M){return function(N){return t.promap(N,T,M)}};e.promap=R}if(Uvt(t)){var x=function(T){return function(M){return t.compose(M,T)}};e.compose=x}if(jvt(t)){var F=function(T){return function(M){return M._tag==="None"?t.throwError(T()):t.of(M.value)}},L=function(T){return T._tag==="Left"?t.throwError(T.left):t.of(T.right)},U=function(T,M){return function(N){return T(N)?t.of(N):t.throwError(M(N))}},rt=function(T,M){return function(N){return t.chain(N,function(at){return T(at)?t.of(at):t.throwError(M(at))})}};e.fromOption=F,e.fromEither=L,e.fromPredicate=U,e.filterOrElse=rt}return e}Xu.pipeable=Bvt,Xu.pipe=HO.pipe;var zvt=ut&&ut.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),qvt=ut&&ut.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),Kvt=ut&&ut.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)Object.hasOwnProperty.call(t,r)&&zvt(e,t,r);return qvt(e,t),e};Object.defineProperty(hf,"__esModule",{value:!0}),hf.NumberFromString=void 0;var ud=Kvt(nt),Vvt=Xu,Hvt=qo;hf.NumberFromString=new ud.Type("NumberFromString",ud.number.is,function(t,e){return Vvt.pipe(ud.string.validate(t,e),Hvt.chain(function(r){var n=+r;return isNaN(n)||r.trim()===""?ud.failure(t,e):ud.success(n)}))},String);var Jvt=ut&&ut.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),Gvt=ut&&ut.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),Yvt=ut&&ut.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)Object.hasOwnProperty.call(t,r)&&Jvt(e,t,r);return Gvt(e,t),e};Object.defineProperty(rg,"__esModule",{value:!0}),rg.IntFromString=void 0;var cd=Yvt(nt),Gj=hf,Xvt=Xu,Zvt=qo;rg.IntFromString=new cd.Type("IntFromString",cd.Int.is,function(t,e){return Xvt.pipe(Gj.NumberFromString.validate(t,e),Zvt.chain(function(r){return cd.Int.is(r)?cd.success(r):cd.failure(t,e)}))},Gj.NumberFromString.encode),Object.defineProperty(ad,"__esModule",{value:!0});const Qvt=X.exports,tmt=qo,mi=(0,Qvt.__importStar)(nt),emt=rg,Yj=Pt,Xj=new mi.Type("SideConstraints",t=>!t||typeof t=="number",(t,e)=>tmt.either.chain(mi.union([mi.literal("auto"),mi.literal(""),mi.Int,emt.IntFromString,Yj.IntFromNumber,Yj.IntFromPixels,mi.null]).validate(t,e),r=>r==="auto"||r===""?mi.success(null):mi.success(r)),t=>t),rmt=mi.partial({width:Xj,height:Xj});ad.default=rmt,Object.defineProperty(eg,"__esModule",{value:!0});const JO=X.exports,nn=(0,JO.__importStar)(nt),Zj=Pt,Qj=(0,JO.__importDefault)(ad),nmt=(0,JO.__importDefault)(te),omt=nn.exact(nn.intersection([nn.type({name:nn.string}),Qj.default])),imt=nn.exact(nn.partial({label:Zj.StringOrNull,placeholder:nn.string,constraint:Qj.default,thumbnails:nn.array(omt)})),amt=nn.exact(nn.intersection([nn.type({type:nn.literal(nmt.default.Image)}),nn.partial({fieldset:Zj.StringOrNull,config:imt})]));eg.default=amt;var ng={};Object.defineProperty(ng,"__esModule",{value:!0});const tB=X.exports,gi=(0,tB.__importStar)(nt),eB=Pt,umt=(0,tB.__importDefault)(te),cmt=gi.exact(gi.partial({label:eB.StringOrNull,placeholder:gi.string,catalog:gi.string})),smt=gi.exact(gi.intersection([gi.type({type:gi.literal(umt.default.IntegrationField)}),gi.partial({fieldset:eB.StringOrNull,config:cmt})]));ng.default=smt;var og={};Object.defineProperty(og,"__esModule",{value:!0});const rB=X.exports,fmt=qo,Ht=(0,rB.__importStar)(nt),lmt=Kc,nB=Pt,pmt=(0,rB.__importDefault)(te),dmt=t=>{if(t instanceof Array&&t.reduce((r,n)=>r&&typeof n=="string",!0))return Ht.success(t)},hmt=t=>{if(typeof t=="string")return Ht.success([t])},oB=new Ht.Type("MasksArrayString",t=>t instanceof Array,(t,e)=>fmt.either.chain(Ht.union([Ht.array(Ht.string),Ht.string]).validate(t,e),r=>dmt(r)||hmt(r)||Ht.failure(t,e)),t=>t),vmt=Ht.exact(Ht.partial({label:nB.StringOrNull,useAsTitle:Ht.boolean,placeholder:Ht.string,select:(0,lmt.withFallback)(Ht.union([Ht.literal("media"),Ht.literal("document"),Ht.literal("web"),Ht.null]),null),customtypes:Ht.array(Ht.string),masks:oB,tags:oB,allowTargetBlank:Ht.boolean})),mmt=Ht.exact(Ht.intersection([Ht.type({type:Ht.literal(pmt.default.Link)}),Ht.partial({fieldset:nB.StringOrNull,config:vmt})]));og.default=mmt;var ig={};Object.defineProperty(ig,"__esModule",{value:!0});const iB=X.exports,Wr=(0,iB.__importStar)(nt),GO=hf,aB=Pt,gmt=(0,iB.__importDefault)(te),ymt=Wr.exact(Wr.partial({label:aB.StringOrNull,placeholder:Wr.string,min:Wr.union([Wr.number,GO.NumberFromString]),max:Wr.union([Wr.number,GO.NumberFromString]),step:Wr.union([Wr.number,GO.NumberFromString])})),bmt=Wr.exact(Wr.intersection([Wr.type({type:Wr.literal(gmt.default.Number)}),Wr.partial({fieldset:aB.StringOrNull,config:ymt})]));ig.default=bmt;var ag={};Object.defineProperty(ag,"__esModule",{value:!0});const uB=X.exports,Fr=(0,uB.__importStar)(nt),YO=hf,cB=Pt,$mt=(0,uB.__importDefault)(te),_mt=Fr.exact(Fr.partial({label:cB.StringOrNull,placeholder:Fr.string,min:Fr.union([Fr.number,YO.NumberFromString]),max:Fr.union([Fr.number,YO.NumberFromString]),step:Fr.union([Fr.number,YO.NumberFromString])})),Smt=Fr.exact(Fr.intersection([Fr.type({type:Fr.literal($mt.default.Range)}),Fr.partial({fieldset:cB.StringOrNull,config:_mt})]));ag.default=Smt;var ug={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.RichText=t.RichTextConfig=t.RichTextNodeTypeCodec=t.RichTextNodeType=t.DEFAULT_OPTION=void 0;const e=X.exports,r=qo,n=(0,e.__importStar)(nt),o=Pt,i=(0,e.__importDefault)(ad),a=(0,e.__importDefault)(te);t.DEFAULT_OPTION="paragraph";var u;(function(h){h.heading1="heading1",h.heading2="heading2",h.heading3="heading3",h.heading4="heading4",h.heading5="heading5",h.heading6="heading6",h.paragraph="paragraph",h.strong="strong",h.em="em",h.preformatted="preformatted",h.hyperlink="hyperlink",h.image="image",h.embed="embed",h.list="list-item",h.orderedList="o-list-item",h.rtl="rtl"})(u=t.RichTextNodeType||(t.RichTextNodeType={})),t.RichTextNodeTypeCodec=n.keyof({[u.heading1]:null,[u.heading2]:null,[u.heading3]:null,[u.heading4]:null,[u.heading5]:null,[u.heading6]:null,[u.paragraph]:null,[u.strong]:null,[u.em]:null,[u.preformatted]:null,[u.hyperlink]:null,[u.image]:null,[u.embed]:null,[u.list]:null,[u.orderedList]:null,[u.rtl]:null});const c=new n.Type("RichTextOptions",h=>typeof h=="string",(h,m)=>r.either.chain(n.union([n.string,n.null]).validate(h,m),g=>{if(!g)return n.success(t.DEFAULT_OPTION);const $=g.split(",").map(w=>w.trim()).filter(w=>(0,r.getOrElseW)(()=>{})(t.RichTextNodeTypeCodec.decode(w)));return $.length?n.success($.join(",")):n.success(t.DEFAULT_OPTION)}),h=>h),s=h=>{if(!h)return n.success([])},f=h=>{if(h instanceof Object){const m=h;if(!Object.entries(m).length)return n.success([]);if(m[""])return n.success(m[""].map(b=>b.name));const g=Object.entries(m).reduce((b,[,$])=>b.concat($.map(w=>w.name)),[]).filter(Boolean);return n.success(g)}},l=h=>{if(h instanceof Array&&h.reduce((g,b)=>g&&typeof b=="string",!0))return n.success(h)},p=h=>{if(typeof h=="string")return n.success([h])},d=new n.Type("RichTextLabels",h=>h instanceof Array,(h,m)=>{const g=n.record(n.string,n.array(n.record(n.literal("name"),n.string))),b=n.array(n.string);return r.either.chain(n.union([g,b,n.string,n.null]).validate(h,m),$=>s($)||l($)||f($)||p($)||n.failure(h,m))},h=>h);t.RichTextConfig=n.exact(n.partial({label:o.StringOrNull,placeholder:n.string,useAsTitle:n.boolean,single:c,multi:c,imageConstraint:i.default,labels:d,allowTargetBlank:n.boolean})),t.RichText=n.exact(n.intersection([n.type({type:n.literal(a.default.RichText)}),n.partial({fieldset:o.StringOrNull,config:t.RichTextConfig})]))})(ug);var cg={};Object.defineProperty(cg,"__esModule",{value:!0});const sB=X.exports,Tn=(0,sB.__importStar)(nt),sg=Pt,Tmt=(0,sB.__importDefault)(te),Imt=Tn.exact(Tn.partial({label:sg.StringOrNull,placeholder:Tn.string,default_value:Tn.string,options:Tn.array(Tn.union([Tn.string,sg.StringFromNumber,sg.StringFromBoolean]))})),Omt=Tn.exact(Tn.intersection([Tn.type({type:Tn.literal(Tmt.default.Select)}),Tn.partial({fieldset:sg.StringOrNull,config:Imt})]));cg.default=Omt;var fg={};Object.defineProperty(fg,"__esModule",{value:!0});const fB=X.exports,Zu=(0,fB.__importStar)(nt),Mmt=Pt,Rmt=(0,fB.__importDefault)(te),Emt=Zu.exact(Zu.partial({label:Mmt.StringOrNull})),wmt=Zu.exact(Zu.intersection([Zu.type({type:Zu.literal(Rmt.default.Separator)}),Zu.partial({config:Emt})]));fg.default=wmt;var lg={};Object.defineProperty(lg,"__esModule",{value:!0});const lB=X.exports,yi=(0,lB.__importStar)(nt),pB=Pt,Amt=(0,lB.__importDefault)(te),Cmt=yi.exact(yi.partial({label:pB.StringOrNull,useAsTitle:yi.boolean,placeholder:yi.string})),xmt=yi.exact(yi.intersection([yi.type({type:yi.literal(Amt.default.Text)}),yi.partial({fieldset:pB.StringOrNull,config:Cmt})]));lg.default=xmt;var pg={};Object.defineProperty(pg,"__esModule",{value:!0});const dB=X.exports,bi=(0,dB.__importStar)(nt),hB=Pt,kmt=(0,dB.__importDefault)(te),Wmt=bi.exact(bi.partial({label:hB.StringOrNull,placeholder:bi.string,default:bi.string})),Fmt=bi.exact(bi.intersection([bi.type({type:bi.literal(kmt.default.Timestamp)}),bi.partial({fieldset:hB.StringOrNull,config:Wmt})]));pg.default=Fmt,Object.defineProperty(Ea,"__esModule",{value:!0});const yr=X.exports,Nmt=(0,yr.__importStar)(nt),Pmt=(0,yr.__importDefault)(Ym),Dmt=(0,yr.__importDefault)(Xm),Lmt=(0,yr.__importDefault)(Zm),Umt=(0,yr.__importDefault)(Qm),jmt=(0,yr.__importDefault)(tg),Bmt=(0,yr.__importDefault)(eg),zmt=(0,yr.__importDefault)(ng),qmt=(0,yr.__importDefault)(og),Kmt=(0,yr.__importDefault)(ig),Vmt=(0,yr.__importDefault)(ag),Hmt=ug,Jmt=(0,yr.__importDefault)(cg),Gmt=(0,yr.__importDefault)(fg),Ymt=(0,yr.__importDefault)(lg),Xmt=(0,yr.__importDefault)(pg),Zmt=Nmt.union([Dmt.default,Pmt.default,Umt.default,jmt.default,Lmt.default,Kmt.default,Vmt.default,Hmt.RichText,Jmt.default,Gmt.default,Ymt.default,Xmt.default,qmt.default,Bmt.default,zmt.default]);Ea.default=Zmt,Object.defineProperty(id,"__esModule",{value:!0});const XO=X.exports,In=(0,XO.__importStar)(nt),vB=Pt,Qmt=(0,XO.__importDefault)(Ea),tgt=(0,XO.__importDefault)(te),egt=In.exact(In.partial({label:vB.StringOrNull,repeat:In.boolean,fields:In.record(In.string,Qmt.default)})),rgt=In.exact(In.intersection([In.type({type:In.literal(tgt.default.Group)}),In.partial({fieldset:vB.StringOrNull,icon:In.string,description:In.string,config:egt})]));id.default=rgt;var ZO={},dg={},Aa={};Object.defineProperty(Aa,"__esModule",{value:!0});var QO;(function(t){t.Slice="Slice",t.SharedSlice="SharedSlice"})(QO||(QO={})),Aa.default=QO,Object.defineProperty(dg,"__esModule",{value:!0});const tM=X.exports,Nr=(0,tM.__importStar)(nt),mB=Pt,gB=(0,tM.__importDefault)(Ea),ngt=(0,tM.__importDefault)(Aa),ogt=Nr.exact(Nr.partial({label:mB.StringOrNull})),igt=Nr.exact(Nr.intersection([Nr.type({type:Nr.literal(ngt.default.Slice)}),Nr.partial({fieldset:mB.StringOrNull,description:Nr.string,icon:Nr.string,display:Nr.string,"non-repeat":Nr.record(Nr.string,gB.default),repeat:Nr.record(Nr.string,gB.default),config:ogt})]));dg.default=igt;var hg={};Object.defineProperty(hg,"__esModule",{value:!0});const eM=X.exports,agt=(0,eM.__importStar)(nt),ugt=(0,eM.__importDefault)(id),cgt=(0,eM.__importDefault)(Ea),sgt=agt.union([cgt.default,ugt.default]);hg.default=sgt;var rM={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.SharedSlice=t.Variation=void 0;const e=X.exports,r=(0,e.__importStar)(nt),n=Kc,o=(0,e.__importDefault)(Ea),i=(0,e.__importDefault)(Aa),a="https://images.prismic.io/slice-machine/621a5ec4-0387-4bc5-9860-2dd46cbc07cd_default_ss.png?auto=compress,format";t.Variation=r.exact(r.intersection([r.type({id:r.string,name:r.string,description:r.string,imageUrl:(0,n.withFallback)(r.string,a),docURL:r.string,version:r.string}),r.partial({display:r.string,primary:r.record(r.string,o.default),items:r.record(r.string,o.default)})])),t.SharedSlice=r.exact(r.intersection([r.type({id:r.string,type:r.literal(i.default.SharedSlice),name:r.string,variations:r.array(t.Variation)}),r.partial({description:r.string})]))})(rM);var vg={};Object.defineProperty(vg,"__esModule",{value:!0});const yB=X.exports,nM=(0,yB.__importStar)(nt),fgt=(0,yB.__importDefault)(Aa),lgt=nM.exact(nM.type({type:nM.literal(fgt.default.SharedSlice)}));vg.default=lgt,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Slices=t.DynamicSlices=t.StaticSlices=t.slicesReader=t.DynamicSlicesConfig=t.StaticSlicesConfig=t.slicesConfigReader=t.SlicesLabels=void 0;const e=X.exports,r=(0,e.__importStar)(nt),n=Pt,o=(0,e.__importDefault)(te),i=(0,e.__importDefault)(dg),a=(0,e.__importDefault)(hg),u=rM,c=(0,e.__importDefault)(vg),s=(0,e.__importDefault)(Aa);t.SlicesLabels=r.union([r.record(r.string,r.array(r.exact(r.intersection([r.type({name:r.string}),r.partial({display:r.string})])))),r.null]);function f(d){return r.exact(r.partial({label:n.StringOrNull,labels:t.SlicesLabels,choices:r.record(r.string,r.union([a.default,i.default,d]))}))}t.slicesConfigReader=f,t.StaticSlicesConfig=f(u.SharedSlice),t.DynamicSlicesConfig=f(c.default);const l={toStatic(d,h){const m=Object.entries(d.choices||{}).reduce((g,[b,$])=>{if($.type===s.default.SharedSlice){const w=h.get(b);return w?K(_({},g),{[b]:w}):g}else return K(_({},g),{[b]:$})},{});return K(_({},d),{choices:m})}};function p(d){return r.exact(r.intersection([r.type({type:r.union([r.literal(o.default.Slices),r.literal(o.default.LegacySlices)])}),r.partial({fieldset:n.StringOrNull,config:d})]))}t.slicesReader=p,t.StaticSlices=p(t.StaticSlicesConfig),t.DynamicSlices=p(t.DynamicSlicesConfig),t.Slices={toStatic(d,h){return d.config?K(_({},d),{config:l.toStatic(d.config,h)}):d}}}(ZO);var mg={};Object.defineProperty(mg,"__esModule",{value:!0});const bB=X.exports,$i=(0,bB.__importStar)(nt),$B=Pt,pgt=(0,bB.__importDefault)(te),dgt=$i.exact($i.partial({label:$B.StringOrNull,useAsTitle:$i.boolean,placeholder:$i.string})),hgt=$i.exact($i.intersection([$i.type({type:$i.literal(pgt.default.UID)}),$i.partial({fieldset:$B.StringOrNull,config:dgt})]));mg.default=hgt,Object.defineProperty(ro,"__esModule",{value:!0}),ro.Widgets=ro.DynamicWidget=ro.StaticWidget=ro.widgetReader=void 0;const sd=X.exports,vgt=(0,sd.__importStar)(nt),mgt=(0,sd.__importDefault)(id),ggt=(0,sd.__importDefault)(Ea),oM=ZO,ygt=(0,sd.__importDefault)(mg),_B=(0,sd.__importDefault)(te);function iM(t){return vgt.union([ygt.default,ggt.default,mgt.default,t])}ro.widgetReader=iM,ro.StaticWidget=iM(oM.StaticSlices),ro.DynamicWidget=iM(oM.DynamicSlices),ro.Widgets={toStatic(t,e){switch(t.type){case _B.default.LegacySlices:case _B.default.Slices:return oM.Slices.toStatic(t,e);default:return t}}},Object.defineProperty(eo,"__esModule",{value:!0}),eo.Sections=eo.DynamicSection=eo.StaticSection=eo.sectionReader=void 0;const bgt=X.exports,SB=(0,bgt.__importStar)(nt),aM=ro;function uM(t){return SB.record(SB.string,t)}eo.sectionReader=uM,eo.StaticSection=uM(aM.StaticWidget),eo.DynamicSection=uM(aM.DynamicWidget),eo.Sections={toStatic(t,e){return Object.entries(t).reduce((n,[o,i])=>K(_({},n),{[o]:aM.Widgets.toStatic(i,e)}),{})}},Object.defineProperty(Ye,"__esModule",{value:!0}),Ye.filterMissingSharedSlices=Ye.collectWidgets=Ye.validateSlices=Ye.toStatic=Ye.flattenWidgets=Ye.CustomType=Ye.StaticCustomType=void 0;const cM=X.exports,TB=qo,Co=(0,cM.__importStar)(nt),IB=Kc,$gt=Pt,sM=eo,OB=(0,cM.__importDefault)(Aa),MB=(0,cM.__importDefault)(te);class _gt extends Error{constructor(e){super();Object.defineProperty(this,"slices",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"message",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.slices=e,this.message=this._formatError(e)}_formatError(e){return`The following slices doesn't exists in your Prismic repository:
16
+ ${e.map(n=>` - ${n}`).join(`
17
+ `)}
18
+ `}}function RB(t){return Co.exact(Co.intersection([Co.type({id:Co.string,label:$gt.StringOrNull,repeatable:(0,IB.withFallback)(Co.boolean,!0),json:Co.record(Co.string,t),status:(0,IB.withFallback)(Co.boolean,!0)}),Co.partial({hash:Co.string})]))}Ye.StaticCustomType=RB(sM.StaticSection),Ye.CustomType=RB(sM.DynamicSection);function EB(t){return Object.entries(t.json).reduce((e,[,r])=>{const n=Object.entries(r);return e.concat(n)},[])}Ye.flattenWidgets=EB;function Sgt(t){return EB(t).filter(([,n])=>n.type===MB.default.Slices).reduce((n,[,o])=>{const i=Object.entries(o.config&&o.config.choices?o.config.choices:{}).filter(([,a])=>a.type===OB.default.SharedSlice).map(([a])=>a);return n.concat(i)},[])}function Tgt(t){const e=Sgt(t);return function(r){return e.map(r)}}function Igt(t,e){const r=Object.entries(t.json).reduce((n,[o,i])=>K(_({},n),{[o]:sM.Sections.toStatic(i,e)}),{});return K(_({},t),{json:r})}Ye.toStatic=Igt;function Ogt(t,e){const r=Tgt(t)(n=>{if(!e.get(n))return n}).filter(Boolean);return r.length>0?(0,TB.left)(new _gt(r)):(0,TB.right)(t)}Ye.validateSlices=Ogt;function wB(t,e){const r=Object.entries(t.json).reduce((n,[o,i])=>{const a=Object.entries(i).reduce((u,[c,s])=>{const f=e(c,s);return f?K(_({},u),{[c]:f}):u},{});return K(_({},n),{[o]:a})},{});return K(_({},t),{json:r})}Ye.collectWidgets=wB;function Mgt(t,e){return wB(t,(r,n)=>{if(n.type===MB.default.Slices){if(!n.config||!n.config.choices)return n;const o=Object.entries(n.config.choices).reduce((a,[u,c])=>c.type===OB.default.SharedSlice&&!e.get(u)?a:K(_({},a),{[u]:c}),{}),i=K(_({},n.config),{choices:o});return K(_({},n),{config:i})}return n})}Ye.filterMissingSharedSlices=Mgt;var Bt={},_t={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Timestamp=t.Text=t.Separator=t.Select=t.Range=t.Number=t.NestableWidget=t.Link=t.IntegrationField=t.Image=t.GeoPoint=t.Embed=t.Date=t.Color=t.BooleanField=void 0;const e=X.exports;var r=Ym;Object.defineProperty(t,"BooleanField",{enumerable:!0,get:function(){return(0,e.__importDefault)(r).default}});var n=Xm;Object.defineProperty(t,"Color",{enumerable:!0,get:function(){return(0,e.__importDefault)(n).default}});var o=Zm;Object.defineProperty(t,"Date",{enumerable:!0,get:function(){return(0,e.__importDefault)(o).default}});var i=Qm;Object.defineProperty(t,"Embed",{enumerable:!0,get:function(){return(0,e.__importDefault)(i).default}});var a=tg;Object.defineProperty(t,"GeoPoint",{enumerable:!0,get:function(){return(0,e.__importDefault)(a).default}});var u=eg;Object.defineProperty(t,"Image",{enumerable:!0,get:function(){return(0,e.__importDefault)(u).default}});var c=ng;Object.defineProperty(t,"IntegrationField",{enumerable:!0,get:function(){return(0,e.__importDefault)(c).default}});var s=og;Object.defineProperty(t,"Link",{enumerable:!0,get:function(){return(0,e.__importDefault)(s).default}});var f=Ea;Object.defineProperty(t,"NestableWidget",{enumerable:!0,get:function(){return(0,e.__importDefault)(f).default}});var l=ig;Object.defineProperty(t,"Number",{enumerable:!0,get:function(){return(0,e.__importDefault)(l).default}});var p=ag;Object.defineProperty(t,"Range",{enumerable:!0,get:function(){return(0,e.__importDefault)(p).default}}),(0,e.__exportStar)(ug,t);var d=cg;Object.defineProperty(t,"Select",{enumerable:!0,get:function(){return(0,e.__importDefault)(d).default}});var h=fg;Object.defineProperty(t,"Separator",{enumerable:!0,get:function(){return(0,e.__importDefault)(h).default}});var m=lg;Object.defineProperty(t,"Text",{enumerable:!0,get:function(){return(0,e.__importDefault)(m).default}});var g=pg;Object.defineProperty(t,"Timestamp",{enumerable:!0,get:function(){return(0,e.__importDefault)(g).default}})})(_t);var AB={};(function(t){var e=ut&&ut.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(t,"__esModule",{value:!0}),t.ImageConstraint=void 0;var r=ad;Object.defineProperty(t,"ImageConstraint",{enumerable:!0,get:function(){return e(r).default}})})(AB);var gg={},CB={};Object.defineProperty(CB,"__esModule",{value:!0}),function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.SlicesTypes=t.SliceZone=t.Slice=t.SharedSliceRef=t.LegacySlice=t.CompositeSlice=void 0;const e=X.exports;var r=dg;Object.defineProperty(t,"CompositeSlice",{enumerable:!0,get:function(){return(0,e.__importDefault)(r).default}});var n=hg;Object.defineProperty(t,"LegacySlice",{enumerable:!0,get:function(){return(0,e.__importDefault)(n).default}}),(0,e.__exportStar)(rM,t);var o=vg;Object.defineProperty(t,"SharedSliceRef",{enumerable:!0,get:function(){return(0,e.__importDefault)(o).default}}),t.Slice=(0,e.__importStar)(CB),t.SliceZone=(0,e.__importStar)(ZO);var i=Aa;Object.defineProperty(t,"SlicesTypes",{enumerable:!0,get:function(){return(0,e.__importDefault)(i).default}})}(gg),function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.WidgetTypes=t.Widget=t.UID=t.Slices=t.Shared=t.Nestable=t.Group=void 0;const e=X.exports;var r=id;Object.defineProperty(t,"Group",{enumerable:!0,get:function(){return(0,e.__importDefault)(r).default}}),t.Nestable=(0,e.__importStar)(_t),t.Shared=(0,e.__importStar)(AB),t.Slices=(0,e.__importStar)(gg);var n=mg;Object.defineProperty(t,"UID",{enumerable:!0,get:function(){return(0,e.__importDefault)(n).default}}),t.Widget=(0,e.__importStar)(ro);var o=te;Object.defineProperty(t,"WidgetTypes",{enumerable:!0,get:function(){return(0,e.__importDefault)(o).default}})}(Bt),function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Widgets=t.Section=void 0;const e=X.exports;(0,e.__exportStar)(Ye,t),t.Section=(0,e.__importStar)(eo),t.Widgets=(0,e.__importStar)(Bt)}(jR);function Rgt(t){return Hn(t.json)}function Egt(t,e){const r=t.json[e];if(r===void 0)throw new Error(`Cannot find a section with name '${e}'.`);return r}function wgt(t,e){return af(r=>t[r]!==void 0)(e)}function Agt(t){const e=v(t,$m(r=>r!==void 0));return new Map(cm(e))}var ae={},fM={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.EmptyContent=t.EmptyContentType=void 0,t.EmptyContentType="EmptyContent",t.EmptyContent={is:e=>e.__TYPE__===t.EmptyContentType}})(fM);var yg={},xB=Li(Nx),Ca=Li(Sk),bg={},$g={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.BooleanContentType=void 0;const e=X.exports,r=fr,n=(0,e.__importStar)(nt);t.BooleanContentType="BooleanContent";const o=new n.Type("BooleanContent",i=>{var a;return((a=i)===null||a===void 0?void 0:a.__TYPE__)===t.BooleanContentType},(i,a)=>r.Chain.chain(n.boolean.validate(i,a),u=>n.success({value:u,__TYPE__:t.BooleanContentType})),i=>n.boolean.encode(i.value));t.default=o})($g);var fd={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.EmbedContent=t.EmbedContentType=void 0;const e=X.exports,r=Dj,n=Kr,o=(0,e.__importStar)(nt),i=Pt,a=xt;t.EmbedContentType="EmbedContent",t.EmbedContent=new o.Type("EmbedContent",c=>c.__TYPE__===t.EmbedContentType,c=>(0,n.pipe)(u.decode(c),r.either.map(s=>K(_({},u.encode(s)),{all:c}))),c=>u.encode(c));const u=(0,a.addType)(o.exact(o.intersection([o.type({embed_url:o.string,type:o.string}),o.partial({version:o.union([o.string,o.number,o.null]),title:i.StringOrNull,author_name:i.StringOrNull,author_url:i.StringOrNull,provider_name:i.StringOrNull,provider_url:i.StringOrNull,cache_age:o.union([o.string,o.number,o.null]),thumbnail_url:i.StringOrNull,thumbnail_width:i.NumberOrNull,thumbnail_height:i.NumberOrNull,html:i.StringOrNull})])),t.EmbedContentType)})(fd);var Qu={};Object.defineProperty(Qu,"__esModule",{value:!0}),Qu.FieldContentType=void 0;const kB=X.exports,Cgt=Kr,WB=(0,kB.__importStar)(Ca),xgt=(0,kB.__importStar)(nt);Qu.FieldContentType="FieldContent";function kgt(t){let e=0;for(;e<t.length&&t[e]<=" ";)e++;let r=t.length;for(;e<r&&t[r-1]<=" ";)r--;return t.substring(e,r)}const Wgt={types:["Text","Date","Timestamp","Color","Number","Range","Select"],forType:(t,e)=>(0,Cgt.pipe)(WB.fromEither(xgt.string.decode(e)),WB.map(r=>({value:kgt(r),type:t,__TYPE__:"FieldContent"})))};Qu.default=Wgt;var _g={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.GeoPointContent=t.GeoPointContentType=void 0;const e=X.exports,r=(0,e.__importStar)(nt),n=xt;t.GeoPointContentType="GeoPointContent",t.GeoPointContent=(0,n.addType)(r.strict({position:r.strict({lat:r.number,lng:r.number})}),t.GeoPointContentType)})(_g);var ld={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ImageContent=t.ImageContentType=t.ImageContentView=void 0;const e=X.exports,r=(0,e.__importStar)(nt),n=Pt,o=xt,i=r.exact(r.type({id:r.string,url:r.string,width:r.number,height:r.number}));t.ImageContentView=r.exact(r.intersection([r.type({origin:i,width:r.number,height:r.number,edit:r.type({zoom:r.number,crop:r.type({x:r.number,y:r.number}),background:r.string})}),r.partial({url:r.string,credits:n.NonEmptyStringOrNull,alt:n.NonEmptyStringOrNull,provider:n.StringOrNull})])),t.ImageContentType="ImageContent",t.ImageContent=(0,o.addType)(r.intersection([t.ImageContentView,r.partial({thumbnails:r.record(r.string,t.ImageContentView)})]),t.ImageContentType)})(ld);var Sg={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.IntegrationFieldsContentType=void 0;const e=X.exports,r=fr,n=(0,e.__importStar)(nt);t.IntegrationFieldsContentType="IntegrationFieldsContent";const o=new n.Type("IntegrationFieldsContent",i=>{var a;return((a=i)===null||a===void 0?void 0:a.__TYPE__)===t.IntegrationFieldsContentType},(i,a)=>r.Chain.chain(n.string.validate(i,a),u=>n.success({value:u,__TYPE__:t.IntegrationFieldsContentType})),()=>{throw new Error("Not implemented - Not used - Not relevant")});t.default=o})(Sg);var tc={},lM={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.isDocumentLink=t.DocumentLink=t.DocumentLinkType=void 0;const e=X.exports,r=(0,e.__importStar)(nt),n=Pt,o=xt;t.DocumentLinkType="DocumentLink",t.DocumentLink=(0,o.addType)(r.strict({id:n.NonEmptyString}),t.DocumentLinkType);function i(a){return a.__TYPE__===t.DocumentLinkType}t.isDocumentLink=i})(lM);var pM={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.isExternalLink=t.ExternalLink=t.ExternalLinkType=void 0;const e=X.exports,r=(0,e.__importStar)(nt),n=Pt,o=xt;t.ExternalLinkType="ExternalLink",t.ExternalLink=(0,o.addType)(r.exact(r.intersection([r.type({url:r.string}),r.partial({kind:r.literal("web"),target:n.StringOrNull,preview:(0,o.nullable)(r.partial({title:r.string}))})])),t.ExternalLinkType);function i(a){return a.__TYPE__===t.ExternalLinkType}t.isExternalLink=i})(pM);var dM={},Tg={},Fgt=ut&&ut.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),Ngt=ut&&ut.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),Pgt=ut&&ut.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)Object.hasOwnProperty.call(t,r)&&Fgt(e,t,r);return Ngt(e,t),e};Object.defineProperty(Tg,"__esModule",{value:!0}),Tg.mapOutput=void 0;var Dgt=Pgt(nt);function Lgt(t,e,r){return r===void 0&&(r=t.name),new Dgt.Type(r,t.is,t.validate,function(n){return e(t.encode(n))})}Tg.mapOutput=Lgt,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.isFileLink=t.FileLink=t.FileLinkType=void 0;const e=X.exports,r=(0,e.__importStar)(nt),n=Tg,o=xt;t.FileLinkType="FileLink",t.FileLink=(0,n.mapOutput)(r.exact(r.intersection([r.type({id:r.string,url:r.string,name:r.string,kind:r.string}),r.partial({date:(0,o.nullable)(r.string),size:(0,o.nullable)(r.string)})])),a=>K(_({},a),{size:a.size||"0",__TYPE__:t.FileLinkType}));function i(a){return a.__TYPE__===t.FileLinkType}t.isFileLink=i}(dM);var hM={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.isImageLink=t.ImageLink=t.ImageLinkType=void 0;const e=X.exports,r=(0,e.__importStar)(nt),n=Pt,o=xt;t.ImageLinkType="ImageLink",t.ImageLink=(0,o.addType)(r.exact(r.intersection([r.type({id:r.string,url:r.string,height:r.string,width:r.string,size:r.string,name:r.string,kind:r.string}),r.partial({date:n.StringOrNull})])),t.ImageLinkType);function i(a){return a.__TYPE__===t.ImageLinkType}t.isImageLink=i})(hM);var vM={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.LinkContent=t.LinkContentType=void 0;const e=X.exports,r=fr,n=(0,e.__importStar)(nt),o=tc;t.LinkContentType="LinkContent",t.LinkContent=new n.Type("LinkContent",i=>{var a;return o.Link.is((a=i)===null||a===void 0?void 0:a.value)},(i,a)=>r.Chain.chain(o.Link.validate(i,a),u=>n.success({value:u,__TYPE__:t.LinkContentType})),i=>o.Link.encode(i.value))})(vM),function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.LinksTypes=t.is=t.BROKEN_CUSTOM_TYPE=t.LinkContent=t.ImageLink=t.FileLink=t.ExternalLink=t.DocumentLink=t.Link=void 0;const e=X.exports,r=(0,e.__importStar)(nt),n=lM,o=pM,i=dM,a=hM,u=vM;t.Link=r.union([a.ImageLink,i.FileLink,n.DocumentLink,o.ExternalLink]);var c=lM;Object.defineProperty(t,"DocumentLink",{enumerable:!0,get:function(){return c.DocumentLink}});var s=pM;Object.defineProperty(t,"ExternalLink",{enumerable:!0,get:function(){return s.ExternalLink}});var f=dM;Object.defineProperty(t,"FileLink",{enumerable:!0,get:function(){return f.FileLink}});var l=hM;Object.defineProperty(t,"ImageLink",{enumerable:!0,get:function(){return l.ImageLink}});var p=vM;Object.defineProperty(t,"LinkContent",{enumerable:!0,get:function(){return p.LinkContent}}),t.BROKEN_CUSTOM_TYPE="broken_type",t.is={documentLink:n.isDocumentLink,fileLink:i.isFileLink,externalLink:o.isExternalLink,imageLink:a.isImageLink},t.LinksTypes={DocumentLink:n.DocumentLinkType,FileLink:i.FileLinkType,ExternalLink:o.ExternalLinkType,ImageLink:a.ImageLinkType,LinkContent:u.LinkContentType}}(tc);var Ig={},ec={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Block=t.TextBlock=t.checkEmbedBlock=t.EmbedBlock=t.checkImageBlock=t.ImageBlock=t.ValidatedMetas=t.Span=t.Meta=void 0;const e=X.exports,r=(0,e.__importStar)(qo),n=(0,e.__importStar)(nt),o=_t,i=Pt,a=xt,u=fd,c=ld,s=tc;t.Meta=n.exact(n.intersection([n.partial({data:n.unknown}),n.type({start:n.number,end:n.number,type:o.RichTextNodeTypeCodec})])),t.Span=t.Meta,t.ValidatedMetas=new n.Type("ValidatedMetas",p=>Array.isArray(p)&&p.every(t.Meta.is),(p,d)=>{if(Array.isArray(p)){const h=p.reduce((m,g)=>{const b=t.Meta.decode(g);if(r.isRight(b)){const $=b.right;if($.data&&$.type==="hyperlink"&&r.isRight(s.Link.validate($.data,d))||$.type!=="hyperlink")return[...m,$]}return m},[]).sort((m,g)=>m.start-g.start);return n.success(h)}else return n.failure(p,d)},p=>n.array(t.Meta).encode(p)),t.ImageBlock=n.exact(n.intersection([n.type({type:n.literal(o.RichTextNodeType.image),data:n.intersection([c.ImageContentView,n.partial({linkTo:(0,a.nullable)(s.Link)})])}),n.partial({label:i.StringOrNull,direction:i.StringOrNull})]));function f(p){return p.type===o.RichTextNodeType.image}t.checkImageBlock=f,t.EmbedBlock=n.exact(n.intersection([n.type({type:n.literal(o.RichTextNodeType.embed),data:u.EmbedContent}),n.partial({label:i.StringOrNull,direction:i.StringOrNull})]));function l(p){return p.type===o.RichTextNodeType.embed}t.checkEmbedBlock=l,t.TextBlock=n.exact(n.intersection([n.type({type:(0,a.refineType)(o.RichTextNodeTypeCodec,`string which isn't ${o.RichTextNodeType.image} ${o.RichTextNodeType.embed}`,p=>p!==o.RichTextNodeType.image&&p!==o.RichTextNodeType.embed),content:n.intersection([n.type({text:n.string}),n.partial({spans:t.ValidatedMetas})])}),n.partial({label:n.string,direction:n.string})])),t.Block=n.union([t.ImageBlock,t.EmbedBlock,t.TextBlock])})(ec),function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Blocks=t.StructuredTextContent=t.StructuredTextContentType=void 0;const e=X.exports,r=fr,n=(0,e.__importStar)(nt),o=ec;t.StructuredTextContentType="StructuredTextContent",t.StructuredTextContent=new n.Type(t.StructuredTextContentType,i=>{var a;return((a=i)===null||a===void 0?void 0:a.__TYPE__)===t.StructuredTextContentType},(i,a)=>r.Chain.chain(n.array(o.Block).validate(i,a),u=>n.success({value:u,__TYPE__:t.StructuredTextContentType})),()=>{throw new Error("NotImplementedError: Not relevant method")}),t.Blocks=(0,e.__importStar)(ec)}(Ig);var Og={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.UIDContent=t.UIDContentType=void 0;const e=X.exports,r=fr,n=(0,e.__importStar)(nt);t.UIDContentType="UIDContent",t.UIDContent=new n.Type("UIDContent",o=>{var i;return((i=o)===null||i===void 0?void 0:i.__TYPE__)===t.UIDContentType},(o,i)=>r.Chain.chain(n.string.validate(o,i),a=>n.success({value:a,__TYPE__:"UIDContent"})),o=>o.value)})(Og),function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.SimpleWidgetContent=t.is=t.SimpleWidgetContentType=void 0;const e=X.exports,r=Kr,n=(0,e.__importStar)(Ca),o=(0,e.__importStar)(nt),i=(0,e.__importDefault)($g),a=fd,u=(0,e.__importDefault)(Qu),c=_g,s=ld,f=(0,e.__importDefault)(Sg),l=tc,p=Ig,d=Og;t.SimpleWidgetContentType=["EmptyContent","ImageContent","GeoPointContent","EmbedContent","BooleanContent","IntegrationFieldsContent","StructuredTextContent","LinkContent","UIDContent","SeparatorContent","FieldContent"];function h(g){const b=g;return t.SimpleWidgetContentType.includes(b.__TYPE__)}t.is=h;const m=o.type({value:o.null});t.SimpleWidgetContent={from:(g,b)=>{if(b===null||m.is(b)){const $={type:g,__TYPE__:"EmptyContent"};return n.some($)}switch(g){case"StructuredText":return n.fromEither(p.StructuredTextContent.decode(b));case"IntegrationFields":return n.fromEither(f.default.decode(b));case"Image":return(0,r.pipe)(n.fromEither(s.ImageContent.decode(b)),n.map($=>s.ImageContent.encode($)));case"GeoPoint":return(0,r.pipe)(n.fromEither(c.GeoPointContent.decode(b)),n.map($=>c.GeoPointContent.encode($)));case"Embed":return n.fromEither(a.EmbedContent.decode(b));case"Link":return n.fromEither(l.LinkContent.decode(b));case"UID":return n.fromEither(d.UIDContent.decode(b));case"Separator":return n.some({__TYPE__:"SeparatorContent"});case"Boolean":return n.fromEither(i.default.decode(b));default:return u.default.types.includes(g)?u.default.forType(g,b):n.none}},is:g=>t.SimpleWidgetContentType.includes(g.__TYPE__)}}(bg),function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.GroupContent=t.GroupContentType=t.GroupItemContentType=void 0;const e=X.exports,r=(0,e.__importStar)(xB),n=(0,e.__importStar)(Ca),o=(0,e.__importStar)(nt),i=bg;t.GroupItemContentType="GroupItemContent",t.GroupContentType="GroupContentType",t.GroupContent=Object.freeze({itemsContentsFromJson:(a,u,c,s)=>u?u.map(f=>{if(typeof f=="object"&&f!==null){const p=Object.entries(f).sort(([d],[h])=>{var m,g;const b=(m=s.get(`${a}.${d}`))!==null&&m!==void 0?m:1e4,$=(g=s.get(`${a}.${h}`))!==null&&g!==void 0?g:1e4;return b-$}).map(([d,h])=>{const m=c.get(`${a}.${d}`);return m?n.map(g=>[d,g])(i.SimpleWidgetContent.from(m,h)):n.none});return{__TYPE__:"GroupItemContent",value:r.compact(p)}}else return{__TYPE__:"GroupItemContent",value:[]}}):[],fromJson:(a,u,c,s,f)=>{const l=Array.of(a,[u]).flat().join("."),p=n.fromEither(o.array(o.unknown).decode(c));return n.map(d=>({value:t.GroupContent.itemsContentsFromJson(l,d,s,f),__TYPE__:t.GroupContentType}))(p)}})}(yg);var _i={},rc={};Object.defineProperty(rc,"__esModule",{value:!0}),rc.SeparatorContent=rc.SeparatorContentType=void 0,rc.SeparatorContentType="SeparatorContent",rc.SeparatorContent={is(t){return t.__TYPE__==="SeparatorContent"}},function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.NestableTypes=t.Links=t.IntegrationFieldsContent=t.ImageContentView=t.ImageContent=t.GeoPointContent=t.FieldContent=t.BooleanContent=void 0;const e=X.exports,r=$g,n=fd,o=Qu,i=_g,a=ld,u=Sg,c=tc,s=rc,f=Ig;var l=$g;Object.defineProperty(t,"BooleanContent",{enumerable:!0,get:function(){return(0,e.__importDefault)(l).default}}),(0,e.__exportStar)(fd,t);var p=Qu;Object.defineProperty(t,"FieldContent",{enumerable:!0,get:function(){return(0,e.__importDefault)(p).default}});var d=_g;Object.defineProperty(t,"GeoPointContent",{enumerable:!0,get:function(){return d.GeoPointContent}});var h=ld;Object.defineProperty(t,"ImageContent",{enumerable:!0,get:function(){return h.ImageContent}}),Object.defineProperty(t,"ImageContentView",{enumerable:!0,get:function(){return h.ImageContentView}});var m=Sg;Object.defineProperty(t,"IntegrationFieldsContent",{enumerable:!0,get:function(){return(0,e.__importDefault)(m).default}}),t.Links=(0,e.__importStar)(tc),(0,e.__exportStar)(rc,t),(0,e.__exportStar)(Ig,t),t.NestableTypes={Links:c.LinksTypes,StructuredText:f.StructuredTextContentType,Boolean:r.BooleanContentType,Embed:n.EmbedContentType,Field:o.FieldContentType,GeoPoint:i.GeoPointContentType,Image:a.ImageContentType,IntegrationFields:u.IntegrationFieldsContentType,Separator:s.SeparatorContentType}}(_i);var mM={},pd={},vf={};Object.defineProperty(vf,"__esModule",{value:!0});const Ugt=X.exports,jgt=(0,Ugt.__importStar)(Ca),FB=yg,NB=bg,Bgt={fromJson:(t,e,r,n,o)=>{const i=Array.of(t,[e]).flat().join("."),a=n.get(i);return a==="Group"?FB.GroupContent.fromJson(t,e,r,n,o):a?NB.SimpleWidgetContent.from(a,r):jgt.none},is:t=>NB.SimpleWidgetContent.is(t)||FB.GroupContentType===t.__TYPE__};vf.default=Bgt;var nc={};Object.defineProperty(nc,"__esModule",{value:!0}),nc.CompositeSliceContent=nc.CompositeSliceContentType=void 0;const PB=X.exports,zgt=fr,gM=(0,PB.__importStar)(Ca),dd=(0,PB.__importStar)(nt),DB=ae;nc.CompositeSliceContentType="CompositeSliceContent";const qgt=dd.exact(dd.partial({repeat:dd.array(dd.unknown),"non-repeat":dd.UnknownRecord}));nc.CompositeSliceContent={fromJson:(t,e,r,n,o)=>{var i;const a=Array.of(t,[e,"repeat"]).flat().join("."),u=qgt.decode(r);if((0,zgt.isRight)(u)){const c=u.right.repeat,s=(i=u.right["non-repeat"])!==null&&i!==void 0?i:{},f=DB.GroupContent.itemsContentsFromJson(a,c,n,o),p=Object.entries(s).sort(([d],[h])=>{var m,g;const b=(m=o.get(`${Array.of(t,[e]).flat().join(".")}.${d}`))!==null&&m!==void 0?m:1e4,$=(g=o.get(`${Array.of(t,[e]).flat().join(".")}.${h}`))!==null&&g!==void 0?g:1e4;return b-$}).reduce((d,[h,m])=>{const g=Array.of(t,[e,"non-repeat",h]).flat().join("."),b=n.get(g);if(b){const $=DB.SimpleWidgetContent.from(b,m);gM.isSome($)&&(d[h]=$.value)}return d},{});return gM.some({repeat:f,nonRepeat:p,__TYPE__:"CompositeSliceContent"})}else return gM.none}};var oc={},LB=rh(Dn,function(t){return t.length>0},"NonEmptyString");function UB(t,e){e===void 0&&(e="NonEmptyArray<"+t.name+">");var r=oh(t);return new pt(e,function(n){return r.is(n)&&ge(n)},function(n,o){return it(r.validate(n,o),hn(function(i){var a=$$(i);return It(a)?Ft(n,o):ht(a.value)}))},function(n){return r.encode(n)})}function jB(t,e,r){r===void 0&&(r="Set<"+t.name+">");var n=oh(t),o=OL(e),i=SL(e);return new pt(r,function(a){return a instanceof Set&&IL(t.is)(a)},function(a,u){return it(n.validate(a,u),hn(function(c){var s=i(c);return s.size!==c.length?Ft(a,u):ht(s)}))},function(a){return n.encode(o(a))})}function Kgt(t,e,r){return r===void 0&&(r="ReadonlySet<"+t.name+">"),jB(t,e,r)}function yM(t,e){return new pt(t,e,function(r,n){return e(r)?ht(r):Ft(r,n)},Tt)}var Vgt=function(t){return t instanceof Date},Hgt=yM("Date",Vgt),Jgt=globalThis&&globalThis.__spreadArrays||function(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;for(var n=Array(t),o=0,e=0;e<r;e++)for(var i=arguments[e],a=0,u=i.length;a<u;a++,o++)n[o]=i[a];return n},Ggt=function(t,e){return{get:t,reverseGet:e}},BB=function(t){return xa(t.get,H(t.reverseGet,Or))},Ygt=function(t){return ic(H(t.get,Jt),t.reverseGet)},Xgt=function(t){return Si(H(t.get,Jt),H(t.reverseGet,Or))},Zgt=function(t){return mf(function(e){return function(r){return function(n){return e.map(r(t.get(n)),function(o){return t.reverseGet(o)})}}})},xa=function(t,e){return{get:t,set:e}},bM=function(t){return Si(H(t.get,Jt),t.set)},Qgt=function(t){return mf(function(e){return function(r){return function(n){return e.map(r(t.get(n)),function(o){return t.set(o)(n)})}}})},zB=function(t){return function(e){return xa(function(r){return t.get(e.get(r))},function(r){return function(n){return e.set(t.set(r)(e.get(n)))(n)}})}},tyt=function(t){return function(e){return ic(H(e.getOption,Hl(t.getOption)),H(t.reverseGet,e.reverseGet))}},eyt=function(t){return function(e){return ac($M(t))(bM(e))}},ryt=function(){return xa(j,Or)},nyt=function(t){return function(e){return xa(function(r){return e.get(r)[t]},function(r){return function(n){var o,i=e.get(n);return r===i[t]?n:e.set(Object.assign({},i,(o={},o[t]=r,o)))(n)}})}},oyt=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(r){return xa(function(n){for(var o=r.get(n),i={},a=0,u=t;a<u.length;a++){var c=u[a];i[c]=o[c]}return i},function(n){return function(o){for(var i=r.get(o),a=0,u=t;a<u.length;a++){var c=u[a];if(n[c]!==i[c])return r.set(Object.assign({},i,n))(o)}return o}})}},iyt=function(t){return function(e){return xa(function(r){return e.get(r)[t]},function(r){return function(n){var o=e.get(n);if(r===o[t])return n;var i=o.slice();return i[t]=r,e.set(i)(n)}})}},ayt=function(t){return function(e){return it(e,zB(Eyt().at(t)))}},ic=function(t,e){return{getOption:t,reverseGet:e}},$M=function(t){return Si(t.getOption,function(e){return KB(e)(t)})},qB=function(t){return mf(function(e){return function(r){return function(n){return it(t.getOption(n),Zo(function(){return e.of(n)},function(o){return e.map(r(o),function(i){return KB(i)(t)(n)})}))}}})},uyt=function(t){return function(e){return function(r){return it(e.getOption(r),bo(function(n){var o=t(n);return o===n?r:e.reverseGet(o)}))}}},cyt=function(t){return function(e){var r=uyt(t)(e);return function(n){return it(r(n),Q_(function(){return n}))}}},KB=function(t){return cyt(function(){return t})},syt=function(t){return function(e){return ac(bM(t))($M(e))}},fyt=function(){return ic(lu,j)},_M=function(t){return ic(sv(t),j)},lyt=function(){return ic(j,Jt)},pyt=function(){return ic(Yl,Ct)},dyt=function(){return ic(function(t){return et(t)?Jt(t.left):Dt},ne)},Si=function(t,e){return{getOption:t,set:e}},hyt=function(t){return mf(function(e){return function(r){return function(n){return it(t.getOption(n),Zo(function(){return e.of(n)},function(o){return e.map(r(o),function(i){return t.set(i)(n)})}))}}})},VB=function(t){return function(e){return function(r){return it(e.getOption(r),bo(function(n){var o=t(n);return o===n?r:e.set(o)(r)}))}}},HB=function(t){return function(e){var r=VB(t)(e);return function(n){return it(r(n),Q_(function(){return n}))}}},ac=function(t){return function(e){return Si(H(e.getOption,Hl(t.getOption)),function(r){return HB(t.set(r))(e)})}},vyt=function(t){return function(e){return it(e,ac(Iyt().index(t)))}},myt=function(t){return function(e){return it(e,ac(Oyt().index(t)))}},gyt=function(t){return function(e){return it(e,ac(Myt().index(t)))}},yyt=function(t){return Si(jh(t),function(e){return function(r){return it(Uh(t)(r),Zo(function(){return r},function(n){return Qh(n,e,r)}))}})},JB=function(t,e,r){if(r[t]===e)return r;var n=Jgt([r[0]],r.slice(1));return n[t]=e,n},byt=function(t){return Si(jh(t),function(e){return function(r){return it(Uh(t)(r),Zo(function(){return r},function(n){return JB(n,e,r)}))}})},mf=function(t){return{modifyF:t}};function SM(t){return function(e){return mf(function(r){return function(n){return e.modifyF(r)(t.modifyF(r)(n))}})}}var $yt={URI:"Identity",map:function(t,e){return e(t)},of:j,ap:function(t,e){return t(e)}},_yt=function(t){return t.URI==="Identity"};function Syt(t){return function(){return mf(function(e){var r=_yt(e)?t.map:t.traverse(e);return function(n){return function(o){return r(o,n)}}})}}function Tyt(t){return SM(Syt(t)())}var TM=function(t){return{index:t}},Iyt=function(){return TM(function(t){return Si(function(e){return au(t,e)},function(e){return function(r){return it(au(t,r),Zo(function(){return r},function(){return Qh(t,e,r)}))}})})},Oyt=function(){return TM(function(t){return Si(function(e){return au(t,e)},function(e){return function(r){return it(au(t,r),Zo(function(){return r},function(){return JB(t,e,r)}))}})})},Myt=function(){return TM(function(t){return Si(function(e){return Au(t,e)},function(e){return function(r){return r[t]===e||It(Au(t,r))?r:PT(t,e)(r)}})})},Ryt=function(t){return{at:t}};function Eyt(){return Ryt(function(t){return xa(function(e){return Au(t,e)},Zo(function(){return sm(t)},function(e){return PT(t,e)}))})}var GB=Ggt,IM=BB,OM=Ygt,MM=Xgt,RM=Zgt,wyt=function(t){return function(e){return GB(H(e.get,t.get),H(t.reverseGet,e.reverseGet))}},Ayt=function(t){return GB(t.reverseGet,t.get)},Cyt=function(t){return function(e){return function(r){return e.reverseGet(t(e.get(r)))}}},YB=xa,Mg=ryt,ka=bM,gf=Qgt,uc=zB,xyt=uc,kyt=H(BB,uc),cc=eyt,EM=function(t){return H(ka,ac(t))},Wyt=function(t){return H(gf,SM(t))},XB=function(t){return function(e){return function(r){var n=e.get(r),o=t(n);return n===o?r:e.set(o)(r)}}};function Fyt(t){return function(e){return function(r){return function(n){return it(r.get(n),e,function(o){return t.map(o,function(i){return r.set(i)(n)})})}}}}var Nyt=function(t){return cc(fyt())(t)};function Pyt(t){return cc(_M(t))}var ZB=nyt,QB=oyt,Dyt=iyt,Lyt=function(t){return H(ka,vyt(t))},Uyt=function(t){return H(ka,myt(t))},jyt=function(t){return H(ka,gyt(t))},Byt=ayt,zyt=cc(lyt()),qyt=cc(pyt()),Kyt=cc(dyt());function Vyt(t){return H(gf,Tyt(t))}function Hyt(t){return EM(yyt(t))}function Jyt(t){return EM(byt(t))}var Gyt=function(t,e){return function(r){return tz(r,t,e)}},tz=function(t,e,r){return YB(H(t.get,e),H(r,t.set))},Rg="monocle-ts/Lens",Yyt={URI:Rg,imap:tz},ez={URI:Rg,compose:function(t,e){return uc(t)(e)}},Xyt={URI:Rg,compose:ez.compose,id:Mg},Zyt=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module",lens:YB,id:Mg,asOptional:ka,asTraversal:gf,compose:uc,composeLens:xyt,composeIso:kyt,composePrism:cc,composeOptional:EM,composeTraversal:Wyt,modify:XB,modifyF:Fyt,fromNullable:Nyt,filter:Pyt,prop:ZB,props:QB,component:Dyt,index:Lyt,indexNonEmpty:Uyt,key:jyt,atKey:Byt,some:zyt,right:qyt,left:Kyt,traverse:Vyt,findFirst:Hyt,findFirstNonEmpty:Jyt,imap:Gyt,URI:Rg,Invariant:Yyt,Semigroupoid:ez,Category:Xyt}),rz=hyt,sc=ac,Qyt=VB,tbt=HB,ebt=_M,wM=$M,AM=qB,CM=tyt,rbt=syt,Ti=SM,nz=function(t){return function(e){return e.modifyF($yt)(t)}},nbt=function(t){return nz(function(){return t})};function obt(t){return Ti(qB(_M(t)))}var oz=function(t){return new az(t.get,t.reverseGet)},yf=function(t){return new xM(t.get,t.set)},hd=function(t){return new uz(t.getOption,t.reverseGet)},On=function(t){return new ibt(t.getOption,t.set)},on=function(t){return new abt(t.modifyF)},iz=function(t,e,r){var n;return r===t[e]?t:Object.assign({},t,(n={},n[e]=r,n))},az=function(){function t(e,r){this.get=e,this.reverseGet=r,this._tag="Iso",this.unwrap=this.get,this.to=this.get,this.wrap=this.reverseGet,this.from=this.reverseGet}return t.prototype.reverse=function(){return oz(Ayt(this))},t.prototype.modify=function(e){return Cyt(e)(this)},t.prototype.asLens=function(){return yf(IM(this))},t.prototype.asPrism=function(){return hd(OM(this))},t.prototype.asOptional=function(){return On(MM(this))},t.prototype.asTraversal=function(){return on(RM(this))},t.prototype.asFold=function(){var e=this;return new bf(function(){return function(r){return function(n){return r(e.get(n))}}})},t.prototype.asGetter=function(){var e=this;return new sz(function(r){return e.get(r)})},t.prototype.asSetter=function(){var e=this;return new vd(function(r){return e.modify(r)})},t.prototype.compose=function(e){return oz(wyt(e)(this))},t.prototype.composeIso=function(e){return this.compose(e)},t.prototype.composeLens=function(e){return yf(it(this,IM,uc(e)))},t.prototype.composePrism=function(e){return hd(it(this,OM,CM(e)))},t.prototype.composeOptional=function(e){return On(it(this,MM,sc(e)))},t.prototype.composeTraversal=function(e){return on(it(this,RM,Ti(e)))},t.prototype.composeFold=function(e){return this.asFold().compose(e)},t.prototype.composeGetter=function(e){return this.asGetter().compose(e)},t.prototype.composeSetter=function(e){return this.asSetter().compose(e)},t}(),xM=function(){function t(e,r){this.get=e,this.set=r,this._tag="Lens"}return t.fromPath=function(){var e=t.fromProp();return function(r){var n=e(r[0]);return r.slice(1).reduce(function(o,i){return o.compose(e(i))},n)}},t.fromProp=function(){return function(e){return yf(it(Mg(),ZB(e)))}},t.fromProps=function(){return function(e){return yf(it(Mg(),QB.apply(Zyt,e)))}},t.fromNullableProp=function(){return function(e,r){return new t(function(n){var o=lu(n[e]);return It(o)?r:o.value},function(n){return function(o){return iz(o,e,n)}})}},t.prototype.modify=function(e){return XB(e)(this)},t.prototype.asOptional=function(){return On(ka(this))},t.prototype.asTraversal=function(){return on(gf(this))},t.prototype.asSetter=function(){var e=this;return new vd(function(r){return e.modify(r)})},t.prototype.asGetter=function(){var e=this;return new sz(function(r){return e.get(r)})},t.prototype.asFold=function(){var e=this;return new bf(function(){return function(r){return function(n){return r(e.get(n))}}})},t.prototype.compose=function(e){return yf(uc(e)(this))},t.prototype.composeLens=function(e){return this.compose(e)},t.prototype.composeGetter=function(e){return this.asGetter().compose(e)},t.prototype.composeFold=function(e){return this.asFold().compose(e)},t.prototype.composeOptional=function(e){return On(it(this,ka,sc(e)))},t.prototype.composeTraversal=function(e){return on(it(this,gf,Ti(e)))},t.prototype.composeSetter=function(e){return this.asSetter().compose(e)},t.prototype.composeIso=function(e){return yf(it(this,uc(it(e,IM))))},t.prototype.composePrism=function(e){return On(cc(e)(this))},t}(),uz=function(){function t(e,r){this.getOption=e,this.reverseGet=r,this._tag="Prism"}return t.fromPredicate=function(e){return hd(ebt(e))},t.some=function(){return cz},t.prototype.modify=function(e){var r=this;return function(n){var o=r.modifyOption(e)(n);return It(o)?n:o.value}},t.prototype.modifyOption=function(e){var r=this;return function(n){return $k.map(r.getOption(n),function(o){var i=e(o);return i===o?n:r.reverseGet(i)})}},t.prototype.set=function(e){return this.modify(function(){return e})},t.prototype.asOptional=function(){return On(wM(this))},t.prototype.asTraversal=function(){return on(AM(this))},t.prototype.asSetter=function(){var e=this;return new vd(function(r){return e.modify(r)})},t.prototype.asFold=function(){var e=this;return new bf(function(r){return function(n){return function(o){var i=e.getOption(o);return It(i)?r.empty:n(i.value)}}})},t.prototype.compose=function(e){return hd(CM(e)(this))},t.prototype.composePrism=function(e){return this.compose(e)},t.prototype.composeOptional=function(e){return On(it(this,wM,sc(e)))},t.prototype.composeTraversal=function(e){return on(it(this,AM,Ti(e)))},t.prototype.composeFold=function(e){return this.asFold().compose(e)},t.prototype.composeSetter=function(e){return this.asSetter().compose(e)},t.prototype.composeIso=function(e){return hd(it(this,CM(it(e,OM))))},t.prototype.composeLens=function(e){return On(rbt(e)(this))},t.prototype.composeGetter=function(e){return this.asFold().compose(e.asFold())},t}(),cz=new uz(j,Jt),ibt=function(){function t(e,r){this.getOption=e,this.set=r,this._tag="Optional"}return t.fromPath=function(){var e=t.fromNullableProp();return function(r){var n=e(r[0]);return r.slice(1).reduce(function(o,i){return o.compose(e(i))},n)}},t.fromNullableProp=function(){return function(e){return new t(function(r){return lu(r[e])},function(r){return function(n){return n[e]==null?n:iz(n,e,r)}})}},t.fromOptionProp=function(){var e=xM.fromProp();return function(r){return e(r).composePrism(cz)}},t.prototype.modify=function(e){return tbt(e)(this)},t.prototype.modifyOption=function(e){return Qyt(e)(this)},t.prototype.asTraversal=function(){return on(rz(this))},t.prototype.asFold=function(){var e=this;return new bf(function(r){return function(n){return function(o){var i=e.getOption(o);return It(i)?r.empty:n(i.value)}}})},t.prototype.asSetter=function(){var e=this;return new vd(function(r){return e.modify(r)})},t.prototype.compose=function(e){return On(sc(e)(this))},t.prototype.composeOptional=function(e){return this.compose(e)},t.prototype.composeTraversal=function(e){return on(it(this,rz,Ti(e)))},t.prototype.composeFold=function(e){return this.asFold().compose(e)},t.prototype.composeSetter=function(e){return this.asSetter().compose(e)},t.prototype.composeLens=function(e){return On(it(this,sc(it(e,ka))))},t.prototype.composePrism=function(e){return On(it(this,sc(it(e,wM))))},t.prototype.composeIso=function(e){return On(it(this,sc(it(e,MM))))},t.prototype.composeGetter=function(e){return this.asFold().compose(e.asFold())},t}(),abt=function(){function t(e){this.modifyF=e,this._tag="Traversal"}return t.prototype.modify=function(e){return nz(e)(this)},t.prototype.set=function(e){return nbt(e)(this)},t.prototype.filter=function(e){return on(obt(e)(this))},t.prototype.asFold=function(){var e=this;return new bf(function(r){return function(n){return e.modifyF(Ik(r))(function(o){return vs(n(o))})}})},t.prototype.asSetter=function(){var e=this;return new vd(function(r){return e.modify(r)})},t.prototype.compose=function(e){return on(Ti(e)(this))},t.prototype.composeTraversal=function(e){return this.compose(e)},t.prototype.composeFold=function(e){return this.asFold().compose(e)},t.prototype.composeSetter=function(e){return this.asSetter().compose(e)},t.prototype.composeOptional=function(e){return this.compose(e.asTraversal())},t.prototype.composeLens=function(e){return on(it(this,Ti(it(e,gf))))},t.prototype.composePrism=function(e){return on(it(this,Ti(it(e,AM))))},t.prototype.composeIso=function(e){return on(it(this,Ti(it(e,RM))))},t.prototype.composeGetter=function(e){return this.asFold().compose(e.asFold())},t}(),sz=function(){function t(e){this.get=e,this._tag="Getter"}return t.prototype.asFold=function(){var e=this;return new bf(function(){return function(r){return function(n){return r(e.get(n))}}})},t.prototype.compose=function(e){var r=this;return new t(function(n){return e.get(r.get(n))})},t.prototype.composeGetter=function(e){return this.compose(e)},t.prototype.composeFold=function(e){return this.asFold().compose(e)},t.prototype.composeLens=function(e){return this.compose(e.asGetter())},t.prototype.composeIso=function(e){return this.compose(e.asGetter())},t.prototype.composeTraversal=function(e){return this.asFold().compose(e.asFold())},t.prototype.composeOptional=function(e){return this.asFold().compose(e.asFold())},t.prototype.composePrism=function(e){return this.asFold().compose(e.asFold())},t}(),bf=function(){function t(e){this.foldMap=e,this._tag="Fold",this.getAll=e(C_())(Qi),this.exist=e(rN),this.all=e(eN),this.foldMapFirst=e(_k())}return t.prototype.compose=function(e){var r=this;return new t(function(n){return function(o){return r.foldMap(n)(e.foldMap(n)(o))}})},t.prototype.composeFold=function(e){return this.compose(e)},t.prototype.composeGetter=function(e){return this.compose(e.asFold())},t.prototype.composeTraversal=function(e){return this.compose(e.asFold())},t.prototype.composeOptional=function(e){return this.compose(e.asFold())},t.prototype.composeLens=function(e){return this.compose(e.asFold())},t.prototype.composePrism=function(e){return this.compose(e.asFold())},t.prototype.composeIso=function(e){return this.compose(e.asFold())},t.prototype.find=function(e){return this.foldMapFirst(sv(e))},t.prototype.headOption=function(e){return this.find(function(){return!0})(e)},t}(),vd=function(){function t(e){this.modify=e,this._tag="Setter"}return t.prototype.set=function(e){return this.modify(Or(e))},t.prototype.compose=function(e){var r=this;return new t(function(n){return r.modify(e.modify(n))})},t.prototype.composeSetter=function(e){return this.compose(e)},t.prototype.composeTraversal=function(e){return this.compose(e.asSetter())},t.prototype.composeOptional=function(e){return this.compose(e.asSetter())},t.prototype.composeLens=function(e){return this.compose(e.asSetter())},t.prototype.composePrism=function(e){return this.compose(e.asSetter())},t.prototype.composeIso=function(e){return this.compose(e.asSetter())},t}(),ubt=new az(Fc,Fc);function cbt(){return ubt}function sbt(t,e){e===void 0&&(e="fromNewtype("+t.name+")");var r=cbt();return new pt(e,function(n){return t.is(n)},function(n,o){return it(t.validate(n,o),ru(r.wrap))},function(n){return t.encode(r.unwrap(n))})}var fbt=gl({_tag:vl("None")}),lbt=vl("Some");function fz(t,e){return e===void 0&&(e="Option<"+t.name+">"),ml([fbt,gl({_tag:lbt,value:t},"Some<"+t.name+">")],e)}function pbt(t,e){return e===void 0&&(e="Option<"+t.name+">"),new pt(e,fz(t).is,function(r,n){return r==null?ht(Dt):it(t.validate(r,n),ru(Jt))},function(r){return mk(it(r,bo(t.encode)))})}var dbt=new pt("DateFromISOString",function(t){return t instanceof Date},function(t,e){return it(Dn.validate(t,e),hn(function(r){var n=new Date(r);return isNaN(n.getTime())?Ft(t,e):ht(n)}))},function(t){return t.toISOString()});function hbt(t,e){return e===void 0&&(e="ReadonlyNonEmptyArray<"+t.name+">"),UB(t,e)}function lz(t){var e=Object.create(Object.getPrototypeOf(t));return Object.assign(e,t),e}var vbt=new pt("DateFromNumber",function(t){return t instanceof Date},function(t,e){return it(ou.validate(t,e),hn(function(r){var n=new Date(r);return isNaN(n.getTime())?Ft(t,e):ht(n)}))},function(t){return t.getTime()});function Eg(t,e,r){r===void 0&&(r=t.name);var n=lz(t);return n.validate=e,n.decode=function(o){return e(o,yw(n))},n.name=r,n}function mbt(t,e,r){return r===void 0&&(r="withFallback("+t.name+")"),Eg(t,function(n,o){return ME(function(){return ht(e)})(t.validate(n,o))},r)}var gbt=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,ybt=rh(Dn,function(t){return gbt.test(t)},"UUID");function bbt(t,e,r){return r===void 0&&(r="fromNullable("+t.name+")"),Eg(t,function(n,o){return n==null?ht(e):t.validate(n,o)},r)}var $bt=new pt("BooleanFromString",eh.is,function(t,e){return it(Dn.validate(t,e),hn(function(r){return r==="true"?ht(!0):r==="false"?ht(!1):Ft(t,e)}))},String);function _bt(t,e){return Eg(t,function(r,n){return pl(function(){return[{value:r,context:n,message:e(r,n),actual:r}]})(t.validate(r,n))})}function pz(t){switch(t._tag){case"InterfaceType":return t.props;case"ExactType":return pz(t.type)}}var Sbt=xM.fromProp();function Tbt(t){var e={};for(var r in pz(t))e[r]=Sbt(r);return e}var Ibt=function(t){return Object.prototype.toString.call(t)==="[object RegExp]"},Obt=yM("RegExp",Ibt),Mbt=new pt("DateFromUnixTime",function(t){return t instanceof Date},function(t,e){return it(nh.validate(t,e),hn(function(r){var n=new Date(r*1e3);return isNaN(n.getTime())?Ft(t,e):ht(n)}))},function(t){return Math.floor(t.getTime()/1e3)}),kM=new pt("NumberFromString",ou.is,function(t,e){return it(Dn.validate(t,e),hn(function(r){var n=+r;return isNaN(n)||r.trim()===""?Ft(t,e):ht(n)}))},String),Rbt=new pt("IntFromString",nh.is,function(t,e){return it(kM.validate(t,e),hn(function(r){return nh.is(r)?ht(r):Ft(t,e)}))},kM.encode),dz=Ob("JsonArray",function(){return hw(wg)}),hz=Ob("JsonRecord",function(){return Eb(Dn,wg)}),wg=ml([eh,ou,Dn,Tb,dz,hz],"Json"),Ebt=new pt("JsonFromString",wg.is,function(t,e){try{return ht(JSON.parse(t))}catch{return Ft(t,e)}},function(t){return JSON.stringify(t)}),wbt=vl("Left"),Abt=vl("Right");function Cbt(t,e,r){return r===void 0&&(r="Either<"+t.name+", "+e.name+">"),ml([gl({_tag:wbt,left:t},"Left<"+t.name+">"),gl({_tag:Abt,right:e},"Right<"+t.name+">")],r)}var xbt=new pt("BigIntFromString",function(t){return typeof t=="bigint"},function(t,e){return it(Dn.validate(t,e),hn(function(r){if(!LB.is(r.trim()))return Ft(t,e);try{return ht(BigInt(r))}catch{return Ft(t,e)}}))},String);function kbt(t,e,r){return r===void 0&&(r=t.name),new pt(r,t.is,t.validate,e)}var Wbt=new pt("BooleanFromNumber",eh.is,function(t,e){return it(ou.validate(t,e),ru(function(r){return r!==0}))},Number),Fbt=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module",mapOutput:Lj,NonEmptyString:LB,nonEmptyArray:UB,readonlySetFromArray:Kgt,fromRefinement:yM,date:Hgt,fromNewtype:sbt,optionFromNullable:pbt,DateFromISOString:dbt,readonlyNonEmptyArray:hbt,clone:lz,DateFromNumber:vbt,withFallback:mbt,UUID:ybt,fromNullable:bbt,BooleanFromString:$bt,withMessage:_bt,withValidate:Eg,getLenses:Tbt,regexp:Obt,option:fz,DateFromUnixTime:Mbt,NumberFromString:kM,setFromArray:jB,IntFromString:Rbt,JsonArray:dz,JsonRecord:hz,Json:wg,JsonFromString:Ebt,either:Cbt,BigIntFromString:xbt,withEncode:kbt,BooleanFromNumber:Wbt}),Nbt=Li(Fbt);Object.defineProperty(oc,"__esModule",{value:!0}),oc.SharedSliceContent=oc.SharedSliceContentType=void 0;const vz=X.exports,Pbt=fr,mz=(0,vz.__importStar)(Ca),$f=(0,vz.__importStar)(nt),gz=Nbt,yz=ae;oc.SharedSliceContentType="SharedSliceContent";const Dbt=$f.exact($f.type({variation:$f.string,items:(0,gz.withFallback)($f.array($f.unknown),[]),primary:(0,gz.withFallback)($f.UnknownRecord,{})}));oc.SharedSliceContent={fromJson:(t,e,r,n,o)=>{const i=(0,Pbt.map)(a=>{const u=Array.of(t,[e,"variations",a.variation,"items"]).flat().join("."),c=yz.GroupContent.itemsContentsFromJson(u,a.items,n,o),f=Object.entries(a.primary).sort(([p],[d])=>{var h,m;const g=(h=o.get(`${Array.of(t,[e]).flat().join(".")}.${p}`))!==null&&h!==void 0?h:1e4,b=(m=o.get(`${Array.of(t,[e]).flat().join(".")}.${d}`))!==null&&m!==void 0?m:1e4;return g-b}).reduce((p,[d,h])=>{const m=Array.of(t,[e,"variations",a.variation,"primary",d]).flat().join("."),g=n.get(m);if(g){const b=yz.SimpleWidgetContent.from(g,h);mz.isSome(b)&&(p[d]=b.value)}return p},{});return{variation:a.variation,primary:f,items:c,__TYPE__:"SharedSliceContent"}})(Dbt.decode(r));return mz.fromEither(i)}},Object.defineProperty(pd,"__esModule",{value:!0}),pd.SliceWidgetContent=void 0;const bz=X.exports,Lbt=(0,bz.__importStar)(Ca),Ubt=(0,bz.__importDefault)(vf),jbt=nc,Bbt=oc;pd.SliceWidgetContent={fromJson:(t,e,r,n,o)=>{const i=Array.of(t,[e]).flat().join("."),a=n.get(i);return a==="SharedSlice"?Bbt.SharedSliceContent.fromJson(t,e,r,n,o):a==="Slice"?jbt.CompositeSliceContent.fromJson(t,e,r,n,o):a?Ubt.default.fromJson(t,e,r,n,o):Lbt.none}},function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.SlicesContent=t.SlicesContentType=void 0;const e=X.exports,r=(0,e.__importStar)(xB),n=Kr,o=(0,e.__importStar)(Ca),i=(0,e.__importStar)(nt),a=xt,u=pd;t.SlicesContentType="SliceContentType";const c=i.exact(i.intersection([i.type({key:i.string,value:i.unknown}),i.partial({label:(0,a.nullable)(i.string)})]));t.SlicesContent={itemsCodec:(s,f)=>(0,n.pipe)(c.decode(s),o.fromEither,o.chain(l=>{const p=l.key.indexOf("$"),d=l.key.substring(0,p>0?p:void 0),h=f(d,l.value);return o.map(m=>{var g;return{key:l.key,name:d,maybeLabel:(g=l.label)!==null&&g!==void 0?g:void 0,widget:m}})(h)})),fromJson:(s,f,l,p)=>{if(l.get(s)==="Slices"){const d=o.getOrElse(()=>new Array)(o.fromEither(i.array(i.unknown).decode(f))),h=(m,g)=>u.SliceWidgetContent.fromJson([s],m,g,l,p);return o.some({value:r.compact(d.map(m=>t.SlicesContent.itemsCodec(m,h))),__TYPE__:t.SlicesContentType})}else return console.error("fieldTypes.get(key) !== 'Slices'"),o.none}}}(mM);var $z={},Ag={};Object.defineProperty(Ag,"__esModule",{value:!0}),Ag.SimpleSliceContent=void 0;const zbt=X.exports,qbt=(0,zbt.__importDefault)(vf);Ag.SimpleSliceContent=qbt.default,function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=X.exports;(0,e.__exportStar)(nc,t),(0,e.__exportStar)(oc,t),(0,e.__exportStar)(Ag,t),(0,e.__exportStar)(mM,t),(0,e.__exportStar)(pd,t)}($z),function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Widget=t.WidgetTypes=t.StaticWidgetContent=t.Slices=t.Nestable=void 0;const e=X.exports,r=fM,n=yg,o=_i,i=mM,a=(0,e.__importDefault)(vf),u=Og;(0,e.__exportStar)(fM,t),(0,e.__exportStar)(yg,t),t.Nestable=(0,e.__importStar)(_i),(0,e.__exportStar)(bg,t),t.Slices=(0,e.__importStar)($z);var c=vf;Object.defineProperty(t,"StaticWidgetContent",{enumerable:!0,get:function(){return(0,e.__importDefault)(c).default}}),(0,e.__exportStar)(Og,t),t.WidgetTypes=K(_({},o.NestableTypes),{Empty:r.EmptyContentType,UID:u.UIDContentType,Group:n.GroupContentType,slices:i.SlicesContentType}),t.Widget={fromJson(s,f,l,p){return l.get(s)==="Slices"?i.SlicesContent.fromJson(s,f,l,p):a.default.fromJson([],s,f,l,p)}}}(ae);function Kbt(t){return t.type===Bt.WidgetTypes.LegacySlices||t.type===Bt.WidgetTypes.Slices}function Vbt(t){return t.__TYPE__===ae.WidgetTypes.slices}function WM(t){return Object.entries(t).filter(e=>e[1]!==void 0)}function ee(t,e){return t===void 0||!e(t)?void 0:t}function Hbt(t){const e=v(t,_m(Kbt),rb(cm));return[ol(e),il(e)]}function Jbt(t,e){return v(e,af((r,n)=>t[r]!==void 0&&(n===void 0||ae.StaticWidgetContent.is(n))))}function Gbt(t){return t.__TYPE__==="SharedSliceContent"}function Ybt(t){return t.__TYPE__==="CompositeSliceContent"}function Xbt(t){return t.__TYPE__!==ae.WidgetTypes.Empty&&t.__TYPE__!==ae.WidgetTypes.UID&&t.__TYPE__!=="CompositeSliceContent"&&t.__TYPE__!=="SharedSliceContent"}function Zbt(t){return t.__TYPE__===ae.WidgetTypes.Empty}function Qbt(t,e,r){const n=t.value[e];if(n===void 0)throw new Error(`Cannot update undefined content at index ${e}.`);return K(_({},t),{value:[...t.value.slice(0,e),K(_({},n),{widget:r!=null?r:{__TYPE__:"EmptyContent",type:""}}),...t.value.slice(e+1)]})}function t$t(t){var e,r,n;return(n=(r=(e=t.config)==null?void 0:e.label)!=null?r:t.fieldset)!=null?n:t.type}function e$t(t){var e;return(e=t["non-repeat"])!=null?e:{}}function r$t(t){var e;return(e=t.repeat)!=null?e:{}}function _z(t){return t.__TYPE__===ae.WidgetTypes.Group}function Cg(t){return t.__TYPE__!==ae.WidgetTypes.Empty&&t.__TYPE__!==ae.WidgetTypes.Group&&t.__TYPE__!==ae.WidgetTypes.UID}function n$t(t,e,r){return r===void 0?sm(e)(t):K(_({},t),{[e]:r})}function o$t(t){return t.__TYPE__===ae.WidgetTypes.Field&&t.type==="Color"}function i$t(t){return t.__TYPE__===ae.WidgetTypes.Field&&t.type==="Date"}function a$t(t){return t.__TYPE__===ae.WidgetTypes.GeoPoint}function u$t(t){return t.__TYPE__===ae.WidgetTypes.Image}function c$t(t){return t.__TYPE__===ae.WidgetTypes.Field&&t.type==="Text"}function s$t(t){return t.__TYPE__===ae.WidgetTypes.Field&&t.type==="Number"}function f$t(t){return t.__TYPE__===ae.WidgetTypes.Field&&t.type==="Range"}function l$t(t){return t.__TYPE__===ae.WidgetTypes.Field&&t.type==="Select"}function p$t(t){return t.__TYPE__===ae.WidgetTypes.Field&&t.type==="Timestamp"}function xg(t){var e,r,n;return(n=(r=(e=t.config)==null?void 0:e.label)!=null?r:t.type===Bt.WidgetTypes.BooleanField||t.type===Bt.WidgetTypes.Separator?void 0:t.fieldset)!=null?n:t.type}function Sz(t){var e,r;return t.type===Bt.WidgetTypes.GeoPoint?"TODO":(r=(e=t.config)==null?void 0:e.placeholder)!=null?r:"..."}var kg={exports:{}},md={};/*
19
+ object-assign
20
+ (c) Sindre Sorhus
21
+ @license MIT
22
+ */var Tz=Object.getOwnPropertySymbols,d$t=Object.prototype.hasOwnProperty,h$t=Object.prototype.propertyIsEnumerable;function v$t(t){if(t==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}function m$t(){try{if(!Object.assign)return!1;var t=new String("abc");if(t[5]="de",Object.getOwnPropertyNames(t)[0]==="5")return!1;for(var e={},r=0;r<10;r++)e["_"+String.fromCharCode(r)]=r;var n=Object.getOwnPropertyNames(e).map(function(i){return e[i]});if(n.join("")!=="0123456789")return!1;var o={};return"abcdefghijklmnopqrst".split("").forEach(function(i){o[i]=i}),Object.keys(Object.assign({},o)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}m$t();/** @license React v17.0.2
23
+ * react-jsx-runtime.production.min.js
24
+ *
25
+ * Copyright (c) Facebook, Inc. and its affiliates.
26
+ *
27
+ * This source code is licensed under the MIT license found in the
28
+ * LICENSE file in the root directory of this source tree.
29
+ */var g$t=rl.default,Iz=60103;if(md.Fragment=60107,typeof Symbol=="function"&&Symbol.for){var Oz=Symbol.for;Iz=Oz("react.element"),md.Fragment=Oz("react.fragment")}var y$t=g$t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,b$t=Object.prototype.hasOwnProperty,$$t={key:!0,ref:!0,__self:!0,__source:!0};function Mz(t,e,r){var n,o={},i=null,a=null;r!==void 0&&(i=""+r),e.key!==void 0&&(i=""+e.key),e.ref!==void 0&&(a=e.ref);for(n in e)b$t.call(e,n)&&!$$t.hasOwnProperty(n)&&(o[n]=e[n]);if(t&&t.defaultProps)for(n in e=t.defaultProps,e)o[n]===void 0&&(o[n]=e[n]);return{$$typeof:Iz,type:t,key:i,ref:a,props:o,_owner:y$t.current}}md.jsx=Mz,md.jsxs=Mz,kg.exports=md;const J=kg.exports.jsx,br=kg.exports.jsxs,fc=kg.exports.Fragment,_$t=({content:t,field:e,id:r,onContentChange:n,readOnly:o})=>{var i;return br(Y.Field,{children:[J(Y.FieldIcon,{children:J(Y.NotesIcon,{})}),J(Y.FieldLabel,{htmlFor:r,children:xg(e)}),J(Y.FieldControl,{children:J(Y.TextArea,{id:r,onChange:a=>{n(S$t(t,a.target.value))},placeholder:Sz(e),readOnly:o,value:(i=t==null?void 0:t.value)!=null?i:""})})]})};function S$t(t,e){if(e.length!==0)return t===void 0?{__TYPE__:"FieldContent",type:"Text",value:e}:K(_({},t),{value:e})}function or(t){this.content=t}or.prototype={constructor:or,find:function(t){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===t)return e;return-1},get:function(t){var e=this.find(t);return e==-1?void 0:this.content[e+1]},update:function(t,e,r){var n=r&&r!=t?this.remove(r):this,o=n.find(t),i=n.content.slice();return o==-1?i.push(r||t,e):(i[o+1]=e,r&&(i[o]=r)),new or(i)},remove:function(t){var e=this.find(t);if(e==-1)return this;var r=this.content.slice();return r.splice(e,2),new or(r)},addToStart:function(t,e){return new or([t,e].concat(this.remove(t).content))},addToEnd:function(t,e){var r=this.remove(t).content.slice();return r.push(t,e),new or(r)},addBefore:function(t,e,r){var n=this.remove(e),o=n.content.slice(),i=n.find(t);return o.splice(i==-1?o.length:i,0,e,r),new or(o)},forEach:function(t){for(var e=0;e<this.content.length;e+=2)t(this.content[e],this.content[e+1])},prepend:function(t){return t=or.from(t),t.size?new or(t.content.concat(this.subtract(t).content)):this},append:function(t){return t=or.from(t),t.size?new or(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var e=this;t=or.from(t);for(var r=0;r<t.content.length;r+=2)e=e.remove(t.content[r]);return e},get size(){return this.content.length>>1}},or.from=function(t){if(t instanceof or)return t;var e=[];if(t)for(var r in t)e.push(r,t[r]);return new or(e)};var Rz=or;function Ez(t,e,r){for(var n=0;;n++){if(n==t.childCount||n==e.childCount)return t.childCount==e.childCount?null:r;var o=t.child(n),i=e.child(n);if(o==i){r+=o.nodeSize;continue}if(!o.sameMarkup(i))return r;if(o.isText&&o.text!=i.text){for(var a=0;o.text[a]==i.text[a];a++)r++;return r}if(o.content.size||i.content.size){var u=Ez(o.content,i.content,r+1);if(u!=null)return u}r+=o.nodeSize}}function wz(t,e,r,n){for(var o=t.childCount,i=e.childCount;;){if(o==0||i==0)return o==i?null:{a:r,b:n};var a=t.child(--o),u=e.child(--i),c=a.nodeSize;if(a==u){r-=c,n-=c;continue}if(!a.sameMarkup(u))return{a:r,b:n};if(a.isText&&a.text!=u.text){for(var s=0,f=Math.min(a.text.length,u.text.length);s<f&&a.text[a.text.length-s-1]==u.text[u.text.length-s-1];)s++,r--,n--;return{a:r,b:n}}if(a.content.size||u.content.size){var l=wz(a.content,u.content,r-1,n-1);if(l)return l}r-=c,n-=c}}var D=function(e,r){if(this.content=e,this.size=r||0,r==null)for(var n=0;n<e.length;n++)this.size+=e[n].nodeSize},Wg={firstChild:{configurable:!0},lastChild:{configurable:!0},childCount:{configurable:!0}};D.prototype.nodesBetween=function(e,r,n,o,i){o===void 0&&(o=0);for(var a=0,u=0;u<r;a++){var c=this.content[a],s=u+c.nodeSize;if(s>e&&n(c,o+u,i,a)!==!1&&c.content.size){var f=u+1;c.nodesBetween(Math.max(0,e-f),Math.min(c.content.size,r-f),n,o+f)}u=s}},D.prototype.descendants=function(e){this.nodesBetween(0,this.size,e)},D.prototype.textBetween=function(e,r,n,o){var i="",a=!0;return this.nodesBetween(e,r,function(u,c){u.isText?(i+=u.text.slice(Math.max(e,c)-c,r-c),a=!n):u.isLeaf&&o?(i+=typeof o=="function"?o(u):o,a=!n):!a&&u.isBlock&&(i+=n,a=!0)},0),i},D.prototype.append=function(e){if(!e.size)return this;if(!this.size)return e;var r=this.lastChild,n=e.firstChild,o=this.content.slice(),i=0;for(r.isText&&r.sameMarkup(n)&&(o[o.length-1]=r.withText(r.text+n.text),i=1);i<e.content.length;i++)o.push(e.content[i]);return new D(o,this.size+e.size)},D.prototype.cut=function(e,r){if(r==null&&(r=this.size),e==0&&r==this.size)return this;var n=[],o=0;if(r>e)for(var i=0,a=0;a<r;i++){var u=this.content[i],c=a+u.nodeSize;c>e&&((a<e||c>r)&&(u.isText?u=u.cut(Math.max(0,e-a),Math.min(u.text.length,r-a)):u=u.cut(Math.max(0,e-a-1),Math.min(u.content.size,r-a-1))),n.push(u),o+=u.nodeSize),a=c}return new D(n,o)},D.prototype.cutByIndex=function(e,r){return e==r?D.empty:e==0&&r==this.content.length?this:new D(this.content.slice(e,r))},D.prototype.replaceChild=function(e,r){var n=this.content[e];if(n==r)return this;var o=this.content.slice(),i=this.size+r.nodeSize-n.nodeSize;return o[e]=r,new D(o,i)},D.prototype.addToStart=function(e){return new D([e].concat(this.content),this.size+e.nodeSize)},D.prototype.addToEnd=function(e){return new D(this.content.concat(e),this.size+e.nodeSize)},D.prototype.eq=function(e){if(this.content.length!=e.content.length)return!1;for(var r=0;r<this.content.length;r++)if(!this.content[r].eq(e.content[r]))return!1;return!0},Wg.firstChild.get=function(){return this.content.length?this.content[0]:null},Wg.lastChild.get=function(){return this.content.length?this.content[this.content.length-1]:null},Wg.childCount.get=function(){return this.content.length},D.prototype.child=function(e){var r=this.content[e];if(!r)throw new RangeError("Index "+e+" out of range for "+this);return r},D.prototype.maybeChild=function(e){return this.content[e]},D.prototype.forEach=function(e){for(var r=0,n=0;r<this.content.length;r++){var o=this.content[r];e(o,n,r),n+=o.nodeSize}},D.prototype.findDiffStart=function(e,r){return r===void 0&&(r=0),Ez(this,e,r)},D.prototype.findDiffEnd=function(e,r,n){return r===void 0&&(r=this.size),n===void 0&&(n=e.size),wz(this,e,r,n)},D.prototype.findIndex=function(e,r){if(r===void 0&&(r=-1),e==0)return Fg(0,e);if(e==this.size)return Fg(this.content.length,e);if(e>this.size||e<0)throw new RangeError("Position "+e+" outside of fragment ("+this+")");for(var n=0,o=0;;n++){var i=this.child(n),a=o+i.nodeSize;if(a>=e)return a==e||r>0?Fg(n+1,a):Fg(n,o);o=a}},D.prototype.toString=function(){return"<"+this.toStringInner()+">"},D.prototype.toStringInner=function(){return this.content.join(", ")},D.prototype.toJSON=function(){return this.content.length?this.content.map(function(e){return e.toJSON()}):null},D.fromJSON=function(e,r){if(!r)return D.empty;if(!Array.isArray(r))throw new RangeError("Invalid input for Fragment.fromJSON");return new D(r.map(e.nodeFromJSON))},D.fromArray=function(e){if(!e.length)return D.empty;for(var r,n=0,o=0;o<e.length;o++){var i=e[o];n+=i.nodeSize,o&&i.isText&&e[o-1].sameMarkup(i)?(r||(r=e.slice(0,o)),r[r.length-1]=i.withText(r[r.length-1].text+i.text)):r&&r.push(i)}return new D(r||e,n)},D.from=function(e){if(!e)return D.empty;if(e instanceof D)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new D([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))},Object.defineProperties(D.prototype,Wg);var FM={index:0,offset:0};function Fg(t,e){return FM.index=t,FM.offset=e,FM}D.empty=new D([],0);function Ng(t,e){if(t===e)return!0;if(!(t&&typeof t=="object")||!(e&&typeof e=="object"))return!1;var r=Array.isArray(t);if(Array.isArray(e)!=r)return!1;if(r){if(t.length!=e.length)return!1;for(var n=0;n<t.length;n++)if(!Ng(t[n],e[n]))return!1}else{for(var o in t)if(!(o in e)||!Ng(t[o],e[o]))return!1;for(var i in e)if(!(i in t))return!1}return!0}var St=function(e,r){this.type=e,this.attrs=r};St.prototype.addToSet=function(e){for(var r,n=!1,o=0;o<e.length;o++){var i=e[o];if(this.eq(i))return e;if(this.type.excludes(i.type))r||(r=e.slice(0,o));else{if(i.type.excludes(this.type))return e;!n&&i.type.rank>this.type.rank&&(r||(r=e.slice(0,o)),r.push(this),n=!0),r&&r.push(i)}}return r||(r=e.slice()),n||r.push(this),r},St.prototype.removeFromSet=function(e){for(var r=0;r<e.length;r++)if(this.eq(e[r]))return e.slice(0,r).concat(e.slice(r+1));return e},St.prototype.isInSet=function(e){for(var r=0;r<e.length;r++)if(this.eq(e[r]))return!0;return!1},St.prototype.eq=function(e){return this==e||this.type==e.type&&Ng(this.attrs,e.attrs)},St.prototype.toJSON=function(){var e={type:this.type.name};for(var r in this.attrs){e.attrs=this.attrs;break}return e},St.fromJSON=function(e,r){if(!r)throw new RangeError("Invalid input for Mark.fromJSON");var n=e.marks[r.type];if(!n)throw new RangeError("There is no mark type "+r.type+" in this schema");return n.create(r.attrs)},St.sameSet=function(e,r){if(e==r)return!0;if(e.length!=r.length)return!1;for(var n=0;n<e.length;n++)if(!e[n].eq(r[n]))return!1;return!0},St.setFrom=function(e){if(!e||e.length==0)return St.none;if(e instanceof St)return[e];var r=e.slice();return r.sort(function(n,o){return n.type.rank-o.type.rank}),r},St.none=[];function xo(t){var e=Error.call(this,t);return e.__proto__=xo.prototype,e}xo.prototype=Object.create(Error.prototype),xo.prototype.constructor=xo,xo.prototype.name="ReplaceError";var Z=function(e,r,n){this.content=e,this.openStart=r,this.openEnd=n},Az={size:{configurable:!0}};Az.size.get=function(){return this.content.size-this.openStart-this.openEnd},Z.prototype.insertAt=function(e,r){var n=xz(this.content,e+this.openStart,r,null);return n&&new Z(n,this.openStart,this.openEnd)},Z.prototype.removeBetween=function(e,r){return new Z(Cz(this.content,e+this.openStart,r+this.openStart),this.openStart,this.openEnd)},Z.prototype.eq=function(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd},Z.prototype.toString=function(){return this.content+"("+this.openStart+","+this.openEnd+")"},Z.prototype.toJSON=function(){if(!this.content.size)return null;var e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e},Z.fromJSON=function(e,r){if(!r)return Z.empty;var n=r.openStart||0,o=r.openEnd||0;if(typeof n!="number"||typeof o!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new Z(D.fromJSON(e,r.content),n,o)},Z.maxOpen=function(e,r){r===void 0&&(r=!0);for(var n=0,o=0,i=e.firstChild;i&&!i.isLeaf&&(r||!i.type.spec.isolating);i=i.firstChild)n++;for(var a=e.lastChild;a&&!a.isLeaf&&(r||!a.type.spec.isolating);a=a.lastChild)o++;return new Z(e,n,o)},Object.defineProperties(Z.prototype,Az);function Cz(t,e,r){var n=t.findIndex(e),o=n.index,i=n.offset,a=t.maybeChild(o),u=t.findIndex(r),c=u.index,s=u.offset;if(i==e||a.isText){if(s!=r&&!t.child(c).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(r))}if(o!=c)throw new RangeError("Removing non-flat range");return t.replaceChild(o,a.copy(Cz(a.content,e-i-1,r-i-1)))}function xz(t,e,r,n){var o=t.findIndex(e),i=o.index,a=o.offset,u=t.maybeChild(i);if(a==e||u.isText)return n&&!n.canReplace(i,i,r)?null:t.cut(0,e).append(r).append(t.cut(e));var c=xz(u.content,e-a-1,r);return c&&t.replaceChild(i,u.copy(c))}Z.empty=new Z(D.empty,0,0);function T$t(t,e,r){if(r.openStart>t.depth)throw new xo("Inserted content deeper than insertion position");if(t.depth-r.openStart!=e.depth-r.openEnd)throw new xo("Inconsistent open depths");return kz(t,e,r,0)}function kz(t,e,r,n){var o=t.index(n),i=t.node(n);if(o==e.index(n)&&n<t.depth-r.openStart){var a=kz(t,e,r,n+1);return i.copy(i.content.replaceChild(o,a))}else if(r.content.size)if(!r.openStart&&!r.openEnd&&t.depth==n&&e.depth==n){var u=t.parent,c=u.content;return pc(u,c.cut(0,t.parentOffset).append(r.content).append(c.cut(e.parentOffset)))}else{var s=I$t(r,t),f=s.start,l=s.end;return pc(i,Fz(t,f,l,e,n))}else return pc(i,Pg(t,e,n))}function Wz(t,e){if(!e.type.compatibleContent(t.type))throw new xo("Cannot join "+e.type.name+" onto "+t.type.name)}function NM(t,e,r){var n=t.node(r);return Wz(n,e.node(r)),n}function lc(t,e){var r=e.length-1;r>=0&&t.isText&&t.sameMarkup(e[r])?e[r]=t.withText(e[r].text+t.text):e.push(t)}function gd(t,e,r,n){var o=(e||t).node(r),i=0,a=e?e.index(r):o.childCount;t&&(i=t.index(r),t.depth>r?i++:t.textOffset&&(lc(t.nodeAfter,n),i++));for(var u=i;u<a;u++)lc(o.child(u),n);e&&e.depth==r&&e.textOffset&&lc(e.nodeBefore,n)}function pc(t,e){if(!t.type.validContent(e))throw new xo("Invalid content for node "+t.type.name);return t.copy(e)}function Fz(t,e,r,n,o){var i=t.depth>o&&NM(t,e,o+1),a=n.depth>o&&NM(r,n,o+1),u=[];return gd(null,t,o,u),i&&a&&e.index(o)==r.index(o)?(Wz(i,a),lc(pc(i,Fz(t,e,r,n,o+1)),u)):(i&&lc(pc(i,Pg(t,e,o+1)),u),gd(e,r,o,u),a&&lc(pc(a,Pg(r,n,o+1)),u)),gd(n,null,o,u),new D(u)}function Pg(t,e,r){var n=[];if(gd(null,t,r,n),t.depth>r){var o=NM(t,e,r+1);lc(pc(o,Pg(t,e,r+1)),n)}return gd(e,null,r,n),new D(n)}function I$t(t,e){for(var r=e.depth-t.openStart,n=e.node(r),o=n.copy(t.content),i=r-1;i>=0;i--)o=e.node(i).copy(D.from(o));return{start:o.resolveNoCache(t.openStart+r),end:o.resolveNoCache(o.content.size-t.openEnd-r)}}var Yt=function(e,r,n){this.pos=e,this.path=r,this.depth=r.length/3-1,this.parentOffset=n},_f={parent:{configurable:!0},doc:{configurable:!0},textOffset:{configurable:!0},nodeAfter:{configurable:!0},nodeBefore:{configurable:!0}};Yt.prototype.resolveDepth=function(e){return e==null?this.depth:e<0?this.depth+e:e},_f.parent.get=function(){return this.node(this.depth)},_f.doc.get=function(){return this.node(0)},Yt.prototype.node=function(e){return this.path[this.resolveDepth(e)*3]},Yt.prototype.index=function(e){return this.path[this.resolveDepth(e)*3+1]},Yt.prototype.indexAfter=function(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)},Yt.prototype.start=function(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1},Yt.prototype.end=function(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size},Yt.prototype.before=function(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]},Yt.prototype.after=function(e){if(e=this.resolveDepth(e),!e)throw new 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},_f.textOffset.get=function(){return this.pos-this.path[this.path.length-1]},_f.nodeAfter.get=function(){var t=this.parent,e=this.index(this.depth);if(e==t.childCount)return null;var r=this.pos-this.path[this.path.length-1],n=t.child(e);return r?t.child(e).cut(r):n},_f.nodeBefore.get=function(){var t=this.index(this.depth),e=this.pos-this.path[this.path.length-1];return e?this.parent.child(t).cut(0,e):t==0?null:this.parent.child(t-1)},Yt.prototype.posAtIndex=function(e,r){r=this.resolveDepth(r);for(var n=this.path[r*3],o=r==0?0:this.path[r*3-1]+1,i=0;i<e;i++)o+=n.child(i).nodeSize;return o},Yt.prototype.marks=function(){var e=this.parent,r=this.index();if(e.content.size==0)return St.none;if(this.textOffset)return e.child(r).marks;var n=e.maybeChild(r-1),o=e.maybeChild(r);if(!n){var i=n;n=o,o=i}for(var a=n.marks,u=0;u<a.length;u++)a[u].type.spec.inclusive===!1&&(!o||!a[u].isInSet(o.marks))&&(a=a[u--].removeFromSet(a));return a},Yt.prototype.marksAcross=function(e){var r=this.parent.maybeChild(this.index());if(!r||!r.isInline)return null;for(var n=r.marks,o=e.parent.maybeChild(e.index()),i=0;i<n.length;i++)n[i].type.spec.inclusive===!1&&(!o||!n[i].isInSet(o.marks))&&(n=n[i--].removeFromSet(n));return n},Yt.prototype.sharedDepth=function(e){for(var r=this.depth;r>0;r--)if(this.start(r)<=e&&this.end(r)>=e)return r;return 0},Yt.prototype.blockRange=function(e,r){if(e===void 0&&(e=this),e.pos<this.pos)return e.blockRange(this);for(var n=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);n>=0;n--)if(e.pos<=this.end(n)&&(!r||r(this.node(n))))return new yd(this,e,n)},Yt.prototype.sameParent=function(e){return this.pos-this.parentOffset==e.pos-e.parentOffset},Yt.prototype.max=function(e){return e.pos>this.pos?e:this},Yt.prototype.min=function(e){return e.pos<this.pos?e:this},Yt.prototype.toString=function(){for(var e="",r=1;r<=this.depth;r++)e+=(e?"/":"")+this.node(r).type.name+"_"+this.index(r-1);return e+":"+this.parentOffset},Yt.resolve=function(e,r){if(!(r>=0&&r<=e.content.size))throw new RangeError("Position "+r+" out of range");for(var n=[],o=0,i=r,a=e;;){var u=a.content.findIndex(i),c=u.index,s=u.offset,f=i-s;if(n.push(a,c,o+s),!f||(a=a.child(c),a.isText))break;i=f-1,o+=s+1}return new Yt(r,n,i)},Yt.resolveCached=function(e,r){for(var n=0;n<PM.length;n++){var o=PM[n];if(o.pos==r&&o.doc==e)return o}var i=PM[DM]=Yt.resolve(e,r);return DM=(DM+1)%O$t,i},Object.defineProperties(Yt.prototype,_f);var PM=[],DM=0,O$t=12,yd=function(e,r,n){this.$from=e,this.$to=r,this.depth=n},Sf={start:{configurable:!0},end:{configurable:!0},parent:{configurable:!0},startIndex:{configurable:!0},endIndex:{configurable:!0}};Sf.start.get=function(){return this.$from.before(this.depth+1)},Sf.end.get=function(){return this.$to.after(this.depth+1)},Sf.parent.get=function(){return this.$from.node(this.depth)},Sf.startIndex.get=function(){return this.$from.index(this.depth)},Sf.endIndex.get=function(){return this.$to.indexAfter(this.depth)},Object.defineProperties(yd.prototype,Sf);var M$t=Object.create(null),Mt=function(e,r,n,o){this.type=e,this.attrs=r,this.content=n||D.empty,this.marks=o||St.none},an={nodeSize:{configurable:!0},childCount:{configurable:!0},textContent:{configurable:!0},firstChild:{configurable:!0},lastChild:{configurable:!0},isBlock:{configurable:!0},isTextblock:{configurable:!0},inlineContent:{configurable:!0},isInline:{configurable:!0},isText:{configurable:!0},isLeaf:{configurable:!0},isAtom:{configurable:!0}};an.nodeSize.get=function(){return this.isLeaf?1:2+this.content.size},an.childCount.get=function(){return this.content.childCount},Mt.prototype.child=function(e){return this.content.child(e)},Mt.prototype.maybeChild=function(e){return this.content.maybeChild(e)},Mt.prototype.forEach=function(e){this.content.forEach(e)},Mt.prototype.nodesBetween=function(e,r,n,o){o===void 0&&(o=0),this.content.nodesBetween(e,r,n,o,this)},Mt.prototype.descendants=function(e){this.nodesBetween(0,this.content.size,e)},an.textContent.get=function(){return this.textBetween(0,this.content.size,"")},Mt.prototype.textBetween=function(e,r,n,o){return this.content.textBetween(e,r,n,o)},an.firstChild.get=function(){return this.content.firstChild},an.lastChild.get=function(){return this.content.lastChild},Mt.prototype.eq=function(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)},Mt.prototype.sameMarkup=function(e){return this.hasMarkup(e.type,e.attrs,e.marks)},Mt.prototype.hasMarkup=function(e,r,n){return this.type==e&&Ng(this.attrs,r||e.defaultAttrs||M$t)&&St.sameSet(this.marks,n||St.none)},Mt.prototype.copy=function(e){return e===void 0&&(e=null),e==this.content?this:new this.constructor(this.type,this.attrs,e,this.marks)},Mt.prototype.mark=function(e){return e==this.marks?this:new this.constructor(this.type,this.attrs,this.content,e)},Mt.prototype.cut=function(e,r){return e==0&&r==this.content.size?this:this.copy(this.content.cut(e,r))},Mt.prototype.slice=function(e,r,n){if(r===void 0&&(r=this.content.size),n===void 0&&(n=!1),e==r)return Z.empty;var o=this.resolve(e),i=this.resolve(r),a=n?0:o.sharedDepth(r),u=o.start(a),c=o.node(a),s=c.content.cut(o.pos-u,i.pos-u);return new Z(s,o.depth-a,i.depth-a)},Mt.prototype.replace=function(e,r,n){return T$t(this.resolve(e),this.resolve(r),n)},Mt.prototype.nodeAt=function(e){for(var r=this;;){var n=r.content.findIndex(e),o=n.index,i=n.offset;if(r=r.maybeChild(o),!r)return null;if(i==e||r.isText)return r;e-=i+1}},Mt.prototype.childAfter=function(e){var r=this.content.findIndex(e),n=r.index,o=r.offset;return{node:this.content.maybeChild(n),index:n,offset:o}},Mt.prototype.childBefore=function(e){if(e==0)return{node:null,index:0,offset:0};var r=this.content.findIndex(e),n=r.index,o=r.offset;if(o<e)return{node:this.content.child(n),index:n,offset:o};var i=this.content.child(n-1);return{node:i,index:n-1,offset:o-i.nodeSize}},Mt.prototype.resolve=function(e){return Yt.resolveCached(this,e)},Mt.prototype.resolveNoCache=function(e){return Yt.resolve(this,e)},Mt.prototype.rangeHasMark=function(e,r,n){var o=!1;return r>e&&this.nodesBetween(e,r,function(i){return n.isInSet(i.marks)&&(o=!0),!o}),o},an.isBlock.get=function(){return this.type.isBlock},an.isTextblock.get=function(){return this.type.isTextblock},an.inlineContent.get=function(){return this.type.inlineContent},an.isInline.get=function(){return this.type.isInline},an.isText.get=function(){return this.type.isText},an.isLeaf.get=function(){return this.type.isLeaf},an.isAtom.get=function(){return this.type.isAtom},Mt.prototype.toString=function(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);var e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),Nz(this.marks,e)},Mt.prototype.contentMatchAt=function(e){var r=this.type.contentMatch.matchFragment(this.content,0,e);if(!r)throw new Error("Called contentMatchAt on a node with invalid content");return r},Mt.prototype.canReplace=function(e,r,n,o,i){n===void 0&&(n=D.empty),o===void 0&&(o=0),i===void 0&&(i=n.childCount);var a=this.contentMatchAt(e).matchFragment(n,o,i),u=a&&a.matchFragment(this.content,r);if(!u||!u.validEnd)return!1;for(var c=o;c<i;c++)if(!this.type.allowsMarks(n.child(c).marks))return!1;return!0},Mt.prototype.canReplaceWith=function(e,r,n,o){if(o&&!this.type.allowsMarks(o))return!1;var i=this.contentMatchAt(e).matchType(n),a=i&&i.matchFragment(this.content,r);return a?a.validEnd:!1},Mt.prototype.canAppend=function(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)},Mt.prototype.check=function(){if(!this.type.validContent(this.content))throw new RangeError("Invalid content for node "+this.type.name+": "+this.content.toString().slice(0,50));for(var e=St.none,r=0;r<this.marks.length;r++)e=this.marks[r].addToSet(e);if(!St.sameSet(e,this.marks))throw new RangeError("Invalid collection of marks for node "+this.type.name+": "+this.marks.map(function(n){return n.type.name}));this.content.forEach(function(n){return n.check()})},Mt.prototype.toJSON=function(){var e={type:this.type.name};for(var r 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(function(n){return n.toJSON()})),e},Mt.fromJSON=function(e,r){if(!r)throw new RangeError("Invalid input for Node.fromJSON");var n=null;if(r.marks){if(!Array.isArray(r.marks))throw new RangeError("Invalid mark data for Node.fromJSON");n=r.marks.map(e.markFromJSON)}if(r.type=="text"){if(typeof r.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(r.text,n)}var o=D.fromJSON(e,r.content);return e.nodeType(r.type).create(r.attrs,o,n)},Object.defineProperties(Mt.prototype,an);var R$t=function(t){function e(n,o,i,a){if(t.call(this,n,o,null,a),!i)throw new RangeError("Empty text nodes are not allowed");this.text=i}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={textContent:{configurable:!0},nodeSize:{configurable:!0}};return e.prototype.toString=function(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):Nz(this.marks,JSON.stringify(this.text))},r.textContent.get=function(){return this.text},e.prototype.textBetween=function(o,i){return this.text.slice(o,i)},r.nodeSize.get=function(){return this.text.length},e.prototype.mark=function(o){return o==this.marks?this:new e(this.type,this.attrs,this.text,o)},e.prototype.withText=function(o){return o==this.text?this:new e(this.type,this.attrs,o,this.marks)},e.prototype.cut=function(o,i){return o===void 0&&(o=0),i===void 0&&(i=this.text.length),o==0&&i==this.text.length?this:this.withText(this.text.slice(o,i))},e.prototype.eq=function(o){return this.sameMarkup(o)&&this.text==o.text},e.prototype.toJSON=function(){var o=t.prototype.toJSON.call(this);return o.text=this.text,o},Object.defineProperties(e.prototype,r),e}(Mt);function Nz(t,e){for(var r=t.length-1;r>=0;r--)e=t[r].type.name+"("+e+")";return e}var ir=function(e){this.validEnd=e,this.next=[],this.wrapCache=[]},Dg={inlineContent:{configurable:!0},defaultType:{configurable:!0},edgeCount:{configurable:!0}};ir.parse=function(e,r){var n=new Lg(e,r);if(n.next==null)return ir.empty;var o=Dz(n);n.next&&n.err("Unexpected trailing text");var i=W$t(k$t(o));return F$t(i,n),i},ir.prototype.matchType=function(e){for(var r=0;r<this.next.length;r+=2)if(this.next[r]==e)return this.next[r+1];return null},ir.prototype.matchFragment=function(e,r,n){r===void 0&&(r=0),n===void 0&&(n=e.childCount);for(var o=this,i=r;o&&i<n;i++)o=o.matchType(e.child(i).type);return o},Dg.inlineContent.get=function(){var t=this.next[0];return t?t.isInline:!1},Dg.defaultType.get=function(){for(var t=0;t<this.next.length;t+=2){var e=this.next[t];if(!(e.isText||e.hasRequiredAttrs()))return e}},ir.prototype.compatible=function(e){for(var r=0;r<this.next.length;r+=2)for(var n=0;n<e.next.length;n+=2)if(this.next[r]==e.next[n])return!0;return!1},ir.prototype.fillBefore=function(e,r,n){r===void 0&&(r=!1),n===void 0&&(n=0);var o=[this];function i(a,u){var c=a.matchFragment(e,n);if(c&&(!r||c.validEnd))return D.from(u.map(function(d){return d.createAndFill()}));for(var s=0;s<a.next.length;s+=2){var f=a.next[s],l=a.next[s+1];if(!(f.isText||f.hasRequiredAttrs())&&o.indexOf(l)==-1){o.push(l);var p=i(l,u.concat(f));if(p)return p}}}return i(this,[])},ir.prototype.findWrapping=function(e){for(var r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==e)return this.wrapCache[r+1];var n=this.computeWrapping(e);return this.wrapCache.push(e,n),n},ir.prototype.computeWrapping=function(e){for(var r=Object.create(null),n=[{match:this,type:null,via:null}];n.length;){var o=n.shift(),i=o.match;if(i.matchType(e)){for(var a=[],u=o;u.type;u=u.via)a.push(u.type);return a.reverse()}for(var c=0;c<i.next.length;c+=2){var s=i.next[c];!s.isLeaf&&!s.hasRequiredAttrs()&&!(s.name in r)&&(!o.type||i.next[c+1].validEnd)&&(n.push({match:s.contentMatch,type:s,via:o}),r[s.name]=!0)}}},Dg.edgeCount.get=function(){return this.next.length>>1},ir.prototype.edge=function(e){var r=e<<1;if(r>=this.next.length)throw new RangeError("There's no "+e+"th edge in this content match");return{type:this.next[r],next:this.next[r+1]}},ir.prototype.toString=function(){var e=[];function r(n){e.push(n);for(var o=1;o<n.next.length;o+=2)e.indexOf(n.next[o])==-1&&r(n.next[o])}return r(this),e.map(function(n,o){for(var i=o+(n.validEnd?"*":" ")+" ",a=0;a<n.next.length;a+=2)i+=(a?", ":"")+n.next[a].name+"->"+e.indexOf(n.next[a+1]);return i}).join(`
30
+ `)},Object.defineProperties(ir.prototype,Dg),ir.empty=new ir(!0);var Lg=function(e,r){this.string=e,this.nodeTypes=r,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()},Pz={next:{configurable:!0}};Pz.next.get=function(){return this.tokens[this.pos]},Lg.prototype.eat=function(e){return this.next==e&&(this.pos++||!0)},Lg.prototype.err=function(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")},Object.defineProperties(Lg.prototype,Pz);function Dz(t){var e=[];do e.push(E$t(t));while(t.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function E$t(t){var e=[];do e.push(w$t(t));while(t.next&&t.next!=")"&&t.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function w$t(t){for(var e=x$t(t);;)if(t.eat("+"))e={type:"plus",expr:e};else if(t.eat("*"))e={type:"star",expr:e};else if(t.eat("?"))e={type:"opt",expr:e};else if(t.eat("{"))e=A$t(t,e);else break;return e}function Lz(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");var e=Number(t.next);return t.pos++,e}function A$t(t,e){var r=Lz(t),n=r;return t.eat(",")&&(t.next!="}"?n=Lz(t):n=-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:r,max:n,expr:e}}function C$t(t,e){var r=t.nodeTypes,n=r[e];if(n)return[n];var o=[];for(var i in r){var a=r[i];a.groups.indexOf(e)>-1&&o.push(a)}return o.length==0&&t.err("No node type or group '"+e+"' found"),o}function x$t(t){if(t.eat("(")){var e=Dz(t);return t.eat(")")||t.err("Missing closing paren"),e}else if(/\W/.test(t.next))t.err("Unexpected token '"+t.next+"'");else{var r=C$t(t,t.next).map(function(n){return t.inline==null?t.inline=n.isInline:t.inline!=n.isInline&&t.err("Mixing inline and block content"),{type:"name",value:n}});return t.pos++,r.length==1?r[0]:{type:"choice",exprs:r}}}function k$t(t){var e=[[]];return o(i(t,0),r()),e;function r(){return e.push([])-1}function n(a,u,c){var s={term:c,to:u};return e[a].push(s),s}function o(a,u){a.forEach(function(c){return c.to=u})}function i(a,u){if(a.type=="choice")return a.exprs.reduce(function(b,$){return b.concat(i($,u))},[]);if(a.type=="seq")for(var c=0;;c++){var s=i(a.exprs[c],u);if(c==a.exprs.length-1)return s;o(s,u=r())}else if(a.type=="star"){var f=r();return n(u,f),o(i(a.expr,f),f),[n(f)]}else if(a.type=="plus"){var l=r();return o(i(a.expr,u),l),o(i(a.expr,l),l),[n(l)]}else{if(a.type=="opt")return[n(u)].concat(i(a.expr,u));if(a.type=="range"){for(var p=u,d=0;d<a.min;d++){var h=r();o(i(a.expr,p),h),p=h}if(a.max==-1)o(i(a.expr,p),p);else for(var m=a.min;m<a.max;m++){var g=r();n(p,g),o(i(a.expr,p),g),p=g}return[n(p)]}else if(a.type=="name")return[n(u,null,a.value)]}}}function Uz(t,e){return e-t}function jz(t,e){var r=[];return n(e),r.sort(Uz);function n(o){var i=t[o];if(i.length==1&&!i[0].term)return n(i[0].to);r.push(o);for(var a=0;a<i.length;a++){var u=i[a],c=u.term,s=u.to;!c&&r.indexOf(s)==-1&&n(s)}}}function W$t(t){var e=Object.create(null);return r(jz(t,0));function r(n){var o=[];n.forEach(function(c){t[c].forEach(function(s){var f=s.term,l=s.to;if(!!f){var p=o.indexOf(f),d=p>-1&&o[p+1];jz(t,l).forEach(function(h){d||o.push(f,d=[]),d.indexOf(h)==-1&&d.push(h)})}})});for(var i=e[n.join(",")]=new ir(n.indexOf(t.length-1)>-1),a=0;a<o.length;a+=2){var u=o[a+1].sort(Uz);i.next.push(o[a],e[u.join(",")]||r(u))}return i}}function F$t(t,e){for(var r=0,n=[t];r<n.length;r++){for(var o=n[r],i=!o.validEnd,a=[],u=0;u<o.next.length;u+=2){var c=o.next[u],s=o.next[u+1];a.push(c.name),i&&!(c.isText||c.hasRequiredAttrs())&&(i=!1),n.indexOf(s)==-1&&n.push(s)}i&&e.err("Only non-generatable nodes ("+a.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function Bz(t){var e=Object.create(null);for(var r in t){var n=t[r];if(!n.hasDefault)return null;e[r]=n.default}return e}function zz(t,e){var r=Object.create(null);for(var n in t){var o=e&&e[n];if(o===void 0){var i=t[n];if(i.hasDefault)o=i.default;else throw new RangeError("No value supplied for attribute "+n)}r[n]=o}return r}function qz(t){var e=Object.create(null);if(t)for(var r in t)e[r]=new Kz(t[r]);return e}var $r=function(e,r,n){this.name=e,this.schema=r,this.spec=n,this.groups=n.group?n.group.split(" "):[],this.attrs=qz(n.attrs),this.defaultAttrs=Bz(this.attrs),this.contentMatch=null,this.markSet=null,this.inlineContent=null,this.isBlock=!(n.inline||e=="text"),this.isText=e=="text"},Tf={isInline:{configurable:!0},isTextblock:{configurable:!0},isLeaf:{configurable:!0},isAtom:{configurable:!0},whitespace:{configurable:!0}};Tf.isInline.get=function(){return!this.isBlock},Tf.isTextblock.get=function(){return this.isBlock&&this.inlineContent},Tf.isLeaf.get=function(){return this.contentMatch==ir.empty},Tf.isAtom.get=function(){return this.isLeaf||this.spec.atom},Tf.whitespace.get=function(){return this.spec.whitespace||(this.spec.code?"pre":"normal")},$r.prototype.hasRequiredAttrs=function(){for(var e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1},$r.prototype.compatibleContent=function(e){return this==e||this.contentMatch.compatible(e.contentMatch)},$r.prototype.computeAttrs=function(e){return!e&&this.defaultAttrs?this.defaultAttrs:zz(this.attrs,e)},$r.prototype.create=function(e,r,n){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new Mt(this,this.computeAttrs(e),D.from(r),St.setFrom(n))},$r.prototype.createChecked=function(e,r,n){if(r=D.from(r),!this.validContent(r))throw new RangeError("Invalid content for node "+this.name);return new Mt(this,this.computeAttrs(e),r,St.setFrom(n))},$r.prototype.createAndFill=function(e,r,n){if(e=this.computeAttrs(e),r=D.from(r),r.size){var o=this.contentMatch.fillBefore(r);if(!o)return null;r=o.append(r)}var i=this.contentMatch.matchFragment(r).fillBefore(D.empty,!0);return i?new Mt(this,e,r.append(i),St.setFrom(n)):null},$r.prototype.validContent=function(e){var r=this.contentMatch.matchFragment(e);if(!r||!r.validEnd)return!1;for(var n=0;n<e.childCount;n++)if(!this.allowsMarks(e.child(n).marks))return!1;return!0},$r.prototype.allowsMarkType=function(e){return this.markSet==null||this.markSet.indexOf(e)>-1},$r.prototype.allowsMarks=function(e){if(this.markSet==null)return!0;for(var r=0;r<e.length;r++)if(!this.allowsMarkType(e[r].type))return!1;return!0},$r.prototype.allowedMarks=function(e){if(this.markSet==null)return e;for(var r,n=0;n<e.length;n++)this.allowsMarkType(e[n].type)?r&&r.push(e[n]):r||(r=e.slice(0,n));return r?r.length?r:St.empty:e},$r.compile=function(e,r){var n=Object.create(null);e.forEach(function(a,u){return n[a]=new $r(a,r,u)});var o=r.spec.topNode||"doc";if(!n[o])throw new RangeError("Schema is missing its top node type ('"+o+"')");if(!n.text)throw new RangeError("Every schema needs a 'text' type");for(var i in n.text.attrs)throw new RangeError("The text node type should not have attributes");return n},Object.defineProperties($r.prototype,Tf);var Kz=function(e){this.hasDefault=Object.prototype.hasOwnProperty.call(e,"default"),this.default=e.default},Vz={isRequired:{configurable:!0}};Vz.isRequired.get=function(){return!this.hasDefault},Object.defineProperties(Kz.prototype,Vz);var Wa=function(e,r,n,o){this.name=e,this.schema=n,this.spec=o,this.attrs=qz(o.attrs),this.rank=r,this.excluded=null;var i=Bz(this.attrs);this.instance=i&&new St(this,i)};Wa.prototype.create=function(e){return!e&&this.instance?this.instance:new St(this,zz(this.attrs,e))},Wa.compile=function(e,r){var n=Object.create(null),o=0;return e.forEach(function(i,a){return n[i]=new Wa(i,o++,r,a)}),n},Wa.prototype.removeFromSet=function(e){for(var r=0;r<e.length;r++)e[r].type==this&&(e=e.slice(0,r).concat(e.slice(r+1)),r--);return e},Wa.prototype.isInSet=function(e){for(var r=0;r<e.length;r++)if(e[r].type==this)return e[r]},Wa.prototype.excludes=function(e){return this.excluded.indexOf(e)>-1};var dc=function(e){this.spec={};for(var r in e)this.spec[r]=e[r];this.spec.nodes=Rz.from(e.nodes),this.spec.marks=Rz.from(e.marks),this.nodes=$r.compile(this.spec.nodes,this),this.marks=Wa.compile(this.spec.marks,this);var n=Object.create(null);for(var o in this.nodes){if(o in this.marks)throw new RangeError(o+" can not be both a node and a mark");var i=this.nodes[o],a=i.spec.content||"",u=i.spec.marks;i.contentMatch=n[a]||(n[a]=ir.parse(a,this.nodes)),i.inlineContent=i.contentMatch.inlineContent,i.markSet=u=="_"?null:u?Hz(this,u.split(" ")):u==""||!i.inlineContent?[]:null}for(var c in this.marks){var s=this.marks[c],f=s.spec.excludes;s.excluded=f==null?[s]:f==""?[]:Hz(this,f.split(" "))}this.nodeFromJSON=this.nodeFromJSON.bind(this),this.markFromJSON=this.markFromJSON.bind(this),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached=Object.create(null),this.cached.wrappings=Object.create(null)};dc.prototype.node=function(e,r,n,o){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof $r){if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}else throw new RangeError("Invalid node type: "+e);return e.createChecked(r,n,o)},dc.prototype.text=function(e,r){var n=this.nodes.text;return new R$t(n,n.defaultAttrs,e,St.setFrom(r))},dc.prototype.mark=function(e,r){return typeof e=="string"&&(e=this.marks[e]),e.create(r)},dc.prototype.nodeFromJSON=function(e){return Mt.fromJSON(this,e)},dc.prototype.markFromJSON=function(e){return St.fromJSON(this,e)},dc.prototype.nodeType=function(e){var r=this.nodes[e];if(!r)throw new RangeError("Unknown node type: "+e);return r};function Hz(t,e){for(var r=[],n=0;n<e.length;n++){var o=e[n],i=t.marks[o],a=i;if(i)r.push(i);else for(var u in t.marks){var c=t.marks[u];(o=="_"||c.spec.group&&c.spec.group.split(" ").indexOf(o)>-1)&&r.push(a=c)}if(!a)throw new SyntaxError("Unknown mark type: '"+e[n]+"'")}return r}var no=function(e,r){var n=this;this.schema=e,this.rules=r,this.tags=[],this.styles=[],r.forEach(function(o){o.tag?n.tags.push(o):o.style&&n.styles.push(o)}),this.normalizeLists=!this.tags.some(function(o){if(!/^(ul|ol)\b/.test(o.tag)||!o.node)return!1;var i=e.nodes[o.node];return i.contentMatch.matchType(i)})};no.prototype.parse=function(e,r){r===void 0&&(r={});var n=new zt(this,r,!1);return n.addAll(e,null,r.from,r.to),n.finish()},no.prototype.parseSlice=function(e,r){r===void 0&&(r={});var n=new zt(this,r,!0);return n.addAll(e,null,r.from,r.to),Z.maxOpen(n.finish())},no.prototype.matchTag=function(e,r,n){for(var o=n?this.tags.indexOf(n)+1:0;o<this.tags.length;o++){var i=this.tags[o];if(D$t(e,i.tag)&&(i.namespace===void 0||e.namespaceURI==i.namespace)&&(!i.context||r.matchesContext(i.context))){if(i.getAttrs){var a=i.getAttrs(e);if(a===!1)continue;i.attrs=a}return i}}},no.prototype.matchStyle=function(e,r,n,o){for(var i=o?this.styles.indexOf(o)+1:0;i<this.styles.length;i++){var a=this.styles[i];if(!(a.style.indexOf(e)!=0||a.context&&!n.matchesContext(a.context)||a.style.length>e.length&&(a.style.charCodeAt(e.length)!=61||a.style.slice(e.length+1)!=r))){if(a.getAttrs){var u=a.getAttrs(r);if(u===!1)continue;a.attrs=u}return a}}},no.schemaRules=function(e){var r=[];function n(c){for(var s=c.priority==null?50:c.priority,f=0;f<r.length;f++){var l=r[f],p=l.priority==null?50:l.priority;if(p<s)break}r.splice(f,0,c)}var o=function(c){var s=e.marks[c].spec.parseDOM;s&&s.forEach(function(f){n(f=Yz(f)),f.mark=c})};for(var i in e.marks)o(i);var a=function(c){var s=e.nodes[u].spec.parseDOM;s&&s.forEach(function(f){n(f=Yz(f)),f.node=u})};for(var u in e.nodes)a();return r},no.fromSchema=function(e){return e.cached.domParser||(e.cached.domParser=new no(e,no.schemaRules(e)))};var LM={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},N$t={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},Jz={ol:!0,ul:!0},Ug=1,jg=2,bd=4;function Gz(t,e,r){return e!=null?(e?Ug:0)|(e==="full"?jg:0):t&&t.whitespace=="pre"?Ug|jg:r&~bd}var Ii=function(e,r,n,o,i,a,u){this.type=e,this.attrs=r,this.solid=i,this.match=a||(u&bd?null:e.contentMatch),this.options=u,this.content=[],this.marks=n,this.activeMarks=St.none,this.pendingMarks=o,this.stashMarks=[]};Ii.prototype.findWrapping=function(e){if(!this.match){if(!this.type)return[];var r=this.type.contentMatch.fillBefore(D.from(e));if(r)this.match=this.type.contentMatch.matchFragment(r);else{var n=this.type.contentMatch,o;return(o=n.findWrapping(e.type))?(this.match=n,o):null}}return this.match.findWrapping(e.type)},Ii.prototype.finish=function(e){if(!(this.options&Ug)){var r=this.content[this.content.length-1],n;r&&r.isText&&(n=/[ \t\r\n\u000c]+$/.exec(r.text))&&(r.text.length==n[0].length?this.content.pop():this.content[this.content.length-1]=r.withText(r.text.slice(0,r.text.length-n[0].length)))}var o=D.from(this.content);return!e&&this.match&&(o=o.append(this.match.fillBefore(D.empty,!0))),this.type?this.type.create(this.attrs,o,this.marks):o},Ii.prototype.popFromStashMark=function(e){for(var r=this.stashMarks.length-1;r>=0;r--)if(e.eq(this.stashMarks[r]))return this.stashMarks.splice(r,1)[0]},Ii.prototype.applyPending=function(e){for(var r=0,n=this.pendingMarks;r<n.length;r++){var o=n[r];(this.type?this.type.allowsMarkType(o.type):U$t(o.type,e))&&!o.isInSet(this.activeMarks)&&(this.activeMarks=o.addToSet(this.activeMarks),this.pendingMarks=o.removeFromSet(this.pendingMarks))}},Ii.prototype.inlineContext=function(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!LM.hasOwnProperty(e.parentNode.nodeName.toLowerCase())};var zt=function(e,r,n){this.parser=e,this.options=r,this.isOpen=n;var o=r.topNode,i,a=Gz(null,r.preserveWhitespace,0)|(n?bd:0);o?i=new Ii(o.type,o.attrs,St.none,St.none,!0,r.topMatch||o.type.contentMatch,a):n?i=new Ii(null,null,St.none,St.none,!0,null,a):i=new Ii(e.schema.topNodeType,null,St.none,St.none,!0,null,a),this.nodes=[i],this.open=0,this.find=r.findPositions,this.needsBlock=!1},UM={top:{configurable:!0},currentPos:{configurable:!0}};UM.top.get=function(){return this.nodes[this.open]},zt.prototype.addDOM=function(e){if(e.nodeType==3)this.addTextNode(e);else if(e.nodeType==1){var r=e.getAttribute("style"),n=r?this.readStyles(L$t(r)):null,o=this.top;if(n!=null)for(var i=0;i<n.length;i++)this.addPendingMark(n[i]);if(this.addElement(e),n!=null)for(var a=0;a<n.length;a++)this.removePendingMark(n[a],o)}},zt.prototype.addTextNode=function(e){var r=e.nodeValue,n=this.top;if(n.options&jg||n.inlineContext(e)||/[^ \t\r\n\u000c]/.test(r)){if(n.options&Ug)n.options&jg?r=r.replace(/\r\n?/g,`
31
+ `):r=r.replace(/\r?\n|\r/g," ");else if(r=r.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(r)&&this.open==this.nodes.length-1){var o=n.content[n.content.length-1],i=e.previousSibling;(!o||i&&i.nodeName=="BR"||o.isText&&/[ \t\r\n\u000c]$/.test(o.text))&&(r=r.slice(1))}r&&this.insertNode(this.parser.schema.text(r)),this.findInText(e)}else this.findInside(e)},zt.prototype.addElement=function(e,r){var n=e.nodeName.toLowerCase(),o;Jz.hasOwnProperty(n)&&this.parser.normalizeLists&&P$t(e);var i=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(o=this.parser.matchTag(e,this,r));if(i?i.ignore:N$t.hasOwnProperty(n))this.findInside(e),this.ignoreFallback(e);else if(!i||i.skip||i.closeParent){i&&i.closeParent?this.open=Math.max(0,this.open-1):i&&i.skip.nodeType&&(e=i.skip);var a,u=this.top,c=this.needsBlock;if(LM.hasOwnProperty(n))a=!0,u.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e);return}this.addAll(e),a&&this.sync(u),this.needsBlock=c}else this.addElementByRule(e,i,i.consuming===!1?o:null)},zt.prototype.leafFallback=function(e){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
32
+ `))},zt.prototype.ignoreFallback=function(e){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"))},zt.prototype.readStyles=function(e){var r=St.none;t:for(var n=0;n<e.length;n+=2)for(var o=null;;){var i=this.parser.matchStyle(e[n],e[n+1],this,o);if(!i)continue t;if(i.ignore)return null;if(r=this.parser.schema.marks[i.mark].create(i.attrs).addToSet(r),i.consuming===!1)o=i;else break}return r},zt.prototype.addElementByRule=function(e,r,n){var o=this,i,a,u,c;r.node?(a=this.parser.schema.nodes[r.node],a.isLeaf?this.insertNode(a.create(r.attrs))||this.leafFallback(e):i=this.enter(a,r.attrs,r.preserveWhitespace)):(u=this.parser.schema.marks[r.mark],c=u.create(r.attrs),this.addPendingMark(c));var s=this.top;if(a&&a.isLeaf)this.findInside(e);else if(n)this.addElement(e,n);else if(r.getContent)this.findInside(e),r.getContent(e,this.parser.schema).forEach(function(l){return o.insertNode(l)});else{var f=r.contentElement;typeof f=="string"?f=e.querySelector(f):typeof f=="function"&&(f=f(e)),f||(f=e),this.findAround(e,f,!0),this.addAll(f,i)}i&&(this.sync(s),this.open--),c&&this.removePendingMark(c,s)},zt.prototype.addAll=function(e,r,n,o){for(var i=n||0,a=n?e.childNodes[n]:e.firstChild,u=o==null?null:e.childNodes[o];a!=u;a=a.nextSibling,++i)this.findAtPoint(e,i),this.addDOM(a),r&&LM.hasOwnProperty(a.nodeName.toLowerCase())&&this.sync(r);this.findAtPoint(e,i)},zt.prototype.findPlace=function(e){for(var r,n,o=this.open;o>=0;o--){var i=this.nodes[o],a=i.findWrapping(e);if(a&&(!r||r.length>a.length)&&(r=a,n=i,!a.length)||i.solid)break}if(!r)return!1;this.sync(n);for(var u=0;u<r.length;u++)this.enterInner(r[u],null,!1);return!0},zt.prototype.insertNode=function(e){if(e.isInline&&this.needsBlock&&!this.top.type){var r=this.textblockFromContext();r&&this.enterInner(r)}if(this.findPlace(e)){this.closeExtra();var n=this.top;n.applyPending(e.type),n.match&&(n.match=n.match.matchType(e.type));for(var o=n.activeMarks,i=0;i<e.marks.length;i++)(!n.type||n.type.allowsMarkType(e.marks[i].type))&&(o=e.marks[i].addToSet(o));return n.content.push(e.mark(o)),!0}return!1},zt.prototype.enter=function(e,r,n){var o=this.findPlace(e.create(r));return o&&this.enterInner(e,r,!0,n),o},zt.prototype.enterInner=function(e,r,n,o){this.closeExtra();var i=this.top;i.applyPending(e),i.match=i.match&&i.match.matchType(e,r);var a=Gz(e,o,i.options);i.options&bd&&i.content.length==0&&(a|=bd),this.nodes.push(new Ii(e,r,i.activeMarks,i.pendingMarks,n,null,a)),this.open++},zt.prototype.closeExtra=function(e){var r=this.nodes.length-1;if(r>this.open){for(;r>this.open;r--)this.nodes[r-1].content.push(this.nodes[r].finish(e));this.nodes.length=this.open+1}},zt.prototype.finish=function(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(this.isOpen||this.options.topOpen)},zt.prototype.sync=function(e){for(var r=this.open;r>=0;r--)if(this.nodes[r]==e){this.open=r;return}},UM.currentPos.get=function(){this.closeExtra();for(var t=0,e=this.open;e>=0;e--){for(var r=this.nodes[e].content,n=r.length-1;n>=0;n--)t+=r[n].nodeSize;e&&t++}return t},zt.prototype.findAtPoint=function(e,r){if(this.find)for(var n=0;n<this.find.length;n++)this.find[n].node==e&&this.find[n].offset==r&&(this.find[n].pos=this.currentPos)},zt.prototype.findInside=function(e){if(this.find)for(var r=0;r<this.find.length;r++)this.find[r].pos==null&&e.nodeType==1&&e.contains(this.find[r].node)&&(this.find[r].pos=this.currentPos)},zt.prototype.findAround=function(e,r,n){if(e!=r&&this.find){for(var o=0;o<this.find.length;o++)if(this.find[o].pos==null&&e.nodeType==1&&e.contains(this.find[o].node)){var i=r.compareDocumentPosition(this.find[o].node);i&(n?2:4)&&(this.find[o].pos=this.currentPos)}}},zt.prototype.findInText=function(e){if(this.find)for(var r=0;r<this.find.length;r++)this.find[r].node==e&&(this.find[r].pos=this.currentPos-(e.nodeValue.length-this.find[r].offset))},zt.prototype.matchesContext=function(e){var r=this;if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);var n=e.split("/"),o=this.options.context,i=!this.isOpen&&(!o||o.parent.type==this.nodes[0].type),a=-(o?o.depth+1:0)+(i?0:1),u=function(c,s){for(;c>=0;c--){var f=n[c];if(f==""){if(c==n.length-1||c==0)continue;for(;s>=a;s--)if(u(c-1,s))return!0;return!1}else{var l=s>0||s==0&&i?r.nodes[s].type:o&&s>=a?o.node(s-a).type:null;if(!l||l.name!=f&&l.groups.indexOf(f)==-1)return!1;s--}}return!0};return u(n.length-1,this.open)},zt.prototype.textblockFromContext=function(){var e=this.options.context;if(e)for(var r=e.depth;r>=0;r--){var n=e.node(r).contentMatchAt(e.indexAfter(r)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(var o in this.parser.schema.nodes){var i=this.parser.schema.nodes[o];if(i.isTextblock&&i.defaultAttrs)return i}},zt.prototype.addPendingMark=function(e){var r=j$t(e,this.top.pendingMarks);r&&this.top.stashMarks.push(r),this.top.pendingMarks=e.addToSet(this.top.pendingMarks)},zt.prototype.removePendingMark=function(e,r){for(var n=this.open;n>=0;n--){var o=this.nodes[n],i=o.pendingMarks.lastIndexOf(e);if(i>-1)o.pendingMarks=e.removeFromSet(o.pendingMarks);else{o.activeMarks=e.removeFromSet(o.activeMarks);var a=o.popFromStashMark(e);a&&o.type&&o.type.allowsMarkType(a.type)&&(o.activeMarks=a.addToSet(o.activeMarks))}if(o==r)break}},Object.defineProperties(zt.prototype,UM);function P$t(t){for(var e=t.firstChild,r=null;e;e=e.nextSibling){var n=e.nodeType==1?e.nodeName.toLowerCase():null;n&&Jz.hasOwnProperty(n)&&r?(r.appendChild(e),e=r):n=="li"?r=e:n&&(r=null)}}function D$t(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function L$t(t){for(var e=/\s*([\w-]+)\s*:\s*([^;]+)/g,r,n=[];r=e.exec(t);)n.push(r[1],r[2].trim());return n}function Yz(t){var e={};for(var r in t)e[r]=t[r];return e}function U$t(t,e){var r=e.schema.nodes,n=function(a){var u=r[a];if(!!u.allowsMarkType(t)){var c=[],s=function(f){c.push(f);for(var l=0;l<f.edgeCount;l++){var p=f.edge(l),d=p.type,h=p.next;if(d==e||c.indexOf(h)<0&&s(h))return!0}};if(s(u.contentMatch))return{v:!0}}};for(var o in r){var i=n(o);if(i)return i.v}}function j$t(t,e){for(var r=0;r<e.length;r++)if(t.eq(e[r]))return e[r]}var Ke=function(e,r){this.nodes=e||{},this.marks=r||{}};Ke.prototype.serializeFragment=function(e,r,n){var o=this;r===void 0&&(r={}),n||(n=jM(r).createDocumentFragment());var i=n,a=null;return e.forEach(function(u){if(a||u.marks.length){a||(a=[]);for(var c=0,s=0;c<a.length&&s<u.marks.length;){var f=u.marks[s];if(!o.marks[f.type.name]){s++;continue}if(!f.eq(a[c])||f.type.spec.spanning===!1)break;c+=2,s++}for(;c<a.length;)i=a.pop(),a.pop();for(;s<u.marks.length;){var l=u.marks[s++],p=o.serializeMark(l,u.isInline,r);p&&(a.push(l,i),i.appendChild(p.dom),i=p.contentDOM||p.dom)}}i.appendChild(o.serializeNodeInner(u,r))}),n},Ke.prototype.serializeNodeInner=function(e,r){r===void 0&&(r={});var n=Ke.renderSpec(jM(r),this.nodes[e.type.name](e)),o=n.dom,i=n.contentDOM;if(i){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");r.onContent?r.onContent(e,i,r):this.serializeFragment(e.content,r,i)}return o},Ke.prototype.serializeNode=function(e,r){r===void 0&&(r={});for(var n=this.serializeNodeInner(e,r),o=e.marks.length-1;o>=0;o--){var i=this.serializeMark(e.marks[o],e.isInline,r);i&&((i.contentDOM||i.dom).appendChild(n),n=i.dom)}return n},Ke.prototype.serializeMark=function(e,r,n){n===void 0&&(n={});var o=this.marks[e.type.name];return o&&Ke.renderSpec(jM(n),o(e,r))},Ke.renderSpec=function(e,r,n){if(n===void 0&&(n=null),typeof r=="string")return{dom:e.createTextNode(r)};if(r.nodeType!=null)return{dom:r};if(r.dom&&r.dom.nodeType!=null)return r;var o=r[0],i=o.indexOf(" ");i>0&&(n=o.slice(0,i),o=o.slice(i+1));var a=null,u=n?e.createElementNS(n,o):e.createElement(o),c=r[1],s=1;if(c&&typeof c=="object"&&c.nodeType==null&&!Array.isArray(c)){s=2;for(var f in c)if(c[f]!=null){var l=f.indexOf(" ");l>0?u.setAttributeNS(f.slice(0,l),f.slice(l+1),c[f]):u.setAttribute(f,c[f])}}for(var p=s;p<r.length;p++){var d=r[p];if(d===0){if(p<r.length-1||p>s)throw new RangeError("Content hole must be the only child of its parent node");return{dom:u,contentDOM:u}}else{var h=Ke.renderSpec(e,d,n),m=h.dom,g=h.contentDOM;if(u.appendChild(m),g){if(a)throw new RangeError("Multiple content holes");a=g}}}return{dom:u,contentDOM:a}},Ke.fromSchema=function(e){return e.cached.domSerializer||(e.cached.domSerializer=new Ke(this.nodesFromSchema(e),this.marksFromSchema(e)))},Ke.nodesFromSchema=function(e){var r=Xz(e.nodes);return r.text||(r.text=function(n){return n.text}),r},Ke.marksFromSchema=function(e){return Xz(e.marks)};function Xz(t){var e={};for(var r in t){var n=t[r].spec.toDOM;n&&(e[r]=n)}return e}function jM(t){return t.document||window.document}var Zz=65535,Qz=Math.pow(2,16);function B$t(t,e){return t+e*Qz}function tq(t){return t&Zz}function z$t(t){return(t-(t&Zz))/Qz}var BM=function(e,r,n){r===void 0&&(r=!1),n===void 0&&(n=null),this.pos=e,this.deleted=r,this.recover=n},Ve=function t(e,r){if(r===void 0&&(r=!1),!e.length&&t.empty)return t.empty;this.ranges=e,this.inverted=r};Ve.prototype.recover=function(e){var r=0,n=tq(e);if(!this.inverted)for(var o=0;o<n;o++)r+=this.ranges[o*3+2]-this.ranges[o*3+1];return this.ranges[n*3]+r+z$t(e)},Ve.prototype.mapResult=function(e,r){return r===void 0&&(r=1),this._map(e,r,!1)},Ve.prototype.map=function(e,r){return r===void 0&&(r=1),this._map(e,r,!0)},Ve.prototype._map=function(e,r,n){for(var o=0,i=this.inverted?2:1,a=this.inverted?1:2,u=0;u<this.ranges.length;u+=3){var c=this.ranges[u]-(this.inverted?o:0);if(c>e)break;var s=this.ranges[u+i],f=this.ranges[u+a],l=c+s;if(e<=l){var p=s?e==c?-1:e==l?1:r:r,d=c+o+(p<0?0:f);if(n)return d;var h=e==(r<0?c:l)?null:B$t(u/3,e-c);return new BM(d,r<0?e!=c:e!=l,h)}o+=f-s}return n?e+o:new BM(e+o)},Ve.prototype.touches=function(e,r){for(var n=0,o=tq(r),i=this.inverted?2:1,a=this.inverted?1:2,u=0;u<this.ranges.length;u+=3){var c=this.ranges[u]-(this.inverted?n:0);if(c>e)break;var s=this.ranges[u+i],f=c+s;if(e<=f&&u==o*3)return!0;n+=this.ranges[u+a]-s}return!1},Ve.prototype.forEach=function(e){for(var r=this.inverted?2:1,n=this.inverted?1:2,o=0,i=0;o<this.ranges.length;o+=3){var a=this.ranges[o],u=a-(this.inverted?i:0),c=a+(this.inverted?0:i),s=this.ranges[o+r],f=this.ranges[o+n];e(u,u+s,c,c+f),i+=f-s}},Ve.prototype.invert=function(){return new Ve(this.ranges,!this.inverted)},Ve.prototype.toString=function(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)},Ve.offset=function(e){return e==0?Ve.empty:new Ve(e<0?[0,-e,0]:[0,0,e])},Ve.empty=new Ve([]);var _r=function(e,r,n,o){this.maps=e||[],this.from=n||0,this.to=o==null?this.maps.length:o,this.mirror=r};_r.prototype.slice=function(e,r){return e===void 0&&(e=0),r===void 0&&(r=this.maps.length),new _r(this.maps,this.mirror,e,r)},_r.prototype.copy=function(){return new _r(this.maps.slice(),this.mirror&&this.mirror.slice(),this.from,this.to)},_r.prototype.appendMap=function(e,r){this.to=this.maps.push(e),r!=null&&this.setMirror(this.maps.length-1,r)},_r.prototype.appendMapping=function(e){for(var r=0,n=this.maps.length;r<e.maps.length;r++){var o=e.getMirror(r);this.appendMap(e.maps[r],o!=null&&o<r?n+o:null)}},_r.prototype.getMirror=function(e){if(this.mirror){for(var r=0;r<this.mirror.length;r++)if(this.mirror[r]==e)return this.mirror[r+(r%2?-1:1)]}},_r.prototype.setMirror=function(e,r){this.mirror||(this.mirror=[]),this.mirror.push(e,r)},_r.prototype.appendMappingInverted=function(e){for(var r=e.maps.length-1,n=this.maps.length+e.maps.length;r>=0;r--){var o=e.getMirror(r);this.appendMap(e.maps[r].invert(),o!=null&&o>r?n-o-1:null)}},_r.prototype.invert=function(){var e=new _r;return e.appendMappingInverted(this),e},_r.prototype.map=function(e,r){if(r===void 0&&(r=1),this.mirror)return this._map(e,r,!0);for(var n=this.from;n<this.to;n++)e=this.maps[n].map(e,r);return e},_r.prototype.mapResult=function(e,r){return r===void 0&&(r=1),this._map(e,r,!1)},_r.prototype._map=function(e,r,n){for(var o=!1,i=this.from;i<this.to;i++){var a=this.maps[i],u=a.mapResult(e,r);if(u.recover!=null){var c=this.getMirror(i);if(c!=null&&c>i&&c<this.to){i=c,e=this.maps[c].recover(u.recover);continue}}u.deleted&&(o=!0),e=u.pos}return n?e:new BM(e,o)};function If(t){var e=Error.call(this,t);return e.__proto__=If.prototype,e}If.prototype=Object.create(Error.prototype),If.prototype.constructor=If,If.prototype.name="TransformError";var fe=function(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new _r},zM={before:{configurable:!0},docChanged:{configurable:!0}};zM.before.get=function(){return this.docs.length?this.docs[0]:this.doc},fe.prototype.step=function(e){var r=this.maybeStep(e);if(r.failed)throw new If(r.failed);return this},fe.prototype.maybeStep=function(e){var r=e.apply(this.doc);return r.failed||this.addStep(e,r.doc),r},zM.docChanged.get=function(){return this.steps.length>0},fe.prototype.addStep=function(e,r){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=r},Object.defineProperties(fe.prototype,zM);function Bg(){throw new Error("Override me")}var qM=Object.create(null),ar=function(){};ar.prototype.apply=function(e){return Bg()},ar.prototype.getMap=function(){return Ve.empty},ar.prototype.invert=function(e){return Bg()},ar.prototype.map=function(e){return Bg()},ar.prototype.merge=function(e){return null},ar.prototype.toJSON=function(){return Bg()},ar.fromJSON=function(e,r){if(!r||!r.stepType)throw new RangeError("Invalid input for Step.fromJSON");var n=qM[r.stepType];if(!n)throw new RangeError("No step type "+r.stepType+" defined");return n.fromJSON(e,r)},ar.jsonID=function(e,r){if(e in qM)throw new RangeError("Duplicate use of step JSON ID "+e);return qM[e]=r,r.prototype.jsonID=e,r};var Sr=function(e,r){this.doc=e,this.failed=r};Sr.ok=function(e){return new Sr(e,null)},Sr.fail=function(e){return new Sr(null,e)},Sr.fromReplace=function(e,r,n,o){try{return Sr.ok(e.replace(r,n,o))}catch(i){if(i instanceof xo)return Sr.fail(i.message);throw i}};var Oi=function(t){function e(r,n,o,i){t.call(this),this.from=r,this.to=n,this.slice=o,this.structure=!!i}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.apply=function(n){return this.structure&&KM(n,this.from,this.to)?Sr.fail("Structure replace would overwrite content"):Sr.fromReplace(n,this.from,this.to,this.slice)},e.prototype.getMap=function(){return new Ve([this.from,this.to-this.from,this.slice.size])},e.prototype.invert=function(n){return new e(this.from,this.from+this.slice.size,n.slice(this.from,this.to))},e.prototype.map=function(n){var o=n.mapResult(this.from,1),i=n.mapResult(this.to,-1);return o.deleted&&i.deleted?null:new e(o.pos,Math.max(o.pos,i.pos),this.slice)},e.prototype.merge=function(n){if(!(n instanceof e)||n.structure||this.structure)return null;if(this.from+this.slice.size==n.from&&!this.slice.openEnd&&!n.slice.openStart){var o=this.slice.size+n.slice.size==0?Z.empty:new Z(this.slice.content.append(n.slice.content),this.slice.openStart,n.slice.openEnd);return new e(this.from,this.to+(n.to-n.from),o,this.structure)}else if(n.to==this.from&&!this.slice.openStart&&!n.slice.openEnd){var i=this.slice.size+n.slice.size==0?Z.empty:new Z(n.slice.content.append(this.slice.content),n.slice.openStart,this.slice.openEnd);return new e(n.from,this.to,i,this.structure)}else return null},e.prototype.toJSON=function(){var n={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(n.slice=this.slice.toJSON()),this.structure&&(n.structure=!0),n},e.fromJSON=function(n,o){if(typeof o.from!="number"||typeof o.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new e(o.from,o.to,Z.fromJSON(n,o.slice),!!o.structure)},e}(ar);ar.jsonID("replace",Oi);var Pr=function(t){function e(r,n,o,i,a,u,c){t.call(this),this.from=r,this.to=n,this.gapFrom=o,this.gapTo=i,this.slice=a,this.insert=u,this.structure=!!c}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.apply=function(n){if(this.structure&&(KM(n,this.from,this.gapFrom)||KM(n,this.gapTo,this.to)))return Sr.fail("Structure gap-replace would overwrite content");var o=n.slice(this.gapFrom,this.gapTo);if(o.openStart||o.openEnd)return Sr.fail("Gap is not a flat range");var i=this.slice.insertAt(this.insert,o.content);return i?Sr.fromReplace(n,this.from,this.to,i):Sr.fail("Content does not fit in gap")},e.prototype.getMap=function(){return new Ve([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])},e.prototype.invert=function(n){var o=this.gapTo-this.gapFrom;return new e(this.from,this.from+this.slice.size+o,this.from+this.insert,this.from+this.insert+o,n.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)},e.prototype.map=function(n){var o=n.mapResult(this.from,1),i=n.mapResult(this.to,-1),a=n.map(this.gapFrom,-1),u=n.map(this.gapTo,1);return o.deleted&&i.deleted||a<o.pos||u>i.pos?null:new e(o.pos,i.pos,a,u,this.slice,this.insert,this.structure)},e.prototype.toJSON=function(){var n={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(n.slice=this.slice.toJSON()),this.structure&&(n.structure=!0),n},e.fromJSON=function(n,o){if(typeof o.from!="number"||typeof o.to!="number"||typeof o.gapFrom!="number"||typeof o.gapTo!="number"||typeof o.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new e(o.from,o.to,o.gapFrom,o.gapTo,Z.fromJSON(n,o.slice),o.insert,!!o.structure)},e}(ar);ar.jsonID("replaceAround",Pr);function KM(t,e,r){for(var n=t.resolve(e),o=r-e,i=n.depth;o>0&&i>0&&n.indexAfter(i)==n.node(i).childCount;)i--,o--;if(o>0)for(var a=n.node(i).maybeChild(n.indexAfter(i));o>0;){if(!a||a.isLeaf)return!0;a=a.firstChild,o--}return!1}function q$t(t,e,r){return(e==0||t.canReplace(e,t.childCount))&&(r==t.childCount||t.canReplace(0,r))}function Of(t){for(var e=t.parent,r=e.content.cutByIndex(t.startIndex,t.endIndex),n=t.depth;;--n){var o=t.$from.node(n),i=t.$from.index(n),a=t.$to.indexAfter(n);if(n<t.depth&&o.canReplace(i,a,r))return n;if(n==0||o.type.spec.isolating||!q$t(o,i,a))break}}fe.prototype.lift=function(t,e){for(var r=t.$from,n=t.$to,o=t.depth,i=r.before(o+1),a=n.after(o+1),u=i,c=a,s=D.empty,f=0,l=o,p=!1;l>e;l--)p||r.index(l)>0?(p=!0,s=D.from(r.node(l).copy(s)),f++):u--;for(var d=D.empty,h=0,m=o,g=!1;m>e;m--)g||n.after(m+1)<n.end(m)?(g=!0,d=D.from(n.node(m).copy(d)),h++):c++;return this.step(new Pr(u,c,i,a,new Z(s.append(d),f,h),s.size-f,!0))};function VM(t,e,r,n){n===void 0&&(n=t);var o=K$t(t,e),i=o&&V$t(n,e);return i?o.map(eq).concat({type:e,attrs:r}).concat(i.map(eq)):null}function eq(t){return{type:t,attrs:null}}function K$t(t,e){var r=t.parent,n=t.startIndex,o=t.endIndex,i=r.contentMatchAt(n).findWrapping(e);if(!i)return null;var a=i.length?i[0]:e;return r.canReplaceWith(n,o,a)?i:null}function V$t(t,e){var r=t.parent,n=t.startIndex,o=t.endIndex,i=r.child(n),a=e.contentMatch.findWrapping(i.type);if(!a)return null;for(var u=a.length?a[a.length-1]:e,c=u.contentMatch,s=n;c&&s<o;s++)c=c.matchType(r.child(s).type);return!c||!c.validEnd?null:a}fe.prototype.wrap=function(t,e){for(var r=D.empty,n=e.length-1;n>=0;n--){if(r.size){var o=e[n].type.contentMatch.matchFragment(r);if(!o||!o.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=D.from(e[n].type.create(e[n].attrs,r))}var i=t.start,a=t.end;return this.step(new Pr(i,a,i,a,new Z(r,0,0),e.length,!0))},fe.prototype.setBlockType=function(t,e,r,n){var o=this;if(e===void 0&&(e=t),!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");var i=this.steps.length;return this.doc.nodesBetween(t,e,function(a,u){if(a.isTextblock&&!a.hasMarkup(r,n)&&H$t(o.doc,o.mapping.slice(i).map(u),r)){o.clearIncompatible(o.mapping.slice(i).map(u,1),r);var c=o.mapping.slice(i),s=c.map(u,1),f=c.map(u+a.nodeSize,1);return o.step(new Pr(s,f,s+1,f-1,new Z(D.from(r.create(n,null,a.marks)),0,0),1,!0)),!1}}),this};function H$t(t,e,r){var n=t.resolve(e),o=n.index();return n.parent.canReplaceWith(o,o+1,r)}fe.prototype.setNodeMarkup=function(t,e,r,n){var o=this.doc.nodeAt(t);if(!o)throw new RangeError("No node at given position");e||(e=o.type);var i=e.create(r,null,n||o.marks);if(o.isLeaf)return this.replaceWith(t,t+o.nodeSize,i);if(!e.validContent(o.content))throw new RangeError("Invalid content for node type "+e.name);return this.step(new Pr(t,t+o.nodeSize,t+1,t+o.nodeSize-1,new Z(D.from(i),0,0),1,!0))};function Mi(t,e,r,n){r===void 0&&(r=1);var o=t.resolve(e),i=o.depth-r,a=n&&n[n.length-1]||o.parent;if(i<0||o.parent.type.spec.isolating||!o.parent.canReplace(o.index(),o.parent.childCount)||!a.type.validContent(o.parent.content.cutByIndex(o.index(),o.parent.childCount)))return!1;for(var u=o.depth-1,c=r-2;u>i;u--,c--){var s=o.node(u),f=o.index(u);if(s.type.spec.isolating)return!1;var l=s.content.cutByIndex(f,s.childCount),p=n&&n[c]||s;if(p!=s&&(l=l.replaceChild(0,p.type.create(p.attrs))),!s.canReplace(f+1,s.childCount)||!p.type.validContent(l))return!1}var d=o.indexAfter(i),h=n&&n[0];return o.node(i).canReplaceWith(d,d,h?h.type:o.node(i+1).type)}fe.prototype.split=function(t,e,r){e===void 0&&(e=1);for(var n=this.doc.resolve(t),o=D.empty,i=D.empty,a=n.depth,u=n.depth-e,c=e-1;a>u;a--,c--){o=D.from(n.node(a).copy(o));var s=r&&r[c];i=D.from(s?s.type.create(s.attrs,i):n.node(a).copy(i))}return this.step(new Oi(t,t,new Z(o.append(i),e,e),!0))};function $d(t,e){var r=t.resolve(e),n=r.index();return J$t(r.nodeBefore,r.nodeAfter)&&r.parent.canReplace(n,n+1)}function J$t(t,e){return t&&e&&!t.isLeaf&&t.canAppend(e)}fe.prototype.join=function(t,e){e===void 0&&(e=1);var r=new Oi(t-e,t+e,Z.empty,!0);return this.step(r)};function G$t(t,e,r){var n=t.resolve(e);if(n.parent.canReplaceWith(n.index(),n.index(),r))return e;if(n.parentOffset==0)for(var o=n.depth-1;o>=0;o--){var i=n.index(o);if(n.node(o).canReplaceWith(i,i,r))return n.before(o+1);if(i>0)return null}if(n.parentOffset==n.parent.content.size)for(var a=n.depth-1;a>=0;a--){var u=n.indexAfter(a);if(n.node(a).canReplaceWith(u,u,r))return n.after(a+1);if(u<n.node(a).childCount)return null}}function Y$t(t,e,r){var n=t.resolve(e);if(!r.content.size)return e;for(var o=r.content,i=0;i<r.openStart;i++)o=o.firstChild.content;for(var a=1;a<=(r.openStart==0&&r.size?2:1);a++)for(var u=n.depth;u>=0;u--){var c=u==n.depth?0:n.pos<=(n.start(u+1)+n.end(u+1))/2?-1:1,s=n.index(u)+(c>0?1:0),f=n.node(u),l=!1;if(a==1)l=f.canReplace(s,s,o);else{var p=f.contentMatchAt(s).findWrapping(o.firstChild.type);l=p&&f.canReplaceWith(s,s,p[0])}if(l)return c==0?n.pos:c<0?n.before(u+1):n.after(u+1)}return null}function HM(t,e,r){for(var n=[],o=0;o<t.childCount;o++){var i=t.child(o);i.content.size&&(i=i.copy(HM(i.content,e,i))),i.isInline&&(i=e(i,r,o)),n.push(i)}return D.fromArray(n)}var JM=function(t){function e(r,n,o){t.call(this),this.from=r,this.to=n,this.mark=o}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.apply=function(n){var o=this,i=n.slice(this.from,this.to),a=n.resolve(this.from),u=a.node(a.sharedDepth(this.to)),c=new Z(HM(i.content,function(s,f){return!s.isAtom||!f.type.allowsMarkType(o.mark.type)?s:s.mark(o.mark.addToSet(s.marks))},u),i.openStart,i.openEnd);return Sr.fromReplace(n,this.from,this.to,c)},e.prototype.invert=function(){return new _d(this.from,this.to,this.mark)},e.prototype.map=function(n){var o=n.mapResult(this.from,1),i=n.mapResult(this.to,-1);return o.deleted&&i.deleted||o.pos>=i.pos?null:new e(o.pos,i.pos,this.mark)},e.prototype.merge=function(n){if(n instanceof e&&n.mark.eq(this.mark)&&this.from<=n.to&&this.to>=n.from)return new e(Math.min(this.from,n.from),Math.max(this.to,n.to),this.mark)},e.prototype.toJSON=function(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}},e.fromJSON=function(n,o){if(typeof o.from!="number"||typeof o.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new e(o.from,o.to,n.markFromJSON(o.mark))},e}(ar);ar.jsonID("addMark",JM);var _d=function(t){function e(r,n,o){t.call(this),this.from=r,this.to=n,this.mark=o}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.apply=function(n){var o=this,i=n.slice(this.from,this.to),a=new Z(HM(i.content,function(u){return u.mark(o.mark.removeFromSet(u.marks))}),i.openStart,i.openEnd);return Sr.fromReplace(n,this.from,this.to,a)},e.prototype.invert=function(){return new JM(this.from,this.to,this.mark)},e.prototype.map=function(n){var o=n.mapResult(this.from,1),i=n.mapResult(this.to,-1);return o.deleted&&i.deleted||o.pos>=i.pos?null:new e(o.pos,i.pos,this.mark)},e.prototype.merge=function(n){if(n instanceof e&&n.mark.eq(this.mark)&&this.from<=n.to&&this.to>=n.from)return new e(Math.min(this.from,n.from),Math.max(this.to,n.to),this.mark)},e.prototype.toJSON=function(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}},e.fromJSON=function(n,o){if(typeof o.from!="number"||typeof o.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new e(o.from,o.to,n.markFromJSON(o.mark))},e}(ar);ar.jsonID("removeMark",_d),fe.prototype.addMark=function(t,e,r){var n=this,o=[],i=[],a=null,u=null;return this.doc.nodesBetween(t,e,function(c,s,f){if(!!c.isInline){var l=c.marks;if(!r.isInSet(l)&&f.type.allowsMarkType(r.type)){for(var p=Math.max(s,t),d=Math.min(s+c.nodeSize,e),h=r.addToSet(l),m=0;m<l.length;m++)l[m].isInSet(h)||(a&&a.to==p&&a.mark.eq(l[m])?a.to=d:o.push(a=new _d(p,d,l[m])));u&&u.to==p?u.to=d:i.push(u=new JM(p,d,r))}}}),o.forEach(function(c){return n.step(c)}),i.forEach(function(c){return n.step(c)}),this},fe.prototype.removeMark=function(t,e,r){var n=this;r===void 0&&(r=null);var o=[],i=0;return this.doc.nodesBetween(t,e,function(a,u){if(!!a.isInline){i++;var c=null;if(r instanceof Wa)for(var s=a.marks,f;f=r.isInSet(s);)(c||(c=[])).push(f),s=f.removeFromSet(s);else r?r.isInSet(a.marks)&&(c=[r]):c=a.marks;if(c&&c.length)for(var l=Math.min(u+a.nodeSize,e),p=0;p<c.length;p++){for(var d=c[p],h=void 0,m=0;m<o.length;m++){var g=o[m];g.step==i-1&&d.eq(o[m].style)&&(h=g)}h?(h.to=l,h.step=i):o.push({style:d,from:Math.max(u,t),to:l,step:i})}}}),o.forEach(function(a){return n.step(new _d(a.from,a.to,a.style))}),this},fe.prototype.clearIncompatible=function(t,e,r){r===void 0&&(r=e.contentMatch);for(var n=this.doc.nodeAt(t),o=[],i=t+1,a=0;a<n.childCount;a++){var u=n.child(a),c=i+u.nodeSize,s=r.matchType(u.type,u.attrs);if(!s)o.push(new Oi(i,c,Z.empty));else{r=s;for(var f=0;f<u.marks.length;f++)e.allowsMarkType(u.marks[f].type)||this.step(new _d(i,c,u.marks[f]))}i=c}if(!r.validEnd){var l=r.fillBefore(D.empty,!0);this.replace(i,i,new Z(l,0,0))}for(var p=o.length-1;p>=0;p--)this.step(o[p]);return this};function GM(t,e,r,n){if(r===void 0&&(r=e),n===void 0&&(n=Z.empty),e==r&&!n.size)return null;var o=t.resolve(e),i=t.resolve(r);return rq(o,i,n)?new Oi(e,r,n):new Mn(o,i,n).fit()}fe.prototype.replace=function(t,e,r){e===void 0&&(e=t),r===void 0&&(r=Z.empty);var n=GM(this.doc,t,e,r);return n&&this.step(n),this},fe.prototype.replaceWith=function(t,e,r){return this.replace(t,e,new Z(D.from(r),0,0))},fe.prototype.delete=function(t,e){return this.replace(t,e,Z.empty)},fe.prototype.insert=function(t,e){return this.replaceWith(t,t,e)};function rq(t,e,r){return!r.openStart&&!r.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),r.content)}var Mn=function(e,r,n){this.$to=r,this.$from=e,this.unplaced=n,this.frontier=[];for(var o=0;o<=e.depth;o++){var i=e.node(o);this.frontier.push({type:i.type,match:i.contentMatchAt(e.indexAfter(o))})}this.placed=D.empty;for(var a=e.depth;a>0;a--)this.placed=D.from(e.node(a).copy(this.placed))},nq={depth:{configurable:!0}};nq.depth.get=function(){return this.frontier.length-1},Mn.prototype.fit=function(){for(;this.unplaced.size;){var e=this.findFittable();e?this.placeNodes(e):this.openMore()||this.dropNode()}var r=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,o=this.$from,i=this.close(r<0?this.$to:o.doc.resolve(r));if(!i)return null;for(var a=this.placed,u=o.depth,c=i.depth;u&&c&&a.childCount==1;)a=a.firstChild.content,u--,c--;var s=new Z(a,u,c);if(r>-1)return new Pr(o.pos,r,this.$to.pos,this.$to.end(),s,n);if(s.size||o.pos!=this.$to.pos)return new Oi(o.pos,i.pos,s)},Mn.prototype.findFittable=function(){for(var e=1;e<=2;e++)for(var r=this.unplaced.openStart;r>=0;r--){var n=void 0,o=void 0;r?(o=YM(this.unplaced.content,r-1).firstChild,n=o.content):n=this.unplaced.content;for(var i=n.firstChild,a=this.depth;a>=0;a--){var u=this.frontier[a],c=u.type,s=u.match,f=void 0,l=void 0;if(e==1&&(i?s.matchType(i.type)||(l=s.fillBefore(D.from(i),!1)):c.compatibleContent(o.type)))return{sliceDepth:r,frontierDepth:a,parent:o,inject:l};if(e==2&&i&&(f=s.findWrapping(i.type)))return{sliceDepth:r,frontierDepth:a,parent:o,wrap:f};if(o&&s.matchType(o.type))break}}},Mn.prototype.openMore=function(){var e=this.unplaced,r=e.content,n=e.openStart,o=e.openEnd,i=YM(r,n);return!i.childCount||i.firstChild.isLeaf?!1:(this.unplaced=new Z(r,n+1,Math.max(o,i.size+n>=r.size-o?n+1:0)),!0)},Mn.prototype.dropNode=function(){var e=this.unplaced,r=e.content,n=e.openStart,o=e.openEnd,i=YM(r,n);if(i.childCount<=1&&n>0){var a=r.size-n<=n+i.size;this.unplaced=new Z(Sd(r,n-1,1),n-1,a?n-1:o)}else this.unplaced=new Z(Sd(r,n,1),n,o)},Mn.prototype.placeNodes=function(e){for(var r=e.sliceDepth,n=e.frontierDepth,o=e.parent,i=e.inject,a=e.wrap;this.depth>n;)this.closeFrontierNode();if(a)for(var u=0;u<a.length;u++)this.openFrontierNode(a[u]);var c=this.unplaced,s=o?o.content:c.content,f=c.openStart-r,l=0,p=[],d=this.frontier[n],h=d.match,m=d.type;if(i){for(var g=0;g<i.childCount;g++)p.push(i.child(g));h=h.matchFragment(i)}for(var b=s.size+r-(c.content.size-c.openEnd);l<s.childCount;){var $=s.child(l),w=h.matchType($.type);if(!w)break;l++,(l>1||f==0||$.content.size)&&(h=w,p.push(oq($.mark(m.allowedMarks($.marks)),l==1?f:0,l==s.childCount?b:-1)))}var y=l==s.childCount;y||(b=-1),this.placed=Td(this.placed,n,D.from(p)),this.frontier[n].match=h,y&&b<0&&o&&o.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(var I=0,S=s;I<b;I++){var k=S.lastChild;this.frontier.push({type:k.type,match:k.contentMatchAt(k.childCount)}),S=k.content}this.unplaced=y?r==0?Z.empty:new Z(Sd(c.content,r-1,1),r-1,b<0?c.openEnd:r-1):new Z(Sd(c.content,r,l),c.openStart,c.openEnd)},Mn.prototype.mustMoveInline=function(){if(!this.$to.parent.isTextblock||this.$to.end()==this.$to.pos)return-1;var e=this.frontier[this.depth],r;if(!e.type.isTextblock||!XM(this.$to,this.$to.depth,e.type,e.match,!1)||this.$to.depth==this.depth&&(r=this.findCloseLevel(this.$to))&&r.depth==this.depth)return-1;for(var n=this.$to,o=n.depth,i=this.$to.after(o);o>1&&i==this.$to.end(--o);)++i;return i},Mn.prototype.findCloseLevel=function(e){t:for(var r=Math.min(this.depth,e.depth);r>=0;r--){var n=this.frontier[r],o=n.match,i=n.type,a=r<e.depth&&e.end(r+1)==e.pos+(e.depth-(r+1)),u=XM(e,r,i,o,a);if(!!u){for(var c=r-1;c>=0;c--){var s=this.frontier[c],f=s.match,l=s.type,p=XM(e,c,l,f,!0);if(!p||p.childCount)continue t}return{depth:r,fit:u,move:a?e.doc.resolve(e.after(r+1)):e}}}},Mn.prototype.close=function(e){var r=this.findCloseLevel(e);if(!r)return null;for(;this.depth>r.depth;)this.closeFrontierNode();r.fit.childCount&&(this.placed=Td(this.placed,r.depth,r.fit)),e=r.move;for(var n=r.depth+1;n<=e.depth;n++){var o=e.node(n),i=o.type.contentMatch.fillBefore(o.content,!0,e.index(n));this.openFrontierNode(o.type,o.attrs,i)}return e},Mn.prototype.openFrontierNode=function(e,r,n){var o=this.frontier[this.depth];o.match=o.match.matchType(e),this.placed=Td(this.placed,this.depth,D.from(e.create(r,n))),this.frontier.push({type:e,match:e.contentMatch})},Mn.prototype.closeFrontierNode=function(){var e=this.frontier.pop(),r=e.match.fillBefore(D.empty,!0);r.childCount&&(this.placed=Td(this.placed,this.frontier.length,r))},Object.defineProperties(Mn.prototype,nq);function Sd(t,e,r){return e==0?t.cutByIndex(r):t.replaceChild(0,t.firstChild.copy(Sd(t.firstChild.content,e-1,r)))}function Td(t,e,r){return e==0?t.append(r):t.replaceChild(t.childCount-1,t.lastChild.copy(Td(t.lastChild.content,e-1,r)))}function YM(t,e){for(var r=0;r<e;r++)t=t.firstChild.content;return t}function oq(t,e,r){if(e<=0)return t;var n=t.content;return e>1&&(n=n.replaceChild(0,oq(n.firstChild,e-1,n.childCount==1?r-1:0))),e>0&&(n=t.type.contentMatch.fillBefore(n).append(n),r<=0&&(n=n.append(t.type.contentMatch.matchFragment(n).fillBefore(D.empty,!0)))),t.copy(n)}function XM(t,e,r,n,o){var i=t.node(e),a=o?t.indexAfter(e):t.index(e);if(a==i.childCount&&!r.compatibleContent(i.type))return null;var u=n.fillBefore(i.content,!0,a);return u&&!X$t(r,i.content,a)?u:null}function X$t(t,e,r){for(var n=r;n<e.childCount;n++)if(!t.allowsMarks(e.child(n).marks))return!0;return!1}fe.prototype.replaceRange=function(t,e,r){if(!r.size)return this.deleteRange(t,e);var n=this.doc.resolve(t),o=this.doc.resolve(e);if(rq(n,o,r))return this.step(new Oi(t,e,r));var i=aq(n,this.doc.resolve(e));i[i.length-1]==0&&i.pop();var a=-(n.depth+1);i.unshift(a);for(var u=n.depth,c=n.pos-1;u>0;u--,c--){var s=n.node(u).type.spec;if(s.defining||s.isolating)break;i.indexOf(u)>-1?a=u:n.before(u)==c&&i.splice(1,0,-u)}for(var f=i.indexOf(a),l=[],p=r.openStart,d=r.content,h=0;;h++){var m=d.firstChild;if(l.push(m),h==r.openStart)break;d=m.content}p>0&&l[p-1].type.spec.defining&&n.node(f).type!=l[p-1].type?p-=1:p>=2&&l[p-1].isTextblock&&l[p-2].type.spec.defining&&n.node(f).type!=l[p-2].type&&(p-=2);for(var g=r.openStart;g>=0;g--){var b=(g+p+1)%(r.openStart+1),$=l[b];if(!!$)for(var w=0;w<i.length;w++){var y=i[(w+f)%i.length],I=!0;y<0&&(I=!1,y=-y);var S=n.node(y-1),k=n.index(y-1);if(S.canReplaceWith(k,k,$.type,$.marks))return this.replace(n.before(y),I?o.after(y):e,new Z(iq(r.content,0,r.openStart,b),b,r.openEnd))}}for(var C=this.steps.length,B=i.length-1;B>=0&&(this.replace(t,e,r),!(this.steps.length>C));B--){var q=i[B];q<0||(t=n.before(q),e=o.after(q))}return this};function iq(t,e,r,n,o){if(e<r){var i=t.firstChild;t=t.replaceChild(0,i.copy(iq(i.content,e+1,r,n,i)))}if(e>n){var a=o.contentMatchAt(0),u=a.fillBefore(t).append(t);t=u.append(a.matchFragment(u).fillBefore(D.empty,!0))}return t}fe.prototype.replaceRangeWith=function(t,e,r){if(!r.isInline&&t==e&&this.doc.resolve(t).parent.content.size){var n=G$t(this.doc,t,r.type);n!=null&&(t=e=n)}return this.replaceRange(t,e,new Z(D.from(r),0,0))},fe.prototype.deleteRange=function(t,e){for(var r=this.doc.resolve(t),n=this.doc.resolve(e),o=aq(r,n),i=0;i<o.length;i++){var a=o[i],u=i==o.length-1;if(u&&a==0||r.node(a).type.contentMatch.validEnd)return this.delete(r.start(a),n.end(a));if(a>0&&(u||r.node(a-1).canReplace(r.index(a-1),n.indexAfter(a-1))))return this.delete(r.before(a),n.after(a))}for(var c=1;c<=r.depth&&c<=n.depth;c++)if(t-r.start(c)==r.depth-c&&e>r.end(c)&&n.end(c)-e!=n.depth-c)return this.delete(r.before(c),e);return this.delete(t,e)};function aq(t,e){for(var r=[],n=Math.min(t.depth,e.depth),o=n;o>=0;o--){var i=t.start(o);if(i<t.pos-(t.depth-o)||e.end(o)>e.pos+(e.depth-o)||t.node(o).type.spec.isolating||e.node(o).type.spec.isolating)break;(i==e.start(o)||o==t.depth&&o==e.depth&&t.parent.inlineContent&&e.parent.inlineContent&&o&&e.start(o-1)==i-1)&&r.push(o)}return r}var ZM=Object.create(null),gt=function(e,r,n){this.ranges=n||[new Z$t(e.min(r),e.max(r))],this.$anchor=e,this.$head=r},Fa={anchor:{configurable:!0},head:{configurable:!0},from:{configurable:!0},to:{configurable:!0},$from:{configurable:!0},$to:{configurable:!0},empty:{configurable:!0}};Fa.anchor.get=function(){return this.$anchor.pos},Fa.head.get=function(){return this.$head.pos},Fa.from.get=function(){return this.$from.pos},Fa.to.get=function(){return this.$to.pos},Fa.$from.get=function(){return this.ranges[0].$from},Fa.$to.get=function(){return this.ranges[0].$to},Fa.empty.get=function(){for(var t=this.ranges,e=0;e<t.length;e++)if(t[e].$from.pos!=t[e].$to.pos)return!1;return!0},gt.prototype.content=function(){return this.$from.node(0).slice(this.from,this.to,!0)},gt.prototype.replace=function(e,r){r===void 0&&(r=Z.empty);for(var n=r.content.lastChild,o=null,i=0;i<r.openEnd;i++)o=n,n=n.lastChild;for(var a=e.steps.length,u=this.ranges,c=0;c<u.length;c++){var s=u[c],f=s.$from,l=s.$to,p=e.mapping.slice(a);e.replaceRange(p.map(f.pos),p.map(l.pos),c?Z.empty:r),c==0&&uq(e,a,(n?n.isInline:o&&o.isTextblock)?-1:1)}},gt.prototype.replaceWith=function(e,r){for(var n=e.steps.length,o=this.ranges,i=0;i<o.length;i++){var a=o[i],u=a.$from,c=a.$to,s=e.mapping.slice(n),f=s.map(u.pos),l=s.map(c.pos);i?e.deleteRange(f,l):(e.replaceRangeWith(f,l,r),uq(e,n,r.isInline?-1:1))}},gt.findFrom=function(e,r,n){var o=e.parent.inlineContent?new wt(e):Mf(e.node(0),e.parent,e.pos,e.index(),r,n);if(o)return o;for(var i=e.depth-1;i>=0;i--){var a=r<0?Mf(e.node(0),e.node(i),e.before(i+1),e.index(i),r,n):Mf(e.node(0),e.node(i),e.after(i+1),e.index(i)+1,r,n);if(a)return a}},gt.near=function(e,r){return r===void 0&&(r=1),this.findFrom(e,r)||this.findFrom(e,-r)||new Ri(e.node(0))},gt.atStart=function(e){return Mf(e,e,0,0,1)||new Ri(e)},gt.atEnd=function(e){return Mf(e,e,e.content.size,e.childCount,-1)||new Ri(e)},gt.fromJSON=function(e,r){if(!r||!r.type)throw new RangeError("Invalid input for Selection.fromJSON");var n=ZM[r.type];if(!n)throw new RangeError("No selection type "+r.type+" defined");return n.fromJSON(e,r)},gt.jsonID=function(e,r){if(e in ZM)throw new RangeError("Duplicate use of selection JSON ID "+e);return ZM[e]=r,r.prototype.jsonID=e,r},gt.prototype.getBookmark=function(){return wt.between(this.$anchor,this.$head).getBookmark()},Object.defineProperties(gt.prototype,Fa),gt.prototype.visible=!0;var Z$t=function(e,r){this.$from=e,this.$to=r},wt=function(t){function e(n,o){o===void 0&&(o=n),t.call(this,n,o)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={$cursor:{configurable:!0}};return r.$cursor.get=function(){return this.$anchor.pos==this.$head.pos?this.$head:null},e.prototype.map=function(o,i){var a=o.resolve(i.map(this.head));if(!a.parent.inlineContent)return t.near(a);var u=o.resolve(i.map(this.anchor));return new e(u.parent.inlineContent?u:a,a)},e.prototype.replace=function(o,i){if(i===void 0&&(i=Z.empty),t.prototype.replace.call(this,o,i),i==Z.empty){var a=this.$from.marksAcross(this.$to);a&&o.ensureMarks(a)}},e.prototype.eq=function(o){return o instanceof e&&o.anchor==this.anchor&&o.head==this.head},e.prototype.getBookmark=function(){return new Id(this.anchor,this.head)},e.prototype.toJSON=function(){return{type:"text",anchor:this.anchor,head:this.head}},e.fromJSON=function(o,i){if(typeof i.anchor!="number"||typeof i.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new e(o.resolve(i.anchor),o.resolve(i.head))},e.create=function(o,i,a){a===void 0&&(a=i);var u=o.resolve(i);return new this(u,a==i?u:o.resolve(a))},e.between=function(o,i,a){var u=o.pos-i.pos;if((!a||u)&&(a=u>=0?1:-1),!i.parent.inlineContent){var c=t.findFrom(i,a,!0)||t.findFrom(i,-a,!0);if(c)i=c.$head;else return t.near(i,a)}return o.parent.inlineContent||(u==0?o=i:(o=(t.findFrom(o,-a,!0)||t.findFrom(o,a,!0)).$anchor,o.pos<i.pos!=u<0&&(o=i))),new e(o,i)},Object.defineProperties(e.prototype,r),e}(gt);gt.jsonID("text",wt);var Id=function(e,r){this.anchor=e,this.head=r};Id.prototype.map=function(e){return new Id(e.map(this.anchor),e.map(this.head))},Id.prototype.resolve=function(e){return wt.between(e.resolve(this.anchor),e.resolve(this.head))};var dt=function(t){function e(r){var n=r.nodeAfter,o=r.node(0).resolve(r.pos+n.nodeSize);t.call(this,r,o),this.node=n}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.map=function(n,o){var i=o.mapResult(this.anchor),a=i.deleted,u=i.pos,c=n.resolve(u);return a?t.near(c):new e(c)},e.prototype.content=function(){return new Z(D.from(this.node),0,0)},e.prototype.eq=function(n){return n instanceof e&&n.anchor==this.anchor},e.prototype.toJSON=function(){return{type:"node",anchor:this.anchor}},e.prototype.getBookmark=function(){return new zg(this.anchor)},e.fromJSON=function(n,o){if(typeof o.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new e(n.resolve(o.anchor))},e.create=function(n,o){return new this(n.resolve(o))},e.isSelectable=function(n){return!n.isText&&n.type.spec.selectable!==!1},e}(gt);dt.prototype.visible=!1,gt.jsonID("node",dt);var zg=function(e){this.anchor=e};zg.prototype.map=function(e){var r=e.mapResult(this.anchor),n=r.deleted,o=r.pos;return n?new Id(o,o):new zg(o)},zg.prototype.resolve=function(e){var r=e.resolve(this.anchor),n=r.nodeAfter;return n&&dt.isSelectable(n)?new dt(r):gt.near(r)};var Ri=function(t){function e(r){t.call(this,r.resolve(0),r.resolve(r.content.size))}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.replace=function(n,o){if(o===void 0&&(o=Z.empty),o==Z.empty){n.delete(0,n.doc.content.size);var i=t.atStart(n.doc);i.eq(n.selection)||n.setSelection(i)}else t.prototype.replace.call(this,n,o)},e.prototype.toJSON=function(){return{type:"all"}},e.fromJSON=function(n){return new e(n)},e.prototype.map=function(n){return new e(n)},e.prototype.eq=function(n){return n instanceof e},e.prototype.getBookmark=function(){return Q$t},e}(gt);gt.jsonID("all",Ri);var Q$t={map:function(){return this},resolve:function(e){return new Ri(e)}};function Mf(t,e,r,n,o,i){if(e.inlineContent)return wt.create(t,r);for(var a=n-(o>0?0:1);o>0?a<e.childCount:a>=0;a+=o){var u=e.child(a);if(u.isAtom){if(!i&&dt.isSelectable(u))return dt.create(t,r-(o<0?u.nodeSize:0))}else{var c=Mf(t,u,r+o,o<0?u.childCount:0,o,i);if(c)return c}r+=u.nodeSize*o}}function uq(t,e,r){var n=t.steps.length-1;if(!(n<e)){var o=t.steps[n];if(o instanceof Oi||o instanceof Pr){var i=t.mapping.maps[n],a;i.forEach(function(u,c,s,f){a==null&&(a=f)}),t.setSelection(gt.near(t.doc.resolve(a),r))}}}var cq=1,qg=2,sq=4,t_t=function(t){function e(n){t.call(this,n.doc),this.time=Date.now(),this.curSelection=n.selection,this.curSelectionFor=0,this.storedMarks=n.storedMarks,this.updated=0,this.meta=Object.create(null)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={selection:{configurable:!0},selectionSet:{configurable:!0},storedMarksSet:{configurable:!0},isGeneric:{configurable:!0},scrolledIntoView:{configurable:!0}};return r.selection.get=function(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection},e.prototype.setSelection=function(o){if(o.$from.doc!=this.doc)throw new RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=o,this.curSelectionFor=this.steps.length,this.updated=(this.updated|cq)&~qg,this.storedMarks=null,this},r.selectionSet.get=function(){return(this.updated&cq)>0},e.prototype.setStoredMarks=function(o){return this.storedMarks=o,this.updated|=qg,this},e.prototype.ensureMarks=function(o){return St.sameSet(this.storedMarks||this.selection.$from.marks(),o)||this.setStoredMarks(o),this},e.prototype.addStoredMark=function(o){return this.ensureMarks(o.addToSet(this.storedMarks||this.selection.$head.marks()))},e.prototype.removeStoredMark=function(o){return this.ensureMarks(o.removeFromSet(this.storedMarks||this.selection.$head.marks()))},r.storedMarksSet.get=function(){return(this.updated&qg)>0},e.prototype.addStep=function(o,i){t.prototype.addStep.call(this,o,i),this.updated=this.updated&~qg,this.storedMarks=null},e.prototype.setTime=function(o){return this.time=o,this},e.prototype.replaceSelection=function(o){return this.selection.replace(this,o),this},e.prototype.replaceSelectionWith=function(o,i){var a=this.selection;return i!==!1&&(o=o.mark(this.storedMarks||(a.empty?a.$from.marks():a.$from.marksAcross(a.$to)||St.none))),a.replaceWith(this,o),this},e.prototype.deleteSelection=function(){return this.selection.replace(this),this},e.prototype.insertText=function(o,i,a){a===void 0&&(a=i);var u=this.doc.type.schema;if(i==null)return o?this.replaceSelectionWith(u.text(o),!0):this.deleteSelection();if(!o)return this.deleteRange(i,a);var c=this.storedMarks;if(!c){var s=this.doc.resolve(i);c=a==i?s.marks():s.marksAcross(this.doc.resolve(a))}return this.replaceRangeWith(i,a,u.text(o,c)),this.selection.empty||this.setSelection(gt.near(this.selection.$to)),this},e.prototype.setMeta=function(o,i){return this.meta[typeof o=="string"?o:o.key]=i,this},e.prototype.getMeta=function(o){return this.meta[typeof o=="string"?o:o.key]},r.isGeneric.get=function(){for(var n in this.meta)return!1;return!0},e.prototype.scrollIntoView=function(){return this.updated|=sq,this},r.scrolledIntoView.get=function(){return(this.updated&sq)>0},Object.defineProperties(e.prototype,r),e}(fe);function fq(t,e){return!e||!t?t:t.bind(e)}var Od=function(e,r,n){this.name=e,this.init=fq(r.init,n),this.apply=fq(r.apply,n)},e_t=[new Od("doc",{init:function(e){return e.doc||e.schema.topNodeType.createAndFill()},apply:function(e){return e.doc}}),new Od("selection",{init:function(e,r){return e.selection||gt.atStart(r.doc)},apply:function(e){return e.selection}}),new Od("storedMarks",{init:function(e){return e.storedMarks||null},apply:function(e,r,n,o){return o.selection.$cursor?e.storedMarks:null}}),new Od("scrollToSelection",{init:function(){return 0},apply:function(e,r){return e.scrolledIntoView?r+1:r}})],QM=function(e,r){var n=this;this.schema=e,this.fields=e_t.concat(),this.plugins=[],this.pluginsByKey=Object.create(null),r&&r.forEach(function(o){if(n.pluginsByKey[o.key])throw new RangeError("Adding different instances of a keyed plugin ("+o.key+")");n.plugins.push(o),n.pluginsByKey[o.key]=o,o.spec.state&&n.fields.push(new Od(o.key,o.spec.state,o))})},ur=function(e){this.config=e},Kg={schema:{configurable:!0},plugins:{configurable:!0},tr:{configurable:!0}};Kg.schema.get=function(){return this.config.schema},Kg.plugins.get=function(){return this.config.plugins},ur.prototype.apply=function(e){return this.applyTransaction(e).state},ur.prototype.filterTransaction=function(e,r){r===void 0&&(r=-1);for(var n=0;n<this.config.plugins.length;n++)if(n!=r){var o=this.config.plugins[n];if(o.spec.filterTransaction&&!o.spec.filterTransaction.call(o,e,this))return!1}return!0},ur.prototype.applyTransaction=function(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};for(var r=[e],n=this.applyInner(e),o=null;;){for(var i=!1,a=0;a<this.config.plugins.length;a++){var u=this.config.plugins[a];if(u.spec.appendTransaction){var c=o?o[a].n:0,s=o?o[a].state:this,f=c<r.length&&u.spec.appendTransaction.call(u,c?r.slice(c):r,s,n);if(f&&n.filterTransaction(f,a)){if(f.setMeta("appendedTransaction",e),!o){o=[];for(var l=0;l<this.config.plugins.length;l++)o.push(l<a?{state:n,n:r.length}:{state:this,n:0})}r.push(f),n=n.applyInner(f),i=!0}o&&(o[a]={state:n,n:r.length})}}if(!i)return{state:n,transactions:r}}},ur.prototype.applyInner=function(e){if(!e.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");for(var r=new ur(this.config),n=this.config.fields,o=0;o<n.length;o++){var i=n[o];r[i.name]=i.apply(e,this[i.name],this,r)}for(var a=0;a<Md.length;a++)Md[a](this,e,r);return r},Kg.tr.get=function(){return new t_t(this)},ur.create=function(e){for(var r=new QM(e.doc?e.doc.type.schema:e.schema,e.plugins),n=new ur(r),o=0;o<r.fields.length;o++)n[r.fields[o].name]=r.fields[o].init(e,n);return n},ur.prototype.reconfigure=function(e){for(var r=new QM(this.schema,e.plugins),n=r.fields,o=new ur(r),i=0;i<n.length;i++){var a=n[i].name;o[a]=this.hasOwnProperty(a)?this[a]:n[i].init(e,o)}return o},ur.prototype.toJSON=function(e){var r={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(r.storedMarks=this.storedMarks.map(function(a){return a.toJSON()})),e&&typeof e=="object")for(var n in e){if(n=="doc"||n=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");var o=e[n],i=o.spec.state;i&&i.toJSON&&(r[n]=i.toJSON.call(o,this[o.key]))}return r},ur.fromJSON=function(e,r,n){if(!r)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");var o=new QM(e.schema,e.plugins),i=new ur(o);return o.fields.forEach(function(a){if(a.name=="doc")i.doc=Mt.fromJSON(e.schema,r.doc);else if(a.name=="selection")i.selection=gt.fromJSON(i.doc,r.selection);else if(a.name=="storedMarks")r.storedMarks&&(i.storedMarks=r.storedMarks.map(e.schema.markFromJSON));else{if(n)for(var u in n){var c=n[u],s=c.spec.state;if(c.key==a.name&&s&&s.fromJSON&&Object.prototype.hasOwnProperty.call(r,u)){i[a.name]=s.fromJSON.call(c,e,r[u],i);return}}i[a.name]=a.init(e,i)}}),i},ur.addApplyListener=function(e){Md.push(e)},ur.removeApplyListener=function(e){var r=Md.indexOf(e);r>-1&&Md.splice(r,1)},Object.defineProperties(ur.prototype,Kg);var Md=[];function lq(t,e,r){for(var n in t){var o=t[n];o instanceof Function?o=o.bind(e):n=="handleDOMEvents"&&(o=lq(o,e,{})),r[n]=o}return r}var Dr=function(e){this.props={},e.props&&lq(e.props,this,this.props),this.spec=e,this.key=e.key?e.key.key:pq("plugin")};Dr.prototype.getState=function(e){return e[this.key]};var t1=Object.create(null);function pq(t){return t in t1?t+"$"+ ++t1[t]:(t1[t]=0,t+"$")}var oo=function(e){e===void 0&&(e="key"),this.key=pq(e)};oo.prototype.get=function(e){return e.config.pluginsByKey[this.key]},oo.prototype.getState=function(e){return e[this.key]};function e1(t,e){return t.selection.empty?!1:(e&&e(t.tr.deleteSelection().scrollIntoView()),!0)}function dq(t,e,r){var n=t.selection,o=n.$cursor;if(!o||(r?!r.endOfTextblock("backward",t):o.parentOffset>0))return!1;var i=vq(o);if(!i){var a=o.blockRange(),u=a&&Of(a);return u==null?!1:(e&&e(t.tr.lift(a,u).scrollIntoView()),!0)}var c=i.nodeBefore;if(!c.type.spec.isolating&&Tq(t,i,e))return!0;if(o.parent.content.size==0&&(Rf(c,"end")||dt.isSelectable(c))){var s=GM(t.doc,o.before(),o.after(),Z.empty);if(s.slice.size<s.to-s.from){if(e){var f=t.tr.step(s);f.setSelection(Rf(c,"end")?gt.findFrom(f.doc.resolve(f.mapping.map(i.pos,-1)),-1):dt.create(f.doc,i.pos-c.nodeSize)),e(f.scrollIntoView())}return!0}}return c.isAtom&&i.depth==o.depth-1?(e&&e(t.tr.delete(i.pos-c.nodeSize,i.pos).scrollIntoView()),!0):!1}function Rf(t,e,r){for(;t;t=e=="start"?t.firstChild:t.lastChild){if(t.isTextblock)return!0;if(r&&t.childCount!=1)return!1}return!1}function hq(t,e,r){var n=t.selection,o=n.$head,i=n.empty,a=o;if(!i)return!1;if(o.parent.isTextblock){if(r?!r.endOfTextblock("backward",t):o.parentOffset>0)return!1;a=vq(o)}var u=a&&a.nodeBefore;return!u||!dt.isSelectable(u)?!1:(e&&e(t.tr.setSelection(dt.create(t.doc,a.pos-u.nodeSize)).scrollIntoView()),!0)}function vq(t){if(!t.parent.type.spec.isolating)for(var e=t.depth-1;e>=0;e--){if(t.index(e)>0)return t.doc.resolve(t.before(e+1));if(t.node(e).type.spec.isolating)break}return null}function mq(t,e,r){var n=t.selection,o=n.$cursor;if(!o||(r?!r.endOfTextblock("forward",t):o.parentOffset<o.parent.content.size))return!1;var i=yq(o);if(!i)return!1;var a=i.nodeAfter;if(Tq(t,i,e))return!0;if(o.parent.content.size==0&&(Rf(a,"start")||dt.isSelectable(a))){var u=GM(t.doc,o.before(),o.after(),Z.empty);if(u.slice.size<u.to-u.from){if(e){var c=t.tr.step(u);c.setSelection(Rf(a,"start")?gt.findFrom(c.doc.resolve(c.mapping.map(i.pos)),1):dt.create(c.doc,c.mapping.map(i.pos))),e(c.scrollIntoView())}return!0}}return a.isAtom&&i.depth==o.depth-1?(e&&e(t.tr.delete(i.pos,i.pos+a.nodeSize).scrollIntoView()),!0):!1}function gq(t,e,r){var n=t.selection,o=n.$head,i=n.empty,a=o;if(!i)return!1;if(o.parent.isTextblock){if(r?!r.endOfTextblock("forward",t):o.parentOffset<o.parent.content.size)return!1;a=yq(o)}var u=a&&a.nodeAfter;return!u||!dt.isSelectable(u)?!1:(e&&e(t.tr.setSelection(dt.create(t.doc,a.pos)).scrollIntoView()),!0)}function yq(t){if(!t.parent.type.spec.isolating)for(var e=t.depth-1;e>=0;e--){var r=t.node(e);if(t.index(e)+1<r.childCount)return t.doc.resolve(t.after(e+1));if(r.type.spec.isolating)break}return null}function r_t(t,e){var r=t.selection,n=r.$from,o=r.$to,i=n.blockRange(o),a=i&&Of(i);return a==null?!1:(e&&e(t.tr.lift(i,a).scrollIntoView()),!0)}function bq(t,e){var r=t.selection,n=r.$head,o=r.$anchor;return!n.parent.type.spec.code||!n.sameParent(o)?!1:(e&&e(t.tr.insertText(`
33
+ `).scrollIntoView()),!0)}function r1(t){for(var e=0;e<t.edgeCount;e++){var r=t.edge(e),n=r.type;if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}function $q(t,e){var r=t.selection,n=r.$head,o=r.$anchor;if(!n.parent.type.spec.code||!n.sameParent(o))return!1;var i=n.node(-1),a=n.indexAfter(-1),u=r1(i.contentMatchAt(a));if(!i.canReplaceWith(a,a,u))return!1;if(e){var c=n.after(),s=t.tr.replaceWith(c,c,u.createAndFill());s.setSelection(gt.near(s.doc.resolve(c),1)),e(s.scrollIntoView())}return!0}function _q(t,e){var r=t.selection,n=r.$from,o=r.$to;if(r instanceof Ri||n.parent.inlineContent||o.parent.inlineContent)return!1;var i=r1(o.parent.contentMatchAt(o.indexAfter()));if(!i||!i.isTextblock)return!1;if(e){var a=(!n.parentOffset&&o.index()<o.parent.childCount?n:o).pos,u=t.tr.insert(a,i.createAndFill());u.setSelection(wt.create(u.doc,a+1)),e(u.scrollIntoView())}return!0}function Sq(t,e){var r=t.selection,n=r.$cursor;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){var o=n.before();if(Mi(t.doc,o))return e&&e(t.tr.split(o).scrollIntoView()),!0}var i=n.blockRange(),a=i&&Of(i);return a==null?!1:(e&&e(t.tr.lift(i,a).scrollIntoView()),!0)}function n_t(t,e){var r=t.selection,n=r.$from,o=r.$to;if(t.selection instanceof dt&&t.selection.node.isBlock)return!n.parentOffset||!Mi(t.doc,n.pos)?!1:(e&&e(t.tr.split(n.pos).scrollIntoView()),!0);if(!n.parent.isBlock)return!1;if(e){var i=o.parentOffset==o.parent.content.size,a=t.tr;(t.selection instanceof wt||t.selection instanceof Ri)&&a.deleteSelection();var u=n.depth==0?null:r1(n.node(-1).contentMatchAt(n.indexAfter(-1))),c=i&&u?[{type:u}]:null,s=Mi(a.doc,a.mapping.map(n.pos),1,c);if(!c&&!s&&Mi(a.doc,a.mapping.map(n.pos),1,u&&[{type:u}])&&(c=[{type:u}],s=!0),s&&(a.split(a.mapping.map(n.pos),1,c),!i&&!n.parentOffset&&n.parent.type!=u)){var f=a.mapping.map(n.before()),l=a.doc.resolve(f);n.node(-1).canReplaceWith(l.index(),l.index()+1,u)&&a.setNodeMarkup(a.mapping.map(n.before()),u)}e(a.scrollIntoView())}return!0}function o_t(t,e){var r=t.selection,n=r.$from,o=r.to,i,a=n.sharedDepth(o);return a==0?!1:(i=n.before(a),e&&e(t.tr.setSelection(dt.create(t.doc,i))),!0)}function i_t(t,e){return e&&e(t.tr.setSelection(new Ri(t.doc))),!0}function a_t(t,e,r){var n=e.nodeBefore,o=e.nodeAfter,i=e.index();return!n||!o||!n.type.compatibleContent(o.type)?!1:!n.content.size&&e.parent.canReplace(i-1,i)?(r&&r(t.tr.delete(e.pos-n.nodeSize,e.pos).scrollIntoView()),!0):!e.parent.canReplace(i,i+1)||!(o.isTextblock||$d(t.doc,e.pos))?!1:(r&&r(t.tr.clearIncompatible(e.pos,n.type,n.contentMatchAt(n.childCount)).join(e.pos).scrollIntoView()),!0)}function Tq(t,e,r){var n=e.nodeBefore,o=e.nodeAfter,i,a;if(n.type.spec.isolating||o.type.spec.isolating)return!1;if(a_t(t,e,r))return!0;var u=e.parent.canReplace(e.index(),e.index()+1);if(u&&(i=(a=n.contentMatchAt(n.childCount)).findWrapping(o.type))&&a.matchType(i[0]||o.type).validEnd){if(r){for(var c=e.pos+o.nodeSize,s=D.empty,f=i.length-1;f>=0;f--)s=D.from(i[f].create(null,s));s=D.from(n.copy(s));var l=t.tr.step(new Pr(e.pos-1,c,e.pos,c,new Z(s,1,0),i.length,!0)),p=c+2*i.length;$d(l.doc,p)&&l.join(p),r(l.scrollIntoView())}return!0}var d=gt.findFrom(e,1),h=d&&d.$from.blockRange(d.$to),m=h&&Of(h);if(m!=null&&m>=e.depth)return r&&r(t.tr.lift(h,m).scrollIntoView()),!0;if(u&&Rf(o,"start",!0)&&Rf(n,"end")){for(var g=n,b=[];b.push(g),!g.isTextblock;)g=g.lastChild;for(var $=o,w=1;!$.isTextblock;$=$.firstChild)w++;if(g.canReplace(g.childCount,g.childCount,$.content)){if(r){for(var y=D.empty,I=b.length-1;I>=0;I--)y=D.from(b[I].copy(y));var S=t.tr.step(new Pr(e.pos-b.length,e.pos+o.nodeSize,e.pos+w,e.pos+o.nodeSize-w,new Z(y,b.length,0),0,!0));r(S.scrollIntoView())}return!0}}return!1}function Iq(t){return function(e,r){for(var n=e.selection,o=t<0?n.$from:n.$to,i=o.depth;o.node(i).isInline;){if(!i)return!1;i--}return o.node(i).isTextblock?(r&&r(e.tr.setSelection(wt.create(e.doc,t<0?o.start(i):o.end(i)))),!0):!1}}var n1=Iq(-1),o1=Iq(1);function u_t(t,e){return function(r,n){var o=r.selection,i=o.$from,a=o.$to,u=i.blockRange(a),c=u&&VM(u,t,e);return c?(n&&n(r.tr.wrap(u,c).scrollIntoView()),!0):!1}}function Oq(t,e){return function(r,n){var o=r.selection,i=o.from,a=o.to,u=!1;return r.doc.nodesBetween(i,a,function(c,s){if(u)return!1;if(!(!c.isTextblock||c.hasMarkup(t,e)))if(c.type==t)u=!0;else{var f=r.doc.resolve(s),l=f.index();u=f.parent.canReplaceWith(l,l+1,t)}}),u?(n&&n(r.tr.setBlockType(i,a,t,e).scrollIntoView()),!0):!1}}function i1(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];return function(r,n,o){for(var i=0;i<t.length;i++)if(t[i](r,n,o))return!0;return!1}}var a1=i1(e1,dq,hq),Mq=i1(e1,mq,gq),ko={Enter:i1(bq,_q,Sq,n_t),"Mod-Enter":$q,Backspace:a1,"Mod-Backspace":a1,"Shift-Backspace":a1,Delete:Mq,"Mod-Delete":Mq,"Mod-a":i_t},c_t={"Ctrl-h":ko.Backspace,"Alt-Backspace":ko["Mod-Backspace"],"Ctrl-d":ko.Delete,"Ctrl-Alt-Backspace":ko["Mod-Delete"],"Alt-Delete":ko["Mod-Delete"],"Alt-d":ko["Mod-Delete"],"Ctrl-a":n1,"Ctrl-e":o1};for(var Rq in ko)c_t[Rq]=ko[Rq];ko.Home=n1,ko.End=o1,typeof navigator!="undefined"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os!="undefined"&&os.platform()=="darwin";function s_t(t,e){return function(r,n){var o=r.selection,i=o.$from,a=o.$to,u=i.blockRange(a),c=!1,s=u;if(!u)return!1;if(u.depth>=2&&i.node(u.depth-1).type.compatibleContent(t)&&u.startIndex==0){if(i.index(u.depth-1)==0)return!1;var f=r.doc.resolve(u.start-2);s=new yd(f,f,u.depth),u.endIndex<u.parent.childCount&&(u=new yd(i,r.doc.resolve(a.end(u.depth)),u.depth)),c=!0}var l=VM(s,t,e,u);return l?(n&&n(f_t(r.tr,u,l,c,t).scrollIntoView()),!0):!1}}function f_t(t,e,r,n,o){for(var i=D.empty,a=r.length-1;a>=0;a--)i=D.from(r[a].type.create(r[a].attrs,i));t.step(new Pr(e.start-(n?2:0),e.end,e.start,e.end,new Z(i,0,0),r.length,!0));for(var u=0,c=0;c<r.length;c++)r[c].type==o&&(u=c+1);for(var s=r.length-u,f=e.start+r.length-(n?2:0),l=e.parent,p=e.startIndex,d=e.endIndex,h=!0;p<d;p++,h=!1)!h&&Mi(t.doc,f,s)&&(t.split(f,s),f+=2*s),f+=l.child(p).nodeSize;return t}function l_t(t){return function(e,r){var n=e.selection,o=n.$from,i=n.$to,a=o.blockRange(i,function(u){return u.childCount&&u.firstChild.type==t});return a?r?o.node(a.depth-1).type==t?p_t(e,r,t,a):d_t(e,r,a):!0:!1}}function p_t(t,e,r,n){var o=t.tr,i=n.end,a=n.$to.end(n.depth);return i<a&&(o.step(new Pr(i-1,a,i,a,new Z(D.from(r.create(null,n.parent.copy())),1,0),1,!0)),n=new yd(o.doc.resolve(n.$from.pos),o.doc.resolve(a),n.depth)),e(o.lift(n,Of(n)).scrollIntoView()),!0}function d_t(t,e,r){for(var n=t.tr,o=r.parent,i=r.end,a=r.endIndex-1,u=r.startIndex;a>u;a--)i-=o.child(a).nodeSize,n.delete(i-1,i+1);var c=n.doc.resolve(r.start),s=c.nodeAfter;if(n.mapping.map(r.end)!=r.start+c.nodeAfter.nodeSize)return!1;var f=r.startIndex==0,l=r.endIndex==o.childCount,p=c.node(-1),d=c.index(-1);if(!p.canReplace(d+(f?0:1),d+1,s.content.append(l?D.empty:D.from(o))))return!1;var h=c.pos,m=h+s.nodeSize;return n.step(new Pr(h-(f?1:0),m+(l?1:0),h+1,m-1,new Z((f?D.empty:D.from(o.copy(D.empty))).append(l?D.empty:D.from(o.copy(D.empty))),f?0:1,l?0:1),f?0:1)),e(n.scrollIntoView()),!0}function h_t(t){return function(e,r){var n=e.selection,o=n.$from,i=n.$to,a=o.blockRange(i,function(m){return m.childCount&&m.firstChild.type==t});if(!a)return!1;var u=a.startIndex;if(u==0)return!1;var c=a.parent,s=c.child(u-1);if(s.type!=t)return!1;if(r){var f=s.lastChild&&s.lastChild.type==c.type,l=D.from(f?t.create():null),p=new Z(D.from(t.create(null,D.from(c.type.create(null,l)))),f?3:1,0),d=a.start,h=a.end;r(e.tr.step(new Pr(d-(f?3:1),h,d,h,p,1,!0)).scrollIntoView())}return!0}}var z={};if(typeof navigator!="undefined"&&typeof document!="undefined"){var u1=/Edge\/(\d+)/.exec(navigator.userAgent),Eq=/MSIE \d/.test(navigator.userAgent),c1=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),s1=z.ie=!!(Eq||c1||u1);z.ie_version=Eq?document.documentMode||6:c1?+c1[1]:u1?+u1[1]:null,z.gecko=!s1&&/gecko\/(\d+)/i.test(navigator.userAgent),z.gecko_version=z.gecko&&+(/Firefox\/(\d+)/.exec(navigator.userAgent)||[0,0])[1];var f1=!s1&&/Chrome\/(\d+)/.exec(navigator.userAgent);z.chrome=!!f1,z.chrome_version=f1&&+f1[1],z.safari=!s1&&/Apple Computer/.test(navigator.vendor),z.ios=z.safari&&(/Mobile\/\w+/.test(navigator.userAgent)||navigator.maxTouchPoints>2),z.mac=z.ios||/Mac/.test(navigator.platform),z.android=/Android \d/.test(navigator.userAgent),z.webkit="webkitFontSmoothing"in document.documentElement.style,z.webkit_version=z.webkit&&+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]}var un=function(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e},l1=function(t){var e=t.assignedSlot||t.parentNode;return e&&e.nodeType==11?e.host:e},wq=null,Ei=function(t,e,r){var n=wq||(wq=document.createRange());return n.setEnd(t,r==null?t.nodeValue.length:r),n.setStart(t,e||0),n},Rd=function(t,e,r,n){return r&&(Aq(t,e,r,n,-1)||Aq(t,e,r,n,1))},v_t=/^(img|br|input|textarea|hr)$/i;function Aq(t,e,r,n,o){for(;;){if(t==r&&e==n)return!0;if(e==(o<0?0:Wo(t))){var i=t.parentNode;if(i.nodeType!=1||g_t(t)||v_t.test(t.nodeName)||t.contentEditable=="false")return!1;e=un(t)+(o<0?0:1),t=i}else if(t.nodeType==1){if(t=t.childNodes[e+(o<0?-1:0)],t.contentEditable=="false")return!1;e=o<0?Wo(t):0}else return!1}}function Wo(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function m_t(t,e,r){for(var n=e==0,o=e==Wo(t);n||o;){if(t==r)return!0;var i=un(t);if(t=t.parentNode,!t)return!1;n=n&&i==0,o=o&&i==Wo(t)}}function g_t(t){for(var e,r=t;r&&!(e=r.pmViewDesc);r=r.parentNode);return e&&e.node&&e.node.isBlock&&(e.dom==t||e.contentDOM==t)}var p1=function(t){var e=t.isCollapsed;return e&&z.chrome&&t.rangeCount&&!t.getRangeAt(0).collapsed&&(e=!1),e};function Ef(t,e){var r=document.createEvent("Event");return r.initEvent("keydown",!0,!0),r.keyCode=t,r.key=r.code=e,r}function y_t(t){return{left:0,right:t.documentElement.clientWidth,top:0,bottom:t.documentElement.clientHeight}}function Na(t,e){return typeof t=="number"?t:t[e]}function b_t(t){var e=t.getBoundingClientRect(),r=e.width/t.offsetWidth||1,n=e.height/t.offsetHeight||1;return{left:e.left,right:e.left+t.clientWidth*r,top:e.top,bottom:e.top+t.clientHeight*n}}function Cq(t,e,r){for(var n=t.someProp("scrollThreshold")||0,o=t.someProp("scrollMargin")||5,i=t.dom.ownerDocument,a=r||t.dom;a;a=l1(a))if(a.nodeType==1){var u=a==i.body||a.nodeType!=1,c=u?y_t(i):b_t(a),s=0,f=0;if(e.top<c.top+Na(n,"top")?f=-(c.top-e.top+Na(o,"top")):e.bottom>c.bottom-Na(n,"bottom")&&(f=e.bottom-c.bottom+Na(o,"bottom")),e.left<c.left+Na(n,"left")?s=-(c.left-e.left+Na(o,"left")):e.right>c.right-Na(n,"right")&&(s=e.right-c.right+Na(o,"right")),s||f)if(u)i.defaultView.scrollBy(s,f);else{var l=a.scrollLeft,p=a.scrollTop;f&&(a.scrollTop+=f),s&&(a.scrollLeft+=s);var d=a.scrollLeft-l,h=a.scrollTop-p;e={left:e.left-d,top:e.top-h,right:e.right-d,bottom:e.bottom-h}}if(u)break}}function $_t(t){for(var e=t.dom.getBoundingClientRect(),r=Math.max(0,e.top),n,o,i=(e.left+e.right)/2,a=r+1;a<Math.min(innerHeight,e.bottom);a+=5){var u=t.root.elementFromPoint(i,a);if(!(u==t.dom||!t.dom.contains(u))){var c=u.getBoundingClientRect();if(c.top>=r-20){n=u,o=c.top;break}}}return{refDOM:n,refTop:o,stack:xq(t.dom)}}function xq(t){for(var e=[],r=t.ownerDocument;t&&(e.push({dom:t,top:t.scrollTop,left:t.scrollLeft}),t!=r);t=l1(t));return e}function __t(t){var e=t.refDOM,r=t.refTop,n=t.stack,o=e?e.getBoundingClientRect().top:0;kq(n,o==0?0:o-r)}function kq(t,e){for(var r=0;r<t.length;r++){var n=t[r],o=n.dom,i=n.top,a=n.left;o.scrollTop!=i+e&&(o.scrollTop=i+e),o.scrollLeft!=a&&(o.scrollLeft=a)}}var wf=null;function S_t(t){if(t.setActive)return t.setActive();if(wf)return t.focus(wf);var e=xq(t);t.focus(wf==null?{get preventScroll(){return wf={preventScroll:!0},!0}}:void 0),wf||(wf=!1,kq(e,0))}function Wq(t,e){for(var r,n=2e8,o,i=0,a=e.top,u=e.top,c=t.firstChild,s=0;c;c=c.nextSibling,s++){var f=void 0;if(c.nodeType==1)f=c.getClientRects();else if(c.nodeType==3)f=Ei(c).getClientRects();else continue;for(var l=0;l<f.length;l++){var p=f[l];if(p.top<=a&&p.bottom>=u){a=Math.max(p.bottom,a),u=Math.min(p.top,u);var d=p.left>e.left?p.left-e.left:p.right<e.left?e.left-p.right:0;if(d<n){r=c,n=d,o=d&&r.nodeType==3?{left:p.right<e.left?p.right:p.left,top:e.top}:e,c.nodeType==1&&d&&(i=s+(e.left>=(p.left+p.right)/2?1:0));continue}}!r&&(e.left>=p.right&&e.top>=p.top||e.left>=p.left&&e.top>=p.bottom)&&(i=s+1)}}return r&&r.nodeType==3?T_t(r,o):!r||n&&r.nodeType==1?{node:t,offset:i}:Wq(r,o)}function T_t(t,e){for(var r=t.nodeValue.length,n=document.createRange(),o=0;o<r;o++){n.setEnd(t,o+1),n.setStart(t,o);var i=Pa(n,1);if(i.top!=i.bottom&&d1(e,i))return{node:t,offset:o+(e.left>=(i.left+i.right)/2?1:0)}}return{node:t,offset:0}}function d1(t,e){return t.left>=e.left-1&&t.left<=e.right+1&&t.top>=e.top-1&&t.top<=e.bottom+1}function I_t(t,e){var r=t.parentNode;return r&&/^li$/i.test(r.nodeName)&&e.left<t.getBoundingClientRect().left?r:t}function O_t(t,e,r){var n=Wq(e,r),o=n.node,i=n.offset,a=-1;if(o.nodeType==1&&!o.firstChild){var u=o.getBoundingClientRect();a=u.left!=u.right&&r.left>(u.left+u.right)/2?1:-1}return t.docView.posFromDOM(o,i,a)}function M_t(t,e,r,n){for(var o=-1,i=e;i!=t.dom;){var a=t.docView.nearestDesc(i,!0);if(!a)return null;if(a.node.isBlock&&a.parent){var u=a.dom.getBoundingClientRect();if(u.left>n.left||u.top>n.top)o=a.posBefore;else if(u.right<n.left||u.bottom<n.top)o=a.posAfter;else break}i=a.dom.parentNode}return o>-1?o:t.docView.posFromDOM(e,r)}function Fq(t,e,r){var n=t.childNodes.length;if(n&&r.top<r.bottom)for(var o=Math.max(0,Math.min(n-1,Math.floor(n*(e.top-r.top)/(r.bottom-r.top))-2)),i=o;;){var a=t.childNodes[i];if(a.nodeType==1)for(var u=a.getClientRects(),c=0;c<u.length;c++){var s=u[c];if(d1(e,s))return Fq(a,e,s)}if((i=(i+1)%n)==o)break}return t}function R_t(t,e){var r,n,o=t.dom.ownerDocument,i,a;if(o.caretPositionFromPoint)try{var u=o.caretPositionFromPoint(e.left,e.top);u&&(r=u,i=r.offsetNode,a=r.offset)}catch{}if(!i&&o.caretRangeFromPoint){var c=o.caretRangeFromPoint(e.left,e.top);c&&(n=c,i=n.startContainer,a=n.startOffset)}var s=(t.root.elementFromPoint?t.root:o).elementFromPoint(e.left,e.top+1),f;if(!s||!t.dom.contains(s.nodeType!=1?s.parentNode:s)){var l=t.dom.getBoundingClientRect();if(!d1(e,l)||(s=Fq(t.dom,e,l),!s))return null}if(z.safari)for(var p=s;i&&p;p=l1(p))p.draggable&&(i=a=null);if(s=I_t(s,e),i){if(z.gecko&&i.nodeType==1&&(a=Math.min(a,i.childNodes.length),a<i.childNodes.length)){var d=i.childNodes[a],h;d.nodeName=="IMG"&&(h=d.getBoundingClientRect()).right<=e.left&&h.bottom>e.top&&a++}i==t.dom&&a==i.childNodes.length-1&&i.lastChild.nodeType==1&&e.top>i.lastChild.getBoundingClientRect().bottom?f=t.state.doc.content.size:(a==0||i.nodeType!=1||i.childNodes[a-1].nodeName!="BR")&&(f=M_t(t,i,a,e))}f==null&&(f=O_t(t,s,e));var m=t.docView.nearestDesc(s,!0);return{pos:f,inside:m?m.posAtStart-m.border:-1}}function Pa(t,e){var r=t.getClientRects();return r.length?r[e<0?0:r.length-1]:t.getBoundingClientRect()}var E_t=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function Nq(t,e,r){var n=t.docView.domFromPos(e,r<0?-1:1),o=n.node,i=n.offset,a=z.webkit||z.gecko;if(o.nodeType==3)if(a&&(E_t.test(o.nodeValue)||(r<0?!i:i==o.nodeValue.length))){var u=Pa(Ei(o,i,i),r);if(z.gecko&&i&&/\s/.test(o.nodeValue[i-1])&&i<o.nodeValue.length){var c=Pa(Ei(o,i-1,i-1),-1);if(c.top==u.top){var s=Pa(Ei(o,i,i+1),-1);if(s.top!=u.top)return Ed(s,s.left<c.left)}}return u}else{var f=i,l=i,p=r<0?1:-1;return r<0&&!i?(l++,p=-1):r>=0&&i==o.nodeValue.length?(f--,p=1):r<0?f--:l++,Ed(Pa(Ei(o,f,l),p),p<0)}if(!t.state.doc.resolve(e).parent.inlineContent){if(i&&(r<0||i==Wo(o))){var d=o.childNodes[i-1];if(d.nodeType==1)return h1(d.getBoundingClientRect(),!1)}if(i<Wo(o)){var h=o.childNodes[i];if(h.nodeType==1)return h1(h.getBoundingClientRect(),!0)}return h1(o.getBoundingClientRect(),r>=0)}if(i&&(r<0||i==Wo(o))){var m=o.childNodes[i-1],g=m.nodeType==3?Ei(m,Wo(m)-(a?0:1)):m.nodeType==1&&(m.nodeName!="BR"||!m.nextSibling)?m:null;if(g)return Ed(Pa(g,1),!1)}if(i<Wo(o)){for(var b=o.childNodes[i];b.pmViewDesc&&b.pmViewDesc.ignoreForCoords;)b=b.nextSibling;var $=b?b.nodeType==3?Ei(b,0,a?0:1):b.nodeType==1?b:null:null;if($)return Ed(Pa($,-1),!0)}return Ed(Pa(o.nodeType==3?Ei(o):o,-r),r>=0)}function Ed(t,e){if(t.width==0)return t;var r=e?t.left:t.right;return{top:t.top,bottom:t.bottom,left:r,right:r}}function h1(t,e){if(t.height==0)return t;var r=e?t.top:t.bottom;return{top:r,bottom:r,left:t.left,right:t.right}}function Pq(t,e,r){var n=t.state,o=t.root.activeElement;n!=e&&t.updateState(e),o!=t.dom&&t.focus();try{return r()}finally{n!=e&&t.updateState(n),o!=t.dom&&o&&o.focus()}}function w_t(t,e,r){var n=e.selection,o=r=="up"?n.$from:n.$to;return Pq(t,e,function(){for(var i=t.docView.domFromPos(o.pos,r=="up"?-1:1),a=i.node;;){var u=t.docView.nearestDesc(a,!0);if(!u)break;if(u.node.isBlock){a=u.dom;break}a=u.dom.parentNode}for(var c=Nq(t,o.pos,1),s=a.firstChild;s;s=s.nextSibling){var f=void 0;if(s.nodeType==1)f=s.getClientRects();else if(s.nodeType==3)f=Ei(s,0,s.nodeValue.length).getClientRects();else continue;for(var l=0;l<f.length;l++){var p=f[l];if(p.bottom>p.top+1&&(r=="up"?c.top-p.top>(p.bottom-c.top)*2:p.bottom-c.bottom>(c.bottom-p.top)*2))return!1}}return!0})}var A_t=/[\u0590-\u08ac]/;function C_t(t,e,r){var n=e.selection,o=n.$head;if(!o.parent.isTextblock)return!1;var i=o.parentOffset,a=!i,u=i==o.parent.content.size,c=t.root.getSelection();return!A_t.test(o.parent.textContent)||!c.modify?r=="left"||r=="backward"?a:u:Pq(t,e,function(){var s=c.getRangeAt(0),f=c.focusNode,l=c.focusOffset,p=c.caretBidiLevel;c.modify("move",r,"character");var d=o.depth?t.docView.domAfterPos(o.before()):t.dom,h=!d.contains(c.focusNode.nodeType==1?c.focusNode:c.focusNode.parentNode)||f==c.focusNode&&l==c.focusOffset;return c.removeAllRanges(),c.addRange(s),p!=null&&(c.caretBidiLevel=p),h})}var Dq=null,Lq=null,Uq=!1;function x_t(t,e,r){return Dq==e&&Lq==r?Uq:(Dq=e,Lq=r,Uq=r=="up"||r=="down"?w_t(t,e,r):C_t(t,e,r))}var io=0,jq=1,wd=2,wi=3,jt=function(e,r,n,o){this.parent=e,this.children=r,this.dom=n,n.pmViewDesc=this,this.contentDOM=o,this.dirty=io},Fo={size:{configurable:!0},border:{configurable:!0},posBefore:{configurable:!0},posAtStart:{configurable:!0},posAfter:{configurable:!0},posAtEnd:{configurable:!0},contentLost:{configurable:!0},domAtom:{configurable:!0},ignoreForCoords:{configurable:!0}};jt.prototype.matchesWidget=function(){return!1},jt.prototype.matchesMark=function(){return!1},jt.prototype.matchesNode=function(){return!1},jt.prototype.matchesHack=function(e){return!1},jt.prototype.parseRule=function(){return null},jt.prototype.stopEvent=function(){return!1},Fo.size.get=function(){for(var t=0,e=0;e<this.children.length;e++)t+=this.children[e].size;return t},Fo.border.get=function(){return 0},jt.prototype.destroy=function(){this.parent=null,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=null);for(var e=0;e<this.children.length;e++)this.children[e].destroy()},jt.prototype.posBeforeChild=function(e){for(var r=0,n=this.posAtStart;r<this.children.length;r++){var o=this.children[r];if(o==e)return n;n+=o.size}},Fo.posBefore.get=function(){return this.parent.posBeforeChild(this)},Fo.posAtStart.get=function(){return this.parent?this.parent.posBeforeChild(this)+this.border:0},Fo.posAfter.get=function(){return this.posBefore+this.size},Fo.posAtEnd.get=function(){return this.posAtStart+this.size-2*this.border},jt.prototype.localPosFromDOM=function(e,r,n){if(this.contentDOM&&this.contentDOM.contains(e.nodeType==1?e:e.parentNode))if(n<0){var o,i;if(e==this.contentDOM)o=e.childNodes[r-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;o=e.previousSibling}for(;o&&!((i=o.pmViewDesc)&&i.parent==this);)o=o.previousSibling;return o?this.posBeforeChild(i)+i.size:this.posAtStart}else{var a,u;if(e==this.contentDOM)a=e.childNodes[r];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;a=e.nextSibling}for(;a&&!((u=a.pmViewDesc)&&u.parent==this);)a=a.nextSibling;return a?this.posBeforeChild(u):this.posAtEnd}var c;if(e==this.dom&&this.contentDOM)c=r>un(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))c=e.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(r==0)for(var s=e;;s=s.parentNode){if(s==this.dom){c=!1;break}if(s.parentNode.firstChild!=s)break}if(c==null&&r==e.childNodes.length)for(var f=e;;f=f.parentNode){if(f==this.dom){c=!0;break}if(f.parentNode.lastChild!=f)break}}return(c==null?n>0:c)?this.posAtEnd:this.posAtStart},jt.prototype.nearestDesc=function(e,r){for(var n=!0,o=e;o;o=o.parentNode){var i=this.getDesc(o);if(i&&(!r||i.node))if(n&&i.nodeDOM&&!(i.nodeDOM.nodeType==1?i.nodeDOM.contains(e.nodeType==1?e:e.parentNode):i.nodeDOM==e))n=!1;else return i}},jt.prototype.getDesc=function(e){for(var r=e.pmViewDesc,n=r;n;n=n.parent)if(n==this)return r},jt.prototype.posFromDOM=function(e,r,n){for(var o=e;o;o=o.parentNode){var i=this.getDesc(o);if(i)return i.localPosFromDOM(e,r,n)}return-1},jt.prototype.descAt=function(e){for(var r=0,n=0;r<this.children.length;r++){var o=this.children[r],i=n+o.size;if(n==e&&i!=n){for(;!o.border&&o.children.length;)o=o.children[0];return o}if(e<i)return o.descAt(e-n-o.border);n=i}},jt.prototype.domFromPos=function(e,r){if(!this.contentDOM)return{node:this.dom,offset:0};for(var n=0,o=0,i=0;n<this.children.length;n++){var a=this.children[n],u=i+a.size;if(u>e||a instanceof Kq){o=e-i;break}i=u}if(o)return this.children[n].domFromPos(o-this.children[n].border,r);for(var c=void 0;n&&!(c=this.children[n-1]).size&&c instanceof Bq&&c.widget.type.side>=0;n--);if(r<=0){for(var s,f=!0;s=n?this.children[n-1]:null,!(!s||s.dom.parentNode==this.contentDOM);n--,f=!1);return s&&r&&f&&!s.border&&!s.domAtom?s.domFromPos(s.size,r):{node:this.contentDOM,offset:s?un(s.dom)+1:0}}else{for(var l,p=!0;l=n<this.children.length?this.children[n]:null,!(!l||l.dom.parentNode==this.contentDOM);n++,p=!1);return l&&p&&!l.border&&!l.domAtom?l.domFromPos(0,r):{node:this.contentDOM,offset:l?un(l.dom):this.contentDOM.childNodes.length}}},jt.prototype.parseRange=function(e,r,n){if(n===void 0&&(n=0),this.children.length==0)return{node:this.contentDOM,from:e,to:r,fromOffset:0,toOffset:this.contentDOM.childNodes.length};for(var o=-1,i=-1,a=n,u=0;;u++){var c=this.children[u],s=a+c.size;if(o==-1&&e<=s){var f=a+c.border;if(e>=f&&r<=s-c.border&&c.node&&c.contentDOM&&this.contentDOM.contains(c.contentDOM))return c.parseRange(e,r,f);e=a;for(var l=u;l>0;l--){var p=this.children[l-1];if(p.size&&p.dom.parentNode==this.contentDOM&&!p.emptyChildAt(1)){o=un(p.dom)+1;break}e-=p.size}o==-1&&(o=0)}if(o>-1&&(s>r||u==this.children.length-1)){r=s;for(var d=u+1;d<this.children.length;d++){var h=this.children[d];if(h.size&&h.dom.parentNode==this.contentDOM&&!h.emptyChildAt(-1)){i=un(h.dom);break}r+=h.size}i==-1&&(i=this.contentDOM.childNodes.length);break}a=s}return{node:this.contentDOM,from:e,to:r,fromOffset:o,toOffset:i}},jt.prototype.emptyChildAt=function(e){if(this.border||!this.contentDOM||!this.children.length)return!1;var r=this.children[e<0?0:this.children.length-1];return r.size==0||r.emptyChildAt(e)},jt.prototype.domAfterPos=function(e){var r=this.domFromPos(e,0),n=r.node,o=r.offset;if(n.nodeType!=1||o==n.childNodes.length)throw new RangeError("No node after pos "+e);return n.childNodes[o]},jt.prototype.setSelection=function(e,r,n,o){for(var i=Math.min(e,r),a=Math.max(e,r),u=0,c=0;u<this.children.length;u++){var s=this.children[u],f=c+s.size;if(i>c&&a<f)return s.setSelection(e-c-s.border,r-c-s.border,n,o);c=f}var l=this.domFromPos(e,e?-1:1),p=r==e?l:this.domFromPos(r,r?-1:1),d=n.getSelection(),h=!1;if((z.gecko||z.safari)&&e==r){var m=l.node,g=l.offset;if(m.nodeType==3){if(h=g&&m.nodeValue[g-1]==`
34
+ `,h&&g==m.nodeValue.length)for(var b=m,$=void 0;b;b=b.parentNode){if($=b.nextSibling){$.nodeName=="BR"&&(l=p={node:$.parentNode,offset:un($)+1});break}var w=b.pmViewDesc;if(w&&w.node&&w.node.isBlock)break}}else{var y=m.childNodes[g-1];h=y&&(y.nodeName=="BR"||y.contentEditable=="false")}}if(z.gecko&&d.focusNode&&d.focusNode!=p.node&&d.focusNode.nodeType==1){var I=d.focusNode.childNodes[d.focusOffset];I&&I.contentEditable=="false"&&(o=!0)}if(!(!(o||h&&z.safari)&&Rd(l.node,l.offset,d.anchorNode,d.anchorOffset)&&Rd(p.node,p.offset,d.focusNode,d.focusOffset))){var S=!1;if((d.extend||e==r)&&!h){d.collapse(l.node,l.offset);try{e!=r&&d.extend(p.node,p.offset),S=!0}catch(B){if(!(B instanceof DOMException))throw B}}if(!S){if(e>r){var k=l;l=p,p=k}var C=document.createRange();C.setEnd(p.node,p.offset),C.setStart(l.node,l.offset),d.removeAllRanges(),d.addRange(C)}}},jt.prototype.ignoreMutation=function(e){return!this.contentDOM&&e.type!="selection"},Fo.contentLost.get=function(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)},jt.prototype.markDirty=function(e,r){for(var n=0,o=0;o<this.children.length;o++){var i=this.children[o],a=n+i.size;if(n==a?e<=a&&r>=n:e<a&&r>n){var u=n+i.border,c=a-i.border;if(e>=u&&r<=c){this.dirty=e==n||r==a?wd:jq,e==u&&r==c&&(i.contentLost||i.dom.parentNode!=this.contentDOM)?i.dirty=wi:i.markDirty(e-u,r-u);return}else i.dirty=i.dom==i.contentDOM&&i.dom.parentNode==this.contentDOM&&!i.children.length?wd:wi}n=a}this.dirty=wd},jt.prototype.markParentsDirty=function(){for(var e=1,r=this.parent;r;r=r.parent,e++){var n=e==1?wd:jq;r.dirty<n&&(r.dirty=n)}},Fo.domAtom.get=function(){return!1},Fo.ignoreForCoords.get=function(){return!1},Object.defineProperties(jt.prototype,Fo);var Da=[],Bq=function(t){function e(n,o,i,a){var u,c=o.type.toDOM;if(typeof c=="function"&&(c=c(i,function(){if(!u)return a;if(u.parent)return u.parent.posBeforeChild(u)})),!o.type.spec.raw){if(c.nodeType!=1){var s=document.createElement("span");s.appendChild(c),c=s}c.contentEditable=!1,c.classList.add("ProseMirror-widget")}t.call(this,n,Da,c,null),this.widget=o,u=this}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={domAtom:{configurable:!0}};return e.prototype.matchesWidget=function(o){return this.dirty==io&&o.type.eq(this.widget.type)},e.prototype.parseRule=function(){return{ignore:!0}},e.prototype.stopEvent=function(o){var i=this.widget.spec.stopEvent;return i?i(o):!1},e.prototype.ignoreMutation=function(o){return o.type!="selection"||this.widget.spec.ignoreSelection},e.prototype.destroy=function(){this.widget.type.destroy(this.dom),t.prototype.destroy.call(this)},r.domAtom.get=function(){return!0},Object.defineProperties(e.prototype,r),e}(jt),k_t=function(t){function e(n,o,i,a){t.call(this,n,Da,o,null),this.textDOM=i,this.text=a}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={size:{configurable:!0}};return r.size.get=function(){return this.text.length},e.prototype.localPosFromDOM=function(o,i){return o!=this.textDOM?this.posAtStart+(i?this.size:0):this.posAtStart+i},e.prototype.domFromPos=function(o){return{node:this.textDOM,offset:o}},e.prototype.ignoreMutation=function(o){return o.type==="characterData"&&o.target.nodeValue==o.oldValue},Object.defineProperties(e.prototype,r),e}(jt),Vg=function(t){function e(r,n,o,i){t.call(this,r,[],o,i),this.mark=n}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.create=function(n,o,i,a){var u=a.nodeViews[o.type.name],c=u&&u(o,a,i);return(!c||!c.dom)&&(c=Ke.renderSpec(document,o.type.spec.toDOM(o,i))),new e(n,o,c.dom,c.contentDOM||c.dom)},e.prototype.parseRule=function(){return this.dirty&wi||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}},e.prototype.matchesMark=function(n){return this.dirty!=wi&&this.mark.eq(n)},e.prototype.markDirty=function(n,o){if(t.prototype.markDirty.call(this,n,o),this.dirty!=io){for(var i=this.parent;!i.node;)i=i.parent;i.dirty<this.dirty&&(i.dirty=this.dirty),this.dirty=io}},e.prototype.slice=function(n,o,i){var a=e.create(this.parent,this.mark,!0,i),u=this.children,c=this.size;o<c&&(u=g1(u,o,c,i)),n>0&&(u=g1(u,0,n,i));for(var s=0;s<u.length;s++)u[s].parent=a;return a.children=u,a},e}(jt),Ad=function(t){function e(n,o,i,a,u,c,s,f,l){t.call(this,n,o.isLeaf?Da:[],u,c),this.nodeDOM=s,this.node=o,this.outerDeco=i,this.innerDeco=a,c&&this.updateChildren(f,l)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={size:{configurable:!0},border:{configurable:!0},domAtom:{configurable:!0}};return e.create=function(o,i,a,u,c,s){var f,l=c.nodeViews[i.type.name],p,d=l&&l(i,c,function(){if(!p)return s;if(p.parent)return p.parent.posBeforeChild(p)},a,u),h=d&&d.dom,m=d&&d.contentDOM;if(i.isText){if(!h)h=document.createTextNode(i.text);else if(h.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else h||(f=Ke.renderSpec(document,i.type.spec.toDOM(i)),h=f.dom,m=f.contentDOM);!m&&!i.isText&&h.nodeName!="BR"&&(h.hasAttribute("contenteditable")||(h.contentEditable=!1),i.type.spec.draggable&&(h.draggable=!0));var g=h;return h=Jq(h,a,i),d?p=new W_t(o,i,a,u,h,m,g,d,c,s+1):i.isText?new qq(o,i,a,u,h,g,c):new e(o,i,a,u,h,m,g,c,s+1)},e.prototype.parseRule=function(){var o=this;if(this.node.type.spec.reparseInView)return null;var i={node:this.node.type.name,attrs:this.node.attrs};return this.node.type.whitespace=="pre"&&(i.preserveWhitespace="full"),this.contentDOM&&!this.contentLost?i.contentElement=this.contentDOM:i.getContent=function(){return o.contentDOM?D.empty:o.node.content},i},e.prototype.matchesNode=function(o,i,a){return this.dirty==io&&o.eq(this.node)&&m1(i,this.outerDeco)&&a.eq(this.innerDeco)},r.size.get=function(){return this.node.nodeSize},r.border.get=function(){return this.node.isLeaf?0:1},e.prototype.updateChildren=function(o,i){var a=this,u=this.node.inlineContent,c=i,s=o.composing&&this.localCompositionInfo(o,i),f=s&&s.pos>-1?s:null,l=s&&s.pos<0,p=new Rn(this,f&&f.node);D_t(this.node,this.innerDeco,function(d,h,m){d.spec.marks?p.syncToMarks(d.spec.marks,u,o):d.type.side>=0&&!m&&p.syncToMarks(h==a.node.childCount?St.none:a.node.child(h).marks,u,o),p.placeWidget(d,o,c)},function(d,h,m,g){p.syncToMarks(d.marks,u,o);var b;p.findNodeMatch(d,h,m,g)||l&&o.state.selection.from>c&&o.state.selection.to<c+d.nodeSize&&(b=p.findIndexWithChild(s.node))>-1&&p.updateNodeAt(d,h,m,b,o)||p.updateNextNode(d,h,m,o,g)||p.addNode(d,h,m,o,c),c+=d.nodeSize}),p.syncToMarks(Da,u,o),this.node.isTextblock&&p.addTextblockHacks(),p.destroyRest(),(p.changed||this.dirty==wd)&&(f&&this.protectLocalComposition(o,f),Vq(this.contentDOM,this.children,o),z.ios&&L_t(this.dom))},e.prototype.localCompositionInfo=function(o,i){var a=o.state.selection,u=a.from,c=a.to;if(!(!(o.state.selection instanceof wt)||u<i||c>i+this.node.content.size)){var s=o.root.getSelection(),f=U_t(s.focusNode,s.focusOffset);if(!(!f||!this.dom.contains(f.parentNode)))if(this.node.inlineContent){var l=f.nodeValue,p=j_t(this.node.content,l,u-i,c-i);return p<0?null:{node:f,pos:p,text:l}}else return{node:f,pos:-1}}},e.prototype.protectLocalComposition=function(o,i){var a=i.node,u=i.pos,c=i.text;if(!this.getDesc(a)){for(var s=a;s.parentNode!=this.contentDOM;s=s.parentNode){for(;s.previousSibling;)s.parentNode.removeChild(s.previousSibling);for(;s.nextSibling;)s.parentNode.removeChild(s.nextSibling);s.pmViewDesc&&(s.pmViewDesc=null)}var f=new k_t(this,s,a,c);o.compositionNodes.push(f),this.children=g1(this.children,u,u+c.length,o,f)}},e.prototype.update=function(o,i,a,u){return this.dirty==wi||!o.sameMarkup(this.node)?!1:(this.updateInner(o,i,a,u),!0)},e.prototype.updateInner=function(o,i,a,u){this.updateOuterDeco(i),this.node=o,this.innerDeco=a,this.contentDOM&&this.updateChildren(u,this.posAtStart),this.dirty=io},e.prototype.updateOuterDeco=function(o){if(!m1(o,this.outerDeco)){var i=this.nodeDOM.nodeType!=1,a=this.dom;this.dom=Hq(this.dom,this.nodeDOM,v1(this.outerDeco,this.node,i),v1(o,this.node,i)),this.dom!=a&&(a.pmViewDesc=null,this.dom.pmViewDesc=this),this.outerDeco=o}},e.prototype.selectNode=function(){this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.dom.draggable=!0)},e.prototype.deselectNode=function(){this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.dom.removeAttribute("draggable")},r.domAtom.get=function(){return this.node.isAtom},Object.defineProperties(e.prototype,r),e}(jt);function zq(t,e,r,n,o){return Jq(n,e,t),new Ad(null,t,e,r,n,n,n,o,0)}var qq=function(t){function e(n,o,i,a,u,c,s){t.call(this,n,o,i,a,u,null,c,s)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={domAtom:{configurable:!0}};return e.prototype.parseRule=function(){for(var o=this.nodeDOM.parentNode;o&&o!=this.dom&&!o.pmIsDeco;)o=o.parentNode;return{skip:o||!0}},e.prototype.update=function(o,i,a,u){return this.dirty==wi||this.dirty!=io&&!this.inParent()||!o.sameMarkup(this.node)?!1:(this.updateOuterDeco(i),(this.dirty!=io||o.text!=this.node.text)&&o.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=o.text,u.trackWrites==this.nodeDOM&&(u.trackWrites=null)),this.node=o,this.dirty=io,!0)},e.prototype.inParent=function(){for(var o=this.parent.contentDOM,i=this.nodeDOM;i;i=i.parentNode)if(i==o)return!0;return!1},e.prototype.domFromPos=function(o){return{node:this.nodeDOM,offset:o}},e.prototype.localPosFromDOM=function(o,i,a){return o==this.nodeDOM?this.posAtStart+Math.min(i,this.node.text.length):t.prototype.localPosFromDOM.call(this,o,i,a)},e.prototype.ignoreMutation=function(o){return o.type!="characterData"&&o.type!="selection"},e.prototype.slice=function(o,i,a){var u=this.node.cut(o,i),c=document.createTextNode(u.text);return new e(this.parent,u,this.outerDeco,this.innerDeco,c,c,a)},e.prototype.markDirty=function(o,i){t.prototype.markDirty.call(this,o,i),this.dom!=this.nodeDOM&&(o==0||i==this.nodeDOM.nodeValue.length)&&(this.dirty=wi)},r.domAtom.get=function(){return!1},Object.defineProperties(e.prototype,r),e}(Ad),Kq=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={domAtom:{configurable:!0},ignoreForCoords:{configurable:!0}};return e.prototype.parseRule=function(){return{ignore:!0}},e.prototype.matchesHack=function(o){return this.dirty==io&&this.dom.nodeName==o},r.domAtom.get=function(){return!0},r.ignoreForCoords.get=function(){return this.dom.nodeName=="IMG"},Object.defineProperties(e.prototype,r),e}(jt),W_t=function(t){function e(r,n,o,i,a,u,c,s,f,l){t.call(this,r,n,o,i,a,u,c,f,l),this.spec=s}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.update=function(n,o,i,a){if(this.dirty==wi)return!1;if(this.spec.update){var u=this.spec.update(n,o,i);return u&&this.updateInner(n,o,i,a),u}else return!this.contentDOM&&!n.isLeaf?!1:t.prototype.update.call(this,n,o,i,a)},e.prototype.selectNode=function(){this.spec.selectNode?this.spec.selectNode():t.prototype.selectNode.call(this)},e.prototype.deselectNode=function(){this.spec.deselectNode?this.spec.deselectNode():t.prototype.deselectNode.call(this)},e.prototype.setSelection=function(n,o,i,a){this.spec.setSelection?this.spec.setSelection(n,o,i):t.prototype.setSelection.call(this,n,o,i,a)},e.prototype.destroy=function(){this.spec.destroy&&this.spec.destroy(),t.prototype.destroy.call(this)},e.prototype.stopEvent=function(n){return this.spec.stopEvent?this.spec.stopEvent(n):!1},e.prototype.ignoreMutation=function(n){return this.spec.ignoreMutation?this.spec.ignoreMutation(n):t.prototype.ignoreMutation.call(this,n)},e}(Ad);function Vq(t,e,r){for(var n=t.firstChild,o=!1,i=0;i<e.length;i++){var a=e[i],u=a.dom;if(u.parentNode==t){for(;u!=n;)n=Gq(n),o=!0;n=n.nextSibling}else o=!0,t.insertBefore(u,n);if(a instanceof Vg){var c=n?n.previousSibling:t.lastChild;Vq(a.contentDOM,a.children,r),n=c?c.nextSibling:t.firstChild}}for(;n;)n=Gq(n),o=!0;o&&r.trackWrites==t&&(r.trackWrites=null)}function Cd(t){t&&(this.nodeName=t)}Cd.prototype=Object.create(null);var hc=[new Cd];function v1(t,e,r){if(t.length==0)return hc;for(var n=r?hc[0]:new Cd,o=[n],i=0;i<t.length;i++){var a=t[i].type.attrs;if(!!a){a.nodeName&&o.push(n=new Cd(a.nodeName));for(var u in a){var c=a[u];c!=null&&(r&&o.length==1&&o.push(n=new Cd(e.isInline?"span":"div")),u=="class"?n.class=(n.class?n.class+" ":"")+c:u=="style"?n.style=(n.style?n.style+";":"")+c:u!="nodeName"&&(n[u]=c))}}}return o}function Hq(t,e,r,n){if(r==hc&&n==hc)return e;for(var o=e,i=0;i<n.length;i++){var a=n[i],u=r[i];if(i){var c=void 0;u&&u.nodeName==a.nodeName&&o!=t&&(c=o.parentNode)&&c.tagName.toLowerCase()==a.nodeName||(c=document.createElement(a.nodeName),c.pmIsDeco=!0,c.appendChild(o),u=hc[0]),o=c}F_t(o,u||hc[0],a)}return o}function F_t(t,e,r){for(var n in e)n!="class"&&n!="style"&&n!="nodeName"&&!(n in r)&&t.removeAttribute(n);for(var o in r)o!="class"&&o!="style"&&o!="nodeName"&&r[o]!=e[o]&&t.setAttribute(o,r[o]);if(e.class!=r.class){for(var i=e.class?e.class.split(" ").filter(Boolean):Da,a=r.class?r.class.split(" ").filter(Boolean):Da,u=0;u<i.length;u++)a.indexOf(i[u])==-1&&t.classList.remove(i[u]);for(var c=0;c<a.length;c++)i.indexOf(a[c])==-1&&t.classList.add(a[c]);t.classList.length==0&&t.removeAttribute("class")}if(e.style!=r.style){if(e.style)for(var s=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g,f;f=s.exec(e.style);)t.style.removeProperty(f[1]);r.style&&(t.style.cssText+=r.style)}}function Jq(t,e,r){return Hq(t,t,hc,v1(e,r,t.nodeType!=1))}function m1(t,e){if(t.length!=e.length)return!1;for(var r=0;r<t.length;r++)if(!t[r].type.eq(e[r].type))return!1;return!0}function Gq(t){var e=t.nextSibling;return t.parentNode.removeChild(t),e}var Rn=function(e,r){this.top=e,this.lock=r,this.index=0,this.stack=[],this.changed=!1,this.preMatch=N_t(e.node.content,e)};Rn.prototype.destroyBetween=function(e,r){if(e!=r){for(var n=e;n<r;n++)this.top.children[n].destroy();this.top.children.splice(e,r-e),this.changed=!0}},Rn.prototype.destroyRest=function(){this.destroyBetween(this.index,this.top.children.length)},Rn.prototype.syncToMarks=function(e,r,n){for(var o=0,i=this.stack.length>>1,a=Math.min(i,e.length);o<a&&(o==i-1?this.top:this.stack[o+1<<1]).matchesMark(e[o])&&e[o].type.spec.spanning!==!1;)o++;for(;o<i;)this.destroyRest(),this.top.dirty=io,this.index=this.stack.pop(),this.top=this.stack.pop(),i--;for(;i<e.length;){this.stack.push(this.top,this.index+1);for(var u=-1,c=this.index;c<Math.min(this.index+3,this.top.children.length);c++)if(this.top.children[c].matchesMark(e[i])){u=c;break}if(u>-1)u>this.index&&(this.changed=!0,this.destroyBetween(this.index,u)),this.top=this.top.children[this.index];else{var s=Vg.create(this.top,e[i],r,n);this.top.children.splice(this.index,0,s),this.top=s,this.changed=!0}this.index=0,i++}},Rn.prototype.findNodeMatch=function(e,r,n,o){var i=-1,a;if(o>=this.preMatch.index&&(a=this.preMatch.matches[o-this.preMatch.index]).parent==this.top&&a.matchesNode(e,r,n))i=this.top.children.indexOf(a,this.index);else for(var u=this.index,c=Math.min(this.top.children.length,u+5);u<c;u++){var s=this.top.children[u];if(s.matchesNode(e,r,n)&&!this.preMatch.matched.has(s)){i=u;break}}return i<0?!1:(this.destroyBetween(this.index,i),this.index++,!0)},Rn.prototype.updateNodeAt=function(e,r,n,o,i){var a=this.top.children[o];return a.update(e,r,n,i)?(this.destroyBetween(this.index,o),this.index=o+1,!0):!1},Rn.prototype.findIndexWithChild=function(e){for(;;){var r=e.parentNode;if(!r)return-1;if(r==this.top.contentDOM){var n=e.pmViewDesc;if(n){for(var o=this.index;o<this.top.children.length;o++)if(this.top.children[o]==n)return o}return-1}e=r}},Rn.prototype.updateNextNode=function(e,r,n,o,i){for(var a=this.index;a<this.top.children.length;a++){var u=this.top.children[a];if(u instanceof Ad){var c=this.preMatch.matched.get(u);if(c!=null&&c!=i)return!1;var s=u.dom,f=this.lock&&(s==this.lock||s.nodeType==1&&s.contains(this.lock.parentNode))&&!(e.isText&&u.node&&u.node.isText&&u.nodeDOM.nodeValue==e.text&&u.dirty!=wi&&m1(r,u.outerDeco));if(!f&&u.update(e,r,n,o))return this.destroyBetween(this.index,a),u.dom!=s&&(this.changed=!0),this.index++,!0;break}}return!1},Rn.prototype.addNode=function(e,r,n,o,i){this.top.children.splice(this.index++,0,Ad.create(this.top,e,r,n,o,i)),this.changed=!0},Rn.prototype.placeWidget=function(e,r,n){var o=this.index<this.top.children.length?this.top.children[this.index]:null;if(o&&o.matchesWidget(e)&&(e==o.widget||!o.widget.type.toDOM.parentNode))this.index++;else{var i=new Bq(this.top,e,r,n);this.top.children.splice(this.index++,0,i),this.changed=!0}},Rn.prototype.addTextblockHacks=function(){for(var e=this.top.children[this.index-1];e instanceof Vg;)e=e.children[e.children.length-1];(!e||!(e instanceof qq)||/\n$/.test(e.node.text))&&((z.safari||z.chrome)&&e&&e.dom.contentEditable=="false"&&this.addHackNode("IMG"),this.addHackNode("BR"))},Rn.prototype.addHackNode=function(e){if(this.index<this.top.children.length&&this.top.children[this.index].matchesHack(e))this.index++;else{var r=document.createElement(e);e=="IMG"&&(r.className="ProseMirror-separator"),e=="BR"&&(r.className="ProseMirror-trailingBreak"),this.top.children.splice(this.index++,0,new Kq(this.top,Da,r,null)),this.changed=!0}};function N_t(t,e){var r=e,n=r.children.length,o=t.childCount,i=new Map,a=[];t:for(;o>0;){for(var u=void 0;;)if(n){var c=r.children[n-1];if(c instanceof Vg)r=c,n=c.children.length;else{u=c,n--;break}}else{if(r==e)break t;n=r.parent.children.indexOf(r),r=r.parent}var s=u.node;if(!!s){if(s!=t.child(o-1))break;--o,i.set(u,o),a.push(u)}}return{index:o,matched:i,matches:a.reverse()}}function P_t(t,e){return t.type.side-e.type.side}function D_t(t,e,r,n){var o=e.locals(t),i=0;if(o.length==0){for(var a=0;a<t.childCount;a++){var u=t.child(a);n(u,o,e.forChild(i,u),a),i+=u.nodeSize}return}for(var c=0,s=[],f=null,l=0;;){if(c<o.length&&o[c].to==i){for(var p=o[c++],d=void 0;c<o.length&&o[c].to==i;)(d||(d=[p])).push(o[c++]);if(d){d.sort(P_t);for(var h=0;h<d.length;h++)r(d[h],l,!!f)}else r(p,l,!!f)}var m=void 0,g=void 0;if(f)g=-1,m=f,f=null;else if(l<t.childCount)g=l,m=t.child(l++);else break;for(var b=0;b<s.length;b++)s[b].to<=i&&s.splice(b--,1);for(;c<o.length&&o[c].from<=i&&o[c].to>i;)s.push(o[c++]);var $=i+m.nodeSize;if(m.isText){var w=$;c<o.length&&o[c].from<w&&(w=o[c].from);for(var y=0;y<s.length;y++)s[y].to<w&&(w=s[y].to);w<$&&(f=m.cut(w-i),m=m.cut(0,w-i),$=w,g=-1)}var I=s.length?m.isInline&&!m.isLeaf?s.filter(function(S){return!S.inline}):s.slice():Da;n(m,I,e.forChild(i,m),g),i=$}}function L_t(t){if(t.nodeName=="UL"||t.nodeName=="OL"){var e=t.style.cssText;t.style.cssText=e+"; list-style: square !important",window.getComputedStyle(t).listStyle,t.style.cssText=e}}function U_t(t,e){for(;;){if(t.nodeType==3)return t;if(t.nodeType==1&&e>0){if(t.childNodes.length>e&&t.childNodes[e].nodeType==3)return t.childNodes[e];t=t.childNodes[e-1],e=Wo(t)}else if(t.nodeType==1&&e<t.childNodes.length)t=t.childNodes[e],e=0;else return null}}function j_t(t,e,r,n){for(var o=0,i=0;o<t.childCount&&i<=n;){var a=t.child(o++),u=i;if(i+=a.nodeSize,!!a.isText){for(var c=a.text;o<t.childCount;){var s=t.child(o++);if(i+=s.nodeSize,!s.isText)break;c+=s.text}if(i>=r&&u<n){var f=c.lastIndexOf(e,n-u-1);if(f>=0&&f+e.length+u>=r)return u+f}}}return-1}function g1(t,e,r,n,o){for(var i=[],a=0,u=0;a<t.length;a++){var c=t[a],s=u,f=u+=c.size;s>=r||f<=e?i.push(c):(s<e&&i.push(c.slice(0,e-s,n)),o&&(i.push(o),o=null),f>r&&i.push(c.slice(r-s,c.size,n)))}return i}function Yq(t,e){var r=t.root.getSelection(),n=t.state.doc;if(!r.focusNode)return null;var o=t.docView.nearestDesc(r.focusNode),i=o&&o.size==0,a=t.docView.posFromDOM(r.focusNode,r.focusOffset);if(a<0)return null;var u=n.resolve(a),c,s;if(p1(r)){for(c=u;o&&!o.node;)o=o.parent;if(o&&o.node.isAtom&&dt.isSelectable(o.node)&&o.parent&&!(o.node.isInline&&m_t(r.focusNode,r.focusOffset,o.dom))){var f=o.posBefore;s=new dt(a==f?u:n.resolve(f))}}else{var l=t.docView.posFromDOM(r.anchorNode,r.anchorOffset);if(l<0)return null;c=n.resolve(l)}if(!s){var p=e=="pointer"||t.state.selection.head<u.pos&&!i?1:-1;s=b1(t,c,u,p)}return s}function Xq(t){return t.editable?t.hasFocus():$1(t)&&document.activeElement&&document.activeElement.contains(t.dom)}function La(t,e){var r=t.state.selection;if(e2(t,r),!!Xq(t)){if(!e&&t.mouseDown&&t.mouseDown.allowDefault&&z.chrome){var n=t.root.getSelection(),o=t.domObserver.currentSelection;if(n.anchorNode&&Rd(n.anchorNode,n.anchorOffset,o.anchorNode,o.anchorOffset)){t.mouseDown.delayedSelectionSync=!0,t.domObserver.setCurSelection();return}}if(t.domObserver.disconnectSelection(),t.cursorWrapper)z_t(t);else{var i=r.anchor,a=r.head,u,c;Zq&&!(r instanceof wt)&&(r.$from.parent.inlineContent||(u=Qq(t,r.from)),!r.empty&&!r.$from.parent.inlineContent&&(c=Qq(t,r.to))),t.docView.setSelection(i,a,t.root,e),Zq&&(u&&t2(u),c&&t2(c)),r.visible?t.dom.classList.remove("ProseMirror-hideselection"):(t.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&B_t(t))}t.domObserver.setCurSelection(),t.domObserver.connectSelection()}}var Zq=z.safari||z.chrome&&z.chrome_version<63;function Qq(t,e){var r=t.docView.domFromPos(e,0),n=r.node,o=r.offset,i=o<n.childNodes.length?n.childNodes[o]:null,a=o?n.childNodes[o-1]:null;if(z.safari&&i&&i.contentEditable=="false")return y1(i);if((!i||i.contentEditable=="false")&&(!a||a.contentEditable=="false")){if(i)return y1(i);if(a)return y1(a)}}function y1(t){return t.contentEditable="true",z.safari&&t.draggable&&(t.draggable=!1,t.wasDraggable=!0),t}function t2(t){t.contentEditable="false",t.wasDraggable&&(t.draggable=!0,t.wasDraggable=null)}function B_t(t){var e=t.dom.ownerDocument;e.removeEventListener("selectionchange",t.hideSelectionGuard);var r=t.root.getSelection(),n=r.anchorNode,o=r.anchorOffset;e.addEventListener("selectionchange",t.hideSelectionGuard=function(){(r.anchorNode!=n||r.anchorOffset!=o)&&(e.removeEventListener("selectionchange",t.hideSelectionGuard),setTimeout(function(){(!Xq(t)||t.state.selection.visible)&&t.dom.classList.remove("ProseMirror-hideselection")},20))})}function z_t(t){var e=t.root.getSelection(),r=document.createRange(),n=t.cursorWrapper.dom,o=n.nodeName=="IMG";o?r.setEnd(n.parentNode,un(n)+1):r.setEnd(n,0),r.collapse(!1),e.removeAllRanges(),e.addRange(r),!o&&!t.state.selection.visible&&z.ie&&z.ie_version<=11&&(n.disabled=!0,n.disabled=!1)}function e2(t,e){if(e instanceof dt){var r=t.docView.descAt(e.from);r!=t.lastSelectedViewDesc&&(r2(t),r&&r.selectNode(),t.lastSelectedViewDesc=r)}else r2(t)}function r2(t){t.lastSelectedViewDesc&&(t.lastSelectedViewDesc.parent&&t.lastSelectedViewDesc.deselectNode(),t.lastSelectedViewDesc=null)}function b1(t,e,r,n){return t.someProp("createSelectionBetween",function(o){return o(t,e,r)})||wt.between(e,r,n)}function q_t(t){return t.editable&&t.root.activeElement!=t.dom?!1:$1(t)}function $1(t){var e=t.root.getSelection();if(!e.anchorNode)return!1;try{return t.dom.contains(e.anchorNode.nodeType==3?e.anchorNode.parentNode:e.anchorNode)&&(t.editable||t.dom.contains(e.focusNode.nodeType==3?e.focusNode.parentNode:e.focusNode))}catch{return!1}}function K_t(t){var e=t.docView.domFromPos(t.state.selection.anchor,0),r=t.root.getSelection();return Rd(e.node,e.offset,r.anchorNode,r.anchorOffset)}function _1(t,e){var r=t.selection,n=r.$anchor,o=r.$head,i=e>0?n.max(o):n.min(o),a=i.parent.inlineContent?i.depth?t.doc.resolve(e>0?i.after():i.before()):null:i;return a&&gt.findFrom(a,e)}function vc(t,e){return t.dispatch(t.state.tr.setSelection(e).scrollIntoView()),!0}function n2(t,e,r){var n=t.state.selection;if(n instanceof wt){if(!n.empty||r.indexOf("s")>-1)return!1;if(t.endOfTextblock(e>0?"right":"left")){var o=_1(t.state,e);return o&&o instanceof dt?vc(t,o):!1}else if(!(z.mac&&r.indexOf("m")>-1)){var i=n.$head,a=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter,u;if(!a||a.isText)return!1;var c=e<0?i.pos-a.nodeSize:i.pos;return a.isAtom||(u=t.docView.descAt(c))&&!u.contentDOM?dt.isSelectable(a)?vc(t,new dt(e<0?t.state.doc.resolve(i.pos-a.nodeSize):i)):z.webkit?vc(t,new wt(t.state.doc.resolve(e<0?c:c+a.nodeSize))):!1:!1}}else{if(n instanceof dt&&n.node.isInline)return vc(t,new wt(e>0?n.$to:n.$from));var s=_1(t.state,e);return s?vc(t,s):!1}}function Hg(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function xd(t){var e=t.pmViewDesc;return e&&e.size==0&&(t.nextSibling||t.nodeName!="BR")}function S1(t){var e=t.root.getSelection(),r=e.focusNode,n=e.focusOffset;if(!!r){var o,i,a=!1;for(z.gecko&&r.nodeType==1&&n<Hg(r)&&xd(r.childNodes[n])&&(a=!0);;)if(n>0){if(r.nodeType!=1)break;var u=r.childNodes[n-1];if(xd(u))o=r,i=--n;else if(u.nodeType==3)r=u,n=r.nodeValue.length;else break}else{if(o2(r))break;for(var c=r.previousSibling;c&&xd(c);)o=r.parentNode,i=un(c),c=c.previousSibling;if(c)r=c,n=Hg(r);else{if(r=r.parentNode,r==t.dom)break;n=0}}a?I1(t,e,r,n):o&&I1(t,e,o,i)}}function T1(t){var e=t.root.getSelection(),r=e.focusNode,n=e.focusOffset;if(!!r){for(var o=Hg(r),i,a;;)if(n<o){if(r.nodeType!=1)break;var u=r.childNodes[n];if(xd(u))i=r,a=++n;else break}else{if(o2(r))break;for(var c=r.nextSibling;c&&xd(c);)i=c.parentNode,a=un(c)+1,c=c.nextSibling;if(c)r=c,n=0,o=Hg(r);else{if(r=r.parentNode,r==t.dom)break;n=o=0}}i&&I1(t,e,i,a)}}function o2(t){var e=t.pmViewDesc;return e&&e.node&&e.node.isBlock}function I1(t,e,r,n){if(p1(e)){var o=document.createRange();o.setEnd(r,n),o.setStart(r,n),e.removeAllRanges(),e.addRange(o)}else e.extend&&e.extend(r,n);t.domObserver.setCurSelection();var i=t.state;setTimeout(function(){t.state==i&&La(t)},50)}function i2(t,e,r){var n=t.state.selection;if(n instanceof wt&&!n.empty||r.indexOf("s")>-1||z.mac&&r.indexOf("m")>-1)return!1;var o=n.$from,i=n.$to;if(!o.parent.inlineContent||t.endOfTextblock(e<0?"up":"down")){var a=_1(t.state,e);if(a&&a instanceof dt)return vc(t,a)}if(!o.parent.inlineContent){var u=e<0?o:i,c=n instanceof Ri?gt.near(u,e):gt.findFrom(u,e);return c?vc(t,c):!1}return!1}function a2(t,e){if(!(t.state.selection instanceof wt))return!0;var r=t.state.selection,n=r.$head,o=r.$anchor,i=r.empty;if(!n.sameParent(o))return!0;if(!i)return!1;if(t.endOfTextblock(e>0?"forward":"backward"))return!0;var a=!n.textOffset&&(e<0?n.nodeBefore:n.nodeAfter);if(a&&!a.isText){var u=t.state.tr;return e<0?u.delete(n.pos-a.nodeSize,n.pos):u.delete(n.pos,n.pos+a.nodeSize),t.dispatch(u),!0}return!1}function u2(t,e,r){t.domObserver.stop(),e.contentEditable=r,t.domObserver.start()}function V_t(t){if(!(!z.safari||t.state.selection.$head.parentOffset>0)){var e=t.root.getSelection(),r=e.focusNode,n=e.focusOffset;if(r&&r.nodeType==1&&n==0&&r.firstChild&&r.firstChild.contentEditable=="false"){var o=r.firstChild;u2(t,o,!0),setTimeout(function(){return u2(t,o,!1)},20)}}}function H_t(t){var e="";return t.ctrlKey&&(e+="c"),t.metaKey&&(e+="m"),t.altKey&&(e+="a"),t.shiftKey&&(e+="s"),e}function J_t(t,e){var r=e.keyCode,n=H_t(e);return r==8||z.mac&&r==72&&n=="c"?a2(t,-1)||S1(t):r==46||z.mac&&r==68&&n=="c"?a2(t,1)||T1(t):r==13||r==27?!0:r==37?n2(t,-1,n)||S1(t):r==39?n2(t,1,n)||T1(t):r==38?i2(t,-1,n)||S1(t):r==40?V_t(t)||i2(t,1,n)||T1(t):n==(z.mac?"m":"c")&&(r==66||r==73||r==89||r==90)}function G_t(t,e,r){var n=t.docView.parseRange(e,r),o=n.node,i=n.fromOffset,a=n.toOffset,u=n.from,c=n.to,s=t.root.getSelection(),f=null,l=s.anchorNode;if(l&&t.dom.contains(l.nodeType==1?l:l.parentNode)&&(f=[{node:l,offset:s.anchorOffset}],p1(s)||f.push({node:s.focusNode,offset:s.focusOffset})),z.chrome&&t.lastKeyCode===8)for(var p=a;p>i;p--){var d=o.childNodes[p-1],h=d.pmViewDesc;if(d.nodeName=="BR"&&!h){a=p;break}if(!h||h.size)break}var m=t.state.doc,g=t.someProp("domParser")||no.fromSchema(t.state.schema),b=m.resolve(u),$=null,w=g.parse(o,{topNode:b.parent,topMatch:b.parent.contentMatchAt(b.index()),topOpen:!0,from:i,to:a,preserveWhitespace:b.parent.type.whitespace=="pre"?"full":!0,editableContent:!0,findPositions:f,ruleFromNode:Y_t,context:b});if(f&&f[0].pos!=null){var y=f[0].pos,I=f[1]&&f[1].pos;I==null&&(I=y),$={anchor:y+u,head:I+u}}return{doc:w,sel:$,from:u,to:c}}function Y_t(t){var e=t.pmViewDesc;if(e)return e.parseRule();if(t.nodeName=="BR"&&t.parentNode){if(z.safari&&/^(ul|ol)$/i.test(t.parentNode.nodeName)){var r=document.createElement("div");return r.appendChild(document.createElement("li")),{skip:r}}else if(t.parentNode.lastChild==t||z.safari&&/^(tr|table)$/i.test(t.parentNode.nodeName))return{ignore:!0}}else if(t.nodeName=="IMG"&&t.getAttribute("mark-placeholder"))return{ignore:!0}}function X_t(t,e,r,n,o){if(e<0){var i=t.lastSelectionTime>Date.now()-50?t.lastSelectionOrigin:null,a=Yq(t,i);if(a&&!t.state.selection.eq(a)){var u=t.state.tr.setSelection(a);i=="pointer"?u.setMeta("pointer",!0):i=="key"&&u.scrollIntoView(),t.dispatch(u)}return}var c=t.state.doc.resolve(e),s=c.sharedDepth(r);e=c.before(s+1),r=t.state.doc.resolve(r).after(s+1);var f=t.state.selection,l=G_t(t,e,r);if(z.chrome&&t.cursorWrapper&&l.sel&&l.sel.anchor==t.cursorWrapper.deco.from){var p=t.cursorWrapper.deco.type.toDOM.nextSibling,d=p&&p.nodeValue?p.nodeValue.length:1;l.sel={anchor:l.sel.anchor+d,head:l.sel.anchor+d}}var h=t.state.doc,m=h.slice(l.from,l.to),g,b;t.lastKeyCode===8&&Date.now()-100<t.lastKeyCodeTime?(g=t.state.selection.to,b="end"):(g=t.state.selection.from,b="start"),t.lastKeyCode=null;var $=tSt(m.content,l.doc.content,l.from,g,b);if(!$)if(n&&f instanceof wt&&!f.empty&&f.$head.sameParent(f.$anchor)&&!t.composing&&!(l.sel&&l.sel.anchor!=l.sel.head))$={start:f.from,endA:f.to,endB:f.to};else if((z.ios&&t.lastIOSEnter>Date.now()-225||z.android)&&o.some(function(L){return L.nodeName=="DIV"||L.nodeName=="P"})&&t.someProp("handleKeyDown",function(L){return L(t,Ef(13,"Enter"))})){t.lastIOSEnter=0;return}else{if(l.sel){var w=c2(t,t.state.doc,l.sel);w&&!w.eq(t.state.selection)&&t.dispatch(t.state.tr.setSelection(w))}return}t.domChangeCount++,t.state.selection.from<t.state.selection.to&&$.start==$.endB&&t.state.selection instanceof wt&&($.start>t.state.selection.from&&$.start<=t.state.selection.from+2?$.start=t.state.selection.from:$.endA<t.state.selection.to&&$.endA>=t.state.selection.to-2&&($.endB+=t.state.selection.to-$.endA,$.endA=t.state.selection.to)),z.ie&&z.ie_version<=11&&$.endB==$.start+1&&$.endA==$.start&&$.start>l.from&&l.doc.textBetween($.start-l.from-1,$.start-l.from+1)==" \xA0"&&($.start--,$.endA--,$.endB--);var y=l.doc.resolveNoCache($.start-l.from),I=l.doc.resolveNoCache($.endB-l.from),S=y.sameParent(I)&&y.parent.inlineContent,k;if((z.ios&&t.lastIOSEnter>Date.now()-225&&(!S||o.some(function(L){return L.nodeName=="DIV"||L.nodeName=="P"}))||!S&&y.pos<l.doc.content.size&&(k=gt.findFrom(l.doc.resolve(y.pos+1),1,!0))&&k.head==I.pos)&&t.someProp("handleKeyDown",function(L){return L(t,Ef(13,"Enter"))})){t.lastIOSEnter=0;return}if(t.state.selection.anchor>$.start&&Q_t(h,$.start,$.endA,y,I)&&t.someProp("handleKeyDown",function(L){return L(t,Ef(8,"Backspace"))})){z.android&&z.chrome&&t.domObserver.suppressSelectionUpdates();return}z.chrome&&z.android&&$.toB==$.from&&(t.lastAndroidDelete=Date.now()),z.android&&!S&&y.start()!=I.start()&&I.parentOffset==0&&y.depth==I.depth&&l.sel&&l.sel.anchor==l.sel.head&&l.sel.head==$.endA&&($.endB-=2,I=l.doc.resolveNoCache($.endB-l.from),setTimeout(function(){t.someProp("handleKeyDown",function(L){return L(t,Ef(13,"Enter"))})},20));var C=$.start,B=$.endA,q,G,O,R;if(S){if(y.pos==I.pos)z.ie&&z.ie_version<=11&&y.parentOffset==0&&(t.domObserver.suppressSelectionUpdates(),setTimeout(function(){return La(t)},20)),q=t.state.tr.delete(C,B),G=h.resolve($.start).marksAcross(h.resolve($.endA));else if($.endA==$.endB&&(R=h.resolve($.start))&&(O=Z_t(y.parent.content.cut(y.parentOffset,I.parentOffset),R.parent.content.cut(R.parentOffset,$.endA-R.start()))))q=t.state.tr,O.type=="add"?q.addMark(C,B,O.mark):q.removeMark(C,B,O.mark);else if(y.parent.child(y.index()).isText&&y.index()==I.index()-(I.textOffset?0:1)){var x=y.parent.textBetween(y.parentOffset,I.parentOffset);if(t.someProp("handleTextInput",function(L){return L(t,C,B,x)}))return;q=t.state.tr.insertText(x,C,B)}}if(q||(q=t.state.tr.replace(C,B,l.doc.slice($.start-l.from,$.endB-l.from))),l.sel){var F=c2(t,q.doc,l.sel);F&&!(z.chrome&&z.android&&t.composing&&F.empty&&($.start!=$.endB||t.lastAndroidDelete<Date.now()-100)&&(F.head==C||F.head==q.mapping.map(B)-1)||z.ie&&F.empty&&F.head==C)&&q.setSelection(F)}G&&q.ensureMarks(G),t.dispatch(q.scrollIntoView())}function c2(t,e,r){return Math.max(r.anchor,r.head)>e.content.size?null:b1(t,e.resolve(r.anchor),e.resolve(r.head))}function Z_t(t,e){for(var r=t.firstChild.marks,n=e.firstChild.marks,o=r,i=n,a,u,c,s=0;s<n.length;s++)o=n[s].removeFromSet(o);for(var f=0;f<r.length;f++)i=r[f].removeFromSet(i);if(o.length==1&&i.length==0)u=o[0],a="add",c=function(d){return d.mark(u.addToSet(d.marks))};else if(o.length==0&&i.length==1)u=i[0],a="remove",c=function(d){return d.mark(u.removeFromSet(d.marks))};else return null;for(var l=[],p=0;p<e.childCount;p++)l.push(c(e.child(p)));if(D.from(l).eq(t))return{mark:u,type:a}}function Q_t(t,e,r,n,o){if(!n.parent.isTextblock||r-e<=o.pos-n.pos||O1(n,!0,!1)<o.pos)return!1;var i=t.resolve(e);if(i.parentOffset<i.parent.content.size||!i.parent.isTextblock)return!1;var a=t.resolve(O1(i,!0,!0));return!a.parent.isTextblock||a.pos>r||O1(a,!0,!1)<r?!1:n.parent.content.cut(n.parentOffset).eq(a.parent.content)}function O1(t,e,r){for(var n=t.depth,o=e?t.end():t.pos;n>0&&(e||t.indexAfter(n)==t.node(n).childCount);)n--,o++,e=!1;if(r)for(var i=t.node(n).maybeChild(t.indexAfter(n));i&&!i.isLeaf;)i=i.firstChild,o++;return o}function tSt(t,e,r,n,o){var i=t.findDiffStart(e,r);if(i==null)return null;var a=t.findDiffEnd(e,r+t.size,r+e.size),u=a.a,c=a.b;if(o=="end"){var s=Math.max(0,i-Math.min(u,c));n-=u+s-i}if(u<i&&t.size<e.size){var f=n<=i&&n>=u?i-n:0;i-=f,c=i+(c-u),u=i}else if(c<i){var l=n<=i&&n>=c?i-n:0;i-=l,u=i+(u-c),c=i}return{start:i,endA:u,endB:c}}function s2(t,e){for(var r=[],n=e.content,o=e.openStart,i=e.openEnd;o>1&&i>1&&n.childCount==1&&n.firstChild.childCount==1;){o--,i--;var a=n.firstChild;r.push(a.type.name,a.attrs!=a.type.defaultAttrs?a.attrs:null),n=a.content}var u=t.someProp("clipboardSerializer")||Ke.fromSchema(t.state.schema),c=g2(),s=c.createElement("div");s.appendChild(u.serializeFragment(n,{document:c}));for(var f=s.firstChild,l;f&&f.nodeType==1&&(l=v2[f.nodeName.toLowerCase()]);){for(var p=l.length-1;p>=0;p--){for(var d=c.createElement(l[p]);s.firstChild;)d.appendChild(s.firstChild);s.appendChild(d),l[p]!="tbody"&&(o++,i++)}f=s.firstChild}f&&f.nodeType==1&&f.setAttribute("data-pm-slice",o+" "+i+" "+JSON.stringify(r));var h=t.someProp("clipboardTextSerializer",function(m){return m(e)})||e.content.textBetween(0,e.content.size,`
35
+
36
+ `);return{dom:s,text:h}}function f2(t,e,r,n,o){var i,a=o.parent.type.spec.code,u;if(!r&&!e)return null;var c=e&&(n||a||!r);if(c){if(t.someProp("transformPastedText",function(I){e=I(e,a||n)}),a)return e?new Z(D.from(t.state.schema.text(e.replace(/\r\n?/g,`
37
+ `))),0,0):Z.empty;var s=t.someProp("clipboardTextParser",function(I){return I(e,o,n)});if(s)u=s;else{var f=o.marks(),l=t.state,p=l.schema,d=Ke.fromSchema(p);i=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(function(I){var S=i.appendChild(document.createElement("p"));I&&S.appendChild(d.serializeNode(p.text(I,f)))})}}else t.someProp("transformPastedHTML",function(I){r=I(r)}),i=nSt(r),z.webkit&&oSt(i);var h=i&&i.querySelector("[data-pm-slice]"),m=h&&/^(\d+) (\d+) (.*)/.exec(h.getAttribute("data-pm-slice"));if(!u){var g=t.someProp("clipboardParser")||t.someProp("domParser")||no.fromSchema(t.state.schema);u=g.parseSlice(i,{preserveWhitespace:!!(c||m),context:o,ruleFromNode:function(S){if(S.nodeName=="BR"&&!S.nextSibling&&S.parentNode&&!eSt.test(S.parentNode.nodeName))return{ignore:!0}}})}if(m)u=iSt(h2(u,+m[1],+m[2]),m[3]);else if(u=Z.maxOpen(rSt(u.content,o),!0),u.openStart||u.openEnd){for(var b=0,$=0,w=u.content.firstChild;b<u.openStart&&!w.type.spec.isolating;b++,w=w.firstChild);for(var y=u.content.lastChild;$<u.openEnd&&!y.type.spec.isolating;$++,y=y.lastChild);u=h2(u,b,$)}return t.someProp("transformPasted",function(I){u=I(u)}),u}var eSt=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function rSt(t,e){if(t.childCount<2)return t;for(var r=function(i){var a=e.node(i),u=a.contentMatchAt(e.index(i)),c=void 0,s=[];if(t.forEach(function(f){if(!!s){var l=u.findWrapping(f.type),p;if(!l)return s=null;if(p=s.length&&c.length&&p2(l,c,f,s[s.length-1],0))s[s.length-1]=p;else{s.length&&(s[s.length-1]=d2(s[s.length-1],c.length));var d=l2(f,l);s.push(d),u=u.matchType(d.type,d.attrs),c=l}}}),s)return{v:D.from(s)}},n=e.depth;n>=0;n--){var o=r(n);if(o)return o.v}return t}function l2(t,e,r){r===void 0&&(r=0);for(var n=e.length-1;n>=r;n--)t=e[n].create(null,D.from(t));return t}function p2(t,e,r,n,o){if(o<t.length&&o<e.length&&t[o]==e[o]){var i=p2(t,e,r,n.lastChild,o+1);if(i)return n.copy(n.content.replaceChild(n.childCount-1,i));var a=n.contentMatchAt(n.childCount);if(a.matchType(o==t.length-1?r.type:t[o+1]))return n.copy(n.content.append(D.from(l2(r,t,o+1))))}}function d2(t,e){if(e==0)return t;var r=t.content.replaceChild(t.childCount-1,d2(t.lastChild,e-1)),n=t.contentMatchAt(t.childCount).fillBefore(D.empty,!0);return t.copy(r.append(n))}function M1(t,e,r,n,o,i){var a=e<0?t.firstChild:t.lastChild,u=a.content;return o<n-1&&(u=M1(u,e,r,n,o+1,i)),o>=r&&(u=e<0?a.contentMatchAt(0).fillBefore(u,t.childCount>1||i<=o).append(u):u.append(a.contentMatchAt(a.childCount).fillBefore(D.empty,!0))),t.replaceChild(e<0?0:t.childCount-1,a.copy(u))}function h2(t,e,r){return e<t.openStart&&(t=new Z(M1(t.content,-1,e,t.openStart,0,t.openEnd),e,t.openEnd)),r<t.openEnd&&(t=new Z(M1(t.content,1,r,t.openEnd,0,0),t.openStart,r)),t}var v2={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]},m2=null;function g2(){return m2||(m2=document.implementation.createHTMLDocument("title"))}function nSt(t){var e=/^(\s*<meta [^>]*>)*/.exec(t);e&&(t=t.slice(e[0].length));var r=g2().createElement("div"),n=/<([a-z][^>\s]+)/i.exec(t),o;if((o=n&&v2[n[1].toLowerCase()])&&(t=o.map(function(a){return"<"+a+">"}).join("")+t+o.map(function(a){return"</"+a+">"}).reverse().join("")),r.innerHTML=t,o)for(var i=0;i<o.length;i++)r=r.querySelector(o[i])||r;return r}function oSt(t){for(var e=t.querySelectorAll(z.chrome?"span:not([class]):not([style])":"span.Apple-converted-space"),r=0;r<e.length;r++){var n=e[r];n.childNodes.length==1&&n.textContent=="\xA0"&&n.parentNode&&n.parentNode.replaceChild(t.ownerDocument.createTextNode(" "),n)}}function iSt(t,e){if(!t.size)return t;var r=t.content.firstChild.type.schema,n;try{n=JSON.parse(e)}catch{return t}for(var o=t.content,i=t.openStart,a=t.openEnd,u=n.length-2;u>=0;u-=2){var c=r.nodes[n[u]];if(!c||c.hasRequiredAttrs())break;o=D.from(c.create(n[u+1],o)),i++,a++}return new Z(o,i,a)}var aSt={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},R1=z.ie&&z.ie_version<=11,E1=function(){this.anchorNode=this.anchorOffset=this.focusNode=this.focusOffset=null};E1.prototype.set=function(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset},E1.prototype.eq=function(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset};var cn=function(e,r){var n=this;this.view=e,this.handleDOMChange=r,this.queue=[],this.flushingSoon=-1,this.observer=window.MutationObserver&&new window.MutationObserver(function(o){for(var i=0;i<o.length;i++)n.queue.push(o[i]);z.ie&&z.ie_version<=11&&o.some(function(a){return a.type=="childList"&&a.removedNodes.length||a.type=="characterData"&&a.oldValue.length>a.target.nodeValue.length})?n.flushSoon():n.flush()}),this.currentSelection=new E1,R1&&(this.onCharData=function(o){n.queue.push({target:o.target,type:"characterData",oldValue:o.prevValue}),n.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.suppressingSelectionUpdates=!1};cn.prototype.flushSoon=function(){var e=this;this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(function(){e.flushingSoon=-1,e.flush()},20))},cn.prototype.forceFlush=function(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())},cn.prototype.start=function(){this.observer&&this.observer.observe(this.view.dom,aSt),R1&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()},cn.prototype.stop=function(){var e=this;if(this.observer){var r=this.observer.takeRecords();if(r.length){for(var n=0;n<r.length;n++)this.queue.push(r[n]);window.setTimeout(function(){return e.flush()},20)}this.observer.disconnect()}R1&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()},cn.prototype.connectSelection=function(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)},cn.prototype.disconnectSelection=function(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)},cn.prototype.suppressSelectionUpdates=function(){var e=this;this.suppressingSelectionUpdates=!0,setTimeout(function(){return e.suppressingSelectionUpdates=!1},50)},cn.prototype.onSelectionChange=function(){if(!!q_t(this.view)){if(this.suppressingSelectionUpdates)return La(this.view);if(z.ie&&z.ie_version<=11&&!this.view.state.selection.empty){var e=this.view.root.getSelection();if(e.focusNode&&Rd(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}},cn.prototype.setCurSelection=function(){this.currentSelection.set(this.view.root.getSelection())},cn.prototype.ignoreSelectionChange=function(e){if(e.rangeCount==0)return!0;var r=e.getRangeAt(0).commonAncestorContainer,n=this.view.docView.nearestDesc(r);if(n&&n.ignoreMutation({type:"selection",target:r.nodeType==3?r.parentNode:r}))return this.setCurSelection(),!0},cn.prototype.flush=function(){if(!(!this.view.docView||this.flushingSoon>-1)){var e=this.observer?this.observer.takeRecords():[];this.queue.length&&(e=this.queue.concat(e),this.queue.length=0);var r=this.view.root.getSelection(),n=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(r)&&$1(this.view)&&!this.ignoreSelectionChange(r),o=-1,i=-1,a=!1,u=[];if(this.view.editable)for(var c=0;c<e.length;c++){var s=this.registerMutation(e[c],u);s&&(o=o<0?s.from:Math.min(s.from,o),i=i<0?s.to:Math.max(s.to,i),s.typeOver&&(a=!0))}if(z.gecko&&u.length>1){var f=u.filter(function(d){return d.nodeName=="BR"});if(f.length==2){var l=f[0],p=f[1];l.parentNode&&l.parentNode.parentNode==p.parentNode?p.remove():l.remove()}}(o>-1||n)&&(o>-1&&(this.view.docView.markDirty(o,i),uSt(this.view)),this.handleDOMChange(o,i,a,u),this.view.docView.dirty?this.view.updateState(this.view.state):this.currentSelection.eq(r)||La(this.view),this.currentSelection.set(r))}},cn.prototype.registerMutation=function(e,r){if(r.indexOf(e.target)>-1)return null;var n=this.view.docView.nearestDesc(e.target);if(e.type=="attributes"&&(n==this.view.docView||e.attributeName=="contenteditable"||e.attributeName=="style"&&!e.oldValue&&!e.target.getAttribute("style"))||!n||n.ignoreMutation(e))return null;if(e.type=="childList"){for(var o=0;o<e.addedNodes.length;o++)r.push(e.addedNodes[o]);if(n.contentDOM&&n.contentDOM!=n.dom&&!n.contentDOM.contains(e.target))return{from:n.posBefore,to:n.posAfter};var i=e.previousSibling,a=e.nextSibling;if(z.ie&&z.ie_version<=11&&e.addedNodes.length)for(var u=0;u<e.addedNodes.length;u++){var c=e.addedNodes[u],s=c.previousSibling,f=c.nextSibling;(!s||Array.prototype.indexOf.call(e.addedNodes,s)<0)&&(i=s),(!f||Array.prototype.indexOf.call(e.addedNodes,f)<0)&&(a=f)}var l=i&&i.parentNode==e.target?un(i)+1:0,p=n.localPosFromDOM(e.target,l,-1),d=a&&a.parentNode==e.target?un(a):e.target.childNodes.length,h=n.localPosFromDOM(e.target,d,1);return{from:p,to:h}}else return e.type=="attributes"?{from:n.posAtStart-n.border,to:n.posAtEnd+n.border}:{from:n.posAtStart,to:n.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}};var y2=!1;function uSt(t){y2||(y2=!0,getComputedStyle(t.dom).whiteSpace=="normal"&&console.warn("ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package."))}var Lr={},Tr={};function cSt(t){t.shiftKey=!1,t.mouseDown=null,t.lastKeyCode=null,t.lastKeyCodeTime=0,t.lastClick={time:0,x:0,y:0,type:""},t.lastSelectionOrigin=null,t.lastSelectionTime=0,t.lastIOSEnter=0,t.lastIOSEnterFallbackTimeout=null,t.lastAndroidDelete=0,t.composing=!1,t.composingTimeout=null,t.compositionNodes=[],t.compositionEndedAt=-2e8,t.domObserver=new cn(t,function(n,o,i,a){return X_t(t,n,o,i,a)}),t.domObserver.start(),t.domChangeCount=0,t.eventHandlers=Object.create(null);var e=function(n){var o=Lr[n];t.dom.addEventListener(n,t.eventHandlers[n]=function(i){fSt(t,i)&&!A1(t,i)&&(t.editable||!(i.type in Tr))&&o(t,i)})};for(var r in Lr)e(r);z.safari&&t.dom.addEventListener("input",function(){return null}),w1(t)}function mc(t,e){t.lastSelectionOrigin=e,t.lastSelectionTime=Date.now()}function sSt(t){t.domObserver.stop();for(var e in t.eventHandlers)t.dom.removeEventListener(e,t.eventHandlers[e]);clearTimeout(t.composingTimeout),clearTimeout(t.lastIOSEnterFallbackTimeout)}function w1(t){t.someProp("handleDOMEvents",function(e){for(var r in e)t.eventHandlers[r]||t.dom.addEventListener(r,t.eventHandlers[r]=function(n){return A1(t,n)})})}function A1(t,e){return t.someProp("handleDOMEvents",function(r){var n=r[e.type];return n?n(t,e)||e.defaultPrevented:!1})}function fSt(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(var r=e.target;r!=t.dom;r=r.parentNode)if(!r||r.nodeType==11||r.pmViewDesc&&r.pmViewDesc.stopEvent(e))return!1;return!0}function lSt(t,e){!A1(t,e)&&Lr[e.type]&&(t.editable||!(e.type in Tr))&&Lr[e.type](t,e)}Tr.keydown=function(t,e){if(t.shiftKey=e.keyCode==16||e.shiftKey,!$2(t,e)&&(t.lastKeyCode=e.keyCode,t.lastKeyCodeTime=Date.now(),!(z.android&&z.chrome&&e.keyCode==13)))if(e.keyCode!=229&&t.domObserver.forceFlush(),z.ios&&e.keyCode==13&&!e.ctrlKey&&!e.altKey&&!e.metaKey){var r=Date.now();t.lastIOSEnter=r,t.lastIOSEnterFallbackTimeout=setTimeout(function(){t.lastIOSEnter==r&&(t.someProp("handleKeyDown",function(n){return n(t,Ef(13,"Enter"))}),t.lastIOSEnter=0)},200)}else t.someProp("handleKeyDown",function(n){return n(t,e)})||J_t(t,e)?e.preventDefault():mc(t,"key")},Tr.keyup=function(t,e){e.keyCode==16&&(t.shiftKey=!1)},Tr.keypress=function(t,e){if(!($2(t,e)||!e.charCode||e.ctrlKey&&!e.altKey||z.mac&&e.metaKey)){if(t.someProp("handleKeyPress",function(o){return o(t,e)})){e.preventDefault();return}var r=t.state.selection;if(!(r instanceof wt)||!r.$from.sameParent(r.$to)){var n=String.fromCharCode(e.charCode);t.someProp("handleTextInput",function(o){return o(t,r.$from.pos,r.$to.pos,n)})||t.dispatch(t.state.tr.insertText(n).scrollIntoView()),e.preventDefault()}}};function Jg(t){return{left:t.clientX,top:t.clientY}}function pSt(t,e){var r=e.x-t.clientX,n=e.y-t.clientY;return r*r+n*n<100}function C1(t,e,r,n,o){if(n==-1)return!1;for(var i=t.state.doc.resolve(n),a=function(s){if(t.someProp(e,function(f){return s>i.depth?f(t,r,i.nodeAfter,i.before(s),o,!0):f(t,r,i.node(s),i.before(s),o,!1)}))return{v:!0}},u=i.depth+1;u>0;u--){var c=a(u);if(c)return c.v}return!1}function Af(t,e,r){t.focused||t.focus();var n=t.state.tr.setSelection(e);r=="pointer"&&n.setMeta("pointer",!0),t.dispatch(n)}function dSt(t,e){if(e==-1)return!1;var r=t.state.doc.resolve(e),n=r.nodeAfter;return n&&n.isAtom&&dt.isSelectable(n)?(Af(t,new dt(r),"pointer"),!0):!1}function hSt(t,e){if(e==-1)return!1;var r=t.state.selection,n,o;r instanceof dt&&(n=r.node);for(var i=t.state.doc.resolve(e),a=i.depth+1;a>0;a--){var u=a>i.depth?i.nodeAfter:i.node(a);if(dt.isSelectable(u)){n&&r.$from.depth>0&&a>=r.$from.depth&&i.before(r.$from.depth+1)==r.$from.pos?o=i.before(r.$from.depth):o=i.before(a);break}}return o!=null?(Af(t,dt.create(t.state.doc,o),"pointer"),!0):!1}function vSt(t,e,r,n,o){return C1(t,"handleClickOn",e,r,n)||t.someProp("handleClick",function(i){return i(t,e,n)})||(o?hSt(t,r):dSt(t,r))}function mSt(t,e,r,n){return C1(t,"handleDoubleClickOn",e,r,n)||t.someProp("handleDoubleClick",function(o){return o(t,e,n)})}function gSt(t,e,r,n){return C1(t,"handleTripleClickOn",e,r,n)||t.someProp("handleTripleClick",function(o){return o(t,e,n)})||ySt(t,r,n)}function ySt(t,e,r){if(r.button!=0)return!1;var n=t.state.doc;if(e==-1)return n.inlineContent?(Af(t,wt.create(n,0,n.content.size),"pointer"),!0):!1;for(var o=n.resolve(e),i=o.depth+1;i>0;i--){var a=i>o.depth?o.nodeAfter:o.node(i),u=o.before(i);if(a.inlineContent)Af(t,wt.create(n,u+1,u+1+a.content.size),"pointer");else if(dt.isSelectable(a))Af(t,dt.create(n,u),"pointer");else continue;return!0}}function x1(t){return Yg(t)}var b2=z.mac?"metaKey":"ctrlKey";Lr.mousedown=function(t,e){t.shiftKey=e.shiftKey;var r=x1(t),n=Date.now(),o="singleClick";n-t.lastClick.time<500&&pSt(e,t.lastClick)&&!e[b2]&&(t.lastClick.type=="singleClick"?o="doubleClick":t.lastClick.type=="doubleClick"&&(o="tripleClick")),t.lastClick={time:n,x:e.clientX,y:e.clientY,type:o};var i=t.posAtCoords(Jg(e));!i||(o=="singleClick"?(t.mouseDown&&t.mouseDown.done(),t.mouseDown=new Gg(t,i,e,r)):(o=="doubleClick"?mSt:gSt)(t,i.pos,i.inside,e)?e.preventDefault():mc(t,"pointer"))};var Gg=function(e,r,n,o){var i=this;this.view=e,this.startDoc=e.state.doc,this.pos=r,this.event=n,this.flushed=o,this.selectNode=n[b2],this.allowDefault=n.shiftKey,this.delayedSelectionSync=!1;var a,u;if(r.inside>-1)a=e.state.doc.nodeAt(r.inside),u=r.inside;else{var c=e.state.doc.resolve(r.pos);a=c.parent,u=c.depth?c.before():0}this.mightDrag=null;var s=o?null:n.target,f=s?e.docView.nearestDesc(s,!0):null;this.target=f?f.dom:null;var l=e.state,p=l.selection;(n.button==0&&a.type.spec.draggable&&a.type.spec.selectable!==!1||p instanceof dt&&p.from<=u&&p.to>u)&&(this.mightDrag={node:a,pos:u,addAttr:this.target&&!this.target.draggable,setUneditable:this.target&&z.gecko&&!this.target.hasAttribute("contentEditable")}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(function(){i.view.mouseDown==i&&i.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),e.root.addEventListener("mouseup",this.up=this.up.bind(this)),e.root.addEventListener("mousemove",this.move=this.move.bind(this)),mc(e,"pointer")};Gg.prototype.done=function(){var e=this;this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(function(){return La(e.view)}),this.view.mouseDown=null},Gg.prototype.up=function(e){if(this.done(),!!this.view.dom.contains(e.target.nodeType==3?e.target.parentNode:e.target)){var r=this.pos;this.view.state.doc!=this.startDoc&&(r=this.view.posAtCoords(Jg(e))),this.allowDefault||!r?mc(this.view,"pointer"):vSt(this.view,r.pos,r.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||z.safari&&this.mightDrag&&!this.mightDrag.node.isAtom||z.chrome&&!(this.view.state.selection instanceof wt)&&Math.min(Math.abs(r.pos-this.view.state.selection.from),Math.abs(r.pos-this.view.state.selection.to))<=2)?(Af(this.view,gt.near(this.view.state.doc.resolve(r.pos)),"pointer"),e.preventDefault()):mc(this.view,"pointer")}},Gg.prototype.move=function(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0),mc(this.view,"pointer"),e.buttons==0&&this.done()},Lr.touchdown=function(t){x1(t),mc(t,"pointer")},Lr.contextmenu=function(t){return x1(t)};function $2(t,e){return t.composing?!0:z.safari&&Math.abs(e.timeStamp-t.compositionEndedAt)<500?(t.compositionEndedAt=-2e8,!0):!1}var bSt=z.android?5e3:-1;Tr.compositionstart=Tr.compositionupdate=function(t){if(!t.composing){t.domObserver.flush();var e=t.state,r=e.selection.$from;if(e.selection.empty&&(e.storedMarks||!r.textOffset&&r.parentOffset&&r.nodeBefore.marks.some(function(u){return u.type.spec.inclusive===!1})))t.markCursor=t.state.storedMarks||r.marks(),Yg(t,!0),t.markCursor=null;else if(Yg(t),z.gecko&&e.selection.empty&&r.parentOffset&&!r.textOffset&&r.nodeBefore.marks.length)for(var n=t.root.getSelection(),o=n.focusNode,i=n.focusOffset;o&&o.nodeType==1&&i!=0;){var a=i<0?o.lastChild:o.childNodes[i-1];if(!a)break;if(a.nodeType==3){n.collapse(a,a.nodeValue.length);break}else o=a,i=-1}t.composing=!0}_2(t,bSt)},Tr.compositionend=function(t,e){t.composing&&(t.composing=!1,t.compositionEndedAt=e.timeStamp,_2(t,20))};function _2(t,e){clearTimeout(t.composingTimeout),e>-1&&(t.composingTimeout=setTimeout(function(){return Yg(t)},e))}function S2(t){for(t.composing&&(t.composing=!1,t.compositionEndedAt=$St());t.compositionNodes.length>0;)t.compositionNodes.pop().markParentsDirty()}function $St(){var t=document.createEvent("Event");return t.initEvent("event",!0,!0),t.timeStamp}function Yg(t,e){if(!(z.android&&t.domObserver.flushingSoon>=0)){if(t.domObserver.forceFlush(),S2(t),e||t.docView.dirty){var r=Yq(t);return r&&!r.eq(t.state.selection)?t.dispatch(t.state.tr.setSelection(r)):t.updateState(t.state),!0}return!1}}function _St(t,e){if(!!t.dom.parentNode){var r=t.dom.parentNode.appendChild(document.createElement("div"));r.appendChild(e),r.style.cssText="position: fixed; left: -10000px; top: 10px";var n=getSelection(),o=document.createRange();o.selectNodeContents(e),t.dom.blur(),n.removeAllRanges(),n.addRange(o),setTimeout(function(){r.parentNode&&r.parentNode.removeChild(r),t.focus()},50)}}var Cf=z.ie&&z.ie_version<15||z.ios&&z.webkit_version<604;Lr.copy=Tr.cut=function(t,e){var r=t.state.selection,n=e.type=="cut";if(!r.empty){var o=Cf?null:e.clipboardData,i=r.content(),a=s2(t,i),u=a.dom,c=a.text;o?(e.preventDefault(),o.clearData(),o.setData("text/html",u.innerHTML),o.setData("text/plain",c)):_St(t,u),n&&t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))}};function SSt(t){return t.openStart==0&&t.openEnd==0&&t.content.childCount==1?t.content.firstChild:null}function TSt(t,e){if(!!t.dom.parentNode){var r=t.shiftKey||t.state.selection.$from.parent.type.spec.code,n=t.dom.parentNode.appendChild(document.createElement(r?"textarea":"div"));r||(n.contentEditable="true"),n.style.cssText="position: fixed; left: -10000px; top: 10px",n.focus(),setTimeout(function(){t.focus(),n.parentNode&&n.parentNode.removeChild(n),r?k1(t,n.value,null,e):k1(t,n.textContent,n.innerHTML,e)},50)}}function k1(t,e,r,n){var o=f2(t,e,r,t.shiftKey,t.state.selection.$from);if(t.someProp("handlePaste",function(u){return u(t,n,o||Z.empty)}))return!0;if(!o)return!1;var i=SSt(o),a=i?t.state.tr.replaceSelectionWith(i,t.shiftKey):t.state.tr.replaceSelection(o);return t.dispatch(a.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}Tr.paste=function(t,e){if(!(t.composing&&!z.android)){var r=Cf?null:e.clipboardData;r&&k1(t,r.getData("text/plain"),r.getData("text/html"),e)?e.preventDefault():TSt(t,e)}};var ISt=function(e,r){this.slice=e,this.move=r},T2=z.mac?"altKey":"ctrlKey";Lr.dragstart=function(t,e){var r=t.mouseDown;if(r&&r.done(),!!e.dataTransfer){var n=t.state.selection,o=n.empty?null:t.posAtCoords(Jg(e));if(!(o&&o.pos>=n.from&&o.pos<=(n instanceof dt?n.to-1:n.to))){if(r&&r.mightDrag)t.dispatch(t.state.tr.setSelection(dt.create(t.state.doc,r.mightDrag.pos)));else if(e.target&&e.target.nodeType==1){var i=t.docView.nearestDesc(e.target,!0);i&&i.node.type.spec.draggable&&i!=t.docView&&t.dispatch(t.state.tr.setSelection(dt.create(t.state.doc,i.posBefore)))}}var a=t.state.selection.content(),u=s2(t,a),c=u.dom,s=u.text;e.dataTransfer.clearData(),e.dataTransfer.setData(Cf?"Text":"text/html",c.innerHTML),e.dataTransfer.effectAllowed="copyMove",Cf||e.dataTransfer.setData("text/plain",s),t.dragging=new ISt(a,!e[T2])}},Lr.dragend=function(t){var e=t.dragging;window.setTimeout(function(){t.dragging==e&&(t.dragging=null)},50)},Tr.dragover=Tr.dragenter=function(t,e){return e.preventDefault()},Tr.drop=function(t,e){var r=t.dragging;if(t.dragging=null,!!e.dataTransfer){var n=t.posAtCoords(Jg(e));if(!!n){var o=t.state.doc.resolve(n.pos);if(!!o){var i=r&&r.slice;i?t.someProp("transformPasted",function(h){i=h(i)}):i=f2(t,e.dataTransfer.getData(Cf?"Text":"text/plain"),Cf?null:e.dataTransfer.getData("text/html"),!1,o);var a=r&&!e[T2];if(t.someProp("handleDrop",function(h){return h(t,e,i||Z.empty,a)})){e.preventDefault();return}if(!!i){e.preventDefault();var u=i?Y$t(t.state.doc,o.pos,i):o.pos;u==null&&(u=o.pos);var c=t.state.tr;a&&c.deleteSelection();var s=c.mapping.map(u),f=i.openStart==0&&i.openEnd==0&&i.content.childCount==1,l=c.doc;if(f?c.replaceRangeWith(s,s,i.content.firstChild):c.replaceRange(s,s,i),!c.doc.eq(l)){var p=c.doc.resolve(s);if(f&&dt.isSelectable(i.content.firstChild)&&p.nodeAfter&&p.nodeAfter.sameMarkup(i.content.firstChild))c.setSelection(new dt(p));else{var d=c.mapping.map(u);c.mapping.maps[c.mapping.maps.length-1].forEach(function(h,m,g,b){return d=b}),c.setSelection(b1(t,p,c.doc.resolve(d)))}t.focus(),t.dispatch(c.setMeta("uiEvent","drop"))}}}}}},Lr.focus=function(t){t.focused||(t.domObserver.stop(),t.dom.classList.add("ProseMirror-focused"),t.domObserver.start(),t.focused=!0,setTimeout(function(){t.docView&&t.hasFocus()&&!t.domObserver.currentSelection.eq(t.root.getSelection())&&La(t)},20))},Lr.blur=function(t,e){t.focused&&(t.domObserver.stop(),t.dom.classList.remove("ProseMirror-focused"),t.domObserver.start(),e.relatedTarget&&t.dom.contains(e.relatedTarget)&&t.domObserver.currentSelection.set({}),t.focused=!1)},Lr.beforeinput=function(t,e){if(z.chrome&&z.android&&e.inputType=="deleteContentBackward"){t.domObserver.flushSoon();var r=t.domChangeCount;setTimeout(function(){if(t.domChangeCount==r&&(t.dom.blur(),t.focus(),!t.someProp("handleKeyDown",function(i){return i(t,Ef(8,"Backspace"))}))){var n=t.state.selection,o=n.$cursor;o&&o.pos>0&&t.dispatch(t.state.tr.delete(o.pos-1,o.pos).scrollIntoView())}},50)}};for(var I2 in Tr)Lr[I2]=Tr[I2];function kd(t,e){if(t==e)return!0;for(var r in t)if(t[r]!==e[r])return!1;for(var n in e)if(!(n in t))return!1;return!0}var xf=function(e,r){this.spec=r||gc,this.side=this.spec.side||0,this.toDOM=e};xf.prototype.map=function(e,r,n,o){var i=e.mapResult(r.from+o,this.side<0?-1:1),a=i.pos,u=i.deleted;return u?null:new Ie(a-n,a-n,this)},xf.prototype.valid=function(){return!0},xf.prototype.eq=function(e){return this==e||e instanceof xf&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&kd(this.spec,e.spec))},xf.prototype.destroy=function(e){this.spec.destroy&&this.spec.destroy(e)};var ao=function(e,r){this.spec=r||gc,this.attrs=e};ao.prototype.map=function(e,r,n,o){var i=e.map(r.from+o,this.spec.inclusiveStart?-1:1)-n,a=e.map(r.to+o,this.spec.inclusiveEnd?1:-1)-n;return i>=a?null:new Ie(i,a,this)},ao.prototype.valid=function(e,r){return r.from<r.to},ao.prototype.eq=function(e){return this==e||e instanceof ao&&kd(this.attrs,e.attrs)&&kd(this.spec,e.spec)},ao.is=function(e){return e.type instanceof ao};var Wd=function(e,r){this.spec=r||gc,this.attrs=e};Wd.prototype.map=function(e,r,n,o){var i=e.mapResult(r.from+o,1);if(i.deleted)return null;var a=e.mapResult(r.to+o,-1);return a.deleted||a.pos<=i.pos?null:new Ie(i.pos-n,a.pos-n,this)},Wd.prototype.valid=function(e,r){var n=e.content.findIndex(r.from),o=n.index,i=n.offset,a;return i==r.from&&!(a=e.child(o)).isText&&i+a.nodeSize==r.to},Wd.prototype.eq=function(e){return this==e||e instanceof Wd&&kd(this.attrs,e.attrs)&&kd(this.spec,e.spec)};var Ie=function(e,r,n){this.from=e,this.to=r,this.type=n},W1={spec:{configurable:!0},inline:{configurable:!0}};Ie.prototype.copy=function(e,r){return new Ie(e,r,this.type)},Ie.prototype.eq=function(e,r){return r===void 0&&(r=0),this.type.eq(e.type)&&this.from+r==e.from&&this.to+r==e.to},Ie.prototype.map=function(e,r,n){return this.type.map(e,this,r,n)},Ie.widget=function(e,r,n){return new Ie(e,e,new xf(r,n))},Ie.inline=function(e,r,n,o){return new Ie(e,r,new ao(n,o))},Ie.node=function(e,r,n,o){return new Ie(e,r,new Wd(n,o))},W1.spec.get=function(){return this.type.spec},W1.inline.get=function(){return this.type instanceof ao},Object.defineProperties(Ie.prototype,W1);var Xg=[],gc={},Nt=function(e,r){this.local=e&&e.length?e:Xg,this.children=r&&r.length?r:Xg};Nt.create=function(e,r){return r.length?Zg(r,e,0,gc):He},Nt.prototype.find=function(e,r,n){var o=[];return this.findInner(e==null?0:e,r==null?1e9:r,o,0,n),o},Nt.prototype.findInner=function(e,r,n,o,i){for(var a=0;a<this.local.length;a++){var u=this.local[a];u.from<=r&&u.to>=e&&(!i||i(u.spec))&&n.push(u.copy(u.from+o,u.to+o))}for(var c=0;c<this.children.length;c+=3)if(this.children[c]<r&&this.children[c+1]>e){var s=this.children[c]+1;this.children[c+2].findInner(e-s,r-s,n,o+s,i)}},Nt.prototype.map=function(e,r,n){return this==He||e.maps.length==0?this:this.mapInner(e,r,0,0,n||gc)},Nt.prototype.mapInner=function(e,r,n,o,i){for(var a,u=0;u<this.local.length;u++){var c=this.local[u].map(e,n,o);c&&c.type.valid(r,c)?(a||(a=[])).push(c):i.onRemove&&i.onRemove(this.local[u].spec)}return this.children.length?OSt(this.children,a,e,r,n,o,i):a?new Nt(a.sort(yc)):He},Nt.prototype.add=function(e,r){return r.length?this==He?Nt.create(e,r):this.addInner(e,r,0):this},Nt.prototype.addInner=function(e,r,n){var o=this,i,a=0;e.forEach(function(s,f){var l=f+n,p;if(!!(p=M2(r,s,l))){for(i||(i=o.children.slice());a<i.length&&i[a]<f;)a+=3;i[a]==f?i[a+2]=i[a+2].addInner(s,p,l+1):i.splice(a,0,f,f+s.nodeSize,Zg(p,s,l+1,gc)),a+=3}});for(var u=O2(a?R2(r):r,-n),c=0;c<u.length;c++)u[c].type.valid(e,u[c])||u.splice(c--,1);return new Nt(u.length?this.local.concat(u).sort(yc):this.local,i||this.children)},Nt.prototype.remove=function(e){return e.length==0||this==He?this:this.removeInner(e,0)},Nt.prototype.removeInner=function(e,r){for(var n=this.children,o=this.local,i=0;i<n.length;i+=3){for(var a=void 0,u=n[i]+r,c=n[i+1]+r,s=0,f=void 0;s<e.length;s++)(f=e[s])&&f.from>u&&f.to<c&&(e[s]=null,(a||(a=[])).push(f));if(!!a){n==this.children&&(n=this.children.slice());var l=n[i+2].removeInner(a,u+1);l!=He?n[i+2]=l:(n.splice(i,3),i-=3)}}if(o.length){for(var p=0,d=void 0;p<e.length;p++)if(d=e[p])for(var h=0;h<o.length;h++)o[h].eq(d,r)&&(o==this.local&&(o=this.local.slice()),o.splice(h--,1))}return n==this.children&&o==this.local?this:o.length||n.length?new Nt(o,n):He},Nt.prototype.forChild=function(e,r){if(this==He)return this;if(r.isLeaf)return Nt.empty;for(var n,o,i=0;i<this.children.length;i+=3)if(this.children[i]>=e){this.children[i]==e&&(n=this.children[i+2]);break}for(var a=e+1,u=a+r.content.size,c=0;c<this.local.length;c++){var s=this.local[c];if(s.from<u&&s.to>a&&s.type instanceof ao){var f=Math.max(a,s.from)-a,l=Math.min(u,s.to)-a;f<l&&(o||(o=[])).push(s.copy(f,l))}}if(o){var p=new Nt(o.sort(yc));return n?new En([p,n]):p}return n||He},Nt.prototype.eq=function(e){if(this==e)return!0;if(!(e instanceof Nt)||this.local.length!=e.local.length||this.children.length!=e.children.length)return!1;for(var r=0;r<this.local.length;r++)if(!this.local[r].eq(e.local[r]))return!1;for(var n=0;n<this.children.length;n+=3)if(this.children[n]!=e.children[n]||this.children[n+1]!=e.children[n+1]||!this.children[n+2].eq(e.children[n+2]))return!1;return!0},Nt.prototype.locals=function(e){return F1(this.localsInner(e))},Nt.prototype.localsInner=function(e){if(this==He)return Xg;if(e.inlineContent||!this.local.some(ao.is))return this.local;for(var r=[],n=0;n<this.local.length;n++)this.local[n].type instanceof ao||r.push(this.local[n]);return r};var He=new Nt;Nt.empty=He,Nt.removeOverlap=F1;var En=function(e){this.members=e};En.prototype.map=function(e,r){var n=this.members.map(function(o){return o.map(e,r,gc)});return En.from(n)},En.prototype.forChild=function(e,r){if(r.isLeaf)return Nt.empty;for(var n=[],o=0;o<this.members.length;o++){var i=this.members[o].forChild(e,r);i!=He&&(i instanceof En?n=n.concat(i.members):n.push(i))}return En.from(n)},En.prototype.eq=function(e){if(!(e instanceof En)||e.members.length!=this.members.length)return!1;for(var r=0;r<this.members.length;r++)if(!this.members[r].eq(e.members[r]))return!1;return!0},En.prototype.locals=function(e){for(var r,n=!0,o=0;o<this.members.length;o++){var i=this.members[o].localsInner(e);if(!!i.length)if(!r)r=i;else{n&&(r=r.slice(),n=!1);for(var a=0;a<i.length;a++)r.push(i[a])}}return r?F1(n?r:r.sort(yc)):Xg},En.from=function(e){switch(e.length){case 0:return He;case 1:return e[0];default:return new En(e)}};function OSt(t,e,r,n,o,i,a){for(var u=t.slice(),c=function(G,O,R,x){for(var F=0;F<u.length;F+=3){var L=u[F+1],U=void 0;L==-1||G>L+i||(O>=u[F]+i?u[F+1]=-1:R>=o&&(U=x-R-(O-G))&&(u[F]+=U,u[F+1]+=U))}},s=0;s<r.maps.length;s++)r.maps[s].forEach(c);for(var f=!1,l=0;l<u.length;l+=3)if(u[l+1]==-1){var p=r.map(t[l]+i),d=p-o;if(d<0||d>=n.content.size){f=!0;continue}var h=r.map(t[l+1]+i,-1),m=h-o,g=n.content.findIndex(d),b=g.index,$=g.offset,w=n.maybeChild(b);if(w&&$==d&&$+w.nodeSize==m){var y=u[l+2].mapInner(r,w,p+1,t[l]+i+1,a);y!=He?(u[l]=d,u[l+1]=m,u[l+2]=y):(u[l+1]=-2,f=!0)}else f=!0}if(f){var I=MSt(u,t,e||[],r,o,i,a),S=Zg(I,n,0,a);e=S.local;for(var k=0;k<u.length;k+=3)u[k+1]<0&&(u.splice(k,3),k-=3);for(var C=0,B=0;C<S.children.length;C+=3){for(var q=S.children[C];B<u.length&&u[B]<q;)B+=3;u.splice(B,0,S.children[C],S.children[C+1],S.children[C+2])}}return new Nt(e&&e.sort(yc),u)}function O2(t,e){if(!e||!t.length)return t;for(var r=[],n=0;n<t.length;n++){var o=t[n];r.push(new Ie(o.from+e,o.to+e,o.type))}return r}function MSt(t,e,r,n,o,i,a){function u(s,f){for(var l=0;l<s.local.length;l++){var p=s.local[l].map(n,o,f);p?r.push(p):a.onRemove&&a.onRemove(s.local[l].spec)}for(var d=0;d<s.children.length;d+=3)u(s.children[d+2],s.children[d]+f+1)}for(var c=0;c<t.length;c+=3)t[c+1]==-1&&u(t[c+2],e[c]+i+1);return r}function M2(t,e,r){if(e.isLeaf)return null;for(var n=r+e.nodeSize,o=null,i=0,a=void 0;i<t.length;i++)(a=t[i])&&a.from>r&&a.to<n&&((o||(o=[])).push(a),t[i]=null);return o}function R2(t){for(var e=[],r=0;r<t.length;r++)t[r]!=null&&e.push(t[r]);return e}function Zg(t,e,r,n){var o=[],i=!1;e.forEach(function(c,s){var f=M2(t,c,s+r);if(f){i=!0;var l=Zg(f,c,r+s+1,n);l!=He&&o.push(s,s+c.nodeSize,l)}});for(var a=O2(i?R2(t):t,-r).sort(yc),u=0;u<a.length;u++)a[u].type.valid(e,a[u])||(n.onRemove&&n.onRemove(a[u].spec),a.splice(u--,1));return a.length||o.length?new Nt(a,o):He}function yc(t,e){return t.from-e.from||t.to-e.to}function F1(t){for(var e=t,r=0;r<e.length-1;r++){var n=e[r];if(n.from!=n.to)for(var o=r+1;o<e.length;o++){var i=e[o];if(i.from==n.from){i.to!=n.to&&(e==t&&(e=t.slice()),e[o]=i.copy(i.from,n.to),E2(e,o+1,i.copy(n.to,i.to)));continue}else{i.from<n.to&&(e==t&&(e=t.slice()),e[r]=n.copy(n.from,i.from),E2(e,o,n.copy(i.from,n.to)));break}}}return e}function E2(t,e,r){for(;e<t.length&&yc(r,t[e])>0;)e++;t.splice(e,0,r)}function N1(t){var e=[];return t.someProp("decorations",function(r){var n=r(t.state);n&&n!=He&&e.push(n)}),t.cursorWrapper&&e.push(Nt.create(t.state.doc,[t.cursorWrapper.deco])),En.from(e)}var be=function(e,r){this._props=r,this.state=r.state,this.directPlugins=r.plugins||[],this.directPlugins.forEach(k2),this.dispatch=this.dispatch.bind(this),this._root=null,this.focused=!1,this.trackWrites=null,this.dom=e&&e.mount||document.createElement("div"),e&&(e.appendChild?e.appendChild(this.dom):e.apply?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=C2(this),this.markCursor=null,this.cursorWrapper=null,A2(this),this.nodeViews=x2(this),this.docView=zq(this.state.doc,w2(this),N1(this),this.dom,this),this.lastSelectedViewDesc=null,this.dragging=null,cSt(this),this.prevDirectPlugins=[],this.pluginViews=[],this.updatePluginViews()},Qg={props:{configurable:!0},root:{configurable:!0},isDestroyed:{configurable:!0}};Qg.props.get=function(){if(this._props.state!=this.state){var t=this._props;this._props={};for(var e in t)this._props[e]=t[e];this._props.state=this.state}return this._props},be.prototype.update=function(e){e.handleDOMEvents!=this._props.handleDOMEvents&&w1(this),this._props=e,e.plugins&&(e.plugins.forEach(k2),this.directPlugins=e.plugins),this.updateStateInner(e.state,!0)},be.prototype.setProps=function(e){var r={};for(var n in this._props)r[n]=this._props[n];r.state=this.state;for(var o in e)r[o]=e[o];this.update(r)},be.prototype.updateState=function(e){this.updateStateInner(e,this.state.plugins!=e.plugins)},be.prototype.updateStateInner=function(e,r){var n=this,o=this.state,i=!1,a=!1;if(e.storedMarks&&this.composing&&(S2(this),a=!0),this.state=e,r){var u=x2(this);ESt(u,this.nodeViews)&&(this.nodeViews=u,i=!0),w1(this)}this.editable=C2(this),A2(this);var c=N1(this),s=w2(this),f=r?"reset":e.scrollToSelection>o.scrollToSelection?"to selection":"preserve",l=i||!this.docView.matchesNode(e.doc,s,c);(l||!e.selection.eq(o.selection))&&(a=!0);var p=f=="preserve"&&a&&this.dom.style.overflowAnchor==null&&$_t(this);if(a){this.domObserver.stop();var d=l&&(z.ie||z.chrome)&&!this.composing&&!o.selection.empty&&!e.selection.empty&&RSt(o.selection,e.selection);if(l){var h=z.chrome?this.trackWrites=this.root.getSelection().focusNode:null;(i||!this.docView.update(e.doc,s,c,this))&&(this.docView.updateOuterDeco([]),this.docView.destroy(),this.docView=zq(e.doc,s,c,this.dom,this)),h&&!this.trackWrites&&(d=!0)}d||!(this.mouseDown&&this.domObserver.currentSelection.eq(this.root.getSelection())&&K_t(this))?La(this,d):(e2(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}if(this.updatePluginViews(o),f=="reset")this.dom.scrollTop=0;else if(f=="to selection"){var m=this.root.getSelection().focusNode;this.someProp("handleScrollToSelection",function(g){return g(n)})||(e.selection instanceof dt?Cq(this,this.docView.domAfterPos(e.selection.from).getBoundingClientRect(),m):Cq(this,this.coordsAtPos(e.selection.head,1),m))}else p&&__t(p)},be.prototype.destroyPluginViews=function(){for(var e;e=this.pluginViews.pop();)e.destroy&&e.destroy()},be.prototype.updatePluginViews=function(e){if(!e||e.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(var r=0;r<this.directPlugins.length;r++){var n=this.directPlugins[r];n.spec.view&&this.pluginViews.push(n.spec.view(this))}for(var o=0;o<this.state.plugins.length;o++){var i=this.state.plugins[o];i.spec.view&&this.pluginViews.push(i.spec.view(this))}}else for(var a=0;a<this.pluginViews.length;a++){var u=this.pluginViews[a];u.update&&u.update(this,e)}},be.prototype.someProp=function(e,r){var n=this._props&&this._props[e],o;if(n!=null&&(o=r?r(n):n))return o;for(var i=0;i<this.directPlugins.length;i++){var a=this.directPlugins[i].props[e];if(a!=null&&(o=r?r(a):a))return o}var u=this.state.plugins;if(u)for(var c=0;c<u.length;c++){var s=u[c].props[e];if(s!=null&&(o=r?r(s):s))return o}},be.prototype.hasFocus=function(){return this.root.activeElement==this.dom},be.prototype.focus=function(){this.domObserver.stop(),this.editable&&S_t(this.dom),La(this),this.domObserver.start()},Qg.root.get=function(){var t=this._root;if(t==null){for(var e=this.dom.parentNode;e;e=e.parentNode)if(e.nodeType==9||e.nodeType==11&&e.host)return e.getSelection||(Object.getPrototypeOf(e).getSelection=function(){return document.getSelection()}),this._root=e}return t||document},be.prototype.posAtCoords=function(e){return R_t(this,e)},be.prototype.coordsAtPos=function(e,r){return r===void 0&&(r=1),Nq(this,e,r)},be.prototype.domAtPos=function(e,r){return r===void 0&&(r=0),this.docView.domFromPos(e,r)},be.prototype.nodeDOM=function(e){var r=this.docView.descAt(e);return r?r.nodeDOM:null},be.prototype.posAtDOM=function(e,r,n){n===void 0&&(n=-1);var o=this.docView.posFromDOM(e,r,n);if(o==null)throw new RangeError("DOM position not inside the editor");return o},be.prototype.endOfTextblock=function(e,r){return x_t(this,r||this.state,e)},be.prototype.destroy=function(){!this.docView||(sSt(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],N1(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null)},Qg.isDestroyed.get=function(){return this.docView==null},be.prototype.dispatchEvent=function(e){return lSt(this,e)},be.prototype.dispatch=function(e){var r=this._props.dispatchTransaction;r?r.call(this,e):this.updateState(this.state.apply(e))},Object.defineProperties(be.prototype,Qg);function w2(t){var e=Object.create(null);return e.class="ProseMirror",e.contenteditable=String(t.editable),e.translate="no",t.someProp("attributes",function(r){if(typeof r=="function"&&(r=r(t.state)),r)for(var n in r)n=="class"&&(e.class+=" "+r[n]),n=="style"?e.style=(e.style?e.style+";":"")+r[n]:!e[n]&&n!="contenteditable"&&n!="nodeName"&&(e[n]=String(r[n]))}),[Ie.node(0,t.state.doc.content.size,e)]}function A2(t){if(t.markCursor){var e=document.createElement("img");e.className="ProseMirror-separator",e.setAttribute("mark-placeholder","true"),t.cursorWrapper={dom:e,deco:Ie.widget(t.state.selection.head,e,{raw:!0,marks:t.markCursor})}}else t.cursorWrapper=null}function C2(t){return!t.someProp("editable",function(e){return e(t.state)===!1})}function RSt(t,e){var r=Math.min(t.$anchor.sharedDepth(t.head),e.$anchor.sharedDepth(e.head));return t.$anchor.start(r)!=e.$anchor.start(r)}function x2(t){var e={};return t.someProp("nodeViews",function(r){for(var n in r)Object.prototype.hasOwnProperty.call(e,n)||(e[n]=r[n])}),e}function ESt(t,e){var r=0,n=0;for(var o in t){if(t[o]!=e[o])return!0;r++}for(var i in e)n++;return r!=n}function k2(t){if(t.spec.state||t.spec.filterTransaction||t.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}for(var Ua={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",229:"q"},ty={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"',229:"Q"},W2=typeof navigator!="undefined"&&/Chrome\/(\d+)/.exec(navigator.userAgent),wSt=typeof navigator!="undefined"&&/Apple Computer/.test(navigator.vendor),ASt=typeof navigator!="undefined"&&/Gecko\/\d+/.test(navigator.userAgent),F2=typeof navigator!="undefined"&&/Mac/.test(navigator.platform),CSt=typeof navigator!="undefined"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),xSt=W2&&(F2||+W2[1]<57)||ASt&&F2,Je=0;Je<10;Je++)Ua[48+Je]=Ua[96+Je]=String(Je);for(var Je=1;Je<=24;Je++)Ua[Je+111]="F"+Je;for(var Je=65;Je<=90;Je++)Ua[Je]=String.fromCharCode(Je+32),ty[Je]=String.fromCharCode(Je);for(var P1 in Ua)ty.hasOwnProperty(P1)||(ty[P1]=Ua[P1]);function kSt(t){var e=xSt&&(t.ctrlKey||t.altKey||t.metaKey)||(wSt||CSt)&&t.shiftKey&&t.key&&t.key.length==1,r=!e&&t.key||(t.shiftKey?ty:Ua)[t.keyCode]||t.key||"Unidentified";return r=="Esc"&&(r="Escape"),r=="Del"&&(r="Delete"),r=="Left"&&(r="ArrowLeft"),r=="Up"&&(r="ArrowUp"),r=="Right"&&(r="ArrowRight"),r=="Down"&&(r="ArrowDown"),r}var WSt=typeof navigator!="undefined"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!1;function FSt(t){var e=t.split(/-(?!$)/),r=e[e.length-1];r=="Space"&&(r=" ");for(var n,o,i,a,u=0;u<e.length-1;u++){var c=e[u];if(/^(cmd|meta|m)$/i.test(c))a=!0;else if(/^a(lt)?$/i.test(c))n=!0;else if(/^(c|ctrl|control)$/i.test(c))o=!0;else if(/^s(hift)?$/i.test(c))i=!0;else if(/^mod$/i.test(c))WSt?a=!0:o=!0;else throw new Error("Unrecognized modifier name: "+c)}return n&&(r="Alt-"+r),o&&(r="Ctrl-"+r),a&&(r="Meta-"+r),i&&(r="Shift-"+r),r}function NSt(t){var e=Object.create(null);for(var r in t)e[FSt(r)]=t[r];return e}function D1(t,e,r){return e.altKey&&(t="Alt-"+t),e.ctrlKey&&(t="Ctrl-"+t),e.metaKey&&(t="Meta-"+t),r!==!1&&e.shiftKey&&(t="Shift-"+t),t}function PSt(t){return new Dr({props:{handleKeyDown:DSt(t)}})}function DSt(t){var e=NSt(t);return function(r,n){var o=kSt(n),i=o.length==1&&o!=" ",a,u=e[D1(o,n,!i)];if(u&&u(r.state,r.dispatch,r))return!0;if(i&&(n.shiftKey||n.altKey||n.metaKey||o.charCodeAt(0)>127)&&(a=Ua[n.keyCode])&&a!=o){var c=e[D1(a,n,!0)];if(c&&c(r.state,r.dispatch,r))return!0}else if(i&&n.shiftKey){var s=e[D1(o,n,!0)];if(s&&s(r.state,r.dispatch,r))return!0}return!1}}function LSt(t){return Object.prototype.toString.call(t).slice(8,-1)}function L1(t){return LSt(t)!=="Object"?!1:t.constructor===Object&&Object.getPrototypeOf(t)===Object.prototype}function ey(t,e){const r=_({},t);return L1(t)&&L1(e)&&Object.keys(e).forEach(n=>{L1(e[n])?n in t?r[n]=ey(t[n],e[n]):Object.assign(r,{[n]:e[n]}):Object.assign(r,{[n]:e[n]})}),r}function N2(t){return typeof t=="function"}function yt(t,e=void 0,...r){return N2(t)?e?t.bind(e)(...r):t(...r):t}function ot(t,e,r){return t.config[e]===void 0&&t.parent?ot(t.parent,e,r):typeof t.config[e]=="function"?t.config[e].bind(K(_({},r),{parent:t.parent?ot(t.parent,e,r):null})):t.config[e]}class Ur{constructor(e={}){this.type="extension",this.name="extension",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config=_(_({},this.config),e),this.name=this.config.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=yt(ot(this,"addOptions",{name:this.name}))),this.storage=yt(ot(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new Ur(e)}configure(e={}){const r=this.extend();return r.options=ey(this.options,e),r.storage=yt(ot(r,"addStorage",{name:r.name,options:r.options})),r}extend(e={}){const r=new Ur(e);return r.parent=this,this.child=r,r.name=e.name?e.name:r.parent.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${r.name}".`),r.options=yt(ot(r,"addOptions",{name:r.name})),r.storage=yt(ot(r,"addStorage",{name:r.name,options:r.options})),r}}function P2(t,e,r){const{from:n,to:o}=e,{blockSeparator:i=`
38
+
39
+ `,textSerializers:a={}}=r||{};let u="",c=!0;return t.nodesBetween(n,o,(s,f,l,p)=>{var d;const h=a==null?void 0:a[s.type.name];h?(s.isBlock&&!c&&(u+=i,c=!0),u+=h({node:s,pos:f,parent:l,index:p})):s.isText?(u+=(d=s==null?void 0:s.text)===null||d===void 0?void 0:d.slice(Math.max(n,f)-f,o-f),c=!1):s.isBlock&&!c&&(u+=i,c=!0)}),u}function D2(t){return Object.fromEntries(Object.entries(t.nodes).filter(([,e])=>e.spec.toText).map(([e,r])=>[e,r.spec.toText]))}const USt=Ur.create({name:"clipboardTextSerializer",addProseMirrorPlugins(){return[new Dr({key:new oo("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:t}=this,{state:e,schema:r}=t,{doc:n,selection:o}=e,{ranges:i}=o,a=Math.min(...i.map(f=>f.$from.pos)),u=Math.max(...i.map(f=>f.$to.pos)),c=D2(r);return P2(n,{from:a,to:u},{textSerializers:c})}}})]}});var jSt=Object.freeze({__proto__:null,blur:()=>({editor:t,view:e})=>(requestAnimationFrame(()=>{var r;t.isDestroyed||(e.dom.blur(),(r=window==null?void 0:window.getSelection())===null||r===void 0||r.removeAllRanges())}),!0)}),BSt=Object.freeze({__proto__:null,clearContent:(t=!1)=>({commands:e})=>e.setContent("",t)}),zSt=Object.freeze({__proto__:null,clearNodes:()=>({state:t,tr:e,dispatch:r})=>{const{selection:n}=e,{ranges:o}=n;return r&&o.forEach(({$from:i,$to:a})=>{t.doc.nodesBetween(i.pos,a.pos,(u,c)=>{if(u.type.isText)return;const{doc:s,mapping:f}=e,l=s.resolve(f.map(c)),p=s.resolve(f.map(c+u.nodeSize)),d=l.blockRange(p);if(!d)return;const h=Of(d);if(u.type.isTextblock){const{defaultType:m}=l.parent.contentMatchAt(l.index());e.setNodeMarkup(d.start,m)}(h||h===0)&&e.lift(d,h)})}),!0}}),qSt=Object.freeze({__proto__:null,command:t=>e=>t(e)}),KSt=Object.freeze({__proto__:null,createParagraphNear:()=>({state:t,dispatch:e})=>_q(t,e)});function Ae(t,e){if(typeof t=="string"){if(!e.nodes[t])throw Error(`There is no node type named '${t}'. Maybe you forgot to add the extension?`);return e.nodes[t]}return t}var VSt=Object.freeze({__proto__:null,deleteNode:t=>({tr:e,state:r,dispatch:n})=>{const o=Ae(t,r.schema),i=e.selection.$anchor;for(let a=i.depth;a>0;a-=1)if(i.node(a).type===o){if(n){const c=i.before(a),s=i.after(a);e.delete(c,s).scrollIntoView()}return!0}return!1}}),HSt=Object.freeze({__proto__:null,deleteRange:t=>({tr:e,dispatch:r})=>{const{from:n,to:o}=t;return r&&e.delete(n,o),!0}}),JSt=Object.freeze({__proto__:null,deleteSelection:()=>({state:t,dispatch:e})=>e1(t,e)}),GSt=Object.freeze({__proto__:null,enter:()=>({commands:t})=>t.keyboardShortcut("Enter")}),YSt=Object.freeze({__proto__:null,exitCode:()=>({state:t,dispatch:e})=>$q(t,e)});function ja(t,e){if(typeof t=="string"){if(!e.marks[t])throw Error(`There is no mark type named '${t}'. Maybe you forgot to add the extension?`);return e.marks[t]}return t}function U1(t){return Object.prototype.toString.call(t)==="[object RegExp]"}function ry(t,e,r={strict:!0}){const n=Object.keys(e);return n.length?n.every(o=>r.strict?e[o]===t[o]:U1(e[o])?e[o].test(t[o]):e[o]===t[o]):!0}function j1(t,e,r={}){return t.find(n=>n.type===e&&ry(n.attrs,r))}function XSt(t,e,r={}){return!!j1(t,e,r)}function B1(t,e,r={}){if(!t||!e)return;const n=t.parent.childAfter(t.parentOffset);if(!n.node)return;const o=j1(n.node.marks,e,r);if(!o)return;let i=t.index(),a=t.start()+n.offset,u=i+1,c=a+n.node.nodeSize;for(j1(n.node.marks,e,r);i>0&&o.isInSet(t.parent.child(i-1).marks);)i-=1,a-=t.parent.child(i).nodeSize;for(;u<t.parent.childCount&&XSt(t.parent.child(u).marks,e,r);)c+=t.parent.child(u).nodeSize,u+=1;return{from:a,to:c}}var ZSt=Object.freeze({__proto__:null,extendMarkRange:(t,e={})=>({tr:r,state:n,dispatch:o})=>{const i=ja(t,n.schema),{doc:a,selection:u}=r,{$from:c,from:s,to:f}=u;if(o){const l=B1(c,i,e);if(l&&l.from<=s&&l.to>=f){const p=wt.create(a,l.from,l.to);r.setSelection(p)}}return!0}}),QSt=Object.freeze({__proto__:null,first:t=>e=>{const r=typeof t=="function"?t(e):t;for(let n=0;n<r.length;n+=1)if(r[n](e))return!0;return!1}});function t0t(t){var e;return((e=t.constructor)===null||e===void 0?void 0:e.toString().substring(0,5))==="class"}function L2(t){return t&&typeof t=="object"&&!Array.isArray(t)&&!t0t(t)}function U2(t){return L2(t)&&t instanceof wt}function ny(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}function Ai(t=0,e=0,r=0){return Math.min(Math.max(t,e),r)}function j2(t,e=null){if(!e)return null;const r=gt.atStart(t),n=gt.atEnd(t);if(e==="start"||e===!0)return r;if(e==="end")return n;const o=r.from,i=n.to;return e==="all"?wt.create(t,Ai(0,o,i),Ai(t.content.size,o,i)):wt.create(t,Ai(e,o,i),Ai(e,o,i))}var e0t=Object.freeze({__proto__:null,focus:(t=null,e)=>({editor:r,view:n,tr:o,dispatch:i})=>{e=_({scrollIntoView:!0},e);const a=()=>{ny()&&n.dom.focus(),requestAnimationFrame(()=>{r.isDestroyed||(n.focus(),(e==null?void 0:e.scrollIntoView)&&r.commands.scrollIntoView())})};if(n.hasFocus()&&t===null||t===!1)return!0;if(i&&t===null&&!U2(r.state.selection))return a(),!0;const u=j2(r.state.doc,t)||r.state.selection,c=r.state.selection.eq(u);return i&&(c||o.setSelection(u),c&&o.storedMarks&&o.setStoredMarks(o.storedMarks),a()),!0}}),r0t=Object.freeze({__proto__:null,forEach:(t,e)=>r=>t.every((n,o)=>e(n,K(_({},r),{index:o})))}),n0t=Object.freeze({__proto__:null,insertContent:(t,e)=>({tr:r,commands:n})=>n.insertContentAt({from:r.selection.from,to:r.selection.to},t,e)});function B2(t){const e=`<body>${t}</body>`;return new window.DOMParser().parseFromString(e,"text/html").body}function oy(t,e,r){if(r=_({slice:!0,parseOptions:{}},r),typeof t=="object"&&t!==null)try{return Array.isArray(t)?D.fromArray(t.map(n=>e.nodeFromJSON(n))):e.nodeFromJSON(t)}catch(n){return console.warn("[tiptap warn]: Invalid content.","Passed value:",t,"Error:",n),oy("",e,r)}if(typeof t=="string"){const n=no.fromSchema(e);return r.slice?n.parseSlice(B2(t),r.parseOptions).content:n.parse(B2(t),r.parseOptions)}return oy("",e,r)}function o0t(t,e,r){const n=t.steps.length-1;if(n<e)return;const o=t.steps[n];if(!(o instanceof Oi||o instanceof Pr))return;const i=t.mapping.maps[n];let a=0;i.forEach((u,c,s,f)=>{a===0&&(a=f)}),t.setSelection(gt.near(t.doc.resolve(a),r))}const i0t=t=>t.toString().startsWith("<");var a0t=Object.freeze({__proto__:null,insertContentAt:(t,e,r)=>({tr:n,dispatch:o,editor:i})=>{if(o){r=_({parseOptions:{},updateSelection:!0},r);const a=oy(e,i.schema,{parseOptions:_({preserveWhitespace:"full"},r.parseOptions)});if(a.toString()==="<>")return!0;let{from:u,to:c}=typeof t=="number"?{from:t,to:t}:t,s=!0,f=!0;if((i0t(a)?a:[a]).forEach(p=>{p.check(),s=s?p.isText&&p.marks.length===0:!1,f=f?p.isBlock:!1}),u===c&&f){const{parent:p}=n.doc.resolve(u);p.isTextblock&&!p.type.spec.code&&!p.childCount&&(u-=1,c+=1)}s?n.insertText(e,u,c):n.replaceWith(u,c,a),r.updateSelection&&o0t(n,n.steps.length-1,-1)}return!0}}),u0t=Object.freeze({__proto__:null,joinBackward:()=>({state:t,dispatch:e})=>dq(t,e)}),c0t=Object.freeze({__proto__:null,joinForward:()=>({state:t,dispatch:e})=>mq(t,e)});function z2(){return typeof navigator!="undefined"?/Mac/.test(navigator.platform):!1}function s0t(t){const e=t.split(/-(?!$)/);let r=e[e.length-1];r==="Space"&&(r=" ");let n,o,i,a;for(let u=0;u<e.length-1;u+=1){const c=e[u];if(/^(cmd|meta|m)$/i.test(c))a=!0;else if(/^a(lt)?$/i.test(c))n=!0;else if(/^(c|ctrl|control)$/i.test(c))o=!0;else if(/^s(hift)?$/i.test(c))i=!0;else if(/^mod$/i.test(c))ny()||z2()?a=!0:o=!0;else throw new Error(`Unrecognized modifier name: ${c}`)}return n&&(r=`Alt-${r}`),o&&(r=`Ctrl-${r}`),a&&(r=`Meta-${r}`),i&&(r=`Shift-${r}`),r}var f0t=Object.freeze({__proto__:null,keyboardShortcut:t=>({editor:e,view:r,tr:n,dispatch:o})=>{const i=s0t(t).split(/-(?!$)/),a=i.find(s=>!["Alt","Ctrl","Meta","Shift"].includes(s)),u=new KeyboardEvent("keydown",{key:a==="Space"?" ":a,altKey:i.includes("Alt"),ctrlKey:i.includes("Ctrl"),metaKey:i.includes("Meta"),shiftKey:i.includes("Shift"),bubbles:!0,cancelable:!0}),c=e.captureTransaction(()=>{r.someProp("handleKeyDown",s=>s(r,u))});return c==null||c.steps.forEach(s=>{const f=s.map(n.mapping);f&&o&&n.maybeStep(f)}),!0}});function Fd(t,e,r={}){const{from:n,to:o,empty:i}=t.selection,a=e?Ae(e,t.schema):null,u=[];t.doc.nodesBetween(n,o,(l,p)=>{if(l.isText)return;const d=Math.max(n,p),h=Math.min(o,p+l.nodeSize);u.push({node:l,from:d,to:h})});const c=o-n,s=u.filter(l=>a?a.name===l.node.type.name:!0).filter(l=>ry(l.node.attrs,r,{strict:!1}));return i?!!s.length:s.reduce((l,p)=>l+p.to-p.from,0)>=c}var l0t=Object.freeze({__proto__:null,lift:(t,e={})=>({state:r,dispatch:n})=>{const o=Ae(t,r.schema);return Fd(r,o,e)?r_t(r,n):!1}}),p0t=Object.freeze({__proto__:null,liftEmptyBlock:()=>({state:t,dispatch:e})=>Sq(t,e)}),d0t=Object.freeze({__proto__:null,liftListItem:t=>({state:e,dispatch:r})=>{const n=Ae(t,e.schema);return l_t(n)(e,r)}}),h0t=Object.freeze({__proto__:null,newlineInCode:()=>({state:t,dispatch:e})=>bq(t,e)});function iy(t,e){return e.nodes[t]?"node":e.marks[t]?"mark":null}function q2(t,e){const r=typeof e=="string"?[e]:e;return Object.keys(t).reduce((n,o)=>(r.includes(o)||(n[o]=t[o]),n),{})}var v0t=Object.freeze({__proto__:null,resetAttributes:(t,e)=>({tr:r,state:n,dispatch:o})=>{let i=null,a=null;const u=iy(typeof t=="string"?t:t.name,n.schema);return u?(u==="node"&&(i=Ae(t,n.schema)),u==="mark"&&(a=ja(t,n.schema)),o&&r.selection.ranges.forEach(c=>{n.doc.nodesBetween(c.$from.pos,c.$to.pos,(s,f)=>{i&&i===s.type&&r.setNodeMarkup(f,void 0,q2(s.attrs,e)),a&&s.marks.length&&s.marks.forEach(l=>{a===l.type&&r.addMark(f,f+s.nodeSize,a.create(q2(l.attrs,e)))})})}),!0):!1}}),m0t=Object.freeze({__proto__:null,scrollIntoView:()=>({tr:t,dispatch:e})=>(e&&t.scrollIntoView(),!0)}),g0t=Object.freeze({__proto__:null,selectAll:()=>({tr:t,commands:e})=>e.setTextSelection({from:0,to:t.doc.content.size})}),y0t=Object.freeze({__proto__:null,selectNodeBackward:()=>({state:t,dispatch:e})=>hq(t,e)}),b0t=Object.freeze({__proto__:null,selectNodeForward:()=>({state:t,dispatch:e})=>gq(t,e)}),$0t=Object.freeze({__proto__:null,selectParentNode:()=>({state:t,dispatch:e})=>o_t(t,e)}),_0t=Object.freeze({__proto__:null,selectTextblockEnd:()=>({state:t,dispatch:e})=>o1(t,e)}),S0t=Object.freeze({__proto__:null,selectTextblockStart:()=>({state:t,dispatch:e})=>n1(t,e)});function K2(t,e,r={}){return oy(t,e,{slice:!1,parseOptions:r})}var T0t=Object.freeze({__proto__:null,setContent:(t,e=!1,r={})=>({tr:n,editor:o,dispatch:i})=>{const{doc:a}=n,u=K2(t,o.schema,r),c=wt.create(a,0,a.content.size);return i&&n.setSelection(c).replaceSelectionWith(u,!1).setMeta("preventUpdate",!e),!0}});function V2(t,e){const r=ja(e,t.schema),{from:n,to:o,empty:i}=t.selection,a=[];i?(t.storedMarks&&a.push(...t.storedMarks),a.push(...t.selection.$head.marks())):t.doc.nodesBetween(n,o,c=>{a.push(...c.marks)});const u=a.find(c=>c.type.name===r.name);return u?_({},u.attrs):{}}var I0t=Object.freeze({__proto__:null,setMark:(t,e={})=>({tr:r,state:n,dispatch:o})=>{const{selection:i}=r,{empty:a,ranges:u}=i,c=ja(t,n.schema);if(o)if(a){const s=V2(n,c);r.addStoredMark(c.create(_(_({},s),e)))}else u.forEach(s=>{const f=s.$from.pos,l=s.$to.pos;n.doc.nodesBetween(f,l,(p,d)=>{const h=Math.max(d,f),m=Math.min(d+p.nodeSize,l);p.marks.find(b=>b.type===c)?p.marks.forEach(b=>{c===b.type&&r.addMark(h,m,c.create(_(_({},b.attrs),e)))}):r.addMark(h,m,c.create(e))})});return!0}}),O0t=Object.freeze({__proto__:null,setMeta:(t,e)=>({tr:r})=>(r.setMeta(t,e),!0)}),M0t=Object.freeze({__proto__:null,setNode:(t,e={})=>({state:r,dispatch:n,chain:o})=>{const i=Ae(t,r.schema);return i.isTextblock?o().command(({commands:a})=>Oq(i,e)(r)?!0:a.clearNodes()).command(({state:a})=>Oq(i,e)(a,n)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)}}),R0t=Object.freeze({__proto__:null,setNodeSelection:t=>({tr:e,dispatch:r})=>{if(r){const{doc:n}=e,o=gt.atStart(n).from,i=gt.atEnd(n).to,a=Ai(t,o,i),u=dt.create(n,a);e.setSelection(u)}return!0}}),E0t=Object.freeze({__proto__:null,setTextSelection:t=>({tr:e,dispatch:r})=>{if(r){const{doc:n}=e,{from:o,to:i}=typeof t=="number"?{from:t,to:t}:t,a=wt.atStart(n).from,u=wt.atEnd(n).to,c=Ai(o,a,u),s=Ai(i,a,u),f=wt.create(n,c,s);e.setSelection(f)}return!0}}),w0t=Object.freeze({__proto__:null,sinkListItem:t=>({state:e,dispatch:r})=>{const n=Ae(t,e.schema);return h_t(n)(e,r)}});function ay(t,e,r){return Object.fromEntries(Object.entries(r).filter(([n])=>{const o=t.find(i=>i.type===e&&i.name===n);return o?o.attribute.keepOnSplit:!1}))}function A0t(t){for(let e=0;e<t.edgeCount;e+=1){const{type:r}=t.edge(e);if(r.isTextblock&&!r.hasRequiredAttrs())return r}return null}function H2(t,e){const r=t.storedMarks||t.selection.$to.parentOffset&&t.selection.$from.marks();if(r){const n=r.filter(o=>e==null?void 0:e.includes(o.type.name));t.tr.ensureMarks(n)}}var C0t=Object.freeze({__proto__:null,splitBlock:({keepMarks:t=!0}={})=>({tr:e,state:r,dispatch:n,editor:o})=>{const{selection:i,doc:a}=e,{$from:u,$to:c}=i,s=o.extensionManager.attributes,f=ay(s,u.node().type.name,u.node().attrs);if(i instanceof dt&&i.node.isBlock)return!u.parentOffset||!Mi(a,u.pos)?!1:(n&&(t&&H2(r,o.extensionManager.splittableMarks),e.split(u.pos).scrollIntoView()),!0);if(!u.parent.isBlock)return!1;if(n){const l=c.parentOffset===c.parent.content.size;i instanceof wt&&e.deleteSelection();const p=u.depth===0?void 0:A0t(u.node(-1).contentMatchAt(u.indexAfter(-1)));let d=l&&p?[{type:p,attrs:f}]:void 0,h=Mi(e.doc,e.mapping.map(u.pos),1,d);if(!d&&!h&&Mi(e.doc,e.mapping.map(u.pos),1,p?[{type:p}]:void 0)&&(h=!0,d=p?[{type:p,attrs:f}]:void 0),h&&(e.split(e.mapping.map(u.pos),1,d),p&&!l&&!u.parentOffset&&u.parent.type!==p)){const m=e.mapping.map(u.before()),g=e.doc.resolve(m);u.node(-1).canReplaceWith(g.index(),g.index()+1,p)&&e.setNodeMarkup(e.mapping.map(u.before()),p)}t&&H2(r,o.extensionManager.splittableMarks),e.scrollIntoView()}return!0}}),x0t=Object.freeze({__proto__:null,splitListItem:t=>({tr:e,state:r,dispatch:n,editor:o})=>{var i;const a=Ae(t,r.schema),{$from:u,$to:c}=r.selection,s=r.selection.node;if(s&&s.isBlock||u.depth<2||!u.sameParent(c))return!1;const f=u.node(-1);if(f.type!==a)return!1;const l=o.extensionManager.attributes;if(u.parent.content.size===0&&u.node(-1).childCount===u.indexAfter(-1)){if(u.depth===2||u.node(-3).type!==a||u.index(-2)!==u.node(-2).childCount-1)return!1;if(n){let g=D.empty;const b=u.index(-1)?1:u.index(-2)?2:3;for(let k=u.depth-b;k>=u.depth-3;k-=1)g=D.from(u.node(k).copy(g));const $=u.indexAfter(-1)<u.node(-2).childCount?1:u.indexAfter(-2)<u.node(-3).childCount?2:3,w=ay(l,u.node().type.name,u.node().attrs),y=((i=a.contentMatch.defaultType)===null||i===void 0?void 0:i.createAndFill(w))||void 0;g=g.append(D.from(a.createAndFill(null,y)||void 0));const I=u.before(u.depth-(b-1));e.replace(I,u.after(-$),new Z(g,4-b,0));let S=-1;e.doc.nodesBetween(I,e.doc.content.size,(k,C)=>{if(S>-1)return!1;k.isTextblock&&k.content.size===0&&(S=C+1)}),S>-1&&e.setSelection(wt.near(e.doc.resolve(S))),e.scrollIntoView()}return!0}const p=c.pos===u.end()?f.contentMatchAt(0).defaultType:null,d=ay(l,f.type.name,f.attrs),h=ay(l,u.node().type.name,u.node().attrs);e.delete(u.pos,c.pos);const m=p?[{type:a,attrs:d},{type:p,attrs:h}]:[{type:a,attrs:d}];return Mi(e.doc,u.pos,2)?(n&&e.split(u.pos,2,m).scrollIntoView(),!0):!1}});function k0t(t,e){for(let r=t.depth;r>0;r-=1){const n=t.node(r);if(e(n))return{pos:r>0?t.before(r):0,start:t.start(r),depth:r,node:n}}}function z1(t){return e=>k0t(e.$from,t)}function uy(t){const e=t.filter(o=>o.type==="extension"),r=t.filter(o=>o.type==="node"),n=t.filter(o=>o.type==="mark");return{baseExtensions:e,nodeExtensions:r,markExtensions:n}}function J2(t,e){const{nodeExtensions:r}=uy(e),n=r.find(a=>a.name===t);if(!n)return!1;const o={name:n.name,options:n.options,storage:n.storage},i=yt(ot(n,"group",o));return typeof i!="string"?!1:i.split(" ").includes("list")}const G2=(t,e)=>{const r=z1(a=>a.type===e)(t.selection);if(!r)return!0;const n=t.doc.resolve(Math.max(0,r.pos-1)).before(r.depth);if(n===void 0)return!0;const o=t.doc.nodeAt(n);return r.node.type===(o==null?void 0:o.type)&&$d(t.doc,r.pos)&&t.join(r.pos),!0},Y2=(t,e)=>{const r=z1(a=>a.type===e)(t.selection);if(!r)return!0;const n=t.doc.resolve(r.start).after(r.depth);if(n===void 0)return!0;const o=t.doc.nodeAt(n);return r.node.type===(o==null?void 0:o.type)&&$d(t.doc,n)&&t.join(n),!0};var W0t=Object.freeze({__proto__:null,toggleList:(t,e)=>({editor:r,tr:n,state:o,dispatch:i,chain:a,commands:u,can:c})=>{const{extensions:s}=r.extensionManager,f=Ae(t,o.schema),l=Ae(e,o.schema),{selection:p}=o,{$from:d,$to:h}=p,m=d.blockRange(h);if(!m)return!1;const g=z1(b=>J2(b.type.name,s))(p);if(m.depth>=1&&g&&m.depth-g.depth<=1){if(g.node.type===f)return u.liftListItem(l);if(J2(g.node.type.name,s)&&f.validContent(g.node.content)&&i)return a().command(()=>(n.setNodeMarkup(g.pos,f),!0)).command(()=>G2(n,f)).command(()=>Y2(n,f)).run()}return a().command(()=>c().wrapInList(f)?!0:u.clearNodes()).wrapInList(f).command(()=>G2(n,f)).command(()=>Y2(n,f)).run()}});function q1(t,e,r={}){const{empty:n,ranges:o}=t.selection,i=e?ja(e,t.schema):null;if(n)return!!(t.storedMarks||t.selection.$from.marks()).filter(l=>i?i.name===l.type.name:!0).find(l=>ry(l.attrs,r,{strict:!1}));let a=0;const u=[];if(o.forEach(({$from:l,$to:p})=>{const d=l.pos,h=p.pos;t.doc.nodesBetween(d,h,(m,g)=>{if(!m.isText&&!m.marks.length)return;const b=Math.max(d,g),$=Math.min(h,g+m.nodeSize);a+=$-b,u.push(...m.marks.map(y=>({mark:y,from:b,to:$})))})}),a===0)return!1;const c=u.filter(l=>i?i.name===l.mark.type.name:!0).filter(l=>ry(l.mark.attrs,r,{strict:!1})).reduce((l,p)=>l+p.to-p.from,0),s=u.filter(l=>i?l.mark.type!==i&&l.mark.type.excludes(i):!0).reduce((l,p)=>l+p.to-p.from,0);return(c>0?c+s:c)>=a}var F0t=Object.freeze({__proto__:null,toggleMark:(t,e={},r={})=>({state:n,commands:o})=>{const{extendEmptyMarkRange:i=!1}=r,a=ja(t,n.schema);return q1(n,a,e)?o.unsetMark(a,{extendEmptyMarkRange:i}):o.setMark(a,e)}}),N0t=Object.freeze({__proto__:null,toggleNode:(t,e,r={})=>({state:n,commands:o})=>{const i=Ae(t,n.schema),a=Ae(e,n.schema);return Fd(n,i,r)?o.setNode(a):o.setNode(i,r)}}),P0t=Object.freeze({__proto__:null,toggleWrap:(t,e={})=>({state:r,commands:n})=>{const o=Ae(t,r.schema);return Fd(r,o,e)?n.lift(o):n.wrapIn(o,e)}}),D0t=Object.freeze({__proto__:null,undoInputRule:()=>({state:t,dispatch:e})=>{const r=t.plugins;for(let n=0;n<r.length;n+=1){const o=r[n];let i;if(o.spec.isInputRules&&(i=o.getState(t))){if(e){const a=t.tr,u=i.transform;for(let c=u.steps.length-1;c>=0;c-=1)a.step(u.steps[c].invert(u.docs[c]));if(i.text){const c=a.doc.resolve(i.from).marks();a.replaceWith(i.from,i.to,t.schema.text(i.text,c))}else a.delete(i.from,i.to)}return!0}}return!1}}),L0t=Object.freeze({__proto__:null,unsetAllMarks:()=>({tr:t,dispatch:e})=>{const{selection:r}=t,{empty:n,ranges:o}=r;return n||e&&o.forEach(i=>{t.removeMark(i.$from.pos,i.$to.pos)}),!0}}),U0t=Object.freeze({__proto__:null,unsetMark:(t,e={})=>({tr:r,state:n,dispatch:o})=>{var i;const{extendEmptyMarkRange:a=!1}=e,{selection:u}=r,c=ja(t,n.schema),{$from:s,empty:f,ranges:l}=u;if(!o)return!0;if(f&&a){let{from:p,to:d}=u;const h=(i=s.marks().find(g=>g.type===c))===null||i===void 0?void 0:i.attrs,m=B1(s,c,h);m&&(p=m.from,d=m.to),r.removeMark(p,d,c)}else l.forEach(p=>{r.removeMark(p.$from.pos,p.$to.pos,c)});return r.removeStoredMark(c),!0}}),j0t=Object.freeze({__proto__:null,updateAttributes:(t,e={})=>({tr:r,state:n,dispatch:o})=>{let i=null,a=null;const u=iy(typeof t=="string"?t:t.name,n.schema);return u?(u==="node"&&(i=Ae(t,n.schema)),u==="mark"&&(a=ja(t,n.schema)),o&&r.selection.ranges.forEach(c=>{const s=c.$from.pos,f=c.$to.pos;n.doc.nodesBetween(s,f,(l,p)=>{i&&i===l.type&&r.setNodeMarkup(p,void 0,_(_({},l.attrs),e)),a&&l.marks.length&&l.marks.forEach(d=>{if(a===d.type){const h=Math.max(p,s),m=Math.min(p+l.nodeSize,f);r.addMark(h,m,a.create(_(_({},d.attrs),e)))}})})}),!0):!1}}),B0t=Object.freeze({__proto__:null,wrapIn:(t,e={})=>({state:r,dispatch:n})=>{const o=Ae(t,r.schema);return u_t(o,e)(r,n)}}),z0t=Object.freeze({__proto__:null,wrapInList:(t,e={})=>({state:r,dispatch:n})=>{const o=Ae(t,r.schema);return s_t(o,e)(r,n)}});const q0t=Ur.create({name:"commands",addCommands(){return _(_(_(_(_(_(_(_(_(_(_(_(_(_(_(_(_(_(_(_(_(_(_(_(_(_(_(_(_(_(_(_(_(_(_(_(_(_(_(_(_(_(_(_(_(_(_(_(_(_({},jSt),BSt),zSt),qSt),KSt),VSt),HSt),JSt),GSt),YSt),ZSt),QSt),e0t),r0t),n0t),a0t),u0t),c0t),f0t),l0t),p0t),d0t),h0t),v0t),m0t),g0t),y0t),b0t),$0t),_0t),S0t),T0t),I0t),O0t),M0t),R0t),E0t),w0t),C0t),x0t),W0t),F0t),N0t),P0t),D0t),L0t),U0t),j0t),B0t),z0t)}}),K0t=Ur.create({name:"editable",addProseMirrorPlugins(){return[new Dr({key:new oo("editable"),props:{editable:()=>this.editor.options.editable}})]}}),V0t=Ur.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:t}=this;return[new Dr({key:new oo("focusEvents"),props:{handleDOMEvents:{focus:(e,r)=>{t.isFocused=!0;const n=t.state.tr.setMeta("focus",{event:r}).setMeta("addToHistory",!1);return e.dispatch(n),!1},blur:(e,r)=>{t.isFocused=!1;const n=t.state.tr.setMeta("blur",{event:r}).setMeta("addToHistory",!1);return e.dispatch(n),!1}}}})]}});function cy(t){const{state:e,transaction:r}=t;let{selection:n}=r,{doc:o}=r,{storedMarks:i}=r;return K(_({},e),{schema:e.schema,plugins:e.plugins,apply:e.apply.bind(e),applyTransaction:e.applyTransaction.bind(e),reconfigure:e.reconfigure.bind(e),toJSON:e.toJSON.bind(e),get storedMarks(){return i},get selection(){return n},get doc(){return o},get tr(){return n=r.selection,o=r.doc,i=r.storedMarks,r}})}class sy{constructor(e){this.editor=e.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=e.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:e,editor:r,state:n}=this,{view:o}=r,{tr:i}=n,a=this.buildProps(i);return Object.fromEntries(Object.entries(e).map(([u,c])=>[u,(...f)=>{const l=c(...f)(a);return!i.getMeta("preventDispatch")&&!this.hasCustomState&&o.dispatch(i),l}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,r=!0){const{rawCommands:n,editor:o,state:i}=this,{view:a}=o,u=[],c=!!e,s=e||i.tr,f=()=>(!c&&r&&!s.getMeta("preventDispatch")&&!this.hasCustomState&&a.dispatch(s),u.every(p=>p===!0)),l=K(_({},Object.fromEntries(Object.entries(n).map(([p,d])=>[p,(...m)=>{const g=this.buildProps(s,r),b=d(...m)(g);return u.push(b),l}]))),{run:f});return l}createCan(e){const{rawCommands:r,state:n}=this,o=void 0,i=e||n.tr,a=this.buildProps(i,o),u=Object.fromEntries(Object.entries(r).map(([c,s])=>[c,(...f)=>s(...f)(K(_({},a),{dispatch:o}))]));return K(_({},u),{chain:()=>this.createChain(i,o)})}buildProps(e,r=!0){const{rawCommands:n,editor:o,state:i}=this,{view:a}=o;i.storedMarks&&e.setStoredMarks(i.storedMarks);const u={tr:e,editor:o,view:a,state:cy({state:i,transaction:e}),dispatch:r?()=>{}:void 0,chain:()=>this.createChain(e),can:()=>this.createCan(e),get commands(){return Object.fromEntries(Object.entries(n).map(([c,s])=>[c,(...f)=>s(...f)(u)]))}};return u}}const H0t=Ur.create({name:"keymap",addKeyboardShortcuts(){const t=()=>this.editor.commands.first(({commands:a})=>[()=>a.undoInputRule(),()=>a.command(({tr:u})=>{const{selection:c,doc:s}=u,{empty:f,$anchor:l}=c,{pos:p,parent:d}=l,h=gt.atStart(s).from===p;return!f||!h||!d.type.isTextblock||d.textContent.length?!1:a.clearNodes()}),()=>a.deleteSelection(),()=>a.joinBackward(),()=>a.selectNodeBackward()]),e=()=>this.editor.commands.first(({commands:a})=>[()=>a.deleteSelection(),()=>a.joinForward(),()=>a.selectNodeForward()]),n={Enter:()=>this.editor.commands.first(({commands:a})=>[()=>a.newlineInCode(),()=>a.createParagraphNear(),()=>a.liftEmptyBlock(),()=>a.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:t,"Mod-Backspace":t,"Shift-Backspace":t,Delete:e,"Mod-Delete":e,"Mod-a":()=>this.editor.commands.selectAll()},o=K(_({},n),{Home:()=>this.editor.commands.selectTextblockStart(),End:()=>this.editor.commands.selectTextblockEnd()}),i=K(_({},n),{"Ctrl-h":t,"Alt-Backspace":t,"Ctrl-d":e,"Ctrl-Alt-Backspace":e,"Alt-Delete":e,"Alt-d":e,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()});return ny()||z2()?i:o},addProseMirrorPlugins(){return[new Dr({key:new oo("clearDocument"),appendTransaction:(t,e,r)=>{if(!(t.some(h=>h.docChanged)&&!e.doc.eq(r.doc)))return;const{empty:o,from:i,to:a}=e.selection,u=gt.atStart(e.doc).from,c=gt.atEnd(e.doc).to,s=i===u&&a===c,f=r.doc.textBetween(0,r.doc.content.size," "," ").length===0;if(o||!s||!f)return;const l=r.tr,p=cy({state:r,transaction:l}),{commands:d}=new sy({editor:this.editor,state:p});if(d.clearNodes(),!!l.steps.length)return l}})]}}),J0t=Ur.create({name:"tabindex",addProseMirrorPlugins(){return[new Dr({key:new oo("tabindex"),props:{attributes:()=>{if(this.editor.isEditable)return{tabindex:"0"}}}})]}});var G0t=Object.freeze({__proto__:null,ClipboardTextSerializer:USt,Commands:q0t,Editable:K0t,FocusEvents:V0t,Keymap:H0t,Tabindex:J0t});function Y0t(t,e){const r=Ae(e,t.schema),{from:n,to:o}=t.selection,i=[];t.doc.nodesBetween(n,o,u=>{i.push(u)});const a=i.reverse().find(u=>u.type.name===r.name);return a?_({},a.attrs):{}}function X0t(t,e){const r=iy(typeof e=="string"?e:e.name,t.schema);return r==="node"?Y0t(t,e):r==="mark"?V2(t,e):{}}function Z0t(t,e,r={}){if(!e)return Fd(t,null,r)||q1(t,null,r);const n=iy(e,t.schema);return n==="node"?Fd(t,e,r):n==="mark"?q1(t,e,r):!1}function Q0t(t,e){const r=Ke.fromSchema(e).serializeFragment(t),o=document.implementation.createHTMLDocument().createElement("div");return o.appendChild(r),o.innerHTML}function tTt(t,e){const r={from:0,to:t.content.size};return P2(t,r,e)}function eTt(t){var e;const r=(e=t.type.createAndFill())===null||e===void 0?void 0:e.toJSON(),n=t.toJSON();return JSON.stringify(r)===JSON.stringify(n)}function rTt(t){const e=document.querySelector("style[data-tiptap-style]");if(e!==null)return e;const r=document.createElement("style");return r.setAttribute("data-tiptap-style",""),r.innerHTML=t,document.getElementsByTagName("head")[0].appendChild(r),r}class K1{constructor(e){this.find=e.find,this.handler=e.handler}}const nTt=(t,e)=>{if(U1(e))return e.exec(t);const r=e(t);if(!r)return null;const n=[];return n.push(r.text),n.index=r.index,n.input=t,n.data=r.data,r.replaceWith&&(r.text.includes(r.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),n.push(r.replaceWith)),n};function V1(t){var e;const{editor:r,from:n,to:o,text:i,rules:a,plugin:u}=t,{view:c}=r;if(c.composing)return!1;const s=c.state.doc.resolve(n);if(s.parent.type.spec.code||!!((e=s.nodeBefore||s.nodeAfter)===null||e===void 0?void 0:e.marks.find(d=>d.type.spec.code)))return!1;let f=!1;const l=500,p=s.parent.textBetween(Math.max(0,s.parentOffset-l),s.parentOffset,void 0," ")+i;return a.forEach(d=>{if(f)return;const h=nTt(p,d.find);if(!h)return;const m=c.state.tr,g=cy({state:c.state,transaction:m}),b={from:n-(h[0].length-i.length),to:o},{commands:$,chain:w,can:y}=new sy({editor:r,state:g});d.handler({state:g,range:b,match:h,commands:$,chain:w,can:y})===null||!m.steps.length||(m.setMeta(u,{transform:m,from:n,to:o,text:i}),c.dispatch(m),f=!0)}),f}function oTt(t){const{editor:e,rules:r}=t,n=new Dr({state:{init(){return null},apply(o,i){const a=o.getMeta(this);return a||(o.selectionSet||o.docChanged?null:i)}},props:{handleTextInput(o,i,a,u){return V1({editor:e,from:i,to:a,text:u,rules:r,plugin:n})},handleDOMEvents:{compositionend:o=>(setTimeout(()=>{const{$cursor:i}=o.state.selection;i&&V1({editor:e,from:i.pos,to:i.pos,text:"",rules:r,plugin:n})}),!1)},handleKeyDown(o,i){if(i.key!=="Enter")return!1;const{$cursor:a}=o.state.selection;return a?V1({editor:e,from:a.pos,to:a.pos,text:`
40
+ `,rules:r,plugin:n}):!1}},isInputRules:!0});return n}function iTt(t){return typeof t=="number"}class aTt{constructor(e){this.find=e.find,this.handler=e.handler}}const uTt=(t,e)=>{if(U1(e))return[...t.matchAll(e)];const r=e(t);return r?r.map(n=>{const o=[];return o.push(n.text),o.index=n.index,o.input=t,o.data=n.data,n.replaceWith&&(n.text.includes(n.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),o.push(n.replaceWith)),o}):[]};function cTt(t){const{editor:e,state:r,from:n,to:o,rule:i}=t,{commands:a,chain:u,can:c}=new sy({editor:e,state:r}),s=[];return r.doc.nodesBetween(n,o,(l,p)=>{if(!l.isTextblock||l.type.spec.code)return;const d=Math.max(n,p),h=Math.min(o,p+l.content.size),m=l.textBetween(d-p,h-p,void 0,"\uFFFC");uTt(m,i.find).forEach(b=>{if(b.index===void 0)return;const $=d+b.index+1,w=$+b[0].length,y={from:r.tr.mapping.map($),to:r.tr.mapping.map(w)},I=i.handler({state:r,range:y,match:b,commands:a,chain:u,can:c});s.push(I)})}),s.every(l=>l!==null)}function sTt(t){const{editor:e,rules:r}=t;let n=null,o=!1,i=!1;return r.map(u=>new Dr({view(c){const s=f=>{var l;n=((l=c.dom.parentElement)===null||l===void 0?void 0:l.contains(f.target))?c.dom.parentElement:null};return window.addEventListener("dragstart",s),{destroy(){window.removeEventListener("dragstart",s)}}},props:{handleDOMEvents:{drop:c=>(i=n===c.dom.parentElement,!1),paste:(c,s)=>{var f;const l=(f=s.clipboardData)===null||f===void 0?void 0:f.getData("text/html");return o=!!(l==null?void 0:l.includes("data-pm-slice")),!1}}},appendTransaction:(c,s,f)=>{const l=c[0],p=l.getMeta("uiEvent")==="paste"&&!o,d=l.getMeta("uiEvent")==="drop"&&!i;if(!p&&!d)return;const h=s.doc.content.findDiffStart(f.doc.content),m=s.doc.content.findDiffEnd(f.doc.content);if(!iTt(h)||!m||h===m.b)return;const g=f.tr,b=cy({state:f,transaction:g});if(!(!cTt({editor:e,state:b,from:Math.max(h-1,0),to:m.b,rule:u})||!g.steps.length))return g}}))}function X2(t){const e=[],{nodeExtensions:r,markExtensions:n}=uy(t),o=[...r,...n],i={default:null,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0};return t.forEach(a=>{const u={name:a.name,options:a.options,storage:a.storage},c=ot(a,"addGlobalAttributes",u);if(!c)return;c().forEach(f=>{f.types.forEach(l=>{Object.entries(f.attributes).forEach(([p,d])=>{e.push({type:l,name:p,attribute:_(_({},i),d)})})})})}),o.forEach(a=>{const u={name:a.name,options:a.options,storage:a.storage},c=ot(a,"addAttributes",u);if(!c)return;const s=c();Object.entries(s).forEach(([f,l])=>{e.push({type:a.name,name:f,attribute:_(_({},i),l)})})}),e}function Ge(...t){return t.filter(e=>!!e).reduce((e,r)=>{const n=_({},e);return Object.entries(r).forEach(([o,i])=>{if(!n[o]){n[o]=i;return}o==="class"?n[o]=[n[o],i].join(" "):o==="style"?n[o]=[n[o],i].join("; "):n[o]=i}),n},{})}function H1(t,e){return e.filter(r=>r.attribute.rendered).map(r=>r.attribute.renderHTML?r.attribute.renderHTML(t.attrs)||{}:{[r.name]:t.attrs[r.name]}).reduce((r,n)=>Ge(r,n),{})}function fTt(t={}){return Object.keys(t).length===0&&t.constructor===Object}function lTt(t){return typeof t!="string"?t:t.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(t):t==="true"?!0:t==="false"?!1:t}function Z2(t,e){return t.style?t:K(_({},t),{getAttrs:r=>{const n=t.getAttrs?t.getAttrs(r):t.attrs;if(n===!1)return!1;const o=e.reduce((i,a)=>{const u=a.attribute.parseHTML?a.attribute.parseHTML(r):lTt(r.getAttribute(a.name));return u==null?i:K(_({},i),{[a.name]:u})},{});return _(_({},n),o)}})}function Q2(t){return Object.fromEntries(Object.entries(t).filter(([e,r])=>e==="attrs"&&fTt(r)?!1:r!=null))}function tK(t){var e;const r=X2(t),{nodeExtensions:n,markExtensions:o}=uy(t),i=(e=n.find(c=>ot(c,"topNode")))===null||e===void 0?void 0:e.name,a=Object.fromEntries(n.map(c=>{const s=r.filter(g=>g.type===c.name),f={name:c.name,options:c.options,storage:c.storage},l=t.reduce((g,b)=>{const $=ot(b,"extendNodeSchema",f);return _(_({},g),$?$(c):{})},{}),p=Q2(K(_({},l),{content:yt(ot(c,"content",f)),marks:yt(ot(c,"marks",f)),group:yt(ot(c,"group",f)),inline:yt(ot(c,"inline",f)),atom:yt(ot(c,"atom",f)),selectable:yt(ot(c,"selectable",f)),draggable:yt(ot(c,"draggable",f)),code:yt(ot(c,"code",f)),defining:yt(ot(c,"defining",f)),isolating:yt(ot(c,"isolating",f)),attrs:Object.fromEntries(s.map(g=>{var b;return[g.name,{default:(b=g==null?void 0:g.attribute)===null||b===void 0?void 0:b.default}]}))})),d=yt(ot(c,"parseHTML",f));d&&(p.parseDOM=d.map(g=>Z2(g,s)));const h=ot(c,"renderHTML",f);h&&(p.toDOM=g=>h({node:g,HTMLAttributes:H1(g,s)}));const m=ot(c,"renderText",f);return m&&(p.toText=m),[c.name,p]})),u=Object.fromEntries(o.map(c=>{const s=r.filter(m=>m.type===c.name),f={name:c.name,options:c.options,storage:c.storage},l=t.reduce((m,g)=>{const b=ot(g,"extendMarkSchema",f);return _(_({},m),b?b(c):{})},{}),p=Q2(K(_({},l),{inclusive:yt(ot(c,"inclusive",f)),excludes:yt(ot(c,"excludes",f)),group:yt(ot(c,"group",f)),spanning:yt(ot(c,"spanning",f)),code:yt(ot(c,"code",f)),attrs:Object.fromEntries(s.map(m=>{var g;return[m.name,{default:(g=m==null?void 0:m.attribute)===null||g===void 0?void 0:g.default}]}))})),d=yt(ot(c,"parseHTML",f));d&&(p.parseDOM=d.map(m=>Z2(m,s)));const h=ot(c,"renderHTML",f);return h&&(p.toDOM=m=>h({mark:m,HTMLAttributes:H1(m,s)})),[c.name,p]}));return new dc({topNode:i,nodes:a,marks:u})}function J1(t,e){return e.nodes[t]||e.marks[t]||null}function eK(t,e){return Array.isArray(e)?e.some(r=>(typeof r=="string"?r:r.name)===t.name):e}function pTt(t){const e=t.filter((r,n)=>t.indexOf(r)!==n);return[...new Set(e)]}class bc{constructor(e,r){this.splittableMarks=[],this.editor=r,this.extensions=bc.resolve(e),this.schema=tK(this.extensions),this.extensions.forEach(n=>{var o;this.editor.extensionStorage[n.name]=n.storage;const i={name:n.name,options:n.options,storage:n.storage,editor:this.editor,type:J1(n.name,this.schema)};n.type==="mark"&&((o=yt(ot(n,"keepOnSplit",i)))!==null&&o!==void 0?o:!0)&&this.splittableMarks.push(n.name);const a=ot(n,"onBeforeCreate",i);a&&this.editor.on("beforeCreate",a);const u=ot(n,"onCreate",i);u&&this.editor.on("create",u);const c=ot(n,"onUpdate",i);c&&this.editor.on("update",c);const s=ot(n,"onSelectionUpdate",i);s&&this.editor.on("selectionUpdate",s);const f=ot(n,"onTransaction",i);f&&this.editor.on("transaction",f);const l=ot(n,"onFocus",i);l&&this.editor.on("focus",l);const p=ot(n,"onBlur",i);p&&this.editor.on("blur",p);const d=ot(n,"onDestroy",i);d&&this.editor.on("destroy",d)})}static resolve(e){const r=bc.sort(bc.flatten(e)),n=pTt(r.map(o=>o.name));return n.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${n.map(o=>`'${o}'`).join(", ")}]. This can lead to issues.`),r}static flatten(e){return e.map(r=>{const n={name:r.name,options:r.options,storage:r.storage},o=ot(r,"addExtensions",n);return o?[r,...this.flatten(o())]:r}).flat(10)}static sort(e){const r=100;return e.sort((n,o)=>{const i=ot(n,"priority")||r,a=ot(o,"priority")||r;return i>a?-1:i<a?1:0})}get commands(){return this.extensions.reduce((e,r)=>{const n={name:r.name,options:r.options,storage:r.storage,editor:this.editor,type:J1(r.name,this.schema)},o=ot(r,"addCommands",n);return o?_(_({},e),o()):e},{})}get plugins(){const{editor:e}=this,r=bc.sort([...this.extensions].reverse()),n=[],o=[],i=r.map(a=>{const u={name:a.name,options:a.options,storage:a.storage,editor:e,type:J1(a.name,this.schema)},c=[],s=ot(a,"addKeyboardShortcuts",u);if(s){const d=Object.fromEntries(Object.entries(s()).map(([m,g])=>[m,()=>g({editor:e})])),h=PSt(d);c.push(h)}const f=ot(a,"addInputRules",u);eK(a,e.options.enableInputRules)&&f&&n.push(...f());const l=ot(a,"addPasteRules",u);eK(a,e.options.enablePasteRules)&&l&&o.push(...l());const p=ot(a,"addProseMirrorPlugins",u);if(p){const d=p();c.push(...d)}return c}).flat();return[oTt({editor:e,rules:n}),...sTt({editor:e,rules:o}),...i]}get attributes(){return X2(this.extensions)}get nodeViews(){const{editor:e}=this,{nodeExtensions:r}=uy(this.extensions);return Object.fromEntries(r.filter(n=>!!ot(n,"addNodeView")).map(n=>{const o=this.attributes.filter(c=>c.type===n.name),i={name:n.name,options:n.options,storage:n.storage,editor:e,type:Ae(n.name,this.schema)},a=ot(n,"addNodeView",i);if(!a)return[];const u=(c,s,f,l)=>{const p=H1(c,o);return a()({editor:e,node:c,getPos:f,decorations:l,HTMLAttributes:p,extension:n})};return[n.name,u]}))}}class dTt{constructor(){this.callbacks={}}on(e,r){return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(r),this}emit(e,...r){const n=this.callbacks[e];return n&&n.forEach(o=>o.apply(this,r)),this}off(e,r){const n=this.callbacks[e];return n&&(r?this.callbacks[e]=n.filter(o=>o!==r):delete this.callbacks[e]),this}removeAllListeners(){this.callbacks={}}}const hTt=`.ProseMirror {
41
+ position: relative;
42
+ }
43
+
44
+ .ProseMirror {
45
+ word-wrap: break-word;
46
+ white-space: pre-wrap;
47
+ white-space: break-spaces;
48
+ -webkit-font-variant-ligatures: none;
49
+ font-variant-ligatures: none;
50
+ font-feature-settings: "liga" 0; /* the above doesn't seem to work in Edge */
51
+ }
52
+
53
+ .ProseMirror [contenteditable="false"] {
54
+ white-space: normal;
55
+ }
56
+
57
+ .ProseMirror [contenteditable="false"] [contenteditable="true"] {
58
+ white-space: pre-wrap;
59
+ }
60
+
61
+ .ProseMirror pre {
62
+ white-space: pre-wrap;
63
+ }
64
+
65
+ img.ProseMirror-separator {
66
+ display: inline !important;
67
+ border: none !important;
68
+ margin: 0 !important;
69
+ width: 1px !important;
70
+ height: 1px !important;
71
+ }
72
+
73
+ .ProseMirror-gapcursor {
74
+ display: none;
75
+ pointer-events: none;
76
+ position: absolute;
77
+ margin: 0;
78
+ }
79
+
80
+ .ProseMirror-gapcursor:after {
81
+ content: "";
82
+ display: block;
83
+ position: absolute;
84
+ top: -2px;
85
+ width: 20px;
86
+ border-top: 1px solid black;
87
+ animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;
88
+ }
89
+
90
+ @keyframes ProseMirror-cursor-blink {
91
+ to {
92
+ visibility: hidden;
93
+ }
94
+ }
95
+
96
+ .ProseMirror-hideselection *::selection {
97
+ background: transparent;
98
+ }
99
+
100
+ .ProseMirror-hideselection *::-moz-selection {
101
+ background: transparent;
102
+ }
103
+
104
+ .ProseMirror-hideselection * {
105
+ caret-color: transparent;
106
+ }
107
+
108
+ .ProseMirror-focused .ProseMirror-gapcursor {
109
+ display: block;
110
+ }
111
+
112
+ .tippy-box[data-animation=fade][data-state=hidden] {
113
+ opacity: 0
114
+ }`;class vTt extends dTt{constructor(e={}){super();this.isFocused=!1,this.extensionStorage={},this.options={element:document.createElement("div"),content:"",injectCSS:!0,extensions:[],autofocus:!1,editable:!0,editorProps:{},parseOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,onBeforeCreate:()=>null,onCreate:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.setOptions(e),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.createView(),this.injectCSS(),this.on("create",this.options.onCreate),this.on("update",this.options.onUpdate),this.on("selectionUpdate",this.options.onSelectionUpdate),this.on("transaction",this.options.onTransaction),this.on("focus",this.options.onFocus),this.on("blur",this.options.onBlur),this.on("destroy",this.options.onDestroy),window.setTimeout(()=>{this.isDestroyed||(this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}))},0)}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager.chain()}can(){return this.commandManager.can()}injectCSS(){this.options.injectCSS&&document&&(this.css=rTt(hTt))}setOptions(e={}){this.options=_(_({},this.options),e),!(!this.view||!this.state||this.isDestroyed)&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(e){this.setOptions({editable:e})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get state(){return this.view.state}registerPlugin(e,r){const n=N2(r)?r(e,this.state.plugins):[...this.state.plugins,e],o=this.state.reconfigure({plugins:n});this.view.updateState(o)}unregisterPlugin(e){if(this.isDestroyed)return;const r=typeof e=="string"?`${e}$`:e.key,n=this.state.reconfigure({plugins:this.state.plugins.filter(o=>!o.key.startsWith(r))});this.view.updateState(n)}createExtensionManager(){const r=[...this.options.enableCoreExtensions?Object.values(G0t):[],...this.options.extensions].filter(n=>["extension","node","mark"].includes(n==null?void 0:n.type));this.extensionManager=new bc(r,this)}createCommandManager(){this.commandManager=new sy({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createView(){const e=K2(this.options.content,this.schema,this.options.parseOptions),r=j2(e,this.options.autofocus);this.view=new be(this.options.element,K(_({},this.options.editorProps),{dispatchTransaction:this.dispatchTransaction.bind(this),state:ur.create({doc:e,selection:r})}));const n=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(n),this.createNodeViews();const o=this.view.dom;o.editor=this}createNodeViews(){this.view.setProps({nodeViews:this.extensionManager.nodeViews})}captureTransaction(e){this.isCapturingTransaction=!0,e(),this.isCapturingTransaction=!1;const r=this.capturedTransaction;return this.capturedTransaction=null,r}dispatchTransaction(e){if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=e;return}e.steps.forEach(a=>{var u;return(u=this.capturedTransaction)===null||u===void 0?void 0:u.step(a)});return}const r=this.state.apply(e),n=!this.state.selection.eq(r.selection);this.view.updateState(r),this.emit("transaction",{editor:this,transaction:e}),n&&this.emit("selectionUpdate",{editor:this,transaction:e});const o=e.getMeta("focus"),i=e.getMeta("blur");o&&this.emit("focus",{editor:this,event:o.event,transaction:e}),i&&this.emit("blur",{editor:this,event:i.event,transaction:e}),!(!e.docChanged||e.getMeta("preventUpdate"))&&this.emit("update",{editor:this,transaction:e})}getAttributes(e){return X0t(this.state,e)}isActive(e,r){const n=typeof e=="string"?e:null,o=typeof e=="string"?r:e;return Z0t(this.state,n,o)}getJSON(){return this.state.doc.toJSON()}getHTML(){return Q0t(this.state.doc.content,this.schema)}getText(e){const{blockSeparator:r=`
115
+
116
+ `,textSerializers:n={}}=e||{};return tTt(this.state.doc,{blockSeparator:r,textSerializers:_(_({},n),D2(this.schema))})}get isEmpty(){return eTt(this.state.doc)}getCharacterCount(){return console.warn('[tiptap warn]: "editor.getCharacterCount()" is deprecated. Please use "editor.storage.characterCount.characters()" instead.'),this.state.doc.content.size-2}destroy(){this.emit("destroy"),this.view&&this.view.destroy(),this.removeAllListeners()}get isDestroyed(){var e;return!((e=this.view)===null||e===void 0?void 0:e.docView)}}class sn{constructor(e={}){this.type="node",this.name="node",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config=_(_({},this.config),e),this.name=this.config.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=yt(ot(this,"addOptions",{name:this.name}))),this.storage=yt(ot(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new sn(e)}configure(e={}){const r=this.extend();return r.options=ey(this.options,e),r.storage=yt(ot(r,"addStorage",{name:r.name,options:r.options})),r}extend(e={}){const r=new sn(e);return r.parent=this,this.child=r,r.name=e.name?e.name:r.parent.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${r.name}".`),r.options=yt(ot(r,"addOptions",{name:r.name})),r.storage=yt(ot(r,"addStorage",{name:r.name,options:r.options})),r}}class Nd{constructor(e={}){this.type="mark",this.name="mark",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config=_(_({},this.config),e),this.name=this.config.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=yt(ot(this,"addOptions",{name:this.name}))),this.storage=yt(ot(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new Nd(e)}configure(e={}){const r=this.extend();return r.options=ey(this.options,e),r.storage=yt(ot(r,"addStorage",{name:r.name,options:r.options})),r}extend(e={}){const r=new Nd(e);return r.parent=this,this.child=r,r.name=e.name?e.name:r.parent.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${r.name}".`),r.options=yt(ot(r,"addOptions",{name:r.name})),r.storage=yt(ot(r,"addStorage",{name:r.name,options:r.options})),r}}class mTt{constructor(e,r,n){this.isDragging=!1,this.component=e,this.editor=r.editor,this.options=_({stopEvent:null,ignoreMutation:null},n),this.extension=r.extension,this.node=r.node,this.decorations=r.decorations,this.getPos=r.getPos,this.mount()}mount(){}get dom(){return null}get contentDOM(){return null}onDragStart(e){var r,n,o;const{view:i}=this.editor,a=e.target,u=a.nodeType===3?(r=a.parentElement)===null||r===void 0?void 0:r.closest("[data-drag-handle]"):a.closest("[data-drag-handle]");if(!this.dom||((n=this.contentDOM)===null||n===void 0?void 0:n.contains(a))||!u)return;let c=0,s=0;if(this.dom!==u){const p=this.dom.getBoundingClientRect(),d=u.getBoundingClientRect();c=d.x-p.x+e.offsetX,s=d.y-p.y+e.offsetY}(o=e.dataTransfer)===null||o===void 0||o.setDragImage(this.dom,c,s);const f=dt.create(i.state.doc,this.getPos()),l=i.state.tr.setSelection(f);i.dispatch(l)}stopEvent(e){var r;if(!this.dom)return!1;if(typeof this.options.stopEvent=="function")return this.options.stopEvent({event:e});const n=e.target;if(!(this.dom.contains(n)&&!((r=this.contentDOM)===null||r===void 0?void 0:r.contains(n))))return!1;const i=e.type==="drop";if((["INPUT","BUTTON","SELECT","TEXTAREA"].includes(n.tagName)||n.isContentEditable)&&!i)return!0;const{isEditable:u}=this.editor,{isDragging:c}=this,s=!!this.node.type.spec.draggable,f=dt.isSelectable(this.node),l=e.type==="copy",p=e.type==="paste",d=e.type==="cut",h=e.type==="mousedown",m=e.type.startsWith("drag");if(!s&&f&&m&&e.preventDefault(),s&&m&&!c)return e.preventDefault(),!1;if(s&&u&&!c&&h){const g=n.closest("[data-drag-handle]");g&&(this.dom===g||this.dom.contains(g))&&(this.isDragging=!0,document.addEventListener("dragend",()=>{this.isDragging=!1},{once:!0}),document.addEventListener("mouseup",()=>{this.isDragging=!1},{once:!0}))}return!(c||i||l||p||d||h&&f)}ignoreMutation(e){return!this.dom||!this.contentDOM?!0:typeof this.options.ignoreMutation=="function"?this.options.ignoreMutation({mutation:e}):this.node.isLeaf||this.node.isAtom?!0:e.type==="selection"||this.dom.contains(e.target)&&e.type==="childList"&&ny()&&this.editor.isFocused&&[...Array.from(e.addedNodes),...Array.from(e.removedNodes)].every(n=>n.isContentEditable)?!1:this.contentDOM===e.target&&e.type==="attributes"?!0:!this.contentDOM.contains(e.target)}updateAttributes(e){this.editor.commands.command(({tr:r})=>{const n=this.getPos();return r.setNodeMarkup(n,void 0,_(_({},this.node.attrs),e)),!0})}deleteNode(){const e=this.getPos(),r=e+this.node.nodeSize;this.editor.commands.deleteRange({from:e,to:r})}}function rK(t,e,r){const n=[];return t===e?r.resolve(t).marks().forEach(o=>{const i=r.resolve(t-1),a=B1(i,o.type);!a||n.push(_({mark:o},a))}):r.nodesBetween(t,e,(o,i)=>{n.push(...o.marks.map(a=>({from:i,to:i+o.nodeSize,mark:a})))}),n}function fy(t){return new K1({find:t.find,handler:({state:e,range:r,match:n})=>{const o=yt(t.getAttributes,void 0,n);if(o===!1||o===null)return null;const{tr:i}=e,a=n[n.length-1],u=n[0];let c=r.to;if(a){const s=u.search(/\S/),f=r.from+u.indexOf(a),l=f+a.length;if(rK(r.from,r.to,e.doc).filter(d=>d.mark.type.excluded.find(m=>m===t.type&&m!==d.mark.type)).filter(d=>d.to>f).length)return null;l<r.to&&i.delete(l,r.to),f>r.from&&i.delete(r.from+s,f),c=r.from+s+a.length,i.addMark(r.from+s,c,t.type.create(o||{})),i.removeStoredMark(t.type)}}})}function G1(t){return new K1({find:t.find,handler:({state:e,range:r,match:n})=>{const o=e.doc.resolve(r.from),i=yt(t.getAttributes,void 0,n)||{};if(!o.node(-1).canReplaceWith(o.index(-1),o.indexAfter(-1),t.type))return null;e.tr.delete(r.from,r.to).setBlockType(r.from,r.from,t.type,i)}})}function nK(t){return new K1({find:t.find,handler:({state:e,range:r,match:n})=>{const o=yt(t.getAttributes,void 0,n)||{},i=e.tr.delete(r.from,r.to),u=i.doc.resolve(r.from).blockRange(),c=u&&VM(u,t.type,o);if(!c)return null;i.wrap(u,c);const s=i.doc.resolve(r.from-1).nodeBefore;s&&s.type===t.type&&$d(i.doc,r.from-1)&&(!t.joinPredicate||t.joinPredicate(n,s))&&i.join(r.from-1)}})}function ly(t){return new aTt({find:t.find,handler:({state:e,range:r,match:n})=>{const o=yt(t.getAttributes,void 0,n);if(o===!1||o===null)return null;const{tr:i}=e,a=n[n.length-1],u=n[0];let c=r.to;if(a){const s=u.search(/\S/),f=r.from+u.indexOf(a),l=f+a.length;if(rK(r.from,r.to,e.doc).filter(d=>d.mark.type.excluded.find(m=>m===t.type&&m!==d.mark.type)).filter(d=>d.to>f).length)return null;l<r.to&&i.delete(l,r.to),f>r.from&&i.delete(r.from+s,f),c=r.from+s+a.length,i.addMark(r.from+s,c,t.type.create(o||{})),i.removeStoredMark(t.type)}}})}function gTt(t){return t.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}function yTt(t){const e=bc.resolve(t);return tK(e)}function bTt(t){return L2(t)&&t instanceof dt}function oK(t,e,r){const n=0,o=t.state.doc.content.size,i=Ai(e,n,o),a=Ai(r,n,o),u=t.coordsAtPos(i),c=t.coordsAtPos(a,-1),s=Math.min(u.top,c.top),f=Math.max(u.bottom,c.bottom),l=Math.min(u.left,c.left),p=Math.max(u.right,c.right),d=p-l,h=f-s,b={top:s,bottom:f,left:l,right:p,width:d,height:h,x:l,y:s};return K(_({},b),{toJSON:()=>b})}var jr="top",wn="bottom",An="right",Br="left",Y1="auto",Pd=[jr,wn,An,Br],kf="start",Dd="end",$Tt="clippingParents",iK="viewport",Ld="popper",_Tt="reference",aK=Pd.reduce(function(t,e){return t.concat([e+"-"+kf,e+"-"+Dd])},[]),uK=[].concat(Pd,[Y1]).reduce(function(t,e){return t.concat([e,e+"-"+kf,e+"-"+Dd])},[]),STt="beforeRead",TTt="read",ITt="afterRead",OTt="beforeMain",MTt="main",RTt="afterMain",ETt="beforeWrite",wTt="write",ATt="afterWrite",CTt=[STt,TTt,ITt,OTt,MTt,RTt,ETt,wTt,ATt];function No(t){return t?(t.nodeName||"").toLowerCase():null}function uo(t){if(t==null)return window;if(t.toString()!=="[object Window]"){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function Wf(t){var e=uo(t).Element;return t instanceof e||t instanceof Element}function Cn(t){var e=uo(t).HTMLElement;return t instanceof e||t instanceof HTMLElement}function cK(t){if(typeof ShadowRoot=="undefined")return!1;var e=uo(t).ShadowRoot;return t instanceof e||t instanceof ShadowRoot}function xTt(t){var e=t.state;Object.keys(e.elements).forEach(function(r){var n=e.styles[r]||{},o=e.attributes[r]||{},i=e.elements[r];!Cn(i)||!No(i)||(Object.assign(i.style,n),Object.keys(o).forEach(function(a){var u=o[a];u===!1?i.removeAttribute(a):i.setAttribute(a,u===!0?"":u)}))})}function kTt(t){var e=t.state,r={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,r.popper),e.styles=r,e.elements.arrow&&Object.assign(e.elements.arrow.style,r.arrow),function(){Object.keys(e.elements).forEach(function(n){var o=e.elements[n],i=e.attributes[n]||{},a=Object.keys(e.styles.hasOwnProperty(n)?e.styles[n]:r[n]),u=a.reduce(function(c,s){return c[s]="",c},{});!Cn(o)||!No(o)||(Object.assign(o.style,u),Object.keys(i).forEach(function(c){o.removeAttribute(c)}))})}}var sK={name:"applyStyles",enabled:!0,phase:"write",fn:xTt,effect:kTt,requires:["computeStyles"]};function Po(t){return t.split("-")[0]}var $c=Math.max,py=Math.min,Ff=Math.round;function Nf(t,e){e===void 0&&(e=!1);var r=t.getBoundingClientRect(),n=1,o=1;if(Cn(t)&&e){var i=t.offsetHeight,a=t.offsetWidth;a>0&&(n=Ff(r.width)/a||1),i>0&&(o=Ff(r.height)/i||1)}return{width:r.width/n,height:r.height/o,top:r.top/o,right:r.right/n,bottom:r.bottom/o,left:r.left/n,x:r.left/n,y:r.top/o}}function X1(t){var e=Nf(t),r=t.offsetWidth,n=t.offsetHeight;return Math.abs(e.width-r)<=1&&(r=e.width),Math.abs(e.height-n)<=1&&(n=e.height),{x:t.offsetLeft,y:t.offsetTop,width:r,height:n}}function fK(t,e){var r=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(r&&cK(r)){var n=e;do{if(n&&t.isSameNode(n))return!0;n=n.parentNode||n.host}while(n)}return!1}function Ci(t){return uo(t).getComputedStyle(t)}function WTt(t){return["table","td","th"].indexOf(No(t))>=0}function Ba(t){return((Wf(t)?t.ownerDocument:t.document)||window.document).documentElement}function dy(t){return No(t)==="html"?t:t.assignedSlot||t.parentNode||(cK(t)?t.host:null)||Ba(t)}function lK(t){return!Cn(t)||Ci(t).position==="fixed"?null:t.offsetParent}function FTt(t){var e=navigator.userAgent.toLowerCase().indexOf("firefox")!==-1,r=navigator.userAgent.indexOf("Trident")!==-1;if(r&&Cn(t)){var n=Ci(t);if(n.position==="fixed")return null}for(var o=dy(t);Cn(o)&&["html","body"].indexOf(No(o))<0;){var i=Ci(o);if(i.transform!=="none"||i.perspective!=="none"||i.contain==="paint"||["transform","perspective"].indexOf(i.willChange)!==-1||e&&i.willChange==="filter"||e&&i.filter&&i.filter!=="none")return o;o=o.parentNode}return null}function Ud(t){for(var e=uo(t),r=lK(t);r&&WTt(r)&&Ci(r).position==="static";)r=lK(r);return r&&(No(r)==="html"||No(r)==="body"&&Ci(r).position==="static")?e:r||FTt(t)||e}function Z1(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function jd(t,e,r){return $c(t,py(e,r))}function NTt(t,e,r){var n=jd(t,e,r);return n>r?r:n}function pK(){return{top:0,right:0,bottom:0,left:0}}function dK(t){return Object.assign({},pK(),t)}function hK(t,e){return e.reduce(function(r,n){return r[n]=t,r},{})}var PTt=function(e,r){return e=typeof e=="function"?e(Object.assign({},r.rects,{placement:r.placement})):e,dK(typeof e!="number"?e:hK(e,Pd))};function DTt(t){var e,r=t.state,n=t.name,o=t.options,i=r.elements.arrow,a=r.modifiersData.popperOffsets,u=Po(r.placement),c=Z1(u),s=[Br,An].indexOf(u)>=0,f=s?"height":"width";if(!(!i||!a)){var l=PTt(o.padding,r),p=X1(i),d=c==="y"?jr:Br,h=c==="y"?wn:An,m=r.rects.reference[f]+r.rects.reference[c]-a[c]-r.rects.popper[f],g=a[c]-r.rects.reference[c],b=Ud(i),$=b?c==="y"?b.clientHeight||0:b.clientWidth||0:0,w=m/2-g/2,y=l[d],I=$-p[f]-l[h],S=$/2-p[f]/2+w,k=jd(y,S,I),C=c;r.modifiersData[n]=(e={},e[C]=k,e.centerOffset=k-S,e)}}function LTt(t){var e=t.state,r=t.options,n=r.element,o=n===void 0?"[data-popper-arrow]":n;o!=null&&(typeof o=="string"&&(o=e.elements.popper.querySelector(o),!o)||!fK(e.elements.popper,o)||(e.elements.arrow=o))}var UTt={name:"arrow",enabled:!0,phase:"main",fn:DTt,effect:LTt,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Pf(t){return t.split("-")[1]}var jTt={top:"auto",right:"auto",bottom:"auto",left:"auto"};function BTt(t){var e=t.x,r=t.y,n=window,o=n.devicePixelRatio||1;return{x:Ff(e*o)/o||0,y:Ff(r*o)/o||0}}function vK(t){var e,r=t.popper,n=t.popperRect,o=t.placement,i=t.variation,a=t.offsets,u=t.position,c=t.gpuAcceleration,s=t.adaptive,f=t.roundOffsets,l=t.isFixed,p=a.x,d=p===void 0?0:p,h=a.y,m=h===void 0?0:h,g=typeof f=="function"?f({x:d,y:m}):{x:d,y:m};d=g.x,m=g.y;var b=a.hasOwnProperty("x"),$=a.hasOwnProperty("y"),w=Br,y=jr,I=window;if(s){var S=Ud(r),k="clientHeight",C="clientWidth";if(S===uo(r)&&(S=Ba(r),Ci(S).position!=="static"&&u==="absolute"&&(k="scrollHeight",C="scrollWidth")),S=S,o===jr||(o===Br||o===An)&&i===Dd){y=wn;var B=l&&I.visualViewport?I.visualViewport.height:S[k];m-=B-n.height,m*=c?1:-1}if(o===Br||(o===jr||o===wn)&&i===Dd){w=An;var q=l&&I.visualViewport?I.visualViewport.width:S[C];d-=q-n.width,d*=c?1:-1}}var G=Object.assign({position:u},s&&jTt),O=f===!0?BTt({x:d,y:m}):{x:d,y:m};if(d=O.x,m=O.y,c){var R;return Object.assign({},G,(R={},R[y]=$?"0":"",R[w]=b?"0":"",R.transform=(I.devicePixelRatio||1)<=1?"translate("+d+"px, "+m+"px)":"translate3d("+d+"px, "+m+"px, 0)",R))}return Object.assign({},G,(e={},e[y]=$?m+"px":"",e[w]=b?d+"px":"",e.transform="",e))}function zTt(t){var e=t.state,r=t.options,n=r.gpuAcceleration,o=n===void 0?!0:n,i=r.adaptive,a=i===void 0?!0:i,u=r.roundOffsets,c=u===void 0?!0:u,s={placement:Po(e.placement),variation:Pf(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:o,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,vK(Object.assign({},s,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:a,roundOffsets:c})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,vK(Object.assign({},s,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:c})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}var qTt={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:zTt,data:{}},hy={passive:!0};function KTt(t){var e=t.state,r=t.instance,n=t.options,o=n.scroll,i=o===void 0?!0:o,a=n.resize,u=a===void 0?!0:a,c=uo(e.elements.popper),s=[].concat(e.scrollParents.reference,e.scrollParents.popper);return i&&s.forEach(function(f){f.addEventListener("scroll",r.update,hy)}),u&&c.addEventListener("resize",r.update,hy),function(){i&&s.forEach(function(f){f.removeEventListener("scroll",r.update,hy)}),u&&c.removeEventListener("resize",r.update,hy)}}var VTt={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:KTt,data:{}},HTt={left:"right",right:"left",bottom:"top",top:"bottom"};function vy(t){return t.replace(/left|right|bottom|top/g,function(e){return HTt[e]})}var JTt={start:"end",end:"start"};function mK(t){return t.replace(/start|end/g,function(e){return JTt[e]})}function Q1(t){var e=uo(t),r=e.pageXOffset,n=e.pageYOffset;return{scrollLeft:r,scrollTop:n}}function tR(t){return Nf(Ba(t)).left+Q1(t).scrollLeft}function GTt(t){var e=uo(t),r=Ba(t),n=e.visualViewport,o=r.clientWidth,i=r.clientHeight,a=0,u=0;return n&&(o=n.width,i=n.height,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||(a=n.offsetLeft,u=n.offsetTop)),{width:o,height:i,x:a+tR(t),y:u}}function YTt(t){var e,r=Ba(t),n=Q1(t),o=(e=t.ownerDocument)==null?void 0:e.body,i=$c(r.scrollWidth,r.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),a=$c(r.scrollHeight,r.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),u=-n.scrollLeft+tR(t),c=-n.scrollTop;return Ci(o||r).direction==="rtl"&&(u+=$c(r.clientWidth,o?o.clientWidth:0)-i),{width:i,height:a,x:u,y:c}}function eR(t){var e=Ci(t),r=e.overflow,n=e.overflowX,o=e.overflowY;return/auto|scroll|overlay|hidden/.test(r+o+n)}function gK(t){return["html","body","#document"].indexOf(No(t))>=0?t.ownerDocument.body:Cn(t)&&eR(t)?t:gK(dy(t))}function Bd(t,e){var r;e===void 0&&(e=[]);var n=gK(t),o=n===((r=t.ownerDocument)==null?void 0:r.body),i=uo(n),a=o?[i].concat(i.visualViewport||[],eR(n)?n:[]):n,u=e.concat(a);return o?u:u.concat(Bd(dy(a)))}function rR(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function XTt(t){var e=Nf(t);return e.top=e.top+t.clientTop,e.left=e.left+t.clientLeft,e.bottom=e.top+t.clientHeight,e.right=e.left+t.clientWidth,e.width=t.clientWidth,e.height=t.clientHeight,e.x=e.left,e.y=e.top,e}function yK(t,e){return e===iK?rR(GTt(t)):Wf(e)?XTt(e):rR(YTt(Ba(t)))}function ZTt(t){var e=Bd(dy(t)),r=["absolute","fixed"].indexOf(Ci(t).position)>=0,n=r&&Cn(t)?Ud(t):t;return Wf(n)?e.filter(function(o){return Wf(o)&&fK(o,n)&&No(o)!=="body"}):[]}function QTt(t,e,r){var n=e==="clippingParents"?ZTt(t):[].concat(e),o=[].concat(n,[r]),i=o[0],a=o.reduce(function(u,c){var s=yK(t,c);return u.top=$c(s.top,u.top),u.right=py(s.right,u.right),u.bottom=py(s.bottom,u.bottom),u.left=$c(s.left,u.left),u},yK(t,i));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function bK(t){var e=t.reference,r=t.element,n=t.placement,o=n?Po(n):null,i=n?Pf(n):null,a=e.x+e.width/2-r.width/2,u=e.y+e.height/2-r.height/2,c;switch(o){case jr:c={x:a,y:e.y-r.height};break;case wn:c={x:a,y:e.y+e.height};break;case An:c={x:e.x+e.width,y:u};break;case Br:c={x:e.x-r.width,y:u};break;default:c={x:e.x,y:e.y}}var s=o?Z1(o):null;if(s!=null){var f=s==="y"?"height":"width";switch(i){case kf:c[s]=c[s]-(e[f]/2-r[f]/2);break;case Dd:c[s]=c[s]+(e[f]/2-r[f]/2);break}}return c}function zd(t,e){e===void 0&&(e={});var r=e,n=r.placement,o=n===void 0?t.placement:n,i=r.boundary,a=i===void 0?$Tt:i,u=r.rootBoundary,c=u===void 0?iK:u,s=r.elementContext,f=s===void 0?Ld:s,l=r.altBoundary,p=l===void 0?!1:l,d=r.padding,h=d===void 0?0:d,m=dK(typeof h!="number"?h:hK(h,Pd)),g=f===Ld?_Tt:Ld,b=t.rects.popper,$=t.elements[p?g:f],w=QTt(Wf($)?$:$.contextElement||Ba(t.elements.popper),a,c),y=Nf(t.elements.reference),I=bK({reference:y,element:b,strategy:"absolute",placement:o}),S=rR(Object.assign({},b,I)),k=f===Ld?S:y,C={top:w.top-k.top+m.top,bottom:k.bottom-w.bottom+m.bottom,left:w.left-k.left+m.left,right:k.right-w.right+m.right},B=t.modifiersData.offset;if(f===Ld&&B){var q=B[o];Object.keys(C).forEach(function(G){var O=[An,wn].indexOf(G)>=0?1:-1,R=[jr,wn].indexOf(G)>=0?"y":"x";C[G]+=q[R]*O})}return C}function tIt(t,e){e===void 0&&(e={});var r=e,n=r.placement,o=r.boundary,i=r.rootBoundary,a=r.padding,u=r.flipVariations,c=r.allowedAutoPlacements,s=c===void 0?uK:c,f=Pf(n),l=f?u?aK:aK.filter(function(h){return Pf(h)===f}):Pd,p=l.filter(function(h){return s.indexOf(h)>=0});p.length===0&&(p=l);var d=p.reduce(function(h,m){return h[m]=zd(t,{placement:m,boundary:o,rootBoundary:i,padding:a})[Po(m)],h},{});return Object.keys(d).sort(function(h,m){return d[h]-d[m]})}function eIt(t){if(Po(t)===Y1)return[];var e=vy(t);return[mK(t),e,mK(e)]}function rIt(t){var e=t.state,r=t.options,n=t.name;if(!e.modifiersData[n]._skip){for(var o=r.mainAxis,i=o===void 0?!0:o,a=r.altAxis,u=a===void 0?!0:a,c=r.fallbackPlacements,s=r.padding,f=r.boundary,l=r.rootBoundary,p=r.altBoundary,d=r.flipVariations,h=d===void 0?!0:d,m=r.allowedAutoPlacements,g=e.options.placement,b=Po(g),$=b===g,w=c||($||!h?[vy(g)]:eIt(g)),y=[g].concat(w).reduce(function(Ut,_e){return Ut.concat(Po(_e)===Y1?tIt(e,{placement:_e,boundary:f,rootBoundary:l,padding:s,flipVariations:h,allowedAutoPlacements:m}):_e)},[]),I=e.rects.reference,S=e.rects.popper,k=new Map,C=!0,B=y[0],q=0;q<y.length;q++){var G=y[q],O=Po(G),R=Pf(G)===kf,x=[jr,wn].indexOf(O)>=0,F=x?"width":"height",L=zd(e,{placement:G,boundary:f,rootBoundary:l,altBoundary:p,padding:s}),U=x?R?An:Br:R?wn:jr;I[F]>S[F]&&(U=vy(U));var rt=vy(U),T=[];if(i&&T.push(L[O]<=0),u&&T.push(L[U]<=0,L[rt]<=0),T.every(function(Ut){return Ut})){B=G,C=!1;break}k.set(G,T)}if(C)for(var M=h?3:1,N=function(_e){var Ir=y.find(function(jo){var fo=k.get(jo);if(fo)return fo.slice(0,_e).every(function(Ja){return Ja})});if(Ir)return B=Ir,"break"},at=M;at>0;at--){var cr=N(at);if(cr==="break")break}e.placement!==B&&(e.modifiersData[n]._skip=!0,e.placement=B,e.reset=!0)}}var nIt={name:"flip",enabled:!0,phase:"main",fn:rIt,requiresIfExists:["offset"],data:{_skip:!1}};function $K(t,e,r){return r===void 0&&(r={x:0,y:0}),{top:t.top-e.height-r.y,right:t.right-e.width+r.x,bottom:t.bottom-e.height+r.y,left:t.left-e.width-r.x}}function _K(t){return[jr,An,wn,Br].some(function(e){return t[e]>=0})}function oIt(t){var e=t.state,r=t.name,n=e.rects.reference,o=e.rects.popper,i=e.modifiersData.preventOverflow,a=zd(e,{elementContext:"reference"}),u=zd(e,{altBoundary:!0}),c=$K(a,n),s=$K(u,o,i),f=_K(c),l=_K(s);e.modifiersData[r]={referenceClippingOffsets:c,popperEscapeOffsets:s,isReferenceHidden:f,hasPopperEscaped:l},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":f,"data-popper-escaped":l})}var iIt={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:oIt};function aIt(t,e,r){var n=Po(t),o=[Br,jr].indexOf(n)>=0?-1:1,i=typeof r=="function"?r(Object.assign({},e,{placement:t})):r,a=i[0],u=i[1];return a=a||0,u=(u||0)*o,[Br,An].indexOf(n)>=0?{x:u,y:a}:{x:a,y:u}}function uIt(t){var e=t.state,r=t.options,n=t.name,o=r.offset,i=o===void 0?[0,0]:o,a=uK.reduce(function(f,l){return f[l]=aIt(l,e.rects,i),f},{}),u=a[e.placement],c=u.x,s=u.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=c,e.modifiersData.popperOffsets.y+=s),e.modifiersData[n]=a}var cIt={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:uIt};function sIt(t){var e=t.state,r=t.name;e.modifiersData[r]=bK({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}var fIt={name:"popperOffsets",enabled:!0,phase:"read",fn:sIt,data:{}};function lIt(t){return t==="x"?"y":"x"}function pIt(t){var e=t.state,r=t.options,n=t.name,o=r.mainAxis,i=o===void 0?!0:o,a=r.altAxis,u=a===void 0?!1:a,c=r.boundary,s=r.rootBoundary,f=r.altBoundary,l=r.padding,p=r.tether,d=p===void 0?!0:p,h=r.tetherOffset,m=h===void 0?0:h,g=zd(e,{boundary:c,rootBoundary:s,padding:l,altBoundary:f}),b=Po(e.placement),$=Pf(e.placement),w=!$,y=Z1(b),I=lIt(y),S=e.modifiersData.popperOffsets,k=e.rects.reference,C=e.rects.popper,B=typeof m=="function"?m(Object.assign({},e.rects,{placement:e.placement})):m,q=typeof B=="number"?{mainAxis:B,altAxis:B}:Object.assign({mainAxis:0,altAxis:0},B),G=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,O={x:0,y:0};if(!!S){if(i){var R,x=y==="y"?jr:Br,F=y==="y"?wn:An,L=y==="y"?"height":"width",U=S[y],rt=U+g[x],T=U-g[F],M=d?-C[L]/2:0,N=$===kf?k[L]:C[L],at=$===kf?-C[L]:-k[L],cr=e.elements.arrow,Ut=d&&cr?X1(cr):{width:0,height:0},_e=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:pK(),Ir=_e[x],jo=_e[F],fo=jd(0,k[L],Ut[L]),Ja=w?k[L]/2-M-fo-Ir-q.mainAxis:N-fo-Ir-q.mainAxis,Bo=w?-k[L]/2+M+fo+jo+q.mainAxis:at+fo+jo+q.mainAxis,Ga=e.elements.arrow&&Ud(e.elements.arrow),Kf=Ga?y==="y"?Ga.clientTop||0:Ga.clientLeft||0:0,Mc=(R=G==null?void 0:G[y])!=null?R:0,Vf=U+Ja-Mc-Kf,Hf=U+Bo-Mc,Rc=jd(d?py(rt,Vf):rt,U,d?$c(T,Hf):T);S[y]=Rc,O[y]=Rc-U}if(u){var Ec,Jf=y==="x"?jr:Br,Gf=y==="x"?wn:An,xn=S[I],zo=I==="y"?"height":"width",wc=xn+g[Jf],Di=xn-g[Gf],Ac=[jr,Br].indexOf(b)!==-1,Yf=(Ec=G==null?void 0:G[I])!=null?Ec:0,Xf=Ac?wc:xn-k[zo]-C[zo]-Yf+q.altAxis,Zf=Ac?xn+k[zo]+C[zo]-Yf-q.altAxis:Di,Qf=d&&Ac?NTt(Xf,xn,Zf):jd(d?Xf:wc,xn,d?Zf:Di);S[I]=Qf,O[I]=Qf-xn}e.modifiersData[n]=O}}var dIt={name:"preventOverflow",enabled:!0,phase:"main",fn:pIt,requiresIfExists:["offset"]};function hIt(t){return{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}}function vIt(t){return t===uo(t)||!Cn(t)?Q1(t):hIt(t)}function mIt(t){var e=t.getBoundingClientRect(),r=Ff(e.width)/t.offsetWidth||1,n=Ff(e.height)/t.offsetHeight||1;return r!==1||n!==1}function gIt(t,e,r){r===void 0&&(r=!1);var n=Cn(e),o=Cn(e)&&mIt(e),i=Ba(e),a=Nf(t,o),u={scrollLeft:0,scrollTop:0},c={x:0,y:0};return(n||!n&&!r)&&((No(e)!=="body"||eR(i))&&(u=vIt(e)),Cn(e)?(c=Nf(e,!0),c.x+=e.clientLeft,c.y+=e.clientTop):i&&(c.x=tR(i))),{x:a.left+u.scrollLeft-c.x,y:a.top+u.scrollTop-c.y,width:a.width,height:a.height}}function yIt(t){var e=new Map,r=new Set,n=[];t.forEach(function(i){e.set(i.name,i)});function o(i){r.add(i.name);var a=[].concat(i.requires||[],i.requiresIfExists||[]);a.forEach(function(u){if(!r.has(u)){var c=e.get(u);c&&o(c)}}),n.push(i)}return t.forEach(function(i){r.has(i.name)||o(i)}),n}function bIt(t){var e=yIt(t);return CTt.reduce(function(r,n){return r.concat(e.filter(function(o){return o.phase===n}))},[])}function $It(t){var e;return function(){return e||(e=new Promise(function(r){Promise.resolve().then(function(){e=void 0,r(t())})})),e}}function _It(t){var e=t.reduce(function(r,n){var o=r[n.name];return r[n.name]=o?Object.assign({},o,n,{options:Object.assign({},o.options,n.options),data:Object.assign({},o.data,n.data)}):n,r},{});return Object.keys(e).map(function(r){return e[r]})}var SK={placement:"bottom",modifiers:[],strategy:"absolute"};function TK(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return!e.some(function(n){return!(n&&typeof n.getBoundingClientRect=="function")})}function SIt(t){t===void 0&&(t={});var e=t,r=e.defaultModifiers,n=r===void 0?[]:r,o=e.defaultOptions,i=o===void 0?SK:o;return function(u,c,s){s===void 0&&(s=i);var f={placement:"bottom",orderedModifiers:[],options:Object.assign({},SK,i),modifiersData:{},elements:{reference:u,popper:c},attributes:{},styles:{}},l=[],p=!1,d={state:f,setOptions:function(b){var $=typeof b=="function"?b(f.options):b;m(),f.options=Object.assign({},i,f.options,$),f.scrollParents={reference:Wf(u)?Bd(u):u.contextElement?Bd(u.contextElement):[],popper:Bd(c)};var w=bIt(_It([].concat(n,f.options.modifiers)));return f.orderedModifiers=w.filter(function(y){return y.enabled}),h(),d.update()},forceUpdate:function(){if(!p){var b=f.elements,$=b.reference,w=b.popper;if(!!TK($,w)){f.rects={reference:gIt($,Ud(w),f.options.strategy==="fixed"),popper:X1(w)},f.reset=!1,f.placement=f.options.placement,f.orderedModifiers.forEach(function(q){return f.modifiersData[q.name]=Object.assign({},q.data)});for(var y=0;y<f.orderedModifiers.length;y++){if(f.reset===!0){f.reset=!1,y=-1;continue}var I=f.orderedModifiers[y],S=I.fn,k=I.options,C=k===void 0?{}:k,B=I.name;typeof S=="function"&&(f=S({state:f,options:C,name:B,instance:d})||f)}}}},update:$It(function(){return new Promise(function(g){d.forceUpdate(),g(f)})}),destroy:function(){m(),p=!0}};if(!TK(u,c))return d;d.setOptions(s).then(function(g){!p&&s.onFirstUpdate&&s.onFirstUpdate(g)});function h(){f.orderedModifiers.forEach(function(g){var b=g.name,$=g.options,w=$===void 0?{}:$,y=g.effect;if(typeof y=="function"){var I=y({state:f,name:b,instance:d,options:w}),S=function(){};l.push(I||S)}})}function m(){l.forEach(function(g){return g()}),l=[]}return d}}var TIt=[VTt,fIt,qTt,sK,cIt,nIt,dIt,UTt,iIt],IIt=SIt({defaultModifiers:TIt}),OIt="tippy-box",IK="tippy-content",MIt="tippy-backdrop",OK="tippy-arrow",MK="tippy-svg-arrow",_c={passive:!0,capture:!0},RK=function(){return document.body};function nR(t,e,r){if(Array.isArray(t)){var n=t[e];return n==null?Array.isArray(r)?r[e]:r:n}return t}function oR(t,e){var r={}.toString.call(t);return r.indexOf("[object")===0&&r.indexOf(e+"]")>-1}function EK(t,e){return typeof t=="function"?t.apply(void 0,e):t}function wK(t,e){if(e===0)return t;var r;return function(n){clearTimeout(r),r=setTimeout(function(){t(n)},e)}}function RIt(t){return t.split(/\s+/).filter(Boolean)}function Df(t){return[].concat(t)}function AK(t,e){t.indexOf(e)===-1&&t.push(e)}function EIt(t){return t.filter(function(e,r){return t.indexOf(e)===r})}function wIt(t){return t.split("-")[0]}function my(t){return[].slice.call(t)}function CK(t){return Object.keys(t).reduce(function(e,r){return t[r]!==void 0&&(e[r]=t[r]),e},{})}function qd(){return document.createElement("div")}function gy(t){return["Element","Fragment"].some(function(e){return oR(t,e)})}function AIt(t){return oR(t,"NodeList")}function CIt(t){return oR(t,"MouseEvent")}function xIt(t){return!!(t&&t._tippy&&t._tippy.reference===t)}function kIt(t){return gy(t)?[t]:AIt(t)?my(t):Array.isArray(t)?t:my(document.querySelectorAll(t))}function iR(t,e){t.forEach(function(r){r&&(r.style.transitionDuration=e+"ms")})}function xK(t,e){t.forEach(function(r){r&&r.setAttribute("data-state",e)})}function WIt(t){var e,r=Df(t),n=r[0];return n!=null&&(e=n.ownerDocument)!=null&&e.body?n.ownerDocument:document}function FIt(t,e){var r=e.clientX,n=e.clientY;return t.every(function(o){var i=o.popperRect,a=o.popperState,u=o.props,c=u.interactiveBorder,s=wIt(a.placement),f=a.modifiersData.offset;if(!f)return!0;var l=s==="bottom"?f.top.y:0,p=s==="top"?f.bottom.y:0,d=s==="right"?f.left.x:0,h=s==="left"?f.right.x:0,m=i.top-n+l>c,g=n-i.bottom-p>c,b=i.left-r+d>c,$=r-i.right-h>c;return m||g||b||$})}function aR(t,e,r){var n=e+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(o){t[n](o,r)})}function kK(t,e){for(var r=e;r;){var n;if(t.contains(r))return!0;r=r.getRootNode==null||(n=r.getRootNode())==null?void 0:n.host}return!1}var Do={isTouch:!1},WK=0;function NIt(){Do.isTouch||(Do.isTouch=!0,window.performance&&document.addEventListener("mousemove",FK))}function FK(){var t=performance.now();t-WK<20&&(Do.isTouch=!1,document.removeEventListener("mousemove",FK)),WK=t}function PIt(){var t=document.activeElement;if(xIt(t)){var e=t._tippy;t.blur&&!e.state.isVisible&&t.blur()}}function DIt(){document.addEventListener("touchstart",NIt,_c),window.addEventListener("blur",PIt)}var LIt=typeof window!="undefined"&&typeof document!="undefined",UIt=LIt?!!window.msCrypto:!1,jIt={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},BIt={allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999},co=Object.assign({appendTo:RK,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},jIt,BIt),zIt=Object.keys(co),qIt=function(e){var r=Object.keys(e);r.forEach(function(n){co[n]=e[n]})};function NK(t){var e=t.plugins||[],r=e.reduce(function(n,o){var i=o.name,a=o.defaultValue;if(i){var u;n[i]=t[i]!==void 0?t[i]:(u=co[i])!=null?u:a}return n},{});return Object.assign({},t,r)}function KIt(t,e){var r=e?Object.keys(NK(Object.assign({},co,{plugins:e}))):zIt,n=r.reduce(function(o,i){var a=(t.getAttribute("data-tippy-"+i)||"").trim();if(!a)return o;if(i==="content")o[i]=a;else try{o[i]=JSON.parse(a)}catch{o[i]=a}return o},{});return n}function PK(t,e){var r=Object.assign({},e,{content:EK(e.content,[t])},e.ignoreAttributes?{}:KIt(t,e.plugins));return r.aria=Object.assign({},co.aria,r.aria),r.aria={expanded:r.aria.expanded==="auto"?e.interactive:r.aria.expanded,content:r.aria.content==="auto"?e.interactive?null:"describedby":r.aria.content},r}var VIt=function(){return"innerHTML"};function uR(t,e){t[VIt()]=e}function DK(t){var e=qd();return t===!0?e.className=OK:(e.className=MK,gy(t)?e.appendChild(t):uR(e,t)),e}function LK(t,e){gy(e.content)?(uR(t,""),t.appendChild(e.content)):typeof e.content!="function"&&(e.allowHTML?uR(t,e.content):t.textContent=e.content)}function cR(t){var e=t.firstElementChild,r=my(e.children);return{box:e,content:r.find(function(n){return n.classList.contains(IK)}),arrow:r.find(function(n){return n.classList.contains(OK)||n.classList.contains(MK)}),backdrop:r.find(function(n){return n.classList.contains(MIt)})}}function UK(t){var e=qd(),r=qd();r.className=OIt,r.setAttribute("data-state","hidden"),r.setAttribute("tabindex","-1");var n=qd();n.className=IK,n.setAttribute("data-state","hidden"),LK(n,t.props),e.appendChild(r),r.appendChild(n),o(t.props,t.props);function o(i,a){var u=cR(e),c=u.box,s=u.content,f=u.arrow;a.theme?c.setAttribute("data-theme",a.theme):c.removeAttribute("data-theme"),typeof a.animation=="string"?c.setAttribute("data-animation",a.animation):c.removeAttribute("data-animation"),a.inertia?c.setAttribute("data-inertia",""):c.removeAttribute("data-inertia"),c.style.maxWidth=typeof a.maxWidth=="number"?a.maxWidth+"px":a.maxWidth,a.role?c.setAttribute("role",a.role):c.removeAttribute("role"),(i.content!==a.content||i.allowHTML!==a.allowHTML)&&LK(s,t.props),a.arrow?f?i.arrow!==a.arrow&&(c.removeChild(f),c.appendChild(DK(a.arrow))):c.appendChild(DK(a.arrow)):f&&c.removeChild(f)}return{popper:e,onUpdate:o}}UK.$$tippy=!0;var HIt=1,yy=[],sR=[];function JIt(t,e){var r=PK(t,Object.assign({},co,NK(CK(e)))),n,o,i,a=!1,u=!1,c=!1,s=!1,f,l,p,d=[],h=wK(Vf,r.interactiveDebounce),m,g=HIt++,b=null,$=EIt(r.plugins),w={isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},y={id:g,reference:t,popper:qd(),popperInstance:b,props:r,state:w,plugins:$,clearDelayTimeouts:Xf,setProps:Zf,setContent:Qf,show:FR,hide:A,hideWithInteractivity:E,enable:Ac,disable:Yf,unmount:P,destroy:Rt};if(!r.render)return y;var I=r.render(y),S=I.popper,k=I.onUpdate;S.setAttribute("data-tippy-root",""),S.id="tippy-"+y.id,y.popper=S,t._tippy=y,S._tippy=y;var C=$.map(function(W){return W.fn(y)}),B=t.hasAttribute("aria-expanded");return Ga(),M(),U(),rt("onCreate",[y]),r.showOnCreate&&wc(),S.addEventListener("mouseenter",function(){y.props.interactive&&y.state.isVisible&&y.clearDelayTimeouts()}),S.addEventListener("mouseleave",function(){y.props.interactive&&y.props.trigger.indexOf("mouseenter")>=0&&x().addEventListener("mousemove",h)}),y;function q(){var W=y.props.touch;return Array.isArray(W)?W:[W,0]}function G(){return q()[0]==="hold"}function O(){var W;return!!((W=y.props.render)!=null&&W.$$tippy)}function R(){return m||t}function x(){var W=R().parentNode;return W?WIt(W):document}function F(){return cR(S)}function L(W){return y.state.isMounted&&!y.state.isVisible||Do.isTouch||f&&f.type==="focus"?0:nR(y.props.delay,W?0:1,co.delay)}function U(W){W===void 0&&(W=!1),S.style.pointerEvents=y.props.interactive&&!W?"":"none",S.style.zIndex=""+y.props.zIndex}function rt(W,Q,ft){if(ft===void 0&&(ft=!0),C.forEach(function(vt){vt[W]&&vt[W].apply(vt,Q)}),ft){var st;(st=y.props)[W].apply(st,Q)}}function T(){var W=y.props.aria;if(!!W.content){var Q="aria-"+W.content,ft=S.id,st=Df(y.props.triggerTarget||t);st.forEach(function(vt){var ue=vt.getAttribute(Q);if(y.state.isVisible)vt.setAttribute(Q,ue?ue+" "+ft:ft);else{var kn=ue&&ue.replace(ft,"").trim();kn?vt.setAttribute(Q,kn):vt.removeAttribute(Q)}})}}function M(){if(!(B||!y.props.aria.expanded)){var W=Df(y.props.triggerTarget||t);W.forEach(function(Q){y.props.interactive?Q.setAttribute("aria-expanded",y.state.isVisible&&Q===R()?"true":"false"):Q.removeAttribute("aria-expanded")})}}function N(){x().removeEventListener("mousemove",h),yy=yy.filter(function(W){return W!==h})}function at(W){if(!(Do.isTouch&&(c||W.type==="mousedown"))){var Q=W.composedPath&&W.composedPath()[0]||W.target;if(!(y.props.interactive&&kK(S,Q))){if(Df(y.props.triggerTarget||t).some(function(ft){return kK(ft,Q)})){if(Do.isTouch||y.state.isVisible&&y.props.trigger.indexOf("click")>=0)return}else rt("onClickOutside",[y,W]);y.props.hideOnClick===!0&&(y.clearDelayTimeouts(),y.hide(),u=!0,setTimeout(function(){u=!1}),y.state.isMounted||Ir())}}}function cr(){c=!0}function Ut(){c=!1}function _e(){var W=x();W.addEventListener("mousedown",at,!0),W.addEventListener("touchend",at,_c),W.addEventListener("touchstart",Ut,_c),W.addEventListener("touchmove",cr,_c)}function Ir(){var W=x();W.removeEventListener("mousedown",at,!0),W.removeEventListener("touchend",at,_c),W.removeEventListener("touchstart",Ut,_c),W.removeEventListener("touchmove",cr,_c)}function jo(W,Q){Ja(W,function(){!y.state.isVisible&&S.parentNode&&S.parentNode.contains(S)&&Q()})}function fo(W,Q){Ja(W,Q)}function Ja(W,Q){var ft=F().box;function st(vt){vt.target===ft&&(aR(ft,"remove",st),Q())}if(W===0)return Q();aR(ft,"remove",l),aR(ft,"add",st),l=st}function Bo(W,Q,ft){ft===void 0&&(ft=!1);var st=Df(y.props.triggerTarget||t);st.forEach(function(vt){vt.addEventListener(W,Q,ft),d.push({node:vt,eventType:W,handler:Q,options:ft})})}function Ga(){G()&&(Bo("touchstart",Mc,{passive:!0}),Bo("touchend",Hf,{passive:!0})),RIt(y.props.trigger).forEach(function(W){if(W!=="manual")switch(Bo(W,Mc),W){case"mouseenter":Bo("mouseleave",Hf);break;case"focus":Bo(UIt?"focusout":"blur",Rc);break;case"focusin":Bo("focusout",Rc);break}})}function Kf(){d.forEach(function(W){var Q=W.node,ft=W.eventType,st=W.handler,vt=W.options;Q.removeEventListener(ft,st,vt)}),d=[]}function Mc(W){var Q,ft=!1;if(!(!y.state.isEnabled||Ec(W)||u)){var st=((Q=f)==null?void 0:Q.type)==="focus";f=W,m=W.currentTarget,M(),!y.state.isVisible&&CIt(W)&&yy.forEach(function(vt){return vt(W)}),W.type==="click"&&(y.props.trigger.indexOf("mouseenter")<0||a)&&y.props.hideOnClick!==!1&&y.state.isVisible?ft=!0:wc(W),W.type==="click"&&(a=!ft),ft&&!st&&Di(W)}}function Vf(W){var Q=W.target,ft=R().contains(Q)||S.contains(Q);if(!(W.type==="mousemove"&&ft)){var st=zo().concat(S).map(function(vt){var ue,kn=vt._tippy,tl=(ue=kn.popperInstance)==null?void 0:ue.state;return tl?{popperRect:vt.getBoundingClientRect(),popperState:tl,props:r}:null}).filter(Boolean);FIt(st,W)&&(N(),Di(W))}}function Hf(W){var Q=Ec(W)||y.props.trigger.indexOf("click")>=0&&a;if(!Q){if(y.props.interactive){y.hideWithInteractivity(W);return}Di(W)}}function Rc(W){y.props.trigger.indexOf("focusin")<0&&W.target!==R()||y.props.interactive&&W.relatedTarget&&S.contains(W.relatedTarget)||Di(W)}function Ec(W){return Do.isTouch?G()!==W.type.indexOf("touch")>=0:!1}function Jf(){Gf();var W=y.props,Q=W.popperOptions,ft=W.placement,st=W.offset,vt=W.getReferenceClientRect,ue=W.moveTransition,kn=O()?cR(S).arrow:null,tl=vt?{getBoundingClientRect:vt,contextElement:vt.contextElement||R()}:t,j3={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(By){var el=By.state;if(O()){var P1t=F(),PR=P1t.box;["placement","reference-hidden","escaped"].forEach(function(zy){zy==="placement"?PR.setAttribute("data-placement",el.placement):el.attributes.popper["data-popper-"+zy]?PR.setAttribute("data-"+zy,""):PR.removeAttribute("data-"+zy)}),el.attributes.popper={}}}},Cc=[{name:"offset",options:{offset:st}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!ue}},j3];O()&&kn&&Cc.push({name:"arrow",options:{element:kn,padding:3}}),Cc.push.apply(Cc,(Q==null?void 0:Q.modifiers)||[]),y.popperInstance=IIt(tl,S,Object.assign({},Q,{placement:ft,onFirstUpdate:p,modifiers:Cc}))}function Gf(){y.popperInstance&&(y.popperInstance.destroy(),y.popperInstance=null)}function xn(){var W=y.props.appendTo,Q,ft=R();y.props.interactive&&W===RK||W==="parent"?Q=ft.parentNode:Q=EK(W,[ft]),Q.contains(S)||Q.appendChild(S),y.state.isMounted=!0,Jf()}function zo(){return my(S.querySelectorAll("[data-tippy-root]"))}function wc(W){y.clearDelayTimeouts(),W&&rt("onTrigger",[y,W]),_e();var Q=L(!0),ft=q(),st=ft[0],vt=ft[1];Do.isTouch&&st==="hold"&&vt&&(Q=vt),Q?n=setTimeout(function(){y.show()},Q):y.show()}function Di(W){if(y.clearDelayTimeouts(),rt("onUntrigger",[y,W]),!y.state.isVisible){Ir();return}if(!(y.props.trigger.indexOf("mouseenter")>=0&&y.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(W.type)>=0&&a)){var Q=L(!1);Q?o=setTimeout(function(){y.state.isVisible&&y.hide()},Q):i=requestAnimationFrame(function(){y.hide()})}}function Ac(){y.state.isEnabled=!0}function Yf(){y.hide(),y.state.isEnabled=!1}function Xf(){clearTimeout(n),clearTimeout(o),cancelAnimationFrame(i)}function Zf(W){if(!y.state.isDestroyed){rt("onBeforeUpdate",[y,W]),Kf();var Q=y.props,ft=PK(t,Object.assign({},Q,CK(W),{ignoreAttributes:!0}));y.props=ft,Ga(),Q.interactiveDebounce!==ft.interactiveDebounce&&(N(),h=wK(Vf,ft.interactiveDebounce)),Q.triggerTarget&&!ft.triggerTarget?Df(Q.triggerTarget).forEach(function(st){st.removeAttribute("aria-expanded")}):ft.triggerTarget&&t.removeAttribute("aria-expanded"),M(),U(),k&&k(Q,ft),y.popperInstance&&(Jf(),zo().forEach(function(st){requestAnimationFrame(st._tippy.popperInstance.forceUpdate)})),rt("onAfterUpdate",[y,W])}}function Qf(W){y.setProps({content:W})}function FR(){var W=y.state.isVisible,Q=y.state.isDestroyed,ft=!y.state.isEnabled,st=Do.isTouch&&!y.props.touch,vt=nR(y.props.duration,0,co.duration);if(!(W||Q||ft||st)&&!R().hasAttribute("disabled")&&(rt("onShow",[y],!1),y.props.onShow(y)!==!1)){if(y.state.isVisible=!0,O()&&(S.style.visibility="visible"),U(),_e(),y.state.isMounted||(S.style.transition="none"),O()){var ue=F(),kn=ue.box,tl=ue.content;iR([kn,tl],0)}p=function(){var Cc;if(!(!y.state.isVisible||s)){if(s=!0,S.offsetHeight,S.style.transition=y.props.moveTransition,O()&&y.props.animation){var NR=F(),By=NR.box,el=NR.content;iR([By,el],vt),xK([By,el],"visible")}T(),M(),AK(sR,y),(Cc=y.popperInstance)==null||Cc.forceUpdate(),rt("onMount",[y]),y.props.animation&&O()&&fo(vt,function(){y.state.isShown=!0,rt("onShown",[y])})}},xn()}}function A(){var W=!y.state.isVisible,Q=y.state.isDestroyed,ft=!y.state.isEnabled,st=nR(y.props.duration,1,co.duration);if(!(W||Q||ft)&&(rt("onHide",[y],!1),y.props.onHide(y)!==!1)){if(y.state.isVisible=!1,y.state.isShown=!1,s=!1,a=!1,O()&&(S.style.visibility="hidden"),N(),Ir(),U(!0),O()){var vt=F(),ue=vt.box,kn=vt.content;y.props.animation&&(iR([ue,kn],st),xK([ue,kn],"hidden"))}T(),M(),y.props.animation?O()&&jo(st,y.unmount):y.unmount()}}function E(W){x().addEventListener("mousemove",h),AK(yy,h),h(W)}function P(){y.state.isVisible&&y.hide(),!!y.state.isMounted&&(Gf(),zo().forEach(function(W){W._tippy.unmount()}),S.parentNode&&S.parentNode.removeChild(S),sR=sR.filter(function(W){return W!==y}),y.state.isMounted=!1,rt("onHidden",[y]))}function Rt(){y.state.isDestroyed||(y.clearDelayTimeouts(),y.unmount(),Kf(),delete t._tippy,y.state.isDestroyed=!0,rt("onDestroy",[y]))}}function Lf(t,e){e===void 0&&(e={});var r=co.plugins.concat(e.plugins||[]);DIt();var n=Object.assign({},e,{plugins:r}),o=kIt(t),i=o.reduce(function(a,u){var c=u&&JIt(u,n);return c&&a.push(c),a},[]);return gy(t)?i[0]:i}Lf.defaultProps=co,Lf.setDefaultProps=qIt,Lf.currentInput=Do,Object.assign({},sK,{effect:function(e){var r=e.state,n={popper:{position:r.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(r.elements.popper.style,n.popper),r.styles=n,r.elements.arrow&&Object.assign(r.elements.arrow.style,n.arrow)}}),Lf.setDefaultProps({render:UK});class GIt{constructor({editor:e,element:r,view:n,tippyOptions:o={},shouldShow:i}){this.preventHide=!1,this.shouldShow=({view:a,state:u,from:c,to:s})=>{const{doc:f,selection:l}=u,{empty:p}=l,d=!f.textBetween(c,s).length&&U2(u.selection);return!(!a.hasFocus()||p||d)},this.mousedownHandler=()=>{this.preventHide=!0},this.dragstartHandler=()=>{this.hide()},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:a})=>{var u;if(this.preventHide){this.preventHide=!1;return}(a==null?void 0:a.relatedTarget)&&((u=this.element.parentNode)===null||u===void 0?void 0:u.contains(a.relatedTarget))||this.hide()},this.editor=e,this.element=r,this.view=n,i&&(this.shouldShow=i),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.addEventListener("dragstart",this.dragstartHandler),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.tippyOptions=o,this.element.remove(),this.element.style.visibility="visible"}createTooltip(){const{element:e}=this.editor.options,r=!!e.parentElement;this.tippy||!r||(this.tippy=Lf(e,_({duration:0,getReferenceClientRect:null,content:this.element,interactive:!0,trigger:"manual",placement:"top",hideOnClick:"toggle"},this.tippyOptions)),this.tippy.popper.firstChild&&this.tippy.popper.firstChild.addEventListener("blur",n=>{this.blurHandler({event:n})}))}update(e,r){var n,o;const{state:i,composing:a}=e,{doc:u,selection:c}=i,s=r&&r.doc.eq(u)&&r.selection.eq(c);if(a||s)return;this.createTooltip();const{ranges:f}=c,l=Math.min(...f.map(h=>h.$from.pos)),p=Math.max(...f.map(h=>h.$to.pos));if(!((n=this.shouldShow)===null||n===void 0?void 0:n.call(this,{editor:this.editor,view:e,state:i,oldState:r,from:l,to:p}))){this.hide();return}(o=this.tippy)===null||o===void 0||o.setProps({getReferenceClientRect:()=>{if(bTt(i.selection)){const h=e.nodeDOM(l);if(h)return h.getBoundingClientRect()}return oK(e,l,p)}}),this.show()}show(){var e;(e=this.tippy)===null||e===void 0||e.show()}hide(){var e;(e=this.tippy)===null||e===void 0||e.hide()}destroy(){var e;(e=this.tippy)===null||e===void 0||e.destroy(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.removeEventListener("dragstart",this.dragstartHandler),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler)}}const jK=t=>new Dr({key:typeof t.pluginKey=="string"?new oo(t.pluginKey):t.pluginKey,view:e=>new GIt(_({view:e},t))});Ur.create({name:"bubbleMenu",addOptions(){return{element:null,tippyOptions:{},pluginKey:"bubbleMenu",shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[jK({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,shouldShow:this.options.shouldShow})]:[]}});class YIt{constructor({editor:e,element:r,view:n,tippyOptions:o={},shouldShow:i}){this.preventHide=!1,this.shouldShow=({view:a,state:u})=>{const{selection:c}=u,{$anchor:s,empty:f}=c,l=s.depth===1,p=s.parent.isTextblock&&!s.parent.type.spec.code&&!s.parent.textContent;return!(!a.hasFocus()||!f||!l||!p)},this.mousedownHandler=()=>{this.preventHide=!0},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:a})=>{var u;if(this.preventHide){this.preventHide=!1;return}(a==null?void 0:a.relatedTarget)&&((u=this.element.parentNode)===null||u===void 0?void 0:u.contains(a.relatedTarget))||this.hide()},this.editor=e,this.element=r,this.view=n,i&&(this.shouldShow=i),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.tippyOptions=o,this.element.remove(),this.element.style.visibility="visible"}createTooltip(){const{element:e}=this.editor.options,r=!!e.parentElement;this.tippy||!r||(this.tippy=Lf(e,_({duration:0,getReferenceClientRect:null,content:this.element,interactive:!0,trigger:"manual",placement:"right",hideOnClick:"toggle"},this.tippyOptions)),this.tippy.popper.firstChild&&this.tippy.popper.firstChild.addEventListener("blur",n=>{this.blurHandler({event:n})}))}update(e,r){var n,o;const{state:i}=e,{doc:a,selection:u}=i,{from:c,to:s}=u;if(r&&r.doc.eq(a)&&r.selection.eq(u))return;if(this.createTooltip(),!((n=this.shouldShow)===null||n===void 0?void 0:n.call(this,{editor:this.editor,view:e,state:i,oldState:r}))){this.hide();return}(o=this.tippy)===null||o===void 0||o.setProps({getReferenceClientRect:()=>oK(e,c,s)}),this.show()}show(){var e;(e=this.tippy)===null||e===void 0||e.show()}hide(){var e;(e=this.tippy)===null||e===void 0||e.hide()}destroy(){var e;(e=this.tippy)===null||e===void 0||e.destroy(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler)}}const XIt=t=>new Dr({key:typeof t.pluginKey=="string"?new oo(t.pluginKey):t.pluginKey,view:e=>new YIt(_({view:e},t))});Ur.create({name:"floatingMenu",addOptions(){return{element:null,tippyOptions:{},pluginKey:"floatingMenu",shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[XIt({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,shouldShow:this.options.shouldShow})]:[]}});const ZIt=t=>{const[e,r]=tt.useState(null);return tt.useEffect(()=>{if(!e||t.editor.isDestroyed)return;const{pluginKey:n="bubbleMenu",editor:o,tippyOptions:i={},shouldShow:a=null}=t,u=jK({pluginKey:n,editor:o,element:e,tippyOptions:i,shouldShow:a});return o.registerPlugin(u),()=>o.unregisterPlugin(n)},[t.editor,e]),J("div",{ref:r,className:t.className,style:{visibility:"hidden"},children:t.children})};class QIt extends vTt{constructor(){super(...arguments);this.contentComponent=null}}function tOt(){const[,t]=tt.useState(0);return()=>t(e=>e+1)}const eOt=(t={},e=[])=>{const[r,n]=tt.useState(null),o=tOt();return tt.useEffect(()=>{const i=new QIt(t);return n(i),i.on("transaction",()=>{requestAnimationFrame(()=>{requestAnimationFrame(()=>{o()})})}),()=>{i.destroy()}},e),r};function rOt(t){return!!(typeof t=="function"&&t.prototype&&t.prototype.isReactComponent)}function nOt(t){var e;return typeof t=="object"&&((e=t.$$typeof)===null||e===void 0?void 0:e.toString())==="Symbol(react.forward_ref)"}class BK{constructor(e,{editor:r,props:n={},as:o="div",className:i=""}){this.ref=null,this.id=Math.floor(Math.random()*4294967295).toString(),this.component=e,this.editor=r,this.props=n,this.element=document.createElement(o),this.element.classList.add("react-renderer"),i&&this.element.classList.add(...i.split(" ")),this.render()}render(){var e;const r=this.component,n=this.props;(rOt(r)||nOt(r))&&(n.ref=o=>{this.ref=o}),this.reactElement=J(r,_({},n)),((e=this.editor)===null||e===void 0?void 0:e.contentComponent)&&this.editor.contentComponent.setState({renderers:this.editor.contentComponent.state.renderers.set(this.id,this)})}updateProps(e={}){this.props=_(_({},this.props),e),this.render()}destroy(){var e;if((e=this.editor)===null||e===void 0?void 0:e.contentComponent){const{renderers:r}=this.editor.contentComponent.state;r.delete(this.id),this.editor.contentComponent.setState({renderers:r})}}}const zK=tt.createContext({onDragStart:void 0}),oOt=()=>tt.useContext(zK);class iOt extends mTt{mount(){const e={editor:this.editor,node:this.node,decorations:this.decorations,selected:!1,extension:this.extension,getPos:()=>this.getPos(),updateAttributes:(o={})=>this.updateAttributes(o),deleteNode:()=>this.deleteNode()};if(!this.component.displayName){const o=i=>i.charAt(0).toUpperCase()+i.substring(1);this.component.displayName=o(this.extension.name)}const r=o=>{const i=this.component,a=this.onDragStart.bind(this),u=c=>{c&&this.contentDOMElement&&c.firstChild!==this.contentDOMElement&&c.appendChild(this.contentDOMElement)};return J(zK.Provider,{value:{onDragStart:a,nodeViewContentRef:u},children:J(i,_({},o))})};r.displayName="ReactNodeView",this.contentDOMElement=this.node.isLeaf?null:document.createElement(this.node.isInline?"span":"div"),this.contentDOMElement&&(this.contentDOMElement.style.whiteSpace="inherit");let n=this.node.isInline?"span":"div";this.options.as&&(n=this.options.as),this.renderer=new BK(r,{editor:this.editor,props:e,as:n,className:`node-${this.node.type.name}`})}get dom(){var e;if(this.renderer.element.firstElementChild&&!((e=this.renderer.element.firstElementChild)===null||e===void 0?void 0:e.hasAttribute("data-node-view-wrapper")))throw Error("Please use the NodeViewWrapper component for your node view.");return this.renderer.element}get contentDOM(){return this.node.isLeaf?null:this.contentDOMElement}update(e,r){const n=o=>{this.renderer.updateProps(o)};if(e.type!==this.node.type)return!1;if(typeof this.options.update=="function"){const o=this.node,i=this.decorations;return this.node=e,this.decorations=r,this.options.update({oldNode:o,oldDecorations:i,newNode:e,newDecorations:r,updateProps:()=>n({node:e,decorations:r})})}return e===this.node&&this.decorations===r||(this.node=e,this.decorations=r,n({node:e,decorations:r})),!0}selectNode(){this.renderer.updateProps({selected:!0})}deselectNode(){this.renderer.updateProps({selected:!1})}destroy(){this.renderer.destroy(),this.contentDOMElement=null}}function aOt(t,e){return r=>r.editor.contentComponent?new iOt(t,r,e):{}}const uOt=({renderers:t})=>J(fc,{children:Array.from(t).map(([e,r])=>q3.default.createPortal(r.reactElement,r.element,e))});class cOt extends rl.default.Component{constructor(e){super(e);this.editorContentRef=rl.default.createRef(),this.state={renderers:new Map}}componentDidMount(){this.init()}componentDidUpdate(){this.init()}init(){const{editor:e}=this.props;if(e&&e.options.element){if(e.contentComponent)return;const r=this.editorContentRef.current;r.append(...e.options.element.childNodes),e.setOptions({element:r}),e.contentComponent=this,e.createNodeViews()}}componentWillUnmount(){const{editor:e}=this.props;if(!e||(e.isDestroyed||e.view.setProps({nodeViews:{}}),e.contentComponent=null,!e.options.element.firstChild))return;const r=document.createElement("div");r.append(...e.options.element.childNodes),e.setOptions({element:r})}render(){const n=this.props,{editor:e}=n,r=Wn(n,["editor"]);return br(fc,{children:[J("div",_({ref:this.editorContentRef},r)),J(uOt,{renderers:this.state.renderers})]})}}const sOt=rl.default.memo(cOt),fOt=rl.default.forwardRef((t,e)=>{const{onDragStart:r}=oOt(),n=t.as||"div";return J(n,K(_({},t),{ref:e,"data-node-view-wrapper":"",onDragStart:r,style:K(_({},t.style),{whiteSpace:"normal"})}))}),lOt=/(?:^|\s)((?:\*\*)((?:[^*]+))(?:\*\*))$/,pOt=/(?:^|\s)((?:\*\*)((?:[^*]+))(?:\*\*))/g,dOt=/(?:^|\s)((?:__)((?:[^__]+))(?:__))$/,hOt=/(?:^|\s)((?:__)((?:[^__]+))(?:__))/g,vOt=Nd.create({name:"bold",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:t=>t.style.fontWeight!=="normal"&&null},{style:"font-weight",getAttrs:t=>/^(bold(er)?|[5-9]\d{2,})$/.test(t)&&null}]},renderHTML({HTMLAttributes:t}){return["strong",Ge(this.options.HTMLAttributes,t),0]},addCommands(){return{setBold:()=>({commands:t})=>t.setMark(this.name),toggleBold:()=>({commands:t})=>t.toggleMark(this.name),unsetBold:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[fy({find:lOt,type:this.type}),fy({find:dOt,type:this.type})]},addPasteRules(){return[ly({find:pOt,type:this.type}),ly({find:hOt,type:this.type})]}});var za;(function(t){t.Document="document",t.Mark="mark",t.Node="node"})(za||(za={}));var xi;(function(t){t.Text="text",t.Embed="embed",t.Image="image"})(xi||(xi={}));class mOt{constructor(e,r,n){xc(this,"extType",za.Document);this.name=e,this.component=r,this.converter=n}}class qK{constructor(e,r,n,o){xc(this,"extType",za.Mark);this.richTextNodeTypes=e,this.name=r,this.component=n,this.converter=o}}class Uf{constructor(e,r,n,o,i,a=!1){xc(this,"extType",za.Node);xc(this,"nodeType",xi.Text);this.richTextNodeTypes=e,this.name=r,this.component=n,this.converter=o,this.placeholder=i,this.lockedFormat=a}}class gOt{constructor(e,r,n,o){xc(this,"extType",za.Node);xc(this,"nodeType",xi.Embed);this.richTextNodeTypes=e,this.name=r,this.component=n,this.converter=o}}class yOt extends Uf{constructor(e,r,n,o,i){super(e,"heading",r,o,i);this.levels=n}}class fR extends Uf{constructor(e,r,n,o){super(e,r,n,o)}}const lR=vOt.extend({name:"bold"}),bOt={fromPrismic(t){return function(){var e;return(e=t.marks[lR.name])==null?void 0:e.create()}},toPrismic(){}},KK=new qK([_t.RichTextNodeType.strong],lR.name,lR,bOt),$Ot=/^\s*([-+*])\s$/,_Ot=sn.create({name:"bulletList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{}}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:"ul"}]},renderHTML({HTMLAttributes:t}){return["ul",Ge(this.options.HTMLAttributes,t),0]},addCommands(){return{toggleBulletList:()=>({commands:t})=>t.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){return[nK({find:$Ot,type:this.type})]}}),VK=sn.create({name:"hardBreak",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:t}){return["br",Ge(this.options.HTMLAttributes,t)]},renderText(){return`
117
+ `},addCommands(){return{setHardBreak:()=>({commands:t,chain:e,state:r,editor:n})=>t.first([()=>t.exitCode(),()=>t.command(()=>{const{selection:o,storedMarks:i}=r;if(o.$from.parent.type.spec.isolating)return!1;const{keepMarks:a}=this.options,{splittableMarks:u}=n.extensionManager,c=i||o.$to.parentOffset&&o.$from.marks();return e().insertContent({type:this.name}).command(({tr:s,dispatch:f})=>{if(f&&c&&a){const l=c.filter(p=>u.includes(p.type.name));s.ensureMarks(l)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),Sc={isHardBreak(t){return t.type.name===VK.name},children:{reduce(t,e,r){let n=r;return t.forEach((o,i,a)=>{n=e(n,o,a)}),n},map(t,e){return this.reduce(t,(r,n)=>[...r,e(n)],[])},exists(t,e){return this.reduce(t,(r,n)=>r||e(n),!1)},filter(t,e){return this.reduce(t,(r,n)=>[...r,...e(n)?[n]:[]],[])}},marks:{reduce(t,e,r){let n=r;return t.marks.forEach((o,i)=>{n=e(n,o,i)}),n},map(t,e){return this.reduce(t,(r,n)=>[...r,e(n)],[])},filter(t,e){return this.reduce(t,(r,n)=>[...r,...e(n)?[n]:[]],[])}}};function SOt(t){if(!t||!t.size)return{defaultTextConverter:void 0,extensions:F3()};const e=F3(t),r=Array.from(t.values()),n=(()=>{const a=zn(s=>r.some(f=>s.richTextNodeTypes.includes(f)))(e),u=a.some(s=>s instanceof fR)?[Ha,...a]:a;return u.some(s=>s instanceof Uf)?u:[W3,...u]})(),o=n.find(a=>a instanceof Uf)||W3;function i(a){return u=>o.converter.fromPrismic(a)(K(_({},u),{type:o.richTextNodeTypes[0]}))}return{defaultTextConverter:i,extensions:n}}function TOt(t){if(!(t==null?void 0:t.single)&&!(t==null?void 0:t.multi))return;const e=v((t.single||t.multi||"").split(/\s*,\s*/),Jh(r=>mb(()=>{})(ug.RichTextNodeTypeCodec.decode(r))),zn(r=>r!==void 0));return new Set(e)}function IOt(t){const e=TOt(t);return SOt(e)}const OOt=sn.create({name:"doc",topNode:!0,content:"block+"}),HK=sn.create({name:"listItem",addOptions(){return{HTMLAttributes:{}}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:t}){return["li",Ge(this.options.HTMLAttributes,t),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}).extend({name:"listItem",content:"paragraph*",addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name)}}});var jf={component:HK,converter:{fromPrismic(t){return function(e){var n;const r=Ha.converter.fromPrismic(t)(e);if(!!r)return(n=t.nodes[HK.name])==null?void 0:n.create({},r)}},toPrismic(t,e){return Sc.children.reduce(t,(r,n)=>{const o=Ha.converter.toPrismic(n),i=(()=>o instanceof Array?o.map(a=>K(_({},a),{type:e})):o?[K(_({},o),{type:e})]:[])();return[...r,...i]},[])}},placeholder:"List"};function MOt(t){return t.slice(1,t.length).reduce((e,r)=>e.copy(e.content.append(r.content)),t[0])}const pR="document",ROt=t=>OOt.extend({name:pR,content:t?"block+":"block"}),EOt=t=>({fromPrismic(e,r){function n(o){return function(i=void 0){return!i&&r&&ec.TextBlock.is(o)?r(o):i}}return function(o){var a;const i=o.value.reduce((u,c)=>{if(!c)return[];const s=t.find(h=>h.richTextNodeTypes.includes(c.type)),f=(()=>{if(!!s)switch(s.nodeType){case xi.Embed:return ec.EmbedBlock.is(c)&&s.converter.fromPrismic(e)(c);case xi.Text:return ec.TextBlock.is(c)&&s.converter.fromPrismic(e)(c);case xi.Image:return ec.ImageBlock.is(c)&&s.converter.fromPrismic(e)(c);default:return}})(),[l,p]=v(u,L$(u.length-1),([h,m])=>[h,D$(m)]),d=(()=>f?v(p,Zo(()=>({merged:!1,node:f}),h=>f.type.name===h.type.name&&(f.type.name===Ny.name||f.type.name===Ly.name)?{merged:!0,node:MOt([h,f])}:{merged:!1,node:f}),({merged:h,node:m})=>({merged:h,node:n(c)(m)})):{merged:!1,node:n(c)()})();return d.node?[...d.merged?l:u,d.node]:u},[]);return(a=e.nodes[pR])==null?void 0:a.create({},i)}},toPrismic(e){const r=Sc.children.reduce(e,(n,o)=>{const i=Object.values(t).find(u=>o.type.name===(u==null?void 0:u.name)),a=i&&i.converter.toPrismic(o);return a||console.warn(`Cannot convert node of type '${o.type.name}'.`),a?[...n,...a instanceof Array?a:[a]]:n},[]);return{__TYPE__:_i.NestableTypes.StructuredText,value:[...r]}}}),by=new mOt(pR,ROt,EOt),$y=VK.extend({name:"hard_break"}),_y=`
118
+ `,JK={fromPrismic(t){return function(e){var r;if(e===_y)return(r=t.nodes[$y.name])==null?void 0:r.create({})}},toPrismic(t){if(t.type.name===$y.name)return _y}},dR={isEmptyLine(t){return t.length===0},isFirst(t){return t===0}};function wOt(t,e){return function(r){const n=JK.fromPrismic(t)(_y);if(!n)return[r(e)];const o=e.split(_y);return o.length===1?e.length?[r(e)]:[n]:o.reduce((i,a,u)=>dR.isFirst(u)?dR.isEmptyLine(a)?i:[...i,r(a)]:dR.isEmptyLine(a)?[...i,n]:[...i,n,r(a)],[])}}const Sy={name:$y.name,component:$y,converter:JK,splitTextToNodes:wOt},AOt=Ur.create({name:"placeholder",addOptions(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Write something \u2026",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){return[new Dr({props:{decorations:({doc:t,selection:e})=>{const r=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:n}=e,o=[];if(!!r)return t.descendants((i,a)=>{const u=n>=a&&n<=a+i.nodeSize,c=!i.isLeaf&&!i.childCount;if((u||!this.options.showOnlyCurrent)&&c){const s=[this.options.emptyNodeClass];this.editor.isEmpty&&s.push(this.options.emptyEditorClass);const f=Ie.node(a,a+i.nodeSize,{class:s.join(" "),"data-placeholder":typeof this.options.placeholder=="function"?this.options.placeholder({editor:this.editor,node:i,pos:a,hasAnchor:u}):this.options.placeholder});o.push(f)}return this.options.includeChildren}),Nt.create(t,o)}}})]}});var COt=t=>AOt.configure({includeChildren:!0,placeholder:({editor:e,hasAnchor:r,node:n})=>{const o=!Sc.children.exists(e.state.doc,u=>u===n),i=(()=>{const u=e.isEditable,c=e.isFocused&&r,s=n.type.name!==Ha.name;return u&&(c||s||o)})(),a=(()=>{if(o)return jf.placeholder;const u=t[n.type.name];return typeof u=="string"?u:u==null?void 0:u(n.attrs)})();return i&&a||""},showOnlyCurrent:!1,showOnlyWhenEditable:!1});function Bf(t){return t.split("-")[0]}function hR(t){return t.split("-")[1]}function Kd(t){return["top","bottom"].includes(Bf(t))?"x":"y"}function GK(t){return t==="y"?"height":"width"}function YK(t,e,r){let{reference:n,floating:o}=t;const i=n.x+n.width/2-o.width/2,a=n.y+n.height/2-o.height/2,u=Kd(e),c=GK(u),s=n[c]/2-o[c]/2,f=Bf(e),l=u==="x";let p;switch(f){case"top":p={x:i,y:n.y-o.height};break;case"bottom":p={x:i,y:n.y+n.height};break;case"right":p={x:n.x+n.width,y:a};break;case"left":p={x:n.x-o.width,y:a};break;default:p={x:n.x,y:n.y}}switch(hR(e)){case"start":p[u]-=s*(r&&l?-1:1);break;case"end":p[u]+=s*(r&&l?-1:1);break}return p}const xOt=async(t,e,r)=>{const{placement:n="bottom",strategy:o="absolute",middleware:i=[],platform:a}=r,u=await(a.isRTL==null?void 0:a.isRTL(e));let c=await a.getElementRects({reference:t,floating:e,strategy:o}),{x:s,y:f}=YK(c,n,u),l=n,p={},d=0;for(let h=0;h<i.length;h++){const{name:m,fn:g}=i[h],{x:b,y:$,data:w,reset:y}=await g({x:s,y:f,initialPlacement:n,placement:l,strategy:o,middlewareData:p,rects:c,platform:a,elements:{reference:t,floating:e}});if(s=b!=null?b:s,f=$!=null?$:f,p=K(_({},p),{[m]:_(_({},p[m]),w)}),y&&d<=50){d++,typeof y=="object"&&(y.placement&&(l=y.placement),y.rects&&(c=y.rects===!0?await a.getElementRects({reference:t,floating:e,strategy:o}):y.rects),{x:s,y:f}=YK(c,l,u)),h=-1;continue}}return{x:s,y:f,placement:l,strategy:o,middlewareData:p}};function kOt(t){return _({top:0,right:0,bottom:0,left:0},t)}function WOt(t){return typeof t!="number"?kOt(t):{top:t,right:t,bottom:t,left:t}}function Ty(t){return K(_({},t),{top:t.y,left:t.x,right:t.x+t.width,bottom:t.y+t.height})}async function XK(t,e){var r;e===void 0&&(e={});const{x:n,y:o,platform:i,rects:a,elements:u,strategy:c}=t,{boundary:s="clippingAncestors",rootBoundary:f="viewport",elementContext:l="floating",altBoundary:p=!1,padding:d=0}=e,h=WOt(d),g=u[p?l==="floating"?"reference":"floating":l],b=Ty(await i.getClippingRect({element:((r=await(i.isElement==null?void 0:i.isElement(g)))!=null?r:!0)?g:g.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(u.floating)),boundary:s,rootBoundary:f,strategy:c})),$=Ty(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({rect:l==="floating"?K(_({},a.floating),{x:n,y:o}):a.reference,offsetParent:await(i.getOffsetParent==null?void 0:i.getOffsetParent(u.floating)),strategy:c}):a[l]);return{top:b.top-$.top+h.top,bottom:$.bottom-b.bottom+h.bottom,left:b.left-$.left+h.left,right:$.right-b.right+h.right}}const FOt=Math.min,NOt=Math.max;function ZK(t,e,r){return NOt(t,FOt(e,r))}const POt={left:"right",right:"left",bottom:"top",top:"bottom"};function Iy(t){return t.replace(/left|right|bottom|top/g,e=>POt[e])}function DOt(t,e,r){r===void 0&&(r=!1);const n=hR(t),o=Kd(t),i=GK(o);let a=o==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return e.reference[i]>e.floating[i]&&(a=Iy(a)),{main:a,cross:Iy(a)}}const LOt={start:"end",end:"start"};function QK(t){return t.replace(/start|end/g,e=>LOt[e])}function UOt(t){const e=Iy(t);return[QK(t),e,QK(e)]}const jOt=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var r;const{placement:n,middlewareData:o,rects:i,initialPlacement:a,platform:u,elements:c}=e,B=t,{mainAxis:s=!0,crossAxis:f=!0,fallbackPlacements:l,fallbackStrategy:p="bestFit",flipAlignment:d=!0}=B,h=Wn(B,["mainAxis","crossAxis","fallbackPlacements","fallbackStrategy","flipAlignment"]),m=Bf(n),b=l||(m===a||!d?[Iy(a)]:UOt(a)),$=[a,...b],w=await XK(e,h),y=[];let I=((r=o.flip)==null?void 0:r.overflows)||[];if(s&&y.push(w[m]),f){const{main:q,cross:G}=DOt(n,i,await(u.isRTL==null?void 0:u.isRTL(c.floating)));y.push(w[q],w[G])}if(I=[...I,{placement:n,overflows:y}],!y.every(q=>q<=0)){var S,k;const q=((S=(k=o.flip)==null?void 0:k.index)!=null?S:0)+1,G=$[q];if(G)return{data:{index:q,overflows:I},reset:{placement:G}};let O="bottom";switch(p){case"bestFit":{var C;const R=(C=I.map(x=>[x,x.overflows.filter(F=>F>0).reduce((F,L)=>F+L,0)]).sort((x,F)=>x[1]-F[1])[0])==null?void 0:C[0].placement;R&&(O=R);break}case"initialPlacement":O=a;break}if(n!==O)return{reset:{placement:O}}}return{}}}};async function BOt(t,e){const{placement:r,platform:n,elements:o}=t,i=await(n.isRTL==null?void 0:n.isRTL(o.floating)),a=Bf(r),u=hR(r),c=Kd(r)==="x",s=["left","top"].includes(a)?-1:1,f=i&&c?-1:1,l=typeof e=="function"?e(t):e;let{mainAxis:p,crossAxis:d,alignmentAxis:h}=typeof l=="number"?{mainAxis:l,crossAxis:0,alignmentAxis:null}:_({mainAxis:0,crossAxis:0,alignmentAxis:null},l);return u&&typeof h=="number"&&(d=u==="end"?h*-1:h),c?{x:d*f,y:p*s}:{x:p*s,y:d*f}}const zOt=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){const{x:r,y:n}=e,o=await BOt(e,t);return{x:r+o.x,y:n+o.y,data:o}}}};function t3(t){return t==="x"?"y":"x"}const qOt=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:r,y:n,placement:o}=e,g=t,{mainAxis:i=!0,crossAxis:a=!1,limiter:u={fn:b=>{let{x:$,y:w}=b;return{x:$,y:w}}}}=g,c=Wn(g,["mainAxis","crossAxis","limiter"]),s={x:r,y:n},f=await XK(e,c),l=Kd(Bf(o)),p=t3(l);let d=s[l],h=s[p];if(i){const b=l==="y"?"top":"left",$=l==="y"?"bottom":"right",w=d+f[b],y=d-f[$];d=ZK(w,d,y)}if(a){const b=p==="y"?"top":"left",$=p==="y"?"bottom":"right",w=h+f[b],y=h-f[$];h=ZK(w,h,y)}const m=u.fn(K(_({},e),{[l]:d,[p]:h}));return K(_({},m),{data:{x:m.x-r,y:m.y-n}})}}},KOt=function(t){return t===void 0&&(t={}),{options:t,fn(e){const{x:r,y:n,placement:o,rects:i,middlewareData:a}=e,{offset:u=0,mainAxis:c=!0,crossAxis:s=!0}=t,f={x:r,y:n},l=Kd(o),p=t3(l);let d=f[l],h=f[p];const m=typeof u=="function"?u(e):u,g=typeof m=="number"?{mainAxis:m,crossAxis:0}:_({mainAxis:0,crossAxis:0},m);if(c){const I=l==="y"?"height":"width",S=i.reference[l]-i.floating[I]+g.mainAxis,k=i.reference[l]+i.reference[I]-g.mainAxis;d<S?d=S:d>k&&(d=k)}if(s){var b,$,w,y;const I=l==="y"?"width":"height",S=["top","left"].includes(Bf(o)),k=i.reference[p]-i.floating[I]+(S&&(b=($=a.offset)==null?void 0:$[p])!=null?b:0)+(S?0:g.crossAxis),C=i.reference[p]+i.reference[I]+(S?0:(w=(y=a.offset)==null?void 0:y[p])!=null?w:0)-(S?g.crossAxis:0);h<k?h=k:h>C&&(h=C)}return{[l]:d,[p]:h}}}};function e3(t){return t&&t.document&&t.location&&t.alert&&t.setInterval}function ki(t){if(t==null)return window;if(!e3(t)){const e=t.ownerDocument;return e&&e.defaultView||window}return t}function Vd(t){return ki(t).getComputedStyle(t)}function Wi(t){return e3(t)?"":t?(t.nodeName||"").toLowerCase():""}function r3(){const t=navigator.userAgentData;return t!=null&&t.brands?t.brands.map(e=>e.brand+"/"+e.version).join(" "):navigator.userAgent}function Lo(t){return t instanceof ki(t).HTMLElement}function qa(t){return t instanceof ki(t).Element}function VOt(t){return t instanceof ki(t).Node}function vR(t){if(typeof ShadowRoot=="undefined")return!1;const e=ki(t).ShadowRoot;return t instanceof e||t instanceof ShadowRoot}function Oy(t){const{overflow:e,overflowX:r,overflowY:n}=Vd(t);return/auto|scroll|overlay|hidden/.test(e+n+r)}function HOt(t){return["table","td","th"].includes(Wi(t))}function n3(t){const e=/firefox/i.test(r3()),r=Vd(t);return r.transform!=="none"||r.perspective!=="none"||r.contain==="paint"||["transform","perspective"].includes(r.willChange)||e&&r.willChange==="filter"||e&&(r.filter?r.filter!=="none":!1)}function o3(){return!/^((?!chrome|android).)*safari/i.test(r3())}const i3=Math.min,Hd=Math.max,My=Math.round;function Fi(t,e,r){var n,o,i,a;e===void 0&&(e=!1),r===void 0&&(r=!1);const u=t.getBoundingClientRect();let c=1,s=1;e&&Lo(t)&&(c=t.offsetWidth>0&&My(u.width)/t.offsetWidth||1,s=t.offsetHeight>0&&My(u.height)/t.offsetHeight||1);const f=qa(t)?ki(t):window,l=!o3()&&r,p=(u.left+(l&&(n=(o=f.visualViewport)==null?void 0:o.offsetLeft)!=null?n:0))/c,d=(u.top+(l&&(i=(a=f.visualViewport)==null?void 0:a.offsetTop)!=null?i:0))/s,h=u.width/c,m=u.height/s;return{width:h,height:m,top:d,right:p+h,bottom:d+m,left:p,x:p,y:d}}function Ka(t){return((VOt(t)?t.ownerDocument:t.document)||window.document).documentElement}function Ry(t){return qa(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function a3(t){return Fi(Ka(t)).left+Ry(t).scrollLeft}function JOt(t){const e=Fi(t);return My(e.width)!==t.offsetWidth||My(e.height)!==t.offsetHeight}function GOt(t,e,r){const n=Lo(e),o=Ka(e),i=Fi(t,n&&JOt(e),r==="fixed");let a={scrollLeft:0,scrollTop:0};const u={x:0,y:0};if(n||!n&&r!=="fixed")if((Wi(e)!=="body"||Oy(o))&&(a=Ry(e)),Lo(e)){const c=Fi(e,!0);u.x=c.x+e.clientLeft,u.y=c.y+e.clientTop}else o&&(u.x=a3(o));return{x:i.left+a.scrollLeft-u.x,y:i.top+a.scrollTop-u.y,width:i.width,height:i.height}}function u3(t){return Wi(t)==="html"?t:t.assignedSlot||t.parentNode||(vR(t)?t.host:null)||Ka(t)}function c3(t){return!Lo(t)||getComputedStyle(t).position==="fixed"?null:t.offsetParent}function YOt(t){let e=u3(t);for(vR(e)&&(e=e.host);Lo(e)&&!["html","body"].includes(Wi(e));){if(n3(e))return e;e=e.parentNode}return null}function mR(t){const e=ki(t);let r=c3(t);for(;r&&HOt(r)&&getComputedStyle(r).position==="static";)r=c3(r);return r&&(Wi(r)==="html"||Wi(r)==="body"&&getComputedStyle(r).position==="static"&&!n3(r))?e:r||YOt(t)||e}function s3(t){if(Lo(t))return{width:t.offsetWidth,height:t.offsetHeight};const e=Fi(t);return{width:e.width,height:e.height}}function XOt(t){let{rect:e,offsetParent:r,strategy:n}=t;const o=Lo(r),i=Ka(r);if(r===i)return e;let a={scrollLeft:0,scrollTop:0};const u={x:0,y:0};if((o||!o&&n!=="fixed")&&((Wi(r)!=="body"||Oy(i))&&(a=Ry(r)),Lo(r))){const c=Fi(r,!0);u.x=c.x+r.clientLeft,u.y=c.y+r.clientTop}return K(_({},e),{x:e.x-a.scrollLeft+u.x,y:e.y-a.scrollTop+u.y})}function ZOt(t,e){const r=ki(t),n=Ka(t),o=r.visualViewport;let i=n.clientWidth,a=n.clientHeight,u=0,c=0;if(o){i=o.width,a=o.height;const s=o3();(s||!s&&e==="fixed")&&(u=o.offsetLeft,c=o.offsetTop)}return{width:i,height:a,x:u,y:c}}function QOt(t){var e;const r=Ka(t),n=Ry(t),o=(e=t.ownerDocument)==null?void 0:e.body,i=Hd(r.scrollWidth,r.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),a=Hd(r.scrollHeight,r.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0);let u=-n.scrollLeft+a3(t);const c=-n.scrollTop;return Vd(o||r).direction==="rtl"&&(u+=Hd(r.clientWidth,o?o.clientWidth:0)-i),{width:i,height:a,x:u,y:c}}function f3(t){const e=u3(t);return["html","body","#document"].includes(Wi(e))?t.ownerDocument.body:Lo(e)&&Oy(e)?e:f3(e)}function zf(t,e){var r;e===void 0&&(e=[]);const n=f3(t),o=n===((r=t.ownerDocument)==null?void 0:r.body),i=ki(n),a=o?[i].concat(i.visualViewport||[],Oy(n)?n:[]):n,u=e.concat(a);return o?u:u.concat(zf(a))}function tMt(t,e){const r=e.getRootNode==null?void 0:e.getRootNode();if(t.contains(e))return!0;if(r&&vR(r)){let n=e;do{if(n&&t===n)return!0;n=n.parentNode||n.host}while(n)}return!1}function eMt(t,e){const r=Fi(t,!1,e==="fixed"),n=r.top+t.clientTop,o=r.left+t.clientLeft;return{top:n,left:o,x:o,y:n,right:o+t.clientWidth,bottom:n+t.clientHeight,width:t.clientWidth,height:t.clientHeight}}function l3(t,e,r){return e==="viewport"?Ty(ZOt(t,r)):qa(e)?eMt(e,r):Ty(QOt(Ka(t)))}function rMt(t){const e=zf(t),n=["absolute","fixed"].includes(Vd(t).position)&&Lo(t)?mR(t):t;return qa(n)?e.filter(o=>qa(o)&&tMt(o,n)&&Wi(o)!=="body"):[]}function nMt(t){let{element:e,boundary:r,rootBoundary:n,strategy:o}=t;const a=[...r==="clippingAncestors"?rMt(e):[].concat(r),n],u=a[0],c=a.reduce((s,f)=>{const l=l3(e,f,o);return s.top=Hd(l.top,s.top),s.right=i3(l.right,s.right),s.bottom=i3(l.bottom,s.bottom),s.left=Hd(l.left,s.left),s},l3(e,u,o));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}const oMt={getClippingRect:nMt,convertOffsetParentRelativeRectToViewportRelativeRect:XOt,isElement:qa,getDimensions:s3,getOffsetParent:mR,getDocumentElement:Ka,getElementRects:t=>{let{reference:e,floating:r,strategy:n}=t;return{reference:GOt(e,mR(r),n),floating:K(_({},s3(r)),{x:0,y:0})}},getClientRects:t=>Array.from(t.getClientRects()),isRTL:t=>Vd(t).direction==="rtl"};function iMt(t,e,r,n){n===void 0&&(n={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:a=!0,animationFrame:u=!1}=n,c=o&&!u,s=i&&!u,f=c||s?[...qa(t)?zf(t):[],...zf(e)]:[];f.forEach(m=>{c&&m.addEventListener("scroll",r,{passive:!0}),s&&m.addEventListener("resize",r)});let l=null;if(a){let m=!0;l=new ResizeObserver(()=>{m||r(),m=!1}),qa(t)&&!u&&l.observe(t),l.observe(e)}let p,d=u?Fi(t):null;u&&h();function h(){const m=Fi(t);d&&(m.x!==d.x||m.y!==d.y||m.width!==d.width||m.height!==d.height)&&r(),d=m,p=requestAnimationFrame(h)}return r(),()=>{var m;f.forEach(g=>{c&&g.removeEventListener("scroll",r),s&&g.removeEventListener("resize",r)}),(m=l)==null||m.disconnect(),l=null,u&&cancelAnimationFrame(p)}}const aMt=(t,e,r)=>xOt(t,e,_({platform:oMt},r));var gR=typeof document!="undefined"?tt.useLayoutEffect:tt.useEffect;function Ey(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(typeof t=="function"&&t.toString()===e.toString())return!0;let r,n,o;if(t&&e&&typeof t=="object"){if(Array.isArray(t)){if(r=t.length,r!=e.length)return!1;for(n=r;n--!=0;)if(!Ey(t[n],e[n]))return!1;return!0}if(o=Object.keys(t),r=o.length,r!==Object.keys(e).length)return!1;for(n=r;n--!=0;)if(!Object.prototype.hasOwnProperty.call(e,o[n]))return!1;for(n=r;n--!=0;){const i=o[n];if(!(i==="_owner"&&t.$$typeof)&&!Ey(t[i],e[i]))return!1}return!0}return t!==t&&e!==e}function uMt(t){const e=bt.useRef(t);return gR(()=>{e.current=t}),e}function cMt(t){let{middleware:e,placement:r="bottom",strategy:n="absolute",whileElementsMounted:o}=t===void 0?{}:t;const[i,a]=bt.useState({x:null,y:null,strategy:n,placement:r,middlewareData:{}}),[u,c]=bt.useState(e);Ey(u==null?void 0:u.map(y=>{let{name:I,options:S}=y;return{name:I,options:S}}),e==null?void 0:e.map(y=>{let{name:I,options:S}=y;return{name:I,options:S}}))||c(e);const s=bt.useRef(null),f=bt.useRef(null),l=bt.useRef(null),p=bt.useRef(i),d=uMt(o),h=bt.useCallback(()=>{!s.current||!f.current||aMt(s.current,f.current,{middleware:u,placement:r,strategy:n}).then(y=>{m.current&&!Ey(p.current,y)&&(p.current=y,K3.flushSync(()=>{a(y)}))})},[u,r,n]);gR(()=>{m.current&&h()},[h]);const m=bt.useRef(!1);gR(()=>(m.current=!0,()=>{m.current=!1}),[]);const g=bt.useCallback(()=>{if(typeof l.current=="function"&&(l.current(),l.current=null),s.current&&f.current)if(d.current){const y=d.current(s.current,f.current,h);l.current=y}else h()},[h,d]),b=bt.useCallback(y=>{s.current=y,g()},[g]),$=bt.useCallback(y=>{f.current=y,g()},[g]),w=bt.useMemo(()=>({reference:s,floating:f}),[]);return bt.useMemo(()=>K(_({},i),{update:h,refs:w,reference:b,floating:$}),[i,h,w,b,$])}var Va=typeof document!="undefined"?tt.useLayoutEffect:tt.useEffect;function sMt(){const t=new Map;return{emit(e,r){var n;(n=t.get(e))==null||n.forEach(o=>o(r))},on(e,r){t.set(e,[...t.get(e)||[],r])},off(e,r){t.set(e,(t.get(e)||[]).filter(n=>n!==r))}}}let yR=!1,fMt=0;const p3=()=>"floating-ui-"+fMt++;function lMt(){const[t,e]=bt.useState(()=>yR?p3():void 0);return Va(()=>{t==null&&e(p3())},[]),bt.useEffect(()=>{yR||(yR=!0)},[]),t}const d3=bt["useId".toString()],h3=d3!=null?d3:lMt,pMt=bt.createContext(null),dMt=bt.createContext(null),v3=()=>{var t,e;return(t=(e=bt.useContext(pMt))==null?void 0:e.id)!=null?t:null},bR=()=>bt.useContext(dMt);function $R(t){var e;return(e=t==null?void 0:t.ownerDocument)!=null?e:document}function m3(t){var e;return(e=$R(t).defaultView)!=null?e:window}function _R(t){return t?t instanceof m3(t).Element:!1}function hMt(t){return t?t instanceof m3(t).HTMLElement:!1}function vMt(t){let{open:e=!1,onOpenChange:r=()=>{},whileElementsMounted:n,placement:o,middleware:i,strategy:a,nodeId:u}=t===void 0?{}:t;const c=bR(),s=bt.useRef(null),f=bt.useRef({}),l=bt.useState(()=>sMt())[0],p=cMt({placement:o,middleware:i,strategy:a,whileElementsMounted:n}),d=bt.useMemo(()=>K(_({},p.refs),{domReference:s}),[p.refs]),h=bt.useMemo(()=>K(_({},p),{refs:d,dataRef:f,nodeId:u,events:l,open:e,onOpenChange:r}),[p,u,l,e,r,d]);Va(()=>{const b=c==null?void 0:c.nodesRef.current.find($=>$.id===u);b&&(b.context=h)});const{reference:m}=p,g=bt.useCallback(b=>{(_R(b)||b===null)&&(h.refs.domReference.current=b),m(b)},[m,h.refs]);return bt.useMemo(()=>K(_({},p),{context:h,refs:d,reference:g}),[p,d,h,g])}function SR(t,e,r){const n=new Map;return _(_(_({},r==="floating"&&{tabIndex:-1}),t),e.map(o=>o?o[r]:null).concat(t).reduce((o,i)=>(i&&Object.entries(i).forEach(a=>{let[u,c]=a;if(u.indexOf("on")===0){if(n.has(u)||n.set(u,[]),typeof c=="function"){var s;(s=n.get(u))==null||s.push(c)}o[u]=function(){for(var f,l=arguments.length,p=new Array(l),d=0;d<l;d++)p[d]=arguments[d];(f=n.get(u))==null||f.forEach(h=>h(...p))}}else o[u]=c}),o),{}))}const mMt=function(t){return t===void 0&&(t=[]),{getReferenceProps:e=>SR(e,t,"reference"),getFloatingProps:e=>SR(e,t,"floating"),getItemProps:e=>SR(e,t,"item")}};function TR(t,e){var r;let n=(r=t.filter(a=>{var u;return a.parentId===e&&((u=a.context)==null?void 0:u.open)}))!=null?r:[],o=n;for(;o.length;){var i;o=(i=t.filter(a=>{var u;return(u=o)==null?void 0:u.some(c=>{var s;return a.parentId===c.id&&((s=a.context)==null?void 0:s.open)})}))!=null?i:[],n=n.concat(o)}return n}function g3(t){let e=t.activeElement;for(;((r=e)==null||(n=r.shadowRoot)==null?void 0:n.activeElement)!=null;){var r,n;e=e.shadowRoot.activeElement}return e}function wy(t){t.preventDefault(),t.stopPropagation()}function Ay(t){const e=tt.useRef(t);return Va(()=>{e.current=t}),e}function y3(t){const e=tt.useRef();return Va(()=>{e.current=t},[t]),e.current}const gMt=function(t,e){let{open:r}=t,{enabled:n=!0,role:o="dialog"}=e===void 0?{}:e;const i=h3(),a=h3(),u={id:i,role:o};return n?o==="tooltip"?{reference:{"aria-describedby":r?i:void 0},floating:u}:{reference:_(_({"aria-expanded":r?"true":"false","aria-haspopup":o,"aria-controls":r?i:void 0},o==="listbox"&&{role:"combobox"}),o==="menu"&&{id:a}),floating:_(_({},u),o==="menu"&&{"aria-labelledby":a})}:{}};function IR(t,e){if(e==null)return!1;if("composedPath"in t)return t.composedPath().includes(e);const r=t;return r.target!=null&&e.contains(r.target)}const yMt=function(t,e){let{open:r,onOpenChange:n,refs:o,events:i,nodeId:a}=t,{enabled:u=!0,escapeKey:c=!0,outsidePointerDown:s=!0,referencePointerDown:f=!1,ancestorScroll:l=!1,bubbles:p=!0}=e===void 0?{}:e;const d=bR(),h=Ay(n),m=v3()!=null;return bt.useEffect(()=>{if(!r||!u)return;function g(I){if(I.key==="Escape"){if(!p&&d&&TR(d.nodesRef.current,a).length>0)return;i.emit("dismiss",{preventScroll:!1}),h.current(!1)}}function b(I){const S=d&&TR(d.nodesRef.current,a).some(k=>{var C;return IR(I,(C=k.context)==null?void 0:C.refs.floating.current)});IR(I,o.floating.current)||IR(I,o.domReference.current)||S||!p&&d&&TR(d.nodesRef.current,a).length>0||(i.emit("dismiss",m?{preventScroll:!0}:!1),h.current(!1))}function $(){h.current(!1)}const w=$R(o.floating.current);c&&w.addEventListener("keydown",g),s&&w.addEventListener("pointerdown",b);const y=(l?[..._R(o.reference.current)?zf(o.reference.current):[],..._R(o.floating.current)?zf(o.floating.current):[]]:[]).filter(I=>{var S;return I!==((S=w.defaultView)==null?void 0:S.visualViewport)});return y.forEach(I=>I.addEventListener("scroll",$,{passive:!0})),()=>{c&&w.removeEventListener("keydown",g),s&&w.removeEventListener("pointerdown",b),y.forEach(I=>I.removeEventListener("scroll",$))}},[c,s,i,d,a,r,h,l,u,p,o,m]),u?{reference:{onPointerDown(){f&&(i.emit("dismiss"),n(!1))}}}:{}},b3="ArrowUp",OR="ArrowDown",Cy="ArrowLeft",xy="ArrowRight";function $3(t,e){return e<0||e>=t.current.length}function qf(t,e){let{startingIndex:r=-1,decrement:n=!1,disabledIndices:o}=e===void 0?{}:e;const i=t.current;let a=r;do{var u,c;a=a+(n?-1:1)}while(a>=0&&a<=i.length-1&&(o?o.includes(a):i[a]==null||((u=i[a])==null?void 0:u.hasAttribute("disabled"))||((c=i[a])==null?void 0:c.getAttribute("aria-disabled"))==="true"));return a}function ky(t,e,r){switch(t){case"vertical":return e;case"horizontal":return r;default:return e||r}}function _3(t,e){return ky(e,t===b3||t===OR,t===Cy||t===xy)}function MR(t,e,r){return ky(e,t===OR,r?t===Cy:t===xy)||t==="Enter"||t==" "||t===""}function bMt(t,e,r){return ky(e,r?t===Cy:t===xy,t===OR)}function $Mt(t,e,r){return ky(e,r?t===xy:t===Cy,t===b3)}function RR(t,e){return qf(t,{disabledIndices:e})}function S3(t,e){return qf(t,{decrement:!0,startingIndex:t.current.length,disabledIndices:e})}const _Mt=function(t,e){let{open:r,onOpenChange:n,refs:o}=t,{listRef:i,activeIndex:a,onNavigate:u,enabled:c=!0,selectedIndex:s=null,allowEscape:f=!1,loop:l=!1,nested:p=!1,rtl:d=!1,virtual:h=!1,focusItemOnOpen:m="auto",focusItemOnHover:g=!0,openOnArrowKeyDown:b=!0,disabledIndices:$=b?void 0:[],orientation:w="vertical"}=e===void 0?{listRef:{current:[]},activeIndex:null,onNavigate:()=>{}}:e;const y=v3(),I=bR(),S=y3(r),k=bt.useRef(m),C=bt.useRef(s!=null?s:-1),B=bt.useRef(null),q=Ay(y3(u)),G=Ay(u),O=Ay($),R=bt.useRef(!1),x=bt.useRef(-1),[F,L]=bt.useState(),U=bt.useCallback((T,M)=>{x.current=requestAnimationFrame(()=>{if(h){var N;L((N=T.current[M.current])==null?void 0:N.id)}else{var at;(at=T.current[M.current])==null||at.focus({preventScroll:!0})}})},[h]);Va(()=>{!c||(!S&&r&&k.current&&s!=null&&G.current(s),S&&!r&&(cancelAnimationFrame(x.current),C.current=-1,q.current==null||q.current(null)))},[r,S,s,i,G,q,U,c]),Va(()=>{if(!!c&&r)if(a==null){if(s!=null)return;S&&(C.current=-1,U(i,C)),!S&&k.current&&(B.current!=null||k.current===!0&&B.current==null)&&(C.current=B.current==null||MR(B.current,w,d)||p?RR(i,O.current):S3(i,O.current),G.current(C.current),U(i,C))}else $3(i,a)||(C.current=a,U(i,C))},[r,S,a,s,p,i,G,U,c,f,w,d,h,O]),Va(()=>{if(!!c&&!r&&S){var T,M;const N=I==null||(T=I.nodesRef.current.find(at=>at.id===y))==null||(M=T.context)==null?void 0:M.refs.floating.current;N&&!N.contains(g3($R(N)))&&N.focus({preventScroll:!0})}},[c,r,S,I,y]),Va(()=>{B.current=null});function rt(T){if(R.current=!0,p&&$Mt(T.key,w,d)){wy(T),n(!1),hMt(o.domReference.current)&&o.domReference.current.focus();return}const M=C.current,N=RR(i,$),at=S3(i,$);if(T.key==="Home"&&(C.current=N,u(C.current)),T.key==="End"&&(C.current=at,u(C.current)),_3(T.key,w)){if(wy(T),r&&!h&&g3(T.currentTarget.ownerDocument)===T.currentTarget){C.current=MR(T.key,w,d)?N:at,u(C.current);return}MR(T.key,w,d)?l?C.current=M>=at?f&&M!==i.current.length?-1:N:qf(i,{startingIndex:M,disabledIndices:$}):C.current=Math.min(at,qf(i,{startingIndex:M,disabledIndices:$})):l?C.current=M<=N?f&&M!==-1?i.current.length:at:qf(i,{startingIndex:M,decrement:!0,disabledIndices:$}):C.current=Math.max(N,qf(i,{startingIndex:M,decrement:!0,disabledIndices:$})),$3(i,C.current)?u(null):u(C.current)}}return c?{reference:K(_({},h&&r&&a!=null&&{"aria-activedescendant":F}),{onKeyDown(T){if(R.current=!0,h&&r)return rt(T);if((T.key.indexOf("Arrow")===0||T.key==="Enter"||T.key===" "||T.key==="")&&(B.current=T.key),p){bMt(T.key,w,d)&&(wy(T),r?(C.current=RR(i,$),u(C.current)):n(!0));return}_3(T.key,w)&&(s!=null&&(C.current=s),wy(T),!r&&b?n(!0):rt(T),r&&u(C.current))}}),floating:K(_({"aria-orientation":w==="both"?void 0:w},h&&a!=null&&{"aria-activedescendant":F}),{onKeyDown:rt,onPointerMove(){R.current=!1}}),item:_({onFocus(T){let{currentTarget:M}=T;const N=i.current.indexOf(M);N!==-1&&u(N)},onClick:T=>{let{currentTarget:M}=T;return M.focus({preventScroll:!0})}},g&&{onMouseMove(T){let{currentTarget:M}=T;const N=M;if(N){const at=i.current.indexOf(N);at!==-1&&u(at)}},onPointerLeave(){if(!R.current&&(C.current=-1,U(i,C),G.current(null),!h)){var T;(T=o.floating.current)==null||T.focus({preventScroll:!0})}}})}:{}};function SMt(t){const{char:e,allowSpaces:r,prefixSpace:n,startOfLine:o,$position:i}=t,a=gTt(e),u=new RegExp(`\\s${a}$`),c=o?"^":"",s=r?new RegExp(`${c}${a}.*?(?=\\s${a}|$)`,"gm"):new RegExp(`${c}(?:^)?${a}[^\\s${a}]*`,"gm"),l=i.depth<=0?0:i.before(),p=i.pos,d=i.doc.textBetween(l,p,"\0","\0"),h=Array.from(d.matchAll(s)).pop();if(!h||h.input===void 0||h.index===void 0)return null;const m=h.input.slice(Math.max(0,h.index-1),h.index),g=/^[\s\0]?$/.test(m);if(n&&!g)return null;const b=h.index+i.start();let $=b+h[0].length;return r&&u.test(d.slice($-1,$+1))&&(h[0]+=" ",$+=1),b<i.pos&&$>=i.pos?{range:{from:b,to:$},query:h[0].slice(e.length),text:h[0]}:null}const TMt=new oo("suggestion");function IMt({pluginKey:t=TMt,editor:e,char:r="@",allowSpaces:n=!1,prefixSpace:o=!0,startOfLine:i=!1,decorationTag:a="span",decorationClass:u="suggestion",command:c=()=>null,items:s=()=>[],render:f=()=>({}),allow:l=()=>!0}){let p;const d=f==null?void 0:f();return new Dr({key:t,view(){return{update:async(h,m)=>{var g,b,$,w,y;const I=(g=this.key)===null||g===void 0?void 0:g.getState(m),S=(b=this.key)===null||b===void 0?void 0:b.getState(h.state),k=I.active&&S.active&&I.range.from!==S.range.from,C=!I.active&&S.active,B=I.active&&!S.active,q=!C&&!B&&I.query!==S.query,G=C||k,O=q&&!k,R=B||k;if(!G&&!O&&!R)return;const x=R&&!G?I:S,F=document.querySelector(`[data-decoration-id="${x.decorationId}"]`);p={editor:e,range:x.range,query:x.query,text:x.text,items:O||G?await s({editor:e,query:x.query}):[],command:L=>{c({editor:e,range:x.range,props:L})},decorationNode:F,clientRect:F?()=>{var L;const{decorationId:U}=(L=this.key)===null||L===void 0?void 0:L.getState(e.state);return document.querySelector(`[data-decoration-id="${U}"]`).getBoundingClientRect()}:null},R&&(($=d==null?void 0:d.onExit)===null||$===void 0||$.call(d,p)),O&&((w=d==null?void 0:d.onUpdate)===null||w===void 0||w.call(d,p)),G&&((y=d==null?void 0:d.onStart)===null||y===void 0||y.call(d,p))},destroy:()=>{var h;!p||(h=d==null?void 0:d.onExit)===null||h===void 0||h.call(d,p)}}},state:{init(){return{active:!1,range:{},query:null,text:null,composing:!1}},apply(h,m,g,b){const{composing:$}=e.view,{selection:w}=h,{empty:y,from:I}=w,S=_({},m);if(S.composing=$,y||e.view.composing){(I<m.range.from||I>m.range.to)&&!$&&!m.composing&&(S.active=!1);const k=SMt({char:r,allowSpaces:n,prefixSpace:o,startOfLine:i,$position:w.$from}),C=`id_${Math.floor(Math.random()*4294967295)}`;k&&l({editor:e,state:b,range:k.range})?(S.active=!0,S.decorationId=m.decorationId?m.decorationId:C,S.range=k.range,S.query=k.query,S.text=k.text):S.active=!1}else S.active=!1;return S.active||(S.decorationId=null,S.range={},S.query=null,S.text=null),S}},props:{handleKeyDown(h,m){var g;const{active:b,range:$}=this.getState(h.state);return b&&((g=d==null?void 0:d.onKeyDown)===null||g===void 0?void 0:g.call(d,{view:h,event:m,range:$}))||!1},decorations(h){const{active:m,range:g,decorationId:b}=this.getState(h);return m?Nt.create(h.doc,[Ie.inline(g.from,g.to,{nodeName:a,class:u,"data-decoration-id":b})]):null}}})}function T3(t){var e,r,n="";if(typeof t=="string"||typeof t=="number")n+=t;else if(typeof t=="object")if(Array.isArray(t))for(e=0;e<t.length;e++)t[e]&&(r=T3(t[e]))&&(n&&(n+=" "),n+=r);else for(e in t)t[e]&&(n&&(n+=" "),n+=e);return n}function OMt(){for(var t=0,e,r,n="";t<arguments.length;)(e=arguments[t++])&&(r=T3(e))&&(n&&(n+=" "),n+=r);return n}const MMt=sn.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:t}){return["p",Ge(this.options.HTMLAttributes,t),0]},addCommands(){return{setParagraph:()=>({commands:t})=>t.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),Uo={heading1:"heading1",heading2:"heading2",heading3:"heading3",heading4:"heading4",heading5:"heading5",heading6:"heading6",paragraph:"paragraph",preformatted:"preformatted",strong:"strong",em:"em",listItem:"list-item",oListItem:"o-list-item",list:"group-list-item",oList:"group-o-list-item",image:"image",embed:"embed",hyperlink:"hyperlink",label:"label",span:"span"},Wy=()=>(++Wy.i).toString();Wy.i=0;const RMt=t=>{const e=EMt(t),r=[];for(let n=0;n<e.length;n++)r.push(I3(e[n]));return{key:Wy(),children:r}},Jd=(t,e=[])=>({key:Wy(),type:t.type,text:"text"in t?t.text:void 0,node:t,children:e}),ER=t=>Jd({type:Uo.span,text:t,spans:[]}),EMt=t=>{const e=t.slice(0);for(let r=0;r<e.length;r++){const n=e[r];if(n.type===Uo.listItem||n.type===Uo.oListItem){const o=[n];for(;e[r+1]&&e[r+1].type===n.type;)o.push(e[r+1]),e.splice(r,1);n.type===Uo.listItem?e[r]={type:Uo.list,items:o}:e[r]={type:Uo.oList,items:o}}}return e},I3=t=>{if("text"in t)return Jd(t,O3(t.spans,t));if("items"in t){const e=[];for(let r=0;r<t.items.length;r++)e.push(I3(t.items[r]));return Jd(t,e)}return Jd(t)},O3=(t,e,r)=>{if(!t.length)return[ER(e.text)];const n=t.slice(0);n.sort((i,a)=>i.start-a.start||a.end-i.end);const o=[];for(let i=0;i<n.length;i++){const a=n[i],u=r&&r.start||0,c=a.start-u,s=a.end-u,f=[];for(let l=i;l<n.length;l++){const p=n[l];p!==a&&p.start>=a.start&&p.end<=a.end&&(f.push(p),n.splice(l,1),l--)}i===0&&c>0&&o.push(ER(e.text.slice(0,c))),o.push(Jd(a,O3(f,K(_({},e),{text:e.text.slice(c,s)}),a))),s<e.text.length&&o.push(ER(e.text.slice(s,n[i+1]?n[i+1].start-u:void 0)))}return o},wMt=(t,e)=>M3(RMt(t).children,e),M3=(t,e)=>{const r=[];for(let n=0;n<t.length;n++){const o=t[n],i=e(o.type,o.node,o.text,M3(o.children,e),o.key);i!=null&&r.push(i)}return r};Uo.listItem+"",Uo.oListItem+"",Uo.list+"",Uo.oList+"";const AMt=sn.create({name:"text",group:"inline"}),CMt={groupBy(t,e){return t.reduce((r,n)=>{const o=e(n),i=(r.get(o)||[]).concat(n);return r.set(o,i)},new Map)},sort(t){return[...t].sort((e,r)=>e.start-r.start)},mergeOverlap(t){const e=this.groupBy(t,n=>n.type),r=Array.from(e.entries()).map(([n,o])=>(this.sort(o).reduce((i,a)=>{if(!i.length)return[a];const u=i.length-1,c=i[u];return c.end>=a.start?[...i.slice(0,u),K(_({},c),{end:a.end})]:[...i,a]},[]),o)).reduce((n,o)=>[...n,...o],[]);return this.sort(r)}},R3={fromPrismic(t){return e=>{var r;return(r=kR.find(n=>n.richTextNodeTypes[0]===e.type))==null?void 0:r.converter.fromPrismic(t)(e)}},toPrismic(t,e,r){const[n,o]=(()=>{const i=kR.find(a=>t.type.name===a.name);if(!i)throw new Error(`Invalid mark extension '${t.type.name}'.`);return[i.richTextNodeTypes[0],i==null?void 0:i.converter.toPrismic(t)]})();return _({type:n,start:e,end:r},o?{data:o}:{})}},E3=AMt.extend({name:"text"}),xMt={fromPrismic(t){return function(e,r,n=!1){const o={type:e,text:r.content.text,spans:r.content.spans||[]};return wMt([o],kMt(t,n))[0]}},toPrismic(t,e,r){const n=Sc.children.reduce(t,(o,i)=>{const a=(()=>i.type.name===Sy.name?Sy.converter.toPrismic(i):i.textContent)(),u=a?o.text+a:o.text,c=o.text.length,s=u.length,f=(()=>i.marks.length?Sc.marks.map(i,p=>R3.toPrismic(p,c,s)):void 0)();return K(_({},o),{text:u,spans:f?[...o.spans,...f]:o.spans})},{text:"",spans:[]});return _({type:e,content:{text:n.text,spans:([...CMt.mergeOverlap(n.spans)].sort((o,i)=>o.type.localeCompare(i.type))||[]).map(o=>K(_({},o),{type:o.type}))}},r)}};function kMt(t,e=!1){return(r,n,o,i)=>{if(r==="span"&&o&&o.length)return e?[t.text(o)]:Sy.splitTextToNodes(t,o)(a=>t.text(a));{const a=R3.fromPrismic(t)(n);return a?S_(i).map(c=>c.mark([...c.marks,a].sort((s,f)=>s.type.name.localeCompare(f.type.name)))):S_(i)}}}const Tc={name:E3.name,component:E3,converter:xMt};var $e;(function(t){t.LeftToRight="ltr",t.RightToLeft="rtl"})($e||($e={}));const Ic="text-direction",WMt=_t.RichTextNodeType.rtl,FMt=Ur.create({name:"textDirection",addOptions(){return{supportedExtensionNames:[]}},addGlobalAttributes(){return[{types:this.options.supportedExtensionNames,attributes:{[Ic]:{default:$e.LeftToRight,parseHTML:t=>{const e=t.attributes;return e.dir&&e.dir===!0?$e.RightToLeft:$e.LeftToRight},renderHTML:t=>t[Ic]===$e.RightToLeft?{dir:$e.RightToLeft}:{dir:$e.LeftToRight}}}}]},addCommands(){return{setDirection:t=>({commands:e})=>{switch(t){case $e.RightToLeft:return e.setRightToLeft();default:return e.setLeftToRight()}},toggleDirection:t=>({commands:e})=>{const r=t===$e.RightToLeft?$e.LeftToRight:$e.RightToLeft;return e.setDirection(r)},setRightToLeft:()=>({commands:t})=>this.options.supportedExtensionNames.every(e=>t.updateAttributes(e,{[Ic]:$e.RightToLeft})),setLeftToRight:()=>({commands:t})=>this.options.supportedExtensionNames.every(e=>t.resetAttributes(e,Ic))}},addKeyboardShortcuts(){return{"Mod-Shift-r":()=>this.editor.commands.setRightToLeft(),"Mod-Shift-l":()=>this.editor.commands.setLeftToRight()}}}),Ni={parseNodeAttrsDirection(t){switch(t[Ic]){case $e.RightToLeft:return $e.RightToLeft;default:return $e.LeftToRight}},fromPrismic(t){const e=(()=>{switch(t.direction){case $e.RightToLeft:return $e.RightToLeft;default:return $e.LeftToRight}})();return{[Ic]:e}},toPrismic(t){const e=this.parseNodeAttrsDirection(t.attrs);return e?{direction:e}:{}}},Fy=MMt.extend({name:"paragraph",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:t}){return["p",Ge(this.options.HTMLAttributes,t),0]}}),NMt={fromPrismic(t){return function(e){var n;const r=Tc.converter.fromPrismic(t)(Fy.name,e);return(n=t.nodes[Fy.name])==null?void 0:n.create(Ni.fromPrismic(e),r)}},toPrismic(t){return Tc.converter.toPrismic(t,_t.RichTextNodeType.paragraph,Ni.toPrismic(t))}},Ha=new Uf([_t.RichTextNodeType.paragraph],Fy.name,Fy,NMt,"Type '/' for commands"),w3=["ArrowDown","ArrowUp","End","Home"],A3=["Enter"],PMt=["Escape",...w3,...A3],DMt=Ur.create({name:"slash-commands",addOptions(){return{nodeTypes:[]}},addProseMirrorPlugins(){const t=Uy(N3,this.options.nodeTypes);return t.length>1?[IMt({allowSpaces:!0,char:"/",editor:this.editor,startOfLine:!0,allow:({editor:e,state:r})=>{const n=r.selection.$from,o=n.parent.type.name===Ha.name&&n.depth===1;return e.isEditable&&o},command:({editor:e,props:r,range:n})=>{r.runCommands(e,{deleteRange:n})},items:({query:e})=>{const r=e.toLocaleLowerCase().trim();return t.filter(n=>{var o,i;return((o=n.shortText)==null?void 0:o.toLocaleLowerCase().includes(r))||((i=n.text)==null?void 0:i.toLocaleLowerCase().includes(r))})},render:()=>{let e;return{onStart:r=>{e=new BK(LMt,{editor:r.editor,props:r}),document.body.appendChild(e.element)},onUpdate:r=>{e==null||e.updateProps(r)},onKeyDown:({event:r})=>e!==void 0&&e.ref!==null&&PMt.includes(r.key)&&e.ref.handleKeyDown(r),onExit:()=>{e==null||e.destroy(),e==null||e.element.remove()}}}})]:[]}}),LMt=tt.forwardRef(function({command:e,decorationNode:r,editor:n,items:o},i){const[a,u]=tt.useState(!0),{context:c,floating:s,reference:f,strategy:l,x:p,y:d}=vMt({middleware:[zOt(8),jOt(),qOt({limiter:KOt()})],onOpenChange:u,open:a,placement:"top-start",strategy:"fixed",whileElementsMounted:iMt});tt.useLayoutEffect(()=>{f(r)},[f,r]),tt.useEffect(()=>{let q;const G=()=>{q=setTimeout(()=>{u(!0)})},O=()=>{u(!1)};return n.on("focus",G).on("blur",O),()=>{n.off("focus",G).off("blur",O),clearTimeout(q)}},[n]);const[h,m]=tt.useState(0),g=tt.useRef([]),[b,$]=tt.useState();o!==b&&(m(0),g.current=[],$(o));const{getFloatingProps:w,getItemProps:y,getReferenceProps:I}=mMt([yMt(c,{outsidePointerDown:!1}),_Mt(c,{activeIndex:h,listRef:g,onNavigate:q=>{m(G=>q!=null?q:G)},openOnArrowKeyDown:!1,virtual:!0}),gMt(c,{role:"menu"})]),k=I().onKeyDown;tt.useImperativeHandle(i,()=>({handleKeyDown:q=>{if(a){if(w3.includes(q.key)&&k(q),A3.includes(q.key)){const G=o[h];G!==void 0&&e(G)}return!0}else return!1}}),[h,e,o,k,a]);const C=p!==null&&d!==null,B=Ky();return a?br("div",K(_({},w()),{className:Y.dropdownMenuStyles.content,ref:s,style:{insetBlockStart:0,insetInlineStart:0,minInlineSize:256,position:l,transform:C?`translate3d(${Math.round(p)}px, ${Math.round(d)}px, 0)`:"translate3d(0, -200%, 0)"},children:[o.map((q,G)=>{var O;return tt.createElement(C3,K(_({},y({onClick:()=>{e(q)},onPointerDown:R=>{R.preventDefault()}})),{"data-highlighted":G===h?"":void 0,id:`${B}[${G}]`,key:q.nodeType,ref:R=>{g.current[G]=R},shortcut:`/${(O=q.shortText)!=null?O:""}`,startIcon:q.icon}),q.text)}),o.length===0?J(C3,K(_({},y({onPointerDown:q=>{q.preventDefault()}})),{disabled:!0,id:`${B}[0]`,ref:q=>{g.current[0]=q},children:"No results"})):null]})):null}),C3=tt.forwardRef(function(u,a){var c=u,{children:e,disabled:r,shortcut:n,startIcon:o}=c,i=Wn(c,["children","disabled","shortcut","startIcon"]);return br("div",K(_(_({},i),r?{"aria-disabled":!0,"data-disabled":!0}:{}),{className:Y.dropdownMenuStyles.item,ref:a,role:"menuitem",children:[tt.isValidElement(o)?tt.cloneElement(o,{className:OMt(o.props.className,Y.dropdownMenuStyles.itemStartIcon)}):null,J(Y.Text,{className:Y.dropdownMenuStyles.itemText,component:"span",children:e}),n?J(Y.Text,{className:Y.dropdownMenuStyles.itemShortcut,color:"inherit",component:"span",variant:"inherit",weight:"inherit",children:n}):null]}))});function UMt(t,e){var i;const r=e.map(a=>a.richTextNodeTypes).flat(),n=Ko.pipe(e,zn(a=>a.nodeType===xi.Text),Yh({},(a,u)=>K(_({},a),{[u.name]:u.placeholder}))),o=r.includes(_t.RichTextNodeType.orderedList)||r.includes(_t.RichTextNodeType.list);return zn(a=>a!==void 0)([by.component(((i=t.config)==null?void 0:i.single)===void 0),Tc.component,Sy.component,COt(n),o?jf.component:void 0,DMt.configure({nodeTypes:r})])}const wR=_Ot.extend({name:"bulletList",parseHTML(){return[{tag:"ul"}]},renderHTML({HTMLAttributes:t}){return["ul",Ge(this.options.HTMLAttributes,t),0]}}).configure({itemTypeName:"listItem"}),jMt={fromPrismic(t){return function(e){var n;const r=jf.converter.fromPrismic(t)(e);if(!!r)return(n=t.nodes[wR.name])==null?void 0:n.create(Ni.fromPrismic(e),r)}},toPrismic(t){return G$(Sc.children.map(t,e=>zn(r=>r!==void 0)(jf.converter.toPrismic(e,_t.RichTextNodeType.list))))}},Ny=new fR([_t.RichTextNodeType.list],wR.name,wR,jMt),BMt=/^```([a-z]+)?[\s\n]$/,zMt=/^~~~([a-z]+)?[\s\n]$/,Py=sn.create({name:"codeBlock",addOptions(){return{languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,HTMLAttributes:{}}},content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:null,parseHTML:t=>{var e;const{languageClassPrefix:r}=this.options,i=[...((e=t.firstElementChild)===null||e===void 0?void 0:e.classList)||[]].filter(a=>a.startsWith(r)).map(a=>a.replace(r,""))[0];return i||null},rendered:!1}}},parseHTML(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML({node:t,HTMLAttributes:e}){return["pre",Ge(this.options.HTMLAttributes,e),["code",{class:t.attrs.language?this.options.languageClassPrefix+t.attrs.language:null},0]]},addCommands(){return{setCodeBlock:t=>({commands:e})=>e.setNode(this.name,t),toggleCodeBlock:t=>({commands:e})=>e.toggleNode(this.name,"paragraph",t)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{const{empty:t,$anchor:e}=this.editor.state.selection,r=e.pos===1;return!t||e.parent.type.name!==this.name?!1:r||!e.parent.textContent.length?this.editor.commands.clearNodes():!1},Enter:({editor:t})=>{if(!this.options.exitOnTripleEnter)return!1;const{state:e}=t,{selection:r}=e,{$from:n,empty:o}=r;if(!o||n.parent.type!==this.type)return!1;const i=n.parentOffset===n.parent.nodeSize-2,a=n.parent.textContent.endsWith(`
119
+
120
+ `);return!i||!a?!1:t.chain().command(({tr:u})=>(u.delete(n.pos-2,n.pos),!0)).exitCode().run()},ArrowDown:({editor:t})=>{if(!this.options.exitOnArrowDown)return!1;const{state:e}=t,{selection:r,doc:n}=e,{$from:o,empty:i}=r;if(!i||o.parent.type!==this.type||!(o.parentOffset===o.parent.nodeSize-2))return!1;const u=o.after();return u===void 0||n.nodeAt(u)?!1:t.commands.exitCode()}}},addInputRules(){return[G1({find:BMt,type:this.type,getAttributes:t=>({language:t[1]})}),G1({find:zMt,type:this.type,getAttributes:t=>({language:t[1]})})]},addProseMirrorPlugins(){return[new Dr({key:new oo("codeBlockVSCodeHandler"),props:{handlePaste:(t,e)=>{if(!e.clipboardData||this.editor.isActive(this.type.name))return!1;const r=e.clipboardData.getData("text/plain"),n=e.clipboardData.getData("vscode-editor-data"),o=n?JSON.parse(n):void 0,i=o==null?void 0:o.mode;if(!r||!i)return!1;const{tr:a}=t.state;return a.replaceSelectionWith(this.type.create({language:i})),a.setSelection(wt.near(a.doc.resolve(Math.max(0,a.selection.from-2)))),a.insertText(r.replace(/\r\n?/g,`
121
+ `)),a.setMeta("paste",!0),t.dispatch(a),!0}}})]}}).extend({name:"preformatted",addAttributes(){return{language:{default:null,parseHTML:t=>{var i;const{languageClassPrefix:e}=this.options,o=[...((i=t.firstElementChild)==null?void 0:i.classList)||[]].filter(a=>a.startsWith(e)).map(a=>a.replace(e,""))[0];return o||null},renderHTML:t=>t.language?{class:this.options.languageClassPrefix+t.language}:null}}},parseHTML(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML({HTMLAttributes:t}){return["pre",Ge(this.options.HTMLAttributes),["code",t,0]]}}).configure({exitOnTripleEnter:!1}),qMt={fromPrismic(t){return function(e){var n;const r=Tc.converter.fromPrismic(t)(Py.name,e,!0);return(n=t.nodes[Py.name])==null?void 0:n.create(Ni.fromPrismic(e),r)}},toPrismic(t){return Tc.converter.toPrismic(t,_t.RichTextNodeType.preformatted,Ni.toPrismic(t))}},x3=new Uf([_t.RichTextNodeType.preformatted],Py.name,Py,qMt,"",!0),KMt=()=>{const[t,e]=tt.useState();return J(fOt,{className:"react-component",children:br("div",{children:[J("input",{placeholder:"embed url",onChange:r=>{e(r.target.value)}}),t?J("iframe",{width:"560",height:"315",src:t,title:"YouTube video player",frameBorder:0,allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"}):null]})})},AR=sn.create({name:"embed",group:"block",atom:!0,addAttributes(){return{src:{default:null}}},addNodeView(){return aOt(KMt)},addCommands(){return{setEmbed:()=>({tr:t,dispatch:e})=>{const{selection:r}=t,n=this.type.create();return e&&t.replaceRangeWith(r.from,r.to,n),!0}}}}),VMt={fromPrismic(t){return function(e){var n;const r=void 0;return(n=t.nodes[AR.name])==null?void 0:n.create({},r)}},toPrismic(t){}};new gOt([_t.RichTextNodeType.embed],AR.name,AR,VMt);const HMt=sn.create({name:"heading",addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:"inline*",group:"block",defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(t=>({tag:`h${t}`,attrs:{level:t}}))},renderHTML({node:t,HTMLAttributes:e}){return[`h${this.options.levels.includes(t.attrs.level)?t.attrs.level:this.options.levels[0]}`,Ge(this.options.HTMLAttributes,e),0]},addCommands(){return{setHeading:t=>({commands:e})=>this.options.levels.includes(t.level)?e.setNode(this.name,t):!1,toggleHeading:t=>({commands:e})=>this.options.levels.includes(t.level)?e.toggleNode(this.name,"paragraph",t):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((t,e)=>K(_({},t),{[`Mod-Alt-${e}`]:()=>this.editor.commands.toggleHeading({level:e})}),{})},addInputRules(){return this.options.levels.map(t=>G1({find:new RegExp(`^(#{1,${t}})\\s$`),type:this.type,getAttributes:{level:t}}))}}),Dy="heading",Pi={byLevel(t){switch(t){case 1:return _t.RichTextNodeType.heading1;case 2:return _t.RichTextNodeType.heading2;case 3:return _t.RichTextNodeType.heading3;case 4:return _t.RichTextNodeType.heading4;case 5:return _t.RichTextNodeType.heading5;case 6:return _t.RichTextNodeType.heading6}},default(t){return{fullName:this.byLevel(t),level:t}},fromPrismic(t,e=[1,2,3,4,5,6]){const r=new RegExp(`^heading([${e.join(",")}]){1}$`),n=t.match(r);if(!n||!n[1])return;const o=parseInt(n[1]);return{fullName:Pi.byLevel(o),level:o}},fromProsemirror(t,e){const r=t.level;if(e.includes(r))return{fullName:Pi.byLevel(r),level:r}}},JMt=t=>HMt.extend({name:Dy,addAttributes(){return{level:{default:t[0]},label:{default:null}}},addOptions(){return{levels:[...t],HTMLAttributes:{}}},parseHTML(){return this.options.levels.map(e=>({tag:`h${e}`}))},renderHTML({node:e,HTMLAttributes:r}){const n=e.attrs.level,o=e.attrs.label?{label:e.attrs.label}:{},i=_({},o);return[`h${n}`,Ge(this.options.HTMLAttributes,r,i),0]}}),GMt=t=>{const e=t[0];return{fromPrismic(r){return function(n){var a;const o=Tc.converter.fromPrismic(r)(Dy,n),i=Pi.fromPrismic(n.type,t)||Pi.default(e);if(!!i)return(a=r.nodes[Dy])==null?void 0:a.create(_({level:i.level},Ni.fromPrismic(n)),o)}},toPrismic(r){const{fullName:n}=Pi.fromProsemirror(r.attrs,t)||Pi.default(e);return Tc.converter.toPrismic(r,n,Ni.toPrismic(r))}}};function YMt(t){if(!t)return[1,2,3,4,5,6];if(!t.size)return;const e=Array.from(t.values()).reduce((r,n)=>{const o=Pi.fromPrismic(n);return o?[...r,o.level]:r},[]).sort((r,n)=>r-n);return v($l(e),Z_(()=>{}))}var Oc={name:Dy,build:t=>{const e=YMt(t);if(!e)return;const r=$l(e.map(n=>Pi.byLevel(n)));if(!It(r))return new yOt(r.value,JMt(e),e,GMt(e),n=>{const o=Pi.fromProsemirror(n,e);return o&&`Heading ${o.level}`})}};const XMt=/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))$/,ZMt=/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))/g,QMt=/(?:^|\s)((?:_)((?:[^_]+))(?:_))$/,t1t=/(?:^|\s)((?:_)((?:[^_]+))(?:_))/g,CR=Nd.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:t=>t.style.fontStyle!=="normal"&&null},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:t}){return["em",Ge(this.options.HTMLAttributes,t),0]},addCommands(){return{setItalic:()=>({commands:t})=>t.setMark(this.name),toggleItalic:()=>({commands:t})=>t.toggleMark(this.name),unsetItalic:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[fy({find:XMt,type:this.type}),fy({find:QMt,type:this.type})]},addPasteRules(){return[ly({find:ZMt,type:this.type}),ly({find:t1t,type:this.type})]}}).extend({name:"em"}),e1t={fromPrismic(t){return function(){var e;return(e=t.marks[CR.name])==null?void 0:e.create()}},toPrismic(){}},k3=new qK([_t.RichTextNodeType.em],CR.name,CR,e1t),r1t=/^(\d+)\.\s$/,xR=sn.create({name:"orderedList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{}}},group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes(){return{start:{default:1,parseHTML:t=>t.hasAttribute("start")?parseInt(t.getAttribute("start")||"",10):1}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:t}){const n=t,{start:e}=n,r=Wn(n,["start"]);return e===1?["ol",Ge(this.options.HTMLAttributes,r),0]:["ol",Ge(this.options.HTMLAttributes,t),0]},addCommands(){return{toggleOrderedList:()=>({commands:t})=>t.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){return[nK({find:r1t,type:this.type,getAttributes:t=>({start:+t[1]}),joinPredicate:(t,e)=>e.childCount+e.attrs.start===+t[1]})]}}).extend({name:"orderedList",addAttributes(){return{start:{default:1,parseHTML:t=>t.hasAttribute("start")?parseInt(t.getAttribute("start")||"",10):1}}},renderHTML({HTMLAttributes:t}){const n=t,{start:e}=n,r=Wn(n,["start"]);return e===1?["ol",Ge(this.options.HTMLAttributes,r),0]:["ol",Ge(this.options.HTMLAttributes,t),0]},addCommands(){return{toggleOrderedList:()=>({commands:t})=>t.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}}}).configure({itemTypeName:"listItem"}),n1t={fromPrismic(t){return function(e){var n;const r=jf.converter.fromPrismic(t)(e);if(!!r)return(n=t.nodes[xR.name])==null?void 0:n.create(Ni.fromPrismic(e),r)}},toPrismic(t){return G$(Sc.children.map(t,e=>zn(r=>r!==void 0)(jf.converter.toPrismic(e,_t.RichTextNodeType.orderedList))))}},Ly=new fR([_t.RichTextNodeType.orderedList],xR.name,xR,n1t),W3=Ha,o1t=t=>zn(e=>e!==void 0)([Ha,Ny,Ly,Oc.build(t),x3]),kR=[KK,k3],F3=t=>[...o1t(t),...kR],N3=[{nodeType:_t.RichTextNodeType.paragraph,icon:J(Y.TextFieldsIcon,{}),isActive:t=>t.isActive(Ha.name)&&!t.isActive(Ny.name)&&!t.isActive(Ly.name),runCommands:fn((t,e)=>t.clearNodes().setDirection(so(e))),shortText:"par",text:"Paragraph"},{nodeType:_t.RichTextNodeType.heading1,icon:J(Y.LooksOneIcon,{}),isActive:t=>t.isActive(Oc.name,{level:1}),runCommands:fn((t,e)=>t.setHeading({level:1}).setDirection(so(e))),shortText:"h1",text:"Heading 1"},{nodeType:_t.RichTextNodeType.heading2,icon:J(Y.LooksTwoIcon,{}),isActive:t=>t.isActive(Oc.name,{level:2}),runCommands:fn((t,e)=>t.setHeading({level:2}).setDirection(so(e))),shortText:"h2",text:"Heading 2"},{nodeType:_t.RichTextNodeType.heading3,icon:J(Y.LooksThreeIcon,{}),isActive:t=>t.isActive(Oc.name,{level:3}),runCommands:fn((t,e)=>t.setHeading({level:3}).setDirection(so(e))),shortText:"h3",text:"Heading 3"},{nodeType:_t.RichTextNodeType.heading4,icon:J(Y.LooksFourIcon,{}),isActive:t=>t.isActive(Oc.name,{level:4}),runCommands:fn((t,e)=>t.setHeading({level:4}).setDirection(so(e))),shortText:"h4",text:"Heading 4"},{nodeType:_t.RichTextNodeType.heading5,icon:J(Y.LooksFiveIcon,{}),isActive:t=>t.isActive(Oc.name,{level:5}),runCommands:fn((t,e)=>t.setHeading({level:5}).setDirection(so(e))),shortText:"h5",text:"Heading 5"},{nodeType:_t.RichTextNodeType.heading6,icon:J(Y.LooksSixIcon,{}),isActive:t=>t.isActive(Oc.name,{level:6}),runCommands:fn((t,e)=>t.setHeading({level:6}).setDirection(so(e))),shortText:"h6",text:"Heading 6"},{nodeType:_t.RichTextNodeType.list,icon:J(Y.FormatListBulletedIcon,{}),isActive:t=>t.isActive(Ny.name),runCommands:fn((t,e)=>t.toggleBulletList().setDirection(so(e))),shortText:"bull",text:"Bulleted list"},{nodeType:_t.RichTextNodeType.orderedList,icon:J(Y.FormatListNumberedIcon,{}),isActive:t=>t.isActive(Ly.name),runCommands:fn((t,e)=>t.toggleOrderedList().setDirection(so(e))),shortText:"num",text:"Numbered list"},{nodeType:_t.RichTextNodeType.preformatted,icon:J(Y.DataObjectIcon,{}),isActive:t=>t.isActive(x3.name),runCommands:fn((t,e)=>t.setCodeBlock().setDirection(so(e))),shortText:"code",text:"Code"}],i1t=[{nodeType:_t.RichTextNodeType.strong,icon:J(Y.FormatBoldIcon,{}),isActive:t=>t.isActive(KK.name),runCommands:fn(t=>t.toggleBold())},{nodeType:_t.RichTextNodeType.em,icon:J(Y.FormatItalicIcon,{}),isActive:t=>t.isActive(k3.name),runCommands:fn(t=>t.toggleItalic())}],a1t=[{nodeType:_t.RichTextNodeType.rtl,icon:J(Y.FormatTextDirectionRtlIcon,{}),isActive:t=>t.isActive({[Ic]:$e.RightToLeft}),runCommands:fn((t,e)=>t.toggleDirection(so(e)))}];function fn(t){return(e,r={})=>{let n=r.can===!0?e.can().chain():e.chain().focus();return r.deleteRange!==void 0&&(n=n.deleteRange(r.deleteRange)),t(n,e).run()}}function so(t){const e=t.state.selection.$from.parent.attrs;return Ni.parseNodeAttrsDirection(e)}function Uy(t,e){return t.filter(r=>e.includes(r.nodeType))}const u1t={duration:100,hideOnClick:!0,offset:[-48,8],placement:"top-start",zIndex:3},c1t=({editor:t,nodeTypes:e})=>{var a,u;const r=Uy(N3,e),n=Uy(i1t,e),o=Uy(a1t,e),i=[r.length>1?J(Y.ToolbarSelect,{onValueChange:c=>{var s;(s=r.find(f=>f.nodeType===c))==null||s.runCommands(t)},value:(u=(a=r.find(c=>c.isActive(t)))==null?void 0:a.nodeType)!=null?u:"",children:r.map(c=>J(Y.ToolbarSelectItem,{value:c.nodeType,children:c.text},c.nodeType))},"node"):null,n.length>0?J(Y.ToolbarToggleButtonGroup,{onValueChange:c=>{n.forEach(s=>{(s.isActive(t)&&!c.includes(s.nodeType)||!s.isActive(t)&&c.includes(s.nodeType))&&s.runCommands(t)})},type:"multiple",value:n.filter(c=>c.isActive(t)).map(c=>c.nodeType),children:n.map(c=>J(Y.ToolbarToggleButtonGroupItem,{disabled:!c.runCommands(t,{can:!0}),startIcon:c.icon,value:c.nodeType},c.nodeType))},"mark"):null,o.length>0?J(tt.Fragment,{children:o.map(c=>J(Y.ToolbarToggleButton,{disabled:!c.runCommands(t,{can:!0}),onPressedChange:()=>{c.runCommands(t)},pressed:c.isActive(t),startIcon:c.icon},c.nodeType))},"extra"):null,r.length+n.length+o.length>1?J(Y.ToolbarButton,{onClick:()=>{t.chain().focus().clearNodes().unsetAllMarks().run()},startIcon:J(Y.FormatClearIcon,{})},"clear"):null].filter(c=>c!==null).map((c,s)=>br(tt.Fragment,{children:[s===0?null:J(Y.ToolbarSeparator,{}),c]},c.key));return i.length>0?J(ZIt,{editor:t,tippyOptions:u1t,children:J(Y.Toolbar,{children:i})}):null},s1t=t=>{var s;const{content:e,field:r,id:n,readOnly:o}=t,i=tt.useMemo(()=>{const{extensions:f,defaultTextConverter:l}=IOt(r.config),p=zn(b=>b.extType===za.Node)(f),d=f.flatMap(b=>b.richTextNodeTypes),h=f.map(b=>b.component),m=[...UMt(r,p),FMt.configure({supportedExtensionNames:zn(b=>b.extType===za.Node&&b.nodeType===xi.Text&&b.lockedFormat===!1)(f).map(b=>b.name)}),...h],g=yTt(m);return{allComponents:m,defaultTextConverter:l,nodeExtensions:p,names:d,schema:g}},[r]),a=e&&by.converter(i.nodeExtensions).fromPrismic(i.schema,(s=i.defaultTextConverter)==null?void 0:s.call(i,i.schema))(e),u=H3(t.onContentChange),c=eOt(K(_({},a?{content:a.toJSON()}:{}),{editable:!o,editorProps:{attributes:{class:Y.contentEditableClass,id:n,tabIndex:"0"}},extensions:i.allComponents,injectCSS:!1,onUpdate({editor:f}){var d;const l=by.converter(i.nodeExtensions).toPrismic(f.state.doc),p=l&&by.converter(i.nodeExtensions).fromPrismic(f.schema,(d=i.defaultTextConverter)==null?void 0:d.call(i,i.schema))(l);console.log({initialProsemirror:f.getJSON(),prismic:l,convertedProsemirror:p==null?void 0:p.toJSON(),areEqual:p&&f.state.doc.eq(p)}),u(l)}}),[i,u,o,n]);return br(Y.Field,{children:[J(Y.FieldLabel,{htmlFor:n,children:xg(r)}),J(Y.FieldControl,{children:br(fc,{children:[J(sOt,{editor:c,style:{flex:1}}),(c==null?void 0:c.isEditable)&&J(c1t,{editor:c,nodeTypes:i.names.concat(WMt)})]})})]})},f1t=({content:t,field:e,id:r,onContentChange:n,readOnly:o})=>{var c,s,f;const i=Sz(e),a=l1t(e),u=(c=t==null?void 0:t.value)!=null?c:a;return br(Y.Field,{children:[J(Y.FieldIcon,{children:J(Y.ArrowDropDownCircleIcon,{})}),J(Y.FieldLabel,{htmlFor:r,children:xg(e)}),J(Y.FieldControl,{children:br(Y.Select,K(_({id:r,onValueChange:l=>{o||n(p1t(t,l))},placeholder:i},u===void 0?{}:{value:u}),{children:[u===void 0||a!==void 0?null:J(Y.SelectItem,{value:"",children:i}),(f=(s=e.config)==null?void 0:s.options)==null?void 0:f.map(l=>J(Y.SelectItem,{value:l,children:l},l))]}))})]},u)};function l1t(t){var e,r;return((e=t.config)==null?void 0:e.default_value)===void 0||(r=t.config.options)==null?void 0:r[0]}function p1t(t,e){if(e.length!==0)return t===void 0?{__TYPE__:"FieldContent",type:"Select",value:e}:K(_({},t),{value:e})}const jy=n=>{var o=n,{content:t,nestableWidget:e}=o,r=Wn(o,["content","nestableWidget"]);return e.type===Bt.WidgetTypes.BooleanField?(ee(t,_i.BooleanContent.is),null):e.type===Bt.WidgetTypes.Color?(ee(t,o$t),null):e.type===Bt.WidgetTypes.Date?(ee(t,i$t),null):e.type===Bt.WidgetTypes.Embed?(ee(t,_i.EmbedContent.is),null):e.type===Bt.WidgetTypes.GeoPoint?(ee(t,a$t),null):e.type===Bt.WidgetTypes.Image?(ee(t,u$t),null):e.type===Bt.WidgetTypes.IntegrationField?(ee(t,_i.IntegrationFieldsContent.is),null):e.type===Bt.WidgetTypes.Link?(ee(t,tc.LinkContent.is),null):e.type===Bt.WidgetTypes.Number?(ee(t,s$t),null):e.type===Bt.WidgetTypes.Range?(ee(t,f$t),null):e.type===Bt.WidgetTypes.RichText?J(s1t,K(_({},r),{content:ee(t,_i.StructuredTextContent.is),field:e})):e.type===Bt.WidgetTypes.Select?J(f1t,K(_({},r),{content:ee(t,l$t),field:e})):e.type===Bt.WidgetTypes.Separator?(ee(t,_i.SeparatorContent.is),null):e.type===Bt.WidgetTypes.Text?J(_$t,K(_({},r),{content:ee(t,c$t),field:e})):(e.type===Bt.WidgetTypes.Timestamp&&ee(t,p$t),null)},P3=({content:t,id:e,nonRepeatableZone:r,onContentChange:n,readOnly:o})=>{const i=d1t(r);return J(fc,{children:i.map(([a,u])=>J(jy,{content:ee(t[a],Cg),id:`${e}.${a}`,nestableWidget:u,onContentChange:c=>{n(n$t(t,a,c))},readOnly:o},a))})};function d1t(t){return tt.useMemo(()=>WM(t),[t])}function h1t(t){return t!=null?t:[{__TYPE__:"GroupItemContent",value:[]}]}function v1t(t){return Object.fromEntries(t.value)}function m1t(t,e,r,n,o){const i=t[e];if(i===void 0)throw new Error(`Cannot update undefined content at index ${e}.`);return[...t.slice(0,e),K(_({},i),{value:[...i.value.slice(0,r),...o===void 0?[]:[[n,o]],...i.value.slice(r+1)]}),...t.slice(e+1)]}const WR=({content:t,id:e,onContentChange:r,readOnly:n,repeatableZone:o})=>{const i=g1t(o),a=h1t(t);return J(fc,{children:a.map((u,c)=>{const s=v1t(u);return i.map(([f,l],p)=>J(jy,{content:ee(s[f],Cg),id:`${e}[${c}].${f}`,nestableWidget:l,onContentChange:d=>{r(m1t(a,c,p,f,d))},readOnly:n},f))})})};function g1t(t){return tt.useMemo(()=>WM(t),[t])}const y1t=o=>{var i=o,{compositeSlice:t,content:e,onContentChange:r}=i,n=Wn(i,["compositeSlice","content","onContentChange"]);return br(Y.FieldSet,{children:[J(Y.FieldSetLegend,{children:t$t(t)}),J(P3,K(_({},n),{content:e.nonRepeat,nonRepeatableZone:e$t(t),onContentChange:a=>{r(K(_({},e),{nonRepeat:a}))}})),J(WR,K(_({},n),{content:e.repeat,onContentChange:a=>{r(K(_({},e),{repeat:a}))},repeatableZone:r$t(t)}))]})};function b1t(t){var e,r,n;return(n=(r=(e=t.config)==null?void 0:e.label)!=null?r:t.fieldset)!=null?n:t.type}function $1t(t){var e,r;return(r=(e=t.config)==null?void 0:e.fields)!=null?r:{}}function _1t(t,e){return t===void 0?{__TYPE__:"GroupContentType",value:e}:K(_({},t),{value:e})}function S1t(t){return t.type===Bt.WidgetTypes.Group?b1t(t):xg(t)}const D3=o=>{var i=o,{content:t,group:e,onContentChange:r}=i,n=Wn(i,["content","group","onContentChange"]);return J(WR,K(_({},n),{content:t==null?void 0:t.value,onContentChange:a=>{r(_1t(t,a))},repeatableZone:$1t(e)}))},L3=n=>{var o=n,{content:t,legacySlice:e}=o,r=Wn(o,["content","legacySlice"]);return br(Y.FieldSet,{children:[J(Y.FieldSetLegend,{children:S1t(e)}),e.type===Bt.WidgetTypes.Group?J(D3,K(_({},r),{content:ee(t,_z),group:e})):J(jy,K(_({},r),{content:ee(t,Cg),nestableWidget:e}))]})};function T1t(t){return{__TYPE__:"SharedSliceContent",variation:t,primary:{},items:[]}}function I1t(t,e){return t.variations.find(r=>r.id===e)}function O1t(t,e){return`${t.name} \u2022 ${e.name}`}function M1t(t){var e;return(e=t.primary)!=null?e:{}}function R1t(t){var e;return(e=t.items)!=null?e:{}}const U3=i=>{var a=i,{content:t,onContentChange:e,readOnly:r=!1,sharedSlice:n}=a,o=Wn(a,["content","onContentChange","readOnly","sharedSlice"]);var l;const u=E1t(n,t.variation),c=Ky();if(u===void 0)return null;const f={id:(l=o.id)!=null?l:c,readOnly:r};return br(Y.FieldSet,{children:[J(Y.FieldSetLegend,{children:O1t(n,u)}),J(P3,K(_({},f),{content:t.primary,nonRepeatableZone:M1t(u),onContentChange:p=>{e(K(_({},t),{primary:p}))}})),J(WR,K(_({},f),{content:t.items,onContentChange:p=>{e(K(_({},t),{items:p}))},repeatableZone:R1t(u)}))]})};function E1t(t,e){return tt.useMemo(()=>I1t(t,e),[t,e])}const w1t=({content:t,id:e,onContentChange:r,readOnly:n,sliceZone:o})=>J(fc,{children:t==null?void 0:t.value.map((i,a)=>{var f,l;const u=(l=(f=o.config)==null?void 0:f.choices)==null?void 0:l[i.name];if(u===void 0)return null;const c=i.widget,s={id:`${e}[${a}]`,key:i.key,onContentChange:p=>{r(Qbt(t,a,p))},readOnly:n};if(u.type===gg.SlicesTypes.SharedSlice)return Gbt(c)?J(U3,K(_({},s),{content:c,sharedSlice:u})):null;if(u.type===gg.SlicesTypes.Slice)return Ybt(c)?J(y1t,K(_({},s),{compositeSlice:u,content:c})):null;{const p=K(_({},s),{legacySlice:u});return Xbt(c)?J(L3,K(_({},p),{content:c})):Zbt(c)?J(L3,K(_({},p),{content:void 0})):null}})});function A1t(){return"Static Zone"}const C1t=({content:t,id:e,onContentChange:r,readOnly:n,staticZone:o})=>{const i=x1t(o);return br(Y.FieldSet,{children:[J(Y.FieldSetLegend,{children:A1t()}),i.map(([a,u])=>{const c={id:`${e}.${a}`,key:a,onContentChange:f=>{r(K(_({},t),{[a]:f}))},readOnly:n},s=t[a];return u.type===Bt.WidgetTypes.UID?(ee(s,ae.UIDContent.is),null):u.type===Bt.WidgetTypes.Group?J(D3,K(_({},c),{content:ee(s,_z),group:u})):J(jy,K(_({},c),{content:ee(s,Cg),nestableWidget:u}))})]})};function x1t(t){return tt.useMemo(()=>WM(t),[t])}const k1t=({content:t,id:e,onContentChange:r,readOnly:n,section:o})=>{const[i,a]=W1t(o);return br(fc,{children:[J(C1t,{content:Jbt(i,t),id:e,onContentChange:u=>{r(_(_({},t),u))},readOnly:n,staticZone:i}),a.map(([u,c])=>J(w1t,{content:ee(t[u],Vbt),id:`${e}.${u}`,onContentChange:s=>{r(K(_({},t),{[u]:s}))},readOnly:n,sliceZone:c},u))]})};function W1t(t){return tt.useMemo(()=>Hbt(t),[t])}const F1t=({content:t,customType:e,onContentChange:r,readOnly:n=!1,sectionName:o,sharedSlices:i})=>{const a=N1t(e,i),u=Ky();if(Rgt(a))return null;if(o===void 0)throw new Error("The 'sectionName' prop cannot be undefined when the provided 'customType' is non-empty.");const c=Egt(a,o);return J(k1t,{content:wgt(c,t),id:u,onContentChange:s=>{r(_(_({},t),s))},readOnly:n,section:c})};function N1t(t,e){return tt.useMemo(()=>jR.toStatic(t,Agt(e)),[t,e])}At.DocumentEditor=F1t,At.SharedSliceEditor=U3,At.defaultSharedSliceContent=T1t,Object.defineProperty(At,"__esModule",{value:!0}),At[Symbol.toStringTag]="Module"});