slice-machine-ui 1.21.2-dev-next-release.3 → 1.21.3-dev-next-release.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/DeleteVariationModal/index.tsx +1 -0
- package/components/Forms/RenameVariationModal/RenameVariationModal.tsx +1 -0
- package/lib/builders/SliceBuilder/Sidebar/index.tsx +26 -10
- package/out/404.html +1 -1
- package/out/_next/static/7-xwDUFUOhWgfbJon6kf_/_buildManifest.js +1 -0
- package/out/_next/static/chunks/18539003-9f66499125869c64.js +97 -0
- package/out/_next/static/chunks/482-7e97f91961588a90.js +1 -0
- package/out/_next/static/chunks/{550-abf97d3008006056.js → 550-19c9163a7ca0e711.js} +1 -1
- package/out/_next/static/chunks/{80-72d903b2a0bd5dc3.js → 80-7b8a97d0122ff74a.js} +1 -1
- package/out/_next/static/chunks/{840-6e00e3fb69984e18.js → 840-c3192c2481effe16.js} +1 -1
- package/out/_next/static/chunks/904-721355903ee2357a.js +1 -0
- package/out/_next/static/chunks/{958-7352113230cf4059.js → 958-c48ce4650cf3eb86.js} +1 -1
- package/out/_next/static/chunks/pages/{_app-2b075d0d6b5cb35e.js → _app-a67c22a01a3bb9a3.js} +125 -117
- package/out/_next/static/chunks/pages/{changes-58e202426cfeb11f.js → changes-c9a244c30cfbfa92.js} +1 -1
- package/out/_next/static/chunks/pages/slices/[lib]/[sliceName]/[variation]-ac0d8307645fe81f.js +1 -0
- package/out/_next/static/css/42c3dec8e94c9fae.css +1 -0
- package/out/_next/static/css/{5d18ccf403d4649a.css → 5da5d3cd7a87c3cf.css} +1 -1
- package/out/_next/static/css/{31841735992dea23.css → 77abb01eee0e43a7.css} +1 -1
- package/out/_next/static/css/{78250665d395ea50.css → 7d650bca12dc4061.css} +1 -1
- package/out/_next/static/css/{b0be58d878c0fac3.css → be1f49e49a5aa7eb.css} +1 -1
- package/out/_next/static/css/{58a89606d9ca9093.css → cb33580e45d01b59.css} +1 -1
- package/out/changelog.html +1 -1
- package/out/changes.html +1 -1
- package/out/custom-types/[customTypeId].html +1 -1
- package/out/custom-types.html +1 -1
- package/out/index.html +1 -1
- package/out/labs.html +1 -1
- package/out/page-types/[pageTypeId].html +1 -1
- package/out/slices/[lib]/[sliceName]/[variation]/simulator.html +1 -1
- package/out/slices/[lib]/[sliceName]/[variation].html +1 -1
- package/out/slices.html +1 -1
- package/package.json +7 -7
- package/postcss.config.js +2 -0
- package/src/features/slices/convertLegacySlice/ConvertLegacySliceAsNewSliceDialog.tsx +1 -0
- package/src/features/slices/convertLegacySlice/ConvertLegacySliceAsNewVariationDialog.tsx +1 -0
- package/src/features/slices/convertLegacySlice/ConvertLegacySliceMergeWithIdenticalDialog.tsx +1 -0
- package/out/_next/static/bmg4AZ5_aawA-FHD0CyW1/_buildManifest.js +0 -1
- package/out/_next/static/chunks/18539003-5d8b6a04053638af.js +0 -97
- package/out/_next/static/chunks/482-2b96f646465808a7.js +0 -1
- package/out/_next/static/chunks/904-41d6e45ae563ffc0.js +0 -1
- package/out/_next/static/chunks/pages/slices/[lib]/[sliceName]/[variation]-3d8beb33e88d9e35.js +0 -1
- package/out/_next/static/css/cf7719d67ec45489.css +0 -1
- /package/out/_next/static/{bmg4AZ5_aawA-FHD0CyW1 → 7-xwDUFUOhWgfbJon6kf_}/_ssgManifest.js +0 -0
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[851],{71463:function(t,n,r){r.d(n,{kS:function(){return ecn}});var i,o,a,u,s,c=r(2784),l=r(98863),f=r(22715),d=r(74217),p=r(50054),h=r(86579),m=r(1611),g=r(17329),y=r(32184),v=r(87322),b=r(16247),x=r(661),_=r(52393),S=r(28316),T=r(87598),w=Object.defineProperty,O=(t,n,r)=>n in t?w(t,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[n]=r,k=(t,n,r)=>(O(t,"symbol"!=typeof n?n+"":n,r),r),I="u">typeof globalThis?globalThis:"u">typeof window?window:"u">typeof r.g?r.g:"u">typeof self?self:{};function C(t){if(t.__esModule)return t;var n=t.default;if("function"==typeof n){var r=function t(){if(this instanceof t){var r=[null];return r.push.apply(r,arguments),new(Function.bind.apply(n,r))}return n.apply(this,arguments)};r.prototype=n.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(t).forEach(function(n){var i=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(r,n,i.get?i:{enumerable:!0,get:function(){return t[n]}})}),r}var M,R={},E={get exports(){return R},set exports(e){R=e}},j={};(M=E).exports=function(){if(qv)return j;qv=1;var t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,i=c.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,o={key:!0,ref:!0,__self:!0,__source:!0};function a(n,a,u){var s,c={},l=null,f=null;for(s in void 0!==u&&(l=""+u),void 0!==a.key&&(l=""+a.key),void 0!==a.ref&&(f=a.ref),a)r.call(a,s)&&!o.hasOwnProperty(s)&&(c[s]=a[s]);if(n&&n.defaultProps)for(s in a=n.defaultProps)void 0===c[s]&&(c[s]=a[s]);return{$$typeof:t,type:n,key:l,ref:f,props:c,_owner:i.current}}return j.Fragment=n,j.jsx=a,j.jsxs=a,j}();let N=(0,c.createContext)(void 0);function A(){let t=(0,c.useContext)(N);if(!t)throw Error("Missing EditorConfigContext.Provider");return t}class P extends Error{}function L(t){throw new P(`Missing EditorConfig.${t}`)}var D,F,W,U,z,B,V,$,q,K,H,G,Z,Y,J,Q,X,ee,et,en,er,ei,eo,ea,eu,es,ec,el,ef,ed,ep={},eh={};D={get exports(){return eh},set exports(e){eh=e}},function(t){var n="object"==typeof I?I:"object"==typeof self?self:"object"==typeof this?this:{};function r(t,r){return t!==n&&("function"==typeof Object.create?Object.defineProperty(t,"__esModule",{value:!0}):t.__esModule=!0),function(n,i){return t[n]=r?r(n,i):i}}t(r(n,r(D.exports)))}(function(t){var n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])};F=function(t,r){if("function"!=typeof r&&null!==r)throw TypeError("Class extends value "+String(r)+" is not a constructor or null");function i(){this.constructor=t}n(t,r),t.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)},W=Object.assign||function(t){for(var n,r=1,i=arguments.length;r<i;r++)for(var o in n=arguments[r])Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o]);return t},U=function(t,n){var r={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&0>n.indexOf(i)&&(r[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,i=Object.getOwnPropertySymbols(t);o<i.length;o++)0>n.indexOf(i[o])&&Object.prototype.propertyIsEnumerable.call(t,i[o])&&(r[i[o]]=t[i[o]]);return r},z=function(t,n,r,i){var o,a=arguments.length,u=a<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,r):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)u=Reflect.decorate(t,n,r,i);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(u=(a<3?o(u):a>3?o(n,r,u):o(n,r))||u);return a>3&&u&&Object.defineProperty(n,r,u),u},B=function(t,n){return function(r,i){n(r,i,t)}},V=function(t,n,r,i,o,a){function u(t){if(void 0!==t&&"function"!=typeof t)throw TypeError("Function expected");return t}for(var s,c=i.kind,l="getter"===c?"get":"setter"===c?"set":"value",f=!n&&t?i.static?t:t.prototype:null,d=n||(f?Object.getOwnPropertyDescriptor(f,i.name):{}),p=!1,h=r.length-1;h>=0;h--){var m={};for(var g in i)m[g]="access"===g?{}:i[g];for(var g in i.access)m.access[g]=i.access[g];m.addInitializer=function(t){if(p)throw TypeError("Cannot add initializers after decoration has completed");a.push(u(t||null))};var y=(0,r[h])("accessor"===c?{get:d.get,set:d.set}:d[l],m);if("accessor"===c){if(void 0===y)continue;if(null===y||"object"!=typeof y)throw TypeError("Object expected");(s=u(y.get))&&(d.get=s),(s=u(y.set))&&(d.set=s),(s=u(y.init))&&o.push(s)}else(s=u(y))&&("field"===c?o.push(s):d[l]=s)}f&&Object.defineProperty(f,i.name,d),p=!0},$=function(t,n,r){for(var i=arguments.length>2,o=0;o<n.length;o++)r=i?n[o].call(t,r):n[o].call(t);return i?r:void 0},q=function(t){return"symbol"==typeof t?t:"".concat(t)},K=function(t,n,r){return"symbol"==typeof n&&(n=n.description?"[".concat(n.description,"]"):""),Object.defineProperty(t,"name",{configurable:!0,value:r?"".concat(r," ",n):n})},H=function(t,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,n)},G=function(t,n,r,i){return new(r||(r=Promise))(function(o,a){function u(t){try{c(i.next(t))}catch(n){a(n)}}function s(t){try{c(i.throw(t))}catch(n){a(n)}}function c(t){var n;t.done?o(t.value):((n=t.value)instanceof r?n:new r(function(t){t(n)})).then(u,s)}c((i=i.apply(t,n||[])).next())})},Z=function(t,n){var r,i,o,a,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(c){return function(s){if(r)throw TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(u=0)),u;)try{if(r=1,i&&(o=2&s[0]?i.return:s[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,s[1])).done)return o;switch(i=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return u.label++,{value:s[1],done:!1};case 5:u.label++,i=s[1],s=[0];continue;case 7:s=u.ops.pop(),u.trys.pop();continue;default:if(!(o=(o=u.trys).length>0&&o[o.length-1])&&(6===s[0]||2===s[0])){u=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){u.label=s[1];break}if(6===s[0]&&u.label<o[1]){u.label=o[1],o=s;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(s);break}o[2]&&u.ops.pop(),u.trys.pop();continue}s=n.call(t,u)}catch(c){s=[6,c],i=0}finally{r=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},Y=function(t,n){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(n,r)||ed(n,t,r)},ed=Object.create?function(t,n,r,i){void 0===i&&(i=r);var o=Object.getOwnPropertyDescriptor(n,r);(!o||("get"in o?!n.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return n[r]}}),Object.defineProperty(t,i,o)}:function(t,n,r,i){void 0===i&&(i=r),t[i]=n[r]},J=function(t){var n="function"==typeof Symbol&&Symbol.iterator,r=n&&t[n],i=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&i>=t.length&&(t=void 0),{value:t&&t[i++],done:!t}}};throw TypeError(n?"Object is not iterable.":"Symbol.iterator is not defined.")},Q=function(t,n){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var i,o,a=r.call(t),u=[];try{for(;(void 0===n||n-- >0)&&!(i=a.next()).done;)u.push(i.value)}catch(s){o={error:s}}finally{try{i&&!i.done&&(r=a.return)&&r.call(a)}finally{if(o)throw o.error}}return u},X=function(){for(var t=[],n=0;n<arguments.length;n++)t=t.concat(Q(arguments[n]));return t},ee=function(){for(var t=0,n=0,r=arguments.length;n<r;n++)t+=arguments[n].length;for(var i=Array(t),o=0,n=0;n<r;n++)for(var a=arguments[n],u=0,s=a.length;u<s;u++,o++)i[o]=a[u];return i},et=function(t,n,r){if(r||2===arguments.length)for(var i,o=0,a=n.length;o<a;o++)!i&&o in n||(i||(i=Array.prototype.slice.call(n,0,o)),i[o]=n[o]);return t.concat(i||Array.prototype.slice.call(n))},en=function(t){return this instanceof en?(this.v=t,this):new en(t)},er=function(t,n,r){if(!Symbol.asyncIterator)throw TypeError("Symbol.asyncIterator is not defined.");var i,o=r.apply(t,n||[]),a=[];return i={},u("next"),u("throw"),u("return"),i[Symbol.asyncIterator]=function(){return this},i;function u(t){o[t]&&(i[t]=function(n){return new Promise(function(r,i){a.push([t,n,r,i])>1||s(t,n)})})}function s(t,n){try{var r;r=o[t](n),r.value instanceof en?Promise.resolve(r.value.v).then(c,l):f(a[0][2],r)}catch(i){f(a[0][3],i)}}function c(t){s("next",t)}function l(t){s("throw",t)}function f(t,n){t(n),a.shift(),a.length&&s(a[0][0],a[0][1])}},ei=function(t){var n,r;return n={},i("next"),i("throw",function(t){throw t}),i("return"),n[Symbol.iterator]=function(){return this},n;function i(i,o){n[i]=t[i]?function(n){return(r=!r)?{value:en(t[i](n)),done:!1}:o?o(n):n}:o}},eo=function(t){if(!Symbol.asyncIterator)throw TypeError("Symbol.asyncIterator is not defined.");var n,r=t[Symbol.asyncIterator];return r?r.call(t):(t="function"==typeof J?J(t):t[Symbol.iterator](),n={},i("next"),i("throw"),i("return"),n[Symbol.asyncIterator]=function(){return this},n);function i(r){n[r]=t[r]&&function(n){return new Promise(function(i,o){(function(t,n,r,i){Promise.resolve(i).then(function(n){t({value:n,done:r})},n)})(i,o,(n=t[r](n)).done,n.value)})}}},ea=function(t,n){return Object.defineProperty?Object.defineProperty(t,"raw",{value:n}):t.raw=n,t};var r=Object.create?function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}:function(t,n){t.default=n};eu=function(t){if(t&&t.__esModule)return t;var n={};if(null!=t)for(var i in t)"default"!==i&&Object.prototype.hasOwnProperty.call(t,i)&&ed(n,t,i);return r(n,t),n},es=function(t){return t&&t.__esModule?t:{default:t}},ec=function(t,n,r,i){if("a"===r&&!i)throw TypeError("Private accessor was defined without a getter");if("function"==typeof n?t!==n||!i:!n.has(t))throw TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(t):i?i.value:n.get(t)},el=function(t,n,r,i,o){if("m"===i)throw TypeError("Private method is not writable");if("a"===i&&!o)throw TypeError("Private accessor was defined without a setter");if("function"==typeof n?t!==n||!o:!n.has(t))throw TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?o.call(t,r):o?o.value=r:n.set(t,r),r},ef=function(t,n){if(null===n||"object"!=typeof n&&"function"!=typeof n)throw TypeError("Cannot use 'in' operator on non-object");return"function"==typeof t?n===t:t.has(n)},t("__extends",F),t("__assign",W),t("__rest",U),t("__decorate",z),t("__param",B),t("__esDecorate",V),t("__runInitializers",$),t("__propKey",q),t("__setFunctionName",K),t("__metadata",H),t("__awaiter",G),t("__generator",Z),t("__exportStar",Y),t("__createBinding",ed),t("__values",J),t("__read",Q),t("__spread",X),t("__spreadArrays",ee),t("__spreadArray",et),t("__await",en),t("__asyncGenerator",er),t("__asyncDelegator",ei),t("__asyncValues",eo),t("__makeTemplateObject",ea),t("__importStar",eu),t("__importDefault",es),t("__classPrivateFieldGet",ec),t("__classPrivateFieldSet",el),t("__classPrivateFieldIn",ef)});var em={};function eg(t){return function(n){return function(r){return r.reduce(function(n,r){return t.alt(n,function(){return r})},n)}}}let ey=Object.freeze(Object.defineProperty({__proto__:null,altAll:eg},Symbol.toStringTag,{value:"Module"})),ev=Object.freeze(Object.defineProperty({__proto__:null,altAll:function(t){return eg(t)(t.zero())}},Symbol.toStringTag,{value:"Module"}));var eb=function(t){return function(){return{meet:function(n,r){return function(i){return t.meet(n(i),r(i))}},join:function(n,r){return function(i){return t.join(n(i),r(i))}},zero:function(){return t.zero},one:function(){return t.one},implies:function(n,r){return function(i){return t.implies(n(i),r(i))}},not:function(n){return function(r){return t.not(n(r))}}}}},ex=function(t){return function(){return{concat:function(n,r){return function(i){return t.concat(n(i),r(i))}}}}},e_=function(t){var n=ex(t);return function(){return{concat:n().concat,empty:function(){return t.empty}}}},eS=function(t){return{add:function(n,r){return function(i){return t.add(n(i),r(i))}},zero:function(){return t.zero},mul:function(n,r){return function(i){return t.mul(n(i),r(i))}},one:function(){return t.one}}},eT=function(t){var n=eS(t);return{add:n.add,mul:n.mul,one:n.one,zero:n.zero,sub:function(n,r){return function(i){return t.sub(n(i),r(i))}}}},ew=function(t){return function(n){return n(t)}};function eO(t){return t}function ek(t){return function(){return t}}var eI=ek(!0),eC=ek(!1),eM=ek(null),eR=ek(void 0);function eE(t,n,r,i,o,a,u,s,c){switch(arguments.length){case 1:return t;case 2:return function(){return n(t.apply(this,arguments))};case 3:return function(){return r(n(t.apply(this,arguments)))};case 4:return function(){return i(r(n(t.apply(this,arguments))))};case 5:return function(){return o(i(r(n(t.apply(this,arguments)))))};case 6:return function(){return a(o(i(r(n(t.apply(this,arguments))))))};case 7:return function(){return u(a(o(i(r(n(t.apply(this,arguments)))))))};case 8:return function(){return s(u(a(o(i(r(n(t.apply(this,arguments))))))))};case 9:return function(){return c(s(u(a(o(i(r(n(t.apply(this,arguments)))))))))}}}function ej(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return t}function eN(t){return t+1}function eA(t){return t-1}function eP(t){throw Error("Called `absurd` function which should be uncallable")}function eL(t,n,r,i,o,a,u,s,c){switch(arguments.length){case 1:return t;case 2:return n(t);case 3:return r(n(t));case 4:return i(r(n(t)));case 5:return o(i(r(n(t))));case 6:return a(o(i(r(n(t)))));case 7:return u(a(o(i(r(n(t))))));case 8:return s(u(a(o(i(r(n(t)))))));case 9:return c(s(u(a(o(i(r(n(t))))))));default:for(var l=arguments[0],f=1;f<arguments.length;f++)l=arguments[f](l);return l}}var eD=function(t,n){return n},eF=function(){return{concat:function(t,n){return eE(t,n)},empty:eO}};let eW=Object.freeze(Object.defineProperty({__proto__:null,SK:eD,absurd:eP,apply:ew,constFalse:eC,constNull:eM,constTrue:eI,constUndefined:eR,constVoid:eR,constant:ek,decrement:eA,flip:function(t){return function(n,r){return t(r,n)}},flow:eE,getBooleanAlgebra:eb,getEndomorphismMonoid:eF,getMonoid:e_,getRing:eT,getSemigroup:ex,getSemiring:eS,hole:eP,identity:eO,increment:eN,not:function(t){return function(n){return!t(n)}},pipe:eL,tuple:ej,tupled:function(t){return function(n){return t.apply(void 0,n)}},unsafeCoerce:eO,untupled:function(t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return t(n)}}},Symbol.toStringTag,{value:"Module"}));var eU=globalThis&&globalThis.__spreadArray||function(t,n,r){if(r||2===arguments.length)for(var i,o=0,a=n.length;o<a;o++)!i&&o in n||(i||(i=Array.prototype.slice.call(n,0,o)),i[o]=n[o]);return t.concat(i||Array.prototype.slice.call(n))},ez=function(t){return"None"===t._tag},eB=function(t){return"Some"===t._tag},eV={_tag:"None"},e$=function(t){return{_tag:"Some",value:t}},eq=function(t){return"Left"===t._tag},eK=function(t){return"Right"===t._tag},eH=function(t){return{_tag:"Left",left:t}},eG=function(t){return{_tag:"Right",right:t}},eZ=function(t){return[t]},eY=function(t){return t.length>0},eJ=function(t){return t[0]},eQ=function(t){return t.slice(1)},eX=[],e0={},e1=Object.prototype.hasOwnProperty,e2=function(t){return eU([t[0]],t.slice(1),!0)};function e3(t,n){return function(r){return function(i){return t.ap(t.map(i,function(t){return function(r){return n.ap(t,r)}}),r)}}}function e4(t){return function(n){return function(r){return t.ap(t.map(r,function(t){return function(){return t}}),n)}}}function e5(t){return function(n){return function(r){return t.ap(t.map(r,function(){return function(t){return t}}),n)}}}function e9(t){return function(n,r){return function(i){return t.ap(t.map(i,function(t){return function(r){var i;return Object.assign({},t,((i={})[n]=r,i))}}),r)}}}function e6(t){return function(n){return{concat:function(r,i){return t.ap(t.map(r,function(t){return function(r){return n.concat(t,r)}}),i)}}}}function e8(t,n,r){return function(i){for(var o=Array(r.length+1),a=0;a<r.length;a++)o[a]=r[a];return o[r.length]=i,0===n?t.apply(null,o):e8(t,n-1,o)}}var e7={1:function(t){return[t]},2:function(t){return function(n){return[t,n]}},3:function(t){return function(n){return function(r){return[t,n,r]}}},4:function(t){return function(n){return function(r){return function(i){return[t,n,r,i]}}}},5:function(t){return function(n){return function(r){return function(i){return function(o){return[t,n,r,i,o]}}}}}};function te(t){return e1.call(e7,t)||(e7[t]=e8(ej,t-1,[])),e7[t]}function tt(t){var n=t.length;switch(n){case 1:return function(n){var r;return(r={})[t[0]]=n,r};case 2:return function(n){return function(r){var i;return(i={})[t[0]]=n,i[t[1]]=r,i}};case 3:return function(n){return function(r){return function(i){var o;return(o={})[t[0]]=n,o[t[1]]=r,o[t[2]]=i,o}}};case 4:return function(n){return function(r){return function(i){return function(o){var a;return(a={})[t[0]]=n,a[t[1]]=r,a[t[2]]=i,a[t[3]]=o,a}}}};case 5:return function(n){return function(r){return function(i){return function(o){return function(a){var u;return(u={})[t[0]]=n,u[t[1]]=r,u[t[2]]=i,u[t[3]]=o,u[t[4]]=a,u}}}}};default:return e8(function(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];for(var o={},a=0;a<n;a++)o[t[a]]=r[a];return o},n-1,[])}}let tn=Object.freeze(Object.defineProperty({__proto__:null,ap:e3,apFirst:e4,apS:e9,apSecond:e5,getApplySemigroup:e6,sequenceS:function(t){return function(n){for(var r=Object.keys(n),i=r.length,o=tt(r),a=t.map(n[r[0]],o),u=1;u<i;u++)a=t.ap(a,n[r[u]]);return a}},sequenceT:function(t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];for(var i=n.length,o=te(i),a=t.map(n[0],o),u=1;u<i;u++)a=t.ap(a,n[u]);return a}}},Symbol.toStringTag,{value:"Module"}));function tr(t,n){return function(r){return function(i){return t.map(i,function(t){return n.map(t,r)})}}}function ti(t){return function(n){return function(r){return t.map(r,function(t){return t(n)})}}}function to(t){return function(n){return function(r){return t.map(r,function(t){var r;return(r={})[n]=t,r})}}}function ta(t,n){var r=tr(t,n);return{map:function(t,n){return eL(t,r(n))}}}let tu=Object.freeze(Object.defineProperty({__proto__:null,bindTo:to,flap:ti,getFunctorComposition:ta,map:tr},Symbol.toStringTag,{value:"Module"}));function ts(t){var n=e6(t);return function(r){return{concat:n(r).concat,empty:t.of(r.empty)}}}function tc(t,n){var r=ta(t,n).map,i=e3(t,n);return{map:r,of:function(r){return t.of(n.of(r))},ap:function(t,n){return eL(t,i(n))}}}let tl=Object.freeze(Object.defineProperty({__proto__:null,getApplicativeComposition:tc,getApplicativeMonoid:ts},Symbol.toStringTag,{value:"Module"}));function tf(t){return function(n){return function(r){return t.chain(r,function(r){return t.map(n(r),function(){return r})})}}}function td(t){return function(n,r){return function(i){return t.chain(i,function(i){return t.map(r(i),function(t){var r;return Object.assign({},i,((r={})[n]=t,r))})})}}}let tp=Object.freeze(Object.defineProperty({__proto__:null,bind:td,chainFirst:tf},Symbol.toStringTag,{value:"Module"}));function th(t){return function(n){return function(r){return t.fromEither(ez(r)?eH(n()):eG(r.value))}}}function tm(t){return function(n,r){return function(i){return t.fromEither(n(i)?eG(i):eH(r(i)))}}}function tg(t){var n=th(t);return function(t){var r=n(t);return function(t){return eE(t,r)}}}function ty(t,n){var r=tg(t);return function(t){var i=r(t);return function(t){return function(r){return n.chain(r,i(t))}}}}function tv(t){return function(n){return eE(n,t.fromEither)}}function tb(t,n){var r=tv(t);return function(t){return function(i){return n.chain(i,r(t))}}}function tx(t,n){return eE(tv(t),tf(n))}function t_(t,n){return function(r,i){return function(o){return n.chain(o,function(n){return t.fromEither(r(n)?eG(n):eH(i(n)))})}}}let tS=Object.freeze(Object.defineProperty({__proto__:null,chainEitherK:tb,chainFirstEitherK:tx,chainOptionK:ty,filterOrElse:t_,fromEitherK:tv,fromOption:th,fromOptionK:tg,fromPredicate:tm},Symbol.toStringTag,{value:"Module"}));var tT=function(t){return{equals:function(n,r){return n===r||t(n,r)}}},tw=function(t){return tT(function(n,r){for(var i in t)if(!t[i].equals(n[i],r[i]))return!1;return!0})},tO=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return tT(function(n,r){return t.every(function(t,i){return t.equals(n[i],r[i])})})},tk=function(t){return function(n){return tT(function(r,i){return n.equals(t(r),t(i))})}},tI={equals:function(t,n){return t===n}},tC={equals:function(){return!0}},tM=function(){return{concat:function(t,n){return tT(function(r,i){return t.equals(r,i)&&n.equals(r,i)})}}},tR=function(){return{concat:tM().concat,empty:tC}},tE={URI:"Eq",contramap:function(t,n){return eL(t,tk(n))}},tj=tI.equals;let tN=Object.freeze(Object.defineProperty({__proto__:null,Contravariant:tE,URI:"Eq",contramap:tk,eq:tE,eqBoolean:tI,eqDate:{equals:function(t,n){return t.valueOf()===n.valueOf()}},eqNumber:tI,eqStrict:tI,eqString:tI,fromEquals:tT,getMonoid:tR,getSemigroup:tM,getStructEq:tw,getTupleEq:tO,strictEqual:tj,struct:tw,tuple:tO},Symbol.toStringTag,{value:"Module"}));var tA=function(t){return function(n,r){return n===r||0===t(n,r)}},tP=function(t){return{equals:tA(t),compare:function(n,r){return n===r?0:t(n,r)}}},tL=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return tP(function(n,r){for(var i=0;i<t.length-1;i++){var o=t[i].compare(n[i],r[i]);if(0!==o)return o}return t[i].compare(n[i],r[i])})},tD=function(t){return tP(function(n,r){return t.compare(r,n)})},tF=function(t){return function(n){return tP(function(r,i){return n.compare(t(r),t(i))})}},tW=function(){return{concat:function(t,n){return tP(function(r,i){var o=t.compare(r,i);return 0!==o?o:n.compare(r,i)})}}},tU=function(){return{concat:tW().concat,empty:tP(function(){return 0})}},tz={URI:"Ord",contramap:function(t,n){return eL(t,tF(n))}},tB={equals:eI,compare:ek(0)},tV=function(t){return function(n){return function(r){return r===n||0===t.compare(r,n)}}},t$=function(t){return function(n,r){return -1===t.compare(n,r)}},tq=function(t){return function(n,r){return 1===t.compare(n,r)}},tK=function(t){return function(n,r){return 1!==t.compare(n,r)}},tH=function(t){return function(n,r){return -1!==t.compare(n,r)}},tG=function(t){return function(n,r){return n===r||1>t.compare(n,r)?n:r}},tZ=function(t){return function(n,r){return n===r||t.compare(n,r)>-1?n:r}},tY=function(t){var n=tG(t),r=tZ(t);return function(t,i){return function(o){return r(n(o,i),t)}}},tJ=function(t){var n=t$(t),r=tq(t);return function(t,i){return function(o){return!(n(o,t)||r(o,i))}}},tQ={equals:tI.equals,compare:function(t,n){return t<n?-1:t>n?1:0}},tX=eL(tQ,tF(function(t){return t.valueOf()}));let t0=Object.freeze(Object.defineProperty({__proto__:null,Contravariant:tz,URI:"Ord",between:tJ,clamp:tY,contramap:tF,equals:tV,equalsDefault:tA,fromCompare:tP,geq:tH,getDualOrd:tD,getMonoid:tU,getSemigroup:tW,getTupleOrd:tL,gt:tq,leq:tK,lt:t$,max:tZ,min:tG,ord:tz,ordBoolean:tQ,ordDate:tX,ordNumber:tQ,ordString:tQ,reverse:tD,trivial:tB,tuple:tL},Symbol.toStringTag,{value:"Module"}));var t1=function(t){return{concat:function(n,r){return t.concat(r,n)}}},t2=function(t){return function(n){return{concat:function(r,i){return t(r)?n.concat(r,i):i}}}},t3=function(t){return function(n){return{concat:function(r,i){return t(i)?n.concat(r,i):r}}}},t4=function(t){return function(n){return{concat:function(r,i){return n.concat(t(r),t(i))}}}},t5=function(t){return function(n){return function(r){return r.reduce(function(n,r){return t.concat(n,r)},n)}}};let t9=Object.freeze(Object.defineProperty({__proto__:null,concatAll:t5,endo:t4,filterFirst:t2,filterSecond:t3,reverse:t1},Symbol.toStringTag,{value:"Module"}));var t6=function(t){return{concat:tG(t)}},t8=function(t){return{concat:tZ(t)}},t7=function(t){return{concat:function(){return t}}},ne=function(t){return{concat:function(n,r){var i={};for(var o in t)e1.call(t,o)&&(i[o]=t[o].concat(n[o],r[o]));return i}}},nt=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return{concat:function(n,r){return t.map(function(t,i){return t.concat(n[i],r[i])})}}},nn=function(t){return function(n){return{concat:function(r,i){return n.concat(r,n.concat(t,i))}}}},nr=function(){return{concat:eO}},ni=function(){return{concat:function(t,n){return n}}},no=t7(void 0),na=function(){return{concat:function(t,n){return Object.assign({},t,n)}}},nu={concat:function(t,n){return t&&n}},ns={concat:function(t,n){return t||n}},nc={concat:function(t,n){return t+n}},nl={concat:function(t,n){return t+n}},nf={concat:function(t,n){return t*n}};let nd=Object.freeze(Object.defineProperty({__proto__:null,concatAll:t5,constant:t7,first:nr,fold:function(t){var n=t5(t);return function(t,r){return void 0===r?n(t):n(t)(r)}},getDualSemigroup:t1,getFirstSemigroup:nr,getFunctionSemigroup:ex,getIntercalateSemigroup:nn,getJoinSemigroup:t8,getLastSemigroup:ni,getMeetSemigroup:t6,getObjectSemigroup:na,getStructSemigroup:ne,getTupleSemigroup:nt,intercalate:nn,last:ni,max:t8,min:t6,reverse:t1,semigroupAll:nu,semigroupAny:ns,semigroupProduct:nf,semigroupString:nc,semigroupSum:nl,semigroupVoid:no,struct:ne,tuple:nt},Symbol.toStringTag,{value:"Module"}));var np=globalThis&&globalThis.__spreadArray||function(t,n,r){if(r||2===arguments.length)for(var i,o=0,a=n.length;o<a;o++)!i&&o in n||(i||(i=Array.prototype.slice.call(n,0,o)),i[o]=n[o]);return t.concat(i||Array.prototype.slice.call(n))},nh=function(t,n){return t<0||t>=n.length},nm=function(t){return function(n){return np([t],n,!0)}},ng=function(t){return function(n){return np(np([],n,!0),[t],!1)}},ny=function(t,n,r){if(eY(r)){var i=e2(r);return i.splice(t,0,n),i}return[n]},nv=function(t,n,r){if(r[t]===n)return r;var i=e2(r);return i[t]=n,i},nb=function(t){return function(n){if(1===n.length)return n;for(var r=[rR(n)],i=rE(n),o=function(n){r.every(function(r){return!t.equals(r,n)})&&r.push(n)},a=0;a<i.length;a++)o(i[a]);return r}},nx=function(t){if(eY(t)){var n=tU();return nP(t.reduce(n.concat,n.empty))}return eO},n_=function(t){var n=nb(t);return function(t){return function(r){return n(eL(r,nE(t)))}}},nS=function(t){return function(n){var r=n.length,i=Math.round(t)%r;if(nh(Math.abs(i),n)||0===i)return n;if(!(i<0))return nS(i-r)(n);var o=n$(-i)(n),a=o[0];return eL(o[1],nE(a))}},nT=function(t){return eY(t)?e$(t):eV},nw=function(t){return function(n){for(var r=Math.max(0,Math.floor(n)),i=[t(0)],o=1;o<r;o++)i.push(t(o));return i}},nO=function(t){return nw(function(){return t})},nk=function(t,n){return t<=n?nw(function(n){return t+n})(n-t+1):[t]},nI=function(t){return[rR(t),rE(t)]},nC=function(t){return[rN(t),rj(t)]},nM=function(t){return nT(t.slice())};function nR(t){return function(n){return n.concat(t)}}function nE(t,n){return n?t.concat(n):function(n){return n.concat(t)}}var nj=function(t){return 1===t.length?t:np([rj(t)],t.slice(0,-1).reverse(),!0)};function nN(t){return function(n){var r=n.length;if(0===r)return eX;for(var i=[],o=n[0],a=[o],u=1;u<r;u++){var s=n[u];t.equals(s,o)?a.push(s):(i.push(a),a=[o=s])}return i.push(a),i}}var nA=function(t){return function(n){for(var r={},i=0;i<n.length;i++){var o=n[i],a=t(o);e1.call(r,a)?r[a].push(o):r[a]=[o]}return r}},nP=function(t){return function(n){return 1===n.length?n:n.slice().sort(t.compare)}},nL=function(t,n){return nD(t,function(){return n})},nD=function(t,n){return function(r){return nh(t,r)?eV:e$(nv(t,n(r[t]),r))}},nF=function(t,n,r){for(var i=[r(t[0],n[0])],o=Math.min(t.length,n.length),a=1;a<o;a++)i[a]=r(t[a],n[a]);return i},nW=function(t){for(var n=[t[0][0]],r=[t[0][1]],i=1;i<t.length;i++)n[i]=t[i][0],r[i]=t[i][1];return[n,r]},nU=function(t){return function(n){for(var r=[t,n[0]],i=1;i<n.length;i++)r.push(t,n[i]);return r}},nz=function(t){return function(n){var r=rE(n);return eY(r)?eL(r,nU(t),nm(rR(n))):n}},nB=function(t){return function(n){for(var r=e2(t(0,rR(n))),i=1;i<n.length;i++)r.push.apply(r,t(i,n[i]));return r}},nV=function(t){return function(n){for(var r=t(n),i=r[0],o=r[1],a=[i],u=o;eY(u);){var s=t(u),c=s[0],l=s[1];a.push(c),u=l}return a}},n$=function(t){return function(n){var r=Math.max(1,t);return r>=n.length?[n,eX]:[eL(n.slice(1,r),nm(rR(n))),n.slice(r)]}},nq=function(t){return nV(n$(t))},nK=function(t,n){return eL(t,rr(n))},nH=function(t,n){return eL(t,ri(n))},nG=function(t,n){return eL(t,n8(n))},nZ=function(t,n){return eL(t,n7(n))},nY=function(t,n){return eL(t,re(n))},nJ=function(t,n,r){return eL(t,ro(n,r))},nQ=function(t){var n=ra(t);return function(t,r){return eL(t,n(r))}},nX=function(t,n,r){return eL(t,ru(n,r))},n0=function(t){var n=rf(t);return function(t,r){return eL(t,n(r))}},n1=function(t,n){return eL(t,n6(n))},n2=function(t,n,r){return eL(t,rs(n,r))},n3=function(t){var n=rc(t);return function(t,r){return eL(t,n(r))}},n4=function(t,n,r){return eL(t,rl(n,r))},n5=function(t){var n=rp(t);return function(t,r){return eL(t,n(r))}},n9=function(t){return function(n){return eL(n,nR(t()))}},n6=n9,n8=function(t){return n7(function(n){return eL(t,rr(n))})},n7=function(t){return nB(function(n,r){return t(r)})},re=function(t){return function(n){for(var r=rE(n),i=[t(n)];eY(r);)i.push(t(r)),r=rE(r);return i}},rt=re(eO),rn=n7(eO),rr=function(t){return ri(function(n,r){return t(r)})},ri=function(t){return function(n){for(var r=[t(0,rR(n))],i=1;i<n.length;i++)r.push(t(i,n[i]));return r}},ro=function(t,n){return rs(t,function(t,r,i){return n(r,i)})},ra=function(t){return function(n){return function(r){return r.slice(1).reduce(function(r,i){return t.concat(r,n(i))},n(r[0]))}}},ru=function(t,n){return rl(t,function(t,r,i){return n(r,i)})},rs=function(t,n){return function(r){return r.reduce(function(t,r,i){return n(i,t,r)},t)}},rc=function(t){return function(n){return function(r){return r.slice(1).reduce(function(r,i,o){return t.concat(r,n(o+1,i))},n(0,r[0]))}}},rl=function(t,n){return function(r){return r.reduceRight(function(t,r,i){return n(i,r,t)},t)}},rf=function(t){var n=rp(t);return function(t){return n(function(n,r){return t(r)})}},rd=function(t){return rp(t)(eD)},rp=function(t){return function(n){return function(r){for(var i=t.map(n(0,rR(r)),eZ),o=1;o<r.length;o++)i=t.ap(t.map(i,function(t){return function(n){return eL(t,ng(n))}}),n(o,r[o]));return i}}},rh="ReadonlyNonEmptyArray",rm=function(t){return{show:function(n){return"[".concat(n.map(t.show).join(", "),"]")}}},rg=function(){return{concat:nE}},ry=function(t){return tT(function(n,r){return n.length===r.length&&n.every(function(n,i){return t.equals(n,r[i])})})},rv=function(t){var n=n_(t);return{concat:function(t,r){return n(r)(t)}}},rb={URI:rh,map:nK},rx=ti(rb),r_={URI:rh,map:nK,ap:nG},rS=e4(r_),rT=e5(r_),rw={URI:rh,map:nK,ap:nG,chain:nZ},rO=tf(rw),rk=eZ(e0),rI=to(rb),rC=td(rw),rM=e9(r_),rR=eJ,rE=eQ,rj=function(t){return t[t.length-1]},rN=function(t){return t.slice(0,-1)},rA=function(t){var n=t6(t);return function(t){return t.reduce(n.concat)}},rP=function(t){var n=t8(t);return function(t){return t.reduce(n.concat)}},rL=function(t){return function(n){return n.reduce(t.concat)}},rD=function(t){return function(n){return t(rR(n),rE(n))}},rF=function(t){return function(n){return t(rN(n),rj(n))}},rW=function(t){return function(n){return np([t(rR(n))],rE(n),!0)}},rU=function(t){return rW(function(){return t})},rz=function(t){return function(n){return eL(rN(n),ng(t(rj(n))))}},rB=function(t){return rz(function(){return t})},rV=function(t){var n=rL(t);return function(t){return eE(nz(t),n)}},r$=function(t){return function(n){return nT(n.filter(function(n,r){return t(r,n)}))}};function rq(t,n){return void 0===n?nm(t):eL(n,nm(t))}var rK=function(t,n){return eL(t,nE([n]))},rH=function(t,n){return function(r){return t<0||t>r.length?eV:e$(ny(t,n,r))}};let rG=Object.freeze(Object.defineProperty({__proto__:null,Alt:{URI:rh,map:nK,alt:n1},Applicative:{URI:rh,map:nK,ap:nG,of:eZ},Apply:r_,Chain:rw,Comonad:{URI:rh,map:nK,extend:nY,extract:eJ},Do:rk,Foldable:{URI:rh,reduce:nJ,foldMap:nQ,reduceRight:nX},FoldableWithIndex:{URI:rh,reduce:nJ,foldMap:nQ,reduceRight:nX,reduceWithIndex:n2,foldMapWithIndex:n3,reduceRightWithIndex:n4},Functor:rb,FunctorWithIndex:{URI:rh,map:nK,mapWithIndex:nH},Monad:{URI:rh,map:nK,ap:nG,of:eZ,chain:nZ},Pointed:{URI:rh,of:eZ},Traversable:{URI:rh,map:nK,reduce:nJ,foldMap:nQ,reduceRight:nX,traverse:n0,sequence:rd},TraversableWithIndex:{URI:rh,map:nK,mapWithIndex:nH,reduce:nJ,foldMap:nQ,reduceRight:nX,traverse:n0,sequence:rd,reduceWithIndex:n2,foldMapWithIndex:n3,reduceRightWithIndex:n4,traverseWithIndex:n5},URI:rh,alt:n6,altW:n9,ap:n8,apFirst:rS,apS:rM,apSecond:rT,append:ng,appendW:ng,bind:rC,bindTo:rI,chain:n7,chainFirst:rO,chainWithIndex:nB,chop:nV,chunksOf:nq,concat:nE,concatAll:rL,concatW:nR,cons:rq,duplicate:rt,empty:eX,extend:re,extract:eJ,filter:function(t){return r$(function(n,r){return t(r)})},filterWithIndex:r$,flap:rx,flatten:rn,fold:rL,foldMap:ra,foldMapWithIndex:rc,fromArray:nM,fromReadonlyArray:nT,getEq:ry,getSemigroup:rg,getShow:rm,getUnionSemigroup:rv,group:nN,groupBy:nA,groupSort:function(t){var n=nP(t),r=nN(t);return function(t){return eY(t)?r(n(t)):eX}},head:rR,init:rN,insertAt:rH,intercalate:rV,intersperse:nz,isNonEmpty:eY,isOutOfBound:nh,last:rj,makeBy:nw,map:rr,mapWithIndex:ri,matchLeft:rD,matchRight:rF,max:rP,min:rA,modifyAt:nD,modifyHead:rW,modifyLast:rz,of:eZ,prepend:nm,prependAll:nU,prependToAll:nU,prependW:nm,range:nk,readonlyNonEmptyArray:{URI:rh,of:eZ,map:nK,mapWithIndex:nH,ap:nG,chain:nZ,extend:nY,extract:eJ,reduce:nJ,foldMap:nQ,reduceRight:nX,traverse:n0,sequence:rd,reduceWithIndex:n2,foldMapWithIndex:n3,reduceRightWithIndex:n4,traverseWithIndex:n5,alt:n1},reduce:ro,reduceRight:ru,reduceRightWithIndex:rl,reduceWithIndex:rs,replicate:nO,reverse:nj,rotate:nS,sequence:rd,snoc:rK,sort:nP,sortBy:nx,splitAt:n$,tail:rE,traverse:rf,traverseWithIndex:rp,unappend:nC,uncons:nI,union:n_,uniq:nb,unprepend:nI,unsafeInsertAt:ny,unsafeUpdateAt:nv,unsnoc:nC,unzip:nW,updateAt:nL,updateHead:rU,updateLast:rB,zip:function t(n,r){return void 0===r?function(r){return t(r,n)}:nF(n,r,function(t,n){return[t,n]})},zipWith:nF},Symbol.toStringTag,{value:"Module"}));var rZ=globalThis&&globalThis.__spreadArray||function(t,n,r){if(r||2===arguments.length)for(var i,o=0,a=n.length;o<a;o++)!i&&o in n||(i||(i=Array.prototype.slice.call(n,0,o)),i[o]=n[o]);return t.concat(i||Array.prototype.slice.call(n))},rY=function(t){return t.length>0},rJ=function(t,n){return t<0||t>=n.length},rQ=function(t){return function(n){return rZ([t],n,!0)}},rX=function(t){return function(n){return rZ(rZ([],n,!0),[t],!1)}},r0=function(t,n,r){if(rY(r)){var i=r9(r);return i.splice(t,0,n),i}return[n]},r1=function(t,n,r){var i=r9(r);return i[t]=n,i},r2=function(t){return function(n){if(1===n.length)return ih(n);for(var r=[oi(n)],i=oo(n),o=function(n){r.every(function(r){return!t.equals(r,n)})&&r.push(n)},a=0;a<i.length;a++)o(i[a]);return r}},r3=function(t){if(rY(t)){var n=tU();return ic(t.reduce(n.concat,n.empty))}return ih},r4=function(t){var n=r2(t);return function(t){return function(r){return n(eL(r,io(t)))}}},r5=function(t){return function(n){var r=n.length,i=Math.round(t)%r;if(rJ(Math.abs(i),n)||0===i)return ih(n);if(!(i<0))return r5(i-r)(n);var o=iS(-i)(n),a=o[0];return eL(o[1],io(a))}},r9=e2,r6=function(t){return rY(t)?e$(t):eV},r8=function(t){return function(n){for(var r=Math.max(0,Math.floor(n)),i=[t(0)],o=1;o<r;o++)i.push(t(o));return i}},r7=function(t){return r8(function(){return t})},ie=function(t,n){return t<=n?r8(function(n){return t+n})(n-t+1):[t]},it=function(t){return[oi(t),oo(t)]},ir=function(t){return[ou(t),oa(t)]};function ii(t){return function(n){return n.concat(t)}}function io(t,n){return n?t.concat(n):function(n){return n.concat(t)}}var ia=function(t){return rZ([oa(t)],t.slice(0,-1).reverse(),!0)};function iu(t){return function(n){var r=n.length;if(0===r)return[];for(var i=[],o=n[0],a=[o],u=1;u<r;u++){var s=n[u];t.equals(s,o)?a.push(s):(i.push(a),a=[o=s])}return i.push(a),i}}var is=function(t){return function(n){for(var r={},i=0;i<n.length;i++){var o=n[i],a=t(o);e1.call(r,a)?r[a].push(o):r[a]=[o]}return r}},ic=function(t){return function(n){return n.slice().sort(t.compare)}},il=function(t,n){return function(r){return t<0||t>r.length?eV:e$(r0(t,n,r))}},id=function(t,n){return ip(t,function(){return n})},ip=function(t,n){return function(r){return rJ(t,r)?eV:e$(r1(t,n(r[t]),r))}},ih=r9,im=function(t){return[t]},ig=function(t,n,r){for(var i=[r(t[0],n[0])],o=Math.min(t.length,n.length),a=1;a<o;a++)i[a]=r(t[a],n[a]);return i},iy=function(t){for(var n=[t[0][0]],r=[t[0][1]],i=1;i<t.length;i++)n[i]=t[i][0],r[i]=t[i][1];return[n,r]},iv=function(t){return function(n){for(var r=[t,n[0]],i=1;i<n.length;i++)r.push(t,n[i]);return r}},ib=function(t){return function(n){var r=oo(n);return rY(r)?eL(r,iv(t),rQ(oi(n))):ih(n)}},ix=function(t){return function(n){for(var r=r9(t(0,oi(n))),i=1;i<n.length;i++)r.push.apply(r,t(i,n[i]));return r}},i_=function(t){return function(n){for(var r=t(n),i=r[0],o=r[1],a=[i],u=o;rY(u);){var s=t(u),c=s[0],l=s[1];a.push(c),u=l}return a}},iS=function(t){return function(n){var r=Math.max(1,t);return r>=n.length?[ih(n),[]]:[eL(n.slice(1,r),rQ(oi(n))),n.slice(r)]}},iT=function(t){return i_(iS(t))},iw=function(t,n){return eL(t,iq(n))},iO=function(t,n){return eL(t,iK(n))},ik=function(t,n){return eL(t,iU(n))},iI=function(t,n){return eL(t,iz(n))},iC=function(t,n){return eL(t,iB(n))},iM=function(t,n,r){return eL(t,iH(n,r))},iR=function(t){var n=ra(t);return function(t,r){return eL(t,n(r))}},iE=function(t,n,r){return eL(t,iZ(n,r))},ij=function(t){var n=iJ(t);return function(t,r){return eL(t,n(r))}},iN=function(t,n){return eL(t,iW(n))},iA=function(t,n,r){return eL(t,iG(n,r))},iP=function(t){var n=rc(t);return function(t,r){return eL(t,n(r))}},iL=function(t,n,r){return eL(t,iY(n,r))},iD=function(t){var n=iX(t);return function(t,r){return eL(t,n(r))}},iF=function(t){return function(n){return eL(n,ii(t()))}},iW=iF,iU=function(t){return iz(function(n){return eL(t,iq(n))})},iz=function(t){return ix(function(n,r){return t(r)})},iB=function(t){return function(n){for(var r=oo(n),i=[t(n)];rY(r);)i.push(t(r)),r=oo(r);return i}},iV=iB(eO),i$=iz(eO),iq=function(t){return iK(function(n,r){return t(r)})},iK=function(t){return function(n){for(var r=[t(0,oi(n))],i=1;i<n.length;i++)r.push(t(i,n[i]));return r}},iH=ro,iG=rs,iZ=ru,iY=rl,iJ=function(t){var n=iX(t);return function(t){return n(function(n,r){return t(r)})}},iQ=function(t){return iX(t)(function(t,n){return n})},iX=function(t){return function(n){return function(r){for(var i=t.map(n(0,oi(r)),im),o=1;o<r.length;o++)i=t.ap(t.map(i,function(t){return function(n){return eL(t,rX(n))}}),n(o,r[o]));return i}}},i0="NonEmptyArray",i1=function(){return{concat:io}},i2=function(t){var n=r4(t);return{concat:function(t,r){return n(r)(t)}}},i3={URI:i0,map:iw},i4=ti(i3),i5={URI:i0,map:iw,ap:ik},i9=e4(i5),i6=e5(i5),i8={URI:i0,map:iw,ap:ik,chain:iI},i7=tf(i8),oe=im(e0),ot=to(i3),on=td(i8),or=e9(i5),oi=rR,oo=function(t){return t.slice(1)},oa=rj,ou=function(t){return t.slice(0,-1)},oc=function(t){return function(n){return n.reduce(t.concat)}},ol=function(t){return function(n){return t(oi(n),oo(n))}},of=function(t){return function(n){return t(ou(n),oa(n))}},od=function(t){return function(n){return rZ([t(oi(n))],oo(n),!0)}},op=function(t){return od(function(){return t})},oh=function(t){return function(n){return eL(ou(n),rX(t(oa(n))))}},om=function(t){return oh(function(){return t})},og=function(t){return function(n){return r6(n.filter(function(n,r){return t(r,n)}))}};function oy(t,n){return void 0===n?rQ(t):eL(n,rQ(t))}var ov=function(t,n){return eL(t,rX(n))};let ob=Object.freeze(Object.defineProperty({__proto__:null,Alt:{URI:i0,map:iw,alt:iN},Applicative:{URI:i0,map:iw,ap:ik,of:im},Apply:i5,Chain:i8,Comonad:{URI:i0,map:iw,extend:iC,extract:rR},Do:oe,Foldable:{URI:i0,reduce:iM,foldMap:iR,reduceRight:iE},FoldableWithIndex:{URI:i0,reduce:iM,foldMap:iR,reduceRight:iE,reduceWithIndex:iA,foldMapWithIndex:iP,reduceRightWithIndex:iL},Functor:i3,FunctorWithIndex:{URI:i0,map:iw,mapWithIndex:iO},Monad:{URI:i0,map:iw,ap:ik,of:im,chain:iI},Pointed:{URI:i0,of:im},Traversable:{URI:i0,map:iw,reduce:iM,foldMap:iR,reduceRight:iE,traverse:ij,sequence:iQ},TraversableWithIndex:{URI:i0,map:iw,mapWithIndex:iO,reduce:iM,foldMap:iR,reduceRight:iE,traverse:ij,sequence:iQ,reduceWithIndex:iA,foldMapWithIndex:iP,reduceRightWithIndex:iL,traverseWithIndex:iD},URI:i0,alt:iW,altW:iF,ap:iU,apFirst:i9,apS:or,apSecond:i6,append:rX,appendW:rX,bind:on,bindTo:ot,chain:iz,chainFirst:i7,chainWithIndex:ix,chop:i_,chunksOf:iT,concat:io,concatAll:oc,concatW:ii,cons:oy,copy:ih,duplicate:iV,extend:iB,extract:rR,filter:function(t){return og(function(n,r){return t(r)})},filterWithIndex:og,flap:i4,flatten:i$,fold:rL,foldMap:ra,foldMapWithIndex:rc,fromArray:r6,fromReadonlyNonEmptyArray:r9,getEq:ry,getSemigroup:i1,getShow:rm,getUnionSemigroup:i2,group:iu,groupBy:is,groupSort:function(t){var n=ic(t),r=iu(t);return function(t){return rY(t)?r(n(t)):[]}},head:oi,init:ou,insertAt:il,intercalate:rV,intersperse:ib,isNonEmpty:rY,isOutOfBound:rJ,last:oa,makeBy:r8,map:iq,mapWithIndex:iK,matchLeft:ol,matchRight:of,max:rP,min:rA,modifyAt:ip,modifyHead:od,modifyLast:oh,nonEmptyArray:{URI:i0,of:im,map:iw,mapWithIndex:iO,ap:ik,chain:iI,extend:iC,extract:rR,reduce:iM,foldMap:iR,reduceRight:iE,traverse:ij,sequence:iQ,reduceWithIndex:iA,foldMapWithIndex:iP,reduceRightWithIndex:iL,traverseWithIndex:iD,alt:iN},of:im,prepend:rQ,prependAll:iv,prependToAll:iv,prependW:rQ,range:ie,reduce:iH,reduceRight:iZ,reduceRightWithIndex:iY,reduceWithIndex:iG,replicate:r7,reverse:ia,rotate:r5,sequence:iQ,snoc:ov,sort:ic,sortBy:r3,splitAt:iS,tail:oo,traverse:iJ,traverseWithIndex:iX,unappend:ir,uncons:it,union:r4,uniq:r2,unprepend:it,unsafeInsertAt:r0,unsafeUpdateAt:r1,unsnoc:ir,unzip:iy,updateAt:id,updateHead:op,updateLast:om,zip:function t(n,r){return void 0===r?function(r){return t(r,n)}:ig(n,r,function(t,n){return[t,n]})},zipWith:ig},Symbol.toStringTag,{value:"Module"}));var ox=function(t){return"number"==typeof t},o_={equals:function(t,n){return t===n}},oS={equals:o_.equals,compare:function(t,n){return t<n?-1:t>n?1:0}},oT={equals:o_.equals,compare:oS.compare,top:1/0,bottom:-1/0},ow={concat:function(t,n){return t-n}},oO={concat:function(t,n){return t+n}},ok={concat:function(t,n){return t*n}},oI={concat:oO.concat,empty:0},oC={concat:ok.concat,empty:1},oM={add:oO.concat,zero:0,mul:ok.concat,one:1,sub:ow.concat,degree:function(t){return 1},div:function(t,n){return t/n},mod:function(t,n){return t%n}};let oR=Object.freeze(Object.defineProperty({__proto__:null,Bounded:oT,Eq:o_,Field:oM,MagmaSub:ow,MonoidProduct:oC,MonoidSum:oI,Ord:oS,SemigroupProduct:ok,SemigroupSum:oO,Show:{show:function(t){return JSON.stringify(t)}},isNumber:ox},Symbol.toStringTag,{value:"Module"}));var oE=function(t,n){return{left:t,right:n}},oj=function(t,n){return eL(t,oP(n))},oN=function(t,n,r){return eL(t,oL(n,r))},oA=function(t){return function(n){return oE(oU(n),t(oz(n)))}},oP=function(t){return function(n){return oE(t(oU(n)),oz(n))}},oL=function(t,n){return function(r){return oE(t(oU(r)),n(oz(r)))}},oD="Separated",oF={URI:oD,map:function(t,n){return eL(t,oA(n))}},oW=ti(oF),oU=function(t){return t.left},oz=function(t){return t.right};let oB=Object.freeze(Object.defineProperty({__proto__:null,Bifunctor:{URI:oD,mapLeft:oj,bimap:oN},Functor:oF,URI:oD,bimap:oL,flap:oW,left:oU,map:oA,mapLeft:oP,right:oz,separated:oE},Symbol.toStringTag,{value:"Module"}));function oV(t,n){return function(r){var i=t.traverse(r);return function(t,o){return r.map(i(t,o),n.separate)}}}function o$(t,n){return function(r){var i=t.traverse(r);return function(t,o){return r.map(i(t,o),n.compact)}}}function oq(t){return function(n){var r=t.wither(n);return function(t){return function(i){return r(i,function(r){return n.map(t(r),function(t){return t?e$(r):eV})})}}}}let oK=Object.freeze(Object.defineProperty({__proto__:null,filterE:oq,wiltDefault:oV,witherDefault:o$},Symbol.toStringTag,{value:"Module"}));function oH(t,n){return function(r){return r?n.of(void 0):t.zero()}}let oG=Object.freeze(Object.defineProperty({__proto__:null,guard:oH},Symbol.toStringTag,{value:"Module"}));var oZ=globalThis&&globalThis.__spreadArray||function(t,n,r){if(r||2===arguments.length)for(var i,o=0,a=n.length;o<a;o++)!i&&o in n||(i||(i=Array.prototype.slice.call(n,0,o)),i[o]=n[o]);return t.concat(i||Array.prototype.slice.call(n))},oY=function(t){return 0===t.length},oJ=function(t,n){return t<=0?se:nw(n)(t)},oQ=function(t,n){return oJ(t,function(){return n})},oX=function(t){return ez(t)?se:[t.value]},o0=function(t){return eq(t)?se:[t.right]},o1=function(t,n){return function(r){return eY(r)?n(r):t()}},o2=function(t,n){return function(r){return eY(r)?n(rR(r),rE(r)):t()}},o3=function(t,n){return function(r){return eY(r)?n(rN(r),rj(r)):t()}},o4=function(t){return function(n){if(oY(n))return se;for(var r=[],i=0;i<n.length;i++)r.push.apply(r,t(i,n[i]));return r}},o5=function(t,n){return function(r){var i=r.length,o=Array(i+1);o[0]=t;for(var a=0;a<i;a++)o[a+1]=n(o[a],r[a]);return o}},o9=function(t,n){return function(r){var i=r.length,o=Array(i+1);o[i]=t;for(var a=i-1;a>=0;a--)o[a]=n(r[a],o[a+1]);return o}},o6=function(t){return t.length};function o8(t,n){return void 0===n?function(n){return o8(t,n)}:nh(t,n)?eV:e$(n[t])}var o7=function(t){return eY(t)?e$(rR(t)):eV},ae=function(t){return eY(t)?e$(rj(t)):eV},at=function(t){return eY(t)?e$(rE(t)):eV},an=function(t){return eY(t)?e$(rN(t)):eV},ar=function(t){return function(n){return nh(t,n)?n:0===t?se:n.slice(0,t)}},ai=function(t){return function(n){return nh(t,n)?n:0===t?se:n.slice(-t)}},ao=function(t,n){for(var r=t.length,i=0;i<r&&n(t[i]);i++);return i},aa=function(t){return function(n){return t<=0||oY(n)?n:t>=n.length?se:n.slice(t,n.length)}},au=function(t){return function(n){return t<=0||oY(n)?n:t>=n.length?se:n.slice(0,n.length-t)}},as=function(t){return function(n){for(var r=0;r<n.length;r++)if(t(n[r]))return e$(r);return eV}};function ac(t){return function(n){for(var r=0;r<n.length;r++)if(t(n[r]))return e$(n[r]);return eV}}var al=function(t){return function(n){for(var r=0;r<n.length;r++){var i=t(n[r]);if(eB(i))return i}return eV}};function af(t){return function(n){for(var r=n.length-1;r>=0;r--)if(t(n[r]))return e$(n[r]);return eV}}var ad=function(t){return function(n){for(var r=n.length-1;r>=0;r--){var i=t(n[r]);if(eB(i))return i}return eV}},ap=function(t){return function(n){for(var r=n.length-1;r>=0;r--)if(t(n[r]))return e$(r);return eV}},ah=function(t,n){return function(r){return t<0||t>r.length?eV:e$(ny(t,n,r))}},am=function(t,n){return ay(t,function(){return n})},ag=function(t){return function(n){return nh(t,n)?eV:e$(u6(t,n))}},ay=function(t,n){return function(r){return nh(t,r)?eV:e$(u9(t,n(r[t]),r))}},av=function(t){return t.length<=1?t:t.slice().reverse()},ab=function(t){for(var n=[],r=0;r<t.length;r++){var i=t[r];"Right"===i._tag&&n.push(i.right)}return n},ax=function(t){for(var n=[],r=0;r<t.length;r++){var i=t[r];"Left"===i._tag&&n.push(i.left)}return n},a_=function(t){return function(n){return n.length<=1?n:n.slice().sort(t.compare)}},aS=function(t,n,r){for(var i=[],o=Math.min(t.length,n.length),a=0;a<o;a++)i[a]=r(t[a],n[a]);return i},aT=function(t){for(var n=[],r=[],i=0;i<t.length;i++)n[i]=t[i][0],r[i]=t[i][1];return[n,r]},aw=function(t){var n=nU(t);return function(t){return eY(t)?n(t):t}},aO=function(t){var n=nz(t);return function(t){return eY(t)?n(t):t}},ak=function(t){var n=nS(t);return function(t){return eY(t)?n(t):t}};function aI(t){return function(n,r){if(void 0===r){var i,o=aI(t);return function(t){return o(n,t)}}for(var a=0;a<r.length;a++)if(i=r[a],t.equals(i,n))return!0;return!1}}var aC=function(t){var n=nb(t);return function(t){return eY(t)?n(t):t}},aM=function(t){var n=nx(t);return function(t){return eY(t)?n(t):t}},aR=function(t){var n=nV(t);return function(t){return eY(t)?n(t):se}},aE=function(t){return function(n){return t>=1&&eY(n)?n$(t)(n):oY(n)?[n,se]:[se,n]}},aj=function(t){var n=nq(t);return function(t){return eY(t)?n(t):se}},aN=function(t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return oX(t.apply(void 0,n))}},aA=function(t){return function(n){return oY(n)?t:oY(t)?n:n.concat(t)}};function aP(t){var n=n_(t);return function(r,i){if(void 0===i){var o=aP(t);return function(t){return o(t,r)}}return eY(r)&&eY(i)?n(i)(r):eY(r)?r:i}}function aL(t){var n=aI(t);return function(r,i){if(void 0===i){var o=aL(t);return function(t){return o(t,r)}}return r.filter(function(t){return n(t,i)})}}function aD(t){var n=aI(t);return function(r,i){if(void 0===i){var o=aD(t);return function(t){return o(t,r)}}return r.filter(function(t){return!n(t,i)})}}var aF=function(t,n){return eL(t,ui(n))},aW=function(t,n){return eL(t,uo(n))},aU=function(t,n){return eL(t,ut(n))},az=function(t,n){return eL(t,un(n))},aB=function(t,n){return eL(t,uu(n))},aV=function(t,n){return eL(t,uc(n))},a$=function(t,n){return eL(t,uf(n))},aq=function(t,n){return eL(t,up(n))},aK=function(t,n){return eL(t,ud(n))},aH=function(t,n){return eL(t,uh(n))},aG=function(t,n){return eL(t,ue(n))},aZ=function(t,n,r){return eL(t,ub(n,r))},aY=function(t){var n=ux(t);return function(t,r){return eL(t,n(r))}},aJ=function(t,n,r){return eL(t,uS(n,r))},aQ=function(t,n,r){return eL(t,u_(n,r))},aX=function(t){var n=uv(t);return function(t,r){return eL(t,n(r))}},a0=function(t,n,r){return eL(t,uT(n,r))},a1=function(t,n){return eL(t,us(n))},a2=function(t,n){return eL(t,um(n))},a3=function(t,n){return eL(t,ug(n))},a4=function(t){var n=uw(t);return function(t,r){return eL(t,n(r))}},a5=function(t){var n=uk(t);return function(t,r){return eL(t,n(r))}},a9=function(t,n){return eL(t,uQ(n))},a6=function(t,n){return eL(t,uX(n))},a8=function(){return se},a7=function(t){return function(n){return n.concat(t())}},ue=a7,ut=function(t){return un(function(n){return eL(t,ui(n))})},un=function(t){return function(n){return eL(n,o4(function(n,r){return t(r)}))}},ur=un(eO),ui=function(t){return function(n){return n.map(function(n){return t(n)})}},uo=function(t){return function(n){return n.map(function(n,r){return t(r,n)})}},ua=function(t){for(var n=[],r=[],i=0;i<t.length;i++){var o=t[i];"Left"===o._tag?n.push(o.left):r.push(o.right)}return oE(n,r)},uu=function(t){return function(n){return n.filter(t)}},us=function(t){return function(n){for(var r=[],i=0;i<n.length;i++){var o=t(i,n[i]);eB(o)&&r.push(o.value)}return r}},uc=function(t){return us(function(n,r){return t(r)})},ul=uc(eO),uf=function(t){return ud(function(n,r){return t(r)})},ud=function(t){return function(n){for(var r=[],i=[],o=0;o<n.length;o++){var a=n[o];t(o,a)?i.push(a):r.push(a)}return oE(r,i)}},up=function(t){return uh(function(n,r){return t(r)})},uh=function(t){return function(n){for(var r=[],i=[],o=0;o<n.length;o++){var a=t(o,n[o]);"Left"===a._tag?r.push(a.left):i.push(a.right)}return oE(r,i)}},um=function(t){return function(n){return n.filter(function(n,r){return t(r,n)})}},ug=function(t){return function(n){return n.map(function(r,i){return t(n.slice(i))})}},uy=ug(eO),uv=function(t){return function(n){return function(r){return r.reduce(function(r,i,o){return t.concat(r,n(o,i))},t.empty)}}},ub=function(t,n){return u_(t,function(t,r,i){return n(r,i)})},ux=function(t){var n=uv(t);return function(t){return n(function(n,r){return t(r)})}},u_=function(t,n){return function(r){for(var i=r.length,o=t,a=0;a<i;a++)o=n(a,o,r[a]);return o}},uS=function(t,n){return uT(t,function(t,r,i){return n(r,i)})},uT=function(t,n){return function(r){return r.reduceRight(function(t,r,i){return n(i,r,t)},t)}},uw=function(t){var n=uk(t);return function(t){return n(function(n,r){return t(r)})}},uO=function(t){return function(n){return aZ(n,t.of(a8()),function(n,r){return t.ap(t.map(n,function(t){return function(n){return eL(t,ng(n))}}),r)})}},uk=function(t){return function(n){return u_(t.of(a8()),function(r,i,o){return t.ap(t.map(i,function(t){return function(n){return eL(t,ng(n))}}),n(r,o))})}},uI=function(t){var n=u0(t);return function(t){return function(r){return n(r,t)}}},uC=function(t){var n=u1(t);return function(t){return function(r){return n(r,t)}}},uM=function(t,n){for(var r=[],i=t;;){var o=n(i);if(eB(o)){var a=o.value,u=a[0],s=a[1];r.push(u),i=s}else break}return r},uR="ReadonlyArray",uE=function(t){return{show:function(n){return"[".concat(n.map(t.show).join(", "),"]")}}},uj=function(){return{concat:function(t,n){return oY(t)?n:oY(n)?t:t.concat(n)}}},uN=function(){return{concat:uj().concat,empty:se}},uA=function(t){return tT(function(n,r){return n.length===r.length&&n.every(function(n,i){return t.equals(n,r[i])})})},uP=function(t){return tP(function(n,r){for(var i=n.length,o=r.length,a=Math.min(i,o),u=0;u<a;u++){var s=t.compare(n[u],r[u]);if(0!==s)return s}return oS.compare(i,o)})},uL=function(t){var n=aP(t);return{concat:function(t,r){return n(r)(t)}}},uD=function(t){return{concat:uL(t).concat,empty:se}},uF=function(t){var n=aL(t);return{concat:function(t,r){return n(r)(t)}}},uW=function(t){var n=aD(t);return{concat:function(t,r){return n(r)(t)}}},uU={URI:uR,map:aF},uz=ti(uU),uB={URI:uR,of:eZ},uV={URI:uR,map:aF,ap:aU},u$=e4(uV),uq=e5(uV),uK={URI:uR,map:aF,ap:aU,chain:az},uH=tf(uK),uG={URI:uR,zero:a8},uZ=oH(uG,uB),uY={URI:uR,compact:ul,separate:ua},uJ={URI:uR,map:aF,reduce:aZ,foldMap:aY,reduceRight:aJ,traverse:a4,sequence:uO},uQ=function(t){return function(n){for(var r=oZ([],t(n),!0),i=[];r.length>0;){var o=r.shift();eq(o)?r.unshift.apply(r,t(o.left)):i.push(o.right)}return i}},uX=function(t){return function(n){var r=t(n),i=[],o=[];function a(n){eq(n)?t(n.left).forEach(function(t){return i.push(t)}):o.push(n.right)}for(var u=0;u<r.length;u++)a(r[u]);for(;i.length>0;)a(i.shift());return o}},u0=o$(uJ,uY),u1=oV(uJ,uY),u2={URI:uR,map:aF,compact:ul,separate:ua,filter:aB,filterMap:aV,partition:a$,partitionMap:aq,reduce:aZ,foldMap:aY,reduceRight:aJ,traverse:a4,sequence:uO,wither:u0,wilt:u1},u3=oq(u2),u4={URI:uR,fromEither:o0},u5=tv(u4),u9=function(t,n,r){return eY(r)?nv(t,n,r):r},u6=function(t,n){var r=n.slice();return r.splice(t,1),r},u8=function(t){return t.slice()},u7=function(t){return oY(t)?se:t.slice()},se=eX;function st(t){return function(n){return n.every(t)}}var sn=function(t){return function(n){return n.some(t)}},sr=function(t){var n=rV(t);return function(r){return o1(function(){return t.empty},n(r))}},si=eZ(e0),so=to(uU),sa=td(uK),su=e9(uV);let ss=Object.freeze(Object.defineProperty({__proto__:null,Alt:{URI:uR,map:aF,alt:aG},Alternative:{URI:uR,map:aF,ap:aU,of:eZ,alt:aG,zero:a8},Applicative:{URI:uR,map:aF,ap:aU,of:eZ},Apply:uV,Chain:uK,ChainRecBreadthFirst:{URI:uR,map:aF,ap:aU,chain:az,chainRec:a6},ChainRecDepthFirst:{URI:uR,map:aF,ap:aU,chain:az,chainRec:a9},Compactable:uY,Do:si,Extend:{URI:uR,map:aF,extend:a3},Filterable:{URI:uR,map:aF,compact:ul,separate:ua,filter:aB,filterMap:aV,partition:a$,partitionMap:aq},FilterableWithIndex:{URI:uR,map:aF,mapWithIndex:aW,compact:ul,separate:ua,filter:aB,filterMap:aV,partition:a$,partitionMap:aq,partitionMapWithIndex:aH,partitionWithIndex:aK,filterMapWithIndex:a1,filterWithIndex:a2},Foldable:{URI:uR,reduce:aZ,foldMap:aY,reduceRight:aJ},FoldableWithIndex:{URI:uR,reduce:aZ,foldMap:aY,reduceRight:aJ,reduceWithIndex:aQ,foldMapWithIndex:aX,reduceRightWithIndex:a0},FromEither:u4,Functor:uU,FunctorWithIndex:{URI:uR,map:aF,mapWithIndex:aW},Monad:{URI:uR,map:aF,ap:aU,of:eZ,chain:az},Pointed:uB,Traversable:uJ,TraversableWithIndex:{URI:uR,map:aF,mapWithIndex:aW,reduce:aZ,foldMap:aY,reduceRight:aJ,reduceWithIndex:aQ,foldMapWithIndex:aX,reduceRightWithIndex:a0,traverse:a4,sequence:uO,traverseWithIndex:a5},URI:uR,Unfoldable:{URI:uR,unfold:uM},Witherable:u2,Zero:uG,_chainRecBreadthFirst:a6,_chainRecDepthFirst:a9,alt:ue,altW:a7,ap:ut,apFirst:u$,apS:su,apSecond:uq,append:ng,appendW:ng,bind:sa,bindTo:so,chain:un,chainFirst:uH,chainRecBreadthFirst:uX,chainRecDepthFirst:uQ,chainWithIndex:o4,chop:aR,chunksOf:aj,compact:ul,comprehension:function(t,n,r){void 0===r&&(r=function(){return!0});var i=function(t,o){return eY(o)?eL(rR(o),un(function(n){return i(eL(t,ng(n)),rE(o))})):r.apply(void 0,t)?[n.apply(void 0,t)]:se};return i(se,t)},concat:aA,concatW:aA,cons:rq,deleteAt:ag,difference:aD,dropLeft:aa,dropLeftWhile:function(t){return function(n){var r=ao(n,t);return 0===r?n:r===n.length?se:n.slice(r)}},dropRight:au,duplicate:uy,elem:aI,empty:se,every:st,exists:sn,extend:ug,filter:uu,filterE:u3,filterMap:uc,filterMapWithIndex:us,filterWithIndex:um,findFirst:ac,findFirstMap:al,findIndex:as,findLast:af,findLastIndex:ap,findLastMap:ad,flap:uz,flatten:ur,foldLeft:o2,foldMap:ux,foldMapWithIndex:uv,foldRight:o3,fromArray:u7,fromEither:o0,fromEitherK:u5,fromOption:oX,fromOptionK:aN,fromPredicate:function(t){return function(n){return t(n)?[n]:se}},getDifferenceMagma:uW,getEq:uA,getIntersectionSemigroup:uF,getMonoid:uN,getOrd:uP,getSemigroup:uj,getShow:uE,getUnionMonoid:uD,getUnionSemigroup:uL,guard:uZ,head:o7,init:an,insertAt:ah,intercalate:sr,intersection:aL,intersperse:aO,isEmpty:oY,isNonEmpty:eY,isOutOfBound:nh,last:ae,lefts:ax,lookup:o8,makeBy:oJ,map:ui,mapWithIndex:uo,match:o1,matchLeft:o2,matchLeftW:o2,matchRight:o3,matchRightW:o3,matchW:o1,modifyAt:ay,of:eZ,partition:uf,partitionMap:up,partitionMapWithIndex:uh,partitionWithIndex:ud,prepend:nm,prependAll:aw,prependToAll:aw,prependW:nm,range:nk,readonlyArray:{URI:uR,compact:ul,separate:ua,map:aF,ap:aU,of:eZ,chain:az,filter:aB,filterMap:aV,partition:a$,partitionMap:aq,mapWithIndex:aW,partitionMapWithIndex:aH,partitionWithIndex:aK,filterMapWithIndex:a1,filterWithIndex:a2,alt:aG,zero:a8,unfold:uM,reduce:aZ,foldMap:aY,reduceRight:aJ,traverse:a4,sequence:uO,reduceWithIndex:aQ,foldMapWithIndex:aX,reduceRightWithIndex:a0,traverseWithIndex:a5,extend:a3,wither:u0,wilt:u1},reduce:ub,reduceRight:uS,reduceRightWithIndex:uT,reduceWithIndex:u_,replicate:oQ,reverse:av,rights:ab,rotate:ak,scanLeft:o5,scanRight:o9,separate:ua,sequence:uO,size:o6,snoc:rK,some:sn,sort:a_,sortBy:aM,spanLeft:function(t){return function(n){var r,i=aE(ao(n,t))(n);return{init:i[0],rest:i[1]}}},splitAt:aE,tail:at,takeLeft:ar,takeLeftWhile:function(t){return function(n){for(var r=[],i=0;i<n.length;i++){var o=n[i];if(!t(o))break;r.push(o)}var a=r.length;return a===n.length?n:0===a?se:r}},takeRight:ai,toArray:u8,traverse:uw,traverseWithIndex:uk,unfold:uM,union:aP,uniq:aC,unsafeDeleteAt:u6,unsafeInsertAt:ny,unsafeUpdateAt:u9,unzip:aT,updateAt:am,wilt:uC,wither:uI,zero:a8,zip:function t(n,r){return void 0===r?function(r){return t(r,n)}:aS(n,r,function(t,n){return[t,n]})},zipWith:aS},Symbol.toStringTag,{value:"Module"}));var sc=function(t){return 0===t.length},sl=function(t,n){return t<=0?[]:r8(n)(t)},sf=function(t,n){return sl(t,function(){return n})},sd=function(t){return ez(t)?[]:[t.value]},sp=function(t){return eq(t)?[]:[t.right]},sh=function(t,n){return function(r){return rY(r)?n(r):t()}},sm=function(t,n){return function(r){return rY(r)?n(oi(r),oo(r)):t()}},sg=function(t,n){return function(r){return rY(r)?n(ou(r),oa(r)):t()}},sy=function(t){return function(n){for(var r=[],i=0;i<n.length;i++)r.push.apply(r,t(i,n[i]));return r}},sv=function(t,n){return function(r){var i=r.length,o=Array(i+1);o[0]=t;for(var a=0;a<i;a++)o[a+1]=n(o[a],r[a]);return o}},sb=function(t,n){return function(r){var i=r.length,o=Array(i+1);o[i]=t;for(var a=i-1;a>=0;a--)o[a]=n(r[a],o[a+1]);return o}},sx=function(t){return t.length},s_=function(t){return rY(t)?e$(oo(t)):eV},sS=function(t){return rY(t)?e$(ou(t)):eV},sT=function(t){return function(n){return rJ(t,n)?sR(n):n.slice(0,t)}},sw=function(t){return function(n){return rJ(t,n)?sR(n):0===t?[]:n.slice(-t)}},sO=function(t,n){for(var r=t.length,i=0;i<r&&n(t[i]);i++);return i},sk=function(t){return function(n){return t<=0||sc(n)?sR(n):t>=n.length?[]:n.slice(t,n.length)}},sI=function(t){return function(n){return t<=0||sc(n)?sR(n):t>=n.length?[]:n.slice(0,n.length-t)}};function sC(t){return ac(t)}function sM(t){return af(t)}var sR=function(t){return t.slice()},sE=function(t,n){return function(r){return t<0||t>r.length?eV:e$(la(t,n,r))}},sj=function(t,n){return sA(t,function(){return n})},sN=function(t){return function(n){return rJ(t,n)?eV:e$(ls(t,n))}},sA=function(t,n){return function(r){return rJ(t,r)?eV:e$(lu(t,n(r[t]),r))}},sP=function(t){return sc(t)?[]:t.slice().reverse()},sL=function(t){for(var n=[],r=0;r<t.length;r++){var i=t[r];"Right"===i._tag&&n.push(i.right)}return n},sD=function(t){for(var n=[],r=0;r<t.length;r++){var i=t[r];"Left"===i._tag&&n.push(i.left)}return n},sF=function(t){return function(n){return n.length<=1?sR(n):n.slice().sort(t.compare)}},sW=function(t,n,r){for(var i=[],o=Math.min(t.length,n.length),a=0;a<o;a++)i[a]=r(t[a],n[a]);return i},sU=function(t){for(var n=[],r=[],i=0;i<t.length;i++)n[i]=t[i][0],r[i]=t[i][1];return[n,r]},sz=function(t){var n=iv(t);return function(t){return rY(t)?n(t):[]}},sB=function(t){var n=ib(t);return function(t){return rY(t)?n(t):sR(t)}},sV=function(t){var n=r5(t);return function(t){return rY(t)?n(t):sR(t)}},s$=function(t){var n=r2(t);return function(t){return rY(t)?n(t):sR(t)}},sq=function(t){var n=r3(t);return function(t){return rY(t)?n(t):sR(t)}},sK=function(t){var n=i_(t);return function(t){return rY(t)?n(t):[]}},sH=function(t){return function(n){return t>=1&&rY(n)?iS(t)(n):sc(n)?[sR(n),[]]:[[],sR(n)]}},sG=function(t){var n=iT(t);return function(t){return rY(t)?n(t):[]}},sZ=function(t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return sd(t.apply(void 0,n))}},sY=function(t){return function(n){return sc(n)?sR(t):sc(t)?sR(n):n.concat(t)}};function sJ(t){var n=r4(t);return function(r,i){if(void 0===i){var o=sJ(t);return function(t){return o(t,r)}}return rY(r)&&rY(i)?n(i)(r):rY(r)?sR(r):sR(i)}}function sQ(t){var n=aI(t);return function(r,i){if(void 0===i){var o=sQ(t);return function(t){return o(t,r)}}return r.filter(function(t){return n(t,i)})}}function sX(t){var n=aI(t);return function(r,i){if(void 0===i){var o=sX(t);return function(t){return o(t,r)}}return r.filter(function(t){return!n(t,i)})}}var s0=function(t,n){return eL(t,cp(n))},s1=function(t,n){return eL(t,cy(n))},s2=function(t,n){return eL(t,ch(n))},s3=function(t,n){return eL(t,cm(n))},s4=function(t,n){return eL(t,cS(n))},s5=function(t,n){return eL(t,cb(n))},s9=function(t,n){return eL(t,cT(n))},s6=function(t,n){return eL(t,cO(n))},s8=function(t,n){return eL(t,cw(n))},s7=function(t,n){return eL(t,ck(n))},ce=function(t,n){return eL(t,cC(n))},ct=function(t,n,r){return eL(t,cA(n,r))},cn=function(t){var n=cj(t);return function(t,r){return eL(t,n(r))}},cr=function(t,n,r){return eL(t,cL(n,r))},ci=function(t,n,r){return eL(t,cP(n,r))},co=function(t){var n=cN(t);return function(t,r){return eL(t,n(r))}},ca=function(t,n,r){return eL(t,cD(n,r))},cu=function(t,n){return eL(t,cv(n))},cs=function(t,n){return eL(t,cM(n))},cc=function(t,n){return eL(t,cR(n))},cl=function(t){var n=cF(t);return function(t,r){return eL(t,n(r))}},cf=function(t){var n=cU(t);return function(t,r){return eL(t,n(r))}},cd=function(){return[]},cp=function(t){return function(n){return n.map(function(n){return t(n)})}},ch=function(t){return cm(function(n){return eL(t,cp(n))})},cm=function(t){return function(n){return eL(n,sy(function(n,r){return t(r)}))}},cg=cm(eO),cy=function(t){return function(n){return n.map(function(n,r){return t(r,n)})}},cv=function(t){return function(n){for(var r=[],i=0;i<n.length;i++){var o=t(i,n[i]);eB(o)&&r.push(o.value)}return r}},cb=function(t){return cv(function(n,r){return t(r)})},cx=cb(eO),c_=function(t){for(var n=[],r=[],i=0;i<t.length;i++){var o=t[i];"Left"===o._tag?n.push(o.left):r.push(o.right)}return oE(n,r)},cS=function(t){return function(n){return n.filter(t)}},cT=function(t){return cw(function(n,r){return t(r)})},cw=function(t){return function(n){for(var r=[],i=[],o=0;o<n.length;o++){var a=n[o];t(o,a)?i.push(a):r.push(a)}return oE(r,i)}},cO=function(t){return ck(function(n,r){return t(r)})},ck=function(t){return function(n){for(var r=[],i=[],o=0;o<n.length;o++){var a=t(o,n[o]);"Left"===a._tag?r.push(a.left):i.push(a.right)}return oE(r,i)}},cI=function(t){return function(n){return n.concat(t())}},cC=cI,cM=function(t){return function(n){return n.filter(function(n,r){return t(r,n)})}},cR=function(t){return function(n){return n.map(function(r,i){return t(n.slice(i))})}},cE=cR(eO),cj=ux,cN=uv,cA=ub,cP=u_,cL=uS,cD=uT,cF=function(t){var n=cU(t);return function(t){return n(function(n,r){return t(r)})}},cW=function(t){return function(n){return ct(n,t.of(cd()),function(n,r){return t.ap(t.map(n,function(t){return function(n){return eL(t,rX(n))}}),r)})}},cU=function(t){return function(n){return cP(t.of(cd()),function(r,i,o){return t.ap(t.map(i,function(t){return function(n){return eL(t,rX(n))}}),n(r,o))})}},cz=function(t){var n=le(t);return function(t){return function(r){return n(r,t)}}},cB=function(t){var n=lt(t);return function(t){return function(r){return n(r,t)}}},cV=function(t,n){for(var r=[],i=t;;){var o=n(i);if(eB(o)){var a=o.value,u=a[0],s=a[1];r.push(u),i=s}else break}return r},c$="Array",cq=function(){return{concat:function(t,n){return t.concat(n)}}},cK=function(){return{concat:cq().concat,empty:[]}},cH=function(t){var n=sJ(t);return{concat:function(t,r){return n(r)(t)}}},cG=function(t){return{concat:cH(t).concat,empty:[]}},cZ=function(t){var n=sQ(t);return{concat:function(t,r){return n(r)(t)}}},cY=function(t){var n=sX(t);return{concat:function(t,r){return n(r)(t)}}},cJ={URI:c$,map:s0},cQ=ti(cJ),cX={URI:c$,of:im},c0={URI:c$,map:s0,ap:s2},c1=e4(c0),c2=e5(c0),c3={URI:c$,map:s0,ap:s2,chain:s3},c4=tf(c3),c5={URI:c$,zero:cd},c9=oH(c5,cX),c6={URI:c$,compact:cx,separate:c_},c8={URI:c$,reduce:ct,foldMap:cn,reduceRight:cr},c7={URI:c$,map:s0,reduce:ct,foldMap:cn,reduceRight:cr,traverse:cl,sequence:cW},le=o$(c7,c6),lt=oV(c7,c6),ln={URI:c$,map:s0,compact:cx,separate:c_,filter:s4,filterMap:s5,partition:s9,partitionMap:s6,reduce:ct,foldMap:cn,reduceRight:cr,traverse:cl,sequence:cW,wither:le,wilt:lt},lr=oq(ln),li={URI:c$,fromEither:sp},lo=tv(li),la=r0,lu=function(t,n,r){return rY(r)?r1(t,n,r):[]},ls=function(t,n){var r=n.slice();return r.splice(t,1),r},lc=function(t){return function(n){return n.some(t)}},ll=im(e0),lf=to(cJ),ld=td(c3),lp=e9(c0);let lh=Object.freeze(Object.defineProperty({__proto__:null,Alt:{URI:c$,map:s0,alt:ce},Alternative:{URI:c$,map:s0,ap:s2,of:im,alt:ce,zero:cd},Applicative:{URI:c$,map:s0,ap:s2,of:im},Apply:c0,Chain:c3,ChainRecBreadthFirst:{URI:c$,map:s0,ap:s2,chain:s3,chainRec:a6},ChainRecDepthFirst:{URI:c$,map:s0,ap:s2,chain:s3,chainRec:a9},Compactable:c6,Do:ll,Extend:{URI:c$,map:s0,extend:cc},Filterable:{URI:c$,map:s0,compact:cx,separate:c_,filter:s4,filterMap:s5,partition:s9,partitionMap:s6},FilterableWithIndex:{URI:c$,map:s0,mapWithIndex:s1,compact:cx,separate:c_,filter:s4,filterMap:s5,partition:s9,partitionMap:s6,partitionMapWithIndex:s7,partitionWithIndex:s8,filterMapWithIndex:cu,filterWithIndex:cs},Foldable:c8,FoldableWithIndex:{URI:c$,reduce:ct,foldMap:cn,reduceRight:cr,reduceWithIndex:ci,foldMapWithIndex:co,reduceRightWithIndex:ca},FromEither:li,Functor:cJ,FunctorWithIndex:{URI:c$,map:s0,mapWithIndex:s1},Monad:{URI:c$,map:s0,ap:s2,of:im,chain:s3},Pointed:cX,Traversable:c7,TraversableWithIndex:{URI:c$,map:s0,mapWithIndex:s1,reduce:ct,foldMap:cn,reduceRight:cr,reduceWithIndex:ci,foldMapWithIndex:co,reduceRightWithIndex:ca,traverse:cl,sequence:cW,traverseWithIndex:cf},URI:c$,Unfoldable:{URI:c$,unfold:cV},Witherable:ln,Zero:c5,alt:cC,altW:cI,ap:ch,apFirst:c1,apS:lp,apSecond:c2,append:rX,appendW:rX,array:{URI:c$,compact:cx,separate:c_,map:s0,ap:s2,of:im,chain:s3,filter:s4,filterMap:s5,partition:s9,partitionMap:s6,mapWithIndex:s1,partitionMapWithIndex:s7,partitionWithIndex:s8,filterMapWithIndex:cu,filterWithIndex:cs,alt:ce,zero:cd,unfold:cV,reduce:ct,foldMap:cn,reduceRight:cr,traverse:cl,sequence:cW,reduceWithIndex:ci,foldMapWithIndex:co,reduceRightWithIndex:ca,traverseWithIndex:cf,extend:cc,wither:le,wilt:lt},bind:ld,bindTo:lf,chain:cm,chainFirst:c4,chainRecBreadthFirst:uX,chainRecDepthFirst:uQ,chainWithIndex:sy,chop:sK,chunksOf:sG,compact:cx,comprehension:function(t,n,r){void 0===r&&(r=function(){return!0});var i=function(t,o){return rY(o)?eL(oi(o),cm(function(n){return i(eL(t,rX(n)),oo(o))})):r.apply(void 0,t)?[n.apply(void 0,t)]:[]};return i([],t)},concat:sY,concatW:sY,cons:oy,copy:sR,deleteAt:sN,difference:sX,dropLeft:sk,dropLeftWhile:function(t){return function(n){return n.slice(sO(n,t))}},dropRight:sI,duplicate:cE,elem:aI,empty:[],every:st,exists:lc,extend:cR,filter:cS,filterE:lr,filterMap:cb,filterMapWithIndex:cv,filterWithIndex:cM,findFirst:sC,findFirstMap:al,findIndex:as,findLast:sM,findLastIndex:ap,findLastMap:ad,flap:cQ,flatten:cg,foldLeft:sm,foldMap:cj,foldMapWithIndex:cN,foldRight:sg,fromEither:sp,fromEitherK:lo,fromOption:sd,fromOptionK:sZ,fromPredicate:function(t){return function(n){return t(n)?[n]:[]}},getDifferenceMagma:cY,getEq:uA,getIntersectionSemigroup:cZ,getMonoid:cK,getOrd:uP,getSemigroup:cq,getShow:uE,getUnionMonoid:cG,getUnionSemigroup:cH,guard:c9,head:o7,init:sS,insertAt:sE,intercalate:sr,intersection:sQ,intersperse:sB,isEmpty:sc,isNonEmpty:rY,isOutOfBound:rJ,last:ae,lefts:sD,lookup:o8,makeBy:sl,map:cp,mapWithIndex:cy,match:sh,matchLeft:sm,matchLeftW:sm,matchRight:sg,matchRightW:sg,matchW:sh,modifyAt:sA,of:im,partition:cT,partitionMap:cO,partitionMapWithIndex:ck,partitionWithIndex:cw,prepend:rQ,prependAll:sz,prependToAll:sz,prependW:rQ,range:ie,reduce:cA,reduceRight:cL,reduceRightWithIndex:cD,reduceWithIndex:cP,replicate:sf,reverse:sP,rights:sL,rotate:sV,scanLeft:sv,scanRight:sb,separate:c_,sequence:cW,size:sx,snoc:ov,some:lc,sort:sF,sortBy:sq,spanLeft:function(t){return function(n){var r,i=sH(sO(n,t))(n);return{init:i[0],rest:i[1]}}},splitAt:sH,tail:s_,takeLeft:sT,takeLeftWhile:function(t){return function(n){for(var r=[],i=0;i<n.length;i++){var o=n[i];if(!t(o))break;r.push(o)}return r}},takeRight:sw,traverse:cF,traverseWithIndex:cU,unfold:cV,union:sJ,uniq:s$,unsafeDeleteAt:ls,unsafeInsertAt:la,unsafeUpdateAt:lu,unzip:sU,updateAt:sj,wilt:cB,wither:cz,zero:cd,zip:function t(n,r){return void 0===r?function(r){return t(r,n)}:sW(n,r,function(t,n){return[t,n]})},zipWith:sW},Symbol.toStringTag,{value:"Module"})),lm=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var lg=function(t){return"boolean"==typeof t},ly=function(t,n){return function(r){return r?n():t()}},lv={equals:function(t,n){return t===n}},lb={concat:function(t,n){return t&&n}},lx={concat:function(t,n){return t||n}},l_={concat:lb.concat,empty:!0},lS={concat:lx.concat,empty:!1},lT={equals:lv.equals,compare:function(t,n){return t<n?-1:t>n?1:0}};let lw=Object.freeze(Object.defineProperty({__proto__:null,BooleanAlgebra:{meet:function(t,n){return t&&n},join:function(t,n){return t||n},zero:!1,one:!0,implies:function(t,n){return!t||n},not:function(t){return!t}},Eq:lv,MonoidAll:l_,MonoidAny:lS,Ord:lT,SemigroupAll:lb,SemigroupAny:lx,Show:{show:function(t){return JSON.stringify(t)}},fold:ly,foldW:ly,isBoolean:lg,match:ly,matchW:ly},Symbol.toStringTag,{value:"Module"}));var lO=function(t){return{meet:function(n,r){return t.join(n,r)},join:function(n,r){return t.meet(n,r)},zero:t.one,one:t.zero,implies:function(n,r){return t.join(t.not(n),r)},not:t.not}};let lk=Object.freeze(Object.defineProperty({__proto__:null,booleanAlgebraBoolean:{meet:function(t,n){return t&&n},join:function(t,n){return t||n},zero:!1,one:!0,implies:function(t,n){return!t||n},not:function(t){return!t}},booleanAlgebraVoid:{meet:function(){},join:function(){},zero:void 0,one:void 0,implies:function(){},not:function(){}},getDualBooleanAlgebra:lO,getFunctionBooleanAlgebra:eb,reverse:lO},Symbol.toStringTag,{value:"Module"}));var lI=function(t){return tY(t)(t.bottom,t.top)},lC=function(t){var n=tD(t);return{equals:n.equals,compare:n.compare,top:t.bottom,bottom:t.top}},lM={equals:tQ.equals,compare:tQ.compare,top:1/0,bottom:-1/0};let lR=Object.freeze(Object.defineProperty({__proto__:null,boundedNumber:lM,clamp:lI,reverse:lC},Symbol.toStringTag,{value:"Module"}));function lE(t){return{meet:tG(t),join:tZ(t)}}let lj=Object.freeze(Object.defineProperty({__proto__:null,getMinMaxDistributiveLattice:lE},Symbol.toStringTag,{value:"Module"})),lN=Object.freeze(Object.defineProperty({__proto__:null,getMinMaxBoundedDistributiveLattice:function(t){var n=lE(t);return function(t,r){return{join:n.join,meet:n.meet,zero:t,one:r}}}},Symbol.toStringTag,{value:"Module"})),lA=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),lP=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),lL=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),lD=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var lF=function(t,n){for(var r=n(t);"Left"===r._tag;)r=n(r.left);return r.right};let lW=Object.freeze(Object.defineProperty({__proto__:null,tailRec:lF},Symbol.toStringTag,{value:"Module"}));function lU(t,n){return function(r,i){return n.compose(t.right(i),t.left(r))}}function lz(t,n){var r=lU(t,n);return function(i,o){return n.compose(t.promap(n.id(),function(t){return"Left"===t._tag?t.left:t.right},eO),r(i,o))}}let lB=Object.freeze(Object.defineProperty({__proto__:null,fanIn:lz,fanin:function(t){return lz(t,t)},split:lU,splitChoice:function(t){return lU(t,t)}},Symbol.toStringTag,{value:"Module"})),lV=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var l$=function(t,n){return eL(t,lq(n))},lq=function(t){return function(n){return eE(t,n)}},lK="Predicate",lH=function(){return{concat:function(t,n){return eL(t,lQ(n))}}},lG=function(){return{concat:lH().concat,empty:eC}},lZ=function(){return{concat:function(t,n){return eL(t,lX(n))}}},lY=function(){return{concat:lZ().concat,empty:eI}},lJ=function(t){return function(n){return!t(n)}},lQ=function(t){return function(n){return function(r){return n(r)||t(r)}}},lX=function(t){return function(n){return function(r){return n(r)&&t(r)}}};let l0=Object.freeze(Object.defineProperty({__proto__:null,Contravariant:{URI:lK,contramap:l$},URI:lK,and:lX,contramap:lq,getMonoidAll:lY,getMonoidAny:lG,getSemigroupAll:lZ,getSemigroupAny:lH,not:lJ,or:lQ},Symbol.toStringTag,{value:"Module"}));function l1(t){return function(n){return t(n)?e$(n):eV}}var l2=function(t){return"Right"===t._tag?eV:e$(t.left)},l3=function(t){return"Left"===t._tag?eV:e$(t.right)},l4=function(t,n){return eL(t,fd(n))},l5=function(t,n){return eL(t,fm(n))},l9=function(t,n){return eL(t,fv(n))},l6=function(t,n,r){return eL(t,fx(n,r))},l8=function(t){var n=f_(t);return function(t,r){return eL(t,n(r))}},l7=function(t,n,r){return eL(t,fS(n,r))},fe=function(t){var n=fF(t);return function(t,r){return eL(t,n(r))}},ft=function(t,n){return eL(t,fw(n))},fn=function(t,n){return eL(t,fN(n))},fr=function(t,n){return eL(t,fA(n))},fi=function(t,n){return eL(t,fC(n))},fo=function(t,n){return eL(t,fP(n))},fa=function(t,n){return eL(t,fL(n))},fu="Option",fs=function(t){return{show:function(n){return fG(n)?"none":"some(".concat(t.show(n.value),")")}}},fc=function(t){return{equals:function(n,r){return n===r||(fG(n)?fG(r):!fG(r)&&t.equals(n.value,r.value))}}},fl=function(t){return{equals:fc(t).equals,compare:function(n,r){return n===r?0:fH(n)?fH(r)?t.compare(n.value,r.value):1:-1}}},ff=function(t){return{concat:function(n,r){return fG(n)?r:fG(r)?n:e$(t.concat(n.value,r.value))},empty:eV}},fd=function(t){return function(n){return fG(n)?eV:e$(t(n.value))}},fp={URI:fu,map:l4},fh={URI:fu,of:e$},fm=function(t){return function(n){return fG(n)||fG(t)?eV:e$(n.value(t.value))}},fg={URI:fu,map:l4,ap:l5},fy={URI:fu,map:l4,ap:l5,of:e$},fv=function(t){return function(n){return fG(n)?eV:t(n.value)}},fb={URI:fu,map:l4,ap:l5,chain:l9},fx=function(t,n){return function(r){return fG(r)?t:n(t,r.value)}},f_=function(t){return function(n){return function(r){return fG(r)?t.empty:n(r.value)}}},fS=function(t,n){return function(r){return fG(r)?t:n(r.value,t)}},fT=function(t){return function(n){return fG(n)?t():n}},fw=fT,fO=function(){return eV},fk={URI:fu,zero:fO},fI=oH(fk,fh),fC=function(t){return function(n){return fG(n)?eV:e$(t(n))}},fM=fv(eO),fR=oE(eV,eV),fE=function(t){return fG(t)?fR:oE(l2(t.value),l3(t.value))},fj={URI:fu,compact:fM,separate:fE},fN=function(t){return function(n){return fG(n)?eV:t(n.value)?n:eV}},fA=function(t){return function(n){return fG(n)?eV:t(n.value)}},fP=function(t){return function(n){return oE(fn(n,lJ(t)),fn(n,t))}},fL=function(t){return eE(fd(t),fE)},fD={URI:fu,map:l4,compact:fM,separate:fE,filter:fn,filterMap:fr,partition:fo,partitionMap:fa},fF=function(t){return function(n){return function(r){return fG(r)?t.of(eV):t.map(n(r.value),e$)}}},fW=function(t){return function(n){return fG(n)?t.of(eV):t.map(n.value,e$)}},fU={URI:fu,map:l4,reduce:l6,foldMap:l8,reduceRight:l7,traverse:fe,sequence:fW},fz=o$(fU,fj),fB=oV(fU,fj),fV=function(t){var n=fz(t);return function(t){return function(r){return n(r,t)}}},f$=function(t){var n=fB(t);return function(t){return function(r){return n(r,t)}}},fq=function(){return eV},fK={URI:fu,fromEither:l3},fH=eB,fG=function(t){return"None"===t._tag},fZ=function(t,n){return function(r){return fG(r)?t():n(r.value)}},fY=function(t){return function(n){return fG(n)?t():n.value}},fJ=ti(fp),fQ=e4(fg),fX=e5(fg),f0=tf(fb),f1=fC(eO),f2=tv(fK),f3=tb(fK,fb),f4=tx(fK,fb),f5=function(t){return null==t?eV:e$(t)},f9=function(t){try{return e$(t())}catch{return eV}},f6=function(t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return f9(function(){return t.apply(void 0,n)})}},f8=function(t){return eE(t,f5)},f7=function(t){return function(n){return fG(n)?eV:f5(t(n.value))}},de=fZ(eM,eO),dt=fZ(eR,eO),dn=function(t){return function(n){return!fG(n)&&t(n.value)}},dr=e$(e0),di=to(fp),da=td(fb),du=e9(fg),ds=e$(eX),dc=function(t){return function(n){var r=t(0,eJ(n));if(fG(r))return eV;for(var i=[r.value],o=1;o<n.length;o++){var a=t(o,n[o]);if(fG(a))return eV;i.push(a.value)}return e$(i)}},dl=function(t){var n=dc(t);return function(t){return eY(t)?n(t):ds}},df=function(t){return dl(function(n,r){return t(r)})},dd=df(eO),dp={URI:fu,map:l4,of:e$,ap:l5,chain:l9,reduce:l6,foldMap:l8,reduceRight:l7,traverse:fe,sequence:fW,zero:fO,alt:ft,extend:fi,compact:fM,separate:fE,filter:fn,filterMap:fr,partition:fo,partitionMap:fa,wither:fz,wilt:fB,throwError:fq},dh=e6(fg),dm=ts(fy),dg=function(){return ff(nr())},dy=function(){return ff(ni())};let dv=Object.freeze(Object.defineProperty({__proto__:null,Alt:{URI:fu,map:l4,alt:ft},Alternative:{URI:fu,map:l4,ap:l5,of:e$,alt:ft,zero:fO},ApT:ds,Applicative:fy,Apply:fg,Chain:fb,Compactable:fj,Do:dr,Extend:{URI:fu,map:l4,extend:fi},Filterable:fD,Foldable:{URI:fu,reduce:l6,foldMap:l8,reduceRight:l7},FromEither:fK,Functor:fp,Monad:{URI:fu,map:l4,ap:l5,of:e$,chain:l9},MonadThrow:{URI:fu,map:l4,ap:l5,of:e$,chain:l9,throwError:fq},Pointed:fh,Traversable:fU,URI:fu,Witherable:{URI:fu,map:l4,reduce:l6,foldMap:l8,reduceRight:l7,traverse:fe,sequence:fW,compact:fM,separate:fE,filter:fn,filterMap:fr,partition:fo,partitionMap:fa,wither:fz,wilt:fB},Zero:fk,alt:fw,altW:fT,ap:fm,apFirst:fQ,apS:du,apSecond:fX,bind:da,bindTo:di,chain:fv,chainEitherK:f3,chainFirst:f0,chainFirstEitherK:f4,chainNullableK:f7,compact:fM,duplicate:f1,elem:function t(n){return function(r,i){if(void 0===i){var o=t(n);return function(t){return o(r,t)}}return!fG(i)&&n.equals(r,i.value)}},exists:dn,extend:fC,filter:fN,filterMap:fA,flap:fJ,flatten:fM,fold:fZ,foldMap:f_,foldW:fZ,fromEither:l3,fromEitherK:f2,fromNullable:f5,fromNullableK:f8,fromPredicate:l1,getApplyMonoid:dm,getApplySemigroup:dh,getEq:fc,getFirstMonoid:dg,getLastMonoid:dy,getLeft:l2,getMonoid:ff,getOrElse:fY,getOrElseW:fY,getOrd:fl,getRefinement:function(t){return function(n){return fH(t(n))}},getRight:l3,getShow:fs,guard:fI,isNone:fG,isSome:fH,map:fd,mapNullable:f7,match:fZ,matchW:fZ,none:eV,of:e$,option:dp,partition:fP,partitionMap:fL,reduce:fx,reduceRight:fS,separate:fE,sequence:fW,sequenceArray:dd,some:e$,throwError:fq,toNullable:de,toUndefined:dt,traverse:fF,traverseArray:df,traverseArrayWithIndex:dl,traverseReadonlyArrayWithIndex:dl,traverseReadonlyNonEmptyArrayWithIndex:dc,tryCatch:f9,tryCatchK:f6,wilt:f$,wither:fV,zero:fO},Symbol.toStringTag,{value:"Module"}));function db(t,n){return function(r){return t.map(r,n.compact)}}function dx(t,n,r){var i=db(t,n),o=tr(t,r);return function(t){return oE(i(eL(t,o(l2))),i(eL(t,o(l3))))}}let d_=Object.freeze(Object.defineProperty({__proto__:null,compact:db,getCompactableComposition:function(t,n){return{map:ta(t,n).map,compact:db(t,n),separate:dx(t,n,n)}},separate:dx},Symbol.toStringTag,{value:"Module"}));var dS=function(t){return function(){return console.log(t)}},dT=function(t){return function(){return console.warn(t)}},dw=function(t){return function(){return console.error(t)}},dO=function(t){return function(){return console.info(t)}};let dk=Object.freeze(Object.defineProperty({__proto__:null,error:dw,info:dO,log:dS,warn:dT},Symbol.toStringTag,{value:"Module"}));function dI(t){return{URI:dD,_E:void 0,map:dR,ap:function(n,r){return eO(t.concat(n,r))}}}function dC(t){var n=dI(t);return{URI:dD,_E:void 0,map:n.map,ap:n.ap,of:function(){return eO(t.empty)}}}var dM=function(t,n){return eL(t,dN())},dR=function(t,n){return eL(t,dA())},dE=function(t,n,r){return eL(t,dP(n))},dj=function(t,n){return eL(t,dL(n))},dN=function(){return eO},dA=function(){return eO},dP=function(t){return function(n){return eO(t(n))}},dL=function(t){return function(n){return eO(t(n))}},dD="Const",dF={URI:dD,map:dR},dW=ti(dF);let dU=Object.freeze(Object.defineProperty({__proto__:null,Bifunctor:{URI:dD,bimap:dE,mapLeft:dj},Contravariant:{URI:dD,contramap:dM},Functor:dF,URI:dD,bimap:dP,const_:{URI:dD,map:dR,contramap:dM,bimap:dE,mapLeft:dj},contramap:dN,flap:dW,getApplicative:dC,getApply:dI,getBooleanAlgebra:eO,getBounded:eO,getEq:eO,getHeytingAlgebra:eO,getMonoid:eO,getOrd:eO,getRing:eO,getSemigroup:eO,getSemiring:eO,getShow:function(t){return{show:function(n){return"make(".concat(t.show(n),")")}}},make:eO,map:dA,mapLeft:dL},Symbol.toStringTag,{value:"Module"})),dz=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var dB=eL(oS,tF(function(t){return t.valueOf()})),dV=function(){return new Date},d$=function(){return new Date().getTime()};let dq=Object.freeze(Object.defineProperty({__proto__:null,Eq:{equals:function(t,n){return t.valueOf()===n.valueOf()}},Ord:dB,create:dV,eqDate:{equals:function(t,n){return t.getDate()===n.getDate()}},eqMonth:{equals:function(t,n){return t.getMonth()===n.getMonth()}},eqYear:{equals:function(t,n){return t.getFullYear()===n.getFullYear()}},now:d$},Symbol.toStringTag,{value:"Module"}));var dK=function(t,n){return eL(t,pr(n))},dH=function(t,n){return eL(t,pu(n))},dG=function(t,n){return eL(t,pf(n))},dZ=function(t,n,r){return eL(t,pp(n,r))},dY=function(t){return function(n,r){var i=ph(t);return eL(n,i(r))}},dJ=function(t,n,r){return eL(t,pm(n,r))},dQ=function(t){var n=pg(t);return function(t,r){return eL(t,n(r))}},dX=function(t,n,r){return eL(t,pb(n,r))},d0=function(t,n){return eL(t,px(n))},d1=function(t,n){return eL(t,pS(n))},d2=function(t,n){return eL(t,pT(n))},d3=function(t,n){return lF(n(t),function(t){return pI(t)?eG(eH(t.left)):pI(t.right)?eH(n(t.right.left)):eG(eG(t.right.right))})},d4="Either",d5=function(t,n){return{show:function(r){return pI(r)?"left(".concat(t.show(r.left),")"):"right(".concat(n.show(r.right),")")}}},d9=function(t,n){return{equals:function(r,i){return r===i||(pI(r)?pI(i)&&t.equals(r.left,i.left):pC(i)&&n.equals(r.right,i.right))}}},d6=function(t){return{concat:function(n,r){return pI(r)?n:pI(n)?r:eG(t.concat(n.right,r.right))}}},d8=function(t){var n=eH(t.empty);return{URI:d4,_E:void 0,compact:function(t){return pI(t)?t:"None"===t.right._tag?n:eG(t.right.value)},separate:function(t){return pI(t)?oE(t,t):pI(t.right)?oE(eG(t.right.left),n):oE(n,eG(t.right.right))}}},d7=function(t){var n,r=eH(t.empty),i=d8(t),o=i.compact;return{URI:d4,_E:void 0,map:dK,compact:o,separate:i.separate,filter:function(t,n){return pI(t)||n(t.right)?t:r},filterMap:function(t,n){if(pI(t))return t;var i=n(t.right);return"None"===i._tag?r:eG(i.value)},partition:function(t,n){return pI(t)?oE(t,t):n(t.right)?oE(r,eG(t.right)):oE(eG(t.right),r)},partitionMap:function(t,n){if(pI(t))return oE(t,t);var i=n(t.right);return pI(i)?oE(eG(i.left),r):oE(r,eG(i.right))}}},pe=function(t){var n=d7(t),r=d8(t);return{URI:d4,_E:void 0,map:dK,compact:n.compact,separate:n.separate,filter:n.filter,filterMap:n.filterMap,partition:n.partition,partitionMap:n.partitionMap,traverse:dQ,sequence:py,reduce:dZ,foldMap:dY,reduceRight:dJ,wither:o$(pv,r),wilt:oV(pv,r)}},pt=function(t){return{URI:d4,_E:void 0,map:dK,ap:function(n,r){return pI(n)?pI(r)?eH(t.concat(n.left,r.left)):n:pI(r)?r:eG(n.right(r.right))},of:po}},pn=function(t){return{URI:d4,_E:void 0,map:dK,alt:function(n,r){if(pC(n))return n;var i=r();return pI(i)?eH(t.concat(n.left,i.left)):i}}},pr=function(t){return function(n){return pI(n)?n:eG(t(n.right))}},pi={URI:d4,map:dK},po=eG,pa=function(t){return function(n){return pI(n)?n:pI(t)?t:eG(n.right(t.right))}},pu=pa,ps={URI:d4,map:dK,ap:dH},pc={URI:d4,map:dK,ap:dH,of:po},pl=function(t){return function(n){return pI(n)?n:t(n.right)}},pf=pl,pd={URI:d4,map:dK,ap:dH,chain:dG},pp=function(t,n){return function(r){return pI(r)?t:n(t,r.right)}},ph=function(t){return function(n){return function(r){return pI(r)?t.empty:n(r.right)}}},pm=function(t,n){return function(r){return pI(r)?t:n(r.right,t)}},pg=function(t){return function(n){return function(r){return pI(r)?t.of(eH(r.left)):t.map(n(r.right),eG)}}},py=function(t){return function(n){return pI(n)?t.of(eH(n.left)):t.map(n.right,eG)}},pv={URI:d4,map:dK,reduce:dZ,foldMap:dY,reduceRight:dJ,traverse:dQ,sequence:py},pb=function(t,n){return function(r){return pI(r)?eH(t(r.left)):eG(n(r.right))}},px=function(t){return function(n){return pI(n)?eH(t(n.left)):n}},p_=function(t){return function(n){return pI(n)?t():n}},pS=p_,pT=function(t){return function(n){return pI(n)?n:eG(t(n))}},pw={URI:d4,fromEither:eO},pO=tm(pw),pk=th(pw),pI=eq,pC=eK,pM=function(t,n){return function(r){return pI(r)?t(r.left):n(r.right)}},pR=function(t){return function(n){return pI(n)?t(n.left):n.right}},pE=ti(pi),pj=e4(ps),pN=e5(ps),pA=tf(pd),pP=pl(eO),pL=pT(eO),pD=tg(pw),pF=ty(pw,pd),pW=t_(pw,pd),pU=function(t){return pI(t)?eG(t.left):eH(t.right)},pz=function(t){return function(n){return pI(n)?t(n.left):n}},pB=function(t){return function(n){return null==n?eH(t):eG(n)}},pV=function(t,n){try{return eG(t())}catch(r){return eH(n(r))}},p$=function(t,n){return function(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];return pV(function(){return t.apply(void 0,r)},n)}},pq=function(t){var n=pB(t);return function(t){return eE(t,n)}},pK=function(t){var n=pq(t);return function(t){return pf(n(t))}},pH=pM(eO,eO),pG=function(t){return function(n){return!pI(n)&&t(n.right)}},pZ=po(e0),pY=to(pi),pJ=td(pd),pQ=e9(ps),pX=po(eX),p0=function(t){return function(n){var r=t(0,eJ(n));if(pI(r))return r;for(var i=[r.right],o=1;o<n.length;o++){var a=t(o,n[o]);if(pI(a))return a;i.push(a.right)}return eG(i)}},p1=function(t){var n=p0(t);return function(t){return eY(t)?n(t):pX}},p2=function(t){return p1(function(n,r){return t(r)})},p3=p2(eO),p4=function(t,n){return pV(function(){var n=JSON.stringify(t);if("string"!=typeof n)throw Error("Converting unsupported structure to JSON");return n},n)},p5=e6(ps),p9=ts(pc),p6=function(t,n){return e6(pt(t))(n)},p8=function(t,n){return ts(pt(t))(n)};let p7=Object.freeze(Object.defineProperty({__proto__:null,Alt:{URI:d4,map:dK,alt:d1},ApT:pX,Applicative:pc,Apply:ps,Bifunctor:{URI:d4,bimap:dX,mapLeft:d0},Chain:pd,ChainRec:{URI:d4,map:dK,ap:dH,chain:dG,chainRec:d3},Do:pZ,Extend:{URI:d4,map:dK,extend:d2},Foldable:{URI:d4,reduce:dZ,foldMap:dY,reduceRight:dJ},FromEither:pw,Functor:pi,Monad:{URI:d4,map:dK,ap:dH,of:po,chain:dG},MonadThrow:{URI:d4,map:dK,ap:dH,of:po,chain:dG,throwError:eH},Pointed:{URI:d4,of:po},Traversable:pv,URI:d4,alt:pS,altW:p_,ap:pu,apFirst:pj,apFirstW:pj,apS:pQ,apSW:pQ,apSecond:pN,apSecondW:pN,apW:pa,bimap:pb,bind:pJ,bindTo:pY,bindW:pJ,chain:pf,chainFirst:pA,chainFirstW:pA,chainNullableK:pK,chainOptionK:pF,chainW:pl,duplicate:pL,either:{URI:d4,map:dK,of:po,ap:dH,chain:dG,reduce:dZ,foldMap:dY,reduceRight:dJ,traverse:dQ,sequence:py,bimap:dX,mapLeft:d0,alt:d1,extend:d2,chainRec:d3,throwError:eH},elem:function t(n){return function(r,i){if(void 0===i){var o=t(n);return function(t){return o(r,t)}}return!pI(i)&&n.equals(r,i.right)}},exists:pG,extend:pT,filterOrElse:pW,filterOrElseW:pW,flap:pE,flatten:pP,flattenW:pP,fold:pM,foldMap:ph,foldW:pM,fromNullable:pB,fromNullableK:pq,fromOption:pk,fromOptionK:pD,fromPredicate:pO,getAltValidation:pn,getApplicativeValidation:pt,getApplyMonoid:p9,getApplySemigroup:p5,getCompactable:d8,getEq:d9,getFilterable:d7,getOrElse:pR,getOrElseW:pR,getSemigroup:d6,getShow:d5,getValidation:function(t){var n=pt(t).ap,r=pn(t).alt;return{URI:d4,_E:void 0,map:dK,of:po,chain:dG,bimap:dX,mapLeft:d0,reduce:dZ,foldMap:dY,reduceRight:dJ,extend:d2,traverse:dQ,sequence:py,chainRec:d3,throwError:eH,ap:n,alt:r}},getValidationMonoid:p8,getValidationSemigroup:p6,getWitherable:pe,isLeft:pI,isRight:pC,left:eH,map:pr,mapLeft:px,match:pM,matchW:pM,of:po,orElse:pz,orElseW:pz,parseJSON:function(t,n){return pV(function(){return JSON.parse(t)},n)},reduce:pp,reduceRight:pm,right:eG,sequence:py,sequenceArray:p3,stringifyJSON:p4,swap:pU,throwError:eH,toError:function(t){return t instanceof Error?t:Error(String(t))},toUnion:pH,traverse:pg,traverseArray:p2,traverseArrayWithIndex:p1,traverseReadonlyArrayWithIndex:p1,traverseReadonlyNonEmptyArrayWithIndex:p0,tryCatch:pV,tryCatchK:p$},Symbol.toStringTag,{value:"Module"}));function he(t){return eE(eG,t.of)}function ht(t){return eE(eH,t.of)}function hn(t){return function(n){return t.map(n,eG)}}function hr(t){return function(n){return t.map(n,eH)}}function hi(t){return function(n){return eE(pB(n),t.of)}}function ho(t){var n=hi(t);return function(t){var r=n(t);return function(t){return eE(t,r)}}}function ha(t){var n=hc(t),r=ho(t);return function(t){var i=r(t);return function(t){return n(i(t))}}}function hu(t){return tr(t,pi)}function hs(t){return e3(t,ps)}function hc(t){return function(n){return function(r){return t.chain(r,function(r){return pI(r)?t.of(r):n(r.right)})}}}function hl(t){return function(n){return function(r){return t.chain(r,function(r){return pI(r)?n():t.of(r)})}}}function hf(t){return function(n,r){return function(i){return t.map(i,pb(n,r))}}}function hd(t){return function(n){return function(r){return t.map(r,px(n))}}}function hp(t,n){return function(r){return function(i){return t.chain(i,pM(function(i){return t.map(r(),px(function(t){return n.concat(i,t)}))},he(t)))}}}function hh(t){return function(n,r){return function(i){return t.map(i,pM(n,r))}}}function hm(t){return function(n,r){return function(i){return t.chain(i,pM(n,r))}}}function hg(t){return function(n){return function(r){return t.chain(r,pM(n,t.of))}}}function hy(t){return function(n){return function(r){return t.chain(r,function(r){return pI(r)?n(r.left):t.of(r)})}}}function hv(t){var n=hy(t);return function(r){return n(function(n){return t.map(r(n),function(t){return pI(t)?t:eH(n)})})}}function hb(t){return function(n){return function(r){return t.chain(r,pM(function(r){return t.map(n(r),eH)},function(n){return t.of(eG(n))}))}}}function hx(t){return function(n){return t.map(n,pU)}}function h_(t){return function(n){return t.map(n,pH)}}let hS=Object.freeze(Object.defineProperty({__proto__:null,alt:hl,altValidation:hp,ap:hs,bimap:hf,chain:hc,chainNullableK:ha,fromNullable:hi,fromNullableK:ho,getEitherM:function(t){var n=hs(t),r=hu(t),i=hc(t),o=hl(t),a=hf(t),u=hd(t),s=hm(t),c=hg(t),l=hy(t);return{map:function(t,n){return eL(t,r(n))},ap:function(t,r){return eL(t,n(r))},of:he(t),chain:function(t,n){return eL(t,i(n))},alt:function(t,n){return eL(t,o(n))},bimap:function(t,n,r){return eL(t,a(n,r))},mapLeft:function(t,n){return eL(t,u(n))},fold:function(t,n,r){return eL(t,s(n,r))},getOrElse:function(t,n){return eL(t,c(n))},orElse:function(t,n){return eL(t,l(n))},swap:hx(t),rightM:hn(t),leftM:hr(t),left:ht(t)}},getOrElse:hg,left:ht,leftF:hr,map:hu,mapLeft:hd,match:hh,matchE:hm,orElse:hy,orElseFirst:hv,orLeft:hb,right:he,rightF:hn,swap:hx,toUnion:h_},Symbol.toStringTag,{value:"Module"}));var hT=function(){return{concat:function(t,n){return eE(t,n)}}},hw=function(){return{concat:hT().concat,empty:eO}};let hO=Object.freeze(Object.defineProperty({__proto__:null,URI:"Endomorphism",getMonoid:hw,getSemigroup:hT},Symbol.toStringTag,{value:"Module"})),hk=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));function hI(t,n){var r=n.zero,i=function(o,a){return t.equals(a,r)?o:i(a,n.mod(o,a))};return i}let hC=Object.freeze(Object.defineProperty({__proto__:null,fieldNumber:{add:function(t,n){return t+n},zero:0,mul:function(t,n){return t*n},one:1,sub:function(t,n){return t-n},degree:function(t){return 1},div:function(t,n){return t/n},mod:function(t,n){return t%n}},gcd:hI,lcm:function(t,n){var r=n.zero,i=hI(t,n);return function(o,a){return t.equals(o,r)||t.equals(a,r)?r:n.div(n.mul(o,a),i(o,a))}}},Symbol.toStringTag,{value:"Module"}));function hM(t,n){return function(r){return function(i){return t.map(i,function(t){return n.filter(t,r)})}}}function hR(t,n){return function(r){return function(i){return t.map(i,function(t){return n.filterMap(t,r)})}}}function hE(t,n){var r=hM(t,n);return function(t){var n=r(lJ(t)),i=r(t);return function(t){return oE(n(t),i(t))}}}function hj(t,n){var r=hR(t,n);return function(t){return function(n){return oE(eL(n,r(function(n){return l2(t(n))})),eL(n,r(function(n){return l3(t(n))})))}}}let hN=Object.freeze(Object.defineProperty({__proto__:null,filter:hM,filterMap:hR,getFilterableComposition:function(t,n){var r=ta(t,n).map,i=db(t,n),o=dx(t,n,n),a=hM(t,n),u=hR(t,n),s=hE(t,n),c=hj(t,n);return{map:r,compact:i,separate:o,filter:function(t,n){return eL(t,a(n))},filterMap:function(t,n){return eL(t,u(n))},partition:function(t,n){return eL(t,s(n))},partitionMap:function(t,n){return eL(t,c(n))}}},partition:hE,partitionMap:hj},Symbol.toStringTag,{value:"Module"})),hA=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));function hP(t,n){return function(r,i){return function(o){return t.reduce(o,r,function(t,r){return n.reduce(r,t,i)})}}}function hL(t,n){return function(r){var i=t.foldMap(r),o=n.foldMap(r);return function(t){return function(n){return i(n,function(n){return o(n,t)})}}}}function hD(t,n){return function(r,i){return function(o){return t.reduceRight(o,r,function(t,r){return n.reduceRight(t,r,i)})}}}function hF(t){return function(n){return t.reduce(n,[],function(t,n){return t.push(n),t})}}function hW(t,n){var r=hP(t,n),i=hL(t,n),o=hD(t,n);return{reduce:function(t,n,i){return eL(t,r(n,i))},foldMap:function(t){var n=i(t);return function(t,r){return eL(t,n(r))}},reduceRight:function(t,n,r){return eL(t,o(n,r))}}}let hU=Object.freeze(Object.defineProperty({__proto__:null,foldM:function(t,n){return function(r,i,o){return n.reduce(r,t.of(i),function(n,r){return t.chain(n,function(t){return o(t,r)})})}},foldMap:hL,getFoldableComposition:hW,intercalate:function(t,n){return function(r,i){var o=function(n,i){var o=n.init,a=n.acc;return o?{init:!1,acc:i}:{init:!1,acc:t.concat(t.concat(a,r),i)}};return n.reduce(i,{init:!0,acc:t.empty},o).acc}},reduce:hP,reduceM:function(t,n){return function(r,i){return function(o){return n.reduce(o,t.of(r),function(n,r){return t.chain(n,function(t){return i(t,r)})})}}},reduceRight:hD,toArray:hF,toReadonlyArray:hF,traverse_:function(t,n){var r=t.of(void 0);return function(i,o){return n.reduce(i,r,function(n,r){var i,a;return a=o(r),t.ap(t.map(n,ek),a)})}}},Symbol.toStringTag,{value:"Module"}));function hz(t,n){return function(r,i){return function(o){return t.reduceWithIndex(o,r,function(t,r,o){return n.reduceWithIndex(o,r,function(n,r,o){return i([t,n],r,o)})})}}}function hB(t,n){return function(r){var i=t.foldMapWithIndex(r),o=n.foldMapWithIndex(r);return function(t){return function(n){return i(n,function(n,r){return o(r,function(r,i){return t([n,r],i)})})}}}}function hV(t,n){return function(r,i){return function(o){return t.reduceRightWithIndex(o,r,function(t,r,o){return n.reduceRightWithIndex(r,o,function(n,r,o){return i([t,n],r,o)})})}}}let h$=Object.freeze(Object.defineProperty({__proto__:null,foldMapWithIndex:hB,getFoldableWithIndexComposition:function(t,n){var r=hW(t,n),i=hz(t,n),o=hB(t,n),a=hV(t,n);return{reduce:r.reduce,foldMap:r.foldMap,reduceRight:r.reduceRight,reduceWithIndex:function(t,n,r){return eL(t,i(n,r))},foldMapWithIndex:function(t){var n=o(t);return function(t,r){return eL(t,n(r))}},reduceRightWithIndex:function(t,n,r){return eL(t,a(n,r))}}},reduceRightWithIndex:hV,reduceWithIndex:hz},Symbol.toStringTag,{value:"Module"}));function hq(t){return function(n){return eE(n,t.fromIO)}}function hK(t,n){return function(r){var i=eE(r,t.fromIO);return function(t){return n.chain(t,i)}}}function hH(t,n){var r=tf(n);return function(n){return r(eE(n,t.fromIO))}}let hG=Object.freeze(Object.defineProperty({__proto__:null,chainFirstIOK:hH,chainIOK:hK,fromIOK:hq},Symbol.toStringTag,{value:"Module"}));var hZ=function(){return eO},hY=function(t){return function(n){return function(r){return n(t(r))}}},hJ=function(t){return function(n){return t(n)(n)}},hQ=function(t,n){return eL(t,h3(n))},hX=function(t,n){return eL(t,h5(n))},h0=function(t,n){return eL(t,h6(n))},h1=function(t,n){return eL(t,h7(n))},h2=function(t,n,r){return eL(t,me(n,r))},h3=function(t){return function(n){return function(r){return t(n(r))}}},h4=function(t){return function(n){return function(r){return n(r)(t(r))}}},h5=h4,h9=function(t){return function(n){return function(r){return t(n(r))(r)}}},h6=h9,h8=h9(eO),h7=function(t){return function(n){return eE(t,n)}},me=function(t,n){return function(r){return function(i){return n(r(t(i)))}}},mt=function(){return eO},mn=function(t){return function(n){var r=n[0],i=n[1];return[t(r),i]}},mr=function(t){return function(n){var r;return[n[0],t(n[1])]}},mi=function(t){return pM(function(n){return eH(t(n))},eG)},mo=function(t){return pM(eH,function(n){return eG(t(n))})},ma="Reader",mu={URI:ma,map:hQ},ms=ti(mu),mc={URI:ma,of:ek},ml={URI:ma,map:hQ,ap:hX},mf=e4(ml),md=e5(ml),mp={URI:ma,map:hQ,ap:hX,of:ek},mh={URI:ma,map:hQ,ap:hX,chain:h0},mm={URI:ma,map:hQ,of:ek,ap:hX,chain:h0},mg=tf(mh),my=to(mu),mv=td(mh),mb=ek(e0),mx=e9(ml),m_=ek(eX),mS=function(t){return function(n){return function(r){for(var i=[t(0,eJ(n))(r)],o=1;o<n.length;o++)i.push(t(o,n[o])(r));return i}}},mT=function(t){var n=mS(t);return function(t){return eY(t)?n(t):m_}},mw=function(t){return mT(function(n,r){return t(r)})},mO=mw(eO),mk=e6(ml),mI=ts(mp);let mC=Object.freeze(Object.defineProperty({__proto__:null,ApT:m_,Applicative:mp,Apply:ml,Category:{URI:ma,compose:h1,id:mt},Chain:mh,Choice:{URI:ma,map:hQ,promap:h2,left:mi,right:mo},Do:mb,Functor:mu,Monad:mm,Pointed:mc,Profunctor:{URI:ma,map:hQ,promap:h2},Strong:{URI:ma,map:hQ,promap:h2,first:mn,second:mr},URI:ma,ap:h5,apFirst:mf,apFirstW:mf,apS:mx,apSW:mx,apSecond:md,apSecondW:md,apW:h4,ask:hZ,asks:eO,asksReader:hJ,asksReaderW:hJ,bind:mv,bindTo:my,bindW:mv,chain:h6,chainFirst:mg,chainFirstW:mg,chainW:h9,compose:h7,first:mn,flap:ms,flatten:h8,flattenW:h8,getMonoid:mI,getSemigroup:mk,id:mt,left:mi,local:hY,map:h3,of:ek,promap:me,reader:{URI:ma,map:hQ,of:ek,ap:hX,chain:h0,promap:h2,compose:h1,id:mt,first:mn,second:mr,left:mi,right:mo},right:mo,second:mr,sequenceArray:mO,traverseArray:mw,traverseArrayWithIndex:mT,traverseReadonlyArrayWithIndex:mT,traverseReadonlyNonEmptyArrayWithIndex:mS},Symbol.toStringTag,{value:"Module"}));function mM(t){return function(){return t.fromReader(hZ())}}function mR(t){return t.fromReader}function mE(t){return function(n){return eE(n,t.fromReader)}}function mj(t,n){var r=mE(t);return function(t){return function(i){return n.chain(i,r(t))}}}function mN(t,n){return eE(mE(t),tf(n))}let mA=Object.freeze(Object.defineProperty({__proto__:null,ask:mM,asks:mR,chainFirstReaderK:mN,chainReaderK:mj,fromReaderK:mE},Symbol.toStringTag,{value:"Module"}));var mP=function(){return function(t){return[t,t]}},mL=function(t){return function(){return[void 0,t]}},mD=function(t){return function(n){return[void 0,t(n)]}},mF=function(t){return function(n){return[t(n),n]}},mW=function(t,n){return eL(t,mB(n))},mU=function(t,n){return eL(t,mV(n))},mz=function(t,n){return eL(t,mq(n))},mB=function(t){return function(n){return function(r){var i=n(r),o=i[0],a=i[1];return[t(o),a]}}},mV=function(t){return function(n){return function(r){var i=n(r),o=i[0],a=t(i[1]),u=a[0],s=a[1];return[o(u),s]}}},m$=function(t){return function(n){return[t,n]}},mq=function(t){return function(n){return function(r){var i=n(r),o=i[0],a=i[1];return t(o)(a)}}},mK=mq(eO),mH="State",mG={URI:mH,map:mW},mZ=ti(mG),mY={URI:mH,map:mW,ap:mU},mJ=e4(mY),mQ=e5(mY),mX={URI:mH,map:mW,ap:mU,chain:mz},m0={URI:mH,map:mW,ap:mU,of:m$,chain:mz},m1=tf(mX),m2=function(t){return function(n){return n(t)[0]}},m3=function(t){return function(n){return n(t)[1]}},m4=to(mG),m5=td(mX),m9=e9(mY),m6=function(t){return function(n){return function(r){for(var i=t(0,eJ(n))(r),o=i[0],a=i[1],u=[o],s=a,c=1;c<n.length;c++){var l=t(c,n[c])(s),f=l[0],d=l[1];u.push(f),s=d}return[u,s]}}},m8=function(t){var n=m6(t);return function(t){return eY(t)?n(t):m$(eX)}},m7=function(t){return m8(function(n,r){return t(r)})},ge=m7(eO),gt=function(t,n){return t(n)[0]},gn=function(t,n){return t(n)[1]};let gr=Object.freeze(Object.defineProperty({__proto__:null,Applicative:{URI:mH,map:mW,ap:mU,of:m$},Apply:mY,Chain:mX,FromState:{URI:mH,fromState:eO},Functor:mG,Monad:m0,Pointed:{URI:mH,of:m$},URI:mH,ap:mV,apFirst:mJ,apS:m9,apSecond:mQ,bind:m5,bindTo:m4,chain:mq,chainFirst:m1,evalState:gt,evaluate:m2,execState:gn,execute:m3,flap:mZ,flatten:mK,get:mP,gets:mF,map:mB,modify:mD,of:m$,put:mL,sequenceArray:ge,state:m0,traverseArray:m7,traverseArrayWithIndex:m8,traverseReadonlyArrayWithIndex:m8,traverseReadonlyNonEmptyArrayWithIndex:m6},Symbol.toStringTag,{value:"Module"}));function gi(t){return function(){return t.fromState(mP())}}function go(t){return function(n){return t.fromState(mL(n))}}function ga(t){return eE(mD,t.fromState)}function gu(t){return eE(mF,t.fromState)}function gs(t){return function(n){return eE(n,t.fromState)}}function gc(t,n){var r=gs(t);return function(t){return function(i){return n.chain(i,r(t))}}}let gl=Object.freeze(Object.defineProperty({__proto__:null,chainStateK:gc,fromStateK:gs,get:gi,gets:gu,modify:ga,put:go},Symbol.toStringTag,{value:"Module"}));function gf(t){return function(n){return eE(n,t.fromTask)}}function gd(t,n){return function(r){var i=eE(r,t.fromTask);return function(t){return n.chain(t,i)}}}function gp(t,n){var r=tf(n);return function(n){return r(eE(n,t.fromTask))}}let gh=Object.freeze(Object.defineProperty({__proto__:null,chainFirstTaskK:gp,chainTaskK:gd,fromTaskK:gf},Symbol.toStringTag,{value:"Module"}));function gm(t){return function(n){return eE(n,t.fromThese)}}let gg=Object.freeze(Object.defineProperty({__proto__:null,fromTheseK:gm},Symbol.toStringTag,{value:"Module"}));function gy(t,n){return function(r){return function(i){return t.mapWithIndex(i,function(t,i){return n.mapWithIndex(i,function(n,i){return r([t,n],i)})})}}}let gv=Object.freeze(Object.defineProperty({__proto__:null,getFunctorWithIndexComposition:function(t,n){var r=ta(t,n).map,i=gy(t,n);return{map:r,mapWithIndex:function(t,n){return eL(t,i(n))}}},mapWithIndex:gy},Symbol.toStringTag,{value:"Module"})),gb=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),gx=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),g_=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var gS=function(t,n){return eL(t,gE(n))},gT=function(t,n){return eL(t,gj(n))},gw=function(t,n){return eL(t,gN(n))},gO=function(t,n,r){return eL(t,gD(n,r))},gk=function(t){return function(t,n){return eL(t,gF()(n))}},gI=function(t,n,r){return eL(t,gW(n,r))},gC=function(t,n){return eL(t,gV())},gM=function(t,n){return eL(t,gA(n))},gR=function(t){var n=gU(t);return function(t,r){return eL(t,n(r))}},gE=function(t){return function(n){return t(n)}},gj=function(t){return function(n){return n(t)}},gN=function(t){return function(n){return t(n)}},gA=function(t){return function(n){return t(n)}},gP=gA(eO),gL=gN(eO),gD=function(t,n){return function(r){return n(t,r)}},gF=function(){return function(t){return function(n){return t(n)}}},gW=function(t,n){return function(r){return n(r,t)}},gU=function(t){return function(n){return function(r){return t.map(n(r),eO)}}},gz=function(t){return function(n){return t.map(n,eO)}},gB=function(){return eO},gV=gB,g$="Identity",gq={URI:g$,map:gS},gK=ti(gq),gH={URI:g$,map:gS,ap:gT},gG=e4(gH),gZ=e5(gH),gY={URI:g$,map:gS,ap:gT,chain:gw},gJ=tf(gY),gQ=eO(e0),gX=to(gq),g0=td(gY),g1=e9(gH);let g2=Object.freeze(Object.defineProperty({__proto__:null,Alt:{URI:g$,map:gS,alt:gC},Applicative:{URI:g$,map:gS,ap:gT,of:eO},Apply:gH,Chain:gY,ChainRec:{URI:g$,map:gS,ap:gT,chain:gw,chainRec:lF},Comonad:{URI:g$,map:gS,extend:gM,extract:eO},Do:gQ,Foldable:{URI:g$,reduce:gO,foldMap:gk,reduceRight:gI},Functor:gq,Monad:{URI:g$,map:gS,ap:gT,of:eO,chain:gw},Pointed:{URI:g$,of:eO},Traversable:{URI:g$,map:gS,reduce:gO,foldMap:gk,reduceRight:gI,traverse:gR,sequence:gz},URI:g$,alt:gV,altW:gB,ap:gj,apFirst:gG,apS:g1,apSecond:gZ,bind:g0,bindTo:gX,chain:gN,chainFirst:gJ,duplicate:gP,extend:gA,extract:eO,flap:gK,flatten:gL,foldMap:gF,getEq:eO,getShow:eO,identity:{URI:g$,map:gS,ap:gT,of:eO,chain:gw,reduce:gO,foldMap:gk,reduceRight:gI,traverse:gR,sequence:gz,alt:gC,extract:eO,extend:gM,chainRec:lF},map:gE,of:eO,reduce:gD,reduceRight:gW,sequence:gz,traverse:gU},Symbol.toStringTag,{value:"Module"})),g3=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var g4=function(t,n){return function(){return n(t())}},g5=function(t,n){return function(){return t()(n())}},g9=function(t,n){return function(){return n(t())()}},g6=function(t,n){return function(){for(var r=n(t)();"Left"===r._tag;)r=n(r.left)();return r.right}},g8=function(t){return function(n){return g4(n,t)}},g7=function(t){return function(n){return g5(n,t)}},ye=function(t){return function(n){return g9(n,t)}},yt=ye(eO),yn={URI:"IO",map:g4},yr=ti(yn),yi={URI:"IO",of:ek},yo={URI:"IO",map:g4,ap:g5},ya=e4(yo),yu=e5(yo),ys={URI:"IO",map:g4,ap:g5,of:ek},yc={URI:"IO",map:g4,ap:g5,chain:g9},yl={URI:"IO",map:g4,ap:g5,of:ek,chain:g9},yf=tf(yc),yd=ek(e0),yp=to(yn),yh=td(yc),ym=e9(yo),yg=ek(eX),yy=function(t){return function(n){return function(){for(var r=[t(0,eJ(n))()],i=1;i<n.length;i++)r.push(t(i,n[i])());return r}}},yv=function(t){var n=yy(t);return function(t){return eY(t)?n(t):yg}},yb=function(t){return yv(function(n,r){return t(r)})},yx=yb(eO),y_=e6(yo),yS=ts(ys);let yT=Object.freeze(Object.defineProperty({__proto__:null,ApT:yg,Applicative:ys,Apply:yo,Chain:yc,ChainRec:{URI:"IO",map:g4,ap:g5,chain:g9,chainRec:g6},Do:yd,FromIO:{URI:"IO",fromIO:eO},Functor:yn,Monad:yl,MonadIO:{URI:"IO",map:g4,ap:g5,of:ek,chain:g9,fromIO:eO},Pointed:yi,URI:"IO",ap:g7,apFirst:ya,apS:ym,apSecond:yu,bind:yh,bindTo:yp,chain:ye,chainFirst:yf,flap:yr,flatten:yt,fromIO:eO,getMonoid:yS,getSemigroup:y_,io:{URI:"IO",map:g4,of:ek,ap:g5,chain:g9,fromIO:eO,chainRec:g6},map:g8,of:ek,sequenceArray:yx,traverseArray:yb,traverseArrayWithIndex:yv,traverseReadonlyArrayWithIndex:yv,traverseReadonlyNonEmptyArrayWithIndex:yy},Symbol.toStringTag,{value:"Module"}));var yw=ht(yi),yO=he(yi),yk=hn(yn),yI=hr(yn),yC=hh(yn),yM=hm(yl),yR=hg(yl),yE=function(t,n){return function(){return pV(t,n)}},yj=function(t,n){return function(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];return yE(function(){return t.apply(void 0,r)},n)}},yN=h_(yn),yA=hy(yl),yP=hv(yl),yL=function(t){return yP(vn(t))},yD=hb(yl),yF=hx(yn),yW=function(t,n){return eL(t,yK(n))},yU=function(t,n){return eL(t,yZ(n))},yz=function(t,n){return eL(t,yY(function(t){return eL(n,yK(t))}))},yB=function(t,n){return eL(t,yY(n))},yV=function(t,n,r){return eL(t,yH(n,r))},y$=function(t,n){return eL(t,yG(n))},yq=function(t,n){return eL(t,yQ(n))},yK=hu(yn),yH=hf(yn),yG=hd(yn),yZ=hs(yo),yY=hc(yl),yJ=yY(eO),yQ=hl(yl),yX="IOEither";function y0(t){var n=e3(yo,pt(t));return{URI:yX,_E:void 0,map:yW,ap:function(t,r){return eL(t,n(r))},of:yO}}function y1(t){var n=hp(yl,t);return{URI:yX,_E:void 0,map:yW,alt:function(t,r){return eL(t,n(r))}}}var y2=function(t){var n=d8(t);return{URI:yX,_E:void 0,compact:db(yn,n),separate:dx(yn,n,pi)}},y3={URI:yX,map:yW},y4=ti(y3),y5={URI:yX,map:yW,ap:yU},y9=e4(y5),y6=e5(y5),y8={URI:yX,map:yW,ap:yU,of:yO},y7={URI:yX,map:yW,ap:yU,chain:yB},ve=tf(y7),vt={URI:yX,fromIO:yk},vn=hq(vt),vr=hK(vt,y7),vi=hH(vt,y7),vo={URI:yX,fromEither:ek},va=th(vo),vu=tg(vo),vs=ty(vo,y7),vc=tb(vo,y7),vl=tx(vo,y7),vf=tm(vo),vd=t_(vo,y7),vp=tv(vo),vh=function(t,n,r){return vm(t,n,r)},vm=function(t,n,r){return eL(t,yY(function(t){return eL(n(t),ye(function(n){return eL(r(t,n),yY(function(){return ek(n)}))}))}))},vg=yO(e0),vy=to(y3),vv=td(y7),vb=e9(y5),vx=yO(eX),v_=function(t){return eE(yy(t),g8(p0(eD)))},vS=function(t){var n=v_(t);return function(t){return eY(t)?n(t):vx}},vT=function(t){return function(n){return function(){var r=t(0,eJ(n))();if(eq(r))return r;for(var i=[r.right],o=1;o<n.length;o++){var a=t(o,n[o])();if(eq(a))return a;i.push(a.right)}return eG(i)}}},vw=function(t){var n=vT(t);return function(t){return eY(t)?n(t):vx}},vO=function(t){return vS(function(n,r){return t(r)})},vk=vO(eO),vI=function(t){return vw(function(n,r){return t(r)})},vC=vI(eO),vM=e6(y5),vR=ts(y8),vE=function(t){return e6(yo)(d6(t))};let vj=Object.freeze(Object.defineProperty({__proto__:null,Alt:{URI:yX,map:yW,alt:yq},ApT:vx,Applicative:y8,ApplicativePar:y8,ApplicativeSeq:{URI:yX,map:yW,ap:yz,of:yO},ApplyPar:y5,Bifunctor:{URI:yX,bimap:yV,mapLeft:y$},Chain:y7,Do:vg,FromEither:vo,FromIO:vt,Functor:y3,Monad:{URI:yX,map:yW,ap:yU,of:yO,chain:yB},MonadIO:{URI:yX,map:yW,ap:yU,of:yO,chain:yB,fromIO:yk},MonadThrow:{URI:yX,map:yW,ap:yU,of:yO,chain:yB,throwError:yw},Pointed:{URI:yX,of:yO},URI:yX,alt:yQ,altW:yQ,ap:yZ,apFirst:y9,apFirstW:y9,apS:vb,apSW:vb,apSecond:y6,apSecondW:y6,apW:yZ,bimap:yH,bind:vv,bindTo:vy,bindW:vv,bracket:vh,bracketW:vm,chain:yY,chainEitherK:vc,chainEitherKW:vc,chainFirst:ve,chainFirstEitherK:vl,chainFirstEitherKW:vl,chainFirstIOK:vi,chainFirstW:ve,chainIOK:vr,chainOptionK:vs,chainW:yY,filterOrElse:vd,filterOrElseW:vd,flap:y4,flatten:yJ,flattenW:yJ,fold:yM,foldW:yM,fromEither:ek,fromEitherK:vp,fromIO:yk,fromIOK:vn,fromOption:va,fromOptionK:vu,fromPredicate:vf,getAltIOValidation:y1,getApplicativeIOValidation:y0,getApplyMonoid:vR,getApplySemigroup:vM,getCompactable:y2,getFilterable:function(t){var n=d7(t),r=y2(t),i=hM(yn,n),o=hR(yn,n),a=hE(yn,n),u=hj(yn,n);return{URI:yX,_E:void 0,map:yW,compact:r.compact,separate:r.separate,filter:function(t,n){return eL(t,i(n))},filterMap:function(t,n){return eL(t,o(n))},partition:function(t,n){return eL(t,a(n))},partitionMap:function(t,n){return eL(t,u(n))}}},getIOValidation:function(t){var n=y0(t),r=y1(t);return{URI:yX,_E:void 0,map:yW,ap:n.ap,of:yO,chain:yB,bimap:yV,mapLeft:y$,alt:r.alt,fromIO:yk,throwError:yw}},getOrElse:yR,getOrElseW:yR,getSemigroup:vE,ioEither:{URI:yX,bimap:yV,mapLeft:y$,map:yW,of:yO,ap:yU,chain:yB,alt:yq,fromIO:yk,throwError:yw},left:yw,leftIO:yI,map:yK,mapLeft:yG,match:yC,matchE:yM,matchEW:yM,matchW:yC,of:yO,orElse:yA,orElseFirst:yP,orElseFirstIOK:yL,orElseFirstW:yP,orElseW:yA,orLeft:yD,right:yO,rightIO:yk,sequenceArray:vk,sequenceSeqArray:vC,swap:yF,throwError:yw,toUnion:yN,traverseArray:vO,traverseArrayWithIndex:vS,traverseReadonlyArrayWithIndex:vS,traverseReadonlyArrayWithIndexSeq:vw,traverseReadonlyNonEmptyArrayWithIndex:v_,traverseReadonlyNonEmptyArrayWithIndexSeq:vT,traverseSeqArray:vI,traverseSeqArrayWithIndex:vw,tryCatch:yE,tryCatchK:yj},Symbol.toStringTag,{value:"Module"}));function vN(t){return eE(e$,t.of)}function vA(t){return ek(t.of(eV))}function vP(t){return function(n){return t.map(n,e$)}}function vL(t){return eE(f5,t.of)}function vD(t){var n=vL(t);return function(t){return eE(t,n)}}function vF(t){var n=vG(t),r=vD(t);return function(t){return n(r(t))}}function vW(t){return function(n){return eE(n,t.of)}}function vU(t){var n=vG(t),r=vW(t);return function(t){return n(r(t))}}function vz(t){return function(n){return function(r){return t.of(l1(n)(r))}}}function vB(t){return eE(l3,t.of)}function vV(t){return function(n,r){return function(i){return t.map(i,fZ(n,r))}}}function v$(t){return function(n,r){return function(i){return t.chain(i,fZ(n,r))}}}function vq(t){return function(n){return function(r){return t.chain(r,fZ(n,t.of))}}}function vK(t){return tr(t,fp)}function vH(t){return e3(t,fg)}function vG(t){var n=vA(t);return function(r){return function(i){return t.chain(i,fZ(function(){return n()},r))}}}function vZ(t){var n=vN(t);return function(r){return function(i){return t.chain(i,fZ(r,n))}}}let vY=Object.freeze(Object.defineProperty({__proto__:null,alt:vZ,ap:vH,chain:vG,chainNullableK:vF,chainOptionK:vU,fromEither:vB,fromF:vP,fromNullable:vL,fromNullableK:vD,fromOptionK:vW,fromPredicate:vz,getOptionM:function(t){var n=vH(t),r=vK(t),i=vG(t),o=vZ(t),a=v$(t),u=vq(t),s=vA(t);return{map:function(t,n){return eL(t,r(n))},ap:function(t,r){return eL(t,n(r))},of:vN(t),chain:function(t,n){return eL(t,i(n))},alt:function(t,n){return eL(t,o(n))},fold:function(t,n,r){return eL(t,a(n,r))},getOrElse:function(t,n){return eL(t,u(n))},fromM:vP(t),none:function(){return s()}}},getOrElse:vq,map:vK,match:vV,matchE:v$,some:vN,zero:vA},Symbol.toStringTag,{value:"Module"}));var vJ=vN(yi),vQ=vz(yi),vX=vB(yi),v0=vP(yn),v1=g8(l3),v2=vV(yn),v3=v$(yc),v4=vq(yl),v5=g8(dt),v9=g8(de),v6=vL(yi),v8=vD(yi),v7=vF(yl),be=vW(yi),bt=vU(yl),bn=vK(yn),br=vH(yo),bi=vG(yl),bo=bi(eO),ba=vZ(yl),bu=vA(yi),bs=bu(),bc=db(yn,fj),bl=dx(yn,fj,fp),bf=hM(yn,fD),bd=hR(yn,fD),bp=hE(yn,fD),bh=hj(yn,fD),bm=function(t,n){return eL(t,bn(n))},bg=function(t,n){return eL(t,br(n))},by=function(t,n){return eL(t,bi(n))},bv=function(t,n){return eL(t,ba(n))},bb=function(t,n){return eL(t,bf(n))},bx=function(t,n){return eL(t,bd(n))},b_=function(t,n){return eL(t,bp(n))},bS=function(t,n){return eL(t,bh(n))},bT="IOOption",bw={URI:bT,map:bm},bO=ti(bw),bk={URI:bT,of:vJ},bI={URI:bT,map:bm,ap:bg},bC=e4(bI),bM=e5(bI),bR={URI:bT,map:bm,ap:bg,chain:by},bE=tf(bR),bj={URI:bT,zero:bu},bN=oH(bj,bk),bA={URI:bT,fromIO:v0},bP=hq(bA),bL=hK(bA,bR),bD=hH(bA,bR),bF={URI:bT,fromEither:vX},bW=tv(bF),bU=tb(bF,bR),bz=tx(bF,bR),bB=vJ(e0),bV=to(bw),b$=td(bR),bq=e9(bI),bK=vJ(eX),bH=function(t){return eE(yy(t),g8(dc(eD)))},bG=function(t){var n=bH(t);return function(t){return eY(t)?n(t):bK}};let bZ=Object.freeze(Object.defineProperty({__proto__:null,Alt:{URI:bT,map:bm,alt:bv},Alternative:{URI:bT,map:bm,ap:bg,of:vJ,alt:bv,zero:bu},ApT:bK,Applicative:{URI:bT,map:bm,ap:bg,of:vJ},Apply:bI,Chain:bR,Compactable:{URI:bT,compact:bc,separate:bl},Do:bB,Filterable:{URI:bT,map:bm,compact:bc,separate:bl,filter:bb,filterMap:bx,partition:b_,partitionMap:bS},FromEither:bF,FromIO:bA,Functor:bw,Monad:{URI:bT,map:bm,ap:bg,of:vJ,chain:by},MonadIO:{URI:bT,map:bm,ap:bg,of:vJ,chain:by,fromIO:v0},Pointed:bk,Zero:bj,alt:ba,altW:ba,ap:br,apFirst:bC,apS:bq,apSecond:bM,bind:b$,bindTo:bV,chain:bi,chainEitherK:bU,chainFirst:bE,chainFirstEitherK:bz,chainFirstIOK:bD,chainIOK:bL,chainNullableK:v7,chainOptionK:bt,compact:bc,filter:bf,filterMap:bd,flap:bO,flatten:bo,fold:v3,fromEither:vX,fromEitherK:bW,fromIO:v0,fromIOEither:v1,fromIOK:bP,fromNullable:v6,fromNullableK:v8,fromOption:ek,fromOptionK:be,fromPredicate:vQ,getOrElse:v4,getOrElseW:v4,guard:bN,map:bn,match:v2,matchE:v3,matchEW:v3,matchW:v2,none:bs,of:vJ,partition:bp,partitionMap:bh,separate:bl,some:vJ,toNullable:v9,toUndefined:v5,traverseReadonlyArrayWithIndex:bG,traverseReadonlyNonEmptyArrayWithIndex:bH,zero:bu},Symbol.toStringTag,{value:"Module"}));var bY=function(){function t(t){var n=this;this.value=t,this.read=function(){return n.value},this.write=this.write.bind(this),this.modify=this.modify.bind(this)}return t.prototype.write=function(t){var n=this;return function(){n.value=t}},t.prototype.modify=function(t){var n=this;return function(){n.value=t(n.value)}},t}();let bJ=Object.freeze(Object.defineProperty({__proto__:null,IORef:bY,newIORef:function(t){return function(){return new bY(t)}}},Symbol.toStringTag,{value:"Module"})),bQ=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var bX=function(t){return pV(function(){return JSON.parse(t)},eO)},b0=function(t){return pV(function(){var n=JSON.stringify(t);if("string"!=typeof n)throw Error("Converting unsupported structure to JSON");return n},eO)};let b1=Object.freeze(Object.defineProperty({__proto__:null,parse:bX,stringify:b0},Symbol.toStringTag,{value:"Module"})),b2=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var b3=function(t){return new Map(t)};function b4(t,n){return{show:function(r){var i=[];return r.forEach(function(r,o){i.push("[".concat(t.show(o),", ").concat(n.show(r),"]"))}),"new Map([".concat(i.sort().join(", "),"])")}}}var b5=function(t){return t.size},b9=function(t){return 0===t.size};function b6(t){var n=xs(t);return function(r,i){if(void 0===i){var o=b6(t);return function(t){return o(r,t)}}return eB(n(r,i))}}function b8(t){return function(n,r){if(void 0===r){var i=b8(t);return function(t){return i(n,t)}}for(var o,a=r.values();!(o=a.next()).done;){var u=o.value;if(t.equals(n,u))return!0}return!1}}var b7=function(t){return function(n){return Array.from(n.keys()).sort(t.compare)}},xe=function(t){return function(n){return Array.from(n.values()).sort(t.compare)}};function xt(t){var n=b7(t);return function(t){return function(r){for(var i=[],o=n(r),a=0;a<o.length;a++){var u=o[a];i.push(t(u,r.get(u)))}return i}}}var xn=function(t){return xt(t)(function(t,n){return[t,n]})},xr=function(t){var n=xu(t);return function(t,r){var i=n(t);return function(n){var o=i(n);if(ez(o)){var a=new Map(n);return a.set(t,r),a}if(o.value[1]!==r){var a=new Map(n);return a.set(o.value[0],r),a}return n}}},xi=function(t){var n=xu(t);return function(t){return function(r){var i=n(t,r);if(eB(i)){var o=new Map(r);return o.delete(i.value[0]),o}return r}}},xo=function(t){var n=xa(t);return function(t,r){return n(t,function(){return r})}},xa=function(t){var n=xu(t);return function(t,r){return function(i){var o=n(t,i);if(ez(o))return eV;var a=o.value,u=a[0],s=a[1],c=r(s);if(c===s)return e$(i);var l=new Map(i);return l.set(u,c),e$(l)}}};function xu(t){return function(n,r){if(void 0===r){var i=xu(t);return function(t){return i(n,t)}}for(var o,a=r.entries();!(o=a.next()).done;){var u=o.value,s=u[0],c=u[1];if(t.equals(s,n))return e$([s,c])}return eV}}function xs(t){var n=xu(t);return function(r,i){if(void 0===i){var o=xs(t);return function(t){return o(r,t)}}return eL(n(r,i),fd(function(t){return t[0],t[1]}))}}function xc(t,n){var r=xu(t);return function(i,o){if(void 0===o){var a=xc(t,n);return function(t){return a(t,i)}}for(var u,s=i.entries();!(u=s.next()).done;){var c=u.value,l=c[0],f=c[1],d=r(l,o);if(ez(d)||!t.equals(l,d.value[0])||!n.equals(f,d.value[1]))return!1}return!0}}var xl=new Map;function xf(t,n){var r=xc(t,n);return tT(function(t,n){return r(t,n)&&r(n,t)})}var xd=function(t,n){return new Map([[t,n]])},xp=function(t,n){for(var r,i=new Map,o=t.entries();!(r=o.next()).done;){var a=r.value,u=a[0],s=a[1];i.set(u,n(u,s))}return i},xh=function(t){return function(n){for(var r,i=new Map,o=new Map,a=n.entries();!(r=a.next()).done;){var u=r.value,s=u[0],c=t(s,u[1]);eq(c)?i.set(s,c.left):o.set(s,c.right)}return oE(i,o)}};function xm(t){return function(n){for(var r,i=new Map,o=new Map,a=n.entries();!(r=a.next()).done;){var u=r.value,s=u[0],c=u[1];t(s,c)?o.set(s,c):i.set(s,c)}return oE(i,o)}}var xg=function(t){return function(n){for(var r,i=new Map,o=n.entries();!(r=o.next()).done;){var a=r.value,u=a[0],s=t(u,a[1]);eB(s)&&i.set(u,s.value)}return i}};function xy(t){return function(n){for(var r,i=new Map,o=n.entries();!(r=o.next()).done;){var a=r.value,u=a[0],s=a[1];t(u,s)&&i.set(u,s)}return i}}var xv=function(t,n){return xp(t,function(t,r){return n(r)})},xb=function(t,n){return xT(t,function(t,r){return n(r)})},xx=function(t,n){return xw(t,function(t,r){return n(r)})},x_=function(t,n){return xO(t,function(t,r){return n(r)})},xS=function(t,n){return xk(t,function(t,r){return n(r)})},xT=function(t,n){return eL(t,xy(n))},xw=function(t,n){return eL(t,xg(n))},xO=function(t,n){return eL(t,xm(n))},xk=function(t,n){return eL(t,xh(n))},xI=function(t){for(var n,r=new Map,i=t.entries();!(n=i.next()).done;){var o=n.value,a=o[0],u=o[1];eB(u)&&r.set(a,u.value)}return r},xC=function(t){return function(n){return xb(n,t)}},xM=function(t){return function(n){return xx(n,t)}},xR=function(t){return function(n){return xv(n,t)}},xE=function(t){return function(n){return xp(n,t)}},xj=function(t){return function(n){return x_(n,t)}},xN=function(t){return function(n){return xS(n,t)}},xA=function(t){for(var n,r=new Map,i=new Map,o=t.entries();!(n=o.next()).done;){var a=n.value,u=a[0],s=a[1];eq(s)?r.set(u,s.left):i.set(u,s.right)}return oE(r,i)},xP="ReadonlyMap",xL=function(t,n){var r=x0(t,n);return{concat:function(t,n){return r(n)(t)}}},xD=function(t,n){return{concat:xL(t,n).concat,empty:xl}},xF=function(t,n){var r=x1(t,n);return{concat:function(t,n){return r(n)(t)}}},xW=function(t){return function(){var n=x2(t);return{concat:function(t,r){return n(r)(t)}}}},xU={URI:xP,map:xv},xz=ti(xU),xB=function(){return{URI:xP,_E:void 0,map:xv,mapWithIndex:xp}},xV={URI:xP,compact:xI,separate:xA},x$=function(t){var n=xG(t);return function(t,r){return n(t,function(t,n,i){return r(n,i)})}},xq=function(t){var n=xZ(t);return function(t){var r=n(t);return function(t){return r(function(n,r){return t(r)})}}},xK=function(t){var n=xY(t);return function(t,r){return n(t,function(t,n,i){return r(n,i)})}},xH=function(t){var n=x$(t),r=xq(t),i=xK(t);return{URI:xP,_E:void 0,reduce:function(t,r,i){return eL(t,n(r,i))},foldMap:function(t){var n=r(t);return function(t,r){return eL(t,n(r))}},reduceRight:function(t,n,r){return eL(t,i(n,r))}}},xG=function(t){var n=b7(t);return function(t,r){return function(i){for(var o=t,a=0,u=n(i);a<u.length;a++){var s=u[a];o=r(s,o,i.get(s))}return o}}},xZ=function(t){var n=b7(t);return function(t){return function(r){return function(i){for(var o=t.empty,a=0,u=n(i);a<u.length;a++){var s=u[a];o=t.concat(o,r(s,i.get(s)))}return o}}}},xY=function(t){var n=b7(t);return function(t,r){return function(i){for(var o=t,a=n(i),u=a.length,s=u-1;s>=0;s--){var c=a[s];o=r(c,i.get(c),o)}return o}}},xJ=function(t){var n=xH(t),r=xG(t),i=xZ(t),o=xY(t);return{URI:xP,_E:void 0,reduce:n.reduce,foldMap:n.foldMap,reduceRight:n.reduceRight,reduceWithIndex:function(t,n,i){return eL(t,r(n,i))},foldMapWithIndex:function(t){var n=i(t);return function(t,r){return eL(t,n(r))}},reduceRightWithIndex:function(t,n,r){return eL(t,o(n,r))}}},xQ=function(t){var n=xX(t),r=xH(t);return{URI:xP,_E:void 0,map:xv,reduce:r.reduce,foldMap:r.foldMap,reduceRight:r.reduceRight,traverse:n.traverse,sequence:n.sequence}},xX=function(t){var n=xJ(t),r=b7(t),i=function(t){return function(n,i){for(var o=t.of(new Map),a=r(n),u=a.length,s=0;s<u;s++)!function(r){var u=a[r],s=n.get(u);o=t.ap(t.map(o,function(t){return function(n){return t.set(u,n)}}),i(u,s))}(s);return o}},o=function(t){var n=i(t);return function(t,r){return n(t,function(t,n){return r(n)})}},a=function(t){var n=i(t);return function(t){return n(t,eD)}};return{URI:xP,_E:void 0,map:xv,mapWithIndex:xp,reduce:n.reduce,foldMap:n.foldMap,reduceRight:n.reduceRight,reduceWithIndex:n.reduceWithIndex,foldMapWithIndex:n.foldMapWithIndex,reduceRightWithIndex:n.reduceRightWithIndex,traverse:o,sequence:a,traverseWithIndex:i}},x0=function(t,n){var r=xs(t);return function(t){return function(i){if(b9(i))return t;if(b9(t))return i;for(var o,a=new Map,u=i.entries();!(o=u.next()).done;){var s=o.value,c=s[0],l=s[1],f=r(c)(t);eB(f)?a.set(c,n.concat(l,f.value)):a.set(c,l)}for(var d=t.entries();!(o=d.next()).done;){var p=o.value,c=p[0],l=p[1],f=r(c)(a);ez(f)&&a.set(c,l)}return a}}},x1=function(t,n){var r=xs(t);return function(t){return function(i){if(b9(i)||b9(t))return xl;for(var o,a=new Map,u=i.entries();!(o=u.next()).done;){var s=o.value,c=s[0],l=s[1],f=r(c)(t);eB(f)&&a.set(c,n.concat(l,f.value))}return a}}},x2=function(t){var n=b6(t);return function(t){return function(r){if(b9(r))return t;if(b9(t))return r;for(var i,o=new Map,a=r.entries();!(i=a.next()).done;){var u=i.value,s=u[0],c=u[1];n(s)(t)||o.set(s,c)}for(var l=t.entries();!(i=l.next()).done;){var f=i.value,s=f[0],c=f[1];n(s)(r)||o.set(s,c)}return o}}};let x3=Object.freeze(Object.defineProperty({__proto__:null,Compactable:xV,Filterable:{URI:xP,map:xv,compact:xI,separate:xA,filter:xb,filterMap:xx,partition:x_,partitionMap:xS},Functor:xU,URI:xP,collect:xt,compact:xI,deleteAt:xi,difference:x2,elem:b8,empty:xl,filter:xC,filterMap:xM,filterMapWithIndex:xg,filterWithIndex:xy,flap:xz,foldMap:xq,foldMapWithIndex:xZ,fromFoldable:function(t,n,r){return function(i){var o=xu(t);return r.reduce(i,new Map,function(t,r){var i=r[0],a=r[1],u=o(i,t);return eB(u)?t.set(u.value[0],n.concat(u.value[1],a)):t.set(i,a),t})}},fromMap:b3,getDifferenceMagma:xW,getEq:xf,getFilterableWithIndex:function(){return{URI:xP,_E:void 0,map:xv,mapWithIndex:xp,compact:xI,separate:xA,filter:xb,filterMap:xx,partition:x_,partitionMap:xS,partitionMapWithIndex:xk,partitionWithIndex:xO,filterMapWithIndex:xw,filterWithIndex:xT}},getFoldable:xH,getFoldableWithIndex:xJ,getFunctorWithIndex:xB,getIntersectionSemigroup:xF,getMonoid:function(t,n){var r=xu(t);return{concat:function(t,i){if(b9(t))return i;if(b9(i))return t;for(var o,a=new Map(t),u=i.entries();!(o=u.next()).done;){var s=o.value,c=s[0],l=s[1],f=r(c,t);eB(f)?a.set(f.value[0],n.concat(f.value[1],l)):a.set(c,l)}return a},empty:xl}},getShow:b4,getTraversable:xQ,getTraversableWithIndex:xX,getUnionMonoid:xD,getUnionSemigroup:xL,getWitherable:function(t){var n=xX(t);return{URI:xP,_E:void 0,map:xv,compact:xI,separate:xA,filter:xb,filterMap:xx,partition:x_,partitionMap:xS,reduce:n.reduce,foldMap:n.foldMap,reduceRight:n.reduceRight,traverse:n.traverse,sequence:n.sequence,mapWithIndex:xp,reduceWithIndex:n.reduceWithIndex,foldMapWithIndex:n.foldMapWithIndex,reduceRightWithIndex:n.reduceRightWithIndex,traverseWithIndex:n.traverseWithIndex,wilt:oV(n,xV),wither:o$(n,xV)}},insertAt:xr,intersection:x1,isEmpty:b9,isSubmap:xc,keys:b7,lookup:xs,lookupWithKey:xu,map:xR,mapWithIndex:xE,member:b6,modifyAt:xa,partition:xj,partitionMap:xN,partitionMapWithIndex:xh,partitionWithIndex:xm,pop:function(t){var n=xs(t),r=xi(t);return function(t){var i=r(t);return function(r){return eL(n(t,r),fd(function(t){return[t,i(r)]}))}}},readonlyMap:{URI:xP,map:xv,compact:xI,separate:xA,filter:xb,filterMap:xx,partition:x_,partitionMap:xS},reduce:x$,reduceRight:xK,reduceRightWithIndex:xY,reduceWithIndex:xG,separate:xA,singleton:xd,size:b5,toMap:function(t){return new Map(t)},toReadonlyArray:xn,toUnfoldable:function(t,n){var r=xn(t);return function(t){var i=r(t),o=i.length;return n.unfold(0,function(t){return t<o?e$([i[t],t+1]):eV})}},union:x0,updateAt:xo,upsertAt:xr,values:xe},Symbol.toStringTag,{value:"Module"}));var x4=globalThis&&globalThis.__assign||function(){return(x4=Object.assign||function(t){for(var n,r=1,i=arguments.length;r<i;r++)for(var o in n=arguments[r])Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o]);return t}).apply(this,arguments)},x5=function(t){return function(n){return Array.from(n.keys()).sort(t.compare)}},x9=function(t){return function(n){return Array.from(n.values()).sort(t.compare)}};function x6(t){var n=x5(t);return function(t){return function(r){for(var i=[],o=n(r),a=0;a<o.length;a++){var u=o[a];i.push(t(u,r.get(u)))}return i}}}function x8(t){return x6(t)(function(t,n){return[t,n]})}var x7=function(t){var n=_r(t);return function(t,r){var i=n(t);return function(n){var o=i(n);if(ez(o)){var a=new Map(n);return a.set(t,r),a}if(o.value[1]!==r){var a=new Map(n);return a.set(o.value[0],r),a}return n}}},_e=function(t){var n=_r(t);return function(t){return function(r){var i=n(t,r);if(eB(i)){var o=new Map(r);return o.delete(i.value[0]),o}return r}}},_t=function(t){var n=_n(t);return function(t,r){return n(t,function(){return r})}},_n=function(t){var n=_r(t);return function(t,r){return function(i){var o=n(t,i);if(ez(o))return eV;var a=new Map(i);return a.set(o.value[0],r(o.value[1])),e$(a)}}};function _r(t){return function(n,r){if(void 0===r){var i=_r(t);return function(t){return i(n,t)}}for(var o,a=r.entries();!(o=a.next()).done;){var u=o.value,s=u[0],c=u[1];if(t.equals(s,n))return e$([s,c])}return eV}}var _i=function(t,n){return new Map([[t,n]])},_o=function(t,n){for(var r,i=new Map,o=t.entries();!(r=o.next()).done;){var a=r.value,u=a[0],s=a[1];i.set(u,n(u,s))}return i},_a=function(t){return function(n){for(var r,i=new Map,o=new Map,a=n.entries();!(r=a.next()).done;){var u=r.value,s=u[0],c=t(s,u[1]);eq(c)?i.set(s,c.left):o.set(s,c.right)}return oE(i,o)}};function _u(t){return function(n){for(var r,i=new Map,o=new Map,a=n.entries();!(r=a.next()).done;){var u=r.value,s=u[0],c=u[1];t(s,c)?o.set(s,c):i.set(s,c)}return oE(i,o)}}var _s=function(t){return function(n){for(var r,i=new Map,o=n.entries();!(r=o.next()).done;){var a=r.value,u=a[0],s=t(u,a[1]);eB(s)&&i.set(u,s.value)}return i}};function _c(t){return function(n){for(var r,i=new Map,o=n.entries();!(r=o.next()).done;){var a=r.value,u=a[0],s=a[1];t(u,s)&&i.set(u,s)}return i}}var _l=function(t,n){return _o(t,function(t,r){return n(r)})},_f=function(t,n){return _m(t,function(t,r){return n(r)})},_d=function(t,n){return _g(t,function(t,r){return n(r)})},_p=function(t,n){return _y(t,function(t,r){return n(r)})},_h=function(t,n){return _v(t,function(t,r){return n(r)})},_m=function(t,n){return eL(t,_c(n))},_g=function(t,n){return eL(t,_s(n))},_y=function(t,n){return eL(t,_u(n))},_v=function(t,n){return eL(t,_a(n))},_b=function(t){for(var n,r=new Map,i=t.entries();!(n=i.next()).done;){var o=n.value,a=o[0],u=o[1];eB(u)&&r.set(a,u.value)}return r},_x=function(t){return function(n){return _f(n,t)}},__=function(t){return function(n){return _d(n,t)}},_S=function(t){return function(n){return _l(n,t)}},_T=function(t){return function(n){return _o(n,t)}},_w=function(t){return function(n){return _p(n,t)}},_O=function(t){return function(n){return _h(n,t)}},_k=function(t){for(var n,r=new Map,i=new Map,o=t.entries();!(n=o.next()).done;){var a=n.value,u=a[0],s=a[1];eq(s)?r.set(u,s.left):i.set(u,s.right)}return oE(r,i)},_I=function(t,n){var r=_W(t,n);return{concat:function(t,n){return r(n)(t)}}},_C=function(t,n){return{concat:_I(t,n).concat,empty:new Map}},_M=function(t,n){var r=_U(t,n);return{concat:function(t,n){return r(n)(t)}}},_R=function(t){return function(){var n=_z(t);return{concat:function(t,r){return n(r)(t)}}}},_E=function(t){return x4(x4({},xH(t)),{URI:"Map"})},_j=function(t){return x4(x4({},xJ(t)),{URI:"Map"})},_N=function(t){var n=_j(t),r=x5(t),i=function(t){return function(n,i){for(var o=t.of(new Map),a=r(n),u=a.length,s=0;s<u;s++)!function(r){var u=a[r],s=n.get(u);o=t.ap(t.map(o,function(t){return function(n){return t.set(u,n)}}),i(u,s))}(s);return o}},o=function(t){var n=i(t);return function(t,r){return n(t,function(t,n){return r(n)})}},a=function(t){var n=i(t);return function(t){return n(t,function(t,n){return n})}};return{URI:"Map",_E:void 0,map:_l,mapWithIndex:_o,reduce:n.reduce,foldMap:n.foldMap,reduceRight:n.reduceRight,reduceWithIndex:n.reduceWithIndex,foldMapWithIndex:n.foldMapWithIndex,reduceRightWithIndex:n.reduceRightWithIndex,traverse:o,sequence:a,traverseWithIndex:i}},_A={URI:"Map",map:_l},_P=ti(_A),_L={URI:"Map",compact:_b,separate:_k},_D={URI:"Map",map:_l,compact:_b,separate:_k,filter:_f,filterMap:_d,partition:_p,partitionMap:_h},_F=function(t){return new Map(t)},_W=function(t,n){var r=x0(t,n);return function(t){return function(n){return b9(n)?_F(t):b9(t)?_F(n):r(t)(n)}}},_U=function(t,n){var r=x1(t,n);return function(t){return function(n){return b9(n)||b9(t)?new Map:r(t)(n)}}},_z=function(t){var n=x2(t);return function(t){return function(r){return b9(r)?_F(t):b9(t)?_F(r):n(t)(r)}}},_B=new Map;let _V=Object.freeze(Object.defineProperty({__proto__:null,Compactable:_L,Filterable:_D,Functor:_A,URI:"Map",collect:x6,compact:_b,deleteAt:_e,difference:_z,elem:b8,empty:_B,filter:_x,filterMap:__,filterMapWithIndex:_s,filterWithIndex:_c,flap:_P,foldMap:xq,foldMapWithIndex:xZ,fromFoldable:function(t,n,r){return function(i){var o=_r(t);return r.reduce(i,new Map,function(t,r){var i=r[0],a=r[1],u=o(i,t);return eB(u)?t.set(u.value[0],n.concat(u.value[1],a)):t.set(i,a),t})}},getDifferenceMagma:_R,getEq:xf,getFilterableWithIndex:function(){return{URI:"Map",_E:void 0,map:_l,mapWithIndex:_o,compact:_b,separate:_k,filter:_f,filterMap:_d,partition:_p,partitionMap:_h,partitionMapWithIndex:_v,partitionWithIndex:_y,filterMapWithIndex:_g,filterWithIndex:_m}},getFoldable:_E,getFoldableWithIndex:_j,getIntersectionSemigroup:_M,getMonoid:function(t,n){var r=_r(t);return{concat:function(t,i){if(b9(t))return i;if(b9(i))return t;for(var o,a=new Map(t),u=i.entries();!(o=u.next()).done;){var s=o.value,c=s[0],l=s[1],f=r(c,t);eB(f)?a.set(f.value[0],n.concat(f.value[1],l)):a.set(c,l)}return a},empty:new Map}},getShow:b4,getTraversableWithIndex:_N,getUnionMonoid:_C,getUnionSemigroup:_I,getWitherable:function(t){var n=_N(t);return{URI:"Map",_E:void 0,map:_l,compact:_b,separate:_k,filter:_f,filterMap:_d,partition:_p,partitionMap:_h,reduce:n.reduce,foldMap:n.foldMap,reduceRight:n.reduceRight,traverse:n.traverse,sequence:n.sequence,mapWithIndex:_o,reduceWithIndex:n.reduceWithIndex,foldMapWithIndex:n.foldMapWithIndex,reduceRightWithIndex:n.reduceRightWithIndex,traverseWithIndex:n.traverseWithIndex,wilt:oV(n,_L),wither:o$(n,_L)}},insertAt:x7,intersection:_U,isEmpty:b9,isSubmap:xc,keys:x5,lookup:xs,lookupWithKey:_r,map:_S,mapWithIndex:_T,map_:_D,member:b6,modifyAt:_n,partition:_w,partitionMap:_O,partitionMapWithIndex:_a,partitionWithIndex:_u,pop:function(t){var n=xs(t),r=_e(t);return function(t){var i=r(t);return function(r){return eL(n(t,r),fd(function(t){return[t,i(r)]}))}}},reduce:x$,reduceRight:xK,reduceRightWithIndex:xY,reduceWithIndex:xG,separate:_k,singleton:_i,size:b5,toArray:x8,toUnfoldable:function(t,n){var r=x8(t);return function(t){var i=r(t),o=i.length;return n.unfold(0,function(t){return t<o?e$([i[t],t+1]):eV})}},union:_W,updateAt:_t,upsertAt:x7,values:x9},Symbol.toStringTag,{value:"Module"})),_$=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),_q=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),_K=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),_H=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),_G=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var _Z=function(t){return{concat:t6(t).concat,empty:t.top}},_Y=function(t){return{concat:t8(t).concat,empty:t.bottom}},_J=function(t){return{concat:t1(t).concat,empty:t.empty}},_Q=function(t){var n={};for(var r in t)e1.call(t,r)&&(n[r]=t[r].empty);return{concat:ne(t).concat,empty:n}},_X=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return{concat:nt.apply(nd,t).concat,empty:t.map(function(t){return t.empty})}},_0=function(t){return t5(t)(t.empty)},_1={concat:no.concat,empty:void 0},_2={concat:nu.concat,empty:!0},_3={concat:ns.concat,empty:!1},_4=function(){return _J(hw())},_5={concat:nc.concat,empty:""},_9={concat:nl.concat,empty:0},_6={concat:nf.concat,empty:1};let _8=Object.freeze(Object.defineProperty({__proto__:null,concatAll:_0,fold:_0,getDualMonoid:_J,getEndomorphismMonoid:_4,getFunctionMonoid:e_,getJoinMonoid:_Y,getMeetMonoid:_Z,getStructMonoid:_Q,getTupleMonoid:_X,max:_Y,min:_Z,monoidAll:_2,monoidAny:_3,monoidProduct:_6,monoidString:_5,monoidSum:_9,monoidVoid:_1,reverse:_J,struct:_Q,tuple:_X},Symbol.toStringTag,{value:"Module"})),_7=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var Se=function(t,n,r){return function(i){return -1===i?t():0===i?n():r()}},St=function(t){return -1===t?1:1===t?-1:0},Sn={equals:function(t,n){return t===n}},Sr={concat:function(t,n){return 0!==t?t:n}},Si={concat:Sr.concat,empty:0},So=function(t){return t<=-1?-1:t>=1?1:0};let Sa=Object.freeze(Object.defineProperty({__proto__:null,Eq:Sn,Monoid:Si,Semigroup:Sr,eqOrdering:Sn,invert:St,match:Se,matchW:Se,monoidOrdering:Si,reverse:St,semigroupOrdering:Sr,sign:So},Symbol.toStringTag,{value:"Module"})),Su=Object.freeze(Object.defineProperty({__proto__:null,pipe:eL,pipeable:function(t){var n,r,i,o,a,u,s,c,l,f,d,p,h,m,g,y={};if("function"==typeof t.map){var v=function(n){return function(r){return t.map(r,n)}};y.map=v}if("function"==typeof t.contramap){var b=function(n){return function(r){return t.contramap(r,n)}};y.contramap=b}if("function"==typeof t.mapWithIndex){var x=function(n){return function(r){return t.mapWithIndex(r,n)}};y.mapWithIndex=x}if("function"==typeof t.ap){var _=function(n){return function(r){return t.ap(r,n)}},S=function(n){return function(r){return t.ap(t.map(r,function(t){return function(){return t}}),n)}};y.ap=_,y.apFirst=S,y.apSecond=function(n){return function(r){return t.ap(t.map(r,function(){return function(t){return t}}),n)}}}if("function"==typeof t.chain){var T=function(n){return function(r){return t.chain(r,n)}},w=function(n){return function(r){return t.chain(r,function(r){return t.map(n(r),function(){return r})})}},O=function(n){return t.chain(n,eO)};y.chain=T,y.chainFirst=w,y.flatten=O}if("function"==typeof t.bimap){var k=function(n,r){return function(i){return t.bimap(i,n,r)}},I=function(n){return function(r){return t.mapLeft(r,n)}};y.bimap=k,y.mapLeft=I}if("function"==typeof t.extend){var C=function(n){return function(r){return t.extend(r,n)}},M=function(n){return t.extend(n,eO)};y.extend=C,y.duplicate=M}if("function"==typeof t.reduce){var R=function(n,r){return function(i){return t.reduce(i,n,r)}},E=function(n){var r=t.foldMap(n);return function(t){return function(n){return r(n,t)}}},j=function(n,r){return function(i){return t.reduceRight(i,n,r)}};y.reduce=R,y.foldMap=E,y.reduceRight=j}if("function"==typeof t.reduceWithIndex){var N=function(n,r){return function(i){return t.reduceWithIndex(i,n,r)}},A=function(n){var r=t.foldMapWithIndex(n);return function(t){return function(n){return r(n,t)}}},P=function(n,r){return function(i){return t.reduceRightWithIndex(i,n,r)}};y.reduceWithIndex=N,y.foldMapWithIndex=A,y.reduceRightWithIndex=P}if("function"==typeof t.alt){var L=function(n){return function(r){return t.alt(r,n)}};y.alt=L}if("function"==typeof t.compact&&(y.compact=t.compact,y.separate=t.separate),"function"==typeof t.filter){var D=function(n){return function(r){return t.filter(r,n)}},F=function(n){return function(r){return t.filterMap(r,n)}},W=function(n){return function(r){return t.partition(r,n)}},U=function(n){return function(r){return t.partitionMap(r,n)}};y.filter=D,y.filterMap=F,y.partition=W,y.partitionMap=U}if("function"==typeof t.filterWithIndex){var z=function(n){return function(r){return t.filterWithIndex(r,n)}},B=function(n){return function(r){return t.filterMapWithIndex(r,n)}},V=function(n){return function(r){return t.partitionWithIndex(r,n)}},$=function(n){return function(r){return t.partitionMapWithIndex(r,n)}};y.filterWithIndex=z,y.filterMapWithIndex=B,y.partitionWithIndex=V,y.partitionMapWithIndex=$}if("function"==typeof t.promap){var q=function(n,r){return function(i){return t.promap(i,n,r)}};y.promap=q}if("function"==typeof t.compose){var K=function(n){return function(r){return t.compose(r,n)}};y.compose=K}if("function"==typeof t.throwError){var H=function(n){return function(r){return"None"===r._tag?t.throwError(n()):t.of(r.value)}},G=function(n){return"Left"===n._tag?t.throwError(n.left):t.of(n.right)},Z=function(n,r){return function(i){return n(i)?t.of(i):t.throwError(r(i))}},Y=function(n,r){return function(i){return t.chain(i,function(i){return n(i)?t.of(i):t.throwError(r(i))})}};y.fromOption=H,y.fromEither=G,y.fromPredicate=Z,y.filterOrElse=Y}return y}},Symbol.toStringTag,{value:"Module"})),Ss=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),Sc=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var Sl=function(){return Math.random()};function Sf(t,n){return eL(Sl,g8(function(r){return Math.floor((n-t+1)*r+t)}))}var Sd=eL(Sl,g8(function(t){return t<.5})),Sp=function(t){return eL(Sf(0,t.length-1),g8(function(n){return t[n]}))};let Sh=Object.freeze(Object.defineProperty({__proto__:null,random:Sl,randomBool:Sd,randomElem:Sp,randomInt:Sf,randomRange:function(t,n){return eL(Sl,g8(function(r){return(n-t)*r+t}))}},Symbol.toStringTag,{value:"Module"}));var Sm=ht(mc),Sg=he(mc),Sy=hn(mu),Sv=hr(mu),Sb=hh(mu),Sx=hm(mm),S_=hg(mm),SS=h_(mu),ST=hy(mm),Sw=hv(mm),SO=hb(mm),Sk=hx(mu),SI=function(t,n){return eL(t,SN(n))},SC=function(t,n,r){return eL(t,SA(n,r))},SM=function(t,n){return eL(t,SP(n))},SR=function(t,n){return eL(t,SL(n))},SE=function(t,n){return eL(t,SD(n))},Sj=function(t,n){return eL(t,SW(n))},SN=hu(mu),SA=hf(mu),SP=hd(mu),SL=hs(ml),SD=hc(mm),SF=SD(eO),SW=hl(mm),SU="ReaderEither",Sz=function(t){var n=d8(t);return{URI:SU,_E:void 0,compact:db(mu,n),separate:dx(mu,n,pi)}};function SB(t){var n=e3(ml,pt(t));return{URI:SU,_E:void 0,map:SI,ap:function(t,r){return eL(t,n(r))},of:Sg}}function SV(t){var n=hp(mm,t);return{URI:SU,_E:void 0,map:SI,alt:function(t,r){return eL(t,n(r))}}}var S$={URI:SU,map:SI},Sq=ti(S$),SK={URI:SU,map:SI,ap:SR},SH=e4(SK),SG=e5(SK),SZ={URI:SU,map:SI,ap:SR,of:Sg},SY={URI:SU,map:SI,ap:SR,chain:SE},SJ=tf(SY),SQ={URI:SU,fromReader:Sy},SX=mM(SQ),S0=mR(SQ),S1=mE(SQ),S2=mj(SQ,SY),S3=mN(SQ,SY),S4={URI:SU,fromEither:ek},S5=th(S4),S9=tg(S4),S6=ty(S4,SY),S8=tb(S4,SY),S7=tx(S4,SY),Te=tm(S4),Tt=t_(S4,SY),Tn=tv(S4),Tr=Sg(e0),Ti=to(S$),To=td(SY),Ta=e9(SK),Tu=Sg(eX),Ts=function(t){return eE(mS(t),h3(p0(eD)))},Tc=function(t){var n=Ts(t);return function(t){return eY(t)?n(t):Tu}},Tl=function(t){return Tc(function(n,r){return t(r)})},Tf=Tl(eO),Td=e6(SK),Tp=ts(SZ),Th=function(t){return e6(ml)(d6(t))};let Tm=Object.freeze(Object.defineProperty({__proto__:null,Alt:{URI:SU,map:SI,alt:Sj},ApT:Tu,Applicative:SZ,Apply:SK,Bifunctor:{URI:SU,bimap:SC,mapLeft:SM},Chain:SY,Do:Tr,FromEither:S4,FromReader:SQ,Functor:S$,Monad:{URI:SU,map:SI,ap:SR,of:Sg,chain:SE},MonadThrow:{URI:SU,map:SI,ap:SR,of:Sg,chain:SE,throwError:Sm},Pointed:{URI:SU,of:Sg},URI:SU,alt:SW,altW:SW,ap:SL,apFirst:SH,apFirstW:SH,apS:Ta,apSW:Ta,apSecond:SG,apSecondW:SG,apW:SL,ask:SX,asks:S0,asksReaderEither:hJ,asksReaderEitherW:hJ,bimap:SA,bind:To,bindTo:Ti,bindW:To,chain:SD,chainEitherK:S8,chainEitherKW:S8,chainFirst:SJ,chainFirstEitherK:S7,chainFirstEitherKW:S7,chainFirstReaderK:S3,chainFirstReaderKW:S3,chainFirstW:SJ,chainOptionK:S6,chainReaderK:S2,chainReaderKW:S2,chainW:SD,filterOrElse:Tt,filterOrElseW:Tt,flap:Sq,flatten:SF,flattenW:SF,fold:Sx,foldW:Sx,fromEither:ek,fromEitherK:Tn,fromOption:S5,fromOptionK:S9,fromPredicate:Te,fromReader:Sy,fromReaderK:S1,getAltReaderValidation:SV,getApplicativeReaderValidation:SB,getApplyMonoid:Tp,getApplySemigroup:Td,getCompactable:Sz,getFilterable:function(t){var n=d7(t),r=Sz(t),i=hM(mu,n),o=hR(mu,n),a=hE(mu,n),u=hj(mu,n);return{URI:SU,_E:void 0,map:SI,compact:r.compact,separate:r.separate,filter:function(t,n){return eL(t,i(n))},filterMap:function(t,n){return eL(t,o(n))},partition:function(t,n){return eL(t,a(n))},partitionMap:function(t,n){return eL(t,u(n))}}},getOrElse:S_,getOrElseW:S_,getReaderValidation:function(t){var n=SB(t),r=SV(t);return{URI:SU,_E:void 0,map:SI,ap:n.ap,of:Sg,chain:SE,bimap:SC,mapLeft:SM,alt:r.alt,throwError:Sm}},getSemigroup:Th,left:Sm,leftReader:Sv,local:hY,map:SN,mapLeft:SP,match:Sb,matchE:Sx,matchEW:Sx,matchW:Sb,of:Sg,orElse:ST,orElseFirst:Sw,orElseFirstW:Sw,orElseW:ST,orLeft:SO,readerEither:{URI:SU,bimap:SC,mapLeft:SM,map:SI,of:Sg,ap:SR,chain:SE,alt:Sj,throwError:Sm},right:Sg,rightReader:Sy,sequenceArray:Tf,swap:Sk,throwError:Sm,toUnion:SS,traverseArray:Tl,traverseArrayWithIndex:Tc,traverseReadonlyArrayWithIndex:Tc,traverseReadonlyNonEmptyArrayWithIndex:Ts},Symbol.toStringTag,{value:"Module"}));function Tg(t){return function(n){return function(){return t.of(n)}}}function Ty(t){return function(n){return function(r){return function(i){return t.map(r(i),n)}}}}function Tv(t){return function(n){return function(r){return function(i){return t.ap(r(i),n(i))}}}}function Tb(t){return function(n){return function(r){return function(i){return t.chain(r(i),function(t){return n(t)(i)})}}}}function Tx(t){return function(n){return eE(n,t.of)}}let T_=Object.freeze(Object.defineProperty({__proto__:null,ap:Tv,chain:Tb,fromNaturalTransformation:function(t){return function(n){return eE(n,t)}},fromReader:Tx,getReaderM:function(t){var n=Tv(t),r=Ty(t),i=Tb(t);return{map:function(t,n){return eL(t,r(n))},ap:function(t,r){return eL(t,n(r))},of:Tg(t),chain:function(t,n){return eL(t,i(n))},ask:function(){return t.of},asks:function(n){return eE(n,t.of)},local:function(t,n){return function(r){return t(n(r))}},fromReader:Tx(t),fromM:function(t){return function(){return t}}}},map:Ty,of:Tg},Symbol.toStringTag,{value:"Module"}));var TS=function(t){return function(){return Promise.resolve().then(t)}},TT=function(t,n){return eL(t,TI(n))},Tw=function(t,n){return eL(t,TC(n))},TO=function(t,n){return eL(t,TR(function(t){return eL(n,TI(t))}))},Tk=function(t,n){return eL(t,TR(n))},TI=function(t){return function(n){return function(){return Promise.resolve().then(n).then(t)}}},TC=function(t){return function(n){return function(){return Promise.all([Promise.resolve().then(n),Promise.resolve().then(t)]).then(function(t){var n;return(0,t[0])(t[1])})}}},TM=function(t){return function(){return Promise.resolve(t)}},TR=function(t){return function(n){return function(){return Promise.resolve().then(n).then(function(n){return t(n)()})}}},TE=TR(eO),Tj="Task",TN={URI:Tj,map:TT},TA=ti(TN),TP={URI:Tj,of:TM},TL={URI:Tj,map:TT,ap:Tw},TD=e4(TL),TF=e5(TL),TW={URI:Tj,map:TT,ap:Tw,of:TM},TU={URI:Tj,map:TT,ap:TO},Tz={URI:Tj,map:TT,ap:TO,of:TM},TB={URI:Tj,map:TT,ap:Tw,chain:Tk},TV={URI:Tj,map:TT,of:TM,ap:Tw,chain:Tk},T$=tf(TB),Tq={URI:Tj,fromIO:TS},TK=hq(Tq),TH=hK(Tq,TB),TG=hH(Tq,TB),TZ=function(){return new Promise(function(t){})},TY=TM(e0),TJ=to(TN),TQ=td(TB),TX=e9(TL),T0=TM(eX),T1=function(t){return function(n){return function(){return Promise.all(n.map(function(n,r){return Promise.resolve().then(function(){return t(r,n)()})}))}}},T2=function(t){var n=T1(t);return function(t){return eY(t)?n(t):T0}},T3=function(t){return function(n){return function(){return eQ(n).reduce(function(n,r,i){return n.then(function(n){return Promise.resolve().then(t(i+1,r)).then(function(t){return n.push(t),n})})},Promise.resolve().then(t(0,eJ(n))).then(eZ))}}},T4=function(t){var n=T3(t);return function(t){return eY(t)?n(t):T0}},T5=function(t){return T2(function(n,r){return t(r)})},T9=T5(eO),T6=function(t){return T4(function(n,r){return t(r)})},T8=T6(eO),T7=e6(TU),we=ts(Tz);let wt=Object.freeze(Object.defineProperty({__proto__:null,ApT:T0,ApplicativePar:TW,ApplicativeSeq:Tz,ApplyPar:TL,ApplySeq:TU,Chain:TB,Do:TY,FromIO:Tq,FromTask:{URI:Tj,fromIO:TS,fromTask:eO},Functor:TN,Monad:TV,MonadIO:{URI:Tj,map:TT,of:TM,ap:Tw,chain:Tk,fromIO:TS},MonadTask:{URI:Tj,map:TT,of:TM,ap:Tw,chain:Tk,fromIO:TS,fromTask:eO},Pointed:TP,URI:Tj,ap:TC,apFirst:TD,apS:TX,apSecond:TF,bind:TQ,bindTo:TJ,chain:TR,chainFirst:T$,chainFirstIOK:TG,chainIOK:TH,delay:function(t){return function(n){return function(){return new Promise(function(r){setTimeout(function(){Promise.resolve().then(n).then(r)},t)})}}},flap:TA,flatten:TE,fromIO:TS,fromIOK:TK,fromTask:eO,getMonoid:we,getRaceMonoid:function(){return{concat:function(t,n){return function(){return Promise.race([Promise.resolve().then(t),Promise.resolve().then(n)])}},empty:TZ}},getSemigroup:T7,map:TI,never:TZ,of:TM,sequenceArray:T9,sequenceSeqArray:T8,task:{URI:Tj,map:TT,of:TM,ap:Tw,chain:Tk,fromIO:TS,fromTask:eO},taskSeq:{URI:Tj,map:TT,of:TM,ap:TO,chain:Tk,fromIO:TS,fromTask:eO},traverseArray:T5,traverseArrayWithIndex:T2,traverseReadonlyArrayWithIndex:T2,traverseReadonlyArrayWithIndexSeq:T4,traverseReadonlyNonEmptyArrayWithIndex:T1,traverseReadonlyNonEmptyArrayWithIndexSeq:T3,traverseSeqArray:T6,traverseSeqArrayWithIndex:T4},Symbol.toStringTag,{value:"Module"}));var wn=Tx(TP),wr=eE(TS,ek),wi=function(t,n){return eL(t,ws(n))},wo=function(t,n){return eL(t,wc(n))},wa=function(t,n){return eL(t,wf(function(t){return eL(n,ws(t))}))},wu=function(t,n){return eL(t,wf(n))},ws=Ty(TN),wc=Tv(TL),wl=Tg(TP),wf=Tb(TV),wd=wf(eO),wp="ReaderTask",wh={URI:wp,map:wi},wm=ti(wh),wg={URI:wp,of:wl},wy={URI:wp,map:wi,ap:wo},wv=e4(wy),wb=e5(wy),wx={URI:wp,map:wi,ap:wa},w_={URI:wp,map:wi,ap:wa,of:wl},wS={URI:wp,map:wi,ap:wo,chain:wu},wT={URI:wp,map:wi,of:wl,ap:wo,chain:wu},ww=tf(wS),wO={URI:wp,fromIO:wr},wk=hq(wO),wI=hK(wO,wS),wC=hH(wO,wS),wM={URI:wp,fromReader:wn},wR=mM(wM),wE=mR(wM),wj=mE(wM),wN=mj(wM,wS),wA=mN(wM,wS),wP={URI:wp,fromIO:wr,fromTask:ek},wL=gf(wP),wD=gd(wP,wS),wF=gp(wP,wS),wW=wl(e0),wU=to(wh),wz=td(wS),wB=e9(wy),wV=wl(eX),w$=function(t){return eE(mS(t),h3(T1(eD)))},wq=function(t){var n=w$(t);return function(t){return eY(t)?n(t):wV}},wK=function(t){return eE(mS(t),h3(T3(eD)))},wH=function(t){var n=wK(t);return function(t){return eY(t)?n(t):wV}},wG=function(t){return wq(function(n,r){return t(r)})},wZ=wG(eO),wY=function(t){return wH(function(n,r){return t(r)})},wJ=wY(eO),wQ=e6(wx),wX=ts(w_);function w0(t,n){return t(n)()}let w1=Object.freeze(Object.defineProperty({__proto__:null,ApT:wV,ApplicativePar:{URI:wp,map:wi,ap:wo,of:wl},ApplicativeSeq:w_,ApplyPar:wy,ApplySeq:wx,Chain:wS,Do:wW,FromIO:wO,FromReader:wM,FromTask:wP,Functor:wh,Monad:wT,MonadIO:{URI:wp,map:wi,of:wl,ap:wo,chain:wu,fromIO:wr},MonadTask:{URI:wp,map:wi,of:wl,ap:wo,chain:wu,fromIO:wr,fromTask:ek},Pointed:wg,URI:wp,ap:wc,apFirst:wv,apS:wB,apSW:wB,apSecond:wb,apW:wc,ask:wR,asks:wE,asksReaderTask:hJ,asksReaderTaskW:hJ,bind:wz,bindTo:wU,bindW:wz,chain:wf,chainFirst:ww,chainFirstIOK:wC,chainFirstReaderK:wA,chainFirstReaderKW:wA,chainFirstTaskK:wF,chainFirstW:ww,chainIOK:wI,chainReaderK:wN,chainReaderKW:wN,chainTaskK:wD,chainW:wf,flap:wm,flatten:wd,flattenW:wd,fromIO:wr,fromIOK:wk,fromReader:wn,fromReaderK:wj,fromTask:ek,fromTaskK:wL,getMonoid:wX,getSemigroup:wQ,local:hY,map:ws,of:wl,readerTask:{URI:wp,map:wi,of:wl,ap:wo,chain:wu,fromIO:wr,fromTask:ek},readerTaskSeq:{URI:wp,map:wi,of:wl,ap:wa,chain:wu,fromIO:wr,fromTask:ek},run:w0,sequenceArray:wZ,sequenceSeqArray:wJ,traverseArray:wG,traverseArrayWithIndex:wq,traverseReadonlyArrayWithIndex:wq,traverseReadonlyArrayWithIndexSeq:wH,traverseReadonlyNonEmptyArrayWithIndex:w$,traverseReadonlyNonEmptyArrayWithIndexSeq:wK,traverseSeqArray:wY,traverseSeqArrayWithIndex:wH},Symbol.toStringTag,{value:"Module"}));var w2=globalThis&&globalThis.__awaiter||function(t,n,r,i){return new(r||(r=Promise))(function(o,a){function u(t){try{c(i.next(t))}catch(n){a(n)}}function s(t){try{c(i.throw(t))}catch(n){a(n)}}function c(t){var n;t.done?o(t.value):((n=t.value)instanceof r?n:new r(function(t){t(n)})).then(u,s)}c((i=i.apply(t,n||[])).next())})},w3=globalThis&&globalThis.__generator||function(t,n){var r,i,o,a,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(a){return function(s){return function(a){if(r)throw TypeError("Generator is already executing.");for(;u;)try{if(r=1,i&&(o=2&a[0]?i.return:a[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,a[1])).done)return o;switch(i=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return u.label++,{value:a[1],done:!1};case 5:u.label++,i=a[1],a=[0];continue;case 7:a=u.ops.pop(),u.trys.pop();continue;default:if(!(o=(o=u.trys).length>0&&o[o.length-1])&&(6===a[0]||2===a[0])){u=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){u.label=a[1];break}if(6===a[0]&&u.label<o[1]){u.label=o[1],o=a;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(a);break}o[2]&&u.ops.pop(),u.trys.pop();continue}a=n.call(t,u)}catch(s){a=[6,s],i=0}finally{r=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,s])}}},w4=ht(TP),w5=he(TP),w9=hn(TN),w6=hr(TN),w8=eE(TS,w9),w7=eE(TS,w6),Oe=function(t){return TI(pk(t))},Ot=hh(TN),On=hm(TV),Or=hg(TV),Oi=function(t,n){return function(){return w2(void 0,void 0,void 0,function(){var r;return w3(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,t().then(eG)];case 1:return[2,r.sent()];case 2:return[2,eH(n(r.sent()))];case 3:return[2]}})})}},Oo=function(t,n){return function(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];return Oi(function(){return t.apply(void 0,r)},n)}},Oa=h_(TN),Ou=hi(TP),Os=ho(TP),Oc=ha(TV),Ol=hy(TV),Of=hv(TV),Od=function(t){return Of(O4(t))},Op=function(t){return Of(O8(t))},Oh=hb(TV),Om=hx(TN),Og=function(t){var n=Oe(t);return function(t){return eE(t,n)}},Oy=function(t){return function(n){return function(r){return eL(r,OE(Og(t)(n)))}}},Ov=function(t){return eE(t,TS)},Ob=function(t){return Oj(Ov(t))},Ox=function(t,n){return eL(t,OI(n))},O_=function(t,n){return eL(t,OR(n))},OS=function(t,n){return eL(t,OE(function(t){return eL(n,OI(t))}))},OT=function(t,n){return eL(t,OE(n))},Ow=function(t,n,r){return eL(t,OC(n,r))},OO=function(t,n){return eL(t,OM(n))},Ok=function(t,n){return eL(t,OA(n))},OI=hu(TN),OC=hf(TN),OM=hd(TN),OR=hs(TL),OE=hc(TV),Oj=OE,ON=Oj(eO),OA=hl(TV),OP="TaskEither";function OL(t,n){var r=e3(t,pt(n));return{URI:OP,_E:void 0,map:Ox,ap:function(t,n){return eL(t,r(n))},of:w5}}function OD(t){var n=hp(TV,t);return{URI:OP,_E:void 0,map:Ox,alt:function(t,r){return eL(t,n(r))}}}var OF=function(t){var n=d8(t);return{URI:OP,_E:void 0,compact:db(TN,n),separate:dx(TN,n,pi)}},OW={URI:OP,map:Ox},OU=ti(OW),Oz={URI:OP,map:Ox,ap:O_},OB=e4(Oz),OV=e5(Oz),O$={URI:OP,map:Ox,ap:OS},Oq={URI:OP,map:Ox,ap:OS,of:w5},OK={URI:OP,map:Ox,ap:O_,chain:OT},OH=tf(OK),OG={URI:OP,fromEither:TM},OZ=th(OG),OY=tg(OG),OJ=ty(OG,OK),OQ=tb(OG,OK),OX=tx(OG,OK),O0=tm(OG),O1=t_(OG,OK),O2=tv(OG),O3={URI:OP,fromIO:w8},O4=hq(O3),O5=hK(O3,OK),O9=hH(O3,OK),O6={URI:OP,fromIO:w8,fromTask:w9},O8=gf(O6),O7=gd(O6,OK),ke=gp(O6,OK),kt=function(t,n,r){return kn(t,n,r)},kn=function(t,n,r){return eL(t,Oj(function(t){return eL(n(t),TR(function(n){return eL(r(t,n),Oj(function(){return TM(n)}))}))}))},kr=w5(e0),ki=to(OW),ko=td(OK),ka=e9(Oz),ku=w5(eX),ks=function(t){return eE(T1(t),TI(p0(eD)))},kc=function(t){var n=ks(t);return function(t){return eY(t)?n(t):ku}},kl=function(t){return function(n){return function(){return eQ(n).reduce(function(n,r,i){return n.then(function(o){return eq(o)?n:t(i+1,r)().then(function(t){return eq(t)?t:(o.right.push(t.right),o)})})},t(0,eJ(n))().then(pr(eZ)))}}},kf=function(t){var n=kl(t);return function(t){return eY(t)?n(t):ku}},kd=function(t){return kc(function(n,r){return t(r)})},kp=kd(eO),kh=function(t){return kf(function(n,r){return t(r)})},km=kh(eO),kg=e6(O$),ky=ts(Oq),kv=function(t){return e6(TU)(d6(t))};let kb=Object.freeze(Object.defineProperty({__proto__:null,Alt:{URI:OP,map:Ox,alt:Ok},ApT:ku,ApplicativePar:{URI:OP,map:Ox,ap:O_,of:w5},ApplicativeSeq:Oq,ApplyPar:Oz,ApplySeq:O$,Bifunctor:{URI:OP,bimap:Ow,mapLeft:OO},Chain:OK,Do:kr,FromEither:OG,FromIO:O3,FromTask:O6,Functor:OW,Monad:{URI:OP,map:Ox,ap:O_,chain:OT,of:w5},MonadIO:{URI:OP,map:Ox,ap:O_,chain:OT,of:w5,fromIO:w8},MonadTask:{URI:OP,map:Ox,ap:O_,chain:OT,of:w5,fromIO:w8,fromTask:w9},MonadThrow:{URI:OP,map:Ox,ap:O_,chain:OT,of:w5,throwError:w4},Pointed:{URI:OP,of:w5},URI:OP,alt:OA,altW:OA,ap:OR,apFirst:OB,apFirstW:OB,apS:ka,apSW:ka,apSecond:OV,apSecondW:OV,apW:OR,bimap:OC,bind:ko,bindTo:ki,bindW:ko,bracket:kt,bracketW:kn,chain:OE,chainEitherK:OQ,chainEitherKW:OQ,chainFirst:OH,chainFirstEitherK:OX,chainFirstEitherKW:OX,chainFirstIOK:O9,chainFirstTaskK:ke,chainFirstW:OH,chainIOEitherK:Ob,chainIOEitherKW:Ob,chainIOK:O5,chainNullableK:Oc,chainOptionK:OJ,chainTaskK:O7,chainTaskOptionK:Oy,chainTaskOptionKW:Oy,chainW:Oj,filterOrElse:O1,filterOrElseW:O1,flap:OU,flatten:ON,flattenW:ON,fold:On,foldW:On,fromEither:TM,fromEitherK:O2,fromIO:w8,fromIOEither:TS,fromIOEitherK:Ov,fromIOK:O4,fromNullable:Ou,fromNullableK:Os,fromOption:OZ,fromOptionK:OY,fromPredicate:O0,fromTask:w9,fromTaskK:O8,fromTaskOption:Oe,fromTaskOptionK:Og,getAltTaskValidation:OD,getApplicativeTaskValidation:OL,getApplyMonoid:ky,getApplySemigroup:kg,getCompactable:OF,getFilterable:function(t){var n=d7(t),r=OF(t),i=hM(TN,n),o=hR(TN,n),a=hE(TN,n),u=hj(TN,n);return{URI:OP,_E:void 0,map:Ox,compact:r.compact,separate:r.separate,filter:function(t,n){return eL(t,i(n))},filterMap:function(t,n){return eL(t,o(n))},partition:function(t,n){return eL(t,a(n))},partitionMap:function(t,n){return eL(t,u(n))}}},getOrElse:Or,getOrElseW:Or,getSemigroup:kv,getTaskValidation:function(t){var n=OL(TW,t),r=OD(t);return{URI:OP,_E:void 0,map:Ox,ap:n.ap,of:w5,chain:OT,bimap:Ow,mapLeft:OO,alt:r.alt,fromIO:w8,fromTask:w9,throwError:w4}},left:w4,leftIO:w7,leftTask:w6,map:OI,mapLeft:OM,match:Ot,matchE:On,matchEW:On,matchW:Ot,of:w5,orElse:Ol,orElseFirst:Of,orElseFirstIOK:Od,orElseFirstTaskK:Op,orElseFirstW:Of,orElseW:Ol,orLeft:Oh,right:w5,rightIO:w8,rightTask:w9,sequenceArray:kp,sequenceSeqArray:km,swap:Om,taskEither:{URI:OP,bimap:Ow,mapLeft:OO,map:Ox,of:w5,ap:O_,chain:OT,alt:Ok,fromIO:w8,fromTask:w9,throwError:w4},taskEitherSeq:{URI:OP,bimap:Ow,mapLeft:OO,map:Ox,of:w5,ap:OS,chain:OT,alt:Ok,fromIO:w8,fromTask:w9,throwError:w4},taskify:function(t){return function(){var n=Array.prototype.slice.call(arguments);return function(){return new Promise(function(r){var i=function(t,n){return null!=t?r(eH(t)):r(eG(n))};t.apply(null,n.concat(i))})}}},throwError:w4,toUnion:Oa,traverseArray:kd,traverseArrayWithIndex:kc,traverseReadonlyArrayWithIndex:kc,traverseReadonlyArrayWithIndexSeq:kf,traverseReadonlyNonEmptyArrayWithIndex:ks,traverseReadonlyNonEmptyArrayWithIndexSeq:kl,traverseSeqArray:kh,traverseSeqArrayWithIndex:kf,tryCatch:Oi,tryCatchK:Oo},Symbol.toStringTag,{value:"Module"}));var kx=ht(wg),k_=he(wg),kS=eE(w9,ek),kT=eE(w6,ek),kw=function(t){return eE(t,w5)},kO=function(t){return eE(t,w4)},kk=hn(wh),kI=hr(wh),kC=eE(w8,ek),kM=eE(w7,ek),kR=eE(TS,ek),kE=function(t){return eE(t,TM)},kj=hh(wh),kN=hm(wS),kA=hg(wT),kP=h_(wh),kL=hi(wg),kD=ho(wg),kF=ha(wT),kW=hy(wT),kU=hv(wT),kz=hb(wT),kB=hx(wh),kV=function(t){return eE(t,kR)},k$=function(t){return k7(kV(t))},kq=function(t){return eE(t,ek)},kK=function(t){return k7(kq(t))},kH=function(t){return Ig(kq(t))},kG=function(t){return eE(t,kE)},kZ=function(t){return k7(kG(t))},kY=function(t){return Ig(kG(t))},kJ=function(t,n){return eL(t,k4(n))},kQ=function(t,n){return eL(t,k6(n))},kX=function(t,n){return eL(t,k8(function(t){return eL(n,k4(t))}))},k0=function(t,n){return eL(t,k8(n))},k1=function(t,n){return eL(t,It(n))},k2=function(t,n,r){return eL(t,k5(n,r))},k3=function(t,n){return eL(t,k9(n))},k4=hu(wh),k5=hf(wh),k9=hd(wh),k6=hs(wy),k8=hc(wT),k7=k8,Ie=k7(eO),It=hl(wT),In="ReaderTaskEither",Ir=function(t){var n=d8(t);return{URI:In,_E:void 0,compact:db(wh,n),separate:dx(wh,n,pi)}};function Ii(t,n){var r=e3(ml,OL(t,n));return{URI:In,_E:void 0,map:kJ,ap:function(t,n){return eL(t,r(n))},of:k_}}function Io(t){var n=hp(wT,t);return{URI:In,_E:void 0,map:kJ,alt:function(t,r){return eL(t,n(r))}}}var Ia={URI:In,map:kJ},Iu=ti(Ia),Is={URI:In,of:k_},Ic={URI:In,map:kJ,ap:kQ},Il=e4(Ic),If=e5(Ic),Id={URI:In,map:kJ,ap:kX},Ip={URI:In,map:kJ,ap:kX,of:k_},Ih={URI:In,map:kJ,ap:kQ,chain:k0},Im=tf(Ih),Ig=Im,Iy={URI:In,fromReader:kw},Iv=mM(Iy),Ib=mR(Iy),Ix=mE(Iy),I_=mj(Iy,Ih),IS=mN(Iy,Ih),IT=function(t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return kk(t.apply(void 0,n))}},Iw=function(t){return k7(IT(t))},IO=function(t){return Ig(IT(t))},Ik={URI:In,fromEither:wl},II=th(Ik),IC=tg(Ik),IM=ty(Ik,Ih),IR=tb(Ik,Ih),IE=tx(Ik,Ih),Ij=tm(Ik),IN=t_(Ik,Ih),IA=tv(Ik),IP={URI:In,fromIO:kC},IL=hq(IP),ID=hK(IP,Ih),IF=hH(IP,Ih),IW={URI:In,fromIO:kC,fromTask:kS},IU=gf(IW),Iz=gd(IW,Ih),IB=gp(IW,Ih);function IV(t,n,r){return I$(t,n,r)}function I$(t,n,r){return function(i){return kn(t(i),function(t){return n(t)(i)},function(t,n){return r(t,n)(i)})}}var Iq=k_(e0),IK=to(Ia),IH=td(Ih),IG=e9(Ic),IZ=k_(eX),IY=function(t){return eE(mS(t),h3(ks(eD)))},IJ=function(t){var n=IY(t);return function(t){return eY(t)?n(t):IZ}},IQ=function(t){return eE(mS(t),h3(kl(eD)))},IX=function(t){var n=IQ(t);return function(t){return eY(t)?n(t):IZ}},I0=function(t){return IJ(function(n,r){return t(r)})},I1=I0(eO),I2=function(t){return IX(function(n,r){return t(r)})},I3=I2(eO),I4=e6(Id),I5=ts(Ip),I9=function(t){return e6(wx)(d6(t))};function I6(t,n){return t(n)()}let I8=Object.freeze(Object.defineProperty({__proto__:null,Alt:{URI:In,map:kJ,alt:k1},ApT:IZ,ApplicativePar:{URI:In,map:kJ,ap:kQ,of:k_},ApplicativeSeq:Ip,ApplyPar:Ic,ApplySeq:Id,Bifunctor:{URI:In,bimap:k2,mapLeft:k3},Chain:Ih,Do:Iq,FromEither:Ik,FromIO:IP,FromReader:Iy,FromTask:IW,Functor:Ia,Monad:{URI:In,map:kJ,ap:kQ,chain:k0,of:k_},MonadIO:{URI:In,map:kJ,ap:kQ,chain:k0,of:k_,fromIO:kC},MonadTask:{URI:In,map:kJ,ap:kQ,chain:k0,of:k_,fromIO:kC,fromTask:kS},MonadThrow:{URI:In,map:kJ,ap:kQ,chain:k0,of:k_,throwError:kx},Pointed:Is,URI:In,alt:It,altW:It,ap:k6,apFirst:Il,apFirstW:Il,apS:IG,apSW:IG,apSecond:If,apSecondW:If,apW:k6,ask:Iv,asks:Ib,asksReaderTaskEither:hJ,asksReaderTaskEitherW:hJ,bimap:k5,bind:IH,bindTo:IK,bindW:IH,bracket:IV,bracketW:I$,chain:k8,chainEitherK:IR,chainEitherKW:IR,chainFirst:Im,chainFirstEitherK:IE,chainFirstEitherKW:IE,chainFirstIOK:IF,chainFirstReaderEitherK:kY,chainFirstReaderEitherKW:kY,chainFirstReaderK:IS,chainFirstReaderKW:IS,chainFirstReaderTaskK:IO,chainFirstReaderTaskKW:IO,chainFirstTaskEitherK:kH,chainFirstTaskEitherKW:kH,chainFirstTaskK:IB,chainFirstW:Ig,chainIOEitherK:k$,chainIOEitherKW:k$,chainIOK:ID,chainNullableK:kF,chainOptionK:IM,chainReaderEitherK:kZ,chainReaderEitherKW:kZ,chainReaderK:I_,chainReaderKW:I_,chainReaderTaskK:Iw,chainReaderTaskKW:Iw,chainTaskEitherK:kK,chainTaskEitherKW:kK,chainTaskK:Iz,chainW:k7,filterOrElse:IN,filterOrElseW:IN,flap:Iu,flatten:Ie,flattenW:Ie,fold:kN,foldW:kN,fromEither:wl,fromEitherK:IA,fromIO:kC,fromIOEither:kR,fromIOEitherK:kV,fromIOK:IL,fromNullable:kL,fromNullableK:kD,fromOption:II,fromOptionK:IC,fromPredicate:Ij,fromReader:kw,fromReaderEither:kE,fromReaderEitherK:kG,fromReaderK:Ix,fromReaderTaskK:IT,fromTask:kS,fromTaskEither:ek,fromTaskEitherK:kq,fromTaskK:IU,getAltReaderTaskValidation:Io,getApplicativeReaderTaskValidation:Ii,getApplyMonoid:I5,getApplySemigroup:I4,getCompactable:Ir,getFilterable:function(t){var n=d7(t),r=Ir(t),i=hM(wh,n),o=hR(wh,n),a=hE(wh,n),u=hj(wh,n);return{URI:In,_E:void 0,map:kJ,compact:r.compact,separate:r.separate,filter:function(t,n){return eL(t,i(n))},filterMap:function(t,n){return eL(t,o(n))},partition:function(t,n){return eL(t,a(n))},partitionMap:function(t,n){return eL(t,u(n))}}},getOrElse:kA,getOrElseW:kA,getReaderTaskValidation:function(t){var n=Ii(TW,t),r=Io(t);return{URI:In,_E:void 0,map:kJ,of:k_,chain:k0,bimap:k2,mapLeft:k3,ap:n.ap,alt:r.alt,fromIO:kC,fromTask:kS,throwError:kx}},getSemigroup:I9,left:kx,leftIO:kM,leftReader:kO,leftReaderTask:kI,leftTask:kT,local:hY,map:k4,mapLeft:k9,match:kj,matchE:kN,matchEW:kN,matchW:kj,of:k_,orElse:kW,orElseFirst:kU,orElseFirstW:kU,orElseW:kW,orLeft:kz,readerTaskEither:{URI:In,map:kJ,of:k_,ap:kQ,chain:k0,alt:k1,bimap:k2,mapLeft:k3,fromIO:kC,fromTask:kS,throwError:kx},readerTaskEitherSeq:{URI:In,map:kJ,of:k_,ap:kX,chain:k0,alt:k1,bimap:k2,mapLeft:k3,fromIO:kC,fromTask:kS,throwError:kx},right:k_,rightIO:kC,rightReader:kw,rightReaderTask:kk,rightTask:kS,run:I6,sequenceArray:I1,sequenceSeqArray:I3,swap:kB,throwError:kx,toUnion:kP,traverseArray:I0,traverseArrayWithIndex:IJ,traverseReadonlyArrayWithIndex:IJ,traverseReadonlyArrayWithIndexSeq:IX,traverseReadonlyNonEmptyArrayWithIndex:IY,traverseReadonlyNonEmptyArrayWithIndexSeq:IQ,traverseSeqArray:I2,traverseSeqArrayWithIndex:IX},Symbol.toStringTag,{value:"Module"}));var I7={equals:function(t,n){return t===n}},Ce={concat:function(t,n){return t+n}},Ct={concat:Ce.concat,empty:""},Cn={equals:I7.equals,compare:function(t,n){return t<n?-1:t>n?1:0}},Cr=function(t){return"string"==typeof t},Ci=function(t){return t.toUpperCase()},Co=function(t){return t.toLowerCase()},Ca=function(t,n){return function(r){return r.replace(t,n)}},Cu=function(t){return t.trim()},Cs=function(t){return t.trimLeft()},Cc=function(t){return t.trimRight()},Cl=function(t,n){return function(r){return r.slice(t,n)}},Cf=function(t){return 0===t.length},Cd=function(t){return t.length},Cp=function(t){return function(n){var r=n.split(t);return eY(r)?r:[n]}},Ch=function(t,n){return function(r){return r.includes(t,n)}},Cm=function(t,n){return function(r){return r.startsWith(t,n)}},Cg=function(t,n){return function(r){return r.endsWith(t,n)}};let Cy=Object.freeze(Object.defineProperty({__proto__:null,Eq:I7,Monoid:Ct,Ord:Cn,Semigroup:Ce,Show:{show:function(t){return JSON.stringify(t)}},empty:"",endsWith:Cg,includes:Ch,isEmpty:Cf,isString:Cr,replace:Ca,size:Cd,slice:Cl,split:Cp,startsWith:Cm,toLowerCase:Co,toUpperCase:Ci,trim:Cu,trimLeft:Cs,trimRight:Cc},Symbol.toStringTag,{value:"Module"}));var Cv=function(t){return Object.assign({},t)},Cb=function(t){return Object.assign({},t)},Cx=function(t){return Object.keys(t).length},C_=function(t){for(var n in t)if(e1.call(t,n))return!1;return!0},CS=function(t){return function(n){return Object.keys(n).sort(t.compare)}},CT=CS(Cn);function Cw(t){if("function"==typeof t)return Cw(Cn)(t);var n=CS(t);return function(t){return function(r){for(var i=[],o=0,a=n(r);o<a.length;o++){var u=a[o];i.push(t(u,r[u]))}return i}}}var CO=Cw(Cn)(function(t,n){return[t,n]}),Ck=function(t,n){return function(r){if(e1.call(r,t)&&r[t]===n)return r;var i=Object.assign({},r);return i[t]=n,i}},CI=function(t,n){return e1.call(n,t)};function CC(t){return function(n){if(!e1.call(n,t))return n;var r=Object.assign({},n);return delete r[t],r}}var CM=function(t,n){return function(r){if(!CI(t,r))return eV;if(r[t]===n)return e$(r);var i=Object.assign({},r);return i[t]=n,e$(i)}},CR=function(t,n){return function(r){if(!CI(t,r))return eV;var i=n(r[t]);if(i===r[t])return e$(r);var o=Object.assign({},r);return o[t]=i,e$(o)}};function CE(t){return function(n,r){if(void 0===r){var i=CE(t);return function(t){return i(t,n)}}for(var o in n)if(!e1.call(r,o)||!t.equals(n[o],r[o]))return!1;return!0}}function Cj(t,n){return void 0===n?function(n){return Cj(t,n)}:e1.call(n,t)?e$(n[t]):eV}var CN={};function CA(t){return function(n){var r={};for(var i in n)e1.call(n,i)&&(r[i]=t(i,n[i]));return r}}function CP(t){return CA(function(n,r){return t(r)})}function CL(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];if(2===t.length)return CL(Cn).apply(void 0,t);var r=CS(t[0]);return function(t,n){return function(i){for(var o=t,a=r(i),u=a.length,s=0;s<u;s++){var c=a[s];o=n(c,o,i[c])}return o}}}function CD(t){if("compare"in t){var n=CS(t);return function(t){return function(r){return function(i){for(var o=t.empty,a=n(i),u=a.length,s=0;s<u;s++){var c=a[s];o=t.concat(o,r(c,i[c]))}return o}}}}return CD(Cn)(t)}function CF(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];if(2===t.length)return CF(Cn).apply(void 0,t);var r=CS(t[0]);return function(t,n){return function(i){for(var o=t,a=r(i),u=a.length,s=u-1;s>=0;s--){var c=a[s];o=n(c,i[c],o)}return o}}}var CW=function(t,n){var r;return(r={})[t]=n,r};function CU(t){var n=Md(Cn)(t);return function(t){return function(r){return n(r,t)}}}function Cz(t){var n=Ml(Cn)(t);return function(t){return function(r){return n(r,t)}}}function CB(t){return Mf(Cn)(t)}var CV=function(t){var n=Cz(t);return function(r){return function(i){return t.map(eL(i,n(r)),Mx)}}},C$=function(t){var n=Cz(t);return function(r){return function(i){return t.map(eL(i,n(r)),M_)}}};function Cq(t){return function(n){var r={},i={};for(var o in n)if(e1.call(n,o)){var a=t(o,n[o]);switch(a._tag){case"Left":r[o]=a.left;break;case"Right":i[o]=a.right}}return oE(r,i)}}function CK(t){return function(n){var r={},i={};for(var o in n)if(e1.call(n,o)){var a=n[o];t(o,a)?i[o]=a:r[o]=a}return oE(r,i)}}function CH(t){return function(n){var r={};for(var i in n)if(e1.call(n,i)){var o=t(i,n[i]);eB(o)&&(r[i]=o.value)}return r}}function CG(t){return function(n){var r={},i=!1;for(var o in n)if(e1.call(n,o)){var a=n[o];t(o,a)?r[o]=a:i=!0}return i?r:n}}function CZ(t,n){var r=CY(t,n);return function(t){return r(t,eO)}}function CY(t,n){return function(r,i){return n.reduce(r,{},function(n,r){var o=i(r),a=o[0],u=o[1];return n[a]=e1.call(n,a)?t.concat(n[a],u):u,n})}}var CJ=function(t){for(var n={},r=0;r<t.length;r++){var i=t[r];n[i[0]]=i[1]}return n};function CQ(t){return function(n){for(var r in n)if(!t(n[r]))return!1;return!0}}function CX(t){return function(n){for(var r in n)if(t(n[r]))return!0;return!1}}function C0(t){return function(n,r){if(void 0===r){var i=C0(t);return function(t){return i(n,t)}}for(var o in r)if(t.equals(r[o],n))return!0;return!1}}var C1=function(t){return function(n){return function(r){if(C_(r))return n;if(C_(n))return r;var i={};for(var o in r)CI(o,n)?i[o]=t.concat(r[o],n[o]):i[o]=r[o];for(var o in n)CI(o,i)||(i[o]=n[o]);return i}}},C2=function(t){return function(n){return function(r){if(C_(r)||C_(n))return CN;var i={};for(var o in r)CI(o,n)&&(i[o]=t.concat(r[o],n[o]));return i}}},C3=function(t){return function(n){if(C_(n))return t;if(C_(t))return n;var r={};for(var i in n)CI(i,t)||(r[i]=n[i]);for(var i in t)CI(i,n)||(r[i]=t[i]);return r}},C4=function(t,n){return eL(t,CP(n))},C5=function(t,n){return eL(t,CA(n))},C9=function(t){var n=My(t);return function(t,r,i){return eL(t,n(r,i))}},C6=function(t){return function(n){var r=Mv(t)(n);return function(t,n){return eL(t,r(n))}}},C8=function(t){var n=Mb(t);return function(t,r,i){return eL(t,n(r,i))}},C7=function(t,n){return eL(t,Mp(n))},Me=function(t,n){return eL(t,Mh(n))},Mt=function(t,n){return eL(t,Mm(n))},Mn=function(t,n){return eL(t,Mg(n))},Mr=function(t){var n=CL(t);return function(t,r,i){return eL(t,n(r,i))}},Mi=function(t){var n=CD(t);return function(t){var r=n(t);return function(t,n){return eL(t,r(n))}}},Mo=function(t){var n=CF(t);return function(t,r,i){return eL(t,n(r,i))}},Ma=function(t,n){return eL(t,Cq(n))},Mu=function(t,n){return eL(t,CK(n))},Ms=function(t,n){return eL(t,CH(n))},Mc=function(t,n){return eL(t,CG(n))},Ml=function(t){var n=Md(t);return function(t){var r=n(t);return function(t,n){return r(t,eE(eD,n))}}},Mf=function(t){var n=Ml(t);return function(t){var r=n(t);return function(t){return r(t,eO)}}},Md=function(t){return function(n){var r=CS(t);return function(t,i){var o=r(t);if(0===o.length)return n.of(CN);for(var a=n.of({}),u=function(r){a=n.ap(n.map(a,function(t){return function(n){var i;return Object.assign({},t,((i={})[r]=n,i))}}),i(r,t[r]))},s=0;s<o.length;s++)u(o[s]);return a}}},Mp=function(t){return CG(function(n,r){return t(r)})},Mh=function(t){return CH(function(n,r){return t(r)})},Mm=function(t){return CK(function(n,r){return t(r)})},Mg=function(t){return Cq(function(n,r){return t(r)})};function My(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];if(1===t.length){var r=CL(t[0]);return function(t,n){return r(t,function(t,r,i){return n(r,i)})}}return My(Cn).apply(void 0,t)}function Mv(t){if("compare"in t){var n=CD(t);return function(t){var r=n(t);return function(t){return r(function(n,r){return t(r)})}}}return Mv(Cn)(t)}function Mb(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];if(1===t.length){var r=CF(t[0]);return function(t,n){return r(t,function(t,r,i){return n(r,i)})}}return Mb(Cn).apply(void 0,t)}var Mx=function(t){var n={};for(var r in t)if(e1.call(t,r)){var i=t[r];eB(i)&&(n[r]=i.value)}return n},M_=function(t){var n={},r={};for(var i in t)if(e1.call(t,i)){var o=t[i];eq(o)?n[i]=o.left:r[i]=o.right}return oE(n,r)},MS="ReadonlyRecord";function MT(t){return"compare"in t?function(n){return{show:function(r){var i=Cw(t)(function(t,r){return"".concat(JSON.stringify(t),": ").concat(n.show(r))})(r).join(", ");return""===i?"{}":"{ ".concat(i," }")}}}:MT(Cn)(t)}function Mw(t){var n=CE(t);return tT(function(t,r){return n(t)(r)&&n(r)(t)})}function MO(t){return{concat:function(n,r){if(C_(n))return r;if(C_(r))return n;var i=Object.assign({},n);for(var o in r)e1.call(r,o)&&(i[o]=e1.call(n,o)?t.concat(n[o],r[o]):r[o]);return i},empty:CN}}var Mk={URI:MS,map:C4},MI=ti(Mk),MC=function(t){return{URI:MS,reduce:C9(t),foldMap:C6(t),reduceRight:C8(t)}},MM=function(t){return{URI:MS,reduce:C9(t),foldMap:C6(t),reduceRight:C8(t),reduceWithIndex:Mr(t),foldMapWithIndex:Mi(t),reduceRightWithIndex:Mo(t)}},MR={URI:MS,compact:Mx,separate:M_},ME=function(t){return{URI:MS,map:C4,reduce:C9(t),foldMap:C6(t),reduceRight:C8(t),traverse:Ml(t),sequence:Mf(t)}},Mj=function(t){return{URI:MS,map:C4,mapWithIndex:C5,reduce:C9(t),foldMap:C6(t),reduceRight:C8(t),reduceWithIndex:Mr(t),foldMapWithIndex:Mi(t),reduceRightWithIndex:Mo(t),traverse:Ml(t),sequence:Mf(t),traverseWithIndex:Md(t)}},MN=function(t){var n=ME(t);return{URI:MS,map:C4,reduce:C9(t),foldMap:C6(t),reduceRight:C8(t),traverse:n.traverse,sequence:n.sequence,compact:Mx,separate:M_,filter:C7,filterMap:Me,partition:Mt,partitionMap:Mn,wither:o$(n,MR),wilt:oV(n,MR)}},MA=function(t){var n=C1(t);return{concat:function(t,r){return n(r)(t)}}},MP=function(t){return{concat:MA(t).concat,empty:CN}},ML=function(t){var n=C2(t);return{concat:function(t,r){return n(r)(t)}}},MD=function(){return{concat:function(t,n){return C3(n)(t)}}},MF={URI:MS,reduce:C9(Cn),foldMap:C6(Cn),reduceRight:C8(Cn)},MW={URI:MS,reduce:C9(Cn),foldMap:C6(Cn),reduceRight:C8(Cn),reduceWithIndex:Mr(Cn),foldMapWithIndex:Mi(Cn),reduceRightWithIndex:Mo(Cn)},MU={URI:MS,map:C4,reduce:C9(Cn),foldMap:C6(Cn),reduceRight:C8(Cn),traverse:Ml(Cn),sequence:CB},Mz={URI:MS,map:C4,mapWithIndex:C5,reduce:C9(Cn),foldMap:C6(Cn),reduceRight:C8(Cn),reduceWithIndex:Mr(Cn),foldMapWithIndex:Mi(Cn),reduceRightWithIndex:Mo(Cn),traverse:Ml(Cn),sequence:CB,traverseWithIndex:Md(Cn)},MB=o$(MU,MR),MV=oV(MU,MR),M$={URI:MS,map:C4,reduce:C9(Cn),foldMap:C6(Cn),reduceRight:C8(Cn),traverse:Ml(Cn),sequence:CB,compact:Mx,separate:M_,filter:C7,filterMap:Me,partition:Mt,partitionMap:Mn,wither:MB,wilt:MV};function Mq(t,n){return e1.call(void 0===n?this:n,t)}var MK={URI:MS,map:C4,reduce:C9(Cn),foldMap:C6(Cn),reduceRight:C8(Cn),traverse:Ml(Cn),sequence:CB,compact:Mx,separate:M_,filter:C7,filterMap:Me,partition:Mt,partitionMap:Mn,mapWithIndex:C5,reduceWithIndex:Mr(Cn),foldMapWithIndex:Mi(Cn),reduceRightWithIndex:Mo(Cn),filterMapWithIndex:Ms,filterWithIndex:Mc,partitionMapWithIndex:Ma,partitionWithIndex:Mu,traverseWithIndex:Md(Cn),wither:MB,wilt:MV};let MH=Object.freeze(Object.defineProperty({__proto__:null,Compactable:MR,Filterable:{URI:MS,map:C4,compact:Mx,separate:M_,filter:C7,filterMap:Me,partition:Mt,partitionMap:Mn},FilterableWithIndex:{URI:MS,map:C4,mapWithIndex:C5,compact:Mx,separate:M_,filter:C7,filterMap:Me,partition:Mt,partitionMap:Mn,filterMapWithIndex:Ms,filterWithIndex:Mc,partitionMapWithIndex:Ma,partitionWithIndex:Mu},Foldable:MF,FoldableWithIndex:MW,Functor:Mk,FunctorWithIndex:{URI:MS,map:C4,mapWithIndex:C5},Traversable:MU,TraversableWithIndex:Mz,URI:MS,Witherable:M$,_filter:C7,_filterMap:Me,_filterMapWithIndex:Ms,_filterWithIndex:Mc,_foldMap:C6,_foldMapWithIndex:Mi,_map:C4,_mapWithIndex:C5,_partition:Mt,_partitionMap:Mn,_partitionMapWithIndex:Ma,_partitionWithIndex:Mu,_reduce:C9,_reduceRight:C8,_reduceRightWithIndex:Mo,_reduceWithIndex:Mr,_sequence:Mf,_traverse:Ml,collect:Cw,compact:Mx,deleteAt:CC,difference:C3,elem:C0,empty:CN,every:CQ,filter:Mp,filterMap:Mh,filterMapWithIndex:CH,filterWithIndex:CG,flap:MI,foldMap:Mv,foldMapWithIndex:CD,fromEntries:CJ,fromFoldable:CZ,fromFoldableMap:CY,fromRecord:Cv,getDifferenceMagma:MD,getEq:Mw,getFoldable:MC,getFoldableWithIndex:MM,getIntersectionSemigroup:ML,getMonoid:MO,getShow:MT,getTraversable:ME,getTraversableWithIndex:Mj,getUnionMonoid:MP,getUnionSemigroup:MA,getWitherable:MN,has:CI,hasOwnProperty:Mq,insertAt:Ck,intersection:C2,isEmpty:C_,isSubrecord:CE,keys:CT,lookup:Cj,map:CP,mapWithIndex:CA,modifyAt:CR,partition:Mm,partitionMap:Mg,partitionMapWithIndex:Cq,partitionWithIndex:CK,pop:function(t){var n=CC(t);return function(r){var i=Cj(t,r);return ez(i)?eV:e$([i.value,n(r)])}},readonlyRecord:MK,reduce:My,reduceRight:Mb,reduceRightWithIndex:CF,reduceWithIndex:CL,separate:M_,sequence:CB,singleton:CW,size:Cx,some:CX,toEntries:CO,toReadonlyArray:CO,toRecord:Cb,toUnfoldable:function(t){return function(n){var r=CO(n),i=r.length;return t.unfold(0,function(t){return t<i?e$([r[t],t+1]):eV})}},traverse:Cz,traverseWithIndex:CU,union:C1,updateAt:CM,upsertAt:Ck,wilt:C$,wither:CV},Symbol.toStringTag,{value:"Module"}));var MG=function(t){return new Set(t)},MZ=function(t){return new Set([t])},MY=function(t){return function(n){for(var r=n.length,i=new Set,o=Ro(t),a=0;a<r;a++){var u=n[a];o(u,i)||i.add(u)}return i}};function MJ(t){return function(n){for(var r,i=n.values(),o=new Set;!(r=i.next()).done;){var a=r.value;t(a)&&o.add(a)}return o}}function MQ(t){var n=Ro(t);return function(r,i){if(void 0===i){var o=MQ(t);return function(t){return o(r,t)}}if(Re(r))return i;if(Re(i))return r;var a=new Set(r);return i.forEach(function(t){n(t,a)||a.add(t)}),a}}function MX(t){var n=Ro(t);return function(r,i){if(void 0===i){var o=MX(t);return function(t){return o(t,r)}}if(Re(r)||Re(i))return M7;var a=new Set;return r.forEach(function(t){n(t,i)&&a.add(t)}),a}}function M0(t){var n=Ro(t);return function(r,i){if(void 0===i){var o=M0(t);return function(t){return o(t,r)}}return MJ(function(t){return!n(t,i)})(r)}}function M1(t){var n=Ra(t);return function(t,r){return function(i){return n(i).reduce(r,t)}}}function M2(t,n){var r=Ra(t);return function(t){return function(i){return r(i).reduce(function(r,i){return n.concat(r,t(i))},n.empty)}}}var M3=function(t){var n=Ra(t);return function(t,r){return function(i){return n(i).reduceRight(function(t,n){return r(n,t)},t)}}};function M4(t){var n=Ro(t);return function(t){return function(r){if(n(t)(r))return r;var i=new Set(r);return i.add(t),i}}}var M5=function(t){return function(n){return function(r){return MJ(function(r){return!t.equals(n,r)})(r)}}},M9=function(t){var n=Ro(t),r=M5(t),i=M4(t);return function(t){return function(o){return(n(t,o)?r:i)(t)(o)}}},M6=function(t){return M8(t)(eO)};function M8(t){var n=Ro(t);return function(t){return function(r){var i=new Set;return r.forEach(function(r){var o=t(r);"Some"!==o._tag||n(o.value,i)||i.add(o.value)}),i}}}var M7=new Set,Re=function(t){return 0===t.size},Rt=function(t){return t.size},Rn=function(t){return function(n){for(var r,i=n.values(),o=!1;!o&&!(r=i.next()).done;)o=t(r.value);return o}};function Rr(t){return lJ(Rn(lJ(t)))}function Ri(t){var n=Ro(t);return function(r,i){if(void 0===i){var o=Ri(t);return function(t){return o(t,r)}}return Rr(function(t){return n(t,i)})(r)}}function Ro(t){return function(n,r){if(void 0===r){var i=Ro(t);return function(t){return i(n,t)}}for(var o,a=r.values(),u=!1;!u&&!(o=a.next()).done;)u=t.equals(n,o.value);return u}}var Ra=function(t){return function(n){var r=[];return n.forEach(function(t){return r.push(t)}),r.sort(t.compare)}};function Ru(t){return{show:function(n){var r=[];return n.forEach(function(n){r.push(t.show(n))}),"new Set([".concat(r.sort().join(", "),"])")}}}function Rs(t){var n=Ri(t);return tT(function(t,r){return n(t,r)&&n(r,t)})}var Rc=function(t){return{concat:MQ(t)}},Rl=function(t){return{concat:Rc(t).concat,empty:M7}},Rf=function(t){return{concat:MX(t)}},Rd=function(t){return{concat:M0(t)}};let Rp=Object.freeze(Object.defineProperty({__proto__:null,URI:"ReadonlySet",chain:function(t){var n=Ro(t);return function(t){return function(r){var i=new Set;return r.forEach(function(r){t(r).forEach(function(t){n(t,i)||i.add(t)})}),i}}},compact:M6,difference:M0,elem:Ro,empty:M7,every:Rr,filter:MJ,filterMap:M8,foldMap:M2,fromArray:MY,fromReadonlyArray:MY,fromSet:MG,getDifferenceMagma:Rd,getEq:Rs,getIntersectionSemigroup:Rf,getShow:Ru,getUnionMonoid:Rl,getUnionSemigroup:Rc,insert:M4,intersection:MX,isEmpty:Re,isSubset:Ri,map:function(t){var n=Ro(t);return function(t){return function(r){var i=new Set;return r.forEach(function(r){var o=t(r);n(o,i)||i.add(o)}),i}}},partition:function(t){return function(n){for(var r,i=n.values(),o=new Set,a=new Set;!(r=i.next()).done;){var u=r.value;t(u)?o.add(u):a.add(u)}return oE(a,o)}},partitionMap:function(t,n){return function(r){return function(i){for(var o,a=i.values(),u=new Set,s=new Set,c=Ro(t),l=Ro(n);!(o=a.next()).done;){var f=r(o.value);switch(f._tag){case"Left":c(f.left,u)||u.add(f.left);break;case"Right":l(f.right,s)||s.add(f.right)}}return oE(u,s)}}},reduce:M1,reduceRight:M3,remove:M5,separate:function(t,n){return function(r){var i=Ro(t),o=Ro(n),a=new Set,u=new Set;return r.forEach(function(t){switch(t._tag){case"Left":i(t.left,a)||a.add(t.left);break;case"Right":o(t.right,u)||u.add(t.right)}}),oE(a,u)}},singleton:MZ,size:Rt,some:Rn,toReadonlyArray:Ra,toSet:function(t){return new Set(t)},toggle:M9,union:MQ},Symbol.toStringTag,{value:"Module"}));function Rh(t){return t[0]}function Rm(t){return t[1]}var Rg=function(t){var n;return[Rm(t),t[0]]};function Ry(t){return{URI:RU,_E:void 0,map:R_,ap:function(n,r){var i,o;return[(0,n[0])(r[0]),t.concat(Rm(n),Rm(r))]}}}var Rv=function(t){return function(n){return[n,t.empty]}};function Rb(t){var n=Ry(t);return{URI:RU,_E:void 0,map:n.map,ap:n.ap,chain:function(n,r){var i,o=r(n[0]),a=o[0],u=o[1];return[a,t.concat(Rm(n),u)]}}}var Rx=function(t,n){return eL(t,Rj(n))},R_=function(t,n){return eL(t,RR(n))},RS=function(t,n,r){return eL(t,RM(n,r))},RT=function(t,n){return eL(t,RE(n))},Rw=function(t,n){return eL(t,RN(n))},RO=function(t,n,r){return eL(t,RP(n,r))},Rk=function(t){var n=RL();return function(t,r){return eL(t,n(r))}},RI=function(t,n,r){return eL(t,RD(n,r))},RC=function(t){var n=RF(t);return function(t,r){return eL(t,n(r))}},RM=function(t,n){return function(r){var i;return[n(r[0]),t(Rm(r))]}},RR=function(t){return function(n){var r;return[t(n[0]),Rm(n)]}},RE=function(t){return function(n){var r;return[n[0],t(Rm(n))]}},Rj=function(t){return function(n){var r;return[n[0],Rm(t)]}},RN=function(t){return function(n){return[t(n),Rm(n)]}},RA=RN(eO),RP=function(t,n){return function(r){var i;return n(t,r[0])}},RL=function(){return function(t){return function(n){var r;return t(n[0])}}},RD=function(t,n){return function(r){var i;return n(r[0],t)}},RF=function(t){return function(n){return function(r){var i;return t.map(n(r[0]),function(t){return[t,Rm(r)]})}}},RW=function(t){return function(n){var r;return t.map(n[0],function(t){return[t,Rm(n)]})}},RU="ReadonlyTuple",Rz={URI:RU,map:R_},RB=ti(Rz);let RV=Object.freeze(Object.defineProperty({__proto__:null,Bifunctor:{URI:RU,bimap:RS,mapLeft:RT},Comonad:{URI:RU,map:R_,extend:Rw,extract:Rh},Foldable:{URI:RU,reduce:RO,foldMap:Rk,reduceRight:RI},Functor:Rz,Semigroupoid:{URI:RU,compose:Rx},Traversable:{URI:RU,map:R_,reduce:RO,foldMap:Rk,reduceRight:RI,traverse:RC,sequence:RW},URI:RU,bimap:RM,compose:Rj,duplicate:RA,extend:RN,extract:Rh,flap:RB,foldMap:RL,fst:Rh,getApplicative:function(t){var n=Ry(t);return{URI:RU,_E:void 0,map:n.map,ap:n.ap,of:Rv(t)}},getApply:Ry,getChain:Rb,getChainRec:function(t){var n=function(n,r){for(var i,o,a=r(n),u=t.empty,s=(i=a)[0];"Left"===s._tag;)u=t.concat(u,Rm(a)),s=(a=r(s.left))[0];return[s.right,t.concat(u,Rm(a))]},r=Rb(t);return{URI:RU,_E:void 0,map:r.map,ap:r.ap,chain:r.chain,chainRec:n}},getMonad:function(t){var n=Rb(t);return{URI:RU,_E:void 0,map:n.map,ap:n.ap,chain:n.chain,of:Rv(t)}},map:RR,mapFst:RR,mapLeft:RE,mapSnd:RE,readonlyTuple:{URI:RU,compose:Rx,map:R_,bimap:RS,mapLeft:RT,extract:Rh,extend:Rw,reduce:RO,foldMap:Rk,reduceRight:RI,traverse:RC,sequence:RW},reduce:RP,reduceRight:RD,sequence:RW,snd:Rm,swap:Rg,traverse:RF},Symbol.toStringTag,{value:"Module"}));var R$=globalThis&&globalThis.__assign||function(){return(R$=Object.assign||function(t){for(var n,r=1,i=arguments.length;r<i;r++)for(var o in n=arguments[r])Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o]);return t}).apply(this,arguments)},Rq=function(t){return function(n){return Object.keys(n).sort(t.compare)}},RK=Rq(Cn);function RH(t){if("function"==typeof t)return RH(Cn)(t);var n=Rq(t);return function(t){return function(r){for(var i=[],o=0,a=n(r);o<a.length;o++){var u=a[o];i.push(t(u,r[u]))}return i}}}var RG=RH(Cn)(function(t,n){return[t,n]});function RZ(t){return function(n){if(!e1.call(n,t))return n;var r=Object.assign({},n);return delete r[t],r}}var RY=function(t,n){return RJ(t,function(){return n})},RJ=function(t,n){return function(r){if(!CI(t,r))return eV;var i=Object.assign({},r);return i[t]=n(r[t]),e$(i)}};function RQ(t){return CU(t)}function RX(t){return Cz(t)}function R0(t){return CB(t)}var R1=function(t){var n,r=Cz(t);return function(n){return function(i){return t.map(eL(i,r(n)),En)}}},R2=function(t){var n,r=Cz(t);return function(n){return function(i){return t.map(eL(i,r(n)),Er)}}};function R3(t){return CK(t)}function R4(t){return CG(t)}function R5(t,n){return CZ(t,n)}var R9=function(t){var n,r;return(n=ni(),CZ(n,c8))(t)};function R6(t,n){return CY(t,n)}var R8=function(t){var n=C1(t);return function(t){return function(r){return C_(r)?R$({},t):C_(t)?R$({},r):n(t)(r)}}},R7=function(t){return function(n){return function(r){return C_(r)||C_(n)?{}:C2(t)(n)(r)}}},Ee=function(t){return function(n){return C_(n)?R$({},t):C_(t)?R$({},n):C3(t)(n)}},Et=function(t){return function(n){var r=Rq(t);return function(t,i){var o=r(t);if(0===o.length)return n.of({});for(var a=n.of({}),u=function(r){a=n.ap(n.map(a,function(t){return function(n){return t[r]=n,t}}),i(r,t[r]))},s=0;s<o.length;s++)u(o[s]);return a}}},En=Mx,Er=M_,Ei="Record",Eo={URI:Ei,map:C4},Ea=ti(Eo),Eu=function(t){return{URI:Ei,reduce:C9(t),foldMap:C6(t),reduceRight:C8(t)}},Es=function(t){return{URI:Ei,reduce:C9(t),foldMap:C6(t),reduceRight:C8(t),reduceWithIndex:Mr(t),foldMapWithIndex:Mi(t),reduceRightWithIndex:Mo(t)}},Ec={URI:Ei,compact:En,separate:Er},El=function(t){return{URI:Ei,map:C4,reduce:C9(t),foldMap:C6(t),reduceRight:C8(t),traverse:Ml(t),sequence:Mf(t)}},Ef=function(t){return{URI:Ei,map:C4,mapWithIndex:C5,reduce:C9(t),foldMap:C6(t),reduceRight:C8(t),reduceWithIndex:Mr(t),foldMapWithIndex:Mi(t),reduceRightWithIndex:Mo(t),traverse:Ml(t),sequence:Mf(t),traverseWithIndex:Et(t)}},Ed=function(t){var n=El(t);return{URI:Ei,map:C4,reduce:C9(t),foldMap:C6(t),reduceRight:C8(t),traverse:n.traverse,sequence:n.sequence,compact:En,separate:Er,filter:C7,filterMap:Me,partition:Mt,partitionMap:Mn,wither:o$(n,Ec),wilt:oV(n,Ec)}},Ep=function(t){var n=R8(t);return{concat:function(t,r){return n(r)(t)}}},Eh=function(t){return{concat:Ep(t).concat,empty:{}}},Em=function(t){var n=R7(t);return{concat:function(t,r){return n(r)(t)}}},Eg=function(){return{concat:function(t,n){return Ee(n)(t)}}},Ey={URI:Ei,reduce:C9(Cn),foldMap:C6(Cn),reduceRight:C8(Cn)},Ev={URI:Ei,reduce:C9(Cn),foldMap:C6(Cn),reduceRight:C8(Cn),reduceWithIndex:Mr(Cn),foldMapWithIndex:Mi(Cn),reduceRightWithIndex:Mo(Cn)},Eb={URI:Ei,map:C4,reduce:C9(Cn),foldMap:C6(Cn),reduceRight:C8(Cn),traverse:Ml(Cn),sequence:R0},Ex={URI:Ei,map:C4,mapWithIndex:C5,reduce:C9(Cn),foldMap:C6(Cn),reduceRight:C8(Cn),reduceWithIndex:Mr(Cn),foldMapWithIndex:Mi(Cn),reduceRightWithIndex:Mo(Cn),traverse:Ml(Cn),sequence:R0,traverseWithIndex:Et(Cn)},E_=o$(Eb,Ec),ES=oV(Eb,Ec),ET={URI:Ei,map:C4,reduce:C9(Cn),foldMap:C6(Cn),reduceRight:C8(Cn),traverse:Ml(Cn),sequence:R0,compact:En,separate:Er,filter:C7,filterMap:Me,partition:Mt,partitionMap:Mn,wither:E_,wilt:ES},Ew={URI:Ei,map:C4,reduce:C9(Cn),foldMap:C6(Cn),reduceRight:C8(Cn),traverse:Ml(Cn),sequence:R0,compact:En,separate:Er,filter:C7,filterMap:Me,partition:Mt,partitionMap:Mn,mapWithIndex:C5,reduceWithIndex:Mr(Cn),foldMapWithIndex:Mi(Cn),reduceRightWithIndex:Mo(Cn),filterMapWithIndex:Ms,filterWithIndex:Mc,partitionMapWithIndex:Ma,partitionWithIndex:Mu,traverseWithIndex:Et(Cn),wither:E_,wilt:ES};let EO=Object.freeze(Object.defineProperty({__proto__:null,Compactable:Ec,Filterable:{URI:Ei,map:C4,compact:En,separate:Er,filter:C7,filterMap:Me,partition:Mt,partitionMap:Mn},FilterableWithIndex:{URI:Ei,map:C4,mapWithIndex:C5,compact:En,separate:Er,filter:C7,filterMap:Me,partition:Mt,partitionMap:Mn,filterMapWithIndex:Ms,filterWithIndex:Mc,partitionMapWithIndex:Ma,partitionWithIndex:Mu},Foldable:Ey,FoldableWithIndex:Ev,Functor:Eo,FunctorWithIndex:{URI:Ei,map:C4,mapWithIndex:C5},Traversable:Eb,TraversableWithIndex:Ex,URI:Ei,Witherable:ET,collect:RH,compact:En,deleteAt:RZ,difference:Ee,elem:C0,empty:{},every:CQ,filter:Mp,filterMap:Mh,filterMapWithIndex:CH,filterWithIndex:R4,flap:Ea,foldMap:function(t){return"compare"in t?Mv(t):Mv(Cn)(t)},foldMapWithIndex:function(t){return"compare"in t?CD(t):CD(Cn)(t)},fromEntries:R9,fromFoldable:R5,fromFoldableMap:R6,getDifferenceMagma:Eg,getEq:Mw,getFoldable:Eu,getFoldableWithIndex:Es,getIntersectionSemigroup:Em,getMonoid:MO,getShow:function(t){return"compare"in t?MT(t):MT(Cn)(t)},getTraversable:El,getTraversableWithIndex:Ef,getUnionMonoid:Eh,getUnionSemigroup:Ep,getWitherable:Ed,has:CI,hasOwnProperty:Mq,insertAt:Ck,intersection:R7,isEmpty:C_,isSubrecord:CE,keys:RK,lookup:Cj,map:CP,mapWithIndex:CA,modifyAt:RJ,partition:Mm,partitionMap:Mg,partitionMapWithIndex:Cq,partitionWithIndex:R3,pop:function(t){var n=RZ(t);return function(r){var i=Cj(t,r);return ez(i)?eV:e$([i.value,n(r)])}},record:Ew,reduce:function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return 1===t.length?My(t[0]):My(Cn).apply(void 0,t)},reduceRight:function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return 1===t.length?Mb(t[0]):Mb(Cn).apply(void 0,t)},reduceRightWithIndex:function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return 1===t.length?CF(t[0]):CF(Cn).apply(void 0,t)},reduceWithIndex:function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return 1===t.length?CL(t[0]):CL(Cn).apply(void 0,t)},separate:Er,sequence:R0,singleton:CW,size:Cx,some:CX,toArray:RG,toEntries:RG,toUnfoldable:function(t){return function(n){var r=RG(n),i=r.length;return t.unfold(0,function(t){return t<i?e$([r[t],t+1]):eV})}},traverse:RX,traverseWithIndex:RQ,union:R8,updateAt:RY,upsertAt:Ck,wilt:R2,wither:R1},Symbol.toStringTag,{value:"Module"}));var Ek=function(t){return function(n){return eB(t(n))}},EI=function(t){return function(n){return eK(t(n))}},EC=function(){return function(t){return!0}},EM=function(t){return function(n){return!t(n)}},ER=function(t){return function(n){return function(r){return n(r)||t(r)}}},EE=function(t){return function(n){return function(r){return n(r)&&t(r)}}},Ej=function(){return function(t){return!1}},EN=function(t){return function(n){return function(r){return n(r)&&t(r)}}};let EA=Object.freeze(Object.defineProperty({__proto__:null,and:EE,compose:EN,fromEitherK:EI,fromOptionK:Ek,id:EC,not:EM,or:ER,zero:Ej},Symbol.toStringTag,{value:"Module"}));var EP=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return{add:function(n,r){return t.map(function(t,i){return t.add(n[i],r[i])})},zero:t.map(function(t){return t.zero}),mul:function(n,r){return t.map(function(t,i){return t.mul(n[i],r[i])})},one:t.map(function(t){return t.one}),sub:function(n,r){return t.map(function(t,i){return t.sub(n[i],r[i])})}}},EL=function(t){return function(n){return t.sub(t.zero,n)}};let ED=Object.freeze(Object.defineProperty({__proto__:null,getFunctionRing:eT,getTupleRing:EP,negate:EL,tuple:EP},Symbol.toStringTag,{value:"Module"})),EF=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),EW=Object.freeze(Object.defineProperty({__proto__:null,getFunctionSemiring:eS},Symbol.toStringTag,{value:"Module"}));function EU(t){return function(n){for(var r,i=n.values(),o=new Set;!(r=i.next()).done;){var a=r.value;t(a)&&o.add(a)}return o}}function Ez(t){var n=E4(t);return function(r,i){if(void 0===i){var o=Ez(t);return function(t){return o(r,t)}}if(E2(r))return i;if(E2(i))return r;var a=new Set(r);return i.forEach(function(t){n(t,a)||a.add(t)}),a}}function EB(t){var n=E4(t);return function(r,i){if(void 0===i){var o=EB(t);return function(t){return o(t,r)}}if(E2(r)||E2(i))return new Set;var a=new Set;return r.forEach(function(t){n(t,i)&&a.add(t)}),a}}function EV(t){var n=E4(t);return function(r,i){if(void 0===i){var o=EV(t);return function(t){return o(t,r)}}return EU(function(t){return!n(t,i)})(r)}}var E$=function(t){return{concat:Ez(t)}},Eq=function(t){return{concat:E$(t).concat,empty:new Set}},EK=function(t){return{concat:EB(t)}},EH=function(t){return{concat:EV(t)}},EG=function(t){return new Set([t])};function EZ(t){var n=E4(t);return function(t){return function(r){if(n(t)(r))return r;var i=new Set(r);return i.add(t),i}}}var EY=function(t){return function(n){return function(r){return EU(function(r){return!t.equals(n,r)})(r)}}},EJ=function(t){var n=E4(t),r=EY(t),i=EZ(t);return function(t){return function(o){return(n(t,o)?r:i)(t)(o)}}},EQ=function(t){return function(n){for(var r=n.length,i=new Set,o=E4(t),a=0;a<r;a++){var u=n[a];o(u,i)||i.add(u)}return i}},EX=function(t){return E0(t)(eO)};function E0(t){var n=E4(t);return function(t){return function(r){var i=new Set;return r.forEach(function(r){var o=t(r);"Some"!==o._tag||n(o.value,i)||i.add(o.value)}),i}}}var E1=new Set,E2=function(t){return 0===t.size},E3=function(t){return t.size},E4=Ro,E5=function(t){return function(n){var r=[];return n.forEach(function(t){return r.push(t)}),r.sort(t.compare)}};let E9=Object.freeze(Object.defineProperty({__proto__:null,chain:function(t){var n=E4(t);return function(t){return function(r){var i=new Set;return r.forEach(function(r){t(r).forEach(function(t){n(t,i)||i.add(t)})}),i}}},compact:EX,difference:EV,elem:E4,empty:E1,every:Rr,filter:EU,filterMap:E0,foldMap:M2,fromArray:EQ,getDifferenceMagma:EH,getEq:Rs,getIntersectionSemigroup:EK,getShow:Ru,getUnionMonoid:Eq,getUnionSemigroup:E$,insert:EZ,intersection:EB,isEmpty:E2,isSubset:Ri,map:function(t){var n=E4(t);return function(t){return function(r){var i=new Set;return r.forEach(function(r){var o=t(r);n(o,i)||i.add(o)}),i}}},partition:function(t){return function(n){for(var r,i=n.values(),o=new Set,a=new Set;!(r=i.next()).done;){var u=r.value;t(u)?o.add(u):a.add(u)}return oE(a,o)}},partitionMap:function(t,n){return function(r){return function(i){for(var o,a=i.values(),u=new Set,s=new Set,c=E4(t),l=E4(n);!(o=a.next()).done;){var f=r(o.value);switch(f._tag){case"Left":c(f.left,u)||u.add(f.left);break;case"Right":l(f.right,s)||s.add(f.right)}}return oE(u,s)}}},reduce:M1,reduceRight:M3,remove:EY,separate:function(t,n){return function(r){var i=E4(t),o=E4(n),a=new Set,u=new Set;return r.forEach(function(t){switch(t._tag){case"Left":i(t.left,a)||a.add(t.left);break;case"Right":o(t.right,u)||u.add(t.right)}}),oE(a,u)}},singleton:EG,size:E3,some:Rn,subset:Ri,toArray:E5,toggle:EJ,union:Ez},Symbol.toStringTag,{value:"Module"}));var E6=function(t){return{show:function(n){var r="{";for(var i in t)e1.call(t,i)&&(r+=" ".concat(i,": ").concat(t[i].show(n[i]),","));return r.length>1&&(r=r.slice(0,-1)+" "),r+="}"}}},E8=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return{show:function(n){return"[".concat(n.map(function(n,r){return t[r].show(n)}).join(", "),"]")}}};let E7=Object.freeze(Object.defineProperty({__proto__:null,getStructShow:E6,getTupleShow:E8,showBoolean:{show:function(t){return JSON.stringify(t)}},showNumber:{show:function(t){return JSON.stringify(t)}},showString:{show:function(t){return JSON.stringify(t)}},struct:E6,tuple:E8},Symbol.toStringTag,{value:"Module"}));function je(t){return function(n){return function(r){return t.of([n,r])}}}function jt(t){return function(n){return function(r){return function(i){return t.map(r(i),function(t){var r=t[0],i=t[1];return[n(r),i]})}}}}function jn(t){return function(n){return function(r){return function(i){return t.chain(r(i),function(r){var i=r[0],o=r[1];return t.map(n(o),function(t){var n=t[0],r=t[1];return[i(n),r]})})}}}}function jr(t){return function(n){return function(r){return function(i){return t.chain(r(i),function(t){var r=t[0],i=t[1];return n(r)(i)})}}}}function ji(t){return function(n){return function(r){return t.of(n(r))}}}function jo(t){return function(n){return function(r){return t.map(n,function(t){return[t,r]})}}}function ja(t){return function(n){return function(r){return t.map(r(n),function(t){return t[0]})}}}function ju(t){return function(n){return function(r){return t.map(r(n),Rm)}}}let js=Object.freeze(Object.defineProperty({__proto__:null,ap:jn,chain:jr,evaluate:ja,execute:ju,fromF:jo,fromState:ji,getStateM:function(t){var n=jn(t),r=jt(t),i=jr(t),o=ja(t),a=ju(t);return{map:function(t,n){return eL(t,r(n))},ap:function(t,r){return eL(t,n(r))},of:je(t),chain:function(t,n){return eL(t,i(n))},get:function(){return function(n){return t.of([n,n])}},put:function(n){return function(){return t.of([void 0,n])}},modify:function(n){return function(r){return t.of([void 0,n(r)])}},gets:function(n){return function(r){return t.of([n(r),r])}},fromState:ji(t),fromM:jo(t),evalState:function(t,n){return eL(t,o(n))},execState:function(t,n){return eL(t,a(n))}}},map:jt,of:je},Symbol.toStringTag,{value:"Module"}));var jc=function(t){return function(){return kx(t)}},jl=je(Is);function jf(t){return j_(kS(t))}function jd(t){return j_(kw(t))}function jp(t){return j_(kC(t))}var jh=function(t){return eE(t,k_)},jm=function(t){return function(n){return kx(t(n)[0])}},jg=pM(function(t){return jc(t)},jl),jy=ji(Is),jv=function(t){return j_(ek(t))},jb=function(t){return j_(kR(t))},jx=function(t){return j_(kE(t))},j_=jo(Ia),jS=function(t){return function(n){return eE(n,hY(t))}},jT=function(t){return function(n){return function(r){return t(r)(n)(r)}}},jw=function(t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return jb(t.apply(void 0,n))}},jO=function(t){return function(n){return eL(n,jz(jw(t)))}},jk=function(t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return jv(t.apply(void 0,n))}},jI=function(t){return function(n){return eL(n,jz(jk(t)))}},jC=function(t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return j_(t.apply(void 0,n))}},jM=function(t){return function(n){return eL(n,jz(jC(t)))}},jR=function(t,n){return eL(t,jL(n))},jE=function(t,n){return eL(t,jW(n))},jj=function(t,n){return eL(t,jU(n))},jN=function(t,n){return function(r){return eL(t(r),It(function(){return n()(r)}))}},jA=function(t,n,r){return function(i){return eL(t(i),k5(n,function(t){var n=t[0],i=t[1];return[r(n),i]}))}},jP=function(t,n){return function(r){return eL(t(r),k9(n))}},jL=jt(Ia),jD=function(t,n){return function(r){return jA(r,t,n)}},jF=function(t){return function(n){return jP(n,t)}},jW=jn(Ih),jU=jr(Ih),jz=jU,jB=jz(eO),jV=function(t){return function(n){return function(r){return eL(n(r),It(function(){return t()(r)}))}}},j$="StateReaderTaskEither",jq={URI:j$,map:jR},jK=ti(jq),jH={URI:j$,map:jR,ap:jE},jG=e4(jH),jZ=e5(jH),jY={URI:j$,map:jR,ap:jE,chain:jj},jJ={URI:j$,fromState:jy},jQ=gi(jJ),jX=go(jJ),j0=ga(jJ),j1=gu(jJ),j2=gs(jJ),j3=gc(jJ,jY),j4=tf(jY),j5={URI:j$,fromReader:jd},j9=mM(j5),j6=mR(j5),j8=mE(j5),j7=mj(j5,jY),Ne=mN(j5,jY),Nt={URI:j$,fromEither:jg},Nn=th(Nt),Nr=tg(Nt),Ni=ty(Nt,jY),No=tb(Nt,jY),Na=tx(Nt,jY),Nu=tm(Nt),Ns=t_(Nt,jY),Nc=tv(Nt),Nl={URI:j$,fromIO:jp},Nf=hq(Nl),Nd=hK(Nl,jY),Np=hH(Nl,jY),Nh={URI:j$,fromIO:jp,fromTask:jf},Nm=gf(Nh),Ng=gd(Nh,jY),Ny=gp(Nh,jY),Nv=ja(Ia),Nb=ju(Ia),Nx=to(jq),N_=td(jY),NS=e9(jH),NT=function(t){return function(n){return function(r){return function(i){return function(){return eQ(n).reduce(function(n,r,o){return n.then(function(a){return eq(a)?n:t(o+1,r)(a.right[1])(i)().then(function(t){if(eq(t))return t;var n=t.right,r=n[0],i=n[1];return a.right[0].push(r),a.right[1]=i,a})})},t(0,eJ(n))(r)(i)().then(pr(function(t){var n;return[[t[0]],t[1]]})))}}}}},Nw=function(t){var n=NT(t);return function(t){return eY(t)?n(t):jl(eX)}},NO=function(t){return Nw(function(n,r){return t(r)})},Nk=NO(eO),NI=function(t,n){return eL(t(n),k4(function(t){return t[0]}))},NC=function(t,n){return eL(t(n),k4(function(t){return t[0],t[1]}))};let NM=Object.freeze(Object.defineProperty({__proto__:null,Alt:{URI:j$,map:jR,alt:jN},Applicative:{URI:j$,map:jR,ap:jE,of:jl},Apply:jH,Bifunctor:{URI:j$,bimap:jA,mapLeft:jP},Chain:jY,FromEither:Nt,FromIO:Nl,FromReader:j5,FromState:jJ,FromTask:Nh,Functor:jq,Monad:{URI:j$,map:jR,ap:jE,of:jl,chain:jj},MonadIO:{URI:j$,map:jR,ap:jE,of:jl,chain:jj,fromIO:jp},MonadTask:{URI:j$,map:jR,ap:jE,of:jl,chain:jj,fromIO:jp,fromTask:jf},MonadThrow:{URI:j$,map:jR,ap:jE,of:jl,chain:jj,throwError:jc},Pointed:{URI:j$,of:jl},URI:j$,alt:jV,altW:jV,ap:jW,apFirst:jG,apFirstW:jG,apS:NS,apSW:NS,apSecond:jZ,apSecondW:jZ,apW:jW,ask:j9,asks:j6,asksStateReaderTaskEither:jT,asksStateReaderTaskEitherW:jT,bimap:jD,bind:N_,bindTo:Nx,bindW:N_,chain:jU,chainEitherK:No,chainEitherKW:No,chainFirst:j4,chainFirstEitherK:Na,chainFirstEitherKW:Na,chainFirstIOK:Np,chainFirstReaderK:Ne,chainFirstReaderKW:Ne,chainFirstTaskK:Ny,chainFirstW:j4,chainIOEitherK:jO,chainIOEitherKW:jO,chainIOK:Nd,chainOptionK:Ni,chainReaderK:j7,chainReaderKW:j7,chainReaderTaskEitherK:jM,chainReaderTaskEitherKW:jM,chainStateK:j3,chainTaskEitherK:jI,chainTaskEitherKW:jI,chainTaskK:Ng,chainW:jz,evalState:NI,evaluate:Nv,execState:NC,execute:Nb,filterOrElse:Ns,filterOrElseW:Ns,flap:jK,flatten:jB,flattenW:jB,fromEither:jg,fromEitherK:Nc,fromIO:jp,fromIOEither:jb,fromIOEitherK:jw,fromIOK:Nf,fromOption:Nn,fromOptionK:Nr,fromPredicate:Nu,fromReader:jd,fromReaderEither:jx,fromReaderK:j8,fromReaderTaskEither:j_,fromReaderTaskEitherK:jC,fromState:jy,fromStateK:j2,fromTask:jf,fromTaskEither:jv,fromTaskEitherK:jk,fromTaskK:Nm,get:jQ,gets:j1,left:jc,leftIO:function(t){return j_(kM(t))},leftReader:function(t){return j_(kO(t))},leftState:jm,leftTask:function(t){return j_(kT(t))},local:jS,map:jL,mapLeft:jF,modify:j0,of:jl,put:jX,right:jl,rightIO:jp,rightReader:jd,rightState:jh,rightTask:jf,run:function(t,n,r){return t(n)(r)()},sequenceArray:Nk,stateReaderTaskEither:{URI:j$,map:jR,of:jl,ap:jE,chain:jj,bimap:jA,mapLeft:jP,alt:jN,fromIO:jp,fromTask:jf,throwError:jc},stateReaderTaskEitherSeq:{URI:j$,map:jR,of:jl,ap:jE,chain:jj,bimap:jA,mapLeft:jP,alt:jN,fromIO:jp,fromTask:jf,throwError:jc},throwError:jc,traverseArray:NO,traverseArrayWithIndex:Nw,traverseReadonlyArrayWithIndex:Nw,traverseReadonlyNonEmptyArrayWithIndex:NT},Symbol.toStringTag,{value:"Module"}));var NR=function(t,n){return eL(t,NP(n))},NE=function(t,n){return eL(t,Nj(n))},Nj=function(t){return function(n){return{peek:function(r){return t({peek:n.peek,pos:r})},pos:n.pos}}},NN=function(t){return t.peek(t.pos)},NA=Nj(eO),NP=function(t){return function(n){return{peek:function(r){return t(n.peek(r))},pos:n.pos}}},NL="Store",ND={URI:NL,map:NR},NF=ti(ND),NW={URI:NL,map:NR,extend:NE,extract:NN};let NU=Object.freeze(Object.defineProperty({__proto__:null,Comonad:NW,Functor:ND,URI:NL,duplicate:NA,experiment:function(t){return function(n){return function(r){return t.map(n(r.pos),function(t){return r.peek(t)})}}},extend:Nj,extract:NN,flap:NF,map:NP,peeks:function(t){return function(n){return n.peek(t(n.pos))}},seek:function(t){return function(n){return{peek:n.peek,pos:t}}},seeks:function(t){return function(n){return{peek:n.peek,pos:t(n.pos)}}},store:NW},Symbol.toStringTag,{value:"Module"}));function Nz(t,n){return function(r,i){return n.compose(t.second(i),t.first(r))}}function NB(t,n){var r=Nz(t,n);return function(i,o){return n.compose(r(i,o),t.promap(n.id(),eO,function(t){return[t,t]}))}}let NV=Object.freeze(Object.defineProperty({__proto__:null,fanOut:NB,fanout:function(t){return NB(t,t)},split:Nz,splitStrong:function(t){return Nz(t,t)}},Symbol.toStringTag,{value:"Module"}));var N$=function(){return{concat:function(t,n){return Object.assign({},t,n)}}},Nq=function(t){return function(n){var r={};for(var i in n)e1.call(n,i)&&(r[i]=t[i](n[i]));return r}};let NK=Object.freeze(Object.defineProperty({__proto__:null,evolve:Nq,getAssignSemigroup:N$},Symbol.toStringTag,{value:"Module"}));var NH=globalThis&&globalThis.__awaiter||function(t,n,r,i){return new(r||(r=Promise))(function(o,a){function u(t){try{c(i.next(t))}catch(n){a(n)}}function s(t){try{c(i.throw(t))}catch(n){a(n)}}function c(t){var n;t.done?o(t.value):((n=t.value)instanceof r?n:new r(function(t){t(n)})).then(u,s)}c((i=i.apply(t,n||[])).next())})},NG=globalThis&&globalThis.__generator||function(t,n){var r,i,o,a,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(a){return function(s){return function(a){if(r)throw TypeError("Generator is already executing.");for(;u;)try{if(r=1,i&&(o=2&a[0]?i.return:a[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,a[1])).done)return o;switch(i=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return u.label++,{value:a[1],done:!1};case 5:u.label++,i=a[1],a=[0];continue;case 7:a=u.ops.pop(),u.trys.pop();continue;default:if(!(o=(o=u.trys).length>0&&o[o.length-1])&&(6===a[0]||2===a[0])){u=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){u.label=a[1];break}if(6===a[0]&&u.label<o[1]){u.label=o[1],o=a;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(a);break}o[2]&&u.ops.pop(),u.trys.pop();continue}a=n.call(t,u)}catch(s){a=[6,s],i=0}finally{r=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,s])}}},NZ=vN(TP),NY=vz(TP),NJ=vB(TP),NQ=function(t){return NX(TS(t))},NX=vP(TN),N0=TI(l3),N1=vV(TN),N2=v$(TB),N3=vq(TV),N4=vL(TP),N5=function(t){return function(){return NH(void 0,void 0,void 0,function(){return NG(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,t().then(e$)];case 1:return[2,n.sent()];case 2:return n.sent(),[2,eV];case 3:return[2]}})})}},N9=function(t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return N5(function(){return t.apply(void 0,n)})}},N6=vD(TP),N8=vF(TV),N7=vW(TP),Ae=vU(TV),At=vK(TN),An=vH(TL),Ar=vG(TV),Ai=Ar(eO),Ao=vZ(TV),Aa=vA(TP),Au=Aa(),As=db(TN,fj),Ac=dx(TN,fj,fp),Al=hM(TN,fD),Af=hR(TN,fD),Ad=hE(TN,fD),Ap=hj(TN,fD),Ah=function(t,n){return eL(t,At(n))},Am=function(t,n){return eL(t,An(n))},Ag=function(t,n){return eL(t,Ar(n))},Ay=function(t,n){return eL(t,Ao(n))},Av=function(t,n){return eL(t,Al(n))},Ab=function(t,n){return eL(t,Af(n))},Ax=function(t,n){return eL(t,Ad(n))},A_=function(t,n){return eL(t,Ap(n))},AS="TaskOption",AT={URI:AS,map:Ah},Aw=ti(AT),AO={URI:AS,of:NZ},Ak={URI:AS,map:Ah,ap:Am},AI=e4(Ak),AC=e5(Ak),AM=function(t,n){return eL(t,Ar(function(t){return eL(n,At(t))}))},AR={URI:AS,map:Ah,ap:Am,chain:Ag},AE=tf(AR),Aj={URI:AS,zero:Aa},AN=oH(Aj,AO),AA={URI:AS,fromIO:NQ},AP=hq(AA),AL=hK(AA,AR),AD=hH(AA,AR),AF={URI:AS,fromEither:NJ},AW=tv(AF),AU=tb(AF,AR),Az=tx(AF,AR),AB={URI:AS,fromIO:NQ,fromTask:NX},AV=gf(AB),A$=gd(AB,AR),Aq=gp(AB,AR),AK=NZ(e0),AH=to(AT),AG=td(AR),AZ=e9(Ak),AY=NZ(eX),AJ=function(t){return eE(T1(t),TI(dc(eD)))},AQ=function(t){var n=AJ(t);return function(t){return eY(t)?n(t):AY}},AX=function(t){return function(n){return function(){return eQ(n).reduce(function(n,r,i){return n.then(function(o){return ez(o)?n:t(i+1,r)().then(function(t){return ez(t)?t:(o.value.push(t.value),o)})})},t(0,eJ(n))().then(fd(eZ)))}}},A0=function(t){var n=AX(t);return function(t){return eY(t)?n(t):AY}},A1=function(t){return AQ(function(n,r){return t(r)})},A2=A1(eO),A3=function(t){return A0(function(n,r){return t(r)})},A4=A3(eO);let A5=Object.freeze(Object.defineProperty({__proto__:null,Alt:{URI:AS,map:Ah,alt:Ay},Alternative:{URI:AS,map:Ah,ap:Am,of:NZ,alt:Ay,zero:Aa},ApT:AY,ApplicativePar:{URI:AS,map:Ah,ap:Am,of:NZ},ApplicativeSeq:{URI:AS,map:Ah,ap:AM,of:NZ},ApplyPar:Ak,ApplySeq:{URI:AS,map:Ah,ap:AM},Chain:AR,Compactable:{URI:AS,compact:As,separate:Ac},Do:AK,Filterable:{URI:AS,map:Ah,compact:As,separate:Ac,filter:Av,filterMap:Ab,partition:Ax,partitionMap:A_},FromEither:AF,FromIO:AA,FromTask:AB,Functor:AT,Monad:{URI:AS,map:Ah,ap:Am,of:NZ,chain:Ag},MonadIO:{URI:AS,map:Ah,ap:Am,of:NZ,chain:Ag,fromIO:NQ},MonadTask:{URI:AS,map:Ah,ap:Am,of:NZ,chain:Ag,fromIO:NQ,fromTask:NX},Pointed:AO,Zero:Aj,alt:Ao,altW:Ao,ap:An,apFirst:AI,apS:AZ,apSecond:AC,bind:AG,bindTo:AH,chain:Ar,chainEitherK:AU,chainFirst:AE,chainFirstEitherK:Az,chainFirstIOK:AD,chainFirstTaskK:Aq,chainIOK:AL,chainNullableK:N8,chainOptionK:Ae,chainTaskK:A$,compact:As,filter:Al,filterMap:Af,flap:Aw,flatten:Ai,fold:N2,foldW:N2,fromEither:NJ,fromEitherK:AW,fromIO:NQ,fromIOK:AP,fromNullable:N4,fromNullableK:N6,fromOption:TM,fromOptionK:N7,fromPredicate:NY,fromTask:NX,fromTaskEither:N0,fromTaskK:AV,getOrElse:N3,getOrElseW:N3,guard:AN,map:At,match:N1,matchE:N2,matchEW:N2,matchW:N1,none:Au,of:NZ,partition:Ad,partitionMap:Ap,separate:Ac,sequenceArray:A2,sequenceSeqArray:A4,some:NZ,traverseArray:A1,traverseArrayWithIndex:AQ,traverseReadonlyArrayWithIndex:AQ,traverseReadonlyArrayWithIndexSeq:A0,traverseReadonlyNonEmptyArrayWithIndex:AJ,traverseReadonlyNonEmptyArrayWithIndexSeq:AX,traverseSeqArray:A3,traverseSeqArrayWithIndex:A0,tryCatch:N5,tryCatchK:N9,zero:Aa},Symbol.toStringTag,{value:"Module"}));var A9=function(t){return"Left"===t._tag},A6=function(t){return"Right"===t._tag};function A8(t){return"Both"===t._tag}function A7(t){return{_tag:"Left",left:t}}function Pe(t){return{_tag:"Right",right:t}}function Pt(t,n){return{_tag:"Both",left:t,right:n}}var Pn=function(t,n,r){return function(i){switch(i._tag){case"Left":return t(i.left);case"Right":return n(i.right);case"Both":return r(i.left,i.right)}}},Pr=Pn(Pe,A7,function(t,n){return Pt(n,t)});function Pi(t,n){return{concat:function(r,i){return A9(r)?A9(i)?A7(t.concat(r.left,i.left)):A6(i)?Pt(r.left,i.right):Pt(t.concat(r.left,i.left),i.right):A6(r)?A9(i)?Pt(i.left,r.right):A6(i)?Pe(n.concat(r.right,i.right)):Pt(i.left,n.concat(r.right,i.right)):A9(i)?Pt(t.concat(r.left,i.left),r.right):A6(i)?Pt(r.left,n.concat(r.right,i.right)):Pt(t.concat(r.left,i.left),n.concat(r.right,i.right))}}}var Po=function(t){return{URI:PT,_E:void 0,map:Ps,ap:function(n,r){return A9(n)?A9(r)?A7(t.concat(n.left,r.left)):A6(r)?A7(n.left):A7(t.concat(n.left,r.left)):A6(n)?A9(r)?A7(r.left):A6(r)?Pe(n.right(r.right)):Pt(r.left,n.right(r.right)):A9(r)?A7(t.concat(n.left,r.left)):A6(r)?Pt(n.left,n.right(r.right)):Pt(t.concat(n.left,r.left),n.right(r.right))}}};function Pa(t){var n=Po(t),r=function(n,r){if(A9(n))return n;if(A6(n))return r(n.right);var i=r(n.right);return A9(i)?A7(t.concat(n.left,i.left)):A6(i)?Pt(n.left,i.right):Pt(t.concat(n.left,i.left),i.right)};return{URI:PT,_E:void 0,map:Ps,ap:n.ap,chain:r}}var Pu=function(t,n){return ez(t)?ez(n)?eV:e$(Pe(n.value)):ez(n)?e$(A7(t.value)):e$(Pt(t.value,n.value))},Ps=function(t,n){return eL(t,Py(n))},Pc=function(t,n,r){return eL(t,Pm(n,r))},Pl=function(t,n){return eL(t,Pg(n))},Pf=function(t,n,r){return eL(t,Pv(n,r))},Pd=function(t){var n=Pb(t);return function(t,r){return eL(t,n(r))}},Pp=function(t,n,r){return eL(t,Px(n,r))},Ph=function(t){var n=P_(t);return function(t,r){return eL(t,n(r))}},Pm=function(t,n){return function(r){return A9(r)?A7(t(r.left)):A6(r)?Pe(n(r.right)):Pt(t(r.left),n(r.right))}},Pg=function(t){return function(n){return A9(n)?A7(t(n.left)):A8(n)?Pt(t(n.left),n.right):n}},Py=function(t){return function(n){return A9(n)?n:A6(n)?Pe(t(n.right)):Pt(n.left,t(n.right))}},Pv=function(t,n){return function(r){return A9(r)?t:n(t,r.right)}},Pb=function(t){return function(n){return function(r){return A9(r)?t.empty:n(r.right)}}},Px=function(t,n){return function(r){return A9(r)?t:n(r.right,t)}},P_=function(t){return function(n){return function(r){return A9(r)?t.of(r):A6(r)?t.map(n(r.right),Pe):t.map(n(r.right),function(t){return Pt(r.left,t)})}}},PS=function(t){return function(n){return A9(n)?t.of(n):A6(n)?t.map(n.right,Pe):t.map(n.right,function(t){return Pt(n.left,t)})}},PT="These",Pw={URI:PT,map:Ps},PO=ti(Pw),Pk={URI:PT,fromEither:eO},PI=th(Pk),PC=tg(Pk),PM=function(t){return function(n){return function(r){return!A9(r)&&t.equals(n,r.right)}}},PR=function(t){return function(n){return!A9(n)&&t(n.right)}},PE=function(t,n){return function(r){return A9(r)?[r.left,n()]:A6(r)?[t(),r.right]:[r.left,r.right]}},Pj=function(t,n){return PE(function(){return t},function(){return n})},PN=Pe(eX),PA=function(t){return function(n){return function(r){var i=eV,o=n(0,eJ(r));if(A9(o))return o;A8(o)&&(i=e$(o.left));for(var a=[o.right],u=1;u<r.length;u++){var s=n(u,r[u]);if(A9(s))return s;A8(s)&&(i=ez(i)?e$(s.left):e$(t.concat(i.value,s.left))),a.push(s.right)}return ez(i)?Pe(a):Pt(i.value,a)}}},PP=function(t){return function(n){var r=PA(t)(n);return function(t){return eY(t)?r(t):PN}}};let PL=Object.freeze(Object.defineProperty({__proto__:null,ApT:PN,Bifunctor:{URI:PT,bimap:Pc,mapLeft:Pl},Foldable:{URI:PT,reduce:Pf,foldMap:Pd,reduceRight:Pp},FromEither:Pk,FromThese:{URI:PT,fromThese:eO},Functor:Pw,Pointed:{URI:PT,of:Pe},Traversable:{URI:PT,map:Ps,reduce:Pf,foldMap:Pd,reduceRight:Pp,traverse:Ph,sequence:PS},URI:PT,bimap:Pm,both:Pt,elem:PM,exists:PR,flap:PO,fold:Pn,foldMap:Pb,foldW:Pn,fromOption:PI,fromOptionK:PC,fromOptions:Pu,getApplicative:function(t){var n=Po(t);return{URI:PT,_E:void 0,map:Ps,ap:n.ap,of:Pe}},getApply:Po,getChain:Pa,getEq:function(t,n){return tT(function(r,i){return A9(r)?A9(i)&&t.equals(r.left,i.left):A6(r)?A6(i)&&n.equals(r.right,i.right):A8(i)&&t.equals(r.left,i.left)&&n.equals(r.right,i.right)})},getLeft:function(t){return A9(t)?e$(t.left):A6(t)?eV:e$(t.left)},getLeftOnly:function(t){return A9(t)?e$(t.left):eV},getMonad:function(t){var n=Pa(t);return{URI:PT,_E:void 0,map:Ps,of:Pe,ap:n.ap,chain:n.chain,throwError:A7}},getRight:function(t){return A9(t)?eV:(A6(t),e$(t.right))},getRightOnly:function(t){return A6(t)?e$(t.right):eV},getSemigroup:Pi,getShow:function(t,n){return{show:Pn(function(n){return"left(".concat(t.show(n),")")},function(t){return"right(".concat(n.show(t),")")},function(r,i){return"both(".concat(t.show(r),", ").concat(n.show(i),")")})}},isBoth:A8,isLeft:A9,isRight:A6,left:A7,leftOrBoth:function(t){return function(n){return ez(n)?A7(t):Pt(t,n.value)}},map:Py,mapLeft:Pg,match:Pn,matchW:Pn,of:Pe,reduce:Pv,reduceRight:Px,right:Pe,rightOrBoth:function(t){return function(n){return ez(n)?Pe(t):Pt(n.value,t)}},sequence:PS,swap:Pr,these:{URI:PT,map:Ps,bimap:Pc,mapLeft:Pl,reduce:Pf,foldMap:Pd,reduceRight:Pp,traverse:Ph,sequence:PS},toTuple:Pj,toTuple2:PE,traverse:P_,traverseReadonlyArrayWithIndex:PP,traverseReadonlyNonEmptyArrayWithIndex:PA},Symbol.toStringTag,{value:"Module"}));function PD(t){return eE(Pe,t.of)}function PF(t){return eE(A7,t.of)}function PW(t){return eE(Pt,t.of)}function PU(t){return function(n){return t.map(n,Pe)}}function Pz(t){return function(n){return t.map(n,A7)}}function PB(t){return tr(t,Pw)}function PV(t,n){return e3(t,Po(n))}function P$(t,n){var r=PF(t);return function(i){return function(o){return t.chain(o,Pn(r,i,function(r,o){return t.map(i(o),Pn(function(t){return A7(n.concat(r,t))},function(t){return Pt(r,t)},function(t,i){return Pt(n.concat(r,t),i)}))}))}}}function Pq(t){return function(n,r){return function(i){return t.map(i,Pm(n,r))}}}function PK(t){return function(n){return function(r){return t.map(r,Pg(n))}}}function PH(t){return function(n,r,i){return function(o){return t.map(o,Pn(n,r,i))}}}function PG(t){return function(n,r,i){return function(o){return t.chain(o,Pn(n,r,i))}}}function PZ(t){return function(n){return t.map(n,Pr)}}function PY(t){return function(n,r){return function(i){return t.map(i,PE(n,r))}}}let PJ=Object.freeze(Object.defineProperty({__proto__:null,ap:PV,bimap:Pq,both:PW,chain:P$,getTheseM:function(t){var n=PB(t),r=Pq(t),i=PK(t),o=PG(t),a=PY(t),u=PD(t),s=function(t,r){return eL(t,n(r))};return{map:s,bimap:function(t,n,i){return eL(t,r(n,i))},mapLeft:function(t,n){return eL(t,i(n))},fold:function(t,n,r,i){return eL(t,o(n,r,i))},swap:PZ(t),rightM:PU(t),leftM:Pz(t),left:PF(t),right:PD(t),both:PW(t),toTuple:function(t,n,r){return eL(t,a(function(){return n},function(){return r}))},getMonad:function(n){var r=PV(t,n),i=P$(t,n);return{_E:void 0,map:s,of:u,ap:function(t,n){return eL(t,r(n))},chain:function(t,n){return eL(t,i(n))}}}}},left:PF,leftF:Pz,map:PB,mapLeft:PK,match:PH,matchE:PG,right:PD,rightF:PU,swap:PZ,toTuple2:PY},Symbol.toStringTag,{value:"Module"}));var PQ=PF(TP),PX=PD(TP),P0=PW(TP),P1=PU(TN),P2=Pz(TN),P3=eE(TS,P1),P4=eE(TS,P2),P5=PH(TN),P9=PG(TV),P6=PZ(TN),P8=function(t,n){return eL(t,Lt(n))},P7=function(t,n,r){return eL(t,Ln(n,r))},Le=function(t,n){return eL(t,Lr(n))},Lt=PB(TN),Ln=Pq(TN),Lr=PK(TN),Li="TaskThese",Lo=function(t,n){var r=PV(t,n);return{URI:Li,_E:void 0,map:P8,ap:function(t,n){return eL(t,r(n))}}};function La(t,n){var r=Lo(t,n).ap;return{URI:Li,_E:void 0,map:P8,ap:r,of:PX}}function Lu(t){var n=Lo(TW,t),r=P$(TV,t);return{URI:Li,_E:void 0,map:P8,ap:n.ap,chain:function(t,n){return eL(t,r(n))}}}var Ls={URI:Li,map:P8},Lc=ti(Ls),Ll={URI:Li,fromEither:TM},Lf=th(Ll),Ld=tg(Ll),Lp=tm(Ll),Lh={URI:Li,fromThese:TM},Lm=gm(Lh),Lg={URI:Li,fromIO:P3},Ly=hq(Lg),Lv={URI:Li,fromIO:P3,fromTask:P1},Lb=gf(Lv),Lx=PY(TN),L_=PX(eX),LS=function(t){var n=PA(t);return function(t){return eE(T1(t),TI(n(eD)))}},LT=function(t){return function(n){var r=LS(t)(n);return function(t){return eY(t)?r(t):L_}}},Lw=function(t){return function(n){return function(r){return function(){return eQ(r).reduce(function(r,i,o){return r.then(function(a){return A9(a)?r:n(o+1,i)().then(function(n){if(A9(n))return n;if(A8(n)){var r=a.right;return r.push(n.right),A8(a)?Pt(t.concat(a.left,n.left),r):Pt(n.left,r)}return a.right.push(n.right),a})})},n(0,eJ(r))().then(Py(eZ)))}}}},LO=function(t){return function(n){var r=Lw(t)(n);return function(t){return eY(t)?r(t):L_}}},Lk=function(t,n){return Lx(function(){return t},function(){return n})},LI=function(t,n){return e6(TU)(Pi(t,n))};let LC=Object.freeze(Object.defineProperty({__proto__:null,ApT:L_,Bifunctor:{URI:Li,bimap:P7,mapLeft:Le},FromEither:Ll,FromIO:Lg,FromTask:Lv,FromThese:Lh,Functor:Ls,Pointed:{URI:Li,of:PX},URI:Li,bifunctorTaskThese:{URI:Li,bimap:P7,mapLeft:Le},bimap:Ln,both:P0,flap:Lc,fold:P9,foldW:P9,fromEither:TM,fromIO:P3,fromIOEither:TS,fromIOK:Ly,fromOption:Lf,fromOptionK:Ld,fromPredicate:Lp,fromTask:P1,fromTaskK:Lb,fromThese:TM,fromTheseK:Lm,functorTaskThese:{URI:Li,map:P8},getApplicative:La,getApply:Lo,getChain:Lu,getMonad:function(t){var n=La(TW,t),r=Lu(t);return{URI:Li,_E:void 0,map:P8,ap:n.ap,of:PX,chain:r.chain,fromIO:P3,fromTask:P1}},getSemigroup:LI,left:PQ,leftIO:P4,leftTask:P2,map:Lt,mapLeft:Lr,match:P5,matchE:P9,matchEW:P9,matchW:P5,of:PX,right:PX,rightIO:P3,rightTask:P1,swap:P6,taskThese:{URI:Li,map:P8,bimap:P7,mapLeft:Le},toTuple:Lk,toTuple2:Lx,traverseReadonlyArrayWithIndex:LT,traverseReadonlyArrayWithIndexSeq:LO,traverseReadonlyNonEmptyArrayWithIndex:LS,traverseReadonlyNonEmptyArrayWithIndexSeq:Lw},Symbol.toStringTag,{value:"Module"}));var LM=function(t,n){return eL(t,LR(n))},LR=function(t){return function(n){return function(r){return t(n(r))}}},LE="Traced",Lj={URI:LE,map:LM},LN=ti(Lj);let LA=Object.freeze(Object.defineProperty({__proto__:null,Functor:Lj,URI:LE,censor:function(t){return function(n){return function(r){return n(t(r))}}},flap:LN,getComonad:function(t){return{URI:LE,_E:void 0,map:LM,extend:function(n,r){return function(i){return r(function(r){return n(t.concat(i,r))})}},extract:function(n){return n(t.empty)}}},listen:function(t){return function(n){return[t(n),n]}},listens:function(t){return function(n){return function(r){return[n(r),t(r)]}}},map:LR,traced:Lj,tracks:function(t,n){return function(r){return r(n(r(t.empty)))}}},Symbol.toStringTag,{value:"Module"}));function LP(t,n){return function(r){var i=t.traverse(r),o=n.traverse(r);return function(t){return function(n){return i(n,function(n){return o(n,t)})}}}}function LL(t,n){return function(r){var i=t.sequence(r),o=n.sequence(r);return function(n){return i(t.map(n,o))}}}let LD=Object.freeze(Object.defineProperty({__proto__:null,getTraversableComposition:function(t,n){var r=ta(t,n).map,i=hW(t,n),o=LP(t,n),a=LL(t,n);return{map:r,reduce:i.reduce,foldMap:i.foldMap,reduceRight:i.reduceRight,traverse:function(t){var n=o(t);return function(t,r){return eL(t,n(r))}},sequence:function(t){var n=a(t);return function(t){return eL(t,n)}}}},sequence:LL,traverse:LP},Symbol.toStringTag,{value:"Module"})),LF=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));function LW(t,n){return void 0===n&&(n=[]),{value:t,forest:n}}var LU=function(t,n){for(var r,i="",o=n.length,a=0;a<o;a++){r=n[a];var u=a===o-1;i+=t+(u?"└":"├")+"─ "+r.value,i+=LU(t+(o>1&&!u?"│ ":" "),r.forest)}return i};function Lz(t){return LU(`
|
|
2
|
-
`,t)}function LB(t,n){var r,i=n(t);return{value:i[0],forest:LV(i[1],n)}}function LV(t,n){return t.map(function(t){return LB(t,n)})}function L$(t){var n=Lq(t);return function(r,i){return t.chain(i(r),function(r){var o=r[0],a=r[1];return t.map(n(a,i),function(t){return{value:o,forest:t}})})}}function Lq(t){var n=cF(t);return function(r,i){return eL(r,n(function(n){return L$(t)(n,i)}))}}var LK=function(t,n){return eL(t,L5(n))},LH=function(t,n){return eL(t,L1(function(t){return eL(n,L5(t))}))},LG=function(t,n){return eL(t,L1(n))},LZ=function(t,n,r){return eL(t,L9(n,r))},LY=function(t){var n=L6(t);return function(t,r){return eL(t,n(r))}},LJ=function(t,n,r){return eL(t,L8(n,r))},LQ=function(t,n){return eL(t,L2(n))},LX=function(t){var n=De(t);return function(t,r){return eL(t,n(r))}},L0=function(t){return function(n){return LH(n,t)}},L1=function(t){return function(n){var r=t(n.value),i=r.value,o=r.forest,a=cK().concat;return{value:i,forest:a(o,n.forest.map(L1(t)))}}},L2=function(t){return function(n){return{value:t(n),forest:n.forest.map(L2(t))}}},L3=L2(eO),L4=L1(eO),L5=function(t){return function(n){return{value:t(n.value),forest:n.forest.map(L5(t))}}},L9=function(t,n){return function(r){for(var i=n(t,r.value),o=r.forest.length,a=0;a<o;a++)i=eL(r.forest[a],L9(i,n));return i}},L6=function(t){return function(n){return L9(t.empty,function(r,i){return t.concat(r,n(i))})}},L8=function(t,n){return function(r){for(var i=t,o=r.forest.length,a=o-1;a>=0;a--)i=eL(r.forest[a],L8(i,n));return n(r.value,i)}},L7=function(t){return t.value},De=function(t){var n=cF(t),r=function(i){return function(o){return t.ap(t.map(i(o.value),function(t){return function(n){return{value:t,forest:n}}}),eL(o.forest,n(r(i))))}};return r},Dt=function(t){return De(t)(eO)},Dn=function(t){return LW(t)},Dr="Tree",Di={URI:Dr,map:LK},Do=ti(Di),Da={URI:Dr,map:LK,ap:LH},Du=e4(Da),Ds=e5(Da),Dc={URI:Dr,map:LK,ap:LH,chain:LG},Dl=tf(Dc),Df=Dn(e0),Dd=to(Di),Dp=td(Dc),Dh=e9(Da),Dm=function(t){return function(n){return t(n.value)||n.forest.some(Dm(t))}};let Dg=Object.freeze(Object.defineProperty({__proto__:null,Applicative:{URI:Dr,map:LK,ap:LH,of:Dn},Apply:Da,Chain:Dc,Comonad:{URI:Dr,map:LK,extend:LQ,extract:L7},Do:Df,Foldable:{URI:Dr,reduce:LZ,foldMap:LY,reduceRight:LJ},Functor:Di,Monad:{URI:Dr,map:LK,ap:LH,of:Dn,chain:LG},Pointed:{URI:Dr,of:Dn},Traversable:{URI:Dr,map:LK,reduce:LZ,foldMap:LY,reduceRight:LJ,traverse:LX,sequence:Dt},URI:Dr,ap:L0,apFirst:Du,apS:Dh,apSecond:Ds,bind:Dp,bindTo:Dd,chain:L1,chainFirst:Dl,drawForest:Lz,drawTree:function(t){return t.value+Lz(t.forest)},duplicate:L3,elem:function(t){var n=function(r,i){return t.equals(r,i.value)||i.forest.some(function(t){return n(r,t)})};return n},exists:Dm,extend:L2,extract:L7,flap:Do,flatten:L4,fold:function(t){var n=function(r){return t(r.value,r.forest.map(n))};return n},foldMap:L6,getEq:function(t){var n,r=tT(function(r,i){return t.equals(r.value,i.value)&&n.equals(r.forest,i.forest)});return n=uA(r),r},getShow:function(t){var n=function(r){return sc(r.forest)?"make(".concat(t.show(r.value),")"):"make(".concat(t.show(r.value),", [").concat(r.forest.map(n).join(", "),"])")};return{show:n}},make:LW,map:L5,of:Dn,reduce:L9,reduceRight:L8,sequence:Dt,traverse:De,tree:{URI:Dr,map:LK,of:Dn,ap:LH,chain:LG,reduce:LZ,foldMap:LY,reduceRight:LJ,traverse:LX,sequence:Dt,extract:L7,extend:LQ},unfoldForest:LV,unfoldForestM:Lq,unfoldTree:LB,unfoldTreeM:L$},Symbol.toStringTag,{value:"Module"}));var Dy=function(t){var n;return[Rm(t),(n=t,n[0])]};function Dv(t){return{URI:Dz,_E:void 0,map:DS,ap:function(n,r){var i,o;return[(i=n,i[0])((o=r,o[0])),t.concat(Rm(n),Rm(r))]}}}var Db=function(t){return function(n){return[n,t.empty]}};function Dx(t){var n=Dv(t);return{URI:Dz,_E:void 0,map:n.map,ap:n.ap,chain:function(n,r){var i,o=r((i=n,i[0])),a=o[0],u=o[1];return[a,t.concat(Rm(n),u)]}}}var D_=function(t,n){return eL(t,DN(n))},DS=function(t,n){return eL(t,DE(n))},DT=function(t,n,r){return eL(t,DR(n,r))},Dw=function(t,n){return eL(t,Dj(n))},DO=function(t,n){return eL(t,DA(n))},Dk=function(t,n,r){return eL(t,DD(n,r))},DI=function(t){var n=DL();return function(t,r){return eL(t,n(r))}},DC=function(t,n,r){return eL(t,DF(n,r))};function DM(t){var n=DW(t);return function(t,r){return eL(t,n(r))}}var DR=function(t,n){return function(r){var i;return[n((i=r,i[0])),t(Rm(r))]}},DE=function(t){return function(n){var r;return[t((r=n,r[0])),Rm(n)]}},Dj=function(t){return function(n){var r;return[(r=n,r[0]),t(Rm(n))]}},DN=function(t){return function(n){var r;return[(r=n,r[0]),Rm(t)]}},DA=function(t){return function(n){return[t(n),Rm(n)]}},DP=DA(eO),DL=RL,DD=RP,DF=RD,DW=function(t){return function(n){return function(r){var i;return t.map(n((i=r,i[0])),function(t){return[t,Rm(r)]})}}},DU=function(t){return function(n){var r;return t.map((r=n,r[0]),function(t){return[t,Rm(n)]})}},Dz="Tuple",DB={URI:Dz,map:DS},DV=ti(DB);let D$=Object.freeze(Object.defineProperty({__proto__:null,Bifunctor:{URI:Dz,bimap:DT,mapLeft:Dw},Comonad:{URI:Dz,map:DS,extend:DO,extract:Rh},Foldable:{URI:Dz,reduce:Dk,foldMap:DI,reduceRight:DC},Functor:DB,Semigroupoid:{URI:Dz,compose:D_},Traversable:{URI:Dz,map:DS,reduce:Dk,foldMap:DI,reduceRight:DC,traverse:DM,sequence:DU},URI:Dz,bimap:DR,compose:DN,duplicate:DP,extend:DA,extract:Rh,flap:DV,foldMap:DL,fst:Rh,getApplicative:function(t){var n=Dv(t);return{URI:Dz,_E:void 0,map:n.map,ap:n.ap,of:Db(t)}},getApply:Dv,getChain:Dx,getChainRec:function(t){var n=function(n,r){for(var i,o,a=r(n),u=t.empty,s=(i=a,i[0]);"Left"===s._tag;){u=t.concat(u,Rm(a)),s=(o=a=r(s.left))[0]}return[s.right,t.concat(u,Rm(a))]},r=Dx(t);return{URI:Dz,_E:void 0,map:r.map,ap:r.ap,chain:r.chain,chainRec:n}},getMonad:function(t){var n=Dx(t);return{URI:Dz,_E:void 0,map:n.map,ap:n.ap,chain:n.chain,of:Db(t)}},map:DE,mapFst:DE,mapLeft:Dj,mapSnd:Dj,reduce:DD,reduceRight:DF,sequence:DU,snd:Rm,swap:Dy,traverse:DW,tuple:{URI:Dz,compose:D_,map:DS,bimap:DT,mapLeft:Dw,extract:Rh,extend:DO,reduce:Dk,foldMap:DI,reduceRight:DC,traverse:DM,sequence:DU}},Symbol.toStringTag,{value:"Module"})),Dq=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),DK=Object.freeze(Object.defineProperty({__proto__:null,getValidationM:function(t,n){var r=tc(n,pt(t));return{map:r.map,ap:r.ap,of:r.of,chain:function(t,r){return n.chain(t,function(t){return eq(t)?n.of(eH(t.left)):r(t.right)})},alt:function(r,i){return n.chain(r,function(r){return eK(r)?n.of(r):n.map(i(),function(n){return eq(n)?eH(t.concat(r.left,n.left)):n})})}}}},Symbol.toStringTag,{value:"Module"}));var DH=t7(void 0),DG={concat:DH.concat,empty:void 0};let DZ=Object.freeze(Object.defineProperty({__proto__:null,Monoid:DG,Semigroup:DH},Symbol.toStringTag,{value:"Module"}));var DY=function(t){return function(){return[void 0,t]}},DJ=function(t){return function(){var n=t(),r=n[0],i=n[1];return[[r,i],i]}},DQ=function(t){return function(){var n,r=t(),i=r[0],o=i[0];return[o,(0,i[1])(r[1])]}},DX=function(t){return function(n){return function(){var r=n(),i=r[0],o=r[1];return[[i,t(o)],o]}}},D0=function(t){return function(n){return function(){var r,i=n();return[i[0],t(i[1])]}}},D1=function(t,n){return eL(t,D2(n))},D2=function(t){return function(n){return function(){var r=n(),i=r[0],o=r[1];return[t(i),o]}}},D3="Writer",D4=function(t){return{URI:D3,_E:void 0,of:function(n){return function(){return[n,t.empty]}}}},D5=function(t){return{URI:D3,_E:void 0,map:D1,ap:function(n,r){return function(){var i=n(),o=i[0],a=i[1],u=r(),s=u[0],c=u[1];return[o(s),t.concat(a,c)]}}}},D9=function(t){var n=D5(t),r=D4(t);return{URI:D3,_E:void 0,map:D1,ap:n.ap,of:r.of}};function D6(t){var n=D5(t);return{URI:D3,_E:void 0,map:D1,ap:n.ap,chain:function(n,r){return function(){var i=n(),o=i[0],a=i[1],u=r(o)(),s=u[0],c=u[1];return[s,t.concat(a,c)]}}}}var D8={URI:D3,map:D1},D7=ti(D8),Fe=function(t){return t()[0]},Ft=function(t){return t()[1]},Fn=function(t){return t()[0]},Fr=function(t){return t()[1]};let Fi=Object.freeze(Object.defineProperty({__proto__:null,Functor:D8,URI:D3,censor:D0,evalWriter:Fn,evaluate:Fe,execWriter:Fr,execute:Ft,flap:D7,getApplicative:D9,getApply:D5,getChain:D6,getMonad:function(t){var n=D9(t),r=D6(t);return{URI:D3,_E:void 0,map:D1,ap:n.ap,of:n.of,chain:r.chain}},getPointed:D4,listen:DJ,listens:DX,map:D2,pass:DQ,tell:DY,writer:D8},Symbol.toStringTag,{value:"Module"})),Fo=Object.freeze(Object.defineProperty({__proto__:null,getWriterM:function(t){var n=function(n,r){return function(){return t.map(n(),function(t){var n=t[0],i=t[1];return[r(n),i]})}};return{map:n,evalWriter:function(n){return t.map(n(),function(t){return t[0]})},execWriter:function(n){return t.map(n(),function(t){return t[0],t[1]})},tell:function(n){return function(){return t.of([void 0,n])}},listen:function(n){return function(){return t.map(n(),function(t){var n=t[0],r=t[1];return[[n,r],r]})}},pass:function(n){return function(){return t.map(n(),function(t){var n,r=t[0],i=r[0];return[i,(0,r[1])(t[1])]})}},listens:function(n,r){return function(){return t.map(n(),function(t){var n=t[0],i=t[1];return[[n,r(i)],i]})}},censor:function(n,r){return function(){return t.map(n(),function(t){var n;return[t[0],r(t[1])]})}},getMonad:function(r){return{_E:void 0,map:n,of:function(n){return function(){return t.of([n,r.empty])}},ap:function(n,i){return function(){return t.chain(n(),function(n){var o=n[0],a=n[1];return t.map(i(),function(t){var n=t[0],i=t[1];return[o(n),r.concat(a,i)]})})}},chain:function(n,i){return function(){return t.chain(n(),function(n){var o=n[0],a=n[1];return t.map(i(o)(),function(t){var n=t[0],i=t[1];return[n,r.concat(a,i)]})})}}}}}}},Symbol.toStringTag,{value:"Module"})),Fa=Object.freeze(Object.defineProperty({__proto__:null,alt:ey,alternative:ev,applicative:tl,apply:tn,array:lh,bifunctor:lm,boolean:lw,booleanAlgebra:lk,bounded:lR,boundedDistributiveLattice:lN,boundedJoinSemilattice:lA,boundedLattice:lP,boundedMeetSemilattice:lL,category:lD,chain:tp,chainRec:lW,choice:lB,comonad:lV,compactable:d_,console:dk,const:dU,contravariant:dz,date:dq,distributiveLattice:lj,either:p7,eitherT:hS,endomorphism:hO,eq:tN,extend:hk,field:hC,filterable:hN,filterableWithIndex:hA,foldable:hU,foldableWithIndex:h$,fromEither:tS,fromIO:hG,fromReader:mA,fromState:gl,fromTask:gh,fromThese:gg,function:eW,functor:tu,functorWithIndex:gv,group:gb,heytingAlgebra:gx,hkt:g_,identity:g2,invariant:g3,io:yT,ioEither:vj,ioOption:bZ,ioRef:bJ,joinSemilattice:bQ,json:b1,lattice:b2,magma:t9,map:_V,meetSemilattice:_$,monad:_q,monadIO:_K,monadTask:_H,monadThrow:_G,monoid:_8,naturalTransformation:_7,nonEmptyArray:ob,number:oR,option:dv,optionT:vY,ord:t0,ordering:Sa,pipeable:Su,pointed:Ss,predicate:l0,profunctor:Sc,random:Sh,reader:mC,readerEither:Tm,readerT:T_,readerTask:w1,readerTaskEither:I8,readonlyArray:ss,readonlyMap:x3,readonlyNonEmptyArray:rG,readonlyRecord:MH,readonlySet:Rp,readonlyTuple:RV,record:EO,refinement:EA,ring:ED,semigroup:nd,semigroupoid:EF,semiring:EW,separated:oB,set:E9,show:E7,state:gr,stateReaderTaskEither:NM,stateT:js,store:NU,string:Cy,strong:NV,struct:NK,task:wt,taskEither:kb,taskOption:A5,taskThese:LC,these:PL,theseT:PJ,traced:LA,traversable:LD,traversableWithIndex:LF,tree:Dg,tuple:D$,unfoldable:Dq,validationT:DK,void:DZ,witherable:oK,writer:Fi,writerT:Fo,zero:oG},Symbol.toStringTag,{value:"Module"})),Fu=C(Fa);var Fs={},Fc={},Fl={},Ff={};!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 n=function(t){return function(){return{meet:function(n,r){return function(i){return t.meet(n(i),r(i))}},join:function(n,r){return function(i){return t.join(n(i),r(i))}},zero:function(){return t.zero},one:function(){return t.one},implies:function(n,r){return function(i){return t.implies(n(i),r(i))}},not:function(n){return function(r){return t.not(n(r))}}}}};t.getBooleanAlgebra=n;var r=function(t){return function(){return{concat:function(n,r){return function(i){return t.concat(n(i),r(i))}}}}};t.getSemigroup=r;var i=function(n){var r=(0,t.getSemigroup)(n);return function(){return{concat:r().concat,empty:function(){return n.empty}}}};t.getMonoid=i;var o=function(t){return{add:function(n,r){return function(i){return t.add(n(i),r(i))}},zero:function(){return t.zero},mul:function(n,r){return function(i){return t.mul(n(i),r(i))}},one:function(){return t.one}}};t.getSemiring=o;var a=function(n){var r=(0,t.getSemiring)(n);return{add:r.add,mul:r.mul,one:r.one,zero:r.zero,sub:function(t,r){return function(i){return n.sub(t(i),r(i))}}}};t.getRing=a;var u=function(t){return function(n){return n(t)}};function s(t){return t}function c(t){return function(){return t}}function l(t,n,r,i,o,a,u,s,c){switch(arguments.length){case 1:return t;case 2:return function(){return n(t.apply(this,arguments))};case 3:return function(){return r(n(t.apply(this,arguments)))};case 4:return function(){return i(r(n(t.apply(this,arguments))))};case 5:return function(){return o(i(r(n(t.apply(this,arguments)))))};case 6:return function(){return a(o(i(r(n(t.apply(this,arguments))))))};case 7:return function(){return u(a(o(i(r(n(t.apply(this,arguments)))))))};case 8:return function(){return s(u(a(o(i(r(n(t.apply(this,arguments))))))))};case 9:return function(){return c(s(u(a(o(i(r(n(t.apply(this,arguments)))))))))}}}function f(t){return t+1}function d(t){return t-1}function p(t){throw Error("Called `absurd` function which should be uncallable")}t.apply=u,t.identity=s,t.unsafeCoerce=s,t.constant=c,t.constTrue=c(!0),t.constFalse=c(!1),t.constNull=c(null),t.constUndefined=c(void 0),t.constVoid=t.constUndefined,t.flip=function(t){return function(n,r){return t(r,n)}},t.flow=l,t.tuple=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return t},t.increment=f,t.decrement=d,t.absurd=p,t.tupled=function(t){return function(n){return t.apply(void 0,n)}},t.untupled=function(t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return t(n)}},t.pipe=function(t,n,r,i,o,a,u,s,c){switch(arguments.length){case 1:return t;case 2:return n(t);case 3:return r(n(t));case 4:return i(r(n(t)));case 5:return o(i(r(n(t))));case 6:return a(o(i(r(n(t)))));case 7:return u(a(o(i(r(n(t))))));case 8:return s(u(a(o(i(r(n(t)))))));case 9:return c(s(u(a(o(i(r(n(t))))))));default:for(var l=arguments[0],f=1;f<arguments.length;f++)l=arguments[f](l);return l}},t.hole=p;var h=function(t,n){return n};t.SK=h,t.not=function(t){return function(n){return!t(n)}};var m=function(){return{concat:function(t,n){return l(t,n)},empty:s}};t.getEndomorphismMonoid=m}(Ff);var Fd={},Fp=I&&I.__spreadArray||function(t,n,r){if(r||2===arguments.length)for(var i,o=0,a=n.length;o<a;o++)!i&&o in n||(i||(i=Array.prototype.slice.call(n,0,o)),i[o]=n[o]);return t.concat(i||Array.prototype.slice.call(n))};Object.defineProperty(Fd,"__esModule",{value:!0}),Fd.fromReadonlyNonEmptyArray=Fd.has=Fd.emptyRecord=Fd.emptyReadonlyArray=Fd.tail=Fd.head=Fd.isNonEmpty=Fd.singleton=Fd.right=Fd.left=Fd.isRight=Fd.isLeft=Fd.some=Fd.none=Fd.isSome=Fd.isNone=void 0;var Fh=function(t){return"None"===t._tag};Fd.isNone=Fh;var Fm=function(t){return"Some"===t._tag};Fd.isSome=Fm,Fd.none={_tag:"None"};var Fg=function(t){return{_tag:"Some",value:t}};Fd.some=Fg;var Fy=function(t){return"Left"===t._tag};Fd.isLeft=Fy;var Fv=function(t){return"Right"===t._tag};Fd.isRight=Fv;var Fb=function(t){return{_tag:"Left",left:t}};Fd.left=Fb;var Fx=function(t){return{_tag:"Right",right:t}};Fd.right=Fx;var F_=function(t){return[t]};Fd.singleton=F_;var FS=function(t){return t.length>0};Fd.isNonEmpty=FS;var FT=function(t){return t[0]};Fd.head=FT;var Fw=function(t){return t.slice(1)};Fd.tail=Fw,Fd.emptyReadonlyArray=[],Fd.emptyRecord={},Fd.has=Object.prototype.hasOwnProperty;var FO=function(t){return Fp([t[0]],t.slice(1),!0)};Fd.fromReadonlyNonEmptyArray=FO;var Fk=I&&I.__createBinding||(Object.create?function(t,n,r,i){void 0===i&&(i=r);var o=Object.getOwnPropertyDescriptor(n,r);(!o||("get"in o?!n.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return n[r]}}),Object.defineProperty(t,i,o)}:function(t,n,r,i){void 0===i&&(i=r),t[i]=n[r]}),FI=I&&I.__setModuleDefault||(Object.create?function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}:function(t,n){t.default=n}),FC=I&&I.__importStar||function(t){if(t&&t.__esModule)return t;var n={};if(null!=t)for(var r in t)"default"!==r&&Object.prototype.hasOwnProperty.call(t,r)&&Fk(n,t,r);return FI(n,t),n};Object.defineProperty(Fl,"__esModule",{value:!0}),Fl.sequenceS=Fl.sequenceT=Fl.getApplySemigroup=Fl.apS=Fl.apSecond=Fl.apFirst=Fl.ap=void 0;var FM=FC(Fd);function FR(t,n,r){return function(i){for(var o=Array(r.length+1),a=0;a<r.length;a++)o[a]=r[a];return o[r.length]=i,0===n?t.apply(null,o):FR(t,n-1,o)}}Fl.ap=function(t,n){return function(r){return function(i){return t.ap(t.map(i,function(t){return function(r){return n.ap(t,r)}}),r)}}},Fl.apFirst=function(t){return function(n){return function(r){return t.ap(t.map(r,function(t){return function(){return t}}),n)}}},Fl.apSecond=function(t){return function(n){return function(r){return t.ap(t.map(r,function(){return function(t){return t}}),n)}}},Fl.apS=function(t){return function(n,r){return function(i){return t.ap(t.map(i,function(t){return function(r){var i;return Object.assign({},t,((i={})[n]=r,i))}}),r)}}},Fl.getApplySemigroup=function(t){return function(n){return{concat:function(r,i){return t.ap(t.map(r,function(t){return function(r){return n.concat(t,r)}}),i)}}}};var FE={1:function(t){return[t]},2:function(t){return function(n){return[t,n]}},3:function(t){return function(n){return function(r){return[t,n,r]}}},4:function(t){return function(n){return function(r){return function(i){return[t,n,r,i]}}}},5:function(t){return function(n){return function(r){return function(i){return function(o){return[t,n,r,i,o]}}}}}};function Fj(t){return FM.has.call(FE,t)||(FE[t]=FR(Ff.tuple,t-1,[])),FE[t]}function FN(t){var n=t.length;switch(n){case 1:return function(n){var r;return(r={})[t[0]]=n,r};case 2:return function(n){return function(r){var i;return(i={})[t[0]]=n,i[t[1]]=r,i}};case 3:return function(n){return function(r){return function(i){var o;return(o={})[t[0]]=n,o[t[1]]=r,o[t[2]]=i,o}}};case 4:return function(n){return function(r){return function(i){return function(o){var a;return(a={})[t[0]]=n,a[t[1]]=r,a[t[2]]=i,a[t[3]]=o,a}}}};case 5:return function(n){return function(r){return function(i){return function(o){return function(a){var u;return(u={})[t[0]]=n,u[t[1]]=r,u[t[2]]=i,u[t[3]]=o,u[t[4]]=a,u}}}}};default:return FR(function(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];for(var o={},a=0;a<n;a++)o[t[a]]=r[a];return o},n-1,[])}}Fl.sequenceT=function(t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];for(var i=n.length,o=Fj(i),a=t.map(n[0],o),u=1;u<i;u++)a=t.ap(a,n[u]);return a}},Fl.sequenceS=function(t){return function(n){for(var r=Object.keys(n),i=r.length,o=FN(r),a=t.map(n[r[0]],o),u=1;u<i;u++)a=t.ap(a,n[r[u]]);return a}};var FA={};function FP(t,n){return function(r){return function(i){return t.map(i,function(t){return n.map(t,r)})}}}Object.defineProperty(FA,"__esModule",{value:!0}),FA.getFunctorComposition=FA.bindTo=FA.flap=FA.map=void 0,FA.map=FP,FA.flap=function(t){return function(n){return function(r){return t.map(r,function(t){return t(n)})}}},FA.bindTo=function(t){return function(n){return function(r){return t.map(r,function(t){var r;return(r={})[n]=t,r})}}},FA.getFunctorComposition=function(t,n){var r=FP(t,n);return{map:function(t,n){return(0,Ff.pipe)(t,r(n))}}},Object.defineProperty(Fc,"__esModule",{value:!0}),Fc.getApplicativeComposition=Fc.getApplicativeMonoid=void 0,Fc.getApplicativeMonoid=function(t){var n=(0,Fl.getApplySemigroup)(t);return function(r){return{concat:n(r).concat,empty:t.of(r.empty)}}},Fc.getApplicativeComposition=function(t,n){var r=(0,FA.getFunctorComposition)(t,n).map,i=(0,Fl.ap)(t,n);return{map:r,of:function(r){return t.of(n.of(r))},ap:function(t,n){return(0,Ff.pipe)(t,i(n))}}};var FL={};Object.defineProperty(FL,"__esModule",{value:!0}),FL.bind=FL.chainFirst=void 0,FL.chainFirst=function(t){return function(n){return function(r){return t.chain(r,function(r){return t.map(n(r),function(){return r})})}}},FL.bind=function(t){return function(n,r){return function(i){return t.chain(i,function(i){return t.map(r(i),function(t){var r;return Object.assign({},i,((r={})[n]=t,r))})})}}};var FD={};Object.defineProperty(FD,"__esModule",{value:!0}),FD.tailRec=void 0;var FF=function(t,n){for(var r=n(t);"Left"===r._tag;)r=n(r.left);return r.right};FD.tailRec=FF;var FW={},FU=I&&I.__createBinding||(Object.create?function(t,n,r,i){void 0===i&&(i=r);var o=Object.getOwnPropertyDescriptor(n,r);(!o||("get"in o?!n.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return n[r]}}),Object.defineProperty(t,i,o)}:function(t,n,r,i){void 0===i&&(i=r),t[i]=n[r]}),Fz=I&&I.__setModuleDefault||(Object.create?function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}:function(t,n){t.default=n}),FB=I&&I.__importStar||function(t){if(t&&t.__esModule)return t;var n={};if(null!=t)for(var r in t)"default"!==r&&Object.prototype.hasOwnProperty.call(t,r)&&FU(n,t,r);return Fz(n,t),n};Object.defineProperty(FW,"__esModule",{value:!0}),FW.filterOrElse=FW.chainFirstEitherK=FW.chainEitherK=FW.fromEitherK=FW.chainOptionK=FW.fromOptionK=FW.fromPredicate=FW.fromOption=void 0;var FV=FB(Fd);function F$(t){return function(n){return function(r){return t.fromEither(FV.isNone(r)?FV.left(n()):FV.right(r.value))}}}function Fq(t){var n=F$(t);return function(t){var r=n(t);return function(t){return(0,Ff.flow)(t,r)}}}function FK(t){return function(n){return(0,Ff.flow)(n,t.fromEither)}}FW.fromOption=F$,FW.fromPredicate=function(t){return function(n,r){return function(i){return t.fromEither(n(i)?FV.right(i):FV.left(r(i)))}}},FW.fromOptionK=Fq,FW.chainOptionK=function(t,n){var r=Fq(t);return function(t){var i=r(t);return function(t){return function(r){return n.chain(r,i(t))}}}},FW.fromEitherK=FK,FW.chainEitherK=function(t,n){var r=FK(t);return function(t){return function(i){return n.chain(i,r(t))}}},FW.chainFirstEitherK=function(t,n){return(0,Ff.flow)(FK(t),(0,FL.chainFirst)(n))},FW.filterOrElse=function(t,n){return function(r,i){return function(o){return n.chain(o,function(n){return t.fromEither(r(n)?FV.right(n):FV.left(i(n)))})}}};var FH,FG,FZ,FY,FJ,FQ,FX,F0,F1,F2,F3={};Object.defineProperty(FH=F3,"__esModule",{value:!0}),FH.right=FH.left=FH.flap=FH.Functor=FH.Bifunctor=FH.URI=FH.bimap=FH.mapLeft=FH.map=FH.separated=void 0,FG=function(t,n){return{left:t,right:n}},FH.separated=FG,FZ=function(t,n){return(0,Ff.pipe)(t,(0,FH.map)(n))},FY=function(t,n){return(0,Ff.pipe)(t,(0,FH.mapLeft)(n))},FJ=function(t,n,r){return(0,Ff.pipe)(t,(0,FH.bimap)(n,r))},FQ=function(t){return function(n){return(0,FH.separated)((0,FH.left)(n),t((0,FH.right)(n)))}},FH.map=FQ,FX=function(t){return function(n){return(0,FH.separated)(t((0,FH.left)(n)),(0,FH.right)(n))}},FH.mapLeft=FX,F0=function(t,n){return function(r){return(0,FH.separated)(t((0,FH.left)(r)),n((0,FH.right)(r)))}},FH.bimap=F0,FH.URI="Separated",FH.Bifunctor={URI:FH.URI,mapLeft:FY,bimap:FJ},FH.Functor={URI:FH.URI,map:FZ},FH.flap=(0,FA.flap)(FH.Functor),F1=function(t){return t.left},FH.left=F1,F2=function(t){return t.right},FH.right=F2;var F4={},F5=I&&I.__createBinding||(Object.create?function(t,n,r,i){void 0===i&&(i=r);var o=Object.getOwnPropertyDescriptor(n,r);(!o||("get"in o?!n.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return n[r]}}),Object.defineProperty(t,i,o)}:function(t,n,r,i){void 0===i&&(i=r),t[i]=n[r]}),F9=I&&I.__setModuleDefault||(Object.create?function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}:function(t,n){t.default=n}),F6=I&&I.__importStar||function(t){if(t&&t.__esModule)return t;var n={};if(null!=t)for(var r in t)"default"!==r&&Object.prototype.hasOwnProperty.call(t,r)&&F5(n,t,r);return F9(n,t),n};Object.defineProperty(F4,"__esModule",{value:!0}),F4.filterE=F4.witherDefault=F4.wiltDefault=void 0;var F8=F6(Fd);F4.wiltDefault=function(t,n){return function(r){var i=t.traverse(r);return function(t,o){return r.map(i(t,o),n.separate)}}},F4.witherDefault=function(t,n){return function(r){var i=t.traverse(r);return function(t,o){return r.map(i(t,o),n.compact)}}},F4.filterE=function(t){return function(n){var r=t.wither(n);return function(t){return function(i){return r(i,function(r){return n.map(t(r),function(t){return t?F8.some(r):F8.none})})}}}},WQ=Fs,WX=I&&I.__createBinding||(Object.create?function(t,n,r,i){void 0===i&&(i=r);var o=Object.getOwnPropertyDescriptor(n,r);(!o||("get"in o?!n.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return n[r]}}),Object.defineProperty(t,i,o)}:function(t,n,r,i){void 0===i&&(i=r),t[i]=n[r]}),W0=I&&I.__setModuleDefault||(Object.create?function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}:function(t,n){t.default=n}),W1=I&&I.__importStar||function(t){if(t&&t.__esModule)return t;var n={};if(null!=t)for(var r in t)"default"!==r&&Object.prototype.hasOwnProperty.call(t,r)&&WX(n,t,r);return W0(n,t),n},Object.defineProperty(WQ,"__esModule",{value:!0}),WQ.fold=WQ.match=WQ.foldW=WQ.matchW=WQ.isRight=WQ.isLeft=WQ.fromOption=WQ.fromPredicate=WQ.FromEither=WQ.MonadThrow=WQ.throwError=WQ.ChainRec=WQ.Extend=WQ.extend=WQ.Alt=WQ.alt=WQ.altW=WQ.Bifunctor=WQ.mapLeft=WQ.bimap=WQ.Traversable=WQ.sequence=WQ.traverse=WQ.Foldable=WQ.reduceRight=WQ.foldMap=WQ.reduce=WQ.Monad=WQ.Chain=WQ.chain=WQ.chainW=WQ.Applicative=WQ.Apply=WQ.ap=WQ.apW=WQ.Pointed=WQ.of=WQ.Functor=WQ.map=WQ.getAltValidation=WQ.getApplicativeValidation=WQ.getWitherable=WQ.getFilterable=WQ.getCompactable=WQ.getSemigroup=WQ.getEq=WQ.getShow=WQ.URI=WQ.right=WQ.left=void 0,WQ.getValidation=WQ.getValidationMonoid=WQ.getValidationSemigroup=WQ.getApplyMonoid=WQ.getApplySemigroup=WQ.either=WQ.stringifyJSON=WQ.parseJSON=WQ.sequenceArray=WQ.traverseArray=WQ.traverseArrayWithIndex=WQ.traverseReadonlyArrayWithIndex=WQ.traverseReadonlyNonEmptyArrayWithIndex=WQ.ApT=WQ.apSW=WQ.apS=WQ.bindW=WQ.bind=WQ.bindTo=WQ.Do=WQ.exists=WQ.elem=WQ.toError=WQ.toUnion=WQ.chainNullableK=WQ.fromNullableK=WQ.tryCatchK=WQ.tryCatch=WQ.fromNullable=WQ.orElse=WQ.orElseW=WQ.swap=WQ.filterOrElseW=WQ.filterOrElse=WQ.chainOptionK=WQ.fromOptionK=WQ.duplicate=WQ.flatten=WQ.flattenW=WQ.chainFirstW=WQ.chainFirst=WQ.apSecondW=WQ.apSecond=WQ.apFirstW=WQ.apFirst=WQ.flap=WQ.getOrElse=WQ.getOrElseW=void 0,W2=W1(Fd),WQ.left=W2.left,WQ.right=W2.right,W3=function(t,n){return(0,Ff.pipe)(t,(0,WQ.map)(n))},W4=function(t,n){return(0,Ff.pipe)(t,(0,WQ.ap)(n))},W5=function(t,n){return(0,Ff.pipe)(t,(0,WQ.chain)(n))},W9=function(t,n,r){return(0,Ff.pipe)(t,(0,WQ.reduce)(n,r))},W6=function(t){return function(n,r){var i=(0,WQ.foldMap)(t);return(0,Ff.pipe)(n,i(r))}},W8=function(t,n,r){return(0,Ff.pipe)(t,(0,WQ.reduceRight)(n,r))},W7=function(t){var n=(0,WQ.traverse)(t);return function(t,r){return(0,Ff.pipe)(t,n(r))}},Ue=function(t,n,r){return(0,Ff.pipe)(t,(0,WQ.bimap)(n,r))},Ut=function(t,n){return(0,Ff.pipe)(t,(0,WQ.mapLeft)(n))},Un=function(t,n){return(0,Ff.pipe)(t,(0,WQ.alt)(n))},Ur=function(t,n){return(0,Ff.pipe)(t,(0,WQ.extend)(n))},Ui=function(t,n){return(0,FD.tailRec)(n(t),function(t){return(0,WQ.isLeft)(t)?(0,WQ.right)((0,WQ.left)(t.left)):(0,WQ.isLeft)(t.right)?(0,WQ.left)(n(t.right.left)):(0,WQ.right)((0,WQ.right)(t.right.right))})},WQ.URI="Either",Uo=function(t,n){return{show:function(r){return(0,WQ.isLeft)(r)?"left(".concat(t.show(r.left),")"):"right(".concat(n.show(r.right),")")}}},WQ.getShow=Uo,Ua=function(t,n){return{equals:function(r,i){return r===i||((0,WQ.isLeft)(r)?(0,WQ.isLeft)(i)&&t.equals(r.left,i.left):(0,WQ.isRight)(i)&&n.equals(r.right,i.right))}}},WQ.getEq=Ua,Uu=function(t){return{concat:function(n,r){return(0,WQ.isLeft)(r)?n:(0,WQ.isLeft)(n)?r:(0,WQ.right)(t.concat(n.right,r.right))}}},WQ.getSemigroup=Uu,Us=function(t){var n=(0,WQ.left)(t.empty);return{URI:WQ.URI,_E:void 0,compact:function(t){return(0,WQ.isLeft)(t)?t:"None"===t.right._tag?n:(0,WQ.right)(t.right.value)},separate:function(t){return(0,WQ.isLeft)(t)?(0,F3.separated)(t,t):(0,WQ.isLeft)(t.right)?(0,F3.separated)((0,WQ.right)(t.right.left),n):(0,F3.separated)(n,(0,WQ.right)(t.right.right))}}},WQ.getCompactable=Us,Uc=function(t){var n=(0,WQ.left)(t.empty),r=(0,WQ.getCompactable)(t),i=r.compact,o=r.separate,a=function(t,r){return(0,WQ.isLeft)(t)||r(t.right)?t:n},u=function(t,r){return(0,WQ.isLeft)(t)?(0,F3.separated)(t,t):r(t.right)?(0,F3.separated)(n,(0,WQ.right)(t.right)):(0,F3.separated)((0,WQ.right)(t.right),n)};return{URI:WQ.URI,_E:void 0,map:W3,compact:i,separate:o,filter:a,filterMap:function(t,r){if((0,WQ.isLeft)(t))return t;var i=r(t.right);return"None"===i._tag?n:(0,WQ.right)(i.value)},partition:u,partitionMap:function(t,r){if((0,WQ.isLeft)(t))return(0,F3.separated)(t,t);var i=r(t.right);return(0,WQ.isLeft)(i)?(0,F3.separated)((0,WQ.right)(i.left),n):(0,F3.separated)(n,(0,WQ.right)(i.right))}}},WQ.getFilterable=Uc,Ul=function(t){var n=(0,WQ.getFilterable)(t),r=(0,WQ.getCompactable)(t);return{URI:WQ.URI,_E:void 0,map:W3,compact:n.compact,separate:n.separate,filter:n.filter,filterMap:n.filterMap,partition:n.partition,partitionMap:n.partitionMap,traverse:W7,sequence:WQ.sequence,reduce:W9,foldMap:W6,reduceRight:W8,wither:(0,F4.witherDefault)(WQ.Traversable,r),wilt:(0,F4.wiltDefault)(WQ.Traversable,r)}},WQ.getWitherable=Ul,Uf=function(t){return{URI:WQ.URI,_E:void 0,map:W3,ap:function(n,r){return(0,WQ.isLeft)(n)?(0,WQ.isLeft)(r)?(0,WQ.left)(t.concat(n.left,r.left)):n:(0,WQ.isLeft)(r)?r:(0,WQ.right)(n.right(r.right))},of:WQ.of}},WQ.getApplicativeValidation=Uf,Ud=function(t){return{URI:WQ.URI,_E:void 0,map:W3,alt:function(n,r){if((0,WQ.isRight)(n))return n;var i=r();return(0,WQ.isLeft)(i)?(0,WQ.left)(t.concat(n.left,i.left)):i}}},WQ.getAltValidation=Ud,Up=function(t){return function(n){return(0,WQ.isLeft)(n)?n:(0,WQ.right)(t(n.right))}},WQ.map=Up,WQ.Functor={URI:WQ.URI,map:W3},WQ.of=WQ.right,WQ.Pointed={URI:WQ.URI,of:WQ.of},Uh=function(t){return function(n){return(0,WQ.isLeft)(n)?n:(0,WQ.isLeft)(t)?t:(0,WQ.right)(n.right(t.right))}},WQ.apW=Uh,WQ.ap=WQ.apW,WQ.Apply={URI:WQ.URI,map:W3,ap:W4},WQ.Applicative={URI:WQ.URI,map:W3,ap:W4,of:WQ.of},Um=function(t){return function(n){return(0,WQ.isLeft)(n)?n:t(n.right)}},WQ.chainW=Um,WQ.chain=WQ.chainW,WQ.Chain={URI:WQ.URI,map:W3,ap:W4,chain:W5},WQ.Monad={URI:WQ.URI,map:W3,ap:W4,of:WQ.of,chain:W5},Ug=function(t,n){return function(r){return(0,WQ.isLeft)(r)?t:n(t,r.right)}},WQ.reduce=Ug,Uy=function(t){return function(n){return function(r){return(0,WQ.isLeft)(r)?t.empty:n(r.right)}}},WQ.foldMap=Uy,Uv=function(t,n){return function(r){return(0,WQ.isLeft)(r)?t:n(r.right,t)}},WQ.reduceRight=Uv,WQ.Foldable={URI:WQ.URI,reduce:W9,foldMap:W6,reduceRight:W8},Ub=function(t){return function(n){return function(r){return(0,WQ.isLeft)(r)?t.of((0,WQ.left)(r.left)):t.map(n(r.right),WQ.right)}}},WQ.traverse=Ub,Ux=function(t){return function(n){return(0,WQ.isLeft)(n)?t.of((0,WQ.left)(n.left)):t.map(n.right,WQ.right)}},WQ.sequence=Ux,WQ.Traversable={URI:WQ.URI,map:W3,reduce:W9,foldMap:W6,reduceRight:W8,traverse:W7,sequence:WQ.sequence},U_=function(t,n){return function(r){return(0,WQ.isLeft)(r)?(0,WQ.left)(t(r.left)):(0,WQ.right)(n(r.right))}},WQ.bimap=U_,US=function(t){return function(n){return(0,WQ.isLeft)(n)?(0,WQ.left)(t(n.left)):n}},WQ.mapLeft=US,WQ.Bifunctor={URI:WQ.URI,bimap:Ue,mapLeft:Ut},UT=function(t){return function(n){return(0,WQ.isLeft)(n)?t():n}},WQ.altW=UT,WQ.alt=WQ.altW,WQ.Alt={URI:WQ.URI,map:W3,alt:Un},Uw=function(t){return function(n){return(0,WQ.isLeft)(n)?n:(0,WQ.right)(t(n))}},WQ.extend=Uw,WQ.Extend={URI:WQ.URI,map:W3,extend:Ur},WQ.ChainRec={URI:WQ.URI,map:W3,ap:W4,chain:W5,chainRec:Ui},WQ.throwError=WQ.left,WQ.MonadThrow={URI:WQ.URI,map:W3,ap:W4,of:WQ.of,chain:W5,throwError:WQ.throwError},WQ.FromEither={URI:WQ.URI,fromEither:Ff.identity},WQ.fromPredicate=(0,FW.fromPredicate)(WQ.FromEither),WQ.fromOption=(0,FW.fromOption)(WQ.FromEither),WQ.isLeft=W2.isLeft,WQ.isRight=W2.isRight,UO=function(t,n){return function(r){return(0,WQ.isLeft)(r)?t(r.left):n(r.right)}},WQ.matchW=UO,WQ.foldW=WQ.matchW,WQ.match=WQ.matchW,WQ.fold=WQ.match,Uk=function(t){return function(n){return(0,WQ.isLeft)(n)?t(n.left):n.right}},WQ.getOrElseW=Uk,WQ.getOrElse=WQ.getOrElseW,WQ.flap=(0,FA.flap)(WQ.Functor),WQ.apFirst=(0,Fl.apFirst)(WQ.Apply),WQ.apFirstW=WQ.apFirst,WQ.apSecond=(0,Fl.apSecond)(WQ.Apply),WQ.apSecondW=WQ.apSecond,WQ.chainFirst=(0,FL.chainFirst)(WQ.Chain),WQ.chainFirstW=WQ.chainFirst,WQ.flattenW=(0,WQ.chainW)(Ff.identity),WQ.flatten=WQ.flattenW,WQ.duplicate=(0,WQ.extend)(Ff.identity),WQ.fromOptionK=(0,FW.fromOptionK)(WQ.FromEither),WQ.chainOptionK=(0,FW.chainOptionK)(WQ.FromEither,WQ.Chain),WQ.filterOrElse=(0,FW.filterOrElse)(WQ.FromEither,WQ.Chain),WQ.filterOrElseW=WQ.filterOrElse,UI=function(t){return(0,WQ.isLeft)(t)?(0,WQ.right)(t.left):(0,WQ.left)(t.right)},WQ.swap=UI,UC=function(t){return function(n){return(0,WQ.isLeft)(n)?t(n.left):n}},WQ.orElseW=UC,WQ.orElse=WQ.orElseW,UM=function(t){return function(n){return null==n?(0,WQ.left)(t):(0,WQ.right)(n)}},WQ.fromNullable=UM,UR=function(t,n){try{return(0,WQ.right)(t())}catch(r){return(0,WQ.left)(n(r))}},WQ.tryCatch=UR,UE=function(t,n){return function(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];return(0,WQ.tryCatch)(function(){return t.apply(void 0,r)},n)}},WQ.tryCatchK=UE,Uj=function(t){var n=(0,WQ.fromNullable)(t);return function(t){return(0,Ff.flow)(t,n)}},WQ.fromNullableK=Uj,UN=function(t){var n=(0,WQ.fromNullableK)(t);return function(t){return(0,WQ.chain)(n(t))}},WQ.chainNullableK=UN,WQ.toUnion=(0,WQ.foldW)(Ff.identity,Ff.identity),WQ.toError=function(t){return t instanceof Error?t:Error(String(t))},WQ.elem=function t(n){return function(r,i){if(void 0===i){var o=t(n);return function(t){return o(r,t)}}return!(0,WQ.isLeft)(i)&&n.equals(r,i.right)}},UA=function(t){return function(n){return!(0,WQ.isLeft)(n)&&t(n.right)}},WQ.exists=UA,WQ.Do=(0,WQ.of)(W2.emptyRecord),WQ.bindTo=(0,FA.bindTo)(WQ.Functor),WQ.bind=(0,FL.bind)(WQ.Chain),WQ.bindW=WQ.bind,WQ.apS=(0,Fl.apS)(WQ.Apply),WQ.apSW=WQ.apS,WQ.ApT=(0,WQ.of)(W2.emptyReadonlyArray),UP=function(t){return function(n){var r=t(0,W2.head(n));if((0,WQ.isLeft)(r))return r;for(var i=[r.right],o=1;o<n.length;o++){var a=t(o,n[o]);if((0,WQ.isLeft)(a))return a;i.push(a.right)}return(0,WQ.right)(i)}},WQ.traverseReadonlyNonEmptyArrayWithIndex=UP,UL=function(t){var n=(0,WQ.traverseReadonlyNonEmptyArrayWithIndex)(t);return function(t){return W2.isNonEmpty(t)?n(t):WQ.ApT}},WQ.traverseReadonlyArrayWithIndex=UL,WQ.traverseArrayWithIndex=WQ.traverseReadonlyArrayWithIndex,UD=function(t){return(0,WQ.traverseReadonlyArrayWithIndex)(function(n,r){return t(r)})},WQ.traverseArray=UD,WQ.sequenceArray=(0,WQ.traverseArray)(Ff.identity),WQ.parseJSON=function(t,n){return(0,WQ.tryCatch)(function(){return JSON.parse(t)},n)},UF=function(t,n){return(0,WQ.tryCatch)(function(){var n=JSON.stringify(t);if("string"!=typeof n)throw Error("Converting unsupported structure to JSON");return n},n)},WQ.stringifyJSON=UF,WQ.either={URI:WQ.URI,map:W3,of:WQ.of,ap:W4,chain:W5,reduce:W9,foldMap:W6,reduceRight:W8,traverse:W7,sequence:WQ.sequence,bimap:Ue,mapLeft:Ut,alt:Un,extend:Ur,chainRec:Ui,throwError:WQ.throwError},WQ.getApplySemigroup=(0,Fl.getApplySemigroup)(WQ.Apply),WQ.getApplyMonoid=(0,Fc.getApplicativeMonoid)(WQ.Applicative),UW=function(t,n){return(0,Fl.getApplySemigroup)((0,WQ.getApplicativeValidation)(t))(n)},WQ.getValidationSemigroup=UW,UU=function(t,n){return(0,Fc.getApplicativeMonoid)((0,WQ.getApplicativeValidation)(t))(n)},WQ.getValidationMonoid=UU,WQ.getValidation=function(t){var n=(0,WQ.getApplicativeValidation)(t).ap,r=(0,WQ.getAltValidation)(t).alt;return{URI:WQ.URI,_E:void 0,map:W3,of:WQ.of,chain:W5,bimap:Ue,mapLeft:Ut,reduce:W9,foldMap:W6,reduceRight:W8,extend:Ur,traverse:W7,sequence:WQ.sequence,chainRec:Ui,throwError:WQ.throwError,ap:n,alt:r}};var F7=globalThis&&globalThis.__extends||(Uz=function(t,n){return(Uz=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])})(t,n)},function(t,n){if("function"!=typeof n&&null!==n)throw TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}Uz(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}),We=globalThis&&globalThis.__assign||function(){return(We=Object.assign||function(t){for(var n,r=1,i=arguments.length;r<i;r++)for(var o in n=arguments[r])Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o]);return t}).apply(this,arguments)},Wt=globalThis&&globalThis.__spreadArray||function(t,n,r){if(r||2===arguments.length)for(var i,o=0,a=n.length;o<a;o++)!i&&o in n||(i||(i=Array.prototype.slice.call(n,0,o)),i[o]=n[o]);return t.concat(i||Array.prototype.slice.call(n))},Wn=function(t,n,r){return eH([{value:t,context:n,message:r}])},Wr=function(){function t(t,n,r,i){this.name=t,this.is=n,this.validate=r,this.encode=i,this.decode=this.decode.bind(this)}return t.prototype.pipe=function(n,r){var i=this;return void 0===r&&(r="pipe(".concat(this.name,", ").concat(n.name,")")),new t(r,n.is,function(t,r){var o=i.validate(t,r);return pI(o)?o:n.validate(o.right,r)},this.encode===Wi&&n.encode===Wi?Wi:function(t){return i.encode(n.encode(t))})},t.prototype.asDecoder=function(){return this},t.prototype.asEncoder=function(){return this},t.prototype.decode=function(t){return this.validate(t,[{key:"",type:this,actual:t}])},t}(),Wi=function(t){return t};function Wo(t){return t.displayName||t.name||"<function".concat(t.length,">")}function Wa(t,n,r,i){for(var o=t.length,a=Array(o+1),u=0;u<o;u++)a[u]=t[u];return a[o]={key:n,type:r,actual:i},a}function Wu(t,n){for(var r=n.length,i=0;i<r;i++)t.push(n[i])}var Ws=Object.prototype.hasOwnProperty;function Wc(t){return Object.keys(t).map(function(n){return"".concat(n,": ").concat(t[n].name)}).join(", ")}function Wl(t){for(var n=0;n<t.length;n++)if(t[n].encode!==Wi)return!1;return!0}function Wf(t){return"{ ".concat(Wc(t)," }")}function Wd(t){return"Partial<".concat(t,">")}function Wp(t){if(W_(t)){var n,r,i=t.value;if(WL.is(i))return(n={})[i]=null,n}else{if(r=t,"KeyofType"===r._tag)return t.keys;if(WT(t)){var o=t.types.map(function(t){return Wp(t)});return o.some(WR.is)?void 0:Object.assign.apply(Object,Wt([{}],o,!1))}}}function Wh(t){return"("+t.map(function(t){return t.name}).join(" | ")+")"}function Wm(t,n){for(var r=!0,i=!0,o=!WK.is(t),a=0;a<n.length;a++){var u=n[a];u!==t&&(r=!1),WK.is(u)&&(i=!1)}if(r)return t;if(i)return n[n.length-1];for(var s={},c=0;c<n.length;c++){var u=n[c];for(var l in u)(!Ws.call(s,l)||o||u[l]!==t[l])&&(s[l]=u[l])}return s}function Wg(t,n){for(var r=Object.getOwnPropertyNames(t),i=!1,o={},a=0;a<r.length;a++){var u=r[a];Ws.call(n,u)?o[u]=t[u]:i=!0}return i?o:t}function Wy(t){return t.length>0}var Wv={};function Wb(t,n){for(var r=[],i=0;i<t.length;i++){var o=t[i];-1!==n.indexOf(o)&&r.push(o)}return r}function Wx(t){return"AnyType"===t._tag}function W_(t){return"LiteralType"===t._tag}function WS(t){return"InterfaceType"===t._tag}function WT(t){return"UnionType"===t._tag}var Ww=[];function WO(t){if(-1!==Ww.indexOf(t))return Wv;if(WS(t)||"StrictType"===(n=t)._tag){var n,r,i,o,a,u=Wv;for(var s in t.props){var c=t.props[s];W_(c)&&(u===Wv&&(u={}),u[s]=[c.value])}return u}if("ExactType"===t._tag||"RefinementType"===t._tag)return WO(t.type);if("IntersectionType"===t._tag)return t.types.reduce(function(t,n){return function(t,n){if(t===Wv)return n;if(n===Wv)return t;var r=Object.assign({},t);for(var i in n)if(Ws.call(t,i)){var o=Wb(t[i],n[i]);if(Wy(o))r[i]=o;else{r=Wv;break}}else r[i]=n[i];return r}(t,WO(n))},Wv);if(WT(t))return t.types.slice(1).reduce(function(t,n){return function(t,n){if(t===Wv||n===Wv)return Wv;var r=Wv;for(var i in t)Ws.call(n,i)&&0===Wb(t[i],n[i]).length&&(r===Wv&&(r={}),r[i]=t[i].concat(n[i]));return r}(t,WO(n))},WO(t.types[0]));if("RecursiveType"===t._tag){Ww.push(t);var l=WO(t.type);return Ww.pop(),l}return Wv}function Wk(t){var n=WO(t[0]),r=Object.keys(n),i=t.length;e:for(var o=0;o<r.length;o++){var a=function(r){for(var o=n[r].slice(),a=[n[r]],u=1;u<i;u++){var s=WO(t[u])[r];if(void 0===s||s.some(function(t){return -1!==o.indexOf(t)}))return"continue-keys";o.push.apply(o,s),a.push(s)}return{value:[r,a]}}(r[o]);if("object"==typeof a)return a.value;if("continue-keys"===a)continue e}}var WI=function(t){function n(){var n=t.call(this,"null",function(t){return null===t},function(t,r){return n.is(t)?eG(t):Wn(t,r)},Wi)||this;return n._tag="NullType",n}return F7(n,t),n}(Wr),WC=new WI,WM=function(t){function n(){var n=t.call(this,"undefined",function(t){return void 0===t},function(t,r){return n.is(t)?eG(t):Wn(t,r)},Wi)||this;return n._tag="UndefinedType",n}return F7(n,t),n}(Wr),WR=new WM,WE=function(t){function n(){var n=t.call(this,"void",WR.is,WR.validate,Wi)||this;return n._tag="VoidType",n}return F7(n,t),n}(Wr),Wj=new WE,WN=function(t){function n(){var n=t.call(this,"unknown",function(t){return!0},eG,Wi)||this;return n._tag="UnknownType",n}return F7(n,t),n}(Wr),WA=new WN,WP=function(t){function n(){var n=t.call(this,"string",function(t){return"string"==typeof t},function(t,r){return n.is(t)?eG(t):Wn(t,r)},Wi)||this;return n._tag="StringType",n}return F7(n,t),n}(Wr),WL=new WP,WD=function(t){function n(){var n=t.call(this,"number",function(t){return"number"==typeof t},function(t,r){return n.is(t)?eG(t):Wn(t,r)},Wi)||this;return n._tag="NumberType",n}return F7(n,t),n}(Wr),WF=new WD,WW=function(t){function n(){var n=t.call(this,"bigint",function(t){return"bigint"==typeof t},function(t,r){return n.is(t)?eG(t):Wn(t,r)},Wi)||this;return n._tag="BigIntType",n}return F7(n,t),n}(Wr),WU=new WW,Wz=function(t){function n(){var n=t.call(this,"boolean",function(t){return"boolean"==typeof t},function(t,r){return n.is(t)?eG(t):Wn(t,r)},Wi)||this;return n._tag="BooleanType",n}return F7(n,t),n}(Wr),WB=new Wz,WV=function(t){function n(){var n=t.call(this,"UnknownArray",Array.isArray,function(t,r){return n.is(t)?eG(t):Wn(t,r)},Wi)||this;return n._tag="AnyArrayType",n}return F7(n,t),n}(Wr),W$=new WV,Wq=function(t){function n(){var n=t.call(this,"UnknownRecord",function(t){var n=Object.prototype.toString.call(t);return"[object Object]"===n||"[object Window]"===n},function(t,r){return n.is(t)?eG(t):Wn(t,r)},Wi)||this;return n._tag="AnyDictionaryType",n}return F7(n,t),n}(Wr),WK=new Wq,WH=function(t){function n(n,r,i,o,a){var u=t.call(this,n,r,i,o)||this;return u.value=a,u._tag="LiteralType",u}return F7(n,t),n}(Wr);function WG(t,n){void 0===n&&(n=JSON.stringify(t));var r=function(n){return n===t};return new WH(n,r,function(n,i){return r(n)?eG(t):Wn(n,i)},Wi,t)}var WZ=function(t){function n(n,r,i,o,a){var u=t.call(this,n,r,i,o)||this;return u.keys=a,u._tag="KeyofType",u}return F7(n,t),n}(Wr),WY=function(t){function n(n,r,i,o,a,u){var s=t.call(this,n,r,i,o)||this;return s.type=a,s.predicate=u,s._tag="RefinementType",s}return F7(n,t),n}(Wr);function WJ(t,n,r){return zd(t,n,r)}var WQ,WX,W0,W1,W2,W3,W4,W5,W9,W6,W8,W7,Ue,Ut,Un,Ur,Ui,Uo,Ua,Uu,Us,Uc,Ul,Uf,Ud,Up,Uh,Um,Ug,Uy,Uv,Ub,Ux,U_,US,UT,Uw,UO,Uk,UI,UC,UM,UR,UE,Uj,UN,UA,UP,UL,UD,UF,UW,UU,Uz,UB,UV,U$=zd(WF,UV=function(t){return Number.isInteger(t)},"Int"),Uq=function(t){function n(n,r,i,o,a){var u=t.call(this,n,r,i,o)||this;return u.runDefinition=a,u._tag="RecursiveType",u}return F7(n,t),n}(Wr);function UK(t,n){var r,i=function(){return r||((r=n(o)).name=t),r},o=new Uq(t,function(t){return i().is(t)},function(t,n){return i().validate(t,n)},function(t){return i().encode(t)},i);return o}Object.defineProperty(Uq.prototype,"type",{get:function(){return this.runDefinition()},enumerable:!0,configurable:!0});var UH=function(t){function n(n,r,i,o,a){var u=t.call(this,n,r,i,o)||this;return u.type=a,u._tag="ArrayType",u}return F7(n,t),n}(Wr);function UG(t,n){return void 0===n&&(n="Array<".concat(t.name,">")),new UH(n,function(n){return W$.is(n)&&n.every(t.is)},function(n,r){var i=W$.validate(n,r);if(pI(i))return i;for(var o=i.right,a=o.length,u=o,s=[],c=0;c<a;c++){var l=o[c],f=t.validate(l,Wa(r,String(c),t,l));if(pI(f))Wu(s,f.left);else{var d=f.right;d!==l&&(u===o&&(u=o.slice()),u[c]=d)}}return s.length>0?eH(s):eG(u)},t.encode===Wi?Wi:function(n){return n.map(t.encode)},t)}var UZ=function(t){function n(n,r,i,o,a){var u=t.call(this,n,r,i,o)||this;return u.props=a,u._tag="InterfaceType",u}return F7(n,t),n}(Wr);function UY(t,n){void 0===n&&(n=Wf(t));var r=Object.keys(t),i=r.map(function(n){return t[n]}),o=r.length;return new UZ(n,function(t){if(WK.is(t)){for(var n=0;n<o;n++){var a=r[n],u=t[a];if(void 0===u&&!Ws.call(t,a)||!i[n].is(u))return!1}return!0}return!1},function(t,n){var a=WK.validate(t,n);if(pI(a))return a;for(var u=a.right,s=u,c=[],l=0;l<o;l++){var f=r[l],d=s[f],p=i[l],h=p.validate(d,Wa(n,f,p,d));if(pI(h))Wu(c,h.left);else{var m=h.right;m===d&&(void 0!==m||Ws.call(s,f))||(s===u&&(s=We({},u)),s[f]=m)}}return c.length>0?eH(c):eG(s)},Wl(i)?Wi:function(t){for(var n=We({},t),a=0;a<o;a++){var u=r[a],s=i[a].encode;s!==Wi&&(n[u]=s(t[u]))}return n},t)}var UJ=function(t){function n(n,r,i,o,a){var u=t.call(this,n,r,i,o)||this;return u.props=a,u._tag="PartialType",u}return F7(n,t),n}(Wr),UQ=function(t){function n(n,r,i,o,a,u){var s=t.call(this,n,r,i,o)||this;return s.domain=a,s.codomain=u,s._tag="DictionaryType",s}return F7(n,t),n}(Wr);function UX(t,n,r){var i,o,a,u,s,c,l,f,d=Wp(t);return d?(i=Object.keys(d),void 0===(u=r)&&(u="{ [K in ".concat(t.name,"]: ").concat(n.name," }")),s=i.length,new UQ(u,function(t){return WK.is(t)&&i.every(function(r){return n.is(t[r])})},function(t,r){var o=WK.validate(t,r);if(pI(o))return o;for(var a=o.right,u={},c=[],l=!1,f=0;f<s;f++){var d=i[f],p=a[d],h=n.validate(p,Wa(r,d,n,p));if(pI(h))Wu(c,h.left);else{var m=h.right;l=l||m!==p,u[d]=m}}return c.length>0?eH(c):eG(l||Object.keys(a).length!==s?u:a)},n.encode===Wi?Wi:function(t){for(var r={},o=0;o<s;o++){var a=i[o];r[a]=n.encode(t[a])}return r},t,n)):(c=t,void 0===(f=r)&&(f="{ [K in ".concat(c.name,"]: ").concat(n.name," }")),new UQ(f,function(t){return WK.is(t)?Object.keys(t).every(function(r){return c.is(r)&&n.is(t[r])}):Wx(n)&&Array.isArray(t)},function(t,r){if(WK.is(t)){for(var i={},o=[],a=Object.keys(t),u=a.length,s=!1,l=0;l<u;l++){var f=a[l],d=t[f],p=c.validate(f,Wa(r,f,c,f));if(pI(p))Wu(o,p.left);else{var h=p.right;s=s||h!==f,f=h;var m=n.validate(d,Wa(r,f,n,d));if(pI(m))Wu(o,m.left);else{var g=m.right;s=s||g!==d,i[f]=g}}}return o.length>0?eH(o):eG(s?i:t)}return Wx(n)&&Array.isArray(t)?eG(t):Wn(t,r)},c.encode===Wi&&n.encode===Wi?Wi:function(t){for(var r={},i=Object.keys(t),o=i.length,a=0;a<o;a++){var u=i[a];r[String(c.encode(u))]=n.encode(t[u])}return r},c,n))}var U0=function(t){function n(n,r,i,o,a){var u=t.call(this,n,r,i,o)||this;return u.types=a,u._tag="UnionType",u}return F7(n,t),n}(Wr);function U1(t,n){void 0===n&&(n=Wh(t));var r=Wk(t);if(void 0===r||!(t.length>0))return new U0(n,function(n){return t.some(function(t){return t.is(n)})},function(n,r){for(var i=[],o=0;o<t.length;o++){var a=t[o],u=a.validate(n,Wa(r,String(o),a,n));if(!pI(u))return eG(u.right);Wu(i,u.left)}return eH(i)},Wl(t)?Wi:function(r){for(var i=0;i<t.length;i++){var o=t[i];if(o.is(r))return o.encode(r)}throw Error("no codec found to encode value in union type ".concat(n))},t);var i=r[0],o=r[1],a=o.length,u=function(t){for(var n=0;n<a;n++)if(-1!==o[n].indexOf(t))return n};return new zn(n,function(n){if(WK.is(n)){var r=u(n[i]);return void 0!==r&&t[r].is(n)}return!1},function(n,r){var o=WK.validate(n,r);if(pI(o))return o;var a=o.right,s=u(a[i]);if(void 0===s)return Wn(n,r);var c=t[s];return c.validate(a,Wa(r,String(s),c,a))},Wl(t)?Wi:function(r){var o=u(r[i]);if(void 0===o)throw Error("no codec found to encode value in union codec ".concat(n));return t[o].encode(r)},t,i)}var U2=function(t){function n(n,r,i,o,a){var u=t.call(this,n,r,i,o)||this;return u.types=a,u._tag="IntersectionType",u}return F7(n,t),n}(Wr),U3=function(t){function n(n,r,i,o,a){var u=t.call(this,n,r,i,o)||this;return u.types=a,u._tag="TupleType",u}return F7(n,t),n}(Wr),U4=function(t){function n(n,r,i,o,a){var u=t.call(this,n,r,i,o)||this;return u.type=a,u._tag="ReadonlyType",u}return F7(n,t),n}(Wr),U5=function(t){function n(n,r,i,o,a){var u=t.call(this,n,r,i,o)||this;return u.type=a,u._tag="ReadonlyArrayType",u}return F7(n,t),n}(Wr);function U9(t,n){void 0===n&&(n="ReadonlyArray<".concat(t.name,">"));var r=UG(t);return new U5(n,r.is,r.validate,r.encode,t)}var U6=function(t,n){return U7(UY(t),n)},U8=function(t){function n(n,r,i,o,a){var u=t.call(this,n,r,i,o)||this;return u.type=a,u._tag="ExactType",u}return F7(n,t),n}(Wr);function U7(t,n){void 0===n&&(n=WS(i=t)?"{| ".concat(Wc(i.props)," |}"):(r=i,"PartialType"===r._tag)?Wd("{| ".concat(Wc(i.props)," |}")):"Exact<".concat(i.name,">"));var r,i,o=function t(n){switch(n._tag){case"RefinementType":case"ReadonlyType":return t(n.type);case"InterfaceType":case"StrictType":case"PartialType":return n.props;case"IntersectionType":return n.types.reduce(function(n,r){return Object.assign(n,t(r))},{})}}(t);return new U8(n,t.is,function(n,r){var i=WK.validate(n,r);if(pI(i))return i;var a=t.validate(n,r);return pI(a)?a:eG(Wg(a.right,o))},function(n){return t.encode(Wg(n,o))},t)}var ze=function(t){function n(){var n=t.call(this,"Function",function(t){return"function"==typeof t},function(t,r){return n.is(t)?eG(t):Wn(t,r)},Wi)||this;return n._tag="FunctionType",n}return F7(n,t),n}(Wr),zt=new ze,zn=function(t){function n(n,r,i,o,a,u){var s=t.call(this,n,r,i,o,a)||this;return s.tag=u,s}return F7(n,t),n}(U0),zr=function(t,n,r){void 0===r&&(r=Wh(n));var i=U1(n,r);return i instanceof zn?i:(console.warn("[io-ts] Cannot build a tagged union for ".concat(r,", returning a de-optimized union")),new zn(r,i.is,i.validate,i.encode,n,t))},zi=function(t,n){return{value:t,context:n}},zo=function(t){return[{key:"",type:t}]},za=function(t){function n(){var n=t.call(this,"never",function(t){return!1},function(t,n){return Wn(t,n)},function(){throw Error("cannot encode never")})||this;return n._tag="NeverType",n}return F7(n,t),n}(Wr),zu=new za,zs=function(t){function n(){var n=t.call(this,"any",function(t){return!0},eG,Wi)||this;return n._tag="AnyType",n}return F7(n,t),n}(Wr),zc=new zs,zl=function(t){function n(){var n=t.call(this,"object",function(t){return null!==t&&"object"==typeof t},function(t,r){return n.is(t)?eG(t):Wn(t,r)},Wi)||this;return n._tag="ObjectType",n}return F7(n,t),n}(Wr),zf=new zl;function zd(t,n,r){return void 0===r&&(r="(".concat(t.name," | ").concat(Wo(n),")")),new WY(r,function(r){return t.is(r)&&n(r)},function(r,i){var o=t.validate(r,i);if(pI(o))return o;var a=o.right;return n(a)?eG(a):Wn(a,i)},t.encode,t,n)}var zp=zd(WF,Number.isInteger,"Integer"),zh=function(t){function n(n,r,i,o,a){var u=t.call(this,n,r,i,o)||this;return u.props=a,u._tag="StrictType",u}return F7(n,t),n}(Wr);function zm(t){return t}let zg=Object.freeze(Object.defineProperty({__proto__:null,AnyArrayType:WV,AnyDictionaryType:Wq,AnyType:zs,Array:W$,ArrayType:UH,BigIntType:WW,BooleanType:Wz,Dictionary:WK,DictionaryType:UQ,ExactType:U8,Function:zt,FunctionType:ze,Int:U$,Integer:zp,InterfaceType:UZ,IntersectionType:U2,KeyofType:WZ,LiteralType:WH,NeverType:za,NullType:WI,NumberType:WD,ObjectType:zl,PartialType:UJ,ReadonlyArrayType:U5,ReadonlyType:U4,RecursiveType:Uq,RefinementType:WY,StrictType:zh,StringType:WP,TaggedUnionType:zn,TupleType:U3,Type:Wr,UndefinedType:WM,UnionType:U0,UnknownArray:W$,UnknownRecord:WK,UnknownType:WN,VoidType:WE,alias:function(t){return function(){return t}},any:zc,appendContext:Wa,array:UG,bigint:WU,boolean:WB,brand:WJ,clean:zm,dictionary:UX,emptyTags:Wv,exact:U7,failure:Wn,failures:eH,getContextEntry:function(t,n){return{key:t,type:n}},getDefaultContext:zo,getDomainKeys:Wp,getFunctionName:Wo,getIndex:Wk,getTags:WO,getValidationError:zi,identity:Wi,interface:UY,intersection:function(t,n){void 0===n&&(n="(".concat(t.map(function(t){return t.name}).join(" & "),")"));var r=t.length;return new U2(n,function(n){return t.every(function(t){return t.is(n)})},0===t.length?eG:function(n,i){for(var o=[],a=[],u=0;u<r;u++){var s=t[u],c=s.validate(n,Wa(i,String(u),s,n));pI(c)?Wu(a,c.left):o.push(c.right)}return a.length>0?eH(a):eG(Wm(n,o))},0===t.length?Wi:function(n){return Wm(n,t.map(function(t){return t.encode(n)}))},t)},keyof:function(t,n){void 0===n&&(n=Object.keys(t).map(function(t){return JSON.stringify(t)}).join(" | "));var r=function(n){return WL.is(n)&&Ws.call(t,n)};return new WZ(n,r,function(t,n){return r(t)?eG(t):Wn(t,n)},Wi,t)},literal:WG,mergeAll:Wm,never:zu,null:WC,nullType:WC,number:WF,object:zf,partial:function(t,n){void 0===n&&(n=Wd(Wf(t)));var r=Object.keys(t),i=r.map(function(n){return t[n]}),o=r.length;return new UJ(n,function(n){if(WK.is(n)){for(var i=0;i<o;i++){var a=r[i],u=n[a];if(void 0!==u&&!t[a].is(u))return!1}return!0}return!1},function(n,i){var a=WK.validate(n,i);if(pI(a))return a;for(var u=a.right,s=u,c=[],l=0;l<o;l++){var f=r[l],d=s[f],p=t[f],h=p.validate(d,Wa(i,f,p,d));if(pI(h))void 0!==d&&Wu(c,h.left);else{var m=h.right;m!==d&&(s===u&&(s=We({},u)),s[f]=m)}}return c.length>0?eH(c):eG(s)},Wl(i)?Wi:function(t){for(var n=We({},t),a=0;a<o;a++){var u=r[a],s=t[u];void 0!==s&&(n[u]=i[a].encode(s))}return n},t)},readonly:function(t,n){return void 0===n&&(n="Readonly<".concat(t.name,">")),new U4(n,t.is,t.validate,t.encode,t)},readonlyArray:U9,record:UX,recursion:UK,refinement:zd,strict:U6,string:WL,success:eG,taggedUnion:zr,tuple:function(t,n){void 0===n&&(n="[".concat(t.map(function(t){return t.name}).join(", "),"]"));var r=t.length;return new U3(n,function(n){return W$.is(n)&&n.length===r&&t.every(function(t,r){return t.is(n[r])})},function(n,i){var o=W$.validate(n,i);if(pI(o))return o;for(var a=o.right,u=a.length>r?a.slice(0,r):a,s=[],c=0;c<r;c++){var l=a[c],f=t[c],d=f.validate(l,Wa(i,String(c),f,l));if(pI(d))Wu(s,d.left);else{var p=d.right;p!==l&&(u===a&&(u=a.slice()),u[c]=p)}}return s.length>0?eH(s):eG(u)},Wl(t)?Wi:function(n){return t.map(function(t,r){return t.encode(n[r])})},t)},type:UY,undefined:WR,union:U1,unknown:WA,void:Wj,voidType:Wj},Symbol.toStringTag,{value:"Module"})),zy=C(zg);var zv={};Object.defineProperty(zv,"__esModule",{value:!0}),zv.ContentPath=void 0,zv.ContentPath={serialize:t=>t.map(t=>t.key).join("::"),current:t=>t[t.length-1],append:(t,n)=>t+"::"+n,make:t=>t.reduce((t,{key:n,type:r})=>n?t.concat({key:n,type:r}):t,[])};var zb={},zx={};Object.defineProperty(zx,"__esModule",{value:!0}),zx.getAssetOrThrow=void 0;let z_=t=>n=>{let r=t[n];if(!r)throw Error(`Missing asset with id '${n}'!`);return r};zx.getAssetOrThrow=z_;var zS={};Object.defineProperty(zS,"__esModule",{value:!0}),zS.getEmbedOrThrow=void 0;let zT=t=>n=>{let r=t[n];if(!r)throw Error(`Missing embed with url '${n}'`);return r};zS.getEmbedOrThrow=zT;var zw={},zO={};let zk=C(eW);function zI(t,n,r){return void 0===r&&(r=t.name),new Wr(r,t.is,t.validate,function(r){return n(t.encode(r))})}let zC=Object.freeze(Object.defineProperty({__proto__:null,mapOutput:zI},Symbol.toStringTag,{value:"Module"}));var zM,zR,zE,zj=zd(WL,zR=function(t){return t.length>0},"NonEmptyString");function zN(t,n){void 0===n&&(n="NonEmptyArray<"+t.name+">");var r=UG(t);return new Wr(n,function(t){return r.is(t)&&rY(t)},function(t,n){return eL(r.validate(t,n),pf(function(r){var i=r6(r);return fG(i)?Wn(t,n):eG(i.value)}))},function(t){return r.encode(t)})}function zA(t,n,r){void 0===r&&(r="Set<"+t.name+">");var i=UG(t),o=E5(n),a=EQ(n);return new Wr(r,function(n){return n instanceof Set&&Rr(t.is)(n)},function(t,n){return eL(i.validate(t,n),pf(function(r){var i=a(r);return i.size!==r.length?Wn(t,n):eG(i)}))},function(t){return i.encode(o(t))})}function zP(t,n){return new Wr(t,n,function(t,r){return n(t)?eG(t):Wn(t,r)},Wi)}var zL=zP("Date",function(t){return t instanceof Date}),zD=globalThis&&globalThis.__spreadArray||function(t,n,r){if(r||2===arguments.length)for(var i,o=0,a=n.length;o<a;o++)!i&&o in n||(i||(i=Array.prototype.slice.call(n,0,o)),i[o]=n[o]);return t.concat(i||Array.prototype.slice.call(n))},zF=function(t,n){return{get:t,reverseGet:n}},zW=function(t){return zV(t.get,eE(t.reverseGet,ek))},zU=function(t){return z0(eE(t.get,e$),t.reverseGet)},zz=function(t){return z5(eE(t.get,e$),eE(t.reverseGet,ek))},zB=function(t){return Bt(function(n){return function(r){return function(i){return n.map(r(t.get(i)),function(n){return t.reverseGet(n)})}}})},zV=function(t,n){return{get:t,set:n}},z$=function(t){return z5(eE(t.get,e$),t.set)},zq=function(t){return Bt(function(n){return function(r){return function(i){return n.map(r(t.get(i)),function(n){return t.set(n)(i)})}}})},zK=function(t){return function(n){return zV(function(r){return t.get(n.get(r))},function(r){return function(i){return n.set(t.set(r)(n.get(i)))(i)}})}},zH=function(t){return function(n){return z0(eE(n.getOption,fv(t.getOption)),eE(t.reverseGet,n.reverseGet))}},zG=function(t){return function(n){return z7(z1(t))(z$(n))}},zZ=function(){return zV(eO,ek)},zY=function(t){return function(n){return zV(function(r){return n.get(r)[t]},function(r){return function(i){var o,a=n.get(i);return r===a[t]?i:n.set(Object.assign({},a,((o={})[t]=r,o)))(i)}})}},zJ=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return function(n){return zV(function(r){for(var i=n.get(r),o={},a=0;a<t.length;a++){var u=t[a];o[u]=i[u]}return o},function(r){return function(i){for(var o=n.get(i),a=0;a<t.length;a++){var u=t[a];if(r[u]!==o[u])return n.set(Object.assign({},o,r))(i)}return i}})}},zQ=function(t){return function(n){return zV(function(r){return n.get(r)[t]},function(r){return function(i){var o=n.get(i);if(r===o[t])return i;var a=o.slice();return a[t]=r,n.set(a)(i)}})}},zX=function(t){return function(n){var r;return eL(n,zK(({at:r=function(t){return zV(function(n){return Cj(t,n)},fZ(function(){return CC(t)},function(n){return Ck(t,n)}))}}).at(t)))}},z0=function(t,n){return{getOption:t,reverseGet:n}},z1=function(t){return z5(t.getOption,function(n){return z3(n)(t)})},z2=function(t){return Bt(function(n){return function(r){return function(i){return eL(t.getOption(i),fZ(function(){return n.of(i)},function(o){return n.map(r(o),function(n){return z3(n)(t)(i)})}))}}})},z3=function(t){var n;return n=function(){return t},function(t){var r,i,o=(r=t,function(t){return eL(r.getOption(t),fd(function(i){var o=n(i);return o===i?t:r.reverseGet(o)}))});return function(t){return eL(o(t),fY(function(){return t}))}}},z4=function(t){return z0(l1(t),eO)},z5=function(t,n){return{getOption:t,set:n}},z9=function(t){return Bt(function(n){return function(r){return function(i){return eL(t.getOption(i),fZ(function(){return n.of(i)},function(o){return n.map(r(o),function(n){return t.set(n)(i)})}))}}})},z6=function(t){return function(n){return function(r){return eL(n.getOption(r),fd(function(i){var o=t(i);return o===i?r:n.set(o)(r)}))}}},z8=function(t){return function(n){var r=z6(t)(n);return function(t){return eL(r(t),fY(function(){return t}))}}},z7=function(t){return function(n){return z5(eE(n.getOption,fv(t.getOption)),function(r){return z8(t.set(r))(n)})}},Be=function(t,n,r){if(r[t]===n)return r;var i=zD([r[0]],r.slice(1),!0);return i[t]=n,i},Bt=function(t){return{modifyF:t}};function Bn(t){return function(n){return Bt(function(r){return function(i){return n.modifyF(r)(t.modifyF(r)(i))}})}}var Br={URI:"Identity",map:function(t,n){return n(t)},of:eO,ap:function(t,n){return t(n)}},Bi=function(t){return{index:t}},Bo=eE(zW,zK),Ba=function(t){return eE(z$,z7(t))},Bu=function(t){return eE(zq,Bn(t))},Bs=function(t){return function(n){return function(r){var i=n.get(r),o=t(i);return i===o?r:n.set(o)(r)}}},Bc=function(t){return zG(z0(f5,eO))(t)},Bl=function(t){var n;return eE(z$,function(n){return eL(n,z7(Bi(function(t){return z5(function(n){return o8(t,n)},function(n){return function(r){return eL(o8(t,r),fZ(function(){return r},function(){return u9(t,n,r)}))}})}).index(t)))})},Bf=function(t){var n;return eE(z$,function(n){return eL(n,z7(Bi(function(t){return z5(function(n){return o8(t,n)},function(n){return function(r){return eL(o8(t,r),fZ(function(){return r},function(){return Be(t,n,r)}))}})}).index(t)))})},Bd=function(t){var n;return eE(z$,function(n){return eL(n,z7(Bi(function(t){return z5(function(n){return Cj(t,n)},function(n){return function(r){return r[t]===n||fG(Cj(t,r))?r:Ck(t,n)(r)}})}).index(t)))})},Bp=zG(z0(eO,e$)),Bh=zG(z0(l3,eG)),Bm=zG(z0(function(t){return pI(t)?e$(t.left):eV},eH)),Bg=function(t,n){return function(r){return By(r,t,n)}},By=function(t,n,r){return zV(eE(t.get,n),eE(r,t.set))},Bv="monocle-ts/Lens",Bb={URI:Bv,compose:function(t,n){return zK(t)(n)}},Bx={URI:Bv,compose:Bb.compose,id:zZ};let B_=Object.freeze(Object.defineProperty({__proto__:null,Category:Bx,Invariant:{URI:Bv,imap:By},Semigroupoid:Bb,URI:Bv,asOptional:z$,asTraversal:zq,atKey:zX,component:zQ,compose:zK,composeIso:Bo,composeLens:zK,composeOptional:Ba,composePrism:zG,composeTraversal:Bu,filter:function(t){return zG(z4(t))},findFirst:function(t){var n;return Ba(z5(ac(t),function(n){return function(r){return eL(as(t)(r),fZ(function(){return r},function(t){return u9(t,n,r)}))}}))},findFirstNonEmpty:function(t){var n;return Ba(z5(ac(t),function(n){return function(r){return eL(as(t)(r),fZ(function(){return r},function(t){return Be(t,n,r)}))}}))},fromNullable:Bc,id:zZ,imap:Bg,index:Bl,indexNonEmpty:Bf,key:Bd,left:Bm,lens:zV,modify:Bs,modifyF:function(t){return function(n){return function(r){return function(i){return eL(r.get(i),n,function(n){return t.map(n,function(t){return r.set(t)(i)})})}}}},prop:zY,props:zJ,right:Bh,some:Bp,traverse:function(t){var n,r;return eE(zq,Bn(Bt(function(n){var r,i="Identity"===n.URI?t.map:t.traverse(n);return function(t){return function(n){return i(n,t)}}})))}},Symbol.toStringTag,{value:"Module"}));var BS=function(t){return function(n){return n.modifyF(Br)(t)}},BT=function(t){return new BM(t.get,t.reverseGet)},Bw=function(t){return new BR(t.get,t.set)},BO=function(t){return new BE(t.getOption,t.reverseGet)},Bk=function(t){return new BN(t.getOption,t.set)},BI=function(t){return new BA(t.modifyF)},BC=function(t,n,r){var i;return r===t[n]?t:Object.assign({},t,((i={})[n]=r,i))},BM=function(){function t(t,n){this.get=t,this.reverseGet=n,this._tag="Iso",this.unwrap=this.get,this.to=this.get,this.wrap=this.reverseGet,this.from=this.reverseGet}return t.prototype.reverse=function(){var t;return BT(zF(this.reverseGet,this.get))},t.prototype.modify=function(t){var n,r;return r=this,function(n){return r.reverseGet(t(r.get(n)))}},t.prototype.asLens=function(){return Bw(zW(this))},t.prototype.asPrism=function(){return BO(zU(this))},t.prototype.asOptional=function(){return Bk(zz(this))},t.prototype.asTraversal=function(){return BI(zB(this))},t.prototype.asFold=function(){var t=this;return new BL(function(){return function(n){return function(r){return n(t.get(r))}}})},t.prototype.asGetter=function(){var t=this;return new BP(function(n){return t.get(n)})},t.prototype.asSetter=function(){var t=this;return new BD(function(n){return t.modify(n)})},t.prototype.compose=function(t){var n,r;return BT((r=this,zF(eE(r.get,t.get),eE(t.reverseGet,r.reverseGet))))},t.prototype.composeIso=function(t){return this.compose(t)},t.prototype.composeLens=function(t){return Bw(eL(this,zW,zK(t)))},t.prototype.composePrism=function(t){return BO(eL(this,zU,zH(t)))},t.prototype.composeOptional=function(t){return Bk(eL(this,zz,z7(t)))},t.prototype.composeTraversal=function(t){return BI(eL(this,zB,Bn(t)))},t.prototype.composeFold=function(t){return this.asFold().compose(t)},t.prototype.composeGetter=function(t){return this.asGetter().compose(t)},t.prototype.composeSetter=function(t){return this.asSetter().compose(t)},t}(),BR=function(){function t(t,n){this.get=t,this.set=n,this._tag="Lens"}return t.fromPath=function(){var n=t.fromProp();return function(t){var r=n(t[0]);return t.slice(1).reduce(function(t,r){return t.compose(n(r))},r)}},t.fromProp=function(){return function(t){return Bw(eL(zZ(),zY(t)))}},t.fromProps=function(){return function(t){return Bw(eL(zZ(),zJ.apply(B_,t)))}},t.fromNullableProp=function(){return function(n,r){return new t(function(t){var i=f5(t[n]);return fG(i)?r:i.value},function(t){return function(r){return BC(r,n,t)}})}},t.prototype.modify=function(t){return Bs(t)(this)},t.prototype.asOptional=function(){return Bk(z$(this))},t.prototype.asTraversal=function(){return BI(zq(this))},t.prototype.asSetter=function(){var t=this;return new BD(function(n){return t.modify(n)})},t.prototype.asGetter=function(){var t=this;return new BP(function(n){return t.get(n)})},t.prototype.asFold=function(){var t=this;return new BL(function(){return function(n){return function(r){return n(t.get(r))}}})},t.prototype.compose=function(t){return Bw(zK(t)(this))},t.prototype.composeLens=function(t){return this.compose(t)},t.prototype.composeGetter=function(t){return this.asGetter().compose(t)},t.prototype.composeFold=function(t){return this.asFold().compose(t)},t.prototype.composeOptional=function(t){return Bk(eL(this,z$,z7(t)))},t.prototype.composeTraversal=function(t){return BI(eL(this,zq,Bn(t)))},t.prototype.composeSetter=function(t){return this.asSetter().compose(t)},t.prototype.composeIso=function(t){return Bw(eL(this,zK(eL(t,zW))))},t.prototype.composePrism=function(t){return Bk(zG(t)(this))},t}(),BE=function(){function t(t,n){this.getOption=t,this.reverseGet=n,this._tag="Prism"}return t.fromPredicate=function(t){return BO(z4(t))},t.some=function(){return Bj},t.prototype.modify=function(t){var n=this;return function(r){var i=n.modifyOption(t)(r);return fG(i)?r:i.value}},t.prototype.modifyOption=function(t){var n=this;return function(r){return dp.map(n.getOption(r),function(i){var o=t(i);return o===i?r:n.reverseGet(o)})}},t.prototype.set=function(t){return this.modify(function(){return t})},t.prototype.asOptional=function(){return Bk(z1(this))},t.prototype.asTraversal=function(){return BI(z2(this))},t.prototype.asSetter=function(){var t=this;return new BD(function(n){return t.modify(n)})},t.prototype.asFold=function(){var t=this;return new BL(function(n){return function(r){return function(i){var o=t.getOption(i);return fG(o)?n.empty:r(o.value)}}})},t.prototype.compose=function(t){return BO(zH(t)(this))},t.prototype.composePrism=function(t){return this.compose(t)},t.prototype.composeOptional=function(t){return Bk(eL(this,z1,z7(t)))},t.prototype.composeTraversal=function(t){return BI(eL(this,z2,Bn(t)))},t.prototype.composeFold=function(t){return this.asFold().compose(t)},t.prototype.composeSetter=function(t){return this.asSetter().compose(t)},t.prototype.composeIso=function(t){return BO(eL(this,zH(eL(t,zU))))},t.prototype.composeLens=function(t){var n;return Bk((n=t,function(t){return z7(z$(n))(z1(t))})(this))},t.prototype.composeGetter=function(t){return this.asFold().compose(t.asFold())},t}(),Bj=new BE(eO,e$),BN=function(){function t(t,n){this.getOption=t,this.set=n,this._tag="Optional"}return t.fromPath=function(){var n=t.fromNullableProp();return function(t){var r=n(t[0]);return t.slice(1).reduce(function(t,r){return t.compose(n(r))},r)}},t.fromNullableProp=function(){return function(n){return new t(function(t){return f5(t[n])},function(t){return function(r){return null==r[n]?r:BC(r,n,t)}})}},t.fromOptionProp=function(){var t=BR.fromProp();return function(n){return t(n).composePrism(Bj)}},t.prototype.modify=function(t){return z8(t)(this)},t.prototype.modifyOption=function(t){return z6(t)(this)},t.prototype.asTraversal=function(){return BI(z9(this))},t.prototype.asFold=function(){var t=this;return new BL(function(n){return function(r){return function(i){var o=t.getOption(i);return fG(o)?n.empty:r(o.value)}}})},t.prototype.asSetter=function(){var t=this;return new BD(function(n){return t.modify(n)})},t.prototype.compose=function(t){return Bk(z7(t)(this))},t.prototype.composeOptional=function(t){return this.compose(t)},t.prototype.composeTraversal=function(t){return BI(eL(this,z9,Bn(t)))},t.prototype.composeFold=function(t){return this.asFold().compose(t)},t.prototype.composeSetter=function(t){return this.asSetter().compose(t)},t.prototype.composeLens=function(t){return Bk(eL(this,z7(eL(t,z$))))},t.prototype.composePrism=function(t){return Bk(eL(this,z7(eL(t,z1))))},t.prototype.composeIso=function(t){return Bk(eL(this,z7(eL(t,zz))))},t.prototype.composeGetter=function(t){return this.asFold().compose(t.asFold())},t}(),BA=function(){function t(t){this.modifyF=t,this._tag="Traversal"}return t.prototype.modify=function(t){return BS(t)(this)},t.prototype.set=function(t){var n;return BS(function(){return t})(this)},t.prototype.filter=function(t){var n;return BI(Bn(z2(z4(t)))(this))},t.prototype.asFold=function(){var t=this;return new BL(function(n){return function(r){return t.modifyF(dC(n))(function(t){return eO(r(t))})}})},t.prototype.asSetter=function(){var t=this;return new BD(function(n){return t.modify(n)})},t.prototype.compose=function(t){return BI(Bn(t)(this))},t.prototype.composeTraversal=function(t){return this.compose(t)},t.prototype.composeFold=function(t){return this.asFold().compose(t)},t.prototype.composeSetter=function(t){return this.asSetter().compose(t)},t.prototype.composeOptional=function(t){return this.compose(t.asTraversal())},t.prototype.composeLens=function(t){return BI(eL(this,Bn(eL(t,zq))))},t.prototype.composePrism=function(t){return BI(eL(this,Bn(eL(t,z2))))},t.prototype.composeIso=function(t){return BI(eL(this,Bn(eL(t,zB))))},t.prototype.composeGetter=function(t){return this.asFold().compose(t.asFold())},t}(),BP=function(){function t(t){this.get=t,this._tag="Getter"}return t.prototype.asFold=function(){var t=this;return new BL(function(){return function(n){return function(r){return n(t.get(r))}}})},t.prototype.compose=function(n){var r=this;return new t(function(t){return n.get(r.get(t))})},t.prototype.composeGetter=function(t){return this.compose(t)},t.prototype.composeFold=function(t){return this.asFold().compose(t)},t.prototype.composeLens=function(t){return this.compose(t.asGetter())},t.prototype.composeIso=function(t){return this.compose(t.asGetter())},t.prototype.composeTraversal=function(t){return this.asFold().compose(t.asFold())},t.prototype.composeOptional=function(t){return this.asFold().compose(t.asFold())},t.prototype.composePrism=function(t){return this.asFold().compose(t.asFold())},t}(),BL=function(){function t(t){this.foldMap=t,this._tag="Fold",this.getAll=t(cK())(im),this.exist=t(_3),this.all=t(_2),this.foldMapFirst=t(dg())}return t.prototype.compose=function(n){var r=this;return new t(function(t){return function(i){return r.foldMap(t)(n.foldMap(t)(i))}})},t.prototype.composeFold=function(t){return this.compose(t)},t.prototype.composeGetter=function(t){return this.compose(t.asFold())},t.prototype.composeTraversal=function(t){return this.compose(t.asFold())},t.prototype.composeOptional=function(t){return this.compose(t.asFold())},t.prototype.composeLens=function(t){return this.compose(t.asFold())},t.prototype.composePrism=function(t){return this.compose(t.asFold())},t.prototype.composeIso=function(t){return this.compose(t.asFold())},t.prototype.find=function(t){return this.foldMapFirst(l1(t))},t.prototype.headOption=function(t){return this.find(function(){return!0})(t)},t}(),BD=function(){function t(t){this.modify=t,this._tag="Setter"}return t.prototype.set=function(t){return this.modify(ek(t))},t.prototype.compose=function(n){var r=this;return new t(function(t){return r.modify(n.modify(t))})},t.prototype.composeSetter=function(t){return this.compose(t)},t.prototype.composeTraversal=function(t){return this.compose(t.asSetter())},t.prototype.composeOptional=function(t){return this.compose(t.asSetter())},t.prototype.composeLens=function(t){return this.compose(t.asSetter())},t.prototype.composePrism=function(t){return this.compose(t.asSetter())},t.prototype.composeIso=function(t){return this.compose(t.asSetter())},t}(),BF=new BM(eO,eO),BW=U6({_tag:WG("None")}),BU=WG("Some");function Bz(t,n){return void 0===n&&(n="Option<"+t.name+">"),U1([BW,U6({_tag:BU,value:t},"Some<"+t.name+">")],n)}var BB=new Wr("DateFromISOString",function(t){return t instanceof Date},function(t,n){return eL(WL.validate(t,n),pf(function(r){var i=new Date(r);return isNaN(i.getTime())?Wn(t,n):eG(i)}))},function(t){return t.toISOString()});function BV(t){var n=Object.create(Object.getPrototypeOf(t));return Object.assign(n,t),n}var B$=new Wr("DateFromNumber",function(t){return t instanceof Date},function(t,n){return eL(WF.validate(t,n),pf(function(r){var i=new Date(r);return isNaN(i.getTime())?Wn(t,n):eG(i)}))},function(t){return t.getTime()});function Bq(t,n,r){void 0===r&&(r=t.name);var i=BV(t);return i.validate=n,i.decode=function(t){return n(t,zo(i))},i.name=r,i}var BK,BH,BG,BZ=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,BY=zd(WL,BH=function(t){return BZ.test(t)},"UUID"),BJ=new Wr("BooleanFromString",WB.is,function(t,n){return eL(WL.validate(t,n),pf(function(r){return"true"===r?eG(!0):"false"===r?eG(!1):Wn(t,n)}))},String);function BQ(t){switch(t._tag){case"InterfaceType":return t.props;case"ExactType":return BQ(t.type)}}var BX=BR.fromProp(),B0=zP("RegExp",function(t){return"[object RegExp]"===Object.prototype.toString.call(t)}),B1=new Wr("DateFromUnixTime",function(t){return t instanceof Date},function(t,n){return eL(U$.validate(t,n),pf(function(r){var i=new Date(1e3*r);return isNaN(i.getTime())?Wn(t,n):eG(i)}))},function(t){return Math.floor(t.getTime()/1e3)}),B2=new Wr("NumberFromString",WF.is,function(t,n){return eL(WL.validate(t,n),pf(function(r){var i=+r;return isNaN(i)||""===r.trim()?Wn(t,n):eG(i)}))},String),B3=new Wr("IntFromString",U$.is,function(t,n){return eL(B2.validate(t,n),pf(function(r){return U$.is(r)?eG(r):Wn(t,n)}))},B2.encode),B4=UK("JsonArray",function(){return U9(B9)}),B5=UK("JsonRecord",function(){return UX(WL,B9)}),B9=U1([WB,WF,WL,WC,B4,B5],"Json"),B6=new Wr("JsonFromString",B9.is,function(t,n){try{return eG(JSON.parse(t))}catch{return Wn(t,n)}},function(t){return JSON.stringify(t)}),B8=WG("Left"),B7=WG("Right"),Ve=new Wr("BigIntFromString",function(t){return"bigint"==typeof t},function(t,n){return eL(WL.validate(t,n),pf(function(r){if(!zj.is(r.trim()))return Wn(t,n);try{return eG(BigInt(r))}catch{return Wn(t,n)}}))},String),Vt=new Wr("BooleanFromNumber",WB.is,function(t,n){return eL(WF.validate(t,n),pr(function(t){return 0!==t}))},Number);let Vn=Object.freeze(Object.defineProperty({__proto__:null,BigIntFromString:Ve,BooleanFromNumber:Vt,BooleanFromString:BJ,DateFromISOString:BB,DateFromNumber:B$,DateFromUnixTime:B1,IntFromString:B3,Json:B9,JsonArray:B4,JsonFromString:B6,JsonRecord:B5,NonEmptyString:zj,NumberFromString:B2,UUID:BY,clone:BV,date:zL,either:function(t,n,r){return void 0===r&&(r="Either<"+t.name+", "+n.name+">"),U1([U6({_tag:B8,left:t},"Left<"+t.name+">"),U6({_tag:B7,right:n},"Right<"+t.name+">")],r)},fromNewtype:function(t,n){return void 0===n&&(n="fromNewtype("+t.name+")"),new Wr(n,function(n){return t.is(n)},function(n,r){return eL(t.validate(n,r),pr(BF.wrap))},function(n){return t.encode(BF.unwrap(n))})},fromNullable:function(t,n,r){return void 0===r&&(r="fromNullable("+t.name+")"),Bq(t,function(r,i){return null==r?eG(n):t.validate(r,i)},r)},fromRefinement:zP,getLenses:function(t){var n={};for(var r in BQ(t))n[r]=BX(r);return n},mapOutput:zI,nonEmptyArray:zN,option:Bz,optionFromNullable:function(t,n){return void 0===n&&(n="Option<"+t.name+">"),new Wr(n,Bz(t).is,function(n,r){return null==n?eG(eV):eL(t.validate(n,r),pr(e$))},function(n){return de(eL(n,fd(t.encode)))})},readonlyNonEmptyArray:function(t,n){return void 0===n&&(n="ReadonlyNonEmptyArray<"+t.name+">"),zN(t,n)},readonlySetFromArray:function(t,n,r){return void 0===r&&(r="ReadonlySet<"+t.name+">"),zA(t,n,r)},regexp:B0,setFromArray:zA,withEncode:function(t,n,r){return void 0===r&&(r=t.name),new Wr(r,t.is,t.validate,n)},withFallback:function(t,n,r){return void 0===r&&(r="withFallback("+t.name+")"),Bq(t,function(r,i){return pz(function(){return eG(n)})(t.validate(r,i))},r)},withMessage:function(t,n){return Bq(t,function(r,i){return px(function(){return[{value:r,context:i,message:n(r,i),actual:r}]})(t.validate(r,i))})},withValidate:Bq},Symbol.toStringTag,{value:"Module"})),Vr=C(Vn),Vi=C(zC);Object.defineProperty(zO,"__esModule",{value:!0}),zO.withCustomError=zO.addType=zO.isEmpty=zO.objectToMap=zO.grouped=zO.formatDate=zO.formatDateTime=zO.filterDouble=zO.refineType=zO.nullable=void 0;let Vo=eh,Va=(0,Vo.__importStar)(zy);zO.nullable=function(t){return Va.union([t,Va.null,Va.undefined])},zO.refineType=function(t,n,r){return new Va.Type(n,t.is,(n,i)=>(0,zk.pipe)(t.validate(n,i),Fu.either.chain(t=>r(t)?Va.success(t):Va.failure(n,i))),t.encode)},zO.filterDouble=function(t){if(""===t)return null;let n=Number(t);return Number.isNaN(n)?null:n},zO.formatDateTime=function(t){return t.toISOString().replace(/\.\d{3}Z$/,"+0000")},zO.formatDate=function(t){return t.toISOString().replace(/T.*/,"")},zO.grouped=function(t,n){return t.reduce((t,r,i)=>(i%n==0?t.push([r]):t[Math.floor(i/n)].push(r),t),[])},zO.objectToMap=function(t){return new Map(Object.entries(t))},zO.isEmpty=function(t){for(let n in t)return!1;return!0},zO.addType=function(t,n){return(0,Vi.mapOutput)(t,t=>({...t,__TYPE__:n}))},zO.withCustomError=function(t,n){return(0,Vr.withValidate)(t,(r,i)=>Fu.either.mapLeft(t=>t.find(t=>t.message)?t:[{value:r,context:i,message:n(r,i),actual:r}])(t.validate(r,i)))},Object.defineProperty(zw,"__esModule",{value:!0}),zw.WidgetKey=void 0;let Vu=eh,Vs=(0,Vu.__importStar)(zy),Vc=RegExp("^[^<>]+$");zw.WidgetKey=(0,zO.refineType)(Vs.string,"WidgetKey",t=>0===t.length||Vc.test(t)),function(t){Object.defineProperty(t,"__esModule",{value:!0});let n=eh;(0,n.__exportStar)(zx,t),(0,n.__exportStar)(zS,t),(0,n.__exportStar)(zw,t)}(zb);var Vl={},Vf={},Vd={},Vp={},Vh={};Object.defineProperty(Vh,"__esModule",{value:!0}),Vh.clone=void 0,Vh.clone=function(t){var n=Object.create(Object.getPrototypeOf(t));return Object.assign(n,t),n};var Vm=I&&I.__createBinding||(Object.create?function(t,n,r,i){void 0===i&&(i=r),Object.defineProperty(t,i,{enumerable:!0,get:function(){return n[r]}})}:function(t,n,r,i){void 0===i&&(i=r),t[i]=n[r]}),Vg=I&&I.__setModuleDefault||(Object.create?function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}:function(t,n){t.default=n}),Vy=I&&I.__importStar||function(t){if(t&&t.__esModule)return t;var n={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&Vm(n,t,r);return Vg(n,t),n};Object.defineProperty(Vp,"__esModule",{value:!0}),Vp.withValidate=void 0;var Vv=Vy(zy);Vp.withValidate=function(t,n,r){void 0===r&&(r=t.name);var i=Vh.clone(t);return i.validate=n,i.decode=function(t){return n(t,Vv.getDefaultContext(i))},i.name=r,i};var Vb=I&&I.__createBinding||(Object.create?function(t,n,r,i){void 0===i&&(i=r),Object.defineProperty(t,i,{enumerable:!0,get:function(){return n[r]}})}:function(t,n,r,i){void 0===i&&(i=r),t[i]=n[r]}),Vx=I&&I.__setModuleDefault||(Object.create?function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}:function(t,n){t.default=n}),V_=I&&I.__importStar||function(t){if(t&&t.__esModule)return t;var n={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&Vb(n,t,r);return Vx(n,t),n};Object.defineProperty(Vd,"__esModule",{value:!0}),Vd.withFallback=void 0;var VS=V_(zy);Vd.withFallback=function(t,n,r){return void 0===r&&(r="withFallback("+t.name+")"),Vp.withValidate(t,function(r,i){return Fs.orElse(function(){return VS.success(n)})(t.validate(r,i))},r)};var VT={},Vw={};Object.defineProperty(Vw,"__esModule",{value:!0}),Vw.EmptyArray=Vw.EmptyObject=Vw.Boolean=Vw.NumberOrNull=Vw.Number=Vw.StringOrNull=Vw.String=void 0;let VO=eh,Vk=(0,VO.__importStar)(zy);Vw.String=(0,zO.withCustomError)(Vk.string,()=>"The value must be a string"),Vw.StringOrNull=(0,zO.withCustomError)(Vk.union([Vk.string,Vk.null]),()=>"The value must be a string or null"),Vw.Number=(0,zO.withCustomError)(Vk.number,()=>"The value must be a number"),Vw.NumberOrNull=(0,zO.withCustomError)(Vk.union([Vk.number,Vk.null]),()=>"The value must be a number or null"),Vw.Boolean=(0,zO.withCustomError)(Vk.boolean,()=>"The value must be a boolean"),Vw.EmptyObject=Vk.UnknownRecord.pipe(new Vk.Type("emptyObject",t=>Vk.UnknownRecord.is(t),(t,n)=>Object.keys(t).length>0?Vk.failure(t,n,"The object is not empty."):Vk.success({}),Vk.identity)),Vw.EmptyArray=new Vk.Type("emptyArray",t=>Vk.UnknownArray.is(t)&&0===t.length,(t,n)=>(0,Ff.pipe)(Vk.UnknownArray.decode(t),Fu.either.chain(r=>r.length>0?Vk.failure(t,n,"The array is not empty."):Vk.success([]))),()=>[]);var VI={};let VC=C(p7);var VM={};Object.defineProperty(VM,"__esModule",{value:!0});let VR=eh,VE=(0,VR.__importStar)(zy);VM.default=new VE.Type("dateFromStringOrNumber",t=>t instanceof Date,(t,n)=>(0,zk.pipe)(VE.union([VE.number,VE.string]).validate(t,n),(0,VC.chain)(r=>{let i=new Date(r);return isNaN(i.getTime())?VE.failure(t,n):VE.success(i)})),t=>t);var Vj={};Object.defineProperty(Vj,"__esModule",{value:!0});let VN=eh,VA=(0,VN.__importStar)(zy);Vj.default=new VA.Type("dateFromTsMs",t=>t instanceof Date,(t,n)=>(0,zk.pipe)(VA.number.validate(t,n),(0,VC.chain)(r=>{let i=new Date(r);return isNaN(i.getTime())?VA.failure(t,n):VA.success(i)})),t=>t.getTime());var VP={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.EmptyArrayOrElse=t.EmptyObjectOrElse=t.NullOrElse=t.DefaultOrElse=void 0;let n=eh,r=(0,n.__importStar)(zy),i=t=>n=>new r.Type(`DefaultOrElse<${t.name}, ${n.name}>`,t=>null===t||n.is(t),(i,o)=>(0,Fs.isRight)(t.validate(i,o))?r.success(null):n.validate(i,o),t=>t?n.encode(t):void 0);t.DefaultOrElse=i;let o=n=>(0,t.DefaultOrElse)(r.null)(n);t.NullOrElse=o;let a=n=>(0,t.DefaultOrElse)(Vw.EmptyObject)(n);t.EmptyObjectOrElse=a;let u=n=>(0,t.DefaultOrElse)(Vw.EmptyArray)(n);t.EmptyArrayOrElse=u}(VP);var VL={};Object.defineProperty(VL,"__esModule",{value:!0});let VD=eh,VF=(0,VD.__importStar)(zy);VL.default=new VF.Type("IntFromNumber",VF.Int.is,(t,n)=>(0,zk.pipe)(VF.number.validate(t,n),(0,VC.chain)(t=>VF.Int.is(t)?VF.success(t):VF.success(Math.round(t)))),VF.Int.encode);var VW={};Object.defineProperty(VW,"__esModule",{value:!0});let VU=eh,Vz=(0,VU.__importStar)(zy),VB=/^([0-9]+)px$/;VW.default=new Vz.Type("IntFromPixels",Vz.Int.is,(t,n)=>(0,zk.pipe)(Vz.string.validate(t,n),(0,VC.chain)(r=>{try{let i=r.match(VB);if(!i)return Vz.failure(t,n);let o=parseInt(i[1]);return Vz.success(o)}catch{return Vz.failure(t,n)}})),String);var VV={};Object.defineProperty(VV,"__esModule",{value:!0});let V$=eh,Vq=(0,V$.__importStar)(zy);VV.default=(0,zO.withCustomError)((0,zO.refineType)(Vq.string,"nonEmptyString",t=>t.trim().length>0),()=>"The value must be a non-empty string");var VK={},VH={};Object.defineProperty(VH,"__esModule",{value:!0});let VG=eh,VZ=(0,VG.__importStar)(zy);VH.default=(0,zO.nullable)(VZ.string),Object.defineProperty(VK,"__esModule",{value:!0});let VY=eh,VJ=(0,VY.__importDefault)(VH);VK.default=new zy.Type("nonEmptyStringOrNull",t=>"string"==typeof t||null===t,(t,n)=>(0,zk.pipe)(VJ.default.validate(t,n),(0,VC.chain)(t=>"string"==typeof t&&t.length>0?(0,zy.success)(t):(0,zy.success)(null))),t=>t);var VQ={};Object.defineProperty(VQ,"__esModule",{value:!0});let VX=eh,V0=(0,VX.__importStar)(zy);VQ.default=(0,zO.nullable)(V0.number);var V1={};Object.defineProperty(V1,"__esModule",{value:!0});let V2=eh,V3=(0,V2.__importStar)(zy);V1.default=(t,n,r)=>Vw.Number.pipe(new V3.Type("numberInRange",t=>Vw.Number.is(t),(i,o)=>i>n||i<t?V3.failure(i,o,`${r} must be a number between ${t} and ${n}`):V3.success(i),V3.identity));var V4={};Object.defineProperty(V4,"__esModule",{value:!0});let V5=eh,V9=(0,V5.__importStar)(zy);V4.default=new V9.Type("StringFromInt",V9.string.is,(t,n)=>(0,zk.pipe)(V9.boolean.validate(t,n),(0,VC.chain)(t=>V9.success(t.toString()))),t=>t);var V6={};Object.defineProperty(V6,"__esModule",{value:!0});let V8=eh,V7=(0,V8.__importStar)(zy);function $e(){return qx||(qx=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.StringOrNull=t.StringFromNumber=t.StringFromBoolean=t.NumberRange=t.NumberOrNull=t.NonEmptyStringOrNull=t.NonEmptyString=t.IntFromPixels=t.IntFromNumber=t.Function=t.DateFromTsMs=t.DateFromStringOrNumber=t.DateFromString=void 0;let n=eh;(0,n.__exportStar)(Vw,t);var r=function(){if(qb)return VI;qb=1,Object.defineProperty(VI,"__esModule",{value:!0});let t=eh,n=(0,t.__importStar)(zy),r=$e();return VI.default=new n.Type("dateFromString",t=>t instanceof Date,(t,i)=>(0,zk.pipe)(r.String.validate(t,i),(0,VC.chain)(r=>{let o=new Date(r);return isNaN(o.getTime())?n.failure(t,i):n.success(o)})),t=>t.toISOString()),VI}();Object.defineProperty(t,"DateFromString",{enumerable:!0,get:function(){return(0,n.__importDefault)(r).default}}),Object.defineProperty(t,"DateFromStringOrNumber",{enumerable:!0,get:function(){return(0,n.__importDefault)(VM).default}}),Object.defineProperty(t,"DateFromTsMs",{enumerable:!0,get:function(){return(0,n.__importDefault)(Vj).default}}),(0,n.__exportStar)(VP,t),t.Function=(0,n.__importStar)(zO),Object.defineProperty(t,"IntFromNumber",{enumerable:!0,get:function(){return(0,n.__importDefault)(VL).default}}),Object.defineProperty(t,"IntFromPixels",{enumerable:!0,get:function(){return(0,n.__importDefault)(VW).default}}),Object.defineProperty(t,"NonEmptyString",{enumerable:!0,get:function(){return(0,n.__importDefault)(VV).default}}),Object.defineProperty(t,"NonEmptyStringOrNull",{enumerable:!0,get:function(){return(0,n.__importDefault)(VK).default}}),Object.defineProperty(t,"NumberOrNull",{enumerable:!0,get:function(){return(0,n.__importDefault)(VQ).default}}),Object.defineProperty(t,"NumberRange",{enumerable:!0,get:function(){return(0,n.__importDefault)(V1).default}}),Object.defineProperty(t,"StringFromBoolean",{enumerable:!0,get:function(){return(0,n.__importDefault)(V4).default}}),Object.defineProperty(t,"StringFromNumber",{enumerable:!0,get:function(){return(0,n.__importDefault)(V6).default}}),Object.defineProperty(t,"StringOrNull",{enumerable:!0,get:function(){return(0,n.__importDefault)(VH).default}})}(VT)),VT}V6.default=new V7.Type("StringFromInt",V7.string.is,(t,n)=>(0,zk.pipe)(V7.number.validate(t,n),(0,VC.chain)(t=>V7.success(t.toString()))),t=>t);var $t={},$n={},$r={},$i={},$o={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.BooleanField=t.BooleanConfig=t.BooleanFieldType=void 0;let n=(0,eh.__importStar)(zy),r=$e();t.BooleanFieldType="Boolean",t.BooleanConfig=n.exact(n.partial({label:r.StringOrNull,default_value:n.boolean,placeholder_true:n.string,placeholder_false:n.string})),t.BooleanField=n.exact(n.intersection([n.type({type:n.literal(t.BooleanFieldType)}),n.partial({config:t.BooleanConfig})]))}($o);var $a={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Color=t.ColorConfig=t.ColorFieldType=void 0;let n=(0,eh.__importStar)(zy),r=$e();t.ColorFieldType="Color",t.ColorConfig=n.exact(n.partial({label:r.StringOrNull,placeholder:n.string})),t.Color=n.exact(n.intersection([n.type({type:n.literal(t.ColorFieldType)}),n.partial({fieldset:r.StringOrNull,config:t.ColorConfig})]))}($a);var $u={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Date=t.DateConfig=t.DateFieldType=void 0;let n=(0,eh.__importStar)(zy),r=$e();t.DateFieldType="Date",t.DateConfig=n.exact(n.partial({label:r.StringOrNull,placeholder:n.string,default:n.string})),t.Date=n.exact(n.intersection([n.type({type:n.literal(t.DateFieldType)}),n.partial({fieldset:r.StringOrNull,config:t.DateConfig})]))}($u);var $s={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Embed=t.EmbedConfig=t.EmbedFieldType=void 0;let n=(0,eh.__importStar)(zy),r=$e();t.EmbedFieldType="Embed",t.EmbedConfig=n.exact(n.partial({label:r.StringOrNull,placeholder:n.string,useAsTitle:n.boolean})),t.Embed=n.exact(n.intersection([n.type({type:n.literal(t.EmbedFieldType)}),n.partial({fieldset:r.StringOrNull,config:t.EmbedConfig})]))}($s);var $c={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.GeoPoint=t.GeoPointConfig=t.GeoPointFieldType=void 0;let n=(0,eh.__importStar)(zy),r=$e();t.GeoPointFieldType="GeoPoint",t.GeoPointConfig=n.exact(n.partial({label:r.StringOrNull})),t.GeoPoint=n.exact(n.intersection([n.type({type:n.literal(t.GeoPointFieldType)}),n.partial({fieldset:r.StringOrNull,config:t.GeoPointConfig})]))}($c);var $l={},$f={},$d={},$p={},$h={};Object.defineProperty($h,"__esModule",{value:!0}),$h.pipe=$h.pipeable=void 0,$h.pipeable=function(t){var n,r,i,o,a,u,s,c,l,f,d,p,h,m,g,y={};if("function"==typeof t.map){var v=function(n){return function(r){return t.map(r,n)}};y.map=v}if("function"==typeof t.contramap){var b=function(n){return function(r){return t.contramap(r,n)}};y.contramap=b}if("function"==typeof t.mapWithIndex){var x=function(n){return function(r){return t.mapWithIndex(r,n)}};y.mapWithIndex=x}if("function"==typeof t.ap){var _=function(n){return function(r){return t.ap(r,n)}},S=function(n){return function(r){return t.ap(t.map(r,function(t){return function(){return t}}),n)}};y.ap=_,y.apFirst=S,y.apSecond=function(n){return function(r){return t.ap(t.map(r,function(){return function(t){return t}}),n)}}}if("function"==typeof t.chain){var T=function(n){return function(r){return t.chain(r,n)}},w=function(n){return function(r){return t.chain(r,function(r){return t.map(n(r),function(){return r})})}},O=function(n){return t.chain(n,Ff.identity)};y.chain=T,y.chainFirst=w,y.flatten=O}if("function"==typeof t.bimap){var k=function(n,r){return function(i){return t.bimap(i,n,r)}},I=function(n){return function(r){return t.mapLeft(r,n)}};y.bimap=k,y.mapLeft=I}if("function"==typeof t.extend){var C=function(n){return function(r){return t.extend(r,n)}},M=function(n){return t.extend(n,Ff.identity)};y.extend=C,y.duplicate=M}if("function"==typeof t.reduce){var R=function(n,r){return function(i){return t.reduce(i,n,r)}},E=function(n){var r=t.foldMap(n);return function(t){return function(n){return r(n,t)}}},j=function(n,r){return function(i){return t.reduceRight(i,n,r)}};y.reduce=R,y.foldMap=E,y.reduceRight=j}if("function"==typeof t.reduceWithIndex){var N=function(n,r){return function(i){return t.reduceWithIndex(i,n,r)}},A=function(n){var r=t.foldMapWithIndex(n);return function(t){return function(n){return r(n,t)}}},P=function(n,r){return function(i){return t.reduceRightWithIndex(i,n,r)}};y.reduceWithIndex=N,y.foldMapWithIndex=A,y.reduceRightWithIndex=P}if("function"==typeof t.alt){var L=function(n){return function(r){return t.alt(r,n)}};y.alt=L}if("function"==typeof t.compact&&(y.compact=t.compact,y.separate=t.separate),"function"==typeof t.filter){var D=function(n){return function(r){return t.filter(r,n)}},F=function(n){return function(r){return t.filterMap(r,n)}},W=function(n){return function(r){return t.partition(r,n)}},U=function(n){return function(r){return t.partitionMap(r,n)}};y.filter=D,y.filterMap=F,y.partition=W,y.partitionMap=U}if("function"==typeof t.filterWithIndex){var z=function(n){return function(r){return t.filterWithIndex(r,n)}},B=function(n){return function(r){return t.filterMapWithIndex(r,n)}},V=function(n){return function(r){return t.partitionWithIndex(r,n)}},$=function(n){return function(r){return t.partitionMapWithIndex(r,n)}};y.filterWithIndex=z,y.filterMapWithIndex=B,y.partitionWithIndex=V,y.partitionMapWithIndex=$}if("function"==typeof t.promap){var q=function(n,r){return function(i){return t.promap(i,n,r)}};y.promap=q}if("function"==typeof t.compose){var K=function(n){return function(r){return t.compose(r,n)}};y.compose=K}if("function"==typeof t.throwError){var H=function(n){return function(r){return"None"===r._tag?t.throwError(n()):t.of(r.value)}},G=function(n){return"Left"===n._tag?t.throwError(n.left):t.of(n.right)},Z=function(n,r){return function(i){return n(i)?t.of(i):t.throwError(r(i))}},Y=function(n,r){return function(i){return t.chain(i,function(i){return n(i)?t.of(i):t.throwError(r(i))})}};y.fromOption=H,y.fromEither=G,y.fromPredicate=Z,y.filterOrElse=Y}return y},$h.pipe=Ff.pipe;var $m=I&&I.__createBinding||(Object.create?function(t,n,r,i){void 0===i&&(i=r),Object.defineProperty(t,i,{enumerable:!0,get:function(){return n[r]}})}:function(t,n,r,i){void 0===i&&(i=r),t[i]=n[r]}),$g=I&&I.__setModuleDefault||(Object.create?function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}:function(t,n){t.default=n}),$y=I&&I.__importStar||function(t){if(t&&t.__esModule)return t;var n={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&$m(n,t,r);return $g(n,t),n};Object.defineProperty($p,"__esModule",{value:!0}),$p.NumberFromString=void 0;var $v=$y(zy);$p.NumberFromString=new $v.Type("NumberFromString",$v.number.is,function(t,n){return $h.pipe($v.string.validate(t,n),Fs.chain(function(r){var i=+r;return isNaN(i)||""===r.trim()?$v.failure(t,n):$v.success(i)}))},String);var $b=I&&I.__createBinding||(Object.create?function(t,n,r,i){void 0===i&&(i=r),Object.defineProperty(t,i,{enumerable:!0,get:function(){return n[r]}})}:function(t,n,r,i){void 0===i&&(i=r),t[i]=n[r]}),$x=I&&I.__setModuleDefault||(Object.create?function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}:function(t,n){t.default=n}),$_=I&&I.__importStar||function(t){if(t&&t.__esModule)return t;var n={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&$b(n,t,r);return $x(n,t),n};Object.defineProperty($d,"__esModule",{value:!0}),$d.IntFromString=void 0;var $S=$_(zy);$d.IntFromString=new $S.Type("IntFromString",$S.Int.is,function(t,n){return $h.pipe($p.NumberFromString.validate(t,n),Fs.chain(function(r){return $S.Int.is(r)?$S.success(r):$S.failure(t,n)}))},$p.NumberFromString.encode),Object.defineProperty($f,"__esModule",{value:!0});let $T=eh,$w=(0,$T.__importStar)(zy),$O=$e(),$k=new $w.Type("SideConstraints",t=>!t||"number"==typeof t,(t,n)=>Fs.either.chain($w.union([$w.literal("auto"),$w.literal(""),$w.Int,$d.IntFromString,$O.IntFromNumber,$O.IntFromPixels,$w.null]).validate(t,n),t=>"auto"===t||""===t?$w.success(null):$w.success(t)),t=>t),$I=$w.partial({width:$k,height:$k});$f.default=$I,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Image=t.ImageConfig=t.Thumbnail=t.ImageFieldType=void 0;let n=eh,r=(0,n.__importStar)(zy),i=$e(),o=(0,n.__importDefault)($f);t.ImageFieldType="Image",t.Thumbnail=r.exact(r.intersection([r.type({name:r.string}),o.default])),t.ImageConfig=r.exact(r.partial({label:i.StringOrNull,placeholder:r.string,constraint:o.default,thumbnails:r.readonlyArray(t.Thumbnail)})),t.Image=r.exact(r.intersection([r.type({type:r.literal(t.ImageFieldType)}),r.partial({fieldset:i.StringOrNull,config:t.ImageConfig})]))}($l);var $C={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.IntegrationField=t.IntegrationFieldConfig=t.IntegrationFieldType=void 0;let n=(0,eh.__importStar)(zy),r=$e();t.IntegrationFieldType="IntegrationFields",t.IntegrationFieldConfig=n.exact(n.partial({label:r.StringOrNull,placeholder:n.string,catalog:n.string})),t.IntegrationField=n.exact(n.intersection([n.type({type:n.literal(t.IntegrationFieldType)}),n.partial({fieldset:r.StringOrNull,config:t.IntegrationFieldConfig})]))}($C);var $M={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Link=t.LinkConfig=t.LinkFieldType=void 0;let n=eh,r=(0,n.__importStar)(zy),i=$e(),o=t=>{if(t instanceof Array&&t.reduce((t,n)=>t&&"string"==typeof n,!0))return r.success(t)},a=t=>{if("string"==typeof t)return r.success([t])},u=new r.Type("MasksArrayString",t=>t instanceof Array,(t,n)=>Fs.either.chain(r.union([r.array(r.string),r.string]).validate(t,n),i=>o(i)||a(i)||r.failure(t,n)),t=>t);t.LinkFieldType="Link",t.LinkConfig=r.exact(r.partial({label:i.StringOrNull,useAsTitle:r.boolean,placeholder:r.string,select:(0,Vd.withFallback)(r.union([r.literal("media"),r.literal("document"),r.literal("web"),r.null]),null),customtypes:r.readonlyArray(r.string),masks:u,tags:u,allowTargetBlank:r.boolean})),t.Link=r.exact(r.intersection([r.type({type:r.literal(t.LinkFieldType)}),r.partial({fieldset:i.StringOrNull,config:t.LinkConfig})]))}($M);var $R={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Number=t.NumberConfig=t.NumberFieldType=void 0;let n=(0,eh.__importStar)(zy),r=$e();t.NumberFieldType="Number",t.NumberConfig=n.exact(n.partial({label:r.StringOrNull,placeholder:n.string,min:n.union([n.number,$p.NumberFromString]),max:n.union([n.number,$p.NumberFromString]),step:n.union([n.number,$p.NumberFromString])})),t.Number=n.exact(n.intersection([n.type({type:n.literal(t.NumberFieldType)}),n.partial({fieldset:r.StringOrNull,config:t.NumberConfig})]))}($R);var $E={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Range=t.RangeConfig=t.RangeFieldType=void 0;let n=(0,eh.__importStar)(zy),r=$e();t.RangeFieldType="Range",t.RangeConfig=n.exact(n.partial({label:r.StringOrNull,placeholder:n.string,min:n.union([n.number,$p.NumberFromString]),max:n.union([n.number,$p.NumberFromString]),step:n.union([n.number,$p.NumberFromString])})),t.Range=n.exact(n.intersection([n.type({type:n.literal(t.RangeFieldType)}),n.partial({fieldset:r.StringOrNull,config:t.RangeConfig})]))}($E);var $j={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.RichText=t.RichTextConfig=t.RichTextNodeTypeCodec=t.RichTextNodeType=t.DEFAULT_OPTION=t.RichTextFieldType=void 0;let n=eh,r=(0,n.__importStar)(zy),i=$e(),o=(0,n.__importDefault)($f);t.RichTextFieldType="StructuredText",t.DEFAULT_OPTION="paragraph",t.RichTextNodeType={heading1:"heading1",heading2:"heading2",heading3:"heading3",heading4:"heading4",heading5:"heading5",heading6:"heading6",paragraph:"paragraph",strong:"strong",em:"em",preformatted:"preformatted",hyperlink:"hyperlink",image:"image",embed:"embed",list:"list-item",orderedList:"o-list-item",rtl:"rtl"},t.RichTextNodeTypeCodec=r.keyof({[t.RichTextNodeType.heading1]:null,[t.RichTextNodeType.heading2]:null,[t.RichTextNodeType.heading3]:null,[t.RichTextNodeType.heading4]:null,[t.RichTextNodeType.heading5]:null,[t.RichTextNodeType.heading6]:null,[t.RichTextNodeType.paragraph]:null,[t.RichTextNodeType.strong]:null,[t.RichTextNodeType.em]:null,[t.RichTextNodeType.preformatted]:null,[t.RichTextNodeType.hyperlink]:null,[t.RichTextNodeType.image]:null,[t.RichTextNodeType.embed]:null,[t.RichTextNodeType.list]:null,[t.RichTextNodeType.orderedList]:null,[t.RichTextNodeType.rtl]:null});let a=new r.Type("RichTextOptions",t=>"string"==typeof t,n=>(0,Ff.pipe)(r.union([r.string,r.null]).decode(n),Fu.either.map(n=>{if(!n)return t.DEFAULT_OPTION;let r=n.split(",").map(t=>t.trim()).filter(n=>(0,Fs.getOrElseW)(()=>{})(t.RichTextNodeTypeCodec.decode(n)));return r.length?r.join(","):t.DEFAULT_OPTION})),t=>t),u=t=>{if(!t)return r.success([])},s=t=>{if(t instanceof Object){if(!Object.entries(t).length)return r.success([]);if(t[""])return r.success(t[""].map(t=>t.name));let n=Object.entries(t).reduce((t,[,n])=>t.concat(n.map(t=>t.name)),[]).filter(Boolean);return r.success(n)}},c=t=>{if(t instanceof Array&&t.reduce((t,n)=>t&&"string"==typeof n,!0))return r.success(t)},l=t=>{if("string"==typeof t)return r.success([t])},f=new r.Type("RichTextLabels",t=>t instanceof Array,(t,n)=>{let i=r.record(r.string,r.readonlyArray(r.record(r.literal("name"),r.string))),o=r.readonlyArray(r.string);return(0,Ff.pipe)(r.union([i,o,r.string,r.null]).decode(t),Fu.either.chain(i=>u(i)||c(i)||s(i)||l(i)||r.failure(t,n)))},t=>t);t.RichTextConfig=r.exact(r.partial({label:i.StringOrNull,placeholder:r.string,useAsTitle:r.boolean,single:a,multi:a,imageConstraint:o.default,labels:f,allowTargetBlank:r.boolean})),t.RichText=r.exact(r.intersection([r.type({type:r.literal(t.RichTextFieldType)}),r.partial({fieldset:i.StringOrNull,config:t.RichTextConfig})]))}($j);var $N={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Select=t.SelectConfig=t.SelectFieldType=void 0;let n=(0,eh.__importStar)(zy),r=$e();t.SelectFieldType="Select",t.SelectConfig=n.exact(n.partial({label:r.StringOrNull,placeholder:n.string,default_value:n.string,options:n.readonlyArray(n.union([n.string,r.StringFromNumber,r.StringFromBoolean]))})),t.Select=n.exact(n.intersection([n.type({type:n.literal(t.SelectFieldType)}),n.partial({fieldset:r.StringOrNull,config:t.SelectConfig})]))}($N);var $A={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Separator=t.SeparatorConfig=t.SeparatorFieldType=void 0;let n=(0,eh.__importStar)(zy),r=$e();t.SeparatorFieldType="Separator",t.SeparatorConfig=n.exact(n.partial({label:r.StringOrNull})),t.Separator=n.exact(n.intersection([n.type({type:n.literal(t.SeparatorFieldType)}),n.partial({config:t.SeparatorConfig})]))}($A);var $P={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Text=t.TextConfig=t.TextFieldType=void 0;let n=(0,eh.__importStar)(zy),r=$e();t.TextFieldType="Text",t.TextConfig=n.exact(n.partial({label:r.StringOrNull,useAsTitle:n.boolean,placeholder:n.string})),t.Text=n.exact(n.intersection([n.type({type:n.literal(t.TextFieldType)}),n.partial({fieldset:r.StringOrNull,config:t.TextConfig})]))}($P);var $L={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Timestamp=t.TimestampConfig=t.TimestampFieldType=void 0;let n=(0,eh.__importStar)(zy),r=$e();t.TimestampFieldType="Timestamp",t.TimestampConfig=n.exact(n.partial({label:r.StringOrNull,placeholder:n.string,default:n.string})),t.Timestamp=n.exact(n.intersection([n.type({type:n.literal(t.TimestampFieldType)}),n.partial({fieldset:r.StringOrNull,config:t.TimestampConfig})]))}($L),Object.defineProperty($i,"__esModule",{value:!0}),$i.NestableWidget=void 0;let $D=eh,$F=(0,$D.__importStar)(zy);$i.NestableWidget=$F.union([$a.Color,$o.BooleanField,$s.Embed,$c.GeoPoint,$u.Date,$R.Number,$E.Range,$j.RichText,$N.Select,$A.Separator,$P.Text,$L.Timestamp,$M.Link,$l.Image,$C.IntegrationField]),function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Group=t.GroupConfig=t.GroupFieldType=void 0;let n=(0,eh.__importStar)(zy),r=$e();t.GroupFieldType="Group",t.GroupConfig=n.exact(n.partial({label:r.StringOrNull,repeat:n.boolean,fields:n.record(zb.WidgetKey,$i.NestableWidget)})),t.Group=n.exact(n.intersection([n.type({type:n.literal(t.GroupFieldType)}),n.partial({fieldset:r.StringOrNull,icon:n.string,description:n.string,config:t.GroupConfig})]))}($r);var $W={};!function(t){Object.defineProperty(t,"__esModule",{value:!0});let n=eh;(0,n.__exportStar)($o,t),(0,n.__exportStar)($a,t),(0,n.__exportStar)($u,t),(0,n.__exportStar)($s,t),(0,n.__exportStar)($c,t),(0,n.__exportStar)($l,t),(0,n.__exportStar)($C,t),(0,n.__exportStar)($M,t),(0,n.__exportStar)($i,t),(0,n.__exportStar)($R,t),(0,n.__exportStar)($E,t),(0,n.__exportStar)($j,t),(0,n.__exportStar)($N,t),(0,n.__exportStar)($A,t),(0,n.__exportStar)($P,t),(0,n.__exportStar)($L,t)}($W);var $U={},$z={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.isCompositeSlice=t.CompositeSlice=t.CompositeSliceConfig=t.CompositeSliceType=void 0;let n=(0,eh.__importStar)(zy),r=$e();t.CompositeSliceType="Slice",t.CompositeSliceConfig=n.exact(n.partial({label:r.StringOrNull})),t.CompositeSlice=n.exact(n.intersection([n.type({type:n.literal(t.CompositeSliceType)}),n.partial({fieldset:r.StringOrNull,description:n.string,icon:n.string,display:n.string,"non-repeat":n.record(zb.WidgetKey,$i.NestableWidget),repeat:n.record(zb.WidgetKey,$i.NestableWidget),config:t.CompositeSliceConfig})])),t.isCompositeSlice=function(t){return"Slice"===t.type}}($z);var $B={};Object.defineProperty($B,"__esModule",{value:!0}),$B.isLegacySlice=$B.LegacySlice=void 0;let $V=eh,$$=(0,$V.__importStar)(zy);$B.LegacySlice=$$.union([$i.NestableWidget,$r.Group]),$B.isLegacySlice=function(t){return"Slice"!==t.type&&"SharedSlice"!==t.type};var $q={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.isDynamicSharedSlice=t.isStaticSharedSlice=t.SharedSlice=t.SharedSliceType=t.Variation=void 0;let n=(0,eh.__importStar)(zy);t.Variation=n.exact(n.intersection([n.type({id:n.string,name:n.string,description:n.string,imageUrl:(0,Vd.withFallback)(n.string,"https://images.prismic.io/slice-machine/621a5ec4-0387-4bc5-9860-2dd46cbc07cd_default_ss.png?auto=compress,format"),docURL:n.string,version:n.string}),n.partial({display:n.string,primary:n.record(zb.WidgetKey,$i.NestableWidget),items:n.record(zb.WidgetKey,$i.NestableWidget)})])),t.SharedSliceType="SharedSlice";let r=n.string,i=n.string;t.SharedSlice=n.exact(n.intersection([n.type({id:n.string,type:n.literal(t.SharedSliceType),name:n.string,variations:n.readonlyArray(t.Variation)}),n.partial({description:n.string,legacyPaths:n.record(r,i)})])),t.isStaticSharedSlice=function(t){return"SharedSlice"===t.type},t.isDynamicSharedSlice=function(t){return"SharedSlice"===t.type}}($q);var $K={};Object.defineProperty($K,"__esModule",{value:!0}),$K.SharedSliceRef=void 0;let $H=eh,$G=(0,$H.__importStar)(zy);$K.SharedSliceRef=$G.exact($G.type({type:$G.literal($q.SharedSliceType)})),function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Slices=t.DynamicSlices=t.StaticSlices=t.slicesReader=t.DynamicSlicesConfig=t.StaticSlicesConfig=t.slicesConfigReader=t.SlicesLabels=t.SlicesFieldType=t.LegacySlicesFieldType=void 0;let n=(0,eh.__importStar)(zy),r=$e();function i(i){return n.exact(n.partial({label:r.StringOrNull,labels:t.SlicesLabels,choices:n.record(zb.WidgetKey,n.union([$B.LegacySlice,$z.CompositeSlice,i]))}))}t.LegacySlicesFieldType="Choice",t.SlicesFieldType="Slices",t.SlicesLabels=n.union([n.record(n.string,n.readonlyArray(n.exact(n.intersection([n.type({name:n.string}),n.partial({display:n.string})])))),n.null]),t.slicesConfigReader=i,t.StaticSlicesConfig=i($q.SharedSlice),t.DynamicSlicesConfig=i($K.SharedSliceRef);let o={toStatic(t,n){let r=Object.entries(t.choices||{}).reduce((t,[r,i])=>{if("SharedSlice"!==i.type)return{...t,[r]:i};{let o=n.get(r);return o?{...t,[r]:o}:t}},{});return{...t,choices:r}}};function a(i){return n.exact(n.intersection([n.type({type:n.keyof({[t.SlicesFieldType]:null,[t.LegacySlicesFieldType]:null})}),n.partial({fieldset:r.StringOrNull,config:i})]))}t.slicesReader=a,t.StaticSlices=a(t.StaticSlicesConfig),t.DynamicSlices=a(t.DynamicSlicesConfig),t.Slices={toStatic:(t,n)=>t.config?{...t,config:o.toStatic(t.config,n)}:t}}($U);var $Z={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.UID=t.UIDConfig=t.UIDFieldType=void 0;let n=(0,eh.__importStar)(zy),r=$e();t.UIDFieldType="UID",t.UIDConfig=n.exact(n.partial({label:r.StringOrNull,useAsTitle:n.boolean,placeholder:n.string})),t.UID=n.exact(n.intersection([n.type({type:n.literal(t.UIDFieldType)}),n.partial({fieldset:r.StringOrNull,config:t.UIDConfig})]))}($Z),Object.defineProperty($n,"__esModule",{value:!0}),$n.Widgets=$n.FieldType=$n.DynamicWidget=$n.StaticWidget=$n.widgetReader=void 0;let $Y=eh,$J=(0,$Y.__importStar)(zy);function $Q(t){return $J.union([$Z.UID,$i.NestableWidget,$r.Group,t])}$n.widgetReader=$Q,$n.StaticWidget=$Q($U.StaticSlices),$n.DynamicWidget=$Q($U.DynamicSlices),$n.FieldType=$J.keyof({[$W.ColorFieldType]:null,[$W.BooleanFieldType]:null,[$W.NumberFieldType]:null,[$W.EmbedFieldType]:null,[$W.GeoPointFieldType]:null,[$W.DateFieldType]:null,[$W.RangeFieldType]:null,[$W.RichTextFieldType]:null,[$W.SelectFieldType]:null,[$W.SeparatorFieldType]:null,[$W.TextFieldType]:null,[$W.TimestampFieldType]:null,[$W.LinkFieldType]:null,[$W.ImageFieldType]:null,[$W.IntegrationFieldType]:null,[$Z.UIDFieldType]:null,[$r.GroupFieldType]:null,[$U.SlicesFieldType]:null,[$U.LegacySlicesFieldType]:null}),$n.Widgets={toStatic(t,n){switch(t.type){case"Choice":case"Slices":return $U.Slices.toStatic(t,n);default:return t}}},Object.defineProperty($t,"__esModule",{value:!0}),$t.Sections=$t.DynamicSection=$t.StaticSection=$t.sectionReader=void 0;let $X=eh,$0=(0,$X.__importStar)(zy);function $1(t){return $0.record(zb.WidgetKey,t)}$t.sectionReader=$1,$t.StaticSection=$1($n.StaticWidget),$t.DynamicSection=$1($n.DynamicWidget),$t.Sections={toStatic:(t,n)=>Object.entries(t).reduce((t,[r,i])=>({...t,[r]:$n.Widgets.toStatic(i,n)}),{})},function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.collectSharedSlices=t.flattenCustomTypeFields=t.filterMissingSharedSlices=t.collectWidgets=t.validateSlices=t.toStatic=t.flattenSections=t.flattenWidgets=t.CustomType=t.StaticCustomType=t.CustomTypeFormat=void 0;let n=eh,r=(0,n.__importStar)(zy),i=$e();t.CustomTypeFormat={page:"page",custom:"custom"};class o extends Error{constructor(t){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=t,this.message=this._formatError(t)}_formatError(t){return`The following slices doesn't exists in your Prismic repository:
|
|
3
|
-
${t.map(t=>` - ${t}`).join(`
|
|
4
|
-
`)}
|
|
5
|
-
`}}function a(n){return r.exact(r.intersection([r.type({id:r.string,label:i.StringOrNull,repeatable:(0,Vd.withFallback)(r.boolean,!0),json:r.record(r.string,n),status:(0,Vd.withFallback)(r.boolean,!0)}),r.partial({hash:r.string,format:(0,Vd.withFallback)(r.keyof(t.CustomTypeFormat),"custom")})]))}function u(t){return Object.entries(t.json).reduce((t,[,n])=>{let r=Object.entries(n);return t.concat(r)},[])}function s(t,n){let r=Object.entries(t.json).reduce((t,[r,i])=>{let o=Object.entries(i).reduce((t,[r,i])=>{let o=n(r,i);return o?{...t,[r]:o}:t},{});return{...t,[r]:o}},{});return{...t,json:r}}t.StaticCustomType=a($t.StaticSection),t.CustomType=a($t.DynamicSection),t.flattenWidgets=u,t.flattenSections=function(t){return Object.entries(t.json).reduce((t,[,n])=>{let r=Object.entries(n);return t.concat(r)},[])},t.toStatic=function(t,n){let r=Object.entries(t.json).reduce((t,[r,i])=>({...t,[r]:$t.Sections.toStatic(i,n)}),{});return{...t,json:r}},t.validateSlices=function(t,n){let r=(function(t){var n;let r=u(t).filter(([,t])=>"Slices"===t.type).reduce((t,[,n])=>{let r=Object.entries(n.config&&n.config.choices?n.config.choices:{}).filter(([,t])=>"SharedSlice"===t.type).map(([t])=>t);return t.concat(r)},[]);return function(t){return r.map(t)}})(t)(t=>{if(!n.get(t))return t}).filter(Boolean);return r.length>0?(0,Fs.left)(new o(r)):(0,Fs.right)(t)},t.collectWidgets=s,t.filterMissingSharedSlices=function(t,n){return s(t,(t,r)=>{if("Slices"===r.type){if(!r.config||!r.config.choices)return r;let i=Object.entries(r.config.choices).reduce((t,[r,i])=>"SharedSlice"!==i.type||n.get(r)?{...t,[r]:i}:t,{}),o={...r.config,choices:i};return{...r,config:o}}return r})},t.flattenCustomTypeFields=function(t){return Object.values(t.json).reduce((t,n)=>({...t,...n}),{})},t.collectSharedSlices=function(t){return Object.entries(t.fields).reduce((t,[,n])=>{var r;return"Slices"===n.type||"Choice"===n.type?{...t,...Object.entries((null===(r=n.config)||void 0===r?void 0:r.choices)||{}).reduce((t,[n,r])=>"SharedSlice"===r.type?{...t,[n]:r}:t,{})}:t},{})}}(Vf);var $2,$3,$4={},$5={};Object.defineProperty($2=$5,"__esModule",{value:!0}),$2.DiffOperation=void 0,($3=$2.DiffOperation||($2.DiffOperation={})).Added="added",$3.Removed="removed",$3.Updated="updated";var $9={},$6={},$8={};Object.defineProperty($8,"__esModule",{value:!0}),$8.HexaColor=void 0;let $7=/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/;$8.HexaColor={is:t=>$7.test(t)};var qe={};Object.defineProperty(qe,"__esModule",{value:!0}),qe.toRecord=void 0,qe.toRecord=function(t,n){return t.reduce((t,r)=>{let i=n(r);return{...t,[i]:r}},{})};var qt={};Object.defineProperty(qt,"__esModule",{value:!0}),qt.mapValues=qt.isObject=qt.withOptionals=qt.isNotEmpty=qt.zipObjects=void 0;let qn=eh,qr=(0,qn.__importStar)(zy);qt.zipObjects=function(t,n){return[...new Set(Object.keys(t||{}).concat(Object.keys(n||{})))].reduce((r,i)=>{let o=null==t?void 0:t[i],a=null==n?void 0:n[i];return{...r,[i]:{left:o,right:a}}},{})},qt.isNotEmpty=function(t){return Boolean(Object.keys(t).length)},qt.withOptionals=function(t,n){return{...t,...n.reduce((t,[n,r])=>r?{...t,[n]:r}:t,{})}};let qi=qr.record(qr.string,qr.unknown);qt.isObject=function(t){return(0,Fs.isRight)(qi.decode(t))},qt.mapValues=function(t,n){return Object.entries(t).reduce((t,[r,i])=>({...t,[r]:n(i,r)}),{})},Object.defineProperty($6,"__esModule",{value:!0}),$6.Objects=$6.Arrays=$6.HexaColorCode=void 0;let qo=eh;$6.HexaColorCode=(0,qo.__importStar)($8),$6.Arrays=(0,qo.__importStar)(qe),$6.Objects=(0,qo.__importStar)(qt);var qa={};function qu(t,n){let r=$6.Objects.zipObjects(t,n),i=Object.entries(r).reduce((t,[n,r])=>{if(JSON.stringify(null==r?void 0:r.left)===JSON.stringify(null==r?void 0:r.right))return t;let i=(()=>{if(!(!(null!=r&&r.left)&&!(null!=r&&r.right)))return null!=r&&r.left&&!r.right?{op:$5.DiffOperation.Removed}:!(null!=r&&r.left)&&null!=r&&r.right?{op:$5.DiffOperation.Added,value:r.right}:{op:$5.DiffOperation.Updated,value:r.right}})();return i?{...t,[n]:i}:t},{});return $6.Objects.isNotEmpty(i)?i:void 0}Object.defineProperty(qa,"__esModule",{value:!0}),qa.VariationComparator=void 0,qa.VariationComparator={compare(t,n){if(t&&!n)return{op:$5.DiffOperation.Removed};if(!t&&n)return{op:$5.DiffOperation.Added,value:n};let r=function(t,n){let r=$6.Objects.zipObjects(t,n);return Object.entries(r).reduce((t,[n,r])=>"primary"===n||"items"===n||(null==r?void 0:r.left)===(null==r?void 0:r.right)?t:{...t,[n]:null==r?void 0:r.right},{})}(t,n),i=qu(null==t?void 0:t.primary,null==n?void 0:n.primary),o=qu(null==t?void 0:t.items,null==n?void 0:n.items),a={...r,...i?{primary:i}:{},...o?{items:o}:{}};if($6.Objects.isNotEmpty(a))return{op:$5.DiffOperation.Updated,value:a}}},Object.defineProperty($9,"__esModule",{value:!0}),$9.SliceComparator=void 0,$9.SliceComparator={compare(t,n){if(!t&&n)return{op:$5.DiffOperation.Added,value:n};if(t&&!n)return{op:$5.DiffOperation.Removed};let r=function(t,n){let r=$6.Objects.zipObjects(t,n);return Object.entries(r).reduce((t,[n,r])=>"variations"===n||(null==r?void 0:r.left)===(null==r?void 0:r.right)?t:{...t,[n]:null==r?void 0:r.right},{})}(t,n),i=$6.Objects.zipObjects(t&&$6.Arrays.toRecord(t.variations,t=>t.id),n&&$6.Arrays.toRecord(n.variations,t=>t.id)),o=Object.entries(i).reduce((t,[n,r])=>{if(!r)return t;let i=qa.VariationComparator.compare(r.left,r.right);return i?{...t,[n]:i}:t},{}),a={...r,...$6.Objects.isNotEmpty(o)?{variations:o}:{}};if($6.Objects.isNotEmpty(a))return{op:$5.DiffOperation.Updated,value:a}}},function(t){Object.defineProperty(t,"__esModule",{value:!0});let n=eh;(0,n.__exportStar)($5,t),(0,n.__exportStar)($9,t),(0,n.__exportStar)(qa,t)}($4);var qs,qc,ql={},qf={};qs=qf,qc=I&&I.__importDefault||function(t){return t&&t.__esModule?t:{default:t}},Object.defineProperty(qs,"__esModule",{value:!0}),qs.ImageConstraint=void 0,Object.defineProperty(qs,"ImageConstraint",{enumerable:!0,get:function(){return qc($f).default}});var qd={},qp={};Object.defineProperty(qp,"__esModule",{value:!0});var qh={};Object.defineProperty(qh,"__esModule",{value:!0}),qh.SlicesTypes=void 0;let qm=eh,qg=(0,qm.__importStar)(zy);qh.SlicesTypes=qg.keyof({[$z.CompositeSliceType]:null,[$q.SharedSliceType]:null}),function(t){Object.defineProperty(t,"__esModule",{value:!0});let n=eh;(0,n.__exportStar)($z,t),(0,n.__exportStar)($B,t),(0,n.__exportStar)($q,t),(0,n.__exportStar)($K,t),(0,n.__exportStar)(qp,t),(0,n.__exportStar)($U,t),(0,n.__exportStar)(qh,t)}(qd),function(t){Object.defineProperty(t,"__esModule",{value:!0});let n=eh;(0,n.__exportStar)($r,t),(0,n.__exportStar)($W,t),(0,n.__exportStar)(qf,t),(0,n.__exportStar)(qd,t),(0,n.__exportStar)($Z,t),(0,n.__exportStar)($n,t)}(ql),function(t){Object.defineProperty(t,"__esModule",{value:!0});let n=eh;(0,n.__exportStar)(Vf,t),(0,n.__exportStar)($4,t),(0,n.__exportStar)($t,t),(0,n.__exportStar)(ql,t)}(Vl);var qy,qv,qb,qx,q_,qS={},qT={},qw={};function qO(){if(q_)return qw;q_=1,Object.defineProperty(qw,"__esModule",{value:!0}),qw.hasContentType=qw.hasFieldContentType=void 0;let t=K8();function n(t){return"object"==typeof t&&null!==t&&"__TYPE__"in t}return qw.hasFieldContentType=function(r){return n(r)&&r.__TYPE__===t.FieldContentType&&(null==r?void 0:r.type)!==void 0&&"string"==typeof r.type&&(0,Fs.isRight)(t.FieldType.decode(r.type))},qw.hasContentType=n,qw}function qk(){return qj||(qj=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.EmptyContent=t.EmptyLegacy=t.isEmptyContent=t.EmptyContentType=void 0;let n=eh,r=(0,n.__importStar)(zy),i=qO();t.EmptyContentType="EmptyContent";let o=n=>(0,i.hasContentType)(n)&&n.__TYPE__===t.EmptyContentType;t.isEmptyContent=o;let a=r.union([r.null,r.type({value:r.null})]),u=n=>new r.Type("EmptyLegacy",t.isEmptyContent,r=>(0,Ff.pipe)(a.decode(r),Fu.either.map(()=>({type:n,__TYPE__:t.EmptyContentType}))),()=>null);t.EmptyLegacy=u,t.EmptyContent=r.strict({type:r.string,__TYPE__:r.literal(t.EmptyContentType)})}(qT)),qT}var qI={},qC={};Object.defineProperty(qC,"__esModule",{value:!0}),qC.defaultCtx=qC.getFieldCtx=qC.LegacyContentCtx=qC.FieldOrSliceType=void 0;let qM=eh,qR=(0,qM.__importStar)(zy);qC.FieldOrSliceType=qR.union([ql.FieldType,ql.SlicesTypes]);class qE{constructor(t,n,r){Object.defineProperty(this,"fieldKey",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"prefixedKey",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"keyOfType",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"fieldPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"fieldType",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"allTypes",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.fieldKey=t,this.fieldPath=n||[],this.allTypes=r||new Map;let i=Array.of(this.fieldPath,[this.fieldKey]).flat().join(".");this.prefixedKey=i,this.keyOfType=`${i}_TYPE`,this.fieldType=this.allTypes.get(this.prefixedKey)}}qC.LegacyContentCtx=qE,qC.getFieldCtx=function(t,n,r){return new qE(t,[...n.fieldPath,n.fieldKey,...r||[]],n.allTypes)},qC.defaultCtx=function(t,n=new Map){return new qE(t,[],n)};var qj,qN,qA={},qP={};function qL(){return qN||(qN=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.BooleanContentDefaultValue=t.BooleanContent=t.BooleanLegacy=t.isBooleanContent=t.BooleanContentType=void 0;let n=eh,r=(0,n.__importStar)(zy),i=qO();t.BooleanContentType="BooleanContent";let o=n=>(0,i.hasContentType)(n)&&n.__TYPE__===t.BooleanContentType;t.isBooleanContent=o;let a=n=>new r.Type("BooleanLegacy",t.isBooleanContent,n=>(0,Ff.pipe)(r.boolean.decode(n),Fu.either.map(n=>t.BooleanContent.encode({value:n,__TYPE__:t.BooleanContentType}))),t=>({content:t.value,types:{[n.keyOfType]:"Boolean"}}));t.BooleanLegacy=a,t.BooleanContent=r.strict({__TYPE__:r.literal(t.BooleanContentType),value:r.boolean});let u=n=>{var r;return(null===(r=n.config)||void 0===r?void 0:r.default_value)!==void 0?{__TYPE__:t.BooleanContentType,value:n.config.default_value||!1}:void 0};t.BooleanContentDefaultValue=u}(qP)),qP}var qD,qF={};function qW(){return qD||(qD=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.EmbedContent=t.EmbedLegacy=t.EmbedContentLegacy=t.isEmbedContent=t.EmbedContentType=void 0;let n=eh,r=(0,n.__importStar)(zy),i=$e(),o=qO();t.EmbedContentType="EmbedContent";let a=n=>(0,o.hasContentType)(n)&&n.__TYPE__===t.EmbedContentType;t.isEmbedContent=a,t.EmbedContentLegacy=r.exact(r.intersection([r.type({embed_url:r.string,type:r.string}),r.partial({version:r.union([r.string,r.number,r.null]),title:i.StringOrNull,author_name:i.StringOrNull,author_url:i.StringOrNull,provider_name:i.StringOrNull,provider_url:i.StringOrNull,cache_age:r.union([r.string,r.number,r.null]),thumbnail_url:i.StringOrNull,thumbnail_width:i.NumberOrNull,thumbnail_height:i.NumberOrNull,html:i.StringOrNull})]));let u=n=>new r.Type("EmbedLegacy",t.isEmbedContent,n=>(0,Ff.pipe)(t.EmbedContentLegacy.decode(n),Fu.either.map(r=>({...r,all:n,__TYPE__:t.EmbedContentType}))),t=>({content:t.all,types:{[n.keyOfType]:"Embed"}}));t.EmbedLegacy=u,t.EmbedContent=r.intersection([t.EmbedContentLegacy,r.strict({__TYPE__:r.literal(t.EmbedContentType),all:r.unknown})])}(qF)),qF}var qU={},qz={},qB={};Object.defineProperty(qB,"__esModule",{value:!0});let qV=eh,q$=(0,qV.__importStar)(zy);qB.default=new q$.Type("TrimmedString",q$.string.is,(t,n)=>(0,zk.pipe)(q$.string.validate(t,n),(0,VC.chain)(t=>q$.success(function(t){let n=0;for(;n<t.length&&t[n]<=" ";)n++;let r=t.length;for(;n<r&&t[r-1]<=" ";)r--;return t.substring(n,r)}(t)))),t=>t);var qq={};function qK(){return qH||(qH=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ColorContent=t.ColorLegacy=t.isColorContent=void 0;let n=eh,r=(0,n.__importStar)(zy),i=(0,n.__importDefault)(qB),o=qO(),a=t=>(0,o.hasContentType)(t)&&t.__TYPE__===qq.FieldContentType&&(0,o.hasFieldContentType)(t)&&"Color"===t.type;t.isColorContent=a;let u=n=>new r.Type("ColorLegacy",t.isColorContent,n=>(0,Ff.pipe)(i.default.decode(n),Fu.either.map(n=>t.ColorContent.encode({value:n,type:ql.ColorFieldType,__TYPE__:qq.FieldContentType}))),t=>({content:t.value,types:{[n.keyOfType]:ql.ColorFieldType}}));t.ColorLegacy=u,t.ColorContent=r.strict({type:r.literal(ql.ColorFieldType),value:i.default,__TYPE__:r.literal(qq.FieldContentType)})}(qz)),qz}Object.defineProperty(qq,"__esModule",{value:!0}),qq.FieldContentType=void 0,qq.FieldContentType="FieldContent";var qH,qG,qZ={};function qY(){return qG||(qG=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.DateContent=t.DateLegacy=t.isDateContent=void 0;let n=eh,r=(0,n.__importStar)(zy),i=(0,n.__importDefault)(qB),o=qO(),a=t=>(0,o.hasContentType)(t)&&t.__TYPE__===qq.FieldContentType&&(0,o.hasFieldContentType)(t)&&"Date"===t.type;t.isDateContent=a;let u=n=>new r.Type("DateLegacy",t.isDateContent,n=>(0,Ff.pipe)(i.default.decode(n),Fu.either.map(n=>t.DateContent.encode({value:n,type:ql.DateFieldType,__TYPE__:qq.FieldContentType}))),t=>({content:t.value,types:{[n.keyOfType]:ql.DateFieldType}}));t.DateLegacy=u,t.DateContent=r.strict({type:r.literal(ql.DateFieldType),value:i.default,__TYPE__:r.literal(qq.FieldContentType)})}(qZ)),qZ}var qJ,qQ={};function qX(){return qJ||(qJ=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.NumberContent=t.NumberLegacy=t.isNumberContent=void 0;let n=eh,r=(0,n.__importStar)(zy),i=(0,n.__importDefault)(qB),o=qO(),a=t=>(0,o.hasContentType)(t)&&t.__TYPE__===qq.FieldContentType&&(0,o.hasFieldContentType)(t)&&"Number"===t.type;t.isNumberContent=a;let u=n=>new r.Type("NumberLegacy",t.isNumberContent,n=>(0,Ff.pipe)(i.default.decode(n),Fu.either.map(n=>t.NumberContent.encode({value:n,type:ql.NumberFieldType,__TYPE__:qq.FieldContentType}))),t=>({content:t.value,types:{[n.keyOfType]:ql.NumberFieldType}}));t.NumberLegacy=u,t.NumberContent=r.strict({type:r.literal(ql.NumberFieldType),value:i.default,__TYPE__:r.literal(qq.FieldContentType)})}(qQ)),qQ}var q0,q1={};function q2(){return q0||(q0=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.RangeContent=t.RangeLegacy=t.isRangeContent=void 0;let n=eh,r=(0,n.__importStar)(zy),i=(0,n.__importDefault)(qB),o=qO(),a=t=>(0,o.hasContentType)(t)&&t.__TYPE__===qq.FieldContentType&&(0,o.hasFieldContentType)(t)&&"Range"===t.type;t.isRangeContent=a;let u=n=>new r.Type("RangeLegacy",t.isRangeContent,n=>(0,Ff.pipe)(i.default.decode(n),Fu.either.map(n=>t.RangeContent.encode({value:n,type:ql.RangeFieldType,__TYPE__:qq.FieldContentType}))),t=>({content:t.value,types:{[n.keyOfType]:ql.RangeFieldType}}));t.RangeLegacy=u,t.RangeContent=r.strict({type:r.literal(ql.RangeFieldType),value:i.default,__TYPE__:r.literal(qq.FieldContentType)})}(q1)),q1}var q3,q4={};function q5(){return q3||(q3=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.SelectContentDefaultValue=t.SelectContent=t.SelectLegacy=t.isSelectContent=void 0;let n=eh,r=(0,n.__importStar)(zy),i=(0,n.__importDefault)(qB),o=qO(),a=t=>(0,o.hasContentType)(t)&&t.__TYPE__===qq.FieldContentType&&(0,o.hasFieldContentType)(t)&&"Select"===t.type;t.isSelectContent=a;let u=n=>new r.Type("SelectLegacy",t.isSelectContent,n=>(0,Ff.pipe)(i.default.decode(n),Fu.either.map(n=>t.SelectContent.encode({value:n,type:ql.SelectFieldType,__TYPE__:qq.FieldContentType}))),t=>({content:t.value,types:{[n.keyOfType]:ql.SelectFieldType}}));t.SelectLegacy=u,t.SelectContent=r.strict({type:r.literal(ql.SelectFieldType),value:i.default,__TYPE__:r.literal(qq.FieldContentType)});let s=t=>{var n;return!(null===(n=t.config)||void 0===n)&&n.default_value?{__TYPE__:qq.FieldContentType,type:ql.SelectFieldType,value:t.config.default_value||""}:void 0};t.SelectContentDefaultValue=s}(q4)),q4}var q9,q6={};function q8(){return q9||(q9=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.TextContent=t.TextLegacy=t.isTextContent=void 0;let n=eh,r=(0,n.__importStar)(zy),i=(0,n.__importDefault)(qB),o=qO(),a=t=>(0,o.hasContentType)(t)&&t.__TYPE__===qq.FieldContentType&&(0,o.hasFieldContentType)(t)&&"Text"===t.type;t.isTextContent=a;let u=n=>new r.Type("TextLegacy",t.isTextContent,n=>(0,Ff.pipe)(i.default.decode(n),Fu.either.map(n=>t.TextContent.encode({value:n,type:ql.TextFieldType,__TYPE__:qq.FieldContentType}))),t=>({content:t.value,types:{[n.keyOfType]:ql.TextFieldType}}));t.TextLegacy=u,t.TextContent=r.strict({type:r.literal(ql.TextFieldType),value:i.default,__TYPE__:r.literal(qq.FieldContentType)})}(q6)),q6}var q7,Ke={};function Kt(){return q7||(q7=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.TimestampContent=t.TimestampLegacy=t.isTimestampContent=void 0;let n=eh,r=(0,n.__importStar)(zy),i=(0,n.__importDefault)(qB),o=qO(),a=t=>(0,o.hasContentType)(t)&&t.__TYPE__===qq.FieldContentType&&(0,o.hasFieldContentType)(t)&&"Timestamp"===t.type;t.isTimestampContent=a;let u=n=>new r.Type("TimestampLegacy",t.isTimestampContent,n=>(0,Ff.pipe)(i.default.decode(n),Fu.either.map(n=>t.TimestampContent.encode({value:n,type:ql.TimestampFieldType,__TYPE__:qq.FieldContentType}))),t=>({content:t.value,types:{[n.keyOfType]:ql.TimestampFieldType}}));t.TimestampLegacy=u,t.TimestampContent=r.strict({type:r.literal(ql.TimestampFieldType),value:i.default,__TYPE__:r.literal(qq.FieldContentType)})}(Ke)),Ke}function Kn(){return Kr||(Kr=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.FieldContent=t.FieldType=void 0;let n=eh,r=(0,n.__importStar)(zy),i=qK(),o=qY(),a=qX(),u=q2(),s=q5(),c=q8(),l=Kt();t.FieldType=r.keyof({Text:null,Date:null,Timestamp:null,Color:null,Number:null,Range:null,Select:null}),t.FieldContent=r.union([o.DateContent,i.ColorContent,a.NumberContent,u.RangeContent,s.SelectContent,c.TextContent,l.TimestampContent]),(0,n.__exportStar)(qK(),t),(0,n.__exportStar)(qq,t),(0,n.__exportStar)(qY(),t),(0,n.__exportStar)(qX(),t),(0,n.__exportStar)(q2(),t),(0,n.__exportStar)(q5(),t),(0,n.__exportStar)(q8(),t),(0,n.__exportStar)(Kt(),t)}(qU)),qU}var Kr,Ki,Ko={};function Ka(){return Ki||(Ki=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.GeoPointContent=t.GeoPointLegacy=t.isGeoPointContent=t.GeoPointContentType=void 0;let n=eh,r=(0,n.__importStar)(zy),i=qO();t.GeoPointContentType="GeoPointContent";let o=n=>(0,i.hasContentType)(n)&&n.__TYPE__===t.GeoPointContentType;t.isGeoPointContent=o;let a=r.strict({position:r.strict({lat:r.number,lng:r.number})}),u=n=>new r.Type("GeoPointLegacy",t.isGeoPointContent,n=>(0,zk.pipe)(a.decode(n),Fu.either.map(n=>t.GeoPointContent.encode({...n,__TYPE__:t.GeoPointContentType}))),t=>({content:{position:t.position},types:{[n.keyOfType]:"GeoPoint"}}));t.GeoPointLegacy=u,t.GeoPointContent=r.intersection([a,r.strict({__TYPE__:r.literal(t.GeoPointContentType)})])}(Ko)),Ko}var Ku,Ks={};function Kc(){return Ku||(Ku=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ImageContent=t.ImageLegacy=t.ImageContentView=t.isImageContent=t.ImageContentType=void 0;let n=eh,r=(0,n.__importStar)(zy),i=$e(),o=qO();t.ImageContentType="ImageContent";let a=n=>(0,o.hasContentType)(n)&&n.__TYPE__===t.ImageContentType;t.isImageContent=a;let u=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:u,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:i.NonEmptyStringOrNull,alt:i.NonEmptyStringOrNull,provider:i.StringOrNull})]));let s=r.intersection([t.ImageContentView,r.partial({thumbnails:r.record(r.string,t.ImageContentView)})]),c=n=>new r.Type("ImageLegacy",t.isImageContent,n=>(0,Ff.pipe)(s.decode(n),Fu.either.map(n=>t.ImageContent.encode({...n,__TYPE__:t.ImageContentType}))),t=>({content:(0,qt.withOptionals)({edit:t.edit,height:t.height,origin:t.origin,width:t.width},[["alt",t.alt],["credits",t.credits],["provider",t.provider],["thumbnails",t.thumbnails],["url",t.url]]),types:{[n.keyOfType]:"Image"}}));t.ImageLegacy=c,t.ImageContent=r.intersection([s,r.strict({__TYPE__:r.literal(t.ImageContentType)})])}(Ks)),Ks}var Kl,Kf={};function Kd(){return Kl||(Kl=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.IntegrationFieldContent=t.IntegrationFieldLegacy=t.isIntegrationFieldContent=t.IntegrationFieldContentType=void 0;let n=eh,r=(0,n.__importStar)(zy),i=qO();t.IntegrationFieldContentType="IntegrationFieldsContent";let o=n=>(0,i.hasContentType)(n)&&n.__TYPE__===t.IntegrationFieldContentType;t.isIntegrationFieldContent=o;let a=n=>new r.Type("IntegrationFieldLegacy",t.isIntegrationFieldContent,n=>(0,Ff.pipe)(r.string.decode(n),Fu.either.map(n=>t.IntegrationFieldContent.encode({value:n,__TYPE__:t.IntegrationFieldContentType}))),t=>({content:t.value,types:{[n.keyOfType]:"IntegrationFields"}}));t.IntegrationFieldLegacy=a,t.IntegrationFieldContent=r.strict({__TYPE__:r.literal(t.IntegrationFieldContentType),value:r.string})}(Kf)),Kf}var Kp,Kh={};function Km(){return Kp||(Kp=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.LinkContent=t.Link=t.LinkContentLegacy=t.LinkLegacy=t.isLinkContent=t.LinkContentType=t.ExternalLinkContent=t.ExternalLinkType=t.DocumentLinkContent=t.DocumentLinkType=t.FileLinkContent=t.FileLinkType=t.ImageLinkContent=t.ImageLinkType=void 0;let n=eh,r=(0,n.__importStar)(zy),i=$e(),o=qO();t.ImageLinkType="ImageLink";let a=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:i.StringOrNull})])),u=new r.Type("ImageLink",n=>(0,o.hasContentType)(n)&&n.__TYPE__===t.ImageLinkType,n=>(0,Ff.pipe)(a.decode(n),Fu.either.map(n=>t.ImageLinkContent.encode({...n,__TYPE__:t.ImageLinkType}))),t=>a.encode(t));t.ImageLinkContent=r.intersection([r.strict({__TYPE__:r.literal(t.ImageLinkType)}),a]),t.FileLinkType="FileLink";let s=r.exact(r.intersection([r.type({id:r.string,url:r.string,name:r.string,kind:r.string,size:(0,Vr.withFallback)(r.string,"0")}),r.partial({date:(0,zO.nullable)(r.string)})])),c=new r.Type("FileLink",n=>(0,o.hasContentType)(n)&&n.__TYPE__===t.FileLinkType,n=>(0,Ff.pipe)(s.decode(n),Fu.either.map(n=>t.FileLinkContent.encode({...n,__TYPE__:t.FileLinkType}))),t=>s.encode(t));t.FileLinkContent=r.intersection([s,r.exact(r.intersection([r.type({__TYPE__:r.literal(t.FileLinkType)}),r.partial({size:(0,Vr.withFallback)(r.string,"0")})]))]),t.DocumentLinkType="DocumentLink";let l=r.strict({id:i.NonEmptyString}),f=new r.Type("DocumentLink",n=>(0,o.hasContentType)(n)&&n.__TYPE__===t.DocumentLinkType,n=>(0,Ff.pipe)(l.decode(n),Fu.either.map(n=>t.DocumentLinkContent.encode({...n,__TYPE__:t.DocumentLinkType}))),t=>l.encode(t));t.DocumentLinkContent=r.intersection([r.strict({__TYPE__:r.literal(t.DocumentLinkType)}),l]),t.ExternalLinkType="ExternalLink";let d=r.exact(r.intersection([r.type({url:r.string}),r.partial({kind:r.literal("web"),target:i.StringOrNull,preview:(0,zO.nullable)(r.partial({title:r.string}))})])),p=new r.Type("ExternalLink",n=>(0,o.hasContentType)(n)&&n.__TYPE__===t.ExternalLinkType,n=>(0,Ff.pipe)(d.decode(n),Fu.either.map(n=>t.ExternalLinkContent.encode({...n,__TYPE__:t.ExternalLinkType}))),t=>d.encode(t));t.ExternalLinkContent=r.intersection([r.strict({__TYPE__:r.literal(t.ExternalLinkType)}),d]),t.LinkContentType="LinkContent";let h=n=>(0,o.hasContentType)(n)&&n.__TYPE__===t.LinkContentType;t.isLinkContent=h,t.LinkLegacy=r.union([u,c,f,p]);let m=n=>new r.Type("LinkLegacy",t.isLinkContent,n=>(0,Ff.pipe)(t.LinkLegacy.decode(n),Fu.either.map(n=>t.LinkContent.encode({value:n,__TYPE__:t.LinkContentType}))),r=>({content:t.LinkLegacy.encode(r.value),types:{[n.keyOfType]:"Link"}}));t.LinkContentLegacy=m,t.Link=r.union([t.ImageLinkContent,t.FileLinkContent,t.DocumentLinkContent,t.ExternalLinkContent]),t.LinkContent=r.strict({__TYPE__:r.literal(t.LinkContentType),value:t.Link})}(Kh)),Kh}var Kg,Ky={},Kv={},Kb={};function Kx(){return Kg||(Kg=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Block=t.BlockLegacy=t.TextBlock=t.checkEmbedBlock=t.EmbedBlock=t.checkImageBlock=t.ImageBlock=t.ValidatedSpans=t.SpanLegacy=t.Span=void 0;let n=eh,r=(0,n.__importStar)(zy),i=$e(),o=qW(),a=Kc(),u=Km(),s=t=>r.strict({data:t,start:r.number,end:r.number,type:r.literal($W.RichTextNodeType.hyperlink)}),c=r.strict({data:(0,Vr.withFallback)(r.string,""),start:r.number,end:r.number,type:r.literal("label")}),l=r.strict({start:r.number,end:r.number,type:r.keyof({[$W.RichTextNodeType.strong]:null,[$W.RichTextNodeType.em]:null,"list-item":null})});t.Span=r.union([s(u.Link),c,l]),t.SpanLegacy=r.union([s(u.LinkLegacy),c,l]);let f=t=>new r.Type("ValidatedSpans",n=>Array.isArray(n)&&n.every(t.is),(n,i)=>{if(!Array.isArray(n))return r.failure(n,i);{let o=n.reduce((n,r)=>{let i=t.decode(r);return(0,Fs.isLeft)(i)?n:[...n,i.right]},[]).sort((t,n)=>t.start-n.start);return r.success(o)}},n=>n.reduce((n,r)=>{let i=t.encode(r);return[...n,i]},[]));t.ValidatedSpans=f;let d=t=>r.exact(r.intersection([r.type({type:r.literal($W.RichTextNodeType.image),data:r.intersection([a.ImageContentView,r.partial({linkTo:(0,zO.nullable)(t)})])}),r.partial({label:i.StringOrNull,direction:i.StringOrNull})]));t.ImageBlock=d(u.Link);let p=d(u.LinkLegacy);t.checkImageBlock=function(t){return t.type===$W.RichTextNodeType.image};let h=r.exact(r.intersection([r.type({type:r.literal($W.RichTextNodeType.embed),data:r.unknown}),r.partial({label:i.StringOrNull,direction:i.StringOrNull})])),m=new r.Type("EmbedBlockLegacy",t=>"embed"===t.type,n=>(0,Ff.pipe)(h.decode(n),Fu.either.chain(t=>Fu.either.map(n=>[t,n])(o.EmbedContentLegacy.decode(t.data))),Fu.either.map(([n,r])=>t.EmbedBlock.encode({...n,data:{...r,__TYPE__:o.EmbedContentType,all:n.data}}))),t=>({...h.encode(t),data:o.EmbedContentLegacy.encode(t.data)}));t.EmbedBlock=r.exact(r.intersection([r.type({type:r.literal($W.RichTextNodeType.embed),data:o.EmbedContent}),r.partial({label:i.StringOrNull,direction:i.StringOrNull})])),t.checkEmbedBlock=function(t){return t.type===$W.RichTextNodeType.embed};let g=n=>r.exact(r.intersection([r.type({type:(0,zO.refineType)($W.RichTextNodeTypeCodec,`string which isn't ${$W.RichTextNodeType.image} ${$W.RichTextNodeType.embed}`,t=>t!==$W.RichTextNodeType.image&&t!==$W.RichTextNodeType.embed),content:r.intersection([r.type({text:r.string}),r.partial({spans:(0,t.ValidatedSpans)(n)})])}),r.partial({label:r.string,direction:r.string})]));t.TextBlock=g(t.Span);let y=g(t.SpanLegacy),v=r.union([m,p,y]);t.BlockLegacy=new r.Type("BlockLegacy",t=>m.is(t)||p.is(t)||y.is(t),t=>v.decode(t),n=>t.ImageBlock.is(n)?p.encode(n):t.EmbedBlock.is(n)?m.encode(n):y.encode(n)),t.Block=r.union([t.ImageBlock,t.EmbedBlock,t.TextBlock])}(Kb)),Kb}function K_(){return KS||(KS=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.RichTextLegacy=t.RichTextContent=t.isRichTextContent=t.RichTextContentType=void 0;let n=eh,r=(0,n.__importStar)(zy),i=qO(),o=Kx();t.RichTextContentType="StructuredTextContent";let a=n=>(0,i.hasContentType)(n)&&n.__TYPE__===t.RichTextContentType;t.isRichTextContent=a;let u=r.array(o.BlockLegacy);t.RichTextContent=r.strict({__TYPE__:r.literal(t.RichTextContentType),value:r.array(o.Block)}),(0,n.__exportStar)(Kx(),t);let s=n=>new r.Type("RichTextLegacy",t.isRichTextContent,n=>(0,Ff.pipe)(u.decode(n),Fu.either.map(n=>({value:n,__TYPE__:t.RichTextContentType}))),t=>({content:u.encode(t.value),types:{[n.keyOfType]:"StructuredText"}}));t.RichTextLegacy=s}(Kv)),Kv}var KS,KT,Kw={};function KO(){return KT||(KT=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.SeparatorContent=t.SeparatorLegacy=t.isSeparatorContent=t.SeparatorContentType=void 0;let n=(0,eh.__importStar)(zy),r=qO();t.SeparatorContentType="SeparatorContent";let i=n=>(0,r.hasContentType)(n)&&n.__TYPE__===t.SeparatorContentType;t.isSeparatorContent=i;let o=r=>new n.Type("SeparatorLegacy",t.isSeparatorContent,()=>n.success(t.SeparatorContent.encode({__TYPE__:t.SeparatorContentType})),()=>({content:{},types:{[r.keyOfType]:"Separator"}}));t.SeparatorLegacy=o,t.SeparatorContent=n.strict({__TYPE__:n.literal(t.SeparatorContentType)})}(Kw)),Kw}function Kk(){return KC||(KC=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});let n=eh;(0,n.__exportStar)(qL(),t),(0,n.__exportStar)(qW(),t),(0,n.__exportStar)(Kn(),t),(0,n.__exportStar)(Ka(),t),(0,n.__exportStar)(Kc(),t),(0,n.__exportStar)(Kd(),t),(0,n.__exportStar)(Km(),t),(0,n.__exportStar)(function(){if(KI)return Ky;KI=1,Object.defineProperty(Ky,"__esModule",{value:!0}),Ky.NestableLegacy=Ky.isNestableContent=Ky.NestableContentDefaultValue=Ky.NestableContent=void 0;let t=eh,n=(0,t.__importStar)(zy),r=qk(),i=qL(),o=qW(),a=Kn(),u=Ka(),s=Kc(),c=Kd(),l=Km(),f=K_(),d=KO();Ky.NestableContent=n.union([r.EmptyContent,i.BooleanContent,o.EmbedContent,a.TextContent,a.TimestampContent,a.SelectContent,a.RangeContent,a.NumberContent,a.DateContent,a.ColorContent,u.GeoPointContent,s.ImageContent,c.IntegrationFieldContent,l.LinkContent,f.RichTextContent,d.SeparatorContent]);let p=t=>{switch(t.type){case"Boolean":return(0,i.BooleanContentDefaultValue)(t);case"Select":return(0,a.SelectContentDefaultValue)(t);default:return}};Ky.NestableContentDefaultValue=p;let h=t=>(0,a.isTextContent)(t)||(0,a.isColorContent)(t)||(0,a.isDateContent)(t)||(0,a.isTimestampContent)(t)||(0,a.isNumberContent)(t)||(0,a.isRangeContent)(t)||(0,a.isSelectContent)(t)||(0,u.isGeoPointContent)(t)||(0,f.isRichTextContent)(t)||(0,i.isBooleanContent)(t)||(0,o.isEmbedContent)(t)||(0,s.isImageContent)(t)||(0,c.isIntegrationFieldContent)(t)||(0,l.isLinkContent)(t)||(0,d.isSeparatorContent)(t)||(0,r.isEmptyContent)(t);Ky.isNestableContent=h;let m=t=>({decode(n){if(!t.fieldType)return;let p=(0,r.EmptyLegacy)(t.fieldType).decode(n);if((0,Fs.isRight)(p))return p;let h=(()=>{switch(t.fieldType){case"Text":return(0,a.TextLegacy)(t);case"Color":return(0,a.ColorLegacy)(t);case"Date":return(0,a.DateLegacy)(t);case"Timestamp":return(0,a.TimestampLegacy)(t);case"Number":return(0,a.NumberLegacy)(t);case"Range":return(0,a.RangeLegacy)(t);case"Select":return(0,a.SelectLegacy)(t);case"GeoPoint":return(0,u.GeoPointLegacy)(t);case"StructuredText":return(0,f.RichTextLegacy)(t);case"Boolean":return(0,i.BooleanLegacy)(t);case"Embed":return(0,o.EmbedLegacy)(t);case"Image":return(0,s.ImageLegacy)(t);case"IntegrationFields":return(0,c.IntegrationFieldLegacy)(t);case"Link":return(0,l.LinkContentLegacy)(t);case"Separator":return(0,d.SeparatorLegacy)(t);default:return}})();if(h)return h.decode(n)},encode(n){switch(n.__TYPE__){case qq.FieldContentType:return"Text"===n.type?(0,a.TextLegacy)(t).encode(n):"Color"===n.type?(0,a.ColorLegacy)(t).encode(n):"Range"===n.type?(0,a.RangeLegacy)(t).encode(n):"Date"===n.type?(0,a.DateLegacy)(t).encode(n):"Number"===n.type?(0,a.NumberLegacy)(t).encode(n):"Timestamp"===n.type?(0,a.TimestampLegacy)(t).encode(n):"Select"===n.type?(0,a.SelectLegacy)(t).encode(n):void 0;case u.GeoPointContentType:return(0,u.GeoPointLegacy)(t).encode(n);case f.RichTextContentType:return(0,f.RichTextLegacy)(t).encode(n);case o.EmbedContentType:return(0,o.EmbedLegacy)(t).encode(n);case i.BooleanContentType:return(0,i.BooleanLegacy)(t).encode(n);case s.ImageContentType:return(0,s.ImageLegacy)(t).encode(n);case c.IntegrationFieldContentType:return(0,c.IntegrationFieldLegacy)(t).encode(n);case l.LinkContentType:return(0,l.LinkContentLegacy)(t).encode(n);case d.SeparatorContentType:return(0,d.SeparatorLegacy)(t).encode(n);default:return}}});return Ky.NestableLegacy=m,Ky}(),t),(0,n.__exportStar)(K_(),t),(0,n.__exportStar)(KO(),t)}(qA)),qA}var KI,KC,KM,KR={};function KE(){if(KM)return KR;KM=1,Object.defineProperty(KR,"__esModule",{value:!0}),KR.repeatableContentWithDefaultNestableContentValues=KR.withDefaultNestableContentValues=void 0;let t=Kk();return KR.withDefaultNestableContentValues=function(n,r){return Object.entries(n).reduce((n,[i,o])=>{if(void 0===r[i]){let a=(0,t.NestableContentDefaultValue)(o);return void 0!==a?{...n,[i]:a}:n}return n},r)},KR.repeatableContentWithDefaultNestableContentValues=function(n,r){let i=Object.entries(n);return r.map(n=>i.reduce((r,[i,o])=>{if(!n.value.find(([t])=>t===i)){let a=(0,t.NestableContentDefaultValue)(o);return{...r,value:[...r.value,...a?[[i,a]]:[]]}}return r},n))},KR}function Kj(){return KN||(KN=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.traverseGroupItemsContent=t.traverseGroupContent=t.groupContentWithDefaultValues=t.GroupContent=t.isGroupContent=t.GroupContentType=t.GroupLegacy=t.GroupItemLegacy=t.GroupItemContent=t.GroupItemContentType=void 0;let n=eh,r=(0,n.__importStar)(zy),i=qO(),o=Kk(),a=KE();t.GroupItemContentType="GroupItemContent",t.GroupItemContent=r.strict({__TYPE__:r.literal(t.GroupItemContentType),value:r.array(r.tuple([r.string,o.NestableContent]))});let u=r.record(r.string,r.unknown),s=n=>new r.Type("GroupItemLegacy",n=>(0,i.hasContentType)(n)&&n.__TYPE__===t.GroupItemContentType,r=>(0,Ff.pipe)(u.decode(r),Fu.either.map(r=>({value:Object.entries(r).reduce((t,[r,i])=>{let a=(0,qC.getFieldCtx)(r,n),u=(0,o.NestableLegacy)(a).decode(i);return!u||(0,Fs.isLeft)(u)?t:[...t,[r,u.right]]},[]),__TYPE__:t.GroupItemContentType}))),t=>t.value.reduce((t,[r,i])=>{let a=(0,qC.getFieldCtx)(r,n),u=(0,o.NestableLegacy)(a).encode(i);return u?{content:{...t.content,[r]:u.content},types:{...t.types,...u.types}}:t},{content:{},types:{}}));t.GroupItemLegacy=s;let c=n=>{let i=r.array(r.union([r.null,(0,t.GroupItemLegacy)(n)])),o=r.array((0,t.GroupItemLegacy)(n));return new r.Type("GroupLegacy",t.isGroupContent,n=>(0,Ff.pipe)(i.decode(n),Fu.either.map(n=>({value:n.map(n=>null===n?{__TYPE__:t.GroupItemContentType,value:[]}:n),__TYPE__:t.GroupContentType}))),t=>{let r=o.encode(t.value);return{content:r.map(t=>t.content),types:r.reduce((t,n)=>({...t,...n.types}),{[n.keyOfType]:"Group"})}})};t.GroupLegacy=c,t.GroupContentType="GroupContentType";let l=n=>(0,i.hasContentType)(n)&&n.__TYPE__===t.GroupContentType;function f({path:t,model:n,content:r}){return i=>r.map((r,a)=>{let u=t.concat([{key:a.toString(),type:"GroupItem"}]),s=r.value.reduce((t,[r,a])=>{let s=null==n?void 0:n[r],c=i({path:u.concat([{key:r,type:"Widget"}]),key:r,apiId:r,model:s,content:a});return c&&(0,o.isNestableContent)(c)?t.concat([[r,c]]):t},[]);return{__TYPE__:r.__TYPE__,value:s}})}t.isGroupContent=l,t.GroupContent=r.strict({__TYPE__:r.literal(t.GroupContentType),value:r.array(t.GroupItemContent)}),t.groupContentWithDefaultValues=function(t,n){var r;let i=null===(r=t.config)||void 0===r?void 0:r.fields;return i?{...n,value:(0,a.repeatableContentWithDefaultNestableContentValues)(i,n.value)}:n},t.traverseGroupContent=function({path:t,key:n,apiId:r,model:i,content:o}){return a=>{var u;let s=f({path:t,model:null===(u=null==i?void 0:i.config)||void 0===u?void 0:u.fields,content:o.value})(a);return a({path:t,key:n,apiId:r,model:i,content:{__TYPE__:o.__TYPE__,value:s}})}},t.traverseGroupItemsContent=f}(qI)),qI}var KN,KA,KP={},KL={},KD={},KF={};function KW(){if(KA)return KF;KA=1,Object.defineProperty(KF,"__esModule",{value:!0}),KF.RepeatableWidgets=KF.RepeatableWidgetsLegacy=void 0;let t=(0,eh.__importStar)(zy),n=Kj(),r=Kk(),i=r=>t.array((0,n.GroupItemLegacy)(r));KF.RepeatableWidgetsLegacy=i;let o=t.tuple([t.string,r.NestableContent]),a=t.strict({__TYPE__:t.literal(n.GroupItemContentType),value:t.array(o)});return KF.RepeatableWidgets=t.array(a),KF}function KU(){return Kz||(Kz=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.migrateCompositeSlice=t.traverseCompositeSliceContent=t.compositeSliceContentWithDefaultValues=t.CompositeSliceContent=t.CompositeSliceLegacy=t.isCompositeSliceContent=t.CompositeSliceContentType=void 0;let n=eh,r=(0,n.__importStar)(zy),i=qO(),o=Kj(),a=Kk(),u=KE(),s=KW();t.CompositeSliceContentType="CompositeSliceContent";let c=n=>(0,i.hasContentType)(n)&&n.__TYPE__===t.CompositeSliceContentType;t.isCompositeSliceContent=c;let l=r.exact(r.partial({repeat:r.array(r.unknown),"non-repeat":r.UnknownRecord})),f=n=>new r.Type("CompositeSliceLegacy",t.isCompositeSliceContent,r=>(0,Ff.pipe)(l.decode(r),Fu.either.map(r=>{let i=(()=>{let t=(0,qC.getFieldCtx)("repeat",n),i=(0,s.RepeatableWidgetsLegacy)(t).decode(r.repeat);if(!(!i||(0,Fs.isLeft)(i)))return i.right})()||[];return{nonRepeat:Object.entries(r["non-repeat"]||{}).reduce((t,[r,i])=>{let o=(0,qC.getFieldCtx)(r,n,["non-repeat"]);if(!o)return t;let u=(0,a.NestableLegacy)(o).decode(i);return!u||(0,Fs.isLeft)(u)?t:{...t,[r]:u.right}},{}),repeat:i,__TYPE__:t.CompositeSliceContentType}})),t=>{let r=Object.entries(t.nonRepeat).reduce((t,[r,i])=>{let o=(0,qC.getFieldCtx)(r,n,["non-repeat"]),u=(0,a.NestableLegacy)(o).encode(i);return u?{content:{...t.content,[r]:u.content},types:{...t.types,...u.types}}:t},{content:{},types:{}}),i=(()=>{let r=(0,qC.getFieldCtx)("repeat",n);return(0,s.RepeatableWidgetsLegacy)(r).encode(t.repeat)})()||[];return{content:{"non-repeat":r.content,repeat:i.map(t=>t.content)},types:{[n.keyOfType]:"Slice",...r.types,...i.reduce((t,n)=>({...t,...n.types}),{})}}});t.CompositeSliceLegacy=f,t.CompositeSliceContent=r.strict({__TYPE__:r.literal(t.CompositeSliceContentType),nonRepeat:r.record(r.string,a.NestableContent),repeat:s.RepeatableWidgets}),t.compositeSliceContentWithDefaultValues=function(t,n){var r,i;let o=(0,u.withDefaultNestableContentValues)(null!==(r=t["non-repeat"])&&void 0!==r?r:{},n.nonRepeat),a=(0,u.repeatableContentWithDefaultNestableContentValues)(null!==(i=t.repeat)&&void 0!==i?i:{},n.repeat);return{...n,nonRepeat:o,repeat:a}},t.traverseCompositeSliceContent=function({path:t,sliceKey:n,sliceName:r,model:i,content:u}){return(s,c)=>{let l=Object.entries(u.widget.nonRepeat).reduce((o,[u,c])=>{var l,f,d;let p=(null==i?void 0:i.type)==="SharedSlice"?null===(f=null===(l=null==i?void 0:i.fields)||void 0===l?void 0:l.primary)||void 0===f?void 0:f[u]:null===(d=null==i?void 0:i["non-repeat"])||void 0===d?void 0:d[u],h=s({path:t.concat([{key:"non-repeat",type:"primary"},{key:u,type:"Widget"}]),key:u,apiId:r,model:p,content:c});return h?(0,a.isNestableContent)(h)?{...o,[u]:h}:(console.warn(`Warn: Non nestable content with key [${u}] detected in a composite slice [${r}] with key [${n}]`),o):o},{}),f=(0,o.traverseGroupItemsContent)({path:t.concat([{key:"repeat",type:"items"}]),model:(null==i?void 0:i.type)==="SharedSlice"?null==i?void 0:i.fields.items:null==i?void 0:i.repeat,content:u.widget.repeat})(s);return c({key:n,apiId:r,path:t,model:i,content:{...u,widget:{__TYPE__:"CompositeSliceContent",repeat:f,nonRepeat:l}}})}},t.migrateCompositeSlice=function(t,n){let[,r]=n.key.split("$");return{key:`${t.sliceName}$${r}`,name:t.sliceName,maybeLabel:n.maybeLabel,widget:{__TYPE__:"SharedSliceContent",variation:t.variationId,primary:Object.entries(n.widget.nonRepeat).reduce((r,[i,o])=>{var a;return!(null===(a=t.fields.primary)||void 0===a)&&a[i]?{...r,[i]:o}:(console.warn(`The widget ${i} in the non-repeat zone of the composite slice [${t.sliceName}] with key [${n.key}] doesn't exist in the model.`),r)},{}),items:n.widget.repeat.map(r=>({__TYPE__:"GroupItemContent",value:r.value.reduce((r,[i,o])=>{var a;return!(null===(a=t.fields.items)||void 0===a)&&a[i]?r.concat([[i,o]]):(console.warn(`The widget ${i} in the repeat zone of the composite slice [${t.sliceName}] with key [${n.key}] doesn't exist in the model.`),r)},[])}),[])}}}}(KD)),KD}var Kz,KB,KV={};function K$(){return KB||(KB=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.traverseSharedSliceContent=t.sharedSliceContentWithDefaultValues=t.SharedSliceContent=t.SharedSliceLegacy=t.isSharedSliceContent=t.SharedSliceContentType=void 0;let n=eh,r=(0,n.__importStar)(zy),i=qO(),o=Kj(),a=Kk(),u=KE(),s=KW();t.SharedSliceContentType="SharedSliceContent";let c=n=>(0,i.hasContentType)(n)&&n.__TYPE__===t.SharedSliceContentType;t.isSharedSliceContent=c;let l=r.exact(r.type({variation:r.string,items:(0,Vr.withFallback)(r.array(r.unknown),[]),primary:(0,Vr.withFallback)(r.UnknownRecord,{})})),f=n=>new r.Type("SharedSliceLegacy",t.isSharedSliceContent,r=>(0,Ff.pipe)(l.decode(r),Fu.either.map(r=>{let i=(()=>{let t=(0,qC.getFieldCtx)("items",n,["variations",r.variation]),i=(0,s.RepeatableWidgetsLegacy)(t).decode(r.items);if(!(!i||(0,Fs.isLeft)(i)))return i.right})()||[],o=Object.entries(r.primary).reduce((t,[i,o])=>{let u=(0,qC.getFieldCtx)(i,n,["variations",r.variation,"primary"]),s=(0,a.NestableLegacy)(u).decode(o);return!s||(0,Fs.isLeft)(s)?t:{...t,[i]:s.right}},{});return{variation:r.variation,primary:o,items:i,__TYPE__:t.SharedSliceContentType}})),t=>{let r=Object.entries(t.primary).reduce((r,[i,o])=>{let u=(0,qC.getFieldCtx)(i,n,["variations",t.variation,"primary"]),s=(0,a.NestableLegacy)(u).encode(o);return s?{content:{...r.content,[i]:s.content},types:{...r.types,...s.types}}:r},{content:{},types:{}}),i=(()=>{let r=(0,qC.getFieldCtx)("items",n,["variations",t.variation]);return(0,s.RepeatableWidgetsLegacy)(r).encode(t.items)})()||[];return{content:{primary:r.content,items:i.map(t=>t.content),variation:t.variation},types:{[n.keyOfType]:"SharedSlice",...r.types,...i.reduce((t,n)=>({...t,...n.types}),{})}}});t.SharedSliceLegacy=f,t.SharedSliceContent=r.strict({__TYPE__:r.literal(t.SharedSliceContentType),variation:r.string,primary:r.record(r.string,a.NestableContent),items:s.RepeatableWidgets}),t.sharedSliceContentWithDefaultValues=function(t,n){var r,i;let o=t.variations.find(t=>t.id===n.variation),a=null!==(r=null==o?void 0:o.primary)&&void 0!==r?r:{},s=null!==(i=null==o?void 0:o.items)&&void 0!==i?i:{},c=(0,u.withDefaultNestableContentValues)(a,n.primary),l=(0,u.repeatableContentWithDefaultNestableContentValues)(s,n.items);return{...n,primary:c,items:l}},t.traverseSharedSliceContent=function({path:t,sliceKey:n,sliceName:r,model:i,content:u}){return(s,c)=>{let l=Object.entries(u.widget.primary).reduce((o,[u,c])=>{var l,f;let d=null===(f=null===(l=null==i?void 0:i.fields)||void 0===l?void 0:l.primary)||void 0===f?void 0:f[u],p=s({path:t.concat([{key:"primary",type:"primary"},{key:u,type:"Widget"}]),key:u,apiId:r,model:d,content:c});return p?(0,a.isNestableContent)(p)?{...o,[u]:p}:(console.warn(`Warn: Non nestable content with key [${u}] detected in a shared slice [${r}] with key [${n}]`),o):o},{}),f=(0,o.traverseGroupItemsContent)({path:t.concat([{key:"items",type:"items"}]),model:null==i?void 0:i.fields.items,content:u.widget.items})(s);return c({key:n,apiId:r,path:t,model:i,content:{...u,widget:{__TYPE__:"SharedSliceContent",variation:u.widget.variation,primary:l,items:f}}})}}}(KV)),KV}var Kq,KK={};function KH(){if(Kq)return KK;Kq=1,Object.defineProperty(KK,"__esModule",{value:!0}),KK.migrateSimpleSlice=KK.traverseSimpleSliceContent=KK.SimpleSliceLegacy=KK.isSimpleSliceContent=KK.SimpleSliceContent=void 0;let t=(0,eh.__importStar)(zy),n=Kj(),r=Kk();KK.SimpleSliceContent=t.union([r.NestableContent,n.GroupContent]);let i=t=>(0,r.isNestableContent)(t)||(0,n.isGroupContent)(t);KK.isSimpleSliceContent=i;let o=t=>({decode:"Group"===t.fieldType?(0,n.GroupLegacy)(t).decode.bind(null):(0,r.NestableLegacy)(t).decode.bind(null),encode:i=>"GroupContentType"===i.__TYPE__?(0,n.GroupLegacy)(t).encode(i):(0,r.NestableLegacy)(t).encode(i)});return KK.SimpleSliceLegacy=o,KK.traverseSimpleSliceContent=function({path:t,sliceKey:r,sliceName:i,model:o,content:a}){return(u,s)=>{var c;if((0,n.isGroupContent)(a.widget)){let l=(0,n.traverseGroupContent)({path:t,key:a.key,apiId:a.name,model:(null==o?void 0:o.type)==="Group"?o:(null==o?void 0:o.type)==="SharedSlice"?{type:"Group",config:{fields:o.fields.items||{}}}:void 0,content:a.widget})(u);return l&&s({key:a.key,apiId:a.name,path:t,model:o,content:{...a,widget:l}})}let f=u({key:a.key,apiId:a.name,path:t,model:(null==o?void 0:o.type)==="SharedSlice"?null===(c=o.fields.primary)||void 0===c?void 0:c[a.name]:(null==o?void 0:o.type)!=="Group"?o:void 0,content:a.widget});return f&&s({key:r,apiId:i,path:t,model:o,content:{...a,widget:f}})}},KK.migrateSimpleSlice=function(t,n){var r;let[,i]=n.key.split("$"),o=`${t.sliceName}$${i}`;return"GroupContentType"===n.widget.__TYPE__?{key:o,name:t.sliceName,maybeLabel:n.maybeLabel,widget:{__TYPE__:"SharedSliceContent",variation:t.variationId,primary:{},items:n.widget.value.map(n=>({__TYPE__:"GroupItemContent",value:n.value.reduce((n,[r,i])=>{var o;return!(null===(o=t.fields.items)||void 0===o)&&o[r]?n.concat([[r,i]]):n},[])}),[])}}:{key:o,name:t.sliceName,maybeLabel:n.maybeLabel,widget:{__TYPE__:"SharedSliceContent",variation:t.variationId,primary:!(null===(r=t.fields.primary)||void 0===r)&&r[n.name]?{[n.name]:n.widget}:{},items:[]}}},KK}function KG(){return KZ||(KZ=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.SliceContent=t.SliceLegacy=void 0;let n=eh,r=(0,n.__importStar)(zy),i=KU(),o=K$(),a=KH(),u=t=>({decode:n=>(()=>{switch(t.fieldType){case"Slice":return(0,i.CompositeSliceLegacy)(t);case"SharedSlice":return(0,o.SharedSliceLegacy)(t);default:return(0,a.SimpleSliceLegacy)(t)}})().decode(n),encode(n){switch(n.__TYPE__){case"SharedSliceContent":return(0,o.SharedSliceLegacy)(t).encode(n);case"CompositeSliceContent":return(0,i.CompositeSliceLegacy)(t).encode(n);default:return(0,a.SimpleSliceLegacy)(t).encode(n)}}});t.SliceLegacy=u,t.SliceContent=r.union([i.CompositeSliceContent,o.SharedSliceContent,a.SimpleSliceContent]),(0,n.__exportStar)(KU(),t),(0,n.__exportStar)(K$(),t),(0,n.__exportStar)(KH(),t)}(KL)),KL}var KZ,KY,KJ={};function KQ(){if(KY)return KJ;KY=1,Object.defineProperty(KJ,"__esModule",{value:!0}),KJ.migrateSliceItem=KJ.SlicesItemLegacy=KJ.sliceItemContentWithDefaultValues=KJ.isSimpleSliceItemContent=KJ.isCompositeSliceItemContent=KJ.isSharedSliceItemContent=KJ.SliceItemContent=void 0;let t=eh,n=(0,t.__importStar)(zy),r=Kj(),i=Kk(),o=KE(),a=KG(),u=KU(),s=K$(),c=KH();function l(t){return(0,u.isCompositeSliceContent)(t.widget)}function f(t){return(0,r.isGroupContent)(t.widget)||(0,i.isNestableContent)(t.widget)}KJ.SliceItemContent=n.type({key:n.string,name:n.string,maybeLabel:n.union([n.string,n.undefined]),widget:a.SliceContent}),KJ.isSharedSliceItemContent=function(t){return(0,s.isSharedSliceContent)(t.widget)},KJ.isCompositeSliceItemContent=l,KJ.isSimpleSliceItemContent=f,KJ.sliceItemContentWithDefaultValues=function(t,n){var i;if("SharedSlice"===t.type&&(0,s.isSharedSliceContent)(n))return(0,a.sharedSliceContentWithDefaultValues)(t,n);if("Slice"===t.type&&(0,u.isCompositeSliceContent)(n))return(0,a.compositeSliceContentWithDefaultValues)(t,n);if("Group"===t.type&&(0,r.isGroupContent)(n)&&!(null===(i=t.config)||void 0===i)&&i.fields){let c=(0,o.repeatableContentWithDefaultNestableContentValues)(t.config.fields,n.value);return{...n,value:c}}return n};let d=n.exact(n.intersection([n.type({key:n.string,value:n.unknown}),n.partial({label:(0,zO.nullable)(n.string)})])),p=t=>new n.Type("SlicesItemLegacy",t=>((0,s.isSharedSliceContent)(t.widget),(0,u.isCompositeSliceContent)(t.widget),(0,c.isSimpleSliceContent)(t.widget)),(r,i)=>(0,Ff.pipe)(d.decode(r),Fu.either.chain(o=>{var u;let s=o.key.indexOf("$"),c=o.key.substring(0,s>0?s:void 0),l=(0,qC.getFieldCtx)(c,t),f=(0,a.SliceLegacy)(l).decode(o.value);return!f||(0,Fs.isLeft)(f)?n.failure(r,i):n.success({key:o.key,name:c,maybeLabel:null!==(u=o.label)&&void 0!==u?u:void 0,widget:f.right})})),n=>{let r=(0,qC.getFieldCtx)(n.name,t),i=(0,a.SliceLegacy)(r).encode(n.widget);return{content:{key:n.key,label:n.maybeLabel,value:(null==i?void 0:i.content)||{}},types:(null==i?void 0:i.types)||{}}});KJ.SlicesItemLegacy=p;let h=({model:t,content:n})=>l(n)&&(null==t?void 0:t.type)==="SharedSlice"?(0,u.migrateCompositeSlice)(t,n):f(n)&&(null==t?void 0:t.type)==="SharedSlice"?(0,c.migrateSimpleSlice)(t,n):n;return KJ.migrateSliceItem=h,KJ}var KX,K0={};function K1(){return K2||(K2=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});let n=eh;(0,n.__exportStar)(KG(),t),(0,n.__exportStar)(KQ(),t),(0,n.__exportStar)((KX||(KX=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.traverseSlices=t.slicesContentWithDefaultValues=t.SlicesContent=t.SlicesLegacy=t.isSlicesContent=t.SlicesContentType=void 0;let n=eh,r=(0,n.__importStar)(zy),i=qO(),o=KU(),a=K$(),u=KH(),s=KQ();t.SlicesContentType="SliceContentType";let c=n=>(0,i.hasContentType)(n)&&n.__TYPE__===t.SlicesContentType;t.isSlicesContent=c;let l=n=>{let i=r.array((0,s.SlicesItemLegacy)(n));return new r.Type("SlicesLegacy",t.isSlicesContent,n=>(0,Ff.pipe)(i.decode(n),Fu.either.map(n=>({__TYPE__:t.SlicesContentType,value:n}))),t=>{let r=i.encode(t.value);return{content:r.map(t=>t.content),types:r.reduce((t,n)=>({...t,...n.types}),{[n.keyOfType]:"Slices"})}})};t.SlicesLegacy=l,t.SlicesContent=r.type({__TYPE__:r.literal(t.SlicesContentType),value:r.array(s.SliceItemContent)}),t.slicesContentWithDefaultValues=function(t,n){var r;let i=null===(r=null==t?void 0:t.config)||void 0===r?void 0:r.choices;if(void 0===i)return n;let o=n.value.map(t=>{let n=i[t.name];if(n){let r=(0,s.sliceItemContentWithDefaultValues)(n,t.widget);return{...t,widget:r}}return t});return{...n,value:o}},t.traverseSlices=function({path:t,key:n,model:r,content:i}){return({transformWidget:c=({content:t})=>t,transformSlice:l=({content:t})=>t})=>{let f=i.value.reduce((n,i)=>{let f=r&&function(t,n,r){var i,o;let a=null===(o=null===(i=null==n?void 0:n.config)||void 0===i?void 0:i.choices)||void 0===o?void 0:o[r.name];return(()=>{if((0,s.isSharedSliceItemContent)(r)&&a&&(0,Vl.isStaticSharedSlice)(a)){let t=a.variations.find(t=>t.id===r.widget.variation);return t?{type:"SharedSlice",sliceName:a.id,variationId:t.id,fields:{primary:t.primary||{},items:t.items||{}}}:void 0}})()||(()=>{var i;let o=zv.ContentPath.append(zv.ContentPath.serialize(t),r.name),a=Object.values((null===(i=null==n?void 0:n.config)||void 0===i?void 0:i.choices)||{}).find(t=>{var n;return!!(0,Vl.isStaticSharedSlice)(t)&&!!(!(null===(n=t.legacyPaths)||void 0===n)&&n[o])});if(!a)return;let u=null==a?void 0:a.variations.find(t=>{var n;return t.id===(null===(n=a.legacyPaths)||void 0===n?void 0:n[o])});if(u)return{type:"SharedSlice",sliceName:a.id,variationId:u.id,fields:{primary:u.primary||{},items:u.items||{}}}})()||(()=>{if(a){if((0,Vl.isCompositeSlice)(a))return{type:"Slice","non-repeat":a["non-repeat"]||{},repeat:a.repeat||{}};if((0,Vl.isLegacySlice)(a))return a}})()}(t,r,i),d=(0,s.isSharedSliceItemContent)(i)?(0,a.traverseSharedSliceContent)({path:t.concat({key:i.key,type:"SharedSlice"}),sliceKey:i.key,sliceName:i.name,model:(null==f?void 0:f.type)==="SharedSlice"?f:void 0,content:i})(c,l):(0,s.isCompositeSliceItemContent)(i)?(0,o.traverseCompositeSliceContent)({path:t.concat({key:i.key,type:"Slice"}),sliceKey:i.key,sliceName:i.name,model:(null==f?void 0:f.type)==="Slice"||(null==f?void 0:f.type)==="SharedSlice"?f:void 0,content:i})(c,l):(0,s.isSimpleSliceItemContent)(i)?(0,u.traverseSimpleSliceContent)({path:t.concat({key:i.key,type:"LegacySlice"}),sliceKey:i.key,sliceName:i.name,model:f&&(null==f?void 0:f.type)!=="Slice"?f:void 0,content:i})(c,l):void 0;return d?n.concat(d):n},[]);return c({path:t,key:n,apiId:n,model:r,content:{__TYPE__:i.__TYPE__,value:f}})}}}(K0)),K0),t)}(KP)),KP}var K2,K3,K4={};function K5(){return K3||(K3=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.UIDContent=t.UIDLegacy=t.isUIDContent=t.UIDContentType=void 0;let n=eh,r=(0,n.__importStar)(zy),i=qO();t.UIDContentType="UIDContent";let o=n=>(0,i.hasContentType)(n)&&n.__TYPE__===t.UIDContentType;t.isUIDContent=o;let a=n=>new r.Type("UIDLegacy",t.isUIDContent,n=>(0,Ff.pipe)(r.string.decode(n),Fu.either.map(n=>t.UIDContent.encode({value:n,__TYPE__:t.UIDContentType}))),t=>({content:t.value,types:{[n.keyOfType]:"UID"}}));t.UIDLegacy=a,t.UIDContent=r.type({__TYPE__:r.literal(t.UIDContentType),value:r.string})}(K4)),K4}var K9,K6={};function K8(){return i||(i=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});let n=eh;(0,n.__exportStar)(qk(),t),(0,n.__exportStar)(Kj(),t),(0,n.__exportStar)(Kk(),t),(0,n.__exportStar)(K1(),t),(0,n.__exportStar)(K5(),t),(0,n.__exportStar)(function(){if(K9)return K6;K9=1,Object.defineProperty(K6,"__esModule",{value:!0}),K6.WidgetLegacy=K6.isWidgetContent=K6.WidgetContent=void 0;let t=(0,eh.__importStar)(zy),n=Kj(),r=Kk(),i=K1(),o=K5();K6.WidgetContent=t.union([n.GroupContent,r.NestableContent,o.UIDContent,i.SlicesContent]);let a=t=>(0,n.isGroupContent)(t)||(0,r.isNestableContent)(t)||(0,o.isUIDContent)(t)||(0,i.isSlicesContent)(t);K6.isWidgetContent=a;let u=t=>({decode(a){if(!t.fieldType)return;let u=(()=>{switch(t.fieldType){case"UID":return(0,o.UIDLegacy)(t);case"Group":return(0,n.GroupLegacy)(t);case"Choice":case"Slices":return(0,i.SlicesLegacy)(t);default:return(0,r.NestableLegacy)(t)}})();if(u)return u.decode(a)},encode(a){switch(a.__TYPE__){case o.UIDContentType:return(0,o.UIDLegacy)(t).encode(a);case n.GroupContentType:return(0,n.GroupLegacy)(t).encode(a);case i.SlicesContentType:return(0,i.SlicesLegacy)(t).encode(a);default:return(0,r.NestableLegacy)(t).encode(a)}}});return K6.WidgetLegacy=u,K6}(),t)}(qS)),qS}Object.defineProperty(em,"__esModule",{value:!0}),em.migrateDocument=em.collectWidgets=em.traverseDocument=em.fillDocumentWithDefaultValues=em.DocumentLegacy=em.Document=void 0;let K7=eh,He=(0,K7.__importStar)(zy),Ht=K8();em.Document=He.record(zb.WidgetKey,Ht.WidgetContent);let Hn=He.record(zb.WidgetKey,He.unknown),Hr=t=>new He.Type("Document",t=>!!t&&"object"==typeof t,n=>(0,Ff.pipe)(Hn.decode(n),Fu.either.map(n=>Object.entries(n).reduce((n,[r,i])=>{let o=(0,qC.defaultCtx)(r,t),a=(0,Ht.WidgetLegacy)(o).decode(i);return!a||(0,Fs.isLeft)(a)?n:{...n,[r]:a.right}},{}))),n=>Object.entries(n).reduce((n,[r,i])=>{let o=(0,qC.defaultCtx)(r,t),a=(0,Ht.WidgetLegacy)(o).encode(i);return a?{content:{...n.content,[r]:a.content},types:{...n.types,...a.types}}:n},{content:{},types:{}}));function Hi(t){let n=Object.entries(t),{types:r,widgets:i}=n.reduce((t,[n,r])=>{if(n.endsWith("_TYPE")){let i=qC.FieldOrSliceType.decode(r);if((0,Fs.isRight)(i))return{...t,types:t.types.set(n.substring(0,n.length-5),i.right)}}return n.endsWith("_POSITION")||n.endsWith("_TYPE")?t:{...t,widgets:{...t.widgets,[n]:r}}},{types:new Map,widgets:{}}),o=t.slugs_INTERNAL||[],a=t.uid;return{widgets:i,types:r,uid:a,slugs:o}}function Ho(t){return{customTypeId:null==t?void 0:t.id,fields:Object.fromEntries((0,Vl.flattenSections)(t))}}function Ha({document:t,customType:n}){let r=n&&Vl.StaticCustomType.is(n)?Ho(n):n;return({transformWidget:n=({content:t})=>t,transformSlice:i=({content:t})=>t})=>{let o=r&&Object.entries(r.fields).reduce((t,[n,r])=>({...t,[n]:r}),{});return Object.entries(t).reduce((t,[a,u])=>{let s=o&&o[a],c=zv.ContentPath.make([{key:null==r?void 0:r.customTypeId,type:"CustomType"},{key:a,type:"Widget"}]),l=(()=>{switch(u.__TYPE__){case"SliceContentType":return(0,Ht.traverseSlices)({path:c,key:a,model:(null==s?void 0:s.type)==="Slices"||(null==s?void 0:s.type)==="Choice"?s:void 0,content:u})({transformWidget:n,transformSlice:i});case"GroupContentType":return(0,Ht.traverseGroupContent)({path:c,key:a,apiId:a,model:(null==s?void 0:s.type)==="Group"?s:void 0,content:u})(n);default:return n({path:c,key:a,apiId:a,model:(null==s?void 0:s.type)!=="Group"&&(null==s?void 0:s.type)!=="Slices"&&(null==s?void 0:s.type)!=="Choice"?s:void 0,content:u})}})();return{...t,...l?{[a]:l}:{}}},{})}}function Hu(t,n){let r=Vl.StaticCustomType.is(n)?Ho(n):n;return Object.values((0,Vl.collectSharedSlices)(r)).some(t=>Boolean(t.legacyPaths))?Ha({document:t,customType:n})({transformSlice:Ht.migrateSliceItem}):t}em.DocumentLegacy={_codec:Hr,extractMetadata:Hi,parse:function(t,n){let r=(0,Ff.pipe)(He.record(zb.WidgetKey,He.unknown).decode(t),Fu.either.chain(t=>{let{types:n,widgets:r}=Hi(t);return Hr(n).decode(r)}));return(0,Fs.isLeft)(r)?void 0:Hu(r.right,n)},encode:function(t){let n=Hr().encode(t);return{...n.content,...n.types}}},em.fillDocumentWithDefaultValues=function(t,n){let{fields:r}=t&&Vl.StaticCustomType.is(t)?Ho(t):t;return Object.entries(r).reduce((t,[r,i])=>{let o=n[r],a=(()=>{switch(i.type){case"Group":return(0,Ht.isGroupContent)(o)?(0,Ht.groupContentWithDefaultValues)(i,o):o;case"Choice":case"Slices":return(0,Ht.isSlicesContent)(o)?(0,Ht.slicesContentWithDefaultValues)(i,o):o;default:return void 0===o&&Vl.NestableWidget.is(i)?(0,Ht.NestableContentDefaultValue)(i):o}})();return a?{...t,[r]:a}:t},n)},em.traverseDocument=Ha,em.collectWidgets=function(t,n){let r={};return Ha({document:t})({transformWidget({content:t,path:i}){let o=zv.ContentPath.serialize(i);return n(t,i)&&(r[o]=t),t}}),r},em.migrateDocument=Hu,function(t){Object.defineProperty(t,"__esModule",{value:!0});let n=eh;(0,n.__exportStar)(em,t),(0,n.__exportStar)(K8(),t),(0,n.__exportStar)(qC,t)}(ep);let Hs=(0,c.createContext)({update(){}});function Hc(t){var n;return(null==(n=t.config)?void 0:n.label)??("Boolean"===t.type||"Separator"===t.type?void 0:t.fieldset)??t.type}function Hl(t,n){var r,i,o;return"Boolean"===t.type?(n?null==(r=t.config)?void 0:r.placeholder_true:null==(i=t.config)?void 0:i.placeholder_false)??"...":(null==(o=t.config)?void 0:o.placeholder)??"..."}function Hf(t){var n;let{content:r,field:i,id:o,onContentChange:a,readOnly:u}=t,s=(null==r?void 0:r.value)??(null==(n=i.config)?void 0:n.default_value)??!1;return R.jsxs(f.gN,{children:[R.jsx(f.fw,{name:"toggleOff"}),R.jsx(f.Qy,{htmlFor:o,children:Hc(i)}),R.jsxs(f.JO,{children:[R.jsx(f.xu,{padding:4,alignItems:"center",children:R.jsx(f.xv,{children:Hl(i,s)})}),R.jsx(f.rs,{checked:s,id:o,onCheckedChange(t){var n;u||a((n=t,{__TYPE__:"BooleanContent",value:n}))}})]})]})}function Hd(t){let{id:n,field:r,content:i,onContentChange:o}=t;return R.jsxs(f.gN,{children:[R.jsx(f.fw,{name:"colorLens"}),R.jsx(f.Qy,{id:n,children:Hc(r)}),R.jsx(f.JO,{children:R.jsx(f.xu,{padding:{left:4},alignItems:"center",children:R.jsx(f.TC,{onValueChange(t){var n;return o((n=t,void 0===n?void 0:{__TYPE__:"FieldContent",type:"Color",value:n}))},value:null==i?void 0:i.value,"aria-labelledby":n,placeholder:Hl(r)})})})]})}function Hp(t){let{id:n,readOnly:r,field:i,content:o,onContentChange:a}=t,u=null!=o&&o.value?(0,p._O)(o.value):void 0;return R.jsxs(f.gN,{children:[R.jsx(f.fw,{name:"dateRange"}),R.jsx(f.Qy,{id:n,children:Hc(i)}),R.jsx(f.JO,{children:R.jsx(f.xu,{padding:{left:4,right:12},width:"100%",flexDirection:"column",justifyContent:"center",children:R.jsx(f.Wr,{mode:"date","aria-labelledby":n,readOnly:r,value:u,onValueChange:t=>a(function(t){if(t)return{__TYPE__:"FieldContent",type:"Date",value:function(t){let n=`${t.getFullYear()}`.padStart(4,"0"),r=`${t.getMonth()+1}`.padStart(2,"0"),i=`${t.getDate()}`.padStart(2,"0");return`${n}-${r}-${i}`}(t)}}(t))})})})]})}(en$=o||(o={})).assertEqual=t=>t,en$.assertIs=function(t){},en$.assertNever=function(t){throw Error()},en$.arrayToEnum=t=>{let n={};for(let r of t)n[r]=r;return n},en$.getValidEnumValues=t=>{let n=en$.objectKeys(t).filter(n=>"number"!=typeof t[t[n]]),r={};for(let i of n)r[i]=t[i];return en$.objectValues(r)},en$.objectValues=t=>en$.objectKeys(t).map(function(n){return t[n]}),en$.objectKeys="function"==typeof Object.keys?t=>Object.keys(t):t=>{let n=[];for(let r in t)Object.prototype.hasOwnProperty.call(t,r)&&n.push(r);return n},en$.find=(t,n)=>{for(let r of t)if(n(r))return r},en$.isInteger="function"==typeof Number.isInteger?t=>Number.isInteger(t):t=>"number"==typeof t&&isFinite(t)&&Math.floor(t)===t,en$.joinValues=function(t,n=" | "){return t.map(t=>"string"==typeof t?`'${t}'`:t).join(n)},en$.jsonStringifyReplacer=(t,n)=>"bigint"==typeof n?n.toString():n,(enq=a||(a={})).mergeShapes=(t,n)=>({...t,...n});let Hh=o.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Hm=t=>{switch(typeof t){case"undefined":return Hh.undefined;case"string":return Hh.string;case"number":return isNaN(t)?Hh.nan:Hh.number;case"boolean":return Hh.boolean;case"function":return Hh.function;case"bigint":return Hh.bigint;case"symbol":return Hh.symbol;case"object":return Array.isArray(t)?Hh.array:null===t?Hh.null:t.then&&"function"==typeof t.then&&t.catch&&"function"==typeof t.catch?Hh.promise:"u">typeof Map&&t instanceof Map?Hh.map:"u">typeof Set&&t instanceof Set?Hh.set:"u">typeof Date&&t instanceof Date?Hh.date:Hh.object;default:return Hh.unknown}},Hg=o.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),Hy=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:");class Hv extends Error{constructor(t){super(),this.issues=[],this.addIssue=t=>{this.issues=[...this.issues,t]},this.addIssues=(t=[])=>{this.issues=[...this.issues,...t]};let n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=t}get errors(){return this.issues}format(t){let n=t||function(t){return t.message},r={_errors:[]},i=t=>{for(let o of t.issues)if("invalid_union"===o.code)o.unionErrors.map(i);else if("invalid_return_type"===o.code)i(o.returnTypeError);else if("invalid_arguments"===o.code)i(o.argumentsError);else if(0===o.path.length)r._errors.push(n(o));else{let a=r,u=0;for(;u<o.path.length;){let s=o.path[u];u===o.path.length-1?(a[s]=a[s]||{_errors:[]},a[s]._errors.push(n(o))):a[s]=a[s]||{_errors:[]},a=a[s],u++}}};return i(this),r}toString(){return this.message}get message(){return JSON.stringify(this.issues,o.jsonStringifyReplacer,2)}get isEmpty(){return 0===this.issues.length}flatten(t=t=>t.message){let n={},r=[];for(let i of this.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}Hv.create=t=>new Hv(t);let Hb=(t,n)=>{let r;switch(t.code){case Hg.invalid_type:r=t.received===Hh.undefined?"Required":`Expected ${t.expected}, received ${t.received}`;break;case Hg.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,o.jsonStringifyReplacer)}`;break;case Hg.unrecognized_keys:r=`Unrecognized key(s) in object: ${o.joinValues(t.keys,", ")}`;break;case Hg.invalid_union:r="Invalid input";break;case Hg.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${o.joinValues(t.options)}`;break;case Hg.invalid_enum_value:r=`Invalid enum value. Expected ${o.joinValues(t.options)}, received '${t.received}'`;break;case Hg.invalid_arguments:r="Invalid function arguments";break;case Hg.invalid_return_type:r="Invalid function return type";break;case Hg.invalid_date:r="Invalid date";break;case Hg.invalid_string:"object"==typeof t.validation?"includes"in t.validation?(r=`Invalid input: must include "${t.validation.includes}"`,"number"==typeof t.validation.position&&(r=`${r} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?r=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?r=`Invalid input: must end with "${t.validation.endsWith}"`:o.assertNever(t.validation):r="regex"!==t.validation?`Invalid ${t.validation}`:"Invalid";break;case Hg.too_small:r="array"===t.type?`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:"string"===t.type?`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:"number"===t.type?`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:"date"===t.type?`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:"Invalid input";break;case Hg.too_big:r="array"===t.type?`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:"string"===t.type?`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:"number"===t.type?`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:"bigint"===t.type?`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:"date"===t.type?`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:"Invalid input";break;case Hg.custom:r="Invalid input";break;case Hg.invalid_intersection_types:r="Intersection results could not be merged";break;case Hg.not_multiple_of:r=`Number must be a multiple of ${t.multipleOf}`;break;case Hg.not_finite:r="Number must be finite";break;default:r=n.defaultError,o.assertNever(t)}return{message:r}},Hx=Hb;function H_(t){Hx=t}function HS(){return Hx}let HT=t=>{let{data:n,path:r,errorMaps:i,issueData:o}=t,a=[...r,...o.path||[]],u={...o,path:a},s="",c=i.filter(t=>!!t).slice().reverse();for(let l of c)s=l(u,{data:n,defaultError:s}).message;return{...o,path:a,message:o.message||s}};function Hw(t,n){let r=HT({issueData:n,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Hx,Hb].filter(t=>!!t)});t.common.issues.push(r)}class HO{constructor(){this.value="valid"}dirty(){"valid"===this.value&&(this.value="dirty")}abort(){"aborted"!==this.value&&(this.value="aborted")}static mergeArray(t,n){let r=[];for(let i of n){if("aborted"===i.status)return Hk;"dirty"===i.status&&t.dirty(),r.push(i.value)}return{status:t.value,value:r}}static async mergeObjectAsync(t,n){let r=[];for(let i of n)r.push({key:await i.key,value:await i.value});return HO.mergeObjectSync(t,r)}static mergeObjectSync(t,n){let r={};for(let i of n){let{key:o,value:a}=i;if("aborted"===o.status||"aborted"===a.status)return Hk;"dirty"===o.status&&t.dirty(),"dirty"===a.status&&t.dirty(),("u">typeof a.value||i.alwaysSet)&&(r[o.value]=a.value)}return{status:t.value,value:r}}}let Hk=Object.freeze({status:"aborted"}),HI=t=>({status:"dirty",value:t}),HC=t=>({status:"valid",value:t}),HM=t=>"aborted"===t.status,HR=t=>"dirty"===t.status,HE=t=>"valid"===t.status,Hj=t=>"u">typeof Promise&&t instanceof Promise;(enK=u||(u={})).errToObj=t=>"string"==typeof t?{message:t}:t||{},enK.toString=t=>"string"==typeof t?t:null==t?void 0:t.message;class HN{constructor(t,n,r,i){this._cachedPath=[],this.parent=t,this.data=n,this._path=r,this._key=i}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}let HA=(t,n)=>{if(HE(n))return{success:!0,data:n.value};if(!t.common.issues.length)throw Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new Hv(t.common.issues);return this._error=r,this._error}}};function HP(t){if(!t)return{};let{errorMap:n,invalid_type_error:r,required_error:i,description:o}=t;if(n&&(r||i))throw Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');return n?{errorMap:n,description:o}:{errorMap:(t,n)=>"invalid_type"!==t.code?{message:n.defaultError}:typeof n.data>"u"?{message:i??n.defaultError}:{message:r??n.defaultError},description:o}}class HL{constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(t){return Hm(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:Hm(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new HO,ctx:{common:t.parent.common,data:t.data,parsedType:Hm(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){let n=this._parse(t);if(Hj(n))throw Error("Synchronous parse encountered promise.");return n}_parseAsync(t){let n=this._parse(t);return Promise.resolve(n)}parse(t,n){let r=this.safeParse(t,n);if(r.success)return r.data;throw r.error}safeParse(t,n){var r;let i={common:{issues:[],async:null!==(r=null==n?void 0:n.async)&&void 0!==r&&r,contextualErrorMap:null==n?void 0:n.errorMap},path:(null==n?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Hm(t)},o=this._parseSync({data:t,path:i.path,parent:i});return HA(i,o)}async parseAsync(t,n){let r=await this.safeParseAsync(t,n);if(r.success)return r.data;throw r.error}async safeParseAsync(t,n){let r={common:{issues:[],contextualErrorMap:null==n?void 0:n.errorMap,async:!0},path:(null==n?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Hm(t)},i=this._parse({data:t,path:r.path,parent:r}),o=await (Hj(i)?i:Promise.resolve(i));return HA(r,o)}refine(t,n){let r=t=>"string"==typeof n||typeof n>"u"?{message:n}:"function"==typeof n?n(t):n;return this._refinement((n,i)=>{let o=t(n),a=()=>i.addIssue({code:Hg.custom,...r(n)});return"u">typeof Promise&&o instanceof Promise?o.then(t=>!!t||(a(),!1)):!!o||(a(),!1)})}refinement(t,n){return this._refinement((r,i)=>!!t(r)||(i.addIssue("function"==typeof n?n(r,i):n),!1))}_refinement(t){return new Gp({schema:this,typeName:s.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}optional(){return Gh.create(this,this._def)}nullable(){return Gm.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return H9.create(this,this._def)}promise(){return Gd.create(this,this._def)}or(t){return H8.create([this,t],this._def)}and(t){return Gt.create(this,t,this._def)}transform(t){return new Gp({...HP(this._def),schema:this,typeName:s.ZodEffects,effect:{type:"transform",transform:t}})}default(t){return new Gg({...HP(this._def),innerType:this,defaultValue:"function"==typeof t?t:()=>t,typeName:s.ZodDefault})}brand(){return new Gx({typeName:s.ZodBranded,type:this,...HP(this._def)})}catch(t){return new Gy({...HP(this._def),innerType:this,catchValue:"function"==typeof t?t:()=>t,typeName:s.ZodCatch})}describe(t){let n=this.constructor;return new n({...this._def,description:t})}pipe(t){return G_.create(this,t)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}let HD=/^c[^\s-]{8,}$/i,HF=/^[a-z][a-z0-9]*$/,HW=/[0-9A-HJKMNP-TV-Z]{26}/,HU=/^([a-f0-9]{8}-[a-f0-9]{4}-[1-5][a-f0-9]{3}-[a-f0-9]{4}-[a-f0-9]{12}|00000000-0000-0000-0000-000000000000)$/i,Hz=/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\])|(\[IPv6:(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))\])|([A-Za-z0-9]([A-Za-z0-9-]*[A-Za-z0-9])*(\.[A-Za-z]{2,})+))$/,HB=/^(\p{Extended_Pictographic}|\p{Emoji_Component})+$/u,HV=/^(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))$/,H$=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,Hq=t=>t.precision?t.offset?RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${t.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`):RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${t.precision}}Z$`):0===t.precision?t.offset?RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$"):RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"):t.offset?RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$"):RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$");function HK(t,n){return!!(("v4"===n||!n)&&HV.test(t)||("v6"===n||!n)&&H$.test(t))}class HH extends HL{constructor(){super(...arguments),this._regex=(t,n,r)=>this.refinement(n=>t.test(n),{validation:n,code:Hg.invalid_string,...u.errToObj(r)}),this.nonempty=t=>this.min(1,u.errToObj(t)),this.trim=()=>new HH({...this._def,checks:[...this._def.checks,{kind:"trim"}]}),this.toLowerCase=()=>new HH({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]}),this.toUpperCase=()=>new HH({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==Hh.string){let n=this._getOrReturnCtx(t);return Hw(n,{code:Hg.invalid_type,expected:Hh.string,received:n.parsedType}),Hk}let r=new HO,i;for(let a of this._def.checks)if("min"===a.kind)t.data.length<a.value&&(Hw(i=this._getOrReturnCtx(t,i),{code:Hg.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),r.dirty());else if("max"===a.kind)t.data.length>a.value&&(Hw(i=this._getOrReturnCtx(t,i),{code:Hg.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),r.dirty());else if("length"===a.kind){let u=t.data.length>a.value,s=t.data.length<a.value;(u||s)&&(i=this._getOrReturnCtx(t,i),u?Hw(i,{code:Hg.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}):s&&Hw(i,{code:Hg.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}),r.dirty())}else if("email"===a.kind)Hz.test(t.data)||(Hw(i=this._getOrReturnCtx(t,i),{validation:"email",code:Hg.invalid_string,message:a.message}),r.dirty());else if("emoji"===a.kind)HB.test(t.data)||(Hw(i=this._getOrReturnCtx(t,i),{validation:"emoji",code:Hg.invalid_string,message:a.message}),r.dirty());else if("uuid"===a.kind)HU.test(t.data)||(Hw(i=this._getOrReturnCtx(t,i),{validation:"uuid",code:Hg.invalid_string,message:a.message}),r.dirty());else if("cuid"===a.kind)HD.test(t.data)||(Hw(i=this._getOrReturnCtx(t,i),{validation:"cuid",code:Hg.invalid_string,message:a.message}),r.dirty());else if("cuid2"===a.kind)HF.test(t.data)||(Hw(i=this._getOrReturnCtx(t,i),{validation:"cuid2",code:Hg.invalid_string,message:a.message}),r.dirty());else if("ulid"===a.kind)HW.test(t.data)||(Hw(i=this._getOrReturnCtx(t,i),{validation:"ulid",code:Hg.invalid_string,message:a.message}),r.dirty());else if("url"===a.kind)try{new URL(t.data)}catch{Hw(i=this._getOrReturnCtx(t,i),{validation:"url",code:Hg.invalid_string,message:a.message}),r.dirty()}else"regex"===a.kind?(a.regex.lastIndex=0,a.regex.test(t.data)||(Hw(i=this._getOrReturnCtx(t,i),{validation:"regex",code:Hg.invalid_string,message:a.message}),r.dirty())):"trim"===a.kind?t.data=t.data.trim():"includes"===a.kind?t.data.includes(a.value,a.position)||(Hw(i=this._getOrReturnCtx(t,i),{code:Hg.invalid_string,validation:{includes:a.value,position:a.position},message:a.message}),r.dirty()):"toLowerCase"===a.kind?t.data=t.data.toLowerCase():"toUpperCase"===a.kind?t.data=t.data.toUpperCase():"startsWith"===a.kind?t.data.startsWith(a.value)||(Hw(i=this._getOrReturnCtx(t,i),{code:Hg.invalid_string,validation:{startsWith:a.value},message:a.message}),r.dirty()):"endsWith"===a.kind?t.data.endsWith(a.value)||(Hw(i=this._getOrReturnCtx(t,i),{code:Hg.invalid_string,validation:{endsWith:a.value},message:a.message}),r.dirty()):"datetime"===a.kind?Hq(a).test(t.data)||(Hw(i=this._getOrReturnCtx(t,i),{code:Hg.invalid_string,validation:"datetime",message:a.message}),r.dirty()):"ip"===a.kind?HK(t.data,a.version)||(Hw(i=this._getOrReturnCtx(t,i),{validation:"ip",code:Hg.invalid_string,message:a.message}),r.dirty()):o.assertNever(a);return{status:r.value,value:t.data}}_addCheck(t){return new HH({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...u.errToObj(t)})}url(t){return this._addCheck({kind:"url",...u.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...u.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...u.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...u.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...u.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...u.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...u.errToObj(t)})}datetime(t){var n;return"string"==typeof t?this._addCheck({kind:"datetime",precision:null,offset:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof(null==t?void 0:t.precision)>"u"?null:null==t?void 0:t.precision,offset:null!==(n=null==t?void 0:t.offset)&&void 0!==n&&n,...u.errToObj(null==t?void 0:t.message)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...u.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:null==n?void 0:n.position,...u.errToObj(null==n?void 0:n.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...u.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...u.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...u.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...u.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...u.errToObj(n)})}get isDatetime(){return!!this._def.checks.find(t=>"datetime"===t.kind)}get isEmail(){return!!this._def.checks.find(t=>"email"===t.kind)}get isURL(){return!!this._def.checks.find(t=>"url"===t.kind)}get isEmoji(){return!!this._def.checks.find(t=>"emoji"===t.kind)}get isUUID(){return!!this._def.checks.find(t=>"uuid"===t.kind)}get isCUID(){return!!this._def.checks.find(t=>"cuid"===t.kind)}get isCUID2(){return!!this._def.checks.find(t=>"cuid2"===t.kind)}get isULID(){return!!this._def.checks.find(t=>"ulid"===t.kind)}get isIP(){return!!this._def.checks.find(t=>"ip"===t.kind)}get minLength(){let t=null;for(let n of this._def.checks)"min"===n.kind&&(null===t||n.value>t)&&(t=n.value);return t}get maxLength(){let t=null;for(let n of this._def.checks)"max"===n.kind&&(null===t||n.value<t)&&(t=n.value);return t}}function HG(t,n){let r=(t.toString().split(".")[1]||"").length,i=(n.toString().split(".")[1]||"").length,o=r>i?r:i,a=parseInt(t.toFixed(o).replace(".","")),u=parseInt(n.toFixed(o).replace(".",""));return a%u/Math.pow(10,o)}HH.create=t=>{var n;return new HH({checks:[],typeName:s.ZodString,coerce:null!==(n=null==t?void 0:t.coerce)&&void 0!==n&&n,...HP(t)})};class HZ extends HL{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==Hh.number){let n=this._getOrReturnCtx(t);return Hw(n,{code:Hg.invalid_type,expected:Hh.number,received:n.parsedType}),Hk}let r,i=new HO;for(let a of this._def.checks)"int"===a.kind?o.isInteger(t.data)||(Hw(r=this._getOrReturnCtx(t,r),{code:Hg.invalid_type,expected:"integer",received:"float",message:a.message}),i.dirty()):"min"===a.kind?(a.inclusive?t.data<a.value:t.data<=a.value)&&(Hw(r=this._getOrReturnCtx(t,r),{code:Hg.too_small,minimum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),i.dirty()):"max"===a.kind?(a.inclusive?t.data>a.value:t.data>=a.value)&&(Hw(r=this._getOrReturnCtx(t,r),{code:Hg.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),i.dirty()):"multipleOf"===a.kind?0!==HG(t.data,a.value)&&(Hw(r=this._getOrReturnCtx(t,r),{code:Hg.not_multiple_of,multipleOf:a.value,message:a.message}),i.dirty()):"finite"===a.kind?Number.isFinite(t.data)||(Hw(r=this._getOrReturnCtx(t,r),{code:Hg.not_finite,message:a.message}),i.dirty()):o.assertNever(a);return{status:i.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,u.toString(n))}gt(t,n){return this.setLimit("min",t,!1,u.toString(n))}lte(t,n){return this.setLimit("max",t,!0,u.toString(n))}lt(t,n){return this.setLimit("max",t,!1,u.toString(n))}setLimit(t,n,r,i){return new HZ({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:u.toString(i)}]})}_addCheck(t){return new HZ({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:u.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:u.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:u.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:u.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:u.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:u.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:u.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:u.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:u.toString(t)})}get minValue(){let t=null;for(let n of this._def.checks)"min"===n.kind&&(null===t||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(let n of this._def.checks)"max"===n.kind&&(null===t||n.value<t)&&(t=n.value);return t}get isInt(){return!!this._def.checks.find(t=>"int"===t.kind||"multipleOf"===t.kind&&o.isInteger(t.value))}get isFinite(){let t=null,n=null;for(let r of this._def.checks){if("finite"===r.kind||"int"===r.kind||"multipleOf"===r.kind)return!0;"min"===r.kind?(null===n||r.value>n)&&(n=r.value):"max"===r.kind&&(null===t||r.value<t)&&(t=r.value)}return Number.isFinite(n)&&Number.isFinite(t)}}HZ.create=t=>new HZ({checks:[],typeName:s.ZodNumber,coerce:(null==t?void 0:t.coerce)||!1,...HP(t)});class HY extends HL{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce&&(t.data=BigInt(t.data)),this._getType(t)!==Hh.bigint){let n=this._getOrReturnCtx(t);return Hw(n,{code:Hg.invalid_type,expected:Hh.bigint,received:n.parsedType}),Hk}let r,i=new HO;for(let a of this._def.checks)"min"===a.kind?(a.inclusive?t.data<a.value:t.data<=a.value)&&(Hw(r=this._getOrReturnCtx(t,r),{code:Hg.too_small,type:"bigint",minimum:a.value,inclusive:a.inclusive,message:a.message}),i.dirty()):"max"===a.kind?(a.inclusive?t.data>a.value:t.data>=a.value)&&(Hw(r=this._getOrReturnCtx(t,r),{code:Hg.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),i.dirty()):"multipleOf"===a.kind?t.data%a.value!==BigInt(0)&&(Hw(r=this._getOrReturnCtx(t,r),{code:Hg.not_multiple_of,multipleOf:a.value,message:a.message}),i.dirty()):o.assertNever(a);return{status:i.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,u.toString(n))}gt(t,n){return this.setLimit("min",t,!1,u.toString(n))}lte(t,n){return this.setLimit("max",t,!0,u.toString(n))}lt(t,n){return this.setLimit("max",t,!1,u.toString(n))}setLimit(t,n,r,i){return new HY({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:u.toString(i)}]})}_addCheck(t){return new HY({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:u.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:u.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:u.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:u.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:u.toString(n)})}get minValue(){let t=null;for(let n of this._def.checks)"min"===n.kind&&(null===t||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(let n of this._def.checks)"max"===n.kind&&(null===t||n.value<t)&&(t=n.value);return t}}HY.create=t=>{var n;return new HY({checks:[],typeName:s.ZodBigInt,coerce:null!==(n=null==t?void 0:t.coerce)&&void 0!==n&&n,...HP(t)})};class HJ extends HL{_parse(t){if(this._def.coerce&&(t.data=Boolean(t.data)),this._getType(t)!==Hh.boolean){let n=this._getOrReturnCtx(t);return Hw(n,{code:Hg.invalid_type,expected:Hh.boolean,received:n.parsedType}),Hk}return HC(t.data)}}HJ.create=t=>new HJ({typeName:s.ZodBoolean,coerce:(null==t?void 0:t.coerce)||!1,...HP(t)});class HQ extends HL{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==Hh.date){let n=this._getOrReturnCtx(t);return Hw(n,{code:Hg.invalid_type,expected:Hh.date,received:n.parsedType}),Hk}if(isNaN(t.data.getTime())){let r=this._getOrReturnCtx(t);return Hw(r,{code:Hg.invalid_date}),Hk}let i=new HO,a;for(let u of this._def.checks)"min"===u.kind?t.data.getTime()<u.value&&(Hw(a=this._getOrReturnCtx(t,a),{code:Hg.too_small,message:u.message,inclusive:!0,exact:!1,minimum:u.value,type:"date"}),i.dirty()):"max"===u.kind?t.data.getTime()>u.value&&(Hw(a=this._getOrReturnCtx(t,a),{code:Hg.too_big,message:u.message,inclusive:!0,exact:!1,maximum:u.value,type:"date"}),i.dirty()):o.assertNever(u);return{status:i.value,value:new Date(t.data.getTime())}}_addCheck(t){return new HQ({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:u.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:u.toString(n)})}get minDate(){let t=null;for(let n of this._def.checks)"min"===n.kind&&(null===t||n.value>t)&&(t=n.value);return null!=t?new Date(t):null}get maxDate(){let t=null;for(let n of this._def.checks)"max"===n.kind&&(null===t||n.value<t)&&(t=n.value);return null!=t?new Date(t):null}}HQ.create=t=>new HQ({checks:[],coerce:(null==t?void 0:t.coerce)||!1,typeName:s.ZodDate,...HP(t)});class HX extends HL{_parse(t){if(this._getType(t)!==Hh.symbol){let n=this._getOrReturnCtx(t);return Hw(n,{code:Hg.invalid_type,expected:Hh.symbol,received:n.parsedType}),Hk}return HC(t.data)}}HX.create=t=>new HX({typeName:s.ZodSymbol,...HP(t)});class H0 extends HL{_parse(t){if(this._getType(t)!==Hh.undefined){let n=this._getOrReturnCtx(t);return Hw(n,{code:Hg.invalid_type,expected:Hh.undefined,received:n.parsedType}),Hk}return HC(t.data)}}H0.create=t=>new H0({typeName:s.ZodUndefined,...HP(t)});class H1 extends HL{_parse(t){if(this._getType(t)!==Hh.null){let n=this._getOrReturnCtx(t);return Hw(n,{code:Hg.invalid_type,expected:Hh.null,received:n.parsedType}),Hk}return HC(t.data)}}H1.create=t=>new H1({typeName:s.ZodNull,...HP(t)});class H2 extends HL{constructor(){super(...arguments),this._any=!0}_parse(t){return HC(t.data)}}H2.create=t=>new H2({typeName:s.ZodAny,...HP(t)});class H3 extends HL{constructor(){super(...arguments),this._unknown=!0}_parse(t){return HC(t.data)}}H3.create=t=>new H3({typeName:s.ZodUnknown,...HP(t)});class H4 extends HL{_parse(t){let n=this._getOrReturnCtx(t);return Hw(n,{code:Hg.invalid_type,expected:Hh.never,received:n.parsedType}),Hk}}H4.create=t=>new H4({typeName:s.ZodNever,...HP(t)});class H5 extends HL{_parse(t){if(this._getType(t)!==Hh.undefined){let n=this._getOrReturnCtx(t);return Hw(n,{code:Hg.invalid_type,expected:Hh.void,received:n.parsedType}),Hk}return HC(t.data)}}H5.create=t=>new H5({typeName:s.ZodVoid,...HP(t)});class H9 extends HL{_parse(t){let{ctx:n,status:r}=this._processInputParams(t),i=this._def;if(n.parsedType!==Hh.array)return Hw(n,{code:Hg.invalid_type,expected:Hh.array,received:n.parsedType}),Hk;if(null!==i.exactLength){let o=n.data.length>i.exactLength.value,a=n.data.length<i.exactLength.value;(o||a)&&(Hw(n,{code:o?Hg.too_big:Hg.too_small,minimum:a?i.exactLength.value:void 0,maximum:o?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),r.dirty())}if(null!==i.minLength&&n.data.length<i.minLength.value&&(Hw(n,{code:Hg.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),r.dirty()),null!==i.maxLength&&n.data.length>i.maxLength.value&&(Hw(n,{code:Hg.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((t,r)=>i.type._parseAsync(new HN(n,t,n.path,r)))).then(t=>HO.mergeArray(r,t));let u=[...n.data].map((t,r)=>i.type._parseSync(new HN(n,t,n.path,r)));return HO.mergeArray(r,u)}get element(){return this._def.type}min(t,n){return new H9({...this._def,minLength:{value:t,message:u.toString(n)}})}max(t,n){return new H9({...this._def,maxLength:{value:t,message:u.toString(n)}})}length(t,n){return new H9({...this._def,exactLength:{value:t,message:u.toString(n)}})}nonempty(t){return this.min(1,t)}}H9.create=(t,n)=>new H9({type:t,minLength:null,maxLength:null,exactLength:null,typeName:s.ZodArray,...HP(n)});class H6 extends HL{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(null!==this._cached)return this._cached;let t=this._def.shape(),n=o.objectKeys(t);return this._cached={shape:t,keys:n}}_parse(t){if(this._getType(t)!==Hh.object){let n=this._getOrReturnCtx(t);return Hw(n,{code:Hg.invalid_type,expected:Hh.object,received:n.parsedType}),Hk}let{status:r,ctx:i}=this._processInputParams(t),{shape:o,keys:a}=this._getCached(),u=[];if(!(this._def.catchall instanceof H4&&"strip"===this._def.unknownKeys))for(let s in i.data)a.includes(s)||u.push(s);let c=[];for(let l of a){let f=o[l],d=i.data[l];c.push({key:{status:"valid",value:l},value:f._parse(new HN(i,d,i.path,l)),alwaysSet:l in i.data})}if(this._def.catchall instanceof H4){let p=this._def.unknownKeys;if("passthrough"===p)for(let h of u)c.push({key:{status:"valid",value:h},value:{status:"valid",value:i.data[h]}});else if("strict"===p)u.length>0&&(Hw(i,{code:Hg.unrecognized_keys,keys:u}),r.dirty());else if("strip"!==p)throw Error("Internal ZodObject error: invalid unknownKeys value.")}else{let m=this._def.catchall;for(let g of u){let y=i.data[g];c.push({key:{status:"valid",value:g},value:m._parse(new HN(i,y,i.path,g)),alwaysSet:g in i.data})}}return i.common.async?Promise.resolve().then(async()=>{let t=[];for(let n of c){let r=await n.key;t.push({key:r,value:await n.value,alwaysSet:n.alwaysSet})}return t}).then(t=>HO.mergeObjectSync(r,t)):HO.mergeObjectSync(r,c)}get shape(){return this._def.shape()}strict(t){return u.errToObj,new H6({...this._def,unknownKeys:"strict",...void 0!==t?{errorMap:(n,r)=>{var i,o,a,s;let c=null!==(a=null===(o=(i=this._def).errorMap)||void 0===o?void 0:o.call(i,n,r).message)&&void 0!==a?a:r.defaultError;return"unrecognized_keys"===n.code?{message:null!==(s=u.errToObj(t).message)&&void 0!==s?s:c}:{message:c}}}:{}})}strip(){return new H6({...this._def,unknownKeys:"strip"})}passthrough(){return new H6({...this._def,unknownKeys:"passthrough"})}extend(t){return new H6({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new H6({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:s.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new H6({...this._def,catchall:t})}pick(t){let n={};return o.objectKeys(t).forEach(r=>{t[r]&&this.shape[r]&&(n[r]=this.shape[r])}),new H6({...this._def,shape:()=>n})}omit(t){let n={};return o.objectKeys(this.shape).forEach(r=>{t[r]||(n[r]=this.shape[r])}),new H6({...this._def,shape:()=>n})}deepPartial(){return function t(n){if(!(n instanceof H6))return n instanceof H9?new H9({...n._def,type:t(n.element)}):n instanceof Gh?Gh.create(t(n.unwrap())):n instanceof Gm?Gm.create(t(n.unwrap())):n instanceof Gn?Gn.create(n.items.map(n=>t(n))):n;{let r={};for(let i in n.shape){let o=n.shape[i];r[i]=Gh.create(t(o))}return new H6({...n._def,shape:()=>r})}}(this)}partial(t){let n={};return o.objectKeys(this.shape).forEach(r=>{let i=this.shape[r];t&&!t[r]?n[r]=i:n[r]=i.optional()}),new H6({...this._def,shape:()=>n})}required(t){let n={};return o.objectKeys(this.shape).forEach(r=>{if(t&&!t[r])n[r]=this.shape[r];else{let i=this.shape[r];for(;i instanceof Gh;)i=i._def.innerType;n[r]=i}}),new H6({...this._def,shape:()=>n})}keyof(){return Gc(o.objectKeys(this.shape))}}H6.create=(t,n)=>new H6({shape:()=>t,unknownKeys:"strip",catchall:H4.create(),typeName:s.ZodObject,...HP(n)}),H6.strictCreate=(t,n)=>new H6({shape:()=>t,unknownKeys:"strict",catchall:H4.create(),typeName:s.ZodObject,...HP(n)}),H6.lazycreate=(t,n)=>new H6({shape:t,unknownKeys:"strip",catchall:H4.create(),typeName:s.ZodObject,...HP(n)});class H8 extends HL{_parse(t){let{ctx:n}=this._processInputParams(t),r=this._def.options;if(n.common.async)return Promise.all(r.map(async t=>{let r={...n,common:{...n.common,issues:[]},parent:null};return{result:await t._parseAsync({data:n.data,path:n.path,parent:r}),ctx:r}})).then(function(t){for(let r of t)if("valid"===r.result.status)return r.result;for(let i of t)if("dirty"===i.result.status)return n.common.issues.push(...i.ctx.common.issues),i.result;let o=t.map(t=>new Hv(t.ctx.common.issues));return Hw(n,{code:Hg.invalid_union,unionErrors:o}),Hk});{let i,o=[];for(let a of r){let u={...n,common:{...n.common,issues:[]},parent:null},s=a._parseSync({data:n.data,path:n.path,parent:u});if("valid"===s.status)return s;"dirty"!==s.status||i||(i={result:s,ctx:u}),u.common.issues.length&&o.push(u.common.issues)}if(i)return n.common.issues.push(...i.ctx.common.issues),i.result;let c=o.map(t=>new Hv(t));return Hw(n,{code:Hg.invalid_union,unionErrors:c}),Hk}}get options(){return this._def.options}}H8.create=(t,n)=>new H8({options:t,typeName:s.ZodUnion,...HP(n)});let H7=t=>t instanceof Gu?H7(t.schema):t instanceof Gp?H7(t.innerType()):t instanceof Gs?[t.value]:t instanceof Gl?t.options:t instanceof Gf?Object.keys(t.enum):t instanceof Gg?H7(t._def.innerType):t instanceof H0?[void 0]:t instanceof H1?[null]:null;class Ge extends HL{_parse(t){let{ctx:n}=this._processInputParams(t);if(n.parsedType!==Hh.object)return Hw(n,{code:Hg.invalid_type,expected:Hh.object,received:n.parsedType}),Hk;let r=this.discriminator,i=n.data[r],o=this.optionsMap.get(i);return o?n.common.async?o._parseAsync({data:n.data,path:n.path,parent:n}):o._parseSync({data:n.data,path:n.path,parent:n}):(Hw(n,{code:Hg.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),Hk)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,r){let i=new Map;for(let o of n){let a=H7(o.shape[t]);if(!a)throw Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(let u of a){if(i.has(u))throw Error(`Discriminator property ${String(t)} has duplicate value ${String(u)}`);i.set(u,o)}}return new Ge({typeName:s.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:i,...HP(r)})}}class Gt extends HL{_parse(t){let{status:n,ctx:r}=this._processInputParams(t),i=(t,i)=>{if(HM(t)||HM(i))return Hk;let a=function t(n,r){let i=Hm(n),a=Hm(r);if(n===r)return{valid:!0,data:n};if(i===Hh.object&&a===Hh.object){let u=o.objectKeys(r),s=o.objectKeys(n).filter(t=>-1!==u.indexOf(t)),c={...n,...r};for(let l of s){let f=t(n[l],r[l]);if(!f.valid)return{valid:!1};c[l]=f.data}return{valid:!0,data:c}}if(i!==Hh.array||a!==Hh.array)return i===Hh.date&&a===Hh.date&&+n==+r?{valid:!0,data:n}:{valid:!1};{if(n.length!==r.length)return{valid:!1};let d=[];for(let p=0;p<n.length;p++){let h=n[p],m=r[p],g=t(h,m);if(!g.valid)return{valid:!1};d.push(g.data)}return{valid:!0,data:d}}}(t.value,i.value);return a.valid?((HR(t)||HR(i))&&n.dirty(),{status:n.value,value:a.data}):(Hw(r,{code:Hg.invalid_intersection_types}),Hk)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([t,n])=>i(t,n)):i(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}Gt.create=(t,n,r)=>new Gt({left:t,right:n,typeName:s.ZodIntersection,...HP(r)});class Gn extends HL{_parse(t){let{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==Hh.array)return Hw(r,{code:Hg.invalid_type,expected:Hh.array,received:r.parsedType}),Hk;if(r.data.length<this._def.items.length)return Hw(r,{code:Hg.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Hk;!this._def.rest&&r.data.length>this._def.items.length&&(Hw(r,{code:Hg.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());let i=[...r.data].map((t,n)=>{let i=this._def.items[n]||this._def.rest;return i?i._parse(new HN(r,t,r.path,n)):null}).filter(t=>!!t);return r.common.async?Promise.all(i).then(t=>HO.mergeArray(n,t)):HO.mergeArray(n,i)}get items(){return this._def.items}rest(t){return new Gn({...this._def,rest:t})}}Gn.create=(t,n)=>{if(!Array.isArray(t))throw Error("You must pass an array of schemas to z.tuple([ ... ])");return new Gn({items:t,typeName:s.ZodTuple,rest:null,...HP(n)})};class Gr extends HL{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==Hh.object)return Hw(r,{code:Hg.invalid_type,expected:Hh.object,received:r.parsedType}),Hk;let i=[],o=this._def.keyType,a=this._def.valueType;for(let u in r.data)i.push({key:o._parse(new HN(r,u,r.path,u)),value:a._parse(new HN(r,r.data[u],r.path,u))});return r.common.async?HO.mergeObjectAsync(n,i):HO.mergeObjectSync(n,i)}get element(){return this._def.valueType}static create(t,n,r){return new Gr(n instanceof HL?{keyType:t,valueType:n,typeName:s.ZodRecord,...HP(r)}:{keyType:HH.create(),valueType:t,typeName:s.ZodRecord,...HP(n)})}}class Gi extends HL{_parse(t){let{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==Hh.map)return Hw(r,{code:Hg.invalid_type,expected:Hh.map,received:r.parsedType}),Hk;let i=this._def.keyType,o=this._def.valueType,a=[...r.data.entries()].map(([t,n],a)=>({key:i._parse(new HN(r,t,r.path,[a,"key"])),value:o._parse(new HN(r,n,r.path,[a,"value"]))}));if(r.common.async){let u=new Map;return Promise.resolve().then(async()=>{for(let t of a){let r=await t.key,i=await t.value;if("aborted"===r.status||"aborted"===i.status)return Hk;("dirty"===r.status||"dirty"===i.status)&&n.dirty(),u.set(r.value,i.value)}return{status:n.value,value:u}})}{let s=new Map;for(let c of a){let l=c.key,f=c.value;if("aborted"===l.status||"aborted"===f.status)return Hk;("dirty"===l.status||"dirty"===f.status)&&n.dirty(),s.set(l.value,f.value)}return{status:n.value,value:s}}}}Gi.create=(t,n,r)=>new Gi({valueType:n,keyType:t,typeName:s.ZodMap,...HP(r)});class Go extends HL{_parse(t){let{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==Hh.set)return Hw(r,{code:Hg.invalid_type,expected:Hh.set,received:r.parsedType}),Hk;let i=this._def;null!==i.minSize&&r.data.size<i.minSize.value&&(Hw(r,{code:Hg.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),n.dirty()),null!==i.maxSize&&r.data.size>i.maxSize.value&&(Hw(r,{code:Hg.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),n.dirty());let o=this._def.valueType;function a(t){let r=new Set;for(let i of t){if("aborted"===i.status)return Hk;"dirty"===i.status&&n.dirty(),r.add(i.value)}return{status:n.value,value:r}}let u=[...r.data.values()].map((t,n)=>o._parse(new HN(r,t,r.path,n)));return r.common.async?Promise.all(u).then(t=>a(t)):a(u)}min(t,n){return new Go({...this._def,minSize:{value:t,message:u.toString(n)}})}max(t,n){return new Go({...this._def,maxSize:{value:t,message:u.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}}Go.create=(t,n)=>new Go({valueType:t,minSize:null,maxSize:null,typeName:s.ZodSet,...HP(n)});class Ga extends HL{constructor(){super(...arguments),this.validate=this.implement}_parse(t){let{ctx:n}=this._processInputParams(t);if(n.parsedType!==Hh.function)return Hw(n,{code:Hg.invalid_type,expected:Hh.function,received:n.parsedType}),Hk;function r(t,r){return HT({data:t,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Hx,Hb].filter(t=>!!t),issueData:{code:Hg.invalid_arguments,argumentsError:r}})}function i(t,r){return HT({data:t,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Hx,Hb].filter(t=>!!t),issueData:{code:Hg.invalid_return_type,returnTypeError:r}})}let o={errorMap:n.common.contextualErrorMap},a=n.data;return this._def.returns instanceof Gd?HC(async(...t)=>{let n=new Hv([]),u=await this._def.args.parseAsync(t,o).catch(i=>{throw n.addIssue(r(t,i)),n}),s=await a(...u);return await this._def.returns._def.type.parseAsync(s,o).catch(t=>{throw n.addIssue(i(s,t)),n})}):HC((...t)=>{let n=this._def.args.safeParse(t,o);if(!n.success)throw new Hv([r(t,n.error)]);let u=a(...n.data),s=this._def.returns.safeParse(u,o);if(!s.success)throw new Hv([i(u,s.error)]);return s.data})}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new Ga({...this._def,args:Gn.create(t).rest(H3.create())})}returns(t){return new Ga({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,n,r){return new Ga({args:t||Gn.create([]).rest(H3.create()),returns:n||H3.create(),typeName:s.ZodFunction,...HP(r)})}}class Gu extends HL{get schema(){return this._def.getter()}_parse(t){let{ctx:n}=this._processInputParams(t);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}Gu.create=(t,n)=>new Gu({getter:t,typeName:s.ZodLazy,...HP(n)});class Gs extends HL{_parse(t){if(t.data!==this._def.value){let n=this._getOrReturnCtx(t);return Hw(n,{received:n.data,code:Hg.invalid_literal,expected:this._def.value}),Hk}return{status:"valid",value:t.data}}get value(){return this._def.value}}function Gc(t,n){return new Gl({values:t,typeName:s.ZodEnum,...HP(n)})}Gs.create=(t,n)=>new Gs({value:t,typeName:s.ZodLiteral,...HP(n)});class Gl extends HL{_parse(t){if("string"!=typeof t.data){let n=this._getOrReturnCtx(t),r=this._def.values;return Hw(n,{expected:o.joinValues(r),received:n.parsedType,code:Hg.invalid_type}),Hk}if(-1===this._def.values.indexOf(t.data)){let i=this._getOrReturnCtx(t),a=this._def.values;return Hw(i,{received:i.data,code:Hg.invalid_enum_value,options:a}),Hk}return HC(t.data)}get options(){return this._def.values}get enum(){let t={};for(let n of this._def.values)t[n]=n;return t}get Values(){let t={};for(let n of this._def.values)t[n]=n;return t}get Enum(){let t={};for(let n of this._def.values)t[n]=n;return t}extract(t){return Gl.create(t)}exclude(t){return Gl.create(this.options.filter(n=>!t.includes(n)))}}Gl.create=Gc;class Gf extends HL{_parse(t){let n=o.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(t);if(r.parsedType!==Hh.string&&r.parsedType!==Hh.number){let i=o.objectValues(n);return Hw(r,{expected:o.joinValues(i),received:r.parsedType,code:Hg.invalid_type}),Hk}if(-1===n.indexOf(t.data)){let a=o.objectValues(n);return Hw(r,{received:r.data,code:Hg.invalid_enum_value,options:a}),Hk}return HC(t.data)}get enum(){return this._def.values}}Gf.create=(t,n)=>new Gf({values:t,typeName:s.ZodNativeEnum,...HP(n)});class Gd extends HL{unwrap(){return this._def.type}_parse(t){let{ctx:n}=this._processInputParams(t);if(n.parsedType!==Hh.promise&&!1===n.common.async)return Hw(n,{code:Hg.invalid_type,expected:Hh.promise,received:n.parsedType}),Hk;let r=n.parsedType===Hh.promise?n.data:Promise.resolve(n.data);return HC(r.then(t=>this._def.type.parseAsync(t,{path:n.path,errorMap:n.common.contextualErrorMap})))}}Gd.create=(t,n)=>new Gd({type:t,typeName:s.ZodPromise,...HP(n)});class Gp extends HL{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===s.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){let{status:n,ctx:r}=this._processInputParams(t),i=this._def.effect||null;if("preprocess"===i.type){let a=i.transform(r.data);return r.common.async?Promise.resolve(a).then(t=>this._def.schema._parseAsync({data:t,path:r.path,parent:r})):this._def.schema._parseSync({data:a,path:r.path,parent:r})}let u={addIssue(t){Hw(r,t),t.fatal?n.abort():n.dirty()},get path(){return r.path}};if(u.addIssue=u.addIssue.bind(u),"refinement"===i.type){let s=t=>{let n=i.refinement(t,u);if(r.common.async)return Promise.resolve(n);if(n instanceof Promise)throw Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return t};if(!1!==r.common.async)return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(t=>"aborted"===t.status?Hk:("dirty"===t.status&&n.dirty(),s(t.value).then(()=>({status:n.value,value:t.value}))));{let c=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return"aborted"===c.status?Hk:("dirty"===c.status&&n.dirty(),s(c.value),{status:n.value,value:c.value})}}if("transform"===i.type){if(!1!==r.common.async)return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(t=>HE(t)?Promise.resolve(i.transform(t.value,u)).then(t=>({status:n.value,value:t})):t);{let l=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!HE(l))return l;let f=i.transform(l.value,u);if(f instanceof Promise)throw Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:f}}}o.assertNever(i)}}Gp.create=(t,n,r)=>new Gp({schema:t,typeName:s.ZodEffects,effect:n,...HP(r)}),Gp.createWithPreprocess=(t,n,r)=>new Gp({schema:n,effect:{type:"preprocess",transform:t},typeName:s.ZodEffects,...HP(r)});class Gh extends HL{_parse(t){return this._getType(t)===Hh.undefined?HC(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Gh.create=(t,n)=>new Gh({innerType:t,typeName:s.ZodOptional,...HP(n)});class Gm extends HL{_parse(t){return this._getType(t)===Hh.null?HC(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Gm.create=(t,n)=>new Gm({innerType:t,typeName:s.ZodNullable,...HP(n)});class Gg extends HL{_parse(t){let{ctx:n}=this._processInputParams(t),r=n.data;return n.parsedType===Hh.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}Gg.create=(t,n)=>new Gg({innerType:t,typeName:s.ZodDefault,defaultValue:"function"==typeof n.default?n.default:()=>n.default,...HP(n)});class Gy extends HL{_parse(t){let{ctx:n}=this._processInputParams(t),r={...n,common:{...n.common,issues:[]}},i=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return Hj(i)?i.then(t=>({status:"valid",value:"valid"===t.status?t.value:this._def.catchValue({get error(){return new Hv(r.common.issues)},input:r.data})})):{status:"valid",value:"valid"===i.status?i.value:this._def.catchValue({get error(){return new Hv(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}Gy.create=(t,n)=>new Gy({innerType:t,typeName:s.ZodCatch,catchValue:"function"==typeof n.catch?n.catch:()=>n.catch,...HP(n)});class Gv extends HL{_parse(t){if(this._getType(t)!==Hh.nan){let n=this._getOrReturnCtx(t);return Hw(n,{code:Hg.invalid_type,expected:Hh.nan,received:n.parsedType}),Hk}return{status:"valid",value:t.data}}}Gv.create=t=>new Gv({typeName:s.ZodNaN,...HP(t)});let Gb=Symbol("zod_brand");class Gx extends HL{_parse(t){let{ctx:n}=this._processInputParams(t),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}}class G_ extends HL{_parse(t){let{status:n,ctx:r}=this._processInputParams(t);if(r.common.async)return(async()=>{let t=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return"aborted"===t.status?Hk:"dirty"===t.status?(n.dirty(),HI(t.value)):this._def.out._parseAsync({data:t.value,path:r.path,parent:r})})();{let i=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return"aborted"===i.status?Hk:"dirty"===i.status?(n.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:r.path,parent:r})}}static create(t,n){return new G_({in:t,out:n,typeName:s.ZodPipeline})}}let GS=(t,n={},r)=>t?H2.create().superRefine((i,o)=>{var a,u;if(!t(i)){let s="function"==typeof n?n(i):"string"==typeof n?{message:n}:n,c=null===(u=null!==(a=s.fatal)&&void 0!==a?a:r)||void 0===u||u;o.addIssue({code:"custom",..."string"==typeof s?{message:s}:s,fatal:c})}}):H2.create(),GT={object:H6.lazycreate};(enH=s||(s={})).ZodString="ZodString",enH.ZodNumber="ZodNumber",enH.ZodNaN="ZodNaN",enH.ZodBigInt="ZodBigInt",enH.ZodBoolean="ZodBoolean",enH.ZodDate="ZodDate",enH.ZodSymbol="ZodSymbol",enH.ZodUndefined="ZodUndefined",enH.ZodNull="ZodNull",enH.ZodAny="ZodAny",enH.ZodUnknown="ZodUnknown",enH.ZodNever="ZodNever",enH.ZodVoid="ZodVoid",enH.ZodArray="ZodArray",enH.ZodObject="ZodObject",enH.ZodUnion="ZodUnion",enH.ZodDiscriminatedUnion="ZodDiscriminatedUnion",enH.ZodIntersection="ZodIntersection",enH.ZodTuple="ZodTuple",enH.ZodRecord="ZodRecord",enH.ZodMap="ZodMap",enH.ZodSet="ZodSet",enH.ZodFunction="ZodFunction",enH.ZodLazy="ZodLazy",enH.ZodLiteral="ZodLiteral",enH.ZodEnum="ZodEnum",enH.ZodEffects="ZodEffects",enH.ZodNativeEnum="ZodNativeEnum",enH.ZodOptional="ZodOptional",enH.ZodNullable="ZodNullable",enH.ZodDefault="ZodDefault",enH.ZodCatch="ZodCatch",enH.ZodPromise="ZodPromise",enH.ZodBranded="ZodBranded",enH.ZodPipeline="ZodPipeline";let Gw=(t,n={message:`Input not instance of ${t.name}`})=>GS(n=>n instanceof t,n),GO=HH.create,Gk=HZ.create,GI=Gv.create,GC=HY.create,GM=HJ.create,GR=HQ.create,GE=HX.create,Gj=H0.create,GN=H1.create,GA=H2.create,GP=H3.create,GL=H4.create,GD=H5.create,GF=H9.create,GW=H6.create,GU=H6.strictCreate,Gz=H8.create,GB=Ge.create,GV=Gt.create,G$=Gn.create,Gq=Gr.create,GK=Gi.create,GH=Go.create,GG=Ga.create,GZ=Gu.create,GY=Gs.create,GJ=Gl.create,GQ=Gf.create,GX=Gd.create,G0=Gp.create,G1=Gh.create,G2=Gm.create,G3=Gp.createWithPreprocess,G4=G_.create,G5=()=>GO().optional(),G9=()=>Gk().optional(),G6=()=>GM().optional();var G8=Object.freeze({__proto__:null,defaultErrorMap:Hb,setErrorMap:H_,getErrorMap:HS,makeIssue:HT,EMPTY_PATH:[],addIssueToContext:Hw,ParseStatus:HO,INVALID:Hk,DIRTY:HI,OK:HC,isAborted:HM,isDirty:HR,isValid:HE,isAsync:Hj,get util(){return o},get objectUtil(){return a},ZodParsedType:Hh,getParsedType:Hm,ZodType:HL,ZodString:HH,ZodNumber:HZ,ZodBigInt:HY,ZodBoolean:HJ,ZodDate:HQ,ZodSymbol:HX,ZodUndefined:H0,ZodNull:H1,ZodAny:H2,ZodUnknown:H3,ZodNever:H4,ZodVoid:H5,ZodArray:H9,ZodObject:H6,ZodUnion:H8,ZodDiscriminatedUnion:Ge,ZodIntersection:Gt,ZodTuple:Gn,ZodRecord:Gr,ZodMap:Gi,ZodSet:Go,ZodFunction:Ga,ZodLazy:Gu,ZodLiteral:Gs,ZodEnum:Gl,ZodNativeEnum:Gf,ZodPromise:Gd,ZodEffects:Gp,ZodTransformer:Gp,ZodOptional:Gh,ZodNullable:Gm,ZodDefault:Gg,ZodCatch:Gy,ZodNaN:Gv,BRAND:Gb,ZodBranded:Gx,ZodPipeline:G_,custom:GS,Schema:HL,ZodSchema:HL,late:GT,get ZodFirstPartyTypeKind(){return s},coerce:{string:t=>HH.create({...t,coerce:!0}),number:t=>HZ.create({...t,coerce:!0}),boolean:t=>HJ.create({...t,coerce:!0}),bigint:t=>HY.create({...t,coerce:!0}),date:t=>HQ.create({...t,coerce:!0})},any:GA,array:GF,bigint:GC,boolean:GM,date:GR,discriminatedUnion:GB,effect:G0,enum:GJ,function:GG,instanceof:Gw,intersection:GV,lazy:GZ,literal:GY,map:GK,nan:GI,nativeEnum:GQ,never:GL,null:GN,nullable:G2,number:Gk,object:GW,oboolean:G6,onumber:G9,optional:G1,ostring:G5,pipeline:G4,preprocess:G3,promise:GX,record:Gq,set:GH,strictObject:GU,string:GO,symbol:GE,transformer:G0,tuple:G$,undefined:Gj,union:Gz,unknown:GP,void:GD,NEVER:Hk,ZodIssueCode:Hg,quotelessJson:Hy,ZodError:Hv});function G7(t){this.content=t}G7.prototype={constructor:G7,find:function(t){for(var n=0;n<this.content.length;n+=2)if(this.content[n]===t)return n;return -1},get:function(t){var n=this.find(t);return -1==n?void 0:this.content[n+1]},update:function(t,n,r){var i=r&&r!=t?this.remove(r):this,o=i.find(t),a=i.content.slice();return -1==o?a.push(r||t,n):(a[o+1]=n,r&&(a[o]=r)),new G7(a)},remove:function(t){var n=this.find(t);if(-1==n)return this;var r=this.content.slice();return r.splice(n,2),new G7(r)},addToStart:function(t,n){return new G7([t,n].concat(this.remove(t).content))},addToEnd:function(t,n){var r=this.remove(t).content.slice();return r.push(t,n),new G7(r)},addBefore:function(t,n,r){var i=this.remove(n),o=i.content.slice(),a=i.find(t);return o.splice(-1==a?o.length:a,0,n,r),new G7(o)},forEach:function(t){for(var n=0;n<this.content.length;n+=2)t(this.content[n],this.content[n+1])},prepend:function(t){return(t=G7.from(t)).size?new G7(t.content.concat(this.subtract(t).content)):this},append:function(t){return(t=G7.from(t)).size?new G7(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var n=this;t=G7.from(t);for(var r=0;r<t.content.length;r+=2)n=n.remove(t.content[r]);return n},toObject:function(){var t={};return this.forEach(function(n,r){t[n]=r}),t},get size(){return this.content.length>>1}},G7.from=function(t){if(t instanceof G7)return t;var n=[];if(t)for(var r in t)n.push(r,t[r]);return new G7(n)};class Ze{constructor(t,n){if(this.content=t,this.size=n||0,null==n)for(let r=0;r<t.length;r++)this.size+=t[r].nodeSize}nodesBetween(t,n,r,i=0,o){for(let a=0,u=0;u<n;a++){let s=this.content[a],c=u+s.nodeSize;if(c>t&&!1!==r(s,i+u,o||null,a)&&s.content.size){let l=u+1;s.nodesBetween(Math.max(0,t-l),Math.min(s.content.size,n-l),r,i+l)}u=c}}descendants(t){this.nodesBetween(0,this.size,t)}textBetween(t,n,r,i){let o="",a=!0;return this.nodesBetween(t,n,(u,s)=>{u.isText?(o+=u.text.slice(Math.max(t,s)-s,n-s),a=!r):u.isLeaf?(i?o+="function"==typeof i?i(u):i:u.type.spec.leafText&&(o+=u.type.spec.leafText(u)),a=!r):!a&&u.isBlock&&(o+=r,a=!0)},0),o}append(t){if(!t.size)return this;if(!this.size)return t;let n=this.lastChild,r=t.firstChild,i=this.content.slice(),o=0;for(n.isText&&n.sameMarkup(r)&&(i[i.length-1]=n.withText(n.text+r.text),o=1);o<t.content.length;o++)i.push(t.content[o]);return new Ze(i,this.size+t.size)}cut(t,n=this.size){if(0==t&&n==this.size)return this;let r=[],i=0;if(n>t)for(let o=0,a=0;a<n;o++){let u=this.content[o],s=a+u.nodeSize;s>t&&((a<t||s>n)&&(u=u.isText?u.cut(Math.max(0,t-a),Math.min(u.text.length,n-a)):u.cut(Math.max(0,t-a-1),Math.min(u.content.size,n-a-1))),r.push(u),i+=u.nodeSize),a=s}return new Ze(r,i)}cutByIndex(t,n){return t==n?Ze.empty:0==t&&n==this.content.length?this:new Ze(this.content.slice(t,n))}replaceChild(t,n){let r=this.content[t];if(r==n)return this;let i=this.content.slice(),o=this.size+n.nodeSize-r.nodeSize;return i[t]=n,new Ze(i,o)}addToStart(t){return new Ze([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new Ze(this.content.concat(t),this.size+t.nodeSize)}eq(t){if(this.content.length!=t.content.length)return!1;for(let n=0;n<this.content.length;n++)if(!this.content[n].eq(t.content[n]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(t){let n=this.content[t];if(!n)throw RangeError("Index "+t+" out of range for "+this);return n}maybeChild(t){return this.content[t]||null}forEach(t){for(let n=0,r=0;n<this.content.length;n++){let i=this.content[n];t(i,r,n),r+=i.nodeSize}}findDiffStart(t,n=0){return function t(n,r,i){for(let o=0;;o++){if(o==n.childCount||o==r.childCount)return n.childCount==r.childCount?null:i;let a=n.child(o),u=r.child(o);if(a==u){i+=a.nodeSize;continue}if(!a.sameMarkup(u))return i;if(a.isText&&a.text!=u.text){for(let s=0;a.text[s]==u.text[s];s++)i++;return i}if(a.content.size||u.content.size){let c=t(a.content,u.content,i+1);if(null!=c)return c}i+=a.nodeSize}}(this,t,n)}findDiffEnd(t,n=this.size,r=t.size){return function t(n,r,i,o){for(let a=n.childCount,u=r.childCount;;){if(0==a||0==u)return a==u?null:{a:i,b:o};let s=n.child(--a),c=r.child(--u),l=s.nodeSize;if(s==c){i-=l,o-=l;continue}if(!s.sameMarkup(c))return{a:i,b:o};if(s.isText&&s.text!=c.text){let f=0,d=Math.min(s.text.length,c.text.length);for(;f<d&&s.text[s.text.length-f-1]==c.text[c.text.length-f-1];)f++,i--,o--;return{a:i,b:o}}if(s.content.size||c.content.size){let p=t(s.content,c.content,i-1,o-1);if(p)return p}i-=l,o-=l}}(this,t,n,r)}findIndex(t,n=-1){if(0==t)return Zn(0,t);if(t==this.size)return Zn(this.content.length,t);if(t>this.size||t<0)throw RangeError(`Position ${t} outside of fragment (${this})`);for(let r=0,i=0;;r++){let o=i+this.child(r).nodeSize;if(o>=t)return o==t||n>0?Zn(r+1,o):Zn(r,i);i=o}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(t=>t.toJSON()):null}static fromJSON(t,n){if(!n)return Ze.empty;if(!Array.isArray(n))throw RangeError("Invalid input for Fragment.fromJSON");return new Ze(n.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return Ze.empty;let n,r=0;for(let i=0;i<t.length;i++){let o=t[i];r+=o.nodeSize,i&&o.isText&&t[i-1].sameMarkup(o)?(n||(n=t.slice(0,i)),n[n.length-1]=o.withText(n[n.length-1].text+o.text)):n&&n.push(o)}return new Ze(n||t,r)}static from(t){if(!t)return Ze.empty;if(t instanceof Ze)return t;if(Array.isArray(t))return this.fromArray(t);if(t.attrs)return new Ze([t],t.nodeSize);throw RangeError("Can not convert "+t+" to a Fragment"+(t.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}Ze.empty=new Ze([],0);let Zt={index:0,offset:0};function Zn(t,n){return Zt.index=t,Zt.offset=n,Zt}function Zr(t,n){if(t===n)return!0;if(!(t&&"object"==typeof t)||!(n&&"object"==typeof n))return!1;let r=Array.isArray(t);if(Array.isArray(n)!=r)return!1;if(r){if(t.length!=n.length)return!1;for(let i=0;i<t.length;i++)if(!Zr(t[i],n[i]))return!1}else{for(let o in t)if(!(o in n)||!Zr(t[o],n[o]))return!1;for(let a in n)if(!(a in t))return!1}return!0}let Zi=class t{constructor(t,n){this.type=t,this.attrs=n}addToSet(t){let n,r=!1;for(let i=0;i<t.length;i++){let o=t[i];if(this.eq(o))return t;if(this.type.excludes(o.type))n||(n=t.slice(0,i));else{if(o.type.excludes(this.type))return t;!r&&o.type.rank>this.type.rank&&(n||(n=t.slice(0,i)),n.push(this),r=!0),n&&n.push(o)}}return n||(n=t.slice()),r||n.push(this),n}removeFromSet(t){for(let n=0;n<t.length;n++)if(this.eq(t[n]))return t.slice(0,n).concat(t.slice(n+1));return t}isInSet(t){for(let n=0;n<t.length;n++)if(this.eq(t[n]))return!0;return!1}eq(t){return this==t||this.type==t.type&&Zr(this.attrs,t.attrs)}toJSON(){let t={type:this.type.name};for(let n in this.attrs){t.attrs=this.attrs;break}return t}static fromJSON(t,n){if(!n)throw RangeError("Invalid input for Mark.fromJSON");let r=t.marks[n.type];if(!r)throw RangeError(`There is no mark type ${n.type} in this schema`);return r.create(n.attrs)}static sameSet(t,n){if(t==n)return!0;if(t.length!=n.length)return!1;for(let r=0;r<t.length;r++)if(!t[r].eq(n[r]))return!1;return!0}static setFrom(n){if(!n||Array.isArray(n)&&0==n.length)return t.none;if(n instanceof t)return[n];let r=n.slice();return r.sort((t,n)=>t.type.rank-n.type.rank),r}};Zi.none=[];class Zo extends Error{}class Za{constructor(t,n,r){this.content=t,this.openStart=n,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(t,n){let r=function t(n,r,i,o){let{index:a,offset:u}=n.findIndex(r),s=n.maybeChild(a);if(u==r||s.isText)return o&&!o.canReplace(a,a,i)?null:n.cut(0,r).append(i).append(n.cut(r));let c=t(s.content,r-u-1,i);return c&&n.replaceChild(a,s.copy(c))}(this.content,t+this.openStart,n);return r&&new Za(r,this.openStart,this.openEnd)}removeBetween(t,n){return new Za(function t(n,r,i){let{index:o,offset:a}=n.findIndex(r),u=n.maybeChild(o),{index:s,offset:c}=n.findIndex(i);if(a==r||u.isText){if(c!=i&&!n.child(s).isText)throw RangeError("Removing non-flat range");return n.cut(0,r).append(n.cut(i))}if(o!=s)throw RangeError("Removing non-flat range");return n.replaceChild(o,u.copy(t(u.content,r-a-1,i-a-1)))}(this.content,t+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(t){return this.content.eq(t.content)&&this.openStart==t.openStart&&this.openEnd==t.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let t={content:this.content.toJSON()};return this.openStart>0&&(t.openStart=this.openStart),this.openEnd>0&&(t.openEnd=this.openEnd),t}static fromJSON(t,n){if(!n)return Za.empty;let r=n.openStart||0,i=n.openEnd||0;if("number"!=typeof r||"number"!=typeof i)throw RangeError("Invalid input for Slice.fromJSON");return new Za(Ze.fromJSON(t,n.content),r,i)}static maxOpen(t,n=!0){let r=0,i=0;for(let o=t.firstChild;o&&!o.isLeaf&&(n||!o.type.spec.isolating);o=o.firstChild)r++;for(let a=t.lastChild;a&&!a.isLeaf&&(n||!a.type.spec.isolating);a=a.lastChild)i++;return new Za(t,r,i)}}function Zu(t,n){if(!n.type.compatibleContent(t.type))throw new Zo("Cannot join "+n.type.name+" onto "+t.type.name)}function Zs(t,n,r){let i=t.node(r);return Zu(i,n.node(r)),i}function Zc(t,n){let r=n.length-1;r>=0&&t.isText&&t.sameMarkup(n[r])?n[r]=t.withText(n[r].text+t.text):n.push(t)}function Zl(t,n,r,i){let o=(n||t).node(r),a=0,u=n?n.index(r):o.childCount;t&&(a=t.index(r),t.depth>r?a++:t.textOffset&&(Zc(t.nodeAfter,i),a++));for(let s=a;s<u;s++)Zc(o.child(s),i);n&&n.depth==r&&n.textOffset&&Zc(n.nodeBefore,i)}function Zf(t,n){return t.type.checkContent(n),t.copy(n)}function Zd(t,n,r){let i=[];return Zl(null,t,r,i),t.depth>r&&Zc(Zf(Zs(t,n,r+1),Zd(t,n,r+1)),i),Zl(n,null,r,i),new Ze(i)}Za.empty=new Za(Ze.empty,0,0);class Zp{constructor(t,n,r){this.pos=t,this.path=n,this.parentOffset=r,this.depth=n.length/3-1}resolveDepth(t){return null==t?this.depth:t<0?this.depth+t:t}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(t){return this.path[3*this.resolveDepth(t)]}index(t){return this.path[3*this.resolveDepth(t)+1]}indexAfter(t){return t=this.resolveDepth(t),this.index(t)+(t!=this.depth||this.textOffset?1:0)}start(t){return 0==(t=this.resolveDepth(t))?0:this.path[3*t-1]+1}end(t){return t=this.resolveDepth(t),this.start(t)+this.node(t).content.size}before(t){if(!(t=this.resolveDepth(t)))throw RangeError("There is no position before the top-level node");return t==this.depth+1?this.pos:this.path[3*t-1]}after(t){if(!(t=this.resolveDepth(t)))throw RangeError("There is no position after the top-level node");return t==this.depth+1?this.pos:this.path[3*t-1]+this.path[3*t].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let t=this.parent,n=this.index(this.depth);if(n==t.childCount)return null;let r=this.pos-this.path[this.path.length-1],i=t.child(n);return r?t.child(n).cut(r):i}get nodeBefore(){let t=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(t).cut(0,n):0==t?null:this.parent.child(t-1)}posAtIndex(t,n){n=this.resolveDepth(n);let r=this.path[3*n],i=0==n?0:this.path[3*n-1]+1;for(let o=0;o<t;o++)i+=r.child(o).nodeSize;return i}marks(){let t=this.parent,n=this.index();if(0==t.content.size)return Zi.none;if(this.textOffset)return t.child(n).marks;let r=t.maybeChild(n-1),i=t.maybeChild(n);if(!r){let o=r;r=i,i=o}let a=r.marks;for(var u=0;u<a.length;u++)!1!==a[u].type.spec.inclusive||i&&a[u].isInSet(i.marks)||(a=a[u--].removeFromSet(a));return a}marksAcross(t){let n=this.parent.maybeChild(this.index());if(!n||!n.isInline)return null;let r=n.marks,i=t.parent.maybeChild(t.index());for(var o=0;o<r.length;o++)!1!==r[o].type.spec.inclusive||i&&r[o].isInSet(i.marks)||(r=r[o--].removeFromSet(r));return r}sharedDepth(t){for(let n=this.depth;n>0;n--)if(this.start(n)<=t&&this.end(n)>=t)return n;return 0}blockRange(t=this,n){if(t.pos<this.pos)return t.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==t.pos?1:0);r>=0;r--)if(t.pos<=this.end(r)&&(!n||n(this.node(r))))return new Zy(this,t,r);return null}sameParent(t){return this.pos-this.parentOffset==t.pos-t.parentOffset}max(t){return t.pos>this.pos?t:this}min(t){return t.pos<this.pos?t:this}toString(){let t="";for(let n=1;n<=this.depth;n++)t+=(t?"/":"")+this.node(n).type.name+"_"+this.index(n-1);return t+":"+this.parentOffset}static resolve(t,n){if(!(n>=0&&n<=t.content.size))throw RangeError("Position "+n+" out of range");let r=[],i=0,o=n;for(let a=t;;){let{index:u,offset:s}=a.content.findIndex(o),c=o-s;if(r.push(a,u,i+s),!c||(a=a.child(u)).isText)break;o=c-1,i+=s+1}return new Zp(n,r,o)}static resolveCached(t,n){for(let r=0;r<Zh.length;r++){let i=Zh[r];if(i.pos==n&&i.doc==t)return i}let o=Zh[Zm]=Zp.resolve(t,n);return Zm=(Zm+1)%Zg,o}}let Zh=[],Zm=0,Zg=12;class Zy{constructor(t,n,r){this.$from=t,this.$to=n,this.depth=r}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}let Zv=Object.create(null),Zb=class t{constructor(t,n,r,i=Zi.none){this.type=t,this.attrs=n,this.marks=i,this.content=r||Ze.empty}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(t){return this.content.child(t)}maybeChild(t){return this.content.maybeChild(t)}forEach(t){this.content.forEach(t)}nodesBetween(t,n,r,i=0){this.content.nodesBetween(t,n,r,i,this)}descendants(t){this.nodesBetween(0,this.content.size,t)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(t,n,r,i){return this.content.textBetween(t,n,r,i)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(t){return this==t||this.sameMarkup(t)&&this.content.eq(t.content)}sameMarkup(t){return this.hasMarkup(t.type,t.attrs,t.marks)}hasMarkup(t,n,r){return this.type==t&&Zr(this.attrs,n||t.defaultAttrs||Zv)&&Zi.sameSet(this.marks,r||Zi.none)}copy(n=null){return n==this.content?this:new t(this.type,this.attrs,n,this.marks)}mark(n){return n==this.marks?this:new t(this.type,this.attrs,this.content,n)}cut(t,n=this.content.size){return 0==t&&n==this.content.size?this:this.copy(this.content.cut(t,n))}slice(t,n=this.content.size,r=!1){if(t==n)return Za.empty;let i=this.resolve(t),o=this.resolve(n),a=r?0:i.sharedDepth(n),u=i.start(a),s=i.node(a).content.cut(i.pos-u,o.pos-u);return new Za(s,i.depth-a,o.depth-a)}replace(t,n,r){return function(t,n,r){if(r.openStart>t.depth)throw new Zo("Inserted content deeper than insertion position");if(t.depth-r.openStart!=n.depth-r.openEnd)throw new Zo("Inconsistent open depths");return function t(n,r,i,o){let a=n.index(o),u=n.node(o);if(a==r.index(o)&&o<n.depth-i.openStart){let s=t(n,r,i,o+1);return u.copy(u.content.replaceChild(a,s))}if(!i.content.size)return Zf(u,Zd(n,r,o));if(i.openStart||i.openEnd||n.depth!=o||r.depth!=o){let{start:c,end:l}=function(t,n){let r=n.depth-t.openStart,i=n.node(r).copy(t.content);for(let o=r-1;o>=0;o--)i=n.node(o).copy(Ze.from(i));return{start:i.resolveNoCache(t.openStart+r),end:i.resolveNoCache(i.content.size-t.openEnd-r)}}(i,n);return Zf(u,function t(n,r,i,o,a){let u=n.depth>a&&Zs(n,r,a+1),s=o.depth>a&&Zs(i,o,a+1),c=[];return Zl(null,n,a,c),u&&s&&r.index(a)==i.index(a)?(Zu(u,s),Zc(Zf(u,t(n,r,i,o,a+1)),c)):(u&&Zc(Zf(u,Zd(n,r,a+1)),c),Zl(r,i,a,c),s&&Zc(Zf(s,Zd(i,o,a+1)),c)),Zl(o,null,a,c),new Ze(c)}(n,c,l,r,o))}{let f=n.parent,d=f.content;return Zf(f,d.cut(0,n.parentOffset).append(i.content).append(d.cut(r.parentOffset)))}}(t,n,r,0)}(this.resolve(t),this.resolve(n),r)}nodeAt(t){for(let n=this;;){let{index:r,offset:i}=n.content.findIndex(t);if(!(n=n.maybeChild(r)))return null;if(i==t||n.isText)return n;t-=i+1}}childAfter(t){let{index:n,offset:r}=this.content.findIndex(t);return{node:this.content.maybeChild(n),index:n,offset:r}}childBefore(t){if(0==t)return{node:null,index:0,offset:0};let{index:n,offset:r}=this.content.findIndex(t);if(r<t)return{node:this.content.child(n),index:n,offset:r};let i=this.content.child(n-1);return{node:i,index:n-1,offset:r-i.nodeSize}}resolve(t){return Zp.resolveCached(this,t)}resolveNoCache(t){return Zp.resolve(this,t)}rangeHasMark(t,n,r){let i=!1;return n>t&&this.nodesBetween(t,n,t=>(r.isInSet(t.marks)&&(i=!0),!i)),i}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let t=this.type.name;return this.content.size&&(t+="("+this.content.toStringInner()+")"),Z_(this.marks,t)}contentMatchAt(t){let n=this.type.contentMatch.matchFragment(this.content,0,t);if(!n)throw Error("Called contentMatchAt on a node with invalid content");return n}canReplace(t,n,r=Ze.empty,i=0,o=r.childCount){let a=this.contentMatchAt(t).matchFragment(r,i,o),u=a&&a.matchFragment(this.content,n);if(!u||!u.validEnd)return!1;for(let s=i;s<o;s++)if(!this.type.allowsMarks(r.child(s).marks))return!1;return!0}canReplaceWith(t,n,r,i){if(i&&!this.type.allowsMarks(i))return!1;let o=this.contentMatchAt(t).matchType(r),a=o&&o.matchFragment(this.content,n);return!!a&&a.validEnd}canAppend(t){return t.content.size?this.canReplace(this.childCount,this.childCount,t.content):this.type.compatibleContent(t.type)}check(){this.type.checkContent(this.content);let t=Zi.none;for(let n=0;n<this.marks.length;n++)t=this.marks[n].addToSet(t);if(!Zi.sameSet(t,this.marks))throw RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(t=>t.type.name)}`);this.content.forEach(t=>t.check())}toJSON(){let t={type:this.type.name};for(let n in this.attrs){t.attrs=this.attrs;break}return this.content.size&&(t.content=this.content.toJSON()),this.marks.length&&(t.marks=this.marks.map(t=>t.toJSON())),t}static fromJSON(t,n){if(!n)throw RangeError("Invalid input for Node.fromJSON");let r=null;if(n.marks){if(!Array.isArray(n.marks))throw RangeError("Invalid mark data for Node.fromJSON");r=n.marks.map(t.markFromJSON)}if("text"==n.type){if("string"!=typeof n.text)throw RangeError("Invalid text node in JSON");return t.text(n.text,r)}let i=Ze.fromJSON(t,n.content);return t.nodeType(n.type).create(n.attrs,i,r)}};Zb.prototype.text=void 0;class Zx extends Zb{constructor(t,n,r,i){if(super(t,n,null,i),!r)throw RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):Z_(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(t,n){return this.text.slice(t,n)}get nodeSize(){return this.text.length}mark(t){return t==this.marks?this:new Zx(this.type,this.attrs,this.text,t)}withText(t){return t==this.text?this:new Zx(this.type,this.attrs,t,this.marks)}cut(t=0,n=this.text.length){return 0==t&&n==this.text.length?this:this.withText(this.text.slice(t,n))}eq(t){return this.sameMarkup(t)&&this.text==t.text}toJSON(){let t=super.toJSON();return t.text=this.text,t}}function Z_(t,n){for(let r=t.length-1;r>=0;r--)n=t[r].type.name+"("+n+")";return n}class ZS{constructor(t){this.validEnd=t,this.next=[],this.wrapCache=[]}static parse(t,n){var r;let i=new ZT(t,n);if(null==i.next)return ZS.empty;let o=Zw(i);i.next&&i.err("Unexpected trailing text");let a,u=(r=function(t){let n=[[]];return o(a(t,0),r()),n;function r(){return n.push([])-1}function i(t,r,i){let o={term:i,to:r};return n[t].push(o),o}function o(t,n){t.forEach(t=>t.to=n)}function a(t,n){if("choice"==t.type)return t.exprs.reduce((t,r)=>t.concat(a(r,n)),[]);if("seq"==t.type)for(let u=0;;u++){let s=a(t.exprs[u],n);if(u==t.exprs.length-1)return s;o(s,n=r())}else if("star"==t.type){let c=r();return i(n,c),o(a(t.expr,c),c),[i(c)]}else if("plus"==t.type){let l=r();return o(a(t.expr,n),l),o(a(t.expr,l),l),[i(l)]}else{if("opt"==t.type)return[i(n)].concat(a(t.expr,n));if("range"==t.type){let f=n;for(let d=0;d<t.min;d++){let p=r();o(a(t.expr,f),p),f=p}if(-1==t.max)o(a(t.expr,f),f);else for(let h=t.min;h<t.max;h++){let m=r();i(f,m),o(a(t.expr,f),m),f=m}return[i(f)]}if("name"==t.type)return[i(n,void 0,t.value)];throw Error("Unknown expr type")}}}(o),a=Object.create(null),function t(n){let i=[];n.forEach(t=>{r[t].forEach(({term:t,to:n})=>{if(!t)return;let o;for(let a=0;a<i.length;a++)i[a][0]==t&&(o=i[a][1]);ZE(r,n).forEach(n=>{o||i.push([t,o=[]]),-1==o.indexOf(n)&&o.push(n)})})});let o=a[n.join(",")]=new ZS(n.indexOf(r.length-1)>-1);for(let u=0;u<i.length;u++){let s=i[u][1].sort(ZR);o.next.push({type:i[u][0],next:a[s.join(",")]||t(s)})}return o}(ZE(r,0)));return function(t,n){for(let r=0,i=[t];r<i.length;r++){let o=i[r],a=!o.validEnd,u=[];for(let s=0;s<o.next.length;s++){let{type:c,next:l}=o.next[s];u.push(c.name),a&&!(c.isText||c.hasRequiredAttrs())&&(a=!1),-1==i.indexOf(l)&&i.push(l)}a&&n.err("Only non-generatable nodes ("+u.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}(u,i),u}matchType(t){for(let n=0;n<this.next.length;n++)if(this.next[n].type==t)return this.next[n].next;return null}matchFragment(t,n=0,r=t.childCount){let i=this;for(let o=n;i&&o<r;o++)i=i.matchType(t.child(o).type);return i}get inlineContent(){return 0!=this.next.length&&this.next[0].type.isInline}get defaultType(){for(let t=0;t<this.next.length;t++){let{type:n}=this.next[t];if(!(n.isText||n.hasRequiredAttrs()))return n}return null}compatible(t){for(let n=0;n<this.next.length;n++)for(let r=0;r<t.next.length;r++)if(this.next[n].type==t.next[r].type)return!0;return!1}fillBefore(t,n=!1,r=0){let i=[this];return function o(a,u){let s=a.matchFragment(t,r);if(s&&(!n||s.validEnd))return Ze.from(u.map(t=>t.createAndFill()));for(let c=0;c<a.next.length;c++){let{type:l,next:f}=a.next[c];if(!(l.isText||l.hasRequiredAttrs())&&-1==i.indexOf(f)){i.push(f);let d=o(f,u.concat(l));if(d)return d}}return null}(this,[])}findWrapping(t){for(let n=0;n<this.wrapCache.length;n+=2)if(this.wrapCache[n]==t)return this.wrapCache[n+1];let r=this.computeWrapping(t);return this.wrapCache.push(t,r),r}computeWrapping(t){let n=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let i=r.shift(),o=i.match;if(o.matchType(t)){let a=[];for(let u=i;u.type;u=u.via)a.push(u.type);return a.reverse()}for(let s=0;s<o.next.length;s++){let{type:c,next:l}=o.next[s];c.isLeaf||c.hasRequiredAttrs()||c.name in n||i.type&&!l.validEnd||(r.push({match:c.contentMatch,type:c,via:i}),n[c.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(t){if(t>=this.next.length)throw RangeError(`There's no ${t}th edge in this content match`);return this.next[t]}toString(){let t=[];return function n(r){t.push(r);for(let i=0;i<r.next.length;i++)-1==t.indexOf(r.next[i].next)&&n(r.next[i].next)}(this),t.map((n,r)=>{let i=r+(n.validEnd?"*":" ")+" ";for(let o=0;o<n.next.length;o++)i+=(o?", ":"")+n.next[o].type.name+"->"+t.indexOf(n.next[o].next);return i}).join(`
|
|
6
|
-
`)}}ZS.empty=new ZS(!0);class ZT{constructor(t,n){this.string=t,this.nodeTypes=n,this.inline=null,this.pos=0,this.tokens=t.split(/\s*(?=\b|\W|$)/),""==this.tokens[this.tokens.length-1]&&this.tokens.pop(),""==this.tokens[0]&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(t){return this.next==t&&(this.pos++||!0)}err(t){throw SyntaxError(t+" (in content expression '"+this.string+"')")}}function Zw(t){let n=[];do n.push(ZO(t));while(t.eat("|"));return 1==n.length?n[0]:{type:"choice",exprs:n}}function ZO(t){let n=[];do n.push(Zk(t));while(t.next&&")"!=t.next&&"|"!=t.next);return 1==n.length?n[0]:{type:"seq",exprs:n}}function Zk(t){let n=ZM(t);for(;;)if(t.eat("+"))n={type:"plus",expr:n};else if(t.eat("*"))n={type:"star",expr:n};else if(t.eat("?"))n={type:"opt",expr:n};else if(t.eat("{"))n=ZC(t,n);else break;return n}function ZI(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let n=Number(t.next);return t.pos++,n}function ZC(t,n){let r=ZI(t),i=r;return t.eat(",")&&(i="}"!=t.next?ZI(t):-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:r,max:i,expr:n}}function ZM(t){if(t.eat("(")){let n=Zw(t);return t.eat(")")||t.err("Missing closing paren"),n}if(/\W/.test(t.next))t.err("Unexpected token '"+t.next+"'");else{let r=(function(t,n){let r=t.nodeTypes,i=r[n];if(i)return[i];let o=[];for(let a in r){let u=r[a];u.groups.indexOf(n)>-1&&o.push(u)}return 0==o.length&&t.err("No node type or group '"+n+"' found"),o})(t,t.next).map(n=>(null==t.inline?t.inline=n.isInline:t.inline!=n.isInline&&t.err("Mixing inline and block content"),{type:"name",value:n}));return t.pos++,1==r.length?r[0]:{type:"choice",exprs:r}}}function ZR(t,n){return n-t}function ZE(t,n){let r=[];return function n(i){let o=t[i];if(1==o.length&&!o[0].term)return n(o[0].to);r.push(i);for(let a=0;a<o.length;a++){let{term:u,to:s}=o[a];u||-1!=r.indexOf(s)||n(s)}}(n),r.sort(ZR)}function Zj(t){let n=Object.create(null);for(let r in t){let i=t[r];if(!i.hasDefault)return null;n[r]=i.default}return n}function ZN(t,n){let r=Object.create(null);for(let i in t){let o=n&&n[i];if(void 0===o){let a=t[i];if(a.hasDefault)o=a.default;else throw RangeError("No value supplied for attribute "+i)}r[i]=o}return r}function ZA(t){let n=Object.create(null);if(t)for(let r in t)n[r]=new ZL(t[r]);return n}let ZP=class t{constructor(t,n,r){this.name=t,this.schema=n,this.spec=r,this.markSet=null,this.groups=r.group?r.group.split(" "):[],this.attrs=ZA(r.attrs),this.defaultAttrs=Zj(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(r.inline||"text"==t),this.isText="text"==t}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==ZS.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let t in this.attrs)if(this.attrs[t].isRequired)return!0;return!1}compatibleContent(t){return this==t||this.contentMatch.compatible(t.contentMatch)}computeAttrs(t){return!t&&this.defaultAttrs?this.defaultAttrs:ZN(this.attrs,t)}create(t=null,n,r){if(this.isText)throw Error("NodeType.create can't construct text nodes");return new Zb(this,this.computeAttrs(t),Ze.from(n),Zi.setFrom(r))}createChecked(t=null,n,r){return n=Ze.from(n),this.checkContent(n),new Zb(this,this.computeAttrs(t),n,Zi.setFrom(r))}createAndFill(t=null,n,r){if(t=this.computeAttrs(t),(n=Ze.from(n)).size){let i=this.contentMatch.fillBefore(n);if(!i)return null;n=i.append(n)}let o=this.contentMatch.matchFragment(n),a=o&&o.fillBefore(Ze.empty,!0);return a?new Zb(this,t,n.append(a),Zi.setFrom(r)):null}validContent(t){let n=this.contentMatch.matchFragment(t);if(!n||!n.validEnd)return!1;for(let r=0;r<t.childCount;r++)if(!this.allowsMarks(t.child(r).marks))return!1;return!0}checkContent(t){if(!this.validContent(t))throw RangeError(`Invalid content for node ${this.name}: ${t.toString().slice(0,50)}`)}allowsMarkType(t){return null==this.markSet||this.markSet.indexOf(t)>-1}allowsMarks(t){if(null==this.markSet)return!0;for(let n=0;n<t.length;n++)if(!this.allowsMarkType(t[n].type))return!1;return!0}allowedMarks(t){if(null==this.markSet)return t;let n;for(let r=0;r<t.length;r++)this.allowsMarkType(t[r].type)?n&&n.push(t[r]):n||(n=t.slice(0,r));return n?n.length?n:Zi.none:t}static compile(n,r){let i=Object.create(null);n.forEach((n,o)=>i[n]=new t(n,r,o));let o=r.spec.topNode||"doc";if(!i[o])throw RangeError("Schema is missing its top node type ('"+o+"')");if(!i.text)throw RangeError("Every schema needs a 'text' type");for(let a in i.text.attrs)throw RangeError("The text node type should not have attributes");return i}};class ZL{constructor(t){this.hasDefault=Object.prototype.hasOwnProperty.call(t,"default"),this.default=t.default}get isRequired(){return!this.hasDefault}}class ZD{constructor(t,n,r,i){this.name=t,this.rank=n,this.schema=r,this.spec=i,this.attrs=ZA(i.attrs),this.excluded=null;let o=Zj(this.attrs);this.instance=o?new Zi(this,o):null}create(t=null){return!t&&this.instance?this.instance:new Zi(this,ZN(this.attrs,t))}static compile(t,n){let r=Object.create(null),i=0;return t.forEach((t,o)=>r[t]=new ZD(t,i++,n,o)),r}removeFromSet(t){for(var n=0;n<t.length;n++)t[n].type==this&&(t=t.slice(0,n).concat(t.slice(n+1)),n--);return t}isInSet(t){for(let n=0;n<t.length;n++)if(t[n].type==this)return t[n]}excludes(t){return this.excluded.indexOf(t)>-1}}class ZF{constructor(t){this.cached=Object.create(null);let n=this.spec={};for(let r in t)n[r]=t[r];n.nodes=G7.from(t.nodes),n.marks=G7.from(t.marks||{}),this.nodes=ZP.compile(this.spec.nodes,this),this.marks=ZD.compile(this.spec.marks,this);let i=Object.create(null);for(let o in this.nodes){if(o in this.marks)throw RangeError(o+" can not be both a node and a mark");let a=this.nodes[o],u=a.spec.content||"",s=a.spec.marks;a.contentMatch=i[u]||(i[u]=ZS.parse(u,this.nodes)),a.inlineContent=a.contentMatch.inlineContent,a.markSet="_"==s?null:s?ZW(this,s.split(" ")):""!=s&&a.inlineContent?null:[]}for(let c in this.marks){let l=this.marks[c],f=l.spec.excludes;l.excluded=null==f?[l]:""==f?[]:ZW(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.wrappings=Object.create(null)}node(t,n=null,r,i){if("string"==typeof t)t=this.nodeType(t);else if(t instanceof ZP){if(t.schema!=this)throw RangeError("Node type from different schema used ("+t.name+")")}else throw RangeError("Invalid node type: "+t);return t.createChecked(n,r,i)}text(t,n){let r=this.nodes.text;return new Zx(r,r.defaultAttrs,t,Zi.setFrom(n))}mark(t,n){return"string"==typeof t&&(t=this.marks[t]),t.create(n)}nodeFromJSON(t){return Zb.fromJSON(this,t)}markFromJSON(t){return Zi.fromJSON(this,t)}nodeType(t){let n=this.nodes[t];if(!n)throw RangeError("Unknown node type: "+t);return n}}function ZW(t,n){let r=[];for(let i=0;i<n.length;i++){let o=n[i],a=t.marks[o],u=a;if(a)r.push(a);else for(let s in t.marks){let c=t.marks[s];("_"==o||c.spec.group&&c.spec.group.split(" ").indexOf(o)>-1)&&r.push(u=c)}if(!u)throw SyntaxError("Unknown mark type: '"+n[i]+"'")}return r}class ZU{constructor(t,n){this.schema=t,this.rules=n,this.tags=[],this.styles=[],n.forEach(t=>{t.tag?this.tags.push(t):t.style&&this.styles.push(t)}),this.normalizeLists=!this.tags.some(n=>{if(!/^(ul|ol)\b/.test(n.tag)||!n.node)return!1;let r=t.nodes[n.node];return r.contentMatch.matchType(r)})}parse(t,n={}){let r=new ZK(this,n,!1);return r.addAll(t,n.from,n.to),r.finish()}parseSlice(t,n={}){let r=new ZK(this,n,!0);return r.addAll(t,n.from,n.to),Za.maxOpen(r.finish())}matchTag(t,n,r){for(let i=r?this.tags.indexOf(r)+1:0;i<this.tags.length;i++){let o=this.tags[i];if(ZH(t,o.tag)&&(void 0===o.namespace||t.namespaceURI==o.namespace)&&(!o.context||n.matchesContext(o.context))){if(o.getAttrs){let a=o.getAttrs(t);if(!1===a)continue;o.attrs=a||void 0}return o}}}matchStyle(t,n,r,i){for(let o=i?this.styles.indexOf(i)+1:0;o<this.styles.length;o++){let a=this.styles[o],u=a.style;if(!(0!=u.indexOf(t)||a.context&&!r.matchesContext(a.context)||u.length>t.length&&(61!=u.charCodeAt(t.length)||u.slice(t.length+1)!=n))){if(a.getAttrs){let s=a.getAttrs(n);if(!1===s)continue;a.attrs=s||void 0}return a}}}static schemaRules(t){let n=[];function r(t){let r=null==t.priority?50:t.priority,i=0;for(;i<n.length;i++){let o=n[i];if((null==o.priority?50:o.priority)<r)break}n.splice(i,0,t)}for(let i in t.marks){let o=t.marks[i].spec.parseDOM;o&&o.forEach(t=>{r(t=ZG(t)),t.mark||t.ignore||t.clearMark||(t.mark=i)})}for(let a in t.nodes){let u=t.nodes[a].spec.parseDOM;u&&u.forEach(t=>{r(t=ZG(t)),t.node||t.ignore||t.mark||(t.node=a)})}return n}static fromSchema(t){return t.cached.domParser||(t.cached.domParser=new ZU(t,ZU.schemaRules(t)))}}let Zz={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},ZB={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},ZV={ol:!0,ul:!0};function Z$(t,n,r){return null!=n?(n?1:0)|("full"===n?2:0):t&&"pre"==t.whitespace?3:-5&r}class Zq{constructor(t,n,r,i,o,a,u){this.type=t,this.attrs=n,this.marks=r,this.pendingMarks=i,this.solid=o,this.options=u,this.content=[],this.activeMarks=Zi.none,this.stashMarks=[],this.match=a||(4&u?null:t.contentMatch)}findWrapping(t){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(Ze.from(t));if(n)this.match=this.type.contentMatch.matchFragment(n);else{let r=this.type.contentMatch,i;return(i=r.findWrapping(t.type))?(this.match=r,i):null}}return this.match.findWrapping(t.type)}finish(t){if(!(1&this.options)){let n=this.content[this.content.length-1],r;n&&n.isText&&(r=/[ \t\r\n\u000c]+$/.exec(n.text))&&(n.text.length==r[0].length?this.content.pop():this.content[this.content.length-1]=n.withText(n.text.slice(0,n.text.length-r[0].length)))}let i=Ze.from(this.content);return!t&&this.match&&(i=i.append(this.match.fillBefore(Ze.empty,!0))),this.type?this.type.create(this.attrs,i,this.marks):i}popFromStashMark(t){for(let n=this.stashMarks.length-1;n>=0;n--)if(t.eq(this.stashMarks[n]))return this.stashMarks.splice(n,1)[0]}applyPending(t){for(let n=0,r=this.pendingMarks;n<r.length;n++){let i=r[n];(this.type?this.type.allowsMarkType(i.type):ZZ(i.type,t))&&!i.isInSet(this.activeMarks)&&(this.activeMarks=i.addToSet(this.activeMarks),this.pendingMarks=i.removeFromSet(this.pendingMarks))}}inlineContext(t){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:t.parentNode&&!Zz.hasOwnProperty(t.parentNode.nodeName.toLowerCase())}}class ZK{constructor(t,n,r){this.parser=t,this.options=n,this.isOpen=r,this.open=0;let i=n.topNode,o,a=Z$(null,n.preserveWhitespace,0)|(r?4:0);o=i?new Zq(i.type,i.attrs,Zi.none,Zi.none,!0,n.topMatch||i.type.contentMatch,a):r?new Zq(null,null,Zi.none,Zi.none,!0,null,a):new Zq(t.schema.topNodeType,null,Zi.none,Zi.none,!0,null,a),this.nodes=[o],this.find=n.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(t){if(3==t.nodeType)this.addTextNode(t);else if(1==t.nodeType){let n=t.getAttribute("style");if(n){let r=this.readStyles(function(t){let n=/\s*([\w-]+)\s*:\s*([^;]+)/g,r,i=[];for(;r=n.exec(t);)i.push(r[1],r[2].trim());return i}(n));if(!r)return;let[i,o]=r,a=this.top;for(let u=0;u<o.length;u++)this.removePendingMark(o[u],a);for(let s=0;s<i.length;s++)this.addPendingMark(i[s]);this.addElement(t);for(let c=0;c<i.length;c++)this.removePendingMark(i[c],a);for(let l=0;l<o.length;l++)this.addPendingMark(o[l])}else this.addElement(t)}}addTextNode(t){let n=t.nodeValue,r=this.top;if(2&r.options||r.inlineContext(t)||/[^ \t\r\n\u000c]/.test(n)){if(1&r.options)n=2&r.options?n.replace(/\r\n?/g,`
|
|
7
|
-
`):n.replace(/\r?\n|\r/g," ");else if(n=n.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(n)&&this.open==this.nodes.length-1){let i=r.content[r.content.length-1],o=t.previousSibling;(!i||o&&"BR"==o.nodeName||i.isText&&/[ \t\r\n\u000c]$/.test(i.text))&&(n=n.slice(1))}n&&this.insertNode(this.parser.schema.text(n)),this.findInText(t)}else this.findInside(t)}addElement(t,n){let r=t.nodeName.toLowerCase(),i;ZV.hasOwnProperty(r)&&this.parser.normalizeLists&&function(t){for(let n=t.firstChild,r=null;n;n=n.nextSibling){let i=1==n.nodeType?n.nodeName.toLowerCase():null;i&&ZV.hasOwnProperty(i)&&r?(r.appendChild(n),n=r):"li"==i?r=n:i&&(r=null)}}(t);let o=this.options.ruleFromNode&&this.options.ruleFromNode(t)||(i=this.parser.matchTag(t,this,n));if(o?o.ignore:ZB.hasOwnProperty(r))this.findInside(t),this.ignoreFallback(t);else if(!o||o.skip||o.closeParent){o&&o.closeParent?this.open=Math.max(0,this.open-1):o&&o.skip.nodeType&&(t=o.skip);let a,u=this.top,s=this.needsBlock;if(Zz.hasOwnProperty(r))u.content.length&&u.content[0].isInline&&this.open&&(this.open--,u=this.top),a=!0,u.type||(this.needsBlock=!0);else if(!t.firstChild){this.leafFallback(t);return}this.addAll(t),a&&this.sync(u),this.needsBlock=s}else this.addElementByRule(t,o,!1===o.consuming?i:void 0)}leafFallback(t){"BR"==t.nodeName&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(t.ownerDocument.createTextNode(`
|
|
8
|
-
`))}ignoreFallback(t){"BR"!=t.nodeName||this.top.type&&this.top.type.inlineContent||this.findPlace(this.parser.schema.text("-"))}readStyles(t){let n=Zi.none,r=Zi.none;e:for(let i=0;i<t.length;i+=2)for(let o;;){let a=this.parser.matchStyle(t[i],t[i+1],this,o);if(!a)continue e;if(a.ignore)return null;if(a.clearMark?this.top.pendingMarks.forEach(t=>{a.clearMark(t)&&(r=t.addToSet(r))}):n=this.parser.schema.marks[a.mark].create(a.attrs).addToSet(n),!1===a.consuming)o=a;else break}return[n,r]}addElementByRule(t,n,r){let i,o,a;n.node?(o=this.parser.schema.nodes[n.node]).isLeaf?this.insertNode(o.create(n.attrs))||this.leafFallback(t):i=this.enter(o,n.attrs||null,n.preserveWhitespace):(a=this.parser.schema.marks[n.mark].create(n.attrs),this.addPendingMark(a));let u=this.top;if(o&&o.isLeaf)this.findInside(t);else if(r)this.addElement(t,r);else if(n.getContent)this.findInside(t),n.getContent(t,this.parser.schema).forEach(t=>this.insertNode(t));else{let s=t;"string"==typeof n.contentElement?s=t.querySelector(n.contentElement):"function"==typeof n.contentElement?s=n.contentElement(t):n.contentElement&&(s=n.contentElement),this.findAround(t,s,!0),this.addAll(s)}i&&this.sync(u)&&this.open--,a&&this.removePendingMark(a,u)}addAll(t,n,r){let i=n||0;for(let o=n?t.childNodes[n]:t.firstChild,a=null==r?null:t.childNodes[r];o!=a;o=o.nextSibling,++i)this.findAtPoint(t,i),this.addDOM(o);this.findAtPoint(t,i)}findPlace(t){let n,r;for(let i=this.open;i>=0;i--){let o=this.nodes[i],a=o.findWrapping(t);if(a&&(!n||n.length>a.length)&&(n=a,r=o,!a.length)||o.solid)break}if(!n)return!1;this.sync(r);for(let u=0;u<n.length;u++)this.enterInner(n[u],null,!1);return!0}insertNode(t){if(t.isInline&&this.needsBlock&&!this.top.type){let n=this.textblockFromContext();n&&this.enterInner(n)}if(this.findPlace(t)){this.closeExtra();let r=this.top;r.applyPending(t.type),r.match&&(r.match=r.match.matchType(t.type));let i=r.activeMarks;for(let o=0;o<t.marks.length;o++)(!r.type||r.type.allowsMarkType(t.marks[o].type))&&(i=t.marks[o].addToSet(i));return r.content.push(t.mark(i)),!0}return!1}enter(t,n,r){let i=this.findPlace(t.create(n));return i&&this.enterInner(t,n,!0,r),i}enterInner(t,n=null,r=!1,i){this.closeExtra();let o=this.top;o.applyPending(t),o.match=o.match&&o.match.matchType(t);let a=Z$(t,i,o.options);4&o.options&&0==o.content.length&&(a|=4),this.nodes.push(new Zq(t,n,o.activeMarks,o.pendingMarks,r,null,a)),this.open++}closeExtra(t=!1){let n=this.nodes.length-1;if(n>this.open){for(;n>this.open;n--)this.nodes[n-1].content.push(this.nodes[n].finish(t));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(this.isOpen||this.options.topOpen)}sync(t){for(let n=this.open;n>=0;n--)if(this.nodes[n]==t)return this.open=n,!0;return!1}get currentPos(){this.closeExtra();let t=0;for(let n=this.open;n>=0;n--){let r=this.nodes[n].content;for(let i=r.length-1;i>=0;i--)t+=r[i].nodeSize;n&&t++}return t}findAtPoint(t,n){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].node==t&&this.find[r].offset==n&&(this.find[r].pos=this.currentPos)}findInside(t){if(this.find)for(let n=0;n<this.find.length;n++)null==this.find[n].pos&&1==t.nodeType&&t.contains(this.find[n].node)&&(this.find[n].pos=this.currentPos)}findAround(t,n,r){if(t!=n&&this.find)for(let i=0;i<this.find.length;i++)null==this.find[i].pos&&1==t.nodeType&&t.contains(this.find[i].node)&&n.compareDocumentPosition(this.find[i].node)&(r?2:4)&&(this.find[i].pos=this.currentPos)}findInText(t){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==t&&(this.find[n].pos=this.currentPos-(t.nodeValue.length-this.find[n].offset))}matchesContext(t){if(t.indexOf("|")>-1)return t.split(/\s*\|\s*/).some(this.matchesContext,this);let n=t.split("/"),r=this.options.context,i=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),o=-(r?r.depth+1:0)+(i?0:1),a=(t,u)=>{for(;t>=0;t--){let s=n[t];if(""==s){if(t==n.length-1||0==t)continue;for(;u>=o;u--)if(a(t-1,u))return!0;return!1}{let c=u>0||0==u&&i?this.nodes[u].type:r&&u>=o?r.node(u-o).type:null;if(!c||c.name!=s&&-1==c.groups.indexOf(s))return!1;u--}}return!0};return a(n.length-1,this.open)}textblockFromContext(){let t=this.options.context;if(t)for(let n=t.depth;n>=0;n--){let r=t.node(n).contentMatchAt(t.indexAfter(n)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let i in this.parser.schema.nodes){let o=this.parser.schema.nodes[i];if(o.isTextblock&&o.defaultAttrs)return o}}addPendingMark(t){let n=function(t,n){for(let r=0;r<n.length;r++)if(t.eq(n[r]))return n[r]}(t,this.top.pendingMarks);n&&this.top.stashMarks.push(n),this.top.pendingMarks=t.addToSet(this.top.pendingMarks)}removePendingMark(t,n){for(let r=this.open;r>=0;r--){let i=this.nodes[r];if(i.pendingMarks.lastIndexOf(t)>-1)i.pendingMarks=t.removeFromSet(i.pendingMarks);else{i.activeMarks=t.removeFromSet(i.activeMarks);let o=i.popFromStashMark(t);o&&i.type&&i.type.allowsMarkType(o.type)&&(i.activeMarks=o.addToSet(i.activeMarks))}if(i==n)break}}}function ZH(t,n){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,n)}function ZG(t){let n={};for(let r in t)n[r]=t[r];return n}function ZZ(t,n){let r=n.schema.nodes;for(let i in r){let o=r[i];if(!o.allowsMarkType(t))continue;let a=[],u=t=>{a.push(t);for(let r=0;r<t.edgeCount;r++){let{type:i,next:o}=t.edge(r);if(i==n||0>a.indexOf(o)&&u(o))return!0}};if(u(o.contentMatch))return!0}}class ZY{constructor(t,n){this.nodes=t,this.marks=n}serializeFragment(t,n={},r){r||(r=ZQ(n).createDocumentFragment());let i=r,o=[];return t.forEach(t=>{if(o.length||t.marks.length){let r=0,a=0;for(;r<o.length&&a<t.marks.length;){let u=t.marks[a];if(!this.marks[u.type.name]){a++;continue}if(!u.eq(o[r][0])||!1===u.type.spec.spanning)break;r++,a++}for(;r<o.length;)i=o.pop()[1];for(;a<t.marks.length;){let s=t.marks[a++],c=this.serializeMark(s,t.isInline,n);c&&(o.push([s,i]),i.appendChild(c.dom),i=c.contentDOM||c.dom)}}i.appendChild(this.serializeNodeInner(t,n))}),r}serializeNodeInner(t,n){let{dom:r,contentDOM:i}=ZY.renderSpec(ZQ(n),this.nodes[t.type.name](t));if(i){if(t.isLeaf)throw RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(t.content,n,i)}return r}serializeNode(t,n={}){let r=this.serializeNodeInner(t,n);for(let i=t.marks.length-1;i>=0;i--){let o=this.serializeMark(t.marks[i],t.isInline,n);o&&((o.contentDOM||o.dom).appendChild(r),r=o.dom)}return r}serializeMark(t,n,r={}){let i=this.marks[t.type.name];return i&&ZY.renderSpec(ZQ(r),i(t,n))}static renderSpec(t,n,r=null){if("string"==typeof n)return{dom:t.createTextNode(n)};if(null!=n.nodeType)return{dom:n};if(n.dom&&null!=n.dom.nodeType)return n;let i=n[0],o=i.indexOf(" ");o>0&&(r=i.slice(0,o),i=i.slice(o+1));let a,u=r?t.createElementNS(r,i):t.createElement(i),s=n[1],c=1;if(s&&"object"==typeof s&&null==s.nodeType&&!Array.isArray(s)){for(let l in c=2,s)if(null!=s[l]){let f=l.indexOf(" ");f>0?u.setAttributeNS(l.slice(0,f),l.slice(f+1),s[l]):u.setAttribute(l,s[l])}}for(let d=c;d<n.length;d++){let p=n[d];if(0===p){if(d<n.length-1||d>c)throw RangeError("Content hole must be the only child of its parent node");return{dom:u,contentDOM:u}}{let{dom:h,contentDOM:m}=ZY.renderSpec(t,p,r);if(u.appendChild(h),m){if(a)throw RangeError("Multiple content holes");a=m}}}return{dom:u,contentDOM:a}}static fromSchema(t){return t.cached.domSerializer||(t.cached.domSerializer=new ZY(this.nodesFromSchema(t),this.marksFromSchema(t)))}static nodesFromSchema(t){let n=ZJ(t.nodes);return n.text||(n.text=t=>t.text),n}static marksFromSchema(t){return ZJ(t.marks)}}function ZJ(t){let n={};for(let r in t){let i=t[r].spec.toDOM;i&&(n[r]=i)}return n}function ZQ(t){return t.document||window.document}function ZX(t,n){return t+65536*n}function Z0(t){return 65535&t}class Z1{constructor(t,n,r){this.pos=t,this.delInfo=n,this.recover=r}get deleted(){return(8&this.delInfo)>0}get deletedBefore(){return(5&this.delInfo)>0}get deletedAfter(){return(6&this.delInfo)>0}get deletedAcross(){return(4&this.delInfo)>0}}class Z2{constructor(t,n=!1){if(this.ranges=t,this.inverted=n,!t.length&&Z2.empty)return Z2.empty}recover(t){var n;let r=0,i=Z0(t);if(!this.inverted)for(let o=0;o<i;o++)r+=this.ranges[3*o+2]-this.ranges[3*o+1];return this.ranges[3*i]+r+(t-(65535&t))/65536}mapResult(t,n=1){return this._map(t,n,!1)}map(t,n=1){return this._map(t,n,!0)}_map(t,n,r){let i=0,o=this.inverted?2:1,a=this.inverted?1:2;for(let u=0;u<this.ranges.length;u+=3){let s=this.ranges[u]-(this.inverted?i:0);if(s>t)break;let c=this.ranges[u+o],l=this.ranges[u+a],f=s+c;if(t<=f){let d=c?t==s?-1:t==f?1:n:n,p=s+i+(d<0?0:l);if(r)return p;let h=t==(n<0?s:f)?null:ZX(u/3,t-s),m=t==s?2:t==f?1:4;return(n<0?t!=s:t!=f)&&(m|=8),new Z1(p,m,h)}i+=l-c}return r?t+i:new Z1(t+i,0,null)}touches(t,n){let r=0,i=Z0(n),o=this.inverted?2:1,a=this.inverted?1:2;for(let u=0;u<this.ranges.length;u+=3){let s=this.ranges[u]-(this.inverted?r:0);if(s>t)break;let c=this.ranges[u+o];if(t<=s+c&&u==3*i)return!0;r+=this.ranges[u+a]-c}return!1}forEach(t){let n=this.inverted?2:1,r=this.inverted?1:2;for(let i=0,o=0;i<this.ranges.length;i+=3){let a=this.ranges[i],u=a-(this.inverted?o:0),s=a+(this.inverted?0:o),c=this.ranges[i+n],l=this.ranges[i+r];t(u,u+c,s,s+l),o+=l-c}}invert(){return new Z2(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(t){return 0==t?Z2.empty:new Z2(t<0?[0,-t,0]:[0,0,t])}}Z2.empty=new Z2([]);class Z3{constructor(t=[],n,r=0,i=t.length){this.maps=t,this.mirror=n,this.from=r,this.to=i}slice(t=0,n=this.maps.length){return new Z3(this.maps,this.mirror,t,n)}copy(){return new Z3(this.maps.slice(),this.mirror&&this.mirror.slice(),this.from,this.to)}appendMap(t,n){this.to=this.maps.push(t),null!=n&&this.setMirror(this.maps.length-1,n)}appendMapping(t){for(let n=0,r=this.maps.length;n<t.maps.length;n++){let i=t.getMirror(n);this.appendMap(t.maps[n],null!=i&&i<n?r+i:void 0)}}getMirror(t){if(this.mirror){for(let n=0;n<this.mirror.length;n++)if(this.mirror[n]==t)return this.mirror[n+(n%2?-1:1)]}}setMirror(t,n){this.mirror||(this.mirror=[]),this.mirror.push(t,n)}appendMappingInverted(t){for(let n=t.maps.length-1,r=this.maps.length+t.maps.length;n>=0;n--){let i=t.getMirror(n);this.appendMap(t.maps[n].invert(),null!=i&&i>n?r-i-1:void 0)}}invert(){let t=new Z3;return t.appendMappingInverted(this),t}map(t,n=1){if(this.mirror)return this._map(t,n,!0);for(let r=this.from;r<this.to;r++)t=this.maps[r].map(t,n);return t}mapResult(t,n=1){return this._map(t,n,!1)}_map(t,n,r){let i=0;for(let o=this.from;o<this.to;o++){let a=this.maps[o].mapResult(t,n);if(null!=a.recover){let u=this.getMirror(o);if(null!=u&&u>o&&u<this.to){o=u,t=this.maps[u].recover(a.recover);continue}}i|=a.delInfo,t=a.pos}return r?t:new Z1(t,i,null)}}let Z4=Object.create(null);class Z5{getMap(){return Z2.empty}merge(t){return null}static fromJSON(t,n){if(!n||!n.stepType)throw RangeError("Invalid input for Step.fromJSON");let r=Z4[n.stepType];if(!r)throw RangeError(`No step type ${n.stepType} defined`);return r.fromJSON(t,n)}static jsonID(t,n){if(t in Z4)throw RangeError("Duplicate use of step JSON ID "+t);return Z4[t]=n,n.prototype.jsonID=t,n}}class Z9{constructor(t,n){this.doc=t,this.failed=n}static ok(t){return new Z9(t,null)}static fail(t){return new Z9(null,t)}static fromReplace(t,n,r,i){try{return Z9.ok(t.replace(n,r,i))}catch(o){if(o instanceof Zo)return Z9.fail(o.message);throw o}}}function Z6(t,n,r){let i=[];for(let o=0;o<t.childCount;o++){let a=t.child(o);a.content.size&&(a=a.copy(Z6(a.content,n,a))),a.isInline&&(a=n(a,r,o)),i.push(a)}return Ze.fromArray(i)}class Z8 extends Z5{constructor(t,n,r){super(),this.from=t,this.to=n,this.mark=r}apply(t){let n=t.slice(this.from,this.to),r=t.resolve(this.from),i=r.node(r.sharedDepth(this.to)),o=new Za(Z6(n.content,(t,n)=>t.isAtom&&n.type.allowsMarkType(this.mark.type)?t.mark(this.mark.addToSet(t.marks)):t,i),n.openStart,n.openEnd);return Z9.fromReplace(t,this.from,this.to,o)}invert(){return new Z7(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new Z8(n.pos,r.pos,this.mark)}merge(t){return t instanceof Z8&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new Z8(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if("number"!=typeof n.from||"number"!=typeof n.to)throw RangeError("Invalid input for AddMarkStep.fromJSON");return new Z8(n.from,n.to,t.markFromJSON(n.mark))}}Z5.jsonID("addMark",Z8);class Z7 extends Z5{constructor(t,n,r){super(),this.from=t,this.to=n,this.mark=r}apply(t){let n=t.slice(this.from,this.to),r=new Za(Z6(n.content,t=>t.mark(this.mark.removeFromSet(t.marks)),t),n.openStart,n.openEnd);return Z9.fromReplace(t,this.from,this.to,r)}invert(){return new Z8(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new Z7(n.pos,r.pos,this.mark)}merge(t){return t instanceof Z7&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new Z7(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if("number"!=typeof n.from||"number"!=typeof n.to)throw RangeError("Invalid input for RemoveMarkStep.fromJSON");return new Z7(n.from,n.to,t.markFromJSON(n.mark))}}Z5.jsonID("removeMark",Z7);class Ye extends Z5{constructor(t,n){super(),this.pos=t,this.mark=n}apply(t){let n=t.nodeAt(this.pos);if(!n)return Z9.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return Z9.fromReplace(t,this.pos,this.pos+1,new Za(Ze.from(r),0,n.isLeaf?0:1))}invert(t){let n=t.nodeAt(this.pos);if(n){let r=this.mark.addToSet(n.marks);if(r.length==n.marks.length){for(let i=0;i<n.marks.length;i++)if(!n.marks[i].isInSet(r))return new Ye(this.pos,n.marks[i]);return new Ye(this.pos,this.mark)}}return new Yt(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new Ye(n.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if("number"!=typeof n.pos)throw RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new Ye(n.pos,t.markFromJSON(n.mark))}}Z5.jsonID("addNodeMark",Ye);class Yt extends Z5{constructor(t,n){super(),this.pos=t,this.mark=n}apply(t){let n=t.nodeAt(this.pos);if(!n)return Z9.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.removeFromSet(n.marks));return Z9.fromReplace(t,this.pos,this.pos+1,new Za(Ze.from(r),0,n.isLeaf?0:1))}invert(t){let n=t.nodeAt(this.pos);return n&&this.mark.isInSet(n.marks)?new Ye(this.pos,this.mark):this}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new Yt(n.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if("number"!=typeof n.pos)throw RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new Yt(n.pos,t.markFromJSON(n.mark))}}Z5.jsonID("removeNodeMark",Yt);class Yn extends Z5{constructor(t,n,r,i=!1){super(),this.from=t,this.to=n,this.slice=r,this.structure=i}apply(t){return this.structure&&Yi(t,this.from,this.to)?Z9.fail("Structure replace would overwrite content"):Z9.fromReplace(t,this.from,this.to,this.slice)}getMap(){return new Z2([this.from,this.to-this.from,this.slice.size])}invert(t){return new Yn(this.from,this.from+this.slice.size,t.slice(this.from,this.to))}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deletedAcross&&r.deletedAcross?null:new Yn(n.pos,Math.max(n.pos,r.pos),this.slice)}merge(t){if(!(t instanceof Yn)||t.structure||this.structure)return null;if(this.from+this.slice.size!=t.from||this.slice.openEnd||t.slice.openStart){if(t.to!=this.from||this.slice.openStart||t.slice.openEnd)return null;{let n=this.slice.size+t.slice.size==0?Za.empty:new Za(t.slice.content.append(this.slice.content),t.slice.openStart,this.slice.openEnd);return new Yn(t.from,this.to,n,this.structure)}}{let r=this.slice.size+t.slice.size==0?Za.empty:new Za(this.slice.content.append(t.slice.content),this.slice.openStart,t.slice.openEnd);return new Yn(this.from,this.to+(t.to-t.from),r,this.structure)}}toJSON(){let t={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(t,n){if("number"!=typeof n.from||"number"!=typeof n.to)throw RangeError("Invalid input for ReplaceStep.fromJSON");return new Yn(n.from,n.to,Za.fromJSON(t,n.slice),!!n.structure)}}Z5.jsonID("replace",Yn);class Yr extends Z5{constructor(t,n,r,i,o,a,u=!1){super(),this.from=t,this.to=n,this.gapFrom=r,this.gapTo=i,this.slice=o,this.insert=a,this.structure=u}apply(t){if(this.structure&&(Yi(t,this.from,this.gapFrom)||Yi(t,this.gapTo,this.to)))return Z9.fail("Structure gap-replace would overwrite content");let n=t.slice(this.gapFrom,this.gapTo);if(n.openStart||n.openEnd)return Z9.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,n.content);return r?Z9.fromReplace(t,this.from,this.to,r):Z9.fail("Content does not fit in gap")}getMap(){return new Z2([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(t){let n=this.gapTo-this.gapFrom;return new Yr(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,t.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1),i=t.map(this.gapFrom,-1),o=t.map(this.gapTo,1);return n.deletedAcross&&r.deletedAcross||i<n.pos||o>r.pos?null:new Yr(n.pos,r.pos,i,o,this.slice,this.insert,this.structure)}toJSON(){let t={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(t,n){if("number"!=typeof n.from||"number"!=typeof n.to||"number"!=typeof n.gapFrom||"number"!=typeof n.gapTo||"number"!=typeof n.insert)throw RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new Yr(n.from,n.to,n.gapFrom,n.gapTo,Za.fromJSON(t,n.slice),n.insert,!!n.structure)}}function Yi(t,n,r){let i=t.resolve(n),o=r-n,a=i.depth;for(;o>0&&a>0&&i.indexAfter(a)==i.node(a).childCount;)a--,o--;if(o>0){let u=i.node(a).maybeChild(i.indexAfter(a));for(;o>0;){if(!u||u.isLeaf)return!0;u=u.firstChild,o--}}return!1}function Yo(t,n,r){return(0==n||t.canReplace(n,t.childCount))&&(r==t.childCount||t.canReplace(0,r))}function Ya(t){let n=t.parent.content.cutByIndex(t.startIndex,t.endIndex);for(let r=t.depth;;--r){let i=t.$from.node(r),o=t.$from.index(r),a=t.$to.indexAfter(r);if(r<t.depth&&i.canReplace(o,a,n))return r;if(0==r||i.type.spec.isolating||!Yo(i,o,a))break}return null}function Yu(t,n,r=null,i=t){let o=function(t,n){let{parent:r,startIndex:i,endIndex:o}=t,a=r.contentMatchAt(i).findWrapping(n);if(!a)return null;let u=a.length?a[0]:n;return r.canReplaceWith(i,o,u)?a:null}(t,n),a=o&&function(t,n){let{parent:r,startIndex:i,endIndex:o}=t,a=r.child(i),u=n.contentMatch.findWrapping(a.type);if(!u)return null;let s=(u.length?u[u.length-1]:n).contentMatch;for(let c=i;s&&c<o;c++)s=s.matchType(r.child(c).type);return s&&s.validEnd?u:null}(i,n);return a?o.map(Ys).concat({type:n,attrs:r}).concat(a.map(Ys)):null}function Ys(t){return{type:t,attrs:null}}function Yc(t,n,r=1,i){let o=t.resolve(n),a=o.depth-r,u=i&&i[i.length-1]||o.parent;if(a<0||o.parent.type.spec.isolating||!o.parent.canReplace(o.index(),o.parent.childCount)||!u.type.validContent(o.parent.content.cutByIndex(o.index(),o.parent.childCount)))return!1;for(let s=o.depth-1,c=r-2;s>a;s--,c--){let l=o.node(s),f=o.index(s);if(l.type.spec.isolating)return!1;let d=l.content.cutByIndex(f,l.childCount),p=i&&i[c+1];p&&(d=d.replaceChild(0,p.type.create(p.attrs)));let h=i&&i[c]||l;if(!l.canReplace(f+1,l.childCount)||!h.type.validContent(d))return!1}let m=o.indexAfter(a),g=i&&i[0];return o.node(a).canReplaceWith(m,m,g?g.type:o.node(a+1).type)}function Yl(t,n){let r=t.resolve(n),i=r.index();return Yf(r.nodeBefore,r.nodeAfter)&&r.parent.canReplace(i,i+1)}function Yf(t,n){return!!(t&&n&&!t.isLeaf&&t.canAppend(n))}function Yd(t,n,r=-1){let i=t.resolve(n);for(let o=i.depth;;o--){let a,u,s=i.index(o);if(o==i.depth?(a=i.nodeBefore,u=i.nodeAfter):r>0?(a=i.node(o+1),s++,u=i.node(o).maybeChild(s)):(a=i.node(o).maybeChild(s-1),u=i.node(o+1)),a&&!a.isTextblock&&Yf(a,u)&&i.node(o).canReplace(s,s+1))return n;if(0==o)break;n=r<0?i.before(o):i.after(o)}}function Yp(t,n,r=n,i=Za.empty){if(n==r&&!i.size)return null;let o=t.resolve(n),a=t.resolve(r);return Yh(o,a,i)?new Yn(n,r,i):new Ym(o,a,i).fit()}function Yh(t,n,r){return!r.openStart&&!r.openEnd&&t.start()==n.start()&&t.parent.canReplace(t.index(),n.index(),r.content)}Z5.jsonID("replaceAround",Yr);class Ym{constructor(t,n,r){this.$from=t,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=Ze.empty;for(let i=0;i<=t.depth;i++){let o=t.node(i);this.frontier.push({type:o.type,match:o.contentMatchAt(t.indexAfter(i))})}for(let a=t.depth;a>0;a--)this.placed=Ze.from(t.node(a).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let t=this.findFittable();t?this.placeNodes(t):this.openMore()||this.dropNode()}let n=this.mustMoveInline(),r=this.placed.size-this.depth-this.$from.depth,i=this.$from,o=this.close(n<0?this.$to:i.doc.resolve(n));if(!o)return null;let a=this.placed,u=i.depth,s=o.depth;for(;u&&s&&1==a.childCount;)a=a.firstChild.content,u--,s--;let c=new Za(a,u,s);return n>-1?new Yr(i.pos,n,this.$to.pos,this.$to.end(),c,r):c.size||i.pos!=this.$to.pos?new Yn(i.pos,o.pos,c):null}findFittable(){let t=this.unplaced.openStart;for(let n=this.unplaced.content,r=0,i=this.unplaced.openEnd;r<t;r++){let o=n.firstChild;if(n.childCount>1&&(i=0),o.type.spec.isolating&&i<=r){t=r;break}n=o.content}for(let a=1;a<=2;a++)for(let u=1==a?t:this.unplaced.openStart;u>=0;u--){let s,c=null,l=(u?(c=Yv(this.unplaced.content,u-1).firstChild).content:this.unplaced.content).firstChild;for(let f=this.depth;f>=0;f--){let{type:d,match:p}=this.frontier[f],h,m=null;if(1==a&&(l?p.matchType(l.type)||(m=p.fillBefore(Ze.from(l),!1)):c&&d.compatibleContent(c.type)))return{sliceDepth:u,frontierDepth:f,parent:c,inject:m};if(2==a&&l&&(h=p.findWrapping(l.type)))return{sliceDepth:u,frontierDepth:f,parent:c,wrap:h};if(c&&p.matchType(c.type))break}}}openMore(){let{content:t,openStart:n,openEnd:r}=this.unplaced,i=Yv(t,n);return!!i.childCount&&!i.firstChild.isLeaf&&(this.unplaced=new Za(t,n+1,Math.max(r,i.size+n>=t.size-r?n+1:0)),!0)}dropNode(){let{content:t,openStart:n,openEnd:r}=this.unplaced,i=Yv(t,n);if(i.childCount<=1&&n>0){let o=t.size-n<=n+i.size;this.unplaced=new Za(Yg(t,n-1,1),n-1,o?n-1:r)}else this.unplaced=new Za(Yg(t,n,1),n,r)}placeNodes({sliceDepth:t,frontierDepth:n,parent:r,inject:i,wrap:o}){for(;this.depth>n;)this.closeFrontierNode();if(o)for(let a=0;a<o.length;a++)this.openFrontierNode(o[a]);let u=this.unplaced,s=r?r.content:u.content,c=u.openStart-t,l=0,f=[],{match:d,type:p}=this.frontier[n];if(i){for(let h=0;h<i.childCount;h++)f.push(i.child(h));d=d.matchFragment(i)}let m=s.size+t-(u.content.size-u.openEnd);for(;l<s.childCount;){let g=s.child(l),y=d.matchType(g.type);if(!y)break;(++l>1||0==c||g.content.size)&&(d=y,f.push(Yb(g.mark(p.allowedMarks(g.marks)),1==l?c:0,l==s.childCount?m:-1)))}let v=l==s.childCount;v||(m=-1),this.placed=Yy(this.placed,n,Ze.from(f)),this.frontier[n].match=d,v&&m<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let b=0,x=s;b<m;b++){let _=x.lastChild;this.frontier.push({type:_.type,match:_.contentMatchAt(_.childCount)}),x=_.content}this.unplaced=v?0==t?Za.empty:new Za(Yg(u.content,t-1,1),t-1,m<0?u.openEnd:t-1):new Za(Yg(u.content,t,l),u.openStart,u.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return -1;let t=this.frontier[this.depth],n;if(!t.type.isTextblock||!Yx(this.$to,this.$to.depth,t.type,t.match,!1)||this.$to.depth==this.depth&&(n=this.findCloseLevel(this.$to))&&n.depth==this.depth)return -1;let{depth:r}=this.$to,i=this.$to.after(r);for(;r>1&&i==this.$to.end(--r);)++i;return i}findCloseLevel(t){e:for(let n=Math.min(this.depth,t.depth);n>=0;n--){let{match:r,type:i}=this.frontier[n],o=n<t.depth&&t.end(n+1)==t.pos+(t.depth-(n+1)),a=Yx(t,n,i,r,o);if(a){for(let u=n-1;u>=0;u--){let{match:s,type:c}=this.frontier[u],l=Yx(t,u,c,s,!0);if(!l||l.childCount)continue e}return{depth:n,fit:a,move:o?t.doc.resolve(t.after(n+1)):t}}}}close(t){let n=this.findCloseLevel(t);if(!n)return null;for(;this.depth>n.depth;)this.closeFrontierNode();n.fit.childCount&&(this.placed=Yy(this.placed,n.depth,n.fit)),t=n.move;for(let r=n.depth+1;r<=t.depth;r++){let i=t.node(r),o=i.type.contentMatch.fillBefore(i.content,!0,t.index(r));this.openFrontierNode(i.type,i.attrs,o)}return t}openFrontierNode(t,n=null,r){let i=this.frontier[this.depth];i.match=i.match.matchType(t),this.placed=Yy(this.placed,this.depth,Ze.from(t.create(n,r))),this.frontier.push({type:t,match:t.contentMatch})}closeFrontierNode(){let t=this.frontier.pop().match.fillBefore(Ze.empty,!0);t.childCount&&(this.placed=Yy(this.placed,this.frontier.length,t))}}function Yg(t,n,r){return 0==n?t.cutByIndex(r,t.childCount):t.replaceChild(0,t.firstChild.copy(Yg(t.firstChild.content,n-1,r)))}function Yy(t,n,r){return 0==n?t.append(r):t.replaceChild(t.childCount-1,t.lastChild.copy(Yy(t.lastChild.content,n-1,r)))}function Yv(t,n){for(let r=0;r<n;r++)t=t.firstChild.content;return t}function Yb(t,n,r){if(n<=0)return t;let i=t.content;return n>1&&(i=i.replaceChild(0,Yb(i.firstChild,n-1,1==i.childCount?r-1:0))),n>0&&(i=t.type.contentMatch.fillBefore(i).append(i),r<=0&&(i=i.append(t.type.contentMatch.matchFragment(i).fillBefore(Ze.empty,!0)))),t.copy(i)}function Yx(t,n,r,i,o){let a=t.node(n),u=o?t.indexAfter(n):t.index(n);if(u==a.childCount&&!r.compatibleContent(a.type))return null;let s=i.fillBefore(a.content,!0,u);return s&&!function(t,n,r){for(let i=r;i<n.childCount;i++)if(!t.allowsMarks(n.child(i).marks))return!0;return!1}(r,a.content,u)?s:null}function Y_(t){return t.spec.defining||t.spec.definingForContent}function YS(t,n,r,i,o){if(n<r){let a=t.firstChild;t=t.replaceChild(0,a.copy(YS(a.content,n+1,r,i,a)))}if(n>i){let u=o.contentMatchAt(0),s=u.fillBefore(t).append(t);t=s.append(u.matchFragment(s).fillBefore(Ze.empty,!0))}return t}function YT(t,n){let r=[],i=Math.min(t.depth,n.depth);for(let o=i;o>=0;o--){let a=t.start(o);if(a<t.pos-(t.depth-o)||n.end(o)>n.pos+(n.depth-o)||t.node(o).type.spec.isolating||n.node(o).type.spec.isolating)break;(a==n.start(o)||o==t.depth&&o==n.depth&&t.parent.inlineContent&&n.parent.inlineContent&&o&&n.start(o-1)==a-1)&&r.push(o)}return r}class Yw extends Z5{constructor(t,n,r){super(),this.pos=t,this.attr=n,this.value=r}apply(t){let n=t.nodeAt(this.pos);if(!n)return Z9.fail("No node at attribute step's position");let r=Object.create(null);for(let i in n.attrs)r[i]=n.attrs[i];r[this.attr]=this.value;let o=n.type.create(r,null,n.marks);return Z9.fromReplace(t,this.pos,this.pos+1,new Za(Ze.from(o),0,n.isLeaf?0:1))}getMap(){return Z2.empty}invert(t){return new Yw(this.pos,this.attr,t.nodeAt(this.pos).attrs[this.attr])}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new Yw(n.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(t,n){if("number"!=typeof n.pos||"string"!=typeof n.attr)throw RangeError("Invalid input for AttrStep.fromJSON");return new Yw(n.pos,n.attr,n.value)}}Z5.jsonID("attr",Yw);let YO=class extends Error{};(YO=function t(n){let r=Error.call(this,n);return r.__proto__=t.prototype,r}).prototype=Object.create(Error.prototype),YO.prototype.constructor=YO,YO.prototype.name="TransformError";class Yk{constructor(t){this.doc=t,this.steps=[],this.docs=[],this.mapping=new Z3}get before(){return this.docs.length?this.docs[0]:this.doc}step(t){let n=this.maybeStep(t);if(n.failed)throw new YO(n.failed);return this}maybeStep(t){let n=t.apply(this.doc);return n.failed||this.addStep(t,n.doc),n}get docChanged(){return this.steps.length>0}addStep(t,n){this.docs.push(this.doc),this.steps.push(t),this.mapping.appendMap(t.getMap()),this.doc=n}replace(t,n=t,r=Za.empty){let i=Yp(this.doc,t,n,r);return i&&this.step(i),this}replaceWith(t,n,r){return this.replace(t,n,new Za(Ze.from(r),0,0))}delete(t,n){return this.replace(t,n,Za.empty)}insert(t,n){return this.replaceWith(t,t,n)}replaceRange(t,n,r){return function(t,n,r,i){if(!i.size)return t.deleteRange(n,r);let o=t.doc.resolve(n),a=t.doc.resolve(r);if(Yh(o,a,i))return t.step(new Yn(n,r,i));let u=YT(o,t.doc.resolve(r));0==u[u.length-1]&&u.pop();let s=-(o.depth+1);u.unshift(s);for(let c=o.depth,l=o.pos-1;c>0;c--,l--){let f=o.node(c).type.spec;if(f.defining||f.definingAsContext||f.isolating)break;u.indexOf(c)>-1?s=c:o.before(c)==l&&u.splice(1,0,-c)}let d=u.indexOf(s),p=[],h=i.openStart;for(let m=i.content,g=0;;g++){let y=m.firstChild;if(p.push(y),g==i.openStart)break;m=y.content}for(let v=h-1;v>=0;v--){let b=p[v].type,x=Y_(b);if(x&&o.node(d).type!=b)h=v;else if(x||!b.isTextblock)break}for(let _=i.openStart;_>=0;_--){let S=(_+h+1)%(i.openStart+1),T=p[S];if(T)for(let w=0;w<u.length;w++){let O=u[(w+d)%u.length],k=!0;O<0&&(k=!1,O=-O);let I=o.node(O-1),C=o.index(O-1);if(I.canReplaceWith(C,C,T.type,T.marks))return t.replace(o.before(O),k?a.after(O):r,new Za(YS(i.content,0,i.openStart,S),S,i.openEnd))}}let M=t.steps.length;for(let R=u.length-1;R>=0&&(t.replace(n,r,i),!(t.steps.length>M));R--){let E=u[R];E<0||(n=o.before(E),r=a.after(E))}}(this,t,n,r),this}replaceRangeWith(t,n,r){return function(t,n,r,i){if(!i.isInline&&n==r&&t.doc.resolve(n).parent.content.size){let o=function(t,n,r){let i=t.resolve(n);if(i.parent.canReplaceWith(i.index(),i.index(),r))return n;if(0==i.parentOffset)for(let o=i.depth-1;o>=0;o--){let a=i.index(o);if(i.node(o).canReplaceWith(a,a,r))return i.before(o+1);if(a>0)return null}if(i.parentOffset==i.parent.content.size)for(let u=i.depth-1;u>=0;u--){let s=i.indexAfter(u);if(i.node(u).canReplaceWith(s,s,r))return i.after(u+1);if(s<i.node(u).childCount)break}return null}(t.doc,n,i.type);null!=o&&(n=r=o)}t.replaceRange(n,r,new Za(Ze.from(i),0,0))}(this,t,n,r),this}deleteRange(t,n){return function(t,n,r){let i=t.doc.resolve(n),o=t.doc.resolve(r),a=YT(i,o);for(let u=0;u<a.length;u++){let s=a[u],c=u==a.length-1;if(c&&0==s||i.node(s).type.contentMatch.validEnd)return t.delete(i.start(s),o.end(s));if(s>0&&(c||i.node(s-1).canReplace(i.index(s-1),o.indexAfter(s-1))))return t.delete(i.before(s),o.after(s))}for(let l=1;l<=i.depth&&l<=o.depth;l++)if(n-i.start(l)==i.depth-l&&r>i.end(l)&&o.end(l)-r!=o.depth-l)return t.delete(i.before(l),r);t.delete(n,r)}(this,t,n),this}lift(t,n){return function(t,n,r){let{$from:i,$to:o,depth:a}=n,u=i.before(a+1),s=o.after(a+1),c=u,l=s,f=Ze.empty,d=0;for(let p=a,h=!1;p>r;p--)h||i.index(p)>0?(h=!0,f=Ze.from(i.node(p).copy(f)),d++):c--;let m=Ze.empty,g=0;for(let y=a,v=!1;y>r;y--)v||o.after(y+1)<o.end(y)?(v=!0,m=Ze.from(o.node(y).copy(m)),g++):l++;t.step(new Yr(c,l,u,s,new Za(f.append(m),d,g),f.size-d,!0))}(this,t,n),this}join(t,n=1){return function(t,n,r){let i=new Yn(n-r,n+r,Za.empty,!0);t.step(i)}(this,t,n),this}wrap(t,n){return function(t,n,r){let i=Ze.empty;for(let o=r.length-1;o>=0;o--){if(i.size){let a=r[o].type.contentMatch.matchFragment(i);if(!a||!a.validEnd)throw RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}i=Ze.from(r[o].type.create(r[o].attrs,i))}let u=n.start,s=n.end;t.step(new Yr(u,s,u,s,new Za(i,0,0),r.length,!0))}(this,t,n),this}setBlockType(t,n=t,r,i=null){return function(t,n,r,i,o){if(!i.isTextblock)throw RangeError("Type given to setBlockType should be a textblock");let a=t.steps.length;t.doc.nodesBetween(n,r,(n,r)=>{var u,s,c;let l,f;if(n.isTextblock&&!n.hasMarkup(i,o)&&(u=t.doc,s=t.mapping.slice(a).map(r),c=i,l=u.resolve(s),f=l.index(),l.parent.canReplaceWith(f,f+1,c))){t.clearIncompatible(t.mapping.slice(a).map(r,1),i);let d=t.mapping.slice(a),p=d.map(r,1),h=d.map(r+n.nodeSize,1);return t.step(new Yr(p,h,p+1,h-1,new Za(Ze.from(i.create(o,null,n.marks)),0,0),1,!0)),!1}})}(this,t,n,r,i),this}setNodeMarkup(t,n,r=null,i){return function(t,n,r,i,o){let a=t.doc.nodeAt(n);if(!a)throw RangeError("No node at given position");r||(r=a.type);let u=r.create(i,null,o||a.marks);if(a.isLeaf)return t.replaceWith(n,n+a.nodeSize,u);if(!r.validContent(a.content))throw RangeError("Invalid content for node type "+r.name);t.step(new Yr(n,n+a.nodeSize,n+1,n+a.nodeSize-1,new Za(Ze.from(u),0,0),1,!0))}(this,t,n,r,i),this}setNodeAttribute(t,n,r){return this.step(new Yw(t,n,r)),this}addNodeMark(t,n){return this.step(new Ye(t,n)),this}removeNodeMark(t,n){if(!(n instanceof Zi)){let r=this.doc.nodeAt(t);if(!r)throw RangeError("No node at position "+t);if(!(n=n.isInSet(r.marks)))return this}return this.step(new Yt(t,n)),this}split(t,n=1,r){return function(t,n,r=1,i){let o=t.doc.resolve(n),a=Ze.empty,u=Ze.empty;for(let s=o.depth,c=o.depth-r,l=r-1;s>c;s--,l--){a=Ze.from(o.node(s).copy(a));let f=i&&i[l];u=Ze.from(f?f.type.create(f.attrs,u):o.node(s).copy(u))}t.step(new Yn(n,n,new Za(a.append(u),r,r),!0))}(this,t,n,r),this}addMark(t,n,r){var i,o,a,u;let s,c,l,f;return i=this,s=[],c=[],i.doc.nodesBetween(t,n,(i,o,a)=>{if(!i.isInline)return;let u=i.marks;if(!r.isInSet(u)&&a.type.allowsMarkType(r.type)){let d=Math.max(o,t),p=Math.min(o+i.nodeSize,n),h=r.addToSet(u);for(let m=0;m<u.length;m++)u[m].isInSet(h)||(l&&l.to==d&&l.mark.eq(u[m])?l.to=p:s.push(l=new Z7(d,p,u[m])));f&&f.to==d?f.to=p:c.push(f=new Z8(d,p,r))}}),s.forEach(t=>i.step(t)),c.forEach(t=>i.step(t)),this}removeMark(t,n,r){var i,o,a,u;let s,c;return i=this,s=[],c=0,i.doc.nodesBetween(t,n,(i,o)=>{if(!i.isInline)return;c++;let a=null;if(r instanceof ZD){let u=i.marks,l;for(;l=r.isInSet(u);)(a||(a=[])).push(l),u=l.removeFromSet(u)}else r?r.isInSet(i.marks)&&(a=[r]):a=i.marks;if(a&&a.length){let f=Math.min(o+i.nodeSize,n);for(let d=0;d<a.length;d++){let p=a[d],h;for(let m=0;m<s.length;m++){let g=s[m];g.step==c-1&&p.eq(s[m].style)&&(h=g)}h?(h.to=f,h.step=c):s.push({style:p,from:Math.max(o,t),to:f,step:c})}}}),s.forEach(t=>i.step(new Z7(t.from,t.to,t.style))),this}clearIncompatible(t,n,r){return function(t,n,r,i=r.contentMatch){let o=t.doc.nodeAt(n),a=[],u=n+1;for(let s=0;s<o.childCount;s++){let c=o.child(s),l=u+c.nodeSize,f=i.matchType(c.type);if(f){i=f;for(let d=0;d<c.marks.length;d++)r.allowsMarkType(c.marks[d].type)||t.step(new Z7(u,l,c.marks[d]))}else a.push(new Yn(u,l,Za.empty));u=l}if(!i.validEnd){let p=i.fillBefore(Ze.empty,!0);t.replace(u,u,new Za(p,0,0))}for(let h=a.length-1;h>=0;h--)t.step(a[h])}(this,t,n,r),this}}let YI=Object.create(null);class YC{constructor(t,n,r){this.$anchor=t,this.$head=n,this.ranges=r||[new YM(t.min(n),t.max(n))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let t=this.ranges;for(let n=0;n<t.length;n++)if(t[n].$from.pos!=t[n].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(t,n=Za.empty){let r=n.content.lastChild,i=null;for(let o=0;o<n.openEnd;o++)i=r,r=r.lastChild;let a=t.steps.length,u=this.ranges;for(let s=0;s<u.length;s++){let{$from:c,$to:l}=u[s],f=t.mapping.slice(a);t.replaceRange(f.map(c.pos),f.map(l.pos),s?Za.empty:n),0==s&&YW(t,a,(r?r.isInline:i&&i.isTextblock)?-1:1)}}replaceWith(t,n){let r=t.steps.length,i=this.ranges;for(let o=0;o<i.length;o++){let{$from:a,$to:u}=i[o],s=t.mapping.slice(r),c=s.map(a.pos),l=s.map(u.pos);o?t.deleteRange(c,l):(t.replaceRangeWith(c,l,n),YW(t,r,n.isInline?-1:1))}}static findFrom(t,n,r=!1){let i=t.parent.inlineContent?new Yj(t):YF(t.node(0),t.parent,t.pos,t.index(),n,r);if(i)return i;for(let o=t.depth-1;o>=0;o--){let a=n<0?YF(t.node(0),t.node(o),t.before(o+1),t.index(o),n,r):YF(t.node(0),t.node(o),t.after(o+1),t.index(o)+1,n,r);if(a)return a}return null}static near(t,n=1){return this.findFrom(t,n)||this.findFrom(t,-n)||new YL(t.node(0))}static atStart(t){return YF(t,t,0,0,1)||new YL(t)}static atEnd(t){return YF(t,t,t.content.size,t.childCount,-1)||new YL(t)}static fromJSON(t,n){if(!n||!n.type)throw RangeError("Invalid input for Selection.fromJSON");let r=YI[n.type];if(!r)throw RangeError(`No selection type ${n.type} defined`);return r.fromJSON(t,n)}static jsonID(t,n){if(t in YI)throw RangeError("Duplicate use of selection JSON ID "+t);return YI[t]=n,n.prototype.jsonID=t,n}getBookmark(){return Yj.between(this.$anchor,this.$head).getBookmark()}}YC.prototype.visible=!0;class YM{constructor(t,n){this.$from=t,this.$to=n}}let YR=!1;function YE(t){YR||t.parent.inlineContent||(YR=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+t.parent.type.name+")"))}class Yj extends YC{constructor(t,n=t){YE(t),YE(n),super(t,n)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(t,n){let r=t.resolve(n.map(this.head));if(!r.parent.inlineContent)return YC.near(r);let i=t.resolve(n.map(this.anchor));return new Yj(i.parent.inlineContent?i:r,r)}replace(t,n=Za.empty){if(super.replace(t,n),n==Za.empty){let r=this.$from.marksAcross(this.$to);r&&t.ensureMarks(r)}}eq(t){return t instanceof Yj&&t.anchor==this.anchor&&t.head==this.head}getBookmark(){return new YN(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(t,n){if("number"!=typeof n.anchor||"number"!=typeof n.head)throw RangeError("Invalid input for TextSelection.fromJSON");return new Yj(t.resolve(n.anchor),t.resolve(n.head))}static create(t,n,r=n){let i=t.resolve(n);return new this(i,r==n?i:t.resolve(r))}static between(t,n,r){let i=t.pos-n.pos;if((!r||i)&&(r=i>=0?1:-1),!n.parent.inlineContent){let o=YC.findFrom(n,r,!0)||YC.findFrom(n,-r,!0);if(!o)return YC.near(n,r);n=o.$head}return t.parent.inlineContent||(0==i?t=n:(t=(YC.findFrom(t,-r,!0)||YC.findFrom(t,r,!0)).$anchor).pos<n.pos!=i<0&&(t=n)),new Yj(t,n)}}YC.jsonID("text",Yj);class YN{constructor(t,n){this.anchor=t,this.head=n}map(t){return new YN(t.map(this.anchor),t.map(this.head))}resolve(t){return Yj.between(t.resolve(this.anchor),t.resolve(this.head))}}class YA extends YC{constructor(t){let n=t.nodeAfter;super(t,t.node(0).resolve(t.pos+n.nodeSize)),this.node=n}map(t,n){let{deleted:r,pos:i}=n.mapResult(this.anchor),o=t.resolve(i);return r?YC.near(o):new YA(o)}content(){return new Za(Ze.from(this.node),0,0)}eq(t){return t instanceof YA&&t.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new YP(this.anchor)}static fromJSON(t,n){if("number"!=typeof n.anchor)throw RangeError("Invalid input for NodeSelection.fromJSON");return new YA(t.resolve(n.anchor))}static create(t,n){return new YA(t.resolve(n))}static isSelectable(t){return!t.isText&&!1!==t.type.spec.selectable}}YA.prototype.visible=!1,YC.jsonID("node",YA);class YP{constructor(t){this.anchor=t}map(t){let{deleted:n,pos:r}=t.mapResult(this.anchor);return n?new YN(r,r):new YP(r)}resolve(t){let n=t.resolve(this.anchor),r=n.nodeAfter;return r&&YA.isSelectable(r)?new YA(n):YC.near(n)}}class YL extends YC{constructor(t){super(t.resolve(0),t.resolve(t.content.size))}replace(t,n=Za.empty){if(n==Za.empty){t.delete(0,t.doc.content.size);let r=YC.atStart(t.doc);r.eq(t.selection)||t.setSelection(r)}else super.replace(t,n)}toJSON(){return{type:"all"}}static fromJSON(t){return new YL(t)}map(t){return new YL(t)}eq(t){return t instanceof YL}getBookmark(){return YD}}YC.jsonID("all",YL);let YD={map(){return this},resolve:t=>new YL(t)};function YF(t,n,r,i,o,a=!1){if(n.inlineContent)return Yj.create(t,r);for(let u=i-(o>0?0:1);o>0?u<n.childCount:u>=0;u+=o){let s=n.child(u);if(s.isAtom){if(!a&&YA.isSelectable(s))return YA.create(t,r-(o<0?s.nodeSize:0))}else{let c=YF(t,s,r+o,o<0?s.childCount:0,o,a);if(c)return c}r+=s.nodeSize*o}return null}function YW(t,n,r){let i=t.steps.length-1;if(i<n)return;let o=t.steps[i];if(!(o instanceof Yn||o instanceof Yr))return;let a;t.mapping.maps[i].forEach((t,n,r,i)=>{null==a&&(a=i)}),t.setSelection(YC.near(t.doc.resolve(a),r))}class YU extends Yk{constructor(t){super(t.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=t.selection,this.storedMarks=t.storedMarks}get selection(){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}setSelection(t){if(t.$from.doc!=this.doc)throw RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=t,this.curSelectionFor=this.steps.length,this.updated=(1|this.updated)&-3,this.storedMarks=null,this}get selectionSet(){return(1&this.updated)>0}setStoredMarks(t){return this.storedMarks=t,this.updated|=2,this}ensureMarks(t){return Zi.sameSet(this.storedMarks||this.selection.$from.marks(),t)||this.setStoredMarks(t),this}addStoredMark(t){return this.ensureMarks(t.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(t){return this.ensureMarks(t.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(2&this.updated)>0}addStep(t,n){super.addStep(t,n),this.updated=-3&this.updated,this.storedMarks=null}setTime(t){return this.time=t,this}replaceSelection(t){return this.selection.replace(this,t),this}replaceSelectionWith(t,n=!0){let r=this.selection;return n&&(t=t.mark(this.storedMarks||(r.empty?r.$from.marks():r.$from.marksAcross(r.$to)||Zi.none))),r.replaceWith(this,t),this}deleteSelection(){return this.selection.replace(this),this}insertText(t,n,r){let i=this.doc.type.schema;if(null==n)return t?this.replaceSelectionWith(i.text(t),!0):this.deleteSelection();{if(null==r&&(r=n),r=r??n,!t)return this.deleteRange(n,r);let o=this.storedMarks;if(!o){let a=this.doc.resolve(n);o=r==n?a.marks():a.marksAcross(this.doc.resolve(r))}return this.replaceRangeWith(n,r,i.text(t,o)),this.selection.empty||this.setSelection(YC.near(this.selection.$to)),this}}setMeta(t,n){return this.meta["string"==typeof t?t:t.key]=n,this}getMeta(t){return this.meta["string"==typeof t?t:t.key]}get isGeneric(){for(let t in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=4,this}get scrolledIntoView(){return(4&this.updated)>0}}function Yz(t,n){return n&&t?t.bind(n):t}class YB{constructor(t,n,r){this.name=t,this.init=Yz(n.init,r),this.apply=Yz(n.apply,r)}}let YV=[new YB("doc",{init:t=>t.doc||t.schema.topNodeType.createAndFill(),apply:t=>t.doc}),new YB("selection",{init:(t,n)=>t.selection||YC.atStart(n.doc),apply:t=>t.selection}),new YB("storedMarks",{init:t=>t.storedMarks||null,apply:(t,n,r,i)=>i.selection.$cursor?t.storedMarks:null}),new YB("scrollToSelection",{init:()=>0,apply:(t,n)=>t.scrolledIntoView?n+1:n})];class Y${constructor(t,n){this.schema=t,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=YV.slice(),n&&n.forEach(t=>{if(this.pluginsByKey[t.key])throw RangeError("Adding different instances of a keyed plugin ("+t.key+")");this.plugins.push(t),this.pluginsByKey[t.key]=t,t.spec.state&&this.fields.push(new YB(t.key,t.spec.state,t))})}}class Yq{constructor(t){this.config=t}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(t){return this.applyTransaction(t).state}filterTransaction(t,n=-1){for(let r=0;r<this.config.plugins.length;r++)if(r!=n){let i=this.config.plugins[r];if(i.spec.filterTransaction&&!i.spec.filterTransaction.call(i,t,this))return!1}return!0}applyTransaction(t){if(!this.filterTransaction(t))return{state:this,transactions:[]};let n=[t],r=this.applyInner(t),i=null;for(;;){let o=!1;for(let a=0;a<this.config.plugins.length;a++){let u=this.config.plugins[a];if(u.spec.appendTransaction){let s=i?i[a].n:0,c=i?i[a].state:this,l=s<n.length&&u.spec.appendTransaction.call(u,s?n.slice(s):n,c,r);if(l&&r.filterTransaction(l,a)){if(l.setMeta("appendedTransaction",t),!i){i=[];for(let f=0;f<this.config.plugins.length;f++)i.push(f<a?{state:r,n:n.length}:{state:this,n:0})}n.push(l),r=r.applyInner(l),o=!0}i&&(i[a]={state:r,n:n.length})}}if(!o)return{state:r,transactions:n}}}applyInner(t){if(!t.before.eq(this.doc))throw RangeError("Applying a mismatched transaction");let n=new Yq(this.config),r=this.config.fields;for(let i=0;i<r.length;i++){let o=r[i];n[o.name]=o.apply(t,this[o.name],this,n)}return n}get tr(){return new YU(this)}static create(t){let n=new Y$(t.doc?t.doc.type.schema:t.schema,t.plugins),r=new Yq(n);for(let i=0;i<n.fields.length;i++)r[n.fields[i].name]=n.fields[i].init(t,r);return r}reconfigure(t){let n=new Y$(this.schema,t.plugins),r=n.fields,i=new Yq(n);for(let o=0;o<r.length;o++){let a=r[o].name;i[a]=this.hasOwnProperty(a)?this[a]:r[o].init(t,i)}return i}toJSON(t){let n={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(n.storedMarks=this.storedMarks.map(t=>t.toJSON())),t&&"object"==typeof t)for(let r in t){if("doc"==r||"selection"==r)throw RangeError("The JSON fields `doc` and `selection` are reserved");let i=t[r],o=i.spec.state;o&&o.toJSON&&(n[r]=o.toJSON.call(i,this[i.key]))}return n}static fromJSON(t,n,r){if(!n)throw RangeError("Invalid input for EditorState.fromJSON");if(!t.schema)throw RangeError("Required config field 'schema' missing");let i=new Y$(t.schema,t.plugins),o=new Yq(i);return i.fields.forEach(i=>{if("doc"==i.name)o.doc=Zb.fromJSON(t.schema,n.doc);else if("selection"==i.name)o.selection=YC.fromJSON(o.doc,n.selection);else if("storedMarks"==i.name)n.storedMarks&&(o.storedMarks=n.storedMarks.map(t.schema.markFromJSON));else{if(r)for(let a in r){let u=r[a],s=u.spec.state;if(u.key==i.name&&s&&s.fromJSON&&Object.prototype.hasOwnProperty.call(n,a)){o[i.name]=s.fromJSON.call(u,t,n[a],o);return}}o[i.name]=i.init(t,o)}}),o}}class YK{constructor(t){this.spec=t,this.props={},t.props&&function t(n,r,i){for(let o in n){let a=n[o];a instanceof Function?a=a.bind(r):"handleDOMEvents"==o&&(a=t(a,r,{})),i[o]=a}return i}(t.props,this,this.props),this.key=t.key?t.key.key:YG("plugin")}getState(t){return t[this.key]}}let YH=Object.create(null);function YG(t){return t in YH?t+"$"+ ++YH[t]:(YH[t]=0,t+"$")}class YZ{constructor(t="key"){this.key=YG(t)}get(t){return t.config.pluginsByKey[this.key]}getState(t){return t[this.key]}}let YY=function(t){for(var n=0;;n++)if(!(t=t.previousSibling))return n},YJ=function(t){let n=t.assignedSlot||t.parentNode;return n&&11==n.nodeType?n.host:n},YQ=null,YX=function(t,n,r){let i=YQ||(YQ=document.createRange());return i.setEnd(t,r??t.nodeValue.length),i.setStart(t,n||0),i},Y0=function(t,n,r,i){return r&&(Y2(t,n,r,i,-1)||Y2(t,n,r,i,1))},Y1=/^(img|br|input|textarea|hr)$/i;function Y2(t,n,r,i,o){for(;;){if(t==r&&n==i)return!0;if(n==(o<0?0:Y3(t))){let a=t.parentNode;if(!a||1!=a.nodeType||Y4(t)||Y1.test(t.nodeName)||"false"==t.contentEditable)return!1;n=YY(t)+(o<0?0:1),t=a}else{if(1!=t.nodeType||"false"==(t=t.childNodes[n+(o<0?-1:0)]).contentEditable)return!1;n=o<0?Y3(t):0}}}function Y3(t){return 3==t.nodeType?t.nodeValue.length:t.childNodes.length}function Y4(t){let n;for(let r=t;r&&!(n=r.pmViewDesc);r=r.parentNode);return n&&n.node&&n.node.isBlock&&(n.dom==t||n.contentDOM==t)}let Y5=function(t){return t.focusNode&&Y0(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)};function Y9(t,n){let r=document.createEvent("Event");return r.initEvent("keydown",!0,!0),r.keyCode=t,r.key=r.code=n,r}function Y6(t,n,r){if(t.caretPositionFromPoint)try{let i=t.caretPositionFromPoint(n,r);if(i)return{node:i.offsetNode,offset:i.offset}}catch{}if(t.caretRangeFromPoint){let o=t.caretRangeFromPoint(n,r);if(o)return{node:o.startContainer,offset:o.startOffset}}}let Y8="u">typeof navigator?navigator:null,Y7="u">typeof document?document:null,Je=Y8&&Y8.userAgent||"",Jt=/Edge\/(\d+)/.exec(Je),Jn=/MSIE \d/.exec(Je),Jr=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Je),Ji=!!(Jn||Jr||Jt),Jo=Jn?document.documentMode:Jr?+Jr[1]:Jt?+Jt[1]:0,Ja=!Ji&&/gecko\/(\d+)/i.test(Je);Ja&&(/Firefox\/(\d+)/.exec(Je)||[0,0])[1];let Ju=!Ji&&/Chrome\/(\d+)/.exec(Je),Js=!!Ju,Jc=Ju?+Ju[1]:0,Jl=!Ji&&!!Y8&&/Apple Computer/.test(Y8.vendor),Jf=Jl&&(/Mobile\/\w+/.test(Je)||!!Y8&&Y8.maxTouchPoints>2),Jd=Jf||!!Y8&&/Mac/.test(Y8.platform),Jp=!!Y8&&/Win/.test(Y8.platform),Jh=/Android \d/.test(Je),Jm=!!Y7&&"webkitFontSmoothing"in Y7.documentElement.style,Jg=Jm?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function Jy(t){return{left:0,right:t.documentElement.clientWidth,top:0,bottom:t.documentElement.clientHeight}}function Jv(t,n){return"number"==typeof t?t:t[n]}function Jb(t){let n=t.getBoundingClientRect(),r=n.width/t.offsetWidth||1,i=n.height/t.offsetHeight||1;return{left:n.left,right:n.left+t.clientWidth*r,top:n.top,bottom:n.top+t.clientHeight*i}}function Jx(t,n,r){let i=t.someProp("scrollThreshold")||0,o=t.someProp("scrollMargin")||5,a=t.dom.ownerDocument;for(let u=r||t.dom;u;u=YJ(u)){if(1!=u.nodeType)continue;let s=u,c=s==a.body,l=c?Jy(a):Jb(s),f=0,d=0;if(n.top<l.top+Jv(i,"top")?d=-(l.top-n.top+Jv(o,"top")):n.bottom>l.bottom-Jv(i,"bottom")&&(d=n.bottom-l.bottom+Jv(o,"bottom")),n.left<l.left+Jv(i,"left")?f=-(l.left-n.left+Jv(o,"left")):n.right>l.right-Jv(i,"right")&&(f=n.right-l.right+Jv(o,"right")),f||d){if(c)a.defaultView.scrollBy(f,d);else{let p=s.scrollLeft,h=s.scrollTop;d&&(s.scrollTop+=d),f&&(s.scrollLeft+=f);let m=s.scrollLeft-p,g=s.scrollTop-h;n={left:n.left-m,top:n.top-g,right:n.right-m,bottom:n.bottom-g}}}if(c)break}}function J_(t){let n=[],r=t.ownerDocument;for(let i=t;i&&(n.push({dom:i,top:i.scrollTop,left:i.scrollLeft}),t!=r);i=YJ(i));return n}function JS(t,n){for(let r=0;r<t.length;r++){let{dom:i,top:o,left:a}=t[r];i.scrollTop!=o+n&&(i.scrollTop=o+n),i.scrollLeft!=a&&(i.scrollLeft=a)}}let JT=null;function Jw(t,n){return t.left>=n.left-1&&t.left<=n.right+1&&t.top>=n.top-1&&t.top<=n.bottom+1}function JO(t){return t.top<t.bottom||t.left<t.right}function Jk(t,n){let r=t.getClientRects();if(r.length){let i=r[n<0?0:r.length-1];if(JO(i))return i}return Array.prototype.find.call(r,JO)||t.getBoundingClientRect()}let JI=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function JC(t,n,r){let{node:i,offset:o,atom:a}=t.docView.domFromPos(n,r<0?-1:1),u=Jm||Ja;if(3==i.nodeType){if(u&&(JI.test(i.nodeValue)||(r<0?!o:o==i.nodeValue.length))){let s=Jk(YX(i,o,o),r);if(Ja&&o&&/\s/.test(i.nodeValue[o-1])&&o<i.nodeValue.length){let c=Jk(YX(i,o-1,o-1),-1);if(c.top==s.top){let l=Jk(YX(i,o,o+1),-1);if(l.top!=s.top)return JM(l,l.left<c.left)}}return s}{let f=o,d=o,p=r<0?1:-1;return r<0&&!o?(d++,p=-1):r>=0&&o==i.nodeValue.length?(f--,p=1):r<0?f--:d++,JM(Jk(YX(i,f,d),p),p<0)}}if(!t.state.doc.resolve(n-(a||0)).parent.inlineContent){if(null==a&&o&&(r<0||o==Y3(i))){let h=i.childNodes[o-1];if(1==h.nodeType)return JR(h.getBoundingClientRect(),!1)}if(null==a&&o<Y3(i)){let m=i.childNodes[o];if(1==m.nodeType)return JR(m.getBoundingClientRect(),!0)}return JR(i.getBoundingClientRect(),r>=0)}if(null==a&&o&&(r<0||o==Y3(i))){let g=i.childNodes[o-1],y=3==g.nodeType?YX(g,Y3(g)-(u?0:1)):1!=g.nodeType||"BR"==g.nodeName&&g.nextSibling?null:g;if(y)return JM(Jk(y,1),!1)}if(null==a&&o<Y3(i)){let v=i.childNodes[o];for(;v.pmViewDesc&&v.pmViewDesc.ignoreForCoords;)v=v.nextSibling;let b=v?3==v.nodeType?YX(v,0,u?0:1):1==v.nodeType?v:null:null;if(b)return JM(Jk(b,-1),!0)}return JM(Jk(3==i.nodeType?YX(i):i,-r),r>=0)}function JM(t,n){if(0==t.width)return t;let r=n?t.left:t.right;return{top:t.top,bottom:t.bottom,left:r,right:r}}function JR(t,n){if(0==t.height)return t;let r=n?t.top:t.bottom;return{top:r,bottom:r,left:t.left,right:t.right}}function JE(t,n,r){let i=t.state,o=t.root.activeElement;i!=n&&t.updateState(n),o!=t.dom&&t.focus();try{return r()}finally{i!=n&&t.updateState(i),o!=t.dom&&o&&o.focus()}}let Jj=/[\u0590-\u08ac]/,JN=null,JA=null,JP=!1;class JL{constructor(t,n,r,i){this.parent=t,this.children=n,this.dom=r,this.contentDOM=i,this.dirty=0,r.pmViewDesc=this}matchesWidget(t){return!1}matchesMark(t){return!1}matchesNode(t,n,r){return!1}matchesHack(t){return!1}parseRule(){return null}stopEvent(t){return!1}get size(){let t=0;for(let n=0;n<this.children.length;n++)t+=this.children[n].size;return t}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let t=0;t<this.children.length;t++)this.children[t].destroy()}posBeforeChild(t){for(let n=0,r=this.posAtStart;;n++){let i=this.children[n];if(i==t)return r;r+=i.size}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(t,n,r){if(this.contentDOM&&this.contentDOM.contains(1==t.nodeType?t:t.parentNode)){if(r<0){let i,o;if(t==this.contentDOM)i=t.childNodes[n-1];else{for(;t.parentNode!=this.contentDOM;)t=t.parentNode;i=t.previousSibling}for(;i&&!((o=i.pmViewDesc)&&o.parent==this);)i=i.previousSibling;return i?this.posBeforeChild(o)+o.size:this.posAtStart}{let a,u;if(t==this.contentDOM)a=t.childNodes[n];else{for(;t.parentNode!=this.contentDOM;)t=t.parentNode;a=t.nextSibling}for(;a&&!((u=a.pmViewDesc)&&u.parent==this);)a=a.nextSibling;return a?this.posBeforeChild(u):this.posAtEnd}}let s;if(t==this.dom&&this.contentDOM)s=n>YY(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))s=2&t.compareDocumentPosition(this.contentDOM);else if(this.dom.firstChild){if(0==n)for(let c=t;;c=c.parentNode){if(c==this.dom){s=!1;break}if(c.previousSibling)break}if(null==s&&n==t.childNodes.length)for(let l=t;;l=l.parentNode){if(l==this.dom){s=!0;break}if(l.nextSibling)break}}return s??r>0?this.posAtEnd:this.posAtStart}nearestDesc(t,n=!1){for(let r=!0,i=t;i;i=i.parentNode){let o=this.getDesc(i),a;if(o&&(!n||o.node)){if(!r||!(a=o.nodeDOM)||(1==a.nodeType?a.contains(1==t.nodeType?t:t.parentNode):a==t))return o;r=!1}}}getDesc(t){let n=t.pmViewDesc;for(let r=n;r;r=r.parent)if(r==this)return n}posFromDOM(t,n,r){for(let i=t;i;i=i.parentNode){let o=this.getDesc(i);if(o)return o.localPosFromDOM(t,n,r)}return -1}descAt(t){for(let n=0,r=0;n<this.children.length;n++){let i=this.children[n],o=r+i.size;if(r==t&&o!=r){for(;!i.border&&i.children.length;)i=i.children[0];return i}if(t<o)return i.descAt(t-r-i.border);r=o}}domFromPos(t,n){if(!this.contentDOM)return{node:this.dom,offset:0,atom:t+1};let r=0,i=0;for(let o=0;r<this.children.length;r++){let a=this.children[r],u=o+a.size;if(u>t||a instanceof JV){i=t-o;break}o=u}if(i)return this.children[r].domFromPos(i-this.children[r].border,n);for(let s;r&&!(s=this.children[r-1]).size&&s instanceof JD&&s.side>=0;r--);if(n<=0){let c,l=!0;for(;!(!(c=r?this.children[r-1]:null)||c.dom.parentNode==this.contentDOM);r--,l=!1);return c&&n&&l&&!c.border&&!c.domAtom?c.domFromPos(c.size,n):{node:this.contentDOM,offset:c?YY(c.dom)+1:0}}{let f,d=!0;for(;!(!(f=r<this.children.length?this.children[r]:null)||f.dom.parentNode==this.contentDOM);r++,d=!1);return f&&d&&!f.border&&!f.domAtom?f.domFromPos(0,n):{node:this.contentDOM,offset:f?YY(f.dom):this.contentDOM.childNodes.length}}}parseRange(t,n,r=0){if(0==this.children.length)return{node:this.contentDOM,from:t,to:n,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let i=-1,o=-1;for(let a=r,u=0;;u++){let s=this.children[u],c=a+s.size;if(-1==i&&t<=c){let l=a+s.border;if(t>=l&&n<=c-s.border&&s.node&&s.contentDOM&&this.contentDOM.contains(s.contentDOM))return s.parseRange(t,n,l);t=a;for(let f=u;f>0;f--){let d=this.children[f-1];if(d.size&&d.dom.parentNode==this.contentDOM&&!d.emptyChildAt(1)){i=YY(d.dom)+1;break}t-=d.size}-1==i&&(i=0)}if(i>-1&&(c>n||u==this.children.length-1)){n=c;for(let p=u+1;p<this.children.length;p++){let h=this.children[p];if(h.size&&h.dom.parentNode==this.contentDOM&&!h.emptyChildAt(-1)){o=YY(h.dom);break}n+=h.size}-1==o&&(o=this.contentDOM.childNodes.length);break}a=c}return{node:this.contentDOM,from:t,to:n,fromOffset:i,toOffset:o}}emptyChildAt(t){if(this.border||!this.contentDOM||!this.children.length)return!1;let n=this.children[t<0?0:this.children.length-1];return 0==n.size||n.emptyChildAt(t)}domAfterPos(t){let{node:n,offset:r}=this.domFromPos(t,0);if(1!=n.nodeType||r==n.childNodes.length)throw RangeError("No node after pos "+t);return n.childNodes[r]}setSelection(t,n,r,i=!1){let o=Math.min(t,n),a=Math.max(t,n);for(let u=0,s=0;u<this.children.length;u++){let c=this.children[u],l=s+c.size;if(o>s&&a<l)return c.setSelection(t-s-c.border,n-s-c.border,r,i);s=l}let f=this.domFromPos(t,t?-1:1),d=n==t?f:this.domFromPos(n,n?-1:1),p=r.getSelection(),h=!1;if((Ja||Jl)&&t==n){let{node:m,offset:g}=f;if(3==m.nodeType){if((h=!!(g&&m.nodeValue[g-1]==`
|
|
9
|
-
`))&&g==m.nodeValue.length)for(let y=m,v;y;y=y.parentNode){if(v=y.nextSibling){"BR"==v.nodeName&&(f=d={node:v.parentNode,offset:YY(v)+1});break}let b=y.pmViewDesc;if(b&&b.node&&b.node.isBlock)break}}else{let x=m.childNodes[g-1];h=x&&("BR"==x.nodeName||"false"==x.contentEditable)}}if(Ja&&p.focusNode&&p.focusNode!=d.node&&1==p.focusNode.nodeType){let _=p.focusNode.childNodes[p.focusOffset];_&&"false"==_.contentEditable&&(i=!0)}if(!(i||h&&Jl)&&Y0(f.node,f.offset,p.anchorNode,p.anchorOffset)&&Y0(d.node,d.offset,p.focusNode,p.focusOffset))return;let S=!1;if((p.extend||t==n)&&!h){p.collapse(f.node,f.offset);try{t!=n&&p.extend(d.node,d.offset),S=!0}catch{}}if(!S){if(t>n){let T=f;f=d,d=T}let w=document.createRange();w.setEnd(d.node,d.offset),w.setStart(f.node,f.offset),p.removeAllRanges(),p.addRange(w)}}ignoreMutation(t){return!this.contentDOM&&"selection"!=t.type}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(t,n){for(let r=0,i=0;i<this.children.length;i++){let o=this.children[i],a=r+o.size;if(r==a?t<=a&&n>=r:t<a&&n>r){let u=r+o.border,s=a-o.border;if(t>=u&&n<=s){this.dirty=t==r||n==a?2:1,t==u&&n==s&&(o.contentLost||o.dom.parentNode!=this.contentDOM)?o.dirty=3:o.markDirty(t-u,n-u);return}o.dirty=o.dom!=o.contentDOM||o.dom.parentNode!=this.contentDOM||o.children.length?3:2}r=a}this.dirty=2}markParentsDirty(){let t=1;for(let n=this.parent;n;n=n.parent,t++){let r=1==t?2:1;n.dirty<r&&(n.dirty=r)}}get domAtom(){return!1}get ignoreForCoords(){return!1}}class JD extends JL{constructor(t,n,r,i){let o,a=n.type.toDOM;if("function"==typeof a&&(a=a(r,()=>o?o.parent?o.parent.posBeforeChild(o):void 0:i)),!n.type.spec.raw){if(1!=a.nodeType){let u=document.createElement("span");u.appendChild(a),a=u}a.contentEditable="false",a.classList.add("ProseMirror-widget")}super(t,[],a,null),this.widget=n,this.widget=n,o=this}matchesWidget(t){return 0==this.dirty&&t.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(t){let n=this.widget.spec.stopEvent;return!!n&&n(t)}ignoreMutation(t){return"selection"!=t.type||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get side(){return this.widget.type.side}}class JF extends JL{constructor(t,n,r,i){super(t,[],n,null),this.textDOM=r,this.text=i}get size(){return this.text.length}localPosFromDOM(t,n){return t!=this.textDOM?this.posAtStart+(n?this.size:0):this.posAtStart+n}domFromPos(t){return{node:this.textDOM,offset:t}}ignoreMutation(t){return"characterData"===t.type&&t.target.nodeValue==t.oldValue}}class JW extends JL{constructor(t,n,r,i){super(t,[],r,i),this.mark=n}static create(t,n,r,i){let o=i.nodeViews[n.type.name],a=o&&o(n,i,r);return a&&a.dom||(a=ZY.renderSpec(document,n.type.spec.toDOM(n,r))),new JW(t,n,a.dom,a.contentDOM||a.dom)}parseRule(){return 3&this.dirty||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM||void 0}}matchesMark(t){return 3!=this.dirty&&this.mark.eq(t)}markDirty(t,n){if(super.markDirty(t,n),0!=this.dirty){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty<this.dirty&&(r.dirty=this.dirty),this.dirty=0}}slice(t,n,r){let i=JW.create(this.parent,this.mark,!0,r),o=this.children,a=this.size;n<a&&(o=J1(o,n,a,r)),t>0&&(o=J1(o,0,t,r));for(let u=0;u<o.length;u++)o[u].parent=i;return i.children=o,i}}class JU extends JL{constructor(t,n,r,i,o,a,u,s,c){super(t,[],o,a),this.node=n,this.outerDeco=r,this.innerDeco=i,this.nodeDOM=u}static create(t,n,r,i,o,a){let u=o.nodeViews[n.type.name],s,c=u&&u(n,o,()=>s?s.parent?s.parent.posBeforeChild(s):void 0:a,r,i),l=c&&c.dom,f=c&&c.contentDOM;if(n.isText){if(l){if(3!=l.nodeType)throw RangeError("Text must be rendered as a DOM text node")}else l=document.createTextNode(n.text)}else l||({dom:l,contentDOM:f}=ZY.renderSpec(document,n.type.spec.toDOM(n)));f||n.isText||"BR"==l.nodeName||(l.hasAttribute("contenteditable")||(l.contentEditable="false"),n.type.spec.draggable&&(l.draggable=!0));let d=l;return l=JY(l,r,n),c?s=new J$(t,n,r,i,l,f||null,d,c,o,a+1):n.isText?new JB(t,n,r,i,l,d,o):new JU(t,n,r,i,l,f||null,d,o,a+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let t={node:this.node.type.name,attrs:this.node.attrs};if("pre"==this.node.type.whitespace&&(t.preserveWhitespace="full"),this.contentDOM){if(this.contentLost){for(let n=this.children.length-1;n>=0;n--){let r=this.children[n];if(this.dom.contains(r.dom.parentNode)){t.contentElement=r.dom.parentNode;break}}t.contentElement||(t.getContent=()=>Ze.empty)}else t.contentElement=this.contentDOM}else t.getContent=()=>this.node.content;return t}matchesNode(t,n,r){return 0==this.dirty&&t.eq(this.node)&&JJ(n,this.outerDeco)&&r.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(t,n){let r=this.node.inlineContent,i=n,o=t.composing?this.localCompositionInfo(t,n):null,a=o&&o.pos>-1?o:null,u=o&&o.pos<0,s=new JX(this,a&&a.node,t);(function(t,n,r,i){let o=n.locals(t),a=0;if(0==o.length){for(let u=0;u<t.childCount;u++){let s=t.child(u);i(s,o,n.forChild(a,s),u),a+=s.nodeSize}return}let c=0,l=[],f=null;for(let d=0;;){if(c<o.length&&o[c].to==a){let p=o[c++],h;for(;c<o.length&&o[c].to==a;)(h||(h=[p])).push(o[c++]);if(h){h.sort(J0);for(let m=0;m<h.length;m++)r(h[m],d,!!f)}else r(p,d,!!f)}let g,y;if(f)y=-1,g=f,f=null;else if(d<t.childCount)y=d,g=t.child(d++);else break;for(let v=0;v<l.length;v++)l[v].to<=a&&l.splice(v--,1);for(;c<o.length&&o[c].from<=a&&o[c].to>a;)l.push(o[c++]);let b=a+g.nodeSize;if(g.isText){let x=b;c<o.length&&o[c].from<x&&(x=o[c].from);for(let _=0;_<l.length;_++)l[_].to<x&&(x=l[_].to);x<b&&(f=g.cut(x-a),g=g.cut(0,x-a),b=x,y=-1)}let S=g.isInline&&!g.isLeaf?l.filter(t=>!t.inline):l.slice();i(g,S,n.forChild(a,g),y),a=b}})(this.node,this.innerDeco,(n,o,a)=>{n.spec.marks?s.syncToMarks(n.spec.marks,r,t):n.type.side>=0&&!a&&s.syncToMarks(o==this.node.childCount?Zi.none:this.node.child(o).marks,r,t),s.placeWidget(n,t,i)},(n,a,c,l)=>{s.syncToMarks(n.marks,r,t);let f;s.findNodeMatch(n,a,c,l)||u&&t.state.selection.from>i&&t.state.selection.to<i+n.nodeSize&&(f=s.findIndexWithChild(o.node))>-1&&s.updateNodeAt(n,a,c,f,t)||s.updateNextNode(n,a,c,t,l,i)||s.addNode(n,a,c,t,i),i+=n.nodeSize}),s.syncToMarks([],r,t),this.node.isTextblock&&s.addTextblockHacks(),s.destroyRest(),(s.changed||2==this.dirty)&&(a&&this.protectLocalComposition(t,a),function t(n,r,i){let o=n.firstChild,a=!1;for(let u=0;u<r.length;u++){let s=r[u],c=s.dom;if(c.parentNode==n){for(;c!=o;)o=JQ(o),a=!0;o=o.nextSibling}else a=!0,n.insertBefore(c,o);if(s instanceof JW){let l=o?o.previousSibling:n.lastChild;t(s.contentDOM,s.children,i),o=l?l.nextSibling:n.firstChild}}for(;o;)o=JQ(o),a=!0;a&&i.trackWrites==n&&(i.trackWrites=null)}(this.contentDOM,this.children,t),Jf&&function(t){if("UL"==t.nodeName||"OL"==t.nodeName){let n=t.style.cssText;t.style.cssText=n+"; list-style: square !important",window.getComputedStyle(t).listStyle,t.style.cssText=n}}(this.dom))}localCompositionInfo(t,n){let{from:r,to:i}=t.state.selection;if(!(t.state.selection instanceof Yj)||r<n||i>n+this.node.content.size)return null;let o=t.domSelectionRange(),a=function(t,n){for(;;){if(3==t.nodeType)return t;if(1==t.nodeType&&n>0){if(t.childNodes.length>n&&3==t.childNodes[n].nodeType)return t.childNodes[n];n=Y3(t=t.childNodes[n-1])}else{if(1!=t.nodeType||!(n<t.childNodes.length))return null;t=t.childNodes[n],n=0}}}(o.focusNode,o.focusOffset);if(!a||!this.dom.contains(a.parentNode))return null;if(!this.node.inlineContent)return{node:a,pos:-1,text:""};{let u=a.nodeValue,s=function(t,n,r,i){for(let o=0,a=0;o<t.childCount&&a<=i;){let u=t.child(o++);if(a+=u.nodeSize,!u.isText)continue;let s=u.text;for(;o<t.childCount;){let c=t.child(o++);if(a+=c.nodeSize,!c.isText)break;s+=c.text}if(a>=r){let l=a<i?s.lastIndexOf(n,i-a-1):-1;if(l>=0&&l+n.length+a>=r)return a+l;if(r==i&&s.length>=i+n.length-a&&s.slice(i-a,i-a+n.length)==n)return i}}return -1}(this.node.content,u,r-n,i-n);return s<0?null:{node:a,pos:s,text:u}}}protectLocalComposition(t,{node:n,pos:r,text:i}){if(this.getDesc(n))return;let o=n;for(;o.parentNode!=this.contentDOM;o=o.parentNode){for(;o.previousSibling;)o.parentNode.removeChild(o.previousSibling);for(;o.nextSibling;)o.parentNode.removeChild(o.nextSibling);o.pmViewDesc&&(o.pmViewDesc=void 0)}let a=new JF(this,o,n,i);t.input.compositionNodes.push(a),this.children=J1(this.children,r,r+i.length,t,a)}update(t,n,r,i){return!!(3!=this.dirty&&t.sameMarkup(this.node))&&(this.updateInner(t,n,r,i),!0)}updateInner(t,n,r,i){this.updateOuterDeco(n),this.node=t,this.innerDeco=r,this.contentDOM&&this.updateChildren(i,this.posAtStart),this.dirty=0}updateOuterDeco(t){if(JJ(t,this.outerDeco))return;let n=1!=this.nodeDOM.nodeType,r=this.dom;this.dom=JG(this.dom,this.nodeDOM,JH(this.outerDeco,this.node,n),JH(t,this.node,n)),this.dom!=r&&(r.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=t}selectNode(){1==this.nodeDOM.nodeType&&this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.dom.draggable=!0)}deselectNode(){1==this.nodeDOM.nodeType&&this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.dom.removeAttribute("draggable")}get domAtom(){return this.node.isAtom}}function Jz(t,n,r,i,o){JY(i,n,t);let a=new JU(void 0,t,n,r,i,i,i,o,0);return a.contentDOM&&a.updateChildren(o,0),a}class JB extends JU{constructor(t,n,r,i,o,a,u){super(t,n,r,i,o,null,a,u,0)}parseRule(){let t=this.nodeDOM.parentNode;for(;t&&t!=this.dom&&!t.pmIsDeco;)t=t.parentNode;return{skip:t||!0}}update(t,n,r,i){return!!(3!=this.dirty&&(0==this.dirty||this.inParent())&&t.sameMarkup(this.node))&&(this.updateOuterDeco(n),(0!=this.dirty||t.text!=this.node.text)&&t.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=t.text,i.trackWrites==this.nodeDOM&&(i.trackWrites=null)),this.node=t,this.dirty=0,!0)}inParent(){let t=this.parent.contentDOM;for(let n=this.nodeDOM;n;n=n.parentNode)if(n==t)return!0;return!1}domFromPos(t){return{node:this.nodeDOM,offset:t}}localPosFromDOM(t,n,r){return t==this.nodeDOM?this.posAtStart+Math.min(n,this.node.text.length):super.localPosFromDOM(t,n,r)}ignoreMutation(t){return"characterData"!=t.type&&"selection"!=t.type}slice(t,n,r){let i=this.node.cut(t,n),o=document.createTextNode(i.text);return new JB(this.parent,i,this.outerDeco,this.innerDeco,o,o,r)}markDirty(t,n){super.markDirty(t,n),this.dom!=this.nodeDOM&&(0==t||n==this.nodeDOM.nodeValue.length)&&(this.dirty=3)}get domAtom(){return!1}}class JV extends JL{parseRule(){return{ignore:!0}}matchesHack(t){return 0==this.dirty&&this.dom.nodeName==t}get domAtom(){return!0}get ignoreForCoords(){return"IMG"==this.dom.nodeName}}class J$ extends JU{constructor(t,n,r,i,o,a,u,s,c,l){super(t,n,r,i,o,a,u,c,l),this.spec=s}update(t,n,r,i){if(3==this.dirty)return!1;if(!this.spec.update)return(!!this.contentDOM||!!t.isLeaf)&&super.update(t,n,r,i);{let o=this.spec.update(t,n,r);return o&&this.updateInner(t,n,r,i),o}}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(t,n,r,i){this.spec.setSelection?this.spec.setSelection(t,n,r):super.setSelection(t,n,r,i)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(t){return!!this.spec.stopEvent&&this.spec.stopEvent(t)}ignoreMutation(t){return this.spec.ignoreMutation?this.spec.ignoreMutation(t):super.ignoreMutation(t)}}let Jq=function(t){t&&(this.nodeName=t)};Jq.prototype=Object.create(null);let JK=[new Jq];function JH(t,n,r){if(0==t.length)return JK;let i=r?JK[0]:new Jq,o=[i];for(let a=0;a<t.length;a++){let u=t[a].type.attrs;if(u)for(let s in u.nodeName&&o.push(i=new Jq(u.nodeName)),u){let c=u[s];null!=c&&(r&&1==o.length&&o.push(i=new Jq(n.isInline?"span":"div")),"class"==s?i.class=(i.class?i.class+" ":"")+c:"style"==s?i.style=(i.style?i.style+";":"")+c:"nodeName"!=s&&(i[s]=c))}}return o}function JG(t,n,r,i){if(r==JK&&i==JK)return n;let o=n;for(let a=0;a<i.length;a++){let u=i[a],s=r[a];if(a){let c;s&&s.nodeName==u.nodeName&&o!=t&&(c=o.parentNode)&&c.nodeName.toLowerCase()==u.nodeName||((c=document.createElement(u.nodeName)).pmIsDeco=!0,c.appendChild(o),s=JK[0]),o=c}JZ(o,s||JK[0],u)}return o}function JZ(t,n,r){for(let i in n)"class"==i||"style"==i||"nodeName"==i||i in r||t.removeAttribute(i);for(let o in r)"class"!=o&&"style"!=o&&"nodeName"!=o&&r[o]!=n[o]&&t.setAttribute(o,r[o]);if(n.class!=r.class){let a=n.class?n.class.split(" ").filter(Boolean):[],u=r.class?r.class.split(" ").filter(Boolean):[];for(let s=0;s<a.length;s++)-1==u.indexOf(a[s])&&t.classList.remove(a[s]);for(let c=0;c<u.length;c++)-1==a.indexOf(u[c])&&t.classList.add(u[c]);0==t.classList.length&&t.removeAttribute("class")}if(n.style!=r.style){if(n.style){let l=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g,f;for(;f=l.exec(n.style);)t.style.removeProperty(f[1])}r.style&&(t.style.cssText+=r.style)}}function JY(t,n,r){return JG(t,t,JK,JH(n,r,1!=t.nodeType))}function JJ(t,n){if(t.length!=n.length)return!1;for(let r=0;r<t.length;r++)if(!t[r].type.eq(n[r].type))return!1;return!0}function JQ(t){let n=t.nextSibling;return t.parentNode.removeChild(t),n}class JX{constructor(t,n,r){this.lock=n,this.view=r,this.index=0,this.stack=[],this.changed=!1,this.top=t,this.preMatch=function(t,n){let r=n,i=r.children.length,o=t.childCount,a=new Map,u=[];e:for(;o>0;){let s;for(;;)if(i){let c=r.children[i-1];if(c instanceof JW)r=c,i=c.children.length;else{s=c,i--;break}}else{if(r==n)break e;i=r.parent.children.indexOf(r),r=r.parent}let l=s.node;if(l){if(l!=t.child(o-1))break;--o,a.set(s,o),u.push(s)}}return{index:o,matched:a,matches:u.reverse()}}(t.node.content,t)}destroyBetween(t,n){if(t!=n){for(let r=t;r<n;r++)this.top.children[r].destroy();this.top.children.splice(t,n-t),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(t,n,r){let i=0,o=this.stack.length>>1,a=Math.min(o,t.length);for(;i<a&&(i==o-1?this.top:this.stack[i+1<<1]).matchesMark(t[i])&&!1!==t[i].type.spec.spanning;)i++;for(;i<o;)this.destroyRest(),this.top.dirty=0,this.index=this.stack.pop(),this.top=this.stack.pop(),o--;for(;o<t.length;){this.stack.push(this.top,this.index+1);let u=-1;for(let s=this.index;s<Math.min(this.index+3,this.top.children.length);s++){let c=this.top.children[s];if(c.matchesMark(t[o])&&!this.isLocked(c.dom)){u=s;break}}if(u>-1)u>this.index&&(this.changed=!0,this.destroyBetween(this.index,u)),this.top=this.top.children[this.index];else{let l=JW.create(this.top,t[o],n,r);this.top.children.splice(this.index,0,l),this.top=l,this.changed=!0}this.index=0,o++}}findNodeMatch(t,n,r,i){let o=-1,a;if(i>=this.preMatch.index&&(a=this.preMatch.matches[i-this.preMatch.index]).parent==this.top&&a.matchesNode(t,n,r))o=this.top.children.indexOf(a,this.index);else for(let u=this.index,s=Math.min(this.top.children.length,u+5);u<s;u++){let c=this.top.children[u];if(c.matchesNode(t,n,r)&&!this.preMatch.matched.has(c)){o=u;break}}return!(o<0)&&(this.destroyBetween(this.index,o),this.index++,!0)}updateNodeAt(t,n,r,i,o){let a=this.top.children[i];return 3==a.dirty&&a.dom==a.contentDOM&&(a.dirty=2),!!a.update(t,n,r,o)&&(this.destroyBetween(this.index,i),this.index++,!0)}findIndexWithChild(t){for(;;){let n=t.parentNode;if(!n)return -1;if(n==this.top.contentDOM){let r=t.pmViewDesc;if(r){for(let i=this.index;i<this.top.children.length;i++)if(this.top.children[i]==r)return i}return -1}t=n}}updateNextNode(t,n,r,i,o,a){for(let u=this.index;u<this.top.children.length;u++){let s=this.top.children[u];if(s instanceof JU){let c=this.preMatch.matched.get(s);if(null!=c&&c!=o)return!1;let l=s.dom,f,d=this.isLocked(l)&&!(t.isText&&s.node&&s.node.isText&&s.nodeDOM.nodeValue==t.text&&3!=s.dirty&&JJ(n,s.outerDeco));if(!d&&s.update(t,n,r,i))return this.destroyBetween(this.index,u),s.dom!=l&&(this.changed=!0),this.index++,!0;if(!d&&(f=this.recreateWrapper(s,t,n,r,i,a)))return this.top.children[this.index]=f,f.dirty=2,f.updateChildren(i,a+1),f.dirty=0,this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(t,n,r,i,o,a){if(t.dirty||n.isAtom||!t.children.length||!t.node.content.eq(n.content))return null;let u=JU.create(this.top,n,r,i,o,a);if(!u.contentDOM)return null;for(let s of(u.children=t.children,t.children=[],t.destroy(),u.children))s.parent=u;return u}addNode(t,n,r,i,o){let a=JU.create(this.top,t,n,r,i,o);a.contentDOM&&a.updateChildren(i,o+1),this.top.children.splice(this.index++,0,a),this.changed=!0}placeWidget(t,n,r){let i=this.index<this.top.children.length?this.top.children[this.index]:null;if(i&&i.matchesWidget(t)&&(t==i.widget||!i.widget.type.toDOM.parentNode))this.index++;else{let o=new JD(this.top,t,n,r);this.top.children.splice(this.index++,0,o),this.changed=!0}}addTextblockHacks(){let t=this.top.children[this.index-1],n=this.top;for(;t instanceof JW;)t=(n=t).children[n.children.length-1];(!t||!(t instanceof JB)||/\n$/.test(t.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(t.node.text))&&((Jl||Js)&&t&&"false"==t.dom.contentEditable&&this.addHackNode("IMG",n),this.addHackNode("BR",this.top))}addHackNode(t,n){if(n==this.top&&this.index<n.children.length&&n.children[this.index].matchesHack(t))this.index++;else{let r=document.createElement(t);"IMG"==t&&(r.className="ProseMirror-separator",r.alt=""),"BR"==t&&(r.className="ProseMirror-trailingBreak");let i=new JV(this.top,[],r,null);n!=this.top?n.children.push(i):n.children.splice(this.index++,0,i),this.changed=!0}}isLocked(t){return this.lock&&(t==this.lock||1==t.nodeType&&t.contains(this.lock.parentNode))}}function J0(t,n){return t.type.side-n.type.side}function J1(t,n,r,i,o){let a=[];for(let u=0,s=0;u<t.length;u++){let c=t[u],l=s+=c.size;s>=r||l<=n?a.push(c):(s<n&&a.push(c.slice(0,n-s,i)),o&&(a.push(o),o=void 0),l>r&&a.push(c.slice(r-s,c.size,i)))}return a}function J2(t,n=null){let r=t.domSelectionRange(),i=t.state.doc;if(!r.focusNode)return null;let o=t.docView.nearestDesc(r.focusNode),a=o&&0==o.size,u=t.docView.posFromDOM(r.focusNode,r.focusOffset,1);if(u<0)return null;let s=i.resolve(u),c,l;if(Y5(r)){for(c=s;o&&!o.node;)o=o.parent;let f=o.node;if(o&&f.isAtom&&YA.isSelectable(f)&&o.parent&&!(f.isInline&&function(t,n,r){for(let i=0==n,o=n==Y3(t);i||o;){if(t==r)return!0;let a=YY(t);if(!(t=t.parentNode))return!1;i=i&&0==a,o=o&&a==Y3(t)}}(r.focusNode,r.focusOffset,o.dom))){let d=o.posBefore;l=new YA(u==d?s:i.resolve(d))}}else{let p=t.docView.posFromDOM(r.anchorNode,r.anchorOffset,1);if(p<0)return null;c=i.resolve(p)}if(!l){let h="pointer"==n||t.state.selection.head<s.pos&&!a?1:-1;l=Qt(t,c,s,h)}return l}function J3(t){return t.editable?t.hasFocus():Qr(t)&&document.activeElement&&document.activeElement.contains(t.dom)}function J4(t,n=!1){let r=t.state.selection;if(J7(t,r),J3(t)){var i,o;if(!n&&t.input.mouseDown&&t.input.mouseDown.allowDefault&&Js){let a=t.domSelectionRange(),u=t.domObserver.currentSelection;if(a.anchorNode&&u.anchorNode&&Y0(a.anchorNode,a.anchorOffset,u.anchorNode,u.anchorOffset)){t.input.mouseDown.delayedSelectionSync=!0,t.domObserver.setCurSelection();return}}if(t.domObserver.disconnectSelection(),t.cursorWrapper){let s,c,l,f;i=t,s=i.domSelection(),c=document.createRange(),l=i.cursorWrapper.dom,f="IMG"==l.nodeName,f?c.setEnd(l.parentNode,YY(l)+1):c.setEnd(l,0),c.collapse(!1),s.removeAllRanges(),s.addRange(c),!f&&!i.state.selection.visible&&Ji&&Jo<=11&&(l.disabled=!0,l.disabled=!1)}else{let{anchor:d,head:p}=r,h,m,g,y,v,b;!J5||r instanceof Yj||(r.$from.parent.inlineContent||(h=J9(t,r.from)),r.empty||r.$from.parent.inlineContent||(m=J9(t,r.to))),t.docView.setSelection(d,p,t.root,n),J5&&(h&&J8(h),m&&J8(m)),r.visible?t.dom.classList.remove("ProseMirror-hideselection"):(t.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&(o=t,g=o.dom.ownerDocument,g.removeEventListener("selectionchange",o.input.hideSelectionGuard),y=o.domSelectionRange(),v=y.anchorNode,b=y.anchorOffset,g.addEventListener("selectionchange",o.input.hideSelectionGuard=()=>{(y.anchorNode!=v||y.anchorOffset!=b)&&(g.removeEventListener("selectionchange",o.input.hideSelectionGuard),setTimeout(()=>{(!J3(o)||o.state.selection.visible)&&o.dom.classList.remove("ProseMirror-hideselection")},20))})))}t.domObserver.setCurSelection(),t.domObserver.connectSelection()}}let J5=Jl||Js&&Jc<63;function J9(t,n){let{node:r,offset:i}=t.docView.domFromPos(n,0),o=i<r.childNodes.length?r.childNodes[i]:null,a=i?r.childNodes[i-1]:null;if(Jl&&o&&"false"==o.contentEditable)return J6(o);if((!o||"false"==o.contentEditable)&&(!a||"false"==a.contentEditable)){if(o)return J6(o);if(a)return J6(a)}}function J6(t){return t.contentEditable="true",Jl&&t.draggable&&(t.draggable=!1,t.wasDraggable=!0),t}function J8(t){t.contentEditable="false",t.wasDraggable&&(t.draggable=!0,t.wasDraggable=null)}function J7(t,n){if(n instanceof YA){let r=t.docView.descAt(n.from);r!=t.lastSelectedViewDesc&&(Qe(t),r&&r.selectNode(),t.lastSelectedViewDesc=r)}else Qe(t)}function Qe(t){t.lastSelectedViewDesc&&(t.lastSelectedViewDesc.parent&&t.lastSelectedViewDesc.deselectNode(),t.lastSelectedViewDesc=void 0)}function Qt(t,n,r,i){return t.someProp("createSelectionBetween",i=>i(t,n,r))||Yj.between(n,r,i)}function Qn(t){return(!t.editable||!!t.hasFocus())&&Qr(t)}function Qr(t){let n=t.domSelectionRange();if(!n.anchorNode)return!1;try{return t.dom.contains(3==n.anchorNode.nodeType?n.anchorNode.parentNode:n.anchorNode)&&(t.editable||t.dom.contains(3==n.focusNode.nodeType?n.focusNode.parentNode:n.focusNode))}catch{return!1}}function Qi(t,n){let{$anchor:r,$head:i}=t.selection,o=n>0?r.max(i):r.min(i),a=o.parent.inlineContent?o.depth?t.doc.resolve(n>0?o.after():o.before()):null:o;return a&&YC.findFrom(a,n)}function Qo(t,n){return t.dispatch(t.state.tr.setSelection(n).scrollIntoView()),!0}function Qa(t,n,r){let i=t.state.selection;if(i instanceof Yj){if(!i.empty||r.indexOf("s")>-1)return!1;if(t.endOfTextblock(n>0?"forward":"backward")){let o=Qi(t.state,n);return!!o&&o instanceof YA&&Qo(t,o)}if(!(Jd&&r.indexOf("m")>-1)){let a=i.$head,u=a.textOffset?null:n<0?a.nodeBefore:a.nodeAfter,s;if(!u||u.isText)return!1;let c=n<0?a.pos-u.nodeSize:a.pos;return!!(u.isAtom||(s=t.docView.descAt(c))&&!s.contentDOM)&&(YA.isSelectable(u)?Qo(t,new YA(n<0?t.state.doc.resolve(a.pos-u.nodeSize):a)):!!Jm&&Qo(t,new Yj(t.state.doc.resolve(n<0?c:c+u.nodeSize))))}}else{if(i instanceof YA&&i.node.isInline)return Qo(t,new Yj(n>0?i.$to:i.$from));{let l=Qi(t.state,n);return!!l&&Qo(t,l)}}}function Qu(t){return 3==t.nodeType?t.nodeValue.length:t.childNodes.length}function Qs(t){let n=t.pmViewDesc;return n&&0==n.size&&(t.nextSibling||"BR"!=t.nodeName)}function Qc(t,n){return n<0?function(t){let n=t.domSelectionRange(),r=n.focusNode,i=n.focusOffset;if(!r)return;let o,a,u=!1;for(Ja&&1==r.nodeType&&i<Qu(r)&&Qs(r.childNodes[i])&&(u=!0);;)if(i>0){if(1!=r.nodeType)break;{let s=r.childNodes[i-1];if(Qs(s))o=r,a=--i;else if(3==s.nodeType)i=(r=s).nodeValue.length;else break}}else{if(Qf(r))break;{let c=r.previousSibling;for(;c&&Qs(c);)o=r.parentNode,a=YY(c),c=c.previousSibling;if(c)i=Qu(r=c);else{if((r=r.parentNode)==t.dom)break;i=0}}}u?Qd(t,r,i):o&&Qd(t,o,a)}(t):Ql(t)}function Ql(t){let n=t.domSelectionRange(),r=n.focusNode,i=n.focusOffset;if(!r)return;let o=Qu(r),a,u;for(;;)if(i<o){if(1!=r.nodeType)break;if(Qs(r.childNodes[i]))a=r,u=++i;else break}else{if(Qf(r))break;{let s=r.nextSibling;for(;s&&Qs(s);)a=s.parentNode,u=YY(s)+1,s=s.nextSibling;if(s)i=0,o=Qu(r=s);else{if((r=r.parentNode)==t.dom)break;i=o=0}}}a&&Qd(t,a,u)}function Qf(t){let n=t.pmViewDesc;return n&&n.node&&n.node.isBlock}function Qd(t,n,r){let i=t.domSelection();if(Y5(i)){let o=document.createRange();o.setEnd(n,r),o.setStart(n,r),i.removeAllRanges(),i.addRange(o)}else i.extend&&i.extend(n,r);t.domObserver.setCurSelection();let{state:a}=t;setTimeout(()=>{t.state==a&&J4(t)},50)}function Qp(t,n){let r=t.state.doc.resolve(n);if(!(Js||Jp)&&r.parent.inlineContent){let i=t.coordsAtPos(n);if(n>r.start()){let o=t.coordsAtPos(n-1),a=(o.top+o.bottom)/2;if(a>i.top&&a<i.bottom&&Math.abs(o.left-i.left)>1)return o.left<i.left?"ltr":"rtl"}if(n<r.end()){let u=t.coordsAtPos(n+1),s=(u.top+u.bottom)/2;if(s>i.top&&s<i.bottom&&Math.abs(u.left-i.left)>1)return u.left>i.left?"ltr":"rtl"}}return"rtl"==getComputedStyle(t.dom).direction?"rtl":"ltr"}function Qh(t,n,r){let i=t.state.selection;if(i instanceof Yj&&!i.empty||r.indexOf("s")>-1||Jd&&r.indexOf("m")>-1)return!1;let{$from:o,$to:a}=i;if(!o.parent.inlineContent||t.endOfTextblock(n<0?"up":"down")){let u=Qi(t.state,n);if(u&&u instanceof YA)return Qo(t,u)}if(!o.parent.inlineContent){let s=n<0?o:a,c=i instanceof YL?YC.near(s,n):YC.findFrom(s,n);return!!c&&Qo(t,c)}return!1}function Qm(t,n){if(!(t.state.selection instanceof Yj))return!0;let{$head:r,$anchor:i,empty:o}=t.state.selection;if(!r.sameParent(i))return!0;if(!o)return!1;if(t.endOfTextblock(n>0?"forward":"backward"))return!0;let a=!r.textOffset&&(n<0?r.nodeBefore:r.nodeAfter);if(a&&!a.isText){let u=t.state.tr;return n<0?u.delete(r.pos-a.nodeSize,r.pos):u.delete(r.pos,r.pos+a.nodeSize),t.dispatch(u),!0}return!1}function Qg(t,n,r){t.domObserver.stop(),n.contentEditable=r,t.domObserver.start()}function Qy(t,n){t.someProp("transformCopied",r=>{n=r(n,t)});let r=[],{content:i,openStart:o,openEnd:a}=n;for(;o>1&&a>1&&1==i.childCount&&1==i.firstChild.childCount;){o--,a--;let u=i.firstChild;r.push(u.type.name,u.attrs!=u.type.defaultAttrs?u.attrs:null),i=u.content}let s=t.someProp("clipboardSerializer")||ZY.fromSchema(t.state.schema),c=QI(),l=c.createElement("div");l.appendChild(s.serializeFragment(i,{document:c}));let f=l.firstChild,d,p=0;for(;f&&1==f.nodeType&&(d=QO[f.nodeName.toLowerCase()]);){for(let h=d.length-1;h>=0;h--){let m=c.createElement(d[h]);for(;l.firstChild;)m.appendChild(l.firstChild);l.appendChild(m),p++}f=l.firstChild}return f&&1==f.nodeType&&f.setAttribute("data-pm-slice",`${o} ${a}${p?` -${p}`:""} ${JSON.stringify(r)}`),{dom:l,text:t.someProp("clipboardTextSerializer",r=>r(n,t))||n.content.textBetween(0,n.content.size,`
|
|
10
|
-
|
|
11
|
-
`)}}function Qv(t,n,r,i,o){let a=o.parent.type.spec.code,u,s;if(!r&&!n)return null;let c=n&&(i||a||!r);if(c){if(t.someProp("transformPastedText",r=>{n=r(n,a||i,t)}),a)return n?new Za(Ze.from(t.state.schema.text(n.replace(/\r\n?/g,`
|
|
12
|
-
`))),0,0):Za.empty;let l=t.someProp("clipboardTextParser",r=>r(n,o,i,t));if(l)s=l;else{let f=o.marks(),{schema:d}=t.state,p=ZY.fromSchema(d);u=document.createElement("div"),n.split(/(?:\r\n?|\n)+/).forEach(t=>{let n=u.appendChild(document.createElement("p"));t&&n.appendChild(p.serializeNode(d.text(t,f)))})}}else t.someProp("transformPastedHTML",n=>{r=n(r,t)}),u=function(t){let n=/^(\s*<meta [^>]*>)*/.exec(t);n&&(t=t.slice(n[0].length));let r=QI().createElement("div"),i=/<([a-z][^>\s]+)/i.exec(t),o;if((o=i&&QO[i[1].toLowerCase()])&&(t=o.map(t=>"<"+t+">").join("")+t+o.map(t=>"</"+t+">").reverse().join("")),r.innerHTML=t,o)for(let a=0;a<o.length;a++)r=r.querySelector(o[a])||r;return r}(r),Jm&&function(t){let n=t.querySelectorAll(Js?"span:not([class]):not([style])":"span.Apple-converted-space");for(let r=0;r<n.length;r++){let i=n[r];1==i.childNodes.length&&"\xa0"==i.textContent&&i.parentNode&&i.parentNode.replaceChild(t.ownerDocument.createTextNode(" "),i)}}(u);let h=u&&u.querySelector("[data-pm-slice]"),m=h&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(h.getAttribute("data-pm-slice")||"");if(m&&m[3])for(let g=+m[3];g>0;g--){let y=u.firstChild;for(;y&&1!=y.nodeType;)y=y.nextSibling;if(!y)break;u=y}if(s||(s=(t.someProp("clipboardParser")||t.someProp("domParser")||ZU.fromSchema(t.state.schema)).parseSlice(u,{preserveWhitespace:!!(c||m),context:o,ruleFromNode:t=>"BR"!=t.nodeName||t.nextSibling||!t.parentNode||Qb.test(t.parentNode.nodeName)?null:{ignore:!0}})),m)s=function(t,n){if(!t.size)return t;let r=t.content.firstChild.type.schema,i;try{i=JSON.parse(n)}catch{return t}let{content:o,openStart:a,openEnd:u}=t;for(let s=i.length-2;s>=0;s-=2){let c=r.nodes[i[s]];if(!c||c.hasRequiredAttrs())break;o=Ze.from(c.create(i[s+1],o)),a++,u++}return new Za(o,a,u)}(Qw(s,+m[1],+m[2]),m[4]);else if((s=Za.maxOpen(function(t,n){if(t.childCount<2)return t;for(let r=n.depth;r>=0;r--){let i=n.node(r).contentMatchAt(n.index(r)),o,a=[];if(t.forEach(t=>{if(!a)return;let n=i.findWrapping(t.type),r;if(!n)return a=null;if(r=a.length&&o.length&&Q_(n,o,t,a[a.length-1],0))a[a.length-1]=r;else{a.length&&(a[a.length-1]=QS(a[a.length-1],o.length));let u=Qx(t,n);a.push(u),i=i.matchType(u.type),o=n}}),a)return Ze.from(a)}return t}(s.content,o),!0)).openStart||s.openEnd){let v=0,b=0;for(let x=s.content.firstChild;v<s.openStart&&!x.type.spec.isolating;v++,x=x.firstChild);for(let _=s.content.lastChild;b<s.openEnd&&!_.type.spec.isolating;b++,_=_.lastChild);s=Qw(s,v,b)}return t.someProp("transformPasted",n=>{s=n(s,t)}),s}let Qb=/^(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 Qx(t,n,r=0){for(let i=n.length-1;i>=r;i--)t=n[i].create(null,Ze.from(t));return t}function Q_(t,n,r,i,o){if(o<t.length&&o<n.length&&t[o]==n[o]){let a=Q_(t,n,r,i.lastChild,o+1);if(a)return i.copy(i.content.replaceChild(i.childCount-1,a));if(i.contentMatchAt(i.childCount).matchType(o==t.length-1?r.type:t[o+1]))return i.copy(i.content.append(Ze.from(Qx(r,t,o+1))))}}function QS(t,n){if(0==n)return t;let r=t.content.replaceChild(t.childCount-1,QS(t.lastChild,n-1)),i=t.contentMatchAt(t.childCount).fillBefore(Ze.empty,!0);return t.copy(r.append(i))}function QT(t,n,r,i,o,a){let u=n<0?t.firstChild:t.lastChild,s=u.content;return t.childCount>1&&(a=0),o<i-1&&(s=QT(s,n,r,i,o+1,a)),o>=r&&(s=n<0?u.contentMatchAt(0).fillBefore(s,a<=o).append(s):s.append(u.contentMatchAt(u.childCount).fillBefore(Ze.empty,!0))),t.replaceChild(n<0?0:t.childCount-1,u.copy(s))}function Qw(t,n,r){return n<t.openStart&&(t=new Za(QT(t.content,-1,n,t.openStart,0,t.openEnd),n,t.openEnd)),r<t.openEnd&&(t=new Za(QT(t.content,1,r,t.openEnd,0,0),t.openStart,r)),t}let QO={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]},Qk=null;function QI(){return Qk||(Qk=document.implementation.createHTMLDocument("title"))}let QC={},QM={},QR={touchstart:!0,touchmove:!0};class QE{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:""},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastAndroidDelete=0,this.composing=!1,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function Qj(t,n){t.input.lastSelectionOrigin=n,t.input.lastSelectionTime=Date.now()}function QN(t){t.someProp("handleDOMEvents",n=>{for(let r in n)t.input.eventHandlers[r]||t.dom.addEventListener(r,t.input.eventHandlers[r]=n=>QA(t,n))})}function QA(t,n){return t.someProp("handleDOMEvents",r=>{let i=r[n.type];return!!i&&(i(t,n)||n.defaultPrevented)})}function QP(t,n){if(!n.bubbles)return!0;if(n.defaultPrevented)return!1;for(let r=n.target;r!=t.dom;r=r.parentNode)if(!r||11==r.nodeType||r.pmViewDesc&&r.pmViewDesc.stopEvent(n))return!1;return!0}function QL(t){return{left:t.clientX,top:t.clientY}}function QD(t,n,r,i,o){if(-1==i)return!1;let a=t.state.doc.resolve(i);for(let u=a.depth+1;u>0;u--)if(t.someProp(n,n=>u>a.depth?n(t,r,a.nodeAfter,a.before(u),o,!0):n(t,r,a.node(u),a.before(u),o,!1)))return!0;return!1}function QF(t,n,r){t.focused||t.focus();let i=t.state.tr.setSelection(n);"pointer"==r&&i.setMeta("pointer",!0),t.dispatch(i)}function QW(t,n,r,i){return QD(t,"handleDoubleClickOn",n,r,i)||t.someProp("handleDoubleClick",r=>r(t,n,i))}function QU(t,n,r,i){return QD(t,"handleTripleClickOn",n,r,i)||t.someProp("handleTripleClick",r=>r(t,n,i))||function(t,n,r){if(0!=r.button)return!1;let i=t.state.doc;if(-1==n)return!!i.inlineContent&&(QF(t,Yj.create(i,0,i.content.size),"pointer"),!0);let o=i.resolve(n);for(let a=o.depth+1;a>0;a--){let u=a>o.depth?o.nodeAfter:o.node(a),s=o.before(a);if(u.inlineContent)QF(t,Yj.create(i,s+1,s+1+u.content.size),"pointer");else{if(!YA.isSelectable(u))continue;QF(t,YA.create(i,s),"pointer")}return!0}}(t,r,i)}QM.keydown=(t,n)=>{if(t.input.shiftKey=16==n.keyCode||n.shiftKey,!QV(t,n)&&(t.input.lastKeyCode=n.keyCode,t.input.lastKeyCodeTime=Date.now(),!(Jh&&Js&&13==n.keyCode))){if(229!=n.keyCode&&t.domObserver.forceFlush(),!Jf||13!=n.keyCode||n.ctrlKey||n.altKey||n.metaKey)t.someProp("handleKeyDown",r=>r(t,n))||function(t,n){var r;let i,o=n.keyCode,a=(i="",n.ctrlKey&&(i+="c"),n.metaKey&&(i+="m"),n.altKey&&(i+="a"),n.shiftKey&&(i+="s"),i);if(8==o||Jd&&72==o&&"c"==a)return Qm(t,-1)||Qc(t,-1);if(46==o&&!n.shiftKey||Jd&&68==o&&"c"==a)return Qm(t,1)||Qc(t,1);if(13==o||27==o)return!0;if(37==o||Jd&&66==o&&"c"==a){let u=37==o?"ltr"==Qp(t,t.state.selection.from)?-1:1:-1;return Qa(t,u,a)||Qc(t,u)}if(39==o||Jd&&70==o&&"c"==a){let s=39==o?"ltr"==Qp(t,t.state.selection.from)?1:-1:1;return Qa(t,s,a)||Qc(t,s)}return 38==o||Jd&&80==o&&"c"==a?Qh(t,-1,a)||Qc(t,-1):40==o||Jd&&78==o&&"c"==a?function(t){if(!Jl||t.state.selection.$head.parentOffset>0)return!1;let{focusNode:n,focusOffset:r}=t.domSelectionRange();if(n&&1==n.nodeType&&0==r&&n.firstChild&&"false"==n.firstChild.contentEditable){let i=n.firstChild;Qg(t,i,"true"),setTimeout(()=>Qg(t,i,"false"),20)}return!1}(t)||Qh(t,1,a)||Ql(t):a==(Jd?"m":"c")&&(66==o||73==o||89==o||90==o)}(t,n)?n.preventDefault():Qj(t,"key");else{let r=Date.now();t.input.lastIOSEnter=r,t.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{t.input.lastIOSEnter==r&&(t.someProp("handleKeyDown",n=>n(t,Y9(13,"Enter"))),t.input.lastIOSEnter=0)},200)}}},QM.keyup=(t,n)=>{16==n.keyCode&&(t.input.shiftKey=!1)},QM.keypress=(t,n)=>{if(QV(t,n)||!n.charCode||n.ctrlKey&&!n.altKey||Jd&&n.metaKey)return;if(t.someProp("handleKeyPress",r=>r(t,n))){n.preventDefault();return}let r=t.state.selection;if(!(r instanceof Yj)||!r.$from.sameParent(r.$to)){let i=String.fromCharCode(n.charCode);/[\r\n]/.test(i)||t.someProp("handleTextInput",n=>n(t,r.$from.pos,r.$to.pos,i))||t.dispatch(t.state.tr.insertText(i).scrollIntoView()),n.preventDefault()}};let Qz=Jd?"metaKey":"ctrlKey";QC.mousedown=(t,n)=>{var r,i,o;t.input.shiftKey=n.shiftKey;let a=QH(t),u=Date.now(),s="singleClick",c,l;u-t.input.lastClick.time<500&&(c=(o=t.input.lastClick).x-n.clientX,c*c+(l=o.y-n.clientY)*l<100)&&!n[Qz]&&("singleClick"==t.input.lastClick.type?s="doubleClick":"doubleClick"==t.input.lastClick.type&&(s="tripleClick")),t.input.lastClick={time:u,x:n.clientX,y:n.clientY,type:s};let f=t.posAtCoords(QL(n));f&&("singleClick"==s?(t.input.mouseDown&&t.input.mouseDown.done(),t.input.mouseDown=new QB(t,f,n,!!a)):("doubleClick"==s?QW:QU)(t,f.pos,f.inside,n)?n.preventDefault():Qj(t,"pointer"))};class QB{constructor(t,n,r,i){this.view=t,this.pos=n,this.event=r,this.flushed=i,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=t.state.doc,this.selectNode=!!r[Qz],this.allowDefault=r.shiftKey;let o,a;if(n.inside>-1)o=t.state.doc.nodeAt(n.inside),a=n.inside;else{let u=t.state.doc.resolve(n.pos);o=u.parent,a=u.depth?u.before():0}let s=i?null:r.target,c=s?t.docView.nearestDesc(s,!0):null;this.target=c?c.dom:null;let{selection:l}=t.state;(0==r.button&&o.type.spec.draggable&&!1!==o.type.spec.selectable||l instanceof YA&&l.from<=a&&l.to>a)&&(this.mightDrag={node:o,pos:a,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&Ja&&!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(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),t.root.addEventListener("mouseup",this.up=this.up.bind(this)),t.root.addEventListener("mousemove",this.move=this.move.bind(this)),Qj(t,"pointer")}done(){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(()=>J4(this.view)),this.view.input.mouseDown=null}up(t){var n,r,i,o,a;if(this.done(),!this.view.dom.contains(t.target))return;let u=this.pos;this.view.state.doc!=this.startDoc&&(u=this.view.posAtCoords(QL(t))),this.updateAllowDefault(t),this.allowDefault||!u?Qj(this.view,"pointer"):(n=this.view,r=u.pos,i=u.inside,a=this.selectNode,QD(n,"handleClickOn",r,i,t)||n.someProp("handleClick",i=>i(n,r,t))||(a?function(t,n){if(-1==n)return!1;let r=t.state.selection,i,o;r instanceof YA&&(i=r.node);let a=t.state.doc.resolve(n);for(let u=a.depth+1;u>0;u--){let s=u>a.depth?a.nodeAfter:a.node(u);if(YA.isSelectable(s)){o=i&&r.$from.depth>0&&u>=r.$from.depth&&a.before(r.$from.depth+1)==r.$from.pos?a.before(r.$from.depth):a.before(u);break}}return null!=o&&(QF(t,YA.create(t.state.doc,o),"pointer"),!0)}(n,i):function(t,n){if(-1==n)return!1;let r=t.state.doc.resolve(n),i=r.nodeAfter;return!!(i&&i.isAtom&&YA.isSelectable(i))&&(QF(t,new YA(r),"pointer"),!0)}(n,i)))?t.preventDefault():0==t.button&&(this.flushed||Jl&&this.mightDrag&&!this.mightDrag.node.isAtom||Js&&!this.view.state.selection.visible&&2>=Math.min(Math.abs(u.pos-this.view.state.selection.from),Math.abs(u.pos-this.view.state.selection.to)))?(QF(this.view,YC.near(this.view.state.doc.resolve(u.pos)),"pointer"),t.preventDefault()):Qj(this.view,"pointer")}move(t){this.updateAllowDefault(t),Qj(this.view,"pointer"),0==t.buttons&&this.done()}updateAllowDefault(t){!this.allowDefault&&(Math.abs(this.event.x-t.clientX)>4||Math.abs(this.event.y-t.clientY)>4)&&(this.allowDefault=!0)}}function QV(t,n){return!!t.composing||!!(Jl&&500>Math.abs(n.timeStamp-t.input.compositionEndedAt))&&(t.input.compositionEndedAt=-2e8,!0)}QC.touchstart=t=>{t.input.lastTouch=Date.now(),QH(t),Qj(t,"pointer")},QC.touchmove=t=>{t.input.lastTouch=Date.now(),Qj(t,"pointer")},QC.contextmenu=t=>{var n;return QH(t)};let Q$=Jh?5e3:-1;function Qq(t,n){clearTimeout(t.input.composingTimeout),n>-1&&(t.input.composingTimeout=setTimeout(()=>QH(t),n))}function QK(t){let n;for(t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=(n=document.createEvent("Event"),n.initEvent("event",!0,!0),n.timeStamp));t.input.compositionNodes.length>0;)t.input.compositionNodes.pop().markParentsDirty()}function QH(t,n=!1){if(!(Jh&&t.domObserver.flushingSoon>=0)){if(t.domObserver.forceFlush(),QK(t),n||t.docView&&t.docView.dirty){let r=J2(t);return r&&!r.eq(t.state.selection)?t.dispatch(t.state.tr.setSelection(r)):t.updateState(t.state),!0}return!1}}QM.compositionstart=QM.compositionupdate=t=>{if(!t.composing){t.domObserver.flush();let{state:n}=t,r=n.selection.$from;if(n.selection.empty&&(n.storedMarks||!r.textOffset&&r.parentOffset&&r.nodeBefore.marks.some(t=>!1===t.type.spec.inclusive)))t.markCursor=t.state.storedMarks||r.marks(),QH(t,!0),t.markCursor=null;else if(QH(t),Ja&&n.selection.empty&&r.parentOffset&&!r.textOffset&&r.nodeBefore.marks.length){let i=t.domSelectionRange();for(let o=i.focusNode,a=i.focusOffset;o&&1==o.nodeType&&0!=a;){let u=a<0?o.lastChild:o.childNodes[a-1];if(!u)break;if(3==u.nodeType){t.domSelection().collapse(u,u.nodeValue.length);break}o=u,a=-1}}t.input.composing=!0}Qq(t,Q$)},QM.compositionend=(t,n)=>{t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=n.timeStamp,t.input.compositionID++,Qq(t,20))};let QG=Ji&&Jo<15||Jf&&Jg<604;function QZ(t,n,r,i,o){var a;let u=Qv(t,n,r,i,t.state.selection.$from);if(t.someProp("handlePaste",n=>n(t,o,u||Za.empty)))return!0;if(!u)return!1;let s=0==u.openStart&&0==u.openEnd&&1==u.content.childCount?u.content.firstChild:null,c=s?t.state.tr.replaceSelectionWith(s,i):t.state.tr.replaceSelection(u);return t.dispatch(c.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}QC.copy=QM.cut=(t,n)=>{let r=t.state.selection,i="cut"==n.type;if(r.empty)return;let o=QG?null:n.clipboardData,{dom:a,text:u}=Qy(t,r.content());o?(n.preventDefault(),o.clearData(),o.setData("text/html",a.innerHTML),o.setData("text/plain",u)):function(t,n){if(!t.dom.parentNode)return;let r=t.dom.parentNode.appendChild(document.createElement("div"));r.appendChild(n),r.style.cssText="position: fixed; left: -10000px; top: 10px";let i=getSelection(),o=document.createRange();o.selectNodeContents(n),t.dom.blur(),i.removeAllRanges(),i.addRange(o),setTimeout(()=>{r.parentNode&&r.parentNode.removeChild(r),t.focus()},50)}(t,a),i&&t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))},QM.paste=(t,n)=>{if(t.composing&&!Jh)return;let r=QG?null:n.clipboardData,i=t.input.shiftKey&&45!=t.input.lastKeyCode;r&&QZ(t,r.getData("text/plain"),r.getData("text/html"),i,n)?n.preventDefault():function(t,n){if(!t.dom.parentNode)return;let r=t.input.shiftKey||t.state.selection.$from.parent.type.spec.code,i=t.dom.parentNode.appendChild(document.createElement(r?"textarea":"div"));r||(i.contentEditable="true"),i.style.cssText="position: fixed; left: -10000px; top: 10px",i.focus();let o=t.input.shiftKey&&45!=t.input.lastKeyCode;setTimeout(()=>{t.focus(),i.parentNode&&i.parentNode.removeChild(i),r?QZ(t,i.value,null,o,n):QZ(t,i.textContent,i.innerHTML,o,n)},50)}(t,n)};class QY{constructor(t,n){this.slice=t,this.move=n}}let QJ=Jd?"altKey":"ctrlKey";for(let QQ in QC.dragstart=(t,n)=>{let r=n,i=t.input.mouseDown;if(i&&i.done(),!r.dataTransfer)return;let o=t.state.selection,a=o.empty?null:t.posAtCoords(QL(r));if(!(a&&a.pos>=o.from&&a.pos<=(o instanceof YA?o.to-1:o.to))){if(i&&i.mightDrag)t.dispatch(t.state.tr.setSelection(YA.create(t.state.doc,i.mightDrag.pos)));else if(r.target&&1==r.target.nodeType){let u=t.docView.nearestDesc(r.target,!0);u&&u.node.type.spec.draggable&&u!=t.docView&&t.dispatch(t.state.tr.setSelection(YA.create(t.state.doc,u.posBefore)))}}let s=t.state.selection.content(),{dom:c,text:l}=Qy(t,s);r.dataTransfer.clearData(),r.dataTransfer.setData(QG?"Text":"text/html",c.innerHTML),r.dataTransfer.effectAllowed="copyMove",QG||r.dataTransfer.setData("text/plain",l),t.dragging=new QY(s,!r[QJ])},QC.dragend=t=>{let n=t.dragging;window.setTimeout(()=>{t.dragging==n&&(t.dragging=null)},50)},QM.dragover=QM.dragenter=(t,n)=>n.preventDefault(),QM.drop=(t,n)=>{let r=t.dragging;if(t.dragging=null,!n.dataTransfer)return;let i=t.posAtCoords(QL(n));if(!i)return;let o=t.state.doc.resolve(i.pos),a=r&&r.slice;a?t.someProp("transformPasted",n=>{a=n(a,t)}):a=Qv(t,n.dataTransfer.getData(QG?"Text":"text/plain"),QG?null:n.dataTransfer.getData("text/html"),!1,o);let u=!!(r&&!n[QJ]);if(t.someProp("handleDrop",r=>r(t,n,a||Za.empty,u))){n.preventDefault();return}if(!a)return;n.preventDefault();let s=a?function(t,n,r){let i=t.resolve(n);if(!r.content.size)return n;let o=r.content;for(let a=0;a<r.openStart;a++)o=o.firstChild.content;for(let u=1;u<=(0==r.openStart&&r.size?2:1);u++)for(let s=i.depth;s>=0;s--){let c=s==i.depth?0:i.pos<=(i.start(s+1)+i.end(s+1))/2?-1:1,l=i.index(s)+(c>0?1:0),f=i.node(s),d=!1;if(1==u)d=f.canReplace(l,l,o);else{let p=f.contentMatchAt(l).findWrapping(o.firstChild.type);d=p&&f.canReplaceWith(l,l,p[0])}if(d)return 0==c?i.pos:c<0?i.before(s+1):i.after(s+1)}return null}(t.state.doc,o.pos,a):o.pos;null==s&&(s=o.pos);let c=t.state.tr;u&&c.deleteSelection();let l=c.mapping.map(s),f=0==a.openStart&&0==a.openEnd&&1==a.content.childCount,d=c.doc;if(f?c.replaceRangeWith(l,l,a.content.firstChild):c.replaceRange(l,l,a),c.doc.eq(d))return;let p=c.doc.resolve(l);if(f&&YA.isSelectable(a.content.firstChild)&&p.nodeAfter&&p.nodeAfter.sameMarkup(a.content.firstChild))c.setSelection(new YA(p));else{let h=c.mapping.map(s);c.mapping.maps[c.mapping.maps.length-1].forEach((t,n,r,i)=>h=i),c.setSelection(Qt(t,p,c.doc.resolve(h)))}t.focus(),t.dispatch(c.setMeta("uiEvent","drop"))},QC.focus=t=>{t.input.lastFocus=Date.now(),t.focused||(t.domObserver.stop(),t.dom.classList.add("ProseMirror-focused"),t.domObserver.start(),t.focused=!0,setTimeout(()=>{t.docView&&t.hasFocus()&&!t.domObserver.currentSelection.eq(t.domSelectionRange())&&J4(t)},20))},QC.blur=(t,n)=>{t.focused&&(t.domObserver.stop(),t.dom.classList.remove("ProseMirror-focused"),t.domObserver.start(),n.relatedTarget&&t.dom.contains(n.relatedTarget)&&t.domObserver.currentSelection.clear(),t.focused=!1)},QC.beforeinput=(t,n)=>{if(Js&&Jh&&"deleteContentBackward"==n.inputType){t.domObserver.flushSoon();let{domChangeCount:r}=t.input;setTimeout(()=>{if(t.input.domChangeCount!=r||(t.dom.blur(),t.focus(),t.someProp("handleKeyDown",n=>n(t,Y9(8,"Backspace")))))return;let{$cursor:n}=t.state.selection;n&&n.pos>0&&t.dispatch(t.state.tr.delete(n.pos-1,n.pos).scrollIntoView())},50)}},QM)QC[QQ]=QM[QQ];function QX(t,n){if(t==n)return!0;for(let r in t)if(t[r]!==n[r])return!1;for(let i in n)if(!(i in t))return!1;return!0}class Q0{constructor(t,n){this.toDOM=t,this.spec=n||Q5,this.side=this.spec.side||0}map(t,n,r,i){let{pos:o,deleted:a}=t.mapResult(n.from+i,this.side<0?-1:1);return a?null:new Q3(o-r,o-r,this)}valid(){return!0}eq(t){return this==t||t instanceof Q0&&(this.spec.key&&this.spec.key==t.spec.key||this.toDOM==t.toDOM&&QX(this.spec,t.spec))}destroy(t){this.spec.destroy&&this.spec.destroy(t)}}class Q1{constructor(t,n){this.attrs=t,this.spec=n||Q5}map(t,n,r,i){let o=t.map(n.from+i,this.spec.inclusiveStart?-1:1)-r,a=t.map(n.to+i,this.spec.inclusiveEnd?1:-1)-r;return o>=a?null:new Q3(o,a,this)}valid(t,n){return n.from<n.to}eq(t){return this==t||t instanceof Q1&&QX(this.attrs,t.attrs)&&QX(this.spec,t.spec)}static is(t){return t.type instanceof Q1}destroy(){}}let Q2=class t{constructor(t,n){this.attrs=t,this.spec=n||Q5}map(t,n,r,i){let o=t.mapResult(n.from+i,1);if(o.deleted)return null;let a=t.mapResult(n.to+i,-1);return a.deleted||a.pos<=o.pos?null:new Q3(o.pos-r,a.pos-r,this)}valid(t,n){let{index:r,offset:i}=t.content.findIndex(n.from),o;return i==n.from&&!(o=t.child(r)).isText&&i+o.nodeSize==n.to}eq(n){return this==n||n instanceof t&&QX(this.attrs,n.attrs)&&QX(this.spec,n.spec)}destroy(){}};class Q3{constructor(t,n,r){this.from=t,this.to=n,this.type=r}copy(t,n){return new Q3(t,n,this.type)}eq(t,n=0){return this.type.eq(t.type)&&this.from+n==t.from&&this.to+n==t.to}map(t,n,r){return this.type.map(t,this,n,r)}static widget(t,n,r){return new Q3(t,t,new Q0(n,r))}static inline(t,n,r,i){return new Q3(t,n,new Q1(r,i))}static node(t,n,r,i){return new Q3(t,n,new Q2(r,i))}get spec(){return this.type.spec}get inline(){return this.type instanceof Q1}}let Q4=[],Q5={};class Q9{constructor(t,n){this.local=t.length?t:Q4,this.children=n.length?n:Q4}static create(t,n){return n.length?Xn(n,t,0,Q5):Q6}find(t,n,r){let i=[];return this.findInner(t??0,n??1e9,i,0,r),i}findInner(t,n,r,i,o){for(let a=0;a<this.local.length;a++){let u=this.local[a];u.from<=n&&u.to>=t&&(!o||o(u.spec))&&r.push(u.copy(u.from+i,u.to+i))}for(let s=0;s<this.children.length;s+=3)if(this.children[s]<n&&this.children[s+1]>t){let c=this.children[s]+1;this.children[s+2].findInner(t-c,n-c,r,i+c,o)}}map(t,n,r){return this==Q6||0==t.maps.length?this:this.mapInner(t,n,0,0,r||Q5)}mapInner(t,n,r,i,o){let a;for(let u=0;u<this.local.length;u++){let s=this.local[u].map(t,r,i);s&&s.type.valid(n,s)?(a||(a=[])).push(s):o.onRemove&&o.onRemove(this.local[u].spec)}return this.children.length?function(t,n,r,i,o,a,u){let s=t.slice();for(let c=0,l=a;c<r.maps.length;c++){let f=0;r.maps[c].forEach((t,n,r,i)=>{let a=i-r-(n-t);for(let u=0;u<s.length;u+=3){let c=s[u+1];if(c<0||t>c+l-f)continue;let d=s[u]+l-f;n>=d?s[u+1]=t<=d?-2:-1:r>=o&&a&&(s[u]+=a,s[u+1]+=a)}f+=a}),l=r.maps[c].map(l,-1)}let d=!1;for(let p=0;p<s.length;p+=3)if(s[p+1]<0){if(-2==s[p+1]){d=!0,s[p+1]=-1;continue}let h=r.map(t[p]+a),m=h-o;if(m<0||m>=i.content.size){d=!0;continue}let g=r.map(t[p+1]+a,-1)-o,{index:y,offset:v}=i.content.findIndex(m),b=i.maybeChild(y);if(b&&v==m&&v+b.nodeSize==g){let x=s[p+2].mapInner(r,b,h+1,t[p]+a+1,u);x!=Q6?(s[p]=m,s[p+1]=g,s[p+2]=x):(s[p+1]=-2,d=!0)}else d=!0}if(d){let _=function(t,n,r,i,o,a,u){function s(t,n){for(let a=0;a<t.local.length;a++){let c=t.local[a].map(i,o,n);c?r.push(c):u.onRemove&&u.onRemove(t.local[a].spec)}for(let l=0;l<t.children.length;l+=3)s(t.children[l+2],t.children[l]+n+1)}for(let c=0;c<t.length;c+=3)-1==t[c+1]&&s(t[c+2],n[c]+a+1);return r}(s,t,n,r,o,a,u),S=Xn(_,i,0,u);n=S.local;for(let T=0;T<s.length;T+=3)s[T+1]<0&&(s.splice(T,3),T-=3);for(let w=0,O=0;w<S.children.length;w+=3){let k=S.children[w];for(;O<s.length&&s[O]<k;)O+=3;s.splice(O,0,S.children[w],S.children[w+1],S.children[w+2])}}return new Q9(n.sort(Xr),s)}(this.children,a||[],t,n,r,i,o):a?new Q9(a.sort(Xr),Q4):Q6}add(t,n){return n.length?this==Q6?Q9.create(t,n):this.addInner(t,n,0):this}addInner(t,n,r){let i,o=0;t.forEach((t,a)=>{let u=a+r,s;if(s=Xe(n,t,u)){for(i||(i=this.children.slice());o<i.length&&i[o]<a;)o+=3;i[o]==a?i[o+2]=i[o+2].addInner(t,s,u+1):i.splice(o,0,a,a+t.nodeSize,Xn(s,t,u+1,Q5)),o+=3}});let a=Q7(o?Xt(n):n,-r);for(let u=0;u<a.length;u++)a[u].type.valid(t,a[u])||a.splice(u--,1);return new Q9(a.length?this.local.concat(a).sort(Xr):this.local,i||this.children)}remove(t){return 0==t.length||this==Q6?this:this.removeInner(t,0)}removeInner(t,n){let r=this.children,i=this.local;for(let o=0;o<r.length;o+=3){let a,u=r[o]+n,s=r[o+1]+n;for(let c=0,l;c<t.length;c++)(l=t[c])&&l.from>u&&l.to<s&&(t[c]=null,(a||(a=[])).push(l));if(!a)continue;r==this.children&&(r=this.children.slice());let f=r[o+2].removeInner(a,u+1);f!=Q6?r[o+2]=f:(r.splice(o,3),o-=3)}if(i.length){for(let d=0,p;d<t.length;d++)if(p=t[d])for(let h=0;h<i.length;h++)i[h].eq(p,n)&&(i==this.local&&(i=this.local.slice()),i.splice(h--,1))}return r==this.children&&i==this.local?this:i.length||r.length?new Q9(i,r):Q6}forChild(t,n){if(this==Q6)return this;if(n.isLeaf)return Q9.empty;let r,i;for(let o=0;o<this.children.length;o+=3)if(this.children[o]>=t){this.children[o]==t&&(r=this.children[o+2]);break}let a=t+1,u=a+n.content.size;for(let s=0;s<this.local.length;s++){let c=this.local[s];if(c.from<u&&c.to>a&&c.type instanceof Q1){let l=Math.max(a,c.from)-a,f=Math.min(u,c.to)-a;l<f&&(i||(i=[])).push(c.copy(l,f))}}if(i){let d=new Q9(i.sort(Xr),Q4);return r?new Q8([d,r]):d}return r||Q6}eq(t){if(this==t)return!0;if(!(t instanceof Q9)||this.local.length!=t.local.length||this.children.length!=t.children.length)return!1;for(let n=0;n<this.local.length;n++)if(!this.local[n].eq(t.local[n]))return!1;for(let r=0;r<this.children.length;r+=3)if(this.children[r]!=t.children[r]||this.children[r+1]!=t.children[r+1]||!this.children[r+2].eq(t.children[r+2]))return!1;return!0}locals(t){return Xi(this.localsInner(t))}localsInner(t){if(this==Q6)return Q4;if(t.inlineContent||!this.local.some(Q1.is))return this.local;let n=[];for(let r=0;r<this.local.length;r++)this.local[r].type instanceof Q1||n.push(this.local[r]);return n}}Q9.empty=new Q9([],[]),Q9.removeOverlap=Xi;let Q6=Q9.empty;class Q8{constructor(t){this.members=t}map(t,n){let r=this.members.map(r=>r.map(t,n,Q5));return Q8.from(r)}forChild(t,n){if(n.isLeaf)return Q9.empty;let r=[];for(let i=0;i<this.members.length;i++){let o=this.members[i].forChild(t,n);o!=Q6&&(o instanceof Q8?r=r.concat(o.members):r.push(o))}return Q8.from(r)}eq(t){if(!(t instanceof Q8)||t.members.length!=this.members.length)return!1;for(let n=0;n<this.members.length;n++)if(!this.members[n].eq(t.members[n]))return!1;return!0}locals(t){let n,r=!0;for(let i=0;i<this.members.length;i++){let o=this.members[i].localsInner(t);if(o.length){if(n){r&&(n=n.slice(),r=!1);for(let a=0;a<o.length;a++)n.push(o[a])}else n=o}}return n?Xi(r?n:n.sort(Xr)):Q4}static from(t){switch(t.length){case 0:return Q6;case 1:return t[0];default:return new Q8(t.every(t=>t instanceof Q9)?t:t.reduce((t,n)=>t.concat(n instanceof Q9?n:n.members),[]))}}}function Q7(t,n){if(!n||!t.length)return t;let r=[];for(let i=0;i<t.length;i++){let o=t[i];r.push(new Q3(o.from+n,o.to+n,o.type))}return r}function Xe(t,n,r){if(n.isLeaf)return null;let i=r+n.nodeSize,o=null;for(let a=0,u;a<t.length;a++)(u=t[a])&&u.from>r&&u.to<i&&((o||(o=[])).push(u),t[a]=null);return o}function Xt(t){let n=[];for(let r=0;r<t.length;r++)null!=t[r]&&n.push(t[r]);return n}function Xn(t,n,r,i){let o=[],a=!1;n.forEach((n,u)=>{let s=Xe(t,n,u+r);if(s){a=!0;let c=Xn(s,n,r+u+1,i);c!=Q6&&o.push(u,u+n.nodeSize,c)}});let u=Q7(a?Xt(t):t,-r).sort(Xr);for(let s=0;s<u.length;s++)u[s].type.valid(n,u[s])||(i.onRemove&&i.onRemove(u[s].spec),u.splice(s--,1));return u.length||o.length?new Q9(u,o):Q6}function Xr(t,n){return t.from-n.from||t.to-n.to}function Xi(t){let n=t;for(let r=0;r<n.length-1;r++){let i=n[r];if(i.from!=i.to)for(let o=r+1;o<n.length;o++){let a=n[o];if(a.from==i.from){a.to!=i.to&&(n==t&&(n=t.slice()),n[o]=a.copy(a.from,i.to),Xo(n,o+1,a.copy(i.to,a.to)));continue}a.from<i.to&&(n==t&&(n=t.slice()),n[r]=i.copy(i.from,a.from),Xo(n,o,i.copy(a.from,i.to)));break}}return n}function Xo(t,n,r){for(;n<t.length&&Xr(r,t[n])>0;)n++;t.splice(n,0,r)}function Xa(t){let n=[];return t.someProp("decorations",r=>{let i=r(t.state);i&&i!=Q6&&n.push(i)}),t.cursorWrapper&&n.push(Q9.create(t.state.doc,[t.cursorWrapper.deco])),Q8.from(n)}let Xu={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},Xs=Ji&&Jo<=11;class Xc{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(t){this.anchorNode=t.anchorNode,this.anchorOffset=t.anchorOffset,this.focusNode=t.focusNode,this.focusOffset=t.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(t){return t.anchorNode==this.anchorNode&&t.anchorOffset==this.anchorOffset&&t.focusNode==this.focusNode&&t.focusOffset==this.focusOffset}}class Xl{constructor(t,n){this.view=t,this.handleDOMChange=n,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new Xc,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.observer=window.MutationObserver&&new window.MutationObserver(t=>{for(let n=0;n<t.length;n++)this.queue.push(t[n]);Ji&&Jo<=11&&t.some(t=>"childList"==t.type&&t.removedNodes.length||"characterData"==t.type&&t.oldValue.length>t.target.nodeValue.length)?this.flushSoon():this.flush()}),Xs&&(this.onCharData=t=>{this.queue.push({target:t.target,type:"characterData",oldValue:t.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(()=>{this.flushingSoon=-1,this.flush()},20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,Xu)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let t=this.observer.takeRecords();if(t.length){for(let n=0;n<t.length;n++)this.queue.push(t[n]);window.setTimeout(()=>this.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(Qn(this.view)){if(this.suppressingSelectionUpdates)return J4(this.view);if(Ji&&Jo<=11&&!this.view.state.selection.empty){let t=this.view.domSelectionRange();if(t.focusNode&&Y0(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(t){if(!t.focusNode)return!0;let n=new Set,r;for(let i=t.focusNode;i;i=YJ(i))n.add(i);for(let o=t.anchorNode;o;o=YJ(o))if(n.has(o)){r=o;break}let a=r&&this.view.docView.nearestDesc(r);if(a&&a.ignoreMutation({type:"selection",target:3==r.nodeType?r.parentNode:r}))return this.setCurSelection(),!0}flush(){var t;let{view:n}=this;if(!n.docView||this.flushingSoon>-1)return;let r=this.observer?this.observer.takeRecords():[];this.queue.length&&(r=this.queue.concat(r),this.queue.length=0);let i=n.domSelectionRange(),o=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(i)&&Qn(n)&&!this.ignoreSelectionChange(i),a=-1,u=-1,s=!1,c=[];if(n.editable)for(let l=0;l<r.length;l++){let f=this.registerMutation(r[l],c);f&&(a=a<0?f.from:Math.min(f.from,a),u=u<0?f.to:Math.max(f.to,u),f.typeOver&&(s=!0))}if(Ja&&c.length>1){let d=c.filter(t=>"BR"==t.nodeName);if(2==d.length){let p=d[0],h=d[1];p.parentNode&&p.parentNode.parentNode==h.parentNode?h.remove():p.remove()}}let m=null;a<0&&o&&n.input.lastFocus>Date.now()-200&&Math.max(n.input.lastTouch,n.input.lastClick.time)<Date.now()-300&&Y5(i)&&(m=J2(n))&&m.eq(YC.near(n.state.doc.resolve(0),1))?(n.input.lastFocus=0,J4(n),this.currentSelection.set(i),n.scrollToSelection()):(a>-1||o)&&(a>-1&&(n.docView.markDirty(a,u),t=n,Xf.has(t)||(Xf.set(t,null),-1===["normal","nowrap","pre-line"].indexOf(getComputedStyle(t.dom).whiteSpace))||(t.requiresGeckoHackNode=Ja,Xd||(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."),Xd=!0))),this.handleDOMChange(a,u,s,c),n.docView&&n.docView.dirty?n.updateState(n.state):this.currentSelection.eq(i)||J4(n),this.currentSelection.set(i))}registerMutation(t,n){if(n.indexOf(t.target)>-1)return null;let r=this.view.docView.nearestDesc(t.target);if("attributes"==t.type&&(r==this.view.docView||"contenteditable"==t.attributeName||"style"==t.attributeName&&!t.oldValue&&!t.target.getAttribute("style"))||!r||r.ignoreMutation(t))return null;if("childList"!=t.type)return"attributes"==t.type?{from:r.posAtStart-r.border,to:r.posAtEnd+r.border}:{from:r.posAtStart,to:r.posAtEnd,typeOver:t.target.nodeValue==t.oldValue};{for(let i=0;i<t.addedNodes.length;i++)n.push(t.addedNodes[i]);if(r.contentDOM&&r.contentDOM!=r.dom&&!r.contentDOM.contains(t.target))return{from:r.posBefore,to:r.posAfter};let o=t.previousSibling,a=t.nextSibling;if(Ji&&Jo<=11&&t.addedNodes.length)for(let u=0;u<t.addedNodes.length;u++){let{previousSibling:s,nextSibling:c}=t.addedNodes[u];(!s||0>Array.prototype.indexOf.call(t.addedNodes,s))&&(o=s),(!c||0>Array.prototype.indexOf.call(t.addedNodes,c))&&(a=c)}let l=o&&o.parentNode==t.target?YY(o)+1:0,f=r.localPosFromDOM(t.target,l,-1),d=a&&a.parentNode==t.target?YY(a):t.target.childNodes.length,p=r.localPosFromDOM(t.target,d,1);return{from:f,to:p}}}}let Xf=new WeakMap,Xd=!1;function Xp(t){let n=t.pmViewDesc;if(n)return n.parseRule();if("BR"==t.nodeName&&t.parentNode){if(Jl&&/^(ul|ol)$/i.test(t.parentNode.nodeName)){let r=document.createElement("div");return r.appendChild(document.createElement("li")),{skip:r}}if(t.parentNode.lastChild==t||Jl&&/^(tr|table)$/i.test(t.parentNode.nodeName))return{ignore:!0}}else if("IMG"==t.nodeName&&t.getAttribute("mark-placeholder"))return{ignore:!0};return null}let Xh=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function Xm(t,n,r){return Math.max(r.anchor,r.head)>n.content.size?null:Qt(t,n.resolve(r.anchor),n.resolve(r.head))}function Xg(t,n,r){let i=t.depth,o=n?t.end():t.pos;for(;i>0&&(n||t.indexAfter(i)==t.node(i).childCount);)i--,o++,n=!1;if(r){let a=t.node(i).maybeChild(t.indexAfter(i));for(;a&&!a.isLeaf;)a=a.firstChild,o++}return o}class Xy{constructor(t,n){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new QE,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=n,this.state=n.state,this.directPlugins=n.plugins||[],this.directPlugins.forEach(XS),this.dispatch=this.dispatch.bind(this),this.dom=t&&t.mount||document.createElement("div"),t&&(t.appendChild?t.appendChild(this.dom):"function"==typeof t?t(this.dom):t.mount&&(this.mounted=!0)),this.editable=Xx(this),Xb(this),this.nodeViews=X_(this),this.docView=Jz(this.state.doc,Xv(this),Xa(this),this.dom,this),this.domObserver=new Xl(this,(t,n,r,i)=>(function(t,n,r,i,o){if(n<0){let a=t.input.lastSelectionTime>Date.now()-50?t.input.lastSelectionOrigin:null,u=J2(t,a);if(u&&!t.state.selection.eq(u)){if(Js&&Jh&&13===t.input.lastKeyCode&&Date.now()-100<t.input.lastKeyCodeTime&&t.someProp("handleKeyDown",n=>n(t,Y9(13,"Enter"))))return;let s=t.state.tr.setSelection(u);"pointer"==a?s.setMeta("pointer",!0):"key"==a&&s.scrollIntoView(),t.composing&&s.setMeta("composition",t.input.compositionID),t.dispatch(s)}return}let c=t.state.doc.resolve(n),l=c.sharedDepth(r);n=c.before(l+1),r=t.state.doc.resolve(r).after(l+1);let f=t.state.selection,d=function(t,n,r){let{node:i,fromOffset:o,toOffset:a,from:u,to:s}=t.docView.parseRange(n,r),c=t.domSelectionRange(),l,f=c.anchorNode;if(f&&t.dom.contains(1==f.nodeType?f:f.parentNode)&&(l=[{node:f,offset:c.anchorOffset}],Y5(c)||l.push({node:c.focusNode,offset:c.focusOffset})),Js&&8===t.input.lastKeyCode)for(let d=a;d>o;d--){let p=i.childNodes[d-1],h=p.pmViewDesc;if("BR"==p.nodeName&&!h){a=d;break}if(!h||h.size)break}let m=t.state.doc,g=t.someProp("domParser")||ZU.fromSchema(t.state.schema),y=m.resolve(u),v=null,b=g.parse(i,{topNode:y.parent,topMatch:y.parent.contentMatchAt(y.index()),topOpen:!0,from:o,to:a,preserveWhitespace:"pre"!=y.parent.type.whitespace||"full",findPositions:l,ruleFromNode:Xp,context:y});if(l&&null!=l[0].pos){let x=l[0].pos,_=l[1]&&l[1].pos;null==_&&(_=x),v={anchor:x+u,head:_+u}}return{doc:b,sel:v,from:u,to:s}}(t,n,r),p=t.state.doc,h=p.slice(d.from,d.to),m,g;8===t.input.lastKeyCode&&Date.now()-100<t.input.lastKeyCodeTime?(m=t.state.selection.to,g="end"):(m=t.state.selection.from,g="start"),t.input.lastKeyCode=null;let y=function(t,n,r,i,o){let a=t.findDiffStart(n,r);if(null==a)return null;let{a:u,b:s}=t.findDiffEnd(n,r+t.size,r+n.size);if("end"==o){let c=Math.max(0,a-Math.min(u,s));i-=u+c-a}if(u<a&&t.size<n.size){let l=i<=a&&i>=u?a-i:0;a-=l,s=a+(s-u),u=a}else if(s<a){let f=i<=a&&i>=s?a-i:0;a-=f,u=a+(u-s),s=a}return{start:a,endA:u,endB:s}}(h.content,d.doc.content,d.from,m,g);if((Jf&&t.input.lastIOSEnter>Date.now()-225||Jh)&&o.some(t=>1==t.nodeType&&!Xh.test(t.nodeName))&&(!y||y.endA>=y.endB)&&t.someProp("handleKeyDown",n=>n(t,Y9(13,"Enter")))){t.input.lastIOSEnter=0;return}if(!y){if(i&&f instanceof Yj&&!f.empty&&f.$head.sameParent(f.$anchor)&&!t.composing&&!(d.sel&&d.sel.anchor!=d.sel.head))y={start:f.from,endA:f.to,endB:f.to};else{if(d.sel){let v=Xm(t,t.state.doc,d.sel);if(v&&!v.eq(t.state.selection)){let b=t.state.tr.setSelection(v);t.composing&&b.setMeta("composition",t.input.compositionID),t.dispatch(b)}}return}}if(Js&&t.cursorWrapper&&d.sel&&d.sel.anchor==t.cursorWrapper.deco.from&&d.sel.head==d.sel.anchor){let x=y.endB-y.start;d.sel={anchor:d.sel.anchor+x,head:d.sel.anchor+x}}t.input.domChangeCount++,t.state.selection.from<t.state.selection.to&&y.start==y.endB&&t.state.selection instanceof Yj&&(y.start>t.state.selection.from&&y.start<=t.state.selection.from+2&&t.state.selection.from>=d.from?y.start=t.state.selection.from:y.endA<t.state.selection.to&&y.endA>=t.state.selection.to-2&&t.state.selection.to<=d.to&&(y.endB+=t.state.selection.to-y.endA,y.endA=t.state.selection.to)),Ji&&Jo<=11&&y.endB==y.start+1&&y.endA==y.start&&y.start>d.from&&" \xa0"==d.doc.textBetween(y.start-d.from-1,y.start-d.from+1)&&(y.start--,y.endA--,y.endB--);let _=d.doc.resolveNoCache(y.start-d.from),S=d.doc.resolveNoCache(y.endB-d.from),T=p.resolve(y.start),w=_.sameParent(S)&&_.parent.inlineContent&&T.end()>=y.endA,O;if((Jf&&t.input.lastIOSEnter>Date.now()-225&&(!w||o.some(t=>"DIV"==t.nodeName||"P"==t.nodeName))||!w&&_.pos<d.doc.content.size&&!_.sameParent(S)&&(O=YC.findFrom(d.doc.resolve(_.pos+1),1,!0))&&O.head==S.pos)&&t.someProp("handleKeyDown",n=>n(t,Y9(13,"Enter")))){t.input.lastIOSEnter=0;return}if(t.state.selection.anchor>y.start&&function(t,n,r,i,o){if(!i.parent.isTextblock||r-n<=o.pos-i.pos||Xg(i,!0,!1)<o.pos)return!1;let a=t.resolve(n);if(a.parentOffset<a.parent.content.size||!a.parent.isTextblock)return!1;let u=t.resolve(Xg(a,!0,!0));return!(!u.parent.isTextblock||u.pos>r||Xg(u,!0,!1)<r)&&i.parent.content.cut(i.parentOffset).eq(u.parent.content)}(p,y.start,y.endA,_,S)&&t.someProp("handleKeyDown",n=>n(t,Y9(8,"Backspace")))){Jh&&Js&&t.domObserver.suppressSelectionUpdates();return}Js&&Jh&&y.endB==y.start&&(t.input.lastAndroidDelete=Date.now()),Jh&&!w&&_.start()!=S.start()&&0==S.parentOffset&&_.depth==S.depth&&d.sel&&d.sel.anchor==d.sel.head&&d.sel.head==y.endA&&(y.endB-=2,S=d.doc.resolveNoCache(y.endB-d.from),setTimeout(()=>{t.someProp("handleKeyDown",function(n){return n(t,Y9(13,"Enter"))})},20));let k=y.start,I=y.endA,C,M,R;if(w){if(_.pos==S.pos)Ji&&Jo<=11&&0==_.parentOffset&&(t.domObserver.suppressSelectionUpdates(),setTimeout(()=>J4(t),20)),C=t.state.tr.delete(k,I),M=p.resolve(y.start).marksAcross(p.resolve(y.endA));else if(y.endA==y.endB&&(R=function(t,n){let r=t.firstChild.marks,i=n.firstChild.marks,o=r,a=i,u,s,c;for(let l=0;l<i.length;l++)o=i[l].removeFromSet(o);for(let f=0;f<r.length;f++)a=r[f].removeFromSet(a);if(1==o.length&&0==a.length)s=o[0],u="add",c=t=>t.mark(s.addToSet(t.marks));else{if(0!=o.length||1!=a.length)return null;s=a[0],u="remove",c=t=>t.mark(s.removeFromSet(t.marks))}let d=[];for(let p=0;p<n.childCount;p++)d.push(c(n.child(p)));if(Ze.from(d).eq(t))return{mark:s,type:u}}(_.parent.content.cut(_.parentOffset,S.parentOffset),T.parent.content.cut(T.parentOffset,y.endA-T.start()))))C=t.state.tr,"add"==R.type?C.addMark(k,I,R.mark):C.removeMark(k,I,R.mark);else if(_.parent.child(_.index()).isText&&_.index()==S.index()-(S.textOffset?0:1)){let E=_.parent.textBetween(_.parentOffset,S.parentOffset);if(t.someProp("handleTextInput",n=>n(t,k,I,E)))return;C=t.state.tr.insertText(E,k,I)}}if(C||(C=t.state.tr.replace(k,I,d.doc.slice(y.start-d.from,y.endB-d.from))),d.sel){let j=Xm(t,C.doc,d.sel);j&&!(Js&&Jh&&t.composing&&j.empty&&(y.start!=y.endB||t.input.lastAndroidDelete<Date.now()-100)&&(j.head==k||j.head==C.mapping.map(I)-1)||Ji&&j.empty&&j.head==k)&&C.setSelection(j)}M&&C.ensureMarks(M),t.composing&&C.setMeta("composition",t.input.compositionID),t.dispatch(C.scrollIntoView())})(this,t,n,r,i)),this.domObserver.start(),function(t){for(let n in QC){let r=QC[n];t.dom.addEventListener(n,t.input.eventHandlers[n]=n=>{!QP(t,n)||QA(t,n)||!t.editable&&n.type in QM||r(t,n)},QR[n]?{passive:!0}:void 0)}Jl&&t.dom.addEventListener("input",()=>null),QN(t)}(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let t=this._props;for(let n in this._props={},t)this._props[n]=t[n];this._props.state=this.state}return this._props}update(t){t.handleDOMEvents!=this._props.handleDOMEvents&&QN(this);let n=this._props;this._props=t,t.plugins&&(t.plugins.forEach(XS),this.directPlugins=t.plugins),this.updateStateInner(t.state,n)}setProps(t){let n={};for(let r in this._props)n[r]=this._props[r];for(let i in n.state=this.state,t)n[i]=t[i];this.update(n)}updateState(t){this.updateStateInner(t,this._props)}updateStateInner(t,n){let r=this.state,i=!1,o=!1;t.storedMarks&&this.composing&&(QK(this),o=!0),this.state=t;let a=r.plugins!=t.plugins||this._props.plugins!=n.plugins;if(a||this._props.plugins!=n.plugins||this._props.nodeViews!=n.nodeViews){let u=X_(this);(function(t,n){let r=0,i=0;for(let o in t){if(t[o]!=n[o])return!0;r++}for(let a in n)i++;return r!=i})(u,this.nodeViews)&&(this.nodeViews=u,i=!0)}(a||n.handleDOMEvents!=this._props.handleDOMEvents)&&QN(this),this.editable=Xx(this),Xb(this);let s=Xa(this),c=Xv(this),l=r.plugins==t.plugins||r.doc.eq(t.doc)?t.scrollToSelection>r.scrollToSelection?"to selection":"preserve":"reset",f=i||!this.docView.matchesNode(t.doc,c,s);(f||!t.selection.eq(r.selection))&&(o=!0);let d="preserve"==l&&o&&null==this.dom.style.overflowAnchor&&function(t){let n=t.dom.getBoundingClientRect(),r=Math.max(0,n.top),i,o;for(let a=(n.left+n.right)/2,u=r+1;u<Math.min(innerHeight,n.bottom);u+=5){let s=t.root.elementFromPoint(a,u);if(!s||s==t.dom||!t.dom.contains(s))continue;let c=s.getBoundingClientRect();if(c.top>=r-20){i=s,o=c.top;break}}return{refDOM:i,refTop:o,stack:J_(t.dom)}}(this);if(o){var p,h,m;this.domObserver.stop();let g,y=f&&(Ji||Js)&&!this.composing&&!r.selection.empty&&!t.selection.empty&&(h=r.selection,m=t.selection,g=Math.min(h.$anchor.sharedDepth(h.head),m.$anchor.sharedDepth(m.head)),h.$anchor.start(g)!=m.$anchor.start(g));if(f){let v=Js?this.trackWrites=this.domSelectionRange().focusNode:null;(i||!this.docView.update(t.doc,c,s,this))&&(this.docView.updateOuterDeco([]),this.docView.destroy(),this.docView=Jz(t.doc,c,s,this.dom,this)),v&&!this.trackWrites&&(y=!0)}let b,x;y||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&(b=this.docView.domFromPos(this.state.selection.anchor,0),x=this.domSelectionRange(),Y0(b.node,b.offset,x.anchorNode,x.anchorOffset)))?J4(this,y):(J7(this,t.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(r),"reset"==l?this.dom.scrollTop=0:"to selection"==l?this.scrollToSelection():d&&function({refDOM:t,refTop:n,stack:r}){let i=t?t.getBoundingClientRect().top:0;JS(r,0==i?0:i-n)}(d)}scrollToSelection(){let t=this.domSelectionRange().focusNode;if(!this.someProp("handleScrollToSelection",t=>t(this))){if(this.state.selection instanceof YA){let n=this.docView.domAfterPos(this.state.selection.from);1==n.nodeType&&Jx(this,n.getBoundingClientRect(),t)}else Jx(this,this.coordsAtPos(this.state.selection.head,1),t)}}destroyPluginViews(){let t;for(;t=this.pluginViews.pop();)t.destroy&&t.destroy()}updatePluginViews(t){if(t&&t.plugins==this.state.plugins&&this.directPlugins==this.prevDirectPlugins)for(let n=0;n<this.pluginViews.length;n++){let r=this.pluginViews[n];r.update&&r.update(this,t)}else{this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let i=0;i<this.directPlugins.length;i++){let o=this.directPlugins[i];o.spec.view&&this.pluginViews.push(o.spec.view(this))}for(let a=0;a<this.state.plugins.length;a++){let u=this.state.plugins[a];u.spec.view&&this.pluginViews.push(u.spec.view(this))}}}someProp(t,n){let r=this._props&&this._props[t],i;if(null!=r&&(i=n?n(r):r))return i;for(let o=0;o<this.directPlugins.length;o++){let a=this.directPlugins[o].props[t];if(null!=a&&(i=n?n(a):a))return i}let u=this.state.plugins;if(u)for(let s=0;s<u.length;s++){let c=u[s].props[t];if(null!=c&&(i=n?n(c):c))return i}}hasFocus(){if(Ji){let t=this.root.activeElement;if(t==this.dom)return!0;if(!t||!this.dom.contains(t))return!1;for(;t&&this.dom!=t&&this.dom.contains(t);){if("false"==t.contentEditable)return!1;t=t.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&function(t){if(t.setActive)return t.setActive();if(JT)return t.focus(JT);let n=J_(t);t.focus(null==JT?{get preventScroll(){return JT={preventScroll:!0},!0}}:void 0),JT||(JT=!1,JS(n,0))}(this.dom),J4(this),this.domObserver.start()}get root(){let t=this._root;if(null==t){for(let n=this.dom.parentNode;n;n=n.parentNode)if(9==n.nodeType||11==n.nodeType&&n.host)return n.getSelection||(Object.getPrototypeOf(n).getSelection=()=>n.ownerDocument.getSelection()),this._root=n}return t||document}posAtCoords(t){return function(t,n){var r,i;let o=t.dom.ownerDocument,a,u=0,s=Y6(o,n.left,n.top);s&&({node:a,offset:u}=s);let c=(t.root.elementFromPoint?t.root:o).elementFromPoint(n.left,n.top),l;if(!c||!t.dom.contains(1!=c.nodeType?c.parentNode:c)){let f=t.dom.getBoundingClientRect();if(!Jw(n,f)||!(c=function t(n,r,i){let o=n.childNodes.length;if(o&&i.top<i.bottom)for(let a=Math.max(0,Math.min(o-1,Math.floor(o*(r.top-i.top)/(i.bottom-i.top))-2)),u=a;;){let s=n.childNodes[u];if(1==s.nodeType){let c=s.getClientRects();for(let l=0;l<c.length;l++){let f=c[l];if(Jw(r,f))return t(s,r,f)}}if((u=(u+1)%o)==a)break}return n}(t.dom,n,f)))return null}if(Jl)for(let d=c;a&&d;d=YJ(d))d.draggable&&(a=void 0);let p;if(c=(p=(r=c).parentNode)&&/^li$/i.test(p.nodeName)&&n.left<r.getBoundingClientRect().left?p:r,a){if(Ja&&1==a.nodeType&&(u=Math.min(u,a.childNodes.length))<a.childNodes.length){let h=a.childNodes[u],m;"IMG"==h.nodeName&&(m=h.getBoundingClientRect()).right<=n.left&&m.bottom>n.top&&u++}a==t.dom&&u==a.childNodes.length-1&&1==a.lastChild.nodeType&&n.top>a.lastChild.getBoundingClientRect().bottom?l=t.state.doc.content.size:(0==u||1!=a.nodeType||"BR"!=a.childNodes[u-1].nodeName)&&(l=function(t,n,r,i){let o=-1;for(let a=n,u=!1;a!=t.dom;){let s=t.docView.nearestDesc(a,!0);if(!s)return null;if(1==s.dom.nodeType&&(s.node.isBlock&&s.parent&&!u||!s.contentDOM)){let c=s.dom.getBoundingClientRect();if(s.node.isBlock&&s.parent&&!u&&(u=!0,c.left>i.left||c.top>i.top?o=s.posBefore:(c.right<i.left||c.bottom<i.top)&&(o=s.posAfter)),!s.contentDOM&&o<0)return(s.node.isBlock?i.top<(c.top+c.bottom)/2:i.left<(c.left+c.right)/2)?s.posBefore:s.posAfter}a=s.dom.parentNode}return o>-1?o:t.docView.posFromDOM(n,r,-1)}(t,a,u,n))}null==l&&(l=function(t,n,r){let{node:i,offset:o}=function t(n,r){let i,o=2e8,a,u=0,s=r.top,c=r.top,l,f;for(let d=n.firstChild,p=0;d;d=d.nextSibling,p++){let h;if(1==d.nodeType)h=d.getClientRects();else{if(3!=d.nodeType)continue;h=YX(d).getClientRects()}for(let m=0;m<h.length;m++){let g=h[m];if(g.top<=s&&g.bottom>=c){s=Math.max(g.bottom,s),c=Math.min(g.top,c);let y=g.left>r.left?g.left-r.left:g.right<r.left?r.left-g.right:0;if(y<o){i=d,o=y,a=y&&3==i.nodeType?{left:g.right<r.left?g.right:g.left,top:r.top}:r,1==d.nodeType&&y&&(u=p+(r.left>=(g.left+g.right)/2?1:0));continue}}else g.top>r.top&&!l&&g.left<=r.left&&g.right>=r.left&&(l=d,f={left:Math.max(g.left,Math.min(g.right,r.left)),top:g.top});!i&&(r.left>=g.right&&r.top>=g.top||r.left>=g.left&&r.top>=g.bottom)&&(u=p+1)}}return!i&&l&&(i=l,a=f,o=0),i&&3==i.nodeType?function(t,n){let r=t.nodeValue.length,i=document.createRange();for(let o=0;o<r;o++){i.setEnd(t,o+1),i.setStart(t,o);let a=Jk(i,1);if(a.top!=a.bottom&&Jw(n,a))return{node:t,offset:o+(n.left>=(a.left+a.right)/2?1:0)}}return{node:t,offset:0}}(i,a):!i||o&&1==i.nodeType?{node:n,offset:u}:t(i,a)}(n,r),a=-1;if(1==i.nodeType&&!i.firstChild){let u=i.getBoundingClientRect();a=u.left!=u.right&&r.left>(u.left+u.right)/2?1:-1}return t.docView.posFromDOM(i,o,a)}(t,c,n));let g=t.docView.nearestDesc(c,!0);return{pos:l,inside:g?g.posAtStart-g.border:-1}}(this,t)}coordsAtPos(t,n=1){return JC(this,t,n)}domAtPos(t,n=0){return this.docView.domFromPos(t,n)}nodeDOM(t){let n=this.docView.descAt(t);return n?n.nodeDOM:null}posAtDOM(t,n,r=-1){let i=this.docView.posFromDOM(t,n,r);if(null==i)throw RangeError("DOM position not inside the editor");return i}endOfTextblock(t,n){var r,i,o,a,u,s;let c,l;return JN==(i=n||this.state)&&JA==t?JP:(JN=i,JA=t,JP="up"==t||"down"==t?(a=this,c=i.selection,l="up"==t?c.$from:c.$to,JE(a,i,()=>{let{node:n}=a.docView.domFromPos(l.pos,"up"==t?-1:1);for(;;){let r=a.docView.nearestDesc(n,!0);if(!r)break;if(r.node.isBlock){n=r.contentDOM||r.dom;break}n=r.dom.parentNode}let i=JC(a,l.pos,1);for(let o=n.firstChild;o;o=o.nextSibling){let u;if(1==o.nodeType)u=o.getClientRects();else{if(3!=o.nodeType)continue;u=YX(o,0,o.nodeValue.length).getClientRects()}for(let s=0;s<u.length;s++){let c=u[s];if(c.bottom>c.top+1&&("up"==t?i.top-c.top>(c.bottom-i.top)*2:c.bottom-i.bottom>(i.bottom-c.top)*2))return!1}}return!0})):function(t,n,r){let{$head:i}=n.selection;if(!i.parent.isTextblock)return!1;let o=i.parentOffset,a=o==i.parent.content.size,u=t.domSelection();return Jj.test(i.parent.textContent)&&u.modify?JE(t,n,()=>{let{focusNode:n,focusOffset:o,anchorNode:a,anchorOffset:s}=t.domSelectionRange(),c=u.caretBidiLevel;u.modify("move",r,"character");let l=i.depth?t.docView.domAfterPos(i.before()):t.dom,{focusNode:f,focusOffset:d}=t.domSelectionRange(),p=f&&!l.contains(1==f.nodeType?f:f.parentNode)||n==f&&o==d;try{u.collapse(a,s),n&&(n!=a||o!=s)&&u.extend&&u.extend(n,o)}catch{}return null!=c&&(u.caretBidiLevel=c),p}):"left"==r||"backward"==r?!o:a}(this,i,t))}pasteHTML(t,n){return QZ(this,"",t,!1,n||new ClipboardEvent("paste"))}pasteText(t,n){return QZ(this,t,null,!0,n||new ClipboardEvent("paste"))}destroy(){this.docView&&(function(t){for(let n in t.domObserver.stop(),t.input.eventHandlers)t.dom.removeEventListener(n,t.input.eventHandlers[n]);clearTimeout(t.input.composingTimeout),clearTimeout(t.input.lastIOSEnterFallbackTimeout)}(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],Xa(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null)}get isDestroyed(){return null==this.docView}dispatchEvent(t){var n,r;QA(this,t)||!QC[t.type]||!this.editable&&t.type in QM||QC[t.type](this,t)}dispatch(t){let n=this._props.dispatchTransaction;n?n.call(this,t):this.updateState(this.state.apply(t))}domSelectionRange(){return Jl&&11===this.root.nodeType&&function(t){let n=t.activeElement;for(;n&&n.shadowRoot;)n=n.shadowRoot.activeElement;return n}(this.dom.ownerDocument)==this.dom?function(t){let n;function r(t){t.preventDefault(),t.stopImmediatePropagation(),n=t.getTargetRanges()[0]}t.dom.addEventListener("beforeinput",r,!0),document.execCommand("indent"),t.dom.removeEventListener("beforeinput",r,!0);let i=n.startContainer,o=n.startOffset,a=n.endContainer,u=n.endOffset,s=t.domAtPos(t.state.selection.anchor);return Y0(s.node,s.offset,a,u)&&([i,o,a,u]=[a,u,i,o]),{anchorNode:i,anchorOffset:o,focusNode:a,focusOffset:u}}(this):this.domSelection()}domSelection(){return this.root.getSelection()}}function Xv(t){let n=Object.create(null);return n.class="ProseMirror",n.contenteditable=String(t.editable),t.someProp("attributes",r=>{if("function"==typeof r&&(r=r(t.state)),r)for(let i in r)"class"==i?n.class+=" "+r[i]:"style"==i?n.style=(n.style?n.style+";":"")+r[i]:n[i]||"contenteditable"==i||"nodeName"==i||(n[i]=String(r[i]))}),n.translate||(n.translate="no"),[Q3.node(0,t.state.doc.content.size,n)]}function Xb(t){if(t.markCursor){let n=document.createElement("img");n.className="ProseMirror-separator",n.setAttribute("mark-placeholder","true"),n.setAttribute("alt",""),t.cursorWrapper={dom:n,deco:Q3.widget(t.state.selection.head,n,{raw:!0,marks:t.markCursor})}}else t.cursorWrapper=null}function Xx(t){return!t.someProp("editable",n=>!1===n(t.state))}function X_(t){let n=Object.create(null);function r(t){for(let r in t)Object.prototype.hasOwnProperty.call(n,r)||(n[r]=t[r])}return t.someProp("nodeViews",r),t.someProp("markViews",r),n}function XS(t){if(t.spec.state||t.spec.filterTransaction||t.spec.appendTransaction)throw RangeError("Plugins passed directly to the view must not have a state component")}for(var XT={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:"'"},Xw={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},XO="u">typeof navigator&&/Mac/.test(navigator.platform),Xk="u">typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),XI=0;XI<10;XI++)XT[48+XI]=XT[96+XI]=String(XI);for(var XI=1;XI<=24;XI++)XT[XI+111]="F"+XI;for(var XI=65;XI<=90;XI++)XT[XI]=String.fromCharCode(XI+32),Xw[XI]=String.fromCharCode(XI);for(var XC in XT)Xw.hasOwnProperty(XC)||(Xw[XC]=XT[XC]);let XM="u">typeof navigator&&/Mac|iP(hone|[oa]d)/.test(navigator.platform);function XR(t){let n=t.split(/-(?!$)/),r=n[n.length-1];"Space"==r&&(r=" ");let i,o,a,u;for(let s=0;s<n.length-1;s++){let c=n[s];if(/^(cmd|meta|m)$/i.test(c))u=!0;else if(/^a(lt)?$/i.test(c))i=!0;else if(/^(c|ctrl|control)$/i.test(c))o=!0;else if(/^s(hift)?$/i.test(c))a=!0;else if(/^mod$/i.test(c))XM?u=!0:o=!0;else throw Error("Unrecognized modifier name: "+c)}return i&&(r="Alt-"+r),o&&(r="Ctrl-"+r),u&&(r="Meta-"+r),a&&(r="Shift-"+r),r}function XE(t,n,r=!0){return n.altKey&&(t="Alt-"+t),n.ctrlKey&&(t="Ctrl-"+t),n.metaKey&&(t="Meta-"+t),r&&n.shiftKey&&(t="Shift-"+t),t}let Xj=(t,n)=>!t.selection.empty&&(n&&n(t.tr.deleteSelection().scrollIntoView()),!0),XN=(t,n,r)=>{let i=function(t,n){let{$cursor:r}=t.selection;return r&&(n?n.endOfTextblock("backward",t):!(r.parentOffset>0))?r:null}(t,r);if(!i)return!1;let o=XL(i);if(!o){let a=i.blockRange(),u=a&&Ya(a);return null!=u&&(n&&n(t.tr.lift(a,u).scrollIntoView()),!0)}let s=o.nodeBefore;if(!s.type.spec.isolating&&XZ(t,o,n))return!0;if(0==i.parent.content.size&&(XA(s,"end")||YA.isSelectable(s))){let c=Yp(t.doc,i.before(),i.after(),Za.empty);if(c&&c.slice.size<c.to-c.from){if(n){let l=t.tr.step(c);l.setSelection(XA(s,"end")?YC.findFrom(l.doc.resolve(l.mapping.map(o.pos,-1)),-1):YA.create(l.doc,o.pos-s.nodeSize)),n(l.scrollIntoView())}return!0}}return!!s.isAtom&&o.depth==i.depth-1&&(n&&n(t.tr.delete(o.pos-s.nodeSize,o.pos).scrollIntoView()),!0)};function XA(t,n,r=!1){for(let i=t;i;i="start"==n?i.firstChild:i.lastChild){if(i.isTextblock)return!0;if(r&&1!=i.childCount)break}return!1}let XP=(t,n,r)=>{let{$head:i,empty:o}=t.selection,a=i;if(!o)return!1;if(i.parent.isTextblock){if(r?!r.endOfTextblock("backward",t):i.parentOffset>0)return!1;a=XL(i)}let u=a&&a.nodeBefore;return!!(u&&YA.isSelectable(u))&&(n&&n(t.tr.setSelection(YA.create(t.doc,a.pos-u.nodeSize)).scrollIntoView()),!0)};function XL(t){if(!t.parent.type.spec.isolating)for(let n=t.depth-1;n>=0;n--){if(t.index(n)>0)return t.doc.resolve(t.before(n+1));if(t.node(n).type.spec.isolating)break}return null}let XD=(t,n,r)=>{let i=function(t,n){let{$cursor:r}=t.selection;return r&&(n?n.endOfTextblock("forward",t):!(r.parentOffset<r.parent.content.size))?r:null}(t,r);if(!i)return!1;let o=XW(i);if(!o)return!1;let a=o.nodeAfter;if(XZ(t,o,n))return!0;if(0==i.parent.content.size&&(XA(a,"start")||YA.isSelectable(a))){let u=Yp(t.doc,i.before(),i.after(),Za.empty);if(u&&u.slice.size<u.to-u.from){if(n){let s=t.tr.step(u);s.setSelection(XA(a,"start")?YC.findFrom(s.doc.resolve(s.mapping.map(o.pos)),1):YA.create(s.doc,s.mapping.map(o.pos))),n(s.scrollIntoView())}return!0}}return!!a.isAtom&&o.depth==i.depth-1&&(n&&n(t.tr.delete(o.pos,o.pos+a.nodeSize).scrollIntoView()),!0)},XF=(t,n,r)=>{let{$head:i,empty:o}=t.selection,a=i;if(!o)return!1;if(i.parent.isTextblock){if(r?!r.endOfTextblock("forward",t):i.parentOffset<i.parent.content.size)return!1;a=XW(i)}let u=a&&a.nodeAfter;return!!(u&&YA.isSelectable(u))&&(n&&n(t.tr.setSelection(YA.create(t.doc,a.pos)).scrollIntoView()),!0)};function XW(t){if(!t.parent.type.spec.isolating)for(let n=t.depth-1;n>=0;n--){let r=t.node(n);if(t.index(n)+1<r.childCount)return t.doc.resolve(t.after(n+1));if(r.type.spec.isolating)break}return null}let XU=(t,n)=>{let r=t.selection,i=r instanceof YA,o;if(i){if(r.node.isTextblock||!Yl(t.doc,r.from))return!1;o=r.from}else if(null==(o=Yd(t.doc,r.from,-1)))return!1;if(n){let a=t.tr.join(o);i&&a.setSelection(YA.create(a.doc,o-t.doc.resolve(o).nodeBefore.nodeSize)),n(a.scrollIntoView())}return!0},Xz=(t,n)=>{let r=t.selection,i;if(r instanceof YA){if(r.node.isTextblock||!Yl(t.doc,r.to))return!1;i=r.to}else if(null==(i=Yd(t.doc,r.to,1)))return!1;return n&&n(t.tr.join(i).scrollIntoView()),!0},XB=(t,n)=>{let{$from:r,$to:i}=t.selection,o=r.blockRange(i),a=o&&Ya(o);return null!=a&&(n&&n(t.tr.lift(o,a).scrollIntoView()),!0)},XV=(t,n)=>{let{$head:r,$anchor:i}=t.selection;return!!(r.parent.type.spec.code&&r.sameParent(i))&&(n&&n(t.tr.insertText(`
|
|
13
|
-
`).scrollIntoView()),!0)};function X$(t){for(let n=0;n<t.edgeCount;n++){let{type:r}=t.edge(n);if(r.isTextblock&&!r.hasRequiredAttrs())return r}return null}let Xq=(t,n)=>{let{$head:r,$anchor:i}=t.selection;if(!r.parent.type.spec.code||!r.sameParent(i))return!1;let o=r.node(-1),a=r.indexAfter(-1),u=X$(o.contentMatchAt(a));if(!u||!o.canReplaceWith(a,a,u))return!1;if(n){let s=r.after(),c=t.tr.replaceWith(s,s,u.createAndFill());c.setSelection(YC.near(c.doc.resolve(s),1)),n(c.scrollIntoView())}return!0},XK=(t,n)=>{let r=t.selection,{$from:i,$to:o}=r;if(r instanceof YL||i.parent.inlineContent||o.parent.inlineContent)return!1;let a=X$(o.parent.contentMatchAt(o.indexAfter()));if(!a||!a.isTextblock)return!1;if(n){let u=(!i.parentOffset&&o.index()<o.parent.childCount?i:o).pos,s=t.tr.insert(u,a.createAndFill());s.setSelection(Yj.create(s.doc,u+1)),n(s.scrollIntoView())}return!0},XH=(t,n)=>{let{$cursor:r}=t.selection;if(!r||r.parent.content.size)return!1;if(r.depth>1&&r.after()!=r.end(-1)){let i=r.before();if(Yc(t.doc,i))return n&&n(t.tr.split(i).scrollIntoView()),!0}let o=r.blockRange(),a=o&&Ya(o);return null!=a&&(n&&n(t.tr.lift(o,a).scrollIntoView()),!0)},XG=(t,n)=>{let{$from:r,to:i}=t.selection,o,a=r.sharedDepth(i);return 0!=a&&(o=r.before(a),n&&n(t.tr.setSelection(YA.create(t.doc,o))),!0)};function XZ(t,n,r){var i,o,a;let u=n.nodeBefore,s=n.nodeAfter,c,l;if(u.type.spec.isolating||s.type.spec.isolating)return!1;let f,d,p;if(f=n.nodeBefore,d=n.nodeAfter,p=n.index(),f&&d&&f.type.compatibleContent(d.type)&&(!f.content.size&&n.parent.canReplace(p-1,p)?(r&&r(t.tr.delete(n.pos-f.nodeSize,n.pos).scrollIntoView()),!0):!!(n.parent.canReplace(p,p+1)&&(d.isTextblock||Yl(t.doc,n.pos)))&&(r&&r(t.tr.clearIncompatible(n.pos,f.type,f.contentMatchAt(f.childCount)).join(n.pos).scrollIntoView()),!0)))return!0;let h=n.parent.canReplace(n.index(),n.index()+1);if(h&&(c=(l=u.contentMatchAt(u.childCount)).findWrapping(s.type))&&l.matchType(c[0]||s.type).validEnd){if(r){let m=n.pos+s.nodeSize,g=Ze.empty;for(let y=c.length-1;y>=0;y--)g=Ze.from(c[y].create(null,g));g=Ze.from(u.copy(g));let v=t.tr.step(new Yr(n.pos-1,m,n.pos,m,new Za(g,1,0),c.length,!0)),b=m+2*c.length;Yl(v.doc,b)&&v.join(b),r(v.scrollIntoView())}return!0}let x=YC.findFrom(n,1),_=x&&x.$from.blockRange(x.$to),S=_&&Ya(_);if(null!=S&&S>=n.depth)return r&&r(t.tr.lift(_,S).scrollIntoView()),!0;if(h&&XA(s,"start",!0)&&XA(u,"end")){let T=u,w=[];for(;w.push(T),!T.isTextblock;)T=T.lastChild;let O=s,k=1;for(;!O.isTextblock;O=O.firstChild)k++;if(T.canReplace(T.childCount,T.childCount,O.content)){if(r){let I=Ze.empty;for(let C=w.length-1;C>=0;C--)I=Ze.from(w[C].copy(I));let M=t.tr.step(new Yr(n.pos-w.length,n.pos+s.nodeSize,n.pos+k,n.pos+s.nodeSize-k,new Za(I,w.length,0),0,!0));r(M.scrollIntoView())}return!0}}return!1}function XY(t){return function(n,r){let i=n.selection,o=t<0?i.$from:i.$to,a=o.depth;for(;o.node(a).isInline;){if(!a)return!1;a--}return!!o.node(a).isTextblock&&(r&&r(n.tr.setSelection(Yj.create(n.doc,t<0?o.start(a):o.end(a)))),!0)}}let XJ=XY(-1),XQ=XY(1);function XX(t,n=null){return function(r,i){let o=!1;for(let a=0;a<r.selection.ranges.length&&!o;a++){let{$from:{pos:u},$to:{pos:s}}=r.selection.ranges[a];r.doc.nodesBetween(u,s,(i,a)=>{if(o)return!1;if(!(!i.isTextblock||i.hasMarkup(t,n))){if(i.type==t)o=!0;else{let u=r.doc.resolve(a),s=u.index();o=u.parent.canReplaceWith(s,s+1,t)}}})}if(!o)return!1;if(i){let c=r.tr;for(let l=0;l<r.selection.ranges.length;l++){let{$from:{pos:f},$to:{pos:d}}=r.selection.ranges[l];c.setBlockType(f,d,t,n)}i(c.scrollIntoView())}return!0}}function X0(t){let{state:n,transaction:r}=t,{selection:i}=r,{doc:o}=r,{storedMarks:a}=r;return{...n,apply:n.apply.bind(n),applyTransaction:n.applyTransaction.bind(n),filterTransaction:n.filterTransaction,plugins:n.plugins,schema:n.schema,reconfigure:n.reconfigure.bind(n),toJSON:n.toJSON.bind(n),get storedMarks(){return a},get selection(){return i},get doc(){return o},get tr(){return i=r.selection,o=r.doc,a=r.storedMarks,r}}}"u">typeof navigator?/Mac|iP(hone|[oa]d)/.test(navigator.platform):"u">typeof os&&os.platform&&os.platform();class X1{constructor(t){this.editor=t.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=t.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){let{rawCommands:t,editor:n,state:r}=this,{view:i}=n,{tr:o}=r,a=this.buildProps(o);return Object.fromEntries(Object.entries(t).map(([t,n])=>[t,(...t)=>{let r=n(...t)(a);return o.getMeta("preventDispatch")||this.hasCustomState||i.dispatch(o),r}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(t,n=!0){let{rawCommands:r,editor:i,state:o}=this,{view:a}=i,u=[],s=!!t,c=t||o.tr,l=()=>(s||!n||c.getMeta("preventDispatch")||this.hasCustomState||a.dispatch(c),u.every(t=>!0===t)),f={...Object.fromEntries(Object.entries(r).map(([t,r])=>[t,(...t)=>{let i=this.buildProps(c,n),o=r(...t)(i);return u.push(o),f}])),run:l};return f}createCan(t){let{rawCommands:n,state:r}=this,i=t||r.tr,o=this.buildProps(i,!1);return{...Object.fromEntries(Object.entries(n).map(([t,n])=>[t,(...t)=>n(...t)({...o,dispatch:void 0})])),chain:()=>this.createChain(i,!1)}}buildProps(t,n=!0){let{rawCommands:r,editor:i,state:o}=this,{view:a}=i;o.storedMarks&&t.setStoredMarks(o.storedMarks);let u={tr:t,editor:i,view:a,state:X0({state:o,transaction:t}),dispatch:n?()=>{}:void 0,chain:()=>this.createChain(t),can:()=>this.createCan(t),get commands(){return Object.fromEntries(Object.entries(r).map(([t,n])=>[t,(...t)=>n(...t)(u)]))}};return u}}class X2{constructor(){this.callbacks={}}on(t,n){return this.callbacks[t]||(this.callbacks[t]=[]),this.callbacks[t].push(n),this}emit(t,...n){let r=this.callbacks[t];return r&&r.forEach(t=>t.apply(this,n)),this}off(t,n){let r=this.callbacks[t];return r&&(n?this.callbacks[t]=r.filter(t=>t!==n):delete this.callbacks[t]),this}removeAllListeners(){this.callbacks={}}}function X3(t,n,r){return void 0===t.config[n]&&t.parent?X3(t.parent,n,r):"function"==typeof t.config[n]?t.config[n].bind({...r,parent:t.parent?X3(t.parent,n,r):null}):t.config[n]}function X4(t){let n=t.filter(t=>"extension"===t.type),r=t.filter(t=>"node"===t.type),i=t.filter(t=>"mark"===t.type);return{baseExtensions:n,nodeExtensions:r,markExtensions:i}}function X5(t){let n=[],{nodeExtensions:r,markExtensions:i}=X4(t),o={default:null,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return t.forEach(t=>{let r={name:t.name,options:t.options,storage:t.storage},i=X3(t,"addGlobalAttributes",r);i&&i().forEach(t=>{t.types.forEach(r=>{Object.entries(t.attributes).forEach(([t,i])=>{n.push({type:r,name:t,attribute:{...o,...i}})})})})}),[...r,...i].forEach(t=>{let r={name:t.name,options:t.options,storage:t.storage},i=X3(t,"addAttributes",r);if(!i)return;let a=i();Object.entries(a).forEach(([r,i])=>{let a={...o,...i};"function"==typeof(null==a?void 0:a.default)&&(a.default=a.default()),null!=a&&a.isRequired&&(null==a?void 0:a.default)===void 0&&delete a.default,n.push({type:t.name,name:r,attribute:a})})}),n}function X9(t,n){if("string"==typeof t){if(!n.nodes[t])throw Error(`There is no node type named '${t}'. Maybe you forgot to add the extension?`);return n.nodes[t]}return t}function X6(...t){return t.filter(t=>!!t).reduce((t,n)=>{let r={...t};return Object.entries(n).forEach(([t,n])=>{if(!r[t]){r[t]=n;return}"class"===t?r[t]=[r[t],n].join(" "):"style"===t?r[t]=[r[t],n].join("; "):r[t]=n}),r},{})}function X8(t,n){return n.filter(t=>t.attribute.rendered).map(n=>n.attribute.renderHTML?n.attribute.renderHTML(t.attrs)||{}:{[n.name]:t.attrs[n.name]}).reduce((t,n)=>X6(t,n),{})}function X7(t){return"function"==typeof t}function eee(t,n,...r){return X7(t)?n?t.bind(n)(...r):t(...r):t}function eet(t,n){return t.style?t:{...t,getAttrs(r){let i=t.getAttrs?t.getAttrs(r):t.attrs;if(!1===i)return!1;let o=n.reduce((t,n)=>{var i;let o=n.attribute.parseHTML?n.attribute.parseHTML(r):"string"!=typeof(i=r.getAttribute(n.name))?i:i.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(i):"true"===i||"false"!==i&&i;return null==o?t:{...t,[n.name]:o}},{});return{...i,...o}}}}function een(t){return Object.fromEntries(Object.entries(t).filter(([t,n])=>!("attrs"===t&&function(t={}){return 0===Object.keys(t).length&&t.constructor===Object}(n))&&null!=n))}function eer(t,n){var r;let i=X5(t),{nodeExtensions:o,markExtensions:a}=X4(t),u=null===(r=o.find(t=>X3(t,"topNode")))||void 0===r?void 0:r.name,s=Object.fromEntries(o.map(r=>{let o=i.filter(t=>t.type===r.name),a={name:r.name,options:r.options,storage:r.storage,editor:n},u=t.reduce((t,n)=>{let i=X3(n,"extendNodeSchema",a);return{...t,...i?i(r):{}}},{}),s=een({...u,content:eee(X3(r,"content",a)),marks:eee(X3(r,"marks",a)),group:eee(X3(r,"group",a)),inline:eee(X3(r,"inline",a)),atom:eee(X3(r,"atom",a)),selectable:eee(X3(r,"selectable",a)),draggable:eee(X3(r,"draggable",a)),code:eee(X3(r,"code",a)),defining:eee(X3(r,"defining",a)),isolating:eee(X3(r,"isolating",a)),attrs:Object.fromEntries(o.map(t=>{var n;return[t.name,{default:null===(n=null==t?void 0:t.attribute)||void 0===n?void 0:n.default}]}))}),c=eee(X3(r,"parseHTML",a));c&&(s.parseDOM=c.map(t=>eet(t,o)));let l=X3(r,"renderHTML",a);l&&(s.toDOM=t=>l({node:t,HTMLAttributes:X8(t,o)}));let f=X3(r,"renderText",a);return f&&(s.toText=f),[r.name,s]})),c=Object.fromEntries(a.map(r=>{let o=i.filter(t=>t.type===r.name),a={name:r.name,options:r.options,storage:r.storage,editor:n},u=t.reduce((t,n)=>{let i=X3(n,"extendMarkSchema",a);return{...t,...i?i(r):{}}},{}),s=een({...u,inclusive:eee(X3(r,"inclusive",a)),excludes:eee(X3(r,"excludes",a)),group:eee(X3(r,"group",a)),spanning:eee(X3(r,"spanning",a)),code:eee(X3(r,"code",a)),attrs:Object.fromEntries(o.map(t=>{var n;return[t.name,{default:null===(n=null==t?void 0:t.attribute)||void 0===n?void 0:n.default}]}))}),c=eee(X3(r,"parseHTML",a));c&&(s.parseDOM=c.map(t=>eet(t,o)));let l=X3(r,"renderHTML",a);return l&&(s.toDOM=t=>l({mark:t,HTMLAttributes:X8(t,o)})),[r.name,s]}));return new ZF({topNode:u,nodes:s,marks:c})}function eei(t,n){return n.nodes[t]||n.marks[t]||null}function eeo(t,n){return Array.isArray(n)?n.some(n=>("string"==typeof n?n:n.name)===t.name):n}let eea=(t,n=500)=>{let r="",i=t.parentOffset;return t.parent.nodesBetween(Math.max(0,i-n),i,(t,n,o,a)=>{var u,s;let c=(null===(s=(u=t.type.spec).toText)||void 0===s?void 0:s.call(u,{node:t,pos:n,parent:o,index:a}))||t.textContent||"%leaf%";r+=c.slice(0,Math.max(0,i-n))}),r};function eeu(t){return"[object RegExp]"===Object.prototype.toString.call(t)}class ees{constructor(t){this.find=t.find,this.handler=t.handler}}let eec=(t,n)=>{if(eeu(n))return n.exec(t);let r=n(t);if(!r)return null;let i=[r.text];return i.index=r.index,i.input=t,i.data=r.data,r.replaceWith&&(r.text.includes(r.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),i.push(r.replaceWith)),i};function eel(t){var n;let{editor:r,from:i,to:o,text:a,rules:u,plugin:s}=t,{view:c}=r;if(c.composing)return!1;let l=c.state.doc.resolve(i);if(l.parent.type.spec.code||!(null===(n=l.nodeBefore||l.nodeAfter)||void 0===n)&&n.marks.find(t=>t.type.spec.code))return!1;let f=!1,d=eea(l)+a;return u.forEach(t=>{if(f)return;let n=eec(d,t.find);if(!n)return;let u=c.state.tr,l=X0({state:c.state,transaction:u}),p={from:i-(n[0].length-a.length),to:o},{commands:h,chain:m,can:g}=new X1({editor:r,state:l});null!==t.handler({state:l,range:p,match:n,commands:h,chain:m,can:g})&&u.steps.length&&(u.setMeta(s,{transform:u,from:i,to:o,text:a}),c.dispatch(u),f=!0)}),f}class eef{constructor(t){this.find=t.find,this.handler=t.handler}}let eed=(t,n)=>{if(eeu(n))return[...t.matchAll(n)];let r=n(t);return r?r.map(n=>{let r=[n.text];return r.index=n.index,r.input=t,r.data=n.data,n.replaceWith&&(n.text.includes(n.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),r.push(n.replaceWith)),r}):[]};class eep{constructor(t,n){this.splittableMarks=[],this.editor=n,this.extensions=eep.resolve(t),this.schema=eer(this.extensions,n),this.extensions.forEach(t=>{var n;this.editor.extensionStorage[t.name]=t.storage;let r={name:t.name,options:t.options,storage:t.storage,editor:this.editor,type:eei(t.name,this.schema)};"mark"===t.type&&(!(null!==(n=eee(X3(t,"keepOnSplit",r)))&&void 0!==n)||n)&&this.splittableMarks.push(t.name);let i=X3(t,"onBeforeCreate",r);i&&this.editor.on("beforeCreate",i);let o=X3(t,"onCreate",r);o&&this.editor.on("create",o);let a=X3(t,"onUpdate",r);a&&this.editor.on("update",a);let u=X3(t,"onSelectionUpdate",r);u&&this.editor.on("selectionUpdate",u);let s=X3(t,"onTransaction",r);s&&this.editor.on("transaction",s);let c=X3(t,"onFocus",r);c&&this.editor.on("focus",c);let l=X3(t,"onBlur",r);l&&this.editor.on("blur",l);let f=X3(t,"onDestroy",r);f&&this.editor.on("destroy",f)})}static resolve(t){let n=eep.sort(eep.flatten(t)),r=function(t){let n=t.filter((n,r)=>t.indexOf(n)!==r);return[...new Set(n)]}(n.map(t=>t.name));return r.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${r.map(t=>`'${t}'`).join(", ")}]. This can lead to issues.`),n}static flatten(t){return t.map(t=>{let n={name:t.name,options:t.options,storage:t.storage},r=X3(t,"addExtensions",n);return r?[t,...this.flatten(r())]:t}).flat(10)}static sort(t){return t.sort((t,n)=>{let r=X3(t,"priority")||100,i=X3(n,"priority")||100;return r>i?-1:r<i?1:0})}get commands(){return this.extensions.reduce((t,n)=>{let r={name:n.name,options:n.options,storage:n.storage,editor:this.editor,type:eei(n.name,this.schema)},i=X3(n,"addCommands",r);return i?{...t,...i()}:t},{})}get plugins(){let{editor:t}=this,n=eep.sort([...this.extensions].reverse()),r=[],i=[],o=n.map(n=>{var o,a;let u={name:n.name,options:n.options,storage:n.storage,editor:t,type:eei(n.name,this.schema)},s=[],c=X3(n,"addKeyboardShortcuts",u),l={};if("mark"===n.type&&n.config.exitable&&(l.ArrowRight=()=>etH.handleExit({editor:t,mark:n})),c){let f=Object.fromEntries(Object.entries(c()).map(([n,r])=>[n,()=>r({editor:t})]));l={...l,...f}}let d,p=(o=l,new YK({props:{handleKeyDown:(a=o,d=function(t){let n=Object.create(null);for(let r in t)n[XR(r)]=t[r];return n}(a),function(t,n){var r,i;let o=("Esc"==(i=!(XO&&n.metaKey&&n.shiftKey&&!n.ctrlKey&&!n.altKey||Xk&&n.shiftKey&&n.key&&1==n.key.length||"Unidentified"==n.key)&&n.key||(n.shiftKey?Xw:XT)[n.keyCode]||n.key||"Unidentified")&&(i="Escape"),"Del"==i&&(i="Delete"),"Left"==i&&(i="ArrowLeft"),"Up"==i&&(i="ArrowUp"),"Right"==i&&(i="ArrowRight"),"Down"==i&&(i="ArrowDown"),i),a,u=d[XE(o,n)];if(u&&u(t.state,t.dispatch,t))return!0;if(1==o.length&&" "!=o){if(n.shiftKey){let s=d[XE(o,n,!1)];if(s&&s(t.state,t.dispatch,t))return!0}if((n.shiftKey||n.altKey||n.metaKey||o.charCodeAt(0)>127)&&(a=XT[n.keyCode])&&a!=o){let c=d[XE(a,n)];if(c&&c(t.state,t.dispatch,t))return!0}}return!1})}}));s.push(p);let h=X3(n,"addInputRules",u);eeo(n,t.options.enableInputRules)&&h&&r.push(...h());let m=X3(n,"addPasteRules",u);eeo(n,t.options.enablePasteRules)&&m&&i.push(...m());let g=X3(n,"addProseMirrorPlugins",u);if(g){let y=g();s.push(...y)}return s}).flat();return[function(t){let{editor:n,rules:r}=t,i=new YK({state:{init:()=>null,apply(t,n){let r=t.getMeta(i);return r||(t.selectionSet||t.docChanged?null:n)}},props:{handleTextInput:(t,o,a,u)=>eel({editor:n,from:o,to:a,text:u,rules:r,plugin:i}),handleDOMEvents:{compositionend:t=>(setTimeout(()=>{let{$cursor:o}=t.state.selection;o&&eel({editor:n,from:o.pos,to:o.pos,text:"",rules:r,plugin:i})}),!1)},handleKeyDown(t,o){if("Enter"!==o.key)return!1;let{$cursor:a}=t.state.selection;return!!a&&eel({editor:n,from:a.pos,to:a.pos,text:`
|
|
14
|
-
`,rules:r,plugin:i})}},isInputRules:!0});return i}({editor:t,rules:r}),...function(t){let{editor:n,rules:r}=t,i=null,o=!1,a=!1;return r.map(t=>new YK({view(t){let n=n=>{var r;i=!(null===(r=t.dom.parentElement)||void 0===r)&&r.contains(n.target)?t.dom.parentElement:null};return window.addEventListener("dragstart",n),{destroy(){window.removeEventListener("dragstart",n)}}},props:{handleDOMEvents:{drop:t=>(a=i===t.dom.parentElement,!1),paste(t,n){var r;let i=null===(r=n.clipboardData)||void 0===r?void 0:r.getData("text/html");return o=!!(null!=i&&i.includes("data-pm-slice")),!1}}},appendTransaction(r,i,u){var s;let c=r[0],l="paste"===c.getMeta("uiEvent")&&!o,f="drop"===c.getMeta("uiEvent")&&!a;if(!l&&!f)return;let d=i.doc.content.findDiffStart(u.doc.content),p=i.doc.content.findDiffEnd(u.doc.content);if("number"!=typeof d||!p||d===p.b)return;let h=u.tr,m=X0({state:u,transaction:h});if(!(!function(t){let{editor:n,state:r,from:i,to:o,rule:a}=t,{commands:u,chain:s,can:c}=new X1({editor:n,state:r}),l=[];return r.doc.nodesBetween(i,o,(t,n)=>{if(!t.isTextblock||t.type.spec.code)return;let f=Math.max(i,n),d=Math.min(o,n+t.content.size),p=t.textBetween(f-n,d-n,void 0,"");eed(p,a.find).forEach(t=>{if(void 0===t.index)return;let n=f+t.index+1,i=n+t[0].length,o={from:r.tr.mapping.map(n),to:r.tr.mapping.map(i)},d=a.handler({state:r,range:o,match:t,commands:u,chain:s,can:c});l.push(d)})}),l.every(t=>null!==t)}({editor:n,state:m,from:Math.max(d-1,0),to:p.b-1,rule:t})||!h.steps.length))return h}}))}({editor:t,rules:i}),...o]}get attributes(){return X5(this.extensions)}get nodeViews(){let{editor:t}=this,{nodeExtensions:n}=X4(this.extensions);return Object.fromEntries(n.filter(t=>!!X3(t,"addNodeView")).map(n=>{let r=this.attributes.filter(t=>t.type===n.name),i={name:n.name,options:n.options,storage:n.storage,editor:t,type:X9(n.name,this.schema)},o=X3(n,"addNodeView",i);if(!o)return[];let a=(i,a,u,s)=>{let c=X8(i,r);return o()({editor:t,node:i,getPos:u,decorations:s,HTMLAttributes:c,extension:n})};return[n.name,a]}))}}function eeh(t){var n;return"Object"===Object.prototype.toString.call(t).slice(8,-1)&&t.constructor===Object&&Object.getPrototypeOf(t)===Object.prototype}function eem(t,n){let r={...t};return eeh(t)&&eeh(n)&&Object.keys(n).forEach(i=>{eeh(n[i])&&i in t?r[i]=eem(t[i],n[i]):Object.assign(r,{[i]:n[i]})}),r}class eeg{constructor(t={}){this.type="extension",this.name="extension",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...t},this.name=this.config.name,t.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=eee(X3(this,"addOptions",{name:this.name}))),this.storage=eee(X3(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(t={}){return new eeg(t)}configure(t={}){let n=this.extend();return n.options=eem(this.options,t),n.storage=eee(X3(n,"addStorage",{name:n.name,options:n.options})),n}extend(t={}){let n=new eeg(t);return n.parent=this,this.child=n,n.name=t.name?t.name:n.parent.name,t.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=eee(X3(n,"addOptions",{name:n.name})),n.storage=eee(X3(n,"addStorage",{name:n.name,options:n.options})),n}}function eey(t,n,r){let{from:i,to:o}=n,{blockSeparator:a=`
|
|
15
|
-
|
|
16
|
-
`,textSerializers:u={}}=r||{},s="",c=!0;return t.nodesBetween(i,o,(t,r,l,f)=>{var d;let p=null==u?void 0:u[t.type.name];p?(t.isBlock&&!c&&(s+=a,c=!0),l&&(s+=p({node:t,pos:r,parent:l,index:f,range:n}))):t.isText?(s+=null===(d=null==t?void 0:t.text)||void 0===d?void 0:d.slice(Math.max(i,r)-r,o-r),c=!1):t.isBlock&&!c&&(s+=a,c=!0)}),s}function eev(t){return Object.fromEntries(Object.entries(t.nodes).filter(([,t])=>t.spec.toText).map(([t,n])=>[t,n.spec.toText]))}let eeb=eeg.create({name:"clipboardTextSerializer",addProseMirrorPlugins(){return[new YK({key:new YZ("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{let{editor:t}=this,{state:n,schema:r}=t,{doc:i,selection:o}=n,{ranges:a}=o,u=Math.min(...a.map(t=>t.$from.pos)),s=Math.max(...a.map(t=>t.$to.pos)),c=eev(r);return eey(i,{from:u,to:s},{textSerializers:c})}}})]}}),eex=()=>({editor:t,view:n})=>(requestAnimationFrame(()=>{var r;t.isDestroyed||(n.dom.blur(),null===(r=null==window?void 0:window.getSelection())||void 0===r||r.removeAllRanges())}),!0),ee_=(t=!1)=>({commands:n})=>n.setContent("",t),eeS=()=>({state:t,tr:n,dispatch:r})=>{let{selection:i}=n,{ranges:o}=i;return r&&o.forEach(({$from:r,$to:i})=>{t.doc.nodesBetween(r.pos,i.pos,(t,r)=>{if(t.type.isText)return;let{doc:i,mapping:o}=n,a=i.resolve(o.map(r)),u=i.resolve(o.map(r+t.nodeSize)),s=a.blockRange(u);if(!s)return;let c=Ya(s);if(t.type.isTextblock){let{defaultType:l}=a.parent.contentMatchAt(a.index());n.setNodeMarkup(s.start,l)}(c||0===c)&&n.lift(s,c)})}),!0},eeT=t=>n=>t(n),eew=()=>({state:t,dispatch:n})=>XK(t,n),eeO=()=>({tr:t,dispatch:n})=>{let{selection:r}=t,i=r.$anchor.node();if(i.content.size>0)return!1;let o=t.selection.$anchor;for(let a=o.depth;a>0;a-=1)if(o.node(a).type===i.type){if(n){let u=o.before(a),s=o.after(a);t.delete(u,s).scrollIntoView()}return!0}return!1},eek=t=>({tr:n,state:r,dispatch:i})=>{let o=X9(t,r.schema),a=n.selection.$anchor;for(let u=a.depth;u>0;u-=1)if(a.node(u).type===o){if(i){let s=a.before(u),c=a.after(u);n.delete(s,c).scrollIntoView()}return!0}return!1},eeI=t=>({tr:n,dispatch:r})=>{let{from:i,to:o}=t;return r&&n.delete(i,o),!0},eeC=()=>({state:t,dispatch:n})=>Xj(t,n),eeM=()=>({commands:t})=>t.keyboardShortcut("Enter"),eeR=()=>({state:t,dispatch:n})=>Xq(t,n);function eeE(t,n,r={strict:!0}){let i=Object.keys(n);return!i.length||i.every(i=>r.strict?n[i]===t[i]:eeu(n[i])?n[i].test(t[i]):n[i]===t[i])}function eej(t,n,r={}){return t.find(t=>t.type===n&&eeE(t.attrs,r))}function eeN(t,n,r={}){return!!eej(t,n,r)}function eeA(t,n,r={}){if(!t||!n)return;let i=t.parent.childAfter(t.parentOffset);if(t.parentOffset===i.offset&&0!==i.offset&&(i=t.parent.childBefore(t.parentOffset)),!i.node)return;let o=eej([...i.node.marks],n,r);if(!o)return;let a=i.index,u=t.start()+i.offset,s=a+1,c=u+i.node.nodeSize;for(eej([...i.node.marks],n,r);a>0&&o.isInSet(t.parent.child(a-1).marks);)a-=1,u-=t.parent.child(a).nodeSize;for(;s<t.parent.childCount&&eeN([...t.parent.child(s).marks],n,r);)c+=t.parent.child(s).nodeSize,s+=1;return{from:u,to:c}}function eeP(t,n){if("string"==typeof t){if(!n.marks[t])throw Error(`There is no mark type named '${t}'. Maybe you forgot to add the extension?`);return n.marks[t]}return t}let eeL=(t,n={})=>({tr:r,state:i,dispatch:o})=>{let a=eeP(t,i.schema),{doc:u,selection:s}=r,{$from:c,from:l,to:f}=s;if(o){let d=eeA(c,a,n);if(d&&d.from<=l&&d.to>=f){let p=Yj.create(u,d.from,d.to);r.setSelection(p)}}return!0},eeD=t=>n=>{let r="function"==typeof t?t(n):t;for(let i=0;i<r.length;i+=1)if(r[i](n))return!0;return!1};function eeF(t){return t instanceof Yj}function eeW(t=0,n=0,r=0){return Math.min(Math.max(t,n),r)}function eeU(t,n=null){if(!n)return null;let r=YC.atStart(t),i=YC.atEnd(t);if("start"===n||!0===n)return r;if("end"===n)return i;let o=r.from,a=i.to;return"all"===n?Yj.create(t,eeW(0,o,a),eeW(t.content.size,o,a)):Yj.create(t,eeW(n,o,a),eeW(n,o,a))}function eez(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}let eeB=(t=null,n={})=>({editor:r,view:i,tr:o,dispatch:a})=>{n={scrollIntoView:!0,...n};let u=()=>{eez()&&i.dom.focus(),requestAnimationFrame(()=>{r.isDestroyed||(i.focus(),null!=n&&n.scrollIntoView&&r.commands.scrollIntoView())})};if(i.hasFocus()&&null===t||!1===t)return!0;if(a&&null===t&&!eeF(r.state.selection))return u(),!0;let s=eeU(o.doc,t)||r.state.selection,c=r.state.selection.eq(s);return a&&(c||o.setSelection(s),c&&o.storedMarks&&o.setStoredMarks(o.storedMarks),u()),!0},eeV=(t,n)=>r=>t.every((t,i)=>n(t,{...r,index:i})),ee$=(t,n)=>({tr:r,commands:i})=>i.insertContentAt({from:r.selection.from,to:r.selection.to},t,n);function eeq(t){let n=`<body>${t}</body>`;return new window.DOMParser().parseFromString(n,"text/html").body}function eeK(t,n,r){if(r={slice:!0,parseOptions:{},...r},"object"==typeof t&&null!==t)try{return Array.isArray(t)&&t.length>0?Ze.fromArray(t.map(t=>n.nodeFromJSON(t))):n.nodeFromJSON(t)}catch(i){return console.warn("[tiptap warn]: Invalid content.","Passed value:",t,"Error:",i),eeK("",n,r)}if("string"==typeof t){let o=ZU.fromSchema(n);return r.slice?o.parseSlice(eeq(t),r.parseOptions).content:o.parse(eeq(t),r.parseOptions)}return eeK("",n,r)}let eeH=t=>t.toString().startsWith("<"),eeG=(t,n,r)=>({tr:i,dispatch:o,editor:a})=>{if(o){r={parseOptions:{},updateSelection:!0,...r};let u=eeK(n,a.schema,{parseOptions:{preserveWhitespace:"full",...r.parseOptions}});if("<>"===u.toString())return!0;let{from:s,to:c}="number"==typeof t?{from:t,to:t}:t,l=!0,f=!0;if((eeH(u)?u:[u]).forEach(t=>{t.check(),l=!!l&&t.isText&&0===t.marks.length,f=!!f&&t.isBlock}),s===c&&f){let{parent:d}=i.doc.resolve(s);!d.isTextblock||d.type.spec.code||d.childCount||(s-=1,c+=1)}l?Array.isArray(n)?i.insertText(n.map(t=>t.text||"").join(""),s,c):"object"==typeof n&&n&&n.text?i.insertText(n.text,s,c):i.insertText(n,s,c):i.replaceWith(s,c,u),r.updateSelection&&function(t,n,r){let i=t.steps.length-1;if(i<n)return;let o=t.steps[i];if(!(o instanceof Yn||o instanceof Yr))return;let a=t.mapping.maps[i],u=0;a.forEach((t,n,r,i)=>{0===u&&(u=i)}),t.setSelection(YC.near(t.doc.resolve(u),-1))}(i,i.steps.length-1,-1)}return!0},eeZ=()=>({state:t,dispatch:n})=>XU(t,n),eeY=()=>({state:t,dispatch:n})=>Xz(t,n),eeJ=()=>({state:t,dispatch:n})=>XN(t,n),eeQ=()=>({state:t,dispatch:n})=>XD(t,n);function eeX(){return"u">typeof navigator&&/Mac/.test(navigator.platform)}let ee0=t=>({editor:n,view:r,tr:i,dispatch:o})=>{let a=(function(t){let n=t.split(/-(?!$)/),r=n[n.length-1];"Space"===r&&(r=" ");let i,o,a,u;for(let s=0;s<n.length-1;s+=1){let c=n[s];if(/^(cmd|meta|m)$/i.test(c))u=!0;else if(/^a(lt)?$/i.test(c))i=!0;else if(/^(c|ctrl|control)$/i.test(c))o=!0;else if(/^s(hift)?$/i.test(c))a=!0;else if(/^mod$/i.test(c))eez()||eeX()?u=!0:o=!0;else throw Error(`Unrecognized modifier name: ${c}`)}return i&&(r=`Alt-${r}`),o&&(r=`Ctrl-${r}`),u&&(r=`Meta-${r}`),a&&(r=`Shift-${r}`),r})(t).split(/-(?!$)/),u=a.find(t=>!["Alt","Ctrl","Meta","Shift"].includes(t)),s=new KeyboardEvent("keydown",{key:"Space"===u?" ":u,altKey:a.includes("Alt"),ctrlKey:a.includes("Ctrl"),metaKey:a.includes("Meta"),shiftKey:a.includes("Shift"),bubbles:!0,cancelable:!0}),c=n.captureTransaction(()=>{r.someProp("handleKeyDown",t=>t(r,s))});return null==c||c.steps.forEach(t=>{let n=t.map(i.mapping);n&&o&&i.maybeStep(n)}),!0};function ee1(t,n,r={}){let{from:i,to:o,empty:a}=t.selection,u=n?X9(n,t.schema):null,s=[];t.doc.nodesBetween(i,o,(t,n)=>{if(t.isText)return;let r=Math.min(o,n+t.nodeSize);s.push({node:t,from:Math.max(i,n),to:r})});let c=s.filter(t=>!u||u.name===t.node.type.name).filter(t=>eeE(t.node.attrs,r,{strict:!1}));return a?!!c.length:c.reduce((t,n)=>t+n.to-n.from,0)>=o-i}let ee2=(t,n={})=>({state:r,dispatch:i})=>{let o=X9(t,r.schema);return!!ee1(r,o,n)&&XB(r,i)},ee3=()=>({state:t,dispatch:n})=>XH(t,n),ee4=t=>({state:n,dispatch:r})=>{var i;let o=X9(t,n.schema);return function(t,n){let{$from:r,$to:i}=t.selection,a=r.blockRange(i,t=>t.childCount>0&&t.firstChild.type==o);return!!a&&(!n||(r.node(a.depth-1).type==o?function(t,n,r,i){let o=t.tr,a=i.end,u=i.$to.end(i.depth);a<u&&(o.step(new Yr(a-1,u,a,u,new Za(Ze.from(r.create(null,i.parent.copy())),1,0),1,!0)),i=new Zy(o.doc.resolve(i.$from.pos),o.doc.resolve(u),i.depth));let s=Ya(i);if(null==s)return!1;o.lift(i,s);let c=o.mapping.map(a,-1)-1;return Yl(o.doc,c)&&o.join(c),n(o.scrollIntoView()),!0}(t,n,o,a):function(t,n,r){let i=t.tr,o=r.parent;for(let a=r.end,u=r.endIndex-1,s=r.startIndex;u>s;u--)a-=o.child(u).nodeSize,i.delete(a-1,a+1);let c=i.doc.resolve(r.start),l=c.nodeAfter;if(i.mapping.map(r.end)!=r.start+c.nodeAfter.nodeSize)return!1;let f=0==r.startIndex,d=r.endIndex==o.childCount,p=c.node(-1),h=c.index(-1);if(!p.canReplace(h+(f?0:1),h+1,l.content.append(d?Ze.empty:Ze.from(o))))return!1;let m=c.pos,g=m+l.nodeSize;return i.step(new Yr(m-(f?1:0),g+(d?1:0),m+1,g-1,new Za((f?Ze.empty:Ze.from(o.copy(Ze.empty))).append(d?Ze.empty:Ze.from(o.copy(Ze.empty))),f?0:1,d?0:1),f?0:1)),n(i.scrollIntoView()),!0}(t,n,a)))}(n,r)},ee5=()=>({state:t,dispatch:n})=>XV(t,n);function ee9(t,n){return n.nodes[t]?"node":n.marks[t]?"mark":null}function ee6(t,n){let r="string"==typeof n?[n]:n;return Object.keys(t).reduce((n,i)=>(r.includes(i)||(n[i]=t[i]),n),{})}let ee8=(t,n)=>({tr:r,state:i,dispatch:o})=>{let a=null,u=null,s=ee9("string"==typeof t?t:t.name,i.schema);return!!s&&("node"===s&&(a=X9(t,i.schema)),"mark"===s&&(u=eeP(t,i.schema)),o&&r.selection.ranges.forEach(t=>{i.doc.nodesBetween(t.$from.pos,t.$to.pos,(t,i)=>{a&&a===t.type&&r.setNodeMarkup(i,void 0,ee6(t.attrs,n)),u&&t.marks.length&&t.marks.forEach(o=>{u===o.type&&r.addMark(i,i+t.nodeSize,u.create(ee6(o.attrs,n)))})})}),!0)},ee7=()=>({tr:t,dispatch:n})=>(n&&t.scrollIntoView(),!0),ete=()=>({tr:t,commands:n})=>n.setTextSelection({from:0,to:t.doc.content.size}),ett=()=>({state:t,dispatch:n})=>XP(t,n),etn=()=>({state:t,dispatch:n})=>XF(t,n),etr=()=>({state:t,dispatch:n})=>XG(t,n),eti=()=>({state:t,dispatch:n})=>XQ(t,n),eto=()=>({state:t,dispatch:n})=>XJ(t,n);function eta(t,n,r={}){return eeK(t,n,{slice:!1,parseOptions:r})}let etu=(t,n=!1,r={})=>({tr:i,editor:o,dispatch:a})=>{let{doc:u}=i,s=eta(t,o.schema,r);return a&&i.replaceWith(0,u.content.size,s).setMeta("preventUpdate",!n),!0};function ets(t){return n=>(function(t,n){for(let r=t.depth;r>0;r-=1){let i=t.node(r);if(n(i))return{pos:r>0?t.before(r):0,start:t.start(r),depth:r,node:i}}})(n.$from,t)}function etc(t,n){let r=eeP(n,t.schema),{from:i,to:o,empty:a}=t.selection,u=[];a?(t.storedMarks&&u.push(...t.storedMarks),u.push(...t.selection.$head.marks())):t.doc.nodesBetween(i,o,t=>{u.push(...t.marks)});let s=u.find(t=>t.type.name===r.name);return s?{...s.attrs}:{}}function etl(t,n,r){let i=[];return t===n?r.resolve(t).marks().forEach(n=>{let o=r.resolve(t-1),a=eeA(o,n.type);a&&i.push({mark:n,...a})}):r.nodesBetween(t,n,(t,n)=>{i.push(...t.marks.map(r=>({from:n,to:n+t.nodeSize,mark:r})))}),i}function etf(t,n,r){return Object.fromEntries(Object.entries(r).filter(([r])=>{let i=t.find(t=>t.type===n&&t.name===r);return!!i&&i.attribute.keepOnSplit}))}function etd(t,n,r={}){let{empty:i,ranges:o}=t.selection,a=n?eeP(n,t.schema):null;if(i)return!!(t.storedMarks||t.selection.$from.marks()).filter(t=>!a||a.name===t.type.name).find(t=>eeE(t.attrs,r,{strict:!1}));let u=0,s=[];if(o.forEach(({$from:n,$to:r})=>{let i=n.pos,o=r.pos;t.doc.nodesBetween(i,o,(t,n)=>{if(!t.isText&&!t.marks.length)return;let r=Math.max(i,n),a=Math.min(o,n+t.nodeSize);u+=a-r,s.push(...t.marks.map(t=>({mark:t,from:r,to:a})))})}),0===u)return!1;let c=s.filter(t=>!a||a.name===t.mark.type.name).filter(t=>eeE(t.mark.attrs,r,{strict:!1})).reduce((t,n)=>t+n.to-n.from,0),l=s.filter(t=>!a||t.mark.type!==a&&t.mark.type.excludes(a)).reduce((t,n)=>t+n.to-n.from,0);return(c>0?c+l:c)>=u}function etp(t,n){let{nodeExtensions:r}=X4(n),i=r.find(n=>n.name===t);if(!i)return!1;let o={name:i.name,options:i.options,storage:i.storage},a=eee(X3(i,"group",o));return"string"==typeof a&&a.split(" ").includes("list")}let eth=(t,n={})=>({tr:r,state:i,dispatch:o})=>{let{selection:a}=r,{empty:u,ranges:s}=a,c=eeP(t,i.schema);if(o){if(u){let l=etc(i,c);r.addStoredMark(c.create({...l,...n}))}else s.forEach(t=>{let o=t.$from.pos,a=t.$to.pos;i.doc.nodesBetween(o,a,(t,i)=>{let u=Math.max(i,o),s=Math.min(i+t.nodeSize,a);t.marks.find(t=>t.type===c)?t.marks.forEach(t=>{c===t.type&&r.addMark(u,s,c.create({...t.attrs,...n}))}):r.addMark(u,s,c.create(n))})})}return function(t,n,r){var i;let{selection:o}=n,a=null;if(eeF(o)&&(a=o.$cursor),a){let u=null!==(i=t.storedMarks)&&void 0!==i?i:a.marks();return!!r.isInSet(u)||!u.some(t=>t.type.excludes(r))}let{ranges:s}=o;return s.some(({$from:n,$to:i})=>{let o=0===n.depth&&t.doc.inlineContent&&t.doc.type.allowsMarkType(r);return t.doc.nodesBetween(n.pos,i.pos,(t,n,i)=>{if(o)return!1;if(t.isInline){let a=!i||i.type.allowsMarkType(r),u=!!r.isInSet(t.marks)||!t.marks.some(t=>t.type.excludes(r));o=a&&u}return!o}),o})}(i,r,c)},etm=(t,n)=>({tr:r})=>(r.setMeta(t,n),!0),etg=(t,n={})=>({state:r,dispatch:i,chain:o})=>{let a=X9(t,r.schema);return a.isTextblock?o().command(({commands:t})=>!!XX(a,n)(r)||t.clearNodes()).command(({state:t})=>XX(a,n)(t,i)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},ety=t=>({tr:n,dispatch:r})=>{if(r){let{doc:i}=n,o=eeW(t,0,i.content.size),a=YA.create(i,o);n.setSelection(a)}return!0},etv=t=>({tr:n,dispatch:r})=>{if(r){let{doc:i}=n,{from:o,to:a}="number"==typeof t?{from:t,to:t}:t,u=Yj.atStart(i).from,s=Yj.atEnd(i).to,c=eeW(o,u,s),l=eeW(a,u,s),f=Yj.create(i,c,l);n.setSelection(f)}return!0},etb=t=>({state:n,dispatch:r})=>{var i;let o=X9(t,n.schema);return function(t,n){let{$from:r,$to:i}=t.selection,a=r.blockRange(i,t=>t.childCount>0&&t.firstChild.type==o);if(!a)return!1;let u=a.startIndex;if(0==u)return!1;let s=a.parent,c=s.child(u-1);if(c.type!=o)return!1;if(n){let l=c.lastChild&&c.lastChild.type==s.type,f=Ze.from(l?o.create():null),d=new Za(Ze.from(o.create(null,Ze.from(s.type.create(null,f)))),l?3:1,0),p=a.start,h=a.end;n(t.tr.step(new Yr(p-(l?3:1),h,p,h,d,1,!0)).scrollIntoView())}return!0}(n,r)};function etx(t,n){let r=t.storedMarks||t.selection.$to.parentOffset&&t.selection.$from.marks();if(r){let i=r.filter(t=>null==n?void 0:n.includes(t.type.name));t.tr.ensureMarks(i)}}let et_=({keepMarks:t=!0}={})=>({tr:n,state:r,dispatch:i,editor:o})=>{let{selection:a,doc:u}=n,{$from:s,$to:c}=a,l=o.extensionManager.attributes,f=etf(l,s.node().type.name,s.node().attrs);if(a instanceof YA&&a.node.isBlock)return!!(s.parentOffset&&Yc(u,s.pos))&&(i&&(t&&etx(r,o.extensionManager.splittableMarks),n.split(s.pos).scrollIntoView()),!0);if(!s.parent.isBlock)return!1;if(i){let d=c.parentOffset===c.parent.content.size;a instanceof Yj&&n.deleteSelection();let p=0===s.depth?void 0:function(t){for(let n=0;n<t.edgeCount;n+=1){let{type:r}=t.edge(n);if(r.isTextblock&&!r.hasRequiredAttrs())return r}return null}(s.node(-1).contentMatchAt(s.indexAfter(-1))),h=d&&p?[{type:p,attrs:f}]:void 0,m=Yc(n.doc,n.mapping.map(s.pos),1,h);if(!h&&!m&&Yc(n.doc,n.mapping.map(s.pos),1,p?[{type:p}]:void 0)&&(m=!0,h=p?[{type:p,attrs:f}]:void 0),m&&(n.split(n.mapping.map(s.pos),1,h),p&&!d&&!s.parentOffset&&s.parent.type!==p)){let g=n.mapping.map(s.before()),y=n.doc.resolve(g);s.node(-1).canReplaceWith(y.index(),y.index()+1,p)&&n.setNodeMarkup(n.mapping.map(s.before()),p)}t&&etx(r,o.extensionManager.splittableMarks),n.scrollIntoView()}return!0},etS=t=>({tr:n,state:r,dispatch:i,editor:o})=>{var a;let u=X9(t,r.schema),{$from:s,$to:c}=r.selection,l=r.selection.node;if(l&&l.isBlock||s.depth<2||!s.sameParent(c))return!1;let f=s.node(-1);if(f.type!==u)return!1;let d=o.extensionManager.attributes;if(0===s.parent.content.size&&s.node(-1).childCount===s.indexAfter(-1)){if(2===s.depth||s.node(-3).type!==u||s.index(-2)!==s.node(-2).childCount-1)return!1;if(i){let p=Ze.empty,h=s.index(-1)?1:s.index(-2)?2:3;for(let m=s.depth-h;m>=s.depth-3;m-=1)p=Ze.from(s.node(m).copy(p));let g=s.indexAfter(-1)<s.node(-2).childCount?1:s.indexAfter(-2)<s.node(-3).childCount?2:3,y=etf(d,s.node().type.name,s.node().attrs),v=(null===(a=u.contentMatch.defaultType)||void 0===a?void 0:a.createAndFill(y))||void 0;p=p.append(Ze.from(u.createAndFill(null,v)||void 0));let b=s.before(s.depth-(h-1));n.replace(b,s.after(-g),new Za(p,4-h,0));let x=-1;n.doc.nodesBetween(b,n.doc.content.size,(t,n)=>{if(x>-1)return!1;t.isTextblock&&0===t.content.size&&(x=n+1)}),x>-1&&n.setSelection(Yj.near(n.doc.resolve(x))),n.scrollIntoView()}return!0}let _=c.pos===s.end()?f.contentMatchAt(0).defaultType:null,S=etf(d,f.type.name,f.attrs),T=etf(d,s.node().type.name,s.node().attrs);if(n.delete(s.pos,c.pos),!Yc(n.doc,s.pos,2))return!1;if(i){let{selection:w,storedMarks:O}=r,{splittableMarks:k}=o.extensionManager,I=O||w.$to.parentOffset&&w.$from.marks();if(n.split(s.pos,2,_?[{type:u,attrs:S},{type:_,attrs:T}]:[{type:u,attrs:S}]).scrollIntoView(),!I||!i)return!0;let C=I.filter(t=>k.includes(t.type.name));n.ensureMarks(C)}return!0},etT=(t,n)=>{let r=ets(t=>t.type===n)(t.selection);if(!r)return!0;let i=t.doc.resolve(Math.max(0,r.pos-1)).before(r.depth);if(void 0===i)return!0;let o=t.doc.nodeAt(i);return r.node.type===(null==o?void 0:o.type)&&Yl(t.doc,r.pos)&&t.join(r.pos),!0},etw=(t,n)=>{let r=ets(t=>t.type===n)(t.selection);if(!r)return!0;let i=t.doc.resolve(r.start).after(r.depth);if(void 0===i)return!0;let o=t.doc.nodeAt(i);return r.node.type===(null==o?void 0:o.type)&&Yl(t.doc,i)&&t.join(i),!0},etO=(t,n,r,i={})=>({editor:o,tr:a,state:u,dispatch:s,chain:c,commands:l,can:f})=>{let{extensions:d,splittableMarks:p}=o.extensionManager,h=X9(t,u.schema),m=X9(n,u.schema),{selection:g,storedMarks:y}=u,{$from:v,$to:b}=g,x=v.blockRange(b),_=y||g.$to.parentOffset&&g.$from.marks();if(!x)return!1;let S=ets(t=>etp(t.type.name,d))(g);if(x.depth>=1&&S&&x.depth-S.depth<=1){if(S.node.type===h)return l.liftListItem(m);if(etp(S.node.type.name,d)&&h.validContent(S.node.content)&&s)return c().command(()=>(a.setNodeMarkup(S.pos,h),!0)).command(()=>etT(a,h)).command(()=>etw(a,h)).run()}return r&&_&&s?c().command(()=>{let t=f().wrapInList(h,i),n=_.filter(t=>p.includes(t.type.name));return a.ensureMarks(n),!!t||l.clearNodes()}).wrapInList(h,i).command(()=>etT(a,h)).command(()=>etw(a,h)).run():c().command(()=>!!f().wrapInList(h,i)||l.clearNodes()).wrapInList(h,i).command(()=>etT(a,h)).command(()=>etw(a,h)).run()},etk=(t,n={},r={})=>({state:i,commands:o})=>{let{extendEmptyMarkRange:a=!1}=r,u=eeP(t,i.schema);return etd(i,u,n)?o.unsetMark(u,{extendEmptyMarkRange:a}):o.setMark(u,n)},etI=(t,n,r={})=>({state:i,commands:o})=>{let a=X9(t,i.schema),u=X9(n,i.schema);return ee1(i,a,r)?o.setNode(u):o.setNode(a,r)},etC=(t,n={})=>({state:r,commands:i})=>{let o=X9(t,r.schema);return ee1(r,o,n)?i.lift(o):i.wrapIn(o,n)},etM=()=>({state:t,dispatch:n})=>{let r=t.plugins;for(let i=0;i<r.length;i+=1){let o=r[i],a;if(o.spec.isInputRules&&(a=o.getState(t))){if(n){let u=t.tr,s=a.transform;for(let c=s.steps.length-1;c>=0;c-=1)u.step(s.steps[c].invert(s.docs[c]));if(a.text){let l=u.doc.resolve(a.from).marks();u.replaceWith(a.from,a.to,t.schema.text(a.text,l))}else u.delete(a.from,a.to)}return!0}}return!1},etR=()=>({tr:t,dispatch:n})=>{let{selection:r}=t,{empty:i,ranges:o}=r;return i||n&&o.forEach(n=>{t.removeMark(n.$from.pos,n.$to.pos)}),!0},etE=(t,n={})=>({tr:r,state:i,dispatch:o})=>{var a;let{extendEmptyMarkRange:u=!1}=n,{selection:s}=r,c=eeP(t,i.schema),{$from:l,empty:f,ranges:d}=s;if(!o)return!0;if(f&&u){let{from:p,to:h}=s,m=null===(a=l.marks().find(t=>t.type===c))||void 0===a?void 0:a.attrs,g=eeA(l,c,m);g&&(p=g.from,h=g.to),r.removeMark(p,h,c)}else d.forEach(t=>{r.removeMark(t.$from.pos,t.$to.pos,c)});return r.removeStoredMark(c),!0},etj=(t,n={})=>({tr:r,state:i,dispatch:o})=>{let a=null,u=null,s=ee9("string"==typeof t?t:t.name,i.schema);return!!s&&("node"===s&&(a=X9(t,i.schema)),"mark"===s&&(u=eeP(t,i.schema)),o&&r.selection.ranges.forEach(t=>{let o=t.$from.pos,s=t.$to.pos;i.doc.nodesBetween(o,s,(t,i)=>{a&&a===t.type&&r.setNodeMarkup(i,void 0,{...t.attrs,...n}),u&&t.marks.length&&t.marks.forEach(a=>{if(u===a.type){let c=Math.min(i+t.nodeSize,s);r.addMark(Math.max(i,o),c,u.create({...a.attrs,...n}))}})})}),!0)},etN=(t,n={})=>({state:r,dispatch:i})=>{let o=X9(t,r.schema);return(function(t,n=null){return function(r,i){let{$from:o,$to:a}=r.selection,u=o.blockRange(a),s=u&&Yu(u,t,n);return!!s&&(i&&i(r.tr.wrap(u,s).scrollIntoView()),!0)}})(o,n)(r,i)},etA=(t,n={})=>({state:r,dispatch:i})=>{let o=X9(t,r.schema);return(function(t,n=null){return function(r,i){let{$from:o,$to:a}=r.selection,u=o.blockRange(a),s=!1,c=u;if(!u)return!1;if(u.depth>=2&&o.node(u.depth-1).type.compatibleContent(t)&&0==u.startIndex){if(0==o.index(u.depth-1))return!1;let l=r.doc.resolve(u.start-2);c=new Zy(l,l,u.depth),u.endIndex<u.parent.childCount&&(u=new Zy(o,r.doc.resolve(a.end(u.depth)),u.depth)),s=!0}let f=Yu(c,t,n,u);return!!f&&(i&&i((function(t,n,r,i,o){let a=Ze.empty;for(let u=r.length-1;u>=0;u--)a=Ze.from(r[u].type.create(r[u].attrs,a));t.step(new Yr(n.start-(i?2:0),n.end,n.start,n.end,new Za(a,0,0),r.length,!0));let s=0;for(let c=0;c<r.length;c++)r[c].type==o&&(s=c+1);let l=r.length-s,f=n.start+r.length-(i?2:0),d=n.parent;for(let p=n.startIndex,h=n.endIndex,m=!0;p<h;p++,m=!1)!m&&Yc(t.doc,f,l)&&(t.split(f,l),f+=2*l),f+=d.child(p).nodeSize;return t})(r.tr,u,f,s,t).scrollIntoView()),!0)}})(o,n)(r,i)};var etP=Object.freeze({__proto__:null,blur:eex,clearContent:ee_,clearNodes:eeS,command:eeT,createParagraphNear:eew,deleteCurrentNode:eeO,deleteNode:eek,deleteRange:eeI,deleteSelection:eeC,enter:eeM,exitCode:eeR,extendMarkRange:eeL,first:eeD,focus:eeB,forEach:eeV,insertContent:ee$,insertContentAt:eeG,joinUp:eeZ,joinDown:eeY,joinBackward:eeJ,joinForward:eeQ,keyboardShortcut:ee0,lift:ee2,liftEmptyBlock:ee3,liftListItem:ee4,newlineInCode:ee5,resetAttributes:ee8,scrollIntoView:ee7,selectAll:ete,selectNodeBackward:ett,selectNodeForward:etn,selectParentNode:etr,selectTextblockEnd:eti,selectTextblockStart:eto,setContent:etu,setMark:eth,setMeta:etm,setNode:etg,setNodeSelection:ety,setTextSelection:etv,sinkListItem:etb,splitBlock:et_,splitListItem:etS,toggleList:etO,toggleMark:etk,toggleNode:etI,toggleWrap:etC,undoInputRule:etM,unsetAllMarks:etR,unsetMark:etE,updateAttributes:etj,wrapIn:etN,wrapInList:etA});let etL=eeg.create({name:"commands",addCommands:()=>({...etP})}),etD=eeg.create({name:"editable",addProseMirrorPlugins(){return[new YK({key:new YZ("editable"),props:{editable:()=>this.editor.options.editable}})]}}),etF=eeg.create({name:"focusEvents",addProseMirrorPlugins(){let{editor:t}=this;return[new YK({key:new YZ("focusEvents"),props:{handleDOMEvents:{focus(n,r){t.isFocused=!0;let i=t.state.tr.setMeta("focus",{event:r}).setMeta("addToHistory",!1);return n.dispatch(i),!1},blur(n,r){t.isFocused=!1;let i=t.state.tr.setMeta("blur",{event:r}).setMeta("addToHistory",!1);return n.dispatch(i),!1}}}})]}}),etW=eeg.create({name:"keymap",addKeyboardShortcuts(){let t=()=>this.editor.commands.first(({commands:t})=>[()=>t.undoInputRule(),()=>t.command(({tr:n})=>{let{selection:r,doc:i}=n,{empty:o,$anchor:a}=r,{pos:u,parent:s}=a,c=YC.atStart(i).from===u;return!!o&&!!c&&!!s.type.isTextblock&&!s.textContent.length&&t.clearNodes()}),()=>t.deleteSelection(),()=>t.joinBackward(),()=>t.selectNodeBackward()]),n=()=>this.editor.commands.first(({commands:t})=>[()=>t.deleteSelection(),()=>t.deleteCurrentNode(),()=>t.joinForward(),()=>t.selectNodeForward()]),r={Enter:()=>this.editor.commands.first(({commands:t})=>[()=>t.newlineInCode(),()=>t.createParagraphNear(),()=>t.liftEmptyBlock(),()=>t.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:t,"Mod-Backspace":t,"Shift-Backspace":t,Delete:n,"Mod-Delete":n,"Mod-a":()=>this.editor.commands.selectAll()},i={...r},o={...r,"Ctrl-h":t,"Alt-Backspace":t,"Ctrl-d":n,"Ctrl-Alt-Backspace":n,"Alt-Delete":n,"Alt-d":n,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return eez()||eeX()?o:i},addProseMirrorPlugins(){return[new YK({key:new YZ("clearDocument"),appendTransaction:(t,n,r)=>{if(!(t.some(t=>t.docChanged)&&!n.doc.eq(r.doc)))return;let{empty:i,from:o,to:a}=n.selection,u=YC.atStart(n.doc).from,s=YC.atEnd(n.doc).to;if(i||!(o===u&&a===s)||0!==r.doc.textBetween(0,r.doc.content.size," "," ").length)return;let c=r.tr,l=X0({state:r,transaction:c}),{commands:f}=new X1({editor:this.editor,state:l});if(f.clearNodes(),c.steps.length)return c}})]}}),etU=eeg.create({name:"tabindex",addProseMirrorPlugins(){return[new YK({key:new YZ("tabindex"),props:{attributes:this.editor.isEditable?{tabindex:"0"}:{}}})]}});var etz=Object.freeze({__proto__:null,ClipboardTextSerializer:eeb,Commands:etL,Editable:etD,FocusEvents:etF,Keymap:etW,Tabindex:etU});let etB=`.ProseMirror {
|
|
17
|
-
position: relative;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
.ProseMirror {
|
|
21
|
-
word-wrap: break-word;
|
|
22
|
-
white-space: pre-wrap;
|
|
23
|
-
white-space: break-spaces;
|
|
24
|
-
-webkit-font-variant-ligatures: none;
|
|
25
|
-
font-variant-ligatures: none;
|
|
26
|
-
font-feature-settings: "liga" 0; /* the above doesn't seem to work in Edge */
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
.ProseMirror [contenteditable="false"] {
|
|
30
|
-
white-space: normal;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
.ProseMirror [contenteditable="false"] [contenteditable="true"] {
|
|
34
|
-
white-space: pre-wrap;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
.ProseMirror pre {
|
|
38
|
-
white-space: pre-wrap;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
img.ProseMirror-separator {
|
|
42
|
-
display: inline !important;
|
|
43
|
-
border: none !important;
|
|
44
|
-
margin: 0 !important;
|
|
45
|
-
width: 1px !important;
|
|
46
|
-
height: 1px !important;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
.ProseMirror-gapcursor {
|
|
50
|
-
display: none;
|
|
51
|
-
pointer-events: none;
|
|
52
|
-
position: absolute;
|
|
53
|
-
margin: 0;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
.ProseMirror-gapcursor:after {
|
|
57
|
-
content: "";
|
|
58
|
-
display: block;
|
|
59
|
-
position: absolute;
|
|
60
|
-
top: -2px;
|
|
61
|
-
width: 20px;
|
|
62
|
-
border-top: 1px solid black;
|
|
63
|
-
animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
@keyframes ProseMirror-cursor-blink {
|
|
67
|
-
to {
|
|
68
|
-
visibility: hidden;
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
.ProseMirror-hideselection *::selection {
|
|
73
|
-
background: transparent;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
.ProseMirror-hideselection *::-moz-selection {
|
|
77
|
-
background: transparent;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
.ProseMirror-hideselection * {
|
|
81
|
-
caret-color: transparent;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
.ProseMirror-focused .ProseMirror-gapcursor {
|
|
85
|
-
display: block;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
.tippy-box[data-animation=fade][data-state=hidden] {
|
|
89
|
-
opacity: 0
|
|
90
|
-
}`,etV=class extends X2{constructor(t={}){super(),this.isFocused=!1,this.extensionStorage={},this.options={element:document.createElement("div"),content:"",injectCSS:!0,injectNonce:void 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(t),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=function(t,n){let r=document.querySelector("style[data-tiptap-style]");if(null!==r)return r;let i=document.createElement("style");return n&&i.setAttribute("nonce",n),i.setAttribute("data-tiptap-style",""),i.innerHTML=t,document.getElementsByTagName("head")[0].appendChild(i),i}(etB,this.options.injectNonce))}setOptions(t={}){this.options={...this.options,...t},this.view&&this.state&&!this.isDestroyed&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(t,n=!0){this.setOptions({editable:t}),n&&this.emit("update",{editor:this,transaction:this.state.tr})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get state(){return this.view.state}registerPlugin(t,n){let r=X7(n)?n(t,[...this.state.plugins]):[...this.state.plugins,t],i=this.state.reconfigure({plugins:r});this.view.updateState(i)}unregisterPlugin(t){if(this.isDestroyed)return;let n="string"==typeof t?`${t}$`:t.key,r=this.state.reconfigure({plugins:this.state.plugins.filter(t=>!t.key.startsWith(n))});this.view.updateState(r)}createExtensionManager(){let t=[...this.options.enableCoreExtensions?Object.values(etz):[],...this.options.extensions].filter(t=>["extension","node","mark"].includes(null==t?void 0:t.type));this.extensionManager=new eep(t,this)}createCommandManager(){this.commandManager=new X1({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createView(){let t=eta(this.options.content,this.schema,this.options.parseOptions),n=eeU(t,this.options.autofocus);this.view=new Xy(this.options.element,{...this.options.editorProps,dispatchTransaction:this.dispatchTransaction.bind(this),state:Yq.create({doc:t,selection:n||void 0})});let r=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(r),this.createNodeViews();let i=this.view.dom;i.editor=this}createNodeViews(){this.view.setProps({nodeViews:this.extensionManager.nodeViews})}captureTransaction(t){this.isCapturingTransaction=!0,t(),this.isCapturingTransaction=!1;let n=this.capturedTransaction;return this.capturedTransaction=null,n}dispatchTransaction(t){if(this.view.isDestroyed)return;if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=t;return}t.steps.forEach(t=>{var n;return null===(n=this.capturedTransaction)||void 0===n?void 0:n.step(t)});return}let n=this.state.apply(t),r=!this.state.selection.eq(n.selection);this.view.updateState(n),this.emit("transaction",{editor:this,transaction:t}),r&&this.emit("selectionUpdate",{editor:this,transaction:t});let i=t.getMeta("focus"),o=t.getMeta("blur");i&&this.emit("focus",{editor:this,event:i.event,transaction:t}),o&&this.emit("blur",{editor:this,event:o.event,transaction:t}),!t.docChanged||t.getMeta("preventUpdate")||this.emit("update",{editor:this,transaction:t})}getAttributes(t){return function(t,n){let r=ee9("string"==typeof n?n:n.name,t.schema);return"node"===r?function(t,n){let r=X9(n,t.schema),{from:i,to:o}=t.selection,a=[];t.doc.nodesBetween(i,o,t=>{a.push(t)});let u=a.reverse().find(t=>t.type.name===r.name);return u?{...u.attrs}:{}}(t,n):"mark"===r?etc(t,n):{}}(this.state,t)}isActive(t,n){return function(t,n,r={}){if(!n)return ee1(t,null,r)||etd(t,null,r);let i=ee9(n,t.schema);return"node"===i?ee1(t,n,r):"mark"===i&&etd(t,n,r)}(this.state,"string"==typeof t?t:null,"string"==typeof t?n:t)}getJSON(){return this.state.doc.toJSON()}getHTML(){return function(t,n){let r=ZY.fromSchema(n).serializeFragment(t),i=document.implementation.createHTMLDocument().createElement("div");return i.appendChild(r),i.innerHTML}(this.state.doc.content,this.schema)}getText(t){let{blockSeparator:n=`
|
|
91
|
-
|
|
92
|
-
`,textSerializers:r={}}=t||{};return function(t,n){let r={from:0,to:t.content.size};return eey(t,r,n)}(this.state.doc,{blockSeparator:n,textSerializers:{...eev(this.schema),...r}})}get isEmpty(){return function(t){var n;let r=null===(n=t.type.createAndFill())||void 0===n?void 0:n.toJSON(),i=t.toJSON();return JSON.stringify(r)===JSON.stringify(i)}(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 t;return!(!(null===(t=this.view)||void 0===t)&&t.docView)}};function et$(t){return new ees({find:t.find,handler({state:n,range:r,match:i}){let o=eee(t.getAttributes,void 0,i);if(!1===o||null===o)return null;let{tr:a}=n,u=i[i.length-1],s=i[0],c=r.to;if(u){let l=s.search(/\S/),f=r.from+s.indexOf(u),d=f+u.length;if(etl(r.from,r.to,n.doc).filter(n=>n.mark.type.excluded.find(r=>r===t.type&&r!==n.mark.type)).filter(t=>t.to>f).length)return null;d<r.to&&a.delete(d,r.to),f>r.from&&a.delete(r.from+l,f),c=r.from+l+u.length,a.addMark(r.from+l,c,t.type.create(o||{})),a.removeStoredMark(t.type)}}})}function etq(t){return new ees({find:t.find,handler({state:n,range:r,match:i}){let o=n.doc.resolve(r.from),a=eee(t.getAttributes,void 0,i)||{};if(!o.node(-1).canReplaceWith(o.index(-1),o.indexAfter(-1),t.type))return null;n.tr.delete(r.from,r.to).setBlockType(r.from,r.from,t.type,a)}})}function etK(t){return new ees({find:t.find,handler({state:n,range:r,match:i,chain:o}){let a=eee(t.getAttributes,void 0,i)||{},u=n.tr.delete(r.from,r.to),s=u.doc.resolve(r.from).blockRange(),c=s&&Yu(s,t.type,a);if(!c)return null;if(u.wrap(s,c),t.keepMarks&&t.editor){let{selection:l,storedMarks:f}=n,{splittableMarks:d}=t.editor.extensionManager,p=f||l.$to.parentOffset&&l.$from.marks();if(p){let h=p.filter(t=>d.includes(t.type.name));u.ensureMarks(h)}}if(t.keepAttributes){let m="bulletList"===t.type.name||"orderedList"===t.type.name?"listItem":"taskList";o().updateAttributes(m,a).run()}let g=u.doc.resolve(r.from-1).nodeBefore;g&&g.type===t.type&&Yl(u.doc,r.from-1)&&(!t.joinPredicate||t.joinPredicate(i,g))&&u.join(r.from-1)}})}let etH=class t{constructor(t={}){this.type="mark",this.name="mark",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...t},this.name=this.config.name,t.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=eee(X3(this,"addOptions",{name:this.name}))),this.storage=eee(X3(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(n={}){return new t(n)}configure(t={}){let n=this.extend();return n.options=eem(this.options,t),n.storage=eee(X3(n,"addStorage",{name:n.name,options:n.options})),n}extend(n={}){let r=new t(n);return r.parent=this,this.child=r,r.name=n.name?n.name:r.parent.name,n.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${r.name}".`),r.options=eee(X3(r,"addOptions",{name:r.name})),r.storage=eee(X3(r,"addStorage",{name:r.name,options:r.options})),r}static handleExit({editor:t,mark:n}){let{tr:r}=t.state,i=t.state.selection.$from;if(i.pos===i.end()){let o=i.marks();if(!o.find(t=>(null==t?void 0:t.type.name)===n.name))return!1;let a=o.find(t=>(null==t?void 0:t.type.name)===n.name);return a&&r.removeStoredMark(a),r.insertText(" ",i.pos),t.view.dispatch(r),!0}return!1}};class etG{constructor(t={}){this.type="node",this.name="node",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...t},this.name=this.config.name,t.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=eee(X3(this,"addOptions",{name:this.name}))),this.storage=eee(X3(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(t={}){return new etG(t)}configure(t={}){let n=this.extend();return n.options=eem(this.options,t),n.storage=eee(X3(n,"addStorage",{name:n.name,options:n.options})),n}extend(t={}){let n=new etG(t);return n.parent=this,this.child=n,n.name=t.name?t.name:n.parent.name,t.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=eee(X3(n,"addOptions",{name:n.name})),n.storage=eee(X3(n,"addStorage",{name:n.name,options:n.options})),n}}class etZ{constructor(t,n,r){this.isDragging=!1,this.component=t,this.editor=n.editor,this.options={stopEvent:null,ignoreMutation:null,...r},this.extension=n.extension,this.node=n.node,this.decorations=n.decorations,this.getPos=n.getPos,this.mount()}mount(){}get dom(){return this.editor.view.dom}get contentDOM(){return null}onDragStart(t){var n,r,i,o,a,u,s;let{view:c}=this.editor,l=t.target,f=3===l.nodeType?null===(n=l.parentElement)||void 0===n?void 0:n.closest("[data-drag-handle]"):l.closest("[data-drag-handle]");if(!this.dom||!(null===(r=this.contentDOM)||void 0===r)&&r.contains(l)||!f)return;let d=0,p=0;if(this.dom!==f){let h=this.dom.getBoundingClientRect(),m=f.getBoundingClientRect(),g=null!==(i=t.offsetX)&&void 0!==i?i:null===(o=t.nativeEvent)||void 0===o?void 0:o.offsetX,y=null!==(a=t.offsetY)&&void 0!==a?a:null===(u=t.nativeEvent)||void 0===u?void 0:u.offsetY;d=m.x-h.x+g,p=m.y-h.y+y}null===(s=t.dataTransfer)||void 0===s||s.setDragImage(this.dom,d,p);let v=YA.create(c.state.doc,this.getPos()),b=c.state.tr.setSelection(v);c.dispatch(b)}stopEvent(t){var n;if(!this.dom)return!1;if("function"==typeof this.options.stopEvent)return this.options.stopEvent({event:t});let r=t.target;if(!(this.dom.contains(r)&&!(!(null===(n=this.contentDOM)||void 0===n)&&n.contains(r))))return!1;let i=t.type.startsWith("drag"),o="drop"===t.type;if((["INPUT","BUTTON","SELECT","TEXTAREA"].includes(r.tagName)||r.isContentEditable)&&!o&&!i)return!0;let{isEditable:a}=this.editor,{isDragging:u}=this,s=!!this.node.type.spec.draggable,c=YA.isSelectable(this.node),l="copy"===t.type,f="paste"===t.type,d="cut"===t.type,p="mousedown"===t.type;if(!s&&c&&i&&t.preventDefault(),s&&i&&!u)return t.preventDefault(),!1;if(s&&a&&!u&&p){let h=r.closest("[data-drag-handle]");h&&(this.dom===h||this.dom.contains(h))&&(this.isDragging=!0,document.addEventListener("dragend",()=>{this.isDragging=!1},{once:!0}),document.addEventListener("drop",()=>{this.isDragging=!1},{once:!0}),document.addEventListener("mouseup",()=>{this.isDragging=!1},{once:!0}))}return!(u||o||l||f||d||p&&c)}ignoreMutation(t){return!this.dom||!this.contentDOM||("function"==typeof this.options.ignoreMutation?this.options.ignoreMutation({mutation:t}):!!this.node.isLeaf||!!this.node.isAtom||!("selection"===t.type||this.dom.contains(t.target)&&"childList"===t.type&&eez()&&this.editor.isFocused&&[...Array.from(t.addedNodes),...Array.from(t.removedNodes)].every(t=>t.isContentEditable))&&(this.contentDOM===t.target&&"attributes"===t.type||!this.contentDOM.contains(t.target)))}updateAttributes(t){this.editor.commands.command(({tr:n})=>{let r=this.getPos();return n.setNodeMarkup(r,void 0,{...this.node.attrs,...t}),!0})}deleteNode(){let t=this.getPos(),n=t+this.node.nodeSize;this.editor.commands.deleteRange({from:t,to:n})}}function etY(t){return new eef({find:t.find,handler({state:n,range:r,match:i}){let o=eee(t.getAttributes,void 0,i);if(!1===o||null===o)return null;let{tr:a}=n,u=i[i.length-1],s=i[0],c=r.to;if(u){let l=s.search(/\S/),f=r.from+s.indexOf(u),d=f+u.length;if(etl(r.from,r.to,n.doc).filter(n=>n.mark.type.excluded.find(r=>r===t.type&&r!==n.mark.type)).filter(t=>t.to>f).length)return null;d<r.to&&a.delete(d,r.to),f>r.from&&a.delete(r.from+l,f),c=r.from+l+u.length,a.addMark(r.from+l,c,t.type.create(o||{})),a.removeStoredMark(t.type)}}})}var etJ="bottom",etQ="right",etX="left",et0="auto",et1=["top",etJ,etQ,etX],et2="start",et3="viewport",et4="popper",et5=et1.reduce(function(t,n){return t.concat([n+"-"+et2,n+"-end"])},[]),et9=[].concat(et1,[et0]).reduce(function(t,n){return t.concat([n,n+"-"+et2,n+"-end"])},[]),et6=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function et8(t){return t?(t.nodeName||"").toLowerCase():null}function et7(t){if(null==t)return window;if("[object Window]"!==t.toString()){var n=t.ownerDocument;return n&&n.defaultView||window}return t}function ene(t){var n=et7(t).Element;return t instanceof n||t instanceof Element}function ent(t){var n=et7(t).HTMLElement;return t instanceof n||t instanceof HTMLElement}function enn(t){if(typeof ShadowRoot>"u")return!1;var n=et7(t).ShadowRoot;return t instanceof n||t instanceof ShadowRoot}let enr={name:"applyStyles",enabled:!0,phase:"write",fn:function(t){var n=t.state;Object.keys(n.elements).forEach(function(t){var r=n.styles[t]||{},i=n.attributes[t]||{},o=n.elements[t];ent(o)&&et8(o)&&(Object.assign(o.style,r),Object.keys(i).forEach(function(t){var n=i[t];!1===n?o.removeAttribute(t):o.setAttribute(t,!0===n?"":n)}))})},effect:function(t){var n=t.state,r={popper:{position:n.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(n.elements.popper.style,r.popper),n.styles=r,n.elements.arrow&&Object.assign(n.elements.arrow.style,r.arrow),function(){Object.keys(n.elements).forEach(function(t){var i=n.elements[t],o=n.attributes[t]||{},a=Object.keys(n.styles.hasOwnProperty(t)?n.styles[t]:r[t]).reduce(function(t,n){return t[n]="",t},{});ent(i)&&et8(i)&&(Object.assign(i.style,a),Object.keys(o).forEach(function(t){i.removeAttribute(t)}))})}},requires:["computeStyles"]};function eni(t){return t.split("-")[0]}var eno=Math.max,ena=Math.min,enu=Math.round;function ens(){var t=navigator.userAgentData;return null!=t&&t.brands&&Array.isArray(t.brands)?t.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function enc(){return!/^((?!chrome|android).)*safari/i.test(ens())}function enl(t,n,r){void 0===n&&(n=!1),void 0===r&&(r=!1);var i=t.getBoundingClientRect(),o=1,a=1;n&&ent(t)&&(o=t.offsetWidth>0&&enu(i.width)/t.offsetWidth||1,a=t.offsetHeight>0&&enu(i.height)/t.offsetHeight||1);var u=(ene(t)?et7(t):window).visualViewport,s=!enc()&&r,c=(i.left+(s&&u?u.offsetLeft:0))/o,l=(i.top+(s&&u?u.offsetTop:0))/a,f=i.width/o,d=i.height/a;return{width:f,height:d,top:l,right:c+f,bottom:l+d,left:c,x:c,y:l}}function enf(t){var n=enl(t),r=t.offsetWidth,i=t.offsetHeight;return 1>=Math.abs(n.width-r)&&(r=n.width),1>=Math.abs(n.height-i)&&(i=n.height),{x:t.offsetLeft,y:t.offsetTop,width:r,height:i}}function end(t,n){var r=n.getRootNode&&n.getRootNode();if(t.contains(n))return!0;if(r&&enn(r)){var i=n;do{if(i&&t.isSameNode(i))return!0;i=i.parentNode||i.host}while(i)}return!1}function enp(t){return et7(t).getComputedStyle(t)}function enh(t){return["table","td","th"].indexOf(et8(t))>=0}function enm(t){return((ene(t)?t.ownerDocument:t.document)||window.document).documentElement}function eng(t){return"html"===et8(t)?t:t.assignedSlot||t.parentNode||(enn(t)?t.host:null)||enm(t)}function eny(t){return ent(t)&&"fixed"!==enp(t).position?t.offsetParent:null}function env(t){for(var n=et7(t),r=eny(t);r&&enh(r)&&"static"===enp(r).position;)r=eny(r);return r&&("html"===et8(r)||"body"===et8(r)&&"static"===enp(r).position)?n:r||function(t){var n=/firefox/i.test(ens());if(/Trident/i.test(ens())&&ent(t)&&"fixed"===enp(t).position)return null;var r=eng(t);for(enn(r)&&(r=r.host);ent(r)&&0>["html","body"].indexOf(et8(r));){var i=enp(r);if("none"!==i.transform||"none"!==i.perspective||"paint"===i.contain||-1!==["transform","perspective"].indexOf(i.willChange)||n&&"filter"===i.willChange||n&&i.filter&&"none"!==i.filter)return r;r=r.parentNode}return null}(t)||n}function enb(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function enx(t,n,r){return eno(t,ena(n,r))}function en_(){return{top:0,right:0,bottom:0,left:0}}function enS(t){return Object.assign({},en_(),t)}function enT(t,n){return n.reduce(function(n,r){return n[r]=t,n},{})}function enw(t){return t.split("-")[1]}var enO={top:"auto",right:"auto",bottom:"auto",left:"auto"};function enk(t){var n,r,i=t.popper,o=t.popperRect,a=t.placement,u=t.variation,s=t.offsets,c=t.position,l=t.gpuAcceleration,f=t.adaptive,d=t.roundOffsets,p=t.isFixed,h=s.x,m=void 0===h?0:h,g=s.y,y=void 0===g?0:g,v="function"==typeof d?d({x:m,y:y}):{x:m,y:y};m=v.x,y=v.y;var b=s.hasOwnProperty("x"),x=s.hasOwnProperty("y"),_=etX,S="top",T=window;if(f){var w=env(i),O="clientHeight",k="clientWidth";w===et7(i)&&(w=enm(i),"static"!==enp(w).position&&"absolute"===c&&(O="scrollHeight",k="scrollWidth")),("top"===a||(a===etX||a===etQ)&&"end"===u)&&(S=etJ,y-=(p&&w===T&&T.visualViewport?T.visualViewport.height:w[O])-o.height,y*=l?1:-1),(a===etX||("top"===a||a===etJ)&&"end"===u)&&(_=etQ,m-=(p&&w===T&&T.visualViewport?T.visualViewport.width:w[k])-o.width,m*=l?1:-1)}var I,C,M,R,E,j=Object.assign({position:c},f&&enO),N=!0===d?(I={x:m,y:y},C=et7(i),M=I.x,R=I.y,{x:enu(M*(E=C.devicePixelRatio||1))/E||0,y:enu(R*E)/E||0}):{x:m,y:y};return(m=N.x,y=N.y,l)?Object.assign({},j,((n={})[S]=x?"0":"",n[_]=b?"0":"",n.transform=1>=(T.devicePixelRatio||1)?"translate("+m+"px, "+y+"px)":"translate3d("+m+"px, "+y+"px, 0)",n)):Object.assign({},j,((r={})[S]=x?y+"px":"",r[_]=b?m+"px":"",r.transform="",r))}var enI={passive:!0},enC={left:"right",right:"left",bottom:"top",top:"bottom"};function enM(t){return t.replace(/left|right|bottom|top/g,function(t){return enC[t]})}var enR={start:"end",end:"start"};function enE(t){return t.replace(/start|end/g,function(t){return enR[t]})}function enj(t){var n,r=et7(t);return{scrollLeft:r.pageXOffset,scrollTop:r.pageYOffset}}function enN(t){return enl(enm(t)).left+enj(t).scrollLeft}function enA(t){var n=enp(t),r=n.overflow,i=n.overflowX,o=n.overflowY;return/auto|scroll|overlay|hidden/.test(r+o+i)}function enP(t,n){void 0===n&&(n=[]);var r,i=function t(n){return["html","body","#document"].indexOf(et8(n))>=0?n.ownerDocument.body:ent(n)&&enA(n)?n:t(eng(n))}(t),o=i===(null==(r=t.ownerDocument)?void 0:r.body),a=et7(i),u=o?[a].concat(a.visualViewport||[],enA(i)?i:[]):i,s=n.concat(u);return o?s:s.concat(enP(eng(u)))}function enL(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function enD(t,n,r){var i,o,a,u,s,c,l,f,d,p,h,m;return n===et3?enL(function(t,n){var r=et7(t),i=enm(t),o=r.visualViewport,a=i.clientWidth,u=i.clientHeight,s=0,c=0;if(o){a=o.width,u=o.height;var l=enc();(l||!l&&"fixed"===n)&&(s=o.offsetLeft,c=o.offsetTop)}return{width:a,height:u,x:s+enN(t),y:c}}(t,r)):ene(n)?((a=enl(n,!1,"fixed"===r)).top=a.top+n.clientTop,a.left=a.left+n.clientLeft,a.bottom=a.top+n.clientHeight,a.right=a.left+n.clientWidth,a.width=n.clientWidth,a.height=n.clientHeight,a.x=a.left,a.y=a.top,a):enL((u=enm(t),c=enm(u),l=enj(u),f=null==(s=u.ownerDocument)?void 0:s.body,d=eno(c.scrollWidth,c.clientWidth,f?f.scrollWidth:0,f?f.clientWidth:0),p=eno(c.scrollHeight,c.clientHeight,f?f.scrollHeight:0,f?f.clientHeight:0),h=-l.scrollLeft+enN(u),m=-l.scrollTop,"rtl"===enp(f||c).direction&&(h+=eno(c.clientWidth,f?f.clientWidth:0)-d),{width:d,height:p,x:h,y:m}))}function enF(t){var n,r=t.reference,i=t.element,o=t.placement,a=o?eni(o):null,u=o?enw(o):null,s=r.x+r.width/2-i.width/2,c=r.y+r.height/2-i.height/2;switch(a){case"top":n={x:s,y:r.y-i.height};break;case etJ:n={x:s,y:r.y+r.height};break;case etQ:n={x:r.x+r.width,y:c};break;case etX:n={x:r.x-i.width,y:c};break;default:n={x:r.x,y:r.y}}var l=a?enb(a):null;if(null!=l){var f="y"===l?"height":"width";switch(u){case et2:n[l]=n[l]-(r[f]/2-i[f]/2);break;case"end":n[l]=n[l]+(r[f]/2-i[f]/2)}}return n}function enW(t,n){void 0===n&&(n={});var r,i,o,a,u,s,c,l,f,d,p=n,h=p.placement,m=void 0===h?t.placement:h,g=p.strategy,y=void 0===g?t.strategy:g,v=p.boundary,b=p.rootBoundary,x=p.elementContext,_=void 0===x?et4:x,S=p.altBoundary,T=p.padding,w=void 0===T?0:T,O=enS("number"!=typeof w?w:enT(w,et1)),k=t.rects.popper,I=t.elements[void 0!==S&&S?_===et4?"reference":et4:_],C=(r=ene(I)?I:I.contextElement||enm(t.elements.popper),f=(l=[].concat("clippingParents"===(i=void 0===v?"clippingParents":v)?(s=enP(eng(r)),c=["absolute","fixed"].indexOf(enp(r).position)>=0&&ent(r)?env(r):r,ene(c)?s.filter(function(t){return ene(t)&&end(t,c)&&"body"!==et8(t)}):[]):[].concat(i),[void 0===b?et3:b]))[0],(d=l.reduce(function(t,n){var i=enD(r,n,y);return t.top=eno(i.top,t.top),t.right=ena(i.right,t.right),t.bottom=ena(i.bottom,t.bottom),t.left=eno(i.left,t.left),t},enD(r,f,y))).width=d.right-d.left,d.height=d.bottom-d.top,d.x=d.left,d.y=d.top,d),M=enl(t.elements.reference),R=enF({reference:M,element:k,strategy:"absolute",placement:m}),E=enL(Object.assign({},k,R)),j=_===et4?E:M,N={top:C.top-j.top+O.top,bottom:j.bottom-C.bottom+O.bottom,left:C.left-j.left+O.left,right:j.right-C.right+O.right},A=t.modifiersData.offset;if(_===et4&&A){var P=A[m];Object.keys(N).forEach(function(t){var n=[etQ,etJ].indexOf(t)>=0?1:-1,r=["top",etJ].indexOf(t)>=0?"y":"x";N[t]+=P[r]*n})}return N}function enU(t,n,r){return void 0===r&&(r={x:0,y:0}),{top:t.top-n.height-r.y,right:t.right-n.width+r.x,bottom:t.bottom-n.height+r.y,left:t.left-n.width-r.x}}function enz(t){return["top",etQ,etJ,etX].some(function(n){return t[n]>=0})}var enB={placement:"bottom",modifiers:[],strategy:"absolute"};function enV(){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];return!n.some(function(t){return!(t&&"function"==typeof t.getBoundingClientRect)})}var en$,enq,enK,enH,enG,enZ,enY,enJ,enQ,enX,en0=(enG={defaultModifiers:[{name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(t){var n=t.state,r=t.instance,i=t.options,o=i.scroll,a=void 0===o||o,u=i.resize,s=void 0===u||u,c=et7(n.elements.popper),l=[].concat(n.scrollParents.reference,n.scrollParents.popper);return a&&l.forEach(function(t){t.addEventListener("scroll",r.update,enI)}),s&&c.addEventListener("resize",r.update,enI),function(){a&&l.forEach(function(t){t.removeEventListener("scroll",r.update,enI)}),s&&c.removeEventListener("resize",r.update,enI)}},data:{}},{name:"popperOffsets",enabled:!0,phase:"read",fn:function(t){var n=t.state,r=t.name;n.modifiersData[r]=enF({reference:n.rects.reference,element:n.rects.popper,strategy:"absolute",placement:n.placement})},data:{}},{name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(t){var n=t.state,r=t.options,i=r.gpuAcceleration,o=r.adaptive,a=r.roundOffsets,u=void 0===a||a,s={placement:eni(n.placement),variation:enw(n.placement),popper:n.elements.popper,popperRect:n.rects.popper,gpuAcceleration:void 0===i||i,isFixed:"fixed"===n.options.strategy};null!=n.modifiersData.popperOffsets&&(n.styles.popper=Object.assign({},n.styles.popper,enk(Object.assign({},s,{offsets:n.modifiersData.popperOffsets,position:n.options.strategy,adaptive:void 0===o||o,roundOffsets:u})))),null!=n.modifiersData.arrow&&(n.styles.arrow=Object.assign({},n.styles.arrow,enk(Object.assign({},s,{offsets:n.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:u})))),n.attributes.popper=Object.assign({},n.attributes.popper,{"data-popper-placement":n.placement})},data:{}},enr,{name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(t){var n=t.state,r=t.options,i=t.name,o=r.offset,a=void 0===o?[0,0]:o,u=et9.reduce(function(t,r){var i,o,u,s,c,l,f,d;return t[r]=(o=n.rects,c=[etX,"top"].indexOf(s=eni(r))>=0?-1:1,f=(l="function"==typeof a?a(Object.assign({},o,{placement:r})):a)[0],d=l[1],f=f||0,d=(d||0)*c,[etX,etQ].indexOf(s)>=0?{x:d,y:f}:{x:f,y:d}),t},{}),s=u[n.placement],c=s.x,l=s.y;null!=n.modifiersData.popperOffsets&&(n.modifiersData.popperOffsets.x+=c,n.modifiersData.popperOffsets.y+=l),n.modifiersData[i]=u}},{name:"flip",enabled:!0,phase:"main",fn:function(t){var n=t.state,r=t.options,i=t.name;if(!n.modifiersData[i]._skip){for(var o=r.mainAxis,a=void 0===o||o,u=r.altAxis,s=void 0===u||u,c=r.fallbackPlacements,l=r.padding,f=r.boundary,d=r.rootBoundary,p=r.altBoundary,h=r.flipVariations,m=void 0===h||h,g=r.allowedAutoPlacements,y=n.options.placement,v=eni(y),b=c||(v!==y&&m?function(t){if(eni(t)===et0)return[];var n=enM(t);return[enE(t),n,enE(n)]}(y):[enM(y)]),x=[y].concat(b).reduce(function(t,r){var i,o,a,u,s,c,p,h,y,v,b,x,_,S;return t.concat(eni(r)===et0?(o={placement:r,boundary:f,rootBoundary:d,padding:l,flipVariations:m,allowedAutoPlacements:g},u=(a=o).placement,s=a.boundary,c=a.rootBoundary,p=a.padding,h=a.flipVariations,v=void 0===(y=a.allowedAutoPlacements)?et9:y,0===(_=(x=(b=enw(u))?h?et5:et5.filter(function(t){return enw(t)===b}):et1).filter(function(t){return v.indexOf(t)>=0})).length&&(_=x),Object.keys(S=_.reduce(function(t,r){return t[r]=enW(n,{placement:r,boundary:s,rootBoundary:c,padding:p})[eni(r)],t},{})).sort(function(t,n){return S[t]-S[n]})):r)},[]),_=n.rects.reference,S=n.rects.popper,T=new Map,w=!0,O=x[0],k=0;k<x.length;k++){var I=x[k],C=eni(I),M=enw(I)===et2,R=["top",etJ].indexOf(C)>=0,E=R?"width":"height",j=enW(n,{placement:I,boundary:f,rootBoundary:d,altBoundary:p,padding:l}),N=R?M?etQ:etX:M?etJ:"top";_[E]>S[E]&&(N=enM(N));var A=enM(N),P=[];if(a&&P.push(j[C]<=0),s&&P.push(j[N]<=0,j[A]<=0),P.every(function(t){return t})){O=I,w=!1;break}T.set(I,P)}if(w)for(var L=m?3:1,D=function(t){var n=x.find(function(n){var r=T.get(n);if(r)return r.slice(0,t).every(function(t){return t})});if(n)return O=n,"break"},F=L;F>0&&"break"!==D(F);F--);n.placement!==O&&(n.modifiersData[i]._skip=!0,n.placement=O,n.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}},{name:"preventOverflow",enabled:!0,phase:"main",fn:function(t){var n,r=t.state,i=t.options,o=t.name,a=i.mainAxis,u=i.altAxis,s=i.boundary,c=i.rootBoundary,l=i.altBoundary,f=i.padding,d=i.tether,p=void 0===d||d,h=i.tetherOffset,m=void 0===h?0:h,g=enW(r,{boundary:s,rootBoundary:c,padding:f,altBoundary:l}),y=eni(r.placement),v=enw(r.placement),b=!v,x=enb(y),_="x"===x?"y":"x",S=r.modifiersData.popperOffsets,T=r.rects.reference,w=r.rects.popper,O="function"==typeof m?m(Object.assign({},r.rects,{placement:r.placement})):m,k="number"==typeof O?{mainAxis:O,altAxis:O}:Object.assign({mainAxis:0,altAxis:0},O),I=r.modifiersData.offset?r.modifiersData.offset[r.placement]:null,C={x:0,y:0};if(S){if(void 0===a||a){var M,R="y"===x?"top":etX,E="y"===x?etJ:etQ,j="y"===x?"height":"width",N=S[x],A=N+g[R],P=N-g[E],L=p?-w[j]/2:0,D=v===et2?T[j]:w[j],F=v===et2?-w[j]:-T[j],W=r.elements.arrow,U=p&&W?enf(W):{width:0,height:0},z=r.modifiersData["arrow#persistent"]?r.modifiersData["arrow#persistent"].padding:en_(),B=z[R],V=z[E],$=enx(0,T[j],U[j]),q=b?T[j]/2-L-$-B-k.mainAxis:D-$-B-k.mainAxis,K=b?-T[j]/2+L+$+V+k.mainAxis:F+$+V+k.mainAxis,H=r.elements.arrow&&env(r.elements.arrow),G=H?"y"===x?H.clientTop||0:H.clientLeft||0:0,Z=null!=(M=null==I?void 0:I[x])?M:0,Y=enx(p?ena(A,N+q-Z-G):A,N,p?eno(P,N+K-Z):P);S[x]=Y,C[x]=Y-N}if(void 0!==u&&u){var J,Q,X,ee,et,en=S[_],er="y"===_?"height":"width",ei=en+g["x"===x?"top":etX],eo=en-g["x"===x?etJ:etQ],ea=-1!==["top",etX].indexOf(y),eu=null!=(et=null==I?void 0:I[_])?et:0,es=ea?ei:en-T[er]-w[er]-eu+k.altAxis,ec=ea?en+T[er]+w[er]-eu-k.altAxis:eo,el=p&&ea?(ee=enx(es,en,ec))>ec?ec:ee:enx(p?es:ei,en,p?ec:eo);S[_]=el,C[_]=el-en}r.modifiersData[o]=C}},requiresIfExists:["offset"]},{name:"arrow",enabled:!0,phase:"main",fn:function(t){var n,r=t.state,i=t.name,o=t.options,a=r.elements.arrow,u=r.modifiersData.popperOffsets,s=eni(r.placement),c=enb(s),l=[etX,etQ].indexOf(s)>=0?"height":"width";if(!(!a||!u)){var f,d,p=enS("number"!=typeof(f="function"==typeof(f=o.padding)?f(Object.assign({},r.rects,{placement:r.placement})):f)?f:enT(f,et1)),h=enf(a),m=r.rects.reference[l]+r.rects.reference[c]-u[c]-r.rects.popper[l],g=u[c]-r.rects.reference[c],y=env(a),v=y?"y"===c?y.clientHeight||0:y.clientWidth||0:0,b=p["y"===c?"top":etX],x=v-h[l]-p["y"===c?etJ:etQ],_=v/2-h[l]/2+(m/2-g/2),S=enx(b,_,x);r.modifiersData[i]=((n={})[c]=S,n.centerOffset=S-_,n)}},effect:function(t){var n=t.state,r=t.options.element,i=void 0===r?"[data-popper-arrow]":r;null==i||("string"!=typeof i||(i=n.elements.popper.querySelector(i)))&&end(n.elements.popper,i)&&(n.elements.arrow=i)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]},{name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(t){var n=t.state,r=t.name,i=n.rects.reference,o=n.rects.popper,a=n.modifiersData.preventOverflow,u=enW(n,{elementContext:"reference"}),s=enW(n,{altBoundary:!0}),c=enU(u,i),l=enU(s,o,a),f=enz(c),d=enz(l);n.modifiersData[r]={referenceClippingOffsets:c,popperEscapeOffsets:l,isReferenceHidden:f,hasPopperEscaped:d},n.attributes.popper=Object.assign({},n.attributes.popper,{"data-popper-reference-hidden":f,"data-popper-escaped":d})}}]},enJ=void 0===(enY=(enZ=enG).defaultModifiers)?[]:enY,enX=void 0===(enQ=enZ.defaultOptions)?enB:enQ,function(t,n,r){void 0===r&&(r=enX);var i,o,a={placement:"bottom",orderedModifiers:[],options:Object.assign({},enB,enX),modifiersData:{},elements:{reference:t,popper:n},attributes:{},styles:{}},u=[],s=!1,c={state:a,setOptions:function(r){var i,o,s,f,d,p,h,m,g="function"==typeof r?r(a.options):r;l(),a.options=Object.assign({},enX,a.options,g),a.scrollParents={reference:ene(t)?enP(t):t.contextElement?enP(t.contextElement):[],popper:enP(n)};var y=(s=Object.keys(o=(i=[].concat(enJ,a.options.modifiers)).reduce(function(t,n){var r=t[n.name];return t[n.name]=r?Object.assign({},r,n,{options:Object.assign({},r.options,n.options),data:Object.assign({},r.data,n.data)}):n,t},{})).map(function(t){return o[t]}),d=new Map,p=new Set,h=[],s.forEach(function(t){d.set(t.name,t)}),s.forEach(function(t){p.has(t.name)||function t(n){p.add(n.name),[].concat(n.requires||[],n.requiresIfExists||[]).forEach(function(n){if(!p.has(n)){var r=d.get(n);r&&t(r)}}),h.push(n)}(t)}),et6.reduce(function(t,n){return t.concat(h.filter(function(t){return t.phase===n}))},[]));return a.orderedModifiers=y.filter(function(t){return t.enabled}),a.orderedModifiers.forEach(function(t){var n=t.name,r=t.options,i=t.effect;if("function"==typeof i){var o=i({state:a,name:n,instance:c,options:void 0===r?{}:r}),s=function(){};u.push(o||s)}}),c.update()},forceUpdate:function(){if(!s){var t,n,r,i,o,u,l,f,d,p,h,m,g,y,v,b=a.elements,x=b.reference,_=b.popper;if(enV(x,_)){a.rects={reference:(t=x,n=env(_),r="fixed"===a.options.strategy,f=ent(n),d=ent(n)&&(u=enu((o=(i=n).getBoundingClientRect()).width)/i.offsetWidth||1,l=enu(o.height)/i.offsetHeight||1,1!==u||1!==l),p=enm(n),h=enl(t,d,r),m={scrollLeft:0,scrollTop:0},g={x:0,y:0},(f||!f&&!r)&&(("body"!==et8(n)||enA(p))&&(m=(y=n)!==et7(y)&&ent(y)?{scrollLeft:(v=y).scrollLeft,scrollTop:v.scrollTop}:enj(y)),ent(n)?(g=enl(n,!0),g.x+=n.clientLeft,g.y+=n.clientTop):p&&(g.x=enN(p))),{x:h.left+m.scrollLeft-g.x,y:h.top+m.scrollTop-g.y,width:h.width,height:h.height}),popper:enf(_)},a.reset=!1,a.placement=a.options.placement,a.orderedModifiers.forEach(function(t){return a.modifiersData[t.name]=Object.assign({},t.data)});for(var S=0;S<a.orderedModifiers.length;S++){if(!0===a.reset){a.reset=!1,S=-1;continue}var T=a.orderedModifiers[S],w=T.fn,O=T.options,k=void 0===O?{}:O,I=T.name;"function"==typeof w&&(a=w({state:a,options:k,name:I,instance:c})||a)}}}},update:function(){return o||(o=new Promise(function(t){Promise.resolve().then(function(){o=void 0,t(new Promise(function(t){c.forceUpdate(),t(a)}))})})),o},destroy:function(){l(),s=!0}};if(!enV(t,n))return c;function l(){u.forEach(function(t){return t()}),u=[]}return c.setOptions(r).then(function(t){!s&&r.onFirstUpdate&&r.onFirstUpdate(t)}),c}),en1="tippy-content",en2="tippy-arrow",en3="tippy-svg-arrow",en4={passive:!0,capture:!0},en5=function(){return document.body};function en9(t,n,r){return Array.isArray(t)?t[n]??(Array.isArray(r)?r[n]:r):t}function en6(t,n){var r=({}).toString.call(t);return 0===r.indexOf("[object")&&r.indexOf(n+"]")>-1}function en8(t,n){return"function"==typeof t?t.apply(void 0,n):t}function en7(t,n){var r;return 0===n?t:function(i){clearTimeout(r),r=setTimeout(function(){t(i)},n)}}function ere(t){return[].concat(t)}function ert(t,n){-1===t.indexOf(n)&&t.push(n)}function ern(t){return[].slice.call(t)}function err(t){return Object.keys(t).reduce(function(n,r){return void 0!==t[r]&&(n[r]=t[r]),n},{})}function eri(){return document.createElement("div")}function ero(t){return["Element","Fragment"].some(function(n){return en6(t,n)})}function era(t,n){t.forEach(function(t){t&&(t.style.transitionDuration=n+"ms")})}function eru(t,n){t.forEach(function(t){t&&t.setAttribute("data-state",n)})}function ers(t,n,r){var i=n+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(n){t[i](n,r)})}function erc(t,n){for(var r,i=n;i;){if(t.contains(i))return!0;i=null==i.getRootNode||null==(r=i.getRootNode())?void 0:r.host}return!1}var erl={isTouch:!1},erf=0;function erd(){erl.isTouch||(erl.isTouch=!0,window.performance&&document.addEventListener("mousemove",erp))}function erp(){var t=performance.now();t-erf<20&&(erl.isTouch=!1,document.removeEventListener("mousemove",erp)),erf=t}function erh(){var t,n=document.activeElement;if(n&&n._tippy&&n._tippy.reference===n){var r=n._tippy;n.blur&&!r.state.isVisible&&n.blur()}}var erm=!!("u">typeof window&&"u">typeof document)&&!!window.msCrypto,erg=Object.assign({appendTo:en5,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},{animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},{allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999}),ery=Object.keys(erg),erv=function(t){Object.keys(t).forEach(function(n){erg[n]=t[n]})};function erb(t){var n=(t.plugins||[]).reduce(function(n,r){var i,o=r.name,a=r.defaultValue;return o&&(n[o]=void 0!==t[o]?t[o]:null!=(i=erg[o])?i:a),n},{});return Object.assign({},t,n)}function erx(t,n){var r,i,o=Object.assign({},n,{content:en8(n.content,[t])},n.ignoreAttributes?{}:((i=n.plugins)?Object.keys(erb(Object.assign({},erg,{plugins:i}))):ery).reduce(function(n,r){var i=(t.getAttribute("data-tippy-"+r)||"").trim();if(!i)return n;if("content"===r)n[r]=i;else try{n[r]=JSON.parse(i)}catch{n[r]=i}return n},{}));return o.aria=Object.assign({},erg.aria,o.aria),o.aria={expanded:"auto"===o.aria.expanded?n.interactive:o.aria.expanded,content:"auto"===o.aria.content?n.interactive?null:"describedby":o.aria.content},o}var er_=function(){return"innerHTML"};function erS(t,n){t[er_()]=n}function erT(t){var n=eri();return!0===t?n.className=en2:(n.className=en3,ero(t)?n.appendChild(t):erS(n,t)),n}function erw(t,n){ero(n.content)?(erS(t,""),t.appendChild(n.content)):"function"!=typeof n.content&&(n.allowHTML?erS(t,n.content):t.textContent=n.content)}function erO(t){var n=t.firstElementChild,r=ern(n.children);return{box:n,content:r.find(function(t){return t.classList.contains(en1)}),arrow:r.find(function(t){return t.classList.contains(en2)||t.classList.contains(en3)}),backdrop:r.find(function(t){return t.classList.contains("tippy-backdrop")})}}function erk(t){var n=eri(),r=eri();r.className="tippy-box",r.setAttribute("data-state","hidden"),r.setAttribute("tabindex","-1");var i=eri();function o(r,i){var o=erO(n),a=o.box,u=o.content,s=o.arrow;i.theme?a.setAttribute("data-theme",i.theme):a.removeAttribute("data-theme"),"string"==typeof i.animation?a.setAttribute("data-animation",i.animation):a.removeAttribute("data-animation"),i.inertia?a.setAttribute("data-inertia",""):a.removeAttribute("data-inertia"),a.style.maxWidth="number"==typeof i.maxWidth?i.maxWidth+"px":i.maxWidth,i.role?a.setAttribute("role",i.role):a.removeAttribute("role"),(r.content!==i.content||r.allowHTML!==i.allowHTML)&&erw(u,t.props),i.arrow?s?r.arrow!==i.arrow&&(a.removeChild(s),a.appendChild(erT(i.arrow))):a.appendChild(erT(i.arrow)):s&&a.removeChild(s)}return i.className=en1,i.setAttribute("data-state","hidden"),erw(i,t.props),n.appendChild(r),r.appendChild(i),o(t.props,t.props),{popper:n,onUpdate:o}}erk.$$tippy=!0;var erI=1,erC=[],erM=[];function erR(t,n){void 0===n&&(n={});var r,i,o=erg.plugins.concat(n.plugins||[]);document.addEventListener("touchstart",erd,en4),window.addEventListener("blur",erh);var a,u=Object.assign({},n,{plugins:o}),s=(ero(t)?[t]:en6(t,"NodeList")?ern(t):Array.isArray(t)?t:ern(document.querySelectorAll(t))).reduce(function(t,n){var r=n&&function(t,n){var r,i,o,a,u,s,c,l,f=erx(t,Object.assign({},erg,erb(err(n)))),d=!1,p=!1,h=!1,m=!1,g=[],y=en7(G,f.interactiveDebounce),v=erI++,b=(r=f.plugins).filter(function(t,n){return r.indexOf(t)===n}),x={id:v,reference:t,popper:eri(),popperInstance:null,props:f,state:{isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},plugins:b,clearDelayTimeouts:function(){clearTimeout(i),clearTimeout(o),cancelAnimationFrame(a)},setProps:function(n){if(!x.state.isDestroyed){A("onBeforeUpdate",[x,n]),K();var r=x.props,i=erx(t,Object.assign({},r,err(n),{ignoreAttributes:!0}));x.props=i,q(),r.interactiveDebounce!==i.interactiveDebounce&&(D(),y=en7(G,i.interactiveDebounce)),r.triggerTarget&&!i.triggerTarget?ere(r.triggerTarget).forEach(function(t){t.removeAttribute("aria-expanded")}):i.triggerTarget&&t.removeAttribute("aria-expanded"),L(),N(),T&&T(r,i),x.popperInstance&&(Q(),ee().forEach(function(t){requestAnimationFrame(t._tippy.popperInstance.forceUpdate)})),A("onAfterUpdate",[x,n])}},setContent:function(t){x.setProps({content:t})},show:function(){var t=x.state.isVisible,n=x.state.isDestroyed,r=!x.state.isEnabled,i=erl.isTouch&&!x.props.touch,o=en9(x.props.duration,0,erg.duration);if(!(t||n||r||i)&&!M().hasAttribute("disabled")&&(A("onShow",[x],!1),!1!==x.props.onShow(x))){if(x.state.isVisible=!0,C()&&(S.style.visibility="visible"),N(),z(),x.state.isMounted||(S.style.transition="none"),C()){var a,u,s,l,f=E();era([f.box,f.content],0)}c=function(){var t;if(!(!x.state.isVisible||m)){if(m=!0,S.offsetHeight,S.style.transition=x.props.moveTransition,C()&&x.props.animation){var n,r,i=E(),a=i.box,u=i.content;era([a,u],o),eru([a,u],"visible")}P(),L(),ert(erM,x),null==(t=x.popperInstance)||t.forceUpdate(),A("onMount",[x]),x.props.animation&&C()&&V(o,r=function(){x.state.isShown=!0,A("onShown",[x])})}},u=x.props.appendTo,s=M(),(a=x.props.interactive&&u===en5||"parent"===u?s.parentNode:en8(u,[s])).contains(S)||a.appendChild(S),x.state.isMounted=!0,Q()}},hide:function(){var t=!x.state.isVisible,n=x.state.isDestroyed,r=!x.state.isEnabled,i=en9(x.props.duration,1,erg.duration);if(!(t||n||r)&&(A("onHide",[x],!1),!1!==x.props.onHide(x))){if(x.state.isVisible=!1,x.state.isShown=!1,m=!1,d=!1,C()&&(S.style.visibility="hidden"),D(),B(),N(!0),C()){var o,a,u=E(),s=u.box,c=u.content;x.props.animation&&(era([s,c],i),eru([s,c],"hidden"))}P(),L(),x.props.animation?C()&&(a=x.unmount,V(i,function(){!x.state.isVisible&&S.parentNode&&S.parentNode.contains(S)&&a()})):x.unmount()}},hideWithInteractivity:function(t){R().addEventListener("mousemove",y),ert(erC,y),y(t)},enable:function(){x.state.isEnabled=!0},disable:function(){x.hide(),x.state.isEnabled=!1},unmount:function(){x.state.isVisible&&x.hide(),x.state.isMounted&&(X(),ee().forEach(function(t){t._tippy.unmount()}),S.parentNode&&S.parentNode.removeChild(S),erM=erM.filter(function(t){return t!==x}),x.state.isMounted=!1,A("onHidden",[x]))},destroy:function(){x.state.isDestroyed||(x.clearDelayTimeouts(),x.unmount(),K(),delete t._tippy,x.state.isDestroyed=!0,A("onDestroy",[x]))}};if(!f.render)return x;var _=f.render(x),S=_.popper,T=_.onUpdate;S.setAttribute("data-tippy-root",""),S.id="tippy-"+x.id,x.popper=S,t._tippy=x,S._tippy=x;var w=b.map(function(t){return t.fn(x)}),O=t.hasAttribute("aria-expanded");return q(),L(),N(),A("onCreate",[x]),f.showOnCreate&&et(),S.addEventListener("mouseenter",function(){x.props.interactive&&x.state.isVisible&&x.clearDelayTimeouts()}),S.addEventListener("mouseleave",function(){x.props.interactive&&x.props.trigger.indexOf("mouseenter")>=0&&R().addEventListener("mousemove",y)}),x;function k(){var t=x.props.touch;return Array.isArray(t)?t:[t,0]}function I(){return"hold"===k()[0]}function C(){var t;return!!(null!=(t=x.props.render)&&t.$$tippy)}function M(){return l||t}function R(){var t,n,r,i=M().parentNode;return i&&null!=(r=ere(i)[0])&&null!=(n=r.ownerDocument)&&n.body?r.ownerDocument:document}function E(){return erO(S)}function j(t){return x.state.isMounted&&!x.state.isVisible||erl.isTouch||u&&"focus"===u.type?0:en9(x.props.delay,t?0:1,erg.delay)}function N(t){void 0===t&&(t=!1),S.style.pointerEvents=x.props.interactive&&!t?"":"none",S.style.zIndex=""+x.props.zIndex}function A(t,n,r){if(void 0===r&&(r=!0),w.forEach(function(r){r[t]&&r[t].apply(r,n)}),r){var i;(i=x.props)[t].apply(i,n)}}function P(){var n=x.props.aria;if(n.content){var r="aria-"+n.content,i=S.id;ere(x.props.triggerTarget||t).forEach(function(t){var n=t.getAttribute(r);if(x.state.isVisible)t.setAttribute(r,n?n+" "+i:i);else{var o=n&&n.replace(i,"").trim();o?t.setAttribute(r,o):t.removeAttribute(r)}})}}function L(){!(O||!x.props.aria.expanded)&&ere(x.props.triggerTarget||t).forEach(function(t){x.props.interactive?t.setAttribute("aria-expanded",x.state.isVisible&&t===M()?"true":"false"):t.removeAttribute("aria-expanded")})}function D(){R().removeEventListener("mousemove",y),erC=erC.filter(function(t){return t!==y})}function F(n){if(!(erl.isTouch&&(h||"mousedown"===n.type))){var r=n.composedPath&&n.composedPath()[0]||n.target;if(!(x.props.interactive&&erc(S,r))){if(ere(x.props.triggerTarget||t).some(function(t){return erc(t,r)})){if(erl.isTouch||x.state.isVisible&&x.props.trigger.indexOf("click")>=0)return}else A("onClickOutside",[x,n]);!0===x.props.hideOnClick&&(x.clearDelayTimeouts(),x.hide(),p=!0,setTimeout(function(){p=!1}),x.state.isMounted||B())}}}function W(){h=!0}function U(){h=!1}function z(){var t=R();t.addEventListener("mousedown",F,!0),t.addEventListener("touchend",F,en4),t.addEventListener("touchstart",U,en4),t.addEventListener("touchmove",W,en4)}function B(){var t=R();t.removeEventListener("mousedown",F,!0),t.removeEventListener("touchend",F,en4),t.removeEventListener("touchstart",U,en4),t.removeEventListener("touchmove",W,en4)}function V(t,n){var r=E().box;function i(t){t.target===r&&(ers(r,"remove",i),n())}if(0===t)return n();ers(r,"remove",s),ers(r,"add",i),s=i}function $(n,r,i){void 0===i&&(i=!1),ere(x.props.triggerTarget||t).forEach(function(t){t.addEventListener(n,r,i),g.push({node:t,eventType:n,handler:r,options:i})})}function q(){var t;I()&&($("touchstart",H,{passive:!0}),$("touchend",Z,{passive:!0})),(t=x.props.trigger).split(/\s+/).filter(Boolean).forEach(function(t){if("manual"!==t)switch($(t,H),t){case"mouseenter":$("mouseleave",Z);break;case"focus":$(erm?"focusout":"blur",Y);break;case"focusin":$("focusout",Y)}})}function K(){g.forEach(function(t){var n=t.node,r=t.eventType,i=t.handler,o=t.options;n.removeEventListener(r,i,o)}),g=[]}function H(t){var n,r=!1;if(!(!x.state.isEnabled||J(t)||p)){var i,o=(null==(n=u)?void 0:n.type)==="focus";u=t,l=t.currentTarget,L(),!x.state.isVisible&&en6(t,"MouseEvent")&&erC.forEach(function(n){return n(t)}),"click"===t.type&&(0>x.props.trigger.indexOf("mouseenter")||d)&&!1!==x.props.hideOnClick&&x.state.isVisible?r=!0:et(t),"click"===t.type&&(d=!r),r&&!o&&en(t)}}function G(t){var n,r,i,o,a=t.target,u=M().contains(a)||S.contains(a);!("mousemove"===t.type&&u)&&(n=ee().concat(S).map(function(t){var n,r=null==(n=t._tippy.popperInstance)?void 0:n.state;return r?{popperRect:t.getBoundingClientRect(),popperState:r,props:f}:null}).filter(Boolean),i=(r=t).clientX,o=r.clientY,n.every(function(t){var n,r=t.popperRect,a=t.popperState,u=t.props.interactiveBorder,s=(n=a.placement).split("-")[0],c=a.modifiersData.offset;if(!c)return!0;var l="bottom"===s?c.top.y:0,f="top"===s?c.bottom.y:0,d="right"===s?c.left.x:0,p="left"===s?c.right.x:0,h=r.top-o+l>u,m=o-r.bottom-f>u,g=r.left-i+d>u,y=i-r.right-p>u;return h||m||g||y})&&(D(),en(t)))}function Z(t){if(!(J(t)||x.props.trigger.indexOf("click")>=0&&d)){if(x.props.interactive){x.hideWithInteractivity(t);return}en(t)}}function Y(t){0>x.props.trigger.indexOf("focusin")&&t.target!==M()||x.props.interactive&&t.relatedTarget&&S.contains(t.relatedTarget)||en(t)}function J(t){return!!erl.isTouch&&I()!==t.type.indexOf("touch")>=0}function Q(){X();var n=x.props,r=n.popperOptions,i=n.placement,o=n.offset,a=n.getReferenceClientRect,u=n.moveTransition,s=C()?erO(S).arrow:null,l=a?{getBoundingClientRect:a,contextElement:a.contextElement||M()}:t,f=[{name:"offset",options:{offset:o}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!u}},{name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(t){var n=t.state;if(C()){var r=E().box;["placement","reference-hidden","escaped"].forEach(function(t){"placement"===t?r.setAttribute("data-placement",n.placement):n.attributes.popper["data-popper-"+t]?r.setAttribute("data-"+t,""):r.removeAttribute("data-"+t)}),n.attributes.popper={}}}}];C()&&s&&f.push({name:"arrow",options:{element:s,padding:3}}),f.push.apply(f,(null==r?void 0:r.modifiers)||[]),x.popperInstance=en0(l,S,Object.assign({},r,{placement:i,onFirstUpdate:c,modifiers:f}))}function X(){x.popperInstance&&(x.popperInstance.destroy(),x.popperInstance=null)}function ee(){return ern(S.querySelectorAll("[data-tippy-root]"))}function et(t){x.clearDelayTimeouts(),t&&A("onTrigger",[x,t]),z();var n=j(!0),r=k(),o=r[0],a=r[1];erl.isTouch&&"hold"===o&&a&&(n=a),n?i=setTimeout(function(){x.show()},n):x.show()}function en(t){if(x.clearDelayTimeouts(),A("onUntrigger",[x,t]),!x.state.isVisible){B();return}if(!(x.props.trigger.indexOf("mouseenter")>=0&&x.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(t.type)>=0&&d)){var n=j(!1);n?o=setTimeout(function(){x.state.isVisible&&x.hide()},n):a=requestAnimationFrame(function(){x.hide()})}}}(n,u);return r&&t.push(r),t},[]);return ero(t)?s[0]:s}erR.defaultProps=erg,erR.setDefaultProps=erv,erR.currentInput=erl,Object.assign({},enr,{effect:function(t){var n=t.state,r={popper:{position:n.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(n.elements.popper.style,r.popper),n.styles=r,n.elements.arrow&&Object.assign(n.elements.arrow.style,r.arrow)}}),erR.setDefaultProps({render:erk});class erE{constructor({editor:t,element:n,view:r,tippyOptions:i={},updateDelay:o=250,shouldShow:a}){this.preventHide=!1,this.shouldShow=({view:t,state:n,from:r,to:i})=>{let{doc:o,selection:a}=n,{empty:u}=a,s=!o.textBetween(r,i).length&&eeF(n.selection),c=this.element.contains(document.activeElement);return!(!(t.hasFocus()||c)||u||s||!this.editor.isEditable)},this.mousedownHandler=()=>{this.preventHide=!0},this.dragstartHandler=()=>{this.hide()},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:t})=>{var n;if(this.preventHide){this.preventHide=!1;return}null!=t&&t.relatedTarget&&!(null===(n=this.element.parentNode)||void 0===n)&&n.contains(t.relatedTarget)||this.hide()},this.tippyBlurHandler=t=>{this.blurHandler({event:t})},this.handleDebouncedUpdate=(t,n)=>{let r=!(null!=n&&n.selection.eq(t.state.selection)),i=!(null!=n&&n.doc.eq(t.state.doc));(r||i)&&(this.updateDebounceTimer&&clearTimeout(this.updateDebounceTimer),this.updateDebounceTimer=window.setTimeout(()=>{this.updateHandler(t,r,i,n)},this.updateDelay))},this.updateHandler=(t,n,r,i)=>{var o,a,u;let{state:s,composing:c}=t,{selection:l}=s;if(c||!n&&!r)return;this.createTooltip();let{ranges:f}=l,d=Math.min(...f.map(t=>t.$from.pos)),p=Math.max(...f.map(t=>t.$to.pos));if(!(null===(o=this.shouldShow)||void 0===o?void 0:o.call(this,{editor:this.editor,view:t,state:s,oldState:i,from:d,to:p}))){this.hide();return}null===(a=this.tippy)||void 0===a||a.setProps({getReferenceClientRect:(null===(u=this.tippyOptions)||void 0===u?void 0:u.getReferenceClientRect)||(()=>{var n;if((n=s.selection)instanceof YA){let r=t.nodeDOM(d),i=r.dataset.nodeViewWrapper?r:r.querySelector("[data-node-view-wrapper]");if(i&&(r=i.firstChild),r)return r.getBoundingClientRect()}return function(t,n,r){let i=t.state.doc.content.size,o=eeW(n,0,i),a=eeW(r,0,i),u=t.coordsAtPos(o),s=t.coordsAtPos(a,-1),c=Math.min(u.top,s.top),l=Math.max(u.bottom,s.bottom),f=Math.min(u.left,s.left),d=Math.max(u.right,s.right),p={top:c,bottom:l,left:f,right:d,width:d-f,height:l-c,x:f,y:c};return{...p,toJSON:()=>p}}(t,d,p)})}),this.show()},this.editor=t,this.element=n,this.view=r,this.updateDelay=o,a&&(this.shouldShow=a),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=i,this.element.remove(),this.element.style.visibility="visible"}createTooltip(){let{element:t}=this.editor.options,n=!!t.parentElement;this.tippy||!n||(this.tippy=erR(t,{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",this.tippyBlurHandler))}update(t,n){let{state:r}=t,i=r.selection.$from.pos!==r.selection.$to.pos;if(this.updateDelay>0&&i){this.handleDebouncedUpdate(t,n);return}let o=!(null!=n&&n.selection.eq(t.state.selection)),a=!(null!=n&&n.doc.eq(t.state.doc));this.updateHandler(t,o,a,n)}show(){var t;null===(t=this.tippy)||void 0===t||t.show()}hide(){var t;null===(t=this.tippy)||void 0===t||t.hide()}destroy(){var t,n;!(null===(t=this.tippy)||void 0===t)&&t.popper.firstChild&&this.tippy.popper.firstChild.removeEventListener("blur",this.tippyBlurHandler),null===(n=this.tippy)||void 0===n||n.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)}}let erj=t=>new YK({key:"string"==typeof t.pluginKey?new YZ(t.pluginKey):t.pluginKey,view:n=>new erE({view:n,...t})});eeg.create({name:"bubbleMenu",addOptions:()=>({element:null,tippyOptions:{},pluginKey:"bubbleMenu",updateDelay:void 0,shouldShow:null}),addProseMirrorPlugins(){return this.options.element?[erj({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,updateDelay:this.options.updateDelay,shouldShow:this.options.shouldShow})]:[]}});let erN=t=>{let[n,r]=(0,c.useState)(null);return(0,c.useEffect)(()=>{if(!n||t.editor.isDestroyed)return;let{pluginKey:r="bubbleMenu",editor:i,tippyOptions:o={},updateDelay:a,shouldShow:u=null}=t,s=erj({updateDelay:a,editor:i,element:n,pluginKey:r,shouldShow:u,tippyOptions:o});return i.registerPlugin(s),()=>i.unregisterPlugin(r)},[t.editor,n]),c.createElement("div",{ref:r,className:t.className,style:{visibility:"hidden"}},t.children)};class erA extends etV{constructor(){super(...arguments),this.contentComponent=null}}let erP=({renderers:t})=>c.createElement(c.Fragment,null,Object.entries(t).map(([t,n])=>S.createPortal(n.reactElement,n.element,t)));class erL extends c.Component{constructor(t){super(t),this.editorContentRef=c.createRef(),this.initialized=!1,this.state={renderers:{}}}componentDidMount(){this.init()}componentDidUpdate(){this.init()}init(){let{editor:t}=this.props;if(t&&t.options.element){if(t.contentComponent)return;let n=this.editorContentRef.current;n.append(...t.options.element.childNodes),t.setOptions({element:n}),t.contentComponent=this,t.createNodeViews(),this.initialized=!0}}maybeFlushSync(t){this.initialized?(0,S.flushSync)(t):t()}setRenderer(t,n){this.maybeFlushSync(()=>{this.setState(({renderers:r})=>({renderers:{...r,[t]:n}}))})}removeRenderer(t){this.maybeFlushSync(()=>{this.setState(({renderers:n})=>{let r={...n};return delete r[t],{renderers:r}})})}componentWillUnmount(){let{editor:t}=this.props;if(!t||(this.initialized=!1,t.isDestroyed||t.view.setProps({nodeViews:{}}),t.contentComponent=null,!t.options.element.firstChild))return;let n=document.createElement("div");n.append(...t.options.element.childNodes),t.setOptions({element:n})}render(){let{editor:t,...n}=this.props;return c.createElement(c.Fragment,null,c.createElement("div",{ref:this.editorContentRef,...n}),c.createElement(erP,{renderers:this.state.renderers}))}}let erD=c.memo(erL),erF=(0,c.createContext)({onDragStart:void 0}),erW=()=>(0,c.useContext)(erF),erU=c.forwardRef((t,n)=>{let{onDragStart:r}=erW(),i=t.as||"div";return c.createElement(i,{...t,ref:n,"data-node-view-wrapper":"",onDragStart:r,style:{whiteSpace:"normal",...t.style}})});class erz{constructor(t,{editor:n,props:r={},as:i="div",className:o="",attrs:a}){this.ref=null,this.id=Math.floor(4294967295*Math.random()).toString(),this.component=t,this.editor=n,this.props=r,this.element=document.createElement(i),this.element.classList.add("react-renderer"),o&&this.element.classList.add(...o.split(" ")),a&&Object.keys(a).forEach(t=>{this.element.setAttribute(t,a[t])}),this.render()}render(){var t,n,r,i,o;let a=this.component,u=this.props;("function"==typeof a&&a.prototype&&a.prototype.isReactComponent||"object"==typeof a&&(null===(o=a.$$typeof)||void 0===o?void 0:o.toString())==="Symbol(react.forward_ref)")&&(u.ref=t=>{this.ref=t}),this.reactElement=c.createElement(a,{...u}),null===(n=null===(t=this.editor)||void 0===t?void 0:t.contentComponent)||void 0===n||n.setRenderer(this.id,this)}updateProps(t={}){this.props={...this.props,...t},this.render()}destroy(){var t,n;null===(n=null===(t=this.editor)||void 0===t?void 0:t.contentComponent)||void 0===n||n.removeRenderer(this.id)}}class erB extends etZ{mount(){let t={editor:this.editor,node:this.node,decorations:this.decorations,selected:!1,extension:this.extension,getPos:()=>this.getPos(),updateAttributes:(t={})=>this.updateAttributes(t),deleteNode:()=>this.deleteNode()};if(!this.component.displayName){var n;this.component.displayName=(n=this.extension.name).charAt(0).toUpperCase()+n.substring(1)}let r=t=>{let n=this.component,r=this.onDragStart.bind(this),i=t=>{t&&this.contentDOMElement&&t.firstChild!==this.contentDOMElement&&t.appendChild(this.contentDOMElement)};return c.createElement(c.Fragment,null,c.createElement(erF.Provider,{value:{onDragStart:r,nodeViewContentRef:i}},c.createElement(n,{...t})))};r.displayName="ReactNodeView",this.contentDOMElement=this.node.isLeaf?null:document.createElement(this.node.isInline?"span":"div"),this.contentDOMElement&&(this.contentDOMElement.style.whiteSpace="inherit");let i=this.node.isInline?"span":"div";this.options.as&&(i=this.options.as);let{className:o=""}=this.options;this.renderer=new erz(r,{editor:this.editor,props:t,as:i,className:`node-${this.node.type.name} ${o}`.trim(),attrs:this.options.attrs})}get dom(){var t;if(this.renderer.element.firstElementChild&&!(!(null===(t=this.renderer.element.firstElementChild)||void 0===t)&&t.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(t,n){let r=t=>{this.renderer.updateProps(t)};if(t.type!==this.node.type)return!1;if("function"==typeof this.options.update){let i=this.node,o=this.decorations;return this.node=t,this.decorations=n,this.options.update({oldNode:i,oldDecorations:o,newNode:t,newDecorations:n,updateProps:()=>r({node:t,decorations:n})})}return t===this.node&&this.decorations===n||(this.node=t,this.decorations=n,r({node:t,decorations:n})),!0}selectNode(){this.renderer.updateProps({selected:!0})}deselectNode(){this.renderer.updateProps({selected:!1})}destroy(){this.renderer.destroy(),this.contentDOMElement=null}}function erV(t,n){return r=>r.editor.contentComponent?new erB(t,r,n):{}}function er$(t){return setTimeout(()=>{t()})}function erq(t){let{debouncedUrl:n,content:r,onContentChange:i,selected:o}=t,a=(0,c.useRef)(null),[u,s]=(0,c.useState)(!1);return(0,d.pQ)(n,()=>{var t;u&&(s(!1),null==(t=a.current)||t.reset())}),(0,y.ju)(n)?n===(null==r?void 0:r.embed_url)?R.jsx(erH,{content:r,selected:o}):R.jsx(f.SV,{ref:a,renderError:erK,onError:function(){s(!0),i(void 0)},children:R.jsx(c.Suspense,{fallback:r&&R.jsx(erH,{content:r,selected:o}),children:R.jsx(erG,{url:n,selected:o,onContentChange:i})})}):null}function erK(){return R.jsx(f.yO,{title:"There is no embed data available."})}function erH(t){let{content:n,selected:r}=t;return R.jsx(f.fu,{...function(t){let n="";switch(t.type){case"video":n=t.title??"";break;case"photo":n="View this post"+(t.provider_name?` on ${t.provider_name}`:"");break;default:n="Open"+(t.provider_name?` on ${t.provider_name}`:"")}return{url:t.embed_url,thumbnail:{url:t.thumbnail_url??"",aspectRatio:"video"===t.type?"16:9":"1:1"},provider:t.provider_name??"",author:t.author_name??"",subtitle:n}}(n),selected:r})}function erG(t){let{url:n,onContentChange:r,selected:i}=t,o=function(t){let{url:n,onContentChange:r}=t,{embedsUrl:i}=A(),o=(0,g.QT)(erZ,[n,i]),a=(0,d.R9)(r);return(0,c.useEffect)(()=>{let t=er$(()=>a(o));return()=>{clearTimeout(t)}},[o,a]),o}({url:n,onContentChange:r});return R.jsx(erH,{content:o,selected:i})}function erZ(t,n){var r;let i=new URL(n);return i.search=new URLSearchParams({url:t}).toString(),(0,m.WY)(i.toString(),{okType:(r=t,G8.object({type:G8.string(),version:G8.string().or(G8.number()).nullish(),title:G8.string().nullish(),author_name:G8.string().nullish(),author_url:G8.string().nullish(),provider_name:G8.string().nullish(),provider_url:G8.string().nullish(),cache_age:G8.string().or(G8.number()).nullish(),thumbnail_url:G8.string().nullish(),thumbnail_width:G8.number().nullish(),thumbnail_height:G8.number().nullish(),html:G8.string().nullish()}).passthrough().transform(t=>{let n={embed_url:r};return{...n,__TYPE__:"EmbedContent",type:t.type,version:t.version,title:t.title,author_name:t.author_name,author_url:t.author_url,provider_name:t.provider_name,provider_url:t.provider_url,cache_age:t.cache_age,thumbnail_url:t.thumbnail_url,thumbnail_width:t.thumbnail_width,thumbnail_height:t.thumbnail_height,html:t.html,all:{...n,...t}}}))})}function erY(t){let{id:n,readOnly:r,field:i,content:o,onContentChange:a}=t,u=(0,d.$P)({initialState:(null==o?void 0:o.embed_url)??"",startTransition:c.startTransition});function s(t){u.set(t),(0,y.ju)(t)||a(void 0)}return R.jsxs(f.gN,{footer:(0,y.ju)(u.value)&&R.jsx(f.mS,{children:R.jsx(erq,{debouncedUrl:u.debouncedValue,content:o,onContentChange:a})}),children:[R.jsx(f.fw,{name:"cloud"}),R.jsx(f.Qy,{htmlFor:n,children:Hc(i)}),R.jsx(f.JO,{children:R.jsx(f.oi,{id:n,readOnly:r,placeholder:Hl(i),value:u.value,onValueChange:s,variant:(0,y.ju)(u.value)?"link":"normal",endAdornment:R.jsx(f.zx,{startIcon:"close",variant:"secondary",size:"small",disabled:!u,onClick:()=>s("")})})})]})}function erJ(t){return!(t.lat>85||t.lat<-85||t.lng>180||t.lng<-180)}function erQ(t){let n=t.match(/^.*@(-?\d+.\d+),(-?\d+.\d+).*$/);if(!n)return;let r=parseFloat(n[1]??""),i=parseFloat(n[2]??"");if(isNaN(r)||isNaN(i))return;let o={lat:r,lng:i};if(erJ(o))return o}function erX(t){return t?`${t.lat}, ${t.lng}`:""}function er0(t){let n=t.match(/\(?([\d|.|-]*)[\s+]*,[\s]*([\d|.|-]*)\)?/);if(!n)return erQ(t);let r=parseFloat(n[1]??""),i=parseFloat(n[2]??"");if(isNaN(r)||isNaN(i))return erQ(t);let o={lat:r,lng:i};return erJ(o)?o:erQ(t)}function er1(t){let{field:n,id:r,readOnly:i,...o}=t,{onValueChange:a,displayedValue:u,onBlur:s,clearValue:l,isValidCoordinates:d}=function(t){let{content:n,onContentChange:r}=t,i=erX(null==n?void 0:n.position),[o,a]=(0,c.useState)(i),u=Boolean(er0(o));return{displayedValue:o,isValidCoordinates:u,onValueChange:a,onBlur:function(){let t=er0(o);if(!t)return a(""),r(void 0);let{lat:n,lng:i}=t;a(erX({lat:n,lng:i})),r({__TYPE__:"GeoPointContent",position:{lat:n,lng:i}})},clearValue:function(){a(""),r(void 0)}}}(o);return R.jsxs(f.gN,{children:[R.jsx(f.fw,{name:"place"}),R.jsx(f.Qy,{htmlFor:r,children:Hc(n)}),R.jsx(f.JO,{children:R.jsx(f.oi,{id:r,onValueChange:a,placeholder:"...",readOnly:i,value:u,onBlur:s,variant:d?"link":"normal",endAdornment:R.jsx(f.zx,{startIcon:"close",variant:"secondary",size:"small",disabled:!u,onClick:l})})})]})}let er2="__MAIN_THUMBNAIL__";function er3(t,n,r){let i=t.name===er2?void 0:t.name,o;return[i,(o=n?(0,h.$)(r)?[r.width,r.height]:(0,h.$)(t.width)||(0,h.$)(t.height)?[t.width??void 0,t.height??void 0]:[n.origin.width,n.origin.height]:void 0)?`${o[0]??"auto"}x${o[1]??"auto"}px`:void 0]}function er4(t,n){let{width:r,height:i}=n??{};return r&&i?[r,i]:r?[r,Math.round(t.height*(r/t.width))]:i?[Math.round(t.width*(i/t.height)),i]:[t.width,t.height]}function er5(t,n,r,i,o){let a=new URL(t);if(o){let{x:u,y:s,width:c,height:l}=n;a.searchParams.set("rect",[u,s,c,l].join(",")),a.searchParams.set("w",r.toString()),a.searchParams.set("h",i.toString())}return a.toString()}function er9(t){let n=new URL(t);return n.searchParams.delete("q"),n.searchParams.set("w","800"),n.searchParams.set("h","800"),n.searchParams.set("auto","compress,format"),n.searchParams.set("fit","max"),n.toString()}function er6(t){let n=new URL(t);return n.searchParams.delete("q"),n.searchParams.delete("fm"),n.searchParams.set("w","300"),n.searchParams.set("auto","compress,format"),n.toString()}function er8(t){return null!=t&&t.url?er9(t.url):void 0}let er7=GW({id:GO(),kind:GO(),extension:GO(),filename:GO(),width:Gk().optional(),height:Gk().optional(),last_modified:Gk(),url:GO(),alt:GO().optional(),size:Gk()}),eie=GW({total:Gk(),cursor:GO().optional(),items:GF(er7)});function eit(t,n,r,i="all",o){let a=new URLSearchParams({assetType:i,limit:"30",...o&&{cursor:o}});return(0,m.WY)(`${t}?${a.toString()}`,{headers:{repository:n},credentials:(0,m.xb)(r),okType:eie})}function ein(t){let{onFilesSelected:n}=t,[r,i]=(0,c.useTransition)(),o=(0,d.$P)({initialState:r,ms:100});return R.jsx(f.SV,{renderError:eis,children:R.jsx(c.Suspense,{children:R.jsxs(f.Zz,{onFilesSelected:n,overlay:R.jsx(eio,{}),children:[R.jsx(eir,{...t,startTransition:i}),R.jsx(f.xu,{position:"relative",width:"100%",justifyContent:"center",children:R.jsx(f.FN,{anchor:R.jsx(f.xu,{position:"fixed",bottom:72}),loadingIndicator:!0,open:o.debouncedValue,title:"Loading media ...",seconds:1})})]})})})}function eir(t){let{uploadingFiles:n,isUploading:r,onFilesSelected:i,onMediaSelected:o,startTransition:a,onRetry:u,assetType:s}=t,{media:l,limit:p,onHasReachedBottom:h,response:m,updateMedia:y}=function(t){let{assetType:n}=t,r=A(),[i,o]=(0,c.useState)(),[a,u]=(0,c.useState)([]),[s,l]=(0,c.useState)(a);r.mediaLibrary||L("mediaLibrary");let{assetsUrl:f,repository:d}=r,p=(0,g.QT)(eit,[f,d,r.env,n,i]);return s!==p.items&&(l(p.items),u(t=>[...t,...p.items])),{media:a,limit:30,onHasReachedBottom:function(){0!==p.total&&o(p.cursor)},response:p,updateMedia:function(t){let o=[...t,...a];u([]),(0,g.VA)(eit,[f,d,r.env,n,i],{total:o.length,items:o,cursor:void 0})}}}({assetType:s});return(0,d.pQ)(n,()=>{if(r)return;let t=n.flatMap(t=>"success"!==t.status?[]:l.find(n=>n.id===t.id)?[]:[t.response]);t.length>0&&y(t)}),0===l.length?R.jsx(eii,{onFilesSelected:i}):R.jsxs(eia,{onScrollToBottom:function(){m.total===p&&a(h)},children:[R.jsx(f.Fp,{enterDuration:400,exitDuration:400,children:n.length?R.jsx(f.xu,{flexDirection:"column",gap:6,children:n.map((t,n)=>R.jsx(f.tK,{file:t.file,status:t.status,onRetry:0!==n||r?void 0:u},t.id))},n.length):null}),R.jsx(f.Rk,{items:l,getItemInfo:eiu,children:t=>R.jsxs(c.Suspense,{fallback:R.jsx(f.Od,{width:"100%",height:"100%"}),children:["pdf"!==t.extension&&R.jsx(f.P0,{url:er6(t.url),onClick:()=>o({...t,width:t.width??2e3,height:t.height??2e3})}),"pdf"===t.extension&&R.jsx(f.Ti,{extension:t.extension,filename:t.filename,onClick:()=>o(t)})]})})]})}function eii(t){let{onFilesSelected:n}=t;return R.jsx(f.xu,{justifyContent:"center",flexDirection:"column",height:"100%",padding:24,children:R.jsx(f.xu,{justifyContent:"center",flexDirection:"column",height:"100%",backgroundColor:"grey2",borderRadius:4,padding:{inline:80},children:R.jsxs(f.R$,{children:[R.jsx(f.av,{name:"cloudUpload",lineColor:"purple10",backgroundColor:"purple3"}),R.jsx(f._T,{size:"big",children:"Drop files here or"}),R.jsx(f.nf,{children:R.jsxs(f.xv,{color:"grey11",align:"center",variant:"normal",children:["Explore our documentation to find out the"," ",R.jsx(f.hh,{underline:!0,color:"grey11",href:" https://prismic.io/docs/guides/manage-images#maximum-file-size",children:"maximum size"})," ","and"," ",R.jsx(f.hh,{underline:!0,color:"grey11",href:" https://prismic.io/docs/guides/manage-images#supported-media",children:"supported image formats"})," ","for uploads in the media library."]})}),R.jsx(f.Qj,{children:R.jsx(f.ZD,{title:"Upload Media",onFilesSelected:n})})]})})})}function eio(){return R.jsx(f.xu,{justifyContent:"center",flexDirection:"column",height:"100%",children:R.jsxs(f.R$,{children:[R.jsx(f.av,{name:"cloudUpload",lineColor:"purple10",backgroundColor:"purple3"}),R.jsx(f._T,{size:"big",children:"Drop files here"}),R.jsx(f.nf,{children:"Drop your files to upload them instantly to your media library"})]})})}function eia(t){let{children:n,onScrollToBottom:r}=t;return R.jsx(f.xr,{style:{height:"100%",paddingInline:f.TV.space[24],paddingBlock:f.TV.space[16],gap:f.TV.space[16]},onScrollToBottom:r,children:n})}function eiu(t){return"pdf"===t.extension?{key:t.id,aspectRatio:193/154}:{key:t.id,aspectRatio:(t.width??2e3)/(t.height??2e3)}}function eis(){return R.jsx(f.xu,{height:"100%",flexDirection:"column",alignItems:"center",justifyContent:"center",children:R.jsx(f.Iq,{title:"Request failed",description:"An error occurred while searching for your image.",errorImageSrc:f.Os})})}g.Fs.registerFetcherConfig(eit,{cacheCapacity:100,revalidationStrategy:{type:"never"}});let eic,eil=new Uint8Array(16);function eif(){if(!eic&&!(eic="u">typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)))throw Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return eic(eil)}let eid=[];for(let eip=0;eip<256;++eip)eid.push((eip+256).toString(16).slice(1));let eih="u">typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),eim={randomUUID:eih},eig=GW({id:GO(),width:Gk(),height:Gk(),urls:GW({full:GO(),small:GO().transform(er6)}),alt_description:GO().optional()}),eiy=GW({results:GF(eig)}).transform(t=>t.results);function eiv(t,n){let r=new URLSearchParams({page:"1",per_page:"30",query:n});return(0,m.WY)(`${t}/search/photos?${r.toString()}`,{okType:eiy})}g.Fs.registerFetcherConfig(eiv,{cacheCapacity:5,revalidationStrategy:{type:"never"}});let eib=t=>{let{onMediaSelected:n}=t,[r,i]=(0,c.useTransition)(),o=(0,d.$P)({initialState:"",ms:200,startTransition:i});return R.jsxs(R.Fragment,{children:[R.jsx(f.xu,{padding:{inline:24,top:16},flexDirection:"column",children:R.jsx(f.Mj,{value:o.value,placeholder:"Search on Unsplash.com",onValueChange:o.set})}),R.jsx(ei_,{children:R.jsx(f.SV,{renderError:eiT,children:R.jsx(c.Suspense,{fallback:R.jsx(f.DW,{}),children:R.jsx(eix,{term:o.debouncedValue,isUpdating:r,onMediaSelected:n})})})})]})},eix=t=>{var n,r,i;let{term:o,isUpdating:a,onMediaSelected:u}=t,s=A(),c=(n=s.unsplashUrl,(0,g.QT)(eiv,[n,o||"fruit"])),l=(i=a,{opacity:i?.4:1,transitionProperty:i?"opacity":"none",transitionDuration:f.TV.transitionDuration[300],transitionTimingFunction:f.TV.transitionTimingFunction.easeInOut});return c.length?R.jsx(f.Rk,{items:c,getItemInfo:eiS,style:l,children:t=>R.jsx(f.P0,{url:t.urls.small,onClick:()=>u({id:t.id,url:t.urls.full,width:t.width,height:t.height,alt:t.alt_description})})}):R.jsxs(f.R$,{style:{marginTop:"auto",marginBottom:"auto",...l},children:[R.jsx(f.u2,{children:R.jsx("img",{src:f.Os,alt:"No results"})}),R.jsx(f._T,{size:"big",children:"Oh no ..."}),R.jsx(f.nf,{children:"The search returned no result."})]})},ei_=({children:t})=>R.jsx(f.xr,{style:{height:"100%",paddingInline:f.TV.space[24],paddingTop:f.TV.space[4]},children:t});function eiS(t){return{key:t.id,aspectRatio:t.width/t.height}}function eiT(){return R.jsx(f.xu,{height:"100%",flexDirection:"column",alignItems:"center",justifyContent:"center",children:R.jsx(f.Iq,{title:"Request failed",description:"An error occurred while searching for your image.",errorImageSrc:f.Os})})}function eiw(t){let{onMediaSelected:n,assetType:r,open:i,onOpenChange:o}=t,a=A(),[u,s]=(0,c.useState)(a.mediaLibrary?"media":"unsplash"),{uploadingFiles:l,isUploading:d,onFilesSelected:p,onRetry:h}=function(t){let[n,r]=(0,c.useState)([]),i=n.some(t=>"idle"===t.status||"uploading"===t.status),o=A();return(0,c.useEffect)(function(){if(!n.length||n.some(t=>"uploading"===t.status)||n.every(t=>"error"===t.status)||!o.mediaLibrary)return;let t=n.find(t=>"idle"===t.status);if(!t){setTimeout(()=>{r(t=>t.filter(t=>"error"===t.status))},1e3);return}let{assetsUrl:i,repository:a,env:u}=o;r(n=>n.map(n=>n.id===t.id?{...n,status:"uploading"}:n)),(function(t){let{file:n,url:r,repository:i,env:o}=t,a=new FormData;return a.append(n.name,n),(0,m.WY)(r,{headers:{repository:i,"Content-Type":"multipart/form-data"},method:"POST",body:a,credentials:(0,m.xb)(o),okType:er7})})({file:t.file,url:i,repository:a,env:u}).then(n=>{r(r=>r.map(r=>r.id===t.id?{...r,status:"success",response:n}:r))}).catch(()=>{r(n=>n.map(n=>n.id===t.id?{...n,status:"error"}:n))})},[o,n]),!t&&n.length&&r([]),{uploadingFiles:n,isUploading:i,onFilesSelected:function(t){r(t.map(t=>({id:function(t,n,r){if(eim.randomUUID&&!n&&!t)return eim.randomUUID();t=t||{};let i=t.random||(t.rng||eif)();if(i[6]=15&i[6]|64,i[8]=63&i[8]|128,n){r=r||0;for(let o=0;o<16;++o)n[r+o]=i[o];return n}return function(t,n=0){return(eid[t[n+0]]+eid[t[n+1]]+eid[t[n+2]]+eid[t[n+3]]+"-"+eid[t[n+4]]+eid[t[n+5]]+"-"+eid[t[n+6]]+eid[t[n+7]]+"-"+eid[t[n+8]]+eid[t[n+9]]+"-"+eid[t[n+10]]+eid[t[n+11]]+eid[t[n+12]]+eid[t[n+13]]+eid[t[n+14]]+eid[t[n+15]]).toLowerCase()}(i)}(),file:t,status:"idle"})))},onRetry:function(){r(t=>t.map(t=>"error"===t.status?{...t,status:"idle"}:t))}}}(i),g=t=>{if("media"!==t&&"unsplash"!==t)throw Error(`Invalid option ${t}.`);s(t)};return R.jsxs(f.Vq,{open:i,onOpenChange:o,children:[R.jsx(f.fK,{icon:"folder",title:"Add an image"}),R.jsxs(f.Zp,{value:u,onValueChange:g,children:[a.mediaLibrary&&R.jsx(f.T9,{value:"media",title:"Media library",subtitle:"From Prismic",icon:"photo"}),R.jsx(f.T9,{value:"unsplash",title:"Unsplash",subtitle:"Source of free images",icon:"unsplash"}),a.mediaLibrary&&R.jsx(f.xu,{flexDirection:"column",justifyContent:"end",flexGrow:1,animation:{name:"fadeIn"},children:R.jsx(f.ZD,{startIcon:"cloudUpload",title:"Upload media",disabled:d,onFilesSelected:p})})]}),R.jsx(f.cZ,{children:R.jsx(eiO,{option:u,uploadingFiles:l,isUploading:d,onFilesSelected:p,onRetry:h,onMediaSelected(t){o(!1),null==n||n(t)},assetType:r})})]})}function eiO(t){let{option:n,onMediaSelected:r,assetType:i,...o}=t,a=A();switch(n){case"media":return a.mediaLibrary?R.jsx(ein,{onMediaSelected:r,assetType:i,...o}):null;case"unsplash":return R.jsx(eib,{onMediaSelected:r})}}function eik(t){let{onMediaSelected:n,readOnly:r,isUpdating:i}=t,[o,a]=(0,c.useState)(!1);return R.jsxs(f.aY,{children:[R.jsx(f.Zb,{color:"grey3",variant:"outlined",children:R.jsx(f.aY,{children:R.jsx(f.xu,{padding:{block:48},flexDirection:"column",children:R.jsxs(f.R$,{children:[R.jsx(f.av,{name:"cloudUpload"}),R.jsx(f._T,{children:i?"Preparing your image...":"You haven't selected an image"}),!r&&R.jsx(f.Qj,{children:R.jsx(f.zx,{disabled:i,onClick:()=>a(!0),children:"Select image"})})]})})})}),R.jsx(eiw,{open:o,onOpenChange:a,onMediaSelected:n,assetType:"image"})]})}function eiI(t){let{id:n,readOnly:r,altText:i,onValueChange:o,selected:a}=t;return R.jsxs(f.gN,{labelPosition:"side",selected:a,children:[R.jsx(f.Qy,{htmlFor:n,children:"Alt text"}),R.jsx(f.JO,{children:R.jsx(f.oi,{id:n,onValueChange:o,placeholder:"Short description for the visually impaired",readOnly:r,value:i})})]})}let eiC=({contentView:t,constraints:n,croppedImage:r})=>{let[i,o]=er4(t.origin,n),a=er5(t.origin.url,r,i,o,!0);return{...t,width:i,height:o,url:a,edit:{...t.edit,zoom:r.zoom,crop:{x:r.x,y:r.y}}}},eiM=({field:t,content:n,thumbnail:r,croppedImage:i})=>{var o,a,u,s;if(r===er2){let c=eiC({contentView:n,constraints:null==(o=null==t?void 0:t.config)?void 0:o.constraint,croppedImage:i});return c.url===n.url?n:{...n,...c}}let l=null==(u=null==(a=null==t?void 0:t.config)?void 0:a.thumbnails)?void 0:u.find(t=>t.name===r),f=null==(s=n.thumbnails)?void 0:s[r];if(!l||!f)return n;let d=eiC({contentView:f,constraints:l,croppedImage:i});return d.url===f.url?n:{...n,thumbnails:{...n.thumbnails,[r]:d}}},eiR=({initialSize:t,constraints:n})=>{let r=null!=n&&n.width&&null!=n&&n.height?n.width/n.height:t.width/t.height,[i,o]=t.width<t.height?[t.width,Math.round(t.width/r)]:[Math.round(t.height*r),t.height],a=Math.max(i/t.width,o/t.height,1);return{width:Math.round(i/a),height:Math.round(o/a)}},eiE=({contentView:t,constraints:n})=>{let r=eiR({initialSize:t.origin,constraints:n}),i=t.edit.zoom??1,o=Math.round(r.width/i),a=Math.round(r.height/i);return{...t.edit.crop,width:o,height:a,zoom:i}},eij={x:0,y:0,width:0,height:0,zoom:1},eiN=({selectedImage:{thumbnail:t,contentView:n}})=>t.width&&t.height?t.width/t.height:n?n.origin.width/n.origin.height:1,eiA=({trigger:t,initialImages:n,initialOption:r,onClose:i})=>{var o;let[a,u]=(0,c.useState)({}),[s,l]=(0,c.useState)({}),[d,p]=(0,c.useState)(!1),[h,m]=(0,c.useState)(!1),[g,y]=(0,c.useState)(r),v=n[g],b=t=>{if(!v)return;let n=v.thumbnail.name,r=a[n]??eij;u({...a,[n]:{...r,zoom:t}})},x=t=>{if(!v)return;let n=v.thumbnail.name,r=a[n]??eij;u({...a,[n]:{...r,...t}})},_=t=>{if(!v)return;let n=v.thumbnail.name,r=s[n];l({...s,[n]:{...r,crop:t}})},S=t=>{if(!v)return;let n=v.thumbnail.name,r=s[n]??{};l({...s,[n]:{...r,aspectRatio:t}})},T=a[(null==v?void 0:v.thumbnail.name)??""],w=d?T??((null==v?void 0:v.contentView)&&eiE({contentView:v.contentView,constraints:v.thumbnail})):void 0,O=s[(null==v?void 0:v.thumbnail.name)??""];return R.jsxs(f.Vq,{trigger:t,onAnimationEnd:()=>m(!0),open:d,onOpenChange(t){t?(y(r),u({}),l({})):(m(!1),i({option:g,croppedImages:a})),p(t)},children:[R.jsx(f.fK,{icon:"photo",title:"Image editor"}),R.jsx(f.Zp,{value:String(g),onValueChange:t=>y(Number(t)),children:n.map((t,n)=>R.jsx(f.T9,{value:String(n),icon:"photo",title:t.labels[0]??"Main",subtitle:t.labels[1]??""},t.thumbnail.name))}),v&&R.jsx(f.cZ,{children:h&&R.jsx(f.tP,{image:(null==(o=v.contentView)?void 0:o.origin.url)??"",crop:(null==O?void 0:O.crop)??{x:0,y:0},onCropChange:_,zoom:(null==T?void 0:T.zoom)??1,onZoomChange:b,aspectRatio:eiN({selectedImage:v,cropper:O}),onAspectRatioChange:S,initialCroppedArea:w,onCropAreaChange:x},v.thumbnail.name)})]})};function eiP(t){var n,r;let{content:i,selected:o,fieldLabel:a,readOnly:u,imageLabel:s,onMediaSelected:l,initialImages:d,initialOption:p=0,onCropperDialogClose:h,onClear:m,children:g}=t,[y,v]=(0,c.useState)(!1),b=(null==(r=null==(n=null==i?void 0:i.url)?void 0:n.split("?")[0])?void 0:r.slice(-4))===".svg",x=null!=i&&i.url&&!u?"visible":"hidden";return R.jsxs(f.Zb,{color:o?"indigo2":"grey2",variant:o?"selected":"dashed",children:[R.jsxs(f.Ol,{children:[R.jsxs(f.wP,{children:[a,0!==s.length&&R.jsx(f.xv,{color:"grey11",component:"span",noSelect:!0,children:` • ${s.join(" • ")}`})]}),R.jsxs(f.Pf,{sx:{visibility:x},children:[R.jsx(eiA,{trigger:R.jsx(f.zx,{startIcon:"crop",disabled:b,children:"Crop & Resize"}),initialImages:d,initialOption:p,onClose:h}),R.jsx(f.zx,{startIcon:"imageSearch",onClick:()=>v(!0),children:"Replace"}),R.jsx(f.zx,{onClick:m,startIcon:"delete",children:"Clear"})]})]}),g,R.jsx(eiw,{open:y,onOpenChange:v,onMediaSelected:l,assetType:"image"})]})}function eiL(t,n){let{width:r,height:i,rect:o}=function(t,n){let[r,i]=er4(t,n),o=Math.max(r/t.width,i/t.height),a=Math.round((t.width-r/o)/2),u=Math.round((t.height-i/o)/2);return{width:r,height:i,rect:{x:a,y:u,width:Math.round(r/o),height:Math.round(i/o)}}}({...t,width:(null==t?void 0:t.width)??2e3,height:(null==t?void 0:t.height)??2e3},n),a=Boolean((null==n?void 0:n.width)||(null==n?void 0:n.height));return{url:er5(t.url,o,r,i,a),alt:t.alt,origin:{id:t.id,url:t.url,width:t.width??2e3,height:t.height??2e3},width:r,height:i,edit:{background:"transparent",zoom:1,crop:{x:o.x,y:o.y}}}}function eiD(t){let{content:n,field:r,id:i,onContentChange:o,readOnly:a}=t,u=n&&n.origin.url.length>0,{onCropperDialogClose:s,onPageChange:f,onMediaSelected:d,isUpdating:p,page:m,thumbnail:g,allThumbnails:y,allContentViews:v,contentView:b,onClear:x}=function(t){var n;let{content:r,onContentChange:i,field:o}=t,[a,u]=(0,c.useState)(0),[s,f]=(0,c.useTransition)(),d=(n=o,(0,c.useMemo)(()=>{var t,r,i;return[{...null==(r=n.config)?void 0:r.constraint,name:er2}].concat((null==(i=n.config)?void 0:i.thumbnails)??[])},[n])),p=d[a],h=r?function(t,n){var r,i;let{__TYPE__:o,thumbnails:a,...u}=n,s=null==(i=null==(r=t.config)?void 0:r.thumbnails)?void 0:i.map(({name:t})=>null==a?void 0:a[t]);return[u,...s??[]]}(o,r):void 0,m=null==h?void 0:h[a];return{onCropperDialogClose:function({option:t,croppedImages:n}){if(u(t),!r)return;let a=Object.entries(n).reduce((t,[n,r])=>eiM({field:o,content:t,thumbnail:n,croppedImage:r}),r);a!==r&&f(()=>i(a))},onPageChange:function(t){f(()=>u(t))},onMediaSelected:function(t){if(!p)return;let n=function(t,n,r,i){var o,a,u,s,c,f;if(!r){let d=null==(o=n.config)?void 0:o.thumbnails,p=d&&Object.fromEntries(d.map(t=>[t.name,eiL(i,t)]));return{__TYPE__:"ImageContent",...eiL(i,null==(a=n.config)?void 0:a.constraint),thumbnails:p}}if(t===er2){let h=eiL(i,null==(u=n.config)?void 0:u.constraint);return h.url===r.url?r:{...r,...h}}let m=null==(c=null==(s=n.config)?void 0:s.thumbnails)?void 0:c.find(n=>n.name===t);if(!m)return r;let g=null==(f=r.thumbnails)?void 0:f[t],y=eiL(i,m);return y.url===(null==g?void 0:g.url)?r:{...r,thumbnails:(0,l.Q8)(r.thumbnails??{},(n,r)=>r===t?y:n)}}(p.name,o,r,t);n!==r&&f(()=>i(n))},isUpdating:s,page:a,thumbnail:p,allThumbnails:d,allContentViews:h,contentView:m,onClear:function(){null==u||u(0),i(void 0)}}}({field:r,content:n,onContentChange:o}),_=Hc(r),S=y.map((t,r)=>{let i=null==v?void 0:v[r];return{thumbnail:t,contentView:i,labels:er3(t,n,i)}}),T=g&&u?er3(g,n,b).filter(h.$):[];return R.jsx(eiP,{content:n,fieldLabel:_,imageLabel:T,initialOption:m,initialImages:S,readOnly:a,onMediaSelected:d,onCropperDialogClose:s,onClear:x,children:R.jsx(c.Suspense,{fallback:R.jsx("div",{style:{height:466}}),children:g&&n&&u&&v?R.jsx(eiF,{allContentViews:v,content:n,contentView:b,id:i,onContentChange:o,onPageChange:f,page:m,readOnly:a,thumbnailName:g.name,isUpdating:p}):R.jsx(eik,{onMediaSelected:d,readOnly:a,isUpdating:p})})})}function eiF(t){let{allContentViews:n,content:r,contentView:i,id:o,onContentChange:a,onPageChange:u,page:s,readOnly:c,thumbnailName:l,isUpdating:d}=t;return R.jsxs(f.aY,{children:[R.jsx(f.lr,{getItemSource:er8,items:n,onPageChange:u,page:s,style:{height:400},children:t=>(null==t?void 0:t.url)&&R.jsx(f.d$,{src:er9(t.url),alt:t.alt??void 0,isUpdating:d},`${l}_${t.url}`)}),R.jsx(eiI,{id:o,readOnly:c||!i,altText:(null==i?void 0:i.alt)??"",onValueChange(t){i&&a(function(t,n,r,i){let o=0===i.length?void 0:i;return t===er2?{...n,alt:o}:{...n,thumbnails:{...n.thumbnails,[t]:{...r,alt:o}}}}(l,r,i,t))}})]})}function eiW(t){let{content:n,field:r,id:i,onContentChange:o,readOnly:a}=t;return R.jsxs(f.gN,{children:[R.jsx(f.fw,{name:"notes"}),R.jsx(f.Qy,{htmlFor:i,children:Hc(r)}),R.jsx(f.JO,{children:R.jsx(f.Kx,{id:i,placeholder:Hl(r),readOnly:a,value:(null==n?void 0:n.value)??"",onChange(t){var n;o((n=t,0===n.length?void 0:{__TYPE__:"FieldContent",type:"Text",value:n}))}})})]})}function eiU(t,n,r,i){return(0,x.W7)(t,r,i,30,n)}function eiz(){let t=A();t.searchDocuments||L("searchDocuments");let{coreApiUrl:n,env:r}=t,i=(0,g.QT)(x.Ag,[`${n}/repository`,r]);return new Set(i.languages.map(t=>({id:t.id,label:t.name})))}function eiB(){let t=A();t.searchDocuments||L("searchDocuments");let{coreApiUrl:n,env:r}=t,i=(0,g.QT)(eiq,[n,r]);return new Set(i.results.map(t=>({id:t,label:t})))}function eiV(){let t=A();t.searchDocuments||L("searchDocuments");let{customTypesApiUrl:n,env:r,repository:i}=t,o=(0,g.QT)(eiH,[n,r,i??""]);return new Set(o)}g.Fs.registerFetcherConfig(eiU,{cacheCapacity:500,revalidationStrategy:{type:"never"}});let ei$=GW({results:GF(GO())});function eiq(t,n){return(0,m.WY)(`${t}/repository/tags`,{credentials:(0,m.xb)(n),okType:ei$})}let eiK=GF(GW({id:GO(),label:GO()}));function eiH(t,n,r){return(0,m.WY)(`${t}/customtypes`,{headers:{repository:r},credentials:(0,m.xb)(n),okType:eiK})}function eiG(t){return t?(0,_.UI)(t,t=>({id:t,label:t})):new Set}function eiZ(t){let{filteredLocales:n,setFilteredLocales:r,filteredTags:i,setFilteredTags:o,filteredCustomTypes:a,setFilteredCustomTypes:u,fixedTags:s,fixedCustomTypes:l}=t;return R.jsxs(R.Fragment,{children:[R.jsx(f.SV,{children:R.jsx(c.Suspense,{fallback:R.jsx(eiY,{selectedValues:n,onSelectedValuesChange:r,label:"Locale",icon:"public",fetchFilters:eiz,multiple:!1}),children:R.jsx(eiQ,{selectedValues:n,onSelectedValuesChange:r})})}),R.jsx(eiY,{selectedValues:i,fixedSelectedValues:eiG(s),onSelectedValuesChange:o,label:"Tags",icon:"label",fetchFilters:eiB}),R.jsx(eiY,{selectedValues:a,fixedSelectedValues:eiG(l),onSelectedValuesChange:u,label:"Type",icon:"description",fetchFilters:eiV})]})}function eiY(t){let[n,r]=(0,c.useState)(!1),i=(0,c.useContext)(g.Nk);return R.jsx(f.SV,{renderError:()=>R.jsx(f.R0,{mode:"error",onErrorRetry:null==i?void 0:i.reset,open:n,setOpen:r,values:new Set,...t}),children:R.jsx(c.Suspense,{fallback:R.jsx(f.R0,{mode:"loading",open:n,setOpen:r,values:new Set,...t}),children:R.jsx(eiJ,{open:n,setOpen:r,...t})})})}function eiJ(t){let{open:n,setOpen:r,onSelectedValuesChange:i,fixedSelectedValues:o,selectedValues:a,label:u,icon:s,fetchFilters:c,multiple:l}=t,d=c();return R.jsx(f.R0,{open:n,setOpen:r,label:u,icon:s,selectedValues:a,values:new Set(d),fixedSelectedValues:o,onSelectedValuesChange:i,multiple:l})}function eiQ(t){let{selectedValues:n,onSelectedValuesChange:r}=t,[i,o]=(0,c.useState)((0,_.Ps)(n)),a=(0,_.sE)(eiz(),t=>{var r;return t.id===(null==(r=(0,_.Ps)(n))?void 0:r.id)});return(null==a?void 0:a.label)!==(null==i?void 0:i.label)&&o(a),R.jsx(eiY,{selectedValues:new Set(i?[i]:[]),onSelectedValuesChange:function(t){r(t),o((0,_.Ps)(t))},label:"Locale",icon:"public",fetchFilters:eiz,multiple:!1})}function eiX(t){let{onSelectDocument:n,fixedCustomTypes:r,fixedTags:i,...o}=t,a=A(),{searchTerm:u,filteredTags:s,setFilteredTags:l,filteredCustomTypes:p,setFilteredCustomTypes:h,filteredLocales:m,setFilteredLocales:g,typesFilter:y,tagsFilter:v}=function(t,n){let r=A(),i=(0,d.$P)({initialState:""}),[o,a]=(0,c.useState)(new Set),[u,s]=(0,c.useState)(new Set),[l,f]=(0,c.useState)(function(){return r.searchDocuments&&r.localeId?new Set([{id:r.localeId,label:r.localeId}]):new Set}),p=(0,_.G0)(u,eiG(t)),h=(0,_.G0)(o,eiG(n));return{searchTerm:i,filteredTags:o,setFilteredTags:a,filteredCustomTypes:u,setFilteredCustomTypes:s,filteredLocales:l,setFilteredLocales:f,typesFilter:p,tagsFilter:h}}(r,i),[b,x]=(0,c.useTransition)(),S=(0,d.$P)({initialState:b,ms:100}),{searchDocuments:T}=A();return R.jsx(f.Vq,{size:{height:727,width:656},hasClose:!1,...o,children:R.jsx(f.cZ,{children:R.jsxs(f.xu,{flexDirection:"column",height:"100%",children:[R.jsxs(f.xu,{padding:{top:16,inline:16},flexDirection:"column",gap:12,children:[R.jsx(f.yt,{value:u.value,onValueChange:u.set,placeholder:"Search a page",icon:"search"}),T&&R.jsx(eiZ,{filteredTags:s,setFilteredTags:l,filteredCustomTypes:p,setFilteredCustomTypes:h,filteredLocales:m,setFilteredLocales:g,fixedTags:i,fixedCustomTypes:r}),R.jsx(f.xv,{variant:"smallBold",color:"grey11",children:"Link to a document"})]}),a.searchDocuments?R.jsx(f.SV,{renderError:ei1,children:R.jsx(c.Suspense,{children:R.jsx(ei2,{searchTerm:u.debouncedValue,tagsFilter:v,typesFilter:y,localesFilter:m,startTransition:x,onSelectDocument:n})})}):R.jsx(ei3,{message:"Slice Machine does not yet support mock data for linked documents in the simulator."}),R.jsx(ei0,{debouncedIsLoading:S.debouncedValue})]})})})}function ei0(t){return R.jsx(f.FN,{anchor:R.jsx(f.xu,{position:"relative",width:"100%",justifyContent:"center",bottom:72}),loadingIndicator:!0,open:t.debouncedIsLoading,title:"Loading more results ...",seconds:1})}function ei1(){return R.jsx(f.xu,{height:"100%",flexDirection:"column",alignItems:"center",justifyContent:"center",children:R.jsx(f.Iq,{title:"Request failed",description:"An error occurred while fetching documents.",errorImageSrc:f.Os})})}function ei2(t){let{searchTerm:n,tagsFilter:r,typesFilter:i,localesFilter:o,startTransition:a,onSelectDocument:u}=t,{documents:s,onHasReachedBottom:l}=function(t){var n,r;let{searchTerm:i,tagsFilter:o,typesFilter:a,localesFilter:u}=t,s=A();s.searchDocuments||L("searchDocuments");let{coreApiUrl:l,env:f,status:d}=s,[p,h]=(0,c.useState)(""),[m,y]=(0,c.useState)([]),[b,S]=(0,c.useState)(""),T=new URLSearchParams((0,x.fW)([{name:"tags",values:[...(0,_.UI)(o,t=>t.id)]},{name:"customTypes",values:[...(0,_.UI)(a,t=>t.id)]},{name:"language",values:[...(0,_.UI)(u,t=>t.id)]},{name:"status",values:x.Vu[d]},{name:"term",values:[i]}])).toString(),w=(0,g.QT)(eiU,[l,T===b?p:"",f,T]);return T!==b?(S(T),h(""),y(w.results)):w.results.length>0&&(null==(n=(0,v.Z$)(m))?void 0:n.id)!==(null==(r=(0,v.Z$)(w.results))?void 0:r.id)&&y(t=>t.concat(w.results)),{documents:m,onHasReachedBottom:function(){w.cursor&&h(w.cursor)},response:w}}({searchTerm:n,tagsFilter:r,localesFilter:o,typesFilter:i}),d=A();return R.jsx(f.xr,{onScrollToBottom:()=>a(l),style:{height:"100%",gap:f.TV.space[16],paddingTop:f.TV.space[10],paddingBottom:f.TV.space[16],paddingInline:f.TV.space[16]},children:R.jsxs(f.xu,{flexDirection:"column",gap:12,children:[0===s.length&&R.jsx(ei3,{}),s.map(t=>{var n,i,o,a,s,c,l,p,h,m;let g=(0,b.u)({documentId:t.id,versionId:(null==(n=t.versions[0])?void 0:n.status)==="archived"?null==(i=t.versions[0])?void 0:i.version_id:void 0,releaseId:(null==(o=t.versions[0])?void 0:o.status)==="release"?t.versions[0].release_id:void 0,status:null==(a=t.versions[0])?void 0:a.status,env:d.env}),y=function(t){let{tags:n,tagsFilter:r}=t,i=[...r].map(t=>t.label).reverse();return(0,v.DY)(n,t=>-i.indexOf(t))}({tags:(null==(s=t.versions[0])?void 0:s.tags)??[],tagsFilter:r});return R.jsx(f.z4,{documentType:(null==(c=t.versions[0])?void 0:c.custom_type_label)??"",documentURL:g,description:null==(l=t.versions[0])?void 0:l.preview_summary,tags:y,title:t.title,previewImageUrl:null==(p=t.versions[0])?void 0:p.preview_image,onSelect:()=>u(t.id),status:null==(h=t.versions[0])?void 0:h.status},`${t.id}-${(null==(m=t.versions[0])?void 0:m.status)??""}`)})]})})}function ei3(t){let{message:n="There are no versions matching this request"}=t;return R.jsxs(f.xu,{justifyContent:"center",flexDirection:"column",alignItems:"center",gap:16,children:[R.jsx(f.xu,{height:56,width:56,backgroundColor:"purple3",alignItems:"center",justifyContent:"center",borderRadius:"100%",children:R.jsx(f.I5,{name:"close",size:"large",color:"purple10"})}),R.jsx(f.xu,{maxWidth:204,children:R.jsx(f.xv,{color:"grey11",align:"center",children:n})})]})}function ei4(t){let{hasLink:n,onUnlink:r,selectEnabled:i,selectedType:o,onValueChange:a,openInNewTab:u=!0,setOpenInNewTab:s}=t;return R.jsxs(R.Fragment,{children:[s&&"web"===o&&R.jsx(f.zx,{startIcon:u?"checkBox":"checkBoxOutlinedBlank",variant:"secondary",size:"small",onClick:()=>s(!u),children:"Open in new tab"}),R.jsxs(f.Ph,{value:o,variant:"secondary",size:"small",startIcon:function(t){if(t)switch(t){case"document":return"description";case"web":return"public";case"media":return"image"}}(o),disabled:!i,onValueChange:a,placeholder:"Choose link type",children:[R.jsx(f.Ql,{value:"web",icon:"public",children:"Link to web page"}),R.jsx(f.Ql,{value:"document",icon:"description",children:"Link to Prismic page"}),R.jsx(f.Ql,{value:"media",icon:"image",children:"Link to media"})]}),R.jsx(f.zx,{startIcon:"close",variant:"secondary",size:"small",disabled:!n,onClick:r})]})}let ei5={DocumentLink:"document",ExternalLink:"web",FileLink:"media",ImageLink:"media"},ei9={document:"DocumentLink",web:"ExternalLink",media:"FileLink"},ei6=GW({id:GO(),title:GO()});function ei8(t,n,r){return(0,m.WY)(`${t}/documents/${r}`,{credentials:(0,m.xb)(n),okType:ei6})}function ei7(t){var n,r,i,o,a,u;let{media:s}=t,c="kind"in s;return c&&"pdf"===s.extension?{__TYPE__:"LinkContent",value:{__TYPE__:"FileLink",id:s.id,name:s.filename,kind:s.kind,url:s.url,size:s.size.toString(),date:(null==(n=s.last_modified)?void 0:n.toString())??""}}:c?{__TYPE__:"LinkContent",value:{__TYPE__:"ImageLink",id:s.id,name:s.filename,url:s.url,kind:s.kind,size:s.size.toString(),height:(null==(r=s.height)?void 0:r.toString())??"2000",width:(null==(i=s.width)?void 0:i.toString())??"2000",date:(null==(o=s.last_modified)?void 0:o.toString())??""}}:{__TYPE__:"LinkContent",value:{__TYPE__:"ImageLink",id:s.id,name:(null==s?void 0:s.alt)??s.url,kind:"image",url:s.url,size:"0",height:(null==(a=s.height)?void 0:a.toString())??"2000",width:(null==(u=s.width)?void 0:u.toString())??"2000"}}}function eoe(t){var n,r;let{content:i,field:o,id:a,onContentChange:u,readOnly:s}=t,[l,p]=(0,c.useState)(!1),[h,m]=(0,c.useState)(!1),[g,v]=(0,c.useState)(!1),[b,x]=(0,c.useState)(!1),{contentType:_,fieldValue:S,errorBoundaryRef:T,onDocumentSelected:w,onError:O,onMediaSelected:k,...I}=function(t){var n;let{field:r,content:i,onContentChange:o}=t,a=i?"DocumentLink"===i.value.__TYPE__?i.value.id:"ExternalLink"===i.value.__TYPE__?i.value.url:i.value.name:"",[u,s]=(0,c.useState)(()=>{var t,n;return!(null!=(t=r.config)&&t.select)||null!=i&&i.value.__TYPE__?null==i?void 0:i.value.__TYPE__:ei9[null==(n=r.config)?void 0:n.select]}),[l,f]=(0,c.useState)(()=>(null==i?void 0:i.value.__TYPE__)==="ExternalLink"?i.value.target:""),[p,h]=(0,c.useState)(!1),m=(0,c.useRef)(null);(0,d.pQ)(a,function(){var t;p&&(h(!1),null==(t=m.current)||t.reset())});let g=u?ei5[u]:void 0;function y(t){if(!t)return o(void 0);switch(u){case"ExternalLink":return o({__TYPE__:"LinkContent",value:{__TYPE__:"ExternalLink",url:t,target:l}});case"DocumentLink":return o({__TYPE__:"LinkContent",value:{__TYPE__:"DocumentLink",id:t}});default:return o(void 0)}}function v(t){y(t)}return{contentType:u,selectType:g,fieldValue:a,onValueChange:y,onTypeChange:function(t){s(ei9[t]),y("")},placeholder:Hl(r),isTypeSelectEnabled:!(null!=(n=r.config)&&n.select),onDocumentSelected:v,onError:function(){h(!0)},errorBoundaryRef:m,isTargetNewTab:"_blank"===l,updateWebLinkTarget:function(t){let n=t?"_blank":null;f(n),o({__TYPE__:"LinkContent",value:{__TYPE__:"ExternalLink",url:a,target:n}})},onMediaSelected:function(t){o(ei7({media:t}))}}}({content:i,field:o,onContentChange:u}),C="ExternalLink"===_&&(0,y.ju)(S),M={id:a,contentType:_,onBlur:()=>p(!1),onFocus(){p(!0),"DocumentLink"===_&&v(!0),"FileLink"===_&&x(!0),"ImageLink"===_&&x(!0)},readOnly:s||!_,textType:C||"ImageLink"===_||"FileLink"===_?"link":"normal",value:S,...I},{searchDocuments:E}=A();return R.jsxs(R.Fragment,{children:[R.jsxs(f.J2,{onMouseOverChange:m,open:l||h,align:"start",sideOffset:-3,openDelay:100,closeDelay:200,focusOnEnter:!1,anchor:R.jsxs(f.gN,{onMouseOverChange:p,children:[R.jsx(f.fw,{name:"link"}),R.jsx(f.Qy,{htmlFor:a,children:Hc(o)}),R.jsx(f.JO,{children:"DocumentLink"===_&&""!==S&&E?R.jsx(eor,{errorBoundaryRef:T,onError:O,fallback:R.jsx(eot,{...M,value:"..."}),renderError(){var t;return t=M,R.jsx(eot,{...t,textType:"link"})},children:R.jsx(eon,{...M,documentId:S,openDocumentListModal:()=>v(!0)})}):R.jsx(eot,{...M})})]}),children:[C&&R.jsx(f.oZ,{url:C,title:(0,y.S$)(C)??"",subTitle:C.toString()}),(null==i?void 0:i.value.__TYPE__)==="ImageLink"&&R.jsx(f.Qi,{url:i.value.url,title:i.value.name,subTitle:`${i.value.width} x ${i.value.height} pixels`})]}),R.jsx(eiw,{open:b,onOpenChange:x,onMediaSelected:k}),R.jsx(eiX,{open:g,onOpenChange:v,onSelectDocument(t){v(!1),w(t)},fixedCustomTypes:new Set(null==(n=o.config)?void 0:n.customtypes),fixedTags:new Set(null==(r=o.config)?void 0:r.tags)})]})}function eot(t){let{id:n,onValueChange:r,placeholder:i,readOnly:o,value:a,textType:u,onFocus:s,onBlur:c,contentType:l,isTypeSelectEnabled:d,selectType:p,onTypeChange:h,isTargetNewTab:m,updateWebLinkTarget:g}=t,y="DocumentLink"===l||"ImageLink"===l||"FileLink"===l;return R.jsx(f.oi,{id:n,onValueChange:r,placeholder:i,readOnly:o||y,value:a,variant:u,onFocus:s,onBlur:c,cursor:y?"pointer":"text",endAdornment:R.jsx(ei4,{hasLink:Boolean(a),onUnlink:()=>r(""),selectEnabled:d,selectedType:p,onValueChange:h,openInNewTab:m,setOpenInNewTab:g})})}function eon(t){let{id:n,documentId:r,openDocumentListModal:i,onValueChange:o,isTypeSelectEnabled:a,selectType:u,onTypeChange:s}=t,c=function(t){let n=A();n.searchDocuments||L("searchDocuments");let{coreApiUrl:r,env:i}=n;return(0,g.QT)(ei8,[r,i,t]).title}(r);return R.jsx(f.oi,{id:n,readOnly:!0,value:c,variant:"link",onFocus:i,cursor:"pointer",endAdornment:R.jsx(ei4,{hasLink:!0,onUnlink:()=>o(""),selectEnabled:a,selectedType:u,onValueChange:s})})}function eor(t){let{errorBoundaryRef:n,onError:r,children:i,fallback:o,renderError:a}=t;return R.jsx(f.SV,{ref:n,onError:r,renderError:a,children:R.jsx(c.Suspense,{fallback:o,children:i})})}let eoi=({content:t,field:n,id:r,onContentChange:i,readOnly:o})=>{var a,u;let s=Number(null==t?void 0:t.value),c=Number.isFinite(s)?s:void 0;return R.jsxs(f.gN,{children:[R.jsx(f.fw,{name:"pin"}),R.jsx(f.Qy,{htmlFor:r,children:Hc(n)}),R.jsx(f.JO,{children:R.jsx(f.Y2,{id:r,value:c,min:null==(a=n.config)?void 0:a.min,max:null==(u=n.config)?void 0:u.max,placeholder:Hl(n),readOnly:o,onValueChange(t){var n;return i((n=t,void 0===n?void 0:{__TYPE__:"FieldContent",type:"Number",value:String(n)}))}})})]})};var eoo=function(){};eoo.prototype.append=function(t){return t.length?(t=eoo.from(t),!this.length&&t||t.length<200&&this.leafAppend(t)||this.length<200&&t.leafPrepend(this)||this.appendInner(t)):this},eoo.prototype.prepend=function(t){return t.length?eoo.from(t).append(this):this},eoo.prototype.appendInner=function(t){return new eou(this,t)},eoo.prototype.slice=function(t,n){return void 0===t&&(t=0),void 0===n&&(n=this.length),t>=n?eoo.empty:this.sliceInner(Math.max(0,t),Math.min(this.length,n))},eoo.prototype.get=function(t){if(!(t<0||t>=this.length))return this.getInner(t)},eoo.prototype.forEach=function(t,n,r){void 0===n&&(n=0),void 0===r&&(r=this.length),n<=r?this.forEachInner(t,n,r,0):this.forEachInvertedInner(t,n,r,0)},eoo.prototype.map=function(t,n,r){void 0===n&&(n=0),void 0===r&&(r=this.length);var i=[];return this.forEach(function(n,r){return i.push(t(n,r))},n,r),i},eoo.from=function(t){return t instanceof eoo?t:t&&t.length?new eoa(t):eoo.empty};var eoa=function(t){function n(n){t.call(this),this.values=n}t&&(n.__proto__=t),n.prototype=Object.create(t&&t.prototype),n.prototype.constructor=n;var r={length:{configurable:!0},depth:{configurable:!0}};return n.prototype.flatten=function(){return this.values},n.prototype.sliceInner=function(t,r){return 0==t&&r==this.length?this:new n(this.values.slice(t,r))},n.prototype.getInner=function(t){return this.values[t]},n.prototype.forEachInner=function(t,n,r,i){for(var o=n;o<r;o++)if(!1===t(this.values[o],i+o))return!1},n.prototype.forEachInvertedInner=function(t,n,r,i){for(var o=n-1;o>=r;o--)if(!1===t(this.values[o],i+o))return!1},n.prototype.leafAppend=function(t){if(this.length+t.length<=200)return new n(this.values.concat(t.flatten()))},n.prototype.leafPrepend=function(t){if(this.length+t.length<=200)return new n(t.flatten().concat(this.values))},r.length.get=function(){return this.values.length},r.depth.get=function(){return 0},Object.defineProperties(n.prototype,r),n}(eoo);eoo.empty=new eoa([]);var eou=function(t){function n(n,r){t.call(this),this.left=n,this.right=r,this.length=n.length+r.length,this.depth=Math.max(n.depth,r.depth)+1}return t&&(n.__proto__=t),n.prototype=Object.create(t&&t.prototype),n.prototype.constructor=n,n.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},n.prototype.getInner=function(t){return t<this.left.length?this.left.get(t):this.right.get(t-this.left.length)},n.prototype.forEachInner=function(t,n,r,i){var o=this.left.length;if(n<o&&!1===this.left.forEachInner(t,n,Math.min(r,o),i)||r>o&&!1===this.right.forEachInner(t,Math.max(n-o,0),Math.min(this.length,r)-o,i+o))return!1},n.prototype.forEachInvertedInner=function(t,n,r,i){var o=this.left.length;if(n>o&&!1===this.right.forEachInvertedInner(t,n-o,Math.max(r,o)-o,i+o)||r<o&&!1===this.left.forEachInvertedInner(t,Math.min(n,o),r,i))return!1},n.prototype.sliceInner=function(t,n){if(0==t&&n==this.length)return this;var r=this.left.length;return n<=r?this.left.slice(t,n):t>=r?this.right.slice(t-r,n-r):this.left.slice(t,r).append(this.right.slice(0,n-r))},n.prototype.leafAppend=function(t){var r=this.right.leafAppend(t);if(r)return new n(this.left,r)},n.prototype.leafPrepend=function(t){var r=this.left.leafPrepend(t);if(r)return new n(r,this.right)},n.prototype.appendInner=function(t){return this.left.depth>=Math.max(this.right.depth,t.depth)+1?new n(this.left,new n(this.right,t)):new n(this,t)},n}(eoo);class eos{constructor(t,n){this.items=t,this.eventCount=n}popEvent(t,n){if(0==this.eventCount)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let i,o;n&&(o=(i=this.remapping(r,this.items.length)).maps.length);let a=t.tr,u,s,c=[],l=[];return this.items.forEach((t,n)=>{if(!t.step){i||(o=(i=this.remapping(r,n+1)).maps.length),o--,l.push(t);return}if(i){l.push(new eoc(t.map));let f=t.step.map(i.slice(o)),d;f&&a.maybeStep(f).doc&&(d=a.mapping.maps[a.mapping.maps.length-1],c.push(new eoc(d,void 0,void 0,c.length+l.length))),o--,d&&i.appendMap(d,o)}else a.maybeStep(t.step);if(t.selection)return u=i?t.selection.map(i.slice(o)):t.selection,s=new eos(this.items.slice(0,r).append(l.reverse().concat(c)),this.eventCount-1),!1},this.items.length,0),{remaining:s,transform:a,selection:u}}addTransform(t,n,r,i){var o,a;let u=[],s=this.eventCount,c=this.items,l=!i&&c.length?c.get(c.length-1):null;for(let f=0;f<t.steps.length;f++){let d=t.steps[f].invert(t.docs[f]),p=new eoc(t.mapping.maps[f],d,n),h;(h=l&&l.merge(p))&&(p=h,f?u.pop():c=c.slice(0,c.length-1)),u.push(p),n&&(s++,n=void 0),i||(l=p)}let m=s-r.depth,g;return m>eof&&(o=c,a=m,c=(o.forEach((t,n)=>{if(t.selection&&0==a--)return g=n,!1}),o.slice(g)),s-=m),new eos(c.append(u),s)}remapping(t,n){let r=new Z3;return this.items.forEach((n,i)=>{let o=null!=n.mirrorOffset&&i-n.mirrorOffset>=t?r.maps.length-n.mirrorOffset:void 0;r.appendMap(n.map,o)},t,n),r}addMaps(t){return 0==this.eventCount?this:new eos(this.items.append(t.map(t=>new eoc(t))),this.eventCount)}rebased(t,n){if(!this.eventCount)return this;let r=[],i=Math.max(0,this.items.length-n),o=t.mapping,a=t.steps.length,u=this.eventCount;this.items.forEach(t=>{t.selection&&u--},i);let s=n;this.items.forEach(n=>{let i=o.getMirror(--s);if(null==i)return;a=Math.min(a,i);let c=o.maps[i];if(n.step){let l=t.steps[i].invert(t.docs[i]),f=n.selection&&n.selection.map(o.slice(s+1,i));f&&u++,r.push(new eoc(c,l,f))}else r.push(new eoc(c))},i);let c=[];for(let l=n;l<a;l++)c.push(new eoc(o.maps[l]));let f=this.items.slice(0,i).append(c).append(r),d=new eos(f,u);return d.emptyItemCount()>500&&(d=d.compress(this.items.length-r.length)),d}emptyItemCount(){let t=0;return this.items.forEach(n=>{n.step||t++}),t}compress(t=this.items.length){let n=this.remapping(0,t),r=n.maps.length,i=[],o=0;return this.items.forEach((a,u)=>{if(u>=t)i.push(a),a.selection&&o++;else if(a.step){let s=a.step.map(n.slice(r)),c=s&&s.getMap();if(r--,c&&n.appendMap(c,r),s){let l=a.selection&&a.selection.map(n.slice(r));l&&o++;let f=new eoc(c.invert(),s,l),d,p=i.length-1;(d=i.length&&i[p].merge(f))?i[p]=d:i.push(f)}}else a.map&&r--},this.items.length,0),new eos(eoo.from(i.reverse()),o)}}eos.empty=new eos(eoo.empty,0);class eoc{constructor(t,n,r,i){this.map=t,this.step=n,this.selection=r,this.mirrorOffset=i}merge(t){if(this.step&&t.step&&!t.selection){let n=t.step.merge(this.step);if(n)return new eoc(n.getMap().invert(),n,this.selection)}}}class eol{constructor(t,n,r,i,o){this.done=t,this.undone=n,this.prevRanges=r,this.prevTime=i,this.prevComposition=o}}let eof=20;function eod(t){let n=[];return t.forEach((t,r,i,o)=>n.push(i,o)),n}function eop(t,n){if(!t)return null;let r=[];for(let i=0;i<t.length;i+=2){let o=n.map(t[i],1),a=n.map(t[i+1],-1);o<=a&&r.push(o,a)}return r}function eoh(t,n,r,i){let o=eoy(n),a=eov.get(n).spec.config,u=(i?t.undone:t.done).popEvent(n,o);if(!u)return;let s=u.selection.resolve(u.transform.doc),c=(i?t.done:t.undone).addTransform(u.transform,n.selection.getBookmark(),a,o),l=new eol(i?c:u.remaining,i?u.remaining:c,null,0,-1);r(u.transform.setSelection(s).setMeta(eov,{redo:i,historyState:l}).scrollIntoView())}let eom=!1,eog=null;function eoy(t){let n=t.plugins;if(eog!=n){eom=!1,eog=n;for(let r=0;r<n.length;r++)if(n[r].spec.historyPreserveItems){eom=!0;break}}return eom}let eov=new YZ("history"),eob=new YZ("closeHistory"),eox=(t,n)=>{let r=eov.getState(t);return!!r&&0!=r.done.eventCount&&(n&&eoh(r,t,n,!1),!0)},eo_=(t,n)=>{let r=eov.getState(t);return!!r&&0!=r.undone.eventCount&&(n&&eoh(r,t,n,!0),!0)},eoS=eeg.create({name:"history",addOptions:()=>({depth:100,newGroupDelay:500}),addCommands:()=>({undo:()=>({state:t,dispatch:n})=>eox(t,n),redo:()=>({state:t,dispatch:n})=>eo_(t,n)}),addProseMirrorPlugins(){return[function(t={}){return t={depth:t.depth||100,newGroupDelay:t.newGroupDelay||500},new YK({key:eov,state:{init:()=>new eol(eos.empty,eos.empty,null,0,-1),apply:(n,r,i)=>(function(t,n,r,i){let o=r.getMeta(eov),a;if(o)return o.historyState;r.getMeta(eob)&&(t=new eol(t.done,t.undone,null,0,-1));let u=r.getMeta("appendedTransaction");if(0==r.steps.length)return t;if(u&&u.getMeta(eov))return u.getMeta(eov).redo?new eol(t.done.addTransform(r,void 0,i,eoy(n)),t.undone,eod(r.mapping.maps[r.steps.length-1]),t.prevTime,t.prevComposition):new eol(t.done,t.undone.addTransform(r,void 0,i,eoy(n)),null,t.prevTime,t.prevComposition);if(!1===r.getMeta("addToHistory")||u&&!1===u.getMeta("addToHistory"))return(a=r.getMeta("rebased"))?new eol(t.done.rebased(r,a),t.undone.rebased(r,a),eop(t.prevRanges,r.mapping),t.prevTime,t.prevComposition):new eol(t.done.addMaps(r.mapping.maps),t.undone.addMaps(r.mapping.maps),eop(t.prevRanges,r.mapping),t.prevTime,t.prevComposition);{let s=r.getMeta("composition"),c=0==t.prevTime||!u&&t.prevComposition!=s&&(t.prevTime<(r.time||0)-i.newGroupDelay||!function(t,n){if(!n)return!1;if(!t.docChanged)return!0;let r=!1;return t.mapping.maps[0].forEach((t,i)=>{for(let o=0;o<n.length;o+=2)t<=n[o+1]&&i>=n[o]&&(r=!0)}),r}(r,t.prevRanges)),l=u?eop(t.prevRanges,r.mapping):eod(r.mapping.maps[r.steps.length-1]);return new eol(t.done.addTransform(r,c?n.selection.getBookmark():void 0,i,eoy(n)),eos.empty,l,r.time,s??t.prevComposition)}})(r,i,n,t)},config:t,props:{handleDOMEvents:{beforeinput(t,n){let r=n.inputType,i="historyUndo"==r?eox:"historyRedo"==r?eo_:null;return!!i&&(n.preventDefault(),i(t.state,t.dispatch))}}}})}(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Mod-y":()=>this.editor.commands.redo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),eoT=/(?:^|\s)((?:\*\*)((?:[^*]+))(?:\*\*))$/,eow=/(?:^|\s)((?:\*\*)((?:[^*]+))(?:\*\*))/g,eoO=/(?:^|\s)((?:__)((?:[^__]+))(?:__))$/,eok=/(?:^|\s)((?:__)((?:[^__]+))(?:__))/g,eoI=etH.create({name:"bold",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"strong"},{tag:"b",getAttrs:t=>"normal"!==t.style.fontWeight&&null},{style:"font-weight",getAttrs:t=>/^(bold(er)?|[5-9]\d{2,})$/.test(t)&&null}],renderHTML({HTMLAttributes:t}){return["strong",X6(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[et$({find:eoT,type:this.type}),et$({find:eoO,type:this.type})]},addPasteRules(){return[etY({find:eow,type:this.type}),etY({find:eok,type:this.type})]}});var eoC,eoM,eoR=((eoC=eoR||{}).Document="document",eoC.Mark="mark",eoC.Node="node",eoC),eoE=((eoM=eoE||{}).Text="text",eoM.Embed="embed",eoM.Image="image",eoM);class eoj{constructor(t,n,r,i,o,a=!1){k(this,"extType","node"),k(this,"nodeType","text"),this.richTextNodeTypes=t,this.name=n,this.component=r,this.converter=i,this.placeholder=o,this.lockedFormat=a}}function eoN(t){return t instanceof eoj}class eoA extends eoj{constructor(t,n,r,i,o){super(t,"heading",n,i,o),this.levels=r}}class eoP extends eoj{constructor(t,n,r,i){super(t,n,r,i)}}function eoL(t){return t instanceof eoP}let eoD=etG.create({name:"hardBreak",addOptions:()=>({keepMarks:!0,HTMLAttributes:{}}),inline:!0,group:"inline",selectable:!1,parseHTML:()=>[{tag:"br"}],renderHTML({HTMLAttributes:t}){return["br",X6(this.options.HTMLAttributes,t)]},renderText:()=>`
|
|
93
|
-
`,addCommands(){return{setHardBreak:()=>({commands:t,chain:n,state:r,editor:i})=>t.first([()=>t.exitCode(),()=>t.command(()=>{let{selection:t,storedMarks:o}=r;if(t.$from.parent.type.spec.isolating)return!1;let{keepMarks:a}=this.options,{splittableMarks:u}=i.extensionManager,s=o||t.$to.parentOffset&&t.$from.marks();return n().insertContent({type:this.name}).command(({tr:t,dispatch:n})=>{if(n&&s&&a){let r=s.filter(t=>u.includes(t.type.name));t.ensureMarks(r)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),eoF={isHardBreak:t=>t.type.name===eoD.name,children:{reduce(t,n,r){let i=r;return t.forEach((t,r,o)=>{i=n(i,t,o)}),i},map(t,n){return this.reduce(t,(t,r)=>[...t,n(r)],[])},exists(t,n){return this.reduce(t,(t,r)=>t||n(r),!1)},filter(t,n){return this.reduce(t,(t,r)=>[...t,...n(r)?[r]:[]],[])}},marks:{reduce(t,n,r){let i=r;return t.marks.forEach((t,r)=>{i=n(i,t,r)}),i},map(t,n){return this.reduce(t,(t,r)=>[...t,n(r)],[])},filter(t,n){return this.reduce(t,(t,r)=>[...t,...n(r)?[r]:[]],[])}}};function eoW(){return{extensions:esN(),defaultTextConverter:void 0}}let eoU=eoI.extend({name:"bold"}),eoz=new class{constructor(t,n,r){k(this,"extType",eoR.Mark),k(this,"richTextNodeTypes",Vl.RichTextNodeType.strong),this.name=t,this.component=n,this.converter=r}}(eoU.name,eoU,{fromPrismic:t=>function(){var n;return null==(n=t.marks[eoU.name])?void 0:n.create()},toPrismic(){}}),eoB=etG.create({name:"listItem",addOptions:()=>({HTMLAttributes:{}}),content:"paragraph block*",defining:!0,parseHTML:()=>[{tag:"li"}],renderHTML({HTMLAttributes:t}){return["li",X6(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)}}}),eoV=etH.create({name:"textStyle",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"span",getAttrs:t=>!!t.hasAttribute("style")&&{}}],renderHTML({HTMLAttributes:t}){return["span",X6(this.options.HTMLAttributes,t),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:t,commands:n})=>{let r=etc(t,this.type);return!!Object.entries(r).some(([,t])=>!!t)||n.unsetMark(this.name)}}}}),eo$=/^\s*([-+*])\s$/,eoq=etG.create({name:"bulletList",addOptions:()=>({itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}),group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML:()=>[{tag:"ul"}],renderHTML({HTMLAttributes:t}){return["ul",X6(this.options.HTMLAttributes,t),0]},addCommands(){return{toggleBulletList:()=>({commands:t,chain:n})=>this.options.keepAttributes?n().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(eoB.name,this.editor.getAttributes(eoV.name)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let t=etK({find:eo$,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(t=etK({find:eo$,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(eoV.name),editor:this.editor})),[t]}}),eoK=etG.create({name:"doc",topNode:!0,content:"block+"}),eoH=etG.create({name:"listItem",addOptions:()=>({HTMLAttributes:{}}),content:"paragraph block*",defining:!0,parseHTML:()=>[{tag:"li"}],renderHTML({HTMLAttributes:t}){return["li",X6(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)}}}),eoG=eoH.extend({name:"listItem",content:"paragraph*",addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name)}}}),eoZ={component:eoG,converter:{fromPrismic:t=>function(n){var r;let i=euG.converter.fromPrismic(t)(n);if(i)return null==(r=t.nodes[eoG.name])?void 0:r.create({},i)},toPrismic:(t,n)=>eoF.children.reduce(t,(t,r)=>{let i=euG.converter.toPrismic(r),o=i instanceof Array?i.map(t=>({...t,type:n})):i?[{...i,type:n}]:[];return[...t,...o]},[])},placeholder:"List"},eoY="document",eoJ=t=>eoK.extend({name:eoY,content:t?"block+":"block"}),eoQ=t=>({fromPrismic(n,r){function i(t,n){return!n&&r&&ep.TextBlock.is(t)?r(t):n}return function(r){var o;let a=r.value.reduce((r,o)=>{let a=t.find(t=>t.richTextNodeTypes.includes(o.type)),u=function(t){let{ext:n,block:r,schema:i}=t;if(n)switch(n.nodeType){case eoE.Embed:return ep.EmbedBlock.is(r)?n.converter.fromPrismic(i)(r):void 0;case eoE.Text:return ep.TextBlock.is(r)?n.converter.fromPrismic(i)(r):void 0;case eoE.Image:return ep.ImageBlock.is(r)?n.converter.fromPrismic(i)(r):void 0;default:return}}({ext:a,block:o,schema:n}),s=r.slice(0,r.length-1),c=(0,v.Z$)(r),l=function(t){var n,r;let{node:i,block:o,nodeWithDefault:a,previousNode:u}=t;return i&&u?i.type.name===u.type.name&&(i.type.name===eu3.name||i.type.name===esE.name)?{merged:!0,updatedNode:u.copy(u.content.append(i.content))}:{merged:!1,updatedNode:a(o,i)}:{merged:!1,updatedNode:i}}({node:u,block:o,nodeWithDefault:i,previousNode:c});return l.updatedNode?[...l.merged?s:r,l.updatedNode]:r},[]);return null==(o=n.nodes[eoY])?void 0:o.create({},a)}},toPrismic:n=>({__TYPE__:"StructuredTextContent",value:[...eoF.children.reduce(n,(n,r)=>{let i=Object.values(t).find(t=>r.type.name===t.name),o=null==i?void 0:i.converter.toPrismic(r);return o||console.warn(`Cannot convert node of type '${r.type.name}'.`),o?[...n,...o instanceof Array?o:[o]]:n},[])]})}),eoX=new class{constructor(t,n,r){k(this,"extType","document"),this.name=t,this.component=n,this.converter=r}}(eoY,eoJ,eoQ),eo0=eoD.extend({name:"hard_break"}),eo1=`
|
|
94
|
-
`,eo2={fromPrismic:t=>function(n){var r;if(n===eo1)return null==(r=t.nodes[eo0.name])?void 0:r.create({})},toPrismic(t){if(t.type.name===eo0.name)return eo1}},eo3={isEmptyLine:t=>0===t.length,isFirst:t=>0===t},eo4={name:eo0.name,component:eo0,converter:eo2,splitTextToNodes:function(t,n){return function(r){let i=eo2.fromPrismic(t)(eo1);if(!i)return[r(n)];let o=n.split(eo1);return 1===o.length?n.length?[r(n)]:[i]:o.reduce((t,n,o)=>eo3.isFirst(o)?eo3.isEmptyLine(n)?t:[...t,r(n)]:eo3.isEmptyLine(n)?[...t,i]:[...t,i,r(n)],[])}}},eo5=eeg.create({name:"placeholder",addOptions:()=>({emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}),addProseMirrorPlugins(){return[new YK({key:new YZ("placeholder"),props:{decorations:({doc:t,selection:n})=>{let r=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:i}=n,o=[];if(!r)return null;let a=t.type.createAndFill(),u=(null==a?void 0:a.sameMarkup(t))&&null===a.content.findDiffStart(t.content);return t.descendants((t,n)=>{let r=i>=n&&i<=n+t.nodeSize,a=!t.isLeaf&&!t.childCount;if((r||!this.options.showOnlyCurrent)&&a){let s=[this.options.emptyNodeClass];u&&s.push(this.options.emptyEditorClass);let c=Q3.node(n,n+t.nodeSize,{class:s.join(" "),"data-placeholder":"function"==typeof this.options.placeholder?this.options.placeholder({editor:this.editor,node:t,pos:n,hasAnchor:r}):this.options.placeholder});o.push(c)}return this.options.includeChildren}),Q9.create(t,o)}}})]}}),eo9=t=>eo5.configure({includeChildren:!0,placeholder:n=>(function({props:t,params:n}){var r;let{editor:i,hasAnchor:o,node:a}=t,{placeholderByNodeType:u,unfocusedPlaceholder:s,nodeExtensions:c}=n,l=!eoF.children.exists(i.state.doc,t=>t===a),f=i.isEditable,d=i.isFocused&&o,p=a.type.name!==euG.name,h=d||p||l,m=c.length>1,g=function(){if(l)return eoZ.placeholder;let t=u[a.type.name];return"string"==typeof t?t:null==t?void 0:t(a.attrs)}();return s&&!d&&i.isEmpty?s:("Type '/' for commands"===g?f&&h&&m:f&&h)&&g||""})({props:n,params:t}),showOnlyCurrent:!1,showOnlyWhenEditable:!1});function eo6(t){return t.split("-")[1]}function eo8(t){return"y"===t?"height":"width"}function eo7(t){return t.split("-")[0]}function eae(t){return["top","bottom"].includes(eo7(t))?"x":"y"}function eat(t,n,r){let{reference:i,floating:o}=t,a=i.x+i.width/2-o.width/2,u=i.y+i.height/2-o.height/2,s=eae(n),c=eo8(s),l=i[c]/2-o[c]/2,f=eo7(n),d="x"===s,p;switch(f){case"top":p={x:a,y:i.y-o.height};break;case"bottom":p={x:a,y:i.y+i.height};break;case"right":p={x:i.x+i.width,y:u};break;case"left":p={x:i.x-o.width,y:u};break;default:p={x:i.x,y:i.y}}switch(eo6(n)){case"start":p[s]-=l*(r&&d?-1:1);break;case"end":p[s]+=l*(r&&d?-1:1)}return p}let ean=async(t,n,r)=>{let{placement:i="bottom",strategy:o="absolute",middleware:a=[],platform:u}=r,s=a.filter(Boolean),c=await (null==u.isRTL?void 0:u.isRTL(n)),l=await u.getElementRects({reference:t,floating:n,strategy:o}),{x:f,y:d}=eat(l,i,c),p=i,h={},m=0;for(let g=0;g<s.length;g++){let{name:y,fn:v}=s[g],{x:b,y:x,data:_,reset:S}=await v({x:f,y:d,initialPlacement:i,placement:p,strategy:o,middlewareData:h,rects:l,platform:u,elements:{reference:t,floating:n}});if(f=b??f,d=x??d,h={...h,[y]:{...h[y],..._}},S&&m<=50){m++,"object"==typeof S&&(S.placement&&(p=S.placement),S.rects&&(l=!0===S.rects?await u.getElementRects({reference:t,floating:n,strategy:o}):S.rects),{x:f,y:d}=eat(l,p,c)),g=-1;continue}}return{x:f,y:d,placement:p,strategy:o,middlewareData:h}};function ear(t){return{...t,top:t.y,left:t.x,right:t.x+t.width,bottom:t.y+t.height}}async function eai(t,n){var r,i,o;void 0===n&&(n={});let{x:a,y:u,platform:s,rects:c,elements:l,strategy:f}=t,{boundary:d="clippingAncestors",rootBoundary:p="viewport",elementContext:h="floating",altBoundary:m=!1,padding:g=0}=n,y="number"!=typeof g?{top:0,right:0,bottom:0,left:0,...g}:{top:g,right:g,bottom:g,left:g},v=l[m?"floating"===h?"reference":"floating":h],b=ear(await s.getClippingRect({element:null==(r=await (null==s.isElement?void 0:s.isElement(v)))||r?v:v.contextElement||await (null==s.getDocumentElement?void 0:s.getDocumentElement(l.floating)),boundary:d,rootBoundary:p,strategy:f})),x="floating"===h?{...c.floating,x:a,y:u}:c.reference,_=await (null==s.getOffsetParent?void 0:s.getOffsetParent(l.floating)),S=await (null==s.isElement?void 0:s.isElement(_))&&await (null==s.getScale?void 0:s.getScale(_))||{x:1,y:1},T=ear(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({rect:x,offsetParent:_,strategy:f}):x);return{top:(b.top-T.top+y.top)/S.y,bottom:(T.bottom-b.bottom+y.bottom)/S.y,left:(b.left-T.left+y.left)/S.x,right:(T.right-b.right+y.right)/S.x}}let eao=Math.min,eaa=Math.max;function eau(t,n,r){return eaa(t,eao(n,r))}let eas={left:"right",right:"left",bottom:"top",top:"bottom"};function eac(t){return t.replace(/left|right|bottom|top/g,t=>eas[t])}let eal={start:"end",end:"start"};function eaf(t){return t.replace(/start|end/g,t=>eal[t])}async function ead(t,n){let{placement:r,platform:i,elements:o}=t,a=await (null==i.isRTL?void 0:i.isRTL(o.floating)),u=eo7(r),s=eo6(r),c="x"===eae(r),l=["left","top"].includes(u)?-1:1,f=a&&c?-1:1,d="function"==typeof n?n(t):n,{mainAxis:p,crossAxis:h,alignmentAxis:m}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...d};return s&&"number"==typeof m&&(h="end"===s?-1*m:m),c?{x:h*f,y:p*l}:{x:p*l,y:h*f}}function eap(t){return"x"===t?"y":"x"}function eah(t){var n;return(null==(n=t.ownerDocument)?void 0:n.defaultView)||window}function eam(t){return eah(t).getComputedStyle(t)}let eag=Math.min,eay=Math.max,eav=Math.round;function eab(t){let n=eam(t),r=parseFloat(n.width),i=parseFloat(n.height),o=t.offsetWidth,a=t.offsetHeight,u=eav(r)!==o||eav(i)!==a;return u&&(r=o,i=a),{width:r,height:i,fallback:u}}function eax(t){return eaO(t)?(t.nodeName||"").toLowerCase():""}let ea_;function eaS(){if(ea_)return ea_;let t=navigator.userAgentData;return t&&Array.isArray(t.brands)?ea_=t.brands.map(t=>t.brand+"/"+t.version).join(" "):navigator.userAgent}function eaT(t){return t instanceof eah(t).HTMLElement}function eaw(t){return t instanceof eah(t).Element}function eaO(t){return t instanceof eah(t).Node}function eak(t){if(typeof ShadowRoot>"u")return!1;let n=eah(t).ShadowRoot;return t instanceof n||t instanceof ShadowRoot}function eaI(t){let{overflow:n,overflowX:r,overflowY:i,display:o}=eam(t);return/auto|scroll|overlay|hidden|clip/.test(n+i+r)&&!["inline","contents"].includes(o)}function eaC(t){return["table","td","th"].includes(eax(t))}function eaM(t){let n=/firefox/i.test(eaS()),r=eam(t),i=r.backdropFilter||r.WebkitBackdropFilter;return"none"!==r.transform||"none"!==r.perspective||!!i&&"none"!==i||n&&"filter"===r.willChange||n&&!!r.filter&&"none"!==r.filter||["transform","perspective"].some(t=>r.willChange.includes(t))||["paint","layout","strict","content"].some(t=>{let n=r.contain;return null!=n&&n.includes(t)})}function eaR(){return/^((?!chrome|android).)*safari/i.test(eaS())}function eaE(t){return["html","body","#document"].includes(eax(t))}function eaj(t){return eaw(t)?t:t.contextElement}let eaN={x:1,y:1};function eaA(t){let n=eaj(t);if(!eaT(n))return eaN;let r=n.getBoundingClientRect(),{width:i,height:o,fallback:a}=eab(n),u=(a?eav(r.width):r.width)/i,s=(a?eav(r.height):r.height)/o;return u&&Number.isFinite(u)||(u=1),s&&Number.isFinite(s)||(s=1),{x:u,y:s}}function eaP(t,n,r,i){var o,a;void 0===n&&(n=!1),void 0===r&&(r=!1);let u=t.getBoundingClientRect(),s=eaj(t),c=eaN;n&&(i?eaw(i)&&(c=eaA(i)):c=eaA(t));let l=s?eah(s):window,f=eaR()&&r,d=(u.left+(f&&(null==(o=l.visualViewport)?void 0:o.offsetLeft)||0))/c.x,p=(u.top+(f&&(null==(a=l.visualViewport)?void 0:a.offsetTop)||0))/c.y,h=u.width/c.x,m=u.height/c.y;if(s){let g=eah(s),y=i&&eaw(i)?eah(i):i,v=g.frameElement;for(;v&&i&&y!==g;){let b=eaA(v),x=v.getBoundingClientRect(),_=getComputedStyle(v);x.x+=(v.clientLeft+parseFloat(_.paddingLeft))*b.x,x.y+=(v.clientTop+parseFloat(_.paddingTop))*b.y,d*=b.x,p*=b.y,h*=b.x,m*=b.y,d+=x.x,p+=x.y,v=eah(v).frameElement}}return{width:h,height:m,top:p,right:d+h,bottom:p+m,left:d,x:d,y:p}}function eaL(t){return((eaO(t)?t.ownerDocument:t.document)||window.document).documentElement}function eaD(t){return eaw(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function eaF(t){return eaP(eaL(t)).left+eaD(t).scrollLeft}function eaW(t){if("html"===eax(t))return t;let n=t.assignedSlot||t.parentNode||eak(t)&&t.host||eaL(t);return eak(n)?n.host:n}function eaU(t,n){var r;void 0===n&&(n=[]);let i=function t(n){let r=eaW(n);return eaE(r)?r.ownerDocument.body:eaT(r)&&eaI(r)?r:t(r)}(t),o=i===(null==(r=t.ownerDocument)?void 0:r.body),a=eah(i);return o?n.concat(a,a.visualViewport||[],eaI(i)?i:[]):n.concat(i,eaU(i))}function eaz(t,n,r){let i;if("viewport"===n)i=function(t,n){let r=eah(t),i=eaL(t),o=r.visualViewport,a=i.clientWidth,u=i.clientHeight,s=0,c=0;if(o){a=o.width,u=o.height;let l=eaR();(!l||l&&"fixed"===n)&&(s=o.offsetLeft,c=o.offsetTop)}return{width:a,height:u,x:s,y:c}}(t,r);else if("document"===n)i=function(t){let n=eaL(t),r=eaD(t),i=t.ownerDocument.body,o=eay(n.scrollWidth,n.clientWidth,i.scrollWidth,i.clientWidth),a=eay(n.scrollHeight,n.clientHeight,i.scrollHeight,i.clientHeight),u=-r.scrollLeft+eaF(t),s=-r.scrollTop;return"rtl"===eam(i).direction&&(u+=eay(n.clientWidth,i.clientWidth)-o),{width:o,height:a,x:u,y:s}}(eaL(t));else if(eaw(n))i=function(t,n){let r=eaP(t,!0,"fixed"===n),i=r.top+t.clientTop,o=r.left+t.clientLeft,a=eaT(t)?eaA(t):{x:1,y:1},u=t.clientWidth*a.x,s=t.clientHeight*a.y,c=o*a.x,l=i*a.y;return{width:u,height:s,x:c,y:l}}(n,r);else{let o={...n};if(eaR()){var a,u;let s=eah(t);o.x-=(null==(a=s.visualViewport)?void 0:a.offsetLeft)||0,o.y-=(null==(u=s.visualViewport)?void 0:u.offsetTop)||0}i=o}return ear(i)}function eaB(t,n){return eaT(t)&&"fixed"!==eam(t).position?n?n(t):t.offsetParent:null}function eaV(t,n){let r=eah(t),i=eaB(t,n);for(;i&&eaC(i)&&"static"===eam(i).position;)i=eaB(i,n);return i&&("html"===eax(i)||"body"===eax(i)&&"static"===eam(i).position&&!eaM(i))?r:i||function(t){let n=eaW(t);for(;eaT(n)&&!eaE(n);){if(eaM(n))return n;n=eaW(n)}return null}(t)||r}let ea$={getClippingRect:function(t){let{element:n,boundary:r,rootBoundary:i,strategy:o}=t,a=[..."clippingAncestors"===r?function(t,n){let r=n.get(t);if(r)return r;let i=eaU(t).filter(t=>eaw(t)&&"body"!==eax(t)),o=null,a="fixed"===eam(t).position,u=a?eaW(t):t;for(;eaw(u)&&!eaE(u);){let s=eam(u),c=eaM(u);"fixed"===s.position?o=null:(a?c||o:!(!c&&"static"===s.position&&o&&["absolute","fixed"].includes(o.position)))?o=s:i=i.filter(t=>t!==u),u=eaW(u)}return n.set(t,i),i}(n,this._c):[].concat(r),i],u=a[0],s=a.reduce((t,r)=>{let i=eaz(n,r,o);return t.top=eay(i.top,t.top),t.right=eag(i.right,t.right),t.bottom=eag(i.bottom,t.bottom),t.left=eay(i.left,t.left),t},eaz(n,u,o));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}},convertOffsetParentRelativeRectToViewportRelativeRect:function(t){let{rect:n,offsetParent:r,strategy:i}=t,o=eaT(r),a=eaL(r);if(r===a)return n;let u={scrollLeft:0,scrollTop:0},s={x:1,y:1},c={x:0,y:0};if((o||!o&&"fixed"!==i)&&(("body"!==eax(r)||eaI(a))&&(u=eaD(r)),eaT(r))){let l=eaP(r);s=eaA(r),c.x=l.x+r.clientLeft,c.y=l.y+r.clientTop}return{width:n.width*s.x,height:n.height*s.y,x:n.x*s.x-u.scrollLeft*s.x+c.x,y:n.y*s.y-u.scrollTop*s.y+c.y}},isElement:eaw,getDimensions:function(t){return eaT(t)?eab(t):t.getBoundingClientRect()},getOffsetParent:eaV,getDocumentElement:eaL,getScale:eaA,async getElementRects(t){let{reference:n,floating:r,strategy:i}=t,o=this.getOffsetParent||eaV,a=this.getDimensions;return{reference:function(t,n,r){let i=eaT(n),o=eaL(n),a=eaP(t,!0,"fixed"===r,n),u={scrollLeft:0,scrollTop:0},s={x:0,y:0};if(i||!i&&"fixed"!==r){if(("body"!==eax(n)||eaI(o))&&(u=eaD(n)),eaT(n)){let c=eaP(n,!0);s.x=c.x+n.clientLeft,s.y=c.y+n.clientTop}else o&&(s.x=eaF(o))}return{x:a.left+u.scrollLeft-s.x,y:a.top+u.scrollTop-s.y,width:a.width,height:a.height}}(n,await o(r),i),floating:{x:0,y:0,...await a(r)}}},getClientRects:t=>Array.from(t.getClientRects()),isRTL:t=>"rtl"===eam(t).direction};function eaq(t,n,r,i){void 0===i&&(i={});let{ancestorScroll:o=!0,ancestorResize:a=!0,elementResize:u=!0,animationFrame:s=!1}=i,c=o&&!s,l=c||a?[...eaw(t)?eaU(t):t.contextElement?eaU(t.contextElement):[],...eaU(n)]:[];l.forEach(t=>{c&&t.addEventListener("scroll",r,{passive:!0}),a&&t.addEventListener("resize",r)});let f=null;if(u){let d=!0;f=new ResizeObserver(()=>{d||r(),d=!1}),eaw(t)&&!s&&f.observe(t),eaw(t)||!t.contextElement||s||f.observe(t.contextElement),f.observe(n)}let p,h=s?eaP(t):null;return s&&function n(){let i=eaP(t);h&&(i.x!==h.x||i.y!==h.y||i.width!==h.width||i.height!==h.height)&&r(),h=i,p=requestAnimationFrame(n)}(),r(),()=>{var t;l.forEach(t=>{c&&t.removeEventListener("scroll",r),a&&t.removeEventListener("resize",r)}),null==(t=f)||t.disconnect(),f=null,s&&cancelAnimationFrame(p)}}let eaK=(t,n,r)=>{let i=new Map,o={platform:ea$,...r},a={...o.platform,_c:i};return ean(t,n,{...o,platform:a})};var eaH="u">typeof document?c.useLayoutEffect:c.useEffect;function eaG(t,n){if(t===n)return!0;if(typeof t!=typeof n)return!1;if("function"==typeof t&&t.toString()===n.toString())return!0;let r,i,o;if(t&&n&&"object"==typeof t){if(Array.isArray(t)){if((r=t.length)!=n.length)return!1;for(i=r;0!=i--;)if(!eaG(t[i],n[i]))return!1;return!0}if((r=(o=Object.keys(t)).length)!==Object.keys(n).length)return!1;for(i=r;0!=i--;)if(!Object.prototype.hasOwnProperty.call(n,o[i]))return!1;for(i=r;0!=i--;){let a=o[i];if(!("_owner"===a&&t.$$typeof)&&!eaG(t[a],n[a]))return!1}return!0}return t!=t&&n!=n}function eaZ(t){let n=c.useRef(t);return eaH(()=>{n.current=t}),n}var eaY="u">typeof document?c.useLayoutEffect:c.useEffect;let eaJ=!1,eaQ=0,eaX=()=>"floating-ui-"+eaQ++,ea0=(qy||(qy=r.t(c,2)))["useId".toString()],ea1=ea0??function(){let[t,n]=c.useState(()=>eaJ?eaX():void 0);return eaY(()=>{null==t&&n(eaX())},[]),c.useEffect(()=>{eaJ||(eaJ=!0)},[]),t},ea2=c.createContext(null),ea3=c.createContext(null),ea4=()=>{var t,n;return null!=(t=null==(n=c.useContext(ea2))?void 0:n.id)?t:null},ea5=()=>c.useContext(ea3);function ea9(t){var n;return null!=(n=null==t?void 0:t.ownerDocument)?n:document}function ea6(t){var n;return null!=(n=ea9(t).defaultView)?n:window}function ea8(t){return!!t&&t instanceof ea6(t).Element}let ea7=(qy||(qy=r.t(c,2)))["useInsertionEffect".toString()];function eue(t){let n=c.useRef(()=>{});return ea7?ea7(()=>{n.current=t}):n.current=t,c.useCallback(function(){for(var t=arguments.length,r=Array(t),i=0;i<t;i++)r[i]=arguments[i];return null==n.current?void 0:n.current(...r)},[])}function eut(t,n,r){let i=new Map;return{..."floating"===r&&{tabIndex:-1},...t,...n.map(t=>t?t[r]:null).concat(t).reduce((t,n)=>(n&&Object.entries(n).forEach(n=>{let[r,o]=n;if(0===r.indexOf("on")){if(i.has(r)||i.set(r,[]),"function"==typeof o){var a;null==(a=i.get(r))||a.push(o),t[r]=function(){for(var t,n=arguments.length,o=Array(n),a=0;a<n;a++)o[a]=arguments[a];null==(t=i.get(r))||t.forEach(t=>t(...o))}}}else t[r]=o}),t),{})}}function eun(t,n){var r,i;let o=null!=(r=t.filter(t=>{var r;return t.parentId===n&&(null==(r=t.context)?void 0:r.open)}))?r:[],a=o;for(;a.length;)a=null!=(i=t.filter(t=>{var n;return null==(n=a)?void 0:n.some(n=>{var r;return t.parentId===n.id&&(null==(r=t.context)?void 0:r.open)})}))?i:[],o=o.concat(a);return o}function eur(t){let n=t.activeElement;for(;(null==(r=n)||null==(i=r.shadowRoot)?void 0:i.activeElement)!=null;){var r,i;n=n.shadowRoot.activeElement}return n}function eui(t){t.preventDefault(),t.stopPropagation()}function euo(t){let n=(0,c.useRef)();return eaY(()=>{n.current=t},[t]),n.current}let eua=function(t,n){let{open:r}=t,{enabled:i=!0,role:o="dialog"}=void 0===n?{}:n,a=ea1(),u=ea1(),s={id:a,role:o};return i?"tooltip"===o?{reference:{"aria-describedby":r?a:void 0},floating:s}:{reference:{"aria-expanded":r?"true":"false","aria-haspopup":"alertdialog"===o?"dialog":o,"aria-controls":r?a:void 0,..."listbox"===o&&{role:"combobox"},..."menu"===o&&{id:u}},floating:{...s,..."menu"===o&&{"aria-labelledby":u}}}:{}};function euu(t,n){return null!=n&&("composedPath"in t?t.composedPath().includes(n):null!=t.target&&n.contains(t.target))}let eus=function(t,n){let{open:r,onOpenChange:i,refs:o,events:a,nodeId:u}=t,{enabled:s=!0,escapeKey:l=!0,outsidePointerDown:f=!0,referencePointerDown:d=!1,ancestorScroll:p=!1,bubbles:h=!0}=void 0===n?{}:n,m=ea5(),g=null!=ea4(),y=c.useRef(!1);return c.useEffect(()=>{if(!r||!s)return;function t(t){"Escape"!==t.key||!h&&m&&eun(m.nodesRef.current,u).length>0||(a.emit("dismiss",{preventScroll:!1}),i(!1))}function n(t){var n,r;let s=y.current;if(y.current=!1,s)return;let c="composedPath"in t?t.composedPath()[0]:t.target;if(ea8(c)&&o.floating.current){let l=null!=(r=o.floating.current.ownerDocument.defaultView)?r:window,f=c.scrollWidth>c.clientWidth,d=c.scrollHeight>c.clientHeight,p=d&&t.offsetX>c.clientWidth;if(d&&"rtl"===l.getComputedStyle(c).direction&&(p=t.offsetX<=c.offsetWidth-c.clientWidth),p||f&&t.offsetY>c.clientHeight)return}let v=m&&eun(m.nodesRef.current,u).some(n=>{var r;return euu(t,null==(r=n.context)?void 0:r.refs.floating.current)});euu(t,o.floating.current)||euu(t,o.domReference.current)||v||!h&&m&&eun(m.nodesRef.current,u).length>0||(a.emit("dismiss",!!g&&{preventScroll:!0}),i(!1))}function c(){i(!1)}let d=ea9(o.floating.current);l&&d.addEventListener("keydown",t),f&&d.addEventListener("pointerdown",n);let v=(p?[...ea8(o.reference.current)?eaU(o.reference.current):[],...ea8(o.floating.current)?eaU(o.floating.current):[]]:[]).filter(t=>{var n;return t!==(null==(n=d.defaultView)?void 0:n.visualViewport)});return v.forEach(t=>t.addEventListener("scroll",c,{passive:!0})),()=>{l&&d.removeEventListener("keydown",t),f&&d.removeEventListener("pointerdown",n),v.forEach(t=>t.removeEventListener("scroll",c))}},[l,f,a,m,u,r,i,p,s,h,o,g]),s?{reference:{onPointerDown(){d&&(a.emit("dismiss"),i(!1))}},floating:{onPointerDownCapture(){y.current=!0}}}:{}},euc="ArrowUp",eul="ArrowDown",euf="ArrowLeft",eud="ArrowRight";function eup(t,n,r){return Math.floor(t/n)!==r}function euh(t,n){return n<0||n>=t.current.length}function eum(t,n){let{startingIndex:r=-1,decrement:i=!1,disabledIndices:o,amount:a=1}=void 0===n?{}:n,u=t.current,s=r;do{var c,l;s+=i?-a:a}while(s>=0&&s<=u.length-1&&(o?o.includes(s):null==u[s]||null!=(c=u[s])&&c.hasAttribute("disabled")||(null==(l=u[s])?void 0:l.getAttribute("aria-disabled"))==="true"));return s}function eug(t,n,r){switch(t){case"vertical":return n;case"horizontal":return r;default:return n||r}}function euy(t,n){return eug(n,t===euc||t===eul,t===euf||t===eud)}function euv(t,n,r){return eug(n,t===eul,r?t===euf:t===eud)||"Enter"===t||" "==t||""===t}function eub(t,n){return eum(t,{disabledIndices:n})}function eux(t,n){return eum(t,{decrement:!0,startingIndex:t.current.length,disabledIndices:n})}let eu_=function(t,n){let{open:r,onOpenChange:i,refs:o}=t,{listRef:a,activeIndex:u,onNavigate:s=()=>{},enabled:l=!0,selectedIndex:f=null,allowEscape:d=!1,loop:p=!1,nested:h=!1,rtl:m=!1,virtual:g=!1,focusItemOnOpen:y="auto",focusItemOnHover:v=!0,openOnArrowKeyDown:b=!0,disabledIndices:x,orientation:_="vertical",cols:S=1}=void 0===n?{listRef:{current:[]},activeIndex:null,onNavigate(){}}:n,T=ea4(),w=ea5(),O=euo(r),k=eue(s),I=eue(euo(s)),C=c.useRef(y),M=c.useRef(f??-1),R=c.useRef(null),E=function(t){let n=(0,c.useRef)(t);return eaY(()=>{n.current=t}),n}(x),j=c.useRef(!1),N=c.useRef(-1),[A,P]=c.useState(),L=c.useCallback((t,n)=>{N.current=requestAnimationFrame(()=>{var r,i;g?P(null==(r=t.current[n.current])?void 0:r.id):null==(i=t.current[n.current])||i.focus({preventScroll:!0})})},[g]);function D(t){var n,u,s,c;if(j.current=!0,h&&(n=t.key,eug(_,m?n===eud:n===euf,n===euc))){eui(t),i(!1),(c=o.domReference.current)&&c instanceof ea6(c).HTMLElement&&o.domReference.current.focus();return}let l=M.current,f=eub(a,x),y=eux(a,x);if("Home"===t.key&&(M.current=f,k(M.current)),"End"===t.key&&(M.current=y,k(M.current)),S>1){let v=M.current;if(t.key===euc){if(eui(t),-1===v)M.current=y;else if(M.current=eum(a,{startingIndex:v,amount:S,decrement:!0,disabledIndices:x}),p&&(v-S<f||M.current<0)){let b=v%S,T=y%S,w=y-(T-b);T===b?M.current=y:M.current=T>b?w:w-S}euh(a,M.current)&&(M.current=v),k(M.current)}if(t.key===eul&&(eui(t),-1===v?M.current=f:(M.current=eum(a,{startingIndex:v,amount:S,disabledIndices:x}),p&&v+S>y&&(M.current=eum(a,{startingIndex:v%S-S,amount:S,disabledIndices:x}))),euh(a,M.current)&&(M.current=v),k(M.current)),"both"===_){let O=Math.floor(v/S);t.key===eud&&(eui(t),v%S!=S-1?(M.current=eum(a,{startingIndex:v,disabledIndices:x}),p&&eup(M.current,S,O)&&(M.current=eum(a,{startingIndex:v-v%S-1,disabledIndices:x}))):p&&(M.current=eum(a,{startingIndex:v-v%S-1,disabledIndices:x})),eup(M.current,S,O)&&(M.current=v)),t.key===euf&&(eui(t),v%S!=0?(M.current=eum(a,{startingIndex:v,disabledIndices:x,decrement:!0}),p&&eup(M.current,S,O)&&(M.current=eum(a,{startingIndex:v+(S-v%S),decrement:!0,disabledIndices:x}))):p&&(M.current=eum(a,{startingIndex:v+(S-v%S),decrement:!0,disabledIndices:x})),eup(M.current,S,O)&&(M.current=v)),euh(a,M.current)&&(p&&Math.floor(y/S)===O?M.current=t.key===euf?y:eum(a,{startingIndex:v-v%S-1,disabledIndices:x}):M.current=v),k(M.current);return}}if(euy(t.key,_)){if(eui(t),r&&!g&&eur(t.currentTarget.ownerDocument)===t.currentTarget){M.current=euv(t.key,_,m)?f:y,k(M.current);return}euv(t.key,_,m)?p?M.current=l>=y?d&&l!==a.current.length?-1:f:eum(a,{startingIndex:l,disabledIndices:x}):M.current=Math.min(y,eum(a,{startingIndex:l,disabledIndices:x})):p?M.current=l<=f?d&&-1!==l?a.current.length:y:eum(a,{startingIndex:l,decrement:!0,disabledIndices:x}):M.current=Math.max(f,eum(a,{startingIndex:l,decrement:!0,disabledIndices:x})),euh(a,M.current)?k(null):k(M.current)}}return eaY(()=>{l&&(!O&&r&&C.current&&null!=f&&k(f),O&&!r&&(cancelAnimationFrame(N.current),M.current=-1,I(null)))},[r,O,f,a,L,l,k,I]),eaY(()=>{l&&r&&(null==u?null==f&&(O&&(M.current=-1,L(a,M)),!O&&C.current&&(null!=R.current||!0===C.current&&null==R.current)&&(M.current=null==R.current||euv(R.current,_,m)||h?eub(a,E.current):eux(a,E.current),k(M.current),L(a,M))):euh(a,u)||(M.current=u,L(a,M)))},[r,O,u,f,h,a,k,L,l,d,_,m,g,E]),eaY(()=>{if(l&&!r&&O){var t,n;let i=null==w||null==(t=w.nodesRef.current.find(t=>t.id===T))||null==(n=t.context)?void 0:n.refs.floating.current;i&&!i.contains(eur(ea9(i)))&&i.focus({preventScroll:!0})}},[l,r,O,w,T]),eaY(()=>{R.current=null}),l?{reference:{...g&&r&&null!=u&&{"aria-activedescendant":A},onKeyDown(t){if(j.current=!0,g&&r)return D(t);if((0===t.key.indexOf("Arrow")||"Enter"===t.key||" "===t.key||""===t.key)&&(R.current=t.key),h){var n,o,u;n=t.key,eug(_,m?n===euf:n===eud,n===eul)&&(eui(t),r?(M.current=eub(a,x),k(M.current)):i(!0));return}euy(t.key,_)&&(null!=f&&(M.current=f),eui(t),!r&&b?i(!0):D(t),r&&k(M.current))}},floating:{"aria-orientation":"both"===_?void 0:_,...g&&null!=u&&{"aria-activedescendant":A},onKeyDown:D,onPointerMove(){j.current=!1}},item:{onFocus(t){let{currentTarget:n}=t,r=a.current.indexOf(n);-1!==r&&k(r)},onClick(t){let{currentTarget:n}=t;return n.focus({preventScroll:!0})},...v&&{onMouseMove(t){let{currentTarget:n}=t;if(n){let r=a.current.indexOf(n);-1!==r&&k(r)}},onPointerLeave(){if(!j.current&&(M.current=-1,L(a,M),k(null),!g)){var t;null==(t=o.floating.current)||t.focus({preventScroll:!0})}}}}}:{}},euS=new YZ("suggestion");function euT(t){var n,r,i="";if("string"==typeof t||"number"==typeof t)i+=t;else if("object"==typeof t){if(Array.isArray(t))for(n=0;n<t.length;n++)t[n]&&(r=euT(t[n]))&&(i&&(i+=" "),i+=r);else for(n in t)t[n]&&(i&&(i+=" "),i+=n)}return i}function euw(){for(var t,n,r=0,i="";r<arguments.length;)(t=arguments[r++])&&(n=euT(t))&&(i&&(i+=" "),i+=n);return i}let euO=etG.create({name:"paragraph",priority:1e3,addOptions:()=>({HTMLAttributes:{}}),group:"block",content:"inline*",parseHTML:()=>[{tag:"p"}],renderHTML({HTMLAttributes:t}){return["p",X6(this.options.HTMLAttributes,t),0]},addCommands(){return{setParagraph:()=>({commands:t})=>t.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),euk={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"},euI=()=>(++euI.i).toString();euI.i=0;let euC=t=>{let n=euE(t),r=[];for(let i=0;i<n.length;i++)r.push(euj(n[i]));return{key:euI(),children:r}},euM=(t,n=[])=>({key:euI(),type:t.type,text:"text"in t?t.text:void 0,node:t,children:n}),euR=t=>euM({type:euk.span,text:t,spans:[]}),euE=t=>{let n=t.slice(0);for(let r=0;r<n.length;r++){let i=n[r];if(i.type===euk.listItem||i.type===euk.oListItem){let o=[i];for(;n[r+1]&&n[r+1].type===i.type;)o.push(n[r+1]),n.splice(r,1);i.type===euk.listItem?n[r]={type:euk.list,items:o}:n[r]={type:euk.oList,items:o}}}return n},euj=t=>{if("text"in t)return euM(t,euN(t.spans,t));if("items"in t){let n=[];for(let r=0;r<t.items.length;r++)n.push(euj(t.items[r]));return euM(t,n)}return euM(t)},euN=(t,n,r)=>{if(!t.length)return[euR(n.text)];let i=t.slice(0);i.sort((t,n)=>t.start-n.start||n.end-t.end);let o=[];for(let a=0;a<i.length;a++){let u=i[a],s=r&&r.start||0,c=u.start-s,l=u.end-s,f=n.text.slice(c,l),d=[];for(let p=a;p<i.length;p++){let h=i[p];h!==u&&h.start>=u.start&&h.end<=u.end&&(d.push(h),i.splice(p,1),p--)}0===a&&c>0&&o.push(euR(n.text.slice(0,c)));let m={...u,text:f};o.push(euM(m,euN(d,{...n,text:f},u))),l<n.text.length&&o.push(euR(n.text.slice(l,i[a+1]?i[a+1].start-s:void 0)))}return o},euA=(t,n)=>euP(euC(t).children,n),euP=(t,n)=>{let r=[];for(let i=0;i<t.length;i++){let o=t[i],a=n(o.type,o.node,o.text,euP(o.children,n),o.key);null!=a&&r.push(a)}return r};euk.listItem,euk.oListItem,euk.list,euk.oList;let euL=etG.create({name:"text",group:"inline"}),euD={groupBy:(t,n)=>t.reduce((t,r)=>{let i=n(r),o=(t.get(i)||[]).concat(r);return t.set(i,o)},new Map),sort:t=>[...t].sort((t,n)=>t.start-n.start),mergeOverlap(t){let n=this.groupBy(t,t=>t.type),r=Array.from(n.entries()).map(([t,n])=>(this.sort(n).reduce((t,n)=>{if(!t.length)return[n];let r=t.length-1,i=t[r];return i.end>=n.start?[...t.slice(0,r),{...i,end:n.end}]:[...t,n]},[]),n)).reduce((t,n)=>[...t,...n],[]);return this.sort(r)}},euF={fromPrismic:t=>n=>{switch(n.type){case"hyperlink":return esS.converter.fromPrismic(t)(n);case"em":return esx.converter.fromPrismic(t)(n);case"strong":return eoz.converter.fromPrismic(t)(n);default:return}},toPrismic(t,n,r){let i=esj.find(n=>t.type.name===n.name);if(!i)throw Error(`Invalid mark extension '${t.type.name}'.`);let o=i.richTextNodeTypes;if("hyperlink"!==o)return{type:o,start:n,end:r};let a=i.converter.toPrismic(t);return{type:o,start:n,end:r,data:a}}},euW=euL.extend({name:"text"}),euU={name:euW.name,component:euW,converter:{fromPrismic:t=>function(n,r,i=!1){let o={type:n,text:r.content.text,spans:r.content.spans||[]};return euA([o],function(t,n=!1){return(r,i,o,a)=>{if("span"===r&&o&&o.length)return n?[t.text(o)]:eo4.splitTextToNodes(t,o)(n=>t.text(n));{let u=euF.fromPrismic(t)(i);return u?a.flat().map(t=>t.mark([...t.marks,u].sort((t,n)=>t.type.name.localeCompare(n.type.name)))):a.flat()}}}(t,i))[0]},toPrismic(t,n,r){let i=eoF.children.reduce(t,(t,n)=>{let r=n.type.name===eo4.name?eo4.converter.toPrismic(n):n.textContent,i=r?t.text+r:t.text,o=t.text.length,a=i.length,u=n.marks.length?eoF.marks.map(n,t=>euF.toPrismic(t,o,a)):void 0;return{...t,text:i,spans:u?[...t.spans,...u]:t.spans}},{text:"",spans:[]});return{type:n,content:{text:i.text,spans:[...euD.mergeOverlap(i.spans)].sort((t,n)=>t.type.localeCompare(n.type))},...r}}}};var euz,euB=((euz=euB||{}).LeftToRight="ltr",euz.RightToLeft="rtl",euz);let euV=Vl.RichTextNodeType.rtl,eu$=eeg.create({name:"textDirection",addOptions:()=>({supportedExtensionNames:[]}),addGlobalAttributes(){return[{types:this.options.supportedExtensionNames,attributes:{dir:{default:"ltr",parseHTML:t=>t.getAttribute("dir"),renderHTML:t=>({dir:"ltr"===t.dir?"ltr":"rtl"})}}}]},addCommands(){return{setDirection:t=>({commands:n})=>"rtl"===t?n.setRightToLeft():n.setLeftToRight(),toggleDirection:t=>({commands:n})=>n.setDirection("rtl"===t?"ltr":"rtl"),setRightToLeft:()=>({commands:t})=>this.options.supportedExtensionNames.every(n=>t.updateAttributes(n,{dir:"rtl"})),setLeftToRight:()=>({commands:t})=>this.options.supportedExtensionNames.every(n=>t.resetAttributes(n,"dir"))}},addKeyboardShortcuts(){return{"Mod-Shift-r":()=>this.editor.commands.setRightToLeft(),"Mod-Shift-l":()=>this.editor.commands.setLeftToRight()}}}),euq={parseNodeAttrsDirection:t=>"rtl"===t.dir?"rtl":"ltr",fromPrismic(t){let n="rtl"===t.direction?"rtl":"ltr";return{dir:n}},toPrismic(t){return{direction:this.parseNodeAttrsDirection(t.attrs)}}},euK=euO.extend({name:"paragraph",parseHTML:()=>[{tag:"p"}],renderHTML({HTMLAttributes:t}){return["p",X6(this.options.HTMLAttributes,t),0]}}),euH=new eoj([Vl.RichTextNodeType.paragraph],euK.name,euK,{fromPrismic:t=>function(n){var r;let i=euU.converter.fromPrismic(t)(euK.name,n);return null==(r=t.nodes[euK.name])?void 0:r.create(euq.fromPrismic(n),i)},toPrismic:t=>euU.converter.toPrismic(t,Vl.RichTextNodeType.paragraph,euq.toPrismic(t))},"Type '/' for commands"),euG=euH,euZ=["ArrowDown","ArrowUp","End","Home"],euY=["Enter"],euJ=["Escape",...euZ,...euY],euQ=eeg.create({name:"slash-commands",addOptions:()=>({nodeTypes:[]}),addProseMirrorPlugins(){let t=esW(esA,this.options.nodeTypes);return t.length>1?[function({pluginKey:t=euS,editor:n,char:r="@",allowSpaces:i=!1,allowedPrefixes:o=[" "],startOfLine:a=!1,decorationTag:u="span",decorationClass:s="suggestion",command:c=()=>null,items:l=()=>[],render:f=()=>({}),allow:d=()=>!0}){let p,h=null==f?void 0:f(),m=new YK({key:t,view(){return{update:async(t,r)=>{var i,o,a,u,s,f,d;let m=null===(i=this.key)||void 0===i?void 0:i.getState(r),g=null===(o=this.key)||void 0===o?void 0:o.getState(t.state),y=m.active&&g.active&&m.range.from!==g.range.from,v=!m.active&&g.active,b=m.active&&!g.active,x=!v&&!b&&m.query!==g.query,_=v||y,S=x&&!y,T=b||y;if(!_&&!S&&!T)return;let w=T&&!_?m:g,O=t.dom.querySelector(`[data-decoration-id="${w.decorationId}"]`);p={editor:n,range:w.range,query:w.query,text:w.text,items:[],command(t){c({editor:n,range:w.range,props:t})},decorationNode:O,clientRect:O?()=>{var r;let{decorationId:i}=null===(r=this.key)||void 0===r?void 0:r.getState(n.state),o=t.dom.querySelector(`[data-decoration-id="${i}"]`);return(null==o?void 0:o.getBoundingClientRect())||null}:null},_&&(null===(a=null==h?void 0:h.onBeforeStart)||void 0===a||a.call(h,p)),S&&(null===(u=null==h?void 0:h.onBeforeUpdate)||void 0===u||u.call(h,p)),(S||_)&&(p.items=await l({editor:n,query:w.query})),T&&(null===(s=null==h?void 0:h.onExit)||void 0===s||s.call(h,p)),S&&(null===(f=null==h?void 0:h.onUpdate)||void 0===f||f.call(h,p)),_&&(null===(d=null==h?void 0:h.onStart)||void 0===d||d.call(h,p))},destroy(){var t;p&&(null===(t=null==h?void 0:h.onExit)||void 0===t||t.call(h,p))}}},state:{init:()=>({active:!1,range:{from:0,to:0},query:null,text:null,composing:!1}),apply(t,u,s,c){let{isEditable:l}=n,{composing:f}=n.view,{selection:p}=t,{empty:h,from:m}=p,g={...u};if(g.composing=f,l&&(h||n.view.composing)){(m<u.range.from||m>u.range.to)&&!f&&!u.composing&&(g.active=!1);let y=function(t){var n,r;let{char:i,allowSpaces:o,allowedPrefixes:a,startOfLine:u,$position:s}=t,c=i.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"),l=RegExp(`\\s${c}$`),f=u?"^":"",d=o?RegExp(`${f}${c}.*?(?=\\s${c}|$)`,"gm"):RegExp(`${f}(?:^)?${c}[^\\s${c}]*`,"gm"),p=(null===(n=s.nodeBefore)||void 0===n?void 0:n.isText)&&s.nodeBefore.text;if(!p)return null;let h=s.pos-p.length,m=Array.from(p.matchAll(d)).pop();if(!m||void 0===m.input||void 0===m.index)return null;let g=m.input.slice(Math.max(0,m.index-1),m.index),y=RegExp(`^[${null==a?void 0:a.join("")}\0]?$`).test(g);if(null!==a&&!y)return null;let v=h+m.index,b=v+m[0].length;return o&&l.test(p.slice(b-1,b+1))&&(m[0]+=" ",b+=1),v<s.pos&&b>=s.pos?{range:{from:v,to:b},query:m[0].slice(i.length),text:m[0]}:null}({char:r,allowSpaces:i,allowedPrefixes:o,startOfLine:a,$position:p.$from}),v=`id_${Math.floor(4294967295*Math.random())}`;y&&d({editor:n,state:c,range:y.range})?(g.active=!0,g.decorationId=u.decorationId?u.decorationId:v,g.range=y.range,g.query=y.query,g.text=y.text):g.active=!1}else g.active=!1;return g.active||(g.decorationId=null,g.range={from:0,to:0},g.query=null,g.text=null),g}},props:{handleKeyDown(t,n){var r;let{active:i,range:o}=m.getState(t.state);return i&&(null===(r=null==h?void 0:h.onKeyDown)||void 0===r?void 0:r.call(h,{view:t,event:n,range:o}))||!1},decorations(t){let{active:n,range:r,decorationId:i}=m.getState(t);return n?Q9.create(t.doc,[Q3.inline(r.from,r.to,{nodeName:u,class:s,"data-decoration-id":i})]):null}}});return m}({allowSpaces:!0,char:"/",editor:this.editor,startOfLine:!0,allow({state:t}){let n=t.selection.$from;return n.parent.type.name===euG.name&&1===n.depth},command({editor:t,props:n,range:r}){n.runCommands(t,{deleteRange:r})},items({query:n}){let r=n.toLocaleLowerCase().trim();return t.filter(t=>{var n,i;return(null==(n=t.shortText)?void 0:n.toLocaleLowerCase().includes(r))||(null==(i=t.text)?void 0:i.toLocaleLowerCase().includes(r))})},render(){let t;return{onStart(n){t=new erz(euX,{editor:n.editor,props:n}),document.body.appendChild(t.element)},onUpdate(n){null==t||t.updateProps(n)},onKeyDown({event:n}){var r;return Boolean(euJ.includes(n.key)&&(null==(r=null==t?void 0:t.ref)?void 0:r.handleKeyDown(n)))},onExit(){null==t||t.destroy(),null==t||t.element.remove()}}}})]:[]}}),euX=(0,c.forwardRef)(function({command:t,decorationNode:n,editor:r,items:i},o){var a,u,s,l,p;let[h,m]=(0,c.useState)(!0),g=parseFloat(f.TV.space[0]),{context:y,floating:v,reference:b,strategy:x,x:_,y:T}=function(t){let{open:n=!1,onOpenChange:r,whileElementsMounted:i,placement:o,middleware:a,strategy:u,nodeId:s}=void 0===t?{}:t,[l,f]=c.useState(null),d=ea5(),p=c.useRef(null),h=c.useRef({}),m=c.useState(()=>(function(){let t=new Map;return{emit(n,r){var i;null==(i=t.get(n))||i.forEach(t=>t(r))},on(n,r){t.set(n,[...t.get(n)||[],r])},off(n,r){t.set(n,(t.get(n)||[]).filter(t=>t!==r))}}})())[0],g=function(t){void 0===t&&(t={});let{placement:n="bottom",strategy:r="absolute",middleware:i=[],platform:o,whileElementsMounted:a,open:u}=t,[s,l]=c.useState({x:null,y:null,strategy:r,placement:n,middlewareData:{},isPositioned:!1}),[f,d]=c.useState(i);eaG(f,i)||d(i);let p=c.useRef(null),h=c.useRef(null),m=c.useRef(s),g=eaZ(a),y=eaZ(o),[v,b]=c.useState(null),[x,_]=c.useState(null),T=c.useCallback(t=>{p.current!==t&&(p.current=t,b(t))},[]),w=c.useCallback(t=>{h.current!==t&&(h.current=t,_(t))},[]),O=c.useCallback(()=>{if(!p.current||!h.current)return;let t={placement:n,strategy:r,middleware:f};y.current&&(t.platform=y.current),eaK(p.current,h.current,t).then(t=>{let n={...t,isPositioned:!0};k.current&&!eaG(m.current,n)&&(m.current=n,S.flushSync(()=>{l(n)}))})},[f,n,r,y]);eaH(()=>{!1===u&&m.current.isPositioned&&(m.current.isPositioned=!1,l(t=>({...t,isPositioned:!1})))},[u]);let k=c.useRef(!1);eaH(()=>(k.current=!0,()=>{k.current=!1}),[]),eaH(()=>{if(v&&x){if(g.current)return g.current(v,x,O);O()}},[v,x,O,g]);let I=c.useMemo(()=>({reference:p,floating:h,setReference:T,setFloating:w}),[T,w]),C=c.useMemo(()=>({reference:v,floating:x}),[v,x]);return c.useMemo(()=>({...s,update:O,refs:I,elements:C,reference:T,floating:w}),[s,O,I,C,T,w])}({placement:o,middleware:a,strategy:u,whileElementsMounted:i}),y=eue(r),v=c.useMemo(()=>({...g.refs,domReference:p}),[g.refs]),b=c.useMemo(()=>({...g,refs:v,dataRef:h,nodeId:s,events:m,open:n,onOpenChange:y,_:{domReference:l}}),[g,s,m,n,y,v,l]);eaY(()=>{let t=null==d?void 0:d.nodesRef.current.find(t=>t.id===s);t&&(t.context=b)});let{reference:x}=g,_=c.useCallback(t=>{(ea8(t)||null===t)&&(b.refs.domReference.current=t,f(t)),x(t)},[x,b.refs]);return c.useMemo(()=>({...g,context:b,refs:v,reference:_}),[g,v,b,_])}({middleware:[(void 0===(a=g)&&(a=0),{name:"offset",options:a,async fn(t){let{x:n,y:r}=t,i=await ead(t,a);return{x:n+i.x,y:r+i.y,data:i}}}),(void 0===u&&(u={}),{name:"flip",options:u,async fn(t){var n,r,i,o;let{placement:a,middlewareData:s,rects:c,initialPlacement:l,platform:f,elements:d}=t,{mainAxis:p=!0,crossAxis:h=!0,fallbackPlacements:m,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:y="none",flipAlignment:v=!0,...b}=u,x=eo7(a),_=eo7(l)===l,S=await (null==f.isRTL?void 0:f.isRTL(d.floating)),T=m||(_||!v?[eac(l)]:function(t){let n=eac(t);return[eaf(t),n,eaf(n)]}(l));m||"none"===y||T.push(...function(t,n,r,i){let o=eo6(t),a=function(t,n,r){let i=["left","right"],o=["right","left"];switch(t){case"top":case"bottom":return r?n?o:i:n?i:o;case"left":case"right":return n?["top","bottom"]:["bottom","top"];default:return[]}}(eo7(t),"start"===r,i);return o&&(a=a.map(t=>t+"-"+o),n&&(a=a.concat(a.map(eaf)))),a}(l,v,y,S));let w=await eai(t,b),O=[],k=(null==(n=s.flip)?void 0:n.overflows)||[];if(p&&O.push(w[x]),h){let{main:I,cross:C}=function(t,n,r){void 0===r&&(r=!1);let i=eo6(t),o=eae(t),a=eo8(o),u="x"===o?i===(r?"end":"start")?"right":"left":"start"===i?"bottom":"top";return n.reference[a]>n.floating[a]&&(u=eac(u)),{main:u,cross:eac(u)}}(a,c,S);O.push(w[I],w[C])}if(k=[...k,{placement:a,overflows:O}],!O.every(t=>t<=0)){let M=((null==(r=s.flip)?void 0:r.index)||0)+1,R=[l,...T][M];if(R)return{data:{index:M,overflows:k},reset:{placement:R}};let E=null==(i=k.filter(t=>t.overflows[0]<=0).sort((t,n)=>t.overflows[1]-n.overflows[1])[0])?void 0:i.placement;if(!E)switch(g){case"bestFit":{let j=null==(o=k.map(t=>[t.placement,t.overflows.filter(t=>t>0).reduce((t,n)=>t+n,0)]).sort((t,n)=>t[1]-n[1])[0])?void 0:o[0];j&&(E=j);break}case"initialPlacement":E=l}if(a!==E)return{reset:{placement:E}}}return{}}}),(l={limiter:(void 0===s&&(s={}),{options:s,fn(t){let{x:n,y:r,placement:i,rects:o,middlewareData:a}=t,{offset:u=0,mainAxis:c=!0,crossAxis:l=!0}=s,f={x:n,y:r},d=eae(i),p=eap(d),h=f[d],m=f[p],g="function"==typeof u?u(t):u,y="number"==typeof g?{mainAxis:g,crossAxis:0}:{mainAxis:0,crossAxis:0,...g};if(c){let v="y"===d?"height":"width",b=o.reference[d]-o.floating[v]+y.mainAxis,x=o.reference[d]+o.reference[v]-y.mainAxis;h<b?h=b:h>x&&(h=x)}if(l){var _,S;let T="y"===d?"width":"height",w=["top","left"].includes(eo7(i)),O=o.reference[p]-o.floating[T]+(w&&(null==(_=a.offset)?void 0:_[p])||0)+(w?0:y.crossAxis),k=o.reference[p]+o.reference[T]+(w?0:(null==(S=a.offset)?void 0:S[p])||0)-(w?y.crossAxis:0);m<O?m=O:m>k&&(m=k)}return{[d]:h,[p]:m}}})},{name:"shift",options:l,async fn(t){let{x:n,y:r,placement:i}=t,{mainAxis:o=!0,crossAxis:a=!1,limiter:u={fn(t){let{x:n,y:r}=t;return{x:n,y:r}}},...s}=l,c={x:n,y:r},f=await eai(t,s),d=eae(eo7(i)),p=eap(d),h=c[d],m=c[p];if(o){let g=h+f["y"===d?"top":"left"],y=h-f["y"===d?"bottom":"right"];h=eau(g,h,y)}if(a){let v=m+f["y"===p?"top":"left"],b=m-f["y"===p?"bottom":"right"];m=eau(v,m,b)}let x=u.fn({...t,[d]:h,[p]:m});return{...x,data:{x:x.x-n,y:x.y-r}}}})],onOpenChange:m,open:h,placement:"top-start",strategy:"fixed",whileElementsMounted:eaq});(0,c.useLayoutEffect)(()=>{b(n)},[b,n]),(0,c.useEffect)(()=>{let t,n=()=>{t=window.setTimeout(()=>{m(!0)})},i=()=>{m(!1)};return r.on("focus",n).on("blur",i),()=>{r.off("focus",n).off("blur",i),clearTimeout(t)}},[r]);let[w,O]=(0,c.useState)(0),k=(0,c.useRef)([]);(0,d.pQ)(i,()=>{O(0),k.current=[]});let{getFloatingProps:I,getItemProps:C,getReferenceProps:M}=(p=[eus(y,{outsidePointerDown:!1}),eu_(y,{activeIndex:w,listRef:k,onNavigate(t){O(n=>t??n)},openOnArrowKeyDown:!1,virtual:!0}),eua(y,{role:"menu"})],{getReferenceProps:t=>eut(t,p,"reference"),getFloatingProps:t=>eut(t,p,"floating"),getItemProps:t=>eut(t,p,"item")}),E=M().onKeyDown;(0,c.useImperativeHandle)(o,()=>({handleKeyDown(n){if(!h)return!1;if(euZ.includes(n.key)&&E(n),euY.includes(n.key)){let r=i[w];void 0!==r&&t(r)}return!0}}),[w,t,i,E,h]);let j=(0,c.useId)();return h?R.jsxs("div",{...I(),className:f._s.content,ref:v,style:{top:parseFloat(f.TV.space[0]),left:parseFloat(f.TV.space[0]),minWidth:256,position:x,transform:null!==_&&null!==T?`translate3d(${Math.round(_)}px, ${Math.round(T)}px, 0)`:"translate3d(0, -200%, 0)"},children:[i.map((n,r)=>(0,c.createElement)(eu0,{...C({onClick(){t(n)},onPointerDown(t){t.preventDefault()}}),"data-highlighted":r===w?"":void 0,id:`${j}[${r}]`,key:n.nodeType,ref(t){k.current[r]=t},shortcut:`/${n.shortText??""}`,startIcon:n.icon},n.text)),0===i.length?R.jsx(eu0,{...C({onPointerDown(t){t.preventDefault()}}),disabled:!0,id:`${j}[0]`,ref(t){k.current[0]=t},children:"No results"}):null]}):null}),eu0=(0,c.forwardRef)(function({children:t,disabled:n,shortcut:r,startIcon:i,...o},a){return R.jsxs("div",{...o,...n?{"aria-disabled":!0,"data-disabled":!0}:{},className:f._s.item,ref:a,role:"menuitem",children:[(0,c.isValidElement)(i)?(0,c.cloneElement)(i,{className:euw(i.props.className,f._s.itemStartIcon)}):null,R.jsx(f.xv,{className:euw(f._s.itemText,f._s.itemTextColor.grey),component:"span",children:t}),r?R.jsx(f.xv,{className:f._s.itemShortcut,color:"inherit",component:"span",variant:"inherit",children:r}):null]})}),eu1=eoq.extend({name:"bulletList",parseHTML:()=>[{tag:"ul"}],renderHTML({HTMLAttributes:t}){return["ul",X6(this.options.HTMLAttributes,t),0]}}).configure({itemTypeName:"listItem"}),eu2=new eoP([Vl.RichTextNodeType.list],eu1.name,eu1,{fromPrismic:t=>function(n){var r;let i=eoZ.converter.fromPrismic(t)(n);if(i)return null==(r=t.nodes[eu1.name])?void 0:r.create(euq.fromPrismic(n),i)},toPrismic:t=>eoF.children.map(t,t=>eoZ.converter.toPrismic(t,Vl.RichTextNodeType.list).filter(h.$)).flat()}),eu3=eu2,eu4=/^```([a-z]+)?[\s\n]$/,eu5=/^~~~([a-z]+)?[\s\n]$/,eu9=etG.create({name:"codeBlock",addOptions:()=>({languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,HTMLAttributes:{}}),content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:null,parseHTML:t=>{var n;let{languageClassPrefix:r}=this.options,i=[...(null===(n=t.firstElementChild)||void 0===n?void 0:n.classList)||[]].filter(t=>t.startsWith(r)).map(t=>t.replace(r,""))[0];return i||null},rendered:!1}}},parseHTML:()=>[{tag:"pre",preserveWhitespace:"full"}],renderHTML({node:t,HTMLAttributes:n}){return["pre",X6(this.options.HTMLAttributes,n),["code",{class:t.attrs.language?this.options.languageClassPrefix+t.attrs.language:null},0]]},addCommands(){return{setCodeBlock:t=>({commands:n})=>n.setNode(this.name,t),toggleCodeBlock:t=>({commands:n})=>n.toggleNode(this.name,"paragraph",t)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{let{empty:t,$anchor:n}=this.editor.state.selection,r=1===n.pos;return!!t&&n.parent.type.name===this.name&&(!!r||!n.parent.textContent.length)&&this.editor.commands.clearNodes()},Enter:({editor:t})=>{if(!this.options.exitOnTripleEnter)return!1;let{state:n}=t,{selection:r}=n,{$from:i,empty:o}=r;if(!o||i.parent.type!==this.type)return!1;let a=i.parentOffset===i.parent.nodeSize-2,u=i.parent.textContent.endsWith(`
|
|
95
|
-
|
|
96
|
-
`);return!!a&&!!u&&t.chain().command(({tr:t})=>(t.delete(i.pos-2,i.pos),!0)).exitCode().run()},ArrowDown:({editor:t})=>{if(!this.options.exitOnArrowDown)return!1;let{state:n}=t,{selection:r,doc:i}=n,{$from:o,empty:a}=r;if(!a||o.parent.type!==this.type||o.parentOffset!==o.parent.nodeSize-2)return!1;let u=o.after();return!(void 0===u||i.nodeAt(u))&&t.commands.exitCode()}}},addInputRules(){return[etq({find:eu4,type:this.type,getAttributes:t=>({language:t[1]})}),etq({find:eu5,type:this.type,getAttributes:t=>({language:t[1]})})]},addProseMirrorPlugins(){return[new YK({key:new YZ("codeBlockVSCodeHandler"),props:{handlePaste:(t,n)=>{if(!n.clipboardData||this.editor.isActive(this.type.name))return!1;let r=n.clipboardData.getData("text/plain"),i=n.clipboardData.getData("vscode-editor-data"),o=i?JSON.parse(i):void 0,a=null==o?void 0:o.mode;if(!r||!a)return!1;let{tr:u}=t.state;return u.replaceSelectionWith(this.type.create({language:a})),u.setSelection(Yj.near(u.doc.resolve(Math.max(0,u.selection.from-2)))),u.insertText(r.replace(/\r\n?/g,`
|
|
97
|
-
`)),u.setMeta("paste",!0),t.dispatch(u),!0}}})]}}),eu6=eu9.extend({name:"preformatted",addAttributes(){return{language:{default:null,parseHTML:t=>{var n;let{languageClassPrefix:r}=this.options,i=[...(null==(n=t.firstElementChild)?void 0:n.classList)||[]].filter(t=>t.startsWith(r)).map(t=>t.replace(r,""))[0];return i||null},renderHTML:t=>t.language?{class:this.options.languageClassPrefix+t.language}:null}}},parseHTML:()=>[{tag:"pre",preserveWhitespace:"full"}],renderHTML({HTMLAttributes:t}){return["pre",X6(this.options.HTMLAttributes),["code",t,0]]}}).configure({exitOnTripleEnter:!1}),eu8=new eoj([Vl.RichTextNodeType.preformatted],eu6.name,eu6,{fromPrismic:t=>function(n){var r;let i=euU.converter.fromPrismic(t)(eu6.name,n,!0);return null==(r=t.nodes[eu6.name])?void 0:r.create(euq.fromPrismic(n),i)},toPrismic:t=>euU.converter.toPrismic(t,Vl.RichTextNodeType.preformatted,euq.toPrismic(t))},"",!0);function eu7(t){let{editor:n,getPos:r,node:i}=t,[o,a]=(0,c.useState)(!1);return(0,c.useEffect)(()=>{function t(){let{from:t,to:o}=n.state.selection,u=r(),s=r()+i.nodeSize;a(t<=u&&o>=s)}function o(){a(!1)}return n.on("blur",o),n.on("selectionUpdate",t),()=>{n.off("blur",o),n.off("selectionUpdate",t)}},[n,r,i.nodeSize]),{selected:o}}function ese(t){let n=(0,c.useRef)(null),r=(0,c.useRef)(null),{onKeyDown:i,url:o,urlChanged:a,onContentChange:u,debouncedUrl:s,content:l}=function(t,n,r){let{node:i}=t,o=i.attrs.content,a=(0,d.R9)(t.updateAttributes),u=(0,d.$P)({initialState:(null==o?void 0:o.embed_url)??"",startTransition:c.startTransition});function s(t){a({content:t})}let{onKeyDown:l}=function(t,n,r,i){let{editor:o,getPos:a,node:u}=t,[s,l]=(0,c.useState)(!0);return(0,c.useEffect)(()=>{s&&t.editor.isFocused&&er$(()=>{var t;return null==(t=r.current)?void 0:t.focus()})},[r,s,t.editor.isFocused]),{containerRef:i,inputRef:r,onKeyDown:function(t){let r=a(),i=a()+u.nodeSize;"Enter"===t.code&&(l(!1),o.chain().insertContentAt(i,{type:"paragraph"}).focus(i+1).run()),"Backspace"===t.code&&""===n&&o.chain().deleteRange({from:r,to:i}).focus(i+1).run(),"ArrowUp"===t.code&&(l(!1),o.chain().focus(r-1).run()),"ArrowDown"===t.code&&(l(!1),o.chain().focus(i+1).run())}}}(t,u.value,n,r);return{inputRef:n,containerRef:r,onKeyDown:l,url:u.value,urlChanged:function(t){u.set(t),(0,y.ju)(t)||s(void 0)},onContentChange:s,debouncedUrl:u.debouncedValue,content:t.node.attrs.content}}(t,n,r),{selected:p}=eu7(t);return R.jsx(erU,{className:"custom-embed",children:R.jsx("div",{contentEditable:"false",suppressContentEditableWarning:!0,children:R.jsxs(f.xu,{flexDirection:"column",children:[R.jsxs(f.xu,{flexGrow:1,alignItems:"center",children:[R.jsx(f.I5,{size:"small",name:"cloud",color:"grey11"}),R.jsx(f.xu,{flexGrow:1,flexDirection:"column",ref:r,children:R.jsx(f.oi,{id:"id",ref:n,value:o,variant:(0,y.ju)(o)?"link":"normal",placeholder:"Paste your link here",onValueChange:a,onKeyDown:i})})]}),(0,y.ju)(o)&&R.jsx(erq,{selected:p,debouncedUrl:s,onContentChange:u,content:l})]})})})}let est=etG.create({name:"embed",group:"block",atom:!0,content:"block*",marks:"",addAttributes:()=>({content:{default:void 0}}),addCommands(){return{setEmbed:()=>({tr:t,dispatch:n})=>{let r=this.type.create();return n&&t.replaceSelectionWith(r),!0}}},parseHTML:()=>[{tag:"embed"}],renderHTML:()=>["embed"],addNodeView:()=>erV(ese)}),esn=new class{constructor(t,n,r,i){k(this,"extType","node"),k(this,"nodeType","embed"),this.richTextNodeTypes=t,this.name=n,this.component=r,this.converter=i}}([Vl.RichTextNodeType.embed],est.name,est,{fromPrismic:t=>function(n){var r;return null==(r=t.nodes[est.name])?void 0:r.create({content:n.data})},toPrismic:t=>void 0===t.attrs.content?{type:"embed",data:{type:"embed",embed_url:"",__TYPE__:"EmbedContent",all:[]}}:{type:"embed",data:{...t.attrs.content}}}),esr=etG.create({name:"heading",addOptions:()=>({levels:[1,2,3,4,5,6],HTMLAttributes:{}}),content:"inline*",group:"block",defining:!0,addAttributes:()=>({level:{default:1,rendered:!1}}),parseHTML(){return this.options.levels.map(t=>({tag:`h${t}`,attrs:{level:t}}))},renderHTML({node:t,HTMLAttributes:n}){return[`h${this.options.levels.includes(t.attrs.level)?t.attrs.level:this.options.levels[0]}`,X6(this.options.HTMLAttributes,n),0]},addCommands(){return{setHeading:t=>({commands:n})=>!!this.options.levels.includes(t.level)&&n.setNode(this.name,t),toggleHeading:t=>({commands:n})=>!!this.options.levels.includes(t.level)&&n.toggleNode(this.name,"paragraph",t)}},addKeyboardShortcuts(){return this.options.levels.reduce((t,n)=>({...t,[`Mod-Alt-${n}`]:()=>this.editor.commands.toggleHeading({level:n})}),{})},addInputRules(){return this.options.levels.map(t=>etq({find:RegExp(`^(#{1,${t}})\\s$`),type:this.type,getAttributes:{level:t}}))}}),esi="heading",eso={byLevel(t){switch(t){case 1:return Vl.RichTextNodeType.heading1;case 2:return Vl.RichTextNodeType.heading2;case 3:return Vl.RichTextNodeType.heading3;case 4:return Vl.RichTextNodeType.heading4;case 5:return Vl.RichTextNodeType.heading5;case 6:return Vl.RichTextNodeType.heading6}},default(t){return{fullName:this.byLevel(t),level:t}},fromPrismic(t,n=[1,2,3,4,5,6]){let r=RegExp(`^heading([${n.join(",")}]){1}$`),i=t.match(r);if(!i||!i[1])return;let o=parseInt(i[1]);return{fullName:eso.byLevel(o),level:o}},fromProsemirror(t,n){let r=t.level;if(n.includes(r))return{fullName:eso.byLevel(r),level:r}}},esa=t=>esr.extend({name:esi,addAttributes:()=>({level:{default:t[0]},label:{default:null}}),addOptions:()=>({levels:[...t],HTMLAttributes:{}}),parseHTML(){return this.options.levels.map(t=>({tag:`h${t}`}))},renderHTML({node:t,HTMLAttributes:n}){let r=t.attrs.level,i={...t.attrs.label?{label:t.attrs.label}:{}};return[`h${r}`,X6(this.options.HTMLAttributes,n,i),0]}}),esu=t=>{let n=t[0]??1;return{fromPrismic:r=>function(i){var o;let a=euU.converter.fromPrismic(r)(esi,i),u=eso.fromPrismic(i.type,t)||eso.default(n);return null==(o=r.nodes[esi])?void 0:o.create({level:u.level,...euq.fromPrismic(i)},a)},toPrismic(r){let{fullName:i}=eso.fromProsemirror(r.attrs,t)||eso.default(n);return euU.converter.toPrismic(r,i,euq.toPrismic(r))}}},ess={name:esi,build(t){var n;let r=t?t.size?Array.from(t.values()).reduce((t,n)=>{let r=eso.fromPrismic(n);return r?[...t,r.level]:t},[]).sort((t,n)=>t-n):[]:[1,2,3,4,5,6];if(!r)return;let i=r.map(t=>eso.byLevel(t));return new eoA(i,esa(r),r,esu(r),t=>{let n=eso.fromProsemirror(t,r);return n&&`Heading ${n.level}`})}};function esc(t){let{node:n}=t,r=n.attrs.content,{selected:i}=eu7(t),o={width:null==r?void 0:r.width,height:null==r?void 0:r.height,name:er2},{onMediaSelected:a,onCropperDialogClose:u,isUpdating:s,updateContent:l,onClear:d}=function(t){let{content:n,thumbnail:r,imageViewProps:{getPos:i,updateAttributes:o,editor:a,node:u}}=t,[s,l]=(0,c.useTransition)();function f(t){l(()=>o({content:t}))}return{onMediaSelected:function(t){let r=eiL(t),o=i()+u.nodeSize;f({__TYPE__:"ImageContent",...n,...r}),a.chain().focus(o+1).run()},onCropperDialogClose:function({croppedImages:t}){if(!n)return;let i=t[r.name];if(!i)return;let o=eiM({content:n,thumbnail:r.name,croppedImage:i});o!==n&&f(o)},isUpdating:s,updateContent:f,onClear:function(){let t=i(),n=i()+u.nodeSize;a.chain().deleteRange({from:t,to:n}).focus(n).run()}}}({content:r,thumbnail:o,imageViewProps:t}),p=(null==r?void 0:r.width)===0&&(null==r?void 0:r.height)===0,h=r&&!p?[`${r.width}x${r.height}px`]:[],m=(null==r?void 0:r.alt)??"",g={thumbnail:o,contentView:r,labels:er3(o,r,r)};return R.jsx(erU,{className:"custom-image",children:R.jsx("div",{contentEditable:"false",suppressContentEditableWarning:!0,children:R.jsx(eiP,{content:r,selected:i,fieldLabel:"Feature image",imageLabel:h,initialImages:[g],readOnly:!1,onMediaSelected:a,onCropperDialogClose:u,onClear:d,children:R.jsx(c.Suspense,{fallback:esl,children:null!=r&&r.url?R.jsxs(f.aY,{children:[R.jsx(f.hM,{children:R.jsx(f.xu,{flexDirection:"column",alignItems:"center",position:"relative",height:400,children:R.jsx(f.xu,{justifyContent:"center",flexGrow:1,maxHeight:"100%",maxWidth:"100%",children:R.jsx(f.kg,{src:er9(r.url),alt:m,sizing:"contain"})})})}),R.jsx(eiI,{onValueChange(t){l({...r,alt:t})},altText:m,readOnly:!r,selected:i})]}):R.jsx(eik,{isUpdating:s,readOnly:!1,onMediaSelected:a})})})})})}let esl=R.jsx("div",{style:{height:468}}),esf=etG.create({name:"image",group:"block",atom:!0,addAttributes:()=>({content:{default:void 0}}),addCommands(){return{setImage:()=>t=>{let{dispatch:n,tr:r}=t,i=this.type.create();return n&&r.replaceSelectionWith(i),!0}}},parseHTML:()=>[{tag:"image"}],renderHTML:({HTMLAttributes:t})=>["image",X6(t)],addNodeView:()=>erV(esc)}),esd=new class{constructor(t,n,r,i){k(this,"extType","node"),k(this,"nodeType","image"),this.richTextNodeTypes=t,this.name=n,this.component=r,this.converter=i}}([Vl.RichTextNodeType.image],esf.name,esf,{fromPrismic:t=>function(n){var r;return null==(r=t.nodes[esf.name])?void 0:r.create({content:n.data})},toPrismic(t){if(void 0!==t.attrs.content)return{type:"image",data:{...t.attrs.content}}}}),esp=/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))$/,esh=/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))/g,esm=/(?:^|\s)((?:_)((?:[^_]+))(?:_))$/,esg=/(?:^|\s)((?:_)((?:[^_]+))(?:_))/g,esy=etH.create({name:"italic",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"em"},{tag:"i",getAttrs:t=>"normal"!==t.style.fontStyle&&null},{style:"font-style=italic"}],renderHTML({HTMLAttributes:t}){return["em",X6(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[et$({find:esp,type:this.type}),et$({find:esm,type:this.type})]},addPasteRules(){return[etY({find:esh,type:this.type}),etY({find:esg,type:this.type})]}}),esv=esy.extend({name:"em"}),esb=new class{constructor(t,n,r){k(this,"extType",eoR.Mark),k(this,"richTextNodeTypes",Vl.RichTextNodeType.em),this.name=t,this.component=n,this.converter=r}}(esv.name,esv,{fromPrismic:t=>function(){var n;return null==(n=t.marks[esv.name])?void 0:n.create()},toPrismic(){}}),esx=esb,es_=etH.create({name:"hyperlink",priority:1e3,keepOnSplit:!1,inclusive:!1,addOptions:()=>({openOnClick:!1,linkOnPaste:!0,autolink:!0,protocols:[],htmlAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null,id:""},validate:void 0}),addAttributes:()=>({href:{default:""},id:{default:""},target:{default:"_blank"},rel:{default:"noopener noreferrer nofollow"},class:{default:null},media:{default:null}}),parseHTML:()=>[{tag:'a[href]:not([href *= "javascript:" i])'}],renderHTML({HTMLAttributes:t}){return["a",X6(this.options.htmlAttributes,t),0]},addCommands(){return{setWebLink:t=>({chain:n})=>n().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMark(this.name,t).setMeta("preventAutolink",!0).run(),setDocumentLink:t=>({chain:n})=>n().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMark(this.name,t).setMeta("preventAutolink",!0).run(),setMediaLink:t=>({chain:n})=>{let r=esT(ei7({media:t.media}).value);return n().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMark(this.name,{media:r}).setMeta("preventAutolink",!0).run()},unsetLink:()=>({chain:t})=>t().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}}}),esS=new class{constructor(t,n,r){k(this,"extType",eoR.Mark),k(this,"richTextNodeTypes",Vl.RichTextNodeType.hyperlink),this.name=t,this.component=n,this.converter=r}}(es_.name,es_,{fromPrismic:t=>function(n){var r,i,o,a;let u=n.data;if("DocumentLink"===u.__TYPE__){let s={type:es_.name,id:u.id};return null==(r=t.marks[es_.name])?void 0:r.create(s)}if("ImageLink"===u.__TYPE__){let c={type:es_.name,media:esT(u)};return null==(i=t.marks[es_.name])?void 0:i.create(c)}if("FileLink"===u.__TYPE__){let l={type:es_.name,media:esT(u)};return null==(o=t.marks[es_.name])?void 0:o.create(l)}if("ExternalLink"===u.__TYPE__){let f={type:es_.name,url:u.url,href:u.url,target:u.target};return null==(a=t.marks[es_.name])?void 0:a.create(f)}},toPrismic:t=>t.attrs.media?esw(t.attrs.media):t.attrs.id?{__TYPE__:"DocumentLink",id:t.attrs.id}:{__TYPE__:"ExternalLink",url:t.attrs.href,target:t.attrs.target}});function esT(t){return JSON.stringify(t)}function esw(t){return JSON.parse(t)}let esO=etG.create({name:"listItem",addOptions:()=>({HTMLAttributes:{}}),content:"paragraph block*",defining:!0,parseHTML:()=>[{tag:"li"}],renderHTML({HTMLAttributes:t}){return["li",X6(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)}}}),esk=etH.create({name:"textStyle",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"span",getAttrs:t=>!!t.hasAttribute("style")&&{}}],renderHTML({HTMLAttributes:t}){return["span",X6(this.options.HTMLAttributes,t),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:t,commands:n})=>{let r=etc(t,this.type);return!!Object.entries(r).some(([,t])=>!!t)||n.unsetMark(this.name)}}}}),esI=/^(\d+)\.\s$/,esC=etG.create({name:"orderedList",addOptions:()=>({itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}),group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes:()=>({start:{default:1,parseHTML:t=>t.hasAttribute("start")?parseInt(t.getAttribute("start")||"",10):1}}),parseHTML:()=>[{tag:"ol"}],renderHTML({HTMLAttributes:t}){let{start:n,...r}=t;return 1===n?["ol",X6(this.options.HTMLAttributes,r),0]:["ol",X6(this.options.HTMLAttributes,t),0]},addCommands(){return{toggleOrderedList:()=>({commands:t,chain:n})=>this.options.keepAttributes?n().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(esO.name,this.editor.getAttributes(esk.name)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let t=etK({find:esI,type:this.type,getAttributes:t=>({start:+t[1]}),joinPredicate:(t,n)=>n.childCount+n.attrs.start===+t[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(t=etK({find:esI,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:t=>({start:+t[1],...this.editor.getAttributes(esk.name)}),joinPredicate:(t,n)=>n.childCount+n.attrs.start===+t[1],editor:this.editor})),[t]}}),esM=esC.extend({name:"orderedList",addAttributes:()=>({start:{default:1,parseHTML:t=>t.hasAttribute("start")?parseInt(t.getAttribute("start")||"",10):1}}),renderHTML({HTMLAttributes:t}){let{start:n,...r}=t;return 1===n?["ol",X6(this.options.HTMLAttributes,r),0]:["ol",X6(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"}),esR=new eoP([Vl.RichTextNodeType.orderedList],esM.name,esM,{fromPrismic:t=>function(n){var r;let i=eoZ.converter.fromPrismic(t)(n);if(i)return null==(r=t.nodes[esM.name])?void 0:r.create(euq.fromPrismic(n),i)},toPrismic:t=>eoF.children.map(t,t=>eoZ.converter.toPrismic(t,Vl.RichTextNodeType.orderedList).filter(h.$)).flat()}),esE=esR,esj=[eoz,esx,esS];function esN(t){return[euG,eu3,esE,ess.build(t),eu8,esn,esd,...esj].filter(h.$)}let esA=[{nodeType:Vl.RichTextNodeType.paragraph,icon:"textFields",isActive:t=>t.isActive(euG.name)&&!t.isActive(eu3.name)&&!t.isActive(esE.name),runCommands:esD((t,n)=>t.clearNodes().setDirection(esF(n))),shortText:"par",text:"Paragraph"},{nodeType:Vl.RichTextNodeType.heading1,icon:"looks1",isActive:t=>t.isActive(ess.name,{level:1}),runCommands:esD((t,n)=>t.setHeading({level:1}).setDirection(esF(n))),shortText:"h1",text:"Heading 1"},{nodeType:Vl.RichTextNodeType.heading2,icon:"looks2",isActive:t=>t.isActive(ess.name,{level:2}),runCommands:esD((t,n)=>t.setHeading({level:2}).setDirection(esF(n))),shortText:"h2",text:"Heading 2"},{nodeType:Vl.RichTextNodeType.heading3,icon:"looks3",isActive:t=>t.isActive(ess.name,{level:3}),runCommands:esD((t,n)=>t.setHeading({level:3}).setDirection(esF(n))),shortText:"h3",text:"Heading 3"},{nodeType:Vl.RichTextNodeType.heading4,icon:"looks4",isActive:t=>t.isActive(ess.name,{level:4}),runCommands:esD((t,n)=>t.setHeading({level:4}).setDirection(esF(n))),shortText:"h4",text:"Heading 4"},{nodeType:Vl.RichTextNodeType.heading5,icon:"looks5",isActive:t=>t.isActive(ess.name,{level:5}),runCommands:esD((t,n)=>t.setHeading({level:5}).setDirection(esF(n))),shortText:"h5",text:"Heading 5"},{nodeType:Vl.RichTextNodeType.heading6,icon:"looks6",isActive:t=>t.isActive(ess.name,{level:6}),runCommands:esD((t,n)=>t.setHeading({level:6}).setDirection(esF(n))),shortText:"h6",text:"Heading 6"},{nodeType:Vl.RichTextNodeType.list,icon:"formatListBulleted",isActive:t=>t.isActive(eu3.name),runCommands:esD((t,n)=>t.toggleBulletList().setDirection(esF(n))),shortText:"bull",text:"Bulleted list"},{nodeType:Vl.RichTextNodeType.orderedList,icon:"formatListNumbered",isActive:t=>t.isActive(esE.name),runCommands:esD((t,n)=>t.toggleOrderedList().setDirection(esF(n))),shortText:"num",text:"Numbered list"},{nodeType:Vl.RichTextNodeType.preformatted,icon:"dataObject",isActive:t=>t.isActive(eu8.name),runCommands:esD((t,n)=>t.setCodeBlock().setDirection(esF(n))),shortText:"code",text:"Code"},{nodeType:Vl.RichTextNodeType.embed,icon:"cloud",isActive:t=>t.isActive(esn.name),runCommands:esD(t=>t.setEmbed()),shortText:"emb",text:"Embed"},{nodeType:Vl.RichTextNodeType.image,icon:"image",isActive:t=>t.isActive(esd.name),runCommands:esD(t=>t.setImage()),shortText:"img",text:"Image"}],esP=[{nodeType:Vl.RichTextNodeType.strong,icon:"formatBold",isActive:t=>t.isActive(eoz.name),runCommands:esD(t=>t.toggleBold())},{nodeType:Vl.RichTextNodeType.em,icon:"formatItalic",isActive:t=>t.isActive(esx.name),runCommands:esD(t=>t.toggleItalic())}],esL=[{nodeType:Vl.RichTextNodeType.rtl,icon:"formatTextDirectionRToL",isActive:t=>t.isActive({dir:euB.RightToLeft}),runCommands:esD((t,n)=>t.toggleDirection(esF(n)))}];function esD(t){return(n,r={})=>{let i=!0===r.can?n.can().chain():n.chain().focus();return void 0!==r.deleteRange&&(i=i.deleteRange(r.deleteRange)),t(i,n).run()}}function esF(t){let n=t.state.selection.$from.parent.attrs;return euq.parseNodeAttrsDirection(n)}function esW(t,n){return t.filter(t=>n.includes(t.nodeType))}function esU(t){let{items:n,editor:r}=t;return 0===n.length?null:R.jsxs(R.Fragment,{children:[R.jsx(f.Jf,{}),n.map(t=>R.jsx(f.r8,{disabled:!t.runCommands(r,{can:!0}),onPressedChange(){t.runCommands(r)},pressed:t.isActive(r),startIcon:t.icon},t.nodeType))]})}function esz(t){let{bubbleMenuContainerRef:n}=t,{disabled:r,showWebLinkModal:i,showDocumentsLinkModal:o,showMediaLinkModal:a}=function(t){let{editor:n,setModal:r}=t;return{disabled:!esD(t=>t.setWebLink({href:""}))(n,{can:!0}),showWebLinkModal:function(){r("webLink")},showDocumentsLinkModal:function(){r("documentLink")},showMediaLinkModal:function(){r("mediaLink")}}}(t);return R.jsxs(R.Fragment,{children:[R.jsx(f.Jf,{}),R.jsxs(f.yM,{density:"compact",children:[R.jsx(f.hA,{disabled:r,startIcon:"link",onClick:i},Vl.RichTextNodeType.hyperlink),R.jsxs(f.h_,{children:[R.jsx(f.$F,{children:R.jsx(f.hA,{startIcon:"arrowDropDown"})}),R.jsxs(f.AW,{align:"end",containerRef:n,children:[R.jsx(f.Xi,{startIcon:R.jsx(f.I5,{name:"public"}),onSelect:i,children:"Link to web page"}),R.jsx(f.Xi,{startIcon:R.jsx(f.I5,{name:"description"}),onSelect:o,children:"Link to document"}),R.jsx(f.Xi,{startIcon:R.jsx(f.I5,{name:"image"}),onSelect:a,children:"Link to media"})]})]})]})]})}function esB(t){let{docId:n,onEdit:r,onUnlink:i}=t,o=function(t){let n=A();n.searchDocuments||L("searchDocuments");let{coreApiUrl:r,env:i}=n;return(0,g.QT)(x.EK,[r,i,t])}(n),a=A();if(!o)return null;let u=o.versions[0],s=(0,b.u)({status:null==u?void 0:u.status,releaseId:(null==u?void 0:u.status)==="release"?u.release_id:void 0,documentId:o.id,versionId:null==u?void 0:u.version_id,env:a.env}),c=(null==u?void 0:u.preview_summary)??"",l=(null==u?void 0:u.custom_type_label)??"";return R.jsx(f.oZ,{url:s,title:o.title,subTitle:l,description:c,onEdit:r,onUnlink:i,largeIconName:"description"})}function esV(t){let{editor:n}=t,{searchDocuments:r}=A(),i=n.getAttributes(Vl.RichTextNodeType.hyperlink);if(i.id&&r){let o=i.id;return R.jsx(es$,{docId:o,...t})}if(i.href){let a=i.href;return R.jsx(esq,{url:a,...t})}if(i.media){let u=esw(i.media);return R.jsx(esK,{media:u,...t})}return null}function es$(t){let{editor:n,onEditDocumentLink:r,docId:i}=t;return R.jsx(f.SV,{renderError:()=>R.jsx(f.oZ,{url:"",title:"Failed to Load Linked Document Data",subTitle:"",error:!0,onEdit:r,onUnlink:()=>esH(n)}),children:R.jsx(c.Suspense,{fallback:R.jsx(f.oZ,{url:"",title:"",subTitle:"",loading:!0,onEdit:r,onUnlink:()=>esH(n)}),children:R.jsx(esB,{docId:i,onEdit:r,onUnlink:()=>esH(n)})})})}function esq(t){let{url:n,editor:r,onEditWebLink:i}=t,o=(0,y.ju)(n);return o?R.jsx(f.oZ,{url:n,title:(0,y.S$)(o),subTitle:n,onEdit:i,onUnlink:()=>esH(r)}):R.jsx(f.oZ,{url:n,title:"",subTitle:n,onEdit:i,onUnlink:()=>esH(r)})}function esK(t){let{media:n,editor:r,onEditMediaLink:i}=t;return"ImageLink"===n.__TYPE__?R.jsx(f.Qi,{url:n.url,title:n.name,subTitle:`${n.width} x ${n.height} pixels`,onEdit:i,onUnlink:()=>esH(r)}):"FileLink"===n.__TYPE__?R.jsx(f.oZ,{url:n.url,title:n.name,subTitle:function(t){let{filename:n}=t,r=n.split(".").pop();return r?r.toLowerCase():""}({filename:n.name}),onEdit:i,onUnlink:()=>esH(r),largeIconName:"insertDriveFile"}):null}function esH(t){esD(t=>t.unsetLink())(t)}function esG(t){let{open:n}=t,{onOpenChange:r,onSelectDocument:i}=function(t){let{editor:n,setOpen:r}=t;function i(t){r(t)}return{onSelectDocument:function(t){esD(n=>n.extendMarkRange(Vl.RichTextNodeType.hyperlink).setDocumentLink({id:t}))(n),r(!1)},onOpenChange:i}}(t);return R.jsx(eiX,{open:n,onOpenChange:r,onSelectDocument:i})}function esZ(t){let{open:n}=t,{onOpenChange:r,onSelectMedia:i}=function(t){let{editor:n,setOpen:r}=t;return{onSelectMedia:function(t){esD(n=>n.extendMarkRange(Vl.RichTextNodeType.hyperlink).setMediaLink({media:t}))(n),r(!1)},onOpenChange:r}}(t);return R.jsx(eiw,{open:n,onOpenChange:r,onMediaSelected:i})}function esY(t){let{open:n}=t,{url:r,setUrl:i,onOpenChange:o,onKeyDown:a,openInNewTab:u,setOpenInNewTab:s,onSetUrl:l,selectionUrl:d,selectionUrlTitle:p}=function(t){var n;let{editor:r,setOpen:i}=t,[o,a]=(0,c.useState)(""),[u,s]=(0,c.useState)(!1),l=function(t){let n=t.getAttributes(Vl.RichTextNodeType.hyperlink);return n.href?n.href:void 0}(r),f=(n=r,"_blank"===n.getAttributes(Vl.RichTextNodeType.hyperlink).target);(0,c.useEffect)(()=>{a(l??"")},[l]),(0,c.useEffect)(()=>{s(f??!1)},[f]);let d=l?(0,y.ju)(l):void 0,p=d?(0,y.S$)(d):"";function h(t){let n=u?"_blank":"_self";esD(r=>r.extendMarkRange(Vl.RichTextNodeType.hyperlink).setWebLink({href:t,target:n}))(r),i(!1)}return{url:o,setUrl:a,onSetUrl:h,selectionUrl:l,selectionUrlTitle:p,openInNewTab:u,selectionOpenInNewTab:f,setOpenInNewTab:s,onKeyDown:function(t){"Enter"===t.key&&h(o)},onOpenChange:function(t){a(""),s(!1),i(t)}}}(t);return R.jsx(f.Vq,{open:n,onOpenChange:o,hasClose:!1,size:"small",children:R.jsx(f.cZ,{children:R.jsxs(f.xu,{flexDirection:"column",children:[R.jsxs(f.xu,{flexDirection:"column",height:"100%",padding:16,gap:4,children:[R.jsx(f.yt,{value:r,onValueChange:i,placeholder:"Paste URL",icon:"public",onKeyDown:a}),d&&R.jsxs(f.xu,{flexDirection:"column",padding:{top:8},gap:4,children:[R.jsx(f.xv,{variant:"smallBold",color:"grey11",children:"Linked to"}),R.jsxs(f.xu,{backgroundColor:"grey4",borderRadius:6,padding:8,alignItems:"center",gap:8,children:[R.jsx(f.pI,{largeIconName:"public",smallIconName:"link"}),R.jsxs(f.xu,{flexDirection:"column",children:[R.jsx(f.xv,{variant:"bold",color:"grey12",children:p}),R.jsx(f.xv,{color:"grey11",variant:"small",children:"Web page"})]})]})]})]}),r&&R.jsxs(f.xu,{flexDirection:"column",padding:{block:8},border:{top:!0},children:[R.jsx(f.UN,{onSelect:()=>s(!u),icon:u?"checkBox":"checkBoxOutlinedBlank",textContent:"Open in new tab"}),R.jsx(f.UN,{onSelect:()=>l(r),icon:"link",textContent:"Link to URL"})]})]})})})}function esJ(t){let{items:n,editor:r}=t;return 0===n.length?null:R.jsxs(R.Fragment,{children:[R.jsx(f.Jf,{}),R.jsx(f.dV,{onValueChange(t){n.forEach(n=>{(n.isActive(r)&&!t.includes(n.nodeType)||!n.isActive(r)&&t.includes(n.nodeType))&&n.runCommands(r)})},type:"multiple",value:n.filter(t=>t.isActive(r)).map(t=>t.nodeType),children:n.map(t=>R.jsx(f.nG,{disabled:!t.runCommands(r,{can:!0}),startIcon:t.icon,value:t.nodeType},t.nodeType))},"mark")]})}function esQ(t){var n;let{items:r,editor:i}=t;return 0===r.length?null:R.jsx(f.vT,{disabled:1===r.length,value:(null==(n=r.find(t=>t.isActive(i)))?void 0:n.nodeType)??"",onValueChange(t){var n;null==(n=r.find(n=>n.nodeType===t))||n.runCommands(i)},children:r.map(t=>R.jsx(f.KG,{value:t.nodeType,children:t.text},t.nodeType))})}let esX={duration:100,hideOnClick:!0,offset:[-48,parseFloat(f.TV.space[8])],placement:"top-start",zIndex:parseFloat(f.TV.zIndex.toolbar)};function es0(t){let{editor:n,nodeTypes:r}=t,[i,o]=(0,c.useState)(),a=r.includes(Vl.RichTextNodeType.hyperlink),u=!i,{shouldShowBubbleMenu:s,shouldShowLinkPopover:l}=function(t){let{editor:n}=t;return{shouldShowBubbleMenu:function(t){let{view:r,state:i,from:o,to:a}=t;if(!r.hasFocus())return!1;let{doc:u,selection:s}=i;return!(n.isActive(Vl.RichTextNodeType.preformatted)||s.empty||0===u.textBetween(o,a).length)},shouldShowLinkPopover:function(t){let{view:n,state:r,from:i,to:o}=t,a=n.state.doc.nodeAt(i),{doc:u,selection:s}=r;return!!s.empty&&!(u.textBetween(i,o).length>0)&&!!(null!=a&&a.marks.some(t=>"hyperlink"===t.type.name))}}}({editor:n}),f=(0,c.useRef)(null);return R.jsxs(R.Fragment,{children:[R.jsx(erN,{editor:n,tippyOptions:esX,shouldShow:s,children:u&&R.jsx("div",{ref:f,children:R.jsx(es1,{...t,bubbleMenuContainerRef:f,setModal:o})})}),R.jsx(erN,{editor:n,tippyOptions:esX,shouldShow:l,children:u&&R.jsx(esV,{editor:n,onEditWebLink:()=>o("webLink"),onEditDocumentLink:()=>o("documentLink"),onEditMediaLink:()=>o("mediaLink")})}),a&&R.jsxs(R.Fragment,{children:[R.jsx(esY,{open:"webLink"===i,setOpen:function(t){o(t?"webLink":void 0)},editor:n}),R.jsx(esG,{open:"documentLink"===i,setOpen:function(t){o(t?"documentLink":void 0)},editor:n}),R.jsx(esZ,{open:"mediaLink"===i,setOpen:function(t){o(t?"mediaLink":void 0)},editor:n})]})]})}function es1(t){let{editor:n,nodeTypes:r}=t,i=r.includes("hyperlink"),o=esW(esA,r),a=esW(esP,r),u=esW(esL,r),s=o.length+a.length+u.length+Number(i);return 0===s?null:R.jsxs(f.o8,{children:[R.jsx(esQ,{items:o,editor:n}),R.jsx(esJ,{items:a,editor:n}),i&&R.jsx(esz,{...t}),R.jsx(esU,{items:u,editor:n}),s>1&&R.jsxs(R.Fragment,{children:[R.jsx(f.Jf,{}),R.jsx(f.hA,{onClick(){n.chain().focus().clearNodes().unsetAllMarks().run()},startIcon:"formatClear"},"clear")]})]})}function es2(t){var n,r;let{content:i,field:o,id:a,readOnly:u}=t,s=(r=o,(0,c.useMemo)(()=>{let{extensions:t,defaultTextConverter:n}=function(t){var n;if(!t||!(null!=t&&t.single)&&!(null!=t&&t.multi))return eoW();let r=function(t){let n=(t.single||t.multi||"").split(/\s*,\s*/).map(t=>{let n=Vl.RichTextNodeTypeCodec.decode(t);return"Right"===n._tag?n.right:void 0}).filter(h.$);return new Set(n)}(t);if(!(null!=r&&r.size))return eoW();let i=(n=r,esN(n).filter(t=>(0,_.G)(n,n=>t.richTextNodeTypes.includes(n)))),o=function(t){let n=new Set(t);return(0,_.G)(n,eoL)&&n.add(euG),(0,_.G)(n,eoN)||n.add(euG),[...n]}(i);return{extensions:o,defaultTextConverter:function(t){let n=t.find(eoN)??euG;return function(t){return r=>n.converter.fromPrismic(t)({...r,type:n.richTextNodeTypes[0]??"heading1"})}}(o)}}(r.config),i=t.filter(es3),o=t.flatMap(t=>t.richTextNodeTypes),a=t.map(t=>t.component),u=t.filter(es4).map(t=>t.name),s=[...a,...function(t,n){var r,i,o;let a=n.map(t=>t.richTextNodeTypes).flat(),u={placeholderByNodeType:(o=n,o.reduce((t,n)=>(n.nodeType===eoE.Text&&(t[n.name]=n.placeholder),t),{})),unfocusedPlaceholder:null==(r=t.config)?void 0:r.placeholder,nodeExtensions:n},s=a.includes(Vl.RichTextNodeType.orderedList)||a.includes(Vl.RichTextNodeType.list);return[eoX.component((null==(i=t.config)?void 0:i.single)===void 0),euU.component,eo4.component,eo9(u),s?eoZ.component:void 0,euQ.configure({nodeTypes:a})].filter(h.$)}(r,i),eu$.configure({supportedExtensionNames:u}),eoS],c=s.map(t=>t.name),l=function(t,n){let r=eep.resolve(t);return eer(r,void 0)}(s);return{allComponents:s,extensionNames:c,defaultTextConverter:n,nodeExtensions:i,names:o,schema:l}},[r])),l=i&&eoX.converter(s.nodeExtensions).fromPrismic(s.schema,null==(n=s.defaultTextConverter)?void 0:n.call(s,s.schema))(i),p=(0,d.R9)(t.onContentChange),m=function(t={},n=[]){let{onUpdate:r}=t,[i,o]=(0,c.useState)(),a=(0,c.useRef)(r),u=(0,d.NW)();return(0,c.useEffect)(()=>{i&&r&&(i.off("update",a.current),i.on("update",r),a.current=r)},[r,i]),(0,c.useLayoutEffect)(()=>{let n=!0,r=new erA(t);return er$(()=>o(r)),r.on("transaction",()=>{requestAnimationFrame(()=>{requestAnimationFrame(()=>{n&&u()})})}),()=>{n=!1}},n),(0,c.useEffect)(()=>()=>{er$(()=>null==i?void 0:i.destroy())},[i]),i}({content:null==l?void 0:l.toJSON(),editable:!u,editorProps:{attributes:{class:f.rk,id:a,tabIndex:"0"}},extensions:s.allComponents,injectCSS:!1,onUpdate({editor:t}){if(t.isEmpty)return p(void 0);let n=eoX.converter(s.nodeExtensions).toPrismic(t.state.doc);p(n)}},[s,u]);return R.jsxs(f.gN,{children:[R.jsx(f.Qy,{htmlFor:a,children:Hc(o)}),R.jsxs(f.JO,{children:[R.jsx(erD,{editor:m??null,style:{flex:1}}),(null==m?void 0:m.isEditable)&&R.jsx(es0,{editor:m,nodeTypes:s.names.concat(euV)})]})]})}function es3(t){return t.extType===eoR.Node}function es4(t){return!(t.extType!==eoR.Node||t.nodeType!==eoE.Text||t.lockedFormat)}function es5(t){var n,r,i,o,a;let{content:u,field:s,id:c,onContentChange:l,readOnly:d}=t,p=Hl(s),h=(i=s,(null==(o=i.config)?void 0:o.default_value)===void 0||null==(a=i.config.options)?void 0:a[0]),m=(null==u?void 0:u.value)??h;return R.jsxs(f.gN,{children:[R.jsx(f.fw,{name:"arrowDropDownCircle"}),R.jsx(f.Qy,{htmlFor:c,children:Hc(s)}),R.jsx(f.JO,{children:R.jsx(f.Ph,{id:c,size:"large",endIcon:"unfoldMore",variant:"secondary",placeholder:p,value:m,onValueChange(t){var n;d||l((n=t,0===n.length?void 0:{__TYPE__:"FieldContent",type:"Select",value:n}))},children:null==(r=null==(n=s.config)?void 0:n.options)?void 0:r.map(t=>R.jsx(f.Ql,{value:t,children:t},t))})})]})}function es9(t){let{id:n,readOnly:r,field:i,content:o,onContentChange:a}=t,u=null!=o&&o.value?(0,p._O)(o.value):void 0;return R.jsxs(f.gN,{children:[R.jsx(f.fw,{name:"event"}),R.jsx(f.Qy,{id:n,children:Hc(i)}),R.jsx(f.JO,{children:R.jsx(f.xu,{padding:{left:4,right:12},width:"100%",flexDirection:"column",justifyContent:"center",children:R.jsx(f.Wr,{mode:"date-time","aria-labelledby":n,readOnly:r,value:u,onValueChange:t=>a(function(t){if(t)return{__TYPE__:"FieldContent",type:"Timestamp",value:function(t){let n=`${t.getUTCFullYear()}`.padStart(4,"0"),r=`${t.getUTCMonth()+1}`.padStart(2,"0"),i=`${t.getUTCDate()}`.padStart(2,"0"),o=`${t.getUTCHours()}`.padStart(2,"0"),a=`${t.getUTCMinutes()}`.padStart(2,"0");return`${n}-${r}-${i}T${o}:${a}:00+00:00`}(t)}}(t))})})})]})}function es6(t){let{id:n,readOnly:r,content:i,nestableWidget:o}=t,a=(0,d.R9)(t.onContentChange);return(0,c.useMemo)(()=>{let t={id:n,readOnly:r,onContentChange:a};return"Boolean"===o.type?R.jsx(Hf,{...t,field:o,content:ep.isBooleanContent(i)?i:void 0}):"Date"===o.type?R.jsx(Hp,{...t,field:o,content:ep.isDateContent(i)?i:void 0}):"Timestamp"===o.type?R.jsx(es9,{...t,field:o,content:ep.isTimestampContent(i)?i:void 0}):"Image"===o.type?R.jsx(eiD,{...t,field:o,content:ep.isImageContent(i)?i:void 0}):"Link"===o.type?R.jsx(eoe,{...t,field:o,content:ep.isLinkContent(i)?i:void 0}):"Number"===o.type?R.jsx(eoi,{...t,field:o,content:ep.isNumberContent(i)?i:void 0}):"StructuredText"===o.type?R.jsx(es2,{...t,field:o,content:ep.isRichTextContent(i)?i:void 0}):"Select"===o.type?R.jsx(es5,{...t,field:o,content:ep.isSelectContent(i)?i:void 0}):"Text"===o.type?R.jsx(eiW,{...t,field:o,content:ep.isTextContent(i)?i:void 0}):"Embed"===o.type?R.jsx(erY,{...t,field:o,content:ep.isEmbedContent(i)?i:void 0}):"Color"===o.type?R.jsx(Hd,{...t,field:o,content:ep.isColorContent(i)?i:void 0}):"GeoPoint"===o.type?R.jsx(er1,{...t,field:o,content:ep.isGeoPointContent(i)?i:void 0}):null},[i,n,o,a,r])}function es8(t){let{content:n,id:r,nonRepeatableZone:i,onContentChange:o,readOnly:a}=t,u=(0,c.useMemo)(()=>Object.entries(i),[i]);return R.jsx(R.Fragment,{children:u.map(([t,i])=>{let u=n[t];return R.jsx(es6,{id:`${r}.${t}`,readOnly:a,nestableWidget:i,content:ep.isNestableContent(u)?u:void 0,onContentChange(r){var i,a,u;o((i=n,a=t,u=r,void 0===u?(0,l.ud)(i,a):{...i,[a]:u}))}},t)})})}function es7(t){let{id:n,title:r,content:i,onContentChange:o,readOnly:a,repeatableZone:u}=t,s=(0,c.useMemo)(()=>Object.entries(u),[u]),l=i??[ece],d=(0,c.useRef)(new Map);function p(t){return d.current.get(t)??"!bugged!"}function h(t){let{index:n,offset:r}=t;o((0,v.pB)(l,n,n+r))}function m(t){let{index:n}=t;o((0,v.$E)(l,n))}return!function(t,n){let r=new Set(n);n.forEach(n=>{t.has(n)||t.set(n,(0,T.d)())}),(0,c.useLayoutEffect)(()=>{for(let[n]of t)r.has(n)||t.delete(n)})}(d.current,l),0===Object.keys(u).length?null:R.jsx(f.ZA,{title:"Repeatable zone"+(r?` • ${r}`:""),addItemButtonTitle:"Add item in group",items:l,getItemKey:p,onAddItem:function(){o(l.concat(ect()))},children(t,r){let i=new Map(t.value),u=p(t);return R.jsx(f.MN,{index:r,title:"Item",onMove:h,onDelete:m,children:s.map(([s,c])=>{let f=i.get(s),p=ep.isNestableContent(f)?f:void 0;return R.jsx(es6,{id:`${n}[${u}].${s}`,content:p,nestableWidget:c,onContentChange:n=>(function(t,n,r,i){let a=function(t,n){let[r,i]=n;if(!i){let o=t.value.filter(([t])=>t!==r);return ect(o)}let a=Array.from(new Map(t.value).set(r,i));return ect(a)}(t,[r,i]),u=function(t,n){let[r,i]=n;return i?t.map((t,n)=>n===r?i:t):t.filter((t,n)=>n!==r)}(l,[n,a]);(function(t,n,r){let i=t.get(n);void 0!==i&&t.set(r,i)})(d.current,t,a),o(u)})(t,r,s,n),readOnly:a},s)})})}})}let ece={__TYPE__:"GroupItemContent",value:[]};function ect(t=[]){return{__TYPE__:"GroupItemContent",value:t}}function ecn(t){var n,r,i,o;let{config:a,content:u,sliceKey:s,readOnly:l=!1,sharedSlice:d,onContentChange:p,...h}=t,m=(n=d,r=u.variation,(0,c.useMemo)(()=>n.variations.find(t=>t.id===r),[n,r])),g=(0,c.useId)(),y={id:h.id??g,readOnly:l},{selected:v,selectionId:b,selection:x}=function(t){let{sliceKey:n}=t||{},r=(0,c.useContext)(Hs),i=function(t,n){if(n)return`${t}___${n}`}("sliceFieldSet",n),o=n===(null==r?void 0:r.id);return{selectionId:i,selected:o,selection:r}}({sliceKey:s}),_=()=>{s&&x.update("sliceFieldSet",s)};return void 0===m?null:R.jsx(N.Provider,{value:a,children:R.jsxs(f.C3,{id:b,selected:v,onFocus:_,children:[R.jsx(f.ax,{children:(i=d,o=m,[i.name,o.name].join(" • "))}),R.jsxs(f.En,{heightEstimate:400,box:{gap:f.jM},children:[R.jsx(es8,{...y,nonRepeatableZone:m.primary??{},content:u.primary,onContentChange(t){p({...u,primary:t})}}),R.jsx(es7,{...y,repeatableZone:m.items??{},content:u.items,onContentChange(t){p({...u,items:t})}})]})]})})}(0,c.createContext)({isDirty:!1,markDirty(){}})}}]);
|