slice-machine-ui 2.7.2-beta.2 → 2.8.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/out/404.html +1 -1
- package/out/_next/static/NHNPoIm5ZybAGepO-LVh5/_buildManifest.js +1 -0
- package/out/_next/static/chunks/{150-84da9b485587e8c4.js → 150-96a0c443c430ec4b.js} +1 -1
- package/out/_next/static/chunks/18539003-9b393c900c89e552.js +22 -0
- package/out/_next/static/chunks/372-cfee53700e416e09.js +1 -0
- package/out/_next/static/chunks/441-76bd8e7cf8cc22da.js +12 -0
- package/out/_next/static/chunks/588-d017e0fe2a651a87.js +1 -0
- package/out/_next/static/chunks/{918-38ab72e6ee071fec.js → 591-a272f15a4bf9830a.js} +2 -2
- package/out/_next/static/chunks/{479-6205c85aa978fc0b.js → 627-092c9e4c99442c08.js} +2 -2
- package/out/_next/static/chunks/750-aa35f21031ee1f96.js +1 -0
- package/out/_next/static/chunks/{772-58d0c8f8ae1c6791.js → 772-db5f72095641ec1d.js} +1 -1
- package/out/_next/static/chunks/{882-1ccb9dbd9bd4734b.js → 882-32959ffa63fa455c.js} +1 -1
- package/out/_next/static/chunks/pages/{_app-8405076cd58a41f0.js → _app-51bef5d3c62d085e.js} +156 -154
- package/out/_next/static/chunks/pages/{changelog-f9055af0d38a0c24.js → changelog-86f30b15d852e710.js} +1 -1
- package/out/_next/static/chunks/pages/changes-6c05ef623617785e.js +1 -0
- package/out/_next/static/chunks/pages/custom-types/{[customTypeId]-2eb64c9ea82fcd0a.js → [customTypeId]-fd2416081ef2ffca.js} +1 -1
- package/out/_next/static/chunks/pages/{custom-types-ddc20cfdd8049c04.js → custom-types-5de2dd7b9b93236e.js} +1 -1
- package/out/_next/static/chunks/pages/{index-17f953c11b46cb20.js → index-2d7f95201a656c12.js} +1 -1
- package/out/_next/static/chunks/pages/{labs-867606e5aff179cd.js → labs-81cf5c5f09fa0bda.js} +1 -1
- package/out/_next/static/chunks/pages/page-types/{[pageTypeId]-e5a5e6b345081e0a.js → [pageTypeId]-59e143620505f73f.js} +1 -1
- package/out/_next/static/chunks/pages/settings-80e0d6f1c79282d3.js +1 -0
- package/out/_next/static/chunks/pages/slices/[lib]/[sliceName]/[variation]/{simulator-783b6577bd4e3728.js → simulator-908e779f6d24760d.js} +1 -1
- package/out/_next/static/chunks/pages/slices/[lib]/[sliceName]/[variation]-0b6162eb591ee324.js +1 -0
- package/out/_next/static/chunks/pages/{slices-0f6e50acfb5957ed.js → slices-317ec2bd3451566e.js} +1 -1
- package/out/_next/static/css/{22103e0fe77e9b53.css → 4e475d945cf8a890.css} +1 -1
- package/out/_next/static/css/850c81be38195a0f.css +1 -0
- package/out/_next/static/css/{00e9fba6d8022425.css → 9d17b7d9f44c5c5d.css} +1 -1
- package/out/_next/static/css/{cc20f7c46912c5dc.css → e5c7f63f02ff4d0f.css} +1 -1
- package/out/_next/static/css/{7f2ebc8f03a13272.css → e5f781f20e24a5ea.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/settings.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 +9 -10
- package/src/components/BlankSlate/BlankSlate.module.css +0 -10
- package/src/components/BlankSlate/BlankSlate.module.css.d.ts +0 -1
- package/src/components/BlankSlate/BlankSlate.tsx +2 -2
- package/src/components/Breadcrumb/Breadcrumb.module.css +0 -4
- package/src/components/Breadcrumb/Breadcrumb.module.css.d.ts +0 -1
- package/src/components/Breadcrumb/Breadcrumb.tsx +1 -2
- package/src/components/ContentTabs/ContentTabs.tsx +2 -1
- package/src/components/FieldSet/FieldSet.module.css +0 -8
- package/src/components/FieldSet/FieldSet.module.css.d.ts +0 -2
- package/src/components/FieldSet/FieldSet.tsx +2 -7
- package/src/components/SideNav/SideNavEnvironmentSelector.tsx +2 -1
- package/src/features/builder/AddFieldDropdown.tsx +1 -1
- package/src/features/documentation/MarkdownRenderer/index.tsx +4 -2
- package/src/features/onboarding/OnboardingProgressStepper.tsx +2 -1
- package/src/features/sync/components/AutoSyncStatusIndicator.tsx +5 -1
- package/src/legacy/lib/builders/CustomTypeBuilder/TabZone/index.tsx +3 -0
- package/src/legacy/lib/builders/SliceBuilder/FieldZones/index.tsx +3 -0
- package/src/legacy/lib/models/common/widgets/Group/ListItem/index.jsx +3 -0
- package/src/legacy/lib/models/common/widgets/Link/Form.jsx +43 -3
- package/src/legacy/lib/models/common/widgets/Link/components.tsx +56 -0
- package/src/legacy/lib/models/common/widgets/Link/index.ts +8 -3
- package/src/legacy/lib/models/common/widgets/LinkToMedia/Form.jsx +14 -1
- package/src/legacy/lib/models/common/widgets/LinkToMedia/index.ts +1 -0
- package/out/_next/static/E30Hv5Nt7vNi3zj5fcpLn/_buildManifest.js +0 -1
- package/out/_next/static/chunks/18539003-080f6b8eec027936.js +0 -22
- package/out/_next/static/chunks/372-a86e2c479a721702.js +0 -1
- package/out/_next/static/chunks/441-126d623f1b578785.js +0 -12
- package/out/_next/static/chunks/50-586dc7ab5e584e76.js +0 -1
- package/out/_next/static/chunks/764-e040bcebe6027fea.js +0 -1
- package/out/_next/static/chunks/pages/changes-72a49635f1ee5057.js +0 -1
- package/out/_next/static/chunks/pages/settings-0edb6f6c78439c20.js +0 -1
- package/out/_next/static/chunks/pages/slices/[lib]/[sliceName]/[variation]-68074c174d83cf1e.js +0 -1
- package/out/_next/static/css/34067e4b880866ca.css +0 -1
- /package/out/_next/static/{E30Hv5Nt7vNi3zj5fcpLn → NHNPoIm5ZybAGepO-LVh5}/_ssgManifest.js +0 -0
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[851],{71463:function(e,t,n){let r,i,o,a;n.d(t,{kS:function(){return etX}});var u,s,l,c,d,f,p,A,h,m,g,y,v,x=n(2784),b=n(33760),C=n(4727),S=n(34736),w=n(32001),I=n(11232),_=n(97867),T=n(47304),O=n(65662),R=n(80832),k=n(19245),E=n(91493),M=n(87248),j=n(34234),F=n(28316),U=n(59131),L=Object.defineProperty,K=(e,t,n)=>t in e?L(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,B=(e,t,n)=>(K(e,"symbol"!=typeof t?t+"":t,n),n),P="u">typeof globalThis?globalThis:"u">typeof window?window:"u">typeof n.g?n.g:"u">typeof self?self:{};function W(e){if(e.__esModule)return e;var t=e.default;if("function"==typeof t){var n=function e(){return this instanceof e?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(t){var r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,r.get?r:{enumerable:!0,get:function(){return e[t]}})}),n}var D={exports:{}},N={};D.exports=function(){if(Bb)return N;Bb=1;var e=Symbol.for("react.element"),t=Symbol.for("react.fragment"),n=Object.prototype.hasOwnProperty,r=x.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,i={key:!0,ref:!0,__self:!0,__source:!0};function o(t,o,a){var u,s={},l=null,c=null;for(u in void 0!==a&&(l=""+a),void 0!==o.key&&(l=""+o.key),void 0!==o.ref&&(c=o.ref),o)n.call(o,u)&&!i.hasOwnProperty(u)&&(s[u]=o[u]);if(t&&t.defaultProps)for(u in o=t.defaultProps)void 0===s[u]&&(s[u]=o[u]);return{$$typeof:e,type:t,key:l,ref:c,props:s,_owner:r.current}}return N.Fragment=t,N.jsx=o,N.jsxs=o,N}();var q=D.exports,Q={},V=function(e,t){return(V=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},z=function(){return(z=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)},Y=Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]};function H(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function G(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}function Z(e){return this instanceof Z?(this.v=e,this):new Z(e)}var J=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t};let $=W(Object.freeze(Object.defineProperty({__proto__:null,get __assign(){return z},__asyncDelegator:function(e){var t,n;return t={},r("next"),r("throw",function(e){throw e}),r("return"),t[Symbol.iterator]=function(){return this},t;function r(r,i){t[r]=e[r]?function(t){return(n=!n)?{value:Z(e[r](t)),done:!1}:i?i(t):t}:i}},__asyncGenerator:function(e,t,n){if(!Symbol.asyncIterator)throw TypeError("Symbol.asyncIterator is not defined.");var r,i=n.apply(e,t||[]),o=[];return r={},a("next"),a("throw"),a("return"),r[Symbol.asyncIterator]=function(){return this},r;function a(e){i[e]&&(r[e]=function(t){return new Promise(function(n,r){o.push([e,t,n,r])>1||u(e,t)})})}function u(e,t){try{var n;(n=i[e](t)).value instanceof Z?Promise.resolve(n.value.v).then(s,l):c(o[0][2],n)}catch(e){c(o[0][3],e)}}function s(e){u("next",e)}function l(e){u("throw",e)}function c(e,t){e(t),o.shift(),o.length&&u(o[0][0],o[0][1])}},__asyncValues:function(e){if(!Symbol.asyncIterator)throw TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e=H(e),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(n){t[n]=e[n]&&function(t){return new Promise(function(r,i){!function(e,t,n,r){Promise.resolve(r).then(function(t){e({value:t,done:n})},t)}(r,i,(t=e[n](t)).done,t.value)})}}},__await:Z,__awaiter:function(e,t,n,r){return new(n||(n=Promise))(function(i,o){function a(e){try{s(r.next(e))}catch(e){o(e)}}function u(e){try{s(r.throw(e))}catch(e){o(e)}}function s(e){var t;e.done?i(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(a,u)}s((r=r.apply(e,t||[])).next())})},__classPrivateFieldGet:function(e,t,n,r){if("a"===n&&!r)throw TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(e):r?r.value:t.get(e)},__classPrivateFieldIn:function(e,t){if(null===t||"object"!=typeof t&&"function"!=typeof t)throw TypeError("Cannot use 'in' operator on non-object");return"function"==typeof e?t===e:e.has(t)},__classPrivateFieldSet:function(e,t,n,r,i){if("m"===r)throw TypeError("Private method is not writable");if("a"===r&&!i)throw TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!i:!t.has(e))throw TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?i.call(e,n):i?i.value=n:t.set(e,n),n},__createBinding:Y,__decorate:function(e,t,n,r){var i,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var u=e.length-1;u>=0;u--)(i=e[u])&&(a=(o<3?i(a):o>3?i(t,n,a):i(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a},__esDecorate:function(e,t,n,r,i,o){function a(e){if(void 0!==e&&"function"!=typeof e)throw TypeError("Function expected");return e}for(var u,s=r.kind,l="getter"===s?"get":"setter"===s?"set":"value",c=!t&&e?r.static?e:e.prototype:null,d=t||(c?Object.getOwnPropertyDescriptor(c,r.name):{}),f=!1,p=n.length-1;p>=0;p--){var A={};for(var h in r)A[h]="access"===h?{}:r[h];for(var h in r.access)A.access[h]=r.access[h];A.addInitializer=function(e){if(f)throw TypeError("Cannot add initializers after decoration has completed");o.push(a(e||null))};var m=(0,n[p])("accessor"===s?{get:d.get,set:d.set}:d[l],A);if("accessor"===s){if(void 0===m)continue;if(null===m||"object"!=typeof m)throw TypeError("Object expected");(u=a(m.get))&&(d.get=u),(u=a(m.set))&&(d.set=u),(u=a(m.init))&&i.push(u)}else(u=a(m))&&("field"===s?i.push(u):d[l]=u)}c&&Object.defineProperty(c,r.name,d),f=!0},__exportStar:function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||Y(t,e,n)},__extends:function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}V(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)},__generator:function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function u(u){return function(s){return function(u){if(n)throw TypeError("Generator is already executing.");for(;o&&(o=0,u[0]&&(a=0)),a;)try{if(n=1,r&&(i=2&u[0]?r.return:u[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,u[1])).done)return i;switch(r=0,i&&(u=[2&u[0],i.value]),u[0]){case 0:case 1:i=u;break;case 4:return a.label++,{value:u[1],done:!1};case 5:a.label++,r=u[1],u=[0];continue;case 7:u=a.ops.pop(),a.trys.pop();continue;default:if(!(i=(i=a.trys).length>0&&i[i.length-1])&&(6===u[0]||2===u[0])){a=0;continue}if(3===u[0]&&(!i||u[1]>i[0]&&u[1]<i[3])){a.label=u[1];break}if(6===u[0]&&a.label<i[1]){a.label=i[1],i=u;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(u);break}i[2]&&a.ops.pop(),a.trys.pop();continue}u=t.call(e,a)}catch(e){u=[6,e],r=0}finally{n=i=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,s])}}},__importDefault:function(e){return e&&e.__esModule?e:{default:e}},__importStar:function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&Y(t,e,n);return J(t,e),t},__makeTemplateObject:function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e},__metadata:function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},__param:function(e,t){return function(n,r){t(n,r,e)}},__propKey:function(e){return"symbol"==typeof e?e:"".concat(e)},__read:G,__rest:function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)0>t.indexOf(r[i])&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n},__runInitializers:function(e,t,n){for(var r=arguments.length>2,i=0;i<t.length;i++)n=r?t[i].call(e,n):t[i].call(e);return r?n:void 0},__setFunctionName:function(e,t,n){return"symbol"==typeof t&&(t=t.description?"[".concat(t.description,"]"):""),Object.defineProperty(e,"name",{configurable:!0,value:n?"".concat(n," ",t):t})},__spread:function(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(G(arguments[t]));return e},__spreadArray:function(e,t,n){if(n||2==arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))},__spreadArrays:function(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;for(var r=Array(e),i=0,t=0;t<n;t++)for(var o=arguments[t],a=0,u=o.length;a<u;a++,i++)r[i]=o[a];return r},__values:H},Symbol.toStringTag,{value:"Module"})));var X={};function ee(e){return function(t){return function(n){return n.reduce(function(t,n){return e.alt(t,function(){return n})},t)}}}let et=Object.freeze(Object.defineProperty({__proto__:null,altAll:ee},Symbol.toStringTag,{value:"Module"})),en=Object.freeze(Object.defineProperty({__proto__:null,altAll:function(e){return ee(e)(e.zero())}},Symbol.toStringTag,{value:"Module"}));var er=function(e){return function(){return{meet:function(t,n){return function(r){return e.meet(t(r),n(r))}},join:function(t,n){return function(r){return e.join(t(r),n(r))}},zero:function(){return e.zero},one:function(){return e.one},implies:function(t,n){return function(r){return e.implies(t(r),n(r))}},not:function(t){return function(n){return e.not(t(n))}}}}},ei=function(e){return function(){return{concat:function(t,n){return function(r){return e.concat(t(r),n(r))}}}}},eo=function(e){var t=ei(e);return function(){return{concat:t().concat,empty:function(){return e.empty}}}},ea=function(e){return{add:function(t,n){return function(r){return e.add(t(r),n(r))}},zero:function(){return e.zero},mul:function(t,n){return function(r){return e.mul(t(r),n(r))}},one:function(){return e.one}}},eu=function(e){var t=ea(e);return{add:t.add,mul:t.mul,one:t.one,zero:t.zero,sub:function(t,n){return function(r){return e.sub(t(r),n(r))}}}};function es(e){return e}function el(e){return function(){return e}}var ec=el(!0),ed=el(!1),ef=el(null),ep=el(void 0);function eA(e,t,n,r,i,o,a,u,s){switch(arguments.length){case 1:return e;case 2:return function(){return t(e.apply(this,arguments))};case 3:return function(){return n(t(e.apply(this,arguments)))};case 4:return function(){return r(n(t(e.apply(this,arguments))))};case 5:return function(){return i(r(n(t(e.apply(this,arguments)))))};case 6:return function(){return o(i(r(n(t(e.apply(this,arguments))))))};case 7:return function(){return a(o(i(r(n(t(e.apply(this,arguments)))))))};case 8:return function(){return u(a(o(i(r(n(t(e.apply(this,arguments))))))))};case 9:return function(){return s(u(a(o(i(r(n(t(e.apply(this,arguments)))))))))}}}function eh(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e}function em(e){throw Error("Called `absurd` function which should be uncallable")}function eg(e,t,n,r,i,o,a,u,s){switch(arguments.length){case 1:return e;case 2:return t(e);case 3:return n(t(e));case 4:return r(n(t(e)));case 5:return i(r(n(t(e))));case 6:return o(i(r(n(t(e)))));case 7:return a(o(i(r(n(t(e))))));case 8:return u(a(o(i(r(n(t(e)))))));case 9:return s(u(a(o(i(r(n(t(e))))))));default:for(var l=arguments[0],c=1;c<arguments.length;c++)l=arguments[c](l);return l}}var ey=function(e,t){return t};let ev=Object.freeze(Object.defineProperty({__proto__:null,SK:ey,absurd:em,apply:function(e){return function(t){return t(e)}},constFalse:ed,constNull:ef,constTrue:ec,constUndefined:ep,constVoid:ep,constant:el,decrement:function(e){return e-1},flip:function(e){return function(t,n){return e(n,t)}},flow:eA,getBooleanAlgebra:er,getEndomorphismMonoid:function(){return{concat:function(e,t){return eA(e,t)},empty:es}},getMonoid:eo,getRing:eu,getSemigroup:ei,getSemiring:ea,hole:em,identity:es,increment:function(e){return e+1},not:function(e){return function(t){return!e(t)}},pipe:eg,tuple:eh,tupled:function(e){return function(t){return e.apply(void 0,t)}},unsafeCoerce:es,untupled:function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return e(t)}}},Symbol.toStringTag,{value:"Module"}));var ex=function(e,t,n){if(n||2==arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))},eb=function(e){return"None"===e._tag},eC=function(e){return"Some"===e._tag},eS={_tag:"None"},ew=function(e){return{_tag:"Some",value:e}},eI=function(e){return"Left"===e._tag},e_=function(e){return"Right"===e._tag},eT=function(e){return{_tag:"Left",left:e}},eO=function(e){return{_tag:"Right",right:e}},eR=function(e){return[e]},ek=function(e){return e.length>0},eE=function(e){return e[0]},eM=function(e){return e.slice(1)},ej=[],eF={},eU=Object.prototype.hasOwnProperty,eL=function(e){return ex([e[0]],e.slice(1),!0)};function eK(e,t){return function(n){return function(r){return e.ap(e.map(r,function(e){return function(n){return t.ap(e,n)}}),n)}}}function eB(e){return function(t){return function(n){return e.ap(e.map(n,function(e){return function(){return e}}),t)}}}function eP(e){return function(t){return function(n){return e.ap(e.map(n,function(){return function(e){return e}}),t)}}}function eW(e){return function(t,n){return function(r){return e.ap(e.map(r,function(e){return function(n){var r;return Object.assign({},e,((r={})[t]=n,r))}}),n)}}}function eD(e){return function(t){return{concat:function(n,r){return e.ap(e.map(n,function(e){return function(n){return t.concat(e,n)}}),r)}}}}function eN(e,t,n){return function(r){for(var i=Array(n.length+1),o=0;o<n.length;o++)i[o]=n[o];return i[n.length]=r,0===t?e.apply(null,i):eN(e,t-1,i)}}var eq={1:function(e){return[e]},2:function(e){return function(t){return[e,t]}},3:function(e){return function(t){return function(n){return[e,t,n]}}},4:function(e){return function(t){return function(n){return function(r){return[e,t,n,r]}}}},5:function(e){return function(t){return function(n){return function(r){return function(i){return[e,t,n,r,i]}}}}}};let eQ=Object.freeze(Object.defineProperty({__proto__:null,ap:eK,apFirst:eB,apS:eW,apSecond:eP,getApplySemigroup:eD,sequenceS:function(e){return function(t){for(var n=Object.keys(t),r=n.length,i=function(e){var t=e.length;switch(t){case 1:return function(t){var n;return(n={})[e[0]]=t,n};case 2:return function(t){return function(n){var r;return(r={})[e[0]]=t,r[e[1]]=n,r}};case 3:return function(t){return function(n){return function(r){var i;return(i={})[e[0]]=t,i[e[1]]=n,i[e[2]]=r,i}}};case 4:return function(t){return function(n){return function(r){return function(i){var o;return(o={})[e[0]]=t,o[e[1]]=n,o[e[2]]=r,o[e[3]]=i,o}}}};case 5:return function(t){return function(n){return function(r){return function(i){return function(o){var a;return(a={})[e[0]]=t,a[e[1]]=n,a[e[2]]=r,a[e[3]]=i,a[e[4]]=o,a}}}}};default:return eN(function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];for(var i={},o=0;o<t;o++)i[e[o]]=n[o];return i},t-1,[])}}(n),o=e.map(t[n[0]],i),a=1;a<r;a++)o=e.ap(o,t[n[a]]);return o}},sequenceT:function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];for(var r=t.length,i=(eU.call(eq,r)||(eq[r]=eN(eh,r-1,[])),eq[r]),o=e.map(t[0],i),a=1;a<r;a++)o=e.ap(o,t[a]);return o}}},Symbol.toStringTag,{value:"Module"}));function eV(e,t){return function(n){return function(r){return e.map(r,function(e){return t.map(e,n)})}}}function ez(e){return function(t){return function(n){return e.map(n,function(e){return e(t)})}}}function eY(e){return function(t){return function(n){return e.map(n,function(e){var n;return(n={})[t]=e,n})}}}function eH(e,t){var n=eV(e,t);return{map:function(e,t){return eg(e,n(t))}}}let eG=Object.freeze(Object.defineProperty({__proto__:null,bindTo:eY,flap:ez,getFunctorComposition:eH,map:eV},Symbol.toStringTag,{value:"Module"}));function eZ(e){var t=eD(e);return function(n){return{concat:t(n).concat,empty:e.of(n.empty)}}}function eJ(e,t){var n=eH(e,t).map,r=eK(e,t);return{map:n,of:function(n){return e.of(t.of(n))},ap:function(e,t){return eg(e,r(t))}}}let e$=Object.freeze(Object.defineProperty({__proto__:null,getApplicativeComposition:eJ,getApplicativeMonoid:eZ},Symbol.toStringTag,{value:"Module"}));function eX(e){return function(t){return function(n){return e.chain(n,function(n){return e.map(t(n),function(){return n})})}}}function e0(e){return function(t,n){return function(r){return e.chain(r,function(r){return e.map(n(r),function(e){var n;return Object.assign({},r,((n={})[t]=e,n))})})}}}let e1=Object.freeze(Object.defineProperty({__proto__:null,bind:e0,chainFirst:eX},Symbol.toStringTag,{value:"Module"}));function e2(e){return function(t){return function(n){return e.fromEither(eb(n)?eT(t()):eO(n.value))}}}function e6(e){return function(t,n){return function(r){return e.fromEither(t(r)?eO(r):eT(n(r)))}}}function e5(e){var t=e2(e);return function(e){var n=t(e);return function(e){return eA(e,n)}}}function e3(e,t){var n=e5(e);return function(e){var r=n(e);return function(e){return function(n){return t.chain(n,r(e))}}}}function e9(e){return function(t){return eA(t,e.fromEither)}}function e4(e,t){var n=e9(e);return function(e){return function(r){return t.chain(r,n(e))}}}function e7(e,t){return eA(e9(e),eX(t))}function e8(e,t){return function(n,r){return function(i){return t.chain(i,function(t){return e.fromEither(n(t)?eO(t):eT(r(t)))})}}}let te=Object.freeze(Object.defineProperty({__proto__:null,chainEitherK:e4,chainFirstEitherK:e7,chainOptionK:e3,filterOrElse:e8,fromEitherK:e9,fromOption:e2,fromOptionK:e5,fromPredicate:e6},Symbol.toStringTag,{value:"Module"}));var tt=function(e){return{equals:function(t,n){return t===n||e(t,n)}}},tn=function(e){return tt(function(t,n){for(var r in e)if(!e[r].equals(t[r],n[r]))return!1;return!0})},tr=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return tt(function(t,n){return e.every(function(e,r){return e.equals(t[r],n[r])})})},ti=function(e){return function(t){return tt(function(n,r){return t.equals(e(n),e(r))})}},to={equals:function(e,t){return e===t}},ta={equals:function(){return!0}},tu=function(){return{concat:function(e,t){return tt(function(n,r){return e.equals(n,r)&&t.equals(n,r)})}}},ts={URI:"Eq",contramap:function(e,t){return eg(e,ti(t))}},tl=to.equals;let tc=Object.freeze(Object.defineProperty({__proto__:null,Contravariant:ts,URI:"Eq",contramap:ti,eq:ts,eqBoolean:to,eqDate:{equals:function(e,t){return e.valueOf()===t.valueOf()}},eqNumber:to,eqStrict:to,eqString:to,fromEquals:tt,getMonoid:function(){return{concat:tu().concat,empty:ta}},getSemigroup:tu,getStructEq:tn,getTupleEq:tr,strictEqual:tl,struct:tn,tuple:tr},Symbol.toStringTag,{value:"Module"}));var td=function(e){return function(t,n){return t===n||0===e(t,n)}},tf=function(e){return{equals:td(e),compare:function(t,n){return t===n?0:e(t,n)}}},tp=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return tf(function(t,n){for(var r=0;r<e.length-1;r++){var i=e[r].compare(t[r],n[r]);if(0!==i)return i}return e[r].compare(t[r],n[r])})},tA=function(e){return tf(function(t,n){return e.compare(n,t)})},th=function(e){return function(t){return tf(function(n,r){return t.compare(e(n),e(r))})}},tm=function(){return{concat:function(e,t){return tf(function(n,r){var i=e.compare(n,r);return 0!==i?i:t.compare(n,r)})}}},tg=function(){return{concat:tm().concat,empty:tf(function(){return 0})}},ty={URI:"Ord",contramap:function(e,t){return eg(e,th(t))}},tv={equals:ec,compare:el(0)},tx=function(e){return function(t,n){return -1===e.compare(t,n)}},tb=function(e){return function(t,n){return 1===e.compare(t,n)}},tC=function(e){return function(t,n){return t===n||1>e.compare(t,n)?t:n}},tS=function(e){return function(t,n){return t===n||e.compare(t,n)>-1?t:n}},tw=function(e){var t=tC(e),n=tS(e);return function(e,r){return function(i){return n(t(i,r),e)}}},tI={equals:to.equals,compare:function(e,t){return e<t?-1:e>t?1:0}},t_=eg(tI,th(function(e){return e.valueOf()}));let tT=Object.freeze(Object.defineProperty({__proto__:null,Contravariant:ty,URI:"Ord",between:function(e){var t=tx(e),n=tb(e);return function(e,r){return function(i){return!(t(i,e)||n(i,r))}}},clamp:tw,contramap:th,equals:function(e){return function(t){return function(n){return n===t||0===e.compare(n,t)}}},equalsDefault:td,fromCompare:tf,geq:function(e){return function(t,n){return -1!==e.compare(t,n)}},getDualOrd:tA,getMonoid:tg,getSemigroup:tm,getTupleOrd:tp,gt:tb,leq:function(e){return function(t,n){return 1!==e.compare(t,n)}},lt:tx,max:tS,min:tC,ord:ty,ordBoolean:tI,ordDate:t_,ordNumber:tI,ordString:tI,reverse:tA,trivial:tv,tuple:tp},Symbol.toStringTag,{value:"Module"}));var tO=function(e){return{concat:function(t,n){return e.concat(n,t)}}},tR=function(e){return function(t){return function(n){return n.reduce(function(t,n){return e.concat(t,n)},t)}}};let tk=Object.freeze(Object.defineProperty({__proto__:null,concatAll:tR,endo:function(e){return function(t){return{concat:function(n,r){return t.concat(e(n),e(r))}}}},filterFirst:function(e){return function(t){return{concat:function(n,r){return e(n)?t.concat(n,r):r}}}},filterSecond:function(e){return function(t){return{concat:function(n,r){return e(r)?t.concat(n,r):n}}}},reverse:tO},Symbol.toStringTag,{value:"Module"}));var tE=function(e){return{concat:tC(e)}},tM=function(e){return{concat:tS(e)}},tj=function(e){return{concat:function(){return e}}},tF=function(e){return{concat:function(t,n){var r={};for(var i in e)eU.call(e,i)&&(r[i]=e[i].concat(t[i],n[i]));return r}}},tU=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return{concat:function(t,n){return e.map(function(e,r){return e.concat(t[r],n[r])})}}},tL=function(e){return function(t){return{concat:function(n,r){return t.concat(n,t.concat(e,r))}}}},tK=function(){return{concat:es}},tB=function(){return{concat:function(e,t){return t}}},tP=tj(void 0),tW={concat:function(e,t){return e&&t}},tD={concat:function(e,t){return e||t}},tN={concat:function(e,t){return e+t}},tq={concat:function(e,t){return e+t}},tQ={concat:function(e,t){return e*t}};let tV=Object.freeze(Object.defineProperty({__proto__:null,concatAll:tR,constant:tj,first:tK,fold:function(e){var t=tR(e);return function(e,n){return void 0===n?t(e):t(e)(n)}},getDualSemigroup:tO,getFirstSemigroup:tK,getFunctionSemigroup:ei,getIntercalateSemigroup:tL,getJoinSemigroup:tM,getLastSemigroup:tB,getMeetSemigroup:tE,getObjectSemigroup:function(){return{concat:function(e,t){return Object.assign({},e,t)}}},getStructSemigroup:tF,getTupleSemigroup:tU,intercalate:tL,last:tB,max:tM,min:tE,reverse:tO,semigroupAll:tW,semigroupAny:tD,semigroupProduct:tQ,semigroupString:tN,semigroupSum:tq,semigroupVoid:tP,struct:tF,tuple:tU},Symbol.toStringTag,{value:"Module"}));var tz=function(e,t,n){if(n||2==arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))},tY=function(e,t){return e<0||e>=t.length},tH=function(e){return function(t){return tz([e],t,!0)}},tG=function(e){return function(t){return tz(tz([],t,!0),[e],!1)}},tZ=function(e,t,n){if(ek(n)){var r=eL(n);return r.splice(e,0,t),r}return[t]},tJ=function(e,t,n){if(n[e]===t)return n;var r=eL(n);return r[e]=t,r},t$=function(e){return function(t){if(1===t.length)return t;for(var n=[n1(t)],r=n2(t),i=function(t){n.every(function(n){return!e.equals(n,t)})&&n.push(t)},o=0;o<r.length;o++)i(r[o]);return n}},tX=function(e){if(ek(e)){var t=tg();return ne(e.reduce(t.concat,t.empty))}return es},t0=function(e){var t=t$(e);return function(e){return function(n){return t(eg(n,t7(e)))}}},t1=function(e){return function(t){var n=t.length,r=Math.round(e)%n;if(tY(Math.abs(r),t)||0===r)return t;if(!(r<0))return t1(r-n)(t);var i=nu(-r)(t),o=i[0];return eg(i[1],t7(o))}},t2=function(e){return ek(e)?ew(e):eS},t6=function(e){return function(t){for(var n=Math.max(0,Math.floor(t)),r=[e(0)],i=1;i<n;i++)r.push(e(i));return r}},t5=function(e,t){return e<=t?t6(function(t){return e+t})(t-e+1):[e]},t3=function(e){return[n1(e),n2(e)]},t9=function(e){return[n5(e),n6(e)]};function t4(e){return function(t){return t.concat(e)}}function t7(e,t){return t?e.concat(t):function(t){return t.concat(e)}}function t8(e){return function(t){var n=t.length;if(0===n)return ej;for(var r=[],i=t[0],o=[i],a=1;a<n;a++){var u=t[a];e.equals(u,i)?o.push(u):(r.push(o),o=[i=u])}return r.push(o),r}}var ne=function(e){return function(t){return 1===t.length?t:t.slice().sort(e.compare)}},nt=function(e,t){return function(n){return tY(e,n)?eS:ew(tJ(e,t(n[e]),n))}},nn=function(e,t,n){for(var r=[n(e[0],t[0])],i=Math.min(e.length,t.length),o=1;o<i;o++)r[o]=n(e[o],t[o]);return r},nr=function(e){return function(t){for(var n=[e,t[0]],r=1;r<t.length;r++)n.push(e,t[r]);return n}},ni=function(e){return function(t){var n=n2(t);return ek(n)?eg(n,nr(e),tH(n1(t))):t}},no=function(e){return function(t){for(var n=eL(e(0,n1(t))),r=1;r<t.length;r++)n.push.apply(n,e(r,t[r]));return n}},na=function(e){return function(t){for(var n=e(t),r=n[0],i=n[1],o=[r],a=i;ek(a);){var u=e(a),s=u[0],l=u[1];o.push(s),a=l}return o}},nu=function(e){return function(t){var n=Math.max(1,e);return n>=t.length?[t,ej]:[eg(t.slice(1,n),tH(n1(t))),t.slice(n)]}},ns=function(e){return na(nu(e))},nl=function(e,t){return eg(e,nk(t))},nc=function(e,t){return eg(e,nE(t))},nd=function(e,t){return eg(e,nI(t))},nf=function(e,t){return eg(e,n_(t))},np=function(e,t){return eg(e,nT(t))},nA=function(e,t,n){return eg(e,nM(t,n))},nh=function(e){var t=nj(e);return function(e,n){return eg(e,t(n))}},nm=function(e,t,n){return eg(e,nF(t,n))},ng=function(e){var t=nB(e);return function(e,n){return eg(e,t(n))}},ny=function(e,t){return eg(e,nw(t))},nv=function(e,t,n){return eg(e,nU(t,n))},nx=function(e){var t=nL(e);return function(e,n){return eg(e,t(n))}},nb=function(e,t,n){return eg(e,nK(t,n))},nC=function(e){var t=nW(e);return function(e,n){return eg(e,t(n))}},nS=function(e){return function(t){return eg(t,t4(e()))}},nw=nS,nI=function(e){return n_(function(t){return eg(e,nk(t))})},n_=function(e){return no(function(t,n){return e(n)})},nT=function(e){return function(t){for(var n=n2(t),r=[e(t)];ek(n);)r.push(e(n)),n=n2(n);return r}},nO=nT(es),nR=n_(es),nk=function(e){return nE(function(t,n){return e(n)})},nE=function(e){return function(t){for(var n=[e(0,n1(t))],r=1;r<t.length;r++)n.push(e(r,t[r]));return n}},nM=function(e,t){return nU(e,function(e,n,r){return t(n,r)})},nj=function(e){return function(t){return function(n){return n.slice(1).reduce(function(n,r){return e.concat(n,t(r))},t(n[0]))}}},nF=function(e,t){return nK(e,function(e,n,r){return t(n,r)})},nU=function(e,t){return function(n){return n.reduce(function(e,n,r){return t(r,e,n)},e)}},nL=function(e){return function(t){return function(n){return n.slice(1).reduce(function(n,r,i){return e.concat(n,t(i+1,r))},t(0,n[0]))}}},nK=function(e,t){return function(n){return n.reduceRight(function(e,n,r){return t(r,n,e)},e)}},nB=function(e){var t=nW(e);return function(e){return t(function(t,n){return e(n)})}},nP=function(e){return nW(e)(ey)},nW=function(e){return function(t){return function(n){for(var r=e.map(t(0,n1(n)),eR),i=1;i<n.length;i++)r=e.ap(e.map(r,function(e){return function(t){return eg(e,tG(t))}}),t(i,n[i]));return r}}},nD="ReadonlyNonEmptyArray",nN=function(e){return{show:function(t){return"[".concat(t.map(e.show).join(", "),"]")}}},nq=function(e){return tt(function(t,n){return t.length===n.length&&t.every(function(t,r){return e.equals(t,n[r])})})},nQ={URI:nD,map:nl},nV=ez(nQ),nz={URI:nD,map:nl,ap:nd},nY=eB(nz),nH=eP(nz),nG={URI:nD,map:nl,ap:nd,chain:nf},nZ=eX(nG),nJ=eR(eF),n$=eY(nQ),nX=e0(nG),n0=eW(nz),n1=eE,n2=eM,n6=function(e){return e[e.length-1]},n5=function(e){return e.slice(0,-1)},n3=function(e){var t=tE(e);return function(e){return e.reduce(t.concat)}},n9=function(e){var t=tM(e);return function(e){return e.reduce(t.concat)}},n4=function(e){return function(t){return t.reduce(e.concat)}},n7=function(e){return function(t){return tz([e(n1(t))],n2(t),!0)}},n8=function(e){return function(t){return eg(n5(t),tG(e(n6(t))))}},re=function(e){var t=n4(e);return function(e){return eA(ni(e),t)}},rt=function(e){return function(t){return t2(t.filter(function(t,n){return e(n,t)}))}};function rn(e,t){return void 0===t?tH(e):eg(t,tH(e))}var rr=function(e,t){return eg(e,t7([t]))};let ri=Object.freeze(Object.defineProperty({__proto__:null,Alt:{URI:nD,map:nl,alt:ny},Applicative:{URI:nD,map:nl,ap:nd,of:eR},Apply:nz,Chain:nG,Comonad:{URI:nD,map:nl,extend:np,extract:eE},Do:nJ,Foldable:{URI:nD,reduce:nA,foldMap:nh,reduceRight:nm},FoldableWithIndex:{URI:nD,reduce:nA,foldMap:nh,reduceRight:nm,reduceWithIndex:nv,foldMapWithIndex:nx,reduceRightWithIndex:nb},Functor:nQ,FunctorWithIndex:{URI:nD,map:nl,mapWithIndex:nc},Monad:{URI:nD,map:nl,ap:nd,of:eR,chain:nf},Pointed:{URI:nD,of:eR},Traversable:{URI:nD,map:nl,reduce:nA,foldMap:nh,reduceRight:nm,traverse:ng,sequence:nP},TraversableWithIndex:{URI:nD,map:nl,mapWithIndex:nc,reduce:nA,foldMap:nh,reduceRight:nm,traverse:ng,sequence:nP,reduceWithIndex:nv,foldMapWithIndex:nx,reduceRightWithIndex:nb,traverseWithIndex:nC},URI:nD,alt:nw,altW:nS,ap:nI,apFirst:nY,apS:n0,apSecond:nH,append:tG,appendW:tG,bind:nX,bindTo:n$,chain:n_,chainFirst:nZ,chainWithIndex:no,chop:na,chunksOf:ns,concat:t7,concatAll:n4,concatW:t4,cons:rn,duplicate:nO,empty:ej,extend:nT,extract:eE,filter:function(e){return rt(function(t,n){return e(n)})},filterWithIndex:rt,flap:nV,flatten:nR,fold:n4,foldMap:nj,foldMapWithIndex:nL,fromArray:function(e){return t2(e.slice())},fromReadonlyArray:t2,getEq:nq,getSemigroup:function(){return{concat:t7}},getShow:nN,getUnionSemigroup:function(e){var t=t0(e);return{concat:function(e,n){return t(n)(e)}}},group:t8,groupBy:function(e){return function(t){for(var n={},r=0;r<t.length;r++){var i=t[r],o=e(i);eU.call(n,o)?n[o].push(i):n[o]=[i]}return n}},groupSort:function(e){var t=ne(e),n=t8(e);return function(e){return ek(e)?n(t(e)):ej}},head:n1,init:n5,insertAt:function(e,t){return function(n){return e<0||e>n.length?eS:ew(tZ(e,t,n))}},intercalate:re,intersperse:ni,isNonEmpty:ek,isOutOfBound:tY,last:n6,makeBy:t6,map:nk,mapWithIndex:nE,matchLeft:function(e){return function(t){return e(n1(t),n2(t))}},matchRight:function(e){return function(t){return e(n5(t),n6(t))}},max:n9,min:n3,modifyAt:nt,modifyHead:n7,modifyLast:n8,of:eR,prepend:tH,prependAll:nr,prependToAll:nr,prependW:tH,range:t5,readonlyNonEmptyArray:{URI:nD,of:eR,map:nl,mapWithIndex:nc,ap:nd,chain:nf,extend:np,extract:eE,reduce:nA,foldMap:nh,reduceRight:nm,traverse:ng,sequence:nP,reduceWithIndex:nv,foldMapWithIndex:nx,reduceRightWithIndex:nb,traverseWithIndex:nC,alt:ny},reduce:nM,reduceRight:nF,reduceRightWithIndex:nK,reduceWithIndex:nU,replicate:function(e){return t6(function(){return e})},reverse:function(e){return 1===e.length?e:tz([n6(e)],e.slice(0,-1).reverse(),!0)},rotate:t1,sequence:nP,snoc:rr,sort:ne,sortBy:tX,splitAt:nu,tail:n2,traverse:nB,traverseWithIndex:nW,unappend:t9,uncons:t3,union:t0,uniq:t$,unprepend:t3,unsafeInsertAt:tZ,unsafeUpdateAt:tJ,unsnoc:t9,unzip:function(e){for(var t=[e[0][0]],n=[e[0][1]],r=1;r<e.length;r++)t[r]=e[r][0],n[r]=e[r][1];return[t,n]},updateAt:function(e,t){return nt(e,function(){return t})},updateHead:function(e){return n7(function(){return e})},updateLast:function(e){return n8(function(){return e})},zip:function e(t,n){return void 0===n?function(n){return e(n,t)}:nn(t,n,function(e,t){return[e,t]})},zipWith:nn},Symbol.toStringTag,{value:"Module"}));var ro=function(e,t,n){if(n||2==arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))},ra=function(e){return e.length>0},ru=function(e,t){return e<0||e>=t.length},rs=function(e){return function(t){return ro([e],t,!0)}},rl=function(e){return function(t){return ro(ro([],t,!0),[e],!1)}},rc=function(e,t,n){if(ra(n)){var r=rm(n);return r.splice(e,0,t),r}return[t]},rd=function(e,t,n){var r=rm(n);return r[e]=t,r},rf=function(e){return function(t){if(1===t.length)return rT(t);for(var n=[im(t)],r=ig(t),i=function(t){n.every(function(n){return!e.equals(n,t)})&&n.push(t)},o=0;o<r.length;o++)i(r[o]);return n}},rp=function(e){if(ra(e)){var t=tg();return rI(e.reduce(t.concat,t.empty))}return rT},rA=function(e){var t=rf(e);return function(e){return function(n){return t(eg(n,rS(e)))}}},rh=function(e){return function(t){var n=t.length,r=Math.round(e)%n;if(ru(Math.abs(r),t)||0===r)return rT(t);if(!(r<0))return rh(r-n)(t);var i=rF(-r)(t),o=i[0];return eg(i[1],rS(o))}},rm=eL,rg=function(e){return ra(e)?ew(e):eS},ry=function(e){return function(t){for(var n=Math.max(0,Math.floor(t)),r=[e(0)],i=1;i<n;i++)r.push(e(i));return r}},rv=function(e,t){return e<=t?ry(function(t){return e+t})(t-e+1):[e]},rx=function(e){return[im(e),ig(e)]},rb=function(e){return[iv(e),iy(e)]};function rC(e){return function(t){return t.concat(e)}}function rS(e,t){return t?e.concat(t):function(t){return t.concat(e)}}function rw(e){return function(t){var n=t.length;if(0===n)return[];for(var r=[],i=t[0],o=[i],a=1;a<n;a++){var u=t[a];e.equals(u,i)?o.push(u):(r.push(o),o=[i=u])}return r.push(o),r}}var rI=function(e){return function(t){return t.slice().sort(e.compare)}},r_=function(e,t){return function(n){return ru(e,n)?eS:ew(rd(e,t(n[e]),n))}},rT=rm,rO=function(e){return[e]},rR=function(e,t,n){for(var r=[n(e[0],t[0])],i=Math.min(e.length,t.length),o=1;o<i;o++)r[o]=n(e[o],t[o]);return r},rk=function(e){return function(t){for(var n=[e,t[0]],r=1;r<t.length;r++)n.push(e,t[r]);return n}},rE=function(e){return function(t){var n=ig(t);return ra(n)?eg(n,rk(e),rs(im(t))):rT(t)}},rM=function(e){return function(t){for(var n=rm(e(0,im(t))),r=1;r<t.length;r++)n.push.apply(n,e(r,t[r]));return n}},rj=function(e){return function(t){for(var n=e(t),r=n[0],i=n[1],o=[r],a=i;ra(a);){var u=e(a),s=u[0],l=u[1];o.push(s),a=l}return o}},rF=function(e){return function(t){var n=Math.max(1,e);return n>=t.length?[rT(t),[]]:[eg(t.slice(1,n),rs(im(t))),t.slice(n)]}},rU=function(e){return rj(rF(e))},rL=function(e,t){return eg(e,r6(t))},rK=function(e,t){return eg(e,r5(t))},rB=function(e,t){return eg(e,r$(t))},rP=function(e,t){return eg(e,rX(t))},rW=function(e,t){return eg(e,r0(t))},rD=function(e,t,n){return eg(e,r3(t,n))},rN=function(e){var t=nj(e);return function(e,n){return eg(e,t(n))}},rq=function(e,t,n){return eg(e,r4(t,n))},rQ=function(e){var t=r8(e);return function(e,n){return eg(e,t(n))}},rV=function(e,t){return eg(e,rJ(t))},rz=function(e,t,n){return eg(e,r9(t,n))},rY=function(e){var t=nL(e);return function(e,n){return eg(e,t(n))}},rH=function(e,t,n){return eg(e,r7(t,n))},rG=function(e){var t=it(e);return function(e,n){return eg(e,t(n))}},rZ=function(e){return function(t){return eg(t,rC(e()))}},rJ=rZ,r$=function(e){return rX(function(t){return eg(e,r6(t))})},rX=function(e){return rM(function(t,n){return e(n)})},r0=function(e){return function(t){for(var n=ig(t),r=[e(t)];ra(n);)r.push(e(n)),n=ig(n);return r}},r1=r0(es),r2=rX(es),r6=function(e){return r5(function(t,n){return e(n)})},r5=function(e){return function(t){for(var n=[e(0,im(t))],r=1;r<t.length;r++)n.push(e(r,t[r]));return n}},r3=nM,r9=nU,r4=nF,r7=nK,r8=function(e){var t=it(e);return function(e){return t(function(t,n){return e(n)})}},ie=function(e){return it(e)(function(e,t){return t})},it=function(e){return function(t){return function(n){for(var r=e.map(t(0,im(n)),rO),i=1;i<n.length;i++)r=e.ap(e.map(r,function(e){return function(t){return eg(e,rl(t))}}),t(i,n[i]));return r}}},ir="NonEmptyArray",ii={URI:ir,map:rL},io=ez(ii),ia={URI:ir,map:rL,ap:rB},iu=eB(ia),is=eP(ia),il={URI:ir,map:rL,ap:rB,chain:rP},ic=eX(il),id=rO(eF),ip=eY(ii),iA=e0(il),ih=eW(ia),im=n1,ig=function(e){return e.slice(1)},iy=n6,iv=function(e){return e.slice(0,-1)},ix=function(e){return function(t){return ro([e(im(t))],ig(t),!0)}},ib=function(e){return function(t){return eg(iv(t),rl(e(iy(t))))}},iC=function(e){return function(t){return rg(t.filter(function(t,n){return e(n,t)}))}};function iS(e,t){return void 0===t?rs(e):eg(t,rs(e))}var iw=function(e,t){return eg(e,rl(t))};let iI=Object.freeze(Object.defineProperty({__proto__:null,Alt:{URI:ir,map:rL,alt:rV},Applicative:{URI:ir,map:rL,ap:rB,of:rO},Apply:ia,Chain:il,Comonad:{URI:ir,map:rL,extend:rW,extract:n1},Do:id,Foldable:{URI:ir,reduce:rD,foldMap:rN,reduceRight:rq},FoldableWithIndex:{URI:ir,reduce:rD,foldMap:rN,reduceRight:rq,reduceWithIndex:rz,foldMapWithIndex:rY,reduceRightWithIndex:rH},Functor:ii,FunctorWithIndex:{URI:ir,map:rL,mapWithIndex:rK},Monad:{URI:ir,map:rL,ap:rB,of:rO,chain:rP},Pointed:{URI:ir,of:rO},Traversable:{URI:ir,map:rL,reduce:rD,foldMap:rN,reduceRight:rq,traverse:rQ,sequence:ie},TraversableWithIndex:{URI:ir,map:rL,mapWithIndex:rK,reduce:rD,foldMap:rN,reduceRight:rq,traverse:rQ,sequence:ie,reduceWithIndex:rz,foldMapWithIndex:rY,reduceRightWithIndex:rH,traverseWithIndex:rG},URI:ir,alt:rJ,altW:rZ,ap:r$,apFirst:iu,apS:ih,apSecond:is,append:rl,appendW:rl,bind:iA,bindTo:ip,chain:rX,chainFirst:ic,chainWithIndex:rM,chop:rj,chunksOf:rU,concat:rS,concatAll:function(e){return function(t){return t.reduce(e.concat)}},concatW:rC,cons:iS,copy:rT,duplicate:r1,extend:r0,extract:n1,filter:function(e){return iC(function(t,n){return e(n)})},filterWithIndex:iC,flap:io,flatten:r2,fold:n4,foldMap:nj,foldMapWithIndex:nL,fromArray:rg,fromReadonlyNonEmptyArray:rm,getEq:nq,getSemigroup:function(){return{concat:rS}},getShow:nN,getUnionSemigroup:function(e){var t=rA(e);return{concat:function(e,n){return t(n)(e)}}},group:rw,groupBy:function(e){return function(t){for(var n={},r=0;r<t.length;r++){var i=t[r],o=e(i);eU.call(n,o)?n[o].push(i):n[o]=[i]}return n}},groupSort:function(e){var t=rI(e),n=rw(e);return function(e){return ra(e)?n(t(e)):[]}},head:im,init:iv,insertAt:function(e,t){return function(n){return e<0||e>n.length?eS:ew(rc(e,t,n))}},intercalate:re,intersperse:rE,isNonEmpty:ra,isOutOfBound:ru,last:iy,makeBy:ry,map:r6,mapWithIndex:r5,matchLeft:function(e){return function(t){return e(im(t),ig(t))}},matchRight:function(e){return function(t){return e(iv(t),iy(t))}},max:n9,min:n3,modifyAt:r_,modifyHead:ix,modifyLast:ib,nonEmptyArray:{URI:ir,of:rO,map:rL,mapWithIndex:rK,ap:rB,chain:rP,extend:rW,extract:n1,reduce:rD,foldMap:rN,reduceRight:rq,traverse:rQ,sequence:ie,reduceWithIndex:rz,foldMapWithIndex:rY,reduceRightWithIndex:rH,traverseWithIndex:rG,alt:rV},of:rO,prepend:rs,prependAll:rk,prependToAll:rk,prependW:rs,range:rv,reduce:r3,reduceRight:r4,reduceRightWithIndex:r7,reduceWithIndex:r9,replicate:function(e){return ry(function(){return e})},reverse:function(e){return ro([iy(e)],e.slice(0,-1).reverse(),!0)},rotate:rh,sequence:ie,snoc:iw,sort:rI,sortBy:rp,splitAt:rF,tail:ig,traverse:r8,traverseWithIndex:it,unappend:rb,uncons:rx,union:rA,uniq:rf,unprepend:rx,unsafeInsertAt:rc,unsafeUpdateAt:rd,unsnoc:rb,unzip:function(e){for(var t=[e[0][0]],n=[e[0][1]],r=1;r<e.length;r++)t[r]=e[r][0],n[r]=e[r][1];return[t,n]},updateAt:function(e,t){return r_(e,function(){return t})},updateHead:function(e){return ix(function(){return e})},updateLast:function(e){return ib(function(){return e})},zip:function e(t,n){return void 0===n?function(n){return e(n,t)}:rR(t,n,function(e,t){return[e,t]})},zipWith:rR},Symbol.toStringTag,{value:"Module"}));var i_={equals:function(e,t){return e===t}},iT={equals:i_.equals,compare:function(e,t){return e<t?-1:e>t?1:0}},iO={equals:i_.equals,compare:iT.compare,top:1/0,bottom:-1/0},iR={concat:function(e,t){return e-t}},ik={concat:function(e,t){return e+t}},iE={concat:function(e,t){return e*t}},iM={concat:ik.concat,empty:0},ij={concat:iE.concat,empty:1};let iF=Object.freeze(Object.defineProperty({__proto__:null,Bounded:iO,Eq:i_,Field:{add:ik.concat,zero:0,mul:iE.concat,one:1,sub:iR.concat,degree:function(e){return 1},div:function(e,t){return e/t},mod:function(e,t){return e%t}},MagmaSub:iR,MonoidProduct:ij,MonoidSum:iM,Ord:iT,SemigroupProduct:iE,SemigroupSum:ik,Show:{show:function(e){return JSON.stringify(e)}},isNumber:function(e){return"number"==typeof e}},Symbol.toStringTag,{value:"Module"}));var iU=function(e,t){return{left:e,right:t}},iL=function(e){return function(t){return iU(iN(t),e(iq(t)))}},iK=function(e){return function(t){return iU(e(iN(t)),iq(t))}},iB=function(e,t){return function(n){return iU(e(iN(n)),t(iq(n)))}},iP="Separated",iW={URI:iP,map:function(e,t){return eg(e,iL(t))}},iD=ez(iW),iN=function(e){return e.left},iq=function(e){return e.right};let iQ=Object.freeze(Object.defineProperty({__proto__:null,Bifunctor:{URI:iP,mapLeft:function(e,t){return eg(e,iK(t))},bimap:function(e,t,n){return eg(e,iB(t,n))}},Functor:iW,URI:iP,bimap:iB,flap:iD,left:iN,map:iL,mapLeft:iK,right:iq,separated:iU},Symbol.toStringTag,{value:"Module"}));function iV(e,t){return function(n){var r=e.traverse(n);return function(e,i){return n.map(r(e,i),t.separate)}}}function iz(e,t){return function(n){var r=e.traverse(n);return function(e,i){return n.map(r(e,i),t.compact)}}}function iY(e){return function(t){var n=e.wither(t);return function(e){return function(r){return n(r,function(n){return t.map(e(n),function(e){return e?ew(n):eS})})}}}}let iH=Object.freeze(Object.defineProperty({__proto__:null,filterE:iY,wiltDefault:iV,witherDefault:iz},Symbol.toStringTag,{value:"Module"}));function iG(e,t){return function(n){return n?t.of(void 0):e.zero()}}let iZ=Object.freeze(Object.defineProperty({__proto__:null,guard:iG},Symbol.toStringTag,{value:"Module"}));var iJ=function(e,t,n){if(n||2==arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))},i$=function(e){return 0===e.length},iX=function(e,t){return e<=0?aF:t6(t)(e)},i0=function(e){return eb(e)?aF:[e.value]},i1=function(e){return eI(e)?aF:[e.right]},i2=function(e,t){return function(n){return ek(n)?t(n):e()}},i6=function(e,t){return function(n){return ek(n)?t(n1(n),n2(n)):e()}},i5=function(e,t){return function(n){return ek(n)?t(n5(n),n6(n)):e()}},i3=function(e){return function(t){if(i$(t))return aF;for(var n=[],r=0;r<t.length;r++)n.push.apply(n,e(r,t[r]));return n}};function i9(e,t){return void 0===t?function(t){return i9(e,t)}:tY(e,t)?eS:ew(t[e])}var i4=function(e){return ek(e)?ew(n1(e)):eS},i7=function(e){return ek(e)?ew(n6(e)):eS},i8=function(e,t){for(var n=e.length,r=0;r<n&&t(e[r]);r++);return r},oe=function(e){return function(t){for(var n=0;n<t.length;n++)if(e(t[n]))return ew(n);return eS}};function ot(e){return function(t){for(var n=0;n<t.length;n++)if(e(t[n]))return ew(t[n]);return eS}}var on=function(e){return function(t){for(var n=0;n<t.length;n++){var r=e(t[n]);if(eC(r))return r}return eS}};function or(e){return function(t){for(var n=t.length-1;n>=0;n--)if(e(t[n]))return ew(t[n]);return eS}}var oi=function(e){return function(t){for(var n=t.length-1;n>=0;n--){var r=e(t[n]);if(eC(r))return r}return eS}},oo=function(e){return function(t){for(var n=t.length-1;n>=0;n--)if(e(t[n]))return ew(n);return eS}},oa=function(e,t){return function(n){return tY(e,n)?eS:ew(aM(e,t(n[e]),n))}},ou=function(e,t,n){for(var r=[],i=Math.min(e.length,t.length),o=0;o<i;o++)r[o]=n(e[o],t[o]);return r},ol=function(e){var t=nr(e);return function(e){return ek(e)?t(e):e}};function oc(e){return function(t,n){if(void 0===n){var r,i=oc(e);return function(e){return i(t,e)}}for(var o=0;o<n.length;o++)if(r=n[o],e.equals(r,t))return!0;return!1}}var od=function(e){return function(t){return e>=1&&ek(t)?nu(e)(t):i$(t)?[t,aF]:[aF,t]}},of=function(e){return function(t){return i$(t)?e:i$(e)?t:t.concat(e)}};function op(e){var t=t0(e);return function(n,r){if(void 0===r){var i=op(e);return function(e){return i(e,n)}}return ek(n)&&ek(r)?t(r)(n):ek(n)?n:r}}function oA(e){var t=oc(e);return function(n,r){if(void 0===r){var i=oA(e);return function(e){return i(e,n)}}return n.filter(function(e){return t(e,r)})}}function oh(e){var t=oc(e);return function(n,r){if(void 0===r){var i=oh(e);return function(e){return i(e,n)}}return n.filter(function(e){return!t(e,r)})}}var om=function(e,t){return eg(e,oz(t))},og=function(e,t){return eg(e,oY(t))},oy=function(e,t){return eg(e,oq(t))},ov=function(e,t){return eg(e,oQ(t))},ox=function(e,t){return eg(e,oG(t))},ob=function(e,t){return eg(e,oJ(t))},oC=function(e,t){return eg(e,oX(t))},oS=function(e,t){return eg(e,o1(t))},ow=function(e,t){return eg(e,o0(t))},oI=function(e,t){return eg(e,o2(t))},o_=function(e,t){return eg(e,oN(t))},oT=function(e,t,n){return eg(e,o4(t,n))},oO=function(e){var t=o7(e);return function(e,n){return eg(e,t(n))}},oR=function(e,t,n){return eg(e,ae(t,n))},ok=function(e,t,n){return eg(e,o8(t,n))},oE=function(e){var t=o9(e);return function(e,n){return eg(e,t(n))}},oM=function(e,t,n){return eg(e,at(t,n))},oj=function(e,t){return eg(e,oZ(t))},oF=function(e,t){return eg(e,o6(t))},oU=function(e,t){return eg(e,o5(t))},oL=function(e){var t=an(e);return function(e,n){return eg(e,t(n))}},oK=function(e){var t=ai(e);return function(e,n){return eg(e,t(n))}},oB=function(e,t){return eg(e,aw(t))},oP=function(e,t){return eg(e,aI(t))},oW=function(){return aF},oD=function(e){return function(t){return t.concat(e())}},oN=oD,oq=function(e){return oQ(function(t){return eg(e,oz(t))})},oQ=function(e){return function(t){return eg(t,i3(function(t,n){return e(n)}))}},oV=oQ(es),oz=function(e){return function(t){return t.map(function(t){return e(t)})}},oY=function(e){return function(t){return t.map(function(t,n){return e(n,t)})}},oH=function(e){for(var t=[],n=[],r=0;r<e.length;r++){var i=e[r];"Left"===i._tag?t.push(i.left):n.push(i.right)}return iU(t,n)},oG=function(e){return function(t){return t.filter(e)}},oZ=function(e){return function(t){for(var n=[],r=0;r<t.length;r++){var i=e(r,t[r]);eC(i)&&n.push(i.value)}return n}},oJ=function(e){return oZ(function(t,n){return e(n)})},o$=oJ(es),oX=function(e){return o0(function(t,n){return e(n)})},o0=function(e){return function(t){for(var n=[],r=[],i=0;i<t.length;i++){var o=t[i];e(i,o)?r.push(o):n.push(o)}return iU(n,r)}},o1=function(e){return o2(function(t,n){return e(n)})},o2=function(e){return function(t){for(var n=[],r=[],i=0;i<t.length;i++){var o=e(i,t[i]);"Left"===o._tag?n.push(o.left):r.push(o.right)}return iU(n,r)}},o6=function(e){return function(t){return t.filter(function(t,n){return e(n,t)})}},o5=function(e){return function(t){return t.map(function(n,r){return e(t.slice(r))})}},o3=o5(es),o9=function(e){return function(t){return function(n){return n.reduce(function(n,r,i){return e.concat(n,t(i,r))},e.empty)}}},o4=function(e,t){return o8(e,function(e,n,r){return t(n,r)})},o7=function(e){var t=o9(e);return function(e){return t(function(t,n){return e(n)})}},o8=function(e,t){return function(n){for(var r=n.length,i=e,o=0;o<r;o++)i=t(o,i,n[o]);return i}},ae=function(e,t){return at(e,function(e,n,r){return t(n,r)})},at=function(e,t){return function(n){return n.reduceRight(function(e,n,r){return t(r,n,e)},e)}},an=function(e){var t=ai(e);return function(e){return t(function(t,n){return e(n)})}},ar=function(e){return function(t){return oT(t,e.of(oW()),function(t,n){return e.ap(e.map(t,function(e){return function(t){return eg(e,tG(t))}}),n)})}},ai=function(e){return function(t){return o8(e.of(oW()),function(n,r,i){return e.ap(e.map(r,function(e){return function(t){return eg(e,tG(t))}}),t(n,i))})}},ao=function(e,t){for(var n=[],r=e;;){var i=t(r);if(eC(i)){var o=i.value,a=o[0],u=o[1];n.push(a),r=u}else break}return n},aa="ReadonlyArray",au=function(e){return{show:function(t){return"[".concat(t.map(e.show).join(", "),"]")}}},as=function(){return{concat:function(e,t){return i$(e)?t:i$(t)?e:e.concat(t)}}},al=function(e){return tt(function(t,n){return t.length===n.length&&t.every(function(t,r){return e.equals(t,n[r])})})},ac=function(e){return tf(function(t,n){for(var r=t.length,i=n.length,o=Math.min(r,i),a=0;a<o;a++){var u=e.compare(t[a],n[a]);if(0!==u)return u}return iT.compare(r,i)})},ad=function(e){var t=op(e);return{concat:function(e,n){return t(n)(e)}}},af={URI:aa,map:om},ap=ez(af),aA={URI:aa,of:eR},ah={URI:aa,map:om,ap:oy},am=eB(ah),ag=eP(ah),ay={URI:aa,map:om,ap:oy,chain:ov},av=eX(ay),ax={URI:aa,zero:oW},ab=iG(ax,aA),aC={URI:aa,compact:o$,separate:oH},aS={URI:aa,map:om,reduce:oT,foldMap:oO,reduceRight:oR,traverse:oL,sequence:ar},aw=function(e){return function(t){for(var n=iJ([],e(t),!0),r=[];n.length>0;){var i=n.shift();eI(i)?n.unshift.apply(n,e(i.left)):r.push(i.right)}return r}},aI=function(e){return function(t){var n=e(t),r=[],i=[];function o(t){eI(t)?e(t.left).forEach(function(e){return r.push(e)}):i.push(t.right)}for(var a=0;a<n.length;a++)o(n[a]);for(;r.length>0;)o(r.shift());return i}},a_=iz(aS,aC),aT=iV(aS,aC),aO={URI:aa,map:om,compact:o$,separate:oH,filter:ox,filterMap:ob,partition:oC,partitionMap:oS,reduce:oT,foldMap:oO,reduceRight:oR,traverse:oL,sequence:ar,wither:a_,wilt:aT},aR=iY(aO),ak={URI:aa,fromEither:i1},aE=e9(ak),aM=function(e,t,n){return ek(n)?tJ(e,t,n):n},aj=function(e,t){var n=t.slice();return n.splice(e,1),n},aF=ej;function aU(e){return function(t){return t.every(e)}}var aL=function(e){return function(t){return t.some(e)}},aK=function(e){var t=re(e);return function(n){return i2(function(){return e.empty},t(n))}},aB=eR(eF),aP=eY(af),aW=e0(ay),aD=eW(ah);let aN=Object.freeze(Object.defineProperty({__proto__:null,Alt:{URI:aa,map:om,alt:o_},Alternative:{URI:aa,map:om,ap:oy,of:eR,alt:o_,zero:oW},Applicative:{URI:aa,map:om,ap:oy,of:eR},Apply:ah,Chain:ay,ChainRecBreadthFirst:{URI:aa,map:om,ap:oy,chain:ov,chainRec:oP},ChainRecDepthFirst:{URI:aa,map:om,ap:oy,chain:ov,chainRec:oB},Compactable:aC,Do:aB,Extend:{URI:aa,map:om,extend:oU},Filterable:{URI:aa,map:om,compact:o$,separate:oH,filter:ox,filterMap:ob,partition:oC,partitionMap:oS},FilterableWithIndex:{URI:aa,map:om,mapWithIndex:og,compact:o$,separate:oH,filter:ox,filterMap:ob,partition:oC,partitionMap:oS,partitionMapWithIndex:oI,partitionWithIndex:ow,filterMapWithIndex:oj,filterWithIndex:oF},Foldable:{URI:aa,reduce:oT,foldMap:oO,reduceRight:oR},FoldableWithIndex:{URI:aa,reduce:oT,foldMap:oO,reduceRight:oR,reduceWithIndex:ok,foldMapWithIndex:oE,reduceRightWithIndex:oM},FromEither:ak,Functor:af,FunctorWithIndex:{URI:aa,map:om,mapWithIndex:og},Monad:{URI:aa,map:om,ap:oy,of:eR,chain:ov},Pointed:aA,Traversable:aS,TraversableWithIndex:{URI:aa,map:om,mapWithIndex:og,reduce:oT,foldMap:oO,reduceRight:oR,reduceWithIndex:ok,foldMapWithIndex:oE,reduceRightWithIndex:oM,traverse:oL,sequence:ar,traverseWithIndex:oK},URI:aa,Unfoldable:{URI:aa,unfold:ao},Witherable:aO,Zero:ax,_chainRecBreadthFirst:oP,_chainRecDepthFirst:oB,alt:oN,altW:oD,ap:oq,apFirst:am,apS:aD,apSecond:ag,append:tG,appendW:tG,bind:aW,bindTo:aP,chain:oQ,chainFirst:av,chainRecBreadthFirst:aI,chainRecDepthFirst:aw,chainWithIndex:i3,chop:function(e){var t=na(e);return function(e){return ek(e)?t(e):aF}},chunksOf:function(e){var t=ns(e);return function(e){return ek(e)?t(e):aF}},compact:o$,comprehension:function(e,t,n){void 0===n&&(n=function(){return!0});var r=function(e,i){return ek(i)?eg(n1(i),oQ(function(t){return r(eg(e,tG(t)),n2(i))})):n.apply(void 0,e)?[t.apply(void 0,e)]:aF};return r(aF,e)},concat:of,concatW:of,cons:rn,deleteAt:function(e){return function(t){return tY(e,t)?eS:ew(aj(e,t))}},difference:oh,dropLeft:function(e){return function(t){return e<=0||i$(t)?t:e>=t.length?aF:t.slice(e,t.length)}},dropLeftWhile:function(e){return function(t){var n=i8(t,e);return 0===n?t:n===t.length?aF:t.slice(n)}},dropRight:function(e){return function(t){return e<=0||i$(t)?t:e>=t.length?aF:t.slice(0,t.length-e)}},duplicate:o3,elem:oc,empty:aF,every:aU,exists:aL,extend:o5,filter:oG,filterE:aR,filterMap:oJ,filterMapWithIndex:oZ,filterWithIndex:o6,findFirst:ot,findFirstMap:on,findIndex:oe,findLast:or,findLastIndex:oo,findLastMap:oi,flap:ap,flatten:oV,foldLeft:i6,foldMap:o7,foldMapWithIndex:o9,foldRight:i5,fromArray:function(e){return i$(e)?aF:e.slice()},fromEither:i1,fromEitherK:aE,fromOption:i0,fromOptionK:function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return i0(e.apply(void 0,t))}},fromPredicate:function(e){return function(t){return e(t)?[t]:aF}},getDifferenceMagma:function(e){var t=oh(e);return{concat:function(e,n){return t(n)(e)}}},getEq:al,getIntersectionSemigroup:function(e){var t=oA(e);return{concat:function(e,n){return t(n)(e)}}},getMonoid:function(){return{concat:as().concat,empty:aF}},getOrd:ac,getSemigroup:as,getShow:au,getUnionMonoid:function(e){return{concat:ad(e).concat,empty:aF}},getUnionSemigroup:ad,guard:ab,head:i4,init:function(e){return ek(e)?ew(n5(e)):eS},insertAt:function(e,t){return function(n){return e<0||e>n.length?eS:ew(tZ(e,t,n))}},intercalate:aK,intersection:oA,intersperse:function(e){var t=ni(e);return function(e){return ek(e)?t(e):e}},isEmpty:i$,isNonEmpty:ek,isOutOfBound:tY,last:i7,lefts:function(e){for(var t=[],n=0;n<e.length;n++){var r=e[n];"Left"===r._tag&&t.push(r.left)}return t},lookup:i9,makeBy:iX,map:oz,mapWithIndex:oY,match:i2,matchLeft:i6,matchLeftW:i6,matchRight:i5,matchRightW:i5,matchW:i2,modifyAt:oa,of:eR,partition:oX,partitionMap:o1,partitionMapWithIndex:o2,partitionWithIndex:o0,prepend:tH,prependAll:ol,prependToAll:ol,prependW:tH,range:t5,readonlyArray:{URI:aa,compact:o$,separate:oH,map:om,ap:oy,of:eR,chain:ov,filter:ox,filterMap:ob,partition:oC,partitionMap:oS,mapWithIndex:og,partitionMapWithIndex:oI,partitionWithIndex:ow,filterMapWithIndex:oj,filterWithIndex:oF,alt:o_,zero:oW,unfold:ao,reduce:oT,foldMap:oO,reduceRight:oR,traverse:oL,sequence:ar,reduceWithIndex:ok,foldMapWithIndex:oE,reduceRightWithIndex:oM,traverseWithIndex:oK,extend:oU,wither:a_,wilt:aT},reduce:o4,reduceRight:ae,reduceRightWithIndex:at,reduceWithIndex:o8,replicate:function(e,t){return iX(e,function(){return t})},reverse:function(e){return e.length<=1?e:e.slice().reverse()},rights:function(e){for(var t=[],n=0;n<e.length;n++){var r=e[n];"Right"===r._tag&&t.push(r.right)}return t},rotate:function(e){var t=t1(e);return function(e){return ek(e)?t(e):e}},scanLeft:function(e,t){return function(n){var r=n.length,i=Array(r+1);i[0]=e;for(var o=0;o<r;o++)i[o+1]=t(i[o],n[o]);return i}},scanRight:function(e,t){return function(n){var r=n.length,i=Array(r+1);i[r]=e;for(var o=r-1;o>=0;o--)i[o]=t(n[o],i[o+1]);return i}},separate:oH,sequence:ar,size:function(e){return e.length},snoc:rr,some:aL,sort:function(e){return function(t){return t.length<=1?t:t.slice().sort(e.compare)}},sortBy:function(e){var t=tX(e);return function(e){return ek(e)?t(e):e}},spanLeft:function(e){return function(t){var n=od(i8(t,e))(t);return{init:n[0],rest:n[1]}}},splitAt:od,tail:function(e){return ek(e)?ew(n2(e)):eS},takeLeft:function(e){return function(t){return tY(e,t)?t:0===e?aF:t.slice(0,e)}},takeLeftWhile:function(e){return function(t){for(var n=[],r=0;r<t.length;r++){var i=t[r];if(!e(i))break;n.push(i)}var o=n.length;return o===t.length?t:0===o?aF:n}},takeRight:function(e){return function(t){return tY(e,t)?t:0===e?aF:t.slice(-e)}},toArray:function(e){return e.slice()},traverse:an,traverseWithIndex:ai,unfold:ao,union:op,uniq:function(e){var t=t$(e);return function(e){return ek(e)?t(e):e}},unsafeDeleteAt:aj,unsafeInsertAt:tZ,unsafeUpdateAt:aM,unzip:function(e){for(var t=[],n=[],r=0;r<e.length;r++)t[r]=e[r][0],n[r]=e[r][1];return[t,n]},updateAt:function(e,t){return oa(e,function(){return t})},wilt:function(e){var t=aT(e);return function(e){return function(n){return t(n,e)}}},wither:function(e){var t=a_(e);return function(e){return function(n){return t(n,e)}}},zero:oW,zip:function e(t,n){return void 0===n?function(n){return e(n,t)}:ou(t,n,function(e,t){return[e,t]})},zipWith:ou},Symbol.toStringTag,{value:"Module"}));var aq=function(e){return 0===e.length},aQ=function(e,t){return e<=0?[]:ry(t)(e)},aV=function(e){return eb(e)?[]:[e.value]},az=function(e){return eI(e)?[]:[e.right]},aY=function(e,t){return function(n){return ra(n)?t(n):e()}},aH=function(e,t){return function(n){return ra(n)?t(im(n),ig(n)):e()}},aG=function(e,t){return function(n){return ra(n)?t(iv(n),iy(n)):e()}},aZ=function(e){return function(t){for(var n=[],r=0;r<t.length;r++)n.push.apply(n,e(r,t[r]));return n}},aJ=function(e,t){for(var n=e.length,r=0;r<n&&t(e[r]);r++);return r},a$=function(e){return e.slice()},aX=function(e,t){return function(n){return ru(e,n)?eS:ew(ss(e,t(n[e]),n))}},a0=function(e,t,n){for(var r=[],i=Math.min(e.length,t.length),o=0;o<i;o++)r[o]=n(e[o],t[o]);return r},a1=function(e){var t=rk(e);return function(e){return ra(e)?t(e):[]}},a2=function(e){return function(t){return e>=1&&ra(t)?rF(e)(t):aq(t)?[a$(t),[]]:[[],a$(t)]}},a6=function(e){return function(t){return aq(t)?a$(e):aq(e)?a$(t):t.concat(e)}};function a5(e){var t=rA(e);return function(n,r){if(void 0===r){var i=a5(e);return function(e){return i(e,n)}}return ra(n)&&ra(r)?t(r)(n):ra(n)?a$(n):a$(r)}}function a3(e){var t=oc(e);return function(n,r){if(void 0===r){var i=a3(e);return function(e){return i(e,n)}}return n.filter(function(e){return t(e,r)})}}function a9(e){var t=oc(e);return function(n,r){if(void 0===r){var i=a9(e);return function(e){return i(e,n)}}return n.filter(function(e){return!t(e,r)})}}var a4=function(e,t){return eg(e,ux(t))},a7=function(e,t){return eg(e,uw(t))},a8=function(e,t){return eg(e,ub(t))},ue=function(e,t){return eg(e,uC(t))},ut=function(e,t){return eg(e,uR(t))},un=function(e,t){return eg(e,u_(t))},ur=function(e,t){return eg(e,uk(t))},ui=function(e,t){return eg(e,uM(t))},uo=function(e,t){return eg(e,uE(t))},ua=function(e,t){return eg(e,uj(t))},uu=function(e,t){return eg(e,uU(t))},us=function(e,t,n){return eg(e,uD(t,n))},ul=function(e){var t=uP(e);return function(e,n){return eg(e,t(n))}},uc=function(e,t,n){return eg(e,uq(t,n))},ud=function(e,t,n){return eg(e,uN(t,n))},uf=function(e){var t=uW(e);return function(e,n){return eg(e,t(n))}},up=function(e,t,n){return eg(e,uQ(t,n))},uA=function(e,t){return eg(e,uI(t))},uh=function(e,t){return eg(e,uL(t))},um=function(e,t){return eg(e,uK(t))},ug=function(e){var t=uV(e);return function(e,n){return eg(e,t(n))}},uy=function(e){var t=uY(e);return function(e,n){return eg(e,t(n))}},uv=function(){return[]},ux=function(e){return function(t){return t.map(function(t){return e(t)})}},ub=function(e){return uC(function(t){return eg(e,ux(t))})},uC=function(e){return function(t){return eg(t,aZ(function(t,n){return e(n)}))}},uS=uC(es),uw=function(e){return function(t){return t.map(function(t,n){return e(n,t)})}},uI=function(e){return function(t){for(var n=[],r=0;r<t.length;r++){var i=e(r,t[r]);eC(i)&&n.push(i.value)}return n}},u_=function(e){return uI(function(t,n){return e(n)})},uT=u_(es),uO=function(e){for(var t=[],n=[],r=0;r<e.length;r++){var i=e[r];"Left"===i._tag?t.push(i.left):n.push(i.right)}return iU(t,n)},uR=function(e){return function(t){return t.filter(e)}},uk=function(e){return uE(function(t,n){return e(n)})},uE=function(e){return function(t){for(var n=[],r=[],i=0;i<t.length;i++){var o=t[i];e(i,o)?r.push(o):n.push(o)}return iU(n,r)}},uM=function(e){return uj(function(t,n){return e(n)})},uj=function(e){return function(t){for(var n=[],r=[],i=0;i<t.length;i++){var o=e(i,t[i]);"Left"===o._tag?n.push(o.left):r.push(o.right)}return iU(n,r)}},uF=function(e){return function(t){return t.concat(e())}},uU=uF,uL=function(e){return function(t){return t.filter(function(t,n){return e(n,t)})}},uK=function(e){return function(t){return t.map(function(n,r){return e(t.slice(r))})}},uB=uK(es),uP=o7,uW=o9,uD=o4,uN=o8,uq=ae,uQ=at,uV=function(e){var t=uY(e);return function(e){return t(function(t,n){return e(n)})}},uz=function(e){return function(t){return us(t,e.of(uv()),function(t,n){return e.ap(e.map(t,function(e){return function(t){return eg(e,rl(t))}}),n)})}},uY=function(e){return function(t){return uN(e.of(uv()),function(n,r,i){return e.ap(e.map(r,function(e){return function(t){return eg(e,rl(t))}}),t(n,i))})}},uH=function(e,t){for(var n=[],r=e;;){var i=t(r);if(eC(i)){var o=i.value,a=o[0],u=o[1];n.push(a),r=u}else break}return n},uG="Array",uZ=function(){return{concat:function(e,t){return e.concat(t)}}},uJ=function(){return{concat:uZ().concat,empty:[]}},u$=function(e){var t=a5(e);return{concat:function(e,n){return t(n)(e)}}},uX={URI:uG,map:a4},u0=ez(uX),u1={URI:uG,of:rO},u2={URI:uG,map:a4,ap:a8},u6=eB(u2),u5=eP(u2),u3={URI:uG,map:a4,ap:a8,chain:ue},u9=eX(u3),u4={URI:uG,zero:uv},u7=iG(u4,u1),u8={URI:uG,compact:uT,separate:uO},se={URI:uG,reduce:us,foldMap:ul,reduceRight:uc},st={URI:uG,map:a4,reduce:us,foldMap:ul,reduceRight:uc,traverse:ug,sequence:uz},sn=iz(st,u8),sr=iV(st,u8),si={URI:uG,map:a4,compact:uT,separate:uO,filter:ut,filterMap:un,partition:ur,partitionMap:ui,reduce:us,foldMap:ul,reduceRight:uc,traverse:ug,sequence:uz,wither:sn,wilt:sr},so=iY(si),sa={URI:uG,fromEither:az},su=e9(sa),ss=function(e,t,n){return ra(n)?rd(e,t,n):[]},sl=function(e,t){var n=t.slice();return n.splice(e,1),n},sc=function(e){return function(t){return t.some(e)}},sd=rO(eF),sf=eY(uX),sp=e0(u3),sA=eW(u2);let sh=Object.freeze(Object.defineProperty({__proto__:null,Alt:{URI:uG,map:a4,alt:uu},Alternative:{URI:uG,map:a4,ap:a8,of:rO,alt:uu,zero:uv},Applicative:{URI:uG,map:a4,ap:a8,of:rO},Apply:u2,Chain:u3,ChainRecBreadthFirst:{URI:uG,map:a4,ap:a8,chain:ue,chainRec:oP},ChainRecDepthFirst:{URI:uG,map:a4,ap:a8,chain:ue,chainRec:oB},Compactable:u8,Do:sd,Extend:{URI:uG,map:a4,extend:um},Filterable:{URI:uG,map:a4,compact:uT,separate:uO,filter:ut,filterMap:un,partition:ur,partitionMap:ui},FilterableWithIndex:{URI:uG,map:a4,mapWithIndex:a7,compact:uT,separate:uO,filter:ut,filterMap:un,partition:ur,partitionMap:ui,partitionMapWithIndex:ua,partitionWithIndex:uo,filterMapWithIndex:uA,filterWithIndex:uh},Foldable:se,FoldableWithIndex:{URI:uG,reduce:us,foldMap:ul,reduceRight:uc,reduceWithIndex:ud,foldMapWithIndex:uf,reduceRightWithIndex:up},FromEither:sa,Functor:uX,FunctorWithIndex:{URI:uG,map:a4,mapWithIndex:a7},Monad:{URI:uG,map:a4,ap:a8,of:rO,chain:ue},Pointed:u1,Traversable:st,TraversableWithIndex:{URI:uG,map:a4,mapWithIndex:a7,reduce:us,foldMap:ul,reduceRight:uc,reduceWithIndex:ud,foldMapWithIndex:uf,reduceRightWithIndex:up,traverse:ug,sequence:uz,traverseWithIndex:uy},URI:uG,Unfoldable:{URI:uG,unfold:uH},Witherable:si,Zero:u4,alt:uU,altW:uF,ap:ub,apFirst:u6,apS:sA,apSecond:u5,append:rl,appendW:rl,array:{URI:uG,compact:uT,separate:uO,map:a4,ap:a8,of:rO,chain:ue,filter:ut,filterMap:un,partition:ur,partitionMap:ui,mapWithIndex:a7,partitionMapWithIndex:ua,partitionWithIndex:uo,filterMapWithIndex:uA,filterWithIndex:uh,alt:uu,zero:uv,unfold:uH,reduce:us,foldMap:ul,reduceRight:uc,traverse:ug,sequence:uz,reduceWithIndex:ud,foldMapWithIndex:uf,reduceRightWithIndex:up,traverseWithIndex:uy,extend:um,wither:sn,wilt:sr},bind:sp,bindTo:sf,chain:uC,chainFirst:u9,chainRecBreadthFirst:aI,chainRecDepthFirst:aw,chainWithIndex:aZ,chop:function(e){var t=rj(e);return function(e){return ra(e)?t(e):[]}},chunksOf:function(e){var t=rU(e);return function(e){return ra(e)?t(e):[]}},compact:uT,comprehension:function(e,t,n){void 0===n&&(n=function(){return!0});var r=function(e,i){return ra(i)?eg(im(i),uC(function(t){return r(eg(e,rl(t)),ig(i))})):n.apply(void 0,e)?[t.apply(void 0,e)]:[]};return r([],e)},concat:a6,concatW:a6,cons:iS,copy:a$,deleteAt:function(e){return function(t){return ru(e,t)?eS:ew(sl(e,t))}},difference:a9,dropLeft:function(e){return function(t){return e<=0||aq(t)?a$(t):e>=t.length?[]:t.slice(e,t.length)}},dropLeftWhile:function(e){return function(t){return t.slice(aJ(t,e))}},dropRight:function(e){return function(t){return e<=0||aq(t)?a$(t):e>=t.length?[]:t.slice(0,t.length-e)}},duplicate:uB,elem:oc,empty:[],every:aU,exists:sc,extend:uK,filter:uR,filterE:so,filterMap:u_,filterMapWithIndex:uI,filterWithIndex:uL,findFirst:function(e){return ot(e)},findFirstMap:on,findIndex:oe,findLast:function(e){return or(e)},findLastIndex:oo,findLastMap:oi,flap:u0,flatten:uS,foldLeft:aH,foldMap:uP,foldMapWithIndex:uW,foldRight:aG,fromEither:az,fromEitherK:su,fromOption:aV,fromOptionK:function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return aV(e.apply(void 0,t))}},fromPredicate:function(e){return function(t){return e(t)?[t]:[]}},getDifferenceMagma:function(e){var t=a9(e);return{concat:function(e,n){return t(n)(e)}}},getEq:al,getIntersectionSemigroup:function(e){var t=a3(e);return{concat:function(e,n){return t(n)(e)}}},getMonoid:uJ,getOrd:ac,getSemigroup:uZ,getShow:au,getUnionMonoid:function(e){return{concat:u$(e).concat,empty:[]}},getUnionSemigroup:u$,guard:u7,head:i4,init:function(e){return ra(e)?ew(iv(e)):eS},insertAt:function(e,t){return function(n){return e<0||e>n.length?eS:ew(rc(e,t,n))}},intercalate:aK,intersection:a3,intersperse:function(e){var t=rE(e);return function(e){return ra(e)?t(e):a$(e)}},isEmpty:aq,isNonEmpty:ra,isOutOfBound:ru,last:i7,lefts:function(e){for(var t=[],n=0;n<e.length;n++){var r=e[n];"Left"===r._tag&&t.push(r.left)}return t},lookup:i9,makeBy:aQ,map:ux,mapWithIndex:uw,match:aY,matchLeft:aH,matchLeftW:aH,matchRight:aG,matchRightW:aG,matchW:aY,modifyAt:aX,of:rO,partition:uk,partitionMap:uM,partitionMapWithIndex:uj,partitionWithIndex:uE,prepend:rs,prependAll:a1,prependToAll:a1,prependW:rs,range:rv,reduce:uD,reduceRight:uq,reduceRightWithIndex:uQ,reduceWithIndex:uN,replicate:function(e,t){return aQ(e,function(){return t})},reverse:function(e){return aq(e)?[]:e.slice().reverse()},rights:function(e){for(var t=[],n=0;n<e.length;n++){var r=e[n];"Right"===r._tag&&t.push(r.right)}return t},rotate:function(e){var t=rh(e);return function(e){return ra(e)?t(e):a$(e)}},scanLeft:function(e,t){return function(n){var r=n.length,i=Array(r+1);i[0]=e;for(var o=0;o<r;o++)i[o+1]=t(i[o],n[o]);return i}},scanRight:function(e,t){return function(n){var r=n.length,i=Array(r+1);i[r]=e;for(var o=r-1;o>=0;o--)i[o]=t(n[o],i[o+1]);return i}},separate:uO,sequence:uz,size:function(e){return e.length},snoc:iw,some:sc,sort:function(e){return function(t){return t.length<=1?a$(t):t.slice().sort(e.compare)}},sortBy:function(e){var t=rp(e);return function(e){return ra(e)?t(e):a$(e)}},spanLeft:function(e){return function(t){var n=a2(aJ(t,e))(t);return{init:n[0],rest:n[1]}}},splitAt:a2,tail:function(e){return ra(e)?ew(ig(e)):eS},takeLeft:function(e){return function(t){return ru(e,t)?a$(t):t.slice(0,e)}},takeLeftWhile:function(e){return function(t){for(var n=[],r=0;r<t.length;r++){var i=t[r];if(!e(i))break;n.push(i)}return n}},takeRight:function(e){return function(t){return ru(e,t)?a$(t):0===e?[]:t.slice(-e)}},traverse:uV,traverseWithIndex:uY,unfold:uH,union:a5,uniq:function(e){var t=rf(e);return function(e){return ra(e)?t(e):a$(e)}},unsafeDeleteAt:sl,unsafeInsertAt:rc,unsafeUpdateAt:ss,unzip:function(e){for(var t=[],n=[],r=0;r<e.length;r++)t[r]=e[r][0],n[r]=e[r][1];return[t,n]},updateAt:function(e,t){return aX(e,function(){return t})},wilt:function(e){var t=sr(e);return function(e){return function(n){return t(n,e)}}},wither:function(e){var t=sn(e);return function(e){return function(n){return t(n,e)}}},zero:uv,zip:function e(t,n){return void 0===n?function(n){return e(n,t)}:a0(t,n,function(e,t){return[e,t]})},zipWith:a0},Symbol.toStringTag,{value:"Module"})),sm=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var sg=function(e,t){return function(n){return n?t():e()}},sy={equals:function(e,t){return e===t}},sv={concat:function(e,t){return e&&t}},sx={concat:function(e,t){return e||t}},sb={concat:sv.concat,empty:!0},sC={concat:sx.concat,empty:!1},sS={equals:sy.equals,compare:function(e,t){return e<t?-1:e>t?1:0}};let sw=Object.freeze(Object.defineProperty({__proto__:null,BooleanAlgebra:{meet:function(e,t){return e&&t},join:function(e,t){return e||t},zero:!1,one:!0,implies:function(e,t){return!e||t},not:function(e){return!e}},Eq:sy,MonoidAll:sb,MonoidAny:sC,Ord:sS,SemigroupAll:sv,SemigroupAny:sx,Show:{show:function(e){return JSON.stringify(e)}},fold:sg,foldW:sg,isBoolean:function(e){return"boolean"==typeof e},match:sg,matchW:sg},Symbol.toStringTag,{value:"Module"}));var sI=function(e){return{meet:function(t,n){return e.join(t,n)},join:function(t,n){return e.meet(t,n)},zero:e.one,one:e.zero,implies:function(t,n){return e.join(e.not(t),n)},not:e.not}};let s_=Object.freeze(Object.defineProperty({__proto__:null,booleanAlgebraBoolean:{meet:function(e,t){return e&&t},join:function(e,t){return e||t},zero:!1,one:!0,implies:function(e,t){return!e||t},not:function(e){return!e}},booleanAlgebraVoid:{meet:function(){},join:function(){},zero:void 0,one:void 0,implies:function(){},not:function(){}},getDualBooleanAlgebra:sI,getFunctionBooleanAlgebra:er,reverse:sI},Symbol.toStringTag,{value:"Module"})),sT=Object.freeze(Object.defineProperty({__proto__:null,boundedNumber:{equals:tI.equals,compare:tI.compare,top:1/0,bottom:-1/0},clamp:function(e){return tw(e)(e.bottom,e.top)},reverse:function(e){var t=tA(e);return{equals:t.equals,compare:t.compare,top:e.bottom,bottom:e.top}}},Symbol.toStringTag,{value:"Module"}));function sO(e){return{meet:tC(e),join:tS(e)}}let sR=Object.freeze(Object.defineProperty({__proto__:null,getMinMaxDistributiveLattice:sO},Symbol.toStringTag,{value:"Module"})),sk=Object.freeze(Object.defineProperty({__proto__:null,getMinMaxBoundedDistributiveLattice:function(e){var t=sO(e);return function(e,n){return{join:t.join,meet:t.meet,zero:e,one:n}}}},Symbol.toStringTag,{value:"Module"})),sE=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),sM=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),sj=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),sF=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var sU=function(e,t){for(var n=t(e);"Left"===n._tag;)n=t(n.left);return n.right};let sL=Object.freeze(Object.defineProperty({__proto__:null,tailRec:sU},Symbol.toStringTag,{value:"Module"}));function sK(e,t){return function(n,r){return t.compose(e.right(r),e.left(n))}}function sB(e,t){var n=sK(e,t);return function(r,i){return t.compose(e.promap(t.id(),function(e){return"Left"===e._tag?e.left:e.right},es),n(r,i))}}let sP=Object.freeze(Object.defineProperty({__proto__:null,fanIn:sB,fanin:function(e){return sB(e,e)},split:sK,splitChoice:function(e){return sK(e,e)}},Symbol.toStringTag,{value:"Module"})),sW=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var sD=function(e){return function(t){return eA(e,t)}},sN="Predicate",sq=function(){return{concat:function(e,t){return eg(e,sz(t))}}},sQ=function(){return{concat:function(e,t){return eg(e,sY(t))}}},sV=function(e){return function(t){return!e(t)}},sz=function(e){return function(t){return function(n){return t(n)||e(n)}}},sY=function(e){return function(t){return function(n){return t(n)&&e(n)}}};let sH=Object.freeze(Object.defineProperty({__proto__:null,Contravariant:{URI:sN,contramap:function(e,t){return eg(e,sD(t))}},URI:sN,and:sY,contramap:sD,getMonoidAll:function(){return{concat:sQ().concat,empty:ec}},getMonoidAny:function(){return{concat:sq().concat,empty:ed}},getSemigroupAll:sQ,getSemigroupAny:sq,not:sV,or:sz},Symbol.toStringTag,{value:"Module"}));function sG(e){return function(t){return e(t)?ew(t):eS}}var sZ=function(e){return"Right"===e._tag?eS:ew(e.left)},sJ=function(e){return"Left"===e._tag?eS:ew(e.right)},s$=function(e,t){return eg(e,li(t))},sX=function(e,t){return eg(e,lu(t))},s0=function(e,t){return eg(e,lc(t))},s1=function(e,t,n){return eg(e,lf(t,n))},s2=function(e){var t=lp(e);return function(e,n){return eg(e,t(n))}},s6=function(e,t,n){return eg(e,lA(t,n))},s5=function(e){var t=lk(e);return function(e,n){return eg(e,t(n))}},s3=function(e,t){return eg(e,lm(t))},s9=function(e,t){return eg(e,lI(t))},s4=function(e,t){return eg(e,l_(t))},s7=function(e,t){return eg(e,lx(t))},s8=function(e,t){return eg(e,lT(t))},le=function(e,t){return eg(e,lO(t))},lt="Option",ln=function(e){return{equals:function(t,n){return t===n||(lK(t)?lK(n):!lK(n)&&e.equals(t.value,n.value))}}},lr=function(e){return{concat:function(t,n){return lK(t)?n:lK(n)?t:ew(e.concat(t.value,n.value))},empty:eS}},li=function(e){return function(t){return lK(t)?eS:ew(e(t.value))}},lo={URI:lt,map:s$},la={URI:lt,of:ew},lu=function(e){return function(t){return lK(t)||lK(e)?eS:ew(t.value(e.value))}},ls={URI:lt,map:s$,ap:sX},ll={URI:lt,map:s$,ap:sX,of:ew},lc=function(e){return function(t){return lK(t)?eS:e(t.value)}},ld={URI:lt,map:s$,ap:sX,chain:s0},lf=function(e,t){return function(n){return lK(n)?e:t(e,n.value)}},lp=function(e){return function(t){return function(n){return lK(n)?e.empty:t(n.value)}}},lA=function(e,t){return function(n){return lK(n)?e:t(n.value,e)}},lh=function(e){return function(t){return lK(t)?e():t}},lm=lh,lg=function(){return eS},ly={URI:lt,zero:lg},lv=iG(ly,la),lx=function(e){return function(t){return lK(t)?eS:ew(e(t))}},lb=lc(es),lC=iU(eS,eS),lS=function(e){return lK(e)?lC:iU(sZ(e.value),sJ(e.value))},lw={URI:lt,compact:lb,separate:lS},lI=function(e){return function(t){return lK(t)?eS:e(t.value)?t:eS}},l_=function(e){return function(t){return lK(t)?eS:e(t.value)}},lT=function(e){return function(t){return iU(s9(t,sV(e)),s9(t,e))}},lO=function(e){return eA(li(e),lS)},lR={URI:lt,map:s$,compact:lb,separate:lS,filter:s9,filterMap:s4,partition:s8,partitionMap:le},lk=function(e){return function(t){return function(n){return lK(n)?e.of(eS):e.map(t(n.value),ew)}}},lE=function(e){return function(t){return lK(t)?e.of(eS):e.map(t.value,ew)}},lM={URI:lt,map:s$,reduce:s1,foldMap:s2,reduceRight:s6,traverse:s5,sequence:lE},lj=iz(lM,lw),lF=iV(lM,lw),lU=function(){return eS},lL={URI:lt,fromEither:sJ},lK=function(e){return"None"===e._tag},lB=function(e,t){return function(n){return lK(n)?e():t(n.value)}},lP=function(e){return function(t){return lK(t)?e():t.value}},lW=ez(lo),lD=eB(ls),lN=eP(ls),lq=eX(ld),lQ=lx(es),lV=e9(lL),lz=e4(lL,ld),lY=e7(lL,ld),lH=function(e){return null==e?eS:ew(e)},lG=function(e){try{return ew(e())}catch{return eS}},lZ=function(e){return function(t){return lK(t)?eS:lH(e(t.value))}},lJ=lB(ef,es),l$=lB(ep,es),lX=ew(eF),l0=eY(lo),l1=e0(ld),l2=eW(ls),l6=ew(ej),l5=function(e){return function(t){var n=e(0,eE(t));if(lK(n))return eS;for(var r=[n.value],i=1;i<t.length;i++){var o=e(i,t[i]);if(lK(o))return eS;r.push(o.value)}return ew(r)}},l3=function(e){var t=l5(e);return function(e){return ek(e)?t(e):l6}},l9=function(e){return l3(function(t,n){return e(n)})},l4=l9(es),l7={URI:lt,map:s$,of:ew,ap:sX,chain:s0,reduce:s1,foldMap:s2,reduceRight:s6,traverse:s5,sequence:lE,zero:lg,alt:s3,extend:s7,compact:lb,separate:lS,filter:s9,filterMap:s4,partition:s8,partitionMap:le,wither:lj,wilt:lF,throwError:lU},l8=eD(ls),ce=eZ(ll),ct=function(){return lr(tK())};let cn=Object.freeze(Object.defineProperty({__proto__:null,Alt:{URI:lt,map:s$,alt:s3},Alternative:{URI:lt,map:s$,ap:sX,of:ew,alt:s3,zero:lg},ApT:l6,Applicative:ll,Apply:ls,Chain:ld,Compactable:lw,Do:lX,Extend:{URI:lt,map:s$,extend:s7},Filterable:lR,Foldable:{URI:lt,reduce:s1,foldMap:s2,reduceRight:s6},FromEither:lL,Functor:lo,Monad:{URI:lt,map:s$,ap:sX,of:ew,chain:s0},MonadThrow:{URI:lt,map:s$,ap:sX,of:ew,chain:s0,throwError:lU},Pointed:la,Traversable:lM,URI:lt,Witherable:{URI:lt,map:s$,reduce:s1,foldMap:s2,reduceRight:s6,traverse:s5,sequence:lE,compact:lb,separate:lS,filter:s9,filterMap:s4,partition:s8,partitionMap:le,wither:lj,wilt:lF},Zero:ly,alt:lm,altW:lh,ap:lu,apFirst:lD,apS:l2,apSecond:lN,bind:l1,bindTo:l0,chain:lc,chainEitherK:lz,chainFirst:lq,chainFirstEitherK:lY,chainNullableK:lZ,compact:lb,duplicate:lQ,elem:function e(t){return function(n,r){if(void 0===r){var i=e(t);return function(e){return i(n,e)}}return!lK(r)&&t.equals(n,r.value)}},exists:function(e){return function(t){return!lK(t)&&e(t.value)}},extend:lx,filter:lI,filterMap:l_,flap:lW,flatten:lb,fold:lB,foldMap:lp,foldW:lB,fromEither:sJ,fromEitherK:lV,fromNullable:lH,fromNullableK:function(e){return eA(e,lH)},fromPredicate:sG,getApplyMonoid:ce,getApplySemigroup:l8,getEq:ln,getFirstMonoid:ct,getLastMonoid:function(){return lr(tB())},getLeft:sZ,getMonoid:lr,getOrElse:lP,getOrElseW:lP,getOrd:function(e){return{equals:ln(e).equals,compare:function(t,n){return t===n?0:eC(t)?eC(n)?e.compare(t.value,n.value):1:-1}}},getRefinement:function(e){return function(t){return eC(e(t))}},getRight:sJ,getShow:function(e){return{show:function(t){return lK(t)?"none":"some(".concat(e.show(t.value),")")}}},guard:lv,isNone:lK,isSome:eC,map:li,mapNullable:lZ,match:lB,matchW:lB,none:eS,of:ew,option:l7,partition:lT,partitionMap:lO,reduce:lf,reduceRight:lA,separate:lS,sequence:lE,sequenceArray:l4,some:ew,throwError:lU,toNullable:lJ,toUndefined:l$,traverse:lk,traverseArray:l9,traverseArrayWithIndex:l3,traverseReadonlyArrayWithIndex:l3,traverseReadonlyNonEmptyArrayWithIndex:l5,tryCatch:lG,tryCatchK:function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return lG(function(){return e.apply(void 0,t)})}},wilt:function(e){var t=lF(e);return function(e){return function(n){return t(n,e)}}},wither:function(e){var t=lj(e);return function(e){return function(n){return t(n,e)}}},zero:lg},Symbol.toStringTag,{value:"Module"}));function cr(e,t){return function(n){return e.map(n,t.compact)}}function ci(e,t,n){var r=cr(e,t),i=eV(e,n);return function(e){return iU(r(eg(e,i(sZ))),r(eg(e,i(sJ))))}}let co=Object.freeze(Object.defineProperty({__proto__:null,compact:cr,getCompactableComposition:function(e,t){return{map:eH(e,t).map,compact:cr(e,t),separate:ci(e,t,t)}},separate:ci},Symbol.toStringTag,{value:"Module"})),ca=Object.freeze(Object.defineProperty({__proto__:null,error:function(e){return function(){return console.error(e)}},info:function(e){return function(){return console.info(e)}},log:function(e){return function(){return console.log(e)}},warn:function(e){return function(){return console.warn(e)}}},Symbol.toStringTag,{value:"Module"}));function cu(e){return{URI:cg,_E:void 0,map:cc,ap:function(t,n){return es(e.concat(t,n))}}}function cs(e){var t=cu(e);return{URI:cg,_E:void 0,map:t.map,ap:t.ap,of:function(){return es(e.empty)}}}var cl=function(e,t){return eg(e,cp())},cc=function(e,t){return eg(e,cA())},cd=function(e,t,n){return eg(e,ch(t))},cf=function(e,t){return eg(e,cm(t))},cp=function(){return es},cA=function(){return es},ch=function(e){return function(t){return es(e(t))}},cm=function(e){return function(t){return es(e(t))}},cg="Const",cy={URI:cg,map:cc},cv=ez(cy);let cx=Object.freeze(Object.defineProperty({__proto__:null,Bifunctor:{URI:cg,bimap:cd,mapLeft:cf},Contravariant:{URI:cg,contramap:cl},Functor:cy,URI:cg,bimap:ch,const_:{URI:cg,map:cc,contramap:cl,bimap:cd,mapLeft:cf},contramap:cp,flap:cv,getApplicative:cs,getApply:cu,getBooleanAlgebra:es,getBounded:es,getEq:es,getHeytingAlgebra:es,getMonoid:es,getOrd:es,getRing:es,getSemigroup:es,getSemiring:es,getShow:function(e){return{show:function(t){return"make(".concat(e.show(t),")")}}},make:es,map:cA,mapLeft:cm},Symbol.toStringTag,{value:"Module"})),cb=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),cC=Object.freeze(Object.defineProperty({__proto__:null,Eq:{equals:function(e,t){return e.valueOf()===t.valueOf()}},Ord:eg(iT,th(function(e){return e.valueOf()})),create:function(){return new Date},eqDate:{equals:function(e,t){return e.getDate()===t.getDate()}},eqMonth:{equals:function(e,t){return e.getMonth()===t.getMonth()}},eqYear:{equals:function(e,t){return e.getFullYear()===t.getFullYear()}},now:function(){return new Date().getTime()}},Symbol.toStringTag,{value:"Module"}));var cS=function(e,t){return eg(e,cD(t))},cw=function(e,t){return eg(e,cV(t))},cI=function(e,t){return eg(e,cG(t))},c_=function(e,t,n){return eg(e,cJ(t,n))},cT=function(e){return function(t,n){return eg(t,c$(e)(n))}},cO=function(e,t,n){return eg(e,cX(t,n))},cR=function(e){var t=c0(e);return function(e,n){return eg(e,t(n))}},ck=function(e,t,n){return eg(e,c6(t,n))},cE=function(e,t){return eg(e,c5(t))},cM=function(e,t){return eg(e,c9(t))},cj=function(e,t){return eg(e,c4(t))},cF=function(e,t){return sU(t(e),function(e){return dt(e)?eO(eT(e.left)):dt(e.right)?eT(t(e.right.left)):eO(eO(e.right.right))})},cU="Either",cL=function(e){return{concat:function(t,n){return dt(n)?t:dt(t)?n:eO(e.concat(t.right,n.right))}}},cK=function(e){var t=eT(e.empty);return{URI:cU,_E:void 0,compact:function(e){return dt(e)?e:"None"===e.right._tag?t:eO(e.right.value)},separate:function(e){return dt(e)?iU(e,e):dt(e.right)?iU(eO(e.right.left),t):iU(t,eO(e.right.right))}}},cB=function(e){var t=eT(e.empty),n=cK(e);return{URI:cU,_E:void 0,map:cS,compact:n.compact,separate:n.separate,filter:function(e,n){return dt(e)||n(e.right)?e:t},filterMap:function(e,n){if(dt(e))return e;var r=n(e.right);return"None"===r._tag?t:eO(r.value)},partition:function(e,n){return dt(e)?iU(e,e):n(e.right)?iU(t,eO(e.right)):iU(eO(e.right),t)},partitionMap:function(e,n){if(dt(e))return iU(e,e);var r=n(e.right);return dt(r)?iU(eO(r.left),t):iU(t,eO(r.right))}}},cP=function(e){return{URI:cU,_E:void 0,map:cS,ap:function(t,n){return dt(t)?dt(n)?eT(e.concat(t.left,n.left)):t:dt(n)?n:eO(t.right(n.right))},of:cq}},cW=function(e){return{URI:cU,_E:void 0,map:cS,alt:function(t,n){if(dn(t))return t;var r=n();return dt(r)?eT(e.concat(t.left,r.left)):r}}},cD=function(e){return function(t){return dt(t)?t:eO(e(t.right))}},cN={URI:cU,map:cS},cq=eO,cQ=function(e){return function(t){return dt(t)?t:dt(e)?e:eO(t.right(e.right))}},cV=cQ,cz={URI:cU,map:cS,ap:cw},cY={URI:cU,map:cS,ap:cw,of:cq},cH=function(e){return function(t){return dt(t)?t:e(t.right)}},cG=cH,cZ={URI:cU,map:cS,ap:cw,chain:cI},cJ=function(e,t){return function(n){return dt(n)?e:t(e,n.right)}},c$=function(e){return function(t){return function(n){return dt(n)?e.empty:t(n.right)}}},cX=function(e,t){return function(n){return dt(n)?e:t(n.right,e)}},c0=function(e){return function(t){return function(n){return dt(n)?e.of(eT(n.left)):e.map(t(n.right),eO)}}},c1=function(e){return function(t){return dt(t)?e.of(eT(t.left)):e.map(t.right,eO)}},c2={URI:cU,map:cS,reduce:c_,foldMap:cT,reduceRight:cO,traverse:cR,sequence:c1},c6=function(e,t){return function(n){return dt(n)?eT(e(n.left)):eO(t(n.right))}},c5=function(e){return function(t){return dt(t)?eT(e(t.left)):t}},c3=function(e){return function(t){return dt(t)?e():t}},c9=c3,c4=function(e){return function(t){return dt(t)?t:eO(e(t))}},c7={URI:cU,fromEither:es},c8=e6(c7),de=e2(c7),dt=eI,dn=e_,dr=function(e,t){return function(n){return dt(n)?e(n.left):t(n.right)}},di=function(e){return function(t){return dt(t)?e(t.left):t.right}},da=ez(cN),du=eB(cz),ds=eP(cz),dl=eX(cZ),dc=cH(es),dd=c4(es),df=e5(c7),dp=e3(c7,cZ),dA=e8(c7,cZ),dh=function(e){return dt(e)?eO(e.left):eT(e.right)},dm=function(e){return function(t){return dt(t)?e(t.left):t}},dg=function(e){return function(t){return null==t?eT(e):eO(t)}},dy=function(e,t){try{return eO(e())}catch(e){return eT(t(e))}},dv=function(e){var t=dg(e);return function(e){return eA(e,t)}},dx=dr(es,es),db=cq(eF),dC=eY(cN),dS=e0(cZ),dw=eW(cz),dI=cq(ej),d_=function(e){return function(t){var n=e(0,eE(t));if(dt(n))return n;for(var r=[n.right],i=1;i<t.length;i++){var o=e(i,t[i]);if(dt(o))return o;r.push(o.right)}return eO(r)}},dT=function(e){var t=d_(e);return function(e){return ek(e)?t(e):dI}},dO=function(e){return dT(function(t,n){return e(n)})},dR=dO(es),dk=eD(cz),dE=eZ(cY);let dM=Object.freeze(Object.defineProperty({__proto__:null,Alt:{URI:cU,map:cS,alt:cM},ApT:dI,Applicative:cY,Apply:cz,Bifunctor:{URI:cU,bimap:ck,mapLeft:cE},Chain:cZ,ChainRec:{URI:cU,map:cS,ap:cw,chain:cI,chainRec:cF},Do:db,Extend:{URI:cU,map:cS,extend:cj},Foldable:{URI:cU,reduce:c_,foldMap:cT,reduceRight:cO},FromEither:c7,Functor:cN,Monad:{URI:cU,map:cS,ap:cw,of:cq,chain:cI},MonadThrow:{URI:cU,map:cS,ap:cw,of:cq,chain:cI,throwError:eT},Pointed:{URI:cU,of:cq},Traversable:c2,URI:cU,alt:c9,altW:c3,ap:cV,apFirst:du,apFirstW:du,apS:dw,apSW:dw,apSecond:ds,apSecondW:ds,apW:cQ,bimap:c6,bind:dS,bindTo:dC,bindW:dS,chain:cG,chainFirst:dl,chainFirstW:dl,chainNullableK:function(e){var t=dv(e);return function(e){return cG(t(e))}},chainOptionK:dp,chainW:cH,duplicate:dd,either:{URI:cU,map:cS,of:cq,ap:cw,chain:cI,reduce:c_,foldMap:cT,reduceRight:cO,traverse:cR,sequence:c1,bimap:ck,mapLeft:cE,alt:cM,extend:cj,chainRec:cF,throwError:eT},elem:function e(t){return function(n,r){if(void 0===r){var i=e(t);return function(e){return i(n,e)}}return!dt(r)&&t.equals(n,r.right)}},exists:function(e){return function(t){return!dt(t)&&e(t.right)}},extend:c4,filterOrElse:dA,filterOrElseW:dA,flap:da,flatten:dc,flattenW:dc,fold:dr,foldMap:c$,foldW:dr,fromNullable:dg,fromNullableK:dv,fromOption:de,fromOptionK:df,fromPredicate:c8,getAltValidation:cW,getApplicativeValidation:cP,getApplyMonoid:dE,getApplySemigroup:dk,getCompactable:cK,getEq:function(e,t){return{equals:function(n,r){return n===r||(dt(n)?dt(r)&&e.equals(n.left,r.left):dn(r)&&t.equals(n.right,r.right))}}},getFilterable:cB,getOrElse:di,getOrElseW:di,getSemigroup:cL,getShow:function(e,t){return{show:function(n){return dt(n)?"left(".concat(e.show(n.left),")"):"right(".concat(t.show(n.right),")")}}},getValidation:function(e){return{URI:cU,_E:void 0,map:cS,of:cq,chain:cI,bimap:ck,mapLeft:cE,reduce:c_,foldMap:cT,reduceRight:cO,extend:cj,traverse:cR,sequence:c1,chainRec:cF,throwError:eT,ap:cP(e).ap,alt:cW(e).alt}},getValidationMonoid:function(e,t){return eZ(cP(e))(t)},getValidationSemigroup:function(e,t){return eD(cP(e))(t)},getWitherable:function(e){var t=cB(e),n=cK(e);return{URI:cU,_E:void 0,map:cS,compact:t.compact,separate:t.separate,filter:t.filter,filterMap:t.filterMap,partition:t.partition,partitionMap:t.partitionMap,traverse:cR,sequence:c1,reduce:c_,foldMap:cT,reduceRight:cO,wither:iz(c2,n),wilt:iV(c2,n)}},isLeft:dt,isRight:dn,left:eT,map:cD,mapLeft:c5,match:dr,matchW:dr,of:cq,orElse:dm,orElseW:dm,parseJSON:function(e,t){return dy(function(){return JSON.parse(e)},t)},reduce:cJ,reduceRight:cX,right:eO,sequence:c1,sequenceArray:dR,stringifyJSON:function(e,t){return dy(function(){var t=JSON.stringify(e);if("string"!=typeof t)throw Error("Converting unsupported structure to JSON");return t},t)},swap:dh,throwError:eT,toError:function(e){return e instanceof Error?e:Error(String(e))},toUnion:dx,traverse:c0,traverseArray:dO,traverseArrayWithIndex:dT,traverseReadonlyArrayWithIndex:dT,traverseReadonlyNonEmptyArrayWithIndex:d_,tryCatch:dy,tryCatchK:function(e,t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return dy(function(){return e.apply(void 0,n)},t)}}},Symbol.toStringTag,{value:"Module"}));function dj(e){return eA(eO,e.of)}function dF(e){return eA(eT,e.of)}function dU(e){return function(t){return e.map(t,eO)}}function dL(e){return function(t){return e.map(t,eT)}}function dK(e){return function(t){return eA(dg(t),e.of)}}function dB(e){var t=dK(e);return function(e){var n=t(e);return function(e){return eA(e,n)}}}function dP(e){var t=dN(e),n=dB(e);return function(e){var r=n(e);return function(e){return t(r(e))}}}function dW(e){return eV(e,cN)}function dD(e){return eK(e,cz)}function dN(e){return function(t){return function(n){return e.chain(n,function(n){return dt(n)?e.of(n):t(n.right)})}}}function dq(e){return function(t){return function(n){return e.chain(n,function(n){return dt(n)?t():e.of(n)})}}}function dQ(e){return function(t,n){return function(r){return e.map(r,c6(t,n))}}}function dV(e){return function(t){return function(n){return e.map(n,c5(t))}}}function dz(e,t){return function(n){return function(r){return e.chain(r,dr(function(r){return e.map(n(),c5(function(e){return t.concat(r,e)}))},dj(e)))}}}function dY(e){return function(t,n){return function(r){return e.map(r,dr(t,n))}}}function dH(e){return function(t,n){return function(r){return e.chain(r,dr(t,n))}}}function dG(e){return function(t){return function(n){return e.chain(n,dr(t,e.of))}}}function dZ(e){return function(t){return function(n){return e.chain(n,function(n){return dt(n)?t(n.left):e.of(n)})}}}function dJ(e){var t=dZ(e);return function(n){return t(function(t){return e.map(n(t),function(e){return dt(e)?e:eT(t)})})}}function d$(e){return function(t){return function(n){return e.chain(n,dr(function(n){return e.map(t(n),eT)},function(t){return e.of(eO(t))}))}}}function dX(e){return function(t){return e.map(t,dh)}}function d0(e){return function(t){return e.map(t,dx)}}let d1=Object.freeze(Object.defineProperty({__proto__:null,alt:dq,altValidation:dz,ap:dD,bimap:dQ,chain:dN,chainNullableK:dP,fromNullable:dK,fromNullableK:dB,getEitherM:function(e){var t=dD(e),n=dW(e),r=dN(e),i=dq(e),o=dQ(e),a=dV(e),u=dH(e),s=dG(e),l=dZ(e);return{map:function(e,t){return eg(e,n(t))},ap:function(e,n){return eg(e,t(n))},of:dj(e),chain:function(e,t){return eg(e,r(t))},alt:function(e,t){return eg(e,i(t))},bimap:function(e,t,n){return eg(e,o(t,n))},mapLeft:function(e,t){return eg(e,a(t))},fold:function(e,t,n){return eg(e,u(t,n))},getOrElse:function(e,t){return eg(e,s(t))},orElse:function(e,t){return eg(e,l(t))},swap:dX(e),rightM:dU(e),leftM:dL(e),left:dF(e)}},getOrElse:dG,left:dF,leftF:dL,map:dW,mapLeft:dV,match:dY,matchE:dH,orElse:dZ,orElseFirst:dJ,orLeft:d$,right:dj,rightF:dU,swap:dX,toUnion:d0},Symbol.toStringTag,{value:"Module"}));var d2=function(){return{concat:function(e,t){return eA(e,t)}}},d6=function(){return{concat:d2().concat,empty:es}};let d5=Object.freeze(Object.defineProperty({__proto__:null,URI:"Endomorphism",getMonoid:d6,getSemigroup:d2},Symbol.toStringTag,{value:"Module"})),d3=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));function d9(e,t){var n=t.zero,r=function(i,o){return e.equals(o,n)?i:r(o,t.mod(i,o))};return r}let d4=Object.freeze(Object.defineProperty({__proto__:null,fieldNumber:{add:function(e,t){return e+t},zero:0,mul:function(e,t){return e*t},one:1,sub:function(e,t){return e-t},degree:function(e){return 1},div:function(e,t){return e/t},mod:function(e,t){return e%t}},gcd:d9,lcm:function(e,t){var n=t.zero,r=d9(e,t);return function(i,o){return e.equals(i,n)||e.equals(o,n)?n:t.div(t.mul(i,o),r(i,o))}}},Symbol.toStringTag,{value:"Module"}));function d7(e,t){return function(n){return function(r){return e.map(r,function(e){return t.filter(e,n)})}}}function d8(e,t){return function(n){return function(r){return e.map(r,function(e){return t.filterMap(e,n)})}}}function fe(e,t){var n=d7(e,t);return function(e){var t=n(sV(e)),r=n(e);return function(e){return iU(t(e),r(e))}}}function ft(e,t){var n=d8(e,t);return function(e){return function(t){return iU(eg(t,n(function(t){return sZ(e(t))})),eg(t,n(function(t){return sJ(e(t))})))}}}let fn=Object.freeze(Object.defineProperty({__proto__:null,filter:d7,filterMap:d8,getFilterableComposition:function(e,t){var n=eH(e,t).map,r=cr(e,t),i=ci(e,t,t),o=d7(e,t),a=d8(e,t),u=fe(e,t),s=ft(e,t);return{map:n,compact:r,separate:i,filter:function(e,t){return eg(e,o(t))},filterMap:function(e,t){return eg(e,a(t))},partition:function(e,t){return eg(e,u(t))},partitionMap:function(e,t){return eg(e,s(t))}}},partition:fe,partitionMap:ft},Symbol.toStringTag,{value:"Module"})),fr=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));function fi(e,t){return function(n,r){return function(i){return e.reduce(i,n,function(e,n){return t.reduce(n,e,r)})}}}function fo(e,t){return function(n){var r=e.foldMap(n),i=t.foldMap(n);return function(e){return function(t){return r(t,function(t){return i(t,e)})}}}}function fa(e,t){return function(n,r){return function(i){return e.reduceRight(i,n,function(e,n){return t.reduceRight(e,n,r)})}}}function fu(e){return function(t){return e.reduce(t,[],function(e,t){return e.push(t),e})}}function fs(e,t){var n=fi(e,t),r=fo(e,t),i=fa(e,t);return{reduce:function(e,t,r){return eg(e,n(t,r))},foldMap:function(e){var t=r(e);return function(e,n){return eg(e,t(n))}},reduceRight:function(e,t,n){return eg(e,i(t,n))}}}let fl=Object.freeze(Object.defineProperty({__proto__:null,foldM:function(e,t){return function(n,r,i){return t.reduce(n,e.of(r),function(t,n){return e.chain(t,function(e){return i(e,n)})})}},foldMap:fo,getFoldableComposition:fs,intercalate:function(e,t){return function(n,r){return t.reduce(r,{init:!0,acc:e.empty},function(t,r){var i=t.init,o=t.acc;return i?{init:!1,acc:r}:{init:!1,acc:e.concat(e.concat(o,n),r)}}).acc}},reduce:fi,reduceM:function(e,t){return function(n,r){return function(i){return t.reduce(i,e.of(n),function(t,n){return e.chain(t,function(e){return r(e,n)})})}}},reduceRight:fa,toArray:fu,toReadonlyArray:fu,traverse_:function(e,t){var n=e.of(void 0);return function(r,i){return t.reduce(r,n,function(t,n){var r;return r=i(n),e.ap(e.map(t,el),r)})}}},Symbol.toStringTag,{value:"Module"}));function fc(e,t){return function(n,r){return function(i){return e.reduceWithIndex(i,n,function(e,n,i){return t.reduceWithIndex(i,n,function(t,n,i){return r([e,t],n,i)})})}}}function fd(e,t){return function(n){var r=e.foldMapWithIndex(n),i=t.foldMapWithIndex(n);return function(e){return function(t){return r(t,function(t,n){return i(n,function(n,r){return e([t,n],r)})})}}}}function ff(e,t){return function(n,r){return function(i){return e.reduceRightWithIndex(i,n,function(e,n,i){return t.reduceRightWithIndex(n,i,function(t,n,i){return r([e,t],n,i)})})}}}let fp=Object.freeze(Object.defineProperty({__proto__:null,foldMapWithIndex:fd,getFoldableWithIndexComposition:function(e,t){var n=fs(e,t),r=fc(e,t),i=fd(e,t),o=ff(e,t);return{reduce:n.reduce,foldMap:n.foldMap,reduceRight:n.reduceRight,reduceWithIndex:function(e,t,n){return eg(e,r(t,n))},foldMapWithIndex:function(e){var t=i(e);return function(e,n){return eg(e,t(n))}},reduceRightWithIndex:function(e,t,n){return eg(e,o(t,n))}}},reduceRightWithIndex:ff,reduceWithIndex:fc},Symbol.toStringTag,{value:"Module"}));function fA(e){return function(t){return eA(t,e.fromIO)}}function fh(e,t){return function(n){var r=eA(n,e.fromIO);return function(e){return t.chain(e,r)}}}function fm(e,t){var n=eX(t);return function(t){return n(eA(t,e.fromIO))}}let fg=Object.freeze(Object.defineProperty({__proto__:null,chainFirstIOK:fm,chainIOK:fh,fromIOK:fA},Symbol.toStringTag,{value:"Module"}));var fy=function(){return es},fv=function(e){return function(t){return function(n){return t(e(n))}}},fx=function(e){return function(t){return e(t)(t)}},fb=function(e,t){return eg(e,f_(t))},fC=function(e,t){return eg(e,fO(t))},fS=function(e,t){return eg(e,fk(t))},fw=function(e,t){return eg(e,fM(t))},fI=function(e,t,n){return eg(e,fj(t,n))},f_=function(e){return function(t){return function(n){return e(t(n))}}},fT=function(e){return function(t){return function(n){return t(n)(e(n))}}},fO=fT,fR=function(e){return function(t){return function(n){return e(t(n))(n)}}},fk=fR,fE=fR(es),fM=function(e){return function(t){return eA(e,t)}},fj=function(e,t){return function(n){return function(r){return t(n(e(r)))}}},fF=function(){return es},fU=function(e){return function(t){var n=t[0],r=t[1];return[e(n),r]}},fL=function(e){return function(t){return[t[0],e(t[1])]}},fK=function(e){return dr(function(t){return eT(e(t))},eO)},fB=function(e){return dr(eT,function(t){return eO(e(t))})},fP="Reader",fW={URI:fP,map:fb},fD=ez(fW),fN={URI:fP,of:el},fq={URI:fP,map:fb,ap:fC},fQ=eB(fq),fV=eP(fq),fz={URI:fP,map:fb,ap:fC,of:el},fY={URI:fP,map:fb,ap:fC,chain:fS},fH={URI:fP,map:fb,of:el,ap:fC,chain:fS},fG=eX(fY),fZ=eY(fW),fJ=e0(fY),f$=el(eF),fX=eW(fq),f0=el(ej),f1=function(e){return function(t){return function(n){for(var r=[e(0,eE(t))(n)],i=1;i<t.length;i++)r.push(e(i,t[i])(n));return r}}},f2=function(e){var t=f1(e);return function(e){return ek(e)?t(e):f0}},f6=function(e){return f2(function(t,n){return e(n)})},f5=f6(es),f3=eD(fq),f9=eZ(fz);let f4=Object.freeze(Object.defineProperty({__proto__:null,ApT:f0,Applicative:fz,Apply:fq,Category:{URI:fP,compose:fw,id:fF},Chain:fY,Choice:{URI:fP,map:fb,promap:fI,left:fK,right:fB},Do:f$,Functor:fW,Monad:fH,Pointed:fN,Profunctor:{URI:fP,map:fb,promap:fI},Strong:{URI:fP,map:fb,promap:fI,first:fU,second:fL},URI:fP,ap:fO,apFirst:fQ,apFirstW:fQ,apS:fX,apSW:fX,apSecond:fV,apSecondW:fV,apW:fT,ask:fy,asks:es,asksReader:fx,asksReaderW:fx,bind:fJ,bindTo:fZ,bindW:fJ,chain:fk,chainFirst:fG,chainFirstW:fG,chainW:fR,compose:fM,first:fU,flap:fD,flatten:fE,flattenW:fE,getMonoid:f9,getSemigroup:f3,id:fF,left:fK,local:fv,map:f_,of:el,promap:fj,reader:{URI:fP,map:fb,of:el,ap:fC,chain:fS,promap:fI,compose:fw,id:fF,first:fU,second:fL,left:fK,right:fB},right:fB,second:fL,sequenceArray:f5,traverseArray:f6,traverseArrayWithIndex:f2,traverseReadonlyArrayWithIndex:f2,traverseReadonlyNonEmptyArrayWithIndex:f1},Symbol.toStringTag,{value:"Module"}));function f7(e){return function(){return e.fromReader(fy())}}function f8(e){return e.fromReader}function pe(e){return function(t){return eA(t,e.fromReader)}}function pt(e,t){var n=pe(e);return function(e){return function(r){return t.chain(r,n(e))}}}function pn(e,t){return eA(pe(e),eX(t))}let pr=Object.freeze(Object.defineProperty({__proto__:null,ask:f7,asks:f8,chainFirstReaderK:pn,chainReaderK:pt,fromReaderK:pe},Symbol.toStringTag,{value:"Module"}));var pi=function(){return function(e){return[e,e]}},po=function(e){return function(){return[void 0,e]}},pa=function(e){return function(t){return[void 0,e(t)]}},pu=function(e){return function(t){return[e(t),t]}},ps=function(e,t){return eg(e,pd(t))},pl=function(e,t){return eg(e,pf(t))},pc=function(e,t){return eg(e,pA(t))},pd=function(e){return function(t){return function(n){var r=t(n),i=r[0],o=r[1];return[e(i),o]}}},pf=function(e){return function(t){return function(n){var r=t(n),i=r[0],o=e(r[1]),a=o[0],u=o[1];return[i(a),u]}}},pp=function(e){return function(t){return[e,t]}},pA=function(e){return function(t){return function(n){var r=t(n),i=r[0],o=r[1];return e(i)(o)}}},ph=pA(es),pm="State",pg={URI:pm,map:ps},py=ez(pg),pv={URI:pm,map:ps,ap:pl},px=eB(pv),pb=eP(pv),pC={URI:pm,map:ps,ap:pl,chain:pc},pS={URI:pm,map:ps,ap:pl,of:pp,chain:pc},pw=eX(pC),pI=eY(pg),p_=e0(pC),pT=eW(pv),pO=function(e){return function(t){return function(n){for(var r=e(0,eE(t))(n),i=r[0],o=r[1],a=[i],u=o,s=1;s<t.length;s++){var l=e(s,t[s])(u),c=l[0],d=l[1];a.push(c),u=d}return[a,u]}}},pR=function(e){var t=pO(e);return function(e){return ek(e)?t(e):pp(ej)}},pk=function(e){return pR(function(t,n){return e(n)})},pE=pk(es);let pM=Object.freeze(Object.defineProperty({__proto__:null,Applicative:{URI:pm,map:ps,ap:pl,of:pp},Apply:pv,Chain:pC,FromState:{URI:pm,fromState:es},Functor:pg,Monad:pS,Pointed:{URI:pm,of:pp},URI:pm,ap:pf,apFirst:px,apS:pT,apSecond:pb,bind:p_,bindTo:pI,chain:pA,chainFirst:pw,evalState:function(e,t){return e(t)[0]},evaluate:function(e){return function(t){return t(e)[0]}},execState:function(e,t){return e(t)[1]},execute:function(e){return function(t){return t(e)[1]}},flap:py,flatten:ph,get:pi,gets:pu,map:pd,modify:pa,of:pp,put:po,sequenceArray:pE,state:pS,traverseArray:pk,traverseArrayWithIndex:pR,traverseReadonlyArrayWithIndex:pR,traverseReadonlyNonEmptyArrayWithIndex:pO},Symbol.toStringTag,{value:"Module"}));function pj(e){return function(){return e.fromState(pi())}}function pF(e){return function(t){return e.fromState(po(t))}}function pU(e){return eA(pa,e.fromState)}function pL(e){return eA(pu,e.fromState)}function pK(e){return function(t){return eA(t,e.fromState)}}function pB(e,t){var n=pK(e);return function(e){return function(r){return t.chain(r,n(e))}}}let pP=Object.freeze(Object.defineProperty({__proto__:null,chainStateK:pB,fromStateK:pK,get:pj,gets:pL,modify:pU,put:pF},Symbol.toStringTag,{value:"Module"}));function pW(e){return function(t){return eA(t,e.fromTask)}}function pD(e,t){return function(n){var r=eA(n,e.fromTask);return function(e){return t.chain(e,r)}}}function pN(e,t){var n=eX(t);return function(t){return n(eA(t,e.fromTask))}}let pq=Object.freeze(Object.defineProperty({__proto__:null,chainFirstTaskK:pN,chainTaskK:pD,fromTaskK:pW},Symbol.toStringTag,{value:"Module"}));function pQ(e){return function(t){return eA(t,e.fromThese)}}let pV=Object.freeze(Object.defineProperty({__proto__:null,fromTheseK:pQ},Symbol.toStringTag,{value:"Module"}));function pz(e,t){return function(n){return function(r){return e.mapWithIndex(r,function(e,r){return t.mapWithIndex(r,function(t,r){return n([e,t],r)})})}}}let pY=Object.freeze(Object.defineProperty({__proto__:null,getFunctorWithIndexComposition:function(e,t){var n=eH(e,t).map,r=pz(e,t);return{map:n,mapWithIndex:function(e,t){return eg(e,r(t))}}},mapWithIndex:pz},Symbol.toStringTag,{value:"Module"})),pH=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),pG=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),pZ=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var pJ=function(e,t){return eg(e,p9(t))},p$=function(e,t){return eg(e,p4(t))},pX=function(e,t){return eg(e,p7(t))},p0=function(e,t,n){return eg(e,An(t,n))},p1=function(e){return function(e,t){return eg(e,Ar()(t))}},p2=function(e,t,n){return eg(e,Ai(t,n))},p6=function(e,t){return eg(e,As())},p5=function(e,t){return eg(e,p8(t))},p3=function(e){var t=Ao(e);return function(e,n){return eg(e,t(n))}},p9=function(e){return function(t){return e(t)}},p4=function(e){return function(t){return t(e)}},p7=function(e){return function(t){return e(t)}},p8=function(e){return function(t){return e(t)}},Ae=p8(es),At=p7(es),An=function(e,t){return function(n){return t(e,n)}},Ar=function(){return function(e){return function(t){return e(t)}}},Ai=function(e,t){return function(n){return t(n,e)}},Ao=function(e){return function(t){return function(n){return e.map(t(n),es)}}},Aa=function(e){return function(t){return e.map(t,es)}},Au=function(){return es},As=Au,Al="Identity",Ac={URI:Al,map:pJ},Ad=ez(Ac),Af={URI:Al,map:pJ,ap:p$},Ap=eB(Af),AA=eP(Af),Ah={URI:Al,map:pJ,ap:p$,chain:pX},Am=eX(Ah),Ag=es(eF),Ay=eY(Ac),Av=e0(Ah),Ax=eW(Af);let Ab=Object.freeze(Object.defineProperty({__proto__:null,Alt:{URI:Al,map:pJ,alt:p6},Applicative:{URI:Al,map:pJ,ap:p$,of:es},Apply:Af,Chain:Ah,ChainRec:{URI:Al,map:pJ,ap:p$,chain:pX,chainRec:sU},Comonad:{URI:Al,map:pJ,extend:p5,extract:es},Do:Ag,Foldable:{URI:Al,reduce:p0,foldMap:p1,reduceRight:p2},Functor:Ac,Monad:{URI:Al,map:pJ,ap:p$,of:es,chain:pX},Pointed:{URI:Al,of:es},Traversable:{URI:Al,map:pJ,reduce:p0,foldMap:p1,reduceRight:p2,traverse:p3,sequence:Aa},URI:Al,alt:As,altW:Au,ap:p4,apFirst:Ap,apS:Ax,apSecond:AA,bind:Av,bindTo:Ay,chain:p7,chainFirst:Am,duplicate:Ae,extend:p8,extract:es,flap:Ad,flatten:At,foldMap:Ar,getEq:es,getShow:es,identity:{URI:Al,map:pJ,ap:p$,of:es,chain:pX,reduce:p0,foldMap:p1,reduceRight:p2,traverse:p3,sequence:Aa,alt:p6,extract:es,extend:p5,chainRec:sU},map:p9,of:es,reduce:An,reduceRight:Ai,sequence:Aa,traverse:Ao},Symbol.toStringTag,{value:"Module"})),AC=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var AS=function(e,t){return function(){return t(e())}},Aw=function(e,t){return function(){return e()(t())}},AI=function(e,t){return function(){return t(e())()}},A_=function(e,t){return function(){for(var n=t(e)();"Left"===n._tag;)n=t(n.left)();return n.right}},AT=function(e){return function(t){return AS(t,e)}},AO=function(e){return function(t){return AI(t,e)}},AR=AO(es),Ak={URI:"IO",map:AS},AE=ez(Ak),AM={URI:"IO",of:el},Aj={URI:"IO",map:AS,ap:Aw},AF=eB(Aj),AU=eP(Aj),AL={URI:"IO",map:AS,ap:Aw,of:el},AK={URI:"IO",map:AS,ap:Aw,chain:AI},AB={URI:"IO",map:AS,ap:Aw,of:el,chain:AI},AP=eX(AK),AW=el(eF),AD=eY(Ak),AN=e0(AK),Aq=eW(Aj),AQ=el(ej),AV=function(e){return function(t){return function(){for(var n=[e(0,eE(t))()],r=1;r<t.length;r++)n.push(e(r,t[r])());return n}}},Az=function(e){var t=AV(e);return function(e){return ek(e)?t(e):AQ}},AY=function(e){return Az(function(t,n){return e(n)})},AH=AY(es),AG=eD(Aj),AZ=eZ(AL);let AJ=Object.freeze(Object.defineProperty({__proto__:null,ApT:AQ,Applicative:AL,Apply:Aj,Chain:AK,ChainRec:{URI:"IO",map:AS,ap:Aw,chain:AI,chainRec:A_},Do:AW,FromIO:{URI:"IO",fromIO:es},Functor:Ak,Monad:AB,MonadIO:{URI:"IO",map:AS,ap:Aw,of:el,chain:AI,fromIO:es},Pointed:AM,URI:"IO",ap:function(e){return function(t){return Aw(t,e)}},apFirst:AF,apS:Aq,apSecond:AU,bind:AN,bindTo:AD,chain:AO,chainFirst:AP,flap:AE,flatten:AR,fromIO:es,getMonoid:AZ,getSemigroup:AG,io:{URI:"IO",map:AS,of:el,ap:Aw,chain:AI,fromIO:es,chainRec:A_},map:AT,of:el,sequenceArray:AH,traverseArray:AY,traverseArrayWithIndex:Az,traverseReadonlyArrayWithIndex:Az,traverseReadonlyNonEmptyArrayWithIndex:AV},Symbol.toStringTag,{value:"Module"}));var A$=dF(AM),AX=dj(AM),A0=dU(Ak),A1=dL(Ak),A2=dY(Ak),A6=dH(AB),A5=dG(AB),A3=function(e,t){return function(){return dy(e,t)}},A9=d0(Ak),A4=dZ(AB),A7=dJ(AB),A8=d$(AB),he=dX(Ak),ht=function(e,t){return eg(e,hu(t))},hn=function(e,t){return eg(e,hc(t))},hr=function(e,t){return eg(e,hd(t))},hi=function(e,t,n){return eg(e,hs(t,n))},ho=function(e,t){return eg(e,hl(t))},ha=function(e,t){return eg(e,hp(t))},hu=dW(Ak),hs=dQ(Ak),hl=dV(Ak),hc=dD(Aj),hd=dN(AB),hf=hd(es),hp=dq(AB),hA="IOEither";function hh(e){var t=eK(Aj,cP(e));return{URI:hA,_E:void 0,map:ht,ap:function(e,n){return eg(e,t(n))},of:AX}}function hm(e){var t=dz(AB,e);return{URI:hA,_E:void 0,map:ht,alt:function(e,n){return eg(e,t(n))}}}var hg=function(e){var t=cK(e);return{URI:hA,_E:void 0,compact:cr(Ak,t),separate:ci(Ak,t,cN)}},hy={URI:hA,map:ht},hv=ez(hy),hx={URI:hA,map:ht,ap:hn},hb=eB(hx),hC=eP(hx),hS={URI:hA,map:ht,ap:hn,of:AX},hw={URI:hA,map:ht,ap:hn,chain:hr},hI=eX(hw),h_={URI:hA,fromIO:A0},hT=fA(h_),hO=fh(h_,hw),hR=fm(h_,hw),hk={URI:hA,fromEither:el},hE=e2(hk),hM=e5(hk),hj=e3(hk,hw),hF=e4(hk,hw),hU=e7(hk,hw),hL=e6(hk),hK=e8(hk,hw),hB=e9(hk),hP=function(e,t,n){return eg(e,hd(function(e){return eg(t(e),AO(function(t){return eg(n(e,t),hd(function(){return el(t)}))}))}))},hW=AX(eF),hD=eY(hy),hN=e0(hw),hq=eW(hx),hQ=AX(ej),hV=function(e){return eA(AV(e),AT(d_(ey)))},hz=function(e){var t=hV(e);return function(e){return ek(e)?t(e):hQ}},hY=function(e){return function(t){return function(){var n=e(0,eE(t))();if(eI(n))return n;for(var r=[n.right],i=1;i<t.length;i++){var o=e(i,t[i])();if(eI(o))return o;r.push(o.right)}return eO(r)}}},hH=function(e){var t=hY(e);return function(e){return ek(e)?t(e):hQ}},hG=function(e){return hz(function(t,n){return e(n)})},hZ=hG(es),hJ=function(e){return hH(function(t,n){return e(n)})},h$=hJ(es),hX=eD(hx),h0=eZ(hS);let h1=Object.freeze(Object.defineProperty({__proto__:null,Alt:{URI:hA,map:ht,alt:ha},ApT:hQ,Applicative:hS,ApplicativePar:hS,ApplicativeSeq:{URI:hA,map:ht,ap:function(e,t){return eg(e,hd(function(e){return eg(t,hu(e))}))},of:AX},ApplyPar:hx,Bifunctor:{URI:hA,bimap:hi,mapLeft:ho},Chain:hw,Do:hW,FromEither:hk,FromIO:h_,Functor:hy,Monad:{URI:hA,map:ht,ap:hn,of:AX,chain:hr},MonadIO:{URI:hA,map:ht,ap:hn,of:AX,chain:hr,fromIO:A0},MonadThrow:{URI:hA,map:ht,ap:hn,of:AX,chain:hr,throwError:A$},Pointed:{URI:hA,of:AX},URI:hA,alt:hp,altW:hp,ap:hc,apFirst:hb,apFirstW:hb,apS:hq,apSW:hq,apSecond:hC,apSecondW:hC,apW:hc,bimap:hs,bind:hN,bindTo:hD,bindW:hN,bracket:function(e,t,n){return hP(e,t,n)},bracketW:hP,chain:hd,chainEitherK:hF,chainEitherKW:hF,chainFirst:hI,chainFirstEitherK:hU,chainFirstEitherKW:hU,chainFirstIOK:hR,chainFirstW:hI,chainIOK:hO,chainOptionK:hj,chainW:hd,filterOrElse:hK,filterOrElseW:hK,flap:hv,flatten:hf,flattenW:hf,fold:A6,foldW:A6,fromEither:el,fromEitherK:hB,fromIO:A0,fromIOK:hT,fromOption:hE,fromOptionK:hM,fromPredicate:hL,getAltIOValidation:hm,getApplicativeIOValidation:hh,getApplyMonoid:h0,getApplySemigroup:hX,getCompactable:hg,getFilterable:function(e){var t=cB(e),n=hg(e),r=d7(Ak,t),i=d8(Ak,t),o=fe(Ak,t),a=ft(Ak,t);return{URI:hA,_E:void 0,map:ht,compact:n.compact,separate:n.separate,filter:function(e,t){return eg(e,r(t))},filterMap:function(e,t){return eg(e,i(t))},partition:function(e,t){return eg(e,o(t))},partitionMap:function(e,t){return eg(e,a(t))}}},getIOValidation:function(e){var t=hh(e),n=hm(e);return{URI:hA,_E:void 0,map:ht,ap:t.ap,of:AX,chain:hr,bimap:hi,mapLeft:ho,alt:n.alt,fromIO:A0,throwError:A$}},getOrElse:A5,getOrElseW:A5,getSemigroup:function(e){return eD(Aj)(cL(e))},ioEither:{URI:hA,bimap:hi,mapLeft:ho,map:ht,of:AX,ap:hn,chain:hr,alt:ha,fromIO:A0,throwError:A$},left:A$,leftIO:A1,map:hu,mapLeft:hl,match:A2,matchE:A6,matchEW:A6,matchW:A2,of:AX,orElse:A4,orElseFirst:A7,orElseFirstIOK:function(e){return A7(hT(e))},orElseFirstW:A7,orElseW:A4,orLeft:A8,right:AX,rightIO:A0,sequenceArray:hZ,sequenceSeqArray:h$,swap:he,throwError:A$,toUnion:A9,traverseArray:hG,traverseArrayWithIndex:hz,traverseReadonlyArrayWithIndex:hz,traverseReadonlyArrayWithIndexSeq:hH,traverseReadonlyNonEmptyArrayWithIndex:hV,traverseReadonlyNonEmptyArrayWithIndexSeq:hY,traverseSeqArray:hJ,traverseSeqArrayWithIndex:hH,tryCatch:A3,tryCatchK:function(e,t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return A3(function(){return e.apply(void 0,n)},t)}}},Symbol.toStringTag,{value:"Module"}));function h2(e){return eA(ew,e.of)}function h6(e){return el(e.of(eS))}function h5(e){return function(t){return e.map(t,ew)}}function h3(e){return eA(lH,e.of)}function h9(e){var t=h3(e);return function(e){return eA(e,t)}}function h4(e){var t=mu(e),n=h9(e);return function(e){return t(n(e))}}function h7(e){return function(t){return eA(t,e.of)}}function h8(e){var t=mu(e),n=h7(e);return function(e){return t(n(e))}}function me(e){return function(t){return function(n){return e.of(sG(t)(n))}}}function mt(e){return eA(sJ,e.of)}function mn(e){return function(t,n){return function(r){return e.map(r,lB(t,n))}}}function mr(e){return function(t,n){return function(r){return e.chain(r,lB(t,n))}}}function mi(e){return function(t){return function(n){return e.chain(n,lB(t,e.of))}}}function mo(e){return eV(e,lo)}function ma(e){return eK(e,ls)}function mu(e){var t=h6(e);return function(n){return function(r){return e.chain(r,lB(function(){return t()},n))}}}function ms(e){var t=h2(e);return function(n){return function(r){return e.chain(r,lB(n,t))}}}let ml=Object.freeze(Object.defineProperty({__proto__:null,alt:ms,ap:ma,chain:mu,chainNullableK:h4,chainOptionK:h8,fromEither:mt,fromF:h5,fromNullable:h3,fromNullableK:h9,fromOptionK:h7,fromPredicate:me,getOptionM:function(e){var t=ma(e),n=mo(e),r=mu(e),i=ms(e),o=mr(e),a=mi(e),u=h6(e);return{map:function(e,t){return eg(e,n(t))},ap:function(e,n){return eg(e,t(n))},of:h2(e),chain:function(e,t){return eg(e,r(t))},alt:function(e,t){return eg(e,i(t))},fold:function(e,t,n){return eg(e,o(t,n))},getOrElse:function(e,t){return eg(e,a(t))},fromM:h5(e),none:function(){return u()}}},getOrElse:mi,map:mo,match:mn,matchE:mr,some:h2,zero:h6},Symbol.toStringTag,{value:"Module"}));var mc=h2(AM),md=me(AM),mf=mt(AM),mp=h5(Ak),mA=AT(sJ),mh=mn(Ak),mm=mr(AK),mg=mi(AB),my=AT(l$),mv=AT(lJ),mx=h3(AM),mb=h9(AM),mC=h4(AB),mS=h7(AM),mw=h8(AB),mI=mo(Ak),m_=ma(Aj),mT=mu(AB),mO=mT(es),mR=ms(AB),mk=h6(AM),mE=mk(),mM=cr(Ak,lw),mj=ci(Ak,lw,lo),mF=d7(Ak,lR),mU=d8(Ak,lR),mL=fe(Ak,lR),mK=ft(Ak,lR),mB=function(e,t){return eg(e,mI(t))},mP=function(e,t){return eg(e,m_(t))},mW=function(e,t){return eg(e,mT(t))},mD=function(e,t){return eg(e,mR(t))},mN="IOOption",mq={URI:mN,map:mB},mQ=ez(mq),mV={URI:mN,of:mc},mz={URI:mN,map:mB,ap:mP},mY=eB(mz),mH=eP(mz),mG={URI:mN,map:mB,ap:mP,chain:mW},mZ=eX(mG),mJ={URI:mN,zero:mk},m$=iG(mJ,mV),mX={URI:mN,fromIO:mp},m0=fA(mX),m1=fh(mX,mG),m2=fm(mX,mG),m6={URI:mN,fromEither:mf},m5=e9(m6),m3=e4(m6,mG),m9=e7(m6,mG),m4=mc(eF),m7=eY(mq),m8=e0(mG),ge=eW(mz),gt=mc(ej),gn=function(e){return eA(AV(e),AT(l5(ey)))};let gr=Object.freeze(Object.defineProperty({__proto__:null,Alt:{URI:mN,map:mB,alt:mD},Alternative:{URI:mN,map:mB,ap:mP,of:mc,alt:mD,zero:mk},ApT:gt,Applicative:{URI:mN,map:mB,ap:mP,of:mc},Apply:mz,Chain:mG,Compactable:{URI:mN,compact:mM,separate:mj},Do:m4,Filterable:{URI:mN,map:mB,compact:mM,separate:mj,filter:function(e,t){return eg(e,mF(t))},filterMap:function(e,t){return eg(e,mU(t))},partition:function(e,t){return eg(e,mL(t))},partitionMap:function(e,t){return eg(e,mK(t))}},FromEither:m6,FromIO:mX,Functor:mq,Monad:{URI:mN,map:mB,ap:mP,of:mc,chain:mW},MonadIO:{URI:mN,map:mB,ap:mP,of:mc,chain:mW,fromIO:mp},Pointed:mV,Zero:mJ,alt:mR,altW:mR,ap:m_,apFirst:mY,apS:ge,apSecond:mH,bind:m8,bindTo:m7,chain:mT,chainEitherK:m3,chainFirst:mZ,chainFirstEitherK:m9,chainFirstIOK:m2,chainIOK:m1,chainNullableK:mC,chainOptionK:mw,compact:mM,filter:mF,filterMap:mU,flap:mQ,flatten:mO,fold:mm,fromEither:mf,fromEitherK:m5,fromIO:mp,fromIOEither:mA,fromIOK:m0,fromNullable:mx,fromNullableK:mb,fromOption:el,fromOptionK:mS,fromPredicate:md,getOrElse:mg,getOrElseW:mg,guard:m$,map:mI,match:mh,matchE:mm,matchEW:mm,matchW:mh,none:mE,of:mc,partition:mL,partitionMap:mK,separate:mj,some:mc,toNullable:mv,toUndefined:my,traverseReadonlyArrayWithIndex:function(e){var t=gn(e);return function(e){return ek(e)?t(e):gt}},traverseReadonlyNonEmptyArrayWithIndex:gn,zero:mk},Symbol.toStringTag,{value:"Module"}));var gi=function(){function e(e){var t=this;this.value=e,this.read=function(){return t.value},this.write=this.write.bind(this),this.modify=this.modify.bind(this)}return e.prototype.write=function(e){var t=this;return function(){t.value=e}},e.prototype.modify=function(e){var t=this;return function(){t.value=e(t.value)}},e}();let go=Object.freeze(Object.defineProperty({__proto__:null,IORef:gi,newIORef:function(e){return function(){return new gi(e)}}},Symbol.toStringTag,{value:"Module"})),ga=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),gu=Object.freeze(Object.defineProperty({__proto__:null,parse:function(e){return dy(function(){return JSON.parse(e)},es)},stringify:function(e){return dy(function(){var t=JSON.stringify(e);if("string"!=typeof t)throw Error("Converting unsupported structure to JSON");return t},es)}},Symbol.toStringTag,{value:"Module"})),gs=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));function gl(e,t){return{show:function(n){var r=[];return n.forEach(function(n,i){r.push("[".concat(e.show(i),", ").concat(t.show(n),"]"))}),"new Map([".concat(r.sort().join(", "),"])")}}}var gc=function(e){return e.size},gd=function(e){return 0===e.size};function gf(e){var t=gb(e);return function(n,r){if(void 0===r){var i=gf(e);return function(e){return i(n,e)}}return eC(t(n,r))}}function gp(e){return function(t,n){if(void 0===n){var r=gp(e);return function(e){return r(t,e)}}for(var i,o=n.values();!(i=o.next()).done;){var a=i.value;if(e.equals(t,a))return!0}return!1}}var gA=function(e){return function(t){return Array.from(t.keys()).sort(e.compare)}};function gh(e){var t=gA(e);return function(e){return function(n){for(var r=[],i=t(n),o=0;o<i.length;o++){var a=i[o];r.push(e(a,n.get(a)))}return r}}}var gm=function(e){return gh(e)(function(e,t){return[e,t]})},gg=function(e){var t=gx(e);return function(e,n){var r=t(e);return function(t){var i=r(t);if(eb(i)){var o=new Map(t);return o.set(e,n),o}if(i.value[1]!==n){var o=new Map(t);return o.set(i.value[0],n),o}return t}}},gy=function(e){var t=gx(e);return function(e){return function(n){var r=t(e,n);if(eC(r)){var i=new Map(n);return i.delete(r.value[0]),i}return n}}},gv=function(e){var t=gx(e);return function(e,n){return function(r){var i=t(e,r);if(eb(i))return eS;var o=i.value,a=o[0],u=o[1],s=n(u);if(s===u)return ew(r);var l=new Map(r);return l.set(a,s),ew(l)}}};function gx(e){return function(t,n){if(void 0===n){var r=gx(e);return function(e){return r(t,e)}}for(var i,o=n.entries();!(i=o.next()).done;){var a=i.value,u=a[0],s=a[1];if(e.equals(u,t))return ew([u,s])}return eS}}function gb(e){var t=gx(e);return function(n,r){if(void 0===r){var i=gb(e);return function(e){return i(n,e)}}return eg(t(n,r),li(function(e){return e[0],e[1]}))}}function gC(e,t){var n=gx(e);return function(r,i){if(void 0===i){var o=gC(e,t);return function(e){return o(e,r)}}for(var a,u=r.entries();!(a=u.next()).done;){var s=a.value,l=s[0],c=s[1],d=n(l,i);if(eb(d)||!e.equals(l,d.value[0])||!t.equals(c,d.value[1]))return!1}return!0}}var gS=new Map;function gw(e,t){var n=gC(e,t);return tt(function(e,t){return n(e,t)&&n(t,e)})}var gI=function(e,t){for(var n,r=new Map,i=e.entries();!(n=i.next()).done;){var o=n.value,a=o[0],u=o[1];r.set(a,t(a,u))}return r},g_=function(e){return 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=e(u,a[1]);eI(s)?r.set(u,s.left):i.set(u,s.right)}return iU(r,i)}};function gT(e){return 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];e(u,s)?i.set(u,s):r.set(u,s)}return iU(r,i)}}var gO=function(e){return function(t){for(var n,r=new Map,i=t.entries();!(n=i.next()).done;){var o=n.value,a=o[0],u=e(a,o[1]);eC(u)&&r.set(a,u.value)}return r}};function gR(e){return 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];e(a,u)&&r.set(a,u)}return r}}var gk=function(e,t){return gI(e,function(e,n){return t(n)})},gE=function(e,t){return gU(e,function(e,n){return t(n)})},gM=function(e,t){return gL(e,function(e,n){return t(n)})},gj=function(e,t){return gK(e,function(e,n){return t(n)})},gF=function(e,t){return gB(e,function(e,n){return t(n)})},gU=function(e,t){return eg(e,gR(t))},gL=function(e,t){return eg(e,gO(t))},gK=function(e,t){return eg(e,gT(t))},gB=function(e,t){return eg(e,g_(t))},gP=function(e){for(var t,n=new Map,r=e.entries();!(t=r.next()).done;){var i=t.value,o=i[0],a=i[1];eC(a)&&n.set(o,a.value)}return n},gW=function(e){for(var t,n=new Map,r=new Map,i=e.entries();!(t=i.next()).done;){var o=t.value,a=o[0],u=o[1];eI(u)?n.set(a,u.left):r.set(a,u.right)}return iU(n,r)},gD="ReadonlyMap",gN=function(e,t){var n=g1(e,t);return{concat:function(e,t){return n(t)(e)}}},gq={URI:gD,map:gk},gQ=ez(gq),gV={URI:gD,compact:gP,separate:gW},gz=function(e){var t=gZ(e);return function(e,n){return t(e,function(e,t,r){return n(t,r)})}},gY=function(e){var t=gJ(e);return function(e){var n=t(e);return function(e){return n(function(t,n){return e(n)})}}},gH=function(e){var t=g$(e);return function(e,n){return t(e,function(e,t,r){return n(t,r)})}},gG=function(e){var t=gz(e),n=gY(e),r=gH(e);return{URI:gD,_E:void 0,reduce:function(e,n,r){return eg(e,t(n,r))},foldMap:function(e){var t=n(e);return function(e,n){return eg(e,t(n))}},reduceRight:function(e,t,n){return eg(e,r(t,n))}}},gZ=function(e){var t=gA(e);return function(e,n){return function(r){for(var i=e,o=0,a=t(r);o<a.length;o++){var u=a[o];i=n(u,i,r.get(u))}return i}}},gJ=function(e){var t=gA(e);return function(e){return function(n){return function(r){for(var i=e.empty,o=0,a=t(r);o<a.length;o++){var u=a[o];i=e.concat(i,n(u,r.get(u)))}return i}}}},g$=function(e){var t=gA(e);return function(e,n){return function(r){for(var i=e,o=t(r),a=o.length,u=a-1;u>=0;u--){var s=o[u];i=n(s,r.get(s),i)}return i}}},gX=function(e){var t=gG(e),n=gZ(e),r=gJ(e),i=g$(e);return{URI:gD,_E:void 0,reduce:t.reduce,foldMap:t.foldMap,reduceRight:t.reduceRight,reduceWithIndex:function(e,t,r){return eg(e,n(t,r))},foldMapWithIndex:function(e){var t=r(e);return function(e,n){return eg(e,t(n))}},reduceRightWithIndex:function(e,t,n){return eg(e,i(t,n))}}},g0=function(e){var t=gX(e),n=gA(e),r=function(e){return function(t,r){for(var i=e.of(new Map),o=n(t),a=o.length,u=0;u<a;u++)!function(n){var a=o[n],u=t.get(a);i=e.ap(e.map(i,function(e){return function(t){return e.set(a,t)}}),r(a,u))}(u);return i}};return{URI:gD,_E:void 0,map:gk,mapWithIndex:gI,reduce:t.reduce,foldMap:t.foldMap,reduceRight:t.reduceRight,reduceWithIndex:t.reduceWithIndex,foldMapWithIndex:t.foldMapWithIndex,reduceRightWithIndex:t.reduceRightWithIndex,traverse:function(e){var t=r(e);return function(e,n){return t(e,function(e,t){return n(t)})}},sequence:function(e){var t=r(e);return function(e){return t(e,ey)}},traverseWithIndex:r}},g1=function(e,t){var n=gb(e);return function(e){return function(r){if(gd(r))return e;if(gd(e))return r;for(var i,o=new Map,a=r.entries();!(i=a.next()).done;){var u=i.value,s=u[0],l=u[1],c=n(s)(e);eC(c)?o.set(s,t.concat(l,c.value)):o.set(s,l)}for(var d=e.entries();!(i=d.next()).done;){var f=i.value,s=f[0],l=f[1],c=n(s)(o);eb(c)&&o.set(s,l)}return o}}},g2=function(e,t){var n=gb(e);return function(e){return function(r){if(gd(r)||gd(e))return gS;for(var i,o=new Map,a=r.entries();!(i=a.next()).done;){var u=i.value,s=u[0],l=u[1],c=n(s)(e);eC(c)&&o.set(s,t.concat(l,c.value))}return o}}},g6=function(e){var t=gf(e);return function(e){return function(n){if(gd(n))return e;if(gd(e))return 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)(e)||i.set(u,s)}for(var l=e.entries();!(r=l.next()).done;){var c=r.value,u=c[0],s=c[1];t(u)(n)||i.set(u,s)}return i}}};let g5=Object.freeze(Object.defineProperty({__proto__:null,Compactable:gV,Filterable:{URI:gD,map:gk,compact:gP,separate:gW,filter:gE,filterMap:gM,partition:gj,partitionMap:gF},Functor:gq,URI:gD,collect:gh,compact:gP,deleteAt:gy,difference:g6,elem:gp,empty:gS,filter:function(e){return function(t){return gE(t,e)}},filterMap:function(e){return function(t){return gM(t,e)}},filterMapWithIndex:gO,filterWithIndex:gR,flap:gQ,foldMap:gY,foldMapWithIndex:gJ,fromFoldable:function(e,t,n){return function(r){var i=gx(e);return n.reduce(r,new Map,function(e,n){var r=n[0],o=n[1],a=i(r,e);return eC(a)?e.set(a.value[0],t.concat(a.value[1],o)):e.set(r,o),e})}},fromMap:function(e){return new Map(e)},getDifferenceMagma:function(e){return function(){var t=g6(e);return{concat:function(e,n){return t(n)(e)}}}},getEq:gw,getFilterableWithIndex:function(){return{URI:gD,_E:void 0,map:gk,mapWithIndex:gI,compact:gP,separate:gW,filter:gE,filterMap:gM,partition:gj,partitionMap:gF,partitionMapWithIndex:gB,partitionWithIndex:gK,filterMapWithIndex:gL,filterWithIndex:gU}},getFoldable:gG,getFoldableWithIndex:gX,getFunctorWithIndex:function(){return{URI:gD,_E:void 0,map:gk,mapWithIndex:gI}},getIntersectionSemigroup:function(e,t){var n=g2(e,t);return{concat:function(e,t){return n(t)(e)}}},getMonoid:function(e,t){var n=gx(e);return{concat:function(e,r){if(gd(e))return r;if(gd(r))return e;for(var i,o=new Map(e),a=r.entries();!(i=a.next()).done;){var u=i.value,s=u[0],l=u[1],c=n(s,e);eC(c)?o.set(c.value[0],t.concat(c.value[1],l)):o.set(s,l)}return o},empty:gS}},getShow:gl,getTraversable:function(e){var t=g0(e),n=gG(e);return{URI:gD,_E:void 0,map:gk,reduce:n.reduce,foldMap:n.foldMap,reduceRight:n.reduceRight,traverse:t.traverse,sequence:t.sequence}},getTraversableWithIndex:g0,getUnionMonoid:function(e,t){return{concat:gN(e,t).concat,empty:gS}},getUnionSemigroup:gN,getWitherable:function(e){var t=g0(e);return{URI:gD,_E:void 0,map:gk,compact:gP,separate:gW,filter:gE,filterMap:gM,partition:gj,partitionMap:gF,reduce:t.reduce,foldMap:t.foldMap,reduceRight:t.reduceRight,traverse:t.traverse,sequence:t.sequence,mapWithIndex:gI,reduceWithIndex:t.reduceWithIndex,foldMapWithIndex:t.foldMapWithIndex,reduceRightWithIndex:t.reduceRightWithIndex,traverseWithIndex:t.traverseWithIndex,wilt:iV(t,gV),wither:iz(t,gV)}},insertAt:gg,intersection:g2,isEmpty:gd,isSubmap:gC,keys:gA,lookup:gb,lookupWithKey:gx,map:function(e){return function(t){return gk(t,e)}},mapWithIndex:function(e){return function(t){return gI(t,e)}},member:gf,modifyAt:gv,partition:function(e){return function(t){return gj(t,e)}},partitionMap:function(e){return function(t){return gF(t,e)}},partitionMapWithIndex:g_,partitionWithIndex:gT,pop:function(e){var t=gb(e),n=gy(e);return function(e){var r=n(e);return function(n){return eg(t(e,n),li(function(e){return[e,r(n)]}))}}},readonlyMap:{URI:gD,map:gk,compact:gP,separate:gW,filter:gE,filterMap:gM,partition:gj,partitionMap:gF},reduce:gz,reduceRight:gH,reduceRightWithIndex:g$,reduceWithIndex:gZ,separate:gW,singleton:function(e,t){return new Map([[e,t]])},size:gc,toMap:function(e){return new Map(e)},toReadonlyArray:gm,toUnfoldable:function(e,t){var n=gm(e);return function(e){var r=n(e),i=r.length;return t.unfold(0,function(e){return e<i?ew([r[e],e+1]):eS})}},union:g1,updateAt:function(e){var t=gv(e);return function(e,n){return t(e,function(){return n})}},upsertAt:gg,values:function(e){return function(t){return Array.from(t.values()).sort(e.compare)}}},Symbol.toStringTag,{value:"Module"}));var g3=function(){return(g3=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)},g9=function(e){return function(t){return Array.from(t.keys()).sort(e.compare)}};function g4(e){var t=g9(e);return function(e){return function(n){for(var r=[],i=t(n),o=0;o<i.length;o++){var a=i[o];r.push(e(a,n.get(a)))}return r}}}function g7(e){return g4(e)(function(e,t){return[e,t]})}var g8=function(e){var t=yn(e);return function(e,n){var r=t(e);return function(t){var i=r(t);if(eb(i)){var o=new Map(t);return o.set(e,n),o}if(i.value[1]!==n){var o=new Map(t);return o.set(i.value[0],n),o}return t}}},ye=function(e){var t=yn(e);return function(e){return function(n){var r=t(e,n);if(eC(r)){var i=new Map(n);return i.delete(r.value[0]),i}return n}}},yt=function(e){var t=yn(e);return function(e,n){return function(r){var i=t(e,r);if(eb(i))return eS;var o=new Map(r);return o.set(i.value[0],n(i.value[1])),ew(o)}}};function yn(e){return function(t,n){if(void 0===n){var r=yn(e);return function(e){return r(t,e)}}for(var i,o=n.entries();!(i=o.next()).done;){var a=i.value,u=a[0],s=a[1];if(e.equals(u,t))return ew([u,s])}return eS}}var yr=gb,yi=function(e,t){for(var n,r=new Map,i=e.entries();!(n=i.next()).done;){var o=n.value,a=o[0],u=o[1];r.set(a,t(a,u))}return r},yo=function(e){return 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=e(u,a[1]);eI(s)?r.set(u,s.left):i.set(u,s.right)}return iU(r,i)}};function ya(e){return 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];e(u,s)?i.set(u,s):r.set(u,s)}return iU(r,i)}}var yu=function(e){return function(t){for(var n,r=new Map,i=t.entries();!(n=i.next()).done;){var o=n.value,a=o[0],u=e(a,o[1]);eC(u)&&r.set(a,u.value)}return r}};function ys(e){return 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];e(a,u)&&r.set(a,u)}return r}}var yl=function(e,t){return yi(e,function(e,n){return t(n)})},yc=function(e,t){return yA(e,function(e,n){return t(n)})},yd=function(e,t){return yh(e,function(e,n){return t(n)})},yf=function(e,t){return ym(e,function(e,n){return t(n)})},yp=function(e,t){return yg(e,function(e,n){return t(n)})},yA=function(e,t){return eg(e,ys(t))},yh=function(e,t){return eg(e,yu(t))},ym=function(e,t){return eg(e,ya(t))},yg=function(e,t){return eg(e,yo(t))},yy=function(e){for(var t,n=new Map,r=e.entries();!(t=r.next()).done;){var i=t.value,o=i[0],a=i[1];eC(a)&&n.set(o,a.value)}return n},yv=function(e){for(var t,n=new Map,r=new Map,i=e.entries();!(t=i.next()).done;){var o=t.value,a=o[0],u=o[1];eI(u)?n.set(a,u.left):r.set(a,u.right)}return iU(n,r)},yx=function(e,t){var n=yO(e,t);return{concat:function(e,t){return n(t)(e)}}},yb=function(e){return g3(g3({},gX(e)),{URI:"Map"})},yC=function(e){var t=yb(e),n=g9(e),r=function(e){return function(t,r){for(var i=e.of(new Map),o=n(t),a=o.length,u=0;u<a;u++)!function(n){var a=o[n],u=t.get(a);i=e.ap(e.map(i,function(e){return function(t){return e.set(a,t)}}),r(a,u))}(u);return i}};return{URI:"Map",_E:void 0,map:yl,mapWithIndex:yi,reduce:t.reduce,foldMap:t.foldMap,reduceRight:t.reduceRight,reduceWithIndex:t.reduceWithIndex,foldMapWithIndex:t.foldMapWithIndex,reduceRightWithIndex:t.reduceRightWithIndex,traverse:function(e){var t=r(e);return function(e,n){return t(e,function(e,t){return n(t)})}},sequence:function(e){var t=r(e);return function(e){return t(e,function(e,t){return t})}},traverseWithIndex:r}},yS={URI:"Map",map:yl},yw=ez(yS),yI={URI:"Map",compact:yy,separate:yv},y_={URI:"Map",map:yl,compact:yy,separate:yv,filter:yc,filterMap:yd,partition:yf,partitionMap:yp},yT=function(e){return new Map(e)},yO=function(e,t){var n=g1(e,t);return function(e){return function(t){return gd(t)?yT(e):gd(e)?yT(t):n(e)(t)}}},yR=function(e,t){var n=g2(e,t);return function(e){return function(t){return gd(t)||gd(e)?new Map:n(e)(t)}}},yk=function(e){var t=g6(e);return function(e){return function(n){return gd(n)?yT(e):gd(e)?yT(n):t(e)(n)}}};let yE=Object.freeze(Object.defineProperty({__proto__:null,Compactable:yI,Filterable:y_,Functor:yS,URI:"Map",collect:g4,compact:yy,deleteAt:ye,difference:yk,elem:gp,empty:new Map,filter:function(e){return function(t){return yc(t,e)}},filterMap:function(e){return function(t){return yd(t,e)}},filterMapWithIndex:yu,filterWithIndex:ys,flap:yw,foldMap:gY,foldMapWithIndex:gJ,fromFoldable:function(e,t,n){return function(r){var i=yn(e);return n.reduce(r,new Map,function(e,n){var r=n[0],o=n[1],a=i(r,e);return eC(a)?e.set(a.value[0],t.concat(a.value[1],o)):e.set(r,o),e})}},getDifferenceMagma:function(e){return function(){var t=yk(e);return{concat:function(e,n){return t(n)(e)}}}},getEq:gw,getFilterableWithIndex:function(){return{URI:"Map",_E:void 0,map:yl,mapWithIndex:yi,compact:yy,separate:yv,filter:yc,filterMap:yd,partition:yf,partitionMap:yp,partitionMapWithIndex:yg,partitionWithIndex:ym,filterMapWithIndex:yh,filterWithIndex:yA}},getFoldable:function(e){return g3(g3({},gG(e)),{URI:"Map"})},getFoldableWithIndex:yb,getIntersectionSemigroup:function(e,t){var n=yR(e,t);return{concat:function(e,t){return n(t)(e)}}},getMonoid:function(e,t){var n=yn(e);return{concat:function(e,r){if(gd(e))return r;if(gd(r))return e;for(var i,o=new Map(e),a=r.entries();!(i=a.next()).done;){var u=i.value,s=u[0],l=u[1],c=n(s,e);eC(c)?o.set(c.value[0],t.concat(c.value[1],l)):o.set(s,l)}return o},empty:new Map}},getShow:gl,getTraversableWithIndex:yC,getUnionMonoid:function(e,t){return{concat:yx(e,t).concat,empty:new Map}},getUnionSemigroup:yx,getWitherable:function(e){var t=yC(e);return{URI:"Map",_E:void 0,map:yl,compact:yy,separate:yv,filter:yc,filterMap:yd,partition:yf,partitionMap:yp,reduce:t.reduce,foldMap:t.foldMap,reduceRight:t.reduceRight,traverse:t.traverse,sequence:t.sequence,mapWithIndex:yi,reduceWithIndex:t.reduceWithIndex,foldMapWithIndex:t.foldMapWithIndex,reduceRightWithIndex:t.reduceRightWithIndex,traverseWithIndex:t.traverseWithIndex,wilt:iV(t,yI),wither:iz(t,yI)}},insertAt:g8,intersection:yR,isEmpty:gd,isSubmap:gC,keys:g9,lookup:yr,lookupWithKey:yn,map:function(e){return function(t){return yl(t,e)}},mapWithIndex:function(e){return function(t){return yi(t,e)}},map_:y_,member:gf,modifyAt:yt,partition:function(e){return function(t){return yf(t,e)}},partitionMap:function(e){return function(t){return yp(t,e)}},partitionMapWithIndex:yo,partitionWithIndex:ya,pop:function(e){var t=yr(e),n=ye(e);return function(e){var r=n(e);return function(n){return eg(t(e,n),li(function(e){return[e,r(n)]}))}}},reduce:gz,reduceRight:gH,reduceRightWithIndex:g$,reduceWithIndex:gZ,separate:yv,singleton:function(e,t){return new Map([[e,t]])},size:gc,toArray:g7,toUnfoldable:function(e,t){var n=g7(e);return function(e){var r=n(e),i=r.length;return t.unfold(0,function(e){return e<i?ew([r[e],e+1]):eS})}},union:yO,updateAt:function(e){var t=yt(e);return function(e,n){return t(e,function(){return n})}},upsertAt:g8,values:function(e){return function(t){return Array.from(t.values()).sort(e.compare)}}},Symbol.toStringTag,{value:"Module"})),yM=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),yj=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),yF=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),yU=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),yL=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var yK=function(e){return{concat:tE(e).concat,empty:e.top}},yB=function(e){return{concat:tM(e).concat,empty:e.bottom}},yP=function(e){return{concat:tO(e).concat,empty:e.empty}},yW=function(e){var t={};for(var n in e)eU.call(e,n)&&(t[n]=e[n].empty);return{concat:tF(e).concat,empty:t}},yD=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return{concat:tU.apply(tV,e).concat,empty:e.map(function(e){return e.empty})}},yN=function(e){return tR(e)(e.empty)},yq={concat:tP.concat,empty:void 0},yQ={concat:tW.concat,empty:!0},yV={concat:tD.concat,empty:!1},yz={concat:tN.concat,empty:""},yY={concat:tq.concat,empty:0};let yH=Object.freeze(Object.defineProperty({__proto__:null,concatAll:yN,fold:yN,getDualMonoid:yP,getEndomorphismMonoid:function(){return yP(d6())},getFunctionMonoid:eo,getJoinMonoid:yB,getMeetMonoid:yK,getStructMonoid:yW,getTupleMonoid:yD,max:yB,min:yK,monoidAll:yQ,monoidAny:yV,monoidProduct:{concat:tQ.concat,empty:1},monoidString:yz,monoidSum:yY,monoidVoid:yq,reverse:yP,struct:yW,tuple:yD},Symbol.toStringTag,{value:"Module"})),yG=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var yZ=function(e,t,n){return function(r){return -1===r?e():0===r?t():n()}},yJ=function(e){return -1===e?1:1===e?-1:0},y$={equals:function(e,t){return e===t}},yX={concat:function(e,t){return 0!==e?e:t}},y0={concat:yX.concat,empty:0};let y1=Object.freeze(Object.defineProperty({__proto__:null,Eq:y$,Monoid:y0,Semigroup:yX,eqOrdering:y$,invert:yJ,match:yZ,matchW:yZ,monoidOrdering:y0,reverse:yJ,semigroupOrdering:yX,sign:function(e){return e<=-1?-1:e>=1?1:0}},Symbol.toStringTag,{value:"Module"})),y2=Object.freeze(Object.defineProperty({__proto__:null,pipe:eg,pipeable:function(e){var t={};return"function"==typeof e.map&&(t.map=function(t){return function(n){return e.map(n,t)}}),"function"==typeof e.contramap&&(t.contramap=function(t){return function(n){return e.contramap(n,t)}}),"function"==typeof e.mapWithIndex&&(t.mapWithIndex=function(t){return function(n){return e.mapWithIndex(n,t)}}),"function"==typeof e.ap&&(t.ap=function(t){return function(n){return e.ap(n,t)}},t.apFirst=function(t){return function(n){return e.ap(e.map(n,function(e){return function(){return e}}),t)}},t.apSecond=function(t){return function(n){return e.ap(e.map(n,function(){return function(e){return e}}),t)}}),"function"==typeof e.chain&&(t.chain=function(t){return function(n){return e.chain(n,t)}},t.chainFirst=function(t){return function(n){return e.chain(n,function(n){return e.map(t(n),function(){return n})})}},t.flatten=function(t){return e.chain(t,es)}),"function"==typeof e.bimap&&(t.bimap=function(t,n){return function(r){return e.bimap(r,t,n)}},t.mapLeft=function(t){return function(n){return e.mapLeft(n,t)}}),"function"==typeof e.extend&&(t.extend=function(t){return function(n){return e.extend(n,t)}},t.duplicate=function(t){return e.extend(t,es)}),"function"==typeof e.reduce&&(t.reduce=function(t,n){return function(r){return e.reduce(r,t,n)}},t.foldMap=function(t){var n=e.foldMap(t);return function(e){return function(t){return n(t,e)}}},t.reduceRight=function(t,n){return function(r){return e.reduceRight(r,t,n)}}),"function"==typeof e.reduceWithIndex&&(t.reduceWithIndex=function(t,n){return function(r){return e.reduceWithIndex(r,t,n)}},t.foldMapWithIndex=function(t){var n=e.foldMapWithIndex(t);return function(e){return function(t){return n(t,e)}}},t.reduceRightWithIndex=function(t,n){return function(r){return e.reduceRightWithIndex(r,t,n)}}),"function"==typeof e.alt&&(t.alt=function(t){return function(n){return e.alt(n,t)}}),"function"==typeof e.compact&&(t.compact=e.compact,t.separate=e.separate),"function"==typeof e.filter&&(t.filter=function(t){return function(n){return e.filter(n,t)}},t.filterMap=function(t){return function(n){return e.filterMap(n,t)}},t.partition=function(t){return function(n){return e.partition(n,t)}},t.partitionMap=function(t){return function(n){return e.partitionMap(n,t)}}),"function"==typeof e.filterWithIndex&&(t.filterWithIndex=function(t){return function(n){return e.filterWithIndex(n,t)}},t.filterMapWithIndex=function(t){return function(n){return e.filterMapWithIndex(n,t)}},t.partitionWithIndex=function(t){return function(n){return e.partitionWithIndex(n,t)}},t.partitionMapWithIndex=function(t){return function(n){return e.partitionMapWithIndex(n,t)}}),"function"==typeof e.promap&&(t.promap=function(t,n){return function(r){return e.promap(r,t,n)}}),"function"==typeof e.compose&&(t.compose=function(t){return function(n){return e.compose(n,t)}}),"function"==typeof e.throwError&&(t.fromOption=function(t){return function(n){return"None"===n._tag?e.throwError(t()):e.of(n.value)}},t.fromEither=function(t){return"Left"===t._tag?e.throwError(t.left):e.of(t.right)},t.fromPredicate=function(t,n){return function(r){return t(r)?e.of(r):e.throwError(n(r))}},t.filterOrElse=function(t,n){return function(r){return e.chain(r,function(r){return t(r)?e.of(r):e.throwError(n(r))})}}),t}},Symbol.toStringTag,{value:"Module"})),y6=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),y5=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var y3=function(){return Math.random()};function y9(e,t){return eg(y3,AT(function(n){return Math.floor((t-e+1)*n+e)}))}var y4=eg(y3,AT(function(e){return e<.5}));let y7=Object.freeze(Object.defineProperty({__proto__:null,random:y3,randomBool:y4,randomElem:function(e){return eg(y9(0,e.length-1),AT(function(t){return e[t]}))},randomInt:y9,randomRange:function(e,t){return eg(y3,AT(function(n){return(t-e)*n+e}))}},Symbol.toStringTag,{value:"Module"}));var y8=dF(fN),ve=dj(fN),vt=dU(fW),vn=dL(fW),vr=dY(fW),vi=dH(fH),vo=dG(fH),va=d0(fW),vu=dZ(fH),vs=dJ(fH),vl=d$(fH),vc=dX(fW),vd=function(e,t){return eg(e,vg(t))},vf=function(e,t,n){return eg(e,vy(t,n))},vp=function(e,t){return eg(e,vv(t))},vA=function(e,t){return eg(e,vx(t))},vh=function(e,t){return eg(e,vb(t))},vm=function(e,t){return eg(e,vS(t))},vg=dW(fW),vy=dQ(fW),vv=dV(fW),vx=dD(fq),vb=dN(fH),vC=vb(es),vS=dq(fH),vw="ReaderEither",vI=function(e){var t=cK(e);return{URI:vw,_E:void 0,compact:cr(fW,t),separate:ci(fW,t,cN)}};function v_(e){var t=eK(fq,cP(e));return{URI:vw,_E:void 0,map:vd,ap:function(e,n){return eg(e,t(n))},of:ve}}function vT(e){var t=dz(fH,e);return{URI:vw,_E:void 0,map:vd,alt:function(e,n){return eg(e,t(n))}}}var vO={URI:vw,map:vd},vR=ez(vO),vk={URI:vw,map:vd,ap:vA},vE=eB(vk),vM=eP(vk),vj={URI:vw,map:vd,ap:vA,of:ve},vF={URI:vw,map:vd,ap:vA,chain:vh},vU=eX(vF),vL={URI:vw,fromReader:vt},vK=f7(vL),vB=f8(vL),vP=pe(vL),vW=pt(vL,vF),vD=pn(vL,vF),vN={URI:vw,fromEither:el},vq=e2(vN),vQ=e5(vN),vV=e3(vN,vF),vz=e4(vN,vF),vY=e7(vN,vF),vH=e6(vN),vG=e8(vN,vF),vZ=e9(vN),vJ=ve(eF),v$=eY(vO),vX=e0(vF),v0=eW(vk),v1=ve(ej),v2=function(e){return eA(f1(e),f_(d_(ey)))},v6=function(e){var t=v2(e);return function(e){return ek(e)?t(e):v1}},v5=function(e){return v6(function(t,n){return e(n)})},v3=v5(es),v9=eD(vk),v4=eZ(vj);let v7=Object.freeze(Object.defineProperty({__proto__:null,Alt:{URI:vw,map:vd,alt:vm},ApT:v1,Applicative:vj,Apply:vk,Bifunctor:{URI:vw,bimap:vf,mapLeft:vp},Chain:vF,Do:vJ,FromEither:vN,FromReader:vL,Functor:vO,Monad:{URI:vw,map:vd,ap:vA,of:ve,chain:vh},MonadThrow:{URI:vw,map:vd,ap:vA,of:ve,chain:vh,throwError:y8},Pointed:{URI:vw,of:ve},URI:vw,alt:vS,altW:vS,ap:vx,apFirst:vE,apFirstW:vE,apS:v0,apSW:v0,apSecond:vM,apSecondW:vM,apW:vx,ask:vK,asks:vB,asksReaderEither:fx,asksReaderEitherW:fx,bimap:vy,bind:vX,bindTo:v$,bindW:vX,chain:vb,chainEitherK:vz,chainEitherKW:vz,chainFirst:vU,chainFirstEitherK:vY,chainFirstEitherKW:vY,chainFirstReaderK:vD,chainFirstReaderKW:vD,chainFirstW:vU,chainOptionK:vV,chainReaderK:vW,chainReaderKW:vW,chainW:vb,filterOrElse:vG,filterOrElseW:vG,flap:vR,flatten:vC,flattenW:vC,fold:vi,foldW:vi,fromEither:el,fromEitherK:vZ,fromOption:vq,fromOptionK:vQ,fromPredicate:vH,fromReader:vt,fromReaderK:vP,getAltReaderValidation:vT,getApplicativeReaderValidation:v_,getApplyMonoid:v4,getApplySemigroup:v9,getCompactable:vI,getFilterable:function(e){var t=cB(e),n=vI(e),r=d7(fW,t),i=d8(fW,t),o=fe(fW,t),a=ft(fW,t);return{URI:vw,_E:void 0,map:vd,compact:n.compact,separate:n.separate,filter:function(e,t){return eg(e,r(t))},filterMap:function(e,t){return eg(e,i(t))},partition:function(e,t){return eg(e,o(t))},partitionMap:function(e,t){return eg(e,a(t))}}},getOrElse:vo,getOrElseW:vo,getReaderValidation:function(e){var t=v_(e),n=vT(e);return{URI:vw,_E:void 0,map:vd,ap:t.ap,of:ve,chain:vh,bimap:vf,mapLeft:vp,alt:n.alt,throwError:y8}},getSemigroup:function(e){return eD(fq)(cL(e))},left:y8,leftReader:vn,local:fv,map:vg,mapLeft:vv,match:vr,matchE:vi,matchEW:vi,matchW:vr,of:ve,orElse:vu,orElseFirst:vs,orElseFirstW:vs,orElseW:vu,orLeft:vl,readerEither:{URI:vw,bimap:vf,mapLeft:vp,map:vd,of:ve,ap:vA,chain:vh,alt:vm,throwError:y8},right:ve,rightReader:vt,sequenceArray:v3,swap:vc,throwError:y8,toUnion:va,traverseArray:v5,traverseArrayWithIndex:v6,traverseReadonlyArrayWithIndex:v6,traverseReadonlyNonEmptyArrayWithIndex:v2},Symbol.toStringTag,{value:"Module"}));function v8(e){return function(t){return function(){return e.of(t)}}}function xe(e){return function(t){return function(n){return function(r){return e.map(n(r),t)}}}}function xt(e){return function(t){return function(n){return function(r){return e.ap(n(r),t(r))}}}}function xn(e){return function(t){return function(n){return function(r){return e.chain(n(r),function(e){return t(e)(r)})}}}}function xr(e){return function(t){return eA(t,e.of)}}let xi=Object.freeze(Object.defineProperty({__proto__:null,ap:xt,chain:xn,fromNaturalTransformation:function(e){return function(t){return eA(t,e)}},fromReader:xr,getReaderM:function(e){var t=xt(e),n=xe(e),r=xn(e);return{map:function(e,t){return eg(e,n(t))},ap:function(e,n){return eg(e,t(n))},of:v8(e),chain:function(e,t){return eg(e,r(t))},ask:function(){return e.of},asks:function(t){return eA(t,e.of)},local:function(e,t){return function(n){return e(t(n))}},fromReader:xr(e),fromM:function(e){return function(){return e}}}},map:xe,of:v8},Symbol.toStringTag,{value:"Module"}));var xo=function(e){return function(){return Promise.resolve().then(e)}},xa=function(e,t){return eg(e,xc(t))},xu=function(e,t){return eg(e,xd(t))},xs=function(e,t){return eg(e,xp(function(e){return eg(t,xc(e))}))},xl=function(e,t){return eg(e,xp(t))},xc=function(e){return function(t){return function(){return Promise.resolve().then(t).then(e)}}},xd=function(e){return function(t){return function(){return Promise.all([Promise.resolve().then(t),Promise.resolve().then(e)]).then(function(e){return(0,e[0])(e[1])})}}},xf=function(e){return function(){return Promise.resolve(e)}},xp=function(e){return function(t){return function(){return Promise.resolve().then(t).then(function(t){return e(t)()})}}},xA=xp(es),xh="Task",xm={URI:xh,map:xa},xg=ez(xm),xy={URI:xh,of:xf},xv={URI:xh,map:xa,ap:xu},xx=eB(xv),xb=eP(xv),xC={URI:xh,map:xa,ap:xu,of:xf},xS={URI:xh,map:xa,ap:xs},xw={URI:xh,map:xa,ap:xs,of:xf},xI={URI:xh,map:xa,ap:xu,chain:xl},x_={URI:xh,map:xa,of:xf,ap:xu,chain:xl},xT=eX(xI),xO={URI:xh,fromIO:xo},xR=fA(xO),xk=fh(xO,xI),xE=fm(xO,xI),xM=function(){return new Promise(function(e){})},xj=xf(eF),xF=eY(xm),xU=e0(xI),xL=eW(xv),xK=xf(ej),xB=function(e){return function(t){return function(){return Promise.all(t.map(function(t,n){return Promise.resolve().then(function(){return e(n,t)()})}))}}},xP=function(e){var t=xB(e);return function(e){return ek(e)?t(e):xK}},xW=function(e){return function(t){return function(){return eM(t).reduce(function(t,n,r){return t.then(function(t){return Promise.resolve().then(e(r+1,n)).then(function(e){return t.push(e),t})})},Promise.resolve().then(e(0,eE(t))).then(eR))}}},xD=function(e){var t=xW(e);return function(e){return ek(e)?t(e):xK}},xN=function(e){return xP(function(t,n){return e(n)})},xq=xN(es),xQ=function(e){return xD(function(t,n){return e(n)})},xV=xQ(es),xz=eD(xS),xY=eZ(xw);let xH=Object.freeze(Object.defineProperty({__proto__:null,ApT:xK,ApplicativePar:xC,ApplicativeSeq:xw,ApplyPar:xv,ApplySeq:xS,Chain:xI,Do:xj,FromIO:xO,FromTask:{URI:xh,fromIO:xo,fromTask:es},Functor:xm,Monad:x_,MonadIO:{URI:xh,map:xa,of:xf,ap:xu,chain:xl,fromIO:xo},MonadTask:{URI:xh,map:xa,of:xf,ap:xu,chain:xl,fromIO:xo,fromTask:es},Pointed:xy,URI:xh,ap:xd,apFirst:xx,apS:xL,apSecond:xb,bind:xU,bindTo:xF,chain:xp,chainFirst:xT,chainFirstIOK:xE,chainIOK:xk,delay:function(e){return function(t){return function(){return new Promise(function(n){setTimeout(function(){Promise.resolve().then(t).then(n)},e)})}}},flap:xg,flatten:xA,fromIO:xo,fromIOK:xR,fromTask:es,getMonoid:xY,getRaceMonoid:function(){return{concat:function(e,t){return function(){return Promise.race([Promise.resolve().then(e),Promise.resolve().then(t)])}},empty:xM}},getSemigroup:xz,map:xc,never:xM,of:xf,sequenceArray:xq,sequenceSeqArray:xV,task:{URI:xh,map:xa,of:xf,ap:xu,chain:xl,fromIO:xo,fromTask:es},taskSeq:{URI:xh,map:xa,of:xf,ap:xs,chain:xl,fromIO:xo,fromTask:es},traverseArray:xN,traverseArrayWithIndex:xP,traverseReadonlyArrayWithIndex:xP,traverseReadonlyArrayWithIndexSeq:xD,traverseReadonlyNonEmptyArrayWithIndex:xB,traverseReadonlyNonEmptyArrayWithIndexSeq:xW,traverseSeqArray:xQ,traverseSeqArrayWithIndex:xD},Symbol.toStringTag,{value:"Module"}));var xG=xr(xy),xZ=eA(xo,el),xJ=function(e,t){return eg(e,x1(t))},x$=function(e,t){return eg(e,x2(t))},xX=function(e,t){return eg(e,x5(function(e){return eg(t,x1(e))}))},x0=function(e,t){return eg(e,x5(t))},x1=xe(xm),x2=xt(xv),x6=v8(xy),x5=xn(x_),x3=x5(es),x9="ReaderTask",x4={URI:x9,map:xJ},x7=ez(x4),x8={URI:x9,of:x6},be={URI:x9,map:xJ,ap:x$},bt=eB(be),bn=eP(be),br={URI:x9,map:xJ,ap:xX},bi={URI:x9,map:xJ,ap:xX,of:x6},bo={URI:x9,map:xJ,ap:x$,chain:x0},ba={URI:x9,map:xJ,of:x6,ap:x$,chain:x0},bu=eX(bo),bs={URI:x9,fromIO:xZ},bl=fA(bs),bc=fh(bs,bo),bd=fm(bs,bo),bf={URI:x9,fromReader:xG},bp=f7(bf),bA=f8(bf),bh=pe(bf),bm=pt(bf,bo),bg=pn(bf,bo),by={URI:x9,fromIO:xZ,fromTask:el},bv=pW(by),bx=pD(by,bo),bb=pN(by,bo),bC=x6(eF),bS=eY(x4),bw=e0(bo),bI=eW(be),b_=x6(ej),bT=function(e){return eA(f1(e),f_(xB(ey)))},bO=function(e){var t=bT(e);return function(e){return ek(e)?t(e):b_}},bR=function(e){return eA(f1(e),f_(xW(ey)))},bk=function(e){var t=bR(e);return function(e){return ek(e)?t(e):b_}},bE=function(e){return bO(function(t,n){return e(n)})},bM=bE(es),bj=function(e){return bk(function(t,n){return e(n)})},bF=bj(es),bU=eD(br),bL=eZ(bi);let bK=Object.freeze(Object.defineProperty({__proto__:null,ApT:b_,ApplicativePar:{URI:x9,map:xJ,ap:x$,of:x6},ApplicativeSeq:bi,ApplyPar:be,ApplySeq:br,Chain:bo,Do:bC,FromIO:bs,FromReader:bf,FromTask:by,Functor:x4,Monad:ba,MonadIO:{URI:x9,map:xJ,of:x6,ap:x$,chain:x0,fromIO:xZ},MonadTask:{URI:x9,map:xJ,of:x6,ap:x$,chain:x0,fromIO:xZ,fromTask:el},Pointed:x8,URI:x9,ap:x2,apFirst:bt,apS:bI,apSW:bI,apSecond:bn,apW:x2,ask:bp,asks:bA,asksReaderTask:fx,asksReaderTaskW:fx,bind:bw,bindTo:bS,bindW:bw,chain:x5,chainFirst:bu,chainFirstIOK:bd,chainFirstReaderK:bg,chainFirstReaderKW:bg,chainFirstTaskK:bb,chainFirstW:bu,chainIOK:bc,chainReaderK:bm,chainReaderKW:bm,chainTaskK:bx,chainW:x5,flap:x7,flatten:x3,flattenW:x3,fromIO:xZ,fromIOK:bl,fromReader:xG,fromReaderK:bh,fromTask:el,fromTaskK:bv,getMonoid:bL,getSemigroup:bU,local:fv,map:x1,of:x6,readerTask:{URI:x9,map:xJ,of:x6,ap:x$,chain:x0,fromIO:xZ,fromTask:el},readerTaskSeq:{URI:x9,map:xJ,of:x6,ap:xX,chain:x0,fromIO:xZ,fromTask:el},run:function(e,t){return e(t)()},sequenceArray:bM,sequenceSeqArray:bF,traverseArray:bE,traverseArrayWithIndex:bO,traverseReadonlyArrayWithIndex:bO,traverseReadonlyArrayWithIndexSeq:bk,traverseReadonlyNonEmptyArrayWithIndex:bT,traverseReadonlyNonEmptyArrayWithIndexSeq:bR,traverseSeqArray:bj,traverseSeqArrayWithIndex:bk},Symbol.toStringTag,{value:"Module"}));var bB=function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function u(o){return function(u){return function(o){if(n)throw TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=(i=a.trys).length>0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=t.call(e,a)}catch(e){o=[6,e],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}},bP=dF(xy),bW=dj(xy),bD=dU(xm),bN=dL(xm),bq=eA(xo,bD),bQ=eA(xo,bN),bV=function(e){return xc(de(e))},bz=dY(xm),bY=dH(x_),bH=dG(x_),bG=function(e,t){return function(){var n,r,i,o;return n=void 0,r=void 0,i=void 0,o=function(){return bB(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,e().then(eO)];case 1:return[2,n.sent()];case 2:return[2,eT(t(n.sent()))];case 3:return[2]}})},new(i||(i=Promise))(function(e,t){function a(e){try{s(o.next(e))}catch(e){t(e)}}function u(e){try{s(o.throw(e))}catch(e){t(e)}}function s(t){var n;t.done?e(t.value):((n=t.value)instanceof i?n:new i(function(e){e(n)})).then(a,u)}s((o=o.apply(n,r||[])).next())})}},bZ=d0(xm),bJ=dK(xy),b$=dB(xy),bX=dP(x_),b0=dZ(x_),b1=dJ(x_),b2=d$(x_),b6=dX(xm),b5=function(e){var t=bV(e);return function(e){return eA(e,t)}},b3=function(e){return function(t){return function(n){return eg(n,Cl(b5(e)(t)))}}},b9=function(e){return eA(e,xo)},b4=function(e){return Cc(b9(e))},b7=function(e,t){return eg(e,Co(t))},b8=function(e,t){return eg(e,Cs(t))},Ce=function(e,t){return eg(e,Cl(function(e){return eg(t,Co(e))}))},Ct=function(e,t){return eg(e,Cl(t))},Cn=function(e,t,n){return eg(e,Ca(t,n))},Cr=function(e,t){return eg(e,Cu(t))},Ci=function(e,t){return eg(e,Cf(t))},Co=dW(xm),Ca=dQ(xm),Cu=dV(xm),Cs=dD(xv),Cl=dN(x_),Cc=Cl,Cd=Cc(es),Cf=dq(x_),Cp="TaskEither";function CA(e,t){var n=eK(e,cP(t));return{URI:Cp,_E:void 0,map:b7,ap:function(e,t){return eg(e,n(t))},of:bW}}function Ch(e){var t=dz(x_,e);return{URI:Cp,_E:void 0,map:b7,alt:function(e,n){return eg(e,t(n))}}}var Cm=function(e){var t=cK(e);return{URI:Cp,_E:void 0,compact:cr(xm,t),separate:ci(xm,t,cN)}},Cg={URI:Cp,map:b7},Cy=ez(Cg),Cv={URI:Cp,map:b7,ap:b8},Cx=eB(Cv),Cb=eP(Cv),CC={URI:Cp,map:b7,ap:Ce},CS={URI:Cp,map:b7,ap:Ce,of:bW},Cw={URI:Cp,map:b7,ap:b8,chain:Ct},CI=eX(Cw),C_={URI:Cp,fromEither:xf},CT=e2(C_),CO=e5(C_),CR=e3(C_,Cw),Ck=e4(C_,Cw),CE=e7(C_,Cw),CM=e6(C_),Cj=e8(C_,Cw),CF=e9(C_),CU={URI:Cp,fromIO:bq},CL=fA(CU),CK=fh(CU,Cw),CB=fm(CU,Cw),CP={URI:Cp,fromIO:bq,fromTask:bD},CW=pW(CP),CD=pD(CP,Cw),CN=pN(CP,Cw),Cq=function(e,t,n){return eg(e,Cc(function(e){return eg(t(e),xp(function(t){return eg(n(e,t),Cc(function(){return xf(t)}))}))}))},CQ=bW(eF),CV=eY(Cg),Cz=e0(Cw),CY=eW(Cv),CH=bW(ej),CG=function(e){return eA(xB(e),xc(d_(ey)))},CZ=function(e){var t=CG(e);return function(e){return ek(e)?t(e):CH}},CJ=function(e){return function(t){return function(){return eM(t).reduce(function(t,n,r){return t.then(function(i){return eI(i)?t:e(r+1,n)().then(function(e){return eI(e)?e:(i.right.push(e.right),i)})})},e(0,eE(t))().then(cD(eR)))}}},C$=function(e){var t=CJ(e);return function(e){return ek(e)?t(e):CH}},CX=function(e){return CZ(function(t,n){return e(n)})},C0=CX(es),C1=function(e){return C$(function(t,n){return e(n)})},C2=C1(es),C6=eD(CC),C5=eZ(CS);let C3=Object.freeze(Object.defineProperty({__proto__:null,Alt:{URI:Cp,map:b7,alt:Ci},ApT:CH,ApplicativePar:{URI:Cp,map:b7,ap:b8,of:bW},ApplicativeSeq:CS,ApplyPar:Cv,ApplySeq:CC,Bifunctor:{URI:Cp,bimap:Cn,mapLeft:Cr},Chain:Cw,Do:CQ,FromEither:C_,FromIO:CU,FromTask:CP,Functor:Cg,Monad:{URI:Cp,map:b7,ap:b8,chain:Ct,of:bW},MonadIO:{URI:Cp,map:b7,ap:b8,chain:Ct,of:bW,fromIO:bq},MonadTask:{URI:Cp,map:b7,ap:b8,chain:Ct,of:bW,fromIO:bq,fromTask:bD},MonadThrow:{URI:Cp,map:b7,ap:b8,chain:Ct,of:bW,throwError:bP},Pointed:{URI:Cp,of:bW},URI:Cp,alt:Cf,altW:Cf,ap:Cs,apFirst:Cx,apFirstW:Cx,apS:CY,apSW:CY,apSecond:Cb,apSecondW:Cb,apW:Cs,bimap:Ca,bind:Cz,bindTo:CV,bindW:Cz,bracket:function(e,t,n){return Cq(e,t,n)},bracketW:Cq,chain:Cl,chainEitherK:Ck,chainEitherKW:Ck,chainFirst:CI,chainFirstEitherK:CE,chainFirstEitherKW:CE,chainFirstIOK:CB,chainFirstTaskK:CN,chainFirstW:CI,chainIOEitherK:b4,chainIOEitherKW:b4,chainIOK:CK,chainNullableK:bX,chainOptionK:CR,chainTaskK:CD,chainTaskOptionK:b3,chainTaskOptionKW:b3,chainW:Cc,filterOrElse:Cj,filterOrElseW:Cj,flap:Cy,flatten:Cd,flattenW:Cd,fold:bY,foldW:bY,fromEither:xf,fromEitherK:CF,fromIO:bq,fromIOEither:xo,fromIOEitherK:b9,fromIOK:CL,fromNullable:bJ,fromNullableK:b$,fromOption:CT,fromOptionK:CO,fromPredicate:CM,fromTask:bD,fromTaskK:CW,fromTaskOption:bV,fromTaskOptionK:b5,getAltTaskValidation:Ch,getApplicativeTaskValidation:CA,getApplyMonoid:C5,getApplySemigroup:C6,getCompactable:Cm,getFilterable:function(e){var t=cB(e),n=Cm(e),r=d7(xm,t),i=d8(xm,t),o=fe(xm,t),a=ft(xm,t);return{URI:Cp,_E:void 0,map:b7,compact:n.compact,separate:n.separate,filter:function(e,t){return eg(e,r(t))},filterMap:function(e,t){return eg(e,i(t))},partition:function(e,t){return eg(e,o(t))},partitionMap:function(e,t){return eg(e,a(t))}}},getOrElse:bH,getOrElseW:bH,getSemigroup:function(e){return eD(xS)(cL(e))},getTaskValidation:function(e){var t=CA(xC,e),n=Ch(e);return{URI:Cp,_E:void 0,map:b7,ap:t.ap,of:bW,chain:Ct,bimap:Cn,mapLeft:Cr,alt:n.alt,fromIO:bq,fromTask:bD,throwError:bP}},left:bP,leftIO:bQ,leftTask:bN,map:Co,mapLeft:Cu,match:bz,matchE:bY,matchEW:bY,matchW:bz,of:bW,orElse:b0,orElseFirst:b1,orElseFirstIOK:function(e){return b1(CL(e))},orElseFirstTaskK:function(e){return b1(CW(e))},orElseFirstW:b1,orElseW:b0,orLeft:b2,right:bW,rightIO:bq,rightTask:bD,sequenceArray:C0,sequenceSeqArray:C2,swap:b6,taskEither:{URI:Cp,bimap:Cn,mapLeft:Cr,map:b7,of:bW,ap:b8,chain:Ct,alt:Ci,fromIO:bq,fromTask:bD,throwError:bP},taskEitherSeq:{URI:Cp,bimap:Cn,mapLeft:Cr,map:b7,of:bW,ap:Ce,chain:Ct,alt:Ci,fromIO:bq,fromTask:bD,throwError:bP},taskify:function(e){return function(){var t=Array.prototype.slice.call(arguments);return function(){return new Promise(function(n){e.apply(null,t.concat(function(e,t){return null!=e?n(eT(e)):n(eO(t))}))})}}},throwError:bP,toUnion:bZ,traverseArray:CX,traverseArrayWithIndex:CZ,traverseReadonlyArrayWithIndex:CZ,traverseReadonlyArrayWithIndexSeq:C$,traverseReadonlyNonEmptyArrayWithIndex:CG,traverseReadonlyNonEmptyArrayWithIndexSeq:CJ,traverseSeqArray:C1,traverseSeqArrayWithIndex:C$,tryCatch:bG,tryCatchK:function(e,t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return bG(function(){return e.apply(void 0,n)},t)}}},Symbol.toStringTag,{value:"Module"}));var C9=dF(x8),C4=dj(x8),C7=eA(bD,el),C8=eA(bN,el),Se=function(e){return eA(e,bW)},St=function(e){return eA(e,bP)},Sn=dU(x4),Sr=dL(x4),Si=eA(bq,el),So=eA(bQ,el),Sa=eA(xo,el),Su=function(e){return eA(e,xf)},Ss=dY(x4),Sl=dH(bo),Sc=dG(ba),Sd=d0(x4),Sf=dK(x8),Sp=dB(x8),SA=dP(ba),Sh=dZ(ba),Sm=dJ(ba),Sg=d$(ba),Sy=dX(x4),Sv=function(e){return eA(e,Sa)},Sx=function(e){return SP(Sv(e))},Sb=function(e){return eA(e,el)},SC=function(e){return SP(Sb(e))},SS=function(e){return S2(Sb(e))},Sw=function(e){return eA(e,Su)},SI=function(e){return SP(Sw(e))},S_=function(e){return S2(Sw(e))},ST=function(e,t){return eg(e,SF(t))},SO=function(e,t){return eg(e,SK(t))},SR=function(e,t){return eg(e,SB(function(e){return eg(t,SF(e))}))},Sk=function(e,t){return eg(e,SB(t))},SE=function(e,t){return eg(e,SD(t))},SM=function(e,t,n){return eg(e,SU(t,n))},Sj=function(e,t){return eg(e,SL(t))},SF=dW(x4),SU=dQ(x4),SL=dV(x4),SK=dD(be),SB=dN(ba),SP=SB,SW=SP(es),SD=dq(ba),SN="ReaderTaskEither",Sq=function(e){var t=cK(e);return{URI:SN,_E:void 0,compact:cr(x4,t),separate:ci(x4,t,cN)}};function SQ(e,t){var n=eK(fq,CA(e,t));return{URI:SN,_E:void 0,map:ST,ap:function(e,t){return eg(e,n(t))},of:C4}}function SV(e){var t=dz(ba,e);return{URI:SN,_E:void 0,map:ST,alt:function(e,n){return eg(e,t(n))}}}var Sz={URI:SN,map:ST},SY=ez(Sz),SH={URI:SN,of:C4},SG={URI:SN,map:ST,ap:SO},SZ=eB(SG),SJ=eP(SG),S$={URI:SN,map:ST,ap:SR},SX={URI:SN,map:ST,ap:SR,of:C4},S0={URI:SN,map:ST,ap:SO,chain:Sk},S1=eX(S0),S2=S1,S6={URI:SN,fromReader:Se},S5=f7(S6),S3=f8(S6),S9=pe(S6),S4=pt(S6,S0),S7=pn(S6,S0),S8=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return Sn(e.apply(void 0,t))}},we=function(e){return SP(S8(e))},wt=function(e){return S2(S8(e))},wn={URI:SN,fromEither:x6},wr=e2(wn),wi=e5(wn),wo=e3(wn,S0),wa=e4(wn,S0),wu=e7(wn,S0),ws=e6(wn),wl=e8(wn,S0),wc=e9(wn),wd={URI:SN,fromIO:Si},wf=fA(wd),wp=fh(wd,S0),wA=fm(wd,S0),wh={URI:SN,fromIO:Si,fromTask:C7},wm=pW(wh),wg=pD(wh,S0),wy=pN(wh,S0);function wv(e,t,n){return function(r){return Cq(e(r),function(e){return t(e)(r)},function(e,t){return n(e,t)(r)})}}var wx=C4(eF),wb=eY(Sz),wC=e0(S0),wS=eW(SG),ww=C4(ej),wI=function(e){return eA(f1(e),f_(CG(ey)))},w_=function(e){var t=wI(e);return function(e){return ek(e)?t(e):ww}},wT=function(e){return eA(f1(e),f_(CJ(ey)))},wO=function(e){var t=wT(e);return function(e){return ek(e)?t(e):ww}},wR=function(e){return w_(function(t,n){return e(n)})},wk=wR(es),wE=function(e){return wO(function(t,n){return e(n)})},wM=wE(es),wj=eD(S$),wF=eZ(SX);let wU=Object.freeze(Object.defineProperty({__proto__:null,Alt:{URI:SN,map:ST,alt:SE},ApT:ww,ApplicativePar:{URI:SN,map:ST,ap:SO,of:C4},ApplicativeSeq:SX,ApplyPar:SG,ApplySeq:S$,Bifunctor:{URI:SN,bimap:SM,mapLeft:Sj},Chain:S0,Do:wx,FromEither:wn,FromIO:wd,FromReader:S6,FromTask:wh,Functor:Sz,Monad:{URI:SN,map:ST,ap:SO,chain:Sk,of:C4},MonadIO:{URI:SN,map:ST,ap:SO,chain:Sk,of:C4,fromIO:Si},MonadTask:{URI:SN,map:ST,ap:SO,chain:Sk,of:C4,fromIO:Si,fromTask:C7},MonadThrow:{URI:SN,map:ST,ap:SO,chain:Sk,of:C4,throwError:C9},Pointed:SH,URI:SN,alt:SD,altW:SD,ap:SK,apFirst:SZ,apFirstW:SZ,apS:wS,apSW:wS,apSecond:SJ,apSecondW:SJ,apW:SK,ask:S5,asks:S3,asksReaderTaskEither:fx,asksReaderTaskEitherW:fx,bimap:SU,bind:wC,bindTo:wb,bindW:wC,bracket:function(e,t,n){return wv(e,t,n)},bracketW:wv,chain:SB,chainEitherK:wa,chainEitherKW:wa,chainFirst:S1,chainFirstEitherK:wu,chainFirstEitherKW:wu,chainFirstIOK:wA,chainFirstReaderEitherK:S_,chainFirstReaderEitherKW:S_,chainFirstReaderK:S7,chainFirstReaderKW:S7,chainFirstReaderTaskK:wt,chainFirstReaderTaskKW:wt,chainFirstTaskEitherK:SS,chainFirstTaskEitherKW:SS,chainFirstTaskK:wy,chainFirstW:S2,chainIOEitherK:Sx,chainIOEitherKW:Sx,chainIOK:wp,chainNullableK:SA,chainOptionK:wo,chainReaderEitherK:SI,chainReaderEitherKW:SI,chainReaderK:S4,chainReaderKW:S4,chainReaderTaskK:we,chainReaderTaskKW:we,chainTaskEitherK:SC,chainTaskEitherKW:SC,chainTaskK:wg,chainW:SP,filterOrElse:wl,filterOrElseW:wl,flap:SY,flatten:SW,flattenW:SW,fold:Sl,foldW:Sl,fromEither:x6,fromEitherK:wc,fromIO:Si,fromIOEither:Sa,fromIOEitherK:Sv,fromIOK:wf,fromNullable:Sf,fromNullableK:Sp,fromOption:wr,fromOptionK:wi,fromPredicate:ws,fromReader:Se,fromReaderEither:Su,fromReaderEitherK:Sw,fromReaderK:S9,fromReaderTaskK:S8,fromTask:C7,fromTaskEither:el,fromTaskEitherK:Sb,fromTaskK:wm,getAltReaderTaskValidation:SV,getApplicativeReaderTaskValidation:SQ,getApplyMonoid:wF,getApplySemigroup:wj,getCompactable:Sq,getFilterable:function(e){var t=cB(e),n=Sq(e),r=d7(x4,t),i=d8(x4,t),o=fe(x4,t),a=ft(x4,t);return{URI:SN,_E:void 0,map:ST,compact:n.compact,separate:n.separate,filter:function(e,t){return eg(e,r(t))},filterMap:function(e,t){return eg(e,i(t))},partition:function(e,t){return eg(e,o(t))},partitionMap:function(e,t){return eg(e,a(t))}}},getOrElse:Sc,getOrElseW:Sc,getReaderTaskValidation:function(e){var t=SQ(xC,e),n=SV(e);return{URI:SN,_E:void 0,map:ST,of:C4,chain:Sk,bimap:SM,mapLeft:Sj,ap:t.ap,alt:n.alt,fromIO:Si,fromTask:C7,throwError:C9}},getSemigroup:function(e){return eD(br)(cL(e))},left:C9,leftIO:So,leftReader:St,leftReaderTask:Sr,leftTask:C8,local:fv,map:SF,mapLeft:SL,match:Ss,matchE:Sl,matchEW:Sl,matchW:Ss,of:C4,orElse:Sh,orElseFirst:Sm,orElseFirstW:Sm,orElseW:Sh,orLeft:Sg,readerTaskEither:{URI:SN,map:ST,of:C4,ap:SO,chain:Sk,alt:SE,bimap:SM,mapLeft:Sj,fromIO:Si,fromTask:C7,throwError:C9},readerTaskEitherSeq:{URI:SN,map:ST,of:C4,ap:SR,chain:Sk,alt:SE,bimap:SM,mapLeft:Sj,fromIO:Si,fromTask:C7,throwError:C9},right:C4,rightIO:Si,rightReader:Se,rightReaderTask:Sn,rightTask:C7,run:function(e,t){return e(t)()},sequenceArray:wk,sequenceSeqArray:wM,swap:Sy,throwError:C9,toUnion:Sd,traverseArray:wR,traverseArrayWithIndex:w_,traverseReadonlyArrayWithIndex:w_,traverseReadonlyArrayWithIndexSeq:wO,traverseReadonlyNonEmptyArrayWithIndex:wI,traverseReadonlyNonEmptyArrayWithIndexSeq:wT,traverseSeqArray:wE,traverseSeqArrayWithIndex:wO},Symbol.toStringTag,{value:"Module"}));var wL={equals:function(e,t){return e===t}},wK={concat:function(e,t){return e+t}},wB={concat:wK.concat,empty:""},wP={equals:wL.equals,compare:function(e,t){return e<t?-1:e>t?1:0}};let wW=Object.freeze(Object.defineProperty({__proto__:null,Eq:wL,Monoid:wB,Ord:wP,Semigroup:wK,Show:{show:function(e){return JSON.stringify(e)}},empty:"",endsWith:function(e,t){return function(n){return n.endsWith(e,t)}},includes:function(e,t){return function(n){return n.includes(e,t)}},isEmpty:function(e){return 0===e.length},isString:function(e){return"string"==typeof e},replace:function(e,t){return function(n){return n.replace(e,t)}},size:function(e){return e.length},slice:function(e,t){return function(n){return n.slice(e,t)}},split:function(e){return function(t){var n=t.split(e);return ek(n)?n:[t]}},startsWith:function(e,t){return function(n){return n.startsWith(e,t)}},toLowerCase:function(e){return e.toLowerCase()},toUpperCase:function(e){return e.toUpperCase()},trim:function(e){return e.trim()},trimLeft:function(e){return e.trimLeft()},trimRight:function(e){return e.trimRight()}},Symbol.toStringTag,{value:"Module"}));var wD=function(e){return Object.keys(e).length},wN=function(e){for(var t in e)if(eU.call(e,t))return!1;return!0},wq=function(e){return function(t){return Object.keys(t).sort(e.compare)}},wQ=wq(wP);function wV(e){if("function"==typeof e)return wV(wP)(e);var t=wq(e);return function(e){return function(n){for(var r=[],i=0,o=t(n);i<o.length;i++){var a=o[i];r.push(e(a,n[a]))}return r}}}var wz=wV(wP)(function(e,t){return[e,t]}),wY=function(e,t){return function(n){if(eU.call(n,e)&&n[e]===t)return n;var r=Object.assign({},n);return r[e]=t,r}},wH=function(e,t){return eU.call(t,e)};function wG(e){return function(t){if(!eU.call(t,e))return t;var n=Object.assign({},t);return delete n[e],n}}function wZ(e){return function(t,n){if(void 0===n){var r=wZ(e);return function(e){return r(e,t)}}for(var i in t)if(!eU.call(n,i)||!e.equals(t[i],n[i]))return!1;return!0}}function wJ(e,t){return void 0===t?function(t){return wJ(e,t)}:eU.call(t,e)?ew(t[e]):eS}var w$={};function wX(e){return function(t){var n={};for(var r in t)eU.call(t,r)&&(n[r]=e(r,t[r]));return n}}function w0(e){return wX(function(t,n){return e(n)})}function w1(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(2===e.length)return w1(wP).apply(void 0,e);var n=wq(e[0]);return function(e,t){return function(r){for(var i=e,o=n(r),a=o.length,u=0;u<a;u++){var s=o[u];i=t(s,i,r[s])}return i}}}function w2(e){if("compare"in e){var t=wq(e);return function(e){return function(n){return function(r){for(var i=e.empty,o=t(r),a=o.length,u=0;u<a;u++){var s=o[u];i=e.concat(i,n(s,r[s]))}return i}}}}return w2(wP)(e)}function w6(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(2===e.length)return w6(wP).apply(void 0,e);var n=wq(e[0]);return function(e,t){return function(r){for(var i=e,o=n(r),a=o.length,u=a-1;u>=0;u--){var s=o[u];i=t(s,r[s],i)}return i}}}var w5=function(e,t){var n;return(n={})[e]=t,n};function w3(e){var t=IO(wP)(e);return function(e){return function(n){return t(n,e)}}}function w9(e){var t=I_(wP)(e);return function(e){return function(n){return t(n,e)}}}function w4(e){return IT(wP)(e)}function w7(e){return function(t){var n={},r={};for(var i in t)if(eU.call(t,i)){var o=e(i,t[i]);switch(o._tag){case"Left":n[i]=o.left;break;case"Right":r[i]=o.right}}return iU(n,r)}}function w8(e){return function(t){var n={},r={};for(var i in t)if(eU.call(t,i)){var o=t[i];e(i,o)?r[i]=o:n[i]=o}return iU(n,r)}}function Ie(e){return function(t){var n={};for(var r in t)if(eU.call(t,r)){var i=e(r,t[r]);eC(i)&&(n[r]=i.value)}return n}}function It(e){return function(t){var n={},r=!1;for(var i in t)if(eU.call(t,i)){var o=t[i];e(i,o)?n[i]=o:r=!0}return r?n:t}}function In(e,t){var n=Ir(e,t);return function(e){return n(e,es)}}function Ir(e,t){return function(n,r){return t.reduce(n,{},function(t,n){var i=r(n),o=i[0],a=i[1];return t[o]=eU.call(t,o)?e.concat(t[o],a):a,t})}}function Ii(e){return function(t){for(var n in t)if(!e(t[n]))return!1;return!0}}function Io(e){return function(t){for(var n in t)if(e(t[n]))return!0;return!1}}function Ia(e){return function(t,n){if(void 0===n){var r=Ia(e);return function(e){return r(t,e)}}for(var i in n)if(e.equals(n[i],t))return!0;return!1}}var Iu=function(e){return function(t){return function(n){if(wN(n))return t;if(wN(t))return n;var r={};for(var i in n)wH(i,t)?r[i]=e.concat(n[i],t[i]):r[i]=n[i];for(var i in t)wH(i,r)||(r[i]=t[i]);return r}}},Is=function(e){return function(t){return function(n){if(wN(n)||wN(t))return w$;var r={};for(var i in n)wH(i,t)&&(r[i]=e.concat(n[i],t[i]));return r}}},Il=function(e){return function(t){if(wN(t))return e;if(wN(e))return t;var n={};for(var r in t)wH(r,e)||(n[r]=t[r]);for(var r in e)wH(r,t)||(n[r]=e[r]);return n}},Ic=function(e,t){return eg(e,w0(t))},Id=function(e,t){return eg(e,wX(t))},If=function(e){var t=Ij(e);return function(e,n,r){return eg(e,t(n,r))}},Ip=function(e){return function(t){var n=IF(e)(t);return function(e,t){return eg(e,n(t))}}},IA=function(e){var t=IU(e);return function(e,n,r){return eg(e,t(n,r))}},Ih=function(e,t){return eg(e,IR(t))},Im=function(e,t){return eg(e,Ik(t))},Ig=function(e,t){return eg(e,IE(t))},Iy=function(e,t){return eg(e,IM(t))},Iv=function(e){var t=w1(e);return function(e,n,r){return eg(e,t(n,r))}},Ix=function(e){var t=w2(e);return function(e){var n=t(e);return function(e,t){return eg(e,n(t))}}},Ib=function(e){var t=w6(e);return function(e,n,r){return eg(e,t(n,r))}},IC=function(e,t){return eg(e,w7(t))},IS=function(e,t){return eg(e,w8(t))},Iw=function(e,t){return eg(e,Ie(t))},II=function(e,t){return eg(e,It(t))},I_=function(e){var t=IO(e);return function(e){var n=t(e);return function(e,t){return n(e,eA(ey,t))}}},IT=function(e){var t=I_(e);return function(e){var n=t(e);return function(e){return n(e,es)}}},IO=function(e){return function(t){var n=wq(e);return function(e,r){var i=n(e);if(0===i.length)return t.of(w$);for(var o=t.of({}),a=function(n){o=t.ap(t.map(o,function(e){return function(t){var r;return Object.assign({},e,((r={})[n]=t,r))}}),r(n,e[n]))},u=0;u<i.length;u++)a(i[u]);return o}}},IR=function(e){return It(function(t,n){return e(n)})},Ik=function(e){return Ie(function(t,n){return e(n)})},IE=function(e){return w8(function(t,n){return e(n)})},IM=function(e){return w7(function(t,n){return e(n)})};function Ij(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(1===e.length){var n=w1(e[0]);return function(e,t){return n(e,function(e,n,r){return t(n,r)})}}return Ij(wP).apply(void 0,e)}function IF(e){if("compare"in e){var t=w2(e);return function(e){var n=t(e);return function(e){return n(function(t,n){return e(n)})}}}return IF(wP)(e)}function IU(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(1===e.length){var n=w6(e[0]);return function(e,t){return n(e,function(e,n,r){return t(n,r)})}}return IU(wP).apply(void 0,e)}var IL=function(e){var t={};for(var n in e)if(eU.call(e,n)){var r=e[n];eC(r)&&(t[n]=r.value)}return t},IK=function(e){var t={},n={};for(var r in e)if(eU.call(e,r)){var i=e[r];eI(i)?t[r]=i.left:n[r]=i.right}return iU(t,n)},IB="ReadonlyRecord";function IP(e){return"compare"in e?function(t){return{show:function(n){var r=wV(e)(function(e,n){return"".concat(JSON.stringify(e),": ").concat(t.show(n))})(n).join(", ");return""===r?"{}":"{ ".concat(r," }")}}}:IP(wP)(e)}function IW(e){var t=wZ(e);return tt(function(e,n){return t(e)(n)&&t(n)(e)})}function ID(e){return{concat:function(t,n){if(wN(t))return n;if(wN(n))return t;var r=Object.assign({},t);for(var i in n)eU.call(n,i)&&(r[i]=eU.call(t,i)?e.concat(t[i],n[i]):n[i]);return r},empty:w$}}var IN={URI:IB,map:Ic},Iq=ez(IN),IQ={URI:IB,compact:IL,separate:IK},IV=function(e){return{URI:IB,map:Ic,reduce:If(e),foldMap:Ip(e),reduceRight:IA(e),traverse:I_(e),sequence:IT(e)}},Iz=function(e){var t=Iu(e);return{concat:function(e,n){return t(n)(e)}}},IY={URI:IB,reduce:If(wP),foldMap:Ip(wP),reduceRight:IA(wP)},IH={URI:IB,reduce:If(wP),foldMap:Ip(wP),reduceRight:IA(wP),reduceWithIndex:Iv(wP),foldMapWithIndex:Ix(wP),reduceRightWithIndex:Ib(wP)},IG={URI:IB,map:Ic,reduce:If(wP),foldMap:Ip(wP),reduceRight:IA(wP),traverse:I_(wP),sequence:w4},IZ={URI:IB,map:Ic,mapWithIndex:Id,reduce:If(wP),foldMap:Ip(wP),reduceRight:IA(wP),reduceWithIndex:Iv(wP),foldMapWithIndex:Ix(wP),reduceRightWithIndex:Ib(wP),traverse:I_(wP),sequence:w4,traverseWithIndex:IO(wP)},IJ=iz(IG,IQ),I$=iV(IG,IQ),IX={URI:IB,map:Ic,reduce:If(wP),foldMap:Ip(wP),reduceRight:IA(wP),traverse:I_(wP),sequence:w4,compact:IL,separate:IK,filter:Ih,filterMap:Im,partition:Ig,partitionMap:Iy,wither:IJ,wilt:I$};function I0(e,t){return eU.call(void 0===t?this:t,e)}var I1={URI:IB,map:Ic,reduce:If(wP),foldMap:Ip(wP),reduceRight:IA(wP),traverse:I_(wP),sequence:w4,compact:IL,separate:IK,filter:Ih,filterMap:Im,partition:Ig,partitionMap:Iy,mapWithIndex:Id,reduceWithIndex:Iv(wP),foldMapWithIndex:Ix(wP),reduceRightWithIndex:Ib(wP),filterMapWithIndex:Iw,filterWithIndex:II,partitionMapWithIndex:IC,partitionWithIndex:IS,traverseWithIndex:IO(wP),wither:IJ,wilt:I$};let I2=Object.freeze(Object.defineProperty({__proto__:null,Compactable:IQ,Filterable:{URI:IB,map:Ic,compact:IL,separate:IK,filter:Ih,filterMap:Im,partition:Ig,partitionMap:Iy},FilterableWithIndex:{URI:IB,map:Ic,mapWithIndex:Id,compact:IL,separate:IK,filter:Ih,filterMap:Im,partition:Ig,partitionMap:Iy,filterMapWithIndex:Iw,filterWithIndex:II,partitionMapWithIndex:IC,partitionWithIndex:IS},Foldable:IY,FoldableWithIndex:IH,Functor:IN,FunctorWithIndex:{URI:IB,map:Ic,mapWithIndex:Id},Traversable:IG,TraversableWithIndex:IZ,URI:IB,Witherable:IX,_filter:Ih,_filterMap:Im,_filterMapWithIndex:Iw,_filterWithIndex:II,_foldMap:Ip,_foldMapWithIndex:Ix,_map:Ic,_mapWithIndex:Id,_partition:Ig,_partitionMap:Iy,_partitionMapWithIndex:IC,_partitionWithIndex:IS,_reduce:If,_reduceRight:IA,_reduceRightWithIndex:Ib,_reduceWithIndex:Iv,_sequence:IT,_traverse:I_,collect:wV,compact:IL,deleteAt:wG,difference:Il,elem:Ia,empty:w$,every:Ii,filter:IR,filterMap:Ik,filterMapWithIndex:Ie,filterWithIndex:It,flap:Iq,foldMap:IF,foldMapWithIndex:w2,fromEntries:function(e){for(var t={},n=0;n<e.length;n++){var r=e[n];t[r[0]]=r[1]}return t},fromFoldable:In,fromFoldableMap:Ir,fromRecord:function(e){return Object.assign({},e)},getDifferenceMagma:function(){return{concat:function(e,t){return Il(t)(e)}}},getEq:IW,getFoldable:function(e){return{URI:IB,reduce:If(e),foldMap:Ip(e),reduceRight:IA(e)}},getFoldableWithIndex:function(e){return{URI:IB,reduce:If(e),foldMap:Ip(e),reduceRight:IA(e),reduceWithIndex:Iv(e),foldMapWithIndex:Ix(e),reduceRightWithIndex:Ib(e)}},getIntersectionSemigroup:function(e){var t=Is(e);return{concat:function(e,n){return t(n)(e)}}},getMonoid:ID,getShow:IP,getTraversable:IV,getTraversableWithIndex:function(e){return{URI:IB,map:Ic,mapWithIndex:Id,reduce:If(e),foldMap:Ip(e),reduceRight:IA(e),reduceWithIndex:Iv(e),foldMapWithIndex:Ix(e),reduceRightWithIndex:Ib(e),traverse:I_(e),sequence:IT(e),traverseWithIndex:IO(e)}},getUnionMonoid:function(e){return{concat:Iz(e).concat,empty:w$}},getUnionSemigroup:Iz,getWitherable:function(e){var t=IV(e);return{URI:IB,map:Ic,reduce:If(e),foldMap:Ip(e),reduceRight:IA(e),traverse:t.traverse,sequence:t.sequence,compact:IL,separate:IK,filter:Ih,filterMap:Im,partition:Ig,partitionMap:Iy,wither:iz(t,IQ),wilt:iV(t,IQ)}},has:wH,hasOwnProperty:I0,insertAt:wY,intersection:Is,isEmpty:wN,isSubrecord:wZ,keys:wQ,lookup:wJ,map:w0,mapWithIndex:wX,modifyAt:function(e,t){return function(n){if(!wH(e,n))return eS;var r=t(n[e]);if(r===n[e])return ew(n);var i=Object.assign({},n);return i[e]=r,ew(i)}},partition:IE,partitionMap:IM,partitionMapWithIndex:w7,partitionWithIndex:w8,pop:function(e){var t=wG(e);return function(n){var r=wJ(e,n);return eb(r)?eS:ew([r.value,t(n)])}},readonlyRecord:I1,reduce:Ij,reduceRight:IU,reduceRightWithIndex:w6,reduceWithIndex:w1,separate:IK,sequence:w4,singleton:w5,size:wD,some:Io,toEntries:wz,toReadonlyArray:wz,toRecord:function(e){return Object.assign({},e)},toUnfoldable:function(e){return function(t){var n=wz(t),r=n.length;return e.unfold(0,function(e){return e<r?ew([n[e],e+1]):eS})}},traverse:w9,traverseWithIndex:w3,union:Iu,updateAt:function(e,t){return function(n){if(!wH(e,n))return eS;if(n[e]===t)return ew(n);var r=Object.assign({},n);return r[e]=t,ew(r)}},upsertAt:wY,wilt:function(e){var t=w9(e);return function(n){return function(r){return e.map(eg(r,t(n)),IK)}}},wither:function(e){var t=w9(e);return function(n){return function(r){return e.map(eg(r,t(n)),IL)}}}},Symbol.toStringTag,{value:"Module"}));var I6=function(e){return function(t){for(var n=t.length,r=new Set,i=_l(e),o=0;o<n;o++){var a=t[o];i(a,r)||r.add(a)}return r}};function I5(e){return function(t){for(var n,r=t.values(),i=new Set;!(n=r.next()).done;){var o=n.value;e(o)&&i.add(o)}return i}}function I3(e){var t=_l(e);return function(n,r){if(void 0===r){var i=I3(e);return function(e){return i(n,e)}}if(_o(n))return r;if(_o(r))return n;var o=new Set(n);return r.forEach(function(e){t(e,o)||o.add(e)}),o}}function I9(e){var t=_l(e);return function(n,r){if(void 0===r){var i=I9(e);return function(e){return i(e,n)}}if(_o(n)||_o(r))return _i;var o=new Set;return n.forEach(function(e){t(e,r)&&o.add(e)}),o}}function I4(e){var t=_l(e);return function(n,r){if(void 0===r){var i=I4(e);return function(e){return i(e,n)}}return I5(function(e){return!t(e,r)})(n)}}function I7(e){var t=_c(e);return function(e,n){return function(r){return t(r).reduce(n,e)}}}function I8(e,t){var n=_c(e);return function(e){return function(r){return n(r).reduce(function(n,r){return t.concat(n,e(r))},t.empty)}}}var _e=function(e){var t=_c(e);return function(e,n){return function(r){return t(r).reduceRight(function(e,t){return n(t,e)},e)}}};function _t(e){var t=_l(e);return function(e){return function(n){if(t(e)(n))return n;var r=new Set(n);return r.add(e),r}}}var _n=function(e){return function(t){return function(n){return I5(function(n){return!e.equals(t,n)})(n)}}};function _r(e){var t=_l(e);return function(e){return function(n){var r=new Set;return n.forEach(function(n){var i=e(n);"Some"!==i._tag||t(i.value,r)||r.add(i.value)}),r}}}var _i=new Set,_o=function(e){return 0===e.size},_a=function(e){return function(t){for(var n,r=t.values(),i=!1;!i&&!(n=r.next()).done;)i=e(n.value);return i}};function _u(e){return sV(_a(sV(e)))}function _s(e){var t=_l(e);return function(n,r){if(void 0===r){var i=_s(e);return function(e){return i(e,n)}}return _u(function(e){return t(e,r)})(n)}}function _l(e){return function(t,n){if(void 0===n){var r=_l(e);return function(e){return r(t,e)}}for(var i,o=n.values(),a=!1;!a&&!(i=o.next()).done;)a=e.equals(t,i.value);return a}}var _c=function(e){return function(t){var n=[];return t.forEach(function(e){return n.push(e)}),n.sort(e.compare)}};function _d(e){return{show:function(t){var n=[];return t.forEach(function(t){n.push(e.show(t))}),"new Set([".concat(n.sort().join(", "),"])")}}}function _f(e){var t=_s(e);return tt(function(e,n){return t(e,n)&&t(n,e)})}var _p=function(e){return{concat:I3(e)}};let _A=Object.freeze(Object.defineProperty({__proto__:null,URI:"ReadonlySet",chain:function(e){var t=_l(e);return function(e){return function(n){var r=new Set;return n.forEach(function(n){e(n).forEach(function(e){t(e,r)||r.add(e)})}),r}}},compact:function(e){return _r(e)(es)},difference:I4,elem:_l,empty:_i,every:_u,filter:I5,filterMap:_r,foldMap:I8,fromArray:I6,fromReadonlyArray:I6,fromSet:function(e){return new Set(e)},getDifferenceMagma:function(e){return{concat:I4(e)}},getEq:_f,getIntersectionSemigroup:function(e){return{concat:I9(e)}},getShow:_d,getUnionMonoid:function(e){return{concat:_p(e).concat,empty:_i}},getUnionSemigroup:_p,insert:_t,intersection:I9,isEmpty:_o,isSubset:_s,map:function(e){var t=_l(e);return function(e){return function(n){var r=new Set;return n.forEach(function(n){var i=e(n);t(i,r)||r.add(i)}),r}}},partition:function(e){return function(t){for(var n,r=t.values(),i=new Set,o=new Set;!(n=r.next()).done;){var a=n.value;e(a)?i.add(a):o.add(a)}return iU(o,i)}},partitionMap:function(e,t){return function(n){return function(r){for(var i,o=r.values(),a=new Set,u=new Set,s=_l(e),l=_l(t);!(i=o.next()).done;){var c=n(i.value);switch(c._tag){case"Left":s(c.left,a)||a.add(c.left);break;case"Right":l(c.right,u)||u.add(c.right)}}return iU(a,u)}}},reduce:I7,reduceRight:_e,remove:_n,separate:function(e,t){return function(n){var r=_l(e),i=_l(t),o=new Set,a=new Set;return n.forEach(function(e){switch(e._tag){case"Left":r(e.left,o)||o.add(e.left);break;case"Right":i(e.right,a)||a.add(e.right)}}),iU(o,a)}},singleton:function(e){return new Set([e])},size:function(e){return e.size},some:_a,toReadonlyArray:_c,toSet:function(e){return new Set(e)},toggle:function(e){var t=_l(e),n=_n(e),r=_t(e);return function(e){return function(i){return(t(e,i)?n:r)(e)(i)}}},union:I3},Symbol.toStringTag,{value:"Module"}));function _h(e){return e[0]}function _m(e){return e[1]}function _g(e){return{URI:_W,_E:void 0,map:_b,ap:function(t,n){return[_h(t)(_h(n)),e.concat(_m(t),_m(n))]}}}var _y=function(e){return function(t){return[t,e.empty]}};function _v(e){var t=_g(e);return{URI:_W,_E:void 0,map:t.map,ap:t.ap,chain:function(t,n){var r=n(_h(t)),i=r[0],o=r[1];return[i,e.concat(_m(t),o)]}}}var _x=function(e,t){return eg(e,_M(t))},_b=function(e,t){return eg(e,_k(t))},_C=function(e,t,n){return eg(e,_R(t,n))},_S=function(e,t){return eg(e,_E(t))},_w=function(e,t){return eg(e,_j(t))},_I=function(e,t,n){return eg(e,_U(t,n))},__=function(e){var t=_L();return function(e,n){return eg(e,t(n))}},_T=function(e,t,n){return eg(e,_K(t,n))},_O=function(e){var t=_B(e);return function(e,n){return eg(e,t(n))}},_R=function(e,t){return function(n){return[t(_h(n)),e(_m(n))]}},_k=function(e){return function(t){return[e(_h(t)),_m(t)]}},_E=function(e){return function(t){return[_h(t),e(_m(t))]}},_M=function(e){return function(t){return[_h(t),_m(e)]}},_j=function(e){return function(t){return[e(t),_m(t)]}},_F=_j(es),_U=function(e,t){return function(n){return t(e,_h(n))}},_L=function(){return function(e){return function(t){return e(_h(t))}}},_K=function(e,t){return function(n){return t(_h(n),e)}},_B=function(e){return function(t){return function(n){return e.map(t(_h(n)),function(e){return[e,_m(n)]})}}},_P=function(e){return function(t){return e.map(_h(t),function(e){return[e,_m(t)]})}},_W="ReadonlyTuple",_D={URI:_W,map:_b},_N=ez(_D);let _q=Object.freeze(Object.defineProperty({__proto__:null,Bifunctor:{URI:_W,bimap:_C,mapLeft:_S},Comonad:{URI:_W,map:_b,extend:_w,extract:_h},Foldable:{URI:_W,reduce:_I,foldMap:__,reduceRight:_T},Functor:_D,Semigroupoid:{URI:_W,compose:_x},Traversable:{URI:_W,map:_b,reduce:_I,foldMap:__,reduceRight:_T,traverse:_O,sequence:_P},URI:_W,bimap:_R,compose:_M,duplicate:_F,extend:_j,extract:_h,flap:_N,foldMap:_L,fst:_h,getApplicative:function(e){var t=_g(e);return{URI:_W,_E:void 0,map:t.map,ap:t.ap,of:_y(e)}},getApply:_g,getChain:_v,getChainRec:function(e){var t=_v(e);return{URI:_W,_E:void 0,map:t.map,ap:t.ap,chain:t.chain,chainRec:function(t,n){for(var r=n(t),i=e.empty,o=_h(r);"Left"===o._tag;)i=e.concat(i,_m(r)),o=_h(r=n(o.left));return[o.right,e.concat(i,_m(r))]}}},getMonad:function(e){var t=_v(e);return{URI:_W,_E:void 0,map:t.map,ap:t.ap,chain:t.chain,of:_y(e)}},map:_k,mapFst:_k,mapLeft:_E,mapSnd:_E,readonlyTuple:{URI:_W,compose:_x,map:_b,bimap:_C,mapLeft:_S,extract:_h,extend:_w,reduce:_I,foldMap:__,reduceRight:_T,traverse:_O,sequence:_P},reduce:_U,reduceRight:_K,sequence:_P,snd:_m,swap:function(e){return[_m(e),_h(e)]},traverse:_B},Symbol.toStringTag,{value:"Module"}));var _Q=function(){return(_Q=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)},_V=function(e){return function(t){return Object.keys(t).sort(e.compare)}},_z=_V(wP);function _Y(e){if("function"==typeof e)return _Y(wP)(e);var t=_V(e);return function(e){return function(n){for(var r=[],i=0,o=t(n);i<o.length;i++){var a=o[i];r.push(e(a,n[a]))}return r}}}var _H=_Y(wP)(function(e,t){return[e,t]});function _G(e){return function(t){if(!eU.call(t,e))return t;var n=Object.assign({},t);return delete n[e],n}}var _Z=function(e,t){return function(n){if(!wH(e,n))return eS;var r=Object.assign({},n);return r[e]=t(n[e]),ew(r)}};function _J(e){return w9(e)}function _$(e){return w4(e)}function _X(e,t){return In(e,t)}var _0=function(e){var t=Iu(e);return function(e){return function(n){return wN(n)?_Q({},e):wN(e)?_Q({},n):t(e)(n)}}},_1=function(e){return function(t){return function(n){return wN(n)||wN(t)?{}:Is(e)(t)(n)}}},_2=function(e){return function(t){return wN(t)?_Q({},e):wN(e)?_Q({},t):Il(e)(t)}},_6=function(e){return function(t){var n=_V(e);return function(e,r){var i=n(e);if(0===i.length)return t.of({});for(var o=t.of({}),a=function(n){o=t.ap(t.map(o,function(e){return function(t){return e[n]=t,e}}),r(n,e[n]))},u=0;u<i.length;u++)a(i[u]);return o}}},_5="Record",_3={URI:_5,map:Ic},_9=ez(_3),_4={URI:_5,compact:IL,separate:IK},_7=function(e){return{URI:_5,map:Ic,reduce:If(e),foldMap:Ip(e),reduceRight:IA(e),traverse:I_(e),sequence:IT(e)}},_8=function(e){var t=_0(e);return{concat:function(e,n){return t(n)(e)}}},Te={URI:_5,reduce:If(wP),foldMap:Ip(wP),reduceRight:IA(wP)},Tt={URI:_5,reduce:If(wP),foldMap:Ip(wP),reduceRight:IA(wP),reduceWithIndex:Iv(wP),foldMapWithIndex:Ix(wP),reduceRightWithIndex:Ib(wP)},Tn={URI:_5,map:Ic,reduce:If(wP),foldMap:Ip(wP),reduceRight:IA(wP),traverse:I_(wP),sequence:_$},Tr={URI:_5,map:Ic,mapWithIndex:Id,reduce:If(wP),foldMap:Ip(wP),reduceRight:IA(wP),reduceWithIndex:Iv(wP),foldMapWithIndex:Ix(wP),reduceRightWithIndex:Ib(wP),traverse:I_(wP),sequence:_$,traverseWithIndex:_6(wP)},Ti=iz(Tn,_4),To=iV(Tn,_4),Ta={URI:_5,map:Ic,reduce:If(wP),foldMap:Ip(wP),reduceRight:IA(wP),traverse:I_(wP),sequence:_$,compact:IL,separate:IK,filter:Ih,filterMap:Im,partition:Ig,partitionMap:Iy,wither:Ti,wilt:To},Tu={URI:_5,map:Ic,reduce:If(wP),foldMap:Ip(wP),reduceRight:IA(wP),traverse:I_(wP),sequence:_$,compact:IL,separate:IK,filter:Ih,filterMap:Im,partition:Ig,partitionMap:Iy,mapWithIndex:Id,reduceWithIndex:Iv(wP),foldMapWithIndex:Ix(wP),reduceRightWithIndex:Ib(wP),filterMapWithIndex:Iw,filterWithIndex:II,partitionMapWithIndex:IC,partitionWithIndex:IS,traverseWithIndex:_6(wP),wither:Ti,wilt:To};let Ts=Object.freeze(Object.defineProperty({__proto__:null,Compactable:_4,Filterable:{URI:_5,map:Ic,compact:IL,separate:IK,filter:Ih,filterMap:Im,partition:Ig,partitionMap:Iy},FilterableWithIndex:{URI:_5,map:Ic,mapWithIndex:Id,compact:IL,separate:IK,filter:Ih,filterMap:Im,partition:Ig,partitionMap:Iy,filterMapWithIndex:Iw,filterWithIndex:II,partitionMapWithIndex:IC,partitionWithIndex:IS},Foldable:Te,FoldableWithIndex:Tt,Functor:_3,FunctorWithIndex:{URI:_5,map:Ic,mapWithIndex:Id},Traversable:Tn,TraversableWithIndex:Tr,URI:_5,Witherable:Ta,collect:_Y,compact:IL,deleteAt:_G,difference:_2,elem:Ia,empty:{},every:Ii,filter:IR,filterMap:Ik,filterMapWithIndex:Ie,filterWithIndex:function(e){return It(e)},flap:_9,foldMap:function(e){return"compare"in e?IF(e):IF(wP)(e)},foldMapWithIndex:function(e){return"compare"in e?w2(e):w2(wP)(e)},fromEntries:function(e){return _X(tB(),se)(e)},fromFoldable:_X,fromFoldableMap:function(e,t){return Ir(e,t)},getDifferenceMagma:function(){return{concat:function(e,t){return _2(t)(e)}}},getEq:IW,getFoldable:function(e){return{URI:_5,reduce:If(e),foldMap:Ip(e),reduceRight:IA(e)}},getFoldableWithIndex:function(e){return{URI:_5,reduce:If(e),foldMap:Ip(e),reduceRight:IA(e),reduceWithIndex:Iv(e),foldMapWithIndex:Ix(e),reduceRightWithIndex:Ib(e)}},getIntersectionSemigroup:function(e){var t=_1(e);return{concat:function(e,n){return t(n)(e)}}},getMonoid:ID,getShow:function(e){return"compare"in e?IP(e):IP(wP)(e)},getTraversable:_7,getTraversableWithIndex:function(e){return{URI:_5,map:Ic,mapWithIndex:Id,reduce:If(e),foldMap:Ip(e),reduceRight:IA(e),reduceWithIndex:Iv(e),foldMapWithIndex:Ix(e),reduceRightWithIndex:Ib(e),traverse:I_(e),sequence:IT(e),traverseWithIndex:_6(e)}},getUnionMonoid:function(e){return{concat:_8(e).concat,empty:{}}},getUnionSemigroup:_8,getWitherable:function(e){var t=_7(e);return{URI:_5,map:Ic,reduce:If(e),foldMap:Ip(e),reduceRight:IA(e),traverse:t.traverse,sequence:t.sequence,compact:IL,separate:IK,filter:Ih,filterMap:Im,partition:Ig,partitionMap:Iy,wither:iz(t,_4),wilt:iV(t,_4)}},has:wH,hasOwnProperty:I0,insertAt:wY,intersection:_1,isEmpty:wN,isSubrecord:wZ,keys:_z,lookup:wJ,map:w0,mapWithIndex:wX,modifyAt:_Z,partition:IE,partitionMap:IM,partitionMapWithIndex:w7,partitionWithIndex:function(e){return w8(e)},pop:function(e){var t=_G(e);return function(n){var r=wJ(e,n);return eb(r)?eS:ew([r.value,t(n)])}},record:Tu,reduce:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return 1===e.length?Ij(e[0]):Ij(wP).apply(void 0,e)},reduceRight:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return 1===e.length?IU(e[0]):IU(wP).apply(void 0,e)},reduceRightWithIndex:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return 1===e.length?w6(e[0]):w6(wP).apply(void 0,e)},reduceWithIndex:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return 1===e.length?w1(e[0]):w1(wP).apply(void 0,e)},separate:IK,sequence:_$,singleton:w5,size:wD,some:Io,toArray:_H,toEntries:_H,toUnfoldable:function(e){return function(t){var n=_H(t),r=n.length;return e.unfold(0,function(e){return e<r?ew([n[e],e+1]):eS})}},traverse:_J,traverseWithIndex:function(e){return w3(e)},union:_0,updateAt:function(e,t){return _Z(e,function(){return t})},upsertAt:wY,wilt:function(e){var t=_J(e);return function(n){return function(r){return e.map(eg(r,t(n)),IK)}}},wither:function(e){var t=_J(e);return function(n){return function(r){return e.map(eg(r,t(n)),IL)}}}},Symbol.toStringTag,{value:"Module"})),Tl=Object.freeze(Object.defineProperty({__proto__:null,and:function(e){return function(t){return function(n){return t(n)&&e(n)}}},compose:function(e){return function(t){return function(n){return t(n)&&e(n)}}},fromEitherK:function(e){return function(t){return e_(e(t))}},fromOptionK:function(e){return function(t){return eC(e(t))}},id:function(){return function(e){return!0}},not:function(e){return function(t){return!e(t)}},or:function(e){return function(t){return function(n){return t(n)||e(n)}}},zero:function(){return function(e){return!1}}},Symbol.toStringTag,{value:"Module"}));var Tc=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return{add:function(t,n){return e.map(function(e,r){return e.add(t[r],n[r])})},zero:e.map(function(e){return e.zero}),mul:function(t,n){return e.map(function(e,r){return e.mul(t[r],n[r])})},one:e.map(function(e){return e.one}),sub:function(t,n){return e.map(function(e,r){return e.sub(t[r],n[r])})}}};let Td=Object.freeze(Object.defineProperty({__proto__:null,getFunctionRing:eu,getTupleRing:Tc,negate:function(e){return function(t){return e.sub(e.zero,t)}},tuple:Tc},Symbol.toStringTag,{value:"Module"})),Tf=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),Tp=Object.freeze(Object.defineProperty({__proto__:null,getFunctionSemiring:ea},Symbol.toStringTag,{value:"Module"}));function TA(e){return function(t){for(var n,r=t.values(),i=new Set;!(n=r.next()).done;){var o=n.value;e(o)&&i.add(o)}return i}}function Th(e){var t=TI(e);return function(n,r){if(void 0===r){var i=Th(e);return function(e){return i(n,e)}}if(Tw(n))return r;if(Tw(r))return n;var o=new Set(n);return r.forEach(function(e){t(e,o)||o.add(e)}),o}}function Tm(e){var t=TI(e);return function(n,r){if(void 0===r){var i=Tm(e);return function(e){return i(e,n)}}if(Tw(n)||Tw(r))return new Set;var o=new Set;return n.forEach(function(e){t(e,r)&&o.add(e)}),o}}function Tg(e){var t=TI(e);return function(n,r){if(void 0===r){var i=Tg(e);return function(e){return i(e,n)}}return TA(function(e){return!t(e,r)})(n)}}var Ty=function(e){return{concat:Th(e)}};function Tv(e){var t=TI(e);return function(e){return function(n){if(t(e)(n))return n;var r=new Set(n);return r.add(e),r}}}var Tx=function(e){return function(t){return function(n){return TA(function(n){return!e.equals(t,n)})(n)}}},Tb=function(e){return function(t){for(var n=t.length,r=new Set,i=TI(e),o=0;o<n;o++){var a=t[o];i(a,r)||r.add(a)}return r}};function TC(e){var t=TI(e);return function(e){return function(n){var r=new Set;return n.forEach(function(n){var i=e(n);"Some"!==i._tag||t(i.value,r)||r.add(i.value)}),r}}}var TS=new Set,Tw=function(e){return 0===e.size},TI=_l,T_=function(e){return function(t){var n=[];return t.forEach(function(e){return n.push(e)}),n.sort(e.compare)}};let TT=Object.freeze(Object.defineProperty({__proto__:null,chain:function(e){var t=TI(e);return function(e){return function(n){var r=new Set;return n.forEach(function(n){e(n).forEach(function(e){t(e,r)||r.add(e)})}),r}}},compact:function(e){return TC(e)(es)},difference:Tg,elem:TI,empty:TS,every:_u,filter:TA,filterMap:TC,foldMap:I8,fromArray:Tb,getDifferenceMagma:function(e){return{concat:Tg(e)}},getEq:_f,getIntersectionSemigroup:function(e){return{concat:Tm(e)}},getShow:_d,getUnionMonoid:function(e){return{concat:Ty(e).concat,empty:new Set}},getUnionSemigroup:Ty,insert:Tv,intersection:Tm,isEmpty:Tw,isSubset:_s,map:function(e){var t=TI(e);return function(e){return function(n){var r=new Set;return n.forEach(function(n){var i=e(n);t(i,r)||r.add(i)}),r}}},partition:function(e){return function(t){for(var n,r=t.values(),i=new Set,o=new Set;!(n=r.next()).done;){var a=n.value;e(a)?i.add(a):o.add(a)}return iU(o,i)}},partitionMap:function(e,t){return function(n){return function(r){for(var i,o=r.values(),a=new Set,u=new Set,s=TI(e),l=TI(t);!(i=o.next()).done;){var c=n(i.value);switch(c._tag){case"Left":s(c.left,a)||a.add(c.left);break;case"Right":l(c.right,u)||u.add(c.right)}}return iU(a,u)}}},reduce:I7,reduceRight:_e,remove:Tx,separate:function(e,t){return function(n){var r=TI(e),i=TI(t),o=new Set,a=new Set;return n.forEach(function(e){switch(e._tag){case"Left":r(e.left,o)||o.add(e.left);break;case"Right":i(e.right,a)||a.add(e.right)}}),iU(o,a)}},singleton:function(e){return new Set([e])},size:function(e){return e.size},some:_a,subset:_s,toArray:T_,toggle:function(e){var t=TI(e),n=Tx(e),r=Tv(e);return function(e){return function(i){return(t(e,i)?n:r)(e)(i)}}},union:Th},Symbol.toStringTag,{value:"Module"}));var TO=function(e){return{show:function(t){var n="{";for(var r in e)eU.call(e,r)&&(n+=" ".concat(r,": ").concat(e[r].show(t[r]),","));return n.length>1&&(n=n.slice(0,-1)+" "),n+="}"}}},TR=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return{show:function(t){return"[".concat(t.map(function(t,n){return e[n].show(t)}).join(", "),"]")}}};let Tk=Object.freeze(Object.defineProperty({__proto__:null,getStructShow:TO,getTupleShow:TR,showBoolean:{show:function(e){return JSON.stringify(e)}},showNumber:{show:function(e){return JSON.stringify(e)}},showString:{show:function(e){return JSON.stringify(e)}},struct:TO,tuple:TR},Symbol.toStringTag,{value:"Module"}));function TE(e){return function(t){return function(n){return e.of([t,n])}}}function TM(e){return function(t){return function(n){return function(r){return e.map(n(r),function(e){var n=e[0],r=e[1];return[t(n),r]})}}}}function Tj(e){return function(t){return function(n){return function(r){return e.chain(n(r),function(n){var r=n[0],i=n[1];return e.map(t(i),function(e){var t=e[0],n=e[1];return[r(t),n]})})}}}}function TF(e){return function(t){return function(n){return function(r){return e.chain(n(r),function(e){var n=e[0],r=e[1];return t(n)(r)})}}}}function TU(e){return function(t){return function(n){return e.of(t(n))}}}function TL(e){return function(t){return function(n){return e.map(t,function(e){return[e,n]})}}}function TK(e){return function(t){return function(n){return e.map(n(t),function(e){return e[0]})}}}function TB(e){return function(t){return function(n){return e.map(n(t),_m)}}}let TP=Object.freeze(Object.defineProperty({__proto__:null,ap:Tj,chain:TF,evaluate:TK,execute:TB,fromF:TL,fromState:TU,getStateM:function(e){var t=Tj(e),n=TM(e),r=TF(e),i=TK(e),o=TB(e);return{map:function(e,t){return eg(e,n(t))},ap:function(e,n){return eg(e,t(n))},of:TE(e),chain:function(e,t){return eg(e,r(t))},get:function(){return function(t){return e.of([t,t])}},put:function(t){return function(){return e.of([void 0,t])}},modify:function(t){return function(n){return e.of([void 0,t(n)])}},gets:function(t){return function(n){return e.of([t(n),n])}},fromState:TU(e),fromM:TL(e),evalState:function(e,t){return eg(e,i(t))},execState:function(e,t){return eg(e,o(t))}}},map:TM,of:TE},Symbol.toStringTag,{value:"Module"}));var TW=function(e){return function(){return C9(e)}},TD=TE(SH);function TN(e){return TG(C7(e))}function Tq(e){return TG(Se(e))}function TQ(e){return TG(Si(e))}var TV=dr(function(e){return TW(e)},TD),Tz=TU(SH),TY=function(e){return TG(el(e))},TH=function(e){return TG(Sa(e))},TG=TL(Sz),TZ=function(e){return function(t){return function(n){return e(n)(t)(n)}}},TJ=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return TH(e.apply(void 0,t))}},T$=function(e){return function(t){return eg(t,On(TJ(e)))}},TX=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return TY(e.apply(void 0,t))}},T0=function(e){return function(t){return eg(t,On(TX(e)))}},T1=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return TG(e.apply(void 0,t))}},T2=function(e){return function(t){return eg(t,On(T1(e)))}},T6=function(e,t){return eg(e,T8(t))},T5=function(e,t){return eg(e,Oe(t))},T3=function(e,t){return eg(e,Ot(t))},T9=function(e,t){return function(n){return eg(e(n),SD(function(){return t()(n)}))}},T4=function(e,t,n){return function(r){return eg(e(r),SU(t,function(e){var t=e[0],r=e[1];return[n(t),r]}))}},T7=function(e,t){return function(n){return eg(e(n),SL(t))}},T8=TM(Sz),Oe=Tj(S0),Ot=TF(S0),On=Ot,Or=On(es),Oi=function(e){return function(t){return function(n){return eg(t(n),SD(function(){return e()(n)}))}}},Oo="StateReaderTaskEither",Oa={URI:Oo,map:T6},Ou=ez(Oa),Os={URI:Oo,map:T6,ap:T5},Ol=eB(Os),Oc=eP(Os),Od={URI:Oo,map:T6,ap:T5,chain:T3},Of={URI:Oo,fromState:Tz},Op=pj(Of),OA=pF(Of),Oh=pU(Of),Om=pL(Of),Og=pK(Of),Oy=pB(Of,Od),Ov=eX(Od),Ox={URI:Oo,fromReader:Tq},Ob=f7(Ox),OC=f8(Ox),OS=pe(Ox),Ow=pt(Ox,Od),OI=pn(Ox,Od),O_={URI:Oo,fromEither:TV},OT=e2(O_),OO=e5(O_),OR=e3(O_,Od),Ok=e4(O_,Od),OE=e7(O_,Od),OM=e6(O_),Oj=e8(O_,Od),OF=e9(O_),OU={URI:Oo,fromIO:TQ},OL=fA(OU),OK=fh(OU,Od),OB=fm(OU,Od),OP={URI:Oo,fromIO:TQ,fromTask:TN},OW=pW(OP),OD=pD(OP,Od),ON=pN(OP,Od),Oq=TK(Sz),OQ=TB(Sz),OV=eY(Oa),Oz=e0(Od),OY=eW(Os),OH=function(e){return function(t){return function(n){return function(r){return function(){return eM(t).reduce(function(t,n,i){return t.then(function(o){return eI(o)?t:e(i+1,n)(o.right[1])(r)().then(function(e){if(eI(e))return e;var t=e.right,n=t[0],r=t[1];return o.right[0].push(n),o.right[1]=r,o})})},e(0,eE(t))(n)(r)().then(cD(function(e){return[[e[0]],e[1]]})))}}}}},OG=function(e){var t=OH(e);return function(e){return ek(e)?t(e):TD(ej)}},OZ=function(e){return OG(function(t,n){return e(n)})};let OJ=Object.freeze(Object.defineProperty({__proto__:null,Alt:{URI:Oo,map:T6,alt:T9},Applicative:{URI:Oo,map:T6,ap:T5,of:TD},Apply:Os,Bifunctor:{URI:Oo,bimap:T4,mapLeft:T7},Chain:Od,FromEither:O_,FromIO:OU,FromReader:Ox,FromState:Of,FromTask:OP,Functor:Oa,Monad:{URI:Oo,map:T6,ap:T5,of:TD,chain:T3},MonadIO:{URI:Oo,map:T6,ap:T5,of:TD,chain:T3,fromIO:TQ},MonadTask:{URI:Oo,map:T6,ap:T5,of:TD,chain:T3,fromIO:TQ,fromTask:TN},MonadThrow:{URI:Oo,map:T6,ap:T5,of:TD,chain:T3,throwError:TW},Pointed:{URI:Oo,of:TD},URI:Oo,alt:Oi,altW:Oi,ap:Oe,apFirst:Ol,apFirstW:Ol,apS:OY,apSW:OY,apSecond:Oc,apSecondW:Oc,apW:Oe,ask:Ob,asks:OC,asksStateReaderTaskEither:TZ,asksStateReaderTaskEitherW:TZ,bimap:function(e,t){return function(n){return T4(n,e,t)}},bind:Oz,bindTo:OV,bindW:Oz,chain:Ot,chainEitherK:Ok,chainEitherKW:Ok,chainFirst:Ov,chainFirstEitherK:OE,chainFirstEitherKW:OE,chainFirstIOK:OB,chainFirstReaderK:OI,chainFirstReaderKW:OI,chainFirstTaskK:ON,chainFirstW:Ov,chainIOEitherK:T$,chainIOEitherKW:T$,chainIOK:OK,chainOptionK:OR,chainReaderK:Ow,chainReaderKW:Ow,chainReaderTaskEitherK:T2,chainReaderTaskEitherKW:T2,chainStateK:Oy,chainTaskEitherK:T0,chainTaskEitherKW:T0,chainTaskK:OD,chainW:On,evalState:function(e,t){return eg(e(t),SF(function(e){return e[0]}))},evaluate:Oq,execState:function(e,t){return eg(e(t),SF(function(e){return e[0],e[1]}))},execute:OQ,filterOrElse:Oj,filterOrElseW:Oj,flap:Ou,flatten:Or,flattenW:Or,fromEither:TV,fromEitherK:OF,fromIO:TQ,fromIOEither:TH,fromIOEitherK:TJ,fromIOK:OL,fromOption:OT,fromOptionK:OO,fromPredicate:OM,fromReader:Tq,fromReaderEither:function(e){return TG(Su(e))},fromReaderK:OS,fromReaderTaskEither:TG,fromReaderTaskEitherK:T1,fromState:Tz,fromStateK:Og,fromTask:TN,fromTaskEither:TY,fromTaskEitherK:TX,fromTaskK:OW,get:Op,gets:Om,left:TW,leftIO:function(e){return TG(So(e))},leftReader:function(e){return TG(St(e))},leftState:function(e){return function(t){return C9(e(t)[0])}},leftTask:function(e){return TG(C8(e))},local:function(e){return function(t){return eA(t,fv(e))}},map:T8,mapLeft:function(e){return function(t){return T7(t,e)}},modify:Oh,of:TD,put:OA,right:TD,rightIO:TQ,rightReader:Tq,rightState:function(e){return eA(e,C4)},rightTask:TN,run:function(e,t,n){return e(t)(n)()},sequenceArray:OZ(es),stateReaderTaskEither:{URI:Oo,map:T6,of:TD,ap:T5,chain:T3,bimap:T4,mapLeft:T7,alt:T9,fromIO:TQ,fromTask:TN,throwError:TW},stateReaderTaskEitherSeq:{URI:Oo,map:T6,of:TD,ap:T5,chain:T3,bimap:T4,mapLeft:T7,alt:T9,fromIO:TQ,fromTask:TN,throwError:TW},throwError:TW,traverseArray:OZ,traverseArrayWithIndex:OG,traverseReadonlyArrayWithIndex:OG,traverseReadonlyNonEmptyArrayWithIndex:OH},Symbol.toStringTag,{value:"Module"}));var O$=function(e,t){return eg(e,O2(t))},OX=function(e){return function(t){return{peek:function(n){return e({peek:t.peek,pos:n})},pos:t.pos}}},O0=function(e){return e.peek(e.pos)},O1=OX(es),O2=function(e){return function(t){return{peek:function(n){return e(t.peek(n))},pos:t.pos}}},O6="Store",O5={URI:O6,map:O$},O3=ez(O5),O9={URI:O6,map:O$,extend:function(e,t){return eg(e,OX(t))},extract:O0};let O4=Object.freeze(Object.defineProperty({__proto__:null,Comonad:O9,Functor:O5,URI:O6,duplicate:O1,experiment:function(e){return function(t){return function(n){return e.map(t(n.pos),function(e){return n.peek(e)})}}},extend:OX,extract:O0,flap:O3,map:O2,peeks:function(e){return function(t){return t.peek(e(t.pos))}},seek:function(e){return function(t){return{peek:t.peek,pos:e}}},seeks:function(e){return function(t){return{peek:t.peek,pos:e(t.pos)}}},store:O9},Symbol.toStringTag,{value:"Module"}));function O7(e,t){return function(n,r){return t.compose(e.second(r),e.first(n))}}function O8(e,t){var n=O7(e,t);return function(r,i){return t.compose(n(r,i),e.promap(t.id(),es,function(e){return[e,e]}))}}let Re=Object.freeze(Object.defineProperty({__proto__:null,fanOut:O8,fanout:function(e){return O8(e,e)},split:O7,splitStrong:function(e){return O7(e,e)}},Symbol.toStringTag,{value:"Module"})),Rt=Object.freeze(Object.defineProperty({__proto__:null,evolve:function(e){return function(t){var n={};for(var r in t)eU.call(t,r)&&(n[r]=e[r](t[r]));return n}},getAssignSemigroup:function(){return{concat:function(e,t){return Object.assign({},e,t)}}}},Symbol.toStringTag,{value:"Module"}));var Rn=function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function u(o){return function(u){return function(o){if(n)throw TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=(i=a.trys).length>0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=t.call(e,a)}catch(e){o=[6,e],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}},Rr=h2(xy),Ri=me(xy),Ro=mt(xy),Ra=function(e){return Ru(xo(e))},Ru=h5(xm),Rs=xc(sJ),Rl=mn(xm),Rc=mr(xI),Rd=mi(x_),Rf=h3(xy),Rp=function(e){return function(){var t,n,r,i;return t=void 0,n=void 0,r=void 0,i=function(){return Rn(this,function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,e().then(ew)];case 1:return[2,t.sent()];case 2:return t.sent(),[2,eS];case 3:return[2]}})},new(r||(r=Promise))(function(e,o){function a(e){try{s(i.next(e))}catch(e){o(e)}}function u(e){try{s(i.throw(e))}catch(e){o(e)}}function s(t){var n;t.done?e(t.value):((n=t.value)instanceof r?n:new r(function(e){e(n)})).then(a,u)}s((i=i.apply(t,n||[])).next())})}},RA=h9(xy),Rh=h4(x_),Rm=h7(xy),Rg=h8(x_),Ry=mo(xm),Rv=ma(xv),Rx=mu(x_),Rb=Rx(es),RC=ms(x_),RS=h6(xy),Rw=RS(),RI=cr(xm,lw),R_=ci(xm,lw,lo),RT=d7(xm,lR),RO=d8(xm,lR),RR=fe(xm,lR),Rk=ft(xm,lR),RE=function(e,t){return eg(e,Ry(t))},RM=function(e,t){return eg(e,Rv(t))},Rj=function(e,t){return eg(e,Rx(t))},RF=function(e,t){return eg(e,RC(t))},RU="TaskOption",RL={URI:RU,map:RE},RK=ez(RL),RB={URI:RU,of:Rr},RP={URI:RU,map:RE,ap:RM},RW=eB(RP),RD=eP(RP),RN=function(e,t){return eg(e,Rx(function(e){return eg(t,Ry(e))}))},Rq={URI:RU,map:RE,ap:RM,chain:Rj},RQ=eX(Rq),RV={URI:RU,zero:RS},Rz=iG(RV,RB),RY={URI:RU,fromIO:Ra},RH=fA(RY),RG=fh(RY,Rq),RZ=fm(RY,Rq),RJ={URI:RU,fromEither:Ro},R$=e9(RJ),RX=e4(RJ,Rq),R0=e7(RJ,Rq),R1={URI:RU,fromIO:Ra,fromTask:Ru},R2=pW(R1),R6=pD(R1,Rq),R5=pN(R1,Rq),R3=Rr(eF),R9=eY(RL),R4=e0(Rq),R7=eW(RP),R8=Rr(ej),ke=function(e){return eA(xB(e),xc(l5(ey)))},kt=function(e){var t=ke(e);return function(e){return ek(e)?t(e):R8}},kn=function(e){return function(t){return function(){return eM(t).reduce(function(t,n,r){return t.then(function(i){return eb(i)?t:e(r+1,n)().then(function(e){return eb(e)?e:(i.value.push(e.value),i)})})},e(0,eE(t))().then(li(eR)))}}},kr=function(e){var t=kn(e);return function(e){return ek(e)?t(e):R8}},ki=function(e){return kt(function(t,n){return e(n)})},ko=ki(es),ka=function(e){return kr(function(t,n){return e(n)})};let ku=Object.freeze(Object.defineProperty({__proto__:null,Alt:{URI:RU,map:RE,alt:RF},Alternative:{URI:RU,map:RE,ap:RM,of:Rr,alt:RF,zero:RS},ApT:R8,ApplicativePar:{URI:RU,map:RE,ap:RM,of:Rr},ApplicativeSeq:{URI:RU,map:RE,ap:RN,of:Rr},ApplyPar:RP,ApplySeq:{URI:RU,map:RE,ap:RN},Chain:Rq,Compactable:{URI:RU,compact:RI,separate:R_},Do:R3,Filterable:{URI:RU,map:RE,compact:RI,separate:R_,filter:function(e,t){return eg(e,RT(t))},filterMap:function(e,t){return eg(e,RO(t))},partition:function(e,t){return eg(e,RR(t))},partitionMap:function(e,t){return eg(e,Rk(t))}},FromEither:RJ,FromIO:RY,FromTask:R1,Functor:RL,Monad:{URI:RU,map:RE,ap:RM,of:Rr,chain:Rj},MonadIO:{URI:RU,map:RE,ap:RM,of:Rr,chain:Rj,fromIO:Ra},MonadTask:{URI:RU,map:RE,ap:RM,of:Rr,chain:Rj,fromIO:Ra,fromTask:Ru},Pointed:RB,Zero:RV,alt:RC,altW:RC,ap:Rv,apFirst:RW,apS:R7,apSecond:RD,bind:R4,bindTo:R9,chain:Rx,chainEitherK:RX,chainFirst:RQ,chainFirstEitherK:R0,chainFirstIOK:RZ,chainFirstTaskK:R5,chainIOK:RG,chainNullableK:Rh,chainOptionK:Rg,chainTaskK:R6,compact:RI,filter:RT,filterMap:RO,flap:RK,flatten:Rb,fold:Rc,foldW:Rc,fromEither:Ro,fromEitherK:R$,fromIO:Ra,fromIOK:RH,fromNullable:Rf,fromNullableK:RA,fromOption:xf,fromOptionK:Rm,fromPredicate:Ri,fromTask:Ru,fromTaskEither:Rs,fromTaskK:R2,getOrElse:Rd,getOrElseW:Rd,guard:Rz,map:Ry,match:Rl,matchE:Rc,matchEW:Rc,matchW:Rl,none:Rw,of:Rr,partition:RR,partitionMap:Rk,separate:R_,sequenceArray:ko,sequenceSeqArray:ka(es),some:Rr,traverseArray:ki,traverseArrayWithIndex:kt,traverseReadonlyArrayWithIndex:kt,traverseReadonlyArrayWithIndexSeq:kr,traverseReadonlyNonEmptyArrayWithIndex:ke,traverseReadonlyNonEmptyArrayWithIndexSeq:kn,traverseSeqArray:ka,traverseSeqArrayWithIndex:kr,tryCatch:Rp,tryCatchK:function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return Rp(function(){return e.apply(void 0,t)})}},zero:RS},Symbol.toStringTag,{value:"Module"}));var ks=function(e){return"Left"===e._tag},kl=function(e){return"Right"===e._tag};function kc(e){return"Both"===e._tag}function kd(e){return{_tag:"Left",left:e}}function kf(e){return{_tag:"Right",right:e}}function kp(e,t){return{_tag:"Both",left:e,right:t}}var kA=function(e,t,n){return function(r){switch(r._tag){case"Left":return e(r.left);case"Right":return t(r.right);case"Both":return n(r.left,r.right)}}},kh=kA(kf,kd,function(e,t){return kp(t,e)});function km(e,t){return{concat:function(n,r){return ks(n)?ks(r)?kd(e.concat(n.left,r.left)):kl(r)?kp(n.left,r.right):kp(e.concat(n.left,r.left),r.right):kl(n)?ks(r)?kp(r.left,n.right):kl(r)?kf(t.concat(n.right,r.right)):kp(r.left,t.concat(n.right,r.right)):ks(r)?kp(e.concat(n.left,r.left),n.right):kl(r)?kp(n.left,t.concat(n.right,r.right)):kp(e.concat(n.left,r.left),t.concat(n.right,r.right))}}}var kg=function(e){return{URI:kF,_E:void 0,map:kv,ap:function(t,n){return ks(t)?ks(n)?kd(e.concat(t.left,n.left)):kl(n)?kd(t.left):kd(e.concat(t.left,n.left)):kl(t)?ks(n)?kd(n.left):kl(n)?kf(t.right(n.right)):kp(n.left,t.right(n.right)):ks(n)?kd(e.concat(t.left,n.left)):kl(n)?kp(t.left,t.right(n.right)):kp(e.concat(t.left,n.left),t.right(n.right))}}};function ky(e){return{URI:kF,_E:void 0,map:kv,ap:kg(e).ap,chain:function(t,n){if(ks(t))return t;if(kl(t))return n(t.right);var r=n(t.right);return ks(r)?kd(e.concat(t.left,r.left)):kl(r)?kp(t.left,r.right):kp(e.concat(t.left,r.left),r.right)}}}var kv=function(e,t){return eg(e,kO(t))},kx=function(e,t,n){return eg(e,k_(t,n))},kb=function(e,t){return eg(e,kT(t))},kC=function(e,t,n){return eg(e,kR(t,n))},kS=function(e){var t=kk(e);return function(e,n){return eg(e,t(n))}},kw=function(e,t,n){return eg(e,kE(t,n))},kI=function(e){var t=kM(e);return function(e,n){return eg(e,t(n))}},k_=function(e,t){return function(n){return ks(n)?kd(e(n.left)):kl(n)?kf(t(n.right)):kp(e(n.left),t(n.right))}},kT=function(e){return function(t){return ks(t)?kd(e(t.left)):kc(t)?kp(e(t.left),t.right):t}},kO=function(e){return function(t){return ks(t)?t:kl(t)?kf(e(t.right)):kp(t.left,e(t.right))}},kR=function(e,t){return function(n){return ks(n)?e:t(e,n.right)}},kk=function(e){return function(t){return function(n){return ks(n)?e.empty:t(n.right)}}},kE=function(e,t){return function(n){return ks(n)?e:t(n.right,e)}},kM=function(e){return function(t){return function(n){return ks(n)?e.of(n):kl(n)?e.map(t(n.right),kf):e.map(t(n.right),function(e){return kp(n.left,e)})}}},kj=function(e){return function(t){return ks(t)?e.of(t):kl(t)?e.map(t.right,kf):e.map(t.right,function(e){return kp(t.left,e)})}},kF="These",kU={URI:kF,map:kv},kL=ez(kU),kK={URI:kF,fromEither:es},kB=e2(kK),kP=e5(kK),kW=function(e,t){return function(n){return ks(n)?[n.left,t()]:kl(n)?[e(),n.right]:[n.left,n.right]}},kD=kf(ej),kN=function(e){return function(t){return function(n){var r=eS,i=t(0,eE(n));if(ks(i))return i;kc(i)&&(r=ew(i.left));for(var o=[i.right],a=1;a<n.length;a++){var u=t(a,n[a]);if(ks(u))return u;kc(u)&&(r=eb(r)?ew(u.left):ew(e.concat(r.value,u.left))),o.push(u.right)}return eb(r)?kf(o):kp(r.value,o)}}};let kq=Object.freeze(Object.defineProperty({__proto__:null,ApT:kD,Bifunctor:{URI:kF,bimap:kx,mapLeft:kb},Foldable:{URI:kF,reduce:kC,foldMap:kS,reduceRight:kw},FromEither:kK,FromThese:{URI:kF,fromThese:es},Functor:kU,Pointed:{URI:kF,of:kf},Traversable:{URI:kF,map:kv,reduce:kC,foldMap:kS,reduceRight:kw,traverse:kI,sequence:kj},URI:kF,bimap:k_,both:kp,elem:function(e){return function(t){return function(n){return!ks(n)&&e.equals(t,n.right)}}},exists:function(e){return function(t){return!ks(t)&&e(t.right)}},flap:kL,fold:kA,foldMap:kk,foldW:kA,fromOption:kB,fromOptionK:kP,fromOptions:function(e,t){return eb(e)?eb(t)?eS:ew(kf(t.value)):eb(t)?ew(kd(e.value)):ew(kp(e.value,t.value))},getApplicative:function(e){return{URI:kF,_E:void 0,map:kv,ap:kg(e).ap,of:kf}},getApply:kg,getChain:ky,getEq:function(e,t){return tt(function(n,r){return ks(n)?ks(r)&&e.equals(n.left,r.left):kl(n)?kl(r)&&t.equals(n.right,r.right):kc(r)&&e.equals(n.left,r.left)&&t.equals(n.right,r.right)})},getLeft:function(e){return ks(e)?ew(e.left):kl(e)?eS:ew(e.left)},getLeftOnly:function(e){return ks(e)?ew(e.left):eS},getMonad:function(e){var t=ky(e);return{URI:kF,_E:void 0,map:kv,of:kf,ap:t.ap,chain:t.chain,throwError:kd}},getRight:function(e){return ks(e)?eS:(kl(e),ew(e.right))},getRightOnly:function(e){return kl(e)?ew(e.right):eS},getSemigroup:km,getShow:function(e,t){return{show:kA(function(t){return"left(".concat(e.show(t),")")},function(e){return"right(".concat(t.show(e),")")},function(n,r){return"both(".concat(e.show(n),", ").concat(t.show(r),")")})}},isBoth:kc,isLeft:ks,isRight:kl,left:kd,leftOrBoth:function(e){return function(t){return eb(t)?kd(e):kp(e,t.value)}},map:kO,mapLeft:kT,match:kA,matchW:kA,of:kf,reduce:kR,reduceRight:kE,right:kf,rightOrBoth:function(e){return function(t){return eb(t)?kf(e):kp(t.value,e)}},sequence:kj,swap:kh,these:{URI:kF,map:kv,bimap:kx,mapLeft:kb,reduce:kC,foldMap:kS,reduceRight:kw,traverse:kI,sequence:kj},toTuple:function(e,t){return kW(function(){return e},function(){return t})},toTuple2:kW,traverse:kM,traverseReadonlyArrayWithIndex:function(e){return function(t){var n=kN(e)(t);return function(e){return ek(e)?n(e):kD}}},traverseReadonlyNonEmptyArrayWithIndex:kN},Symbol.toStringTag,{value:"Module"}));function kQ(e){return eA(kf,e.of)}function kV(e){return eA(kd,e.of)}function kz(e){return eA(kp,e.of)}function kY(e){return function(t){return e.map(t,kf)}}function kH(e){return function(t){return e.map(t,kd)}}function kG(e){return eV(e,kU)}function kZ(e,t){return eK(e,kg(t))}function kJ(e,t){var n=kV(e);return function(r){return function(i){return e.chain(i,kA(n,r,function(n,i){return e.map(r(i),kA(function(e){return kd(t.concat(n,e))},function(e){return kp(n,e)},function(e,r){return kp(t.concat(n,e),r)}))}))}}}function k$(e){return function(t,n){return function(r){return e.map(r,k_(t,n))}}}function kX(e){return function(t){return function(n){return e.map(n,kT(t))}}}function k0(e){return function(t,n,r){return function(i){return e.map(i,kA(t,n,r))}}}function k1(e){return function(t,n,r){return function(i){return e.chain(i,kA(t,n,r))}}}function k2(e){return function(t){return e.map(t,kh)}}function k6(e){return function(t,n){return function(r){return e.map(r,kW(t,n))}}}let k5=Object.freeze(Object.defineProperty({__proto__:null,ap:kZ,bimap:k$,both:kz,chain:kJ,getTheseM:function(e){var t=kG(e),n=k$(e),r=kX(e),i=k1(e),o=k6(e),a=kQ(e),u=function(e,n){return eg(e,t(n))};return{map:u,bimap:function(e,t,r){return eg(e,n(t,r))},mapLeft:function(e,t){return eg(e,r(t))},fold:function(e,t,n,r){return eg(e,i(t,n,r))},swap:k2(e),rightM:kY(e),leftM:kH(e),left:kV(e),right:kQ(e),both:kz(e),toTuple:function(e,t,n){return eg(e,o(function(){return t},function(){return n}))},getMonad:function(t){var n=kZ(e,t),r=kJ(e,t);return{_E:void 0,map:u,of:a,ap:function(e,t){return eg(e,n(t))},chain:function(e,t){return eg(e,r(t))}}}}},left:kV,leftF:kH,map:kG,mapLeft:kX,match:k0,matchE:k1,right:kQ,rightF:kY,swap:k2,toTuple2:k6},Symbol.toStringTag,{value:"Module"}));var k3=kV(xy),k9=kQ(xy),k4=kz(xy),k7=kY(xm),k8=kH(xm),Ee=eA(xo,k7),Et=eA(xo,k8),En=k0(xm),Er=k1(x_),Ei=k2(xm),Eo=function(e,t){return eg(e,Es(t))},Ea=function(e,t,n){return eg(e,El(t,n))},Eu=function(e,t){return eg(e,Ec(t))},Es=kG(xm),El=k$(xm),Ec=kX(xm),Ed="TaskThese",Ef=function(e,t){var n=kZ(e,t);return{URI:Ed,_E:void 0,map:Eo,ap:function(e,t){return eg(e,n(t))}}};function Ep(e,t){return{URI:Ed,_E:void 0,map:Eo,ap:Ef(e,t).ap,of:k9}}function EA(e){var t=Ef(xC,e),n=kJ(x_,e);return{URI:Ed,_E:void 0,map:Eo,ap:t.ap,chain:function(e,t){return eg(e,n(t))}}}var Eh={URI:Ed,map:Eo},Em=ez(Eh),Eg={URI:Ed,fromEither:xf},Ey=e2(Eg),Ev=e5(Eg),Ex=e6(Eg),Eb={URI:Ed,fromThese:xf},EC=pQ(Eb),ES={URI:Ed,fromIO:Ee},Ew=fA(ES),EI={URI:Ed,fromIO:Ee,fromTask:k7},E_=pW(EI),ET=k6(xm),EO=k9(ej),ER=function(e){var t=kN(e);return function(e){return eA(xB(e),xc(t(ey)))}},Ek=function(e){return function(t){return function(n){return function(){return eM(n).reduce(function(n,r,i){return n.then(function(o){return ks(o)?n:t(i+1,r)().then(function(t){if(ks(t))return t;if(kc(t)){var n=o.right;return n.push(t.right),kc(o)?kp(e.concat(o.left,t.left),n):kp(t.left,n)}return o.right.push(t.right),o})})},t(0,eE(n))().then(kO(eR)))}}}};let EE=Object.freeze(Object.defineProperty({__proto__:null,ApT:EO,Bifunctor:{URI:Ed,bimap:Ea,mapLeft:Eu},FromEither:Eg,FromIO:ES,FromTask:EI,FromThese:Eb,Functor:Eh,Pointed:{URI:Ed,of:k9},URI:Ed,bifunctorTaskThese:{URI:Ed,bimap:Ea,mapLeft:Eu},bimap:El,both:k4,flap:Em,fold:Er,foldW:Er,fromEither:xf,fromIO:Ee,fromIOEither:xo,fromIOK:Ew,fromOption:Ey,fromOptionK:Ev,fromPredicate:Ex,fromTask:k7,fromTaskK:E_,fromThese:xf,fromTheseK:EC,functorTaskThese:{URI:Ed,map:Eo},getApplicative:Ep,getApply:Ef,getChain:EA,getMonad:function(e){var t=Ep(xC,e),n=EA(e);return{URI:Ed,_E:void 0,map:Eo,ap:t.ap,of:k9,chain:n.chain,fromIO:Ee,fromTask:k7}},getSemigroup:function(e,t){return eD(xS)(km(e,t))},left:k3,leftIO:Et,leftTask:k8,map:Es,mapLeft:Ec,match:En,matchE:Er,matchEW:Er,matchW:En,of:k9,right:k9,rightIO:Ee,rightTask:k7,swap:Ei,taskThese:{URI:Ed,map:Eo,bimap:Ea,mapLeft:Eu},toTuple:function(e,t){return ET(function(){return e},function(){return t})},toTuple2:ET,traverseReadonlyArrayWithIndex:function(e){return function(t){var n=ER(e)(t);return function(e){return ek(e)?n(e):EO}}},traverseReadonlyArrayWithIndexSeq:function(e){return function(t){var n=Ek(e)(t);return function(e){return ek(e)?n(e):EO}}},traverseReadonlyNonEmptyArrayWithIndex:ER,traverseReadonlyNonEmptyArrayWithIndexSeq:Ek},Symbol.toStringTag,{value:"Module"}));var EM=function(e,t){return eg(e,Ej(t))},Ej=function(e){return function(t){return function(n){return e(t(n))}}},EF="Traced",EU={URI:EF,map:EM},EL=ez(EU);let EK=Object.freeze(Object.defineProperty({__proto__:null,Functor:EU,URI:EF,censor:function(e){return function(t){return function(n){return t(e(n))}}},flap:EL,getComonad:function(e){return{URI:EF,_E:void 0,map:EM,extend:function(t,n){return function(r){return n(function(n){return t(e.concat(r,n))})}},extract:function(t){return t(e.empty)}}},listen:function(e){return function(t){return[e(t),t]}},listens:function(e){return function(t){return function(n){return[t(n),e(n)]}}},map:Ej,traced:EU,tracks:function(e,t){return function(n){return n(t(n(e.empty)))}}},Symbol.toStringTag,{value:"Module"}));function EB(e,t){return function(n){var r=e.traverse(n),i=t.traverse(n);return function(e){return function(t){return r(t,function(t){return i(t,e)})}}}}function EP(e,t){return function(n){var r=e.sequence(n),i=t.sequence(n);return function(t){return r(e.map(t,i))}}}let EW=Object.freeze(Object.defineProperty({__proto__:null,getTraversableComposition:function(e,t){var n=eH(e,t).map,r=fs(e,t),i=EB(e,t),o=EP(e,t);return{map:n,reduce:r.reduce,foldMap:r.foldMap,reduceRight:r.reduceRight,traverse:function(e){var t=i(e);return function(e,n){return eg(e,t(n))}},sequence:function(e){var t=o(e);return function(e){return eg(e,t)}}}},sequence:EP,traverse:EB},Symbol.toStringTag,{value:"Module"})),ED=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));function EN(e,t){return void 0===t&&(t=[]),{value:e,forest:t}}var Eq=function(e,t){for(var n,r="",i=t.length,o=0;o<i;o++){n=t[o];var a=o===i-1;r+=e+(a?"└":"├")+"─ "+n.value+Eq(e+(i>1&&!a?"│ ":" "),n.forest)}return r};function EQ(e){return Eq(`
|
|
2
|
-
`,e)}function EV(e,t){var n=t(e);return{value:n[0],forest:Ez(n[1],t)}}function Ez(e,t){return e.map(function(e){return EV(e,t)})}function EY(e){var t=EH(e);return function(n,r){return e.chain(r(n),function(n){var i=n[0],o=n[1];return e.map(t(o,r),function(e){return{value:i,forest:e}})})}}function EH(e){var t=uV(e);return function(n,r){return eg(n,t(function(t){return EY(e)(t,r)}))}}var EG=function(e,t){return eg(e,E4(t))},EZ=function(e,t){return eg(e,E6(function(e){return eg(t,E4(e))}))},EJ=function(e,t){return eg(e,E6(t))},E$=function(e,t,n){return eg(e,E7(t,n))},EX=function(e){var t=E8(e);return function(e,n){return eg(e,t(n))}},E0=function(e,t,n){return eg(e,Me(t,n))},E1=function(e,t){return eg(e,E5(t))},E2=function(e){var t=Mn(e);return function(e,n){return eg(e,t(n))}},E6=function(e){return function(t){var n=e(t.value),r=n.value,i=n.forest;return{value:r,forest:(0,uJ().concat)(i,t.forest.map(E6(e)))}}},E5=function(e){return function(t){return{value:e(t),forest:t.forest.map(E5(e))}}},E3=E5(es),E9=E6(es),E4=function(e){return function(t){return{value:e(t.value),forest:t.forest.map(E4(e))}}},E7=function(e,t){return function(n){for(var r=t(e,n.value),i=n.forest.length,o=0;o<i;o++)r=eg(n.forest[o],E7(r,t));return r}},E8=function(e){return function(t){return E7(e.empty,function(n,r){return e.concat(n,t(r))})}},Me=function(e,t){return function(n){for(var r=e,i=n.forest.length,o=i-1;o>=0;o--)r=eg(n.forest[o],Me(r,t));return t(n.value,r)}},Mt=function(e){return e.value},Mn=function(e){var t=uV(e),n=function(r){return function(i){return e.ap(e.map(r(i.value),function(e){return function(t){return{value:e,forest:t}}}),eg(i.forest,t(n(r))))}};return n},Mr=function(e){return Mn(e)(es)},Mi=function(e){return EN(e)},Mo="Tree",Ma={URI:Mo,map:EG},Mu=ez(Ma),Ms={URI:Mo,map:EG,ap:EZ},Ml=eB(Ms),Mc=eP(Ms),Md={URI:Mo,map:EG,ap:EZ,chain:EJ},Mf=eX(Md),Mp=Mi(eF),MA=eY(Ma),Mh=e0(Md),Mm=eW(Ms),Mg=function(e){return function(t){return e(t.value)||t.forest.some(Mg(e))}};let My=Object.freeze(Object.defineProperty({__proto__:null,Applicative:{URI:Mo,map:EG,ap:EZ,of:Mi},Apply:Ms,Chain:Md,Comonad:{URI:Mo,map:EG,extend:E1,extract:Mt},Do:Mp,Foldable:{URI:Mo,reduce:E$,foldMap:EX,reduceRight:E0},Functor:Ma,Monad:{URI:Mo,map:EG,ap:EZ,of:Mi,chain:EJ},Pointed:{URI:Mo,of:Mi},Traversable:{URI:Mo,map:EG,reduce:E$,foldMap:EX,reduceRight:E0,traverse:E2,sequence:Mr},URI:Mo,ap:function(e){return function(t){return EZ(t,e)}},apFirst:Ml,apS:Mm,apSecond:Mc,bind:Mh,bindTo:MA,chain:E6,chainFirst:Mf,drawForest:EQ,drawTree:function(e){return e.value+EQ(e.forest)},duplicate:E3,elem:function(e){var t=function(n,r){return e.equals(n,r.value)||r.forest.some(function(e){return t(n,e)})};return t},exists:Mg,extend:E5,extract:Mt,flap:Mu,flatten:E9,fold:function(e){var t=function(n){return e(n.value,n.forest.map(t))};return t},foldMap:E8,getEq:function(e){var t,n=tt(function(n,r){return e.equals(n.value,r.value)&&t.equals(n.forest,r.forest)});return t=al(n),n},getShow:function(e){var t=function(n){return aq(n.forest)?"make(".concat(e.show(n.value),")"):"make(".concat(e.show(n.value),", [").concat(n.forest.map(t).join(", "),"])")};return{show:t}},make:EN,map:E4,of:Mi,reduce:E7,reduceRight:Me,sequence:Mr,traverse:Mn,tree:{URI:Mo,map:EG,of:Mi,ap:EZ,chain:EJ,reduce:E$,foldMap:EX,reduceRight:E0,traverse:E2,sequence:Mr,extract:Mt,extend:E1},unfoldForest:Ez,unfoldForestM:EH,unfoldTree:EV,unfoldTreeM:EY},Symbol.toStringTag,{value:"Module"}));function Mv(e){return{URI:MN,_E:void 0,map:MS,ap:function(t,n){return[_h(t)(_h(n)),e.concat(_m(t),_m(n))]}}}var Mx=function(e){return function(t){return[t,e.empty]}};function Mb(e){var t=Mv(e);return{URI:MN,_E:void 0,map:t.map,ap:t.ap,chain:function(t,n){var r=n(_h(t)),i=r[0],o=r[1];return[i,e.concat(_m(t),o)]}}}var MC=function(e,t){return eg(e,MF(t))},MS=function(e,t){return eg(e,MM(t))},Mw=function(e,t,n){return eg(e,ME(t,n))},MI=function(e,t){return eg(e,Mj(t))},M_=function(e,t){return eg(e,MU(t))},MT=function(e,t,n){return eg(e,MB(t,n))},MO=function(e){var t=MK();return function(e,n){return eg(e,t(n))}},MR=function(e,t,n){return eg(e,MP(t,n))};function Mk(e){var t=MW(e);return function(e,n){return eg(e,t(n))}}var ME=function(e,t){return function(n){return[t(_h(n)),e(_m(n))]}},MM=function(e){return function(t){return[e(_h(t)),_m(t)]}},Mj=function(e){return function(t){return[_h(t),e(_m(t))]}},MF=function(e){return function(t){return[_h(t),_m(e)]}},MU=function(e){return function(t){return[e(t),_m(t)]}},ML=MU(es),MK=_L,MB=_U,MP=_K,MW=function(e){return function(t){return function(n){return e.map(t(_h(n)),function(e){return[e,_m(n)]})}}},MD=function(e){return function(t){return e.map(_h(t),function(e){return[e,_m(t)]})}},MN="Tuple",Mq={URI:MN,map:MS},MQ=ez(Mq);let MV=Object.freeze(Object.defineProperty({__proto__:null,Bifunctor:{URI:MN,bimap:Mw,mapLeft:MI},Comonad:{URI:MN,map:MS,extend:M_,extract:_h},Foldable:{URI:MN,reduce:MT,foldMap:MO,reduceRight:MR},Functor:Mq,Semigroupoid:{URI:MN,compose:MC},Traversable:{URI:MN,map:MS,reduce:MT,foldMap:MO,reduceRight:MR,traverse:Mk,sequence:MD},URI:MN,bimap:ME,compose:MF,duplicate:ML,extend:MU,extract:_h,flap:MQ,foldMap:MK,fst:_h,getApplicative:function(e){var t=Mv(e);return{URI:MN,_E:void 0,map:t.map,ap:t.ap,of:Mx(e)}},getApply:Mv,getChain:Mb,getChainRec:function(e){var t=Mb(e);return{URI:MN,_E:void 0,map:t.map,ap:t.ap,chain:t.chain,chainRec:function(t,n){for(var r=n(t),i=e.empty,o=_h(r);"Left"===o._tag;)i=e.concat(i,_m(r)),o=_h(r=n(o.left));return[o.right,e.concat(i,_m(r))]}}},getMonad:function(e){var t=Mb(e);return{URI:MN,_E:void 0,map:t.map,ap:t.ap,chain:t.chain,of:Mx(e)}},map:MM,mapFst:MM,mapLeft:Mj,mapSnd:Mj,reduce:MB,reduceRight:MP,sequence:MD,snd:_m,swap:function(e){return[_m(e),_h(e)]},traverse:MW,tuple:{URI:MN,compose:MC,map:MS,bimap:Mw,mapLeft:MI,extract:_h,extend:M_,reduce:MT,foldMap:MO,reduceRight:MR,traverse:Mk,sequence:MD}},Symbol.toStringTag,{value:"Module"})),Mz=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),MY=Object.freeze(Object.defineProperty({__proto__:null,getValidationM:function(e,t){var n=eJ(t,cP(e));return{map:n.map,ap:n.ap,of:n.of,chain:function(e,n){return t.chain(e,function(e){return eI(e)?t.of(eT(e.left)):n(e.right)})},alt:function(n,r){return t.chain(n,function(n){return e_(n)?t.of(n):t.map(r(),function(t){return eI(t)?eT(e.concat(n.left,t.left)):t})})}}}},Symbol.toStringTag,{value:"Module"}));var MH=tj(void 0);let MG=Object.freeze(Object.defineProperty({__proto__:null,Monoid:{concat:MH.concat,empty:void 0},Semigroup:MH},Symbol.toStringTag,{value:"Module"}));var MZ=function(e,t){return eg(e,MJ(t))},MJ=function(e){return function(t){return function(){var n=t(),r=n[0],i=n[1];return[e(r),i]}}},M$="Writer",MX=function(e){return{URI:M$,_E:void 0,of:function(t){return function(){return[t,e.empty]}}}},M0=function(e){return{URI:M$,_E:void 0,map:MZ,ap:function(t,n){return function(){var r=t(),i=r[0],o=r[1],a=n(),u=a[0],s=a[1];return[i(u),e.concat(o,s)]}}}},M1=function(e){var t=M0(e),n=MX(e);return{URI:M$,_E:void 0,map:MZ,ap:t.ap,of:n.of}};function M2(e){return{URI:M$,_E:void 0,map:MZ,ap:M0(e).ap,chain:function(t,n){return function(){var r=t(),i=r[0],o=r[1],a=n(i)(),u=a[0],s=a[1];return[u,e.concat(o,s)]}}}}var M6={URI:M$,map:MZ},M5=ez(M6);let M3=W(Object.freeze(Object.defineProperty({__proto__:null,alt:et,alternative:en,applicative:e$,apply:eQ,array:sh,bifunctor:sm,boolean:sw,booleanAlgebra:s_,bounded:sT,boundedDistributiveLattice:sk,boundedJoinSemilattice:sE,boundedLattice:sM,boundedMeetSemilattice:sj,category:sF,chain:e1,chainRec:sL,choice:sP,comonad:sW,compactable:co,console:ca,const:cx,contravariant:cb,date:cC,distributiveLattice:sR,either:dM,eitherT:d1,endomorphism:d5,eq:tc,extend:d3,field:d4,filterable:fn,filterableWithIndex:fr,foldable:fl,foldableWithIndex:fp,fromEither:te,fromIO:fg,fromReader:pr,fromState:pP,fromTask:pq,fromThese:pV,function:ev,functor:eG,functorWithIndex:pY,group:pH,heytingAlgebra:pG,hkt:pZ,identity:Ab,invariant:AC,io:AJ,ioEither:h1,ioOption:gr,ioRef:go,joinSemilattice:ga,json:gu,lattice:gs,magma:tk,map:yE,meetSemilattice:yM,monad:yj,monadIO:yF,monadTask:yU,monadThrow:yL,monoid:yH,naturalTransformation:yG,nonEmptyArray:iI,number:iF,option:cn,optionT:ml,ord:tT,ordering:y1,pipeable:y2,pointed:y6,predicate:sH,profunctor:y5,random:y7,reader:f4,readerEither:v7,readerT:xi,readerTask:bK,readerTaskEither:wU,readonlyArray:aN,readonlyMap:g5,readonlyNonEmptyArray:ri,readonlyRecord:I2,readonlySet:_A,readonlyTuple:_q,record:Ts,refinement:Tl,ring:Td,semigroup:tV,semigroupoid:Tf,semiring:Tp,separated:iQ,set:TT,show:Tk,state:pM,stateReaderTaskEither:OJ,stateT:TP,store:O4,string:wW,strong:Re,struct:Rt,task:xH,taskEither:C3,taskOption:ku,taskThese:EE,these:kq,theseT:k5,traced:EK,traversable:EW,traversableWithIndex:ED,tree:My,tuple:MV,unfoldable:Mz,validationT:MY,void:MG,witherable:iH,writer:Object.freeze(Object.defineProperty({__proto__:null,Functor:M6,URI:M$,censor:function(e){return function(t){return function(){var n=t();return[n[0],e(n[1])]}}},evalWriter:function(e){return e()[0]},evaluate:function(e){return e()[0]},execWriter:function(e){return e()[1]},execute:function(e){return e()[1]},flap:M5,getApplicative:M1,getApply:M0,getChain:M2,getMonad:function(e){var t=M1(e),n=M2(e);return{URI:M$,_E:void 0,map:MZ,ap:t.ap,of:t.of,chain:n.chain}},getPointed:MX,listen:function(e){return function(){var t=e(),n=t[0],r=t[1];return[[n,r],r]}},listens:function(e){return function(t){return function(){var n=t(),r=n[0],i=n[1];return[[r,e(i)],i]}}},map:MJ,pass:function(e){return function(){var t=e(),n=t[0];return[n[0],(0,n[1])(t[1])]}},tell:function(e){return function(){return[void 0,e]}},writer:M6},Symbol.toStringTag,{value:"Module"})),writerT:Object.freeze(Object.defineProperty({__proto__:null,getWriterM:function(e){var t=function(t,n){return function(){return e.map(t(),function(e){var t=e[0],r=e[1];return[n(t),r]})}};return{map:t,evalWriter:function(t){return e.map(t(),function(e){return e[0]})},execWriter:function(t){return e.map(t(),function(e){return e[0],e[1]})},tell:function(t){return function(){return e.of([void 0,t])}},listen:function(t){return function(){return e.map(t(),function(e){var t=e[0],n=e[1];return[[t,n],n]})}},pass:function(t){return function(){return e.map(t(),function(e){var t=e[0];return[t[0],(0,t[1])(e[1])]})}},listens:function(t,n){return function(){return e.map(t(),function(e){var t=e[0],r=e[1];return[[t,n(r)],r]})}},censor:function(t,n){return function(){return e.map(t(),function(e){return[e[0],n(e[1])]})}},getMonad:function(n){return{_E:void 0,map:t,of:function(t){return function(){return e.of([t,n.empty])}},ap:function(t,r){return function(){return e.chain(t(),function(t){var i=t[0],o=t[1];return e.map(r(),function(e){var t=e[0],r=e[1];return[i(t),n.concat(o,r)]})})}},chain:function(t,r){return function(){return e.chain(t(),function(t){var i=t[0],o=t[1];return e.map(r(i)(),function(e){var t=e[0],r=e[1];return[t,n.concat(o,r)]})})}}}}}}},Symbol.toStringTag,{value:"Module"})),zero:iZ},Symbol.toStringTag,{value:"Module"})));var M9={},M4={},M7={},M8={};!function(e){function t(e){return e}function n(e){return function(){return e}}function r(e,t,n,r,i,o,a,u,s){switch(arguments.length){case 1:return e;case 2:return function(){return t(e.apply(this,arguments))};case 3:return function(){return n(t(e.apply(this,arguments)))};case 4:return function(){return r(n(t(e.apply(this,arguments))))};case 5:return function(){return i(r(n(t(e.apply(this,arguments)))))};case 6:return function(){return o(i(r(n(t(e.apply(this,arguments))))))};case 7:return function(){return a(o(i(r(n(t(e.apply(this,arguments)))))))};case 8:return function(){return u(a(o(i(r(n(t(e.apply(this,arguments))))))))};case 9:return function(){return s(u(a(o(i(r(n(t(e.apply(this,arguments)))))))))}}}function i(e){throw Error("Called `absurd` function which should be uncallable")}Object.defineProperty(e,"__esModule",{value:!0}),e.getEndomorphismMonoid=e.not=e.SK=e.hole=e.pipe=e.untupled=e.tupled=e.absurd=e.decrement=e.increment=e.tuple=e.flow=e.flip=e.constVoid=e.constUndefined=e.constNull=e.constFalse=e.constTrue=e.constant=e.unsafeCoerce=e.identity=e.apply=e.getRing=e.getSemiring=e.getMonoid=e.getSemigroup=e.getBooleanAlgebra=void 0,e.getBooleanAlgebra=function(e){return function(){return{meet:function(t,n){return function(r){return e.meet(t(r),n(r))}},join:function(t,n){return function(r){return e.join(t(r),n(r))}},zero:function(){return e.zero},one:function(){return e.one},implies:function(t,n){return function(r){return e.implies(t(r),n(r))}},not:function(t){return function(n){return e.not(t(n))}}}}},e.getSemigroup=function(e){return function(){return{concat:function(t,n){return function(r){return e.concat(t(r),n(r))}}}}},e.getMonoid=function(t){var n=(0,e.getSemigroup)(t);return function(){return{concat:n().concat,empty:function(){return t.empty}}}},e.getSemiring=function(e){return{add:function(t,n){return function(r){return e.add(t(r),n(r))}},zero:function(){return e.zero},mul:function(t,n){return function(r){return e.mul(t(r),n(r))}},one:function(){return e.one}}},e.getRing=function(t){var n=(0,e.getSemiring)(t);return{add:n.add,mul:n.mul,one:n.one,zero:n.zero,sub:function(e,n){return function(r){return t.sub(e(r),n(r))}}}},e.apply=function(e){return function(t){return t(e)}},e.identity=t,e.unsafeCoerce=t,e.constant=n,e.constTrue=n(!0),e.constFalse=n(!1),e.constNull=n(null),e.constUndefined=n(void 0),e.constVoid=e.constUndefined,e.flip=function(e){return function(t,n){return e(n,t)}},e.flow=r,e.tuple=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e},e.increment=function(e){return e+1},e.decrement=function(e){return e-1},e.absurd=i,e.tupled=function(e){return function(t){return e.apply(void 0,t)}},e.untupled=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return e(t)}},e.pipe=function(e,t,n,r,i,o,a,u,s){switch(arguments.length){case 1:return e;case 2:return t(e);case 3:return n(t(e));case 4:return r(n(t(e)));case 5:return i(r(n(t(e))));case 6:return o(i(r(n(t(e)))));case 7:return a(o(i(r(n(t(e))))));case 8:return u(a(o(i(r(n(t(e)))))));case 9:return s(u(a(o(i(r(n(t(e))))))));default:for(var l=arguments[0],c=1;c<arguments.length;c++)l=arguments[c](l);return l}},e.hole=i,e.SK=function(e,t){return t},e.not=function(e){return function(t){return!e(t)}},e.getEndomorphismMonoid=function(){return{concat:function(e,t){return r(e,t)},empty:t}}}(M8);var je={},jt=P&&P.__spreadArray||function(e,t,n){if(n||2==arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))};Object.defineProperty(je,"__esModule",{value:!0}),je.fromReadonlyNonEmptyArray=je.has=je.emptyRecord=je.emptyReadonlyArray=je.tail=je.head=je.isNonEmpty=je.singleton=je.right=je.left=je.isRight=je.isLeft=je.some=je.none=je.isSome=je.isNone=void 0,je.isNone=function(e){return"None"===e._tag},je.isSome=function(e){return"Some"===e._tag},je.none={_tag:"None"},je.some=function(e){return{_tag:"Some",value:e}},je.isLeft=function(e){return"Left"===e._tag},je.isRight=function(e){return"Right"===e._tag},je.left=function(e){return{_tag:"Left",left:e}},je.right=function(e){return{_tag:"Right",right:e}},je.singleton=function(e){return[e]},je.isNonEmpty=function(e){return e.length>0},je.head=function(e){return e[0]},je.tail=function(e){return e.slice(1)},je.emptyReadonlyArray=[],je.emptyRecord={},je.has=Object.prototype.hasOwnProperty,je.fromReadonlyNonEmptyArray=function(e){return jt([e[0]],e.slice(1),!0)};var jn=P&&P.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),jr=P&&P.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),ji=P&&P.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&jn(t,e,n);return jr(t,e),t};Object.defineProperty(M7,"__esModule",{value:!0}),M7.sequenceS=M7.sequenceT=M7.getApplySemigroup=M7.apS=M7.apSecond=M7.apFirst=M7.ap=void 0;var jo=ji(je);function ja(e,t,n){return function(r){for(var i=Array(n.length+1),o=0;o<n.length;o++)i[o]=n[o];return i[n.length]=r,0===t?e.apply(null,i):ja(e,t-1,i)}}M7.ap=function(e,t){return function(n){return function(r){return e.ap(e.map(r,function(e){return function(n){return t.ap(e,n)}}),n)}}},M7.apFirst=function(e){return function(t){return function(n){return e.ap(e.map(n,function(e){return function(){return e}}),t)}}},M7.apSecond=function(e){return function(t){return function(n){return e.ap(e.map(n,function(){return function(e){return e}}),t)}}},M7.apS=function(e){return function(t,n){return function(r){return e.ap(e.map(r,function(e){return function(n){var r;return Object.assign({},e,((r={})[t]=n,r))}}),n)}}},M7.getApplySemigroup=function(e){return function(t){return{concat:function(n,r){return e.ap(e.map(n,function(e){return function(n){return t.concat(e,n)}}),r)}}}};var ju={1:function(e){return[e]},2:function(e){return function(t){return[e,t]}},3:function(e){return function(t){return function(n){return[e,t,n]}}},4:function(e){return function(t){return function(n){return function(r){return[e,t,n,r]}}}},5:function(e){return function(t){return function(n){return function(r){return function(i){return[e,t,n,r,i]}}}}}};M7.sequenceT=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];for(var r=t.length,i=(jo.has.call(ju,r)||(ju[r]=ja(M8.tuple,r-1,[])),ju[r]),o=e.map(t[0],i),a=1;a<r;a++)o=e.ap(o,t[a]);return o}},M7.sequenceS=function(e){return function(t){for(var n=Object.keys(t),r=n.length,i=function(e){var t=e.length;switch(t){case 1:return function(t){var n;return(n={})[e[0]]=t,n};case 2:return function(t){return function(n){var r;return(r={})[e[0]]=t,r[e[1]]=n,r}};case 3:return function(t){return function(n){return function(r){var i;return(i={})[e[0]]=t,i[e[1]]=n,i[e[2]]=r,i}}};case 4:return function(t){return function(n){return function(r){return function(i){var o;return(o={})[e[0]]=t,o[e[1]]=n,o[e[2]]=r,o[e[3]]=i,o}}}};case 5:return function(t){return function(n){return function(r){return function(i){return function(o){var a;return(a={})[e[0]]=t,a[e[1]]=n,a[e[2]]=r,a[e[3]]=i,a[e[4]]=o,a}}}}};default:return ja(function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];for(var i={},o=0;o<t;o++)i[e[o]]=n[o];return i},t-1,[])}}(n),o=e.map(t[n[0]],i),a=1;a<r;a++)o=e.ap(o,t[n[a]]);return o}};var js={};function jl(e,t){return function(n){return function(r){return e.map(r,function(e){return t.map(e,n)})}}}Object.defineProperty(js,"__esModule",{value:!0}),js.getFunctorComposition=js.bindTo=js.flap=js.map=void 0,js.map=jl,js.flap=function(e){return function(t){return function(n){return e.map(n,function(e){return e(t)})}}},js.bindTo=function(e){return function(t){return function(n){return e.map(n,function(e){var n;return(n={})[t]=e,n})}}},js.getFunctorComposition=function(e,t){var n=jl(e,t);return{map:function(e,t){return(0,M8.pipe)(e,n(t))}}},Object.defineProperty(M4,"__esModule",{value:!0}),M4.getApplicativeComposition=M4.getApplicativeMonoid=void 0,M4.getApplicativeMonoid=function(e){var t=(0,M7.getApplySemigroup)(e);return function(n){return{concat:t(n).concat,empty:e.of(n.empty)}}},M4.getApplicativeComposition=function(e,t){var n=(0,js.getFunctorComposition)(e,t).map,r=(0,M7.ap)(e,t);return{map:n,of:function(n){return e.of(t.of(n))},ap:function(e,t){return(0,M8.pipe)(e,r(t))}}};var jc={};Object.defineProperty(jc,"__esModule",{value:!0}),jc.bind=jc.chainFirst=void 0,jc.chainFirst=function(e){return function(t){return function(n){return e.chain(n,function(n){return e.map(t(n),function(){return n})})}}},jc.bind=function(e){return function(t,n){return function(r){return e.chain(r,function(r){return e.map(n(r),function(e){var n;return Object.assign({},r,((n={})[t]=e,n))})})}}};var jd={};Object.defineProperty(jd,"__esModule",{value:!0}),jd.tailRec=void 0,jd.tailRec=function(e,t){for(var n=t(e);"Left"===n._tag;)n=t(n.left);return n.right};var jf={},jp=P&&P.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),jA=P&&P.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),jh=P&&P.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&jp(t,e,n);return jA(t,e),t};Object.defineProperty(jf,"__esModule",{value:!0}),jf.filterOrElse=jf.chainFirstEitherK=jf.chainEitherK=jf.fromEitherK=jf.chainOptionK=jf.fromOptionK=jf.fromPredicate=jf.fromOption=void 0;var jm=jh(je);function jg(e){return function(t){return function(n){return e.fromEither(jm.isNone(n)?jm.left(t()):jm.right(n.value))}}}function jy(e){var t=jg(e);return function(e){var n=t(e);return function(e){return(0,M8.flow)(e,n)}}}function jv(e){return function(t){return(0,M8.flow)(t,e.fromEither)}}jf.fromOption=jg,jf.fromPredicate=function(e){return function(t,n){return function(r){return e.fromEither(t(r)?jm.right(r):jm.left(n(r)))}}},jf.fromOptionK=jy,jf.chainOptionK=function(e,t){var n=jy(e);return function(e){var r=n(e);return function(e){return function(n){return t.chain(n,r(e))}}}},jf.fromEitherK=jv,jf.chainEitherK=function(e,t){var n=jv(e);return function(e){return function(r){return t.chain(r,n(e))}}},jf.chainFirstEitherK=function(e,t){return(0,M8.flow)(jv(e),(0,jc.chainFirst)(t))},jf.filterOrElse=function(e,t){return function(n,r){return function(i){return t.chain(i,function(t){return e.fromEither(n(t)?jm.right(t):jm.left(r(t)))})}}};var jx={};Object.defineProperty(jx,"__esModule",{value:!0}),jx.right=jx.left=jx.flap=jx.Functor=jx.Bifunctor=jx.URI=jx.bimap=jx.mapLeft=jx.map=jx.separated=void 0,jx.separated=function(e,t){return{left:e,right:t}},jx.map=function(e){return function(t){return(0,jx.separated)((0,jx.left)(t),e((0,jx.right)(t)))}},jx.mapLeft=function(e){return function(t){return(0,jx.separated)(e((0,jx.left)(t)),(0,jx.right)(t))}},jx.bimap=function(e,t){return function(n){return(0,jx.separated)(e((0,jx.left)(n)),t((0,jx.right)(n)))}},jx.URI="Separated",jx.Bifunctor={URI:jx.URI,mapLeft:function(e,t){return(0,M8.pipe)(e,(0,jx.mapLeft)(t))},bimap:function(e,t,n){return(0,M8.pipe)(e,(0,jx.bimap)(t,n))}},jx.Functor={URI:jx.URI,map:function(e,t){return(0,M8.pipe)(e,(0,jx.map)(t))}},jx.flap=(0,js.flap)(jx.Functor),jx.left=function(e){return e.left},jx.right=function(e){return e.right};var jb={},jC=P&&P.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),jS=P&&P.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),jw=P&&P.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&jC(t,e,n);return jS(t,e),t};Object.defineProperty(jb,"__esModule",{value:!0}),jb.filterE=jb.witherDefault=jb.wiltDefault=void 0;var jI=jw(je);jb.wiltDefault=function(e,t){return function(n){var r=e.traverse(n);return function(e,i){return n.map(r(e,i),t.separate)}}},jb.witherDefault=function(e,t){return function(n){var r=e.traverse(n);return function(e,i){return n.map(r(e,i),t.compact)}}},jb.filterE=function(e){return function(t){var n=e.wither(t);return function(e){return function(r){return n(r,function(n){return t.map(e(n),function(e){return e?jI.some(n):jI.none})})}}}},Bt=P&&P.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),Bn=P&&P.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Br=P&&P.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&Bt(t,e,n);return Bn(t,e),t},Object.defineProperty(M9,"__esModule",{value:!0}),M9.fold=M9.match=M9.foldW=M9.matchW=M9.isRight=M9.isLeft=M9.fromOption=M9.fromPredicate=M9.FromEither=M9.MonadThrow=M9.throwError=M9.ChainRec=M9.Extend=M9.extend=M9.Alt=M9.alt=M9.altW=M9.Bifunctor=M9.mapLeft=M9.bimap=M9.Traversable=M9.sequence=M9.traverse=M9.Foldable=M9.reduceRight=M9.foldMap=M9.reduce=M9.Monad=M9.Chain=M9.chain=M9.chainW=M9.Applicative=M9.Apply=M9.ap=M9.apW=M9.Pointed=M9.of=M9.Functor=M9.map=M9.getAltValidation=M9.getApplicativeValidation=M9.getWitherable=M9.getFilterable=M9.getCompactable=M9.getSemigroup=M9.getEq=M9.getShow=M9.URI=M9.right=M9.left=void 0,M9.getValidation=M9.getValidationMonoid=M9.getValidationSemigroup=M9.getApplyMonoid=M9.getApplySemigroup=M9.either=M9.stringifyJSON=M9.parseJSON=M9.sequenceArray=M9.traverseArray=M9.traverseArrayWithIndex=M9.traverseReadonlyArrayWithIndex=M9.traverseReadonlyNonEmptyArrayWithIndex=M9.ApT=M9.apSW=M9.apS=M9.bindW=M9.bind=M9.bindTo=M9.Do=M9.exists=M9.elem=M9.toError=M9.toUnion=M9.chainNullableK=M9.fromNullableK=M9.tryCatchK=M9.tryCatch=M9.fromNullable=M9.orElse=M9.orElseW=M9.swap=M9.filterOrElseW=M9.filterOrElse=M9.chainOptionK=M9.fromOptionK=M9.duplicate=M9.flatten=M9.flattenW=M9.chainFirstW=M9.chainFirst=M9.apSecondW=M9.apSecond=M9.apFirstW=M9.apFirst=M9.flap=M9.getOrElse=M9.getOrElseW=void 0,Bi=Br(je),M9.left=Bi.left,M9.right=Bi.right,Bo=function(e,t){return(0,M8.pipe)(e,(0,M9.map)(t))},Ba=function(e,t){return(0,M8.pipe)(e,(0,M9.ap)(t))},Bu=function(e,t){return(0,M8.pipe)(e,(0,M9.chain)(t))},Bs=function(e,t,n){return(0,M8.pipe)(e,(0,M9.reduce)(t,n))},Bl=function(e){return function(t,n){var r=(0,M9.foldMap)(e);return(0,M8.pipe)(t,r(n))}},Bc=function(e,t,n){return(0,M8.pipe)(e,(0,M9.reduceRight)(t,n))},Bd=function(e){var t=(0,M9.traverse)(e);return function(e,n){return(0,M8.pipe)(e,t(n))}},Bf=function(e,t,n){return(0,M8.pipe)(e,(0,M9.bimap)(t,n))},Bp=function(e,t){return(0,M8.pipe)(e,(0,M9.mapLeft)(t))},BA=function(e,t){return(0,M8.pipe)(e,(0,M9.alt)(t))},Bh=function(e,t){return(0,M8.pipe)(e,(0,M9.extend)(t))},Bm=function(e,t){return(0,jd.tailRec)(t(e),function(e){return(0,M9.isLeft)(e)?(0,M9.right)((0,M9.left)(e.left)):(0,M9.isLeft)(e.right)?(0,M9.left)(t(e.right.left)):(0,M9.right)((0,M9.right)(e.right.right))})},M9.URI="Either",M9.getShow=function(e,t){return{show:function(n){return(0,M9.isLeft)(n)?"left(".concat(e.show(n.left),")"):"right(".concat(t.show(n.right),")")}}},M9.getEq=function(e,t){return{equals:function(n,r){return n===r||((0,M9.isLeft)(n)?(0,M9.isLeft)(r)&&e.equals(n.left,r.left):(0,M9.isRight)(r)&&t.equals(n.right,r.right))}}},M9.getSemigroup=function(e){return{concat:function(t,n){return(0,M9.isLeft)(n)?t:(0,M9.isLeft)(t)?n:(0,M9.right)(e.concat(t.right,n.right))}}},M9.getCompactable=function(e){var t=(0,M9.left)(e.empty);return{URI:M9.URI,_E:void 0,compact:function(e){return(0,M9.isLeft)(e)?e:"None"===e.right._tag?t:(0,M9.right)(e.right.value)},separate:function(e){return(0,M9.isLeft)(e)?(0,jx.separated)(e,e):(0,M9.isLeft)(e.right)?(0,jx.separated)((0,M9.right)(e.right.left),t):(0,jx.separated)(t,(0,M9.right)(e.right.right))}}},M9.getFilterable=function(e){var t=(0,M9.left)(e.empty),n=(0,M9.getCompactable)(e),r=n.compact,i=n.separate;return{URI:M9.URI,_E:void 0,map:Bo,compact:r,separate:i,filter:function(e,n){return(0,M9.isLeft)(e)||n(e.right)?e:t},filterMap:function(e,n){if((0,M9.isLeft)(e))return e;var r=n(e.right);return"None"===r._tag?t:(0,M9.right)(r.value)},partition:function(e,n){return(0,M9.isLeft)(e)?(0,jx.separated)(e,e):n(e.right)?(0,jx.separated)(t,(0,M9.right)(e.right)):(0,jx.separated)((0,M9.right)(e.right),t)},partitionMap:function(e,n){if((0,M9.isLeft)(e))return(0,jx.separated)(e,e);var r=n(e.right);return(0,M9.isLeft)(r)?(0,jx.separated)((0,M9.right)(r.left),t):(0,jx.separated)(t,(0,M9.right)(r.right))}}},M9.getWitherable=function(e){var t=(0,M9.getFilterable)(e),n=(0,M9.getCompactable)(e);return{URI:M9.URI,_E:void 0,map:Bo,compact:t.compact,separate:t.separate,filter:t.filter,filterMap:t.filterMap,partition:t.partition,partitionMap:t.partitionMap,traverse:Bd,sequence:M9.sequence,reduce:Bs,foldMap:Bl,reduceRight:Bc,wither:(0,jb.witherDefault)(M9.Traversable,n),wilt:(0,jb.wiltDefault)(M9.Traversable,n)}},M9.getApplicativeValidation=function(e){return{URI:M9.URI,_E:void 0,map:Bo,ap:function(t,n){return(0,M9.isLeft)(t)?(0,M9.isLeft)(n)?(0,M9.left)(e.concat(t.left,n.left)):t:(0,M9.isLeft)(n)?n:(0,M9.right)(t.right(n.right))},of:M9.of}},M9.getAltValidation=function(e){return{URI:M9.URI,_E:void 0,map:Bo,alt:function(t,n){if((0,M9.isRight)(t))return t;var r=n();return(0,M9.isLeft)(r)?(0,M9.left)(e.concat(t.left,r.left)):r}}},M9.map=function(e){return function(t){return(0,M9.isLeft)(t)?t:(0,M9.right)(e(t.right))}},M9.Functor={URI:M9.URI,map:Bo},M9.of=M9.right,M9.Pointed={URI:M9.URI,of:M9.of},M9.apW=function(e){return function(t){return(0,M9.isLeft)(t)?t:(0,M9.isLeft)(e)?e:(0,M9.right)(t.right(e.right))}},M9.ap=M9.apW,M9.Apply={URI:M9.URI,map:Bo,ap:Ba},M9.Applicative={URI:M9.URI,map:Bo,ap:Ba,of:M9.of},M9.chainW=function(e){return function(t){return(0,M9.isLeft)(t)?t:e(t.right)}},M9.chain=M9.chainW,M9.Chain={URI:M9.URI,map:Bo,ap:Ba,chain:Bu},M9.Monad={URI:M9.URI,map:Bo,ap:Ba,of:M9.of,chain:Bu},M9.reduce=function(e,t){return function(n){return(0,M9.isLeft)(n)?e:t(e,n.right)}},M9.foldMap=function(e){return function(t){return function(n){return(0,M9.isLeft)(n)?e.empty:t(n.right)}}},M9.reduceRight=function(e,t){return function(n){return(0,M9.isLeft)(n)?e:t(n.right,e)}},M9.Foldable={URI:M9.URI,reduce:Bs,foldMap:Bl,reduceRight:Bc},M9.traverse=function(e){return function(t){return function(n){return(0,M9.isLeft)(n)?e.of((0,M9.left)(n.left)):e.map(t(n.right),M9.right)}}},M9.sequence=function(e){return function(t){return(0,M9.isLeft)(t)?e.of((0,M9.left)(t.left)):e.map(t.right,M9.right)}},M9.Traversable={URI:M9.URI,map:Bo,reduce:Bs,foldMap:Bl,reduceRight:Bc,traverse:Bd,sequence:M9.sequence},M9.bimap=function(e,t){return function(n){return(0,M9.isLeft)(n)?(0,M9.left)(e(n.left)):(0,M9.right)(t(n.right))}},M9.mapLeft=function(e){return function(t){return(0,M9.isLeft)(t)?(0,M9.left)(e(t.left)):t}},M9.Bifunctor={URI:M9.URI,bimap:Bf,mapLeft:Bp},M9.altW=function(e){return function(t){return(0,M9.isLeft)(t)?e():t}},M9.alt=M9.altW,M9.Alt={URI:M9.URI,map:Bo,alt:BA},M9.extend=function(e){return function(t){return(0,M9.isLeft)(t)?t:(0,M9.right)(e(t))}},M9.Extend={URI:M9.URI,map:Bo,extend:Bh},M9.ChainRec={URI:M9.URI,map:Bo,ap:Ba,chain:Bu,chainRec:Bm},M9.throwError=M9.left,M9.MonadThrow={URI:M9.URI,map:Bo,ap:Ba,of:M9.of,chain:Bu,throwError:M9.throwError},M9.FromEither={URI:M9.URI,fromEither:M8.identity},M9.fromPredicate=(0,jf.fromPredicate)(M9.FromEither),M9.fromOption=(0,jf.fromOption)(M9.FromEither),M9.isLeft=Bi.isLeft,M9.isRight=Bi.isRight,M9.matchW=function(e,t){return function(n){return(0,M9.isLeft)(n)?e(n.left):t(n.right)}},M9.foldW=M9.matchW,M9.match=M9.matchW,M9.fold=M9.match,M9.getOrElseW=function(e){return function(t){return(0,M9.isLeft)(t)?e(t.left):t.right}},M9.getOrElse=M9.getOrElseW,M9.flap=(0,js.flap)(M9.Functor),M9.apFirst=(0,M7.apFirst)(M9.Apply),M9.apFirstW=M9.apFirst,M9.apSecond=(0,M7.apSecond)(M9.Apply),M9.apSecondW=M9.apSecond,M9.chainFirst=(0,jc.chainFirst)(M9.Chain),M9.chainFirstW=M9.chainFirst,M9.flattenW=(0,M9.chainW)(M8.identity),M9.flatten=M9.flattenW,M9.duplicate=(0,M9.extend)(M8.identity),M9.fromOptionK=(0,jf.fromOptionK)(M9.FromEither),M9.chainOptionK=(0,jf.chainOptionK)(M9.FromEither,M9.Chain),M9.filterOrElse=(0,jf.filterOrElse)(M9.FromEither,M9.Chain),M9.filterOrElseW=M9.filterOrElse,M9.swap=function(e){return(0,M9.isLeft)(e)?(0,M9.right)(e.left):(0,M9.left)(e.right)},M9.orElseW=function(e){return function(t){return(0,M9.isLeft)(t)?e(t.left):t}},M9.orElse=M9.orElseW,M9.fromNullable=function(e){return function(t){return null==t?(0,M9.left)(e):(0,M9.right)(t)}},M9.tryCatch=function(e,t){try{return(0,M9.right)(e())}catch(e){return(0,M9.left)(t(e))}},M9.tryCatchK=function(e,t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return(0,M9.tryCatch)(function(){return e.apply(void 0,n)},t)}},M9.fromNullableK=function(e){var t=(0,M9.fromNullable)(e);return function(e){return(0,M8.flow)(e,t)}},M9.chainNullableK=function(e){var t=(0,M9.fromNullableK)(e);return function(e){return(0,M9.chain)(t(e))}},M9.toUnion=(0,M9.foldW)(M8.identity,M8.identity),M9.toError=function(e){return e instanceof Error?e:Error(String(e))},M9.elem=function e(t){return function(n,r){if(void 0===r){var i=e(t);return function(e){return i(n,e)}}return!(0,M9.isLeft)(r)&&t.equals(n,r.right)}},M9.exists=function(e){return function(t){return!(0,M9.isLeft)(t)&&e(t.right)}},M9.Do=(0,M9.of)(Bi.emptyRecord),M9.bindTo=(0,js.bindTo)(M9.Functor),M9.bind=(0,jc.bind)(M9.Chain),M9.bindW=M9.bind,M9.apS=(0,M7.apS)(M9.Apply),M9.apSW=M9.apS,M9.ApT=(0,M9.of)(Bi.emptyReadonlyArray),M9.traverseReadonlyNonEmptyArrayWithIndex=function(e){return function(t){var n=e(0,Bi.head(t));if((0,M9.isLeft)(n))return n;for(var r=[n.right],i=1;i<t.length;i++){var o=e(i,t[i]);if((0,M9.isLeft)(o))return o;r.push(o.right)}return(0,M9.right)(r)}},M9.traverseReadonlyArrayWithIndex=function(e){var t=(0,M9.traverseReadonlyNonEmptyArrayWithIndex)(e);return function(e){return Bi.isNonEmpty(e)?t(e):M9.ApT}},M9.traverseArrayWithIndex=M9.traverseReadonlyArrayWithIndex,M9.traverseArray=function(e){return(0,M9.traverseReadonlyArrayWithIndex)(function(t,n){return e(n)})},M9.sequenceArray=(0,M9.traverseArray)(M8.identity),M9.parseJSON=function(e,t){return(0,M9.tryCatch)(function(){return JSON.parse(e)},t)},M9.stringifyJSON=function(e,t){return(0,M9.tryCatch)(function(){var t=JSON.stringify(e);if("string"!=typeof t)throw Error("Converting unsupported structure to JSON");return t},t)},M9.either={URI:M9.URI,map:Bo,of:M9.of,ap:Ba,chain:Bu,reduce:Bs,foldMap:Bl,reduceRight:Bc,traverse:Bd,sequence:M9.sequence,bimap:Bf,mapLeft:Bp,alt:BA,extend:Bh,chainRec:Bm,throwError:M9.throwError},M9.getApplySemigroup=(0,M7.getApplySemigroup)(M9.Apply),M9.getApplyMonoid=(0,M4.getApplicativeMonoid)(M9.Applicative),M9.getValidationSemigroup=function(e,t){return(0,M7.getApplySemigroup)((0,M9.getApplicativeValidation)(e))(t)},M9.getValidationMonoid=function(e,t){return(0,M4.getApplicativeMonoid)((0,M9.getApplicativeValidation)(e))(t)},M9.getValidation=function(e){var t=(0,M9.getApplicativeValidation)(e).ap,n=(0,M9.getAltValidation)(e).alt;return{URI:M9.URI,_E:void 0,map:Bo,of:M9.of,chain:Bu,bimap:Bf,mapLeft:Bp,reduce:Bs,foldMap:Bl,reduceRight:Bc,extend:Bh,traverse:Bd,sequence:M9.sequence,chainRec:Bm,throwError:M9.throwError,ap:t,alt:n}};var j_=(Bg=function(e,t){return(Bg=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}Bg(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),jT=function(){return(jT=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)},jO=function(e,t,n){if(n||2==arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))},jR=function(e,t,n){return eT([{value:e,context:t,message:n}])},jk=function(){function e(e,t,n,r){this.name=e,this.is=t,this.validate=n,this.encode=r,this.decode=this.decode.bind(this)}return e.prototype.pipe=function(t,n){var r=this;return void 0===n&&(n="pipe(".concat(this.name,", ").concat(t.name,")")),new e(n,t.is,function(e,n){var i=r.validate(e,n);return dt(i)?i:t.validate(i.right,n)},this.encode===jE&&t.encode===jE?jE:function(e){return r.encode(t.encode(e))})},e.prototype.asDecoder=function(){return this},e.prototype.asEncoder=function(){return this},e.prototype.decode=function(e){return this.validate(e,[{key:"",type:this,actual:e}])},e}(),jE=function(e){return e};function jM(e){return e.displayName||e.name||"<function".concat(e.length,">")}function jj(e,t,n,r){for(var i=e.length,o=Array(i+1),a=0;a<i;a++)o[a]=e[a];return o[i]={key:t,type:n,actual:r},o}function jF(e,t){for(var n=t.length,r=0;r<n;r++)e.push(t[r])}var jU=Object.prototype.hasOwnProperty;function jL(e){return Object.keys(e).map(function(t){return"".concat(t,": ").concat(e[t].name)}).join(", ")}function jK(e){for(var t=0;t<e.length;t++)if(e[t].encode!==jE)return!1;return!0}function jB(e){return"{ ".concat(jL(e)," }")}function jP(e){return"Partial<".concat(e,">")}function jW(e){var t;if(jY(e)){var n=e.value;if(j7.is(n))return(t={})[n]=null,t}else{if("KeyofType"===e._tag)return e.keys;if(jG(e)){var r=e.types.map(function(e){return jW(e)});return r.some(j2.is)?void 0:Object.assign.apply(Object,jO([{}],r,!1))}}}function jD(e){return"("+e.map(function(e){return e.name}).join(" | ")+")"}function jN(e,t){for(var n=!0,r=!0,i=!Fs.is(e),o=0;o<t.length;o++){var a=t[o];a!==e&&(n=!1),Fs.is(a)&&(r=!1)}if(n)return e;if(r)return t[t.length-1];for(var u={},s=0;s<t.length;s++){var a=t[s];for(var l in a)(!jU.call(u,l)||i||a[l]!==e[l])&&(u[l]=a[l])}return u}function jq(e,t){for(var n=Object.getOwnPropertyNames(e),r=!1,i={},o=0;o<n.length;o++){var a=n[o];jU.call(t,a)?i[a]=e[a]:r=!0}return r?i:e}var jQ={};function jV(e,t){for(var n=[],r=0;r<e.length;r++){var i=e[r];-1!==t.indexOf(i)&&n.push(i)}return n}function jz(e){return"AnyType"===e._tag}function jY(e){return"LiteralType"===e._tag}function jH(e){return"InterfaceType"===e._tag}function jG(e){return"UnionType"===e._tag}var jZ=[];function jJ(e){if(-1!==jZ.indexOf(e))return jQ;if(jH(e)||"StrictType"===e._tag){var t=jQ;for(var n in e.props){var r=e.props[n];jY(r)&&(t===jQ&&(t={}),t[n]=[r.value])}return t}if("ExactType"===e._tag||"RefinementType"===e._tag)return jJ(e.type);if("IntersectionType"===e._tag)return e.types.reduce(function(e,t){return function(e,t){if(e===jQ)return t;if(t===jQ)return e;var n=Object.assign({},e);for(var r in t)if(jU.call(e,r)){var i=jV(e[r],t[r]);if(i.length>0)n[r]=i;else{n=jQ;break}}else n[r]=t[r];return n}(e,jJ(t))},jQ);if(jG(e))return e.types.slice(1).reduce(function(e,t){return function(e,t){if(e===jQ||t===jQ)return jQ;var n=jQ;for(var r in e)jU.call(t,r)&&0===jV(e[r],t[r]).length&&(n===jQ&&(n={}),n[r]=e[r].concat(t[r]));return n}(e,jJ(t))},jJ(e.types[0]));if("RecursiveType"===e._tag){jZ.push(e);var i=jJ(e.type);return jZ.pop(),i}return jQ}function j$(e){for(var t=jJ(e[0]),n=Object.keys(t),r=e.length,i=0;i<n.length;i++){var o=function(n){for(var i=t[n].slice(),o=[t[n]],a=1;a<r;a++){var u=jJ(e[a])[n];if(void 0===u||u.some(function(e){return -1!==i.indexOf(e)}))return"continue-keys";i.push.apply(i,u),o.push(u)}return{value:[n,o]}}(n[i]);if("object"==typeof o)return o.value;if("continue-keys"===o)continue}}var jX=function(e){function t(){var t=e.call(this,"null",function(e){return null===e},function(e,n){return t.is(e)?eO(e):jR(e,n)},jE)||this;return t._tag="NullType",t}return j_(t,e),t}(jk),j0=new jX,j1=function(e){function t(){var t=e.call(this,"undefined",function(e){return void 0===e},function(e,n){return t.is(e)?eO(e):jR(e,n)},jE)||this;return t._tag="UndefinedType",t}return j_(t,e),t}(jk),j2=new j1,j6=function(e){function t(){var t=e.call(this,"void",j2.is,j2.validate,jE)||this;return t._tag="VoidType",t}return j_(t,e),t}(jk),j5=new j6,j3=function(e){function t(){var t=e.call(this,"unknown",function(e){return!0},eO,jE)||this;return t._tag="UnknownType",t}return j_(t,e),t}(jk),j9=new j3,j4=function(e){function t(){var t=e.call(this,"string",function(e){return"string"==typeof e},function(e,n){return t.is(e)?eO(e):jR(e,n)},jE)||this;return t._tag="StringType",t}return j_(t,e),t}(jk),j7=new j4,j8=function(e){function t(){var t=e.call(this,"number",function(e){return"number"==typeof e},function(e,n){return t.is(e)?eO(e):jR(e,n)},jE)||this;return t._tag="NumberType",t}return j_(t,e),t}(jk),Fe=new j8,Ft=function(e){function t(){var t=e.call(this,"bigint",function(e){return"bigint"==typeof e},function(e,n){return t.is(e)?eO(e):jR(e,n)},jE)||this;return t._tag="BigIntType",t}return j_(t,e),t}(jk),Fn=new Ft,Fr=function(e){function t(){var t=e.call(this,"boolean",function(e){return"boolean"==typeof e},function(e,n){return t.is(e)?eO(e):jR(e,n)},jE)||this;return t._tag="BooleanType",t}return j_(t,e),t}(jk),Fi=new Fr,Fo=function(e){function t(){var t=e.call(this,"UnknownArray",Array.isArray,function(e,n){return t.is(e)?eO(e):jR(e,n)},jE)||this;return t._tag="AnyArrayType",t}return j_(t,e),t}(jk),Fa=new Fo,Fu=function(e){function t(){var t=e.call(this,"UnknownRecord",function(e){var t=Object.prototype.toString.call(e);return"[object Object]"===t||"[object Window]"===t},function(e,n){return t.is(e)?eO(e):jR(e,n)},jE)||this;return t._tag="AnyDictionaryType",t}return j_(t,e),t}(jk),Fs=new Fu,Fl=function(e){function t(t,n,r,i,o){var a=e.call(this,t,n,r,i)||this;return a.value=o,a._tag="LiteralType",a}return j_(t,e),t}(jk);function Fc(e,t){void 0===t&&(t=JSON.stringify(e));var n=function(t){return t===e};return new Fl(t,n,function(t,r){return n(t)?eO(e):jR(t,r)},jE,e)}var Fd=function(e){function t(t,n,r,i,o){var a=e.call(this,t,n,r,i)||this;return a.keys=o,a._tag="KeyofType",a}return j_(t,e),t}(jk),Ff=function(e){function t(t,n,r,i,o,a){var u=e.call(this,t,n,r,i)||this;return u.type=o,u.predicate=a,u._tag="RefinementType",u}return j_(t,e),t}(jk);function Fp(e,t,n){return FQ(e,t,n)}var FA=Fp(Fe,function(e){return Number.isInteger(e)},"Int"),Fh=function(e){function t(t,n,r,i,o){var a=e.call(this,t,n,r,i)||this;return a.runDefinition=o,a._tag="RecursiveType",a}return j_(t,e),t}(jk);function Fm(e,t){var n,r=function(){return n||((n=t(i)).name=e),n},i=new Fh(e,function(e){return r().is(e)},function(e,t){return r().validate(e,t)},function(e){return r().encode(e)},r);return i}Object.defineProperty(Fh.prototype,"type",{get:function(){return this.runDefinition()},enumerable:!0,configurable:!0});var Fg=function(e){function t(t,n,r,i,o){var a=e.call(this,t,n,r,i)||this;return a.type=o,a._tag="ArrayType",a}return j_(t,e),t}(jk);function Fy(e,t){return void 0===t&&(t="Array<".concat(e.name,">")),new Fg(t,function(t){return Fa.is(t)&&t.every(e.is)},function(t,n){var r=Fa.validate(t,n);if(dt(r))return r;for(var i=r.right,o=i.length,a=i,u=[],s=0;s<o;s++){var l=i[s],c=e.validate(l,jj(n,String(s),e,l));if(dt(c))jF(u,c.left);else{var d=c.right;d!==l&&(a===i&&(a=i.slice()),a[s]=d)}}return u.length>0?eT(u):eO(a)},e.encode===jE?jE:function(t){return t.map(e.encode)},e)}var Fv=function(e){function t(t,n,r,i,o){var a=e.call(this,t,n,r,i)||this;return a.props=o,a._tag="InterfaceType",a}return j_(t,e),t}(jk);function Fx(e,t){void 0===t&&(t=jB(e));var n=Object.keys(e),r=n.map(function(t){return e[t]}),i=n.length;return new Fv(t,function(e){if(Fs.is(e)){for(var t=0;t<i;t++){var o=n[t],a=e[o];if(void 0===a&&!jU.call(e,o)||!r[t].is(a))return!1}return!0}return!1},function(e,t){var o=Fs.validate(e,t);if(dt(o))return o;for(var a=o.right,u=a,s=[],l=0;l<i;l++){var c=n[l],d=u[c],f=r[l],p=f.validate(d,jj(t,c,f,d));if(dt(p))jF(s,p.left);else{var A=p.right;A===d&&(void 0!==A||jU.call(u,c))||(u===a&&(u=jT({},a)),u[c]=A)}}return s.length>0?eT(s):eO(u)},jK(r)?jE:function(e){for(var t=jT({},e),o=0;o<i;o++){var a=n[o],u=r[o].encode;u!==jE&&(t[a]=u(e[a]))}return t},e)}var Fb=function(e){function t(t,n,r,i,o){var a=e.call(this,t,n,r,i)||this;return a.props=o,a._tag="PartialType",a}return j_(t,e),t}(jk),FC=function(e){function t(t,n,r,i,o,a){var u=e.call(this,t,n,r,i)||this;return u.domain=o,u.codomain=a,u._tag="DictionaryType",u}return j_(t,e),t}(jk);function FS(e,t,n){var r,i,o,a,u=jW(e);return u?(r=Object.keys(u),void 0===(i=n)&&(i="{ [K in ".concat(e.name,"]: ").concat(t.name," }")),o=r.length,new FC(i,function(e){return Fs.is(e)&&r.every(function(n){return t.is(e[n])})},function(e,n){var i=Fs.validate(e,n);if(dt(i))return i;for(var a=i.right,u={},s=[],l=!1,c=0;c<o;c++){var d=r[c],f=a[d],p=t.validate(f,jj(n,d,t,f));if(dt(p))jF(s,p.left);else{var A=p.right;l=l||A!==f,u[d]=A}}return s.length>0?eT(s):eO(l||Object.keys(a).length!==o?u:a)},t.encode===jE?jE:function(e){for(var n={},i=0;i<o;i++){var a=r[i];n[a]=t.encode(e[a])}return n},e,t)):(void 0===(a=n)&&(a="{ [K in ".concat(e.name,"]: ").concat(t.name," }")),new FC(a,function(n){return Fs.is(n)?Object.keys(n).every(function(r){return e.is(r)&&t.is(n[r])}):jz(t)&&Array.isArray(n)},function(n,r){if(Fs.is(n)){for(var i={},o=[],a=Object.keys(n),u=a.length,s=!1,l=0;l<u;l++){var c=a[l],d=n[c],f=e.validate(c,jj(r,c,e,c));if(dt(f))jF(o,f.left);else{var p=f.right;s=s||p!==c,c=p;var A=t.validate(d,jj(r,c,t,d));if(dt(A))jF(o,A.left);else{var h=A.right;s=s||h!==d,i[c]=h}}}return o.length>0?eT(o):eO(s?i:n)}return jz(t)&&Array.isArray(n)?eO(n):jR(n,r)},e.encode===jE&&t.encode===jE?jE:function(n){for(var r={},i=Object.keys(n),o=i.length,a=0;a<o;a++){var u=i[a];r[String(e.encode(u))]=t.encode(n[u])}return r},e,t))}var Fw=function(e){function t(t,n,r,i,o){var a=e.call(this,t,n,r,i)||this;return a.types=o,a._tag="UnionType",a}return j_(t,e),t}(jk);function FI(e,t){void 0===t&&(t=jD(e));var n=j$(e);if(void 0===n||!(e.length>0))return new Fw(t,function(t){return e.some(function(e){return e.is(t)})},function(t,n){for(var r=[],i=0;i<e.length;i++){var o=e[i],a=o.validate(t,jj(n,String(i),o,t));if(!dt(a))return eO(a.right);jF(r,a.left)}return eT(r)},jK(e)?jE:function(n){for(var r=0;r<e.length;r++){var i=e[r];if(i.is(n))return i.encode(n)}throw Error("no codec found to encode value in union type ".concat(t))},e);var r=n[0],i=n[1],o=i.length,a=function(e){for(var t=0;t<o;t++)if(-1!==i[t].indexOf(e))return t};return new FL(t,function(t){if(Fs.is(t)){var n=a(t[r]);return void 0!==n&&e[n].is(t)}return!1},function(t,n){var i=Fs.validate(t,n);if(dt(i))return i;var o=i.right,u=a(o[r]);if(void 0===u)return jR(t,n);var s=e[u];return s.validate(o,jj(n,String(u),s,o))},jK(e)?jE:function(n){var i=a(n[r]);if(void 0===i)throw Error("no codec found to encode value in union codec ".concat(t));return e[i].encode(n)},e,r)}var F_=function(e){function t(t,n,r,i,o){var a=e.call(this,t,n,r,i)||this;return a.types=o,a._tag="IntersectionType",a}return j_(t,e),t}(jk),FT=function(e){function t(t,n,r,i,o){var a=e.call(this,t,n,r,i)||this;return a.types=o,a._tag="TupleType",a}return j_(t,e),t}(jk),FO=function(e){function t(t,n,r,i,o){var a=e.call(this,t,n,r,i)||this;return a.type=o,a._tag="ReadonlyType",a}return j_(t,e),t}(jk),FR=function(e){function t(t,n,r,i,o){var a=e.call(this,t,n,r,i)||this;return a.type=o,a._tag="ReadonlyArrayType",a}return j_(t,e),t}(jk);function Fk(e,t){void 0===t&&(t="ReadonlyArray<".concat(e.name,">"));var n=Fy(e);return new FR(t,n.is,n.validate,n.encode,e)}var FE=function(e,t){return Fj(Fx(e),t)},FM=function(e){function t(t,n,r,i,o){var a=e.call(this,t,n,r,i)||this;return a.type=o,a._tag="ExactType",a}return j_(t,e),t}(jk);function Fj(e,t){void 0===t&&(t=jH(e)?"{| ".concat(jL(e.props)," |}"):"PartialType"===e._tag?jP("{| ".concat(jL(e.props)," |}")):"Exact<".concat(e.name,">"));var n=function e(t){switch(t._tag){case"RefinementType":case"ReadonlyType":return e(t.type);case"InterfaceType":case"StrictType":case"PartialType":return t.props;case"IntersectionType":return t.types.reduce(function(t,n){return Object.assign(t,e(n))},{})}}(e);return new FM(t,e.is,function(t,r){var i=Fs.validate(t,r);if(dt(i))return i;var o=e.validate(t,r);return dt(o)?o:eO(jq(o.right,n))},function(t){return e.encode(jq(t,n))},e)}var FF=function(e){function t(){var t=e.call(this,"Function",function(e){return"function"==typeof e},function(e,n){return t.is(e)?eO(e):jR(e,n)},jE)||this;return t._tag="FunctionType",t}return j_(t,e),t}(jk),FU=new FF,FL=function(e){function t(t,n,r,i,o,a){var u=e.call(this,t,n,r,i,o)||this;return u.tag=a,u}return j_(t,e),t}(Fw),FK=function(e){return[{key:"",type:e}]},FB=function(e){function t(){var t=e.call(this,"never",function(e){return!1},function(e,t){return jR(e,t)},function(){throw Error("cannot encode never")})||this;return t._tag="NeverType",t}return j_(t,e),t}(jk),FP=new FB,FW=function(e){function t(){var t=e.call(this,"any",function(e){return!0},eO,jE)||this;return t._tag="AnyType",t}return j_(t,e),t}(jk),FD=new FW,FN=function(e){function t(){var t=e.call(this,"object",function(e){return null!==e&&"object"==typeof e},function(e,n){return t.is(e)?eO(e):jR(e,n)},jE)||this;return t._tag="ObjectType",t}return j_(t,e),t}(jk),Fq=new FN;function FQ(e,t,n){return void 0===n&&(n="(".concat(e.name," | ").concat(jM(t),")")),new Ff(n,function(n){return e.is(n)&&t(n)},function(n,r){var i=e.validate(n,r);if(dt(i))return i;var o=i.right;return t(o)?eO(o):jR(o,r)},e.encode,e,t)}let FV=W(Object.freeze(Object.defineProperty({__proto__:null,AnyArrayType:Fo,AnyDictionaryType:Fu,AnyType:FW,Array:Fa,ArrayType:Fg,BigIntType:Ft,BooleanType:Fr,Dictionary:Fs,DictionaryType:FC,ExactType:FM,Function:FU,FunctionType:FF,Int:FA,Integer:FQ(Fe,Number.isInteger,"Integer"),InterfaceType:Fv,IntersectionType:F_,KeyofType:Fd,LiteralType:Fl,NeverType:FB,NullType:jX,NumberType:j8,ObjectType:FN,PartialType:Fb,ReadonlyArrayType:FR,ReadonlyType:FO,RecursiveType:Fh,RefinementType:Ff,StrictType:function(e){function t(t,n,r,i,o){var a=e.call(this,t,n,r,i)||this;return a.props=o,a._tag="StrictType",a}return j_(t,e),t}(jk),StringType:j4,TaggedUnionType:FL,TupleType:FT,Type:jk,UndefinedType:j1,UnionType:Fw,UnknownArray:Fa,UnknownRecord:Fs,UnknownType:j3,VoidType:j6,alias:function(e){return function(){return e}},any:FD,appendContext:jj,array:Fy,bigint:Fn,boolean:Fi,brand:Fp,clean:function(e){return e},dictionary:FS,emptyTags:jQ,exact:Fj,failure:jR,failures:eT,getContextEntry:function(e,t){return{key:e,type:t}},getDefaultContext:FK,getDomainKeys:jW,getFunctionName:jM,getIndex:j$,getTags:jJ,getValidationError:function(e,t){return{value:e,context:t}},identity:jE,interface:Fx,intersection:function(e,t){void 0===t&&(t="(".concat(e.map(function(e){return e.name}).join(" & "),")"));var n=e.length;return new F_(t,function(t){return e.every(function(e){return e.is(t)})},0===e.length?eO:function(t,r){for(var i=[],o=[],a=0;a<n;a++){var u=e[a],s=u.validate(t,jj(r,String(a),u,t));dt(s)?jF(o,s.left):i.push(s.right)}return o.length>0?eT(o):eO(jN(t,i))},0===e.length?jE:function(t){return jN(t,e.map(function(e){return e.encode(t)}))},e)},keyof:function(e,t){void 0===t&&(t=Object.keys(e).map(function(e){return JSON.stringify(e)}).join(" | "));var n=function(t){return j7.is(t)&&jU.call(e,t)};return new Fd(t,n,function(e,t){return n(e)?eO(e):jR(e,t)},jE,e)},literal:Fc,mergeAll:jN,never:FP,null:j0,nullType:j0,number:Fe,object:Fq,partial:function(e,t){void 0===t&&(t=jP(jB(e)));var n=Object.keys(e),r=n.map(function(t){return e[t]}),i=n.length;return new Fb(t,function(t){if(Fs.is(t)){for(var r=0;r<i;r++){var o=n[r],a=t[o];if(void 0!==a&&!e[o].is(a))return!1}return!0}return!1},function(t,r){var o=Fs.validate(t,r);if(dt(o))return o;for(var a=o.right,u=a,s=[],l=0;l<i;l++){var c=n[l],d=u[c],f=e[c],p=f.validate(d,jj(r,c,f,d));if(dt(p))void 0!==d&&jF(s,p.left);else{var A=p.right;A!==d&&(u===a&&(u=jT({},a)),u[c]=A)}}return s.length>0?eT(s):eO(u)},jK(r)?jE:function(e){for(var t=jT({},e),o=0;o<i;o++){var a=n[o],u=e[a];void 0!==u&&(t[a]=r[o].encode(u))}return t},e)},readonly:function(e,t){return void 0===t&&(t="Readonly<".concat(e.name,">")),new FO(t,e.is,e.validate,e.encode,e)},readonlyArray:Fk,record:FS,recursion:Fm,refinement:FQ,strict:FE,string:j7,success:eO,taggedUnion:function(e,t,n){void 0===n&&(n=jD(t));var r=FI(t,n);return r instanceof FL?r:(console.warn("[io-ts] Cannot build a tagged union for ".concat(n,", returning a de-optimized union")),new FL(n,r.is,r.validate,r.encode,t,e))},tuple:function(e,t){void 0===t&&(t="[".concat(e.map(function(e){return e.name}).join(", "),"]"));var n=e.length;return new FT(t,function(t){return Fa.is(t)&&t.length===n&&e.every(function(e,n){return e.is(t[n])})},function(t,r){var i=Fa.validate(t,r);if(dt(i))return i;for(var o=i.right,a=o.length>n?o.slice(0,n):o,u=[],s=0;s<n;s++){var l=o[s],c=e[s],d=c.validate(l,jj(r,String(s),c,l));if(dt(d))jF(u,d.left);else{var f=d.right;f!==l&&(a===o&&(a=o.slice()),a[s]=f)}}return u.length>0?eT(u):eO(a)},jK(e)?jE:function(t){return e.map(function(e,n){return e.encode(t[n])})},e)},type:Fx,undefined:j2,union:FI,unknown:j9,void:j5,voidType:j5},Symbol.toStringTag,{value:"Module"})));var Fz={};Object.defineProperty(Fz,"__esModule",{value:!0}),Fz.ContentPath=void 0,Fz.ContentPath={serialize:e=>e.map(e=>e.key).join("::"),current:e=>e[e.length-1],append:(e,t)=>e+"::"+t,make:e=>e.reduce((e,{key:t,type:n})=>t?e.concat({key:t,type:n}):e,[])};var FY={},FH={};Object.defineProperty(FH,"__esModule",{value:!0}),FH.getAssetOrThrow=void 0,FH.getAssetOrThrow=e=>t=>{let n=e[t];if(!n)throw Error(`Missing asset with id '${t}'!`);return n};var FG={};Object.defineProperty(FG,"__esModule",{value:!0}),FG.getEmbedOrThrow=void 0,FG.getEmbedOrThrow=e=>t=>{let n=e[t];if(!n)throw Error(`Missing embed with url '${t}'`);return n};var FZ={},FJ={};let F$=W(ev);function FX(e,t,n){return void 0===n&&(n=e.name),new jk(n,e.is,e.validate,function(n){return t(e.encode(n))})}let F0=Object.freeze(Object.defineProperty({__proto__:null,mapOutput:FX},Symbol.toStringTag,{value:"Module"}));var F1=Fp(j7,function(e){return e.length>0},"NonEmptyString");function F2(e,t){void 0===t&&(t="NonEmptyArray<"+e.name+">");var n=Fy(e);return new jk(t,function(e){return n.is(e)&&ra(e)},function(e,t){return eg(n.validate(e,t),cG(function(n){var r=rg(n);return lK(r)?jR(e,t):eO(r.value)}))},function(e){return n.encode(e)})}function F6(e,t,n){void 0===n&&(n="Set<"+e.name+">");var r=Fy(e),i=T_(t),o=Tb(t);return new jk(n,function(t){return t instanceof Set&&_u(e.is)(t)},function(e,t){return eg(r.validate(e,t),cG(function(n){var r=o(n);return r.size!==n.length?jR(e,t):eO(r)}))},function(e){return r.encode(i(e))})}function F5(e,t){return new jk(e,t,function(e,n){return t(e)?eO(e):jR(e,n)},jE)}var F3=F5("Date",function(e){return e instanceof Date}),F9=function(e,t,n){if(n||2==arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))},F4=function(e){return F7(e.get,eA(e.reverseGet,el))},F7=function(e,t){return{get:e,set:t}},F8=function(e){return Ua(eA(e.get,ew),e.set)},Ue=function(e){return function(t){return F7(function(n){return e.get(t.get(n))},function(n){return function(r){return t.set(e.set(n)(t.get(r)))(r)}})}},Ut=function(e,t){return{getOption:e,reverseGet:t}},Un=function(e){return Ua(e.getOption,function(t){return Ui(t)(e)})},Ur=function(e){return Ud(function(t){return function(n){return function(r){return eg(e.getOption(r),lB(function(){return t.of(r)},function(i){return t.map(n(i),function(t){return Ui(t)(e)(r)})}))}}})},Ui=function(e){var t;return t=function(){return e},function(e){return function(n){var r;return eg((r=n,eg(e.getOption(r),li(function(n){var i=t(n);return i===n?r:e.reverseGet(i)}))),lP(function(){return n}))}}},Uo=function(e){return Ut(sG(e),es)},Ua=function(e,t){return{getOption:e,set:t}},Uu=function(e){return function(t){return function(n){return eg(t.getOption(n),li(function(r){var i=e(r);return i===r?n:t.set(i)(n)}))}}},Us=function(e){return function(t){var n=Uu(e)(t);return function(e){return eg(n(e),lP(function(){return e}))}}},Ul=function(e){return function(t){return Ua(eA(t.getOption,lc(e.getOption)),function(n){return Us(e.set(n))(t)})}},Uc=function(e,t,n){if(n[e]===t)return n;var r=F9([n[0]],n.slice(1),!0);return r[e]=t,r},Ud=function(e){return{modifyF:e}};function Uf(e){return function(t){return Ud(function(n){return function(r){return t.modifyF(n)(e.modifyF(n)(r))}})}}var Up={URI:"Identity",map:function(e,t){return t(e)},of:es,ap:function(e,t){return e(t)}},UA=function(e){return{index:e}},Uh=function(e,t){return{get:e,reverseGet:t}},Um=function(e){return Ut(eA(e.get,ew),e.reverseGet)},Ug=function(e){return Ua(eA(e.get,ew),eA(e.reverseGet,el))},Uy=function(e){return Ud(function(t){return function(n){return function(r){return t.map(n(e.get(r)),function(t){return e.reverseGet(t)})}}})},Uv=function(){return F7(es,el)},Ux=function(e){return Ud(function(t){return function(n){return function(r){return t.map(n(e.get(r)),function(t){return e.set(t)(r)})}}})},Ub=eA(F4,Ue),UC=function(e){return function(t){return Ul(Un(e))(F8(t))}},US=function(e){return eA(F8,Ul(e))},Uw=function(e){return function(t){return function(n){var r=t.get(n),i=e(r);return r===i?n:t.set(i)(n)}}},UI=function(e){return function(t){return F7(function(n){return t.get(n)[e]},function(n){return function(r){var i,o=t.get(r);return n===o[e]?r:t.set(Object.assign({},o,((i={})[e]=n,i)))(r)}})}},U_=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(t){return F7(function(n){for(var r=t.get(n),i={},o=0;o<e.length;o++){var a=e[o];i[a]=r[a]}return i},function(n){return function(r){for(var i=t.get(r),o=0;o<e.length;o++){var a=e[o];if(n[a]!==i[a])return t.set(Object.assign({},i,n))(r)}return r}})}},UT=UC(Ut(es,ew)),UO=UC(Ut(sJ,eO)),UR=UC(Ut(function(e){return dt(e)?ew(e.left):eS},eT)),Uk=function(e,t,n){return F7(eA(e.get,t),eA(n,e.set))},UE="monocle-ts/Lens",UM={URI:UE,compose:function(e,t){return Ue(e)(t)}};let Uj=Object.freeze(Object.defineProperty({__proto__:null,Category:{URI:UE,compose:UM.compose,id:Uv},Invariant:{URI:UE,imap:Uk},Semigroupoid:UM,URI:UE,asOptional:F8,asTraversal:Ux,atKey:function(e){return function(t){return eg(t,Ue(({at:function(e){return F7(function(t){return wJ(e,t)},lB(function(){return wG(e)},function(t){return wY(e,t)}))}}).at(e)))}},component:function(e){return function(t){return F7(function(n){return t.get(n)[e]},function(n){return function(r){var i=t.get(r);if(n===i[e])return r;var o=i.slice();return o[e]=n,t.set(o)(r)}})}},compose:Ue,composeIso:Ub,composeLens:Ue,composeOptional:US,composePrism:UC,composeTraversal:function(e){return eA(Ux,Uf(e))},filter:function(e){return UC(Uo(e))},findFirst:function(e){return US(Ua(ot(e),function(t){return function(n){return eg(oe(e)(n),lB(function(){return n},function(e){return aM(e,t,n)}))}}))},findFirstNonEmpty:function(e){return US(Ua(ot(e),function(t){return function(n){return eg(oe(e)(n),lB(function(){return n},function(e){return Uc(e,t,n)}))}}))},fromNullable:function(e){return UC(Ut(lH,es))(e)},id:Uv,imap:function(e,t){return function(n){return Uk(n,e,t)}},index:function(e){return eA(F8,function(t){return eg(t,Ul(UA(function(e){return Ua(function(t){return i9(e,t)},function(t){return function(n){return eg(i9(e,n),lB(function(){return n},function(){return aM(e,t,n)}))}})}).index(e)))})},indexNonEmpty:function(e){return eA(F8,function(t){return eg(t,Ul(UA(function(e){return Ua(function(t){return i9(e,t)},function(t){return function(n){return eg(i9(e,n),lB(function(){return n},function(){return Uc(e,t,n)}))}})}).index(e)))})},key:function(e){return eA(F8,function(t){return eg(t,Ul(UA(function(e){return Ua(function(t){return wJ(e,t)},function(t){return function(n){return n[e]===t||lK(wJ(e,n))?n:wY(e,t)(n)}})}).index(e)))})},left:UR,lens:F7,modify:Uw,modifyF:function(e){return function(t){return function(n){return function(r){return eg(n.get(r),t,function(t){return e.map(t,function(e){return n.set(e)(r)})})}}}},prop:UI,props:U_,right:UO,some:UT,traverse:function(e){return eA(Ux,Uf(Ud(function(t){var n="Identity"===t.URI?e.map:e.traverse(t);return function(e){return function(t){return n(t,e)}}})))}},Symbol.toStringTag,{value:"Module"}));var UF=function(e){return Ud(function(t){return function(n){return function(r){return eg(e.getOption(r),lB(function(){return t.of(r)},function(i){return t.map(n(i),function(t){return e.set(t)(r)})}))}}})},UU=function(e){return function(t){return Ut(eA(t.getOption,lc(e.getOption)),eA(e.reverseGet,t.reverseGet))}},UL=function(e){return function(t){return t.modifyF(Up)(e)}},UK=function(e){return new Uq(e.get,e.reverseGet)},UB=function(e){return new UQ(e.get,e.set)},UP=function(e){return new UV(e.getOption,e.reverseGet)},UW=function(e){return new UY(e.getOption,e.set)},UD=function(e){return new UH(e.modifyF)},UN=function(e,t,n){var r;return n===e[t]?e:Object.assign({},e,((r={})[t]=n,r))},Uq=function(){function e(e,t){this.get=e,this.reverseGet=t,this._tag="Iso",this.unwrap=this.get,this.to=this.get,this.wrap=this.reverseGet,this.from=this.reverseGet}return e.prototype.reverse=function(){return UK(Uh(this.reverseGet,this.get))},e.prototype.modify=function(e){var t;return t=this,function(n){return t.reverseGet(e(t.get(n)))}},e.prototype.asLens=function(){return UB(F4(this))},e.prototype.asPrism=function(){return UP(Um(this))},e.prototype.asOptional=function(){return UW(Ug(this))},e.prototype.asTraversal=function(){return UD(Uy(this))},e.prototype.asFold=function(){var e=this;return new UZ(function(){return function(t){return function(n){return t(e.get(n))}}})},e.prototype.asGetter=function(){var e=this;return new UG(function(t){return e.get(t)})},e.prototype.asSetter=function(){var e=this;return new UJ(function(t){return e.modify(t)})},e.prototype.compose=function(e){return UK(Uh(eA(this.get,e.get),eA(e.reverseGet,this.reverseGet)))},e.prototype.composeIso=function(e){return this.compose(e)},e.prototype.composeLens=function(e){return UB(eg(this,F4,Ue(e)))},e.prototype.composePrism=function(e){return UP(eg(this,Um,UU(e)))},e.prototype.composeOptional=function(e){return UW(eg(this,Ug,Ul(e)))},e.prototype.composeTraversal=function(e){return UD(eg(this,Uy,Uf(e)))},e.prototype.composeFold=function(e){return this.asFold().compose(e)},e.prototype.composeGetter=function(e){return this.asGetter().compose(e)},e.prototype.composeSetter=function(e){return this.asSetter().compose(e)},e}(),UQ=function(){function e(e,t){this.get=e,this.set=t,this._tag="Lens"}return e.fromPath=function(){var t=e.fromProp();return function(e){var n=t(e[0]);return e.slice(1).reduce(function(e,n){return e.compose(t(n))},n)}},e.fromProp=function(){return function(e){return UB(eg(Uv(),UI(e)))}},e.fromProps=function(){return function(e){return UB(eg(Uv(),U_.apply(Uj,e)))}},e.fromNullableProp=function(){return function(t,n){return new e(function(e){var r=lH(e[t]);return lK(r)?n:r.value},function(e){return function(n){return UN(n,t,e)}})}},e.prototype.modify=function(e){return Uw(e)(this)},e.prototype.asOptional=function(){return UW(F8(this))},e.prototype.asTraversal=function(){return UD(Ux(this))},e.prototype.asSetter=function(){var e=this;return new UJ(function(t){return e.modify(t)})},e.prototype.asGetter=function(){var e=this;return new UG(function(t){return e.get(t)})},e.prototype.asFold=function(){var e=this;return new UZ(function(){return function(t){return function(n){return t(e.get(n))}}})},e.prototype.compose=function(e){return UB(Ue(e)(this))},e.prototype.composeLens=function(e){return this.compose(e)},e.prototype.composeGetter=function(e){return this.asGetter().compose(e)},e.prototype.composeFold=function(e){return this.asFold().compose(e)},e.prototype.composeOptional=function(e){return UW(eg(this,F8,Ul(e)))},e.prototype.composeTraversal=function(e){return UD(eg(this,Ux,Uf(e)))},e.prototype.composeSetter=function(e){return this.asSetter().compose(e)},e.prototype.composeIso=function(e){return UB(eg(this,Ue(eg(e,F4))))},e.prototype.composePrism=function(e){return UW(UC(e)(this))},e}(),UV=function(){function e(e,t){this.getOption=e,this.reverseGet=t,this._tag="Prism"}return e.fromPredicate=function(e){return UP(Uo(e))},e.some=function(){return Uz},e.prototype.modify=function(e){var t=this;return function(n){var r=t.modifyOption(e)(n);return lK(r)?n:r.value}},e.prototype.modifyOption=function(e){var t=this;return function(n){return l7.map(t.getOption(n),function(r){var i=e(r);return i===r?n:t.reverseGet(i)})}},e.prototype.set=function(e){return this.modify(function(){return e})},e.prototype.asOptional=function(){return UW(Un(this))},e.prototype.asTraversal=function(){return UD(Ur(this))},e.prototype.asSetter=function(){var e=this;return new UJ(function(t){return e.modify(t)})},e.prototype.asFold=function(){var e=this;return new UZ(function(t){return function(n){return function(r){var i=e.getOption(r);return lK(i)?t.empty:n(i.value)}}})},e.prototype.compose=function(e){return UP(UU(e)(this))},e.prototype.composePrism=function(e){return this.compose(e)},e.prototype.composeOptional=function(e){return UW(eg(this,Un,Ul(e)))},e.prototype.composeTraversal=function(e){return UD(eg(this,Ur,Uf(e)))},e.prototype.composeFold=function(e){return this.asFold().compose(e)},e.prototype.composeSetter=function(e){return this.asSetter().compose(e)},e.prototype.composeIso=function(e){return UP(eg(this,UU(eg(e,Um))))},e.prototype.composeLens=function(e){return UW(Ul(F8(e))(Un(this)))},e.prototype.composeGetter=function(e){return this.asFold().compose(e.asFold())},e}(),Uz=new UV(es,ew),UY=function(){function e(e,t){this.getOption=e,this.set=t,this._tag="Optional"}return e.fromPath=function(){var t=e.fromNullableProp();return function(e){var n=t(e[0]);return e.slice(1).reduce(function(e,n){return e.compose(t(n))},n)}},e.fromNullableProp=function(){return function(t){return new e(function(e){return lH(e[t])},function(e){return function(n){return null==n[t]?n:UN(n,t,e)}})}},e.fromOptionProp=function(){var e=UQ.fromProp();return function(t){return e(t).composePrism(Uz)}},e.prototype.modify=function(e){return Us(e)(this)},e.prototype.modifyOption=function(e){return Uu(e)(this)},e.prototype.asTraversal=function(){return UD(UF(this))},e.prototype.asFold=function(){var e=this;return new UZ(function(t){return function(n){return function(r){var i=e.getOption(r);return lK(i)?t.empty:n(i.value)}}})},e.prototype.asSetter=function(){var e=this;return new UJ(function(t){return e.modify(t)})},e.prototype.compose=function(e){return UW(Ul(e)(this))},e.prototype.composeOptional=function(e){return this.compose(e)},e.prototype.composeTraversal=function(e){return UD(eg(this,UF,Uf(e)))},e.prototype.composeFold=function(e){return this.asFold().compose(e)},e.prototype.composeSetter=function(e){return this.asSetter().compose(e)},e.prototype.composeLens=function(e){return UW(eg(this,Ul(eg(e,F8))))},e.prototype.composePrism=function(e){return UW(eg(this,Ul(eg(e,Un))))},e.prototype.composeIso=function(e){return UW(eg(this,Ul(eg(e,Ug))))},e.prototype.composeGetter=function(e){return this.asFold().compose(e.asFold())},e}(),UH=function(){function e(e){this.modifyF=e,this._tag="Traversal"}return e.prototype.modify=function(e){return UL(e)(this)},e.prototype.set=function(e){return UL(function(){return e})(this)},e.prototype.filter=function(e){return UD(Uf(Ur(Uo(e)))(this))},e.prototype.asFold=function(){var e=this;return new UZ(function(t){return function(n){return e.modifyF(cs(t))(function(e){return es(n(e))})}})},e.prototype.asSetter=function(){var e=this;return new UJ(function(t){return e.modify(t)})},e.prototype.compose=function(e){return UD(Uf(e)(this))},e.prototype.composeTraversal=function(e){return this.compose(e)},e.prototype.composeFold=function(e){return this.asFold().compose(e)},e.prototype.composeSetter=function(e){return this.asSetter().compose(e)},e.prototype.composeOptional=function(e){return this.compose(e.asTraversal())},e.prototype.composeLens=function(e){return UD(eg(this,Uf(eg(e,Ux))))},e.prototype.composePrism=function(e){return UD(eg(this,Uf(eg(e,Ur))))},e.prototype.composeIso=function(e){return UD(eg(this,Uf(eg(e,Uy))))},e.prototype.composeGetter=function(e){return this.asFold().compose(e.asFold())},e}(),UG=function(){function e(e){this.get=e,this._tag="Getter"}return e.prototype.asFold=function(){var e=this;return new UZ(function(){return function(t){return function(n){return t(e.get(n))}}})},e.prototype.compose=function(t){var n=this;return new e(function(e){return t.get(n.get(e))})},e.prototype.composeGetter=function(e){return this.compose(e)},e.prototype.composeFold=function(e){return this.asFold().compose(e)},e.prototype.composeLens=function(e){return this.compose(e.asGetter())},e.prototype.composeIso=function(e){return this.compose(e.asGetter())},e.prototype.composeTraversal=function(e){return this.asFold().compose(e.asFold())},e.prototype.composeOptional=function(e){return this.asFold().compose(e.asFold())},e.prototype.composePrism=function(e){return this.asFold().compose(e.asFold())},e}(),UZ=function(){function e(e){this.foldMap=e,this._tag="Fold",this.getAll=e(uJ())(rO),this.exist=e(yV),this.all=e(yQ),this.foldMapFirst=e(ct())}return e.prototype.compose=function(t){var n=this;return new e(function(e){return function(r){return n.foldMap(e)(t.foldMap(e)(r))}})},e.prototype.composeFold=function(e){return this.compose(e)},e.prototype.composeGetter=function(e){return this.compose(e.asFold())},e.prototype.composeTraversal=function(e){return this.compose(e.asFold())},e.prototype.composeOptional=function(e){return this.compose(e.asFold())},e.prototype.composeLens=function(e){return this.compose(e.asFold())},e.prototype.composePrism=function(e){return this.compose(e.asFold())},e.prototype.composeIso=function(e){return this.compose(e.asFold())},e.prototype.find=function(e){return this.foldMapFirst(sG(e))},e.prototype.headOption=function(e){return this.find(function(){return!0})(e)},e}(),UJ=function(){function e(e){this.modify=e,this._tag="Setter"}return e.prototype.set=function(e){return this.modify(el(e))},e.prototype.compose=function(t){var n=this;return new e(function(e){return n.modify(t.modify(e))})},e.prototype.composeSetter=function(e){return this.compose(e)},e.prototype.composeTraversal=function(e){return this.compose(e.asSetter())},e.prototype.composeOptional=function(e){return this.compose(e.asSetter())},e.prototype.composeLens=function(e){return this.compose(e.asSetter())},e.prototype.composePrism=function(e){return this.compose(e.asSetter())},e.prototype.composeIso=function(e){return this.compose(e.asSetter())},e}(),U$=new Uq(es,es),UX=FE({_tag:Fc("None")}),U0=Fc("Some");function U1(e,t){return void 0===t&&(t="Option<"+e.name+">"),FI([UX,FE({_tag:U0,value:e},"Some<"+e.name+">")],t)}var U2=new jk("DateFromISOString",function(e){return e instanceof Date},function(e,t){return eg(j7.validate(e,t),cG(function(n){var r=new Date(n);return isNaN(r.getTime())?jR(e,t):eO(r)}))},function(e){return e.toISOString()});function U6(e){var t=Object.create(Object.getPrototypeOf(e));return Object.assign(t,e),t}var U5=new jk("DateFromNumber",function(e){return e instanceof Date},function(e,t){return eg(Fe.validate(e,t),cG(function(n){var r=new Date(n);return isNaN(r.getTime())?jR(e,t):eO(r)}))},function(e){return e.getTime()});function U3(e,t,n){void 0===n&&(n=e.name);var r=U6(e);return r.validate=t,r.decode=function(e){return t(e,FK(r))},r.name=n,r}var U9=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,U4=Fp(j7,function(e){return U9.test(e)},"UUID"),U7=new jk("BooleanFromString",Fi.is,function(e,t){return eg(j7.validate(e,t),cG(function(n){return"true"===n?eO(!0):"false"===n?eO(!1):jR(e,t)}))},String);function U8(e){switch(e._tag){case"InterfaceType":return e.props;case"ExactType":return U8(e.type)}}var Le=UQ.fromProp(),Lt=F5("RegExp",function(e){return"[object RegExp]"===Object.prototype.toString.call(e)}),Ln=new jk("DateFromUnixTime",function(e){return e instanceof Date},function(e,t){return eg(FA.validate(e,t),cG(function(n){var r=new Date(1e3*n);return isNaN(r.getTime())?jR(e,t):eO(r)}))},function(e){return Math.floor(e.getTime()/1e3)}),Lr=new jk("NumberFromString",Fe.is,function(e,t){return eg(j7.validate(e,t),cG(function(n){var r=+n;return isNaN(r)||""===n.trim()?jR(e,t):eO(r)}))},String),Li=new jk("IntFromString",FA.is,function(e,t){return eg(Lr.validate(e,t),cG(function(n){return FA.is(n)?eO(n):jR(e,t)}))},Lr.encode),Lo=Fm("JsonArray",function(){return Fk(Lu)}),La=Fm("JsonRecord",function(){return FS(j7,Lu)}),Lu=FI([Fi,Fe,j7,j0,Lo,La],"Json"),Ls=new jk("JsonFromString",Lu.is,function(e,t){try{return eO(JSON.parse(e))}catch{return jR(e,t)}},function(e){return JSON.stringify(e)}),Ll=Fc("Left"),Lc=Fc("Right");let Ld=W(Object.freeze(Object.defineProperty({__proto__:null,BigIntFromString:new jk("BigIntFromString",function(e){return"bigint"==typeof e},function(e,t){return eg(j7.validate(e,t),cG(function(n){if(!F1.is(n.trim()))return jR(e,t);try{return eO(BigInt(n))}catch{return jR(e,t)}}))},String),BooleanFromNumber:new jk("BooleanFromNumber",Fi.is,function(e,t){return eg(Fe.validate(e,t),cD(function(e){return 0!==e}))},Number),BooleanFromString:U7,DateFromISOString:U2,DateFromNumber:U5,DateFromUnixTime:Ln,IntFromString:Li,Json:Lu,JsonArray:Lo,JsonFromString:Ls,JsonRecord:La,NonEmptyString:F1,NumberFromString:Lr,UUID:U4,clone:U6,date:F3,either:function(e,t,n){return void 0===n&&(n="Either<"+e.name+", "+t.name+">"),FI([FE({_tag:Ll,left:e},"Left<"+e.name+">"),FE({_tag:Lc,right:t},"Right<"+e.name+">")],n)},fromNewtype:function(e,t){return void 0===t&&(t="fromNewtype("+e.name+")"),new jk(t,function(t){return e.is(t)},function(t,n){return eg(e.validate(t,n),cD(U$.wrap))},function(t){return e.encode(U$.unwrap(t))})},fromNullable:function(e,t,n){return void 0===n&&(n="fromNullable("+e.name+")"),U3(e,function(n,r){return null==n?eO(t):e.validate(n,r)},n)},fromRefinement:F5,getLenses:function(e){var t={};for(var n in U8(e))t[n]=Le(n);return t},mapOutput:FX,nonEmptyArray:F2,option:U1,optionFromNullable:function(e,t){return void 0===t&&(t="Option<"+e.name+">"),new jk(t,U1(e).is,function(t,n){return null==t?eO(eS):eg(e.validate(t,n),cD(ew))},function(t){return lJ(eg(t,li(e.encode)))})},readonlyNonEmptyArray:function(e,t){return void 0===t&&(t="ReadonlyNonEmptyArray<"+e.name+">"),F2(e,t)},readonlySetFromArray:function(e,t,n){return void 0===n&&(n="ReadonlySet<"+e.name+">"),F6(e,t,n)},regexp:Lt,setFromArray:F6,withEncode:function(e,t,n){return void 0===n&&(n=e.name),new jk(n,e.is,e.validate,t)},withFallback:function(e,t,n){return void 0===n&&(n="withFallback("+e.name+")"),U3(e,function(n,r){return dm(function(){return eO(t)})(e.validate(n,r))},n)},withMessage:function(e,t){return U3(e,function(n,r){return c5(function(){return[{value:n,context:r,message:t(n,r),actual:n}]})(e.validate(n,r))})},withValidate:U3},Symbol.toStringTag,{value:"Module"}))),Lf=W(F0);Object.defineProperty(FJ,"__esModule",{value:!0}),FJ.withCustomError=FJ.addType=FJ.isEmpty=FJ.objectToMap=FJ.grouped=FJ.formatDate=FJ.formatDateTime=FJ.filterDouble=FJ.refineType=FJ.nullable=void 0;let Lp=(0,$.__importStar)(FV);FJ.nullable=function(e){return Lp.union([e,Lp.null,Lp.undefined])},FJ.refineType=function(e,t,n){return new Lp.Type(t,e.is,(t,r)=>(0,F$.pipe)(e.validate(t,r),M3.either.chain(e=>n(e)?Lp.success(e):Lp.failure(t,r))),e.encode)},FJ.filterDouble=function(e){if(""===e)return null;let t=Number(e);return Number.isNaN(t)?null:t},FJ.formatDateTime=function(e){return e.toISOString().replace(/\.\d{3}Z$/,"+0000")},FJ.formatDate=function(e){return e.toISOString().replace(/T.*/,"")},FJ.grouped=function(e,t){return e.reduce((e,n,r)=>(r%t==0?e.push([n]):e[Math.floor(r/t)].push(n),e),[])},FJ.objectToMap=function(e){return new Map(Object.entries(e))},FJ.isEmpty=function(e){for(let t in e)return!1;return!0},FJ.addType=function(e,t){return(0,Lf.mapOutput)(e,e=>({...e,__TYPE__:t}))},FJ.withCustomError=function(e,t){return(0,Ld.withValidate)(e,(n,r)=>M3.either.mapLeft(e=>e.find(e=>e.message)?e:[{value:n,context:r,message:t(n,r),actual:n}])(e.validate(n,r)))},Object.defineProperty(FZ,"__esModule",{value:!0}),FZ.WidgetKey=void 0;let LA=(0,$.__importStar)(FV),Lh=RegExp("^[^<>]+$");FZ.WidgetKey=(0,FJ.refineType)(LA.string,"WidgetKey",e=>0===e.length||Lh.test(e)),Object.defineProperty(FY,"__esModule",{value:!0}),(0,$.__exportStar)(FH,FY),(0,$.__exportStar)(FG,FY),(0,$.__exportStar)(FZ,FY);var Lm={},Lg={},Ly={},Lv={},Lx={};Object.defineProperty(Lx,"__esModule",{value:!0}),Lx.clone=void 0,Lx.clone=function(e){var t=Object.create(Object.getPrototypeOf(e));return Object.assign(t,e),t};var Lb=P&&P.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),LC=P&&P.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),LS=P&&P.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&Lb(t,e,n);return LC(t,e),t};Object.defineProperty(Lv,"__esModule",{value:!0}),Lv.withValidate=void 0;var Lw=LS(FV);Lv.withValidate=function(e,t,n){void 0===n&&(n=e.name);var r=Lx.clone(e);return r.validate=t,r.decode=function(e){return t(e,Lw.getDefaultContext(r))},r.name=n,r};var LI=P&&P.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),L_=P&&P.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),LT=P&&P.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&LI(t,e,n);return L_(t,e),t};Object.defineProperty(Ly,"__esModule",{value:!0}),Ly.withFallback=void 0;var LO=LT(FV);Ly.withFallback=function(e,t,n){return void 0===n&&(n="withFallback("+e.name+")"),Lv.withValidate(e,function(n,r){return M9.orElse(function(){return LO.success(t)})(e.validate(n,r))},n)};var LR={},Lk={};Object.defineProperty(Lk,"__esModule",{value:!0}),Lk.EmptyArray=Lk.EmptyObject=Lk.Boolean=Lk.NumberOrNull=Lk.Number=Lk.StringOrNull=Lk.String=void 0;let LE=(0,$.__importStar)(FV);Lk.String=(0,FJ.withCustomError)(LE.string,()=>"The value must be a string"),Lk.StringOrNull=(0,FJ.withCustomError)(LE.union([LE.string,LE.null]),()=>"The value must be a string or null"),Lk.Number=(0,FJ.withCustomError)(LE.number,()=>"The value must be a number"),Lk.NumberOrNull=(0,FJ.withCustomError)(LE.union([LE.number,LE.null]),()=>"The value must be a number or null"),Lk.Boolean=(0,FJ.withCustomError)(LE.boolean,()=>"The value must be a boolean"),Lk.EmptyObject=LE.UnknownRecord.pipe(new LE.Type("emptyObject",e=>LE.UnknownRecord.is(e),(e,t)=>Object.keys(e).length>0?LE.failure(e,t,"The object is not empty."):LE.success({}),LE.identity)),Lk.EmptyArray=new LE.Type("emptyArray",e=>LE.UnknownArray.is(e)&&0===e.length,(e,t)=>(0,M8.pipe)(LE.UnknownArray.decode(e),M3.either.chain(n=>n.length>0?LE.failure(e,t,"The array is not empty."):LE.success([]))),()=>[]);var LM={};let Lj=W(dM);var LF={};Object.defineProperty(LF,"__esModule",{value:!0});let LU=(0,$.__importStar)(FV);LF.default=new LU.Type("dateFromStringOrNumber",e=>e instanceof Date,(e,t)=>(0,F$.pipe)(LU.union([LU.number,LU.string]).validate(e,t),(0,Lj.chain)(n=>{let r=new Date(n);return isNaN(r.getTime())?LU.failure(e,t):LU.success(r)})),e=>e);var LL={};Object.defineProperty(LL,"__esModule",{value:!0});let LK=(0,$.__importStar)(FV);LL.default=new LK.Type("dateFromTsMs",e=>e instanceof Date,(e,t)=>(0,F$.pipe)(LK.number.validate(e,t),(0,Lj.chain)(n=>{let r=new Date(n);return isNaN(r.getTime())?LK.failure(e,t):LK.success(r)})),e=>e.getTime());var LB={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.EmptyArrayOrElse=e.EmptyObjectOrElse=e.NullOrElse=e.DefaultOrElse=void 0;let t=(0,$.__importStar)(FV);e.DefaultOrElse=e=>n=>new t.Type(`DefaultOrElse<${e.name}, ${n.name}>`,e=>null===e||n.is(e),(r,i)=>(0,M9.isRight)(e.validate(r,i))?t.success(null):n.validate(r,i),e=>e?n.encode(e):void 0),e.NullOrElse=n=>(0,e.DefaultOrElse)(t.null)(n),e.EmptyObjectOrElse=t=>(0,e.DefaultOrElse)(Lk.EmptyObject)(t),e.EmptyArrayOrElse=t=>(0,e.DefaultOrElse)(Lk.EmptyArray)(t)}(LB);var LP={};Object.defineProperty(LP,"__esModule",{value:!0});let LW=(0,$.__importStar)(FV);LP.default=new LW.Type("IntFromNumber",LW.Int.is,(e,t)=>(0,F$.pipe)(LW.number.validate(e,t),(0,Lj.chain)(e=>LW.Int.is(e)?LW.success(e):LW.success(Math.round(e)))),LW.Int.encode);var LD={};Object.defineProperty(LD,"__esModule",{value:!0});let LN=(0,$.__importStar)(FV),Lq=/^([0-9]+)px$/;LD.default=new LN.Type("IntFromPixels",LN.Int.is,(e,t)=>(0,F$.pipe)(LN.string.validate(e,t),(0,Lj.chain)(n=>{try{let r=n.match(Lq);if(!r)return LN.failure(e,t);let i=parseInt(r[1]);return LN.success(i)}catch{return LN.failure(e,t)}})),String);var LQ={};Object.defineProperty(LQ,"__esModule",{value:!0});let LV=(0,$.__importStar)(FV);LQ.default=(0,FJ.withCustomError)((0,FJ.refineType)(LV.string,"nonEmptyString",e=>e.trim().length>0),()=>"The value must be a non-empty string");var Lz={},LY={};Object.defineProperty(LY,"__esModule",{value:!0});let LH=(0,$.__importStar)(FV);LY.default=(0,FJ.nullable)(LH.string),Object.defineProperty(Lz,"__esModule",{value:!0});let LG=(0,$.__importDefault)(LY);Lz.default=new FV.Type("nonEmptyStringOrNull",e=>"string"==typeof e||null===e,(e,t)=>(0,F$.pipe)(LG.default.validate(e,t),(0,Lj.chain)(e=>"string"==typeof e&&e.length>0?(0,FV.success)(e):(0,FV.success)(null))),e=>e);var LZ={};Object.defineProperty(LZ,"__esModule",{value:!0});let LJ=(0,$.__importStar)(FV);LZ.default=(0,FJ.nullable)(LJ.number);var L$={};Object.defineProperty(L$,"__esModule",{value:!0});let LX=(0,$.__importStar)(FV);L$.default=(e,t,n)=>Lk.Number.pipe(new LX.Type("numberInRange",e=>Lk.Number.is(e),(r,i)=>r>t||r<e?LX.failure(r,i,`${n} must be a number between ${e} and ${t}`):LX.success(r),LX.identity));var L0={};Object.defineProperty(L0,"__esModule",{value:!0});let L1=(0,$.__importStar)(FV);L0.default=new L1.Type("StringFromInt",L1.string.is,(e,t)=>(0,F$.pipe)(L1.boolean.validate(e,t),(0,Lj.chain)(e=>L1.success(e.toString()))),e=>e);var L2={};Object.defineProperty(L2,"__esModule",{value:!0});let L6=(0,$.__importStar)(FV);function L5(){var e;return BS||(BS=1,Object.defineProperty(LR,"__esModule",{value:!0}),LR.StringOrNull=LR.StringFromNumber=LR.StringFromBoolean=LR.NumberRange=LR.NumberOrNull=LR.NonEmptyStringOrNull=LR.NonEmptyString=LR.IntFromPixels=LR.IntFromNumber=LR.Function=LR.DateFromTsMs=LR.DateFromStringOrNumber=LR.DateFromString=void 0,(0,$.__exportStar)(Lk,LR),e=function(){if(BC)return LM;BC=1,Object.defineProperty(LM,"__esModule",{value:!0});let e=(0,$.__importStar)(FV),t=L5();return LM.default=new e.Type("dateFromString",e=>e instanceof Date,(n,r)=>(0,F$.pipe)(t.String.validate(n,r),(0,Lj.chain)(t=>{let i=new Date(t);return isNaN(i.getTime())?e.failure(n,r):e.success(i)})),e=>e.toISOString()),LM}(),Object.defineProperty(LR,"DateFromString",{enumerable:!0,get:function(){return(0,$.__importDefault)(e).default}}),Object.defineProperty(LR,"DateFromStringOrNumber",{enumerable:!0,get:function(){return(0,$.__importDefault)(LF).default}}),Object.defineProperty(LR,"DateFromTsMs",{enumerable:!0,get:function(){return(0,$.__importDefault)(LL).default}}),(0,$.__exportStar)(LB,LR),LR.Function=(0,$.__importStar)(FJ),Object.defineProperty(LR,"IntFromNumber",{enumerable:!0,get:function(){return(0,$.__importDefault)(LP).default}}),Object.defineProperty(LR,"IntFromPixels",{enumerable:!0,get:function(){return(0,$.__importDefault)(LD).default}}),Object.defineProperty(LR,"NonEmptyString",{enumerable:!0,get:function(){return(0,$.__importDefault)(LQ).default}}),Object.defineProperty(LR,"NonEmptyStringOrNull",{enumerable:!0,get:function(){return(0,$.__importDefault)(Lz).default}}),Object.defineProperty(LR,"NumberOrNull",{enumerable:!0,get:function(){return(0,$.__importDefault)(LZ).default}}),Object.defineProperty(LR,"NumberRange",{enumerable:!0,get:function(){return(0,$.__importDefault)(L$).default}}),Object.defineProperty(LR,"StringFromBoolean",{enumerable:!0,get:function(){return(0,$.__importDefault)(L0).default}}),Object.defineProperty(LR,"StringFromNumber",{enumerable:!0,get:function(){return(0,$.__importDefault)(L2).default}}),Object.defineProperty(LR,"StringOrNull",{enumerable:!0,get:function(){return(0,$.__importDefault)(LY).default}})),LR}L2.default=new L6.Type("StringFromInt",L6.string.is,(e,t)=>(0,F$.pipe)(L6.number.validate(e,t),(0,Lj.chain)(e=>L6.success(e.toString()))),e=>e);var L3={},L9={},L4={},L7={},L8={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.BooleanField=e.BooleanConfig=e.BooleanFieldType=void 0;let t=(0,$.__importStar)(FV),n=L5();e.BooleanFieldType="Boolean",e.BooleanConfig=t.exact(t.partial({label:n.StringOrNull,default_value:t.boolean,placeholder_true:t.string,placeholder_false:t.string})),e.BooleanField=t.exact(t.intersection([t.type({type:t.literal(e.BooleanFieldType)}),t.partial({config:e.BooleanConfig})]))}(L8);var Ke={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Color=e.ColorConfig=e.ColorFieldType=void 0;let t=(0,$.__importStar)(FV),n=L5();e.ColorFieldType="Color",e.ColorConfig=t.exact(t.partial({label:n.StringOrNull,placeholder:t.string})),e.Color=t.exact(t.intersection([t.type({type:t.literal(e.ColorFieldType)}),t.partial({fieldset:n.StringOrNull,config:e.ColorConfig})]))}(Ke);var Kt={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Date=e.DateConfig=e.DateFieldType=void 0;let t=(0,$.__importStar)(FV),n=L5();e.DateFieldType="Date",e.DateConfig=t.exact(t.partial({label:n.StringOrNull,placeholder:t.string,default:t.string})),e.Date=t.exact(t.intersection([t.type({type:t.literal(e.DateFieldType)}),t.partial({fieldset:n.StringOrNull,config:e.DateConfig})]))}(Kt);var Kn={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Embed=e.EmbedConfig=e.EmbedFieldType=void 0;let t=(0,$.__importStar)(FV),n=L5();e.EmbedFieldType="Embed",e.EmbedConfig=t.exact(t.partial({label:n.StringOrNull,placeholder:t.string,useAsTitle:t.boolean})),e.Embed=t.exact(t.intersection([t.type({type:t.literal(e.EmbedFieldType)}),t.partial({fieldset:n.StringOrNull,config:e.EmbedConfig})]))}(Kn);var Kr={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.GeoPoint=e.GeoPointConfig=e.GeoPointFieldType=void 0;let t=(0,$.__importStar)(FV),n=L5();e.GeoPointFieldType="GeoPoint",e.GeoPointConfig=t.exact(t.partial({label:n.StringOrNull})),e.GeoPoint=t.exact(t.intersection([t.type({type:t.literal(e.GeoPointFieldType)}),t.partial({fieldset:n.StringOrNull,config:e.GeoPointConfig})]))}(Kr);var Ki={},Ko={},Ka={},Ku={},Ks={};Object.defineProperty(Ks,"__esModule",{value:!0}),Ks.pipe=Ks.pipeable=void 0,Ks.pipeable=function(e){var t={};return"function"==typeof e.map&&(t.map=function(t){return function(n){return e.map(n,t)}}),"function"==typeof e.contramap&&(t.contramap=function(t){return function(n){return e.contramap(n,t)}}),"function"==typeof e.mapWithIndex&&(t.mapWithIndex=function(t){return function(n){return e.mapWithIndex(n,t)}}),"function"==typeof e.ap&&(t.ap=function(t){return function(n){return e.ap(n,t)}},t.apFirst=function(t){return function(n){return e.ap(e.map(n,function(e){return function(){return e}}),t)}},t.apSecond=function(t){return function(n){return e.ap(e.map(n,function(){return function(e){return e}}),t)}}),"function"==typeof e.chain&&(t.chain=function(t){return function(n){return e.chain(n,t)}},t.chainFirst=function(t){return function(n){return e.chain(n,function(n){return e.map(t(n),function(){return n})})}},t.flatten=function(t){return e.chain(t,M8.identity)}),"function"==typeof e.bimap&&(t.bimap=function(t,n){return function(r){return e.bimap(r,t,n)}},t.mapLeft=function(t){return function(n){return e.mapLeft(n,t)}}),"function"==typeof e.extend&&(t.extend=function(t){return function(n){return e.extend(n,t)}},t.duplicate=function(t){return e.extend(t,M8.identity)}),"function"==typeof e.reduce&&(t.reduce=function(t,n){return function(r){return e.reduce(r,t,n)}},t.foldMap=function(t){var n=e.foldMap(t);return function(e){return function(t){return n(t,e)}}},t.reduceRight=function(t,n){return function(r){return e.reduceRight(r,t,n)}}),"function"==typeof e.reduceWithIndex&&(t.reduceWithIndex=function(t,n){return function(r){return e.reduceWithIndex(r,t,n)}},t.foldMapWithIndex=function(t){var n=e.foldMapWithIndex(t);return function(e){return function(t){return n(t,e)}}},t.reduceRightWithIndex=function(t,n){return function(r){return e.reduceRightWithIndex(r,t,n)}}),"function"==typeof e.alt&&(t.alt=function(t){return function(n){return e.alt(n,t)}}),"function"==typeof e.compact&&(t.compact=e.compact,t.separate=e.separate),"function"==typeof e.filter&&(t.filter=function(t){return function(n){return e.filter(n,t)}},t.filterMap=function(t){return function(n){return e.filterMap(n,t)}},t.partition=function(t){return function(n){return e.partition(n,t)}},t.partitionMap=function(t){return function(n){return e.partitionMap(n,t)}}),"function"==typeof e.filterWithIndex&&(t.filterWithIndex=function(t){return function(n){return e.filterWithIndex(n,t)}},t.filterMapWithIndex=function(t){return function(n){return e.filterMapWithIndex(n,t)}},t.partitionWithIndex=function(t){return function(n){return e.partitionWithIndex(n,t)}},t.partitionMapWithIndex=function(t){return function(n){return e.partitionMapWithIndex(n,t)}}),"function"==typeof e.promap&&(t.promap=function(t,n){return function(r){return e.promap(r,t,n)}}),"function"==typeof e.compose&&(t.compose=function(t){return function(n){return e.compose(n,t)}}),"function"==typeof e.throwError&&(t.fromOption=function(t){return function(n){return"None"===n._tag?e.throwError(t()):e.of(n.value)}},t.fromEither=function(t){return"Left"===t._tag?e.throwError(t.left):e.of(t.right)},t.fromPredicate=function(t,n){return function(r){return t(r)?e.of(r):e.throwError(n(r))}},t.filterOrElse=function(t,n){return function(r){return e.chain(r,function(r){return t(r)?e.of(r):e.throwError(n(r))})}}),t},Ks.pipe=M8.pipe;var Kl=P&&P.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),Kc=P&&P.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Kd=P&&P.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&Kl(t,e,n);return Kc(t,e),t};Object.defineProperty(Ku,"__esModule",{value:!0}),Ku.NumberFromString=void 0;var Kf=Kd(FV);Ku.NumberFromString=new Kf.Type("NumberFromString",Kf.number.is,function(e,t){return Ks.pipe(Kf.string.validate(e,t),M9.chain(function(n){var r=+n;return isNaN(r)||""===n.trim()?Kf.failure(e,t):Kf.success(r)}))},String);var Kp=P&&P.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),KA=P&&P.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Kh=P&&P.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&Kp(t,e,n);return KA(t,e),t};Object.defineProperty(Ka,"__esModule",{value:!0}),Ka.IntFromString=void 0;var Km=Kh(FV);Ka.IntFromString=new Km.Type("IntFromString",Km.Int.is,function(e,t){return Ks.pipe(Ku.NumberFromString.validate(e,t),M9.chain(function(n){return Km.Int.is(n)?Km.success(n):Km.failure(e,t)}))},Ku.NumberFromString.encode),Object.defineProperty(Ko,"__esModule",{value:!0});let Kg=(0,$.__importStar)(FV),Ky=L5(),Kv=new Kg.Type("SideConstraints",e=>!e||"number"==typeof e,(e,t)=>M9.either.chain(Kg.union([Kg.literal("auto"),Kg.literal(""),Kg.Int,Ka.IntFromString,Ky.IntFromNumber,Ky.IntFromPixels,Kg.null]).validate(e,t),e=>"auto"===e||""===e?Kg.success(null):Kg.success(e)),e=>e),Kx=Kg.partial({width:Kv,height:Kv});Ko.default=Kx,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Image=e.ImageConfig=e.Thumbnail=e.ImageFieldType=void 0;let t=(0,$.__importStar)(FV),n=L5(),r=(0,$.__importDefault)(Ko);e.ImageFieldType="Image",e.Thumbnail=t.exact(t.intersection([t.type({name:t.string}),r.default])),e.ImageConfig=t.exact(t.partial({label:n.StringOrNull,placeholder:t.string,constraint:r.default,thumbnails:t.readonlyArray(e.Thumbnail)})),e.Image=t.exact(t.intersection([t.type({type:t.literal(e.ImageFieldType)}),t.partial({fieldset:n.StringOrNull,config:e.ImageConfig})]))}(Ki);var Kb={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.IntegrationField=e.IntegrationFieldConfig=e.IntegrationFieldType=void 0;let t=(0,$.__importStar)(FV),n=L5();e.IntegrationFieldType="IntegrationFields",e.IntegrationFieldConfig=t.exact(t.partial({label:n.StringOrNull,placeholder:t.string,catalog:t.string})),e.IntegrationField=t.exact(t.intersection([t.type({type:t.literal(e.IntegrationFieldType)}),t.partial({fieldset:n.StringOrNull,config:e.IntegrationFieldConfig})]))}(Kb);var KC={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Link=e.LinkConfig=e.LinkFieldType=void 0;let t=(0,$.__importStar)(FV),n=L5(),r=e=>{if(e instanceof Array&&e.reduce((e,t)=>e&&"string"==typeof t,!0))return t.success(e)},i=e=>{if("string"==typeof e)return t.success([e])},o=new t.Type("MasksArrayString",e=>e instanceof Array,(e,n)=>M9.either.chain(t.union([t.array(t.string),t.string]).validate(e,n),o=>r(o)||i(o)||t.failure(e,n)),e=>e);e.LinkFieldType="Link",e.LinkConfig=t.exact(t.partial({label:n.StringOrNull,useAsTitle:t.boolean,placeholder:t.string,select:(0,Ly.withFallback)(t.union([t.literal("media"),t.literal("document"),t.literal("web"),t.null]),null),customtypes:t.readonlyArray(t.string),masks:o,tags:o,allowTargetBlank:t.boolean})),e.Link=t.exact(t.intersection([t.type({type:t.literal(e.LinkFieldType)}),t.partial({fieldset:n.StringOrNull,config:e.LinkConfig})]))}(KC);var KS={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Number=e.NumberConfig=e.NumberFieldType=void 0;let t=(0,$.__importStar)(FV),n=L5();e.NumberFieldType="Number",e.NumberConfig=t.exact(t.partial({label:n.StringOrNull,placeholder:t.string,min:t.union([t.number,Ku.NumberFromString]),max:t.union([t.number,Ku.NumberFromString]),step:t.union([t.number,Ku.NumberFromString])})),e.Number=t.exact(t.intersection([t.type({type:t.literal(e.NumberFieldType)}),t.partial({fieldset:n.StringOrNull,config:e.NumberConfig})]))}(KS);var Kw={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Range=e.RangeConfig=e.RangeFieldType=void 0;let t=(0,$.__importStar)(FV),n=L5();e.RangeFieldType="Range",e.RangeConfig=t.exact(t.partial({label:n.StringOrNull,placeholder:t.string,min:t.union([t.number,Ku.NumberFromString]),max:t.union([t.number,Ku.NumberFromString]),step:t.union([t.number,Ku.NumberFromString])})),e.Range=t.exact(t.intersection([t.type({type:t.literal(e.RangeFieldType)}),t.partial({fieldset:n.StringOrNull,config:e.RangeConfig})]))}(Kw);var KI={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.RichText=e.RichTextConfig=e.RichTextNodeTypeCodec=e.RichTextNodeType=e.DEFAULT_OPTION=e.RichTextFieldType=void 0;let t=(0,$.__importStar)(FV),n=L5(),r=(0,$.__importDefault)(Ko);e.RichTextFieldType="StructuredText",e.DEFAULT_OPTION="paragraph",e.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"},e.RichTextNodeTypeCodec=t.keyof({[e.RichTextNodeType.heading1]:null,[e.RichTextNodeType.heading2]:null,[e.RichTextNodeType.heading3]:null,[e.RichTextNodeType.heading4]:null,[e.RichTextNodeType.heading5]:null,[e.RichTextNodeType.heading6]:null,[e.RichTextNodeType.paragraph]:null,[e.RichTextNodeType.strong]:null,[e.RichTextNodeType.em]:null,[e.RichTextNodeType.preformatted]:null,[e.RichTextNodeType.hyperlink]:null,[e.RichTextNodeType.image]:null,[e.RichTextNodeType.embed]:null,[e.RichTextNodeType.list]:null,[e.RichTextNodeType.orderedList]:null,[e.RichTextNodeType.rtl]:null});let i=new t.Type("RichTextOptions",e=>"string"==typeof e,n=>(0,M8.pipe)(t.union([t.string,t.null]).decode(n),M3.either.map(t=>{if(!t)return e.DEFAULT_OPTION;let n=t.split(",").map(e=>e.trim()).filter(t=>(0,M9.getOrElseW)(()=>{})(e.RichTextNodeTypeCodec.decode(t)));return n.length?n.join(","):e.DEFAULT_OPTION})),e=>e),o=e=>{if(!e)return t.success([])},a=e=>{if(e instanceof Object){if(!Object.entries(e).length)return t.success([]);if(e[""])return t.success(e[""].map(e=>e.name));let n=Object.entries(e).reduce((e,[,t])=>e.concat(t.map(e=>e.name)),[]).filter(Boolean);return t.success(n)}},u=e=>{if(e instanceof Array&&e.reduce((e,t)=>e&&"string"==typeof t,!0))return t.success(e)},s=e=>{if("string"==typeof e)return t.success([e])},l=new t.Type("RichTextLabels",e=>e instanceof Array,(e,n)=>{let r=t.record(t.string,t.readonlyArray(t.record(t.literal("name"),t.string))),i=t.readonlyArray(t.string);return(0,M8.pipe)(t.union([r,i,t.string,t.null]).decode(e),M3.either.chain(r=>o(r)||u(r)||a(r)||s(r)||t.failure(e,n)))},e=>e);e.RichTextConfig=t.exact(t.partial({label:n.StringOrNull,placeholder:t.string,useAsTitle:t.boolean,single:i,multi:i,imageConstraint:r.default,labels:l,allowTargetBlank:t.boolean})),e.RichText=t.exact(t.intersection([t.type({type:t.literal(e.RichTextFieldType)}),t.partial({fieldset:n.StringOrNull,config:e.RichTextConfig})]))}(KI);var K_={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Select=e.SelectConfig=e.SelectFieldType=void 0;let t=(0,$.__importStar)(FV),n=L5();e.SelectFieldType="Select",e.SelectConfig=t.exact(t.partial({label:n.StringOrNull,placeholder:t.string,default_value:t.string,options:t.readonlyArray(t.union([t.string,n.StringFromNumber,n.StringFromBoolean]))})),e.Select=t.exact(t.intersection([t.type({type:t.literal(e.SelectFieldType)}),t.partial({fieldset:n.StringOrNull,config:e.SelectConfig})]))}(K_);var KT={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Separator=e.SeparatorConfig=e.SeparatorFieldType=void 0;let t=(0,$.__importStar)(FV),n=L5();e.SeparatorFieldType="Separator",e.SeparatorConfig=t.exact(t.partial({label:n.StringOrNull})),e.Separator=t.exact(t.intersection([t.type({type:t.literal(e.SeparatorFieldType)}),t.partial({config:e.SeparatorConfig})]))}(KT);var KO={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Text=e.TextConfig=e.TextFieldType=void 0;let t=(0,$.__importStar)(FV),n=L5();e.TextFieldType="Text",e.TextConfig=t.exact(t.partial({label:n.StringOrNull,useAsTitle:t.boolean,placeholder:t.string})),e.Text=t.exact(t.intersection([t.type({type:t.literal(e.TextFieldType)}),t.partial({fieldset:n.StringOrNull,config:e.TextConfig})]))}(KO);var KR={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Timestamp=e.TimestampConfig=e.TimestampFieldType=void 0;let t=(0,$.__importStar)(FV),n=L5();e.TimestampFieldType="Timestamp",e.TimestampConfig=t.exact(t.partial({label:n.StringOrNull,placeholder:t.string,default:t.string})),e.Timestamp=t.exact(t.intersection([t.type({type:t.literal(e.TimestampFieldType)}),t.partial({fieldset:n.StringOrNull,config:e.TimestampConfig})]))}(KR),Object.defineProperty(L7,"__esModule",{value:!0}),L7.NestableWidget=void 0;let Kk=(0,$.__importStar)(FV);L7.NestableWidget=Kk.union([Ke.Color,L8.BooleanField,Kn.Embed,Kr.GeoPoint,Kt.Date,KS.Number,Kw.Range,KI.RichText,K_.Select,KT.Separator,KO.Text,KR.Timestamp,KC.Link,Ki.Image,Kb.IntegrationField]),function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Group=e.GroupConfig=e.NestedGroup=e.NestedGroupConfig=e.GroupFieldType=void 0;let t=(0,$.__importStar)(FV),n=L5();e.GroupFieldType="Group";let r=e=>t.exact(t.partial({label:n.StringOrNull,repeat:t.boolean,fields:t.record(FY.WidgetKey,e)})),i=i=>t.exact(t.intersection([t.type({type:t.literal(e.GroupFieldType)}),t.partial({fieldset:n.StringOrNull,icon:t.string,description:t.string,config:r(i)})]));e.NestedGroupConfig=r(L7.NestableWidget),e.NestedGroup=i(L7.NestableWidget),e.GroupConfig=r(t.union([L7.NestableWidget,e.NestedGroup])),e.Group=i(t.union([L7.NestableWidget,e.NestedGroup]))}(L4);var KE={};Object.defineProperty(KE,"__esModule",{value:!0}),(0,$.__exportStar)(L8,KE),(0,$.__exportStar)(Ke,KE),(0,$.__exportStar)(Kt,KE),(0,$.__exportStar)(Kn,KE),(0,$.__exportStar)(Kr,KE),(0,$.__exportStar)(Ki,KE),(0,$.__exportStar)(Kb,KE),(0,$.__exportStar)(KC,KE),(0,$.__exportStar)(L7,KE),(0,$.__exportStar)(KS,KE),(0,$.__exportStar)(Kw,KE),(0,$.__exportStar)(KI,KE),(0,$.__exportStar)(K_,KE),(0,$.__exportStar)(KT,KE),(0,$.__exportStar)(KO,KE),(0,$.__exportStar)(KR,KE);var KM={},Kj={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.isCompositeSlice=e.CompositeSlice=e.CompositeSliceConfig=e.CompositeSliceType=void 0;let t=(0,$.__importStar)(FV),n=L5();e.CompositeSliceType="Slice",e.CompositeSliceConfig=t.exact(t.partial({label:n.StringOrNull})),e.CompositeSlice=t.exact(t.intersection([t.type({type:t.literal(e.CompositeSliceType)}),t.partial({fieldset:n.StringOrNull,description:t.string,icon:t.string,display:t.string,"non-repeat":t.record(FY.WidgetKey,L7.NestableWidget),repeat:t.record(FY.WidgetKey,L7.NestableWidget),config:e.CompositeSliceConfig})])),e.isCompositeSlice=function(e){return"Slice"===e.type}}(Kj);var KF={};Object.defineProperty(KF,"__esModule",{value:!0}),KF.isLegacySlice=KF.LegacySlice=void 0;let KU=(0,$.__importStar)(FV);KF.LegacySlice=KU.union([L7.NestableWidget,L4.NestedGroup]),KF.isLegacySlice=function(e){return"Slice"!==e.type&&"SharedSlice"!==e.type};var KL={},KK={};Object.defineProperty(KK,"__esModule",{value:!0}),KK.isSlicePrimaryWidget=KK.SlicePrimaryWidget=void 0;let KB=(0,$.__importStar)(FV);KK.SlicePrimaryWidget=KB.union([KE.NestableWidget,L4.Group]),KK.isSlicePrimaryWidget=e=>KE.NestableWidget.is(e)||L4.Group.is(e),function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.isDynamicSharedSlice=e.isStaticSharedSlice=e.SharedSlice=e.SharedSliceType=e.Variation=void 0;let t=(0,$.__importStar)(FV);e.Variation=t.exact(t.intersection([t.type({id:t.string,name:t.string,description:t.string,imageUrl:(0,Ly.withFallback)(t.string,"https://images.prismic.io/slice-machine/621a5ec4-0387-4bc5-9860-2dd46cbc07cd_default_ss.png?auto=compress,format"),docURL:t.string,version:t.string}),t.partial({display:t.string,primary:t.record(FY.WidgetKey,KK.SlicePrimaryWidget),items:t.record(FY.WidgetKey,L7.NestableWidget)})])),e.SharedSliceType="SharedSlice";let n=t.string,r=t.string;e.SharedSlice=t.exact(t.intersection([t.type({id:t.string,type:t.literal(e.SharedSliceType),name:t.string,variations:t.readonlyArray(e.Variation)}),t.partial({description:t.string,legacyPaths:t.record(n,r)})])),e.isStaticSharedSlice=function(e){return"SharedSlice"===e.type},e.isDynamicSharedSlice=function(e){return"SharedSlice"===e.type}}(KL);var KP={};Object.defineProperty(KP,"__esModule",{value:!0}),KP.SharedSliceRef=void 0;let KW=(0,$.__importStar)(FV);KP.SharedSliceRef=KW.exact(KW.type({type:KW.literal(KL.SharedSliceType)})),function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Slices=e.DynamicSlices=e.StaticSlices=e.slicesReader=e.DynamicSlicesConfig=e.StaticSlicesConfig=e.slicesConfigReader=e.SlicesLabels=e.SlicesFieldType=e.LegacySlicesFieldType=void 0;let t=(0,$.__importStar)(FV),n=L5();function r(r){return t.exact(t.partial({label:n.StringOrNull,labels:e.SlicesLabels,choices:t.record(FY.WidgetKey,t.union([KF.LegacySlice,Kj.CompositeSlice,r]))}))}e.LegacySlicesFieldType="Choice",e.SlicesFieldType="Slices",e.SlicesLabels=t.union([t.record(t.string,t.readonlyArray(t.exact(t.intersection([t.type({name:t.string}),t.partial({display:t.string})])))),t.null]),e.slicesConfigReader=r,e.StaticSlicesConfig=r(KL.SharedSlice),e.DynamicSlicesConfig=r(KP.SharedSliceRef);let i={toStatic(e,t){let n=Object.entries(e.choices||{}).reduce((e,[n,r])=>{if("SharedSlice"!==r.type)return{...e,[n]:r};{let r=t.get(n);return r?{...e,[n]:r}:e}},{});return{...e,choices:n}}};function o(r){return t.exact(t.intersection([t.type({type:t.keyof({[e.SlicesFieldType]:null,[e.LegacySlicesFieldType]:null})}),t.partial({fieldset:n.StringOrNull,config:r})]))}e.slicesReader=o,e.StaticSlices=o(e.StaticSlicesConfig),e.DynamicSlices=o(e.DynamicSlicesConfig),e.Slices={toStatic:(e,t)=>e.config?{...e,config:i.toStatic(e.config,t)}:e}}(KM);var KD={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.UID=e.UIDConfig=e.UIDFieldType=void 0;let t=(0,$.__importStar)(FV),n=L5();e.UIDFieldType="UID",e.UIDConfig=t.exact(t.partial({label:n.StringOrNull,useAsTitle:t.boolean,placeholder:t.string})),e.UID=t.exact(t.intersection([t.type({type:t.literal(e.UIDFieldType)}),t.partial({fieldset:n.StringOrNull,config:e.UIDConfig})]))}(KD),Object.defineProperty(L9,"__esModule",{value:!0}),L9.Widgets=L9.FieldType=L9.DynamicWidget=L9.StaticWidget=L9.widgetReader=void 0;let KN=(0,$.__importStar)(FV);function Kq(e){return KN.union([KD.UID,L7.NestableWidget,L4.Group,e])}L9.widgetReader=Kq,L9.StaticWidget=Kq(KM.StaticSlices),L9.DynamicWidget=Kq(KM.DynamicSlices),L9.FieldType=KN.keyof({[KE.ColorFieldType]:null,[KE.BooleanFieldType]:null,[KE.NumberFieldType]:null,[KE.EmbedFieldType]:null,[KE.GeoPointFieldType]:null,[KE.DateFieldType]:null,[KE.RangeFieldType]:null,[KE.RichTextFieldType]:null,[KE.SelectFieldType]:null,[KE.SeparatorFieldType]:null,[KE.TextFieldType]:null,[KE.TimestampFieldType]:null,[KE.LinkFieldType]:null,[KE.ImageFieldType]:null,[KE.IntegrationFieldType]:null,[KD.UIDFieldType]:null,[L4.GroupFieldType]:null,[KM.SlicesFieldType]:null,[KM.LegacySlicesFieldType]:null}),L9.Widgets={toStatic(e,t){switch(e.type){case"Choice":case"Slices":return KM.Slices.toStatic(e,t);default:return e}}},Object.defineProperty(L3,"__esModule",{value:!0}),L3.Sections=L3.DynamicSection=L3.StaticSection=L3.sectionReader=void 0;let KQ=(0,$.__importStar)(FV);function KV(e){return KQ.record(FY.WidgetKey,e)}L3.sectionReader=KV,L3.StaticSection=KV(L9.StaticWidget),L3.DynamicSection=KV(L9.DynamicWidget),L3.Sections={toStatic:(e,t)=>Object.entries(e).reduce((e,[n,r])=>({...e,[n]:L9.Widgets.toStatic(r,t)}),{})},function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.collectSharedSlices=e.flattenCustomTypeFields=e.filterMissingSharedSlices=e.collectWidgets=e.validateSlices=e.toStatic=e.flattenSections=e.flattenWidgets=e.CustomType=e.StaticCustomType=e.CustomTypeFormat=void 0;let t=(0,$.__importStar)(FV),n=L5();e.CustomTypeFormat={page:"page",custom:"custom"};class r extends Error{constructor(e){super(),Object.defineProperty(this,"slices",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"message",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.slices=e,this.message=this._formatError(e)}_formatError(e){return`The following slices doesn't exists in your Prismic repository:
|
|
3
|
-
${e.map(e=>` - ${e}`).join(`
|
|
4
|
-
`)}
|
|
5
|
-
`}}function i(r){return t.exact(t.intersection([t.type({id:t.string,label:n.StringOrNull,repeatable:(0,Ly.withFallback)(t.boolean,!0),json:t.record(t.string,r),status:(0,Ly.withFallback)(t.boolean,!0)}),t.partial({hash:t.string,format:(0,Ly.withFallback)(t.keyof(e.CustomTypeFormat),"custom")})]))}function o(e){return Object.entries(e.json).reduce((e,[,t])=>{let n=Object.entries(t);return e.concat(n)},[])}function a(e,t){let n=Object.entries(e.json).reduce((e,[n,r])=>{let i=Object.entries(r).reduce((e,[n,r])=>{let i=t(n,r);return i?{...e,[n]:i}:e},{});return{...e,[n]:i}},{});return{...e,json:n}}e.StaticCustomType=i(L3.StaticSection),e.CustomType=i(L3.DynamicSection),e.flattenWidgets=o,e.flattenSections=function(e){return Object.entries(e.json).reduce((e,[,t])=>{let n=Object.entries(t);return e.concat(n)},[])},e.toStatic=function(e,t){let n=Object.entries(e.json).reduce((e,[n,r])=>({...e,[n]:L3.Sections.toStatic(r,t)}),{});return{...e,json:n}},e.validateSlices=function(e,t){let n=(function(e){let t=o(e).filter(([,e])=>"Slices"===e.type).reduce((e,[,t])=>{let n=Object.entries(t.config&&t.config.choices?t.config.choices:{}).filter(([,e])=>"SharedSlice"===e.type).map(([e])=>e);return e.concat(n)},[]);return function(e){return t.map(e)}})(e)(e=>{if(!t.get(e))return e}).filter(Boolean);return n.length>0?(0,M9.left)(new r(n)):(0,M9.right)(e)},e.collectWidgets=a,e.filterMissingSharedSlices=function(e,t){return a(e,(e,n)=>{if("Slices"===n.type){if(!n.config||!n.config.choices)return n;let e=Object.entries(n.config.choices).reduce((e,[n,r])=>"SharedSlice"!==r.type||t.get(n)?{...e,[n]:r}:e,{}),r={...n.config,choices:e};return{...n,config:r}}return n})},e.flattenCustomTypeFields=function(e){return Object.values(e.json).reduce((e,t)=>({...e,...t}),{})},e.collectSharedSlices=function(e){return Object.entries(e.fields).reduce((e,[,t])=>{var n;return"Slices"===t.type||"Choice"===t.type?{...e,...Object.entries((null===(n=t.config)||void 0===n?void 0:n.choices)||{}).reduce((e,[t,n])=>"SharedSlice"===n.type?{...e,[t]:n}:e,{})}:e},{})}}(Lg);var Kz={},KY={};Object.defineProperty(KY,"__esModule",{value:!0}),KY.DiffOperation=void 0,(By=KY.DiffOperation||(KY.DiffOperation={})).Added="added",By.Removed="removed",By.Updated="updated";var KH={},KG={},KZ={};Object.defineProperty(KZ,"__esModule",{value:!0}),KZ.HexaColor=void 0;let KJ=/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/;KZ.HexaColor={is:e=>KJ.test(e)};var K$={};Object.defineProperty(K$,"__esModule",{value:!0}),K$.toRecord=void 0,K$.toRecord=function(e,t){return e.reduce((e,n)=>{let r=t(n);return{...e,[r]:n}},{})};var KX={};Object.defineProperty(KX,"__esModule",{value:!0}),KX.mapValues=KX.isObject=KX.withOptionals=KX.isNotEmpty=KX.zipObjects=void 0;let K0=(0,$.__importStar)(FV);KX.zipObjects=function(e,t){return[...new Set(Object.keys(e||{}).concat(Object.keys(t||{})))].reduce((n,r)=>{let i=null==e?void 0:e[r],o=null==t?void 0:t[r];return{...n,[r]:{left:i,right:o}}},{})},KX.isNotEmpty=function(e){return!!Object.keys(e).length},KX.withOptionals=function(e,t){return{...e,...t.reduce((e,[t,n])=>n?{...e,[t]:n}:e,{})}};let K1=K0.record(K0.string,K0.unknown);KX.isObject=function(e){return(0,M9.isRight)(K1.decode(e))},KX.mapValues=function(e,t){return Object.entries(e).reduce((e,[n,r])=>({...e,[n]:t(r,n)}),{})},Object.defineProperty(KG,"__esModule",{value:!0}),KG.Objects=KG.Arrays=KG.HexaColorCode=void 0,KG.HexaColorCode=(0,$.__importStar)(KZ),KG.Arrays=(0,$.__importStar)(K$),KG.Objects=(0,$.__importStar)(KX);var K2={};function K6(e,t){let n=Object.entries(KG.Objects.zipObjects(e,t)).reduce((e,[t,n])=>{if(JSON.stringify(null==n?void 0:n.left)===JSON.stringify(null==n?void 0:n.right))return e;let r=(()=>{var e,t,r,i,o,a,u;if(!(!(null!=n&&n.left)&&!(null!=n&&n.right))){if(null!=n&&n.left&&!n.right)return{op:KY.DiffOperation.Removed};if(!(null!=n&&n.left)&&null!=n&&n.right){if((null===(e=n.right)||void 0===e?void 0:e.type)===L4.GroupFieldType){let e={...n.right,config:{...n.right.config,fields:{}}};return e.config.fields=K6(void 0,null===(t=n.right.config)||void 0===t?void 0:t.fields)||{},{op:KY.DiffOperation.Added,value:e}}return{op:KY.DiffOperation.Added,value:n.right}}if((null===(r=n.right)||void 0===r?void 0:r.type)===L4.GroupFieldType){let e={...n.right,config:{...n.right.config,fields:{}}};return e.config.fields=K6((null===(i=n.left)||void 0===i?void 0:i.type)===L4.GroupFieldType?null===(a=null===(o=n.left)||void 0===o?void 0:o.config)||void 0===a?void 0:a.fields:void 0,null===(u=n.right.config)||void 0===u?void 0:u.fields)||{},{op:KY.DiffOperation.Updated,value:e}}return{op:KY.DiffOperation.Updated,value:n.right}}})();return r?{...e,[t]:r}:e},{});return KG.Objects.isNotEmpty(n)?n:void 0}Object.defineProperty(K2,"__esModule",{value:!0}),K2.VariationComparator=void 0,K2.VariationComparator={compare(e,t){if(e&&!t)return{op:KY.DiffOperation.Removed};if(!e&&t)return{op:KY.DiffOperation.Added,value:t};let n=Object.entries(KG.Objects.zipObjects(e,t)).reduce((e,[t,n])=>"primary"===t||"items"===t||(null==n?void 0:n.left)===(null==n?void 0:n.right)?e:{...e,[t]:null==n?void 0:n.right},{}),r=K6(null==e?void 0:e.primary,null==t?void 0:t.primary),i=K6(null==e?void 0:e.items,null==t?void 0:t.items),o={...n,...r?{primary:r}:{},...i?{items:i}:{}};if(KG.Objects.isNotEmpty(o))return{op:KY.DiffOperation.Updated,value:o}}},Object.defineProperty(KH,"__esModule",{value:!0}),KH.SliceComparator=void 0,KH.SliceComparator={compare(e,t){if(!e&&t)return{op:KY.DiffOperation.Added,value:t};if(e&&!t)return{op:KY.DiffOperation.Removed};let n=Object.entries(KG.Objects.zipObjects(e,t)).reduce((e,[t,n])=>"variations"===t||(null==n?void 0:n.left)===(null==n?void 0:n.right)?e:{...e,[t]:null==n?void 0:n.right},{}),r=Object.entries(KG.Objects.zipObjects(e&&KG.Arrays.toRecord(e.variations,e=>e.id),t&&KG.Arrays.toRecord(t.variations,e=>e.id))).reduce((e,[t,n])=>{if(!n)return e;let r=K2.VariationComparator.compare(n.left,n.right);return r?{...e,[t]:r}:e},{}),i={...n,...KG.Objects.isNotEmpty(r)?{variations:r}:{}};if(KG.Objects.isNotEmpty(i))return{op:KY.DiffOperation.Updated,value:i}}};var K5={};Object.defineProperty(K5,"__esModule",{value:!0}),Object.defineProperty(Kz,"__esModule",{value:!0}),(0,$.__exportStar)(KY,Kz),(0,$.__exportStar)(KH,Kz),(0,$.__exportStar)(K2,Kz),(0,$.__exportStar)(K5,Kz);var K3={},K9={};Bv=P&&P.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Object.defineProperty(K9,"__esModule",{value:!0}),K9.ImageConstraint=void 0,Object.defineProperty(K9,"ImageConstraint",{enumerable:!0,get:function(){return Bv(Ko).default}});var K4={},K7={};Object.defineProperty(K7,"__esModule",{value:!0});var K8={};Object.defineProperty(K8,"__esModule",{value:!0}),K8.SlicesTypes=void 0;let Be=(0,$.__importStar)(FV);K8.SlicesTypes=Be.keyof({[Kj.CompositeSliceType]:null,[KL.SharedSliceType]:null}),Object.defineProperty(K4,"__esModule",{value:!0}),(0,$.__exportStar)(Kj,K4),(0,$.__exportStar)(KF,K4),(0,$.__exportStar)(KL,K4),(0,$.__exportStar)(KP,K4),(0,$.__exportStar)(K7,K4),(0,$.__exportStar)(KK,K4),(0,$.__exportStar)(KM,K4),(0,$.__exportStar)(K8,K4),Object.defineProperty(K3,"__esModule",{value:!0}),(0,$.__exportStar)(L4,K3),(0,$.__exportStar)(KE,K3),(0,$.__exportStar)(K9,K3),(0,$.__exportStar)(K4,K3),(0,$.__exportStar)(KD,K3),(0,$.__exportStar)(L9,K3),Object.defineProperty(Lm,"__esModule",{value:!0}),(0,$.__exportStar)(Lg,Lm),(0,$.__exportStar)(Kz,Lm),(0,$.__exportStar)(L3,Lm),(0,$.__exportStar)(K3,Lm);var Bt,Bn,Br,Bi,Bo,Ba,Bu,Bs,Bl,Bc,Bd,Bf,Bp,BA,Bh,Bm,Bg,By,Bv,Bx,Bb,BC,BS,Bw,BI={},B_={},BT={};function BO(){if(Bw)return BT;Bw=1,Object.defineProperty(BT,"__esModule",{value:!0}),BT.hasContentType=BT.hasFieldContentType=void 0;let e=Wn();function t(e){return"object"==typeof e&&null!==e&&"__TYPE__"in e}return BT.hasFieldContentType=function(n){return t(n)&&n.__TYPE__===e.FieldContentType&&(null==n?void 0:n.type)!==void 0&&"string"==typeof n.type&&(0,M9.isRight)(e.FieldType.decode(n.type))},BT.hasContentType=t,BT}function BR(){return BF||(BF=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.EmptyContent=e.EmptyLegacy=e.isEmptyContent=e.EmptyContentType=void 0;let t=(0,$.__importStar)(FV),n=BO();e.EmptyContentType="EmptyContent",e.isEmptyContent=t=>(0,n.hasContentType)(t)&&t.__TYPE__===e.EmptyContentType;let r=t.union([t.null,t.type({value:t.null})]);e.EmptyLegacy=n=>new t.Type("EmptyLegacy",e.isEmptyContent,t=>(0,M8.pipe)(r.decode(t),M3.either.map(()=>({type:n,__TYPE__:e.EmptyContentType}))),()=>null),e.EmptyContent=t.strict({type:t.string,__TYPE__:t.literal(e.EmptyContentType)})}(B_)),B_}var Bk={},BE={};Object.defineProperty(BE,"__esModule",{value:!0}),BE.defaultCtx=BE.getFieldCtx=BE.LegacyContentCtx=BE.FieldOrSliceType=void 0;let BM=(0,$.__importStar)(FV);BE.FieldOrSliceType=BM.union([K3.FieldType,K3.SlicesTypes]);class Bj{constructor(e,t,n){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=e,this.fieldPath=t||[],this.allTypes=n||new Map;let r=Array.of(this.fieldPath,[this.fieldKey]).flat().join(".");this.prefixedKey=r,this.keyOfType=`${r}_TYPE`,this.fieldType=this.allTypes.get(this.prefixedKey)}}BE.LegacyContentCtx=Bj,BE.getFieldCtx=function(e,t,n){return new Bj(e,[...t.fieldPath,t.fieldKey,...n||[]],t.allTypes)},BE.defaultCtx=function(e,t=new Map){return new Bj(e,[],t)};var BF,BU,BL={},BK={};function BB(){return BU||(BU=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.BooleanContentDefaultValue=e.BooleanContent=e.BooleanLegacy=e.isBooleanContent=e.BooleanContentType=void 0;let t=(0,$.__importStar)(FV),n=BO();e.BooleanContentType="BooleanContent",e.isBooleanContent=t=>(0,n.hasContentType)(t)&&t.__TYPE__===e.BooleanContentType,e.BooleanLegacy=n=>new t.Type("BooleanLegacy",e.isBooleanContent,n=>(0,M8.pipe)(t.boolean.decode(n),M3.either.map(t=>e.BooleanContent.encode({value:t,__TYPE__:e.BooleanContentType}))),e=>({content:e.value,types:{[n.keyOfType]:"Boolean"}})),e.BooleanContent=t.strict({__TYPE__:t.literal(e.BooleanContentType),value:t.boolean}),e.BooleanContentDefaultValue=t=>{var n;return(null===(n=t.config)||void 0===n?void 0:n.default_value)!==void 0?{__TYPE__:e.BooleanContentType,value:t.config.default_value||!1}:void 0}}(BK)),BK}var BP,BW={};function BD(){return BP||(BP=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.EmbedContent=e.EmbedLegacy=e.EmbedContentLegacy=e.isEmbedContent=e.EmbedContentType=void 0;let t=(0,$.__importStar)(FV),n=L5(),r=BO();e.EmbedContentType="EmbedContent",e.isEmbedContent=t=>(0,r.hasContentType)(t)&&t.__TYPE__===e.EmbedContentType,e.EmbedContentLegacy=t.exact(t.intersection([t.type({embed_url:t.string,type:t.string}),t.partial({version:t.union([t.string,t.number,t.null]),title:n.StringOrNull,author_name:n.StringOrNull,author_url:n.StringOrNull,provider_name:n.StringOrNull,provider_url:n.StringOrNull,cache_age:t.union([t.string,t.number,t.null]),thumbnail_url:n.StringOrNull,thumbnail_width:n.NumberOrNull,thumbnail_height:n.NumberOrNull,html:n.StringOrNull})])),e.EmbedLegacy=n=>new t.Type("EmbedLegacy",e.isEmbedContent,t=>(0,M8.pipe)(e.EmbedContentLegacy.decode(t),M3.either.map(n=>({...n,all:t,__TYPE__:e.EmbedContentType}))),e=>({content:e.all,types:{[n.keyOfType]:"Embed"}})),e.EmbedContent=t.intersection([e.EmbedContentLegacy,t.strict({__TYPE__:t.literal(e.EmbedContentType),all:t.unknown})])}(BW)),BW}var BN={},Bq={},BQ={};Object.defineProperty(BQ,"__esModule",{value:!0});let BV=(0,$.__importStar)(FV);BQ.default=new BV.Type("TrimmedString",BV.string.is,(e,t)=>(0,F$.pipe)(BV.string.validate(e,t),(0,Lj.chain)(e=>BV.success(function(e){let t=0;for(;t<e.length&&e[t]<=" ";)t++;let n=e.length;for(;t<n&&e[n-1]<=" ";)n--;return e.substring(t,n)}(e)))),e=>e);var Bz={};function BY(){return BH||(BH=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ColorContent=e.ColorLegacy=e.isColorContent=void 0;let t=(0,$.__importStar)(FV),n=(0,$.__importDefault)(BQ),r=BO();e.isColorContent=e=>(0,r.hasContentType)(e)&&e.__TYPE__===Bz.FieldContentType&&(0,r.hasFieldContentType)(e)&&"Color"===e.type,e.ColorLegacy=r=>new t.Type("ColorLegacy",e.isColorContent,t=>(0,M8.pipe)(n.default.decode(t),M3.either.map(t=>e.ColorContent.encode({value:t,type:K3.ColorFieldType,__TYPE__:Bz.FieldContentType}))),e=>({content:e.value,types:{[r.keyOfType]:K3.ColorFieldType}})),e.ColorContent=t.strict({type:t.literal(K3.ColorFieldType),value:n.default,__TYPE__:t.literal(Bz.FieldContentType)})}(Bq)),Bq}Object.defineProperty(Bz,"__esModule",{value:!0}),Bz.FieldContentType=void 0,Bz.FieldContentType="FieldContent";var BH,BG,BZ={};function BJ(){return BG||(BG=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.DateContent=e.DateLegacy=e.isDateContent=void 0;let t=(0,$.__importStar)(FV),n=(0,$.__importDefault)(BQ),r=BO();e.isDateContent=e=>(0,r.hasContentType)(e)&&e.__TYPE__===Bz.FieldContentType&&(0,r.hasFieldContentType)(e)&&"Date"===e.type,e.DateLegacy=r=>new t.Type("DateLegacy",e.isDateContent,t=>(0,M8.pipe)(n.default.decode(t),M3.either.map(t=>e.DateContent.encode({value:t,type:K3.DateFieldType,__TYPE__:Bz.FieldContentType}))),e=>({content:e.value,types:{[r.keyOfType]:K3.DateFieldType}})),e.DateContent=t.strict({type:t.literal(K3.DateFieldType),value:n.default,__TYPE__:t.literal(Bz.FieldContentType)})}(BZ)),BZ}var B$,BX={};function B0(){return B$||(B$=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.NumberContent=e.NumberLegacy=e.isNumberContent=void 0;let t=(0,$.__importStar)(FV),n=(0,$.__importDefault)(BQ),r=BO();e.isNumberContent=e=>(0,r.hasContentType)(e)&&e.__TYPE__===Bz.FieldContentType&&(0,r.hasFieldContentType)(e)&&"Number"===e.type,e.NumberLegacy=r=>new t.Type("NumberLegacy",e.isNumberContent,t=>(0,M8.pipe)(n.default.decode(t),M3.either.map(t=>e.NumberContent.encode({value:t,type:K3.NumberFieldType,__TYPE__:Bz.FieldContentType}))),e=>({content:e.value,types:{[r.keyOfType]:K3.NumberFieldType}})),e.NumberContent=t.strict({type:t.literal(K3.NumberFieldType),value:n.default,__TYPE__:t.literal(Bz.FieldContentType)})}(BX)),BX}var B1,B2={};function B6(){return B1||(B1=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.RangeContent=e.RangeLegacy=e.isRangeContent=void 0;let t=(0,$.__importStar)(FV),n=(0,$.__importDefault)(BQ),r=BO();e.isRangeContent=e=>(0,r.hasContentType)(e)&&e.__TYPE__===Bz.FieldContentType&&(0,r.hasFieldContentType)(e)&&"Range"===e.type,e.RangeLegacy=r=>new t.Type("RangeLegacy",e.isRangeContent,t=>(0,M8.pipe)(n.default.decode(t),M3.either.map(t=>e.RangeContent.encode({value:t,type:K3.RangeFieldType,__TYPE__:Bz.FieldContentType}))),e=>({content:e.value,types:{[r.keyOfType]:K3.RangeFieldType}})),e.RangeContent=t.strict({type:t.literal(K3.RangeFieldType),value:n.default,__TYPE__:t.literal(Bz.FieldContentType)})}(B2)),B2}var B5,B3={};function B9(){return B5||(B5=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.SelectContentDefaultValue=e.SelectContent=e.SelectLegacy=e.isSelectContent=void 0;let t=(0,$.__importStar)(FV),n=(0,$.__importDefault)(BQ),r=BO();e.isSelectContent=e=>(0,r.hasContentType)(e)&&e.__TYPE__===Bz.FieldContentType&&(0,r.hasFieldContentType)(e)&&"Select"===e.type,e.SelectLegacy=r=>new t.Type("SelectLegacy",e.isSelectContent,t=>(0,M8.pipe)(n.default.decode(t),M3.either.map(t=>e.SelectContent.encode({value:t,type:K3.SelectFieldType,__TYPE__:Bz.FieldContentType}))),e=>({content:e.value,types:{[r.keyOfType]:K3.SelectFieldType}})),e.SelectContent=t.strict({type:t.literal(K3.SelectFieldType),value:n.default,__TYPE__:t.literal(Bz.FieldContentType)}),e.SelectContentDefaultValue=e=>{var t;return!(null===(t=e.config)||void 0===t)&&t.default_value?{__TYPE__:Bz.FieldContentType,type:K3.SelectFieldType,value:e.config.default_value||""}:void 0}}(B3)),B3}var B4,B7={};function B8(){return B4||(B4=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.TextContent=e.TextLegacy=e.isTextContent=void 0;let t=(0,$.__importStar)(FV),n=(0,$.__importDefault)(BQ),r=BO();e.isTextContent=e=>(0,r.hasContentType)(e)&&e.__TYPE__===Bz.FieldContentType&&(0,r.hasFieldContentType)(e)&&"Text"===e.type,e.TextLegacy=r=>new t.Type("TextLegacy",e.isTextContent,t=>(0,M8.pipe)(n.default.decode(t),M3.either.map(t=>e.TextContent.encode({value:t,type:K3.TextFieldType,__TYPE__:Bz.FieldContentType}))),e=>({content:e.value,types:{[r.keyOfType]:K3.TextFieldType}})),e.TextContent=t.strict({type:t.literal(K3.TextFieldType),value:n.default,__TYPE__:t.literal(Bz.FieldContentType)})}(B7)),B7}var Pe,Pt={};function Pn(){return Pe||(Pe=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.TimestampContent=e.TimestampLegacy=e.isTimestampContent=void 0;let t=(0,$.__importStar)(FV),n=(0,$.__importDefault)(BQ),r=BO();e.isTimestampContent=e=>(0,r.hasContentType)(e)&&e.__TYPE__===Bz.FieldContentType&&(0,r.hasFieldContentType)(e)&&"Timestamp"===e.type,e.TimestampLegacy=r=>new t.Type("TimestampLegacy",e.isTimestampContent,t=>(0,M8.pipe)(n.default.decode(t),M3.either.map(t=>e.TimestampContent.encode({value:t,type:K3.TimestampFieldType,__TYPE__:Bz.FieldContentType}))),e=>({content:e.value,types:{[r.keyOfType]:K3.TimestampFieldType}})),e.TimestampContent=t.strict({type:t.literal(K3.TimestampFieldType),value:n.default,__TYPE__:t.literal(Bz.FieldContentType)})}(Pt)),Pt}function Pr(){return Pi||(Pi=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.FieldContent=e.FieldType=void 0;let t=(0,$.__importStar)(FV),n=BY(),r=BJ(),i=B0(),o=B6(),a=B9(),u=B8(),s=Pn();e.FieldType=t.keyof({Text:null,Date:null,Timestamp:null,Color:null,Number:null,Range:null,Select:null}),e.FieldContent=t.union([r.DateContent,n.ColorContent,i.NumberContent,o.RangeContent,a.SelectContent,u.TextContent,s.TimestampContent]),(0,$.__exportStar)(BY(),e),(0,$.__exportStar)(Bz,e),(0,$.__exportStar)(BJ(),e),(0,$.__exportStar)(B0(),e),(0,$.__exportStar)(B6(),e),(0,$.__exportStar)(B9(),e),(0,$.__exportStar)(B8(),e),(0,$.__exportStar)(Pn(),e)}(BN)),BN}var Pi,Po,Pa={};function Pu(){return Po||(Po=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.GeoPointContent=e.GeoPointLegacy=e.isGeoPointContent=e.GeoPointContentType=void 0;let t=(0,$.__importStar)(FV),n=BO();e.GeoPointContentType="GeoPointContent",e.isGeoPointContent=t=>(0,n.hasContentType)(t)&&t.__TYPE__===e.GeoPointContentType;let r=t.strict({position:t.strict({lat:t.number,lng:t.number})});e.GeoPointLegacy=n=>new t.Type("GeoPointLegacy",e.isGeoPointContent,t=>(0,F$.pipe)(r.decode(t),M3.either.map(t=>e.GeoPointContent.encode({...t,__TYPE__:e.GeoPointContentType}))),e=>({content:{position:e.position},types:{[n.keyOfType]:"GeoPoint"}})),e.GeoPointContent=t.intersection([r,t.strict({__TYPE__:t.literal(e.GeoPointContentType)})])}(Pa)),Pa}var Ps,Pl={};function Pc(){return Ps||(Ps=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ImageContent=e.ImageLegacy=e.ImageContentView=e.isImageContent=e.ImageContentType=void 0;let t=(0,$.__importStar)(FV),n=L5(),r=BO();e.ImageContentType="ImageContent",e.isImageContent=t=>(0,r.hasContentType)(t)&&t.__TYPE__===e.ImageContentType;let i=t.exact(t.type({id:t.string,url:t.string,width:t.number,height:t.number}));e.ImageContentView=t.exact(t.intersection([t.type({origin:i,width:t.number,height:t.number,edit:t.type({zoom:t.number,crop:t.type({x:t.number,y:t.number}),background:t.string})}),t.partial({url:t.string,credits:n.NonEmptyStringOrNull,alt:n.NonEmptyStringOrNull,provider:n.StringOrNull})]));let o=t.intersection([e.ImageContentView,t.partial({thumbnails:t.record(t.string,e.ImageContentView)})]);e.ImageLegacy=n=>new t.Type("ImageLegacy",e.isImageContent,t=>(0,M8.pipe)(o.decode(t),M3.either.map(t=>e.ImageContent.encode({...t,__TYPE__:e.ImageContentType}))),e=>({content:(0,KX.withOptionals)({edit:e.edit,height:e.height,origin:e.origin,width:e.width},[["alt",e.alt],["credits",e.credits],["provider",e.provider],["thumbnails",e.thumbnails],["url",e.url]]),types:{[n.keyOfType]:"Image"}})),e.ImageContent=t.intersection([o,t.strict({__TYPE__:t.literal(e.ImageContentType)})])}(Pl)),Pl}var Pd,Pf={};function Pp(){return Pd||(Pd=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.IntegrationFieldContent=e.IntegrationFieldLegacy=e.isIntegrationFieldContent=e.IntegrationFieldContentType=void 0;let t=(0,$.__importStar)(FV),n=BO();e.IntegrationFieldContentType="IntegrationFieldsContent",e.isIntegrationFieldContent=t=>(0,n.hasContentType)(t)&&t.__TYPE__===e.IntegrationFieldContentType,e.IntegrationFieldLegacy=n=>new t.Type("IntegrationFieldLegacy",e.isIntegrationFieldContent,n=>(0,M8.pipe)(t.string.decode(n),M3.either.map(t=>e.IntegrationFieldContent.encode({value:t,__TYPE__:e.IntegrationFieldContentType}))),e=>({content:e.value,types:{[n.keyOfType]:"IntegrationFields"}})),e.IntegrationFieldContent=t.strict({__TYPE__:t.literal(e.IntegrationFieldContentType),value:t.string})}(Pf)),Pf}var PA,Ph={};function Pm(){return PA||(PA=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.LinkContent=e.Link=e.LinkContentLegacy=e.LinkLegacy=e.isLinkContent=e.LinkContentType=e.ExternalLinkContent=e.ExternalLinkType=e.DocumentLinkContent=e.DocumentLinkType=e.FileLinkContent=e.FileLinkType=e.ImageLinkContent=e.ImageLinkType=void 0;let t=(0,$.__importStar)(FV),n=L5(),r=BO();e.ImageLinkType="ImageLink";let i=t.exact(t.intersection([t.type({id:t.string,url:t.string,height:t.string,width:t.string,size:t.string,name:t.string,kind:t.string}),t.partial({date:n.StringOrNull})])),o=new t.Type("ImageLink",t=>(0,r.hasContentType)(t)&&t.__TYPE__===e.ImageLinkType,t=>(0,M8.pipe)(i.decode(t),M3.either.map(t=>e.ImageLinkContent.encode({...t,__TYPE__:e.ImageLinkType}))),e=>i.encode(e));e.ImageLinkContent=t.intersection([t.strict({__TYPE__:t.literal(e.ImageLinkType)}),i]),e.FileLinkType="FileLink";let a=t.exact(t.intersection([t.type({id:t.string,url:t.string,name:t.string,kind:t.string,size:(0,Ld.withFallback)(t.string,"0")}),t.partial({date:(0,FJ.nullable)(t.string)})])),u=new t.Type("FileLink",t=>(0,r.hasContentType)(t)&&t.__TYPE__===e.FileLinkType,t=>(0,M8.pipe)(a.decode(t),M3.either.map(t=>e.FileLinkContent.encode({...t,__TYPE__:e.FileLinkType}))),e=>a.encode(e));e.FileLinkContent=t.intersection([a,t.exact(t.intersection([t.type({__TYPE__:t.literal(e.FileLinkType)}),t.partial({size:(0,Ld.withFallback)(t.string,"0")})]))]),e.DocumentLinkType="DocumentLink";let s=t.strict({id:n.NonEmptyString}),l=new t.Type("DocumentLink",t=>(0,r.hasContentType)(t)&&t.__TYPE__===e.DocumentLinkType,t=>(0,M8.pipe)(s.decode(t),M3.either.map(t=>e.DocumentLinkContent.encode({...t,__TYPE__:e.DocumentLinkType}))),e=>s.encode(e));e.DocumentLinkContent=t.intersection([t.strict({__TYPE__:t.literal(e.DocumentLinkType)}),s]),e.ExternalLinkType="ExternalLink";let c=t.exact(t.intersection([t.type({url:t.string}),t.partial({kind:t.literal("web"),target:n.StringOrNull,preview:(0,FJ.nullable)(t.partial({title:t.string}))})])),d=new t.Type("ExternalLink",t=>(0,r.hasContentType)(t)&&t.__TYPE__===e.ExternalLinkType,t=>(0,M8.pipe)(c.decode(t),M3.either.map(t=>e.ExternalLinkContent.encode({...t,__TYPE__:e.ExternalLinkType}))),e=>c.encode(e));e.ExternalLinkContent=t.intersection([t.strict({__TYPE__:t.literal(e.ExternalLinkType)}),c]),e.LinkContentType="LinkContent",e.isLinkContent=t=>(0,r.hasContentType)(t)&&t.__TYPE__===e.LinkContentType,e.LinkLegacy=t.union([o,u,l,d]),e.LinkContentLegacy=n=>new t.Type("LinkLegacy",e.isLinkContent,t=>(0,M8.pipe)(e.LinkLegacy.decode(t),M3.either.map(t=>e.LinkContent.encode({value:t,__TYPE__:e.LinkContentType}))),t=>({content:e.LinkLegacy.encode(t.value),types:{[n.keyOfType]:"Link"}})),e.Link=t.union([e.ImageLinkContent,e.FileLinkContent,e.DocumentLinkContent,e.ExternalLinkContent]),e.LinkContent=t.strict({__TYPE__:t.literal(e.LinkContentType),value:e.Link})}(Ph)),Ph}var Pg,Py={},Pv={},Px={};function Pb(){return Pg||(Pg=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Block=e.BlockLegacy=e.TextBlock=e.checkEmbedBlock=e.EmbedBlock=e.checkImageBlock=e.ImageBlock=e.ValidatedSpans=e.SpanLegacy=e.Span=void 0;let t=(0,$.__importStar)(FV),n=L5(),r=BD(),i=Pc(),o=Pm(),a=e=>t.strict({data:e,start:t.number,end:t.number,type:t.literal(KE.RichTextNodeType.hyperlink)}),u=t.strict({data:(0,Ld.withFallback)(t.string,""),start:t.number,end:t.number,type:t.literal("label")}),s=t.strict({start:t.number,end:t.number,type:t.keyof({[KE.RichTextNodeType.strong]:null,[KE.RichTextNodeType.em]:null,"list-item":null})});e.Span=t.union([a(o.Link),u,s]),e.SpanLegacy=t.union([a(o.LinkLegacy),u,s]),e.ValidatedSpans=e=>new t.Type("ValidatedSpans",t=>Array.isArray(t)&&t.every(e.is),(n,r)=>{if(!Array.isArray(n))return t.failure(n,r);{let r=n.reduce((t,n)=>{let r=e.decode(n);return(0,M9.isLeft)(r)?t:[...t,r.right]},[]).sort((e,t)=>e.start-t.start);return t.success(r)}},t=>t.reduce((t,n)=>[...t,e.encode(n)],[]));let l=e=>t.exact(t.intersection([t.type({type:t.literal(KE.RichTextNodeType.image),data:t.intersection([i.ImageContentView,t.partial({linkTo:(0,FJ.nullable)(e)})])}),t.partial({label:n.StringOrNull,direction:n.StringOrNull})]));e.ImageBlock=l(o.Link);let c=l(o.LinkLegacy);e.checkImageBlock=function(e){return e.type===KE.RichTextNodeType.image};let d=t.exact(t.intersection([t.type({type:t.literal(KE.RichTextNodeType.embed),data:t.unknown}),t.partial({label:n.StringOrNull,direction:n.StringOrNull})])),f=new t.Type("EmbedBlockLegacy",e=>"embed"===e.type,t=>(0,M8.pipe)(d.decode(t),M3.either.chain(e=>M3.either.map(t=>[e,t])(r.EmbedContentLegacy.decode(e.data))),M3.either.map(([t,n])=>e.EmbedBlock.encode({...t,data:{...n,__TYPE__:r.EmbedContentType,all:t.data}}))),e=>({...d.encode(e),data:r.EmbedContentLegacy.encode(e.data)}));e.EmbedBlock=t.exact(t.intersection([t.type({type:t.literal(KE.RichTextNodeType.embed),data:r.EmbedContent}),t.partial({label:n.StringOrNull,direction:n.StringOrNull})])),e.checkEmbedBlock=function(e){return e.type===KE.RichTextNodeType.embed};let p=n=>t.exact(t.intersection([t.type({type:(0,FJ.refineType)(KE.RichTextNodeTypeCodec,`string which isn't ${KE.RichTextNodeType.image} ${KE.RichTextNodeType.embed}`,e=>e!==KE.RichTextNodeType.image&&e!==KE.RichTextNodeType.embed),content:t.intersection([t.type({text:t.string}),t.partial({spans:(0,e.ValidatedSpans)(n)})])}),t.partial({label:t.string,direction:t.string})]));e.TextBlock=p(e.Span);let A=p(e.SpanLegacy),h=t.union([f,c,A]);e.BlockLegacy=new t.Type("BlockLegacy",e=>f.is(e)||c.is(e)||A.is(e),e=>h.decode(e),t=>e.ImageBlock.is(t)?c.encode(t):e.EmbedBlock.is(t)?f.encode(t):A.encode(t)),e.Block=t.union([e.ImageBlock,e.EmbedBlock,e.TextBlock])}(Px)),Px}function PC(){return PS||(PS=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.RichTextLegacy=e.RichTextContent=e.isRichTextContent=e.RichTextContentType=void 0;let t=(0,$.__importStar)(FV),n=BO(),r=Pb();e.RichTextContentType="StructuredTextContent",e.isRichTextContent=t=>(0,n.hasContentType)(t)&&t.__TYPE__===e.RichTextContentType;let i=t.array(r.BlockLegacy);e.RichTextContent=t.strict({__TYPE__:t.literal(e.RichTextContentType),value:t.array(r.Block)}),(0,$.__exportStar)(Pb(),e),e.RichTextLegacy=n=>new t.Type("RichTextLegacy",e.isRichTextContent,t=>(0,M8.pipe)(i.decode(t),M3.either.map(t=>({value:t,__TYPE__:e.RichTextContentType}))),e=>({content:i.encode(e.value),types:{[n.keyOfType]:"StructuredText"}}))}(Pv)),Pv}var PS,Pw,PI={};function P_(){return Pw||(Pw=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.SeparatorContent=e.SeparatorLegacy=e.isSeparatorContent=e.SeparatorContentType=void 0;let t=(0,$.__importStar)(FV),n=BO();e.SeparatorContentType="SeparatorContent",e.isSeparatorContent=t=>(0,n.hasContentType)(t)&&t.__TYPE__===e.SeparatorContentType,e.SeparatorLegacy=n=>new t.Type("SeparatorLegacy",e.isSeparatorContent,()=>t.success(e.SeparatorContent.encode({__TYPE__:e.SeparatorContentType})),()=>({content:{},types:{[n.keyOfType]:"Separator"}})),e.SeparatorContent=t.strict({__TYPE__:t.literal(e.SeparatorContentType)})}(PI)),PI}function PT(){return PR||(PR=1,Object.defineProperty(BL,"__esModule",{value:!0}),(0,$.__exportStar)(BB(),BL),(0,$.__exportStar)(BD(),BL),(0,$.__exportStar)(Pr(),BL),(0,$.__exportStar)(Pu(),BL),(0,$.__exportStar)(Pc(),BL),(0,$.__exportStar)(Pp(),BL),(0,$.__exportStar)(Pm(),BL),(0,$.__exportStar)(function(){if(PO)return Py;PO=1,Object.defineProperty(Py,"__esModule",{value:!0}),Py.NestableLegacy=Py.isNestableContent=Py.NestableContentDefaultValue=Py.NestableContent=void 0;let e=(0,$.__importStar)(FV),t=BR(),n=BB(),r=BD(),i=Pr(),o=Pu(),a=Pc(),u=Pp(),s=Pm(),l=PC(),c=P_();return Py.NestableContent=e.union([t.EmptyContent,n.BooleanContent,r.EmbedContent,i.TextContent,i.TimestampContent,i.SelectContent,i.RangeContent,i.NumberContent,i.DateContent,i.ColorContent,o.GeoPointContent,a.ImageContent,u.IntegrationFieldContent,s.LinkContent,l.RichTextContent,c.SeparatorContent]),Py.NestableContentDefaultValue=e=>{switch(e.type){case"Boolean":return(0,n.BooleanContentDefaultValue)(e);case"Select":return(0,i.SelectContentDefaultValue)(e);default:return}},Py.isNestableContent=e=>(0,i.isTextContent)(e)||(0,i.isColorContent)(e)||(0,i.isDateContent)(e)||(0,i.isTimestampContent)(e)||(0,i.isNumberContent)(e)||(0,i.isRangeContent)(e)||(0,i.isSelectContent)(e)||(0,o.isGeoPointContent)(e)||(0,l.isRichTextContent)(e)||(0,n.isBooleanContent)(e)||(0,r.isEmbedContent)(e)||(0,a.isImageContent)(e)||(0,u.isIntegrationFieldContent)(e)||(0,s.isLinkContent)(e)||(0,c.isSeparatorContent)(e)||(0,t.isEmptyContent)(e),Py.NestableLegacy=e=>({decode(d){if(!e.fieldType)return;let f=(0,t.EmptyLegacy)(e.fieldType).decode(d);if((0,M9.isRight)(f))return f;let p=(()=>{switch(e.fieldType){case"Text":return(0,i.TextLegacy)(e);case"Color":return(0,i.ColorLegacy)(e);case"Date":return(0,i.DateLegacy)(e);case"Timestamp":return(0,i.TimestampLegacy)(e);case"Number":return(0,i.NumberLegacy)(e);case"Range":return(0,i.RangeLegacy)(e);case"Select":return(0,i.SelectLegacy)(e);case"GeoPoint":return(0,o.GeoPointLegacy)(e);case"StructuredText":return(0,l.RichTextLegacy)(e);case"Boolean":return(0,n.BooleanLegacy)(e);case"Embed":return(0,r.EmbedLegacy)(e);case"Image":return(0,a.ImageLegacy)(e);case"IntegrationFields":return(0,u.IntegrationFieldLegacy)(e);case"Link":return(0,s.LinkContentLegacy)(e);case"Separator":return(0,c.SeparatorLegacy)(e);default:return}})();if(p)return p.decode(d)},encode(t){switch(t.__TYPE__){case Bz.FieldContentType:return"Text"===t.type?(0,i.TextLegacy)(e).encode(t):"Color"===t.type?(0,i.ColorLegacy)(e).encode(t):"Range"===t.type?(0,i.RangeLegacy)(e).encode(t):"Date"===t.type?(0,i.DateLegacy)(e).encode(t):"Number"===t.type?(0,i.NumberLegacy)(e).encode(t):"Timestamp"===t.type?(0,i.TimestampLegacy)(e).encode(t):"Select"===t.type?(0,i.SelectLegacy)(e).encode(t):void 0;case o.GeoPointContentType:return(0,o.GeoPointLegacy)(e).encode(t);case l.RichTextContentType:return(0,l.RichTextLegacy)(e).encode(t);case r.EmbedContentType:return(0,r.EmbedLegacy)(e).encode(t);case n.BooleanContentType:return(0,n.BooleanLegacy)(e).encode(t);case a.ImageContentType:return(0,a.ImageLegacy)(e).encode(t);case u.IntegrationFieldContentType:return(0,u.IntegrationFieldLegacy)(e).encode(t);case s.LinkContentType:return(0,s.LinkContentLegacy)(e).encode(t);case c.SeparatorContentType:return(0,c.SeparatorLegacy)(e).encode(t);default:return}}}),Py}(),BL),(0,$.__exportStar)(PC(),BL),(0,$.__exportStar)(P_(),BL)),BL}var PO,PR,Pk,PE={};function PM(){if(Pk)return PE;Pk=1,Object.defineProperty(PE,"__esModule",{value:!0}),PE.repeatableContentWithDefaultNestableContentValues=PE.withDefaultNestableContentValues=PE.withDefaultSlicePrimaryContentValues=void 0;let e=Pj(),t=PT();return PE.withDefaultSlicePrimaryContentValues=function(n,r){for(let[i,o]of Object.entries(n)){let n=r[i];if(void 0===n){if(o.type===Lm.GroupFieldType)r[i]=(0,e.groupContentWithDefaultValues)(o,e.GroupContentDefaultValue);else{let e=(0,t.NestableContentDefaultValue)(o);e&&(r[i]=e)}continue}o.type===Lm.GroupFieldType&&(0,e.isGroupContent)(n)&&(r[i]=(0,e.groupContentWithDefaultValues)(o,n))}return r},PE.withDefaultNestableContentValues=function(e,n){return Object.entries(e).reduce((e,[r,i])=>{if(void 0===n[r]){let n=(0,t.NestableContentDefaultValue)(i);return void 0!==n?{...e,[r]:n}:e}return e},n)},PE.repeatableContentWithDefaultNestableContentValues=function(n,r){let i=Object.entries(n);return r.map(n=>i.reduce((r,[i,o])=>{var a;let u=n.value.find(([e])=>e===i);if("Group"===o.type){let t=(0,e.groupContentWithDefaultValues)(o,null!==(a=null==u?void 0:u[1])&&void 0!==a?a:{__TYPE__:e.GroupContentType,value:[]});return{...r,value:[...r.value.filter(([e])=>e!==i),...t?[[i,t]]:[]]}}if(!u){let e=(0,t.NestableContentDefaultValue)(o);return{...r,value:[...r.value,...e?[[i,e]]:[]]}}return r},n))},PE}function Pj(){return PF||(PF=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.traverseGroupItemsContent=e.traverseGroupContent=e.groupContentWithDefaultValues=e.GroupLegacy=e.GroupItemLegacy=e.GroupContentDefaultValue=e.isGroupContent=e.GroupContent=e.GroupItemContent=e.GroupContentType=e.GroupItemContentType=void 0;let t=(0,$.__importStar)(FV),n=BO(),r=PT(),i=PM();e.GroupItemContentType="GroupItemContent",e.GroupContentType="GroupContentType",e.GroupItemContent=t.recursion("GroupItemContent",()=>t.strict({__TYPE__:t.literal(e.GroupItemContentType),value:t.array(t.tuple([t.string,t.union([r.NestableContent,e.GroupContent])]))})),e.GroupContent=t.recursion("GroupContent",()=>t.strict({__TYPE__:t.literal(e.GroupContentType),value:t.array(e.GroupItemContent)})),e.isGroupContent=e.GroupContent.is,e.GroupContentDefaultValue={__TYPE__:e.GroupContentType,value:[]};let o=t.record(t.string,t.unknown);function a({path:e,key:t,apiId:n,model:r,content:i}){return o=>{var a;let s=u({path:e,model:null===(a=null==r?void 0:r.config)||void 0===a?void 0:a.fields,content:i.value})(o);return o({path:e,key:t,apiId:n,model:r,content:{__TYPE__:i.__TYPE__,value:s}})}}function u({path:t,model:n,content:i}){return o=>i.map((i,u)=>{let s=t.concat([{key:u.toString(),type:"GroupItem"}]),l=i.value.reduce((t,[i,u])=>{let l;let c=null==n?void 0:n[i];return(l=c&&(null==c?void 0:c.type)!==Lm.GroupFieldType||u.__TYPE__!==e.GroupContentType?o({path:s.concat([{key:i,type:"Widget"}]),key:i,apiId:i,model:c,content:u}):a({path:s.concat([{key:i,type:"Widget"}]),key:i,apiId:i,model:c,content:u})(o))&&((0,r.isNestableContent)(l)||(0,e.isGroupContent)(l))?t.concat([[i,l]]):t},[]);return{__TYPE__:i.__TYPE__,value:l}})}e.GroupItemLegacy=i=>new t.Type("GroupItemLegacy",t=>(0,n.hasContentType)(t)&&t.__TYPE__===e.GroupItemContentType,t=>(0,M8.pipe)(o.decode(t),M3.either.map(t=>({value:Object.entries(t).reduce((t,[n,o])=>{let a=(0,BE.getFieldCtx)(n,i),u=a.fieldType===Lm.GroupFieldType?(0,e.GroupLegacy)(a).decode(o):(0,r.NestableLegacy)(a).decode(o);return!u||(0,M9.isLeft)(u)?t:[...t,[n,u.right]]},[]),__TYPE__:e.GroupItemContentType}))),t=>t.value.reduce((t,[n,o])=>{let a=(0,BE.getFieldCtx)(n,i),u=(0,e.isGroupContent)(o)?(0,e.GroupLegacy)(a).encode(o):(0,r.NestableLegacy)(a).encode(o);return u?{content:{...t.content,[n]:u.content},types:{...t.types,...u.types}}:t},{content:{},types:{}})),e.GroupLegacy=n=>{let r=t.array(t.union([t.null,(0,e.GroupItemLegacy)(n)])),i=t.array((0,e.GroupItemLegacy)(n));return new t.Type("GroupLegacy",e.isGroupContent,t=>(0,M8.pipe)(r.decode(t),M3.either.map(t=>({value:t.map(t=>null===t?{__TYPE__:e.GroupItemContentType,value:[]}:t),__TYPE__:e.GroupContentType}))),e=>{let t=i.encode(e.value);return{content:t.map(e=>e.content),types:t.reduce((e,t)=>({...e,...t.types}),{[n.keyOfType]:Lm.GroupFieldType})}})},e.groupContentWithDefaultValues=function(e,t){var n;let r=null===(n=e.config)||void 0===n?void 0:n.fields;return r?{...t,value:(0,i.repeatableContentWithDefaultNestableContentValues)(r,t.value)}:t},e.traverseGroupContent=a,e.traverseGroupItemsContent=u}(Bk)),Bk}var PF,PU,PL={},PK={},PB={},PP={};function PW(){if(PU)return PP;PU=1,Object.defineProperty(PP,"__esModule",{value:!0}),PP.RepeatableWidgets=PP.RepeatableWidgetsLegacy=void 0;let e=(0,$.__importStar)(FV),t=Pj(),n=PT();PP.RepeatableWidgetsLegacy=n=>e.array((0,t.GroupItemLegacy)(n));let r=e.tuple([e.string,e.union([n.NestableContent,t.GroupContent])]),i=e.strict({__TYPE__:e.literal(t.GroupItemContentType),value:e.array(r)});return PP.RepeatableWidgets=e.array(i),PP}function PD(){return PN||(PN=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.migrateCompositeSlice=e.traverseCompositeSliceContent=e.compositeSliceContentWithDefaultValues=e.CompositeSliceContent=e.CompositeSliceLegacy=e.isCompositeSliceContent=e.CompositeSliceContentType=void 0;let t=(0,$.__importStar)(FV),n=BO(),r=Pj(),i=PT(),o=PM(),a=PW();e.CompositeSliceContentType="CompositeSliceContent",e.isCompositeSliceContent=t=>(0,n.hasContentType)(t)&&t.__TYPE__===e.CompositeSliceContentType;let u=t.exact(t.partial({repeat:t.array(t.unknown),"non-repeat":t.UnknownRecord}));e.CompositeSliceLegacy=n=>new t.Type("CompositeSliceLegacy",e.isCompositeSliceContent,t=>(0,M8.pipe)(u.decode(t),M3.either.map(t=>{let r=(()=>{let e=(0,BE.getFieldCtx)("repeat",n),r=(0,a.RepeatableWidgetsLegacy)(e).decode(t.repeat);if(!(!r||(0,M9.isLeft)(r)))return r.right})()||[];return{nonRepeat:Object.entries(t["non-repeat"]||{}).reduce((e,[t,r])=>{let o=(0,BE.getFieldCtx)(t,n,["non-repeat"]);if(!o)return e;let a=(0,i.NestableLegacy)(o).decode(r);return!a||(0,M9.isLeft)(a)?e:{...e,[t]:a.right}},{}),repeat:r,__TYPE__:e.CompositeSliceContentType}})),e=>{let t=Object.entries(e.nonRepeat).reduce((e,[t,r])=>{let o=(0,BE.getFieldCtx)(t,n,["non-repeat"]),a=(0,i.NestableLegacy)(o).encode(r);return a?{content:{...e.content,[t]:a.content},types:{...e.types,...a.types}}:e},{content:{},types:{}}),r=(()=>{let t=(0,BE.getFieldCtx)("repeat",n);return(0,a.RepeatableWidgetsLegacy)(t).encode(e.repeat)})()||[];return{content:{"non-repeat":t.content,repeat:r.map(e=>e.content)},types:{[n.keyOfType]:"Slice",...t.types,...r.reduce((e,t)=>({...e,...t.types}),{})}}}),e.CompositeSliceContent=t.strict({__TYPE__:t.literal(e.CompositeSliceContentType),nonRepeat:t.record(t.string,i.NestableContent),repeat:a.RepeatableWidgets}),e.compositeSliceContentWithDefaultValues=function(e,t){var n,r;let i=(0,o.withDefaultNestableContentValues)(null!==(n=e["non-repeat"])&&void 0!==n?n:{},t.nonRepeat),a=(0,o.repeatableContentWithDefaultNestableContentValues)(null!==(r=e.repeat)&&void 0!==r?r:{},t.repeat);return{...t,nonRepeat:i,repeat:a}},e.traverseCompositeSliceContent=function({path:e,sliceKey:t,sliceName:n,model:o,content:a}){return(u,s)=>{let l=Object.entries(a.widget.nonRepeat).reduce((r,[a,s])=>{var l,c,d;let f=(null==o?void 0:o.type)==="SharedSlice"?null===(c=null===(l=null==o?void 0:o.fields)||void 0===l?void 0:l.primary)||void 0===c?void 0:c[a]:null===(d=null==o?void 0:o["non-repeat"])||void 0===d?void 0:d[a],p=u({path:e.concat([{key:"non-repeat",type:"primary"},{key:a,type:"Widget"}]),key:a,apiId:n,model:f,content:s});return p?(0,i.isNestableContent)(p)?{...r,[a]:p}:(console.warn(`Warn: Non nestable content with key [${a}] detected in a composite slice [${n}] with key [${t}]`),r):r},{}),c=(0,r.traverseGroupItemsContent)({path:e.concat([{key:"repeat",type:"items"}]),model:(null==o?void 0:o.type)==="SharedSlice"?null==o?void 0:o.fields.items:null==o?void 0:o.repeat,content:a.widget.repeat})(u);return s({key:t,apiId:n,path:e,model:o,content:{...a,widget:{__TYPE__:"CompositeSliceContent",repeat:c,nonRepeat:l}}})}},e.migrateCompositeSlice=function(e,t){let[,n]=t.key.split("$");return{key:`${e.sliceName}$${n}`,name:e.sliceName,maybeLabel:t.maybeLabel,widget:{__TYPE__:"SharedSliceContent",variation:e.variationId,primary:Object.entries(t.widget.nonRepeat).reduce((n,[r,i])=>{var o;return!(null===(o=e.fields.primary)||void 0===o)&&o[r]?{...n,[r]:i}:(console.warn(`The widget ${r} in the non-repeat zone of the composite slice [${e.sliceName}] with key [${t.key}] doesn't exist in the model.`),n)},{}),items:t.widget.repeat.map(n=>({__TYPE__:"GroupItemContent",value:n.value.reduce((n,[r,i])=>{var o;return!(null===(o=e.fields.items)||void 0===o)&&o[r]?n.concat([[r,i]]):(console.warn(`The widget ${r} in the repeat zone of the composite slice [${e.sliceName}] with key [${t.key}] doesn't exist in the model.`),n)},[])}),[])}}}}(PB)),PB}var PN,Pq,PQ={},PV={};function Pz(){if(Pq)return PV;Pq=1,Object.defineProperty(PV,"__esModule",{value:!0}),PV.isSlicePrimaryContent=PV.SlicePrimaryLegacy=PV.SlicePrimaryContent=void 0;let e=(0,$.__importStar)(FV),t=Pj(),n=PT();return PV.SlicePrimaryContent=e.union([n.NestableContent,t.GroupContent]),PV.SlicePrimaryLegacy=e=>{let r=(0,t.GroupLegacy)(e),i=(0,n.NestableLegacy)(e);return{decode:t=>e.fieldType===Lm.GroupFieldType?r.decode(t):i.decode(t),encode:e=>(0,t.isGroupContent)(e)?r.encode(e):i.encode(e)}},PV.isSlicePrimaryContent=e=>(0,n.isNestableContent)(e)||(0,t.isGroupContent)(e),PV}function PY(){return PH||(PH=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.traverseSharedSliceContent=e.sharedSliceContentWithDefaultValues=e.SharedSliceContent=e.SharedSliceLegacy=e.isSharedSliceContent=e.SharedSliceContentType=void 0;let t=(0,$.__importStar)(FV),n=BO(),r=Pj(),i=PT(),o=PM(),a=PW(),u=Pz();e.SharedSliceContentType="SharedSliceContent",e.isSharedSliceContent=t=>(0,n.hasContentType)(t)&&t.__TYPE__===e.SharedSliceContentType;let s=t.exact(t.type({variation:t.string,items:(0,Ld.withFallback)(t.array(t.unknown),[]),primary:(0,Ld.withFallback)(t.UnknownRecord,{})}));e.SharedSliceLegacy=n=>new t.Type("SharedSliceLegacy",e.isSharedSliceContent,t=>(0,M8.pipe)(s.decode(t),M3.either.map(t=>{let r=(()=>{let e=(0,BE.getFieldCtx)("items",n,["variations",t.variation]),r=(0,a.RepeatableWidgetsLegacy)(e).decode(t.items);if(!(!r||(0,M9.isLeft)(r)))return r.right})()||[],i=Object.entries(t.primary).reduce((e,[r,i])=>{let o=(0,BE.getFieldCtx)(r,n,["variations",t.variation,"primary"]),a=(0,u.SlicePrimaryLegacy)(o).decode(i);return!a||(0,M9.isLeft)(a)?e:{...e,[r]:a.right}},{});return{variation:t.variation,primary:i,items:r,__TYPE__:e.SharedSliceContentType}})),e=>{let t=Object.entries(e.primary).reduce((t,[r,i])=>{let o=(0,BE.getFieldCtx)(r,n,["variations",e.variation,"primary"]),a=(0,u.SlicePrimaryLegacy)(o).encode(i);return a?{content:{...t.content,[r]:a.content},types:{...t.types,...a.types}}:t},{content:{},types:{}}),r=(()=>{let t=(0,BE.getFieldCtx)("items",n,["variations",e.variation]);return(0,a.RepeatableWidgetsLegacy)(t).encode(e.items)})()||[];return{content:{primary:t.content,items:r.map(e=>e.content),variation:e.variation},types:{[n.keyOfType]:"SharedSlice",...t.types,...r.reduce((e,t)=>({...e,...t.types}),{})}}}),e.SharedSliceContent=t.strict({__TYPE__:t.literal(e.SharedSliceContentType),variation:t.string,primary:t.record(t.string,u.SlicePrimaryContent),items:a.RepeatableWidgets}),e.sharedSliceContentWithDefaultValues=function(e,t){var n,r;let i=e.variations.find(e=>e.id===t.variation),a=null!==(n=null==i?void 0:i.primary)&&void 0!==n?n:{},u=null!==(r=null==i?void 0:i.items)&&void 0!==r?r:{},s=(0,o.withDefaultSlicePrimaryContentValues)(a,t.primary),l=(0,o.repeatableContentWithDefaultNestableContentValues)(u,t.items);return{...t,primary:s,items:l}},e.traverseSharedSliceContent=function({path:e,sliceKey:t,sliceName:n,model:o,content:a}){return(s,l)=>{let c=Object.entries(a.widget.primary).reduce((a,[l,c])=>{var d,f;let p=null===(f=null===(d=null==o?void 0:o.fields)||void 0===d?void 0:d.primary)||void 0===f?void 0:f[l],A=(0,r.isGroupContent)(c)?(0,r.traverseGroupContent)({path:e.concat([{key:"primary",type:"primary"},{key:l,type:"Widget"}]),key:l,apiId:l,content:c,model:(null==p?void 0:p.type)===Lm.GroupFieldType?p:void 0})(s):(0,i.isNestableContent)(c)?s({path:e.concat([{key:"primary",type:"primary"},{key:l,type:"Widget"}]),key:l,apiId:l,model:p,content:c}):void 0;return A?((0,u.isSlicePrimaryContent)(A)||console.warn(`Warn: Non nestable or group content with key [${l}] detected in a shared slice [${n}] with key [${t}]`),{...a,[l]:A}):a},{}),d=(0,r.traverseGroupItemsContent)({path:e.concat([{key:"items",type:"items"}]),model:null==o?void 0:o.fields.items,content:a.widget.items})(s);return l({key:t,apiId:n,path:e,model:o,content:{...a,widget:{__TYPE__:"SharedSliceContent",variation:a.widget.variation,primary:c,items:d}}})}}}(PQ)),PQ}var PH,PG,PZ={};function PJ(){if(PG)return PZ;PG=1,Object.defineProperty(PZ,"__esModule",{value:!0}),PZ.migrateSimpleSlice=PZ.traverseSimpleSliceContent=PZ.SimpleSliceLegacy=PZ.isSimpleSliceContent=PZ.SimpleSliceContent=void 0;let e=(0,$.__importStar)(FV),t=Pj(),n=PT();return PZ.SimpleSliceContent=e.union([n.NestableContent,t.GroupContent]),PZ.isSimpleSliceContent=e=>(0,n.isNestableContent)(e)||(0,t.isGroupContent)(e),PZ.SimpleSliceLegacy=e=>({decode:"Group"===e.fieldType?(0,t.GroupLegacy)(e).decode.bind(null):(0,n.NestableLegacy)(e).decode.bind(null),encode:r=>"GroupContentType"===r.__TYPE__?(0,t.GroupLegacy)(e).encode(r):(0,n.NestableLegacy)(e).encode(r)}),PZ.traverseSimpleSliceContent=function({path:e,sliceKey:n,sliceName:r,model:i,content:o}){return(a,u)=>{var s;if((0,t.isGroupContent)(o.widget)){let n=(0,t.traverseGroupContent)({path:e,key:o.key,apiId:o.name,model:(null==i?void 0:i.type)==="Group"?i:(null==i?void 0:i.type)==="SharedSlice"?{type:"Group",config:{fields:i.fields.items||{}}}:void 0,content:o.widget})(a);return n&&u({key:o.key,apiId:o.name,path:e,model:i,content:{...o,widget:n}})}let l=a({key:o.key,apiId:o.name,path:e,model:(null==i?void 0:i.type)==="SharedSlice"?null===(s=i.fields.primary)||void 0===s?void 0:s[o.name]:(null==i?void 0:i.type)!=="Group"?i:void 0,content:o.widget});return l&&u({key:n,apiId:r,path:e,model:i,content:{...o,widget:l}})}},PZ.migrateSimpleSlice=function(e,t){var n;let[,r]=t.key.split("$"),i=`${e.sliceName}$${r}`;return"GroupContentType"===t.widget.__TYPE__?{key:i,name:e.sliceName,maybeLabel:t.maybeLabel,widget:{__TYPE__:"SharedSliceContent",variation:e.variationId,primary:{},items:t.widget.value.map(t=>({__TYPE__:"GroupItemContent",value:t.value.reduce((t,[n,r])=>{var i;return!(null===(i=e.fields.items)||void 0===i)&&i[n]?t.concat([[n,r]]):t},[])}),[])}}:{key:i,name:e.sliceName,maybeLabel:t.maybeLabel,widget:{__TYPE__:"SharedSliceContent",variation:e.variationId,primary:!(null===(n=e.fields.primary)||void 0===n)&&n[t.name]?{[t.name]:t.widget}:{},items:[]}}},PZ}function P$(){return PX||(PX=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.SliceContent=e.SliceLegacy=void 0;let t=(0,$.__importStar)(FV),n=PD(),r=PY(),i=PJ();e.SliceLegacy=e=>({decode:t=>(()=>{switch(e.fieldType){case"Slice":return(0,n.CompositeSliceLegacy)(e);case"SharedSlice":return(0,r.SharedSliceLegacy)(e);default:return(0,i.SimpleSliceLegacy)(e)}})().decode(t),encode:t=>{switch(t.__TYPE__){case"SharedSliceContent":return(0,r.SharedSliceLegacy)(e).encode(t);case"CompositeSliceContent":return(0,n.CompositeSliceLegacy)(e).encode(t);default:return(0,i.SimpleSliceLegacy)(e).encode(t)}}}),e.SliceContent=t.union([n.CompositeSliceContent,r.SharedSliceContent,i.SimpleSliceContent]),(0,$.__exportStar)(PD(),e),(0,$.__exportStar)(PY(),e),(0,$.__exportStar)(PJ(),e),(0,$.__exportStar)(Pz(),e)}(PK)),PK}var PX,P0,P1={};function P2(){if(P0)return P1;P0=1,Object.defineProperty(P1,"__esModule",{value:!0}),P1.migrateSliceItem=P1.SlicesItemLegacy=P1.sliceItemContentWithDefaultValues=P1.isSimpleSliceItemContent=P1.isCompositeSliceItemContent=P1.isSharedSliceItemContent=P1.SliceItemContent=void 0;let e=(0,$.__importStar)(FV),t=Pj(),n=PT(),r=PM(),i=P$(),o=PD(),a=PY(),u=PJ();function s(e){return(0,o.isCompositeSliceContent)(e.widget)}function l(e){return(0,t.isGroupContent)(e.widget)||(0,n.isNestableContent)(e.widget)}P1.SliceItemContent=e.type({key:e.string,name:e.string,maybeLabel:e.union([e.string,e.undefined]),widget:i.SliceContent}),P1.isSharedSliceItemContent=function(e){return(0,a.isSharedSliceContent)(e.widget)},P1.isCompositeSliceItemContent=s,P1.isSimpleSliceItemContent=l,P1.sliceItemContentWithDefaultValues=function(e,n){var u;if("SharedSlice"===e.type&&(0,a.isSharedSliceContent)(n))return(0,i.sharedSliceContentWithDefaultValues)(e,n);if("Slice"===e.type&&(0,o.isCompositeSliceContent)(n))return(0,i.compositeSliceContentWithDefaultValues)(e,n);if("Group"===e.type&&(0,t.isGroupContent)(n)&&!(null===(u=e.config)||void 0===u)&&u.fields){let t=(0,r.repeatableContentWithDefaultNestableContentValues)(e.config.fields,n.value);return{...n,value:t}}return n};let c=e.exact(e.intersection([e.type({key:e.string,value:e.unknown}),e.partial({label:(0,FJ.nullable)(e.string)})]));return P1.SlicesItemLegacy=t=>new e.Type("SlicesItemLegacy",e=>((0,a.isSharedSliceContent)(e.widget),(0,o.isCompositeSliceContent)(e.widget),(0,u.isSimpleSliceContent)(e.widget)),(n,r)=>(0,M8.pipe)(c.decode(n),M3.either.chain(o=>{var a;let u=o.key.indexOf("$"),s=o.key.substring(0,u>0?u:void 0),l=(0,BE.getFieldCtx)(s,t),c=(0,i.SliceLegacy)(l).decode(o.value);return!c||(0,M9.isLeft)(c)?e.failure(n,r):e.success({key:o.key,name:s,maybeLabel:null!==(a=o.label)&&void 0!==a?a:void 0,widget:c.right})})),e=>{let n=(0,BE.getFieldCtx)(e.name,t),r=(0,i.SliceLegacy)(n).encode(e.widget);return{content:{key:e.key,label:e.maybeLabel,value:(null==r?void 0:r.content)||{}},types:(null==r?void 0:r.types)||{}}}),P1.migrateSliceItem=({model:e,content:t})=>s(t)&&(null==e?void 0:e.type)==="SharedSlice"?(0,o.migrateCompositeSlice)(e,t):l(t)&&(null==e?void 0:e.type)==="SharedSlice"?(0,u.migrateSimpleSlice)(e,t):t,P1}var P6,P5={};function P3(){return P9||(P9=1,Object.defineProperty(PL,"__esModule",{value:!0}),(0,$.__exportStar)(P$(),PL),(0,$.__exportStar)(P2(),PL),(0,$.__exportStar)((P6||(P6=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.traverseSlices=e.slicesContentWithDefaultValues=e.SlicesContent=e.SlicesLegacy=e.isSlicesContent=e.SlicesContentType=void 0;let t=(0,$.__importStar)(FV),n=BO(),r=PD(),i=PY(),o=PJ(),a=P2();e.SlicesContentType="SliceContentType",e.isSlicesContent=t=>(0,n.hasContentType)(t)&&t.__TYPE__===e.SlicesContentType,e.SlicesLegacy=n=>{let r=t.array((0,a.SlicesItemLegacy)(n));return new t.Type("SlicesLegacy",e.isSlicesContent,t=>(0,M8.pipe)(r.decode(t),M3.either.map(t=>({__TYPE__:e.SlicesContentType,value:t}))),e=>{let t=r.encode(e.value);return{content:t.map(e=>e.content),types:t.reduce((e,t)=>({...e,...t.types}),{[n.keyOfType]:"Slices"})}})},e.SlicesContent=t.type({__TYPE__:t.literal(e.SlicesContentType),value:t.array(a.SliceItemContent)}),e.slicesContentWithDefaultValues=function(e,t){var n;let r=null===(n=null==e?void 0:e.config)||void 0===n?void 0:n.choices;if(void 0===r)return t;let i=t.value.map(e=>{let t=r[e.name];if(t){let n=(0,a.sliceItemContentWithDefaultValues)(t,e.widget);return{...e,widget:n}}return e});return{...t,value:i}},e.traverseSlices=function({path:e,key:t,model:n,content:u}){return({transformWidget:s=({content:e})=>e,transformSlice:l=({content:e})=>e})=>{let c=u.value.reduce((t,u)=>{let c=n&&function(e,t,n){var r,i;let o=null===(i=null===(r=null==t?void 0:t.config)||void 0===r?void 0:r.choices)||void 0===i?void 0:i[n.name];return(()=>{if((0,a.isSharedSliceItemContent)(n)&&o&&(0,Lm.isStaticSharedSlice)(o)){let e=o.variations.find(e=>e.id===n.widget.variation);return e?{type:"SharedSlice",sliceName:o.id,variationId:e.id,fields:{primary:e.primary||{},items:e.items||{}}}:void 0}})()||(()=>{var r;let i=Fz.ContentPath.append(Fz.ContentPath.serialize(e),n.name),o=Object.values((null===(r=null==t?void 0:t.config)||void 0===r?void 0:r.choices)||{}).find(e=>{var t;return!!(0,Lm.isStaticSharedSlice)(e)&&!!(!(null===(t=e.legacyPaths)||void 0===t)&&t[i])});if(!o)return;let a=null==o?void 0:o.variations.find(e=>{var t;return e.id===(null===(t=o.legacyPaths)||void 0===t?void 0:t[i])});if(a)return{type:"SharedSlice",sliceName:o.id,variationId:a.id,fields:{primary:a.primary||{},items:a.items||{}}}})()||(()=>{if(o){if((0,Lm.isCompositeSlice)(o))return{type:"Slice","non-repeat":o["non-repeat"]||{},repeat:o.repeat||{}};if((0,Lm.isLegacySlice)(o))return o}})()}(e,n,u),d=(0,a.isSharedSliceItemContent)(u)?(0,i.traverseSharedSliceContent)({path:e.concat({key:u.key,type:"SharedSlice"}),sliceKey:u.key,sliceName:u.name,model:(null==c?void 0:c.type)==="SharedSlice"?c:void 0,content:u})(s,l):(0,a.isCompositeSliceItemContent)(u)?(0,r.traverseCompositeSliceContent)({path:e.concat({key:u.key,type:"Slice"}),sliceKey:u.key,sliceName:u.name,model:(null==c?void 0:c.type)==="Slice"||(null==c?void 0:c.type)==="SharedSlice"?c:void 0,content:u})(s,l):(0,a.isSimpleSliceItemContent)(u)?(0,o.traverseSimpleSliceContent)({path:e.concat({key:u.key,type:"LegacySlice"}),sliceKey:u.key,sliceName:u.name,model:c&&(null==c?void 0:c.type)!=="Slice"?c:void 0,content:u})(s,l):void 0;return d?t.concat(d):t},[]);return s({path:e,key:t,apiId:t,model:n,content:{__TYPE__:u.__TYPE__,value:c}})}}}(P5)),P5),PL)),PL}var P9,P4,P7={};function P8(){return P4||(P4=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.UIDContent=e.UIDLegacy=e.isUIDContent=e.UIDContentType=void 0;let t=(0,$.__importStar)(FV),n=BO();e.UIDContentType="UIDContent",e.isUIDContent=t=>(0,n.hasContentType)(t)&&t.__TYPE__===e.UIDContentType,e.UIDLegacy=n=>new t.Type("UIDLegacy",e.isUIDContent,n=>(0,M8.pipe)(t.string.decode(n),M3.either.map(t=>e.UIDContent.encode({value:t,__TYPE__:e.UIDContentType}))),e=>({content:e.value,types:{[n.keyOfType]:"UID"}})),e.UIDContent=t.type({__TYPE__:t.literal(e.UIDContentType),value:t.string})}(P7)),P7}var We,Wt={};function Wn(){return h||(h=1,Object.defineProperty(BI,"__esModule",{value:!0}),(0,$.__exportStar)(BR(),BI),(0,$.__exportStar)(Pj(),BI),(0,$.__exportStar)(PT(),BI),(0,$.__exportStar)(P3(),BI),(0,$.__exportStar)(P8(),BI),(0,$.__exportStar)(function(){if(We)return Wt;We=1,Object.defineProperty(Wt,"__esModule",{value:!0}),Wt.WidgetLegacy=Wt.isWidgetContent=Wt.WidgetContent=void 0;let e=(0,$.__importStar)(FV),t=Pj(),n=PT(),r=P3(),i=P8();return Wt.WidgetContent=e.union([t.GroupContent,n.NestableContent,i.UIDContent,r.SlicesContent]),Wt.isWidgetContent=e=>(0,t.isGroupContent)(e)||(0,n.isNestableContent)(e)||(0,i.isUIDContent)(e)||(0,r.isSlicesContent)(e),Wt.WidgetLegacy=e=>({decode(o){if(!e.fieldType)return;let a=(()=>{switch(e.fieldType){case"UID":return(0,i.UIDLegacy)(e);case"Group":return(0,t.GroupLegacy)(e);case"Choice":case"Slices":return(0,r.SlicesLegacy)(e);default:return(0,n.NestableLegacy)(e)}})();if(a)return a.decode(o)},encode(o){switch(o.__TYPE__){case i.UIDContentType:return(0,i.UIDLegacy)(e).encode(o);case t.GroupContentType:return(0,t.GroupLegacy)(e).encode(o);case r.SlicesContentType:return(0,r.SlicesLegacy)(e).encode(o);default:return(0,n.NestableLegacy)(e).encode(o)}}}),Wt}(),BI)),BI}Object.defineProperty(X,"__esModule",{value:!0}),X.migrateDocument=X.collectWidgets=X.traverseDocument=X.fillDocumentWithDefaultValues=X.DocumentLegacy=X.Document=void 0;let Wr=(0,$.__importStar)(FV),Wi=Wn();X.Document=Wr.record(FY.WidgetKey,Wi.WidgetContent);let Wo=Wr.record(FY.WidgetKey,Wr.unknown),Wa=e=>new Wr.Type("Document",e=>!!e&&"object"==typeof e,t=>(0,M8.pipe)(Wo.decode(t),M3.either.map(t=>Object.entries(t).reduce((t,[n,r])=>{let i=(0,BE.defaultCtx)(n,e),o=(0,Wi.WidgetLegacy)(i).decode(r);return!o||(0,M9.isLeft)(o)?t:{...t,[n]:o.right}},{}))),t=>Object.entries(t).reduce((t,[n,r])=>{let i=(0,BE.defaultCtx)(n,e),o=(0,Wi.WidgetLegacy)(i).encode(r);return o?{content:{...t.content,[n]:o.content},types:{...t.types,...o.types}}:t},{content:{},types:{}}));function Wu(e){let{types:t,widgets:n}=Object.entries(e).reduce((e,[t,n])=>{if(t.endsWith("_TYPE")){let r=BE.FieldOrSliceType.decode(n);if((0,M9.isRight)(r))return{...e,types:e.types.set(t.substring(0,t.length-5),r.right)}}return t.endsWith("_POSITION")||t.endsWith("_TYPE")?e:{...e,widgets:{...e.widgets,[t]:n}}},{types:new Map,widgets:{}}),r=e.slugs_INTERNAL||[];return{widgets:n,types:t,uid:e.uid,slugs:r}}function Ws(e){return{customTypeId:null==e?void 0:e.id,fields:Object.fromEntries((0,Lm.flattenSections)(e))}}function Wl({document:e,customType:t}){let n=t&&Lm.StaticCustomType.is(t)?Ws(t):t;return({transformWidget:t=({content:e})=>e,transformSlice:r=({content:e})=>e})=>{let i=n&&Object.entries(n.fields).reduce((e,[t,n])=>({...e,[t]:n}),{});return Object.entries(e).reduce((e,[o,a])=>{let u=i&&i[o],s=Fz.ContentPath.make([{key:null==n?void 0:n.customTypeId,type:"CustomType"},{key:o,type:"Widget"}]),l=(()=>{switch(a.__TYPE__){case"SliceContentType":return(0,Wi.traverseSlices)({path:s,key:o,model:(null==u?void 0:u.type)==="Slices"||(null==u?void 0:u.type)==="Choice"?u:void 0,content:a})({transformWidget:t,transformSlice:r});case"GroupContentType":return(0,Wi.traverseGroupContent)({path:s,key:o,apiId:o,model:(null==u?void 0:u.type)==="Group"?u:void 0,content:a})(t);default:return t({path:s,key:o,apiId:o,model:(null==u?void 0:u.type)!=="Group"&&(null==u?void 0:u.type)!=="Slices"&&(null==u?void 0:u.type)!=="Choice"?u:void 0,content:a})}})();return{...e,...l?{[o]:l}:{}}},{})}}function Wc(e,t){let n=Lm.StaticCustomType.is(t)?Ws(t):t;return Object.values((0,Lm.collectSharedSlices)(n)).some(e=>!!e.legacyPaths)?Wl({document:e,customType:t})({transformSlice:Wi.migrateSliceItem}):e}X.DocumentLegacy={_codec:Wa,extractMetadata:Wu,parse:function(e,t){let n=(0,M8.pipe)(Wr.record(FY.WidgetKey,Wr.unknown).decode(e),M3.either.chain(e=>{let{types:t,widgets:n}=Wu(e);return Wa(t).decode(n)}));return(0,M9.isLeft)(n)?void 0:Wc(n.right,t)},encode:function(e){let t=Wa().encode(e);return{...t.content,...t.types}}},X.fillDocumentWithDefaultValues=function(e,t){let{fields:n}=e&&Lm.StaticCustomType.is(e)?Ws(e):e;return Object.entries(n).reduce((e,[n,r])=>{let i=t[n],o=(()=>{switch(r.type){case"Group":return(0,Wi.isGroupContent)(i)?(0,Wi.groupContentWithDefaultValues)(r,i):i;case"Choice":case"Slices":return(0,Wi.isSlicesContent)(i)?(0,Wi.slicesContentWithDefaultValues)(r,i):i;default:return void 0===i&&Lm.NestableWidget.is(r)?(0,Wi.NestableContentDefaultValue)(r):i}})();return o?{...e,[n]:o}:e},t)},X.traverseDocument=Wl,X.collectWidgets=function(e,t){let n={};return Wl({document:e})({transformWidget:({content:e,path:r})=>{let i=Fz.ContentPath.serialize(r);return t(e,r)&&(n[i]=e),e}}),n},X.migrateDocument=Wc,Object.defineProperty(Q,"__esModule",{value:!0}),(0,$.__exportStar)(X,Q),(0,$.__exportStar)(Wn(),Q),(0,$.__exportStar)(BE,Q);let Wd={unclassified:{title:"Draft",color:"amber"},published:{title:"Live",color:"green"},release:{title:"Planned",color:"purple"},archived:{title:"Archived",color:"grey"}},Wf={unclassified:["unclassified","published"],archived:["unclassified","published"],release:["release","published"],published:["published"]};function Wp(e){let{documentId:t,versionId:n,baseUrl:r,status:i,releaseId:o}=e,a=new URLSearchParams((0,C.aO)({params:{s:i,v:n,r:o}})).toString();return new URL(`pages/${t}?${a}`,r)}let WA="media-library-newMediaLibraryFeaturesBannerClosed";function Wh(e){let{maxWidth:t}=e,[n,r]=(0,x.useState)(()=>!(E.Xb.isAvailable()&&E.Xb.read(WA)));return n?q.jsx(b.xu,{justifyContent:"center",padding:{inline:16,block:12},backgroundColor:"purple9",children:q.jsxs(b.xu,{maxWidth:t,width:"100%",alignItems:"center",gap:8,children:[q.jsx(b.xu,{borderRadius:"100%",alignItems:"center",justifyContent:"center",width:28,height:28,border:!0,borderColor:"purple8",flexShrink:0,children:q.jsx(b.I5,{name:"autoFixHigh",color:"white",size:"small"})}),q.jsxs("div",{children:[q.jsx(b.xv,{color:"white",variant:"bold",children:"New features on the Media Library now available!"}),q.jsxs(b.xu,{gap:4,flexWrap:"wrap",children:[q.jsx(b.xv,{color:"white",children:"Media Tagging, Filtering, Improved Search & Bulk Deletion"}),q.jsx(b.xv,{color:"white",variant:"bold",href:"https://prismic.io/lp/new-media-library",target:"_blank",rel:"noopener noreferrer",underline:!0,children:"Find out More →"})]})]}),q.jsx(b.zx,{invisible:!0,color:"white",sx:{marginLeft:"auto",marginBottom:"auto",flexShrink:0},underline:!0,onClick:function(){r(!1),E.Xb.isAvailable()&&E.Xb.write(WA,String(Date.now()))},children:"Close"})]})}):null}let Wm=(0,x.createContext)(void 0),Wg={selectedIds:new Set,excludedIds:new Set,isAllSelected:!1};function Wy(e){let{children:t,initialTotalItemCount:n,isSelectAllEnabled:r=!1}=e,[i,o]=(0,x.useState)(Wg),a=(0,x.useRef)(),u=(0,x.useRef)(n||0),s=(0,x.useMemo)(()=>{let{selectedIds:e,excludedIds:t,isAllSelected:n}=i;return n?u.current-t.size:e.size},[i]),l=(0,x.useCallback)(e=>{let{isAllSelected:t,selectedIds:n,excludedIds:r}=i;return t?!r.has(e):n.has(e)},[i]),c=(0,w.R9)(()=>{let{isAllSelected:e,selectedIds:t,excludedIds:n}=i;return{selectedIds:[...t],excludedIds:[...n],isAllSelected:e,selectedCount:s}}),d=(0,w.R9)(()=>{r&&o({isAllSelected:!0,selectedIds:new Set,excludedIds:new Set})}),f=(0,w.R9)(()=>{o({isAllSelected:!1,selectedIds:new Set,excludedIds:new Set})});(0,x.useEffect)(()=>{let{isAllSelected:e,selectedIds:t,excludedIds:n}=i,o=u.current;if(!(0===o||!r)){if(e&&n.size===o){f();return}if(!e&&t.size===o){d();return}}},[i,r,d,f]);let p=(0,w.R9)(e=>{let{id:t,isSingleSelection:n,metaKey:r,shiftKey:i,ids:u}=e;return i&&u&&u.length>0&&a.current?function(e,t,n){let r=function(e,t,n){let r=e.indexOf(t),i=e.indexOf(n);if(-1===r||-1===i)throw Error("Both startValue and endValue must be in the array");return r<=i?e.slice(r,i+1):e.slice(i,r+1)}(t,n,e),i=l(e);return i?m(r):h(r),i}(t,u,a.current):n&&!r?l(t)&&1===s?o(e=>({...e,selectedIds:new Set})):o({isAllSelected:!1,selectedIds:new Set([t]),excludedIds:new Set}):l(t)?m([t]):h([t]),a.current=t,l(t)}),A=(0,w.R9)(()=>{s>0?f():d()});function h(e){let{isAllSelected:t}=i;if(t){o(t=>({...t,excludedIds:Wx(t.excludedIds,e)}));return}o(t=>({...t,selectedIds:Wb(t.selectedIds,e)}))}function m(e){let{isAllSelected:t}=i;if(t){o(t=>({...t,excludedIds:Wb(t.excludedIds,e)}));return}o(t=>({...t,selectedIds:Wx(t.selectedIds,e)}))}function g(e){u.current=e}let y=(0,x.useMemo)(()=>({selectedCount:s,state:i,totalItemCount:u.current,isSelected:l,isSelectAllEnabled:r,getSelectionState:c,toggleSelection:p,toggleSelectAll:A,clearSelection:f,setTotalItemCount:g}),[i,f,c,r,l,s,A,p]);return q.jsx(Wm.Provider,{value:y,children:t})}function Wv(e){let t=(0,x.useContext)(Wm);if(void 0===t)throw Error("useSelectionManagerContext must be used within a SelectionManagerProvider");let{totalItemCount:n,onChangeSelection:r}=e||{},{setTotalItemCount:i,totalItemCount:o,state:a,getSelectionState:u,...s}=t;void 0!==n&&n!==o&&i(n);let l=(0,w.R9)(r);return(0,x.useEffect)(()=>{null==l||l(u())},[u,l,a]),{...s,getSelectionState:u,isAllSelected:a.isAllSelected}}function Wx(e,t){let n=new Set(e);return t.forEach(e=>n.delete(e)),n}function Wb(e,t){return new Set([...e,...t])}let WC=(0,x.createContext)(void 0);function WS(){let e=(0,x.useContext)(WC);if(!e)throw Error("Missing EditorConfigContext.Provider");return e}class Ww extends Error{}function WI(e){throw new Ww(`Missing EditorConfig.${e}`)}(u=m||(m={})).assertEqual=e=>e,u.assertIs=function(e){},u.assertNever=function(e){throw Error()},u.arrayToEnum=e=>{let t={};for(let n of e)t[n]=n;return t},u.getValidEnumValues=e=>{let t=u.objectKeys(e).filter(t=>"number"!=typeof e[e[t]]),n={};for(let r of t)n[r]=e[r];return u.objectValues(n)},u.objectValues=e=>u.objectKeys(e).map(function(t){return e[t]}),u.objectKeys="function"==typeof Object.keys?e=>Object.keys(e):e=>{let t=[];for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.push(n);return t},u.find=(e,t)=>{for(let n of e)if(t(n))return n},u.isInteger="function"==typeof Number.isInteger?e=>Number.isInteger(e):e=>"number"==typeof e&&isFinite(e)&&Math.floor(e)===e,u.joinValues=function(e,t=" | "){return e.map(e=>"string"==typeof e?`'${e}'`:e).join(t)},u.jsonStringifyReplacer=(e,t)=>"bigint"==typeof t?t.toString():t,(g||(g={})).mergeShapes=(e,t)=>({...e,...t});let W_=m.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),WT=e=>{switch(typeof e){case"undefined":return W_.undefined;case"string":return W_.string;case"number":return isNaN(e)?W_.nan:W_.number;case"boolean":return W_.boolean;case"function":return W_.function;case"bigint":return W_.bigint;case"symbol":return W_.symbol;case"object":return Array.isArray(e)?W_.array:null===e?W_.null:e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch?W_.promise:"u">typeof Map&&e instanceof Map?W_.map:"u">typeof Set&&e instanceof Set?W_.set:"u">typeof Date&&e instanceof Date?W_.date:W_.object;default:return W_.unknown}},WO=m.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"]);class WR extends Error{constructor(e){super(),this.issues=[],this.addIssue=e=>{this.issues=[...this.issues,e]},this.addIssues=(e=[])=>{this.issues=[...this.issues,...e]};let t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){let t=e||function(e){return e.message},n={_errors:[]},r=e=>{for(let i of e.issues)if("invalid_union"===i.code)i.unionErrors.map(r);else if("invalid_return_type"===i.code)r(i.returnTypeError);else if("invalid_arguments"===i.code)r(i.argumentsError);else if(0===i.path.length)n._errors.push(t(i));else{let e=n,r=0;for(;r<i.path.length;){let n=i.path[r];r===i.path.length-1?(e[n]=e[n]||{_errors:[]},e[n]._errors.push(t(i))):e[n]=e[n]||{_errors:[]},e=e[n],r++}}};return r(this),n}toString(){return this.message}get message(){return JSON.stringify(this.issues,m.jsonStringifyReplacer,2)}get isEmpty(){return 0===this.issues.length}flatten(e=e=>e.message){let t={},n=[];for(let r of this.issues)r.path.length>0?(t[r.path[0]]=t[r.path[0]]||[],t[r.path[0]].push(e(r))):n.push(e(r));return{formErrors:n,fieldErrors:t}}get formErrors(){return this.flatten()}}WR.create=e=>new WR(e);let Wk=(e,t)=>{let n;switch(e.code){case WO.invalid_type:n=e.received===W_.undefined?"Required":`Expected ${e.expected}, received ${e.received}`;break;case WO.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,m.jsonStringifyReplacer)}`;break;case WO.unrecognized_keys:n=`Unrecognized key(s) in object: ${m.joinValues(e.keys,", ")}`;break;case WO.invalid_union:n="Invalid input";break;case WO.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${m.joinValues(e.options)}`;break;case WO.invalid_enum_value:n=`Invalid enum value. Expected ${m.joinValues(e.options)}, received '${e.received}'`;break;case WO.invalid_arguments:n="Invalid function arguments";break;case WO.invalid_return_type:n="Invalid function return type";break;case WO.invalid_date:n="Invalid date";break;case WO.invalid_string:"object"==typeof e.validation?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,"number"==typeof e.validation.position&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:m.assertNever(e.validation):n="regex"!==e.validation?`Invalid ${e.validation}`:"Invalid";break;case WO.too_small:n="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:"date"===e.type?`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:"Invalid input";break;case WO.too_big:n="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"bigint"===e.type?`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"date"===e.type?`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:"Invalid input";break;case WO.custom:n="Invalid input";break;case WO.invalid_intersection_types:n="Intersection results could not be merged";break;case WO.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case WO.not_finite:n="Number must be finite";break;default:n=t.defaultError,m.assertNever(e)}return{message:n}},WE=Wk;function WM(){return WE}let Wj=e=>{let{data:t,path:n,errorMaps:r,issueData:i}=e,o=[...n,...i.path||[]],a={...i,path:o},u="";for(let e of r.filter(e=>!!e).slice().reverse())u=e(a,{data:t,defaultError:u}).message;return{...i,path:o,message:i.message||u}};function WF(e,t){let n=Wj({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,WM(),Wk].filter(e=>!!e)});e.common.issues.push(n)}class WU{constructor(){this.value="valid"}dirty(){"valid"===this.value&&(this.value="dirty")}abort(){"aborted"!==this.value&&(this.value="aborted")}static mergeArray(e,t){let n=[];for(let r of t){if("aborted"===r.status)return WL;"dirty"===r.status&&e.dirty(),n.push(r.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,t){let n=[];for(let e of t)n.push({key:await e.key,value:await e.value});return WU.mergeObjectSync(e,n)}static mergeObjectSync(e,t){let n={};for(let r of t){let{key:t,value:i}=r;if("aborted"===t.status||"aborted"===i.status)return WL;"dirty"===t.status&&e.dirty(),"dirty"===i.status&&e.dirty(),("u">typeof i.value||r.alwaysSet)&&(n[t.value]=i.value)}return{status:e.value,value:n}}}let WL=Object.freeze({status:"aborted"}),WK=e=>({status:"dirty",value:e}),WB=e=>({status:"valid",value:e}),WP=e=>"aborted"===e.status,WW=e=>"dirty"===e.status,WD=e=>"valid"===e.status,WN=e=>"u">typeof Promise&&e instanceof Promise;(s=y||(y={})).errToObj=e=>"string"==typeof e?{message:e}:e||{},s.toString=e=>"string"==typeof e?e:null==e?void 0:e.message;class Wq{constructor(e,t,n,r){this._cachedPath=[],this.parent=e,this.data=t,this._path=n,this._key=r}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 WQ=(e,t)=>{if(WD(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let t=new WR(e.common.issues);return this._error=t,this._error}}};function WV(e){if(!e)return{};let{errorMap:t,invalid_type_error:n,required_error:r,description:i}=e;if(t&&(n||r))throw Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');return t?{errorMap:t,description:i}:{errorMap:(e,t)=>"invalid_type"!==e.code?{message:t.defaultError}:typeof t.data>"u"?{message:r??t.defaultError}:{message:n??t.defaultError},description:i}}class Wz{constructor(e){this.spa=this.safeParseAsync,this._def=e,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(e){return WT(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:WT(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new WU,ctx:{common:e.parent.common,data:e.data,parsedType:WT(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let t=this._parse(e);if(WN(t))throw Error("Synchronous parse encountered promise.");return t}_parseAsync(e){return Promise.resolve(this._parse(e))}parse(e,t){let n=this.safeParse(e,t);if(n.success)return n.data;throw n.error}safeParse(e,t){var n;let r={common:{issues:[],async:null!==(n=null==t?void 0:t.async)&&void 0!==n&&n,contextualErrorMap:null==t?void 0:t.errorMap},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:WT(e)},i=this._parseSync({data:e,path:r.path,parent:r});return WQ(r,i)}async parseAsync(e,t){let n=await this.safeParseAsync(e,t);if(n.success)return n.data;throw n.error}async safeParseAsync(e,t){let n={common:{issues:[],contextualErrorMap:null==t?void 0:t.errorMap,async:!0},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:WT(e)},r=this._parse({data:e,path:n.path,parent:n});return WQ(n,await (WN(r)?r:Promise.resolve(r)))}refine(e,t){let n=e=>"string"==typeof t||typeof t>"u"?{message:t}:"function"==typeof t?t(e):t;return this._refinement((t,r)=>{let i=e(t),o=()=>r.addIssue({code:WO.custom,...n(t)});return"u">typeof Promise&&i instanceof Promise?i.then(e=>!!e||(o(),!1)):!!i||(o(),!1)})}refinement(e,t){return this._refinement((n,r)=>!!e(n)||(r.addIssue("function"==typeof t?t(n,r):t),!1))}_refinement(e){return new Db({schema:this,typeName:v.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return DC.create(this,this._def)}nullable(){return DS.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Di.create(this,this._def)}promise(){return Dx.create(this,this._def)}or(e){return Da.create([this,e],this._def)}and(e){return Dl.create(this,e,this._def)}transform(e){return new Db({...WV(this._def),schema:this,typeName:v.ZodEffects,effect:{type:"transform",transform:e}})}default(e){return new Dw({...WV(this._def),innerType:this,defaultValue:"function"==typeof e?e:()=>e,typeName:v.ZodDefault})}brand(){return new DO({typeName:v.ZodBranded,type:this,...WV(this._def)})}catch(e){return new DI({...WV(this._def),innerType:this,catchValue:"function"==typeof e?e:()=>e,typeName:v.ZodCatch})}describe(e){return new this.constructor({...this._def,description:e})}pipe(e){return DR.create(this,e)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}let WY=/^c[^\s-]{8,}$/i,WH=/^[a-z][a-z0-9]*$/,WG=/[0-9A-HJKMNP-TV-Z]{26}/,WZ=/^([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,WJ=/^(([^<>()[\]\\.,;:\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,})+))$/,W$=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u"),WX=/^(((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}))$/,W0=/^(([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})))$/,W1=e=>e.precision?e.offset?RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${e.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`):RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${e.precision}}Z$`):0===e.precision?e.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$"):e.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$");class W2 extends Wz{constructor(){super(...arguments),this._regex=(e,t,n)=>this.refinement(t=>e.test(t),{validation:t,code:WO.invalid_string,...y.errToObj(n)}),this.nonempty=e=>this.min(1,y.errToObj(e)),this.trim=()=>new W2({...this._def,checks:[...this._def.checks,{kind:"trim"}]}),this.toLowerCase=()=>new W2({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]}),this.toUpperCase=()=>new W2({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}_parse(e){let t;if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==W_.string){let t=this._getOrReturnCtx(e);return WF(t,{code:WO.invalid_type,expected:W_.string,received:t.parsedType}),WL}let n=new WU;for(let o of this._def.checks)if("min"===o.kind)e.data.length<o.value&&(WF(t=this._getOrReturnCtx(e,t),{code:WO.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),n.dirty());else if("max"===o.kind)e.data.length>o.value&&(WF(t=this._getOrReturnCtx(e,t),{code:WO.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),n.dirty());else if("length"===o.kind){let r=e.data.length>o.value,i=e.data.length<o.value;(r||i)&&(t=this._getOrReturnCtx(e,t),r?WF(t,{code:WO.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):i&&WF(t,{code:WO.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),n.dirty())}else if("email"===o.kind)WJ.test(e.data)||(WF(t=this._getOrReturnCtx(e,t),{validation:"email",code:WO.invalid_string,message:o.message}),n.dirty());else if("emoji"===o.kind)W$.test(e.data)||(WF(t=this._getOrReturnCtx(e,t),{validation:"emoji",code:WO.invalid_string,message:o.message}),n.dirty());else if("uuid"===o.kind)WZ.test(e.data)||(WF(t=this._getOrReturnCtx(e,t),{validation:"uuid",code:WO.invalid_string,message:o.message}),n.dirty());else if("cuid"===o.kind)WY.test(e.data)||(WF(t=this._getOrReturnCtx(e,t),{validation:"cuid",code:WO.invalid_string,message:o.message}),n.dirty());else if("cuid2"===o.kind)WH.test(e.data)||(WF(t=this._getOrReturnCtx(e,t),{validation:"cuid2",code:WO.invalid_string,message:o.message}),n.dirty());else if("ulid"===o.kind)WG.test(e.data)||(WF(t=this._getOrReturnCtx(e,t),{validation:"ulid",code:WO.invalid_string,message:o.message}),n.dirty());else if("url"===o.kind)try{new URL(e.data)}catch{WF(t=this._getOrReturnCtx(e,t),{validation:"url",code:WO.invalid_string,message:o.message}),n.dirty()}else{var r,i;"regex"===o.kind?(o.regex.lastIndex=0,o.regex.test(e.data)||(WF(t=this._getOrReturnCtx(e,t),{validation:"regex",code:WO.invalid_string,message:o.message}),n.dirty())):"trim"===o.kind?e.data=e.data.trim():"includes"===o.kind?e.data.includes(o.value,o.position)||(WF(t=this._getOrReturnCtx(e,t),{code:WO.invalid_string,validation:{includes:o.value,position:o.position},message:o.message}),n.dirty()):"toLowerCase"===o.kind?e.data=e.data.toLowerCase():"toUpperCase"===o.kind?e.data=e.data.toUpperCase():"startsWith"===o.kind?e.data.startsWith(o.value)||(WF(t=this._getOrReturnCtx(e,t),{code:WO.invalid_string,validation:{startsWith:o.value},message:o.message}),n.dirty()):"endsWith"===o.kind?e.data.endsWith(o.value)||(WF(t=this._getOrReturnCtx(e,t),{code:WO.invalid_string,validation:{endsWith:o.value},message:o.message}),n.dirty()):"datetime"===o.kind?W1(o).test(e.data)||(WF(t=this._getOrReturnCtx(e,t),{code:WO.invalid_string,validation:"datetime",message:o.message}),n.dirty()):"ip"===o.kind?(r=e.data,("v4"===(i=o.version)||!i)&&WX.test(r)||("v6"===i||!i)&&W0.test(r)||(WF(t=this._getOrReturnCtx(e,t),{validation:"ip",code:WO.invalid_string,message:o.message}),n.dirty())):m.assertNever(o)}return{status:n.value,value:e.data}}_addCheck(e){return new W2({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...y.errToObj(e)})}url(e){return this._addCheck({kind:"url",...y.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...y.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...y.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...y.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...y.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...y.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...y.errToObj(e)})}datetime(e){var t;return"string"==typeof e?this._addCheck({kind:"datetime",precision:null,offset:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(null==e?void 0:e.precision)>"u"?null:null==e?void 0:e.precision,offset:null!==(t=null==e?void 0:e.offset)&&void 0!==t&&t,...y.errToObj(null==e?void 0:e.message)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...y.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:null==t?void 0:t.position,...y.errToObj(null==t?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...y.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...y.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...y.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...y.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...y.errToObj(t)})}get isDatetime(){return!!this._def.checks.find(e=>"datetime"===e.kind)}get isEmail(){return!!this._def.checks.find(e=>"email"===e.kind)}get isURL(){return!!this._def.checks.find(e=>"url"===e.kind)}get isEmoji(){return!!this._def.checks.find(e=>"emoji"===e.kind)}get isUUID(){return!!this._def.checks.find(e=>"uuid"===e.kind)}get isCUID(){return!!this._def.checks.find(e=>"cuid"===e.kind)}get isCUID2(){return!!this._def.checks.find(e=>"cuid2"===e.kind)}get isULID(){return!!this._def.checks.find(e=>"ulid"===e.kind)}get isIP(){return!!this._def.checks.find(e=>"ip"===e.kind)}get minLength(){let e=null;for(let t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(let t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}W2.create=e=>{var t;return new W2({checks:[],typeName:v.ZodString,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...WV(e)})};class W6 extends Wz{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){let t;if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==W_.number){let t=this._getOrReturnCtx(e);return WF(t,{code:WO.invalid_type,expected:W_.number,received:t.parsedType}),WL}let n=new WU;for(let r of this._def.checks)"int"===r.kind?m.isInteger(e.data)||(WF(t=this._getOrReturnCtx(e,t),{code:WO.invalid_type,expected:"integer",received:"float",message:r.message}),n.dirty()):"min"===r.kind?(r.inclusive?e.data<r.value:e.data<=r.value)&&(WF(t=this._getOrReturnCtx(e,t),{code:WO.too_small,minimum:r.value,type:"number",inclusive:r.inclusive,exact:!1,message:r.message}),n.dirty()):"max"===r.kind?(r.inclusive?e.data>r.value:e.data>=r.value)&&(WF(t=this._getOrReturnCtx(e,t),{code:WO.too_big,maximum:r.value,type:"number",inclusive:r.inclusive,exact:!1,message:r.message}),n.dirty()):"multipleOf"===r.kind?0!==function(e,t){let n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,i=n>r?n:r;return parseInt(e.toFixed(i).replace(".",""))%parseInt(t.toFixed(i).replace(".",""))/Math.pow(10,i)}(e.data,r.value)&&(WF(t=this._getOrReturnCtx(e,t),{code:WO.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):"finite"===r.kind?Number.isFinite(e.data)||(WF(t=this._getOrReturnCtx(e,t),{code:WO.not_finite,message:r.message}),n.dirty()):m.assertNever(r);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,y.toString(t))}gt(e,t){return this.setLimit("min",e,!1,y.toString(t))}lte(e,t){return this.setLimit("max",e,!0,y.toString(t))}lt(e,t){return this.setLimit("max",e,!1,y.toString(t))}setLimit(e,t,n,r){return new W6({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:y.toString(r)}]})}_addCheck(e){return new W6({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:y.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:y.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:y.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:y.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:y.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:y.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:y.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:y.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:y.toString(e)})}get minValue(){let e=null;for(let t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>"int"===e.kind||"multipleOf"===e.kind&&m.isInteger(e.value))}get isFinite(){let e=null,t=null;for(let n of this._def.checks){if("finite"===n.kind||"int"===n.kind||"multipleOf"===n.kind)return!0;"min"===n.kind?(null===t||n.value>t)&&(t=n.value):"max"===n.kind&&(null===e||n.value<e)&&(e=n.value)}return Number.isFinite(t)&&Number.isFinite(e)}}W6.create=e=>new W6({checks:[],typeName:v.ZodNumber,coerce:(null==e?void 0:e.coerce)||!1,...WV(e)});class W5 extends Wz{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){let t;if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==W_.bigint){let t=this._getOrReturnCtx(e);return WF(t,{code:WO.invalid_type,expected:W_.bigint,received:t.parsedType}),WL}let n=new WU;for(let r of this._def.checks)"min"===r.kind?(r.inclusive?e.data<r.value:e.data<=r.value)&&(WF(t=this._getOrReturnCtx(e,t),{code:WO.too_small,type:"bigint",minimum:r.value,inclusive:r.inclusive,message:r.message}),n.dirty()):"max"===r.kind?(r.inclusive?e.data>r.value:e.data>=r.value)&&(WF(t=this._getOrReturnCtx(e,t),{code:WO.too_big,type:"bigint",maximum:r.value,inclusive:r.inclusive,message:r.message}),n.dirty()):"multipleOf"===r.kind?e.data%r.value!==BigInt(0)&&(WF(t=this._getOrReturnCtx(e,t),{code:WO.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):m.assertNever(r);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,y.toString(t))}gt(e,t){return this.setLimit("min",e,!1,y.toString(t))}lte(e,t){return this.setLimit("max",e,!0,y.toString(t))}lt(e,t){return this.setLimit("max",e,!1,y.toString(t))}setLimit(e,t,n,r){return new W5({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:y.toString(r)}]})}_addCheck(e){return new W5({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:y.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:y.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:y.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:y.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:y.toString(t)})}get minValue(){let e=null;for(let t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}W5.create=e=>{var t;return new W5({checks:[],typeName:v.ZodBigInt,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...WV(e)})};class W3 extends Wz{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==W_.boolean){let t=this._getOrReturnCtx(e);return WF(t,{code:WO.invalid_type,expected:W_.boolean,received:t.parsedType}),WL}return WB(e.data)}}W3.create=e=>new W3({typeName:v.ZodBoolean,coerce:(null==e?void 0:e.coerce)||!1,...WV(e)});class W9 extends Wz{_parse(e){let t;if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==W_.date){let t=this._getOrReturnCtx(e);return WF(t,{code:WO.invalid_type,expected:W_.date,received:t.parsedType}),WL}if(isNaN(e.data.getTime()))return WF(this._getOrReturnCtx(e),{code:WO.invalid_date}),WL;let n=new WU;for(let r of this._def.checks)"min"===r.kind?e.data.getTime()<r.value&&(WF(t=this._getOrReturnCtx(e,t),{code:WO.too_small,message:r.message,inclusive:!0,exact:!1,minimum:r.value,type:"date"}),n.dirty()):"max"===r.kind?e.data.getTime()>r.value&&(WF(t=this._getOrReturnCtx(e,t),{code:WO.too_big,message:r.message,inclusive:!0,exact:!1,maximum:r.value,type:"date"}),n.dirty()):m.assertNever(r);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new W9({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:y.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:y.toString(t)})}get minDate(){let e=null;for(let t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return null!=e?new Date(e):null}get maxDate(){let e=null;for(let t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return null!=e?new Date(e):null}}W9.create=e=>new W9({checks:[],coerce:(null==e?void 0:e.coerce)||!1,typeName:v.ZodDate,...WV(e)});class W4 extends Wz{_parse(e){if(this._getType(e)!==W_.symbol){let t=this._getOrReturnCtx(e);return WF(t,{code:WO.invalid_type,expected:W_.symbol,received:t.parsedType}),WL}return WB(e.data)}}W4.create=e=>new W4({typeName:v.ZodSymbol,...WV(e)});class W7 extends Wz{_parse(e){if(this._getType(e)!==W_.undefined){let t=this._getOrReturnCtx(e);return WF(t,{code:WO.invalid_type,expected:W_.undefined,received:t.parsedType}),WL}return WB(e.data)}}W7.create=e=>new W7({typeName:v.ZodUndefined,...WV(e)});class W8 extends Wz{_parse(e){if(this._getType(e)!==W_.null){let t=this._getOrReturnCtx(e);return WF(t,{code:WO.invalid_type,expected:W_.null,received:t.parsedType}),WL}return WB(e.data)}}W8.create=e=>new W8({typeName:v.ZodNull,...WV(e)});class De extends Wz{constructor(){super(...arguments),this._any=!0}_parse(e){return WB(e.data)}}De.create=e=>new De({typeName:v.ZodAny,...WV(e)});class Dt extends Wz{constructor(){super(...arguments),this._unknown=!0}_parse(e){return WB(e.data)}}Dt.create=e=>new Dt({typeName:v.ZodUnknown,...WV(e)});class Dn extends Wz{_parse(e){let t=this._getOrReturnCtx(e);return WF(t,{code:WO.invalid_type,expected:W_.never,received:t.parsedType}),WL}}Dn.create=e=>new Dn({typeName:v.ZodNever,...WV(e)});class Dr extends Wz{_parse(e){if(this._getType(e)!==W_.undefined){let t=this._getOrReturnCtx(e);return WF(t,{code:WO.invalid_type,expected:W_.void,received:t.parsedType}),WL}return WB(e.data)}}Dr.create=e=>new Dr({typeName:v.ZodVoid,...WV(e)});class Di extends Wz{_parse(e){let{ctx:t,status:n}=this._processInputParams(e),r=this._def;if(t.parsedType!==W_.array)return WF(t,{code:WO.invalid_type,expected:W_.array,received:t.parsedType}),WL;if(null!==r.exactLength){let e=t.data.length>r.exactLength.value,i=t.data.length<r.exactLength.value;(e||i)&&(WF(t,{code:e?WO.too_big:WO.too_small,minimum:i?r.exactLength.value:void 0,maximum:e?r.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:r.exactLength.message}),n.dirty())}if(null!==r.minLength&&t.data.length<r.minLength.value&&(WF(t,{code:WO.too_small,minimum:r.minLength.value,type:"array",inclusive:!0,exact:!1,message:r.minLength.message}),n.dirty()),null!==r.maxLength&&t.data.length>r.maxLength.value&&(WF(t,{code:WO.too_big,maximum:r.maxLength.value,type:"array",inclusive:!0,exact:!1,message:r.maxLength.message}),n.dirty()),t.common.async)return Promise.all([...t.data].map((e,n)=>r.type._parseAsync(new Wq(t,e,t.path,n)))).then(e=>WU.mergeArray(n,e));let i=[...t.data].map((e,n)=>r.type._parseSync(new Wq(t,e,t.path,n)));return WU.mergeArray(n,i)}get element(){return this._def.type}min(e,t){return new Di({...this._def,minLength:{value:e,message:y.toString(t)}})}max(e,t){return new Di({...this._def,maxLength:{value:e,message:y.toString(t)}})}length(e,t){return new Di({...this._def,exactLength:{value:e,message:y.toString(t)}})}nonempty(e){return this.min(1,e)}}Di.create=(e,t)=>new Di({type:e,minLength:null,maxLength:null,exactLength:null,typeName:v.ZodArray,...WV(t)});class Do extends Wz{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(null!==this._cached)return this._cached;let e=this._def.shape(),t=m.objectKeys(e);return this._cached={shape:e,keys:t}}_parse(e){if(this._getType(e)!==W_.object){let t=this._getOrReturnCtx(e);return WF(t,{code:WO.invalid_type,expected:W_.object,received:t.parsedType}),WL}let{status:t,ctx:n}=this._processInputParams(e),{shape:r,keys:i}=this._getCached(),o=[];if(!(this._def.catchall instanceof Dn&&"strip"===this._def.unknownKeys))for(let e in n.data)i.includes(e)||o.push(e);let a=[];for(let e of i){let t=r[e],i=n.data[e];a.push({key:{status:"valid",value:e},value:t._parse(new Wq(n,i,n.path,e)),alwaysSet:e in n.data})}if(this._def.catchall instanceof Dn){let e=this._def.unknownKeys;if("passthrough"===e)for(let e of o)a.push({key:{status:"valid",value:e},value:{status:"valid",value:n.data[e]}});else if("strict"===e)o.length>0&&(WF(n,{code:WO.unrecognized_keys,keys:o}),t.dirty());else if("strip"!==e)throw Error("Internal ZodObject error: invalid unknownKeys value.")}else{let e=this._def.catchall;for(let t of o){let r=n.data[t];a.push({key:{status:"valid",value:t},value:e._parse(new Wq(n,r,n.path,t)),alwaysSet:t in n.data})}}return n.common.async?Promise.resolve().then(async()=>{let e=[];for(let t of a){let n=await t.key;e.push({key:n,value:await t.value,alwaysSet:t.alwaysSet})}return e}).then(e=>WU.mergeObjectSync(t,e)):WU.mergeObjectSync(t,a)}get shape(){return this._def.shape()}strict(e){return y.errToObj,new Do({...this._def,unknownKeys:"strict",...void 0!==e?{errorMap:(t,n)=>{var r,i,o,a;let u=null!==(o=null===(i=(r=this._def).errorMap)||void 0===i?void 0:i.call(r,t,n).message)&&void 0!==o?o:n.defaultError;return"unrecognized_keys"===t.code?{message:null!==(a=y.errToObj(e).message)&&void 0!==a?a:u}:{message:u}}}:{}})}strip(){return new Do({...this._def,unknownKeys:"strip"})}passthrough(){return new Do({...this._def,unknownKeys:"passthrough"})}extend(e){return new Do({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new Do({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:v.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new Do({...this._def,catchall:e})}pick(e){let t={};return m.objectKeys(e).forEach(n=>{e[n]&&this.shape[n]&&(t[n]=this.shape[n])}),new Do({...this._def,shape:()=>t})}omit(e){let t={};return m.objectKeys(this.shape).forEach(n=>{e[n]||(t[n]=this.shape[n])}),new Do({...this._def,shape:()=>t})}deepPartial(){return function e(t){if(!(t instanceof Do))return t instanceof Di?new Di({...t._def,type:e(t.element)}):t instanceof DC?DC.create(e(t.unwrap())):t instanceof DS?DS.create(e(t.unwrap())):t instanceof Dc?Dc.create(t.items.map(t=>e(t))):t;{let n={};for(let r in t.shape){let i=t.shape[r];n[r]=DC.create(e(i))}return new Do({...t._def,shape:()=>n})}}(this)}partial(e){let t={};return m.objectKeys(this.shape).forEach(n=>{let r=this.shape[n];e&&!e[n]?t[n]=r:t[n]=r.optional()}),new Do({...this._def,shape:()=>t})}required(e){let t={};return m.objectKeys(this.shape).forEach(n=>{if(e&&!e[n])t[n]=this.shape[n];else{let e=this.shape[n];for(;e instanceof DC;)e=e._def.innerType;t[n]=e}}),new Do({...this._def,shape:()=>t})}keyof(){return Dg(m.objectKeys(this.shape))}}Do.create=(e,t)=>new Do({shape:()=>e,unknownKeys:"strip",catchall:Dn.create(),typeName:v.ZodObject,...WV(t)}),Do.strictCreate=(e,t)=>new Do({shape:()=>e,unknownKeys:"strict",catchall:Dn.create(),typeName:v.ZodObject,...WV(t)}),Do.lazycreate=(e,t)=>new Do({shape:e,unknownKeys:"strip",catchall:Dn.create(),typeName:v.ZodObject,...WV(t)});class Da extends Wz{_parse(e){let{ctx:t}=this._processInputParams(e),n=this._def.options;if(t.common.async)return Promise.all(n.map(async e=>{let n={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:n}),ctx:n}})).then(function(e){for(let t of e)if("valid"===t.result.status)return t.result;for(let n of e)if("dirty"===n.result.status)return t.common.issues.push(...n.ctx.common.issues),n.result;let n=e.map(e=>new WR(e.ctx.common.issues));return WF(t,{code:WO.invalid_union,unionErrors:n}),WL});{let e;let r=[];for(let i of n){let n={...t,common:{...t.common,issues:[]},parent:null},o=i._parseSync({data:t.data,path:t.path,parent:n});if("valid"===o.status)return o;"dirty"!==o.status||e||(e={result:o,ctx:n}),n.common.issues.length&&r.push(n.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;let i=r.map(e=>new WR(e));return WF(t,{code:WO.invalid_union,unionErrors:i}),WL}}get options(){return this._def.options}}Da.create=(e,t)=>new Da({options:e,typeName:v.ZodUnion,...WV(t)});let Du=e=>e instanceof Dh?Du(e.schema):e instanceof Db?Du(e.innerType()):e instanceof Dm?[e.value]:e instanceof Dy?e.options:e instanceof Dv?Object.keys(e.enum):e instanceof Dw?Du(e._def.innerType):e instanceof W7?[void 0]:e instanceof W8?[null]:null;class Ds extends Wz{_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==W_.object)return WF(t,{code:WO.invalid_type,expected:W_.object,received:t.parsedType}),WL;let n=this.discriminator,r=t.data[n],i=this.optionsMap.get(r);return i?t.common.async?i._parseAsync({data:t.data,path:t.path,parent:t}):i._parseSync({data:t.data,path:t.path,parent:t}):(WF(t,{code:WO.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),WL)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,n){let r=new Map;for(let n of t){let t=Du(n.shape[e]);if(!t)throw Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let i of t){if(r.has(i))throw Error(`Discriminator property ${String(e)} has duplicate value ${String(i)}`);r.set(i,n)}}return new Ds({typeName:v.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:r,...WV(n)})}}class Dl extends Wz{_parse(e){let{status:t,ctx:n}=this._processInputParams(e),r=(e,r)=>{if(WP(e)||WP(r))return WL;let i=function e(t,n){let r=WT(t),i=WT(n);if(t===n)return{valid:!0,data:t};if(r===W_.object&&i===W_.object){let r=m.objectKeys(n),i=m.objectKeys(t).filter(e=>-1!==r.indexOf(e)),o={...t,...n};for(let r of i){let i=e(t[r],n[r]);if(!i.valid)return{valid:!1};o[r]=i.data}return{valid:!0,data:o}}if(r!==W_.array||i!==W_.array)return r===W_.date&&i===W_.date&&+t==+n?{valid:!0,data:t}:{valid:!1};{if(t.length!==n.length)return{valid:!1};let r=[];for(let i=0;i<t.length;i++){let o=e(t[i],n[i]);if(!o.valid)return{valid:!1};r.push(o.data)}return{valid:!0,data:r}}}(e.value,r.value);return i.valid?((WW(e)||WW(r))&&t.dirty(),{status:t.value,value:i.data}):(WF(n,{code:WO.invalid_intersection_types}),WL)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([e,t])=>r(e,t)):r(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}}Dl.create=(e,t,n)=>new Dl({left:e,right:t,typeName:v.ZodIntersection,...WV(n)});class Dc extends Wz{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==W_.array)return WF(n,{code:WO.invalid_type,expected:W_.array,received:n.parsedType}),WL;if(n.data.length<this._def.items.length)return WF(n,{code:WO.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),WL;!this._def.rest&&n.data.length>this._def.items.length&&(WF(n,{code:WO.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());let r=[...n.data].map((e,t)=>{let r=this._def.items[t]||this._def.rest;return r?r._parse(new Wq(n,e,n.path,t)):null}).filter(e=>!!e);return n.common.async?Promise.all(r).then(e=>WU.mergeArray(t,e)):WU.mergeArray(t,r)}get items(){return this._def.items}rest(e){return new Dc({...this._def,rest:e})}}Dc.create=(e,t)=>{if(!Array.isArray(e))throw Error("You must pass an array of schemas to z.tuple([ ... ])");return new Dc({items:e,typeName:v.ZodTuple,rest:null,...WV(t)})};class Dd extends Wz{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==W_.object)return WF(n,{code:WO.invalid_type,expected:W_.object,received:n.parsedType}),WL;let r=[],i=this._def.keyType,o=this._def.valueType;for(let e in n.data)r.push({key:i._parse(new Wq(n,e,n.path,e)),value:o._parse(new Wq(n,n.data[e],n.path,e))});return n.common.async?WU.mergeObjectAsync(t,r):WU.mergeObjectSync(t,r)}get element(){return this._def.valueType}static create(e,t,n){return new Dd(t instanceof Wz?{keyType:e,valueType:t,typeName:v.ZodRecord,...WV(n)}:{keyType:W2.create(),valueType:e,typeName:v.ZodRecord,...WV(t)})}}class Df extends Wz{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==W_.map)return WF(n,{code:WO.invalid_type,expected:W_.map,received:n.parsedType}),WL;let r=this._def.keyType,i=this._def.valueType,o=[...n.data.entries()].map(([e,t],o)=>({key:r._parse(new Wq(n,e,n.path,[o,"key"])),value:i._parse(new Wq(n,t,n.path,[o,"value"]))}));if(n.common.async){let e=new Map;return Promise.resolve().then(async()=>{for(let n of o){let r=await n.key,i=await n.value;if("aborted"===r.status||"aborted"===i.status)return WL;("dirty"===r.status||"dirty"===i.status)&&t.dirty(),e.set(r.value,i.value)}return{status:t.value,value:e}})}{let e=new Map;for(let n of o){let r=n.key,i=n.value;if("aborted"===r.status||"aborted"===i.status)return WL;("dirty"===r.status||"dirty"===i.status)&&t.dirty(),e.set(r.value,i.value)}return{status:t.value,value:e}}}}Df.create=(e,t,n)=>new Df({valueType:t,keyType:e,typeName:v.ZodMap,...WV(n)});class Dp extends Wz{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==W_.set)return WF(n,{code:WO.invalid_type,expected:W_.set,received:n.parsedType}),WL;let r=this._def;null!==r.minSize&&n.data.size<r.minSize.value&&(WF(n,{code:WO.too_small,minimum:r.minSize.value,type:"set",inclusive:!0,exact:!1,message:r.minSize.message}),t.dirty()),null!==r.maxSize&&n.data.size>r.maxSize.value&&(WF(n,{code:WO.too_big,maximum:r.maxSize.value,type:"set",inclusive:!0,exact:!1,message:r.maxSize.message}),t.dirty());let i=this._def.valueType;function o(e){let n=new Set;for(let r of e){if("aborted"===r.status)return WL;"dirty"===r.status&&t.dirty(),n.add(r.value)}return{status:t.value,value:n}}let a=[...n.data.values()].map((e,t)=>i._parse(new Wq(n,e,n.path,t)));return n.common.async?Promise.all(a).then(e=>o(e)):o(a)}min(e,t){return new Dp({...this._def,minSize:{value:e,message:y.toString(t)}})}max(e,t){return new Dp({...this._def,maxSize:{value:e,message:y.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}Dp.create=(e,t)=>new Dp({valueType:e,minSize:null,maxSize:null,typeName:v.ZodSet,...WV(t)});class DA extends Wz{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==W_.function)return WF(t,{code:WO.invalid_type,expected:W_.function,received:t.parsedType}),WL;function n(e,n){return Wj({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,WM(),Wk].filter(e=>!!e),issueData:{code:WO.invalid_arguments,argumentsError:n}})}function r(e,n){return Wj({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,WM(),Wk].filter(e=>!!e),issueData:{code:WO.invalid_return_type,returnTypeError:n}})}let i={errorMap:t.common.contextualErrorMap},o=t.data;return this._def.returns instanceof Dx?WB(async(...e)=>{let t=new WR([]),a=await this._def.args.parseAsync(e,i).catch(r=>{throw t.addIssue(n(e,r)),t}),u=await o(...a);return await this._def.returns._def.type.parseAsync(u,i).catch(e=>{throw t.addIssue(r(u,e)),t})}):WB((...e)=>{let t=this._def.args.safeParse(e,i);if(!t.success)throw new WR([n(e,t.error)]);let a=o(...t.data),u=this._def.returns.safeParse(a,i);if(!u.success)throw new WR([r(a,u.error)]);return u.data})}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new DA({...this._def,args:Dc.create(e).rest(Dt.create())})}returns(e){return new DA({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,n){return new DA({args:e||Dc.create([]).rest(Dt.create()),returns:t||Dt.create(),typeName:v.ZodFunction,...WV(n)})}}class Dh extends Wz{get schema(){return this._def.getter()}_parse(e){let{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}Dh.create=(e,t)=>new Dh({getter:e,typeName:v.ZodLazy,...WV(t)});class Dm extends Wz{_parse(e){if(e.data!==this._def.value){let t=this._getOrReturnCtx(e);return WF(t,{received:t.data,code:WO.invalid_literal,expected:this._def.value}),WL}return{status:"valid",value:e.data}}get value(){return this._def.value}}function Dg(e,t){return new Dy({values:e,typeName:v.ZodEnum,...WV(t)})}Dm.create=(e,t)=>new Dm({value:e,typeName:v.ZodLiteral,...WV(t)});class Dy extends Wz{_parse(e){if("string"!=typeof e.data){let t=this._getOrReturnCtx(e),n=this._def.values;return WF(t,{expected:m.joinValues(n),received:t.parsedType,code:WO.invalid_type}),WL}if(-1===this._def.values.indexOf(e.data)){let t=this._getOrReturnCtx(e),n=this._def.values;return WF(t,{received:t.data,code:WO.invalid_enum_value,options:n}),WL}return WB(e.data)}get options(){return this._def.values}get enum(){let e={};for(let t of this._def.values)e[t]=t;return e}get Values(){let e={};for(let t of this._def.values)e[t]=t;return e}get Enum(){let e={};for(let t of this._def.values)e[t]=t;return e}extract(e){return Dy.create(e)}exclude(e){return Dy.create(this.options.filter(t=>!e.includes(t)))}}Dy.create=Dg;class Dv extends Wz{_parse(e){let t=m.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==W_.string&&n.parsedType!==W_.number){let e=m.objectValues(t);return WF(n,{expected:m.joinValues(e),received:n.parsedType,code:WO.invalid_type}),WL}if(-1===t.indexOf(e.data)){let e=m.objectValues(t);return WF(n,{received:n.data,code:WO.invalid_enum_value,options:e}),WL}return WB(e.data)}get enum(){return this._def.values}}Dv.create=(e,t)=>new Dv({values:e,typeName:v.ZodNativeEnum,...WV(t)});class Dx extends Wz{unwrap(){return this._def.type}_parse(e){let{ctx:t}=this._processInputParams(e);return t.parsedType!==W_.promise&&!1===t.common.async?(WF(t,{code:WO.invalid_type,expected:W_.promise,received:t.parsedType}),WL):WB((t.parsedType===W_.promise?t.data:Promise.resolve(t.data)).then(e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap})))}}Dx.create=(e,t)=>new Dx({type:e,typeName:v.ZodPromise,...WV(t)});class Db extends Wz{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===v.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:t,ctx:n}=this._processInputParams(e),r=this._def.effect||null;if("preprocess"===r.type){let e=r.transform(n.data);return n.common.async?Promise.resolve(e).then(e=>this._def.schema._parseAsync({data:e,path:n.path,parent:n})):this._def.schema._parseSync({data:e,path:n.path,parent:n})}let i={addIssue:e=>{WF(n,e),e.fatal?t.abort():t.dirty()},get path(){return n.path}};if(i.addIssue=i.addIssue.bind(i),"refinement"===r.type){let e=e=>{let t=r.refinement(e,i);if(n.common.async)return Promise.resolve(t);if(t instanceof Promise)throw Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return e};if(!1!==n.common.async)return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(n=>"aborted"===n.status?WL:("dirty"===n.status&&t.dirty(),e(n.value).then(()=>({status:t.value,value:n.value}))));{let r=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return"aborted"===r.status?WL:("dirty"===r.status&&t.dirty(),e(r.value),{status:t.value,value:r.value})}}if("transform"===r.type){if(!1!==n.common.async)return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(e=>WD(e)?Promise.resolve(r.transform(e.value,i)).then(e=>({status:t.value,value:e})):e);{let e=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!WD(e))return e;let o=r.transform(e.value,i);if(o instanceof Promise)throw Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:o}}}m.assertNever(r)}}Db.create=(e,t,n)=>new Db({schema:e,typeName:v.ZodEffects,effect:t,...WV(n)}),Db.createWithPreprocess=(e,t,n)=>new Db({schema:t,effect:{type:"preprocess",transform:e},typeName:v.ZodEffects,...WV(n)});class DC extends Wz{_parse(e){return this._getType(e)===W_.undefined?WB(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}DC.create=(e,t)=>new DC({innerType:e,typeName:v.ZodOptional,...WV(t)});class DS extends Wz{_parse(e){return this._getType(e)===W_.null?WB(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}DS.create=(e,t)=>new DS({innerType:e,typeName:v.ZodNullable,...WV(t)});class Dw extends Wz{_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;return t.parsedType===W_.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}Dw.create=(e,t)=>new Dw({innerType:e,typeName:v.ZodDefault,defaultValue:"function"==typeof t.default?t.default:()=>t.default,...WV(t)});class DI extends Wz{_parse(e){let{ctx:t}=this._processInputParams(e),n={...t,common:{...t.common,issues:[]}},r=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return WN(r)?r.then(e=>({status:"valid",value:"valid"===e.status?e.value:this._def.catchValue({get error(){return new WR(n.common.issues)},input:n.data})})):{status:"valid",value:"valid"===r.status?r.value:this._def.catchValue({get error(){return new WR(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}}DI.create=(e,t)=>new DI({innerType:e,typeName:v.ZodCatch,catchValue:"function"==typeof t.catch?t.catch:()=>t.catch,...WV(t)});class D_ extends Wz{_parse(e){if(this._getType(e)!==W_.nan){let t=this._getOrReturnCtx(e);return WF(t,{code:WO.invalid_type,expected:W_.nan,received:t.parsedType}),WL}return{status:"valid",value:e.data}}}D_.create=e=>new D_({typeName:v.ZodNaN,...WV(e)});let DT=Symbol("zod_brand");class DO extends Wz{_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;return this._def.type._parse({data:n,path:t.path,parent:t})}unwrap(){return this._def.type}}class DR extends Wz{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{let e=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return"aborted"===e.status?WL:"dirty"===e.status?(t.dirty(),WK(e.value)):this._def.out._parseAsync({data:e.value,path:n.path,parent:n})})();{let e=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return"aborted"===e.status?WL:"dirty"===e.status?(t.dirty(),{status:"dirty",value:e.value}):this._def.out._parseSync({data:e.value,path:n.path,parent:n})}}static create(e,t){return new DR({in:e,out:t,typeName:v.ZodPipeline})}}let Dk=(e,t={},n)=>e?De.create().superRefine((r,i)=>{var o,a;if(!e(r)){let e="function"==typeof t?t(r):"string"==typeof t?{message:t}:t,u=null===(a=null!==(o=e.fatal)&&void 0!==o?o:n)||void 0===a||a;i.addIssue({code:"custom",..."string"==typeof e?{message:e}:e,fatal:u})}}):De.create(),DE={object:Do.lazycreate};(l=v||(v={})).ZodString="ZodString",l.ZodNumber="ZodNumber",l.ZodNaN="ZodNaN",l.ZodBigInt="ZodBigInt",l.ZodBoolean="ZodBoolean",l.ZodDate="ZodDate",l.ZodSymbol="ZodSymbol",l.ZodUndefined="ZodUndefined",l.ZodNull="ZodNull",l.ZodAny="ZodAny",l.ZodUnknown="ZodUnknown",l.ZodNever="ZodNever",l.ZodVoid="ZodVoid",l.ZodArray="ZodArray",l.ZodObject="ZodObject",l.ZodUnion="ZodUnion",l.ZodDiscriminatedUnion="ZodDiscriminatedUnion",l.ZodIntersection="ZodIntersection",l.ZodTuple="ZodTuple",l.ZodRecord="ZodRecord",l.ZodMap="ZodMap",l.ZodSet="ZodSet",l.ZodFunction="ZodFunction",l.ZodLazy="ZodLazy",l.ZodLiteral="ZodLiteral",l.ZodEnum="ZodEnum",l.ZodEffects="ZodEffects",l.ZodNativeEnum="ZodNativeEnum",l.ZodOptional="ZodOptional",l.ZodNullable="ZodNullable",l.ZodDefault="ZodDefault",l.ZodCatch="ZodCatch",l.ZodPromise="ZodPromise",l.ZodBranded="ZodBranded",l.ZodPipeline="ZodPipeline";let DM=W2.create,Dj=W6.create,DF=D_.create,DU=W5.create,DL=W3.create,DK=W9.create,DB=W4.create,DP=W7.create,DW=W8.create,DD=De.create,DN=Dt.create,Dq=Dn.create,DQ=Dr.create,DV=Di.create,Dz=Do.create,DY=Do.strictCreate,DH=Da.create,DG=Ds.create,DZ=Dl.create,DJ=Dc.create,D$=Dd.create,DX=Df.create,D0=Dp.create,D1=DA.create,D2=Dh.create,D6=Dm.create,D5=Dy.create,D3=Dv.create,D9=Dx.create,D4=Db.create,D7=DC.create,D8=DS.create,Ne=Db.createWithPreprocess,Nt=DR.create;var Nn=Object.freeze({__proto__:null,defaultErrorMap:Wk,setErrorMap:function(e){WE=e},getErrorMap:WM,makeIssue:Wj,EMPTY_PATH:[],addIssueToContext:WF,ParseStatus:WU,INVALID:WL,DIRTY:WK,OK:WB,isAborted:WP,isDirty:WW,isValid:WD,isAsync:WN,get util(){return m},get objectUtil(){return g},ZodParsedType:W_,getParsedType:WT,ZodType:Wz,ZodString:W2,ZodNumber:W6,ZodBigInt:W5,ZodBoolean:W3,ZodDate:W9,ZodSymbol:W4,ZodUndefined:W7,ZodNull:W8,ZodAny:De,ZodUnknown:Dt,ZodNever:Dn,ZodVoid:Dr,ZodArray:Di,ZodObject:Do,ZodUnion:Da,ZodDiscriminatedUnion:Ds,ZodIntersection:Dl,ZodTuple:Dc,ZodRecord:Dd,ZodMap:Df,ZodSet:Dp,ZodFunction:DA,ZodLazy:Dh,ZodLiteral:Dm,ZodEnum:Dy,ZodNativeEnum:Dv,ZodPromise:Dx,ZodEffects:Db,ZodTransformer:Db,ZodOptional:DC,ZodNullable:DS,ZodDefault:Dw,ZodCatch:DI,ZodNaN:D_,BRAND:DT,ZodBranded:DO,ZodPipeline:DR,custom:Dk,Schema:Wz,ZodSchema:Wz,late:DE,get ZodFirstPartyTypeKind(){return v},coerce:{string:e=>W2.create({...e,coerce:!0}),number:e=>W6.create({...e,coerce:!0}),boolean:e=>W3.create({...e,coerce:!0}),bigint:e=>W5.create({...e,coerce:!0}),date:e=>W9.create({...e,coerce:!0})},any:DD,array:DV,bigint:DU,boolean:DL,date:DK,discriminatedUnion:DG,effect:D4,enum:D5,function:D1,instanceof:(e,t={message:`Input not instance of ${e.name}`})=>Dk(t=>t instanceof e,t),intersection:DZ,lazy:D2,literal:D6,map:DX,nan:DF,nativeEnum:D3,never:Dq,null:DW,nullable:D8,number:Dj,object:Dz,oboolean:()=>DL().optional(),onumber:()=>Dj().optional(),optional:D7,ostring:()=>DM().optional(),pipeline:Nt,preprocess:Ne,promise:D9,record:D$,set:D0,strictObject:DY,string:DM,symbol:DB,transformer:D4,tuple:DJ,undefined:DP,union:DH,unknown:DN,void:DQ,NEVER:WL,ZodIssueCode:WO,quotelessJson:e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),ZodError:WR});let Nr=Nn.object({id:Nn.string(),label:Nn.string(),repeatable:Nn.boolean(),status:Nn.boolean()}),Ni=Nn.array(Nr);function No(e,t,n){return(0,k.WY)(new URL("customtypes",e),{headers:{repository:t},credentials:(0,k.xb)(n),okType:Ni})}let Na=Nn.object({first_name:Nn.string().optional(),last_name:Nn.string().optional(),email:Nn.string().optional()}),Nu=Nn.object({id:Nn.string(),name:Nn.string(),is_master:Nn.boolean().optional()}),Ns=Nn.discriminatedUnion("status",[Nn.object({status:Nn.literal("unclassified")}),Nn.object({status:Nn.literal("published")}),Nn.object({status:Nn.literal("release"),release_id:Nn.string()}),Nn.object({status:Nn.literal("archived")})]).and(Nn.object({version_id:Nn.string(),tags:Nn.array(Nn.string()),custom_type_label:Nn.string(),preview_summary:Nn.string().optional(),preview_image:Nn.string().optional(),last_modified_date:Nn.coerce.date(),author:Na,uid:Nn.string().optional()})),Nl=Nn.object({id:Nn.string(),title:Nn.string().nullish().transform(e=>e??"Untitled"),custom_type_id:Nn.string(),group_lang_id:Nn.string(),language:Nu,versions:Nn.array(Ns)}),Nc=Nn.object({total:Nn.number(),cursor:Nn.string().optional(),results:Nn.array(Nl)}),Nd=Nn.object({id:Nn.string(),title:Nn.string(),repository_id:Nn.string(),tags:Nn.array(Nn.string()).optional()}).passthrough(),Nf=Nn.object({results:Nn.array(Nd)});function Np(e,t,n,r,i){let o=new URL("documents",e);return r&&o.searchParams.set("limit",r.toString()),i&&o.searchParams.set("cursor",i),o.search+=`&${n}`,(0,k.WY)(o,{credentials:(0,k.xb)(t),okType:Nc})}function NA(e){return e.reduce((e,t)=>{if(t.values.every(e=>""===e))return e;let n=t.values.map(e=>[t.name,e]);return e.concat(n)},[])}function Nh(e,t,n){return(0,k.WY)(new URL(`documents/${n}`,e),{credentials:(0,k.xb)(t),okType:Nl})}function Nm(e){return new URLSearchParams(NA((0,S.XP)(e).flatMap(t=>{let n=e[t];return n?{name:t,values:n}:[]}))).toString()}async function Ng(e,t,n){if(0===n.length)return[];let r=n.slice(0,50).map(({id:e})=>e),i=await Np(e,t,Nm({document_id:r}),r.length),o=new Map(r.map((e,t)=>[e,t]));return i.results.sort((e,t)=>(o.get(e.id)??1/0)-(o.get(t.id)??1/0))}Nn.custom().transform((e,t)=>{let n=Q.Document.decode(e);return"Left"===n._tag?(t.addIssue({code:Nn.ZodIssueCode.custom,message:"Invalid document."}),Nn.NEVER):n.right}),Nn.unknown().transform((e,t)=>{let n=Q.SliceItemContent.decode(e);return"Right"===n._tag?n.right:(t.addIssue({code:Nn.ZodIssueCode.custom,message:"Invalid slice content."}),Nn.NEVER)});let Ny=Nn.object({id:Nn.string(),firstname:Nn.string().optional(),lastname:Nn.string().optional(),email:Nn.string()}),Nv=Nn.array(Ny),Nx=Nn.object({slicemachineEnabled:Nn.boolean()}),Nb=["next","nuxt","sveltekit"],NC=Nn.preprocess(e=>"string"==typeof e&&Nb.includes(e)?e:"other",Nn.enum([...Nb,"other"])),NS=Nn.object({simulator_url:Nn.string().url().nullish(),languages:Nn.array(Nu).transform(e=>(0,R.DY)(e,e=>e.name)),authors:Nv.optional().default([]),quotas:Nx.optional().default({slicemachineEnabled:!1}),framework:NC.optional().default("other"),storageVersion:Nn.object({major:Nn.number().int(),minor:Nn.number().int()})}).transform(({simulator_url:e,framework:t,...n})=>{let r=e&&function(e){let t=(0,C.ju)(e);return!!t&&t.pathname.endsWith("/slice-simulator")}(e)?e:void 0;return{...n,simulatorUrl:r,isSupportedFramework:"other"!==t}});function Nw(e,t){return(0,k.WY)(new URL("repository",e),{credentials:(0,k.xb)(t),okType:NS})}let NI=Nn.object({results:Nn.array(Nn.string())});function N_(e,t){return(0,k.WY)(new URL("repository/tags",e),{credentials:(0,k.xb)(t),okType:NI})}function NT(){let e=WS();e.mediaLibrary||WI("mediaLibrary");let{assetsApiBaseUrl:t,authStrategy:n,repository:r}=e,{items:i}=(0,O.QT)(NO,[t,r,n]);return{tags:i}}function NO(e,t,n){return(0,k.WY)(new URL("tags",e),{credentials:(0,k.xb)(n),okType:NE,headers:{repository:t}})}let NR=Nn.string().min(3).max(20),Nk=Nn.object({id:Nn.string(),name:NR,uploader_id:Nn.string().optional(),created_at:Nn.number(),last_modified:Nn.number(),count:Nn.number().optional().default(0)}),NE=Nn.object({items:Nn.array(Nk)});function NM(e){(0,O.YC)(NO,t=>{let{items:n}=t,r=e(n);if(r)return{items:r}})}let Nj=Nn.array(Nn.string()).optional().transform(e=>null==e?void 0:e[0]),NF=Nn.object({id:Nn.string(),kind:Nn.string(),extension:Nn.string().optional(),filename:Nn.string(),width:Nn.number().optional(),height:Nn.number().optional(),last_modified:Nn.number(),url:Nn.string(),alt:Nn.string().optional(),size:Nn.number(),notes:Nn.string().optional(),credits:Nn.string().optional(),search_highlight:Nn.object({filename:Nj,alt:Nj,notes:Nj,credits:Nj}).optional(),tags:Nn.array(Nk)}),NU={"X-Prismic-Source":"Wroom"},NL=Nn.object({total:Nn.number(),cursor:Nn.string().optional(),items:Nn.array(NF)});function NK(e,t,n,r,i,o,a,u){let s=e?new URL("assets",e):void 0,l=new URLSearchParams(NA([{name:"limit",values:["30"]},{name:"cursor",values:[u??""]},{name:"keyword",values:[i]},{name:"tags",values:o.split(",")},{name:"assetType",values:[r]}])).toString(),c=NL.transform(e=>({...e,assetType:r,keyword:i,page:a,tags:o})),d=performance.now();return(0,k.WY)(`${(null==s?void 0:s.href)??""}?${l}`,{headers:{repository:t,...NU},credentials:(0,k.xb)(n),okType:c}).then(e=>({...e,time:(performance.now()-d).toFixed(0)}))}O.Fs.registerFetcherConfig(NK,{revalidationStrategy:{type:"never"}});let NB={keyword:"",assetType:"all",tagIds:[]};function NP(e){Nq(t=>t.flatMap(t=>{let n=e.find(e=>e.id===t.id);return n?void 0===n.response?[]:{...t,...n.response}:t}))}function NW(e){Nq(t=>t.filter(t=>!e.includes(t.id)))}function ND(e){let{keyword:t,assetType:n,tagIds:r}=e,i=null==r?void 0:r.join(",");(0,O.YC)(NK,e=>{if(!(e.keyword===t&&e.tags===i&&e.assetType===n))return e})}function NN(e,t,n,r){let i=e.filter(e=>e.assetType===t&&e.keyword===n&&e.tags===r),o=(0,R.DY)(i,e=>e.page).flatMap(e=>e.items);return n?(0,R.mN)(o,e=>e.id):o}function Nq(e){(0,O.YC)(NK,t=>{let{items:n,total:r}=t,i=e(n,t);if(i)return{...t,total:r+(i.length-n.length),items:i}})}function NQ(e){let{config:t,keyword:n=NB.keyword,assetType:r=NB.assetType,tagIds:i=NB.tagIds}=e;if(!t.mediaLibrary)throw Error("media library is not configured");let{assetsApiBaseUrl:o,authStrategy:a,repository:u}=t;(0,O.gw)(NK,Nz({assetsApiBaseUrl:o,repository:u,authStrategy:a,keyword:n,assetType:r,tagIds:i,page:0}))}function NV(e){let{config:t,keyword:n=NB.keyword,assetType:r=NB.assetType,tagIds:i=NB.tagIds}=e;if(!t.mediaLibrary)throw Error("media library is not configured");(0,O.YC)(NK,e=>0===e.page?e:void 0),NQ({config:t,keyword:n,assetType:r,tagIds:i})}function Nz(e){return[e.assetsApiBaseUrl,e.repository,e.authStrategy,e.assetType,e.keyword,e.tagIds.join(","),e.page,e.cursor]}let NY=new Uint8Array(16),NH=[];for(let e=0;e<256;++e)NH.push((e+256).toString(16).slice(1));let NG={randomUUID:"u">typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)},NZ=(0,x.createContext)(void 0);function NJ(e){let{children:t,assetType:n=NB.assetType,onSelectedChange:i,actionContainerRef:o}=e,[a,u]=(0,x.useTransition)(),[s,l]=(0,x.useTransition)(),c=WS(),{showAlert:d}=(0,b.VY)(),{keyword:f,tagIds:p,assetType:A,setFilters:h,resetFilters:m,media:g,fetchNextPage:y,hasNextPage:v,updateMedia:C,unshiftMedia:S,deleteMedia:w,mediaTotal:I,deleteSearchData:_,revalidateFirstPage:R}=function(e){let{initialAssetType:t=NB.assetType,mode:n}=e,r=WS(),[i,o]=(0,x.useState)({...NB,assetType:t,page:0});r.mediaLibrary||WI("mediaLibrary");let{assetsApiBaseUrl:a,authStrategy:u,repository:s}=r,{keyword:l,page:c,cursor:d,assetType:f,tagIds:p}=i,A=(0,O.QT)(NK,Nz({assetsApiBaseUrl:a,authStrategy:u,repository:s,assetType:f,keyword:l,tagIds:p,page:c,cursor:d}));!function(e){let{assetType:t,keyword:n,mode:r,tagIds:i}=e,o=WS();o.mediaLibrary||WI("mediaLibrary");let{onAnalyticsEvent:a}=o,u=(0,O.q_)(NK),s=u[u.length-1],l=(0,x.useRef)(s);l.current=s,(0,x.useEffect)(()=>{if(!a||!n||!l.current||l.current.keyword!==n)return;let e=String(n.split(" ").length),o=String(l.current.total),u=i.join(",");a("Media Library Search",{searchQuery:n,numberOfWords:e,numberOfResults:o,timeToGetResults:l.current.time,assetType:t,mode:r,tags:u})},[n,t,r,a,i])}({assetType:f,keyword:l,tagIds:p,mode:n});let h=NN((0,O.q_)(NK),f,l,p.join(",")),m=A.total!==h.length;return{keyword:l,assetType:f,tagIds:p,setFilters:function(e){o(t=>({...t,...e,page:0,cursor:void 0}))},resetFilters:function(){o(e=>({...e,...NB,assetType:"all"===t?NB.assetType:e.assetType,page:0,cursor:void 0}))},media:h,mediaTotal:A.total,limit:30,hasNextPage:m,fetchNextPage:function(){void 0!==A.cursor&&o(e=>({...e,page:e.page+1,cursor:A.cursor}))},updateMedia:NP,unshiftMedia:function(e){o(e=>({...e,page:0,cursor:void 0})),Nq((t,n)=>{if(0===n.page)return[...e,...t]})},deleteMedia:NW,deleteSearchData:ND,revalidateFirstPage:NQ}}({initialAssetType:n,mode:i?"select":"browse"}),[E,M]=(0,x.useState)(),{isMediaRevalidationInProgress:j,isMediaCacheInvalid:F,revalidateMedia:U,revalidateWithParams:L}=function(e){let{revalidate:t,config:n,keyword:r,assetType:i,tagIds:o}=e,{assetsApiBaseUrl:a,repository:u="",authStrategy:s="token"}=n.mediaLibrary?n:{},[l,c]=(0,x.useState)(!1),[d,f]=(0,x.useState)(!1),p={assetsApiBaseUrl:a,repository:u,authStrategy:s,keyword:r,assetType:i,tagIds:o,page:0},{revalidateData:A}=(0,O.NN)({fetcher:NK,requestParams:Nz(p),validator:(e,t)=>{var n,r;return((null==(n=e.items[0])?void 0:n.id)??"")!==((null==(r=t.items[0])?void 0:r.id)??"")||e.total!==(null==t?void 0:t.total)},onCacheInvalidated:()=>f(!0),every:6e4});return(0,x.useEffect)(()=>{l&&(f(!1),c(!1))},[l]),{isMediaRevalidationInProgress:l,isMediaCacheInvalid:d,revalidateMedia:function(){c(!0),t()},revalidateWithParams:e=>{A(Nz({...p,...e}))}}}({config:c,revalidate:function(){NV({config:c,keyword:f,assetType:A,tagIds:p})},keyword:f,assetType:A,tagIds:p}),{isUploading:K,onFilesSelected:B,uploadingFiles:P,onRetry:W}=function(e){let{onBeforeUpload:t,onComplete:n}=e,[i,o]=(0,x.useState)([]),a=i.some(e=>"idle"===e.status||"uploading"===e.status),u=WS(),s=(0,x.useCallback)(e=>{let n=[{...e,status:"idle"},...i.filter(t=>t.id!==e.id)];o(n),t(n)},[t,i]);return(0,x.useEffect)(function(){if(!i.length||i.some(e=>"uploading"===e.status)||i.every(e=>"error"===e.status))return;let e=i.find(e=>"idle"===e.status);if(!e)return;let t=i;function r(e){o(t=e(t)),t.every(e=>"success"===e.status||"error"===e.status)&&setTimeout(()=>{o([]),null==n||n(t)},1500)}r(t=>t.map(t=>t.id===e.id?{...t,status:"uploading"}:t)),(function(e){let{file:t,config:n}=e;if(!n.mediaLibrary)throw Error("Media Library not configured.");let{assetsApiBaseUrl:r,repository:i,authStrategy:o}=n,a=new FormData;return a.append(t.name,t),(0,k.WY)(new URL("assets",r),{headers:{repository:i,"Content-Type":"multipart/form-data",...NU},method:"POST",body:a,credentials:(0,k.xb)(o),okType:NF})})({file:e.file,config:u}).then(t=>{r(n=>n.map(n=>n.id===e.id?{...n,status:"success",response:t}:n))}).catch(()=>{r(t=>t.map(t=>t.id===e.id?{...t,status:"error"}:t))})},[u,i,n]),{isUploading:a,uploadingFiles:i,onFilesSelected:function(e){let n=e.map(e=>({id:`temp-${function(e,t,n){if(NG.randomUUID&&!e)return NG.randomUUID();let i=(e=e||{}).random||(e.rng||function(){if(!r&&!(r="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 r(NY)})();return i[6]=15&i[6]|64,i[8]=63&i[8]|128,function(e,t=0){return NH[e[t+0]]+NH[e[t+1]]+NH[e[t+2]]+NH[e[t+3]]+"-"+NH[e[t+4]]+NH[e[t+5]]+"-"+NH[e[t+6]]+NH[e[t+7]]+"-"+NH[e[t+8]]+NH[e[t+9]]+"-"+NH[e[t+10]]+NH[e[t+11]]+NH[e[t+12]]+NH[e[t+13]]+NH[e[t+14]]+NH[e[t+15]]}(i)}()}`,file:e,status:"idle"}));o(n),t(n)},onRetry:s}}({onBeforeUpload:e=>{m();let t=e.filter(e=>"idle"===e.status).map(e=>({id:e.id,url:URL.createObjectURL(e.file),filename:e.file.name,size:e.file.size,extension:e.file.type,kind:e.file.type,last_modified:e.file.lastModified,tags:[]}));S(t);let[n]=t??[];n&&D.toggleSelection({id:n.id,isSingleSelection:!0})},onComplete:e=>{let t=e.flatMap(e=>"success"===e.status?e:(function(e){let t=(0,T.tx)(e.file.name,30);d({id:e.id,title:`The specified file "${t}" could not be uploaded.`,subtitle:q.jsxs(b.xv,{color:"inherit",children:["Read more about our"," ",q.jsx(b.xv,{color:"tomato11",href:"https://prismic.io/docs/guides/manage-images#supported-media",underline:!0,children:"supported media"}),"."]}),buttons:{action:{text:"Retry upload",icon:"cloudUpload",onClick:()=>W(e)}}})}(e),{id:e.id,response:void 0}));C(t),R({config:c,assetType:A,tagIds:p});let n=t[0];n&&n.response&&D.isSelected(n.id)&&D.toggleSelection({id:n.response.id,isSingleSelection:!0})}}),D=Wv({totalItemCount:I,onChangeSelection:({selectedIds:e,selectedCount:t})=>{if(Q(!1),i){if(1===t){let[t]=[...e];if(P.some(e=>e.id===t&&"success"!==e.status)){i(new Set);return}}i(new Set(e))}}}),[N,Q]=(0,x.useState)(!1);return q.jsx(NZ.Provider,{value:{isFetchingMedia:a,media:g,mediaTotal:I,onScrollToBottom:function(){v&&u(y)},actionContainerRef:o,onFilesUpload:function(e){K||B(e)},isUploading:K,uploadingFiles:P,isMediaRevalidationInProgress:j,isMediaCacheInvalid:F,revalidateMedia:U,deleteMedia:w,updateMedia:function(e,t){C([{id:e,response:t}])},keyword:f,isSearchingMedia:s,assetType:A,initialAssetType:n,tagManagerOpen:N,setTagManagerOpen:Q,tagIds:p,onFilterChange:function(e){let t={keyword:f,assetType:A,tagIds:p,...e};!function(e){let t=e.keyword===NB.keyword,r=e.assetType===n,i=e.tagIds.length===NB.tagIds.length&&e.tagIds.every((e,t)=>e===NB.tagIds[t]);return t&&r&&i}(t)?_(t):L(e),l(()=>{h(e),D.clearSelection()})},openMediaSection:E,setOpenMediaSection:M},children:t})}function N$(){let e=(0,x.useContext)(NZ);if(!e)throw Error("useMediaLibrary must be used within a MediaLibraryProvider");return e}function NX(){return 0===function(){let e=WS(),{initialAssetType:t}=N$(),{assetsApiBaseUrl:n,repository:r="",authStrategy:i="token"}=e.mediaLibrary?e:{},{total:o}=(0,O.QT)(NK,Nz({assetsApiBaseUrl:n,authStrategy:i,repository:r,assetType:t,keyword:"",tagIds:[],page:0}));return o}()}function N0(){return NX()?q.jsx(N6,{}):q.jsx(N2,{})}function N1(e){let{children:t}=e;return q.jsx(b.xu,{justifyContent:"center",flexDirection:"column",height:"100%",backgroundColor:"grey3",children:t})}function N2(){return q.jsx(N1,{children:q.jsxs(b.R$,{children:[q.jsx(b.av,{name:"close",lineColor:"purple10",backgroundColor:"purple3",borderColor:"purple6",borderStyle:"dashed",size:"xlarge"}),q.jsx(b._T,{size:"big",children:"Oops!"}),q.jsx(b.nf,{width:360,children:"No items found matching your search"})]})})}function N6(){let{onFilesUpload:e}=N$();return q.jsx(N1,{children:q.jsxs(b.xu,{gap:20,flexDirection:"column",alignItems:"center",children:[q.jsx(b.xu,{maxWidth:375,children:q.jsx(b._T,{size:"big",children:"Start by uploading your files!"})}),q.jsx(b.xu,{border:!0,borderStyle:"dashed",borderRadius:4,justifyContent:"center",children:q.jsxs(b.R$,{sx:{marginBlock:80,marginInline:48},children:[q.jsx(b.av,{name:"cloudUpload",lineColor:"purple11",backgroundColor:"purple5",size:"large"}),q.jsx(b._T,{children:"Drop your files anywhere to upload or ..."}),q.jsx(b.KH,{onFilesSelected:e,renderButton:e=>q.jsx(b.xu,{display:"inline-flex",as:"span",children:q.jsx(b.zx,{onClick:e,color:"grey",children:"Upload media"})})}),q.jsx(b.nf,{children:"Maximum upload size file: 128Mb"})]})})]})})}let N5={warning:{uploadWhileUploading:{title:"Hang tight!",description:"Your current images are still being uploaded. Once they're all set, you'll be free to upload more."}}};function N3(){let{actionContainerRef:e,isUploading:t,onFilesUpload:n,assetType:r}=N$(),i=null==e?void 0:e.current;return q.jsx(N4,{actionContainerRef:e,children:q.jsxs(b.xu,{width:"100%",gap:16,children:[q.jsx(N9,{}),q.jsx(b.u,{title:N5.warning.uploadWhileUploading.title,content:N5.warning.uploadWhileUploading.description,visible:t,stableMount:!0,children:q.jsx(b.KH,{disabled:t,onFilesSelected:n,startIcon:"cloudUpload",color:i?"purple":"grey",size:"large",assetType:r,children:"Upload media"})})]})})}function N9(){let{keyword:e,onFilterChange:t,isFetchingMedia:n}=N$(),[r,i]=(0,x.useState)(e);return(0,w.pQ)(e,()=>{""===e&&i("")}),(0,w.Nr)(r,300,(0,w.R9)(e=>t({keyword:e}))),q.jsx(b.xu,{width:"100%",flexDirection:"column",children:q.jsx(b.CR,{value:r,placeholder:"Search",onValueChange:i,maxLength:200,isLoading:n&&e!==r})})}function N4(e){let{children:t,actionContainerRef:n}=e,r=null==n?void 0:n.current,i=r?b.Uv:x.Fragment,o=r?{container:n.current,asChild:!0}:{};return q.jsx(i,{...o,children:t})}function N7(e){let{children:t}=e,{onFilesUpload:n,assetType:r}=N$();return q.jsx(b.Zz,{overlay:q.jsx(N8,{}),onFilesSelected:n,assetType:r,children:t})}function N8(){let{isUploading:e}=N$(),t=e?N5.warning.uploadWhileUploading.title:"Drop files here",n=e?N5.warning.uploadWhileUploading.description:"Drop your files to upload them instantly to the media library.";return q.jsx(b.xu,{justifyContent:"center",flexDirection:"column",height:"100%",backgroundColor:"grey3",children:q.jsxs(b.R$,{children:[q.jsx(b.av,{name:e?"block":"cloudUpload",lineColor:e?"tomato11":"purple10",backgroundColor:e?"tomato2":"purple3",borderColor:e?"tomato6":"purple6",borderStyle:"dashed",size:"xlarge"}),q.jsx(b._T,{size:"big",children:t}),q.jsx(b.nf,{width:360,children:n})]})})}function qe(){return q.jsx(b.Iq,{title:"Oops! Something went wrong",description:"An error occurred while searching for your image.",errorImageSrc:b.Os,sx:{marginBlock:"auto",marginInline:"auto"}})}function qt(e){let{mediaList:t,mediaActions:n,mediaToolbar:r,sidePane:i}=e,o=(0,b.ac)({min:"medium"}),a=i&&o;return q.jsxs(b.xu,{display:"grid",gridTemplateRows:"auto auto 1fr",gridTemplateColumns:a?"1fr 380px":"1fr",width:"100%",height:"100%",children:[q.jsxs(b.xu,{position:"relative",display:"grid",gap:16,gridColumn:"1",gridRow:"1",padding:{right:16,bottom:16},children:[n,r]}),q.jsx(b.xu,{position:"relative",display:"grid",gridColumn:"1",gridRow:"2 / -1",children:t}),a&&i]})}function qn(e){let{count:t}=e;return q.jsxs(b.xv,{variant:"bold",children:[t," items"]})}function qr(){var e;let{onScrollToBottom:t,media:n,isUploading:r,uploadingFiles:i,isSearchingMedia:o,isMediaRevalidationInProgress:a,setOpenMediaSection:u,isFetchingMedia:s}=N$(),l=Wv(),c=(0,x.useRef)(null);function d(e,t,r){let i=t.shiftKey?n.map(({id:e})=>e):void 0;l.toggleSelection({id:e,isSingleSelection:"single"===r,metaKey:t.metaKey,shiftKey:t.shiftKey,ids:i})}return(r||o||a)&&(null==(e=c.current)||e.scrollTo({top:0,behavior:"instant"})),q.jsxs(qi,{onScrollToBottom:t,scrollAreaRef:c,children:[n.map(e=>{var t,n;return q.jsx(b.PB,{"aria-label":"media item",...e,filenameHighlight:null==(t=e.search_highlight)?void 0:t.filename,loading:o,status:null==(n=i.find(t=>t.id===e.id))?void 0:n.status,selected:l.isSelected(e.id),onCardClick:t=>d(e.id,t,"single"),onCheckedChange:(t,n)=>d(e.id,n,"multi"),onAddTagClick:()=>{var t;return t=e.id,void(l.toggleSelection({id:t,isSingleSelection:!0}),u("tags"))}},e.id)}),q.jsx(b.xu,{gridColumn:"1 / -1",justifyContent:"center",children:q.jsx(b.Fp,{animation:{name:"fade"},children:s&&q.jsx(b.xv,{align:"center",color:"grey11",sx:{marginBlock:8},children:"Loading more items ..."})})})]})}function qi(e){let{children:t,scrollAreaRef:n,onScrollToBottom:r}=e;return q.jsx(b.xr,{"aria-label":"Media list",ref:n,style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(max(250px, calc((100% - 48px) / 4)), 1fr))",gridTemplateRows:"1fr 1fr 1fr ",gap:16,padding:2,paddingBottom:16,position:"relative"},onScrollToBottom:r,threshold:500,children:t})}function qo(e){let{children:t,hasSelectedMedia:n}=e;return q.jsx(b.xu,{overflow:"hidden",gridColumn:"2 / -1",gridRow:"1 / -1",children:q.jsx(b.xr,{style:{display:"grid",height:"100%"},children:q.jsx(b.xu,{flexGrow:1,borderRadius:{topRight:8,topLeft:8},borderStyle:n?"solid":"dashed",border:{top:!0,right:!0,left:!0,bottom:!1},minWidth:0,children:t})})})}function qa(e){let{onFilesUpload:t,isUploading:n,isInitialLoad:r=!1}=e,i=r||n;return q.jsxs(b.xu,{flexDirection:"column",justifyContent:"center",alignItems:"center",padding:16,gap:16,width:"100%",children:[q.jsx(b.av,{name:"cloudUpload",lineColor:"purple11",backgroundColor:"purple5",size:"large"}),q.jsx(b.xu,{flexDirection:"column",gap:4,children:q.jsxs(b.xv,{align:"center",children:["Select or"," ",q.jsx(b.KH,{disabled:i,onFilesSelected:t,renderButton:e=>q.jsx(b.u,{title:N5.warning.uploadWhileUploading.title,content:N5.warning.uploadWhileUploading.description,visible:n,children:q.jsx(b.xu,{display:"inline-flex",as:"span",children:q.jsx(b.zx,{disabled:i,onClick:e,invisible:!0,children:"upload"})})})})," ","media."]})}),q.jsx(b.KH,{disabled:i,onFilesSelected:t,color:"grey",children:"Upload media"})]})}function qu(e){let{actionContainerRef:t}=e;return q.jsx(qt,{sidePane:q.jsx(qc,{}),mediaActions:q.jsx(ql,{actionContainerRef:t}),mediaToolbar:q.jsx(b.Od,{color:"grey5",borderRadius:12,children:q.jsx(qn,{count:888})}),mediaList:q.jsx(qs,{})})}function qs(){return q.jsx(qi,{children:(0,R.w6)(1,24).map(e=>q.jsx(qd,{},e))})}function ql(e){let{actionContainerRef:t}=e,n=(0,w.NW)();return(0,x.useLayoutEffect)(()=>{n()},[n]),q.jsx(N4,{actionContainerRef:t,children:q.jsxs(b.xu,{width:"100%",gap:16,children:[q.jsx(b.xu,{width:"100%",flexDirection:"column",children:q.jsx(b.CR,{placeholder:"Search",maxLength:200,value:"",disabled:!0,onValueChange:()=>{}})}),q.jsx(b.KH,{disabled:!0,onFilesSelected:()=>{},startIcon:"cloudUpload",color:t?"purple":"grey",size:"large",children:"Upload media"})]})})}function qc(){return q.jsx(qo,{hasSelectedMedia:!1,children:q.jsx(qa,{onFilesUpload:()=>{},isUploading:!1,isInitialLoad:!0})})}function qd(){return q.jsxs(b.xu,{height:302,width:"100%",flexDirection:"column",padding:16,backgroundColor:"grey1",border:!0,borderStyle:"solid",borderRadius:6,children:[q.jsx(b.Od,{height:164,width:"100%"}),q.jsx(b.Od,{height:16,width:"100%",sx:{marginTop:12}}),q.jsx(b.Od,{height:10,width:100,sx:{marginTop:8}}),q.jsx(b.Od,{height:1,width:"100%",sx:{marginTop:20,marginBottom:16}}),q.jsxs(b.xu,{flexDirection:"row",gap:8,children:[q.jsx(b.Od,{height:24,width:54}),q.jsx(b.Od,{height:24,width:45}),q.jsx(b.Od,{height:24,width:62})]})]})}let qf=(0,x.createContext)({showToast:()=>{}});function qp(e){let{children:t}=e,[n,r]=(0,x.useState)({title:"",seconds:5}),[i,o]=(0,x.useState)(!1),{title:a,action:u,seconds:s=1,icon:l="check"}=n,c=(0,x.useMemo)(()=>({showToast:e=>{r({seconds:s,...e}),o(!0)}}),[s]);return q.jsxs(q.Fragment,{children:[q.jsx(qh,{}),q.jsx(b.FN,{anchor:q.jsx(b.xu,{position:"absolute",justifyContent:"center",width:"100%",bottom:72}),open:i,onOpenChange:o,title:a,action:u,seconds:s,icon:l}),q.jsx(qf.Provider,{value:c,children:t})]})}function qA(){return(0,x.useContext)(qf)}function qh(){let{revalidateMedia:e,isMediaCacheInvalid:t}=N$(),[n,r]=(0,x.useState)(t);return(0,w.pQ)(t,r),q.jsx(b.FN,{anchor:q.jsx(b.xu,{position:"absolute",justifyContent:"center",width:"100%",bottom:72}),open:n,title:"There have been changes to your media library",action:{title:"Update",onClick:e},cancel:{onClick:()=>r(!1)}})}function qm(){let{media:e,mediaTotal:t}=N$(),n=Wv();return q.jsxs(b.xu,{alignItems:"center",gap:16,children:[n.isSelectAllEnabled&&q.jsx(b.XZ,{onCheckedChange:n.toggleSelectAll,checked:n.selectedCount>0,indeterminate:n.selectedCount!==t,onClick:e=>e.stopPropagation(),disabled:0===e.length}),0!==e.length&&q.jsx(qn,{count:t}),q.jsxs(b.xu,{gap:8,alignItems:"center",children:[q.jsx(b.xv,{children:"Filter:"}),q.jsx(qv,{}),q.jsx(qC,{})]})]})}let qg={all:{name:"All media",icon:"public"},image:{name:"Images",icon:"image"},video:{name:"Videos",icon:"videocam"},document:{name:"Documents",icon:"insertDriveFile"},audio:{name:"Audio files",icon:"musicNote"}},qy=Object.entries(qg);function qv(){let{assetType:e,initialAssetType:t,onFilterChange:n}=N$(),[r,i]=(0,x.useState)(e);(0,w.pQ)(e,()=>{i(e)});let[o,a]=(0,x.useState)(!1),{icon:u,name:s}=qg[r],l=qg[t].name,c="all"!==t;return q.jsxs(b.h_,{open:o,onOpenChange:a,children:[q.jsx(b.$F,{disabled:c,children:q.jsx(qx,{icon:u,isDropdownDisabled:c,buttonName:s,tooltipAssetTypeName:l})}),q.jsx(b.AW,{minWidth:256,align:"start",childrenFocusScope:!0,children:q.jsx(q.Fragment,{children:qy.filter(([e])=>e!==r).map(([e,{icon:t,name:r}])=>q.jsx(b.Xi,{startIcon:q.jsx(b.I5,{name:t}),onSelect:()=>{a(!1),i(e),n({assetType:e})},children:r},e))})})]})}let qx=(0,x.forwardRef)(function(e,t){let{icon:n,isDropdownDisabled:r,buttonName:i,tooltipAssetTypeName:o,...a}=e;return q.jsx(b.u,{content:`You can only pick ${(null==o?void 0:o.toLocaleLowerCase())??"this type of media"}`,visible:r,children:q.jsx(b.zx,{startIcon:n,endIcon:"arrowDropDown",size:"small",color:"grey",disabled:r,ref:t,...a,children:i})})});function qb(e){let{optimisticTagIds:t,setOptimisticTagIds:n}=e,{onFilterChange:r}=N$(),{tags:i}=NT(),o=(0,x.useMemo)(()=>(0,M.vM)(i,e=>e.id),[i]);return q.jsx(q.Fragment,{children:t.map(e=>{var i;let a=null==(i=o.get(e))?void 0:i[0];return a?q.jsx(b.Ct,{title:a.name,size:"medium",color:"purple",onClose:()=>(function(e){let i=t.filter(t=>t!==e.id);n(i),r({tagIds:i})})(a),selected:!0},a.id):null})})}function qC(){let{setTagManagerOpen:e,tagIds:t,onFilterChange:n}=N$(),[r,i]=(0,x.useState)(""),[o,a]=(0,x.useState)(!1),[u,s]=(0,x.useState)(t);return(0,w.pQ)(JSON.stringify(t),()=>{s(t)}),q.jsxs(q.Fragment,{children:[q.jsxs(b.h_,{open:o,onOpenChange:function(e){a(e),e||i("")},children:[q.jsx(b.$F,{children:q.jsx(b.zx,{startIcon:"label",endIcon:"arrowDropDown",size:"small",color:"grey",children:"Tags"})}),q.jsx(b.AW,{minWidth:256,align:"start",border:!1,childrenFocusScope:!0,children:q.jsxs(b.BC,{variant:"attached",children:[q.jsx(b.Ie,{value:r,onValueChange:i,placeholder:"Search for a tag",autoFocus:!0}),q.jsx(b.KV,{children:q.jsx(b.SV,{renderError:()=>q.jsx(b.xv,{color:"grey9",variant:"small",sx:{marginBlock:8,marginInline:8},children:"Error getting tags"}),children:q.jsx(x.Suspense,{fallback:q.jsx(b.xu,{padding:8,flexDirection:"column",gap:8,children:(0,R.w6)(1,6).map(e=>q.jsx(b.Od,{height:24,width:85},e))}),children:q.jsx(qS,{searchTerm:r,setSearchTerm:i,onTagToggle:function(e){let r=u.includes(e.id)?t.filter(t=>t!==e.id):[...t,e.id];s(r),n({tagIds:r}),a(!1)},optimisticTagIds:u})})})}),q.jsx(b.De,{children:q.jsx(b.zx,{invisible:!0,startIcon:"edit",textWeight:"normal",color:"dark",onClick:function(){a(!1),e(!0)},children:"Manage tags"})})]})})]}),u.length>0&&q.jsx(b.SV,{children:q.jsx(x.Suspense,{children:q.jsx(qb,{optimisticTagIds:u,setOptimisticTagIds:s})})})]})}function qS(e){let{onTagToggle:t,searchTerm:n,optimisticTagIds:r}=e,{tags:i}=NT(),o=(0,x.useMemo)(()=>{let e=n.toLowerCase();return i.filter(t=>t.name.toLowerCase().includes(e))},[i,n]);return q.jsxs(q.Fragment,{children:[!o.length&&q.jsx(b.xv,{color:"grey9",variant:"small",sx:{marginBlock:8,marginInline:8},children:"No tags found"}),o.map((e,n)=>{let i=r.includes(e.id);return q.jsx(b.c8,{value:e.id,onCheckedChange:()=>t(e),checked:i,children:q.jsx(b.Ct,{title:e.name,color:"purple",sx:{marginLeft:8,marginBottom:n===o.length-1?8:4,marginTop:0===n?8:4},size:"medium"})},e.id)})]})}function qw(){let{media:e}=N$(),t=Wv();return e.filter(({id:e})=>t.isSelected(e))}function qI(){let[e,t]=(0,x.useState)(!1),n=qw(),r=Wv(),i=(0,x.useMemo)(()=>n.some(({id:e})=>e.startsWith("temp")),[n]),[o]=n;return o?r.selectedCount>1?q.jsxs(b.xu,{gap:8,alignItems:"center",children:[q.jsxs(b.xv,{variant:"emphasized",noWrap:!0,sx:{flexGrow:1},children:[r.selectedCount," media selected"]}),q.jsx(b.u,{content:"Open all selected media in new tabs",children:q.jsx(b.hU,{icon:"openInFull",variant:"solid",size:"small",onClick:()=>n.forEach(e=>window.open(e.url,"_blank"))})}),q.jsx(b.u,{content:"Remove selected media",children:q.jsx(b.hU,{icon:"delete",variant:"solid",color:"tomato",size:"small",hiddenLabel:"Remove media",onClick:()=>t(!0),disabled:i})}),q.jsx(q_,{open:e,onOpenChange:t,media:n})]}):q.jsxs(b.xu,{gap:8,alignItems:"center",children:[q.jsx(b.xv,{variant:"emphasized",noWrap:!0,sx:{flexGrow:1},children:o.filename}),q.jsxs(b.xu,{gap:8,children:[q.jsx(b.u,{content:"Open media in new tab",children:q.jsx(b.hU,{icon:"openInFull",variant:"solid",size:"small",hiddenLabel:"Open media in new tab",onClick:()=>window.open(o.url,"_blank"),disabled:i})}),q.jsx(b.u,{content:"Copy media URL",children:q.jsx(b.hU,{icon:"link",variant:"solid",size:"small",hiddenLabel:"Copy media URL",onClick:()=>navigator.clipboard.writeText(o.url),disabled:i})}),q.jsx(b.u,{content:"Remove media",children:q.jsx(b.hU,{icon:"delete",variant:"solid",color:"tomato",size:"small",hiddenLabel:"Remove media",onClick:()=>t(!0),disabled:i})}),q.jsx(q_,{open:e,onOpenChange:t,media:o})]})]}):null}function q_(e){let{open:t,onOpenChange:n,media:r}=e,i=WS(),{showAlert:o}=(0,b.VY)(),{deleteMedia:a}=N$(),u=Wv(),[s,l]=(0,x.useState)(!1),c=Array.isArray(r),d=c?"these items":"this item";return q.jsxs(b.Vq,{onOpenChange:n,open:t,size:"small",children:[q.jsx(b.fK,{icon:"alert",title:`Remove ${d} from your media library?`}),q.jsx(b.cZ,{children:q.jsx(b.xu,{padding:16,children:q.jsxs(b.xv,{children:["You are about to delete ",d,": \xa0",c?q.jsx(qT,{media:r}):q.jsx("b",{children:r.filename})]})})}),q.jsxs(b.kX,{children:[q.jsx(b.PO,{}),q.jsxs(b._d,{onClick:function(){l(!0);let e=u.getSelectionState().selectedIds;(function(e){let{ids:t,config:n}=e;if(!n.mediaLibrary)throw Error("Media Library not configured.");if(0===t.length)throw Error("No ids provided during media deletion");let{assetsApiBaseUrl:r,repository:i,authStrategy:o}=n;if(1===t.length){let[e]=t;return(0,k.WY)(new URL(`assets/${e}`,r),{headers:{repository:i},method:"DELETE",credentials:(0,k.xb)(o),okType:Nn.unknown()})}return(0,k.WY)(new URL("assets/bulk-delete",r),{headers:{repository:i},method:"POST",credentials:(0,k.xb)(o),okType:Nn.unknown(),body:{ids:t}})})({ids:e,config:i}).then(()=>{n(!1),a(e),u.clearSelection()}).catch(()=>{n(!1),o({title:"Error",subtitle:`Something went wrong when removing ${d}.`})}).finally(()=>{l(!1)})},color:"tomato",loading:s,children:["Yes, I want to remove ",d]})]})]})}function qT({media:e}){let t=e.slice(0,15),n=e.length>15,r=n?e.length-15:0;return q.jsxs("ul",{children:[t.map((e,t)=>q.jsx("li",{children:q.jsx("b",{children:e.filename})},t)),n&&q.jsxs("span",{children:[q.jsx("br",{}),"And ",q.jsx("b",{children:r})," more ",1===r?"item":"items","..."]})]})}function qO(){var e;let t=qw(),{uploadingFiles:n}=N$(),[r]=t;if(!r)return null;if(2===t.length)return q.jsx(qR,{children:t.map((e,t)=>q.jsx("div",{style:{position:"absolute",transform:0===t?"translateX(25%) rotate(15deg) ":"translateX(-25%) rotate(-15deg) "},children:q.jsx(qk,{media:e})},e.id))});if(t.length>2)return q.jsx(qR,{children:t.slice(-4).map((e,t)=>q.jsx("div",{style:{position:"absolute",paddingRight:16*t},children:q.jsx(qk,{media:e})},e.id))});let i=null==(e=n.find(e=>e.id===r.id))?void 0:e.status,o=r.kind.startsWith("image");return q.jsx(b.xu,{flexDirection:"column",children:q.jsx(b.hM,{children:q.jsx(qR,{uploadStatus:i,hasImage:o,children:o?q.jsx(b.Ee,{src:r.url,alt:r.alt,sizing:"contain"}):q.jsx(b.Sp,{kind:r.kind,filename:r.filename})})})})}function qR(e){let{children:t,uploadStatus:n,hasImage:r}=e;return q.jsxs(b.xu,{flexDirection:"column",alignItems:"center",justifyContent:"center",position:"relative",height:200,width:"100%",backgroundColor:r?"transparent":"purple2",children:[t,n&&q.jsx(b.xu,{position:"absolute",backgroundColor:"greyAlpha1",width:"100%",height:"100%",padding:{inline:16},justifyContent:"end",flexDirection:"column",children:q.jsx(b.wI,{status:n})})]})}function qk(e){let{media:t}=e;return q.jsx(b.xu,{width:111,height:152,children:"image"===t.kind?q.jsx(b.Ee,{borderRadius:8,src:t.url,alt:t.alt,sizing:"cover"}):q.jsx(b.Sp,{kind:t.kind,filename:t.filename})})}let qE="__MAIN_THUMBNAIL__";function qM(e,t,n){let r;return[e.name===qE?void 0:e.name,(r=t?(0,_.$)(n)?[n.width,n.height]:(0,_.$)(e.width)||(0,_.$)(e.height)?[e.width??void 0,e.height??void 0]:[t.origin.width,t.origin.height]:void 0)?`${r[0]??"auto"}\xd7${r[1]??"auto"}px`:void 0]}function qj(e){let t=new URL(e);return t.searchParams.delete("q"),t.searchParams.set("w","800"),t.searchParams.set("h","800"),t.searchParams.set("auto","compress,format"),t.searchParams.set("fit","max"),t.toString()}function qF(e){return null!=e&&e.url?qj(e.url):void 0}function qU(e,t){let{width:n,height:r,rect:i}=function(e,t){let[n,r]=function(e,t){let{width:n,height:r}=t??{};return n&&r?[n,r]:n?[n,Math.round(e.height*(n/e.width))]:r?[Math.round(e.width*(r/e.height)),r]:[e.width,e.height]}(e,t),i=Math.max(n/e.width,r/e.height),o=Math.round((e.width-n/i)/2),a=Math.round((e.height-r/i)/2);return{width:n,height:r,rect:{x:o,y:a,width:Math.round(n/i),height:Math.round(r/i)}}}({...e,width:(null==e?void 0:e.width)??2e3,height:(null==e?void 0:e.height)??2e3},t),o=!!(null!=t&&t.width||null!=t&&t.height);return{provider:"imgix",url:function(e,t,n,r,i){if("svg"===function(e){let{pathname:t}=new URL(e),n=t.lastIndexOf(".");if(-1!==n)return t.substring(n).slice(1).toLowerCase()}(e))return e;let o=new URL(e);if(i){let{x:e,y:i,width:a,height:u}=t,s=[...o.searchParams.entries(),["rect",[e,i,a,u].join(",")],["w",n],["h",r]];o.search=s.map(e=>e.join("=")).join("&")}return o.toString()}(e.url,i,n,r,o),alt:e.alt,..."kind"in e&&"extension"in e?{credits:e.credits}:{},origin:{id:e.id,url:e.url,width:e.width??2e3,height:e.height??2e3},width:n,height:r,edit:{background:"transparent",zoom:1,crop:{x:i.x,y:i.y}}}}function qL(e){if(!e)return"";let{filename:t,extension:n}=e;if(!n)return t;let r=RegExp(`\\.${n}$`);return t.replace(r,"")}function qK(e){let{tags:t,toggleAssetTag:n,getTagsLabel:r}=e,{setTagManagerOpen:i}=N$(),{showToast:o}=qA(),{showAlert:a}=(0,b.VY)(),[u,s]=(0,x.useState)("");async function l(e,t){s("");try{await n(e,t),o({title:"Media tags were updated",seconds:3})}catch{a({title:"Error",subtitle:"Something went wrong when updating media tags"})}}return q.jsxs(b.xu,{flexDirection:"column",children:[q.jsxs(b.xu,{justifyContent:"space-between",children:[q.jsx(b.xv,{color:"grey12",variant:"bold",children:r()}),q.jsx(b.zx,{startIcon:"edit",invisible:!0,color:"dark",onClick:()=>i(!0),children:"Manage tags"})]}),q.jsxs(b.BC,{sx:{marginTop:4,marginBottom:8},children:[q.jsx(qB,{searchTerm:u,setSearchTerm:s}),q.jsx(b.KV,{children:q.jsx(b.SV,{renderError:()=>q.jsx(b.xv,{color:"grey9",variant:"small",sx:{marginBlock:8,marginInline:8},children:"Error getting tags"}),children:q.jsx(x.Suspense,{fallback:q.jsx(b.xu,{padding:8,flexDirection:"column",gap:8,children:(0,R.w6)(1,6).map(e=>q.jsx(b.Od,{height:24,width:85},e))}),children:q.jsx(qP,{searchTerm:u,assignedTags:t,onToggleAssetTag:l})})})})]}),q.jsx(b.xu,{flexDirection:"column",alignItems:"flex-start",gap:8,children:t.map(e=>q.jsx(b.Ct,{title:e.name,size:"medium",color:"purple",selected:!0,onClose:()=>l(e,"remove")},e.id))})]})}function qB(e){let{searchTerm:t,setSearchTerm:n}=e,r=(0,x.useRef)(null),{openMediaSection:i,setOpenMediaSection:o}=N$();return(0,x.useEffect)(()=>{var e;"tags"===i&&(null==(e=r.current)||e.focus(),o(void 0))},[i,o]),q.jsx(b.Ie,{value:t,onValueChange:n,placeholder:"Add or create a new tag",ref:r})}function qP(e){let{searchTerm:t,assignedTags:n,onToggleAssetTag:r}=e,[i]=qw(),o=WS(),{showAlert:a}=(0,b.VY)(),{tags:u}=NT(),s=(0,x.useMemo)(()=>{let e=t.toLowerCase();return u.filter(t=>t.name.toLowerCase().includes(e))},[u,t]),l=NR.safeParse(t).success&&u.every(e=>e.name!==t);async function c(){let e;if(t&&i){try{e=await function(e){let{name:t,config:n}=e;n.mediaLibrary||WI("mediaLibrary");let{assetsApiBaseUrl:r,repository:i,authStrategy:o}=n;return(0,k.WY)(new URL("tags",r),{headers:{repository:i},body:{name:t},method:"POST",credentials:(0,k.xb)(o),okType:Nk})}({name:t,config:o}),NM(t=>[e,...t])}catch{a({title:"Error",subtitle:`Something went wrong when creating the tag ${t}`});return}await r(e,"add")}}return i?q.jsxs(q.Fragment,{children:[!s.length&&q.jsx(b.xv,{color:"grey9",variant:"small",sx:{marginBlock:8,marginInline:8},children:"No tags found"}),s.map((e,t)=>q.jsx(b.c8,{value:e.id,onCheckedChange:t=>r(e,t?"add":"remove"),checked:n.some(t=>t.id===e.id),children:q.jsx(b.Ct,{title:e.name,color:"purple",size:"medium",sx:{marginInline:8,marginBottom:t===s.length-1?8:4,marginTop:0===t?8:4}})},e.id)),l&&q.jsx(b.c8,{value:"new",onCheckedChange:c,children:q.jsxs(b.xu,{padding:8,flexDirection:"row",alignItems:"center",gap:4,children:[q.jsx(b.I5,{name:"add",size:"small",color:"grey11"}),q.jsxs(b.xv,{color:"grey12",children:['Create tag "',t,'"']})]})})]}):null}function qW(e){let{selectedMedia:t}=e,n=WS(),r=(0,x.useMemo)(()=>(function(e){let t=e.length,n={},r=[];return e.forEach(e=>{e.tags.forEach(e=>{n[e.id]||(n[e.id]=0,r.push(e)),n[e.id]++})}),r.filter(e=>n[e.id]===t)})(t),[t]);async function i(e,r){let i="remove"===r,o=t.map(e=>e.id),a=[];Nq(t=>(a=t,t.map(t=>o.includes(t.id)?i?function(e,t){let n=e.tags.filter(e=>e.id!==t.id);return{...e,tags:n}}(t,e):t.tags.some(({id:t})=>t===e.id)?t:{...t,tags:[...t.tags,e]}:t)));try{await function(e){let{tagId:t,assetIds:n,config:r,operation:i}=e;if(!r.mediaLibrary)throw Error("Media Library not configured.");let{assetsApiBaseUrl:o,repository:a,authStrategy:u}=r;return(0,k.WY)(new URL(`tags/${t}/assets`,o),{headers:{repository:a},body:{assetIds:n},method:"add"===i?"POST":"DELETE",credentials:(0,k.xb)(u),okType:Nn.unknown()})}({tagId:e.id,assetIds:o,operation:i?"remove":"add",config:n});let r=t.length*(i?-1:1);NM(t=>t.map(t=>t.id===e.id?{...t,count:t.count+r}:t))}catch(e){throw Nq(()=>a),e}}return q.jsx(qK,{tags:r,getTagsLabel:function(){let e=r.length;return e>1?`${e} tags in common`:1===e?"1 tag in common":"Common tags"},toggleAssetTag:i})}function qD(e){let{selectedMedia:t}=e,n=t.tags,r=WS(),{updateMedia:i}=N$();async function o(e,n){let o=t.tags,a="remove"===n,u=a?o.filter(t=>t.id!==e.id):[...o,e];i(t.id,{tags:u});try{await function(e){let{mediaId:t,config:n,tags:r}=e;if(!n.mediaLibrary)throw Error("Media Library not configured.");let{assetsApiBaseUrl:i,repository:o,authStrategy:a}=n;return(0,k.WY)(new URL(`assets/${t}`,i),{headers:{repository:o},body:{tags:r},method:"PATCH",credentials:(0,k.xb)(a),okType:NF})}({mediaId:t.id,config:r,tags:u.map(e=>e.id)}),NM(t=>t.map(t=>t.id===e.id?{...t,count:t.count+(a?-1:1)}:t))}catch(e){throw i(t.id,{tags:o}),e}}return q.jsx(qK,{tags:n,getTagsLabel:function(){let e=n.length;return e>1?`${e} tags`:1===e?"1 tag":"Tags"},toggleAssetTag:o})}function qN(){let[e,t]=(0,x.useState)("description");if(1!==qw().length)return q.jsx(qz,{});let n="description"===e,r="more-info"===e;return q.jsxs(q.Fragment,{children:[q.jsxs(b.xu,{border:!0,borderStyle:"solid",borderRadius:8,backgroundColor:"grey2",children:[q.jsx(b.OK,{title:"Description",selected:n,onSelect:()=>t("description"),outline:n,background:n?void 0:"transparent",sx:{flexGrow:1,flexBasis:0}}),q.jsx(b.OK,{title:"More info",selected:r,onSelect:()=>t("more-info"),outline:r,background:r?void 0:"transparent",sx:{flexGrow:1,flexBasis:0}})]}),q.jsx(qq,{tab:e})]})}function qq(e){let{tab:t}=e;switch(t){case"description":return q.jsx(qQ,{});case"more-info":return q.jsx(qV,{})}}function qQ(){let{title:e,alt:t,onBlur:n,isUploading:r,selectedMedia:i}=qY();if(!i)return null;let{extension:o}=i;return q.jsxs(b.xu,{flexDirection:"column",gap:16,children:[q.jsx(b.yt,{value:e.value,onValueChange:e.set,label:"Media title",placeholder:"Media title",onBlur:n,disabled:r,suffix:o?`.${o}`:void 0}),q.jsx(b.Cz,{label:"Alternative text",children:q.jsx(b.f$,{content:t.displayValue,contentVersion:t.version,readOnly:r,placeholder:"A short description of the media for accessibility",multiline:!0,decorations:{em:"highlight"},onChange:t.onChange,onBlur:n})}),!r&&q.jsx(qD,{selectedMedia:i})]})}function qV(){let{credits:e,notes:t,onBlur:n,isUploading:r,selectedMedia:i}=qY();if(!i)return null;let o=function(e){let{width:t,height:n,last_modified:r,size:i,extension:o}=e,a=t&&n,u={label:"Date",value:(0,I._L)(new Date(r))};return[u,{label:"File size",value:(0,T.td)(i)},a?{label:"Dimensions",value:`${t}\xd7${n}`}:void 0,a?{label:"Ratio",value:((t??0)/(n??0)).toFixed(1)}:void 0,o?{label:"Extension",value:o.toUpperCase()}:void 0].filter(_.$)}(i);return q.jsxs(b.xu,{gap:8,flexDirection:"column",children:[o.map(e=>q.jsxs(b.xu,{gap:8,children:[q.jsxs(b.xv,{color:"grey11",children:[e.label,":"]}),q.jsx(b.xv,{children:e.value})]},e.label)),q.jsx(b.Cz,{label:"Copyright",children:q.jsx(b.f$,{content:e.displayValue,contentVersion:e.version,readOnly:r,placeholder:"Media copyrights or credits",multiline:!0,decorations:{em:"highlight"},onChange:e.onChange,onBlur:n})}),q.jsx(b.Cz,{label:"Private notes",children:q.jsx(b.f$,{content:t.displayValue,contentVersion:t.version,readOnly:r,placeholder:"Private notes are never shared publicly",multiline:!0,decorations:{em:"highlight"},onChange:t.onChange,onBlur:n})})]})}function qz(){let e=qw(),{uploadingFiles:t}=N$(),n=(0,x.useMemo)(()=>t.some(t=>e.some(e=>t.id===e.id)&&"success"!==t.status),[e,t]);return q.jsx(q.Fragment,{children:!n&&q.jsx(qW,{selectedMedia:e})})}function qY(){let[e]=qw(),{updateMedia:t,uploadingFiles:n}=N$(),r=WS(),{showToast:i}=qA(),o=(null==e?void 0:e.id)??"",a=qH(e,"alt"),u=qH(e,"notes"),s=qH(e,"credits"),l=qH(e,"filename",qL),c=n.some(t=>t.id===(null==e?void 0:e.id)&&"success"!==t.status);return{selectedMedia:e,onBlur:function(){if(!e||!l.changed&&!a.changed&&!s.changed&&!u.changed)return;let{extension:n,search_highlight:c}=e,d=n?`${l.value}.${n}`:l.value;t(o,{filename:d,alt:a.value,credits:s.value,notes:u.value,search_highlight:{alt:a.changed||null==c?void 0:c.alt,credits:s.changed||null==c?void 0:c.credits,filename:l.changed||null==c?void 0:c.filename,notes:u.changed||null==c?void 0:c.notes}}),(function(e){let{id:t,config:n,metadata:r}=e;if(!n.mediaLibrary)throw Error("Media Library not configured.");let{assetsApiBaseUrl:i,repository:o,authStrategy:a}=n;return(0,k.WY)(new URL(`assets/${t}`,i),{headers:{repository:o},body:{...r},method:"PATCH",credentials:(0,k.xb)(a),okType:NF})})({id:o,config:r,metadata:{filename:d,alt:a.value,credits:s.value,notes:u.value}}).then(()=>{i({title:"Media metadata has been saved.",seconds:3})}).catch(e=>{console.error(e)})},isUploading:c,title:l,alt:a,credits:s,notes:u,extension:null==e?void 0:e.extension}}function qH(e,t,n=e=>null==e?void 0:e[t]){var r,i;let o=n(e)??"",[a,u]=(0,x.useState)(o);(0,w.pQ)(null==e?void 0:e.id,()=>u(o));let s=null==(r=null==e?void 0:e.search_highlight)?void 0:r[t];return{value:a,set:u,displayValue:(null==(i=s??a)?void 0:i.replace(/\n/g,"<br>"))??"",onChange:function(e){let{from:t,to:n}=e.state.selection;e.commands.selectAll(),e.commands.unsetAllMarks(),e.commands.setTextSelection({from:t,to:n}),u(e.getText())},version:`${(null==e?void 0:e.id)??""}_${!!s}`,changed:a!==o}}function qG(){let{setTagManagerOpen:e}=N$(),[t,n]=(0,x.useState)("");return q.jsxs(b.xu,{gap:20,flexDirection:"column",height:"100%",children:[q.jsxs(b.xu,{alignItems:"center",gap:4,children:[q.jsx(b.hU,{icon:"close",size:"small",hasPadding:!1,onClick:()=>e(!1)}),q.jsx(b.xv,{variant:"bold",children:"Tags management"})]}),q.jsxs(b.xu,{gap:16,flexDirection:"column",height:"100%",children:[q.jsx(b.CR,{value:t,onValueChange:n,placeholder:"Search for tags",endAdornment:!1,autoFocus:!0}),q.jsx(b.SV,{renderError:()=>q.jsx(qX,{}),children:q.jsx(x.Suspense,{fallback:q.jsx(q0,{}),children:q.jsx(qZ,{searchTerm:t})})})]})]})}function qZ(e){let{searchTerm:t}=e,{tags:n}=NT(),r=n.filter(e=>e.name.toLowerCase().includes(t.toLowerCase()));return 0===r.length?q.jsx(b.xv,{color:"grey9",variant:"small",children:"No tags found"}):q.jsx(b._M,{ariaLabel:"Tags list",getItemKey:e=>e.id,gap:16,items:r,children:e=>q.jsx(qJ,{tag:e})})}function qJ(e){let{tag:t}=e,[n,r]=(0,x.useState)(!1),i=WS(),{showAlert:o}=(0,b.VY)(),{showToast:a}=(0,b.pm)(),{tags:u}=NT();async function s(e){if(!NR.safeParse(e).success){o({title:"Error",subtitle:`Failed to rename tag "${t.name}" to "${e}". Tag name must be at least 3 and at maximum 20 characters long.`});return}if(u.some(t=>t.name===e)){o({title:"Error",subtitle:`Failed to rename tag "${t.name}" to "${e}". Tag with name "${e}" already exists.`});return}try{await function(e){let{id:t,name:n,config:r}=e;r.mediaLibrary||WI("mediaLibrary");let{assetsApiBaseUrl:i,repository:o,authStrategy:a}=r;return(0,k.WY)(new URL(`tags/${t}`,i),{headers:{repository:o},method:"PATCH",credentials:(0,k.xb)(a),body:{name:n},okType:Nn.unknown()})}({id:t.id,name:e,config:i}),NM(n=>n.map(n=>n.id===t.id?{...n,name:e}:n)),Nq(n=>n.map(n=>{if(-1!==n.tags.findIndex(e=>e.id===t.id)){let r=n.tags.map(n=>n.id===t.id?{...n,name:e}:n);return{...n,tags:r}}return n})),a({title:`Tag "${t.name}" renamed to "${e}"`,seconds:3})}catch{o({title:"Error",subtitle:"Something went wrong when renaming the tag."})}}return q.jsxs(q.Fragment,{children:[q.jsxs(b.xu,{justifyContent:"space-between",children:[q.jsx(b.Ct,{title:t.name,color:"purple",size:"medium",onEdit:s}),q.jsx(b.zx,{invisible:!0,color:"tomato",textWeight:"normal",onClick:()=>r(!0),children:"Delete"})]}),q.jsx(q$,{open:n,onOpenChange:r,tag:t})]})}function q$(e){let{open:t,onOpenChange:n,tag:r}=e,{id:i,name:o,count:a}=r,u=WS(),{showAlert:s}=(0,b.VY)(),[l,c]=(0,x.useState)(!1);async function d(){c(!0);try{await function(e){let{id:t,config:n}=e;n.mediaLibrary||WI("mediaLibrary");let{assetsApiBaseUrl:r,repository:i,authStrategy:o}=n;return(0,k.WY)(new URL(`tags/${t}`,r),{headers:{repository:i},method:"DELETE",credentials:(0,k.xb)(o),okType:Nn.unknown()})}({id:i,config:u}),NM(e=>e.filter(e=>e.id!==i)),Nq(e=>e.map(e=>{if(-1!==e.tags.findIndex(e=>e.id===i)){let t=e.tags.filter(e=>e.id!==i);return{...e,tags:t}}return e}))}catch{s({title:"Error",subtitle:"Something went wrong when removing the tag."})}finally{c(!1),n(!1)}}return q.jsxs(b.Vq,{onOpenChange:n,open:t,size:"small",children:[q.jsx(b.fK,{title:`This tag is being used on ${a} media item${1===a?"":"s"}`}),q.jsx(b.cZ,{padding:16,children:q.jsxs(b.xv,{children:["You are about to delete the tag name ",q.jsx("b",{children:o}),"."," ",a>0&&`This tag is being
|
|
6
|
-
used on ${a} media item${1===a?"":"s"} and will be deleted
|
|
7
|
-
from ${1===a?"it":"them"}.`]})}),q.jsxs(b.kX,{children:[q.jsx(b.PO,{}),q.jsx(b._d,{onClick:d,color:"tomato",loading:l,children:"Yes, I want to delete"})]})]})}function qX(){let e=(0,x.useContext)(O.Nk);return q.jsx(b.xu,{flexDirection:"column",children:q.jsxs(b.R$,{children:[q.jsx(b.av,{name:"close",lineColor:"purple10",backgroundColor:"purple3",borderColor:"purple6",borderStyle:"dashed"}),q.jsx(b._T,{size:"big",children:"Oops!"}),q.jsx(b.nf,{width:360,children:"We couldn't load your media tags."}),q.jsx(b.Qj,{children:q.jsx(b.zx,{onClick:null==e?void 0:e.reset,size:"medium",children:"Try again"})})]})})}function q0(){return q.jsx(b.xu,{flexDirection:"column",gap:16,children:(0,R.w6)(1,6).map(e=>q.jsxs(b.xu,{justifyContent:"space-between",children:[q.jsx(b.Od,{height:24,width:85}),q.jsx(b.Od,{height:24,width:45})]},e))})}function q1(){let e=qw(),{onFilesUpload:t,isUploading:n,tagManagerOpen:r}=N$();return 0===e.length&&!1===r?q.jsx(qa,{onFilesUpload:t,isUploading:n}):q.jsx(b.xu,{flexDirection:"column",backgroundColor:"grey1",width:"100%",padding:16,gap:16,borderRadius:{topLeft:8,topRight:8},children:r?q.jsx(qG,{}):q.jsxs(q.Fragment,{children:[q.jsx(qI,{}),q.jsx(qO,{}),q.jsx(qN,{})]})})}function q2(){let e=Wv();return q.jsx(qo,{hasSelectedMedia:0!==e.selectedCount,children:q.jsx(q1,{})})}function q6(e){let{assetType:t,onSelectedChange:n,actionContainerRef:r}=e;return q.jsx(b.SV,{renderError:()=>q.jsx(qe,{}),children:q.jsx(x.Suspense,{fallback:q.jsx(qu,{actionContainerRef:r}),children:q.jsx(Wy,{children:q.jsx(NJ,{assetType:t,actionContainerRef:r,onSelectedChange:n,children:q.jsx(N7,{children:q.jsx(q5,{})})})})})})}function q5(){let{media:e}=N$(),t=NX();return q.jsx(qp,{children:q.jsx(qt,{sidePane:t?void 0:q.jsx(q2,{}),mediaActions:q.jsx(N3,{}),mediaToolbar:q.jsx(qm,{}),mediaList:0===e.length?q.jsx(N0,{}):q.jsx(qr,{})})})}(0,x.createContext)({editedUID:{current:!1},onEditUID:()=>{}});let q3=(0,x.createContext)({update:()=>{}});function q9(e){var t;return(null==(t=e.config)?void 0:t.label)??("Boolean"===e.type||"Separator"===e.type?void 0:e.fieldset)??e.type}function q4(e,t="..."){var n;return(null==(n=e.config)?void 0:n.placeholder)||t}function q7(e){var t;let{content:n,field:r,id:i,readOnly:o,onContentChange:a}=e,u=(null==n?void 0:n.value)??(null==(t=r.config)?void 0:t.default_value)??!1;return q.jsxs(b.gN,{children:[q.jsx(b.fw,{name:"biToggle"}),q.jsx(b.Qy,{htmlFor:i,children:q9(r)}),q.jsxs(b.JO,{children:[q.jsx(b.xu,{padding:4,alignItems:"center",children:q.jsx(b.xv,{children:function(e,t,n="..."){var r,i;return(t?null==(r=e.config)?void 0:r.placeholder_true:null==(i=e.config)?void 0:i.placeholder_false)||n}(r,u)})}),q.jsx(b.rs,{id:i,sx:{alignSelf:"center",marginLeft:"auto",marginRight:12},checked:u,onCheckedChange:e=>{o||a({__TYPE__:"BooleanContent",value:e})}})]})]})}function q8(e){let{id:t,field:n,content:r,onContentChange:i}=e;return q.jsxs(b.gN,{children:[q.jsx(b.fw,{name:"colorLens"}),q.jsx(b.Qy,{id:t,children:q9(n)}),q.jsx(b.JO,{children:q.jsx(b.xu,{padding:{left:4},alignItems:"center",children:q.jsx(b.TC,{onValueChange:e=>i(void 0===e?void 0:{__TYPE__:"FieldContent",type:"Color",value:e}),value:null==r?void 0:r.value,"aria-labelledby":t,placeholder:q4(n)})})})]})}function Qe(e){let{id:t,readOnly:n,field:r,content:i,onContentChange:o}=e,a=null!=i&&i.value?(0,I._O)(i.value):void 0;return q.jsxs(b.gN,{children:[q.jsx(b.fw,{name:"dateRange"}),q.jsx(b.Qy,{id:t,children:q9(r)}),q.jsx(b.JO,{children:q.jsx(b.xu,{padding:{left:4,right:12},width:"100%",flexDirection:"column",justifyContent:"center",children:q.jsx(b.Wr,{mode:"date","aria-labelledby":t,disabled:n,value:a,onValueChange:e=>o(function(e){if(e)return{__TYPE__:"FieldContent",type:"Date",value:function(e){let t=`${e.getFullYear()}`.padStart(4,"0"),n=`${e.getMonth()+1}`.padStart(2,"0"),r=`${e.getDate()}`.padStart(2,"0");return`${t}-${n}-${r}`}(e)}}(e))})})})]})}let Qt=(0,x.forwardRef)(function(e,t){return q.jsx(b.oi,{padding:Qn,...e,ref:t,sx:{...e.sx,alignSelf:"stretch"}})}),Qn={input:{inline:4},adornment:{inline:12}},Qr=({provider:e})=>Qi[e.toLowerCase()]??q.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[q.jsx("g",{clipPath:"url(#clip0_6524_22412)",children:q.jsx("path",{d:"M7.99992 1.33333C4.31992 1.33333 1.33325 4.32 1.33325 8C1.33325 11.68 4.31992 14.6667 7.99992 14.6667C11.6799 14.6667 14.6666 11.68 14.6666 8C14.6666 4.32 11.6799 1.33333 7.99992 1.33333ZM2.66659 8C2.66659 7.59333 2.71992 7.19333 2.80659 6.81333L5.99325 10V10.6667C5.99325 11.4 6.59325 12 7.32658 12V13.2867C4.70658 12.9533 2.66659 10.7133 2.66659 8ZM11.9266 11.6C11.7533 11.06 11.2599 10.6667 10.6599 10.6667H9.99325V8.66667C9.99325 8.3 9.69325 8 9.32658 8H5.32658V6.66667H6.65992C7.02658 6.66667 7.32658 6.36667 7.32658 6V4.66667H8.65992C9.39325 4.66667 9.99325 4.06667 9.99325 3.33333V3.06C11.9466 3.84667 13.3333 5.76667 13.3333 8C13.3333 9.38667 12.7933 10.6533 11.9266 11.6Z",fill:"#6F6E77"})}),q.jsx("defs",{children:q.jsx("clipPath",{id:"clip0_6524_22412",children:q.jsx("rect",{width:"16",height:"16",fill:"white"})})})]}),Qi={codepen:q.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[q.jsx("g",{clipPath:"url(#clip0_6523_22409)",children:q.jsx("path",{d:"M15.9879 5.44292C15.9843 5.42352 15.981 5.40413 15.9759 5.38517C15.9726 5.37375 15.9688 5.36298 15.9651 5.35177C15.9597 5.33497 15.9541 5.31816 15.9474 5.30179C15.9427 5.29037 15.9373 5.27938 15.9321 5.26839C15.9248 5.25288 15.9173 5.23758 15.9086 5.22271C15.9026 5.21172 15.8957 5.20138 15.889 5.19082C15.8798 5.1766 15.8703 5.1626 15.8599 5.14902C15.8524 5.13889 15.8446 5.1292 15.8365 5.1195C15.8257 5.10657 15.8141 5.09429 15.8024 5.08223C15.7934 5.07318 15.7843 5.06413 15.7748 5.05529C15.7623 5.04387 15.7494 5.0331 15.7358 5.02276C15.7255 5.01479 15.7154 5.0066 15.7046 4.99927C15.7007 4.99647 15.6973 4.99324 15.6932 4.99065L8.38116 0.115543C8.15039 -0.0385144 7.84939 -0.0385144 7.61863 0.115543L0.306176 4.99044C0.302082 4.99302 0.29885 4.99626 0.294756 4.99906C0.283983 5.0066 0.273856 5.01457 0.263514 5.02254C0.250155 5.0331 0.237011 5.04387 0.224515 5.05486C0.215034 5.06348 0.205985 5.07253 0.19715 5.0818C0.185084 5.09386 0.17388 5.10614 0.162892 5.11907C0.154704 5.12877 0.146947 5.13846 0.139406 5.14924C0.129064 5.16281 0.119583 5.1766 0.110318 5.19104C0.103639 5.20159 0.0969593 5.21194 0.0907108 5.22293C0.0820922 5.23779 0.0745509 5.25309 0.0674405 5.26817C0.0622694 5.27916 0.0566673 5.29037 0.0521425 5.30157C0.0454631 5.31795 0.0396456 5.33475 0.0342589 5.35156C0.030596 5.36276 0.0267177 5.37375 0.0237011 5.38388C0.0187455 5.40284 0.0150825 5.42201 0.0116351 5.44162C0.00969592 5.45153 0.00732581 5.46123 0.00603302 5.47136C0.00215465 5.50109 0 5.53082 0 5.56121V10.4372C0 10.4673 0.00215465 10.4975 0.00646395 10.527C0.00797221 10.5378 0.0107733 10.5464 0.0129279 10.5568C0.0163753 10.5762 0.0193919 10.5955 0.0258558 10.6149C0.0288723 10.6257 0.0323198 10.6365 0.0366291 10.6483C0.0420157 10.6656 0.0474023 10.6828 0.0538662 10.6985C0.058391 10.7093 0.0646395 10.7201 0.0689488 10.7309C0.0760591 10.7459 0.0840314 10.761 0.09265 10.7768C0.098683 10.7875 0.105578 10.7983 0.112042 10.8082C0.121307 10.8233 0.131434 10.8362 0.142207 10.8491C0.149748 10.8599 0.157289 10.8685 0.165908 10.8789C0.176897 10.8918 0.187455 10.9047 0.200382 10.9162C0.209217 10.9248 0.21762 10.9355 0.228393 10.942C0.24089 10.9528 0.254249 10.9636 0.267177 10.9748C0.277519 10.9834 0.288723 10.9898 0.297342 10.9982C0.301436 11.0004 0.303806 11.0047 0.308115 11.0067L7.61863 15.8841C7.73412 15.9617 7.86641 16.0005 8 15.9998C8.13359 15.9992 8.26588 15.9611 8.38137 15.8841L15.6938 11.0092C15.6979 11.0067 15.7014 11.0036 15.7052 11.0008C15.716 10.9933 15.7261 10.9853 15.7365 10.9773C15.7498 10.9668 15.763 10.9558 15.7755 10.9446C15.785 10.9362 15.794 10.9269 15.8031 10.9179C15.8149 10.9058 15.8263 10.8935 15.8371 10.8806C15.8453 10.8709 15.8531 10.8612 15.8606 10.8509C15.8709 10.8373 15.8804 10.8233 15.8897 10.8091C15.8964 10.7987 15.903 10.7882 15.9093 10.7776C15.9179 10.7625 15.9254 10.7472 15.9328 10.7317C15.9379 10.7207 15.9433 10.7097 15.9481 10.6985C15.9548 10.6819 15.9604 10.6651 15.9657 10.6483C15.9694 10.6371 15.9733 10.6261 15.9765 10.6149C15.9815 10.596 15.9849 10.5766 15.9886 10.5572C15.9903 10.5473 15.9929 10.5376 15.994 10.5275C15.9978 10.4977 16 10.468 16 10.4376V5.5625C16 5.53212 15.9976 5.50238 15.994 5.47265C15.9922 5.46209 15.989 5.45347 15.9869 5.44292H15.9879ZM7.99978 9.62638L5.56826 8.00005L7.99978 6.37351L10.4315 8.00005L7.99978 9.62638ZM7.31245 5.17919L4.33171 7.17288L1.92561 5.56336L7.31245 1.97221V5.17919ZM3.09515 7.99984L1.37531 9.15021V6.84947L3.09515 7.99984ZM4.33171 8.82765L7.31245 10.8211V14.0281L1.92561 10.4365L4.33171 8.82722V8.82765ZM8.68733 10.8207L11.6681 8.82722L14.0744 10.4365L8.68733 14.0277V10.8207ZM12.9046 8.00027L14.6247 6.84969V9.15064L12.9046 7.99984V8.00027ZM11.6681 7.17288L8.68733 5.1794V1.97221L14.0744 5.56336L11.6681 7.17288Z",fill:"black"})}),q.jsx("defs",{children:q.jsx("clipPath",{id:"clip0_6523_22409",children:q.jsx("rect",{width:"16",height:"16",fill:"white"})})})]}),codesandbox:q.jsxs("svg",{width:"14",height:"16",viewBox:"0 0 14 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[q.jsx("g",{clipPath:"url(#clip0_6523_22406)",children:q.jsx("path",{d:"M6.24312 14.1129V8.35021L1.28724 5.49888V8.78388L3.55732 10.0999V12.5702L6.24312 14.1129ZM7.53036 14.1468L10.2658 12.571V10.0422L12.5506 8.71812V5.47426L7.53036 8.3727V14.1468ZM11.8904 4.36906L9.25164 2.83995L6.93472 4.18436L4.60022 2.8386L1.93795 4.38817L6.90626 7.24665L11.8904 4.36906ZM0 12.0115V4.02675L6.91821 0L13.8378 4.00984V11.9988L6.91805 15.985L0 12.0115Z",fill:"black"})}),q.jsx("defs",{children:q.jsx("clipPath",{id:"clip0_6523_22406",children:q.jsx("rect",{width:"13.8378",height:"16",fill:"white"})})})]}),dailymotion:q.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[q.jsxs("g",{clipPath:"url(#clip0_6523_22345)",children:[q.jsx("path",{d:"M16 0H0V16H16V0Z",fill:"white"}),q.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.73038 10.3003C8.40789 10.6268 8.00377 10.7901 7.51804 10.7901C7.04025 10.7901 6.64411 10.6308 6.32956 10.3122C6.01503 9.99367 5.85776 9.58351 5.85776 9.08176C5.85776 8.60389 6.01901 8.20766 6.3415 7.89306C6.66401 7.57847 7.06016 7.42118 7.52998 7.42118C7.84849 7.42118 8.13715 7.49484 8.39594 7.64219C8.65474 7.78953 8.8558 7.99063 8.99913 8.2455C9.14246 8.50034 9.21412 8.77908 9.21412 9.08176C9.21412 9.56757 9.05287 9.97376 8.73038 10.3003ZM9.10662 3.58632V6.35792C8.82791 6.07918 8.53131 5.87808 8.21678 5.75463C7.90223 5.63118 7.54988 5.56946 7.1597 5.56946C6.53062 5.56946 5.96527 5.72476 5.4636 6.03538C4.96193 6.34597 4.57176 6.77007 4.29305 7.30768C4.01435 7.84528 3.875 8.44062 3.875 9.09369C3.875 9.76269 4.01236 10.366 4.28708 10.9036C4.5618 11.4412 4.95197 11.8653 5.45763 12.1759C5.96328 12.4865 6.54258 12.6418 7.19553 12.6418C8.14312 12.6418 8.80403 12.3312 9.17831 11.71H9.20218V12.5595H11.0894V3.15625L9.10662 3.58632Z",fill:"#232323"})]}),q.jsx("defs",{children:q.jsx("clipPath",{id:"clip0_6523_22345",children:q.jsx("rect",{width:"16",height:"16",fill:"white"})})})]}),flickr:q.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[q.jsx("rect",{width:"16",height:"16",fill:"white"}),q.jsxs("g",{clipPath:"url(#clip0_6523_22379)",children:[q.jsx("path",{d:"M8.43286 7.78387C8.43286 9.321 9.67925 10.5674 11.2166 10.5674C12.7538 10.5674 13.9999 9.321 13.9999 7.78387C13.9999 6.24675 12.7538 5.00061 11.2166 5.00061C9.67925 5.00061 8.43286 6.24675 8.43286 7.78387Z",fill:"#FF0084"}),q.jsx("path",{d:"M2 7.78408C2 9.32121 3.24614 10.5676 4.78352 10.5676C6.32089 10.5676 7.56703 9.32121 7.56703 7.78408C7.56703 6.24695 6.32089 5.00081 4.78352 5.00081C3.24614 5.00081 2 6.24695 2 7.78408Z",fill:"#0063DC"})]}),q.jsx("defs",{children:q.jsx("clipPath",{id:"clip0_6523_22379",children:q.jsx("rect",{width:"12",height:"5.568",fill:"white",transform:"translate(2 5)"})})})]}),giphy:q.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[q.jsx("rect",{width:"16",height:"16",fill:"#121212"}),q.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4 3.38889V12.2778H5.11111V3.38889H4Z",fill:"#00FF99"}),q.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.6663 5.61111V12.2778H11.7774V5.61111H10.6663Z",fill:"#9933FF"}),q.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.75 3H4V4.11111H8.83333V3H7.75Z",fill:"#FFF35C"}),q.jsx("path",{d:"M9.00041 4.11111H7.33374H8.83374V3.77778L9.00041 4.11111Z",fill:"#999999"}),q.jsx("path",{d:"M8.83374 4.11111H7.33374L8.44485 3L8.83374 3.77778V4.11111Z",fill:"#999237"}),q.jsx("path",{d:"M10.6663 7.44444V5.77778L11.7774 6.33333L10.6663 7.44444Z",fill:"#5C1F99"}),q.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.6667 11.8889H4V13H11.7778V11.8889H10.6667Z",fill:"#00CCFF"}),q.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.6668 5.22222V4.11111H9.55569V3H8.44458V3.90739V5.0185V6.33333H9.55569H10.6668H11.7779V5.22222H10.6668Z",fill:"#FF6666"})]}),instagram:q.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",children:[q.jsxs("g",{clipPath:"url(#clip0_6523_22356)",children:[q.jsx("mask",{id:"mask0_6523_22356",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"16",height:"16",children:q.jsx("path",{d:"M4.70325 0.0949238C3.85627 0.1349 3.27778 0.270564 2.77227 0.468642C2.24897 0.672648 1.80537 0.946046 1.36408 1.38914C0.922279 1.83249 0.650958 2.27688 0.448504 2.8007C0.252489 3.3075 0.119662 3.88627 0.0822604 4.73377C0.045126 5.58283 0.0366102 5.85363 0.0407495 8.01522C0.0448729 10.1765 0.0544124 10.4479 0.0949012 11.2972C0.135388 12.1439 0.270546 12.7222 0.468623 13.2279C0.672886 13.7512 0.946004 14.1946 1.38935 14.6361C1.83245 15.0777 2.27708 15.3487 2.80115 15.5515C3.30744 15.7472 3.88644 15.8806 4.73369 15.9177C5.58273 15.9551 5.85379 15.9634 8.01483 15.9592C10.1769 15.9551 10.448 15.9456 11.297 15.9053C12.144 15.8648 12.722 15.7292 13.228 15.5316C13.7513 15.3268 14.1949 15.0542 14.6362 14.6109C15.0775 14.1678 15.3488 13.7231 15.5512 13.199C15.7473 12.6927 15.8806 12.1137 15.9175 11.267C15.9546 10.4174 15.9634 10.1461 15.9593 7.98478C15.9551 5.8232 15.9453 5.55239 15.9051 4.7036C15.8649 3.85609 15.7292 3.27811 15.5314 2.77208C15.3269 2.24877 15.054 1.80567 14.6109 1.36387C14.1678 0.922574 13.7232 0.650729 13.1991 0.448785C12.6926 0.252768 12.1138 0.119166 11.2666 0.0825425C10.4175 0.0448876 10.1465 0.0366393 7.98465 0.0407642C5.82336 0.0448892 5.5523 0.0541772 4.70325 0.0949238ZM4.79611 14.485C4.02004 14.4512 3.59863 14.3222 3.31776 14.2142C2.94585 14.0703 2.68046 13.8977 2.40114 13.6205C2.12234 13.3422 1.94928 13.0776 1.80408 12.7064C1.69497 12.4255 1.5637 12.0046 1.52734 11.2286C1.48788 10.3896 1.47886 10.1378 1.47498 8.01237C1.47086 5.88742 1.47859 5.63569 1.51522 4.79593C1.54848 4.02038 1.67822 3.59843 1.78602 3.31782C1.92993 2.94539 2.10196 2.68051 2.37973 2.4012C2.65801 2.12187 2.92263 1.94933 3.29402 1.80412C3.57463 1.69451 3.99555 1.56426 4.77134 1.52738C5.61084 1.48766 5.8623 1.47915 7.98723 1.47502C10.1127 1.47089 10.3644 1.47838 11.2042 1.51526C11.9797 1.54904 12.4016 1.67749 12.682 1.78607C13.0541 1.92998 13.3195 2.1015 13.5986 2.37979C13.8777 2.65808 14.0507 2.92218 14.1959 3.29435C14.3055 3.57418 14.4358 3.99562 14.4724 4.77117C14.5124 5.61068 14.5214 5.8624 14.5253 7.98736C14.5294 10.1128 14.5217 10.3646 14.4848 11.2038C14.451 11.9799 14.3223 12.4016 14.214 12.6827C14.0701 13.0543 13.898 13.3197 13.62 13.5991C13.342 13.8773 13.0774 14.0509 12.7057 14.1961C12.4256 14.3055 12.0042 14.436 11.2289 14.4729C10.3894 14.5123 10.1379 14.5214 8.01225 14.5252C5.88732 14.5294 5.63586 14.5214 4.79611 14.485ZM11.2854 3.74493C11.2864 4.27211 11.7151 4.69896 12.2422 4.69792C12.7697 4.69689 13.1965 4.2685 13.1957 3.74132C13.1947 3.21414 12.7661 2.78704 12.2386 2.78807C11.7112 2.7891 11.2844 3.21775 11.2854 3.74493ZM3.91277 8.00773C3.91714 10.2653 5.75063 12.0913 8.0076 12.0869C10.2648 12.0825 12.0919 10.2495 12.0875 7.99201C12.0831 5.73526 10.2494 3.90819 7.99188 3.91257C5.73489 3.91696 3.90837 5.75073 3.91277 8.00773ZM5.34648 8.0049C5.3439 6.53969 6.52978 5.34942 7.99471 5.34683C9.45991 5.344 10.6504 6.52937 10.6533 7.99484C10.6561 9.46031 9.47022 10.6503 8.00477 10.6532C6.53984 10.656 5.34932 9.47037 5.34648 8.0049Z",fill:"white"})}),q.jsxs("g",{mask:"url(#mask0_6523_22356)",children:[q.jsx("mask",{id:"mask1_6523_22356",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"-1",y:"-1",width:"18",height:"18",children:q.jsx("path",{d:"M16.5905 -0.583628H-0.603516V16.6106H16.5905V-0.583628Z",fill:"white"})}),q.jsxs("g",{mask:"url(#mask1_6523_22356)",children:[q.jsx("mask",{id:"mask2_6523_22356",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"-1",y:"-1",width:"18",height:"18",children:q.jsx("path",{d:"M16.6701 -0.663237H-0.683105V16.6902H16.6701V-0.663237Z",fill:"white"})}),q.jsxs("g",{mask:"url(#mask2_6523_22356)",children:[q.jsx("mask",{id:"mask3_6523_22356",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"-1",y:"-1",width:"18",height:"18",children:q.jsx("path",{d:"M16.6701 -0.663237H-0.683105V16.6902H16.6701V-0.663237Z",fill:"white"})}),q.jsx("g",{mask:"url(#mask3_6523_22356)",children:q.jsx("rect",{x:"-0.688721",y:"-0.665792",width:"17.3622",height:"17.3622",fill:"url(#pattern0)"})})]})]})]})]}),q.jsxs("defs",{children:[q.jsx("pattern",{id:"pattern0",patternContentUnits:"objectBoundingBox",width:"1",height:"1",children:q.jsx("use",{xlinkHref:"#image0_6523_22356",transform:"scale(0.000439947)"})}),q.jsx("clipPath",{id:"clip0_6523_22356",children:q.jsx("rect",{width:"16",height:"16",fill:"white"})}),q.jsx("image",{id:"image0_6523_22356",width:"2273",height:"2275",xlinkHref:"data:image/jpeg;base64,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Hbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfw5h277H8MO3fY/hh277H8MO3fY/hh277H8MO3fY/hh277H8MO3fY/hh277H8MO3fY/hh277H8MO3fY/hh277H8MO3fY/hh277H8MO3fY/hh277H8MO3fY/hh277H8MO3fY/hh277H8MO3fY/hh277H8MO3fY/hh277H8MO3fY/hh277H8MO3fY/hh277H8MO3fY/hh277H8MO3fY/hh277H8MO3fY/hh277H8MO3fY/hh277H8MO3fY/hh277H8MO3fY/hh277H8MO3fY/hh277H8MO3fY/hh277H8MO3XY/hh26jfww7dRv4Yduo38MO3Ub+GHbqN/DDt1G/hh26jfww7dRv4Yduo38MO3Ub+GHbqN/DDt1G/hh26jfww7dRv4Yduo38MO3Ub+GHbqN/DDt1G/hh26jfww7dRv4Yduo38MO3Ub+GHbqN/DDt1G/hh26jfww7dRv4Yduo38MO3Ub+GHbqN/DDt1G/hh26j+GHbqP4Yduo38MO3Ub+GHbqP4Yduo/hh26j+GHbmP4YduY/hh25j+GHbmP4YduY/hh25j+GHbmP4YduY/hh25j+GHbmP4YduY/hh25j+GHbmP4YduY/hh25j+GHbmP4YduY/hh25j+GHbmNh25jYduY2HbmNh25jYduY2HbmNh24jYduI2HbiNh24jYduI2HbiNh24jYduI2HbiNh24jYduI2HbiNh24jYduI2HbiNh24jYduI2HbiNh24jYduI2HbiNh0+Nh0+Jh0+Jh0+Jh0+Jh0+Jh0+Jh0+Jh0+Jh0+Jh0+Jh0+Jh0+Jh0+Jh0+Jh0+Jh0+Jh0+Jh0+Jh0+Jh06Jh06Jh06Jh06Jh06Jh06Jh06Jh06Jh06Jh06Jh06Jh06Jh06Jh06Jh06Jh06Jh06Jh06Jh06Jh06Jh06Jh06Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jhz+j7fweHn/AFd+fp9v6v8Ape79DDf1JLc930/LnmGfj9H0+v7/APAf6c32/wAQ/wCR+n/5f9383/iNaca041pxrTjWnGtONaca041pxrTjWnGtONaca041pxrTjWnGtONaca041pxrTjWnGtONaca041pxrTjWnGtONaca041pxrTjWnGtONaca041pxrTjWnGtONaca041pxrTjWnGtONaca0415xrzjXnGvONeca8415xrzjXnGvONeca8415xrzjXnGvONeca8415xrzjXnGvONeYa8w15hrzDXmGvMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMNeYa8w15hrzDXnGvONeca8415xrzjXnGvONeca041pxrTjWnGtONaca041pxrTjWnGtONacas41ZxqzjVnGrONWcas41ZxqzjVnGrONScak41JxqTjUUGooNRQaig1FBqKDTUGmoNNQaag01BpqDTUGmoNNQaag0lBpKDSUGkoNJQaSg0lBpKDSUGioNFQaKg0VBoqDRVGiqNFUaKo0FRoKjQVGgqNBUaCo0FRoKjQVGgqPXqj16o9eqPXqj16o9eqPXqj16o9eqPXqj1yo9cqPXKj1yo9cqPXLD1yw9csPXLD1yw9csPWrD1qw9asPWrD1qw9asPWrD1qw9asPWrD1qw9YsPWLD1iw9YsPWLD1iw9YsPWLD1iw9YsPWLD1iw9YsPWLD1iw9YsPWLD1iw9YsPWLD1iw9YsPWLD1aw9WsPVrD1aw9WsPVrD1aw9WsPVrD1aw9WsPVrB34/8Ay/z/AH/53yHY/wDU/E/0v+P7/wCz/9k="})]})]}),pinterest:q.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[q.jsxs("g",{clipPath:"url(#clip0_6570_25513)",children:[q.jsx("rect",{width:"15.996",height:"16",rx:"2",fill:"#CC2127"}),q.jsx("path",{d:"M7.999 2C4.68555 2 2 4.68555 2 7.999C2 10.5406 3.58174 12.7102 5.81336 13.5861C5.76137 13.1121 5.71338 12.3843 5.83336 11.8644C5.94134 11.3964 6.53724 8.88285 6.53724 8.88285C6.53724 8.88285 6.35727 8.52291 6.35727 7.993C6.35727 7.15914 6.84119 6.53524 7.44309 6.53524C7.95501 6.53524 8.20297 6.91918 8.20297 7.3811C8.20297 7.89502 7.87502 8.66489 7.70705 9.37877C7.56507 9.97667 8.007 10.4626 8.5949 10.4626C9.66072 10.4626 10.4806 9.33878 10.4806 7.71505C10.4806 6.27929 9.44876 5.27345 7.975 5.27345C6.26729 5.27345 5.26546 6.55324 5.26546 7.87702C5.26546 8.39293 5.46342 8.94484 5.71138 9.24679C5.75937 9.30678 5.76737 9.35877 5.75337 9.41876C5.70738 9.60873 5.6074 10.0167 5.5874 10.0987C5.56141 10.2086 5.50142 10.2326 5.38743 10.1786C4.63756 9.83069 4.16964 8.73488 4.16964 7.85502C4.16964 5.96334 5.54541 4.22563 8.13298 4.22563C10.2146 4.22563 11.8304 5.70938 11.8304 7.69105C11.8304 9.75871 10.5266 11.4224 8.71688 11.4224C8.10898 11.4224 7.53708 11.1065 7.34111 10.7345C7.34111 10.7345 7.04116 11.8804 6.96717 12.1603C6.83119 12.6822 6.46526 13.3341 6.2213 13.732C6.7832 13.906 7.3791 14 7.997 14C11.3104 14 13.996 11.3144 13.996 8.001C13.998 4.68555 11.3124 2 7.999 2Z",fill:"white"})]}),q.jsx("defs",{children:q.jsx("clipPath",{id:"clip0_6570_25513",children:q.jsx("rect",{width:"16",height:"16",fill:"white"})})})]}),spotify:q.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[q.jsx("g",{clipPath:"url(#clip0_6523_22402)",children:q.jsx("path",{d:"M12.6609 7.10585C10.121 5.59751 5.93158 5.45882 3.50697 6.1947C3.11759 6.31287 2.70584 6.09298 2.5879 5.70373C2.46988 5.31411 2.68945 4.90265 3.07911 4.78429C5.86241 3.93945 10.4892 4.1026 13.4132 5.83828C13.7634 6.04622 13.8782 6.49851 13.6707 6.84813C13.4629 7.19833 13.0103 7.31376 12.6609 7.10585ZM12.5777 9.33993C12.3995 9.62908 12.0215 9.71979 11.7327 9.54223C9.61522 8.24063 6.38637 7.86357 3.88123 8.624C3.55636 8.72218 3.21323 8.53899 3.11455 8.21475C3.01666 7.88989 3.19992 7.54738 3.5242 7.44859C6.38597 6.58018 9.9436 7.00081 12.3756 8.49536C12.6644 8.67322 12.7553 9.05146 12.5777 9.33993ZM11.6136 11.4855C11.472 11.7177 11.1697 11.7904 10.9383 11.6489C9.08801 10.518 6.75909 10.2627 4.01637 10.8891C3.75207 10.9497 3.48866 10.7841 3.42838 10.5198C3.36785 10.2556 3.53284 9.99217 3.79772 9.93186C6.79916 9.2457 9.37381 9.54101 11.4506 10.8101C11.6822 10.9515 11.7551 11.254 11.6136 11.4855ZM8.00002 0.120623C3.64839 0.120623 0.120605 3.64834 0.120605 7.99989C0.120605 12.352 3.64839 15.8794 8.00002 15.8794C12.3517 15.8794 15.8794 12.352 15.8794 7.99989C15.8794 3.64834 12.3517 0.120623 8.00002 0.120623Z",fill:"#1ED760"})}),q.jsx("defs",{children:q.jsx("clipPath",{id:"clip0_6523_22402",children:q.jsx("rect",{width:"16",height:"16",fill:"white"})})})]}),twitter:q.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:q.jsx("path",{d:"M14.3193 4.31285C14.329 4.45301 14.329 4.59317 14.329 4.73462C14.329 9.04475 11.0516 14.0156 5.05865 14.0156V14.0131C3.28832 14.0156 1.55478 13.508 0.0644531 12.5507C0.321873 12.5817 0.580582 12.5972 0.839937 12.5979C2.30703 12.5992 3.7322 12.1063 4.88639 11.1988C3.4922 11.1724 2.26961 10.2623 1.84252 8.93366C2.3309 9.02796 2.83413 9.00858 3.31349 8.87746C1.79349 8.57001 0.699937 7.23299 0.699937 5.68023C0.699937 5.66602 0.699937 5.65246 0.699937 5.63889C1.15284 5.89144 1.65994 6.0316 2.17865 6.0471C0.747034 5.08923 0.305743 3.18251 1.17026 1.69176C2.82445 3.7296 5.2651 4.96844 7.8851 5.09956C7.62252 3.96664 7.98123 2.77947 8.82768 1.98307C10.1399 0.748096 12.2038 0.811395 13.4374 2.12452C14.167 1.98048 14.8664 1.71243 15.5064 1.33264C15.2632 2.0877 14.7541 2.72909 14.0741 3.13665C14.7199 3.06044 15.3509 2.88734 15.9451 2.62316C15.5077 3.2794 14.9567 3.85103 14.3193 4.31285Z",fill:"#1D9BF0"})}),vimeo:q.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[q.jsxs("g",{clipPath:"url(#clip0_6523_22340)",children:[q.jsx("path",{d:"M16 14.4C16 15.28 15.28 16 14.4 16H1.6C0.72 16 0 15.28 0 14.4V1.6C0 0.72 0.72 0 1.6 0H14.4C15.28 0 16 0.72 16 1.6V14.4Z",fill:"#1AB7EA"}),q.jsx("path",{d:"M13.9945 5.3084C13.9391 6.42815 13.1229 7.97447 11.5458 9.93402C9.91331 11.9736 8.52987 13 7.40928 13C6.70372 13 6.12267 12.3735 5.63846 11.1338C5.32027 9.98735 4.98824 8.85427 4.67005 7.70786C4.31036 6.46814 3.92299 5.84161 3.50796 5.84161C3.42495 5.84161 3.10676 6.02824 2.56721 6.38816L2 5.68165C2.59488 5.1751 3.17593 4.68187 3.75698 4.17532C4.54554 3.52214 5.14042 3.17555 5.54162 3.13556C6.46853 3.05557 7.04958 3.66877 7.27093 4.97514C7.50612 6.40149 7.67213 7.28129 7.75514 7.62788C8.01799 8.80095 8.32235 9.40081 8.64054 9.40081C8.88956 9.40081 9.26309 9.01423 9.77497 8.2544C10.273 7.49457 10.5497 6.90804 10.5774 6.50813C10.6465 5.85494 10.3837 5.52169 9.77497 5.52169C9.48444 5.52169 9.19392 5.58834 8.88956 5.70831C9.48444 3.84206 10.605 2.94893 12.2652 3.00225C13.4826 3.02891 14.0637 3.80207 13.9945 5.3084Z",fill:"white"})]}),q.jsx("defs",{children:q.jsx("clipPath",{id:"clip0_6523_22340",children:q.jsx("rect",{width:"16",height:"16",fill:"white"})})})]}),youtube:q.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[q.jsx("path",{d:"M15.6656 3.75817C15.4816 3.06609 14.9395 2.5211 14.2511 2.33614C13.0034 2 8 2 8 2C8 2 2.99666 2 1.7489 2.33614C1.06051 2.5211 0.518324 3.06609 0.334339 3.75817C0 5.01251 0 7.62963 0 7.62963C0 7.62963 0 10.2467 0.334339 11.5012C0.518324 12.1932 1.06051 12.7381 1.7489 12.9232C2.99666 13.2593 8 13.2593 8 13.2593C8 13.2593 13.0034 13.2593 14.2511 12.9232C14.9395 12.7381 15.4816 12.1932 15.6656 11.5012C16 10.2467 16 7.62963 16 7.62963C16 7.62963 16 5.01251 15.6656 3.75817Z",fill:"#ED1D24"}),q.jsx("path",{d:"M6.36353 10.0058L10.5453 7.62974L6.36353 5.25349V10.0058Z",fill:"white"})]})};function Qo(e){let{debouncedUrl:t,content:n,onContentChange:r,selected:i}=e,o=(0,x.useRef)(null),[a,u]=(0,x.useState)(!1);return(0,w.pQ)(t,()=>{var e;a&&(u(!1),null==(e=o.current)||e.reset())}),(0,C.ju)(t)?t===(null==n?void 0:n.embed_url)?q.jsx(Qu,{content:n,selected:i}):q.jsx(b.SV,{ref:o,renderError:Qa,onError:function(){u(!0),r(void 0)},children:q.jsx(x.Suspense,{fallback:n&&q.jsx(Qu,{content:n,selected:i}),children:q.jsx(Qs,{url:t,selected:i,onContentChange:r})})}):null}function Qa(){return q.jsxs(b.xu,{backgroundColor:"grey2",borderRadius:6,padding:16,gap:4,children:[q.jsx(b.I5,{name:"alert",size:"small",color:"grey11"}),q.jsx(b.xv,{variant:"smallBold",color:"grey11",children:"There is no embed data available."})]})}function Qu(e){let{content:t,selected:n}=e,{thumbnail:r,provider:i,author:o,url:a,subtitle:u}=function(e){let t="";switch(e.type){case"video":t=e.title??"";break;case"photo":t=`View this post${e.provider_name?` on ${e.provider_name}`:""}`;break;default:t=`Open${e.provider_name?` on ${e.provider_name}`:""}`}return{url:e.embed_url,thumbnail:{url:e.thumbnail_url??"",aspectRatio:"video"===e.type?"16:9":"1:1"},provider:e.provider_name??"",author:e.author_name??"",subtitle:t}}(t);return q.jsxs(b.oU,{selected:n,children:[q.jsx(b.Sy,{src:r.url,aspectRatio:r.aspectRatio}),q.jsxs(b.Tw,{children:[q.jsxs(b.xu,{display:"flex",alignItems:"center",gap:4,children:[q.jsx(Qr,{provider:i}),q.jsx(b.xv,{variant:"smallBold",color:"grey12",noWrap:!0,children:i}),o&&q.jsx(b.xv,{variant:"small",color:"grey11",noWrap:!0,children:o})]}),q.jsx(b.xv,{variant:"smallBold",href:a,children:u})]})]})}function Qs(e){let{url:t,onContentChange:n,selected:r}=e,i=function(e){let{url:t,onContentChange:n}=e,{embedApiEndpoint:r}=WS(),i=(0,O.QT)(Ql,[t,r]),o=(0,w.R9)(n);return(0,x.useEffect)(()=>{let e=(0,b.rI)(()=>o(i));return()=>{clearTimeout(e)}},[i,o]),i}({url:t,onContentChange:n});return q.jsx(Qu,{content:i,selected:r})}function Ql(e,t){let n=new URL(t);return n.searchParams.set("url",e),(0,k.WY)(n,{okType:Nn.object({type:Nn.string(),version:Nn.string().or(Nn.number()).nullish(),title:Nn.string().nullish(),author_name:Nn.string().nullish(),author_url:Nn.string().nullish(),provider_name:Nn.string().nullish(),provider_url:Nn.string().nullish(),cache_age:Nn.string().or(Nn.number()).nullish(),thumbnail_url:Nn.string().nullish(),thumbnail_width:Nn.number().nullish(),thumbnail_height:Nn.number().nullish(),html:Nn.string().nullish()}).passthrough().transform(t=>{let n={embed_url:e};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 Qc(e){let{id:t,readOnly:n,field:r,content:i,onContentChange:o}=e,a=(0,w.$P)({initialState:(null==i?void 0:i.embed_url)??"",startTransition:x.startTransition});function u(e){a.set(e),(0,C.ju)(e)||o(void 0)}return q.jsxs(b.gN,{footer:(0,C.ju)(a.value)&&q.jsx(b.mS,{children:q.jsx(Qo,{debouncedUrl:a.debouncedValue,content:i,onContentChange:o})}),children:[q.jsx(b.fw,{name:"cloud"}),q.jsx(b.Qy,{htmlFor:t,children:q9(r)}),q.jsx(b.JO,{children:q.jsx(Qt,{id:t,readOnly:n,placeholder:q4(r),value:a.value,onValueChange:u,variant:(0,C.ju)(a.value)?"link":"normal",endAdornment:q.jsx(b.zx,{startIcon:"close",color:"grey",size:"small",disabled:!a,onClick:()=>u("")})})})]})}function Qd(e){return!(e.lat>85||e.lat<-85||e.lng>180||e.lng<-180)}function Qf(e){let t=e.match(/^.*@(-?\d+.\d+),(-?\d+.\d+).*$/);if(!t)return;let n=parseFloat(t[1]??""),r=parseFloat(t[2]??"");if(isNaN(n)||isNaN(r))return;let i={lat:n,lng:r};if(Qd(i))return i}function Qp(e){return e?`${e.lat}, ${e.lng}`:""}function QA(e){let t=e.match(/\(?([\d|.|-]*)[\s+]*,[\s]*([\d|.|-]*)\)?/);if(!t)return Qf(e);let n=parseFloat(t[1]??""),r=parseFloat(t[2]??"");if(isNaN(n)||isNaN(r))return Qf(e);let i={lat:n,lng:r};return Qd(i)?i:Qf(e)}function Qh(e){let{field:t,id:n,readOnly:r,...i}=e,{onValueChange:o,displayedValue:a,onBlur:u,clearValue:s,isValidCoordinates:l}=function(e){let{content:t,onContentChange:n}=e,r=Qp(null==t?void 0:t.position),[i,o]=(0,x.useState)(r),a=!!QA(i);return{displayedValue:i,isValidCoordinates:a,onValueChange:o,onBlur:function(){let e=QA(i);if(!e)return o(""),n(void 0);let{lat:t,lng:r}=e;o(Qp({lat:t,lng:r})),n({__TYPE__:"GeoPointContent",position:{lat:t,lng:r}})},clearValue:function(){o(""),n(void 0)}}}(i);return q.jsxs(b.gN,{children:[q.jsx(b.fw,{name:"place"}),q.jsx(b.Qy,{htmlFor:n,children:q9(t)}),q.jsx(b.JO,{children:q.jsx(Qt,{id:n,onValueChange:o,placeholder:"...",readOnly:r,value:a,onBlur:u,variant:l?"link":"normal",endAdornment:q.jsx(b.zx,{startIcon:"close",color:"grey",size:"small",disabled:!a,onClick:s})})})]})}function Qm(e){let{fieldLabel:t,imageLabel:n=[]}=e;return q.jsxs(b.wP,{children:[q.jsx(b.xv,{variant:"bold",noWrap:!0,children:(0,T.tx)(t,30)}),0!==n.length&&q.jsx(b.xv,{color:"grey11",noSelect:!0,children:` • ${n.join(" • ")}`})]})}function Qg(e){let{fieldLabel:t,isUpdating:n,readOnly:r,onMediaDialogOpenChange:i}=e;return q.jsxs(q.Fragment,{children:[q.jsx(b.Ol,{sx:{flexWrap:"wrap"},children:q.jsx(Qm,{fieldLabel:t})}),q.jsx(b.aY,{children:q.jsx(b.Zb,{color:"grey2",variant:"dashed",paddingBlock:12,radius:4,sx:{width:"100%"},children:q.jsx(b.aY,{children:q.jsxs(b.R$,{variant:"horizontal",children:[q.jsx(b.av,{name:"cloudUpload",lineColor:"purple9",backgroundColor:"purple4",size:"small"}),q.jsx(b._T,{children:n?"Preparing your image...":"You haven't selected an image"}),!r&&q.jsx(b.Qj,{children:q.jsx(b.zx,{disabled:n,onClick:()=>i(!0),size:"medium",children:"Select image"})})]})})})})]})}let Qy=Dz({id:DM(),width:Dj(),height:Dj(),urls:Dz({full:DM(),small:DM().transform(function(e){let t=new URL(e);return t.searchParams.delete("q"),t.searchParams.delete("fm"),t.searchParams.set("w","300"),t.searchParams.set("auto","compress,format"),t.toString()})}),alt_description:DM().optional(),description:DM().nullable()}),Qv=Dz({results:DV(Qy)}).transform(e=>e.results);function Qx(e,t){let n=new URL("search/photos",e);return n.searchParams.set("page","1"),n.searchParams.set("per_page","28"),n.searchParams.set("query",t),(0,k.WY)(n,{okType:Qv})}function Qb(e){let{onSelectedChange:t}=e,[n,r]=(0,x.useTransition)(),i=(0,w.$P)({initialState:"",ms:300,startTransition:r});return q.jsxs(b.xu,{flexDirection:"column",gap:16,width:"100%",position:"relative",children:[q.jsx(b.CR,{value:i.value,placeholder:"Search on Unsplash.com",onValueChange:i.set}),q.jsx(b.SV,{renderError:()=>q.jsx(qe,{}),children:q.jsx(x.Suspense,{fallback:q.jsx(Qw,{}),children:q.jsx(QC,{term:i.debouncedValue,loading:n,onSelectedChange:t})})})]})}function QC(e){let{term:t,onSelectedChange:n,loading:r}=e,{media:i,toggleSelected:o,selectedImageId:a}=function(e){var t;let{term:n,onSelectedChange:r}=e,{unsplashApiBaseUrl:i}=WS(),o=function(e,t){let n=(0,x.useRef)(),r=WS(),i=(0,O.QT)(Qx,[e,t]);return(0,w.Nr)(t,1e3,()=>{var e;n.current&&t!==n.current&&(null==(e=r.onAnalyticsEvent)||e.call(r,"Unsplash Image Searched")),n.current=t}),i}(i,n||"citrus fruit"),a=null==(t=null==o?void 0:o[0])?void 0:t.id,[u,s]=(0,x.useState)();return(0,x.useEffect)(()=>{null==r||r([]),s(void 0)},[a,r]),{media:o,toggleSelected:function(e){if(e.id===u)return s(void 0),null==r?void 0:r([]);s(e.id),null==r||r([{...e,url:e.urls.full,alt:e.alt_description}])},selectedImageId:u}}({term:t,onSelectedChange:n});return q.jsxs(q.Fragment,{children:[i.length>0&&q.jsx(QS,{children:null==i?void 0:i.map(e=>{let t=new URL(e.urls.full).searchParams.get("fm")??"jpg";return q.jsx(b.PB,{url:e.urls.small,filename:e.description??"Unsplash Image",selected:a===e.id,onCardClick:()=>o(e),onCheckedChange:()=>o(e),extension:t,kind:"image",width:e.width,height:e.height,loading:r},e.id)})}),0===i.length&&q.jsx(N2,{})]})}function QS(e){let{children:t}=e;return q.jsx(b.xr,{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(min(100%, 250px), 1fr))",gap:16,padding:2,paddingBottom:16,position:"relative",width:"100%"},children:t})}function Qw(){return q.jsx(QS,{children:(0,R.w6)(1,24).map(e=>q.jsx(qd,{},e))})}function QI(e){let{open:t,onOpenChange:n,onMediaSelected:r,assetType:i}=e,o=WS(),a=o.mediaLibrary,[u,s]=(0,x.useState)(()=>a?"media":"unsplash"),[l,c]=(0,x.useState)(new Set),[d,f]=(0,x.useState)([]),p=l.size+d.length,A=(0,O.q_)(NK);function h(e){e||c(new Set),n(e)}(0,x.useEffect)(()=>{t&&a&&NV({config:o,assetType:i})},[t,o,i,a]);let m=function(e){let{assetType:t,mediaDialogOpen:n}=e,r=WS(),i=(0,O.q_)(NK),o=(0,x.useRef)(0);return(0,x.useEffect)(()=>{n&&(o.current=performance.now())},[n]),function(e){if(!r.onAnalyticsEvent||!r.mediaLibrary)return;let n=i[i.length-1];if(!n)return;let{keyword:a,tags:u}=n,s=NN(i,t,a,u),l=String(a.split(" ").length),c=String(n.total),d=String(s.findIndex(t=>t.id===e)+1),f=[e].join(","),p=(performance.now()-o.current).toFixed(0);r.onAnalyticsEvent("Media Added To Page",{assetType:t,searchQuery:a,numberOfWords:l,numberOfResults:c,searchPosition:d,mediaIds:f,timeToAddMediaToPage:p,tags:u})}}({assetType:i,mediaDialogOpen:t}),{containerRef:g}=(0,b.VY)();return q.jsxs(b.Vq,{open:t,onOpenChange:h,size:{width:"min(calc(100% - 48px), 2000px)",height:"calc(100% - 30px)"},position:"center",onPointerDownOutside:e=>{g&&(0,w.DX)(g,e.target)&&e.preventDefault()},children:[q.jsx(b.fK,{icon:"image",title:"Media library"}),q.jsxs(b.Zp,{value:u,onValueChange:function(e){if("media"!==e&&"unsplash"!==e)throw Error(`Invalid option ${e}.`);s(e)},padding:"small",width:"auto",children:[a&&q.jsx(b.T9,{value:"media",icon:"photo"}),q.jsx(b.T9,{value:"unsplash",icon:"unsplash"})]}),q.jsx(b.cZ,{children:q.jsxs(b.xu,{flexDirection:"column",flexGrow:1,overflow:"hidden",children:[q.jsx(Wh,{}),q.jsxs(b.xu,{overflow:"hidden",backgroundColor:"grey3",padding:{top:16,inline:16},flexGrow:1,children:["media"===u&&q.jsx(q6,{assetType:i,onSelectedChange:c}),"unsplash"===u&&q.jsx(Qb,{onSelectedChange:f})]})]})}),q.jsxs(b.kX,{children:[q.jsx(b.PO,{}),q.jsx(b._d,{onClick:function(){var e;if("unsplash"===u){let t=d[0];if(!t)return;r(t),null==(e=o.onAnalyticsEvent)||e.call(o,"Unsplash Image Added")}else if("media"===u){let e=A.flatMap(e=>e.items).filter(e=>l.has(e.id))[0];if(!e)return;r(e),m(e.id)}h(!1)},disabled:1!==p,tooltipLabel:0===p?"Select a media item to add to the page":p>1?"Only one media item can be added to the page":void 0,children:"Add to page"})]})]})}function Q_(e){let{isMediaDialogOpen:t,selected:n,onMediaSelected:r,onMediaDialogOpenChange:i,children:o}=e;return q.jsxs(b.Zb,{color:n?"indigo2":"grey2",variant:n?"selected":"dashed",paddingBlock:12,radius:4,children:[o,q.jsx(QI,{open:t,onOpenChange:i,onMediaSelected:r,assetType:"image"})]})}function QT(e){let{contentView:t,croppedImage:n}=e,{width:r,height:i,x:o,y:a,zoom:u}=n,s=function(e){let{origin:t,croppedImage:n}=e,{x:r,y:i,width:o,height:a,cropHeight:u,cropWidth:s}=n,l=new URL(t.url),c=t.height!==a||t.width!==o;if(0!==r||0!==i||u!==t.height||s!==t.width){let e=[r,i,s,u].map(Math.round).join(",");l.searchParams.set("rect",e),l.searchParams.set("w",o.toString()),l.searchParams.set("h",a.toString())}return c&&(l.searchParams.set("w",o.toString()),l.searchParams.set("h",a.toString())),l.toString()}({origin:t.origin,croppedImage:n});return{...t,width:r,height:i,url:s,edit:{...t.edit,zoom:u,crop:{x:o,y:a}}}}function QO(e){let{content:t,croppedImage:n}=e,r=QT({contentView:t,croppedImage:n});return r.url===t.url?t:{...t,...r}}function QR(e){let{selectedImage:t,imageCrop:n,setImageCrop:r}=e,{width:i,height:o,zoom:a,cropHeight:u,cropWidth:s}=n,l=t.contentView,c={x:n.x,y:n.y,width:s,height:u},[d,f]=(0,x.useState)(),p=(null==l?void 0:l.origin.url)??"",A=!(null!=t&&t.thumbnail.height&&null!=t&&t.thumbnail.width);function h(e,t){let i=parseInt(t);isNaN(i)||i<=0||!A||r({...n,[e]:i})}function m(e){r({...n,zoom:e})}return q.jsxs(b.xu,{padding:{inline:24,block:16},flexDirection:"column",gap:16,height:"100%",overflowY:"auto",alignItems:"center",children:[q.jsxs(b.xu,{gap:8,height:32,alignItems:"flex-start",width:"100%",children:[q.jsx(b.u,{content:"Center",children:q.jsx(b.zx,{color:"grey",size:"medium",startIcon:"centerFocusWeak",onClick:function(){f(Qk),r({...n,...Qk})}})}),q.jsx(b.u,{content:"Cover",children:q.jsx(b.zx,{color:"grey",size:"medium",startIcon:"zoomOutMap",onClick:function(){l&&(f(Qk),r({...n,...Qk,zoom:1,cropWidth:l.width,cropHeight:l.height}))}})}),q.jsx(b.Z0,{orientation:"vertical"}),q.jsx(b.yt,{prefix:"W",prefixTooltip:"Width",placeholder:"width",type:"number",size:"medium",value:String(i),onValueChange:e=>h("width",e),sx:{width:100},disabled:!A}),q.jsx(b.yt,{prefix:"H",prefixTooltip:"Height",placeholder:"height",type:"number",size:"medium",value:String(o),onValueChange:e=>h("height",e),sx:{width:100},disabled:!A})]}),q.jsx(b.fl,{image:p,aspect:i/o,crop:d??{x:0,y:0},onCropChange:f,zoom:a,onZoomChange:m,onCropAreaChange:(e,t)=>{r({...n,cropWidth:t.width,cropHeight:t.height,x:t.x,y:t.y})},initialCroppedAreaPixels:c}),q.jsx(b.xu,{width:"100%",maxWidth:320,children:q.jsx(b.iR,{min:1,max:3,step:.01,value:[a],onValueChange:([e])=>m(e??1)})})]})}O.Fs.registerFetcherConfig(Qx,{cacheCapacity:5,revalidationStrategy:{type:"never"}});let Qk={x:0,y:0};function QE(e){let{trigger:t,initialImages:n,renderTooltip:r}=e,{open:i,onOpenChange:o,ready:a,option:u,selectedImage:s,croppedImage:l,setCroppedImage:c,setReady:d,setOption:f}=function(e){let{initialImages:t,initialOption:n,onClose:r}=e,[i,o]=(0,x.useState)(A),[a,u]=(0,x.useState)(!1),[s,l]=(0,x.useState)(!1),[c,d]=(0,x.useState)(n),f=t[c],p=i[(null==f?void 0:f.thumbnail.name)??""];function A(){return t.reduce((e,t)=>(t.contentView&&(e[t.thumbnail.name]=function(e){let{x:t,y:n}=e.edit.crop,r=e.edit.zoom,{width:i,height:o}=e,{width:a,height:u}=e.origin,s=i/o,l=Math.min(a,u*s/r);return{x:t,y:n,width:i,height:o,zoom:r,cropWidth:l,cropHeight:l/s}}(t.contentView)),e),{})}return{open:a,ready:s,option:c,selectedImage:f,croppedImage:p,setCroppedImage:function(e){if(!f)return;let t=f.thumbnail.name;o({...i,[t]:e})},setReady:l,setOption:d,onClose:r,onOpenChange:function(e){e?(d(n),o(A())):(l(!1),r({option:c,croppedImages:i})),u(e)}}}(e);return q.jsxs(b.Vq,{trigger:t,onAnimationEnd:()=>d(!0),open:i,onOpenChange:o,renderTooltip:r,children:[q.jsx(b.fK,{icon:"photo",title:"Image editor"}),q.jsx(b.Zp,{value:String(u),onValueChange:e=>f(Number(e)),children:n.map((e,t)=>q.jsx(b.T9,{value:String(t),icon:"photo",title:e.labels[0]??"Main",subtitle:e.labels[1]??""},e.thumbnail.name))}),s&&q.jsx(b.cZ,{children:a&&l&&q.jsx(QR,{selectedImage:s,imageCrop:l,setImageCrop:c},s.thumbnail.name)})]})}function QM(e){let{id:t,readOnly:n,altText:r,onValueChange:i,selected:o}=e;return q.jsxs(b.gN,{selected:o,children:[q.jsx(b.Qy,{htmlFor:t,children:"Alt text"}),q.jsx(b.JO,{children:q.jsx(b.xu,{flexGrow:1,height:40,children:q.jsx(Qt,{id:t,placeholder:"Short description for the visually impaired",readOnly:n,value:r,onValueChange:i,padding:{input:{inline:12}}})})})]})}function Qj(e){let{fieldLabel:t,imageLabel:n,initialImages:r,page:i,displaySeparator:o=!0,isSVGContentView:a,visibility:u,onClear:s,onCropperDialogClose:l,onMediaDialogOpenChange:c}=e;return q.jsxs(b.xu,{display:"flex",flexDirection:"column",gap:12,children:[q.jsxs(b.xu,{display:"flex",alignItems:"center",justifyContent:"space-between",flexWrap:"wrap",gap:4,children:[q.jsx(Qm,{fieldLabel:t,imageLabel:n}),q.jsxs(b.Pf,{sx:{visibility:u},children:[q.jsx(QE,{trigger:q.jsx(b.zx,{startIcon:"crop",disabled:a,hiddenLabel:"Crop & Resize"}),renderTooltip:e=>q.jsx(b.u,{content:"Crop & Resize",children:e}),initialImages:r,initialOption:i,onClose:l}),q.jsx(b.u,{content:"Replace",children:q.jsx(b.zx,{startIcon:"imageSearch",hiddenLabel:"Replace",onClick:()=>c(!0)})}),q.jsx(b.u,{content:"Clear",children:q.jsx(b.zx,{onClick:s,startIcon:"delete",hiddenLabel:"Clear"})})]})]}),o&&q.jsx(b.Z0,{style:"dashed",decorative:!0})]})}function QF(e){let{documentType:t,documentUrl:n,title:r,statusColor:i,description:o,tags:a,tagsFilter:u,previewImageUrl:s,onSelect:l}=e;return q.jsxs(b.Zb,{paddingBlock:16,onSelect:function(e){return e.nativeEvent instanceof MouseEvent&&(e.metaKey||e.ctrlKey)?window.open(n,"_blank"):l()},children:[q.jsx(b.aY,{children:q.jsxs(b.xu,{justifyContent:"space-between",children:[q.jsxs(b.xu,{flexDirection:"column",gap:4,alignItems:"flex-start",flexGrow:1,children:[q.jsx(QU,{documentType:t}),q.jsx(QL,{title:r,statusColor:i}),q.jsx(QK,{description:o})]}),q.jsx(QB,{previewImageUrl:s})]})}),a.length>0&&q.jsx(QP,{tags:a,tagsFilter:u})]})}function QU(e){let{documentType:t}=e;return q.jsx(b.Ct,{maxWidth:150,size:"medium",title:`Type: ${t}`,icon:"description"})}function QL(e){let{title:t,statusColor:n}=e;return q.jsxs(b.xu,{gap:8,alignItems:"center",children:[q.jsx(b.oT,{color:n}),q.jsx(b.xv,{variant:"bold",children:t})]})}function QK(e){let{description:t}=e,n=null==t?void 0:t.substring(0,150);return n?q.jsx(b.xv,{variant:"small",color:"grey11",children:`${n}${n!==t?"...":""}`}):q.jsx(b.xv,{variant:"smallItalic",color:"grey11",children:"No description available"})}function QB(e){let{previewImageUrl:t}=e;return q.jsx(b.xu,{width:142,height:90,backgroundColor:"grey2",border:!0,borderRadius:6,flexDirection:"column",alignItems:"center",justifyContent:"center",gap:4,flexShrink:0,padding:8,children:t?q.jsx(b.Ee,{src:t,sizing:"cover"}):q.jsxs(q.Fragment,{children:[q.jsx(b.I5,{name:"hideImage",size:"large",color:"grey11"}),q.jsx(b.xv,{color:"grey11",variant:"small",children:"No preview available"})]})})}function QP(e){let{tags:t}=e;return q.jsxs(b.eW,{children:[q.jsxs(b.xu,{gap:4,alignItems:"center",children:[q.jsx(b.I5,{name:"label",size:"small",color:"grey11"}),q.jsx(b.xv,{variant:"small",color:"grey11",children:"Tags:"})]}),q.jsx(b.lG,{children:t.map(e=>q.jsx(b.Ct,{size:"medium",title:e,sx:{marginRight:8}},e))})]})}async function QW(e,t,n,r,i,o){let a=Wf[i];if(!o)return QD((await Np(e,n,r,200)).results,a);let u=await function(e,t,n,r){let i=new URL(e);return i.search=n,(0,k.WY)(i,{credentials:(0,k.xb)(t),okType:Nf})}(t,n,r);return QD(await Ng(e,n,u.results),a)}function QD(e,t){return{results:e.flatMap(e=>{let n=e.versions.filter(e=>t.includes(e.status));return 0===n.length?[]:{...e,versions:n}})}}function QN(){let e=WS();e.searchDocuments||WI("searchDocuments");let{coreApiBaseUrl:t,authStrategy:n}=e;return new Set((0,O.QT)(Nw,[t,n]).languages.map(e=>({id:e.id,label:e.name})))}function Qq(){let e=WS();e.searchDocuments||WI("searchDocuments");let{coreApiBaseUrl:t,authStrategy:n}=e;return new Set((0,O.QT)(N_,[t,n]).results.map(e=>({id:e,label:e})))}function QQ(){let e=WS();e.searchDocuments||WI("searchDocuments");let{customTypesApiBaseUrl:t,repository:n,authStrategy:r}=e;return new Set((0,O.QT)(No,[t,n,r]))}function QV(e){return e?(0,j.UI)(e,e=>({id:e,label:e})):new Set}function Qz(e){let{filteredLocales:t,setFilteredLocales:n,filteredTags:r,setFilteredTags:i,filteredCustomTypes:o,setFilteredCustomTypes:a,fixedTags:u,fixedCustomTypes:s}=e;return q.jsxs(q.Fragment,{children:[q.jsx(QG,{selectedValues:t,onSelectedValuesChange:n}),q.jsx(QY,{selectedValues:r,fixedSelectedValues:QV(u),onSelectedValuesChange:i,label:"Tags",icon:"label",fetchFilters:Qq}),q.jsx(QY,{selectedValues:o,fixedSelectedValues:QV(s),onSelectedValuesChange:a,label:"Type",icon:"description",fetchFilters:QQ})]})}function QY(e){let[t,n]=(0,x.useState)(!1),r=(0,x.useRef)(null);return q.jsx(b.SV,{ref:r,renderError:()=>{var i;return q.jsx(b.R0,{mode:"error",onErrorRetry:null==(i=r.current)?void 0:i.reset,open:t,setOpen:n,values:new Set,...e})},children:q.jsx(x.Suspense,{fallback:q.jsx(b.R0,{mode:"loading",open:t,setOpen:n,values:new Set,...e}),children:q.jsx(QH,{open:t,setOpen:n,...e})})})}function QH(e){let{open:t,setOpen:n,onSelectedValuesChange:r,fixedSelectedValues:i,selectedValues:o,label:a,icon:u,fetchFilters:s,multiple:l}=e,c=s();return q.jsx(b.R0,{open:t,setOpen:n,label:a,icon:u,selectedValues:o,values:new Set(c),fixedSelectedValues:i,onSelectedValuesChange:r,multiple:l})}function QG(e){let{selectedValues:t,onSelectedValuesChange:n}=e,[r,i]=(0,x.useState)((0,j.Ps)(t)),o=(0,j.sE)(QN(),e=>{var n;return e.id===(null==(n=(0,j.Ps)(t))?void 0:n.id)});return(null==o?void 0:o.label)!==(null==r?void 0:r.label)&&i(o),q.jsx(QY,{selectedValues:new Set(r?[r]:[]),onSelectedValuesChange:function(e){n(e),i((0,j.Ps)(e))},label:"Locale",icon:"public",fetchFilters:QN,multiple:!1})}function QZ(e){let{onSelectDocument:t,fixedCustomTypes:n,fixedTags:r,...i}=e,o=WS(),{searchTerm:a,filteredTags:u,setFilteredTags:s,filteredCustomTypes:l,setFilteredCustomTypes:c,filteredLocales:d,setFilteredLocales:f,typesFilter:p,tagsFilter:A}=function(e,t){let n=WS(),r=(0,w.$P)({initialState:""}),[i,o]=(0,x.useState)(new Set),[a,u]=(0,x.useState)(new Set),[s,l]=(0,x.useState)(function(){return n.searchDocuments&&n.localeId?new Set([{id:n.localeId,label:n.localeId}]):new Set}),c=(0,j.G0)(a,QV(e)),d=(0,j.G0)(i,QV(t));return{searchTerm:r,filteredTags:i,setFilteredTags:o,filteredCustomTypes:a,setFilteredCustomTypes:u,filteredLocales:s,setFilteredLocales:l,typesFilter:c,tagsFilter:d}}(n,r),[h,m]=(0,x.useTransition)();return q.jsx(b.Vq,{size:{height:727,width:656},hasClose:!1,...i,children:q.jsx(b.cZ,{children:q.jsxs(b.xu,{flexDirection:"column",height:"100%",children:[q.jsxs(b.xu,{padding:{top:16,inline:16,bottom:8},flexDirection:"column",gap:12,children:[q.jsx(b.yt,{value:a.value,onValueChange:a.set,placeholder:"Search a page",icon:"search"}),o.searchDocuments&&q.jsx(Qz,{filteredTags:u,setFilteredTags:s,filteredCustomTypes:l,setFilteredCustomTypes:c,filteredLocales:d,setFilteredLocales:f,fixedTags:r,fixedCustomTypes:n}),q.jsx(b.xv,{variant:"smallBold",color:"grey11",children:"Link to a document"})]}),o.searchDocuments?q.jsx(b.SV,{renderError:QJ,children:q.jsx(x.Suspense,{fallback:q.jsx(Q0,{}),children:q.jsx(Q$,{searchTerm:a.debouncedValue,tagsFilter:A,typesFilter:p,localesFilter:d,startTransition:m,isLoadingDocuments:h,onSelectDocument:t})})}):q.jsx(QX,{message:"Slice Machine does not yet support mock data for linked documents in the simulator."})]})})})}function QJ(){return q.jsx(b.xu,{height:"100%",flexDirection:"column",alignItems:"center",justifyContent:"center",children:q.jsx(b.Iq,{title:"Request failed",description:"An error occurred while fetching documents.",errorImageSrc:b.Os})})}function Q$(e){let{searchTerm:t,tagsFilter:n,typesFilter:r,localesFilter:i,isLoadingDocuments:o,onSelectDocument:a}=e,{documents:u}=function(e){var t,n;let{searchTerm:r,tagsFilter:i,typesFilter:o,localesFilter:a}=e,u=WS();u.searchDocuments||WI("searchDocuments");let{coreApiBaseUrl:s,documentSearchBaseUrl:l,authStrategy:c,status:d,documentListOpenSearchEnabled:f,repository:p}=u,{storageVersion:A}=(0,O.QT)(Nw,[s,c]),h=A.major>=7&&f,[m,g]=(0,x.useState)([]),[y,v]=(0,x.useState)(""),b=h?function(e){let{repository:t,searchTerm:n,tags:r,localeId:i,customTypesIds:o}=e,a=new URLSearchParams;return a.append("repository",t),n&&a.append("searchTerm",n),null!=r&&r.length&&a.append("tags",r.toString()),i&&a.append("localeId",i),null!=o&&o.length&&a.append("customTypesIds",o.toString()),a.toString()}({repository:p,searchTerm:r,customTypesIds:[...(0,j.UI)(o,e=>e.id)],tags:[...(0,j.UI)(i,e=>e.id)],localeId:[...(0,j.UI)(a,e=>e.id)][0]}):Nm({tags:[...(0,j.UI)(i,e=>e.id)],customTypes:[...(0,j.UI)(o,e=>e.id)],language:[...(0,j.UI)(a,e=>e.id)],term:[r]}),C=(0,O.QT)(QW,[s,l,c,b,d,h]);return b!==y?(v(b),g(C.results)):C.results.length>0&&(null==(t=(0,R.Z$)(m))?void 0:t.id)!==(null==(n=(0,R.Z$)(C.results))?void 0:n.id)&&g(e=>e.concat(C.results)),{documents:m,response:C}}({searchTerm:t,tagsFilter:n,localesFilter:i,typesFilter:r}),s=WS();return q.jsxs(b.xr,{style:{flexGrow:1,paddingTop:b.rS.space[10],paddingBottom:b.rS.space[16],paddingInline:b.rS.space[16],display:"flex",flexDirection:"column",gap:b.rS.space[12]},children:[0===u.length&&q.jsx(QX,{}),u.map(e=>{let t=e.versions[0];if(!t)return null;let r=Wp({documentId:e.id,versionId:"archived"===t.status?t.version_id:void 0,releaseId:"release"===t.status?t.release_id:void 0,status:t.status,baseUrl:s.baseUrl}),i=function(e){let{tags:t,tagsFilter:n}=e,r=[...n].map(e=>e.label).reverse();return(0,R.DY)(t,e=>-r.indexOf(e))}({tags:t.tags,tagsFilter:n});return q.jsx(QF,{documentType:t.custom_type_label,documentUrl:r,description:t.preview_summary,tags:i,title:e.title,previewImageUrl:t.preview_image,onSelect:()=>a(e.id),statusColor:Wd[t.status].color},`${e.id}-${t.status}`)}),q.jsx(b.Fp,{animation:{name:"fade"},children:o&&q.jsx(b.xv,{color:"grey11",align:"center",sx:{marginBlock:8},children:"Loading more results ..."})})]})}function QX(e){let{message:t="We can't find any versions matching this request"}=e;return q.jsx(b.xu,{justifyContent:"center",flexDirection:"column",height:"100%",children:q.jsxs(b.R$,{children:[q.jsx(b.av,{name:"close",lineColor:"purple10",backgroundColor:"purple3",borderColor:"purple6",borderStyle:"dashed",size:"xlarge"}),q.jsx(b._T,{size:"big",children:"Oops!"}),q.jsx(b.nf,{width:360,children:t})]})})}function Q0(){return q.jsx(b.xu,{flexDirection:"column",gap:12,padding:{top:10,inline:16,bottom:16},children:(0,R.w6)(1,5).map(e=>q.jsx(b.Od,{height:150},e))})}function Q1(e){let{hasLink:t,onUnlink:n,selectEnabled:r,selectedType:i,onValueChange:o,openInNewTab:a=!0,condensedButtons:u=!1,setOpenInNewTab:s}=e,l=s&&"web"===i;return q.jsxs(q.Fragment,{children:[l&&q.jsx(b.u,{content:"Open in new tab",visible:u,children:q.jsx(b.zx,{startIcon:a?"checkBox":"checkBoxOutlinedBlank",color:"grey",size:"small",onClick:()=>s(!a),children:u?"":"Open in new tab"})}),q.jsxs(b.Ph,{value:i,color:"grey",size:"small",boldTriggerText:!0,startIcon:function(e){if(e)switch(e){case"document":return"description";case"web":return"public";case"media":return"image"}}(i),disabled:!r,onValueChange:o,placeholder:u?"":Q2("placeholder"),onlyStartIcon:u&&!!i,renderTrigger:({button:e})=>q.jsx(b.u,{content:Q2(i),visible:u,children:e}),children:[q.jsx(b.Ql,{value:"web",icon:"public",children:Q2("web")}),q.jsx(b.Ql,{value:"document",icon:"description",children:Q2("document")}),q.jsx(b.Ql,{value:"media",icon:"image",children:Q2("media")})]}),q.jsx(b.zx,{startIcon:"close",color:"grey",size:"small",disabled:!t,onClick:n})]})}function Q2(e){if(!e||"placeholder"===e)return"Choose link type";switch(e){case"document":return"Link to Prismic page";case"web":return"Link to web page";case"media":return"Link to media"}}O.Fs.registerFetcherConfig(QW,{cacheCapacity:500,revalidationStrategy:{type:"never"}});let Q6={DocumentLink:"document",ExternalLink:"web",FileLink:"media",ImageLink:"media"},Q5={document:"DocumentLink",web:"ExternalLink",media:"FileLink"},Q3=Dz({id:DM(),title:DM()});function Q9(e,t,n){return(0,k.WY)(new URL(`documents/${n}`,e),{credentials:(0,k.xb)(t),okType:Q3})}function Q4(e){var t,n,r,i,o,a;let{media:u}=e,s="kind"in u;return s&&"image"===u.kind?{__TYPE__:"LinkContent",value:{__TYPE__:"ImageLink",id:u.id,name:u.filename,url:u.url,kind:u.kind,size:u.size.toString(),height:(null==(t=u.height)?void 0:t.toString())??"2000",width:(null==(n=u.width)?void 0:n.toString())??"2000",date:(null==(r=u.last_modified)?void 0:r.toString())??""}}:s?{__TYPE__:"LinkContent",value:{__TYPE__:"FileLink",id:u.id,name:u.filename,kind:u.kind,url:u.url,size:u.size.toString(),date:(null==(i=u.last_modified)?void 0:i.toString())??""}}:{__TYPE__:"LinkContent",value:{__TYPE__:"ImageLink",id:u.id,name:(null==u?void 0:u.alt)??u.url,kind:"image",url:u.url,size:"0",height:(null==(o=u.height)?void 0:o.toString())??"2000",width:(null==(a=u.width)?void 0:a.toString())??"2000"}}}function Q7(e){var t,n;let{content:r,field:i,id:o,onContentChange:a,readOnly:u=!1,condensedButtons:s=!1}=e,[l,c]=(0,x.useState)(!1),[d,f]=(0,x.useState)(!1),[p,A]=(0,x.useState)(!1),[h,m]=(0,x.useState)(!1),{contentType:g,fieldValue:y,errorBoundaryRef:v,onDocumentSelected:S,onError:I,onMediaSelected:_,...T}=function(e){var t;let{field:n,content:r,onContentChange:i}=e,o=r?"DocumentLink"===r.value.__TYPE__?r.value.id:"ExternalLink"===r.value.__TYPE__?r.value.url:r.value.name:"",[a,u]=(0,x.useState)(function(){var e,t;return!(null!=(e=n.config)&&e.select)||null!=r&&r.value.__TYPE__?null==r?void 0:r.value.__TYPE__:Q5[null==(t=n.config)?void 0:t.select]}),[s,l]=(0,x.useState)(()=>(null==r?void 0:r.value.__TYPE__)==="ExternalLink"?r.value.target:""),[c,d]=(0,x.useState)(!1),f=(0,x.useRef)(null);(0,w.pQ)(o,function(){var e;c&&(d(!1),null==(e=f.current)||e.reset())});let p=a?Q6[a]:void 0;function A(e){if(!e)return i(void 0);switch(a){case"ExternalLink":return i({__TYPE__:"LinkContent",value:{__TYPE__:"ExternalLink",url:e,target:s}});case"DocumentLink":return i({__TYPE__:"LinkContent",value:{__TYPE__:"DocumentLink",id:e}});case"FileLink":case"ImageLink":case void 0:return i(void 0)}}return{contentType:a,selectType:p,fieldValue:o,onValueChange:A,onTypeChange:function(e){u(Q5[e]),A("")},placeholder:q4(n),isTypeSelectEnabled:!(null!=(t=n.config)&&t.select),onDocumentSelected:function(e){A(e)},onError:function(){d(!0)},errorBoundaryRef:f,isTargetNewTab:"_blank"===s,updateWebLinkTarget:function(e){let t=e?"_blank":null;l(t),i({__TYPE__:"LinkContent",value:{__TYPE__:"ExternalLink",url:o,target:t}})},onMediaSelected:function(e){i(Q4({media:e}))}}}({content:r,field:i,onContentChange:a}),O="DocumentLink"===g&&""!==y,R="ExternalLink"===g&&(0,C.ju)(y),k={id:o,contentType:g,onBlur:()=>c(!1),onFocus:()=>{c(!0),"DocumentLink"===g&&A(!0),"FileLink"===g&&m(!0),"ImageLink"===g&&m(!0)},readOnly:u||!g,textType:R||"ImageLink"===g||"FileLink"===g?"link":"normal",value:y,condensedButtons:s,...T},{searchDocuments:E}=WS();return q.jsxs(q.Fragment,{children:[q.jsxs(b.J2,{onMouseOverChange:f,open:l||d,align:"start",sideOffset:-3,openDelay:100,closeDelay:200,focusOnEnter:!1,anchor:q.jsxs(b.gN,{onMouseOverChange:c,children:[q.jsx(b.fw,{name:"link"}),q.jsx(b.Qy,{htmlFor:o,children:q9(i)}),q.jsx(b.JO,{children:O&&E?q.jsx(Vt,{errorBoundaryRef:v,onError:I,fallback:q.jsx(Q8,{...k,value:"..."}),renderError:()=>q.jsx(Q8,{...k,textType:"link"}),children:q.jsx(Ve,{...k,documentId:y,openDocumentListModal:()=>A(!0)})}):q.jsx(Q8,{...k})})]}),children:[R&&q.jsx(b.oZ,{url:R,title:(0,C.S$)(R)??"",subTitle:R.toString()}),(null==r?void 0:r.value.__TYPE__)==="ImageLink"&&q.jsx(b.Qi,{url:r.value.url,title:r.value.name,subTitle:`${r.value.width} x ${r.value.height} pixels`})]}),q.jsx(QI,{open:h,onOpenChange:m,onMediaSelected:_,assetType:"all"}),q.jsx(QZ,{open:p,onOpenChange:A,onSelectDocument:e=>{A(!1),S(e)},fixedCustomTypes:new Set(null==(t=i.config)?void 0:t.customtypes),fixedTags:new Set(null==(n=i.config)?void 0:n.tags)})]})}function Q8(e){let{id:t,onValueChange:n,placeholder:r,readOnly:i,value:o,textType:a,onFocus:u,onBlur:s,contentType:l,isTypeSelectEnabled:c,selectType:d,onTypeChange:f,isTargetNewTab:p,condensedButtons:A,updateWebLinkTarget:h}=e,m="DocumentLink"===l||"ImageLink"===l||"FileLink"===l;return q.jsx(Qt,{id:t,onValueChange:n,placeholder:r,readOnly:i||m,value:o,variant:a,onFocus:u,onBlur:s,cursor:m?"pointer":"text",endAdornment:q.jsx(Q1,{hasLink:!!o,onUnlink:()=>n(""),selectEnabled:c,selectedType:d,onValueChange:f,openInNewTab:p,condensedButtons:A,setOpenInNewTab:h})})}function Ve(e){let{id:t,documentId:n,openDocumentListModal:r,onValueChange:i,isTypeSelectEnabled:o,selectType:a,condensedButtons:u,onTypeChange:s}=e,l=function(e){let t=WS();t.searchDocuments||WI("searchDocuments");let{coreApiBaseUrl:n,authStrategy:r}=t;return(0,O.QT)(Q9,[n,r,e]).title}(n);return q.jsx(Qt,{id:t,readOnly:!0,value:l,variant:"link",onFocus:r,cursor:"pointer",endAdornment:q.jsx(Q1,{hasLink:!0,onUnlink:()=>i(""),selectEnabled:o,selectedType:a,condensedButtons:u,onValueChange:s})})}function Vt(e){let{errorBoundaryRef:t,onError:n,children:r,fallback:i,renderError:o}=e;return q.jsx(b.SV,{ref:t,onError:n,renderError:o,children:q.jsx(x.Suspense,{fallback:i,children:r})})}function Vn(e){let{linkTo:t,onLinkToChange:n}=e;return q.jsx(Q7,{content:t?{__TYPE__:"LinkContent",value:t}:void 0,onContentChange:e=>n(e?e.value:void 0),field:{type:"Link",config:{label:"Link",allowTargetBlank:!0}},condensedButtons:!0})}function Vr(e){var t,n;let{allContentViews:r,content:i,contentView:o,fieldLabel:a,id:u,imageLabel:s,initialImages:l,isUpdating:c,page:d=0,readOnly:f,thumbnailName:p,onClear:A,onContentChange:h,onCropperDialogClose:m,onPageChange:g=()=>{},onMediaDialogOpenChange:y}=e,v=(null==(n=null==(t=null==i?void 0:i.url)?void 0:t.split("?")[0])?void 0:n.slice(-4))===".svg",x=null!=i&&i.url&&!f?"visible":"hidden",C=!Q.isImageContent(i);return q.jsxs(b.xu,{display:"flex",gap:12,padding:{inline:12},children:[q.jsx(b.xu,{children:q.jsx(b.lr,{getItemSource:qF,items:r,onPageChange:g,page:d,buttonSize:"small",renderPrevTooltip:e=>q.jsx(b.u,{content:"Previous",children:e}),renderNextTooltip:e=>q.jsx(b.u,{content:"Next",children:e}),style:C?{width:181,height:142}:{width:123,height:93},children:e=>(null==e?void 0:e.url)&&q.jsx(b.d$,{"aria-label":"Image Field Item",src:qj(e.url),alt:e.alt??void 0,isUpdating:c,disableAnimation:C},`${p}_${e.url}`)})}),q.jsxs(b.xu,{width:"100%",display:"flex",flexDirection:"column",gap:C?16:12,children:[q.jsx(Qj,{fieldLabel:a,imageLabel:s,initialImages:l,page:d,displaySeparator:!C,isSVGContentView:v,visibility:x,onClear:A,onCropperDialogClose:m,onMediaDialogOpenChange:y}),q.jsx(QM,{id:u,readOnly:f||!o,altText:(null==o?void 0:o.alt)??"",onValueChange:e=>{o&&h(function(e,t,n,r){let i=0===r.length?void 0:r;return e!==qE&&Q.isImageContent(t)?{...t,thumbnails:{...t.thumbnails,[e]:{...n,alt:i}}}:{...t,alt:i}}(p,i,o,e))}}),C&&q.jsx(Vn,{linkTo:i.linkTo,onLinkToChange:e=>{h({...i,linkTo:e})}})]})]})}function Vi(e){let{content:t,field:n,id:r,onContentChange:i,readOnly:o}=e,a=t&&t.origin.url.length>0,{onCropperDialogClose:u,onPageChange:s,onMediaSelected:l,isUpdating:c,page:d,thumbnail:f,allThumbnails:p,allContentViews:A,contentView:h,onClear:m}=function(e){let{content:t,onContentChange:n,field:r}=e,[i,o]=(0,x.useState)(0),[a,u]=(0,x.useTransition)(),s=(0,x.useMemo)(()=>{var e,t;return[{...null==(e=r.config)?void 0:e.constraint,name:qE}].concat((null==(t=r.config)?void 0:t.thumbnails)??[])},[r]),l=s[i],c=t?function(e,t){var n,r;let{__TYPE__:i,thumbnails:o,...a}=t;return[a,...(null==(r=null==(n=e.config)?void 0:n.thumbnails)?void 0:r.map(({name:e})=>null==o?void 0:o[e]))??[]]}(r,t):void 0,d=null==c?void 0:c[i];return{onCropperDialogClose:function({option:e,croppedImages:i}){if(o(e),!t)return;let a=Object.entries(i).reduce((e,[t,n])=>(function(e){var t,n,r;let{field:i,content:o,thumbnail:a,croppedImage:u}=e;if(a===qE)return QO({content:o,croppedImage:u});let s=Q.isImageContent(o),l=null==(n=null==(t=null==i?void 0:i.config)?void 0:t.thumbnails)?void 0:n.find(e=>e.name===a),c=s?null==(r=o.thumbnails)?void 0:r[a]:void 0;if(!l||!c)return o;let d=QT({contentView:c,croppedImage:u});return d.url===c.url?o:{...o,thumbnails:s?{...o.thumbnails,[a]:d}:void 0}})({field:r,content:e,thumbnail:t,croppedImage:n}),t);a!==t&&u(()=>n(a))},onPageChange:function(e){u(()=>o(e))},onMediaSelected:function(e){if(!l)return;let i=function(e,t,n,r){var i,o,a,u,s;if(!n||e===qE){let e=null==(i=t.config)?void 0:i.thumbnails,n=e&&Object.fromEntries(e.map(e=>[e.name,qU(r,e)]));return{__TYPE__:"ImageContent",...qU(r,null==(o=t.config)?void 0:o.constraint),thumbnails:n}}let l=null==(u=null==(a=t.config)?void 0:a.thumbnails)?void 0:u.find(t=>t.name===e);if(!l)return n;let c=null==(s=n.thumbnails)?void 0:s[e],d=qU(r,l);return d.url===(null==c?void 0:c.url)?n:{...n,thumbnails:(0,S.Q8)(n.thumbnails??{},(t,n)=>n===e?d:t)}}(l.name,r,t,e);i!==t&&u(()=>n(i))},isUpdating:a,page:i,thumbnail:l,allThumbnails:s,allContentViews:c,contentView:d,onClear:function(){null==o||o(0),n(void 0)}}}({field:n,content:t,onContentChange:i}),[g,y]=(0,x.useState)(!1),v=q9(n),b=p.map((e,n)=>{let r=null==A?void 0:A[n];return{thumbnail:e,contentView:r,labels:qM(e,t,r)}}),C=f&&a?qM(f,t,h).filter(_.$):[],w=f&&t&&a&&A;return q.jsx(Q_,{isMediaDialogOpen:g,onMediaSelected:l,onMediaDialogOpenChange:y,children:q.jsx(x.Suspense,{fallback:q.jsx("div",{style:{height:95}}),children:w?q.jsx(Vr,{allContentViews:A,content:t,contentView:h,fieldLabel:v,id:r,imageLabel:C,initialImages:b,isUpdating:c,page:d,readOnly:o,thumbnailName:f.name,onClear:m,onContentChange:i,onCropperDialogClose:u,onMediaDialogOpenChange:y,onPageChange:s}):q.jsx(Qg,{fieldLabel:v,isUpdating:c,readOnly:o,onMediaDialogOpenChange:y})})})}function Vo(e,t,n,r,i,o=1,a=30){let u=new URL(`if/search/${r}`,e);return u.searchParams.set("searchTerm",i),u.searchParams.set("limit",a.toString()),u.searchParams.set("page",o.toString()),(0,k.WY)(u,{headers:{repository:n},credentials:(0,k.xb)(t),okType:Vu})}O.Fs.registerFetcherConfig(Q9,{concurrency:50});let Va=Nn.object({id:Nn.string(),title:Nn.string(),imageURL:Nn.string().optional(),description:Nn.string().optional()}),Vu=Nn.object({items:Nn.array(Va),totalPages:Nn.number(),page:Nn.number()});function Vs(e){let{itemId:t,catalogId:n}=e,r=WS();r.integrationFields||WI("integrationFields");let{integrationFieldsApiBaseUrl:i,repository:o,authStrategy:a}=r,u=(0,O.QT)(Vl,[i,a,o,n,t]).items[0];if(!u)throw Error("Item not found");return{item:u}}function Vl(e,t,n,r,i){let o=new URL(`if/read/${r}`,e);return o.searchParams.set("ids",[i].toString()),(0,k.WY)(o,{headers:{repository:n},credentials:(0,k.xb)(t),okType:Vc})}let Vc=Nn.object({items:Nn.array(Va)});function Vd(e){let{item:t,onClick:n,catalogId:r}=e;return q.jsxs(b.oU,{variant:"large",onClick:n,children:[q.jsx(Vf,{src:t.imageURL??"",alt:t.title}),q.jsxs(b.Tw,{children:[q.jsx(b.Ct,{title:`Catalog: ${r}`,icon:"multipleStop",size:"medium"}),q.jsx(b.xv,{variant:"bold",color:"grey12",sx:{marginTop:4},children:t.title}),q.jsx(b.xv,{variant:"small",color:"grey11",children:t.description??t.id})]})]})}function Vf(e){let{src:t,alt:n}=e;return t?q.jsx(b.Sy,{src:t,alt:n,width:76,height:76,framed:!0}):q.jsxs(b.xu,{borderRadius:6,backgroundColor:"grey2",height:76,width:76,flexDirection:"column",alignItems:"center",justifyContent:"center",border:!0,padding:{inline:4,block:8},children:[q.jsx(b.I5,{name:"hideImage",size:"large",color:"grey11"}),q.jsx(b.xv,{color:"grey11",variant:"small",noSelect:!0,align:"center",children:"No preview image"})]})}function Vp(){return q.jsxs(b.oU,{variant:"large",children:[q.jsx(b.Od,{height:76,width:76}),q.jsxs(b.Tw,{children:[q.jsx(b.Od,{height:24,width:168}),q.jsx(b.Od,{height:24,width:240,sx:{marginTop:4}}),q.jsx(b.Od,{height:16,width:144})]})]})}function VA(e){let{open:t,onOpenChange:n,catalogId:r,onSelectItem:i}=e,o=(0,w.$P)({initialState:""}),a=WS();return q.jsx(b.Vq,{open:t,onOpenChange:n,hasClose:!1,size:{width:612,height:724},children:q.jsx(b.cZ,{children:q.jsxs(b.xu,{flexDirection:"column",height:"100%",children:[q.jsxs(b.xu,{padding:{top:16,inline:16},flexDirection:"column",gap:8,children:[q.jsx(b.CR,{value:o.value,onValueChange:o.set,placeholder:"Search in your catalog"}),q.jsx(b.xv,{variant:"smallBold",color:"grey11",children:"Select an item"})]}),a.integrationFields?q.jsx(b.SV,{renderError:()=>q.jsx(Vm,{message:"There was an error while fetching your catalog items."}),children:q.jsx(x.Suspense,{fallback:q.jsxs(b.xu,{flexDirection:"column",gap:12,padding:{top:10,inline:16,bottom:16},children:[q.jsx(Vp,{}),q.jsx(Vp,{}),q.jsx(Vp,{}),q.jsx(Vp,{}),q.jsx(Vp,{})]}),children:q.jsx(Vh,{searchTerm:o.debouncedValue,catalogId:r,onItemClick:i})})}):q.jsx(Vm,{message:"Slice Machine does not yet support mock data for integration field in the simulator."})]})})})}function Vh(e){let{catalogId:t,searchTerm:n,onItemClick:r}=e,[i,o]=(0,x.useTransition)(),{items:a,hasNextPage:u,fetchNextPage:s}=function(e){var t,n;let{searchTerm:r,catalogId:i}=e,o=WS();o.integrationFields||WI("integrationFields");let{integrationFieldsApiBaseUrl:a,repository:u,authStrategy:s}=o,[l,c]=(0,x.useState)(1),[d,f]=(0,x.useState)([]),[p,A]=(0,x.useState)(""),h=(0,O.QT)(Vo,[a,s,u,i,r,r===p?l:1]);r!==p?(A(r),c(1),f(h.items)):h.items.length>0&&(null==(t=(0,R.Z$)(d))?void 0:t.id)!==(null==(n=(0,R.Z$)(h.items))?void 0:n.id)&&f(e=>e.concat(h.items));let m=l<h.totalPages;return{items:d,response:h,fetchNextPage:function(){m&&c(e=>e+1)},hasNextPage:m}}({catalogId:t,searchTerm:n});return q.jsx(q.Fragment,{children:q.jsxs(b.xr,{onScrollToBottom:()=>u&&o(s),style:{flexGrow:1,paddingTop:b.rS.space[10],paddingBottom:b.rS.space[16],paddingInline:b.rS.space[16],display:"flex",flexDirection:"column",gap:b.rS.space[12]},threshold:252,children:[0===a.length?q.jsx(Vm,{}):a.map(e=>q.jsx(Vd,{item:e,catalogId:t,onClick:()=>r(e)},e.id)),q.jsx(b.Fp,{animation:{name:"fade"},children:i&&q.jsx(b.xv,{color:"grey11",align:"center",sx:{marginBlock:8},children:"Loading more results ..."})})]})})}function Vm(e){let{message:t="We can't find any items matching your search"}=e;return q.jsx(b.xu,{justifyContent:"center",flexDirection:"column",height:"100%",children:q.jsxs(b.R$,{children:[q.jsx(b.av,{name:"close",lineColor:"purple10",backgroundColor:"purple3",borderColor:"purple6",borderStyle:"dashed",size:"xlarge"}),q.jsx(b._T,{size:"big",children:"Oops!"}),q.jsx(b.nf,{width:360,children:t})]})})}function Vg(e){let{itemId:t,item:n}=e,r=WS();return t&&n&&n.id===t?q.jsx(Vx,{...e,value:n.title}):t&&r.integrationFields?q.jsx(b.SV,{renderError:()=>q.jsx(Vx,{...e,value:t}),children:q.jsx(x.Suspense,{fallback:q.jsx(Vx,{...e,value:t}),children:q.jsx(Vb,{...e,itemId:t})},t)},t):t&&!r.integrationFields?q.jsx(Vx,{...e,value:t}):q.jsx(Vx,{...e,value:""})}function Vy(e){let{catalogId:t,itemId:n,item:r}=e,i=WS();return n&&r&&r.id===n?q.jsx(b.mS,{children:q.jsx(Vd,{catalogId:t,item:r})}):n&&i.integrationFields?q.jsx(b.SV,{renderError:()=>null,children:q.jsx(b.mS,{children:q.jsx(x.Suspense,{fallback:q.jsx(Vp,{}),children:q.jsx(Vv,{catalogId:t,itemId:n})},n)})},n):null}function Vv(e){let{itemId:t,catalogId:n}=e,{item:r}=Vs({catalogId:n,itemId:t});return q.jsx(Vd,{catalogId:n,item:r})}function Vx(e){let{id:t,field:n,readOnly:r,value:i,onFocus:o,onClearItem:a}=e;return q.jsx(Qt,{id:t,placeholder:q4(n),readOnly:!0,variant:"link",value:i,...!r&&{cursor:"pointer",onFocus:o},endAdornment:q.jsx(b.zx,{startIcon:"close",color:"grey",size:"small",disabled:!i,onClick:a})})}function Vb(e){let{itemId:t,catalogId:n}=e,{item:r}=Vs({catalogId:n,itemId:t});return q.jsx(Vx,{...e,value:r.title})}function VC(e){var t;let{id:n,field:r,content:i,readOnly:o,onContentChange:a}=e,[u,s]=(0,x.useState)(!1),[l,c]=(0,x.useState)(),d=null==(t=r.config)?void 0:t.catalog;return d?q.jsxs(q.Fragment,{children:[q.jsxs(b.gN,{footer:q.jsx(Vy,{catalogId:d,item:l,itemId:null==i?void 0:i.value}),children:[q.jsx(b.fw,{name:"multipleStop"}),q.jsx(b.Qy,{htmlFor:n,children:q9(r)}),q.jsx(b.JO,{children:q.jsx(Vg,{id:n,field:r,readOnly:o,catalogId:d,item:l,itemId:null==i?void 0:i.value,onFocus:()=>s(!0),onClearItem:function(){a(void 0),c(void 0)}})})]}),q.jsx(VA,{open:u,onOpenChange:s,catalogId:d,onSelectItem:function(e){a({value:e.id,__TYPE__:"IntegrationFieldsContent"}),c(e),s(!1)}})]}):null}function VS(e){let{content:t,field:n,id:r,onContentChange:i,readOnly:o}=e;return q.jsxs(b.gN,{children:[q.jsx(b.fw,{name:"notes"}),q.jsx(b.Qy,{htmlFor:r,children:q9(n)}),q.jsx(b.JO,{children:q.jsx(b.Kx,{id:r,placeholder:q4(n),readOnly:o,paddingLeft:4,paddingRight:12,sx:{flexGrow:1},value:(null==t?void 0:t.value)??"",onChange:e=>{i(0===e.length?void 0:{__TYPE__:"FieldContent",type:"Text",value:e})}})})]})}let Vw=({content:e,field:t,id:n,onContentChange:r,readOnly:i})=>{var o,a;let u=Number(null==e?void 0:e.value),s=Number.isFinite(u)?u:void 0;return q.jsxs(b.gN,{children:[q.jsx(b.fw,{name:"pin"}),q.jsx(b.Qy,{htmlFor:n,children:q9(t)}),q.jsx(b.JO,{children:q.jsx(b.Y2,{id:n,value:s,min:null==(o=t.config)?void 0:o.min,max:null==(a=t.config)?void 0:a.max,padding:Qn,placeholder:q4(t),readOnly:i,onValueChange:e=>r(void 0===e?void 0:{__TYPE__:"FieldContent",type:"Number",value:String(e)})})})]})};function VI(e){this.content=e}VI.prototype={constructor:VI,find:function(e){for(var t=0;t<this.content.length;t+=2)if(this.content[t]===e)return t;return -1},get:function(e){var t=this.find(e);return -1==t?void 0:this.content[t+1]},update:function(e,t,n){var r=n&&n!=e?this.remove(n):this,i=r.find(e),o=r.content.slice();return -1==i?o.push(n||e,t):(o[i+1]=t,n&&(o[i]=n)),new VI(o)},remove:function(e){var t=this.find(e);if(-1==t)return this;var n=this.content.slice();return n.splice(t,2),new VI(n)},addToStart:function(e,t){return new VI([e,t].concat(this.remove(e).content))},addToEnd:function(e,t){var n=this.remove(e).content.slice();return n.push(e,t),new VI(n)},addBefore:function(e,t,n){var r=this.remove(t),i=r.content.slice(),o=r.find(e);return i.splice(-1==o?i.length:o,0,t,n),new VI(i)},forEach:function(e){for(var t=0;t<this.content.length;t+=2)e(this.content[t],this.content[t+1])},prepend:function(e){return(e=VI.from(e)).size?new VI(e.content.concat(this.subtract(e).content)):this},append:function(e){return(e=VI.from(e)).size?new VI(this.subtract(e).content.concat(e.content)):this},subtract:function(e){var t=this;e=VI.from(e);for(var n=0;n<e.content.length;n+=2)t=t.remove(e.content[n]);return t},toObject:function(){var e={};return this.forEach(function(t,n){e[t]=n}),e},get size(){return this.content.length>>1}},VI.from=function(e){if(e instanceof VI)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new VI(t)};class V_{constructor(e,t){if(this.content=e,this.size=t||0,null==t)for(let t=0;t<e.length;t++)this.size+=e[t].nodeSize}nodesBetween(e,t,n,r=0,i){for(let o=0,a=0;a<t;o++){let u=this.content[o],s=a+u.nodeSize;if(s>e&&!1!==n(u,r+a,i||null,o)&&u.content.size){let i=a+1;u.nodesBetween(Math.max(0,e-i),Math.min(u.content.size,t-i),n,r+i)}a=s}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,n,r){let i="",o=!0;return this.nodesBetween(e,t,(a,u)=>{a.isText?(i+=a.text.slice(Math.max(e,u)-u,t-u),o=!n):a.isLeaf?(r?i+="function"==typeof r?r(a):r:a.type.spec.leafText&&(i+=a.type.spec.leafText(a)),o=!n):!o&&a.isBlock&&(i+=n,o=!0)},0),i}append(e){if(!e.size)return this;if(!this.size)return e;let t=this.lastChild,n=e.firstChild,r=this.content.slice(),i=0;for(t.isText&&t.sameMarkup(n)&&(r[r.length-1]=t.withText(t.text+n.text),i=1);i<e.content.length;i++)r.push(e.content[i]);return new V_(r,this.size+e.size)}cut(e,t=this.size){if(0==e&&t==this.size)return this;let n=[],r=0;if(t>e)for(let i=0,o=0;o<t;i++){let a=this.content[i],u=o+a.nodeSize;u>e&&((o<e||u>t)&&(a=a.isText?a.cut(Math.max(0,e-o),Math.min(a.text.length,t-o)):a.cut(Math.max(0,e-o-1),Math.min(a.content.size,t-o-1))),n.push(a),r+=a.nodeSize),o=u}return new V_(n,r)}cutByIndex(e,t){return e==t?V_.empty:0==e&&t==this.content.length?this:new V_(this.content.slice(e,t))}replaceChild(e,t){let n=this.content[e];if(n==t)return this;let r=this.content.slice(),i=this.size+t.nodeSize-n.nodeSize;return r[e]=t,new V_(r,i)}addToStart(e){return new V_([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new V_(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let t=this.content[e];if(!t)throw RangeError("Index "+e+" out of range for "+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,n=0;t<this.content.length;t++){let r=this.content[t];e(r,n,t),n+=r.nodeSize}}findDiffStart(e,t=0){return function e(t,n,r){for(let i=0;;i++){if(i==t.childCount||i==n.childCount)return t.childCount==n.childCount?null:r;let o=t.child(i),a=n.child(i);if(o==a){r+=o.nodeSize;continue}if(!o.sameMarkup(a))return r;if(o.isText&&o.text!=a.text){for(let e=0;o.text[e]==a.text[e];e++)r++;return r}if(o.content.size||a.content.size){let t=e(o.content,a.content,r+1);if(null!=t)return t}r+=o.nodeSize}}(this,e,t)}findDiffEnd(e,t=this.size,n=e.size){return function e(t,n,r,i){for(let o=t.childCount,a=n.childCount;;){if(0==o||0==a)return o==a?null:{a:r,b:i};let u=t.child(--o),s=n.child(--a),l=u.nodeSize;if(u==s){r-=l,i-=l;continue}if(!u.sameMarkup(s))return{a:r,b:i};if(u.isText&&u.text!=s.text){let e=0,t=Math.min(u.text.length,s.text.length);for(;e<t&&u.text[u.text.length-e-1]==s.text[s.text.length-e-1];)e++,r--,i--;return{a:r,b:i}}if(u.content.size||s.content.size){let t=e(u.content,s.content,r-1,i-1);if(t)return t}r-=l,i-=l}}(this,e,t,n)}findIndex(e,t=-1){if(0==e)return VO(0,e);if(e==this.size)return VO(this.content.length,e);if(e>this.size||e<0)throw RangeError(`Position ${e} outside of fragment (${this})`);for(let n=0,r=0;;n++){let i=r+this.child(n).nodeSize;if(i>=e)return i==e||t>0?VO(n+1,i):VO(n,r);r=i}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,t){if(!t)return V_.empty;if(!Array.isArray(t))throw RangeError("Invalid input for Fragment.fromJSON");return new V_(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return V_.empty;let t,n=0;for(let r=0;r<e.length;r++){let i=e[r];n+=i.nodeSize,r&&i.isText&&e[r-1].sameMarkup(i)?(t||(t=e.slice(0,r)),t[t.length-1]=i.withText(t[t.length-1].text+i.text)):t&&t.push(i)}return new V_(t||e,n)}static from(e){if(!e)return V_.empty;if(e instanceof V_)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new V_([e],e.nodeSize);throw RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}V_.empty=new V_([],0);let VT={index:0,offset:0};function VO(e,t){return VT.index=e,VT.offset=t,VT}function VR(e,t){if(e===t)return!0;if(!(e&&"object"==typeof e)||!(t&&"object"==typeof t))return!1;let n=Array.isArray(e);if(Array.isArray(t)!=n)return!1;if(n){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!VR(e[n],t[n]))return!1}else{for(let n in e)if(!(n in t)||!VR(e[n],t[n]))return!1;for(let n in t)if(!(n in e))return!1}return!0}let Vk=class e{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,n=!1;for(let r=0;r<e.length;r++){let i=e[r];if(this.eq(i))return e;if(this.type.excludes(i.type))t||(t=e.slice(0,r));else{if(i.type.excludes(this.type))return e;!n&&i.type.rank>this.type.rank&&(t||(t=e.slice(0,r)),t.push(this),n=!0),t&&t.push(i)}}return t||(t=e.slice()),n||t.push(this),t}removeFromSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e}isInSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1}eq(e){return this==e||this.type==e.type&&VR(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,t){if(!t)throw RangeError("Invalid input for Mark.fromJSON");let n=e.marks[t.type];if(!n)throw RangeError(`There is no mark type ${t.type} in this schema`);return n.create(t.attrs)}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].eq(t[n]))return!1;return!0}static setFrom(t){if(!t||Array.isArray(t)&&0==t.length)return e.none;if(t instanceof e)return[t];let n=t.slice();return n.sort((e,t)=>e.type.rank-t.type.rank),n}};Vk.none=[];class VE extends Error{}class VM{constructor(e,t,n){this.content=e,this.openStart=t,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,t){let n=function e(t,n,r,i){let{index:o,offset:a}=t.findIndex(n),u=t.maybeChild(o);if(a==n||u.isText)return i&&!i.canReplace(o,o,r)?null:t.cut(0,n).append(r).append(t.cut(n));let s=e(u.content,n-a-1,r);return s&&t.replaceChild(o,u.copy(s))}(this.content,e+this.openStart,t);return n&&new VM(n,this.openStart,this.openEnd)}removeBetween(e,t){return new VM(function e(t,n,r){let{index:i,offset:o}=t.findIndex(n),a=t.maybeChild(i),{index:u,offset:s}=t.findIndex(r);if(o==n||a.isText){if(s!=r&&!t.child(u).isText)throw RangeError("Removing non-flat range");return t.cut(0,n).append(t.cut(r))}if(i!=u)throw RangeError("Removing non-flat range");return t.replaceChild(i,a.copy(e(a.content,n-o-1,r-o-1)))}(this.content,e+this.openStart,t+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,t){if(!t)return VM.empty;let n=t.openStart||0,r=t.openEnd||0;if("number"!=typeof n||"number"!=typeof r)throw RangeError("Invalid input for Slice.fromJSON");return new VM(V_.fromJSON(e,t.content),n,r)}static maxOpen(e,t=!0){let n=0,r=0;for(let r=e.firstChild;r&&!r.isLeaf&&(t||!r.type.spec.isolating);r=r.firstChild)n++;for(let n=e.lastChild;n&&!n.isLeaf&&(t||!n.type.spec.isolating);n=n.lastChild)r++;return new VM(e,n,r)}}function Vj(e,t){if(!t.type.compatibleContent(e.type))throw new VE("Cannot join "+t.type.name+" onto "+e.type.name)}function VF(e,t,n){let r=e.node(n);return Vj(r,t.node(n)),r}function VU(e,t){let n=t.length-1;n>=0&&e.isText&&e.sameMarkup(t[n])?t[n]=e.withText(t[n].text+e.text):t.push(e)}function VL(e,t,n,r){let i=(t||e).node(n),o=0,a=t?t.index(n):i.childCount;e&&(o=e.index(n),e.depth>n?o++:e.textOffset&&(VU(e.nodeAfter,r),o++));for(let e=o;e<a;e++)VU(i.child(e),r);t&&t.depth==n&&t.textOffset&&VU(t.nodeBefore,r)}function VK(e,t){return e.type.checkContent(t),e.copy(t)}function VB(e,t,n){let r=[];return VL(null,e,n,r),e.depth>n&&VU(VK(VF(e,t,n+1),VB(e,t,n+1)),r),VL(t,null,n,r),new V_(r)}VM.empty=new VM(V_.empty,0,0);class VP{constructor(e,t,n){this.pos=e,this.path=t,this.parentOffset=n,this.depth=t.length/3-1}resolveDepth(e){return null==e?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[3*this.resolveDepth(e)]}index(e){return this.path[3*this.resolveDepth(e)+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e!=this.depth||this.textOffset?1:0)}start(e){return 0==(e=this.resolveDepth(e))?0:this.path[3*e-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(!(e=this.resolveDepth(e)))throw RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[3*e-1]}after(e){if(!(e=this.resolveDepth(e)))throw RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[3*e-1]+this.path[3*e].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let n=this.pos-this.path[this.path.length-1],r=e.child(t);return n?e.child(t).cut(n):r}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):0==e?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let n=this.path[3*t],r=0==t?0:this.path[3*t-1]+1;for(let t=0;t<e;t++)r+=n.child(t).nodeSize;return r}marks(){let e=this.parent,t=this.index();if(0==e.content.size)return Vk.none;if(this.textOffset)return e.child(t).marks;let n=e.maybeChild(t-1),r=e.maybeChild(t);if(!n){let e=n;n=r,r=e}let i=n.marks;for(var o=0;o<i.length;o++)!1!==i[o].type.spec.inclusive||r&&i[o].isInSet(r.marks)||(i=i[o--].removeFromSet(i));return i}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let n=t.marks,r=e.parent.maybeChild(e.index());for(var i=0;i<n.length;i++)!1!==n[i].type.spec.inclusive||r&&n[i].isInSet(r.marks)||(n=n[i--].removeFromSet(n));return n}sharedDepth(e){for(let t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos<this.pos)return e.blockRange(this);for(let n=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);n>=0;n--)if(e.pos<=this.end(n)&&(!t||t(this.node(n))))return new Vq(this,e,n);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let t=1;t<=this.depth;t++)e+=(e?"/":"")+this.node(t).type.name+"_"+this.index(t-1);return e+":"+this.parentOffset}static resolve(e,t){if(!(t>=0&&t<=e.content.size))throw RangeError("Position "+t+" out of range");let n=[],r=0,i=t;for(let t=e;;){let{index:e,offset:o}=t.content.findIndex(i),a=i-o;if(n.push(t,e,r+o),!a||(t=t.child(e)).isText)break;i=a-1,r+=o+1}return new VP(t,n,i)}static resolveCached(e,t){for(let n=0;n<VW.length;n++){let r=VW[n];if(r.pos==t&&r.doc==e)return r}let n=VW[VD]=VP.resolve(e,t);return VD=(VD+1)%VN,n}}let VW=[],VD=0,VN=12;class Vq{constructor(e,t,n){this.$from=e,this.$to=t,this.depth=n}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}let VQ=Object.create(null),VV=class e{constructor(e,t,n,r=Vk.none){this.type=e,this.attrs=t,this.marks=r,this.content=n||V_.empty}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,t,n,r=0){this.content.nodesBetween(e,t,n,r,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,t,n,r){return this.content.textBetween(e,t,n,r)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,t,n){return this.type==e&&VR(this.attrs,t||e.defaultAttrs||VQ)&&Vk.sameSet(this.marks,n||Vk.none)}copy(t=null){return t==this.content?this:new e(this.type,this.attrs,t,this.marks)}mark(t){return t==this.marks?this:new e(this.type,this.attrs,this.content,t)}cut(e,t=this.content.size){return 0==e&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,n=!1){if(e==t)return VM.empty;let r=this.resolve(e),i=this.resolve(t),o=n?0:r.sharedDepth(t),a=r.start(o);return new VM(r.node(o).content.cut(r.pos-a,i.pos-a),r.depth-o,i.depth-o)}replace(e,t,n){return function(e,t,n){if(n.openStart>e.depth)throw new VE("Inserted content deeper than insertion position");if(e.depth-n.openStart!=t.depth-n.openEnd)throw new VE("Inconsistent open depths");return function e(t,n,r,i){let o=t.index(i),a=t.node(i);if(o==n.index(i)&&i<t.depth-r.openStart){let u=e(t,n,r,i+1);return a.copy(a.content.replaceChild(o,u))}if(!r.content.size)return VK(a,VB(t,n,i));if(r.openStart||r.openEnd||t.depth!=i||n.depth!=i){let{start:e,end:o}=function(e,t){let n=t.depth-e.openStart,r=t.node(n).copy(e.content);for(let e=n-1;e>=0;e--)r=t.node(e).copy(V_.from(r));return{start:r.resolveNoCache(e.openStart+n),end:r.resolveNoCache(r.content.size-e.openEnd-n)}}(r,t);return VK(a,function e(t,n,r,i,o){let a=t.depth>o&&VF(t,n,o+1),u=i.depth>o&&VF(r,i,o+1),s=[];return VL(null,t,o,s),a&&u&&n.index(o)==r.index(o)?(Vj(a,u),VU(VK(a,e(t,n,r,i,o+1)),s)):(a&&VU(VK(a,VB(t,n,o+1)),s),VL(n,r,o,s),u&&VU(VK(u,VB(r,i,o+1)),s)),VL(i,null,o,s),new V_(s)}(t,e,o,n,i))}{let e=t.parent,i=e.content;return VK(e,i.cut(0,t.parentOffset).append(r.content).append(i.cut(n.parentOffset)))}}(e,t,n,0)}(this.resolve(e),this.resolve(t),n)}nodeAt(e){for(let t=this;;){let{index:n,offset:r}=t.content.findIndex(e);if(!(t=t.maybeChild(n)))return null;if(r==e||t.isText)return t;e-=r+1}}childAfter(e){let{index:t,offset:n}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:n}}childBefore(e){if(0==e)return{node:null,index:0,offset:0};let{index:t,offset:n}=this.content.findIndex(e);if(n<e)return{node:this.content.child(t),index:t,offset:n};let r=this.content.child(t-1);return{node:r,index:t-1,offset:n-r.nodeSize}}resolve(e){return VP.resolveCached(this,e)}resolveNoCache(e){return VP.resolve(this,e)}rangeHasMark(e,t,n){let r=!1;return t>e&&this.nodesBetween(e,t,e=>(n.isInSet(e.marks)&&(r=!0),!r)),r}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),VY(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw Error("Called contentMatchAt on a node with invalid content");return t}canReplace(e,t,n=V_.empty,r=0,i=n.childCount){let o=this.contentMatchAt(e).matchFragment(n,r,i),a=o&&o.matchFragment(this.content,t);if(!a||!a.validEnd)return!1;for(let e=r;e<i;e++)if(!this.type.allowsMarks(n.child(e).marks))return!1;return!0}canReplaceWith(e,t,n,r){if(r&&!this.type.allowsMarks(r))return!1;let i=this.contentMatchAt(e).matchType(n),o=i&&i.matchFragment(this.content,t);return!!o&&o.validEnd}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content);let e=Vk.none;for(let t=0;t<this.marks.length;t++)e=this.marks[t].addToSet(e);if(!Vk.sameSet(e,this.marks))throw RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(e=>e.type.name)}`);this.content.forEach(e=>e.check())}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(e=>e.toJSON())),e}static fromJSON(e,t){if(!t)throw RangeError("Invalid input for Node.fromJSON");let n=null;if(t.marks){if(!Array.isArray(t.marks))throw RangeError("Invalid mark data for Node.fromJSON");n=t.marks.map(e.markFromJSON)}if("text"==t.type){if("string"!=typeof t.text)throw RangeError("Invalid text node in JSON");return e.text(t.text,n)}let r=V_.fromJSON(e,t.content);return e.nodeType(t.type).create(t.attrs,r,n)}};VV.prototype.text=void 0;class Vz extends VV{constructor(e,t,n,r){if(super(e,t,null,r),!n)throw RangeError("Empty text nodes are not allowed");this.text=n}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):VY(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new Vz(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new Vz(this.type,this.attrs,e,this.marks)}cut(e=0,t=this.text.length){return 0==e&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function VY(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+"("+t+")";return t}class VH{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){var n;let r,i=new VG(e,t);if(null==i.next)return VH.empty;let o=function e(t){let n=[];do n.push(function(t){let n=[];do n.push(function(t){let n=function(t){if(t.eat("(")){let n=e(t);return t.eat(")")||t.err("Missing closing paren"),n}if(/\W/.test(t.next))t.err("Unexpected token '"+t.next+"'");else{let e=(function(e,t){let n=e.nodeTypes,r=n[t];if(r)return[r];let i=[];for(let e in n){let r=n[e];r.groups.indexOf(t)>-1&&i.push(r)}return 0==i.length&&e.err("No node type or group '"+t+"' found"),i})(t,t.next).map(e=>(null==t.inline?t.inline=e.isInline:t.inline!=e.isInline&&t.err("Mixing inline and block content"),{type:"name",value:e}));return t.pos++,1==e.length?e[0]:{type:"choice",exprs:e}}}(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=function(e,t){let n=VZ(e),r=n;return e.eat(",")&&(r="}"!=e.next?VZ(e):-1),e.eat("}")||e.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:t}}(t,n);else break;return n}(t));while(t.next&&")"!=t.next&&"|"!=t.next);return 1==n.length?n[0]:{type:"seq",exprs:n}}(t));while(t.eat("|"));return 1==n.length?n[0]:{type:"choice",exprs:n}}(i);i.next&&i.err("Unexpected trailing text");let a=(n=function(e){let t=[[]];return i(function e(t,o){if("choice"==t.type)return t.exprs.reduce((t,n)=>t.concat(e(n,o)),[]);if("seq"==t.type)for(let r=0;;r++){let a=e(t.exprs[r],o);if(r==t.exprs.length-1)return a;i(a,o=n())}else if("star"==t.type){let a=n();return r(o,a),i(e(t.expr,a),a),[r(a)]}else if("plus"==t.type){let a=n();return i(e(t.expr,o),a),i(e(t.expr,a),a),[r(a)]}else{if("opt"==t.type)return[r(o)].concat(e(t.expr,o));if("range"==t.type){let a=o;for(let r=0;r<t.min;r++){let r=n();i(e(t.expr,a),r),a=r}if(-1==t.max)i(e(t.expr,a),a);else for(let o=t.min;o<t.max;o++){let o=n();r(a,o),i(e(t.expr,a),o),a=o}return[r(a)]}if("name"==t.type)return[r(o,void 0,t.value)];throw Error("Unknown expr type")}}(e,0),n()),t;function n(){return t.push([])-1}function r(e,n,r){let i={term:r,to:n};return t[e].push(i),i}function i(e,t){e.forEach(e=>e.to=t)}}(o),r=Object.create(null),function e(t){let i=[];t.forEach(e=>{n[e].forEach(({term:e,to:t})=>{let r;if(e){for(let t=0;t<i.length;t++)i[t][0]==e&&(r=i[t][1]);V$(n,t).forEach(t=>{r||i.push([e,r=[]]),-1==r.indexOf(t)&&r.push(t)})}})});let o=r[t.join(",")]=new VH(t.indexOf(n.length-1)>-1);for(let t=0;t<i.length;t++){let n=i[t][1].sort(VJ);o.next.push({type:i[t][0],next:r[n.join(",")]||e(n)})}return o}(V$(n,0)));return function(e,t){for(let n=0,r=[e];n<r.length;n++){let e=r[n],i=!e.validEnd,o=[];for(let t=0;t<e.next.length;t++){let{type:n,next:a}=e.next[t];o.push(n.name),i&&!(n.isText||n.hasRequiredAttrs())&&(i=!1),-1==r.indexOf(a)&&r.push(a)}i&&t.err("Only non-generatable nodes ("+o.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}(a,i),a}matchType(e){for(let t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}matchFragment(e,t=0,n=e.childCount){let r=this;for(let i=t;r&&i<n;i++)r=r.matchType(e.child(i).type);return r}get inlineContent(){return 0!=this.next.length&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:t}=this.next[e];if(!(t.isText||t.hasRequiredAttrs()))return t}return null}compatible(e){for(let t=0;t<this.next.length;t++)for(let n=0;n<e.next.length;n++)if(this.next[t].type==e.next[n].type)return!0;return!1}fillBefore(e,t=!1,n=0){let r=[this];return function i(o,a){let u=o.matchFragment(e,n);if(u&&(!t||u.validEnd))return V_.from(a.map(e=>e.createAndFill()));for(let e=0;e<o.next.length;e++){let{type:t,next:n}=o.next[e];if(!(t.isText||t.hasRequiredAttrs())&&-1==r.indexOf(n)){r.push(n);let e=i(n,a.concat(t));if(e)return e}}return null}(this,[])}findWrapping(e){for(let t=0;t<this.wrapCache.length;t+=2)if(this.wrapCache[t]==e)return this.wrapCache[t+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),n=[{match:this,type:null,via:null}];for(;n.length;){let r=n.shift(),i=r.match;if(i.matchType(e)){let e=[];for(let t=r;t.type;t=t.via)e.push(t.type);return e.reverse()}for(let e=0;e<i.next.length;e++){let{type:o,next:a}=i.next[e];o.isLeaf||o.hasRequiredAttrs()||o.name in t||r.type&&!a.validEnd||(n.push({match:o.contentMatch,type:o,via:r}),t[o.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];return function t(n){e.push(n);for(let r=0;r<n.next.length;r++)-1==e.indexOf(n.next[r].next)&&t(n.next[r].next)}(this),e.map((t,n)=>{let r=n+(t.validEnd?"*":" ")+" ";for(let n=0;n<t.next.length;n++)r+=(n?", ":"")+t.next[n].type.name+"->"+e.indexOf(t.next[n].next);return r}).join(`
|
|
8
|
-
`)}}VH.empty=new VH(!0);class VG{constructor(e,t){this.string=e,this.nodeTypes=t,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),""==this.tokens[this.tokens.length-1]&&this.tokens.pop(),""==this.tokens[0]&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw SyntaxError(e+" (in content expression '"+this.string+"')")}}function VZ(e){/\D/.test(e.next)&&e.err("Expected number, got '"+e.next+"'");let t=Number(e.next);return e.pos++,t}function VJ(e,t){return t-e}function V$(e,t){let n=[];return function t(r){let i=e[r];if(1==i.length&&!i[0].term)return t(i[0].to);n.push(r);for(let e=0;e<i.length;e++){let{term:r,to:o}=i[e];r||-1!=n.indexOf(o)||t(o)}}(t),n.sort(VJ)}function VX(e){let t=Object.create(null);for(let n in e){let r=e[n];if(!r.hasDefault)return null;t[n]=r.default}return t}function V0(e,t){let n=Object.create(null);for(let r in e){let i=t&&t[r];if(void 0===i){let t=e[r];if(t.hasDefault)i=t.default;else throw RangeError("No value supplied for attribute "+r)}n[r]=i}return n}function V1(e){let t=Object.create(null);if(e)for(let n in e)t[n]=new V6(e[n]);return t}let V2=class e{constructor(e,t,n){this.name=e,this.schema=t,this.spec=n,this.markSet=null,this.groups=n.group?n.group.split(" "):[],this.attrs=V1(n.attrs),this.defaultAttrs=VX(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(n.inline||"text"==e),this.isText="text"==e}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==VH.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:V0(this.attrs,e)}create(e=null,t,n){if(this.isText)throw Error("NodeType.create can't construct text nodes");return new VV(this,this.computeAttrs(e),V_.from(t),Vk.setFrom(n))}createChecked(e=null,t,n){return t=V_.from(t),this.checkContent(t),new VV(this,this.computeAttrs(e),t,Vk.setFrom(n))}createAndFill(e=null,t,n){if(e=this.computeAttrs(e),(t=V_.from(t)).size){let e=this.contentMatch.fillBefore(t);if(!e)return null;t=e.append(t)}let r=this.contentMatch.matchFragment(t),i=r&&r.fillBefore(V_.empty,!0);return i?new VV(this,e,t.append(i),Vk.setFrom(n)):null}validContent(e){let t=this.contentMatch.matchFragment(e);if(!t||!t.validEnd)return!1;for(let t=0;t<e.childCount;t++)if(!this.allowsMarks(e.child(t).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}allowsMarkType(e){return null==this.markSet||this.markSet.indexOf(e)>-1}allowsMarks(e){if(null==this.markSet)return!0;for(let t=0;t<e.length;t++)if(!this.allowsMarkType(e[t].type))return!1;return!0}allowedMarks(e){let t;if(null==this.markSet)return e;for(let n=0;n<e.length;n++)this.allowsMarkType(e[n].type)?t&&t.push(e[n]):t||(t=e.slice(0,n));return t?t.length?t:Vk.none:e}static compile(t,n){let r=Object.create(null);t.forEach((t,i)=>r[t]=new e(t,n,i));let i=n.spec.topNode||"doc";if(!r[i])throw RangeError("Schema is missing its top node type ('"+i+"')");if(!r.text)throw RangeError("Every schema needs a 'text' type");for(let e in r.text.attrs)throw RangeError("The text node type should not have attributes");return r}};class V6{constructor(e){this.hasDefault=Object.prototype.hasOwnProperty.call(e,"default"),this.default=e.default}get isRequired(){return!this.hasDefault}}class V5{constructor(e,t,n,r){this.name=e,this.rank=t,this.schema=n,this.spec=r,this.attrs=V1(r.attrs),this.excluded=null;let i=VX(this.attrs);this.instance=i?new Vk(this,i):null}create(e=null){return!e&&this.instance?this.instance:new Vk(this,V0(this.attrs,e))}static compile(e,t){let n=Object.create(null),r=0;return e.forEach((e,i)=>n[e]=new V5(e,r++,t,i)),n}removeFromSet(e){for(var t=0;t<e.length;t++)e[t].type==this&&(e=e.slice(0,t).concat(e.slice(t+1)),t--);return e}isInSet(e){for(let t=0;t<e.length;t++)if(e[t].type==this)return e[t]}excludes(e){return this.excluded.indexOf(e)>-1}}class V3{constructor(e){this.cached=Object.create(null);let t=this.spec={};for(let n in e)t[n]=e[n];t.nodes=VI.from(e.nodes),t.marks=VI.from(e.marks||{}),this.nodes=V2.compile(this.spec.nodes,this),this.marks=V5.compile(this.spec.marks,this);let n=Object.create(null);for(let e in this.nodes){if(e in this.marks)throw RangeError(e+" can not be both a node and a mark");let t=this.nodes[e],r=t.spec.content||"",i=t.spec.marks;t.contentMatch=n[r]||(n[r]=VH.parse(r,this.nodes)),t.inlineContent=t.contentMatch.inlineContent,t.markSet="_"==i?null:i?V9(this,i.split(" ")):""!=i&&t.inlineContent?null:[]}for(let e in this.marks){let t=this.marks[e],n=t.spec.excludes;t.excluded=null==n?[t]:""==n?[]:V9(this,n.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(e,t=null,n,r){if("string"==typeof e)e=this.nodeType(e);else if(e instanceof V2){if(e.schema!=this)throw RangeError("Node type from different schema used ("+e.name+")")}else throw RangeError("Invalid node type: "+e);return e.createChecked(t,n,r)}text(e,t){let n=this.nodes.text;return new Vz(n,n.defaultAttrs,e,Vk.setFrom(t))}mark(e,t){return"string"==typeof e&&(e=this.marks[e]),e.create(t)}nodeFromJSON(e){return VV.fromJSON(this,e)}markFromJSON(e){return Vk.fromJSON(this,e)}nodeType(e){let t=this.nodes[e];if(!t)throw RangeError("Unknown node type: "+e);return t}}function V9(e,t){let n=[];for(let r=0;r<t.length;r++){let i=t[r],o=e.marks[i],a=o;if(o)n.push(o);else for(let t in e.marks){let r=e.marks[t];("_"==i||r.spec.group&&r.spec.group.split(" ").indexOf(i)>-1)&&n.push(a=r)}if(!a)throw SyntaxError("Unknown mark type: '"+t[r]+"'")}return n}class V4{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[],t.forEach(e=>{e.tag?this.tags.push(e):e.style&&this.styles.push(e)}),this.normalizeLists=!this.tags.some(t=>{if(!/^(ul|ol)\b/.test(t.tag)||!t.node)return!1;let n=e.nodes[t.node];return n.contentMatch.matchType(n)})}parse(e,t={}){let n=new zr(this,t,!1);return n.addAll(e,t.from,t.to),n.finish()}parseSlice(e,t={}){let n=new zr(this,t,!0);return n.addAll(e,t.from,t.to),VM.maxOpen(n.finish())}matchTag(e,t,n){for(let i=n?this.tags.indexOf(n)+1:0;i<this.tags.length;i++){var r;let n=this.tags[i];if(r=n.tag,(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,r)&&(void 0===n.namespace||e.namespaceURI==n.namespace)&&(!n.context||t.matchesContext(n.context))){if(n.getAttrs){let t=n.getAttrs(e);if(!1===t)continue;n.attrs=t||void 0}return n}}}matchStyle(e,t,n,r){for(let i=r?this.styles.indexOf(r)+1:0;i<this.styles.length;i++){let r=this.styles[i],o=r.style;if(!(0!=o.indexOf(e)||r.context&&!n.matchesContext(r.context)||o.length>e.length&&(61!=o.charCodeAt(e.length)||o.slice(e.length+1)!=t))){if(r.getAttrs){let e=r.getAttrs(t);if(!1===e)continue;r.attrs=e||void 0}return r}}}static schemaRules(e){let t=[];function n(e){let n=null==e.priority?50:e.priority,r=0;for(;r<t.length;r++){let e=t[r];if((null==e.priority?50:e.priority)<n)break}t.splice(r,0,e)}for(let t in e.marks){let r=e.marks[t].spec.parseDOM;r&&r.forEach(e=>{n(e=zi(e)),e.mark||e.ignore||e.clearMark||(e.mark=t)})}for(let t in e.nodes){let r=e.nodes[t].spec.parseDOM;r&&r.forEach(e=>{n(e=zi(e)),e.node||e.ignore||e.mark||(e.node=t)})}return t}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new V4(e,V4.schemaRules(e)))}}let V7={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},V8={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},ze={ol:!0,ul:!0};function zt(e,t,n){return null!=t?(t?1:0)|("full"===t?2:0):e&&"pre"==e.whitespace?3:-5&n}class zn{constructor(e,t,n,r,i,o,a){this.type=e,this.attrs=t,this.marks=n,this.pendingMarks=r,this.solid=i,this.options=a,this.content=[],this.activeMarks=Vk.none,this.stashMarks=[],this.match=o||(4&a?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(V_.from(e));if(t)this.match=this.type.contentMatch.matchFragment(t);else{let t=this.type.contentMatch,n;return(n=t.findWrapping(e.type))?(this.match=t,n):null}}return this.match.findWrapping(e.type)}finish(e){if(!(1&this.options)){let e=this.content[this.content.length-1],t;e&&e.isText&&(t=/[ \t\r\n\u000c]+$/.exec(e.text))&&(e.text.length==t[0].length?this.content.pop():this.content[this.content.length-1]=e.withText(e.text.slice(0,e.text.length-t[0].length)))}let t=V_.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(V_.empty,!0))),this.type?this.type.create(this.attrs,t,this.marks):t}popFromStashMark(e){for(let t=this.stashMarks.length-1;t>=0;t--)if(e.eq(this.stashMarks[t]))return this.stashMarks.splice(t,1)[0]}applyPending(e){for(let t=0,n=this.pendingMarks;t<n.length;t++){let r=n[t];(this.type?this.type.allowsMarkType(r.type):function(e,t){let n=t.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(e))continue;let o=[],a=e=>{o.push(e);for(let n=0;n<e.edgeCount;n++){let{type:r,next:i}=e.edge(n);if(r==t||0>o.indexOf(i)&&a(i))return!0}};if(a(i.contentMatch))return!0}}(r.type,e))&&!r.isInSet(this.activeMarks)&&(this.activeMarks=r.addToSet(this.activeMarks),this.pendingMarks=r.removeFromSet(this.pendingMarks))}}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!V7.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class zr{constructor(e,t,n){this.parser=e,this.options=t,this.isOpen=n,this.open=0;let r=t.topNode,i,o=zt(null,t.preserveWhitespace,0)|(n?4:0);i=r?new zn(r.type,r.attrs,Vk.none,Vk.none,!0,t.topMatch||r.type.contentMatch,o):n?new zn(null,null,Vk.none,Vk.none,!0,null,o):new zn(e.schema.topNodeType,null,Vk.none,Vk.none,!0,null,o),this.nodes=[i],this.find=t.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e){if(3==e.nodeType)this.addTextNode(e);else if(1==e.nodeType){let t=e.getAttribute("style");if(t){let n=this.readStyles(function(e){let t=/\s*([\w-]+)\s*:\s*([^;]+)/g,n,r=[];for(;n=t.exec(e);)r.push(n[1],n[2].trim());return r}(t));if(!n)return;let[r,i]=n,o=this.top;for(let e=0;e<i.length;e++)this.removePendingMark(i[e],o);for(let e=0;e<r.length;e++)this.addPendingMark(r[e]);this.addElement(e);for(let e=0;e<r.length;e++)this.removePendingMark(r[e],o);for(let e=0;e<i.length;e++)this.addPendingMark(i[e])}else this.addElement(e)}}addTextNode(e){let t=e.nodeValue,n=this.top;if(2&n.options||n.inlineContext(e)||/[^ \t\r\n\u000c]/.test(t)){if(1&n.options)t=2&n.options?t.replace(/\r\n?/g,`
|
|
9
|
-
`):t.replace(/\r?\n|\r/g," ");else if(t=t.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(t)&&this.open==this.nodes.length-1){let r=n.content[n.content.length-1],i=e.previousSibling;(!r||i&&"BR"==i.nodeName||r.isText&&/[ \t\r\n\u000c]$/.test(r.text))&&(t=t.slice(1))}t&&this.insertNode(this.parser.schema.text(t)),this.findInText(e)}else this.findInside(e)}addElement(e,t){let n=e.nodeName.toLowerCase(),r;ze.hasOwnProperty(n)&&this.parser.normalizeLists&&function(e){for(let t=e.firstChild,n=null;t;t=t.nextSibling){let e=1==t.nodeType?t.nodeName.toLowerCase():null;e&&ze.hasOwnProperty(e)&&n?(n.appendChild(t),t=n):"li"==e?n=t:e&&(n=null)}}(e);let i=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(r=this.parser.matchTag(e,this,t));if(i?i.ignore:V8.hasOwnProperty(n))this.findInside(e),this.ignoreFallback(e);else if(!i||i.skip||i.closeParent){i&&i.closeParent?this.open=Math.max(0,this.open-1):i&&i.skip.nodeType&&(e=i.skip);let t,r=this.top,o=this.needsBlock;if(V7.hasOwnProperty(n))r.content.length&&r.content[0].isInline&&this.open&&(this.open--,r=this.top),t=!0,r.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e);return}this.addAll(e),t&&this.sync(r),this.needsBlock=o}else this.addElementByRule(e,i,!1===i.consuming?r:void 0)}leafFallback(e){"BR"==e.nodeName&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
|
|
10
|
-
`))}ignoreFallback(e){"BR"!=e.nodeName||this.top.type&&this.top.type.inlineContent||this.findPlace(this.parser.schema.text("-"))}readStyles(e){let t=Vk.none,n=Vk.none;e:for(let r=0;r<e.length;r+=2)for(let i;;){let o=this.parser.matchStyle(e[r],e[r+1],this,i);if(!o)continue e;if(o.ignore)return null;if(o.clearMark?this.top.pendingMarks.forEach(e=>{o.clearMark(e)&&(n=e.addToSet(n))}):t=this.parser.schema.marks[o.mark].create(o.attrs).addToSet(t),!1===o.consuming)i=o;else break}return[t,n]}addElementByRule(e,t,n){let r,i,o;t.node?(i=this.parser.schema.nodes[t.node]).isLeaf?this.insertNode(i.create(t.attrs))||this.leafFallback(e):r=this.enter(i,t.attrs||null,t.preserveWhitespace):(o=this.parser.schema.marks[t.mark].create(t.attrs),this.addPendingMark(o));let a=this.top;if(i&&i.isLeaf)this.findInside(e);else if(n)this.addElement(e,n);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach(e=>this.insertNode(e));else{let n=e;"string"==typeof t.contentElement?n=e.querySelector(t.contentElement):"function"==typeof t.contentElement?n=t.contentElement(e):t.contentElement&&(n=t.contentElement),this.findAround(e,n,!0),this.addAll(n)}r&&this.sync(a)&&this.open--,o&&this.removePendingMark(o,a)}addAll(e,t,n){let r=t||0;for(let i=t?e.childNodes[t]:e.firstChild,o=null==n?null:e.childNodes[n];i!=o;i=i.nextSibling,++r)this.findAtPoint(e,r),this.addDOM(i);this.findAtPoint(e,r)}findPlace(e){let t,n;for(let r=this.open;r>=0;r--){let i=this.nodes[r],o=i.findWrapping(e);if(o&&(!t||t.length>o.length)&&(t=o,n=i,!o.length)||i.solid)break}if(!t)return!1;this.sync(n);for(let e=0;e<t.length;e++)this.enterInner(t[e],null,!1);return!0}insertNode(e){if(e.isInline&&this.needsBlock&&!this.top.type){let e=this.textblockFromContext();e&&this.enterInner(e)}if(this.findPlace(e)){this.closeExtra();let t=this.top;t.applyPending(e.type),t.match&&(t.match=t.match.matchType(e.type));let n=t.activeMarks;for(let r=0;r<e.marks.length;r++)(!t.type||t.type.allowsMarkType(e.marks[r].type))&&(n=e.marks[r].addToSet(n));return t.content.push(e.mark(n)),!0}return!1}enter(e,t,n){let r=this.findPlace(e.create(t));return r&&this.enterInner(e,t,!0,n),r}enterInner(e,t=null,n=!1,r){this.closeExtra();let i=this.top;i.applyPending(e),i.match=i.match&&i.match.matchType(e);let o=zt(e,r,i.options);4&i.options&&0==i.content.length&&(o|=4),this.nodes.push(new zn(e,t,i.activeMarks,i.pendingMarks,n,null,o)),this.open++}closeExtra(e=!1){let t=this.nodes.length-1;if(t>this.open){for(;t>this.open;t--)this.nodes[t-1].content.push(this.nodes[t].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(this.isOpen||this.options.topOpen)}sync(e){for(let t=this.open;t>=0;t--)if(this.nodes[t]==e)return this.open=t,!0;return!1}get currentPos(){this.closeExtra();let e=0;for(let t=this.open;t>=0;t--){let n=this.nodes[t].content;for(let t=n.length-1;t>=0;t--)e+=n[t].nodeSize;t&&e++}return e}findAtPoint(e,t){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&this.find[n].offset==t&&(this.find[n].pos=this.currentPos)}findInside(e){if(this.find)for(let t=0;t<this.find.length;t++)null==this.find[t].pos&&1==e.nodeType&&e.contains(this.find[t].node)&&(this.find[t].pos=this.currentPos)}findAround(e,t,n){if(e!=t&&this.find)for(let r=0;r<this.find.length;r++)null==this.find[r].pos&&1==e.nodeType&&e.contains(this.find[r].node)&&t.compareDocumentPosition(this.find[r].node)&(n?2:4)&&(this.find[r].pos=this.currentPos)}findInText(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].node==e&&(this.find[t].pos=this.currentPos-(e.nodeValue.length-this.find[t].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let t=e.split("/"),n=this.options.context,r=!this.isOpen&&(!n||n.parent.type==this.nodes[0].type),i=-(n?n.depth+1:0)+(r?0:1),o=(e,a)=>{for(;e>=0;e--){let u=t[e];if(""==u){if(e==t.length-1||0==e)continue;for(;a>=i;a--)if(o(e-1,a))return!0;return!1}{let e=a>0||0==a&&r?this.nodes[a].type:n&&a>=i?n.node(a-i).type:null;if(!e||e.name!=u&&-1==e.groups.indexOf(u))return!1;a--}}return!0};return o(t.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let t=e.depth;t>=0;t--){let n=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(let e in this.parser.schema.nodes){let t=this.parser.schema.nodes[e];if(t.isTextblock&&t.defaultAttrs)return t}}addPendingMark(e){let t=function(e,t){for(let n=0;n<t.length;n++)if(e.eq(t[n]))return t[n]}(e,this.top.pendingMarks);t&&this.top.stashMarks.push(t),this.top.pendingMarks=e.addToSet(this.top.pendingMarks)}removePendingMark(e,t){for(let n=this.open;n>=0;n--){let r=this.nodes[n];if(r.pendingMarks.lastIndexOf(e)>-1)r.pendingMarks=e.removeFromSet(r.pendingMarks);else{r.activeMarks=e.removeFromSet(r.activeMarks);let t=r.popFromStashMark(e);t&&r.type&&r.type.allowsMarkType(t.type)&&(r.activeMarks=t.addToSet(r.activeMarks))}if(r==t)break}}}function zi(e){let t={};for(let n in e)t[n]=e[n];return t}class zo{constructor(e,t){this.nodes=e,this.marks=t}serializeFragment(e,t={},n){n||(n=zu(t).createDocumentFragment());let r=n,i=[];return e.forEach(e=>{if(i.length||e.marks.length){let n=0,o=0;for(;n<i.length&&o<e.marks.length;){let t=e.marks[o];if(!this.marks[t.type.name]){o++;continue}if(!t.eq(i[n][0])||!1===t.type.spec.spanning)break;n++,o++}for(;n<i.length;)r=i.pop()[1];for(;o<e.marks.length;){let n=e.marks[o++],a=this.serializeMark(n,e.isInline,t);a&&(i.push([n,r]),r.appendChild(a.dom),r=a.contentDOM||a.dom)}}r.appendChild(this.serializeNodeInner(e,t))}),n}serializeNodeInner(e,t){let{dom:n,contentDOM:r}=zo.renderSpec(zu(t),this.nodes[e.type.name](e));if(r){if(e.isLeaf)throw RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,t,r)}return n}serializeNode(e,t={}){let n=this.serializeNodeInner(e,t);for(let r=e.marks.length-1;r>=0;r--){let i=this.serializeMark(e.marks[r],e.isInline,t);i&&((i.contentDOM||i.dom).appendChild(n),n=i.dom)}return n}serializeMark(e,t,n={}){let r=this.marks[e.type.name];return r&&zo.renderSpec(zu(n),r(e,t))}static renderSpec(e,t,n=null){if("string"==typeof t)return{dom:e.createTextNode(t)};if(null!=t.nodeType)return{dom:t};if(t.dom&&null!=t.dom.nodeType)return t;let r=t[0],i=r.indexOf(" ");i>0&&(n=r.slice(0,i),r=r.slice(i+1));let o,a=n?e.createElementNS(n,r):e.createElement(r),u=t[1],s=1;if(u&&"object"==typeof u&&null==u.nodeType&&!Array.isArray(u)){for(let e in s=2,u)if(null!=u[e]){let t=e.indexOf(" ");t>0?a.setAttributeNS(e.slice(0,t),e.slice(t+1),u[e]):a.setAttribute(e,u[e])}}for(let r=s;r<t.length;r++){let i=t[r];if(0===i){if(r<t.length-1||r>s)throw RangeError("Content hole must be the only child of its parent node");return{dom:a,contentDOM:a}}{let{dom:t,contentDOM:r}=zo.renderSpec(e,i,n);if(a.appendChild(t),r){if(o)throw RangeError("Multiple content holes");o=r}}}return{dom:a,contentDOM:o}}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new zo(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let t=za(e.nodes);return t.text||(t.text=e=>e.text),t}static marksFromSchema(e){return za(e.marks)}}function za(e){let t={};for(let n in e){let r=e[n].spec.toDOM;r&&(t[n]=r)}return t}function zu(e){return e.document||window.document}let zs=class{constructor(e,t,n){this.pos=e,this.delInfo=t,this.recover=n}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}},zl=class e{constructor(t,n=!1){if(this.ranges=t,this.inverted=n,!t.length&&e.empty)return e.empty}recover(e){let t=0,n=65535&e;if(!this.inverted)for(let e=0;e<n;e++)t+=this.ranges[3*e+2]-this.ranges[3*e+1];return this.ranges[3*n]+t+(e-(65535&e))/65536}mapResult(e,t=1){return this._map(e,t,!1)}map(e,t=1){return this._map(e,t,!0)}_map(e,t,n){let r=0,i=this.inverted?2:1,o=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let u=this.ranges[a]-(this.inverted?r:0);if(u>e)break;let s=this.ranges[a+i],l=this.ranges[a+o],c=u+s;if(e<=c){let i=s?e==u?-1:e==c?1:t:t,o=u+r+(i<0?0:l);if(n)return o;let d=e==(t<0?u:c)?null:a/3+(e-u)*65536,f=e==u?2:e==c?1:4;return(t<0?e!=u:e!=c)&&(f|=8),new zs(o,f,d)}r+=l-s}return n?e+r:new zs(e+r,0,null)}touches(e,t){let n=0,r=65535&t,i=this.inverted?2:1,o=this.inverted?1:2;for(let t=0;t<this.ranges.length;t+=3){let a=this.ranges[t]-(this.inverted?n:0);if(a>e)break;let u=this.ranges[t+i];if(e<=a+u&&t==3*r)return!0;n+=this.ranges[t+o]-u}return!1}forEach(e){let t=this.inverted?2:1,n=this.inverted?1:2;for(let r=0,i=0;r<this.ranges.length;r+=3){let o=this.ranges[r],a=o-(this.inverted?i:0),u=o+(this.inverted?0:i),s=this.ranges[r+t],l=this.ranges[r+n];e(a,a+s,u,u+l),i+=l-s}}invert(){return new e(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(t){return 0==t?e.empty:new e(t<0?[0,-t,0]:[0,0,t])}};zl.empty=new zl([]);class zc{constructor(e=[],t,n=0,r=e.length){this.maps=e,this.mirror=t,this.from=n,this.to=r}slice(e=0,t=this.maps.length){return new zc(this.maps,this.mirror,e,t)}copy(){return new zc(this.maps.slice(),this.mirror&&this.mirror.slice(),this.from,this.to)}appendMap(e,t){this.to=this.maps.push(e),null!=t&&this.setMirror(this.maps.length-1,t)}appendMapping(e){for(let t=0,n=this.maps.length;t<e.maps.length;t++){let r=e.getMirror(t);this.appendMap(e.maps[t],null!=r&&r<t?n+r:void 0)}}getMirror(e){if(this.mirror){for(let t=0;t<this.mirror.length;t++)if(this.mirror[t]==e)return this.mirror[t+(t%2?-1:1)]}}setMirror(e,t){this.mirror||(this.mirror=[]),this.mirror.push(e,t)}appendMappingInverted(e){for(let t=e.maps.length-1,n=this.maps.length+e.maps.length;t>=0;t--){let r=e.getMirror(t);this.appendMap(e.maps[t].invert(),null!=r&&r>t?n-r-1:void 0)}}invert(){let e=new zc;return e.appendMappingInverted(this),e}map(e,t=1){if(this.mirror)return this._map(e,t,!0);for(let n=this.from;n<this.to;n++)e=this.maps[n].map(e,t);return e}mapResult(e,t=1){return this._map(e,t,!1)}_map(e,t,n){let r=0;for(let n=this.from;n<this.to;n++){let i=this.maps[n].mapResult(e,t);if(null!=i.recover){let t=this.getMirror(n);if(null!=t&&t>n&&t<this.to){n=t,e=this.maps[t].recover(i.recover);continue}}r|=i.delInfo,e=i.pos}return n?e:new zs(e,r,null)}}let zd=Object.create(null),zf=class{getMap(){return zl.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw RangeError("Invalid input for Step.fromJSON");let n=zd[t.stepType];if(!n)throw RangeError(`No step type ${t.stepType} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in zd)throw RangeError("Duplicate use of step JSON ID "+e);return zd[e]=t,t.prototype.jsonID=e,t}},zp=class e{constructor(e,t){this.doc=e,this.failed=t}static ok(t){return new e(t,null)}static fail(t){return new e(null,t)}static fromReplace(t,n,r,i){try{return e.ok(t.replace(n,r,i))}catch(t){if(t instanceof VE)return e.fail(t.message);throw t}}};function zA(e,t,n){let r=[];for(let i=0;i<e.childCount;i++){let o=e.child(i);o.content.size&&(o=o.copy(zA(o.content,t,o))),o.isInline&&(o=t(o,n,i)),r.push(o)}return V_.fromArray(r)}let zh=class e extends zf{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=e.resolve(this.from),r=n.node(n.sharedDepth(this.to)),i=new VM(zA(t.content,(e,t)=>e.isAtom&&t.type.allowsMarkType(this.mark.type)?e.mark(this.mark.addToSet(e.marks)):e,r),t.openStart,t.openEnd);return zp.fromReplace(e,this.from,this.to,i)}invert(){return new zm(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new e(n.pos,r.pos,this.mark)}merge(t){return t instanceof e&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new e(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if("number"!=typeof n.from||"number"!=typeof n.to)throw RangeError("Invalid input for AddMarkStep.fromJSON");return new e(n.from,n.to,t.markFromJSON(n.mark))}};zf.jsonID("addMark",zh);let zm=class e extends zf{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=new VM(zA(t.content,e=>e.mark(this.mark.removeFromSet(e.marks)),e),t.openStart,t.openEnd);return zp.fromReplace(e,this.from,this.to,n)}invert(){return new zh(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new e(n.pos,r.pos,this.mark)}merge(t){return t instanceof e&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new e(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if("number"!=typeof n.from||"number"!=typeof n.to)throw RangeError("Invalid input for RemoveMarkStep.fromJSON");return new e(n.from,n.to,t.markFromJSON(n.mark))}};zf.jsonID("removeMark",zm);let zg=class e extends zf{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return zp.fail("No node at mark step's position");let n=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return zp.fromReplace(e,this.pos,this.pos+1,new VM(V_.from(n),0,t.isLeaf?0:1))}invert(t){let n=t.nodeAt(this.pos);if(n){let t=this.mark.addToSet(n.marks);if(t.length==n.marks.length){for(let r=0;r<n.marks.length;r++)if(!n.marks[r].isInSet(t))return new e(this.pos,n.marks[r]);return new e(this.pos,this.mark)}}return new zy(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new e(n.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if("number"!=typeof n.pos)throw RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new e(n.pos,t.markFromJSON(n.mark))}};zf.jsonID("addNodeMark",zg);let zy=class e extends zf{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return zp.fail("No node at mark step's position");let n=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return zp.fromReplace(e,this.pos,this.pos+1,new VM(V_.from(n),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);return t&&this.mark.isInSet(t.marks)?new zg(this.pos,this.mark):this}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new e(n.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if("number"!=typeof n.pos)throw RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new e(n.pos,t.markFromJSON(n.mark))}};zf.jsonID("removeNodeMark",zy);let zv=class e extends zf{constructor(e,t,n,r=!1){super(),this.from=e,this.to=t,this.slice=n,this.structure=r}apply(e){return this.structure&&zb(e,this.from,this.to)?zp.fail("Structure replace would overwrite content"):zp.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new zl([this.from,this.to-this.from,this.slice.size])}invert(t){return new e(this.from,this.from+this.slice.size,t.slice(this.from,this.to))}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deletedAcross&&r.deletedAcross?null:new e(n.pos,Math.max(n.pos,r.pos),this.slice)}merge(t){if(!(t instanceof e)||t.structure||this.structure)return null;if(this.from+this.slice.size!=t.from||this.slice.openEnd||t.slice.openStart){if(t.to!=this.from||this.slice.openStart||t.slice.openEnd)return null;{let n=this.slice.size+t.slice.size==0?VM.empty:new VM(t.slice.content.append(this.slice.content),t.slice.openStart,this.slice.openEnd);return new e(t.from,this.to,n,this.structure)}}{let n=this.slice.size+t.slice.size==0?VM.empty:new VM(this.slice.content.append(t.slice.content),this.slice.openStart,t.slice.openEnd);return new e(this.from,this.to+(t.to-t.from),n,this.structure)}}toJSON(){let e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(t,n){if("number"!=typeof n.from||"number"!=typeof n.to)throw RangeError("Invalid input for ReplaceStep.fromJSON");return new e(n.from,n.to,VM.fromJSON(t,n.slice),!!n.structure)}};zf.jsonID("replace",zv);let zx=class e extends zf{constructor(e,t,n,r,i,o,a=!1){super(),this.from=e,this.to=t,this.gapFrom=n,this.gapTo=r,this.slice=i,this.insert=o,this.structure=a}apply(e){if(this.structure&&(zb(e,this.from,this.gapFrom)||zb(e,this.gapTo,this.to)))return zp.fail("Structure gap-replace would overwrite content");let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return zp.fail("Gap is not a flat range");let n=this.slice.insertAt(this.insert,t.content);return n?zp.fromReplace(e,this.from,this.to,n):zp.fail("Content does not fit in gap")}getMap(){return new zl([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(t){let n=this.gapTo-this.gapFrom;return new e(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,t.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1),i=t.map(this.gapFrom,-1),o=t.map(this.gapTo,1);return n.deletedAcross&&r.deletedAcross||i<n.pos||o>r.pos?null:new e(n.pos,r.pos,i,o,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(t,n){if("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 e(n.from,n.to,n.gapFrom,n.gapTo,VM.fromJSON(t,n.slice),n.insert,!!n.structure)}};function zb(e,t,n){let r=e.resolve(t),i=n-t,o=r.depth;for(;i>0&&o>0&&r.indexAfter(o)==r.node(o).childCount;)o--,i--;if(i>0){let e=r.node(o).maybeChild(r.indexAfter(o));for(;i>0;){if(!e||e.isLeaf)return!0;e=e.firstChild,i--}}return!1}function zC(e){let t=e.parent.content.cutByIndex(e.startIndex,e.endIndex);for(let n=e.depth;;--n){let r=e.$from.node(n),i=e.$from.index(n),o=e.$to.indexAfter(n);if(n<e.depth&&r.canReplace(i,o,t))return n;if(0==n||r.type.spec.isolating||!((0==i||r.canReplace(i,r.childCount))&&(o==r.childCount||r.canReplace(0,o))))break}return null}function zS(e,t,n=null,r=e){let i=function(e,t){let{parent:n,startIndex:r,endIndex:i}=e,o=n.contentMatchAt(r).findWrapping(t);if(!o)return null;let a=o.length?o[0]:t;return n.canReplaceWith(r,i,a)?o:null}(e,t),o=i&&function(e,t){let{parent:n,startIndex:r,endIndex:i}=e,o=n.child(r),a=t.contentMatch.findWrapping(o.type);if(!a)return null;let u=(a.length?a[a.length-1]:t).contentMatch;for(let e=r;u&&e<i;e++)u=u.matchType(n.child(e).type);return u&&u.validEnd?a:null}(r,t);return o?i.map(zw).concat({type:t,attrs:n}).concat(o.map(zw)):null}function zw(e){return{type:e,attrs:null}}function zI(e,t,n=1,r){let i=e.resolve(t),o=i.depth-n,a=r&&r[r.length-1]||i.parent;if(o<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!a.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let e=i.depth-1,t=n-2;e>o;e--,t--){let n=i.node(e),o=i.index(e);if(n.type.spec.isolating)return!1;let a=n.content.cutByIndex(o,n.childCount),u=r&&r[t+1];u&&(a=a.replaceChild(0,u.type.create(u.attrs)));let s=r&&r[t]||n;if(!n.canReplace(o+1,n.childCount)||!s.type.validContent(a))return!1}let u=i.indexAfter(o),s=r&&r[0];return i.node(o).canReplaceWith(u,u,s?s.type:i.node(o+1).type)}function z_(e,t){let n=e.resolve(t),r=n.index();return zT(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function zT(e,t){return!!(e&&t&&!e.isLeaf&&e.canAppend(t))}function zO(e,t,n=-1){let r=e.resolve(t);for(let e=r.depth;;e--){let i,o,a=r.index(e);if(e==r.depth?(i=r.nodeBefore,o=r.nodeAfter):n>0?(i=r.node(e+1),a++,o=r.node(e).maybeChild(a)):(i=r.node(e).maybeChild(a-1),o=r.node(e+1)),i&&!i.isTextblock&&zT(i,o)&&r.node(e).canReplace(a,a+1))return t;if(0==e)break;t=n<0?r.before(e):r.after(e)}}function zR(e,t,n=t,r=VM.empty){if(t==n&&!r.size)return null;let i=e.resolve(t),o=e.resolve(n);return!r.openStart&&!r.openEnd&&i.start()==o.start()&&i.parent.canReplace(i.index(),o.index(),r.content)?new zv(t,n,r):new zk(i,o,r).fit()}zf.jsonID("replaceAround",zx);class zk{constructor(e,t,n){this.$from=e,this.$to=t,this.unplaced=n,this.frontier=[],this.placed=V_.empty;for(let t=0;t<=e.depth;t++){let n=e.node(t);this.frontier.push({type:n.type,match:n.contentMatchAt(e.indexAfter(t))})}for(let t=e.depth;t>0;t--)this.placed=V_.from(e.node(t).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let e=this.findFittable();e?this.placeNodes(e):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),t=this.placed.size-this.depth-this.$from.depth,n=this.$from,r=this.close(e<0?this.$to:n.doc.resolve(e));if(!r)return null;let i=this.placed,o=n.depth,a=r.depth;for(;o&&a&&1==i.childCount;)i=i.firstChild.content,o--,a--;let u=new VM(i,o,a);return e>-1?new zx(n.pos,e,this.$to.pos,this.$to.end(),u,t):u.size||n.pos!=this.$to.pos?new zv(n.pos,r.pos,u):null}findFittable(){let e=this.unplaced.openStart;for(let t=this.unplaced.content,n=0,r=this.unplaced.openEnd;n<e;n++){let i=t.firstChild;if(t.childCount>1&&(r=0),i.type.spec.isolating&&r<=n){e=n;break}t=i.content}for(let t=1;t<=2;t++)for(let n=1==t?e:this.unplaced.openStart;n>=0;n--){let e=null,r=(n?(e=zj(this.unplaced.content,n-1).firstChild).content:this.unplaced.content).firstChild;for(let i=this.depth;i>=0;i--){let{type:o,match:a}=this.frontier[i],u,s=null;if(1==t&&(r?a.matchType(r.type)||(s=a.fillBefore(V_.from(r),!1)):e&&o.compatibleContent(e.type)))return{sliceDepth:n,frontierDepth:i,parent:e,inject:s};if(2==t&&r&&(u=a.findWrapping(r.type)))return{sliceDepth:n,frontierDepth:i,parent:e,wrap:u};if(e&&a.matchType(e.type))break}}}openMore(){let{content:e,openStart:t,openEnd:n}=this.unplaced,r=zj(e,t);return!!r.childCount&&!r.firstChild.isLeaf&&(this.unplaced=new VM(e,t+1,Math.max(n,r.size+t>=e.size-n?t+1:0)),!0)}dropNode(){let{content:e,openStart:t,openEnd:n}=this.unplaced,r=zj(e,t);if(r.childCount<=1&&t>0){let i=e.size-t<=t+r.size;this.unplaced=new VM(zE(e,t-1,1),t-1,i?t-1:n)}else this.unplaced=new VM(zE(e,t,1),t,n)}placeNodes({sliceDepth:e,frontierDepth:t,parent:n,inject:r,wrap:i}){for(;this.depth>t;)this.closeFrontierNode();if(i)for(let e=0;e<i.length;e++)this.openFrontierNode(i[e]);let o=this.unplaced,a=n?n.content:o.content,u=o.openStart-e,s=0,l=[],{match:c,type:d}=this.frontier[t];if(r){for(let e=0;e<r.childCount;e++)l.push(r.child(e));c=c.matchFragment(r)}let f=a.size+e-(o.content.size-o.openEnd);for(;s<a.childCount;){let e=a.child(s),t=c.matchType(e.type);if(!t)break;(++s>1||0==u||e.content.size)&&(c=t,l.push(function e(t,n,r){if(n<=0)return t;let i=t.content;return n>1&&(i=i.replaceChild(0,e(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(V_.empty,!0)))),t.copy(i)}(e.mark(d.allowedMarks(e.marks)),1==s?u:0,s==a.childCount?f:-1)))}let p=s==a.childCount;p||(f=-1),this.placed=zM(this.placed,t,V_.from(l)),this.frontier[t].match=c,p&&f<0&&n&&n.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let e=0,t=a;e<f;e++){let e=t.lastChild;this.frontier.push({type:e.type,match:e.contentMatchAt(e.childCount)}),t=e.content}this.unplaced=p?0==e?VM.empty:new VM(zE(o.content,e-1,1),e-1,f<0?o.openEnd:e-1):new VM(zE(o.content,e,s),o.openStart,o.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return -1;let e=this.frontier[this.depth],t;if(!e.type.isTextblock||!zF(this.$to,this.$to.depth,e.type,e.match,!1)||this.$to.depth==this.depth&&(t=this.findCloseLevel(this.$to))&&t.depth==this.depth)return -1;let{depth:n}=this.$to,r=this.$to.after(n);for(;n>1&&r==this.$to.end(--n);)++r;return r}findCloseLevel(e){e:for(let t=Math.min(this.depth,e.depth);t>=0;t--){let{match:n,type:r}=this.frontier[t],i=t<e.depth&&e.end(t+1)==e.pos+(e.depth-(t+1)),o=zF(e,t,r,n,i);if(o){for(let n=t-1;n>=0;n--){let{match:t,type:r}=this.frontier[n],i=zF(e,n,r,t,!0);if(!i||i.childCount)continue e}return{depth:t,fit:o,move:i?e.doc.resolve(e.after(t+1)):e}}}}close(e){let t=this.findCloseLevel(e);if(!t)return null;for(;this.depth>t.depth;)this.closeFrontierNode();t.fit.childCount&&(this.placed=zM(this.placed,t.depth,t.fit)),e=t.move;for(let n=t.depth+1;n<=e.depth;n++){let t=e.node(n),r=t.type.contentMatch.fillBefore(t.content,!0,e.index(n));this.openFrontierNode(t.type,t.attrs,r)}return e}openFrontierNode(e,t=null,n){let r=this.frontier[this.depth];r.match=r.match.matchType(e),this.placed=zM(this.placed,this.depth,V_.from(e.create(t,n))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let e=this.frontier.pop().match.fillBefore(V_.empty,!0);e.childCount&&(this.placed=zM(this.placed,this.frontier.length,e))}}function zE(e,t,n){return 0==t?e.cutByIndex(n,e.childCount):e.replaceChild(0,e.firstChild.copy(zE(e.firstChild.content,t-1,n)))}function zM(e,t,n){return 0==t?e.append(n):e.replaceChild(e.childCount-1,e.lastChild.copy(zM(e.lastChild.content,t-1,n)))}function zj(e,t){for(let n=0;n<t;n++)e=e.firstChild.content;return e}function zF(e,t,n,r,i){let o=e.node(t),a=i?e.indexAfter(t):e.index(t);if(a==o.childCount&&!n.compatibleContent(o.type))return null;let u=r.fillBefore(o.content,!0,a);return u&&!function(e,t,n){for(let r=n;r<t.childCount;r++)if(!e.allowsMarks(t.child(r).marks))return!0;return!1}(n,o.content,a)?u:null}let zU=class e extends zf{constructor(e,t,n){super(),this.pos=e,this.attr=t,this.value=n}apply(e){let t=e.nodeAt(this.pos);if(!t)return zp.fail("No node at attribute step's position");let n=Object.create(null);for(let e in t.attrs)n[e]=t.attrs[e];n[this.attr]=this.value;let r=t.type.create(n,null,t.marks);return zp.fromReplace(e,this.pos,this.pos+1,new VM(V_.from(r),0,t.isLeaf?0:1))}getMap(){return zl.empty}invert(t){return new e(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 e(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 e(n.pos,n.attr,n.value)}};zf.jsonID("attr",zU);let zL=class extends Error{};(zL=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n}).prototype=Object.create(Error.prototype),zL.prototype.constructor=zL,zL.prototype.name="TransformError";let zK=Object.create(null);class zB{constructor(e,t,n){this.$anchor=e,this.$head=t,this.ranges=n||[new zP(e.min(t),e.max(t))]}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 e=this.ranges;for(let t=0;t<e.length;t++)if(e[t].$from.pos!=e[t].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(e,t=VM.empty){let n=t.content.lastChild,r=null;for(let e=0;e<t.openEnd;e++)r=n,n=n.lastChild;let i=e.steps.length,o=this.ranges;for(let a=0;a<o.length;a++){let{$from:u,$to:s}=o[a],l=e.mapping.slice(i);e.replaceRange(l.map(u.pos),l.map(s.pos),a?VM.empty:t),0==a&&zG(e,i,(n?n.isInline:r&&r.isTextblock)?-1:1)}}replaceWith(e,t){let n=e.steps.length,r=this.ranges;for(let i=0;i<r.length;i++){let{$from:o,$to:a}=r[i],u=e.mapping.slice(n),s=u.map(o.pos),l=u.map(a.pos);i?e.deleteRange(s,l):(e.replaceRangeWith(s,l,t),zG(e,n,t.isInline?-1:1))}}static findFrom(e,t,n=!1){let r=e.parent.inlineContent?new zN(e):zH(e.node(0),e.parent,e.pos,e.index(),t,n);if(r)return r;for(let r=e.depth-1;r>=0;r--){let i=t<0?zH(e.node(0),e.node(r),e.before(r+1),e.index(r),t,n):zH(e.node(0),e.node(r),e.after(r+1),e.index(r)+1,t,n);if(i)return i}return null}static near(e,t=1){return this.findFrom(e,t)||this.findFrom(e,-t)||new zz(e.node(0))}static atStart(e){return zH(e,e,0,0,1)||new zz(e)}static atEnd(e){return zH(e,e,e.content.size,e.childCount,-1)||new zz(e)}static fromJSON(e,t){if(!t||!t.type)throw RangeError("Invalid input for Selection.fromJSON");let n=zK[t.type];if(!n)throw RangeError(`No selection type ${t.type} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in zK)throw RangeError("Duplicate use of selection JSON ID "+e);return zK[e]=t,t.prototype.jsonID=e,t}getBookmark(){return zN.between(this.$anchor,this.$head).getBookmark()}}zB.prototype.visible=!0;class zP{constructor(e,t){this.$from=e,this.$to=t}}let zW=!1;function zD(e){zW||e.parent.inlineContent||(zW=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+e.parent.type.name+")"))}class zN extends zB{constructor(e,t=e){zD(e),zD(t),super(e,t)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,t){let n=e.resolve(t.map(this.head));if(!n.parent.inlineContent)return zB.near(n);let r=e.resolve(t.map(this.anchor));return new zN(r.parent.inlineContent?r:n,n)}replace(e,t=VM.empty){if(super.replace(e,t),t==VM.empty){let t=this.$from.marksAcross(this.$to);t&&e.ensureMarks(t)}}eq(e){return e instanceof zN&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new zq(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,t){if("number"!=typeof t.anchor||"number"!=typeof t.head)throw RangeError("Invalid input for TextSelection.fromJSON");return new zN(e.resolve(t.anchor),e.resolve(t.head))}static create(e,t,n=t){let r=e.resolve(t);return new this(r,n==t?r:e.resolve(n))}static between(e,t,n){let r=e.pos-t.pos;if((!n||r)&&(n=r>=0?1:-1),!t.parent.inlineContent){let e=zB.findFrom(t,n,!0)||zB.findFrom(t,-n,!0);if(!e)return zB.near(t,n);t=e.$head}return e.parent.inlineContent||(0==r?e=t:(e=(zB.findFrom(e,-n,!0)||zB.findFrom(e,n,!0)).$anchor).pos<t.pos!=r<0&&(e=t)),new zN(e,t)}}zB.jsonID("text",zN);class zq{constructor(e,t){this.anchor=e,this.head=t}map(e){return new zq(e.map(this.anchor),e.map(this.head))}resolve(e){return zN.between(e.resolve(this.anchor),e.resolve(this.head))}}class zQ extends zB{constructor(e){let t=e.nodeAfter;super(e,e.node(0).resolve(e.pos+t.nodeSize)),this.node=t}map(e,t){let{deleted:n,pos:r}=t.mapResult(this.anchor),i=e.resolve(r);return n?zB.near(i):new zQ(i)}content(){return new VM(V_.from(this.node),0,0)}eq(e){return e instanceof zQ&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new zV(this.anchor)}static fromJSON(e,t){if("number"!=typeof t.anchor)throw RangeError("Invalid input for NodeSelection.fromJSON");return new zQ(e.resolve(t.anchor))}static create(e,t){return new zQ(e.resolve(t))}static isSelectable(e){return!e.isText&&!1!==e.type.spec.selectable}}zQ.prototype.visible=!1,zB.jsonID("node",zQ);class zV{constructor(e){this.anchor=e}map(e){let{deleted:t,pos:n}=e.mapResult(this.anchor);return t?new zq(n,n):new zV(n)}resolve(e){let t=e.resolve(this.anchor),n=t.nodeAfter;return n&&zQ.isSelectable(n)?new zQ(t):zB.near(t)}}class zz extends zB{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,t=VM.empty){if(t==VM.empty){e.delete(0,e.doc.content.size);let t=zB.atStart(e.doc);t.eq(e.selection)||e.setSelection(t)}else super.replace(e,t)}toJSON(){return{type:"all"}}static fromJSON(e){return new zz(e)}map(e){return new zz(e)}eq(e){return e instanceof zz}getBookmark(){return zY}}zB.jsonID("all",zz);let zY={map(){return this},resolve:e=>new zz(e)};function zH(e,t,n,r,i,o=!1){if(t.inlineContent)return zN.create(e,n);for(let a=r-(i>0?0:1);i>0?a<t.childCount:a>=0;a+=i){let r=t.child(a);if(r.isAtom){if(!o&&zQ.isSelectable(r))return zQ.create(e,n-(i<0?r.nodeSize:0))}else{let t=zH(e,r,n+i,i<0?r.childCount:0,i,o);if(t)return t}n+=r.nodeSize*i}return null}function zG(e,t,n){let r,i=e.steps.length-1;if(i<t)return;let o=e.steps[i];(o instanceof zv||o instanceof zx)&&(e.mapping.maps[i].forEach((e,t,n,i)=>{null==r&&(r=i)}),e.setSelection(zB.near(e.doc.resolve(r),n)))}function zZ(e,t){return t&&e?e.bind(t):e}class zJ{constructor(e,t,n){this.name=e,this.init=zZ(t.init,n),this.apply=zZ(t.apply,n)}}new zJ("doc",{init:e=>e.doc||e.schema.topNodeType.createAndFill(),apply:e=>e.doc}),new zJ("selection",{init:(e,t)=>e.selection||zB.atStart(t.doc),apply:e=>e.selection}),new zJ("storedMarks",{init:e=>e.storedMarks||null,apply:(e,t,n,r)=>r.selection.$cursor?e.storedMarks:null}),new zJ("scrollToSelection",{init:()=>0,apply:(e,t)=>e.scrolledIntoView?t+1:t});class z${constructor(e){this.spec=e,this.props={},e.props&&function e(t,n,r){for(let i in t){let o=t[i];o instanceof Function?o=o.bind(n):"handleDOMEvents"==i&&(o=e(o,n,{})),r[i]=o}return r}(e.props,this,this.props),this.key=e.key?e.key.key:z0("plugin")}getState(e){return e[this.key]}}let zX=Object.create(null);function z0(e){return e in zX?e+"$"+ ++zX[e]:(zX[e]=0,e+"$")}class z1{constructor(e="key"){this.key=z0(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}let z2=function(e){for(var t=0;;t++)if(!(e=e.previousSibling))return t},z6=function(e,t,n,r){return n&&(z3(e,t,n,r,-1)||z3(e,t,n,r,1))},z5=/^(img|br|input|textarea|hr)$/i;function z3(e,t,n,r,i){for(;;){if(e==n&&t==r)return!0;if(t==(i<0?0:z9(e))){let n=e.parentNode;if(!n||1!=n.nodeType||z4(e)||z5.test(e.nodeName)||"false"==e.contentEditable)return!1;t=z2(e)+(i<0?0:1),e=n}else{if(1!=e.nodeType||"false"==(e=e.childNodes[t+(i<0?-1:0)]).contentEditable)return!1;t=i<0?z9(e):0}}}function z9(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function z4(e){let t;for(let n=e;n&&!(t=n.pmViewDesc);n=n.parentNode);return t&&t.node&&t.node.isBlock&&(t.dom==e||t.contentDOM==e)}let z7=function(e){return e.focusNode&&z6(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)};function z8(e,t){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=e,n.key=n.code=t,n}let Ye="u">typeof navigator?navigator:null,Yt="u">typeof document?document:null,Yn=Ye&&Ye.userAgent||"",Yr=/Edge\/(\d+)/.exec(Yn),Yi=/MSIE \d/.exec(Yn),Yo=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Yn),Ya=!!(Yi||Yo||Yr),Yu=Yi?document.documentMode:Yo?+Yo[1]:Yr?+Yr[1]:0,Ys=!Ya&&/gecko\/(\d+)/i.test(Yn);Ys&&(/Firefox\/(\d+)/.exec(Yn)||[0,0])[1];let Yl=!Ya&&/Chrome\/(\d+)/.exec(Yn),Yc=!!Yl,Yd=Yl?+Yl[1]:0,Yf=!Ya&&!!Ye&&/Apple Computer/.test(Ye.vendor),Yp=Yf&&(/Mobile\/\w+/.test(Yn)||!!Ye&&Ye.maxTouchPoints>2),YA=Yp||!!Ye&&/Mac/.test(Ye.platform),Yh=!!Ye&&/Win/.test(Ye.platform),Ym=/Android \d/.test(Yn),Yg=!!Yt&&"webkitFontSmoothing"in Yt.documentElement.style,Yy=Yg?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function Yv(e){return e.editable?e.hasFocus():function(e){let t=e.domSelectionRange();if(!t.anchorNode)return!1;try{return e.dom.contains(3==t.anchorNode.nodeType?t.anchorNode.parentNode:t.anchorNode)&&(e.editable||e.dom.contains(3==t.focusNode.nodeType?t.focusNode.parentNode:t.focusNode))}catch{return!1}}(e)&&document.activeElement&&document.activeElement.contains(e.dom)}function Yx(e,t=!1){let n=e.state.selection;if(function(e,t){if(t instanceof zQ){let n=e.docView.descAt(t.from);n!=e.lastSelectedViewDesc&&(YI(e),n&&n.selectNode(),e.lastSelectedViewDesc=n)}else YI(e)}(e,n),Yv(e)){if(!t&&e.input.mouseDown&&e.input.mouseDown.allowDefault&&Yc){let t=e.domSelectionRange(),n=e.domObserver.currentSelection;if(t.anchorNode&&n.anchorNode&&z6(t.anchorNode,t.anchorOffset,n.anchorNode,n.anchorOffset)){e.input.mouseDown.delayedSelectionSync=!0,e.domObserver.setCurSelection();return}}if(e.domObserver.disconnectSelection(),e.cursorWrapper){let t,n,r,i;t=e.domSelection(),n=document.createRange(),(i="IMG"==(r=e.cursorWrapper.dom).nodeName)?n.setEnd(r.parentNode,z2(r)+1):n.setEnd(r,0),n.collapse(!1),t.removeAllRanges(),t.addRange(n),!i&&!e.state.selection.visible&&Ya&&Yu<=11&&(r.disabled=!0,r.disabled=!1)}else{let r,i,o,a,{anchor:u,head:s}=n,l,c;!Yb||n instanceof zN||(n.$from.parent.inlineContent||(l=YC(e,n.from)),n.empty||n.$from.parent.inlineContent||(c=YC(e,n.to))),e.docView.setSelection(u,s,e.root,t),Yb&&(l&&Yw(l),c&&Yw(c)),n.visible?e.dom.classList.remove("ProseMirror-hideselection"):(e.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&((r=e.dom.ownerDocument).removeEventListener("selectionchange",e.input.hideSelectionGuard),o=(i=e.domSelectionRange()).anchorNode,a=i.anchorOffset,r.addEventListener("selectionchange",e.input.hideSelectionGuard=()=>{(i.anchorNode!=o||i.anchorOffset!=a)&&(r.removeEventListener("selectionchange",e.input.hideSelectionGuard),setTimeout(()=>{(!Yv(e)||e.state.selection.visible)&&e.dom.classList.remove("ProseMirror-hideselection")},20))})))}e.domObserver.setCurSelection(),e.domObserver.connectSelection()}}let Yb=Yf||Yc&&Yd<63;function YC(e,t){let{node:n,offset:r}=e.docView.domFromPos(t,0),i=r<n.childNodes.length?n.childNodes[r]:null,o=r?n.childNodes[r-1]:null;if(Yf&&i&&"false"==i.contentEditable)return YS(i);if((!i||"false"==i.contentEditable)&&(!o||"false"==o.contentEditable)){if(i)return YS(i);if(o)return YS(o)}}function YS(e){return e.contentEditable="true",Yf&&e.draggable&&(e.draggable=!1,e.wasDraggable=!0),e}function Yw(e){e.contentEditable="false",e.wasDraggable&&(e.draggable=!0,e.wasDraggable=null)}function YI(e){e.lastSelectedViewDesc&&(e.lastSelectedViewDesc.parent&&e.lastSelectedViewDesc.deselectNode(),e.lastSelectedViewDesc=void 0)}function Y_(e,t,n,r){return e.someProp("createSelectionBetween",r=>r(e,t,n))||zN.between(t,n,r)}function YT(e,t){let{$anchor:n,$head:r}=e.selection,i=t>0?n.max(r):n.min(r),o=i.parent.inlineContent?i.depth?e.doc.resolve(t>0?i.after():i.before()):null:i;return o&&zB.findFrom(o,t)}function YO(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function YR(e,t,n){let r=e.state.selection;if(r instanceof zN){if(n.indexOf("s")>-1){let{$head:n}=r,i=n.textOffset?null:t<0?n.nodeBefore:n.nodeAfter;if(!i||i.isText||!i.isLeaf)return!1;let o=e.state.doc.resolve(n.pos+i.nodeSize*(t<0?-1:1));return YO(e,new zN(r.$anchor,o))}if(!r.empty)return!1;if(e.endOfTextblock(t>0?"forward":"backward")){let n=YT(e.state,t);return!!n&&n instanceof zQ&&YO(e,n)}if(!(YA&&n.indexOf("m")>-1)){let n=r.$head,i=n.textOffset?null:t<0?n.nodeBefore:n.nodeAfter,o;if(!i||i.isText)return!1;let a=t<0?n.pos-i.nodeSize:n.pos;return!!(i.isAtom||(o=e.docView.descAt(a))&&!o.contentDOM)&&(zQ.isSelectable(i)?YO(e,new zQ(t<0?e.state.doc.resolve(n.pos-i.nodeSize):n)):!!Yg&&YO(e,new zN(e.state.doc.resolve(t<0?a:a+i.nodeSize))))}}else{if(r instanceof zQ&&r.node.isInline)return YO(e,new zN(t>0?r.$to:r.$from));{let n=YT(e.state,t);return!!n&&YO(e,n)}}}function Yk(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function YE(e,t){let n=e.pmViewDesc;return n&&0==n.size&&(t<0||e.nextSibling||"BR"!=e.nodeName)}function YM(e,t){return t<0?function(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i,o,a=!1;for(Ys&&1==n.nodeType&&r<Yk(n)&&YE(n.childNodes[r],-1)&&(a=!0);;)if(r>0){if(1!=n.nodeType)break;{let e=n.childNodes[r-1];if(YE(e,-1))i=n,o=--r;else if(3==e.nodeType)r=(n=e).nodeValue.length;else break}}else{if(Yj(n))break;{let t=n.previousSibling;for(;t&&YE(t,-1);)i=n.parentNode,o=z2(t),t=t.previousSibling;if(t)r=Yk(n=t);else{if((n=n.parentNode)==e.dom)break;r=0}}}a?YF(e,n,r):i&&YF(e,i,o)}(e):function(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i=Yk(n),o,a;for(;;)if(r<i){if(1!=n.nodeType)break;if(YE(n.childNodes[r],1))o=n,a=++r;else break}else{if(Yj(n))break;{let t=n.nextSibling;for(;t&&YE(t,1);)o=t.parentNode,a=z2(t)+1,t=t.nextSibling;if(t)r=0,i=Yk(n=t);else{if((n=n.parentNode)==e.dom)break;r=i=0}}}o&&YF(e,o,a)}(e)}function Yj(e){let t=e.pmViewDesc;return t&&t.node&&t.node.isBlock}function YF(e,t,n){if(3!=t.nodeType){let e,r;(r=function(e,t){for(;e&&t==e.childNodes.length&&!z4(e);)t=z2(e)+1,e=e.parentNode;for(;e&&t<e.childNodes.length;){let n=e.childNodes[t];if(3==n.nodeType)return n;if(1==n.nodeType&&"false"==n.contentEditable)break;e=n,t=0}}(t,n))?(t=r,n=0):(e=function(e,t){for(;e&&!t&&!z4(e);)t=z2(e),e=e.parentNode;for(;e&&t;){let n=e.childNodes[t-1];if(3==n.nodeType)return n;if(1==n.nodeType&&"false"==n.contentEditable)break;t=(e=n).childNodes.length}}(t,n))&&(t=e,n=e.nodeValue.length)}let r=e.domSelection();if(z7(r)){let e=document.createRange();e.setEnd(t,n),e.setStart(t,n),r.removeAllRanges(),r.addRange(e)}else r.extend&&r.extend(t,n);e.domObserver.setCurSelection();let{state:i}=e;setTimeout(()=>{e.state==i&&Yx(e)},50)}function YU(e,t){let n=e.state.doc.resolve(t);if(!(Yc||Yh)&&n.parent.inlineContent){let r=e.coordsAtPos(t);if(t>n.start()){let n=e.coordsAtPos(t-1),i=(n.top+n.bottom)/2;if(i>r.top&&i<r.bottom&&Math.abs(n.left-r.left)>1)return n.left<r.left?"ltr":"rtl"}if(t<n.end()){let n=e.coordsAtPos(t+1),i=(n.top+n.bottom)/2;if(i>r.top&&i<r.bottom&&Math.abs(n.left-r.left)>1)return n.left>r.left?"ltr":"rtl"}}return"rtl"==getComputedStyle(e.dom).direction?"rtl":"ltr"}function YL(e,t,n){let r=e.state.selection;if(r instanceof zN&&!r.empty||n.indexOf("s")>-1||YA&&n.indexOf("m")>-1)return!1;let{$from:i,$to:o}=r;if(!i.parent.inlineContent||e.endOfTextblock(t<0?"up":"down")){let n=YT(e.state,t);if(n&&n instanceof zQ)return YO(e,n)}if(!i.parent.inlineContent){let n=t<0?i:o,a=r instanceof zz?zB.near(n,t):zB.findFrom(n,t);return!!a&&YO(e,a)}return!1}function YK(e,t){if(!(e.state.selection instanceof zN))return!0;let{$head:n,$anchor:r,empty:i}=e.state.selection;if(!n.sameParent(r))return!0;if(!i)return!1;if(e.endOfTextblock(t>0?"forward":"backward"))return!0;let o=!n.textOffset&&(t<0?n.nodeBefore:n.nodeAfter);if(o&&!o.isText){let r=e.state.tr;return t<0?r.delete(n.pos-o.nodeSize,n.pos):r.delete(n.pos,n.pos+o.nodeSize),e.dispatch(r),!0}return!1}function YB(e,t,n){e.domObserver.stop(),t.contentEditable=n,e.domObserver.start()}function YP(e,t){e.someProp("transformCopied",n=>{t=n(t,e)});let n=[],{content:r,openStart:i,openEnd:o}=t;for(;i>1&&o>1&&1==r.childCount&&1==r.firstChild.childCount;){i--,o--;let e=r.firstChild;n.push(e.type.name,e.attrs!=e.type.defaultAttrs?e.attrs:null),r=e.content}let a=e.someProp("clipboardSerializer")||zo.fromSchema(e.state.schema),u=YY(),s=u.createElement("div");s.appendChild(a.serializeFragment(r,{document:u}));let l=s.firstChild,c,d=0;for(;l&&1==l.nodeType&&(c=YV[l.nodeName.toLowerCase()]);){for(let e=c.length-1;e>=0;e--){let t=u.createElement(c[e]);for(;s.firstChild;)t.appendChild(s.firstChild);s.appendChild(t),d++}l=s.firstChild}return l&&1==l.nodeType&&l.setAttribute("data-pm-slice",`${i} ${o}${d?` -${d}`:""} ${JSON.stringify(n)}`),{dom:s,text:e.someProp("clipboardTextSerializer",n=>n(t,e))||t.content.textBetween(0,t.content.size,`
|
|
11
|
-
|
|
12
|
-
`)}}function YW(e,t,n,r,i){let o=i.parent.type.spec.code,a,u;if(!n&&!t)return null;let s=t&&(r||o||!n);if(s){if(e.someProp("transformPastedText",n=>{t=n(t,o||r,e)}),o)return t?new VM(V_.from(e.state.schema.text(t.replace(/\r\n?/g,`
|
|
13
|
-
`))),0,0):VM.empty;let n=e.someProp("clipboardTextParser",n=>n(t,i,r,e));if(n)u=n;else{let n=i.marks(),{schema:r}=e.state,o=zo.fromSchema(r);a=document.createElement("div"),t.split(/(?:\r\n?|\n)+/).forEach(e=>{let t=a.appendChild(document.createElement("p"));e&&t.appendChild(o.serializeNode(r.text(e,n)))})}}else e.someProp("transformPastedHTML",t=>{n=t(n,e)}),a=function(e){let t=/^(\s*<meta [^>]*>)*/.exec(e);t&&(e=e.slice(t[0].length));let n=YY().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(e),i;if((i=r&&YV[r[1].toLowerCase()])&&(e=i.map(e=>"<"+e+">").join("")+e+i.map(e=>"</"+e+">").reverse().join("")),n.innerHTML=e,i)for(let e=0;e<i.length;e++)n=n.querySelector(i[e])||n;return n}(n),Yg&&function(e){let t=e.querySelectorAll(Yc?"span:not([class]):not([style])":"span.Apple-converted-space");for(let n=0;n<t.length;n++){let r=t[n];1==r.childNodes.length&&"\xa0"==r.textContent&&r.parentNode&&r.parentNode.replaceChild(e.ownerDocument.createTextNode(" "),r)}}(a);let l=a&&a.querySelector("[data-pm-slice]"),c=l&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(l.getAttribute("data-pm-slice")||"");if(c&&c[3])for(let e=+c[3];e>0;e--){let e=a.firstChild;for(;e&&1!=e.nodeType;)e=e.nextSibling;if(!e)break;a=e}if(u||(u=(e.someProp("clipboardParser")||e.someProp("domParser")||V4.fromSchema(e.state.schema)).parseSlice(a,{preserveWhitespace:!!(s||c),context:i,ruleFromNode:e=>"BR"!=e.nodeName||e.nextSibling||!e.parentNode||YD.test(e.parentNode.nodeName)?null:{ignore:!0}})),c)u=function(e,t){if(!e.size)return e;let n=e.content.firstChild.type.schema,r;try{r=JSON.parse(t)}catch{return e}let{content:i,openStart:o,openEnd:a}=e;for(let e=r.length-2;e>=0;e-=2){let t=n.nodes[r[e]];if(!t||t.hasRequiredAttrs())break;i=V_.from(t.create(r[e+1],i)),o++,a++}return new VM(i,o,a)}(YQ(u,+c[1],+c[2]),c[4]);else if((u=VM.maxOpen(function(e,t){if(e.childCount<2)return e;for(let n=t.depth;n>=0;n--){let r=t.node(n).contentMatchAt(t.index(n)),i,o=[];if(e.forEach(e=>{if(!o)return;let t=r.findWrapping(e.type),n;if(!t)return o=null;if(n=o.length&&i.length&&function e(t,n,r,i,o){if(o<t.length&&o<n.length&&t[o]==n[o]){let a=e(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(V_.from(YN(r,t,o+1))))}}(t,i,e,o[o.length-1],0))o[o.length-1]=n;else{o.length&&(o[o.length-1]=function e(t,n){if(0==n)return t;let r=t.content.replaceChild(t.childCount-1,e(t.lastChild,n-1)),i=t.contentMatchAt(t.childCount).fillBefore(V_.empty,!0);return t.copy(r.append(i))}(o[o.length-1],i.length));let n=YN(e,t);o.push(n),r=r.matchType(n.type),i=t}}),o)return V_.from(o)}return e}(u.content,i),!0)).openStart||u.openEnd){let e=0,t=0;for(let t=u.content.firstChild;e<u.openStart&&!t.type.spec.isolating;e++,t=t.firstChild);for(let e=u.content.lastChild;t<u.openEnd&&!e.type.spec.isolating;t++,e=e.lastChild);u=YQ(u,e,t)}return e.someProp("transformPasted",t=>{u=t(u,e)}),u}let YD=/^(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 YN(e,t,n=0){for(let r=t.length-1;r>=n;r--)e=t[r].create(null,V_.from(e));return e}function Yq(e,t,n,r,i,o){let a=t<0?e.firstChild:e.lastChild,u=a.content;return e.childCount>1&&(o=0),i<r-1&&(u=Yq(u,t,n,r,i+1,o)),i>=n&&(u=t<0?a.contentMatchAt(0).fillBefore(u,o<=i).append(u):u.append(a.contentMatchAt(a.childCount).fillBefore(V_.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,a.copy(u))}function YQ(e,t,n){return t<e.openStart&&(e=new VM(Yq(e.content,-1,t,e.openStart,0,e.openEnd),t,e.openEnd)),n<e.openEnd&&(e=new VM(Yq(e.content,1,n,e.openEnd,0,0),e.openStart,n)),e}let YV={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]},Yz=null;function YY(){return Yz||(Yz=document.implementation.createHTMLDocument("title"))}let YH={},YG={};function YZ(e,t){e.input.lastSelectionOrigin=t,e.input.lastSelectionTime=Date.now()}function YJ(e){return{left:e.clientX,top:e.clientY}}function Y$(e,t,n,r,i){if(-1==r)return!1;let o=e.state.doc.resolve(r);for(let r=o.depth+1;r>0;r--)if(e.someProp(t,t=>r>o.depth?t(e,n,o.nodeAfter,o.before(r),i,!0):t(e,n,o.node(r),o.before(r),i,!1)))return!0;return!1}function YX(e,t,n){e.focused||e.focus();let r=e.state.tr.setSelection(t);"pointer"==n&&r.setMeta("pointer",!0),e.dispatch(r)}YG.keydown=(e,t)=>{if(e.input.shiftKey=16==t.keyCode||t.shiftKey,!Y2(e,t)&&(e.input.lastKeyCode=t.keyCode,e.input.lastKeyCodeTime=Date.now(),!(Ym&&Yc&&13==t.keyCode))){if(229!=t.keyCode&&e.domObserver.forceFlush(),!Yp||13!=t.keyCode||t.ctrlKey||t.altKey||t.metaKey)e.someProp("handleKeyDown",n=>n(e,t))||function(e,t){let n;let r=t.keyCode,i=(n="",t.ctrlKey&&(n+="c"),t.metaKey&&(n+="m"),t.altKey&&(n+="a"),t.shiftKey&&(n+="s"),n);if(8==r||YA&&72==r&&"c"==i)return YK(e,-1)||YM(e,-1);if(46==r&&!t.shiftKey||YA&&68==r&&"c"==i)return YK(e,1)||YM(e,1);if(13==r||27==r)return!0;if(37==r||YA&&66==r&&"c"==i){let t=37==r?"ltr"==YU(e,e.state.selection.from)?-1:1:-1;return YR(e,t,i)||YM(e,t)}if(39==r||YA&&70==r&&"c"==i){let t=39==r?"ltr"==YU(e,e.state.selection.from)?1:-1:1;return YR(e,t,i)||YM(e,t)}return 38==r||YA&&80==r&&"c"==i?YL(e,-1,i)||YM(e,-1):40==r||YA&&78==r&&"c"==i?function(e){if(!Yf||e.state.selection.$head.parentOffset>0)return!1;let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(t&&1==t.nodeType&&0==n&&t.firstChild&&"false"==t.firstChild.contentEditable){let n=t.firstChild;YB(e,n,"true"),setTimeout(()=>YB(e,n,"false"),20)}return!1}(e)||YL(e,1,i)||YM(e,1):i==(YA?"m":"c")&&(66==r||73==r||89==r||90==r)}(e,t)?t.preventDefault():YZ(e,"key");else{let t=Date.now();e.input.lastIOSEnter=t,e.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{e.input.lastIOSEnter==t&&(e.someProp("handleKeyDown",t=>t(e,z8(13,"Enter"))),e.input.lastIOSEnter=0)},200)}}},YG.keyup=(e,t)=>{16==t.keyCode&&(e.input.shiftKey=!1)},YG.keypress=(e,t)=>{if(Y2(e,t)||!t.charCode||t.ctrlKey&&!t.altKey||YA&&t.metaKey)return;if(e.someProp("handleKeyPress",n=>n(e,t))){t.preventDefault();return}let n=e.state.selection;if(!(n instanceof zN)||!n.$from.sameParent(n.$to)){let r=String.fromCharCode(t.charCode);/[\r\n]/.test(r)||e.someProp("handleTextInput",t=>t(e,n.$from.pos,n.$to.pos,r))||e.dispatch(e.state.tr.insertText(r).scrollIntoView()),t.preventDefault()}};let Y0=YA?"metaKey":"ctrlKey";YH.mousedown=(e,t)=>{var n;let r,i;e.input.shiftKey=t.shiftKey;let o=Y3(e),a=Date.now(),u="singleClick";a-e.input.lastClick.time<500&&(r=(n=e.input.lastClick).x-t.clientX)*r+(i=n.y-t.clientY)*i<100&&!t[Y0]&&("singleClick"==e.input.lastClick.type?u="doubleClick":"doubleClick"==e.input.lastClick.type&&(u="tripleClick")),e.input.lastClick={time:a,x:t.clientX,y:t.clientY,type:u};let s=e.posAtCoords(YJ(t));s&&("singleClick"==u?(e.input.mouseDown&&e.input.mouseDown.done(),e.input.mouseDown=new Y1(e,s,t,!!o)):("doubleClick"==u?function(e,t,n,r){return Y$(e,"handleDoubleClickOn",t,n,r)||e.someProp("handleDoubleClick",n=>n(e,t,r))}:function(e,t,n,r){return Y$(e,"handleTripleClickOn",t,n,r)||e.someProp("handleTripleClick",n=>n(e,t,r))||function(e,t,n){if(0!=n.button)return!1;let r=e.state.doc;if(-1==t)return!!r.inlineContent&&(YX(e,zN.create(r,0,r.content.size),"pointer"),!0);let i=r.resolve(t);for(let t=i.depth+1;t>0;t--){let n=t>i.depth?i.nodeAfter:i.node(t),o=i.before(t);if(n.inlineContent)YX(e,zN.create(r,o+1,o+1+n.content.size),"pointer");else{if(!zQ.isSelectable(n))continue;YX(e,zQ.create(r,o),"pointer")}return!0}}(e,n,r)})(e,s.pos,s.inside,t)?t.preventDefault():YZ(e,"pointer"))};class Y1{constructor(e,t,n,r){let i,o;if(this.view=e,this.pos=t,this.event=n,this.flushed=r,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!n[Y0],this.allowDefault=n.shiftKey,t.inside>-1)i=e.state.doc.nodeAt(t.inside),o=t.inside;else{let n=e.state.doc.resolve(t.pos);i=n.parent,o=n.depth?n.before():0}let a=r?null:n.target,u=a?e.docView.nearestDesc(a,!0):null;this.target=u?u.dom:null;let{selection:s}=e.state;(0==n.button&&i.type.spec.draggable&&!1!==i.type.spec.selectable||s instanceof zQ&&s.from<=o&&s.to>o)&&(this.mightDrag={node:i,pos:o,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&Ys&&!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()),e.root.addEventListener("mouseup",this.up=this.up.bind(this)),e.root.addEventListener("mousemove",this.move=this.move.bind(this)),YZ(e,"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(()=>Yx(this.view)),this.view.input.mouseDown=null}up(e){var t,n,r,i;if(this.done(),!this.view.dom.contains(e.target))return;let o=this.pos;this.view.state.doc!=this.startDoc&&(o=this.view.posAtCoords(YJ(e))),this.updateAllowDefault(e),this.allowDefault||!o?YZ(this.view,"pointer"):(t=this.view,n=o.pos,r=o.inside,i=this.selectNode,Y$(t,"handleClickOn",n,r,e)||t.someProp("handleClick",r=>r(t,n,e))||(i?function(e,t){if(-1==t)return!1;let n=e.state.selection,r,i;n instanceof zQ&&(r=n.node);let o=e.state.doc.resolve(t);for(let e=o.depth+1;e>0;e--){let t=e>o.depth?o.nodeAfter:o.node(e);if(zQ.isSelectable(t)){i=r&&n.$from.depth>0&&e>=n.$from.depth&&o.before(n.$from.depth+1)==n.$from.pos?o.before(n.$from.depth):o.before(e);break}}return null!=i&&(YX(e,zQ.create(e.state.doc,i),"pointer"),!0)}(t,r):function(e,t){if(-1==t)return!1;let n=e.state.doc.resolve(t),r=n.nodeAfter;return!!(r&&r.isAtom&&zQ.isSelectable(r))&&(YX(e,new zQ(n),"pointer"),!0)}(t,r)))?e.preventDefault():0==e.button&&(this.flushed||Yf&&this.mightDrag&&!this.mightDrag.node.isAtom||Yc&&!this.view.state.selection.visible&&2>=Math.min(Math.abs(o.pos-this.view.state.selection.from),Math.abs(o.pos-this.view.state.selection.to)))?(YX(this.view,zB.near(this.view.state.doc.resolve(o.pos)),"pointer"),e.preventDefault()):YZ(this.view,"pointer")}move(e){this.updateAllowDefault(e),YZ(this.view,"pointer"),0==e.buttons&&this.done()}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}}function Y2(e,t){return!!e.composing||!!(Yf&&500>Math.abs(t.timeStamp-e.input.compositionEndedAt))&&(e.input.compositionEndedAt=-2e8,!0)}YH.touchstart=e=>{e.input.lastTouch=Date.now(),Y3(e),YZ(e,"pointer")},YH.touchmove=e=>{e.input.lastTouch=Date.now(),YZ(e,"pointer")},YH.contextmenu=e=>Y3(e);let Y6=Ym?5e3:-1;function Y5(e,t){clearTimeout(e.input.composingTimeout),t>-1&&(e.input.composingTimeout=setTimeout(()=>Y3(e),t))}function Y3(e,t=!1){if(!(Ym&&e.domObserver.flushingSoon>=0)){if(e.domObserver.forceFlush(),function(e){let t;for(e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=((t=document.createEvent("Event")).initEvent("event",!0,!0),t.timeStamp));e.input.compositionNodes.length>0;)e.input.compositionNodes.pop().markParentsDirty()}(e),t||e.docView&&e.docView.dirty){let t=function(e,t=null){let n=e.domSelectionRange(),r=e.state.doc;if(!n.focusNode)return null;let i=e.docView.nearestDesc(n.focusNode),o=i&&0==i.size,a=e.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(a<0)return null;let u=r.resolve(a),s,l;if(z7(n)){for(s=u;i&&!i.node;)i=i.parent;let e=i.node;if(i&&e.isAtom&&zQ.isSelectable(e)&&i.parent&&!(e.isInline&&function(e,t,n){for(let r=0==t,i=t==z9(e);r||i;){if(e==n)return!0;let t=z2(e);if(!(e=e.parentNode))return!1;r=r&&0==t,i=i&&t==z9(e)}}(n.focusNode,n.focusOffset,i.dom))){let e=i.posBefore;l=new zQ(a==e?u:r.resolve(e))}}else{let t=e.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(t<0)return null;s=r.resolve(t)}if(!l){let n="pointer"==t||e.state.selection.head<u.pos&&!o?1:-1;l=Y_(e,s,u,n)}return l}(e);return t&&!t.eq(e.state.selection)?e.dispatch(e.state.tr.setSelection(t)):e.updateState(e.state),!0}return!1}}YG.compositionstart=YG.compositionupdate=e=>{if(!e.composing){e.domObserver.flush();let{state:t}=e,n=t.selection.$from;if(t.selection.empty&&(t.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(e=>!1===e.type.spec.inclusive)))e.markCursor=e.state.storedMarks||n.marks(),Y3(e,!0),e.markCursor=null;else if(Y3(e),Ys&&t.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let t=e.domSelectionRange();for(let n=t.focusNode,r=t.focusOffset;n&&1==n.nodeType&&0!=r;){let t=r<0?n.lastChild:n.childNodes[r-1];if(!t)break;if(3==t.nodeType){e.domSelection().collapse(t,t.nodeValue.length);break}n=t,r=-1}}e.input.composing=!0}Y5(e,Y6)},YG.compositionend=(e,t)=>{e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=t.timeStamp,e.input.compositionPendingChanges=e.domObserver.pendingRecords().length?e.input.compositionID:0,e.input.compositionPendingChanges&&Promise.resolve().then(()=>e.domObserver.flush()),e.input.compositionID++,Y5(e,20))};let Y9=Ya&&Yu<15||Yp&&Yy<604;function Y4(e,t,n,r,i){let o=YW(e,t,n,r,e.state.selection.$from);if(e.someProp("handlePaste",t=>t(e,i,o||VM.empty)))return!0;if(!o)return!1;let a=0==o.openStart&&0==o.openEnd&&1==o.content.childCount?o.content.firstChild:null,u=a?e.state.tr.replaceSelectionWith(a,r):e.state.tr.replaceSelection(o);return e.dispatch(u.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function Y7(e){let t=e.getData("text/plain")||e.getData("Text");if(t)return t;let n=e.getData("text/uri-list");return n?n.replace(/\r?\n/g," "):""}YH.copy=YG.cut=(e,t)=>{let n=e.state.selection,r="cut"==t.type;if(n.empty)return;let i=Y9?null:t.clipboardData,{dom:o,text:a}=YP(e,n.content());i?(t.preventDefault(),i.clearData(),i.setData("text/html",o.innerHTML),i.setData("text/plain",a)):function(e,t){if(!e.dom.parentNode)return;let n=e.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(t),n.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),i=document.createRange();i.selectNodeContents(t),e.dom.blur(),r.removeAllRanges(),r.addRange(i),setTimeout(()=>{n.parentNode&&n.parentNode.removeChild(n),e.focus()},50)}(e,o),r&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))},YG.paste=(e,t)=>{if(e.composing&&!Ym)return;let n=Y9?null:t.clipboardData,r=e.input.shiftKey&&45!=e.input.lastKeyCode;n&&Y4(e,Y7(n),n.getData("text/html"),r,t)?t.preventDefault():function(e,t){if(!e.dom.parentNode)return;let n=e.input.shiftKey||e.state.selection.$from.parent.type.spec.code,r=e.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus();let i=e.input.shiftKey&&45!=e.input.lastKeyCode;setTimeout(()=>{e.focus(),r.parentNode&&r.parentNode.removeChild(r),n?Y4(e,r.value,null,i,t):Y4(e,r.textContent,r.innerHTML,i,t)},50)}(e,t)};class Y8{constructor(e,t,n){this.slice=e,this.move=t,this.node=n}}let He=YA?"altKey":"ctrlKey";for(let e in YH.dragstart=(e,t)=>{let n=e.input.mouseDown;if(n&&n.done(),!t.dataTransfer)return;let r=e.state.selection,i=r.empty?null:e.posAtCoords(YJ(t)),o;if(!(i&&i.pos>=r.from&&i.pos<=(r instanceof zQ?r.to-1:r.to))){if(n&&n.mightDrag)o=zQ.create(e.state.doc,n.mightDrag.pos);else if(t.target&&1==t.target.nodeType){let n=e.docView.nearestDesc(t.target,!0);n&&n.node.type.spec.draggable&&n!=e.docView&&(o=zQ.create(e.state.doc,n.posBefore))}}let a=(o||e.state.selection).content(),{dom:u,text:s}=YP(e,a);t.dataTransfer.clearData(),t.dataTransfer.setData(Y9?"Text":"text/html",u.innerHTML),t.dataTransfer.effectAllowed="copyMove",Y9||t.dataTransfer.setData("text/plain",s),e.dragging=new Y8(a,!t[He],o)},YH.dragend=e=>{let t=e.dragging;window.setTimeout(()=>{e.dragging==t&&(e.dragging=null)},50)},YG.dragover=YG.dragenter=(e,t)=>t.preventDefault(),YG.drop=(e,t)=>{let n=e.dragging;if(e.dragging=null,!t.dataTransfer)return;let r=e.posAtCoords(YJ(t));if(!r)return;let i=e.state.doc.resolve(r.pos),o=n&&n.slice;o?e.someProp("transformPasted",t=>{o=t(o,e)}):o=YW(e,Y7(t.dataTransfer),Y9?null:t.dataTransfer.getData("text/html"),!1,i);let a=!!(n&&!t[He]);if(e.someProp("handleDrop",n=>n(e,t,o||VM.empty,a))){t.preventDefault();return}if(!o)return;t.preventDefault();let u=o?function(e,t,n){let r=e.resolve(t);if(!n.content.size)return t;let i=n.content;for(let e=0;e<n.openStart;e++)i=i.firstChild.content;for(let e=1;e<=(0==n.openStart&&n.size?2:1);e++)for(let t=r.depth;t>=0;t--){let n=t==r.depth?0:r.pos<=(r.start(t+1)+r.end(t+1))/2?-1:1,o=r.index(t)+(n>0?1:0),a=r.node(t),u=!1;if(1==e)u=a.canReplace(o,o,i);else{let e=a.contentMatchAt(o).findWrapping(i.firstChild.type);u=e&&a.canReplaceWith(o,o,e[0])}if(u)return 0==n?r.pos:n<0?r.before(t+1):r.after(t+1)}return null}(e.state.doc,i.pos,o):i.pos;null==u&&(u=i.pos);let s=e.state.tr;if(a){let{node:e}=n;e?e.replace(s):s.deleteSelection()}let l=s.mapping.map(u),c=0==o.openStart&&0==o.openEnd&&1==o.content.childCount,d=s.doc;if(c?s.replaceRangeWith(l,l,o.content.firstChild):s.replaceRange(l,l,o),s.doc.eq(d))return;let f=s.doc.resolve(l);if(c&&zQ.isSelectable(o.content.firstChild)&&f.nodeAfter&&f.nodeAfter.sameMarkup(o.content.firstChild))s.setSelection(new zQ(f));else{let t=s.mapping.map(u);s.mapping.maps[s.mapping.maps.length-1].forEach((e,n,r,i)=>t=i),s.setSelection(Y_(e,f,s.doc.resolve(t)))}e.focus(),e.dispatch(s.setMeta("uiEvent","drop"))},YH.focus=e=>{e.input.lastFocus=Date.now(),e.focused||(e.domObserver.stop(),e.dom.classList.add("ProseMirror-focused"),e.domObserver.start(),e.focused=!0,setTimeout(()=>{e.docView&&e.hasFocus()&&!e.domObserver.currentSelection.eq(e.domSelectionRange())&&Yx(e)},20))},YH.blur=(e,t)=>{e.focused&&(e.domObserver.stop(),e.dom.classList.remove("ProseMirror-focused"),e.domObserver.start(),t.relatedTarget&&e.dom.contains(t.relatedTarget)&&e.domObserver.currentSelection.clear(),e.focused=!1)},YH.beforeinput=(e,t)=>{if(Yc&&Ym&&"deleteContentBackward"==t.inputType){e.domObserver.flushSoon();let{domChangeCount:t}=e.input;setTimeout(()=>{if(e.input.domChangeCount!=t||(e.dom.blur(),e.focus(),e.someProp("handleKeyDown",t=>t(e,z8(8,"Backspace")))))return;let{$cursor:n}=e.state.selection;n&&n.pos>0&&e.dispatch(e.state.tr.delete(n.pos-1,n.pos).scrollIntoView())},50)}},YG)YH[e]=YG[e];function Ht(e,t){if(e==t)return!0;for(let n in e)if(e[n]!==t[n])return!1;for(let n in t)if(!(n in e))return!1;return!0}class Hn{constructor(e,t){this.toDOM=e,this.spec=t||Hu,this.side=this.spec.side||0}map(e,t,n,r){let{pos:i,deleted:o}=e.mapResult(t.from+r,this.side<0?-1:1);return o?null:new Ho(i-n,i-n,this)}valid(){return!0}eq(e){return this==e||e instanceof Hn&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&Ht(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class Hr{constructor(e,t){this.attrs=e,this.spec=t||Hu}map(e,t,n,r){let i=e.map(t.from+r,this.spec.inclusiveStart?-1:1)-n,o=e.map(t.to+r,this.spec.inclusiveEnd?1:-1)-n;return i>=o?null:new Ho(i,o,this)}valid(e,t){return t.from<t.to}eq(e){return this==e||e instanceof Hr&&Ht(this.attrs,e.attrs)&&Ht(this.spec,e.spec)}static is(e){return e.type instanceof Hr}destroy(){}}let Hi=class e{constructor(e,t){this.attrs=e,this.spec=t||Hu}map(e,t,n,r){let i=e.mapResult(t.from+r,1);if(i.deleted)return null;let o=e.mapResult(t.to+r,-1);return o.deleted||o.pos<=i.pos?null:new Ho(i.pos-n,o.pos-n,this)}valid(e,t){let{index:n,offset:r}=e.content.findIndex(t.from),i;return r==t.from&&!(i=e.child(n)).isText&&r+i.nodeSize==t.to}eq(t){return this==t||t instanceof e&&Ht(this.attrs,t.attrs)&&Ht(this.spec,t.spec)}destroy(){}};class Ho{constructor(e,t,n){this.from=e,this.to=t,this.type=n}copy(e,t){return new Ho(e,t,this.type)}eq(e,t=0){return this.type.eq(e.type)&&this.from+t==e.from&&this.to+t==e.to}map(e,t,n){return this.type.map(e,this,t,n)}static widget(e,t,n){return new Ho(e,e,new Hn(t,n))}static inline(e,t,n,r){return new Ho(e,t,new Hr(n,r))}static node(e,t,n,r){return new Ho(e,t,new Hi(n,r))}get spec(){return this.type.spec}get inline(){return this.type instanceof Hr}get widget(){return this.type instanceof Hn}}let Ha=[],Hu={};class Hs{constructor(e,t){this.local=e.length?e:Ha,this.children=t.length?t:Ha}static create(e,t){return t.length?HA(t,e,0,Hu):Hl}find(e,t,n){let r=[];return this.findInner(e??0,t??1e9,r,0,n),r}findInner(e,t,n,r,i){for(let o=0;o<this.local.length;o++){let a=this.local[o];a.from<=t&&a.to>=e&&(!i||i(a.spec))&&n.push(a.copy(a.from+r,a.to+r))}for(let o=0;o<this.children.length;o+=3)if(this.children[o]<t&&this.children[o+1]>e){let a=this.children[o]+1;this.children[o+2].findInner(e-a,t-a,n,r+a,i)}}map(e,t,n){return this==Hl||0==e.maps.length?this:this.mapInner(e,t,0,0,n||Hu)}mapInner(e,t,n,r,i){let o;for(let a=0;a<this.local.length;a++){let u=this.local[a].map(e,n,r);u&&u.type.valid(t,u)?(o||(o=[])).push(u):i.onRemove&&i.onRemove(this.local[a].spec)}return this.children.length?function(e,t,n,r,i,o,a){let u=e.slice();for(let e=0,t=o;e<n.maps.length;e++){let r=0;n.maps[e].forEach((e,n,i,o)=>{let a=o-i-(n-e);for(let i=0;i<u.length;i+=3){let o=u[i+1];if(o<0||e>o+t-r)continue;let s=u[i]+t-r;n>=s?u[i+1]=e<=s?-2:-1:e>=t&&a&&(u[i]+=a,u[i+1]+=a)}r+=a}),t=n.maps[e].map(t,-1)}let s=!1;for(let t=0;t<u.length;t+=3)if(u[t+1]<0){if(-2==u[t+1]){s=!0,u[t+1]=-1;continue}let l=n.map(e[t]+o),c=l-i;if(c<0||c>=r.content.size){s=!0;continue}let d=n.map(e[t+1]+o,-1)-i,{index:f,offset:p}=r.content.findIndex(c),A=r.maybeChild(f);if(A&&p==c&&p+A.nodeSize==d){let r=u[t+2].mapInner(n,A,l+1,e[t]+o+1,a);r!=Hl?(u[t]=c,u[t+1]=d,u[t+2]=r):(u[t+1]=-2,s=!0)}else s=!0}if(s){let s=HA(function(e,t,n,r,i,o,a){for(let u=0;u<e.length;u+=3)-1==e[u+1]&&function e(t,o){for(let e=0;e<t.local.length;e++){let u=t.local[e].map(r,i,o);u?n.push(u):a.onRemove&&a.onRemove(t.local[e].spec)}for(let n=0;n<t.children.length;n+=3)e(t.children[n+2],t.children[n]+o+1)}(e[u+2],t[u]+o+1);return n}(u,e,t,n,i,o,a),r,0,a);t=s.local;for(let e=0;e<u.length;e+=3)u[e+1]<0&&(u.splice(e,3),e-=3);for(let e=0,t=0;e<s.children.length;e+=3){let n=s.children[e];for(;t<u.length&&u[t]<n;)t+=3;u.splice(t,0,s.children[e],s.children[e+1],s.children[e+2])}}return new Hs(t.sort(Hh),u)}(this.children,o||[],e,t,n,r,i):o?new Hs(o.sort(Hh),Ha):Hl}add(e,t){return t.length?this==Hl?Hs.create(e,t):this.addInner(e,t,0):this}addInner(e,t,n){let r,i=0;e.forEach((e,o)=>{let a=o+n,u;if(u=Hf(t,e,a)){for(r||(r=this.children.slice());i<r.length&&r[i]<o;)i+=3;r[i]==o?r[i+2]=r[i+2].addInner(e,u,a+1):r.splice(i,0,o,o+e.nodeSize,HA(u,e,a+1,Hu)),i+=3}});let o=Hd(i?Hp(t):t,-n);for(let t=0;t<o.length;t++)o[t].type.valid(e,o[t])||o.splice(t--,1);return new Hs(o.length?this.local.concat(o).sort(Hh):this.local,r||this.children)}remove(e){return 0==e.length||this==Hl?this:this.removeInner(e,0)}removeInner(e,t){let n=this.children,r=this.local;for(let r=0;r<n.length;r+=3){let i,o=n[r]+t,a=n[r+1]+t;for(let t=0,n;t<e.length;t++)(n=e[t])&&n.from>o&&n.to<a&&(e[t]=null,(i||(i=[])).push(n));if(!i)continue;n==this.children&&(n=this.children.slice());let u=n[r+2].removeInner(i,o+1);u!=Hl?n[r+2]=u:(n.splice(r,3),r-=3)}if(r.length){for(let n=0,i;n<e.length;n++)if(i=e[n])for(let e=0;e<r.length;e++)r[e].eq(i,t)&&(r==this.local&&(r=this.local.slice()),r.splice(e--,1))}return n==this.children&&r==this.local?this:r.length||n.length?new Hs(r,n):Hl}forChild(e,t){let n,r;if(this==Hl)return this;if(t.isLeaf)return Hs.empty;for(let t=0;t<this.children.length;t+=3)if(this.children[t]>=e){this.children[t]==e&&(n=this.children[t+2]);break}let i=e+1,o=i+t.content.size;for(let e=0;e<this.local.length;e++){let t=this.local[e];if(t.from<o&&t.to>i&&t.type instanceof Hr){let e=Math.max(i,t.from)-i,n=Math.min(o,t.to)-i;e<n&&(r||(r=[])).push(t.copy(e,n))}}if(r){let e=new Hs(r.sort(Hh),Ha);return n?new Hc([e,n]):e}return n||Hl}eq(e){if(this==e)return!0;if(!(e instanceof Hs)||this.local.length!=e.local.length||this.children.length!=e.children.length)return!1;for(let t=0;t<this.local.length;t++)if(!this.local[t].eq(e.local[t]))return!1;for(let t=0;t<this.children.length;t+=3)if(this.children[t]!=e.children[t]||this.children[t+1]!=e.children[t+1]||!this.children[t+2].eq(e.children[t+2]))return!1;return!0}locals(e){return Hm(this.localsInner(e))}localsInner(e){if(this==Hl)return Ha;if(e.inlineContent||!this.local.some(Hr.is))return this.local;let t=[];for(let e=0;e<this.local.length;e++)this.local[e].type instanceof Hr||t.push(this.local[e]);return t}}Hs.empty=new Hs([],[]),Hs.removeOverlap=Hm;let Hl=Hs.empty;class Hc{constructor(e){this.members=e}map(e,t){let n=this.members.map(n=>n.map(e,t,Hu));return Hc.from(n)}forChild(e,t){if(t.isLeaf)return Hs.empty;let n=[];for(let r=0;r<this.members.length;r++){let i=this.members[r].forChild(e,t);i!=Hl&&(i instanceof Hc?n=n.concat(i.members):n.push(i))}return Hc.from(n)}eq(e){if(!(e instanceof Hc)||e.members.length!=this.members.length)return!1;for(let t=0;t<this.members.length;t++)if(!this.members[t].eq(e.members[t]))return!1;return!0}locals(e){let t,n=!0;for(let r=0;r<this.members.length;r++){let i=this.members[r].localsInner(e);if(i.length){if(t){n&&(t=t.slice(),n=!1);for(let e=0;e<i.length;e++)t.push(i[e])}else t=i}}return t?Hm(n?t:t.sort(Hh)):Ha}static from(e){switch(e.length){case 0:return Hl;case 1:return e[0];default:return new Hc(e.every(e=>e instanceof Hs)?e:e.reduce((e,t)=>e.concat(t instanceof Hs?t:t.members),[]))}}}function Hd(e,t){if(!t||!e.length)return e;let n=[];for(let r=0;r<e.length;r++){let i=e[r];n.push(new Ho(i.from+t,i.to+t,i.type))}return n}function Hf(e,t,n){if(t.isLeaf)return null;let r=n+t.nodeSize,i=null;for(let t=0,o;t<e.length;t++)(o=e[t])&&o.from>n&&o.to<r&&((i||(i=[])).push(o),e[t]=null);return i}function Hp(e){let t=[];for(let n=0;n<e.length;n++)null!=e[n]&&t.push(e[n]);return t}function HA(e,t,n,r){let i=[],o=!1;t.forEach((t,a)=>{let u=Hf(e,t,a+n);if(u){o=!0;let e=HA(u,t,n+a+1,r);e!=Hl&&i.push(a,a+t.nodeSize,e)}});let a=Hd(o?Hp(e):e,-n).sort(Hh);for(let e=0;e<a.length;e++)a[e].type.valid(t,a[e])||(r.onRemove&&r.onRemove(a[e].spec),a.splice(e--,1));return a.length||i.length?new Hs(a,i):Hl}function Hh(e,t){return e.from-t.from||e.to-t.to}function Hm(e){let t=e;for(let n=0;n<t.length-1;n++){let r=t[n];if(r.from!=r.to)for(let i=n+1;i<t.length;i++){let o=t[i];if(o.from==r.from){o.to!=r.to&&(t==e&&(t=e.slice()),t[i]=o.copy(o.from,r.to),Hg(t,i+1,o.copy(r.to,o.to)));continue}o.from<r.to&&(t==e&&(t=e.slice()),t[n]=r.copy(r.from,o.from),Hg(t,i,r.copy(o.from,r.to)));break}}return t}function Hg(e,t,n){for(;t<e.length&&Hh(n,e[t])>0;)t++;e.splice(t,0,n)}for(var Hy={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:"'"},Hv={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},Hx="u">typeof navigator&&/Mac/.test(navigator.platform),Hb="u">typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),HC=0;HC<10;HC++)Hy[48+HC]=Hy[96+HC]=String(HC);for(var HC=1;HC<=24;HC++)Hy[HC+111]="F"+HC;for(var HC=65;HC<=90;HC++)Hy[HC]=String.fromCharCode(HC+32),Hv[HC]=String.fromCharCode(HC);for(var HS in Hy)Hv.hasOwnProperty(HS)||(Hv[HS]=Hy[HS]);let Hw="u">typeof navigator&&/Mac|iP(hone|[oa]d)/.test(navigator.platform);function HI(e,t,n=!0){return t.altKey&&(e="Alt-"+e),t.ctrlKey&&(e="Ctrl-"+e),t.metaKey&&(e="Meta-"+e),n&&t.shiftKey&&(e="Shift-"+e),e}class H_{constructor(e,t,n){this.pos=e,this.delInfo=t,this.recover=n}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 HT{constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&HT.empty)return HT.empty}recover(e){let t=0,n=65535&e;if(!this.inverted)for(let e=0;e<n;e++)t+=this.ranges[3*e+2]-this.ranges[3*e+1];return this.ranges[3*n]+t+(e-(65535&e))/65536}mapResult(e,t=1){return this._map(e,t,!1)}map(e,t=1){return this._map(e,t,!0)}_map(e,t,n){let r=0,i=this.inverted?2:1,o=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let u=this.ranges[a]-(this.inverted?r:0);if(u>e)break;let s=this.ranges[a+i],l=this.ranges[a+o],c=u+s;if(e<=c){let i=s?e==u?-1:e==c?1:t:t,o=u+r+(i<0?0:l);if(n)return o;let d=e==(t<0?u:c)?null:a/3+(e-u)*65536,f=e==u?2:e==c?1:4;return(t<0?e!=u:e!=c)&&(f|=8),new H_(o,f,d)}r+=l-s}return n?e+r:new H_(e+r,0,null)}touches(e,t){let n=0,r=65535&t,i=this.inverted?2:1,o=this.inverted?1:2;for(let t=0;t<this.ranges.length;t+=3){let a=this.ranges[t]-(this.inverted?n:0);if(a>e)break;let u=this.ranges[t+i];if(e<=a+u&&t==3*r)return!0;n+=this.ranges[t+o]-u}return!1}forEach(e){let t=this.inverted?2:1,n=this.inverted?1:2;for(let r=0,i=0;r<this.ranges.length;r+=3){let o=this.ranges[r],a=o-(this.inverted?i:0),u=o+(this.inverted?0:i),s=this.ranges[r+t],l=this.ranges[r+n];e(a,a+s,u,u+l),i+=l-s}}invert(){return new HT(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return 0==e?HT.empty:new HT(e<0?[0,-e,0]:[0,0,e])}}HT.empty=new HT([]);let HO=Object.create(null);class HR{getMap(){return HT.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw RangeError("Invalid input for Step.fromJSON");let n=HO[t.stepType];if(!n)throw RangeError(`No step type ${t.stepType} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in HO)throw RangeError("Duplicate use of step JSON ID "+e);return HO[e]=t,t.prototype.jsonID=e,t}}class Hk{constructor(e,t){this.doc=e,this.failed=t}static ok(e){return new Hk(e,null)}static fail(e){return new Hk(null,e)}static fromReplace(e,t,n,r){try{return Hk.ok(e.replace(t,n,r))}catch(e){if(e instanceof VE)return Hk.fail(e.message);throw e}}}function HE(e,t,n){let r=[];for(let i=0;i<e.childCount;i++){let o=e.child(i);o.content.size&&(o=o.copy(HE(o.content,t,o))),o.isInline&&(o=t(o,n,i)),r.push(o)}return V_.fromArray(r)}class HM extends HR{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=e.resolve(this.from),r=n.node(n.sharedDepth(this.to)),i=new VM(HE(t.content,(e,t)=>e.isAtom&&t.type.allowsMarkType(this.mark.type)?e.mark(this.mark.addToSet(e.marks)):e,r),t.openStart,t.openEnd);return Hk.fromReplace(e,this.from,this.to,i)}invert(){return new Hj(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return t.deleted&&n.deleted||t.pos>=n.pos?null:new HM(t.pos,n.pos,this.mark)}merge(e){return e instanceof HM&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new HM(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if("number"!=typeof t.from||"number"!=typeof t.to)throw RangeError("Invalid input for AddMarkStep.fromJSON");return new HM(t.from,t.to,e.markFromJSON(t.mark))}}HR.jsonID("addMark",HM);class Hj extends HR{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=new VM(HE(t.content,e=>e.mark(this.mark.removeFromSet(e.marks)),e),t.openStart,t.openEnd);return Hk.fromReplace(e,this.from,this.to,n)}invert(){return new HM(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return t.deleted&&n.deleted||t.pos>=n.pos?null:new Hj(t.pos,n.pos,this.mark)}merge(e){return e instanceof Hj&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Hj(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if("number"!=typeof t.from||"number"!=typeof t.to)throw RangeError("Invalid input for RemoveMarkStep.fromJSON");return new Hj(t.from,t.to,e.markFromJSON(t.mark))}}HR.jsonID("removeMark",Hj);class HF extends HR{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return Hk.fail("No node at mark step's position");let n=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return Hk.fromReplace(e,this.pos,this.pos+1,new VM(V_.from(n),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);if(t){let e=this.mark.addToSet(t.marks);if(e.length==t.marks.length){for(let n=0;n<t.marks.length;n++)if(!t.marks[n].isInSet(e))return new HF(this.pos,t.marks[n]);return new HF(this.pos,this.mark)}}return new HU(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new HF(t.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if("number"!=typeof t.pos)throw RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new HF(t.pos,e.markFromJSON(t.mark))}}HR.jsonID("addNodeMark",HF);class HU extends HR{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return Hk.fail("No node at mark step's position");let n=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return Hk.fromReplace(e,this.pos,this.pos+1,new VM(V_.from(n),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);return t&&this.mark.isInSet(t.marks)?new HF(this.pos,this.mark):this}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new HU(t.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if("number"!=typeof t.pos)throw RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new HU(t.pos,e.markFromJSON(t.mark))}}HR.jsonID("removeNodeMark",HU);class HL extends HR{constructor(e,t,n,r=!1){super(),this.from=e,this.to=t,this.slice=n,this.structure=r}apply(e){return this.structure&&HB(e,this.from,this.to)?Hk.fail("Structure replace would overwrite content"):Hk.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new HT([this.from,this.to-this.from,this.slice.size])}invert(e){return new HL(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return t.deletedAcross&&n.deletedAcross?null:new HL(t.pos,Math.max(t.pos,n.pos),this.slice)}merge(e){if(!(e instanceof HL)||e.structure||this.structure)return null;if(this.from+this.slice.size!=e.from||this.slice.openEnd||e.slice.openStart){if(e.to!=this.from||this.slice.openStart||e.slice.openEnd)return null;{let t=this.slice.size+e.slice.size==0?VM.empty:new VM(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new HL(e.from,this.to,t,this.structure)}}{let t=this.slice.size+e.slice.size==0?VM.empty:new VM(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new HL(this.from,this.to+(e.to-e.from),t,this.structure)}}toJSON(){let e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if("number"!=typeof t.from||"number"!=typeof t.to)throw RangeError("Invalid input for ReplaceStep.fromJSON");return new HL(t.from,t.to,VM.fromJSON(e,t.slice),!!t.structure)}}HR.jsonID("replace",HL);class HK extends HR{constructor(e,t,n,r,i,o,a=!1){super(),this.from=e,this.to=t,this.gapFrom=n,this.gapTo=r,this.slice=i,this.insert=o,this.structure=a}apply(e){if(this.structure&&(HB(e,this.from,this.gapFrom)||HB(e,this.gapTo,this.to)))return Hk.fail("Structure gap-replace would overwrite content");let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return Hk.fail("Gap is not a flat range");let n=this.slice.insertAt(this.insert,t.content);return n?Hk.fromReplace(e,this.from,this.to,n):Hk.fail("Content does not fit in gap")}getMap(){return new HT([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let t=this.gapTo-this.gapFrom;return new HK(this.from,this.from+this.slice.size+t,this.from+this.insert,this.from+this.insert+t,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1),r=e.map(this.gapFrom,-1),i=e.map(this.gapTo,1);return t.deletedAcross&&n.deletedAcross||r<t.pos||i>n.pos?null:new HK(t.pos,n.pos,r,i,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if("number"!=typeof t.from||"number"!=typeof t.to||"number"!=typeof t.gapFrom||"number"!=typeof t.gapTo||"number"!=typeof t.insert)throw RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new HK(t.from,t.to,t.gapFrom,t.gapTo,VM.fromJSON(e,t.slice),t.insert,!!t.structure)}}function HB(e,t,n){let r=e.resolve(t),i=n-t,o=r.depth;for(;i>0&&o>0&&r.indexAfter(o)==r.node(o).childCount;)o--,i--;if(i>0){let e=r.node(o).maybeChild(r.indexAfter(o));for(;i>0;){if(!e||e.isLeaf)return!0;e=e.firstChild,i--}}return!1}function HP(e){return{type:e,attrs:null}}function HW(e,t,n=1,r){let i=e.resolve(t),o=i.depth-n,a=r&&r[r.length-1]||i.parent;if(o<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!a.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let e=i.depth-1,t=n-2;e>o;e--,t--){let n=i.node(e),o=i.index(e);if(n.type.spec.isolating)return!1;let a=n.content.cutByIndex(o,n.childCount),u=r&&r[t+1];u&&(a=a.replaceChild(0,u.type.create(u.attrs)));let s=r&&r[t]||n;if(!n.canReplace(o+1,n.childCount)||!s.type.validContent(a))return!1}let u=i.indexAfter(o),s=r&&r[0];return i.node(o).canReplaceWith(u,u,s?s.type:i.node(o+1).type)}function HD(e,t){let n=e.resolve(t),r=n.index();return HN(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function HN(e,t){return!!(e&&t&&!e.isLeaf&&e.canAppend(t))}function Hq(e,t,n=-1){let r=e.resolve(t);for(let e=r.depth;;e--){let i,o,a=r.index(e);if(e==r.depth?(i=r.nodeBefore,o=r.nodeAfter):n>0?(i=r.node(e+1),a++,o=r.node(e).maybeChild(a)):(i=r.node(e).maybeChild(a-1),o=r.node(e+1)),i&&!i.isTextblock&&HN(i,o)&&r.node(e).canReplace(a,a+1))return t;if(0==e)break;t=n<0?r.before(e):r.after(e)}}HR.jsonID("replaceAround",HK);class HQ extends HR{constructor(e,t,n){super(),this.pos=e,this.attr=t,this.value=n}apply(e){let t=e.nodeAt(this.pos);if(!t)return Hk.fail("No node at attribute step's position");let n=Object.create(null);for(let e in t.attrs)n[e]=t.attrs[e];n[this.attr]=this.value;let r=t.type.create(n,null,t.marks);return Hk.fromReplace(e,this.pos,this.pos+1,new VM(V_.from(r),0,t.isLeaf?0:1))}getMap(){return HT.empty}invert(e){return new HQ(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new HQ(t.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,t){if("number"!=typeof t.pos||"string"!=typeof t.attr)throw RangeError("Invalid input for AttrStep.fromJSON");return new HQ(t.pos,t.attr,t.value)}}HR.jsonID("attr",HQ);class HV extends HR{constructor(e,t){super(),this.attr=e,this.value=t}apply(e){let t=Object.create(null);for(let n in e.attrs)t[n]=e.attrs[n];t[this.attr]=this.value;let n=e.type.create(t,e.content,e.marks);return Hk.ok(n)}getMap(){return HT.empty}invert(e){return new HV(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,t){if("string"!=typeof t.attr)throw RangeError("Invalid input for DocAttrStep.fromJSON");return new HV(t.attr,t.value)}}HR.jsonID("docAttr",HV);let Hz=class extends Error{};(Hz=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n}).prototype=Object.create(Error.prototype),Hz.prototype.constructor=Hz,Hz.prototype.name="TransformError";let HY=(e,t)=>!e.selection.empty&&(t&&t(e.tr.deleteSelection().scrollIntoView()),!0);function HH(e,t){let{$cursor:n}=e.selection;return n&&(t?t.endOfTextblock("backward",e):!(n.parentOffset>0))?n:null}let HG=(e,t,n)=>{let r=HH(e,n);if(!r)return!1;let i=H1(r);if(!i){let n=r.blockRange(),i=n&&zC(n);return null!=i&&(t&&t(e.tr.lift(n,i).scrollIntoView()),!0)}let o=i.nodeBefore;if(!o.type.spec.isolating&&Go(e,i,t))return!0;if(0==r.parent.content.size&&(HX(o,"end")||zQ.isSelectable(o))){let n=zR(e.doc,r.before(),r.after(),VM.empty);if(n&&n.slice.size<n.to-n.from){if(t){let r=e.tr.step(n);r.setSelection(HX(o,"end")?zB.findFrom(r.doc.resolve(r.mapping.map(i.pos,-1)),-1):zQ.create(r.doc,i.pos-o.nodeSize)),t(r.scrollIntoView())}return!0}}return!!o.isAtom&&i.depth==r.depth-1&&(t&&t(e.tr.delete(i.pos-o.nodeSize,i.pos).scrollIntoView()),!0)},HZ=(e,t,n)=>{let r=HH(e,n);if(!r)return!1;let i=H1(r);return!!i&&H$(e,i,t)},HJ=(e,t,n)=>{let r=H2(e,n);if(!r)return!1;let i=H3(r);return!!i&&H$(e,i,t)};function H$(e,t,n){let r=t.nodeBefore,i=t.pos-1;for(;!r.isTextblock;i--){if(r.type.spec.isolating)return!1;let e=r.lastChild;if(!e)return!1;r=e}let o=t.nodeAfter,a=t.pos+1;for(;!o.isTextblock;a++){if(o.type.spec.isolating)return!1;let e=o.firstChild;if(!e)return!1;o=e}let u=zR(e.doc,i,a,VM.empty);if(!u||u.from!=i||u instanceof zv&&u.slice.size>=a-i)return!1;if(n){let t=e.tr.step(u);t.setSelection(zN.create(t.doc,i)),n(t.scrollIntoView())}return!0}function HX(e,t,n=!1){for(let r=e;r;r="start"==t?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&1!=r.childCount)break}return!1}let H0=(e,t,n)=>{let{$head:r,empty:i}=e.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",e):r.parentOffset>0)return!1;o=H1(r)}let a=o&&o.nodeBefore;return!!(a&&zQ.isSelectable(a))&&(t&&t(e.tr.setSelection(zQ.create(e.doc,o.pos-a.nodeSize)).scrollIntoView()),!0)};function H1(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){if(e.index(t)>0)return e.doc.resolve(e.before(t+1));if(e.node(t).type.spec.isolating)break}return null}function H2(e,t){let{$cursor:n}=e.selection;return n&&(t?t.endOfTextblock("forward",e):!(n.parentOffset<n.parent.content.size))?n:null}let H6=(e,t,n)=>{let r=H2(e,n);if(!r)return!1;let i=H3(r);if(!i)return!1;let o=i.nodeAfter;if(Go(e,i,t))return!0;if(0==r.parent.content.size&&(HX(o,"start")||zQ.isSelectable(o))){let n=zR(e.doc,r.before(),r.after(),VM.empty);if(n&&n.slice.size<n.to-n.from){if(t){let r=e.tr.step(n);r.setSelection(HX(o,"start")?zB.findFrom(r.doc.resolve(r.mapping.map(i.pos)),1):zQ.create(r.doc,r.mapping.map(i.pos))),t(r.scrollIntoView())}return!0}}return!!o.isAtom&&i.depth==r.depth-1&&(t&&t(e.tr.delete(i.pos,i.pos+o.nodeSize).scrollIntoView()),!0)},H5=(e,t,n)=>{let{$head:r,empty:i}=e.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",e):r.parentOffset<r.parent.content.size)return!1;o=H3(r)}let a=o&&o.nodeAfter;return!!(a&&zQ.isSelectable(a))&&(t&&t(e.tr.setSelection(zQ.create(e.doc,o.pos)).scrollIntoView()),!0)};function H3(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){let n=e.node(t);if(e.index(t)+1<n.childCount)return e.doc.resolve(e.after(t+1));if(n.type.spec.isolating)break}return null}let H9=(e,t)=>{let n=e.selection,r=n instanceof zQ,i;if(r){if(n.node.isTextblock||!z_(e.doc,n.from))return!1;i=n.from}else if(null==(i=zO(e.doc,n.from,-1)))return!1;if(t){let n=e.tr.join(i);r&&n.setSelection(zQ.create(n.doc,i-e.doc.resolve(i).nodeBefore.nodeSize)),t(n.scrollIntoView())}return!0},H4=(e,t)=>{let n=e.selection,r;if(n instanceof zQ){if(n.node.isTextblock||!z_(e.doc,n.to))return!1;r=n.to}else if(null==(r=zO(e.doc,n.to,1)))return!1;return t&&t(e.tr.join(r).scrollIntoView()),!0},H7=(e,t)=>{let{$from:n,$to:r}=e.selection,i=n.blockRange(r),o=i&&zC(i);return null!=o&&(t&&t(e.tr.lift(i,o).scrollIntoView()),!0)},H8=(e,t)=>{let{$head:n,$anchor:r}=e.selection;return!!(n.parent.type.spec.code&&n.sameParent(r))&&(t&&t(e.tr.insertText(`
|
|
14
|
-
`).scrollIntoView()),!0)};function Ge(e){for(let t=0;t<e.edgeCount;t++){let{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}let Gt=(e,t)=>{let{$head:n,$anchor:r}=e.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let i=n.node(-1),o=n.indexAfter(-1),a=Ge(i.contentMatchAt(o));if(!a||!i.canReplaceWith(o,o,a))return!1;if(t){let r=n.after(),i=e.tr.replaceWith(r,r,a.createAndFill());i.setSelection(zB.near(i.doc.resolve(r),1)),t(i.scrollIntoView())}return!0},Gn=(e,t)=>{let n=e.selection,{$from:r,$to:i}=n;if(n instanceof zz||r.parent.inlineContent||i.parent.inlineContent)return!1;let o=Ge(i.parent.contentMatchAt(i.indexAfter()));if(!o||!o.isTextblock)return!1;if(t){let n=(!r.parentOffset&&i.index()<i.parent.childCount?r:i).pos,a=e.tr.insert(n,o.createAndFill());a.setSelection(zN.create(a.doc,n+1)),t(a.scrollIntoView())}return!0},Gr=(e,t)=>{let{$cursor:n}=e.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let r=n.before();if(zI(e.doc,r))return t&&t(e.tr.split(r).scrollIntoView()),!0}let r=n.blockRange(),i=r&&zC(r);return null!=i&&(t&&t(e.tr.lift(r,i).scrollIntoView()),!0)},Gi=(e,t)=>{let{$from:n,to:r}=e.selection,i,o=n.sharedDepth(r);return 0!=o&&(i=n.before(o),t&&t(e.tr.setSelection(zQ.create(e.doc,i))),!0)};function Go(e,t,n){let r,i,o,a=t.nodeBefore,u=t.nodeAfter,s,l;if(a.type.spec.isolating||u.type.spec.isolating)return!1;if(r=t.nodeBefore,i=t.nodeAfter,o=t.index(),r&&i&&r.type.compatibleContent(i.type)&&(!r.content.size&&t.parent.canReplace(o-1,o)?(n&&n(e.tr.delete(t.pos-r.nodeSize,t.pos).scrollIntoView()),!0):!!(t.parent.canReplace(o,o+1)&&(i.isTextblock||z_(e.doc,t.pos)))&&(n&&n(e.tr.clearIncompatible(t.pos,r.type,r.contentMatchAt(r.childCount)).join(t.pos).scrollIntoView()),!0)))return!0;let c=t.parent.canReplace(t.index(),t.index()+1);if(c&&(s=(l=a.contentMatchAt(a.childCount)).findWrapping(u.type))&&l.matchType(s[0]||u.type).validEnd){if(n){let r=t.pos+u.nodeSize,i=V_.empty;for(let e=s.length-1;e>=0;e--)i=V_.from(s[e].create(null,i));i=V_.from(a.copy(i));let o=e.tr.step(new zx(t.pos-1,r,t.pos,r,new VM(i,1,0),s.length,!0)),l=r+2*s.length;z_(o.doc,l)&&o.join(l),n(o.scrollIntoView())}return!0}let d=zB.findFrom(t,1),f=d&&d.$from.blockRange(d.$to),p=f&&zC(f);if(null!=p&&p>=t.depth)return n&&n(e.tr.lift(f,p).scrollIntoView()),!0;if(c&&HX(u,"start",!0)&&HX(a,"end")){let r=a,i=[];for(;i.push(r),!r.isTextblock;)r=r.lastChild;let o=u,s=1;for(;!o.isTextblock;o=o.firstChild)s++;if(r.canReplace(r.childCount,r.childCount,o.content)){if(n){let r=V_.empty;for(let e=i.length-1;e>=0;e--)r=V_.from(i[e].copy(r));n(e.tr.step(new zx(t.pos-i.length,t.pos+u.nodeSize,t.pos+s,t.pos+u.nodeSize-s,new VM(r,i.length,0),0,!0)).scrollIntoView())}return!0}}return!1}function Ga(e){return function(t,n){let r=t.selection,i=e<0?r.$from:r.$to,o=i.depth;for(;i.node(o).isInline;){if(!o)return!1;o--}return!!i.node(o).isTextblock&&(n&&n(t.tr.setSelection(zN.create(t.doc,e<0?i.start(o):i.end(o)))),!0)}}let Gu=Ga(-1),Gs=Ga(1);function Gl(e,t=null){return function(n,r){let i=!1;for(let r=0;r<n.selection.ranges.length&&!i;r++){let{$from:{pos:o},$to:{pos:a}}=n.selection.ranges[r];n.doc.nodesBetween(o,a,(r,o)=>{if(i)return!1;if(!(!r.isTextblock||r.hasMarkup(e,t))){if(r.type==e)i=!0;else{let t=n.doc.resolve(o),r=t.index();i=t.parent.canReplaceWith(r,r+1,e)}}})}if(!i)return!1;if(r){let i=n.tr;for(let r=0;r<n.selection.ranges.length;r++){let{$from:{pos:o},$to:{pos:a}}=n.selection.ranges[r];i.setBlockType(o,a,e,t)}r(i.scrollIntoView())}return!0}}function Gc(e){let{state:t,transaction:n}=e,{selection:r}=n,{doc:i}=n,{storedMarks:o}=n;return{...t,apply:t.apply.bind(t),applyTransaction:t.applyTransaction.bind(t),plugins:t.plugins,schema:t.schema,reconfigure:t.reconfigure.bind(t),toJSON:t.toJSON.bind(t),get storedMarks(){return o},get selection(){return r},get doc(){return i},get tr(){return r=n.selection,i=n.doc,o=n.storedMarks,n}}}"u">typeof navigator?/Mac|iP(hone|[oa]d)/.test(navigator.platform):"u">typeof os&&os.platform&&os.platform();class Gd{constructor(e){this.editor=e.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=e.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){let{rawCommands:e,editor:t,state:n}=this,{view:r}=t,{tr:i}=n,o=this.buildProps(i);return Object.fromEntries(Object.entries(e).map(([e,t])=>[e,(...e)=>{let n=t(...e)(o);return i.getMeta("preventDispatch")||this.hasCustomState||r.dispatch(i),n}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,t=!0){let{rawCommands:n,editor:r,state:i}=this,{view:o}=r,a=[],u=!!e,s=e||i.tr,l={...Object.fromEntries(Object.entries(n).map(([e,n])=>[e,(...e)=>{let r=this.buildProps(s,t),i=n(...e)(r);return a.push(i),l}])),run:()=>(u||!t||s.getMeta("preventDispatch")||this.hasCustomState||o.dispatch(s),a.every(e=>!0===e))};return l}createCan(e){let{rawCommands:t,state:n}=this,r=e||n.tr,i=this.buildProps(r,!1);return{...Object.fromEntries(Object.entries(t).map(([e,t])=>[e,(...e)=>t(...e)({...i,dispatch:void 0})])),chain:()=>this.createChain(r,!1)}}buildProps(e,t=!0){let{rawCommands:n,editor:r,state:i}=this,{view:o}=r,a={tr:e,editor:r,view:o,state:Gc({state:i,transaction:e}),dispatch:t?()=>{}:void 0,chain:()=>this.createChain(e,t),can:()=>this.createCan(e),get commands(){return Object.fromEntries(Object.entries(n).map(([e,t])=>[e,(...e)=>t(...e)(a)]))}};return a}}function Gf(e,t,n){return void 0===e.config[t]&&e.parent?Gf(e.parent,t,n):"function"==typeof e.config[t]?e.config[t].bind({...n,parent:e.parent?Gf(e.parent,t,n):null}):e.config[t]}function Gp(e){return{baseExtensions:e.filter(e=>"extension"===e.type),nodeExtensions:e.filter(e=>"node"===e.type),markExtensions:e.filter(e=>"mark"===e.type)}}function GA(e){let t=[],{nodeExtensions:n,markExtensions:r}=Gp(e),i=[...n,...r],o={default:null,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return e.forEach(e=>{let n={name:e.name,options:e.options,storage:e.storage},r=Gf(e,"addGlobalAttributes",n);r&&r().forEach(e=>{e.types.forEach(n=>{Object.entries(e.attributes).forEach(([e,r])=>{t.push({type:n,name:e,attribute:{...o,...r}})})})})}),i.forEach(e=>{let n={name:e.name,options:e.options,storage:e.storage},r=Gf(e,"addAttributes",n);r&&Object.entries(r()).forEach(([n,r])=>{let i={...o,...r};"function"==typeof(null==i?void 0:i.default)&&(i.default=i.default()),null!=i&&i.isRequired&&(null==i?void 0:i.default)===void 0&&delete i.default,t.push({type:e.name,name:n,attribute:i})})}),t}function Gh(e,t){if("string"==typeof e){if(!t.nodes[e])throw Error(`There is no node type named '${e}'. Maybe you forgot to add the extension?`);return t.nodes[e]}return e}function Gm(...e){return e.filter(e=>!!e).reduce((e,t)=>{let n={...e};return Object.entries(t).forEach(([e,t])=>{if(!n[e]){n[e]=t;return}if("class"===e){let r=t?t.split(" "):[],i=n[e]?n[e].split(" "):[],o=r.filter(e=>!i.includes(e));n[e]=[...i,...o].join(" ")}else"style"===e?n[e]=[n[e],t].join("; "):n[e]=t}),n},{})}function Gg(e,t){return t.filter(e=>e.attribute.rendered).map(t=>t.attribute.renderHTML?t.attribute.renderHTML(e.attrs)||{}:{[t.name]:e.attrs[t.name]}).reduce((e,t)=>Gm(e,t),{})}function Gy(e,t,...n){return"function"==typeof e?t?e.bind(t)(...n):e(...n):e}function Gv(e,t){return e.style?e:{...e,getAttrs:n=>{let r=e.getAttrs?e.getAttrs(n):e.attrs;if(!1===r)return!1;let i=t.reduce((e,t)=>{var r;let i=t.attribute.parseHTML?t.attribute.parseHTML(n):"string"!=typeof(r=n.getAttribute(t.name))?r:r.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(r):"true"===r||"false"!==r&&r;return null==i?e:{...e,[t.name]:i}},{});return{...r,...i}}}}function Gx(e){return Object.fromEntries(Object.entries(e).filter(([e,t])=>!("attrs"===e&&function(e={}){return 0===Object.keys(e).length&&e.constructor===Object}(t))&&null!=t))}function Gb(e,t){var n;let r=GA(e),{nodeExtensions:i,markExtensions:o}=Gp(e);return new V3({topNode:null===(n=i.find(e=>Gf(e,"topNode")))||void 0===n?void 0:n.name,nodes:Object.fromEntries(i.map(n=>{let i=r.filter(e=>e.type===n.name),o={name:n.name,options:n.options,storage:n.storage,editor:t},a=Gx({...e.reduce((e,t)=>{let r=Gf(t,"extendNodeSchema",o);return{...e,...r?r(n):{}}},{}),content:Gy(Gf(n,"content",o)),marks:Gy(Gf(n,"marks",o)),group:Gy(Gf(n,"group",o)),inline:Gy(Gf(n,"inline",o)),atom:Gy(Gf(n,"atom",o)),selectable:Gy(Gf(n,"selectable",o)),draggable:Gy(Gf(n,"draggable",o)),code:Gy(Gf(n,"code",o)),defining:Gy(Gf(n,"defining",o)),isolating:Gy(Gf(n,"isolating",o)),attrs:Object.fromEntries(i.map(e=>{var t;return[e.name,{default:null===(t=null==e?void 0:e.attribute)||void 0===t?void 0:t.default}]}))}),u=Gy(Gf(n,"parseHTML",o));u&&(a.parseDOM=u.map(e=>Gv(e,i)));let s=Gf(n,"renderHTML",o);s&&(a.toDOM=e=>s({node:e,HTMLAttributes:Gg(e,i)}));let l=Gf(n,"renderText",o);return l&&(a.toText=l),[n.name,a]})),marks:Object.fromEntries(o.map(n=>{let i=r.filter(e=>e.type===n.name),o={name:n.name,options:n.options,storage:n.storage,editor:t},a=Gx({...e.reduce((e,t)=>{let r=Gf(t,"extendMarkSchema",o);return{...e,...r?r(n):{}}},{}),inclusive:Gy(Gf(n,"inclusive",o)),excludes:Gy(Gf(n,"excludes",o)),group:Gy(Gf(n,"group",o)),spanning:Gy(Gf(n,"spanning",o)),code:Gy(Gf(n,"code",o)),attrs:Object.fromEntries(i.map(e=>{var t;return[e.name,{default:null===(t=null==e?void 0:e.attribute)||void 0===t?void 0:t.default}]}))}),u=Gy(Gf(n,"parseHTML",o));u&&(a.parseDOM=u.map(e=>Gv(e,i)));let s=Gf(n,"renderHTML",o);return s&&(a.toDOM=e=>s({mark:e,HTMLAttributes:Gg(e,i)})),[n.name,a]}))})}function GC(e,t){return t.nodes[e]||t.marks[e]||null}function GS(e,t){return Array.isArray(t)?t.some(t=>("string"==typeof t?t:t.name)===e.name):t}let Gw=(e,t=500)=>{let n="",r=e.parentOffset;return e.parent.nodesBetween(Math.max(0,r-t),r,(e,t,i,o)=>{var a,u;let s=(null===(u=(a=e.type.spec).toText)||void 0===u?void 0:u.call(a,{node:e,pos:t,parent:i,index:o}))||e.textContent||"%leaf%";n+=s.slice(0,Math.max(0,r-t))}),n};function GI(e){return"[object RegExp]"===Object.prototype.toString.call(e)}class G_{constructor(e){this.find=e.find,this.handler=e.handler}}let GT=(e,t)=>{if(GI(t))return t.exec(e);let n=t(e);if(!n)return null;let r=[n.text];return r.index=n.index,r.input=e,r.data=n.data,n.replaceWith&&(n.text.includes(n.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),r.push(n.replaceWith)),r};function GO(e){var t;let{editor:n,from:r,to:i,text:o,rules:a,plugin:u}=e,{view:s}=n;if(s.composing)return!1;let l=s.state.doc.resolve(r);if(l.parent.type.spec.code||!(null===(t=l.nodeBefore||l.nodeAfter)||void 0===t)&&t.marks.find(e=>e.type.spec.code))return!1;let c=!1,d=Gw(l)+o;return a.forEach(e=>{if(c)return;let t=GT(d,e.find);if(!t)return;let a=s.state.tr,l=Gc({state:s.state,transaction:a}),f={from:r-(t[0].length-o.length),to:i},{commands:p,chain:A,can:h}=new Gd({editor:n,state:l});null!==e.handler({state:l,range:f,match:t,commands:p,chain:A,can:h})&&a.steps.length&&(a.setMeta(u,{transform:a,from:r,to:i,text:o}),s.dispatch(a),c=!0)}),c}class GR{constructor(e){this.find=e.find,this.handler=e.handler}}let Gk=(e,t,n)=>{if(GI(t))return[...e.matchAll(t)];let r=t(e,n);return r?r.map(t=>{let n=[t.text];return n.index=t.index,n.input=e,n.data=t.data,t.replaceWith&&(t.text.includes(t.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),n.push(t.replaceWith)),n}):[]},GE=e=>{var t;let n=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return null===(t=n.clipboardData)||void 0===t||t.setData("text/html",e),n};class GM{constructor(e,t){this.splittableMarks=[],this.editor=t,this.extensions=GM.resolve(e),this.schema=Gb(this.extensions,t),this.extensions.forEach(e=>{var t;this.editor.extensionStorage[e.name]=e.storage;let n={name:e.name,options:e.options,storage:e.storage,editor:this.editor,type:GC(e.name,this.schema)};"mark"===e.type&&(!(null!==(t=Gy(Gf(e,"keepOnSplit",n)))&&void 0!==t)||t)&&this.splittableMarks.push(e.name);let r=Gf(e,"onBeforeCreate",n);r&&this.editor.on("beforeCreate",r);let i=Gf(e,"onCreate",n);i&&this.editor.on("create",i);let o=Gf(e,"onUpdate",n);o&&this.editor.on("update",o);let a=Gf(e,"onSelectionUpdate",n);a&&this.editor.on("selectionUpdate",a);let u=Gf(e,"onTransaction",n);u&&this.editor.on("transaction",u);let s=Gf(e,"onFocus",n);s&&this.editor.on("focus",s);let l=Gf(e,"onBlur",n);l&&this.editor.on("blur",l);let c=Gf(e,"onDestroy",n);c&&this.editor.on("destroy",c)})}static resolve(e){var t;let n=GM.sort(GM.flatten(e)),r=[...new Set((t=n.map(e=>e.name)).filter((e,n)=>t.indexOf(e)!==n))];return r.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${r.map(e=>`'${e}'`).join(", ")}]. This can lead to issues.`),n}static flatten(e){return e.map(e=>{let t={name:e.name,options:e.options,storage:e.storage},n=Gf(e,"addExtensions",t);return n?[e,...this.flatten(n())]:e}).flat(10)}static sort(e){return e.sort((e,t)=>{let n=Gf(e,"priority")||100,r=Gf(t,"priority")||100;return n>r?-1:n<r?1:0})}get commands(){return this.extensions.reduce((e,t)=>{let n={name:t.name,options:t.options,storage:t.storage,editor:this.editor,type:GC(t.name,this.schema)},r=Gf(t,"addCommands",n);return r?{...e,...r()}:e},{})}get plugins(){let{editor:e}=this,t=GM.sort([...this.extensions].reverse()),n=[],r=[],i=t.map(t=>{let i;let o={name:t.name,options:t.options,storage:t.storage,editor:e,type:GC(t.name,this.schema)},a=[],u=Gf(t,"addKeyboardShortcuts",o),s={};if("mark"===t.type&&t.config.exitable&&(s.ArrowRight=()=>G8.handleExit({editor:e,mark:t})),u){let t=Object.fromEntries(Object.entries(u()).map(([t,n])=>[t,()=>n({editor:e})]));s={...s,...t}}let l=new z$({props:{handleKeyDown:(i=function(e){let t=Object.create(null);for(let n in e)t[function(e){let t,n,r,i,o=e.split(/-(?!$)/),a=o[o.length-1];"Space"==a&&(a=" ");for(let e=0;e<o.length-1;e++){let a=o[e];if(/^(cmd|meta|m)$/i.test(a))i=!0;else if(/^a(lt)?$/i.test(a))t=!0;else if(/^(c|ctrl|control)$/i.test(a))n=!0;else if(/^s(hift)?$/i.test(a))r=!0;else if(/^mod$/i.test(a))Hw?i=!0:n=!0;else throw Error("Unrecognized modifier name: "+a)}return t&&(a="Alt-"+a),n&&(a="Ctrl-"+a),i&&(a="Meta-"+a),r&&(a="Shift-"+a),a}(n)]=e[n];return t}(s),function(e,t){var n;let r=("Esc"==(n=!(Hx&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||Hb&&t.shiftKey&&t.key&&1==t.key.length||"Unidentified"==t.key)&&t.key||(t.shiftKey?Hv:Hy)[t.keyCode]||t.key||"Unidentified")&&(n="Escape"),"Del"==n&&(n="Delete"),"Left"==n&&(n="ArrowLeft"),"Up"==n&&(n="ArrowUp"),"Right"==n&&(n="ArrowRight"),"Down"==n&&(n="ArrowDown"),n),o,a=i[HI(r,t)];if(a&&a(e.state,e.dispatch,e))return!0;if(1==r.length&&" "!=r){if(t.shiftKey){let n=i[HI(r,t,!1)];if(n&&n(e.state,e.dispatch,e))return!0}if((t.shiftKey||t.altKey||t.metaKey||r.charCodeAt(0)>127)&&(o=Hy[t.keyCode])&&o!=r){let n=i[HI(o,t)];if(n&&n(e.state,e.dispatch,e))return!0}}return!1})}});a.push(l);let c=Gf(t,"addInputRules",o);GS(t,e.options.enableInputRules)&&c&&n.push(...c());let d=Gf(t,"addPasteRules",o);GS(t,e.options.enablePasteRules)&&d&&r.push(...d());let f=Gf(t,"addProseMirrorPlugins",o);if(f){let e=f();a.push(...e)}return a}).flat();return[function(e){let{editor:t,rules:n}=e,r=new z$({state:{init:()=>null,apply(e,i){let o=e.getMeta(r);if(o)return o;let a=e.getMeta("applyInputRules");return a&&setTimeout(()=>{let{from:e,text:i}=a,o=e+i.length;GO({editor:t,from:e,to:o,text:i,rules:n,plugin:r})}),e.selectionSet||e.docChanged?null:i}},props:{handleTextInput:(e,i,o,a)=>GO({editor:t,from:i,to:o,text:a,rules:n,plugin:r}),handleDOMEvents:{compositionend:e=>(setTimeout(()=>{let{$cursor:i}=e.state.selection;i&&GO({editor:t,from:i.pos,to:i.pos,text:"",rules:n,plugin:r})}),!1)},handleKeyDown(e,i){if("Enter"!==i.key)return!1;let{$cursor:o}=e.state.selection;return!!o&&GO({editor:t,from:o.pos,to:o.pos,text:`
|
|
15
|
-
`,rules:n,plugin:r})}},isInputRules:!0});return r}({editor:e,rules:n}),...function(e){let{editor:t,rules:n}=e,r=null,i=!1,o=!1,a="u">typeof ClipboardEvent?new ClipboardEvent("paste"):null,u="u">typeof DragEvent?new DragEvent("drop"):null,s=({state:e,from:n,to:r,rule:i,pasteEvt:o})=>{let s=e.tr;if(!(!function(e){let{editor:t,state:n,from:r,to:i,rule:o,pasteEvent:a,dropEvent:u}=e,{commands:s,chain:l,can:c}=new Gd({editor:t,state:n}),d=[];return n.doc.nodesBetween(r,i,(e,t)=>{if(!e.isTextblock||e.type.spec.code)return;let f=Math.max(r,t),p=Math.min(i,t+e.content.size);Gk(e.textBetween(f-t,p-t,void 0,""),o.find,a).forEach(e=>{if(void 0===e.index)return;let t=f+e.index+1,r=t+e[0].length,i={from:n.tr.mapping.map(t),to:n.tr.mapping.map(r)},p=o.handler({state:n,range:i,match:e,commands:s,chain:l,can:c,pasteEvent:a,dropEvent:u});d.push(p)})}),d.every(e=>null!==e)}({editor:t,state:Gc({state:e,transaction:s}),from:Math.max(n-1,0),to:r.b-1,rule:i,pasteEvent:o,dropEvent:u})||!s.steps.length))return u="u">typeof DragEvent?new DragEvent("drop"):null,a="u">typeof ClipboardEvent?new ClipboardEvent("paste"):null,s};return n.map(e=>new z$({view(e){let t=t=>{var n;r=!(null===(n=e.dom.parentElement)||void 0===n)&&n.contains(t.target)?e.dom.parentElement:null};return window.addEventListener("dragstart",t),{destroy(){window.removeEventListener("dragstart",t)}}},props:{handleDOMEvents:{drop:(e,t)=>(o=r===e.dom.parentElement,u=t,!1),paste:(e,t)=>{var n;let r=null===(n=t.clipboardData)||void 0===n?void 0:n.getData("text/html");return a=t,i=!!(null!=r&&r.includes("data-pm-slice")),!1}}},appendTransaction:(t,n,r)=>{let u=t[0],l="paste"===u.getMeta("uiEvent")&&!i,c="drop"===u.getMeta("uiEvent")&&!o,d=u.getMeta("applyPasteRules"),f=!!d;if(!l&&!c&&!f)return;if(f){let{from:t,text:n}=d,i=t+n.length;return s({rule:e,state:r,from:t,to:{b:i},pasteEvt:GE(n)})}let p=n.doc.content.findDiffStart(r.doc.content),A=n.doc.content.findDiffEnd(r.doc.content);if(!("number"!=typeof p||!A||p===A.b))return s({rule:e,state:r,from:p,to:A,pasteEvt:a})}}))}({editor:e,rules:r}),...i]}get attributes(){return GA(this.extensions)}get nodeViews(){let{editor:e}=this,{nodeExtensions:t}=Gp(this.extensions);return Object.fromEntries(t.filter(e=>!!Gf(e,"addNodeView")).map(t=>{let n=this.attributes.filter(e=>e.type===t.name),r={name:t.name,options:t.options,storage:t.storage,editor:e,type:Gh(t.name,this.schema)},i=Gf(t,"addNodeView",r);return i?[t.name,(r,o,a,u)=>{let s=Gg(r,n);return i()({editor:e,node:r,getPos:a,decorations:u,HTMLAttributes:s,extension:t})}]:[]}))}}function Gj(e){return"Object"===Object.prototype.toString.call(e).slice(8,-1)&&e.constructor===Object&&Object.getPrototypeOf(e)===Object.prototype}function GF(e,t){let n={...e};return Gj(e)&&Gj(t)&&Object.keys(t).forEach(r=>{Gj(t[r])&&r in e?n[r]=GF(e[r],t[r]):Object.assign(n,{[r]:t[r]})}),n}class GU{constructor(e={}){this.type="extension",this.name="extension",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&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=Gy(Gf(this,"addOptions",{name:this.name}))),this.storage=Gy(Gf(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new GU(e)}configure(e={}){let t=this.extend();return t.options=GF(this.options,e),t.storage=Gy(Gf(t,"addStorage",{name:t.name,options:t.options})),t}extend(e={}){let t=new GU({...this.config,...e});return t.parent=this,this.child=t,t.name=e.name?e.name:t.parent.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${t.name}".`),t.options=Gy(Gf(t,"addOptions",{name:t.name})),t.storage=Gy(Gf(t,"addStorage",{name:t.name,options:t.options})),t}}function GL(e,t,n={strict:!0}){let r=Object.keys(t);return!r.length||r.every(r=>n.strict?t[r]===e[r]:GI(t[r])?t[r].test(e[r]):t[r]===e[r])}function GK(e,t,n={}){return e.find(e=>e.type===t&&GL(e.attrs,n))}function GB(e,t,n={}){if(!e||!t)return;let r=e.parent.childAfter(e.parentOffset);if(e.parentOffset===r.offset&&0!==r.offset&&(r=e.parent.childBefore(e.parentOffset)),!r.node)return;let i=GK([...r.node.marks],t,n);if(!i)return;let o=r.index,a=e.start()+r.offset,u=o+1,s=a+r.node.nodeSize;for(GK([...r.node.marks],t,n);o>0&&i.isInSet(e.parent.child(o-1).marks);)o-=1,a-=e.parent.child(o).nodeSize;for(;u<e.parent.childCount&&function(e,t,n={}){return!!GK(e,t,n)}([...e.parent.child(u).marks],t,n);)s+=e.parent.child(u).nodeSize,u+=1;return{from:a,to:s}}function GP(e,t){if("string"==typeof e){if(!t.marks[e])throw Error(`There is no mark type named '${e}'. Maybe you forgot to add the extension?`);return t.marks[e]}return e}function GW(e){return e instanceof zN}function GD(e=0,t=0,n=0){return Math.min(Math.max(e,t),n)}function GN(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}GU.create({name:"clipboardTextSerializer",addOptions:()=>({blockSeparator:void 0}),addProseMirrorPlugins(){return[new z$({key:new z1("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{let{editor:e}=this,{state:t,schema:n}=e,{doc:r,selection:i}=t,{ranges:o}=i,a=Math.min(...o.map(e=>e.$from.pos)),u=Math.max(...o.map(e=>e.$to.pos)),s=Object.fromEntries(Object.entries(n.nodes).filter(([,e])=>e.spec.toText).map(([e,t])=>[e,t.spec.toText]));return function(e,t,n){let{from:r,to:i}=t,{blockSeparator:o=`
|
|
16
|
-
|
|
17
|
-
`,textSerializers:a={}}=n||{},u="",s=!0;return e.nodesBetween(r,i,(e,n,l,c)=>{var d;let f=null==a?void 0:a[e.type.name];if(f)return e.isBlock&&!s&&(u+=o,s=!0),l&&(u+=f({node:e,pos:n,parent:l,index:c,range:t})),!1;e.isText?(u+=null===(d=null==e?void 0:e.text)||void 0===d?void 0:d.slice(Math.max(r,n)-n,i-n),s=!1):e.isBlock&&!s&&(u+=o,s=!0)}),u}(r,{from:a,to:u},{...void 0!==this.options.blockSeparator?{blockSeparator:this.options.blockSeparator}:{},textSerializers:s})}}})]}});let Gq=e=>{let t=e.childNodes;for(let n=t.length-1;n>=0;n-=1){let r=t[n];3===r.nodeType&&r.nodeValue&&/^(\n\s\s|\n)$/.test(r.nodeValue)?e.removeChild(r):1===r.nodeType&&Gq(r)}return e};function GQ(e){let t=`<body>${e}</body>`;return Gq(new window.DOMParser().parseFromString(t,"text/html").body)}function GV(e,t,n){if(n={slice:!0,parseOptions:{},...n},"object"==typeof e&&null!==e)try{return Array.isArray(e)&&e.length>0?V_.fromArray(e.map(e=>t.nodeFromJSON(e))):t.nodeFromJSON(e)}catch(r){return console.warn("[tiptap warn]: Invalid content.","Passed value:",e,"Error:",r),GV("",t,n)}if("string"==typeof e){let r=V4.fromSchema(t);return n.slice?r.parseSlice(GQ(e),n.parseOptions).content:r.parse(GQ(e),n.parseOptions)}return GV("",t,n)}let Gz=e=>e.toString().startsWith("<");function GY(){return"u">typeof navigator&&/Mac/.test(navigator.platform)}function GH(e,t,n={}){let{from:r,to:i,empty:o}=e.selection,a=t?Gh(t,e.schema):null,u=[];e.doc.nodesBetween(r,i,(e,t)=>{if(e.isText)return;let n=Math.max(r,t),o=Math.min(i,t+e.nodeSize);u.push({node:e,from:n,to:o})});let s=i-r,l=u.filter(e=>!a||a.name===e.node.type.name).filter(e=>GL(e.node.attrs,n,{strict:!1}));return o?!!l.length:l.reduce((e,t)=>e+t.to-t.from,0)>=s}function GG(e,t){return t.nodes[e]?"node":t.marks[e]?"mark":null}function GZ(e,t){let n="string"==typeof t?[t]:t;return Object.keys(e).reduce((t,r)=>(n.includes(r)||(t[r]=e[r]),t),{})}function GJ(e,t){let n=GP(t,e.schema),{from:r,to:i,empty:o}=e.selection,a=[];o?(e.storedMarks&&a.push(...e.storedMarks),a.push(...e.selection.$head.marks())):e.doc.nodesBetween(r,i,e=>{a.push(...e.marks)});let u=a.find(e=>e.type.name===n.name);return u?{...u.attrs}:{}}function G$(e){return t=>(function(e,t){for(let n=e.depth;n>0;n-=1){let r=e.node(n);if(t(r))return{pos:n>0?e.before(n):0,start:e.start(n),depth:n,node:r}}})(t.$from,e)}function GX(e,t,n){let r=[];return e===t?n.resolve(e).marks().forEach(t=>{let i=GB(n.resolve(e-1),t.type);i&&r.push({mark:t,...i})}):n.nodesBetween(e,t,(e,t)=>{e&&(null==e?void 0:e.nodeSize)!==void 0&&r.push(...e.marks.map(n=>({from:t,to:t+e.nodeSize,mark:n})))}),r}function G0(e,t,n){return Object.fromEntries(Object.entries(n).filter(([n])=>{let r=e.find(e=>e.type===t&&e.name===n);return!!r&&r.attribute.keepOnSplit}))}function G1(e,t){let{nodeExtensions:n}=Gp(t),r=n.find(t=>t.name===e);if(!r)return!1;let i={name:r.name,options:r.options,storage:r.storage},o=Gy(Gf(r,"group",i));return"string"==typeof o&&o.split(" ").includes("list")}function G2(e,t){let n=e.storedMarks||e.selection.$to.parentOffset&&e.selection.$from.marks();if(n){let r=n.filter(e=>null==t?void 0:t.includes(e.type.name));e.tr.ensureMarks(r)}}let G6=(e,t)=>{let n=G$(e=>e.type===t)(e.selection);if(!n)return!0;let r=e.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(void 0===r)return!0;let i=e.doc.nodeAt(r);return n.node.type===(null==i?void 0:i.type)&&HD(e.doc,n.pos)&&e.join(n.pos),!0},G5=(e,t)=>{let n=G$(e=>e.type===t)(e.selection);if(!n)return!0;let r=e.doc.resolve(n.start).after(n.depth);if(void 0===r)return!0;let i=e.doc.nodeAt(r);return n.node.type===(null==i?void 0:i.type)&&HD(e.doc,r)&&e.join(r),!0};var G3=Object.freeze({__proto__:null,blur:()=>({editor:e,view:t})=>(requestAnimationFrame(()=>{var n;e.isDestroyed||(t.dom.blur(),null===(n=null==window?void 0:window.getSelection())||void 0===n||n.removeAllRanges())}),!0),clearContent:(e=!1)=>({commands:t})=>t.setContent("",e),clearNodes:()=>({state:e,tr:t,dispatch:n})=>{let{selection:r}=t,{ranges:i}=r;return n&&i.forEach(({$from:n,$to:r})=>{e.doc.nodesBetween(n.pos,r.pos,(e,n)=>{if(e.type.isText)return;let{doc:r,mapping:i}=t,o=r.resolve(i.map(n)),a=r.resolve(i.map(n+e.nodeSize)),u=o.blockRange(a);if(!u)return;let s=function(e){let t=e.parent.content.cutByIndex(e.startIndex,e.endIndex);for(let n=e.depth;;--n){let r=e.$from.node(n),i=e.$from.index(n),o=e.$to.indexAfter(n);if(n<e.depth&&r.canReplace(i,o,t))return n;if(0==n||r.type.spec.isolating||!((0==i||r.canReplace(i,r.childCount))&&(o==r.childCount||r.canReplace(0,o))))break}return null}(u);if(e.type.isTextblock){let{defaultType:e}=o.parent.contentMatchAt(o.index());t.setNodeMarkup(u.start,e)}(s||0===s)&&t.lift(u,s)})}),!0},command:e=>t=>e(t),createParagraphNear:()=>({state:e,dispatch:t})=>Gn(e,t),cut:(e,t)=>({editor:n,tr:r})=>{let{state:i}=n,o=i.doc.slice(e.from,e.to);r.deleteRange(e.from,e.to);let a=r.mapping.map(t);return r.insert(a,o.content),r.setSelection(new zN(r.doc.resolve(a-1))),!0},deleteCurrentNode:()=>({tr:e,dispatch:t})=>{let{selection:n}=e,r=n.$anchor.node();if(r.content.size>0)return!1;let i=e.selection.$anchor;for(let n=i.depth;n>0;n-=1)if(i.node(n).type===r.type){if(t){let t=i.before(n),r=i.after(n);e.delete(t,r).scrollIntoView()}return!0}return!1},deleteNode:e=>({tr:t,state:n,dispatch:r})=>{let i=Gh(e,n.schema),o=t.selection.$anchor;for(let e=o.depth;e>0;e-=1)if(o.node(e).type===i){if(r){let n=o.before(e),r=o.after(e);t.delete(n,r).scrollIntoView()}return!0}return!1},deleteRange:e=>({tr:t,dispatch:n})=>{let{from:r,to:i}=e;return n&&t.delete(r,i),!0},deleteSelection:()=>({state:e,dispatch:t})=>HY(e,t),enter:()=>({commands:e})=>e.keyboardShortcut("Enter"),exitCode:()=>({state:e,dispatch:t})=>Gt(e,t),extendMarkRange:(e,t={})=>({tr:n,state:r,dispatch:i})=>{let o=GP(e,r.schema),{doc:a,selection:u}=n,{$from:s,from:l,to:c}=u;if(i){let e=GB(s,o,t);if(e&&e.from<=l&&e.to>=c){let t=zN.create(a,e.from,e.to);n.setSelection(t)}}return!0},first:e=>t=>{let n="function"==typeof e?e(t):e;for(let e=0;e<n.length;e+=1)if(n[e](t))return!0;return!1},focus:(e=null,t={})=>({editor:n,view:r,tr:i,dispatch:o})=>{t={scrollIntoView:!0,...t};let a=()=>{GN()&&r.dom.focus(),requestAnimationFrame(()=>{n.isDestroyed||(r.focus(),null!=t&&t.scrollIntoView&&n.commands.scrollIntoView())})};if(r.hasFocus()&&null===e||!1===e)return!0;if(o&&null===e&&!GW(n.state.selection))return a(),!0;let u=function(e,t=null){if(!t)return null;let n=zB.atStart(e),r=zB.atEnd(e);if("start"===t||!0===t)return n;if("end"===t)return r;let i=n.from,o=r.to;return"all"===t?zN.create(e,GD(0,i,o),GD(e.content.size,i,o)):zN.create(e,GD(t,i,o),GD(t,i,o))}(i.doc,e)||n.state.selection,s=n.state.selection.eq(u);return o&&(s||i.setSelection(u),s&&i.storedMarks&&i.setStoredMarks(i.storedMarks),a()),!0},forEach:(e,t)=>n=>e.every((e,r)=>t(e,{...n,index:r})),insertContent:(e,t)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},e,t),insertContentAt:(e,t,n)=>({tr:r,dispatch:i,editor:o})=>{if(i){let i;n={parseOptions:{},updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...n};let a=GV(t,o.schema,{parseOptions:{preserveWhitespace:"full",...n.parseOptions}});if("<>"===a.toString())return!0;let{from:u,to:s}="number"==typeof e?{from:e,to:e}:{from:e.from,to:e.to},l=!0,c=!0;if((Gz(a)?a:[a]).forEach(e=>{e.check(),l=!!l&&e.isText&&0===e.marks.length,c=!!c&&e.isBlock}),u===s&&c){let{parent:e}=r.doc.resolve(u);!e.isTextblock||e.type.spec.code||e.childCount||(u-=1,s+=1)}l?(i=Array.isArray(t)?t.map(e=>e.text||"").join(""):"object"==typeof t&&t&&t.text?t.text:t,r.insertText(i,u,s)):(i=a,r.replaceWith(u,s,i)),n.updateSelection&&function(e,t,n){let r=e.steps.length-1;if(r<t)return;let i=e.steps[r];if(!(i instanceof HL||i instanceof HK))return;let o=e.mapping.maps[r],a=0;o.forEach((e,t,n,r)=>{0===a&&(a=r)}),e.setSelection(zB.near(e.doc.resolve(a),-1))}(r,r.steps.length-1,0),n.applyInputRules&&r.setMeta("applyInputRules",{from:u,text:i}),n.applyPasteRules&&r.setMeta("applyPasteRules",{from:u,text:i})}return!0},joinUp:()=>({state:e,dispatch:t})=>H9(e,t),joinDown:()=>({state:e,dispatch:t})=>H4(e,t),joinBackward:()=>({state:e,dispatch:t})=>HG(e,t),joinForward:()=>({state:e,dispatch:t})=>H6(e,t),joinItemBackward:()=>({tr:e,state:t,dispatch:n})=>{try{let r=Hq(t.doc,t.selection.$from.pos,-1);return null!=r&&(e.join(r,2),n&&n(e),!0)}catch{return!1}},joinItemForward:()=>({state:e,dispatch:t,tr:n})=>{try{let r=Hq(e.doc,e.selection.$from.pos,1);return null!=r&&(n.join(r,2),t&&t(n),!0)}catch{return!1}},joinTextblockBackward:()=>({state:e,dispatch:t})=>HZ(e,t),joinTextblockForward:()=>({state:e,dispatch:t})=>HJ(e,t),keyboardShortcut:e=>({editor:t,view:n,tr:r,dispatch:i})=>{let o=(function(e){let t,n,r,i;let o=e.split(/-(?!$)/),a=o[o.length-1];"Space"===a&&(a=" ");for(let e=0;e<o.length-1;e+=1){let a=o[e];if(/^(cmd|meta|m)$/i.test(a))i=!0;else if(/^a(lt)?$/i.test(a))t=!0;else if(/^(c|ctrl|control)$/i.test(a))n=!0;else if(/^s(hift)?$/i.test(a))r=!0;else if(/^mod$/i.test(a))GN()||GY()?i=!0:n=!0;else throw Error(`Unrecognized modifier name: ${a}`)}return t&&(a=`Alt-${a}`),n&&(a=`Ctrl-${a}`),i&&(a=`Meta-${a}`),r&&(a=`Shift-${a}`),a})(e).split(/-(?!$)/),a=o.find(e=>!["Alt","Ctrl","Meta","Shift"].includes(e)),u=new KeyboardEvent("keydown",{key:"Space"===a?" ":a,altKey:o.includes("Alt"),ctrlKey:o.includes("Ctrl"),metaKey:o.includes("Meta"),shiftKey:o.includes("Shift"),bubbles:!0,cancelable:!0}),s=t.captureTransaction(()=>{n.someProp("handleKeyDown",e=>e(n,u))});return null==s||s.steps.forEach(e=>{let t=e.map(r.mapping);t&&i&&r.maybeStep(t)}),!0},lift:(e,t={})=>({state:n,dispatch:r})=>{let i=Gh(e,n.schema);return!!GH(n,i,t)&&H7(n,r)},liftEmptyBlock:()=>({state:e,dispatch:t})=>Gr(e,t),liftListItem:e=>({state:t,dispatch:n})=>{var r;return(r=Gh(e,t.schema),function(e,t){let{$from:n,$to:i}=e.selection,o=n.blockRange(i,e=>e.childCount>0&&e.firstChild.type==r);return!!o&&(!t||(n.node(o.depth-1).type==r?function(e,t,n,r){let i=e.tr,o=r.end,a=r.$to.end(r.depth);o<a&&(i.step(new zx(o-1,a,o,a,new VM(V_.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new Vq(i.doc.resolve(r.$from.pos),i.doc.resolve(a),r.depth));let u=zC(r);if(null==u)return!1;i.lift(r,u);let s=i.mapping.map(o,-1)-1;return z_(i.doc,s)&&i.join(s),t(i.scrollIntoView()),!0}(e,t,r,o):function(e,t,n){let r=e.tr,i=n.parent;for(let e=n.end,t=n.endIndex-1,o=n.startIndex;t>o;t--)e-=i.child(t).nodeSize,r.delete(e-1,e+1);let o=r.doc.resolve(n.start),a=o.nodeAfter;if(r.mapping.map(n.end)!=n.start+o.nodeAfter.nodeSize)return!1;let u=0==n.startIndex,s=n.endIndex==i.childCount,l=o.node(-1),c=o.index(-1);if(!l.canReplace(c+(u?0:1),c+1,a.content.append(s?V_.empty:V_.from(i))))return!1;let d=o.pos,f=d+a.nodeSize;return r.step(new zx(d-(u?1:0),f+(s?1:0),d+1,f-1,new VM((u?V_.empty:V_.from(i.copy(V_.empty))).append(s?V_.empty:V_.from(i.copy(V_.empty))),u?0:1,s?0:1),u?0:1)),t(r.scrollIntoView()),!0}(e,t,o)))})(t,n)},newlineInCode:()=>({state:e,dispatch:t})=>H8(e,t),resetAttributes:(e,t)=>({tr:n,state:r,dispatch:i})=>{let o=null,a=null,u=GG("string"==typeof e?e:e.name,r.schema);return!!u&&("node"===u&&(o=Gh(e,r.schema)),"mark"===u&&(a=GP(e,r.schema)),i&&n.selection.ranges.forEach(e=>{r.doc.nodesBetween(e.$from.pos,e.$to.pos,(e,r)=>{o&&o===e.type&&n.setNodeMarkup(r,void 0,GZ(e.attrs,t)),a&&e.marks.length&&e.marks.forEach(i=>{a===i.type&&n.addMark(r,r+e.nodeSize,a.create(GZ(i.attrs,t)))})})}),!0)},scrollIntoView:()=>({tr:e,dispatch:t})=>(t&&e.scrollIntoView(),!0),selectAll:()=>({tr:e,commands:t})=>t.setTextSelection({from:0,to:e.doc.content.size}),selectNodeBackward:()=>({state:e,dispatch:t})=>H0(e,t),selectNodeForward:()=>({state:e,dispatch:t})=>H5(e,t),selectParentNode:()=>({state:e,dispatch:t})=>Gi(e,t),selectTextblockEnd:()=>({state:e,dispatch:t})=>Gs(e,t),selectTextblockStart:()=>({state:e,dispatch:t})=>Gu(e,t),setContent:(e,t=!1,n={})=>({tr:r,editor:i,dispatch:o})=>{let{doc:a}=r,u=function(e,t,n={}){return GV(e,t,{slice:!1,parseOptions:n})}(e,i.schema,n);return o&&r.replaceWith(0,a.content.size,u).setMeta("preventUpdate",!t),!0},setMark:(e,t={})=>({tr:n,state:r,dispatch:i})=>{let{selection:o}=n,{empty:a,ranges:u}=o,s=GP(e,r.schema);if(i){if(a){let e=GJ(r,s);n.addStoredMark(s.create({...e,...t}))}else u.forEach(e=>{let i=e.$from.pos,o=e.$to.pos;r.doc.nodesBetween(i,o,(e,r)=>{let a=Math.max(r,i),u=Math.min(r+e.nodeSize,o);e.marks.find(e=>e.type===s)?e.marks.forEach(e=>{s===e.type&&n.addMark(a,u,s.create({...e.attrs,...t}))}):n.addMark(a,u,s.create(t))})})}return function(e,t,n){var r;let{selection:i}=t,o=null;if(GW(i)&&(o=i.$cursor),o){let t=null!==(r=e.storedMarks)&&void 0!==r?r:o.marks();return!!n.isInSet(t)||!t.some(e=>e.type.excludes(n))}let{ranges:a}=i;return a.some(({$from:t,$to:r})=>{let i=0===t.depth&&e.doc.inlineContent&&e.doc.type.allowsMarkType(n);return e.doc.nodesBetween(t.pos,r.pos,(e,t,r)=>{if(i)return!1;if(e.isInline){let t=!r||r.type.allowsMarkType(n),o=!!n.isInSet(e.marks)||!e.marks.some(e=>e.type.excludes(n));i=t&&o}return!i}),i})}(r,n,s)},setMeta:(e,t)=>({tr:n})=>(n.setMeta(e,t),!0),setNode:(e,t={})=>({state:n,dispatch:r,chain:i})=>{let o=Gh(e,n.schema);return o.isTextblock?i().command(({commands:e})=>!!Gl(o,t)(n)||e.clearNodes()).command(({state:e})=>Gl(o,t)(e,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},setNodeSelection:e=>({tr:t,dispatch:n})=>{if(n){let{doc:n}=t,r=GD(e,0,n.content.size),i=zQ.create(n,r);t.setSelection(i)}return!0},setTextSelection:e=>({tr:t,dispatch:n})=>{if(n){let{doc:n}=t,{from:r,to:i}="number"==typeof e?{from:e,to:e}:e,o=zN.atStart(n).from,a=zN.atEnd(n).to,u=GD(r,o,a),s=GD(i,o,a),l=zN.create(n,u,s);t.setSelection(l)}return!0},sinkListItem:e=>({state:t,dispatch:n})=>{var r;return(r=Gh(e,t.schema),function(e,t){let{$from:n,$to:i}=e.selection,o=n.blockRange(i,e=>e.childCount>0&&e.firstChild.type==r);if(!o)return!1;let a=o.startIndex;if(0==a)return!1;let u=o.parent,s=u.child(a-1);if(s.type!=r)return!1;if(t){let n=s.lastChild&&s.lastChild.type==u.type,i=V_.from(n?r.create():null),a=new VM(V_.from(r.create(null,V_.from(u.type.create(null,i)))),n?3:1,0),l=o.start,c=o.end;t(e.tr.step(new zx(l-(n?3:1),c,l,c,a,1,!0)).scrollIntoView())}return!0})(t,n)},splitBlock:({keepMarks:e=!0}={})=>({tr:t,state:n,dispatch:r,editor:i})=>{let{selection:o,doc:a}=t,{$from:u,$to:s}=o,l=G0(i.extensionManager.attributes,u.node().type.name,u.node().attrs);if(o instanceof zQ&&o.node.isBlock)return!!(u.parentOffset&&HW(a,u.pos))&&(r&&(e&&G2(n,i.extensionManager.splittableMarks),t.split(u.pos).scrollIntoView()),!0);if(!u.parent.isBlock)return!1;if(r){let r=s.parentOffset===s.parent.content.size;o instanceof zN&&t.deleteSelection();let a=0===u.depth?void 0:function(e){for(let t=0;t<e.edgeCount;t+=1){let{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}(u.node(-1).contentMatchAt(u.indexAfter(-1))),c=r&&a?[{type:a,attrs:l}]:void 0,d=HW(t.doc,t.mapping.map(u.pos),1,c);if(!c&&!d&&HW(t.doc,t.mapping.map(u.pos),1,a?[{type:a}]:void 0)&&(d=!0,c=a?[{type:a,attrs:l}]:void 0),d&&(t.split(t.mapping.map(u.pos),1,c),a&&!r&&!u.parentOffset&&u.parent.type!==a)){let e=t.mapping.map(u.before()),n=t.doc.resolve(e);u.node(-1).canReplaceWith(n.index(),n.index()+1,a)&&t.setNodeMarkup(t.mapping.map(u.before()),a)}e&&G2(n,i.extensionManager.splittableMarks),t.scrollIntoView()}return!0},splitListItem:e=>({tr:t,state:n,dispatch:r,editor:i})=>{var o;let a=Gh(e,n.schema),{$from:u,$to:s}=n.selection,l=n.selection.node;if(l&&l.isBlock||u.depth<2||!u.sameParent(s))return!1;let c=u.node(-1);if(c.type!==a)return!1;let d=i.extensionManager.attributes;if(0===u.parent.content.size&&u.node(-1).childCount===u.indexAfter(-1)){if(2===u.depth||u.node(-3).type!==a||u.index(-2)!==u.node(-2).childCount-1)return!1;if(r){let e=V_.empty,n=u.index(-1)?1:u.index(-2)?2:3;for(let t=u.depth-n;t>=u.depth-3;t-=1)e=V_.from(u.node(t).copy(e));let r=u.indexAfter(-1)<u.node(-2).childCount?1:u.indexAfter(-2)<u.node(-3).childCount?2:3,i=G0(d,u.node().type.name,u.node().attrs),s=(null===(o=a.contentMatch.defaultType)||void 0===o?void 0:o.createAndFill(i))||void 0;e=e.append(V_.from(a.createAndFill(null,s)||void 0));let l=u.before(u.depth-(n-1));t.replace(l,u.after(-r),new VM(e,4-n,0));let c=-1;t.doc.nodesBetween(l,t.doc.content.size,(e,t)=>{if(c>-1)return!1;e.isTextblock&&0===e.content.size&&(c=t+1)}),c>-1&&t.setSelection(zN.near(t.doc.resolve(c))),t.scrollIntoView()}return!0}let f=s.pos===u.end()?c.contentMatchAt(0).defaultType:null,p=G0(d,c.type.name,c.attrs),A=G0(d,u.node().type.name,u.node().attrs);if(t.delete(u.pos,s.pos),!HW(t.doc,u.pos,2))return!1;if(r){let{selection:e,storedMarks:o}=n,{splittableMarks:s}=i.extensionManager,l=o||e.$to.parentOffset&&e.$from.marks();if(t.split(u.pos,2,f?[{type:a,attrs:p},{type:f,attrs:A}]:[{type:a,attrs:p}]).scrollIntoView(),!l||!r)return!0;let c=l.filter(e=>s.includes(e.type.name));t.ensureMarks(c)}return!0},toggleList:(e,t,n,r={})=>({editor:i,tr:o,state:a,dispatch:u,chain:s,commands:l,can:c})=>{let{extensions:d,splittableMarks:f}=i.extensionManager,p=Gh(e,a.schema),A=Gh(t,a.schema),{selection:h,storedMarks:m}=a,{$from:g,$to:y}=h,v=g.blockRange(y),x=m||h.$to.parentOffset&&h.$from.marks();if(!v)return!1;let b=G$(e=>G1(e.type.name,d))(h);if(v.depth>=1&&b&&v.depth-b.depth<=1){if(b.node.type===p)return l.liftListItem(A);if(G1(b.node.type.name,d)&&p.validContent(b.node.content)&&u)return s().command(()=>(o.setNodeMarkup(b.pos,p),!0)).command(()=>G6(o,p)).command(()=>G5(o,p)).run()}return n&&x&&u?s().command(()=>{let e=c().wrapInList(p,r),t=x.filter(e=>f.includes(e.type.name));return o.ensureMarks(t),!!e||l.clearNodes()}).wrapInList(p,r).command(()=>G6(o,p)).command(()=>G5(o,p)).run():s().command(()=>!!c().wrapInList(p,r)||l.clearNodes()).wrapInList(p,r).command(()=>G6(o,p)).command(()=>G5(o,p)).run()},toggleMark:(e,t={},n={})=>({state:r,commands:i})=>{let{extendEmptyMarkRange:o=!1}=n,a=GP(e,r.schema);return!function(e,t,n={}){let{empty:r,ranges:i}=e.selection,o=t?GP(t,e.schema):null;if(r)return!!(e.storedMarks||e.selection.$from.marks()).filter(e=>!o||o.name===e.type.name).find(e=>GL(e.attrs,n,{strict:!1}));let a=0,u=[];if(i.forEach(({$from:t,$to:n})=>{let r=t.pos,i=n.pos;e.doc.nodesBetween(r,i,(e,t)=>{if(!e.isText&&!e.marks.length)return;let n=Math.max(r,t),o=Math.min(i,t+e.nodeSize);a+=o-n,u.push(...e.marks.map(e=>({mark:e,from:n,to:o})))})}),0===a)return!1;let s=u.filter(e=>!o||o.name===e.mark.type.name).filter(e=>GL(e.mark.attrs,n,{strict:!1})).reduce((e,t)=>e+t.to-t.from,0),l=u.filter(e=>!o||e.mark.type!==o&&e.mark.type.excludes(o)).reduce((e,t)=>e+t.to-t.from,0);return(s>0?s+l:s)>=a}(r,a,t)?i.setMark(a,t):i.unsetMark(a,{extendEmptyMarkRange:o})},toggleNode:(e,t,n={})=>({state:r,commands:i})=>{let o=Gh(e,r.schema),a=Gh(t,r.schema);return GH(r,o,n)?i.setNode(a):i.setNode(o,n)},toggleWrap:(e,t={})=>({state:n,commands:r})=>{let i=Gh(e,n.schema);return GH(n,i,t)?r.lift(i):r.wrapIn(i,t)},undoInputRule:()=>({state:e,dispatch:t})=>{let n=e.plugins;for(let r=0;r<n.length;r+=1){let i;let o=n[r];if(o.spec.isInputRules&&(i=o.getState(e))){if(t){let t=e.tr,n=i.transform;for(let e=n.steps.length-1;e>=0;e-=1)t.step(n.steps[e].invert(n.docs[e]));if(i.text){let n=t.doc.resolve(i.from).marks();t.replaceWith(i.from,i.to,e.schema.text(i.text,n))}else t.delete(i.from,i.to)}return!0}}return!1},unsetAllMarks:()=>({tr:e,dispatch:t})=>{let{selection:n}=e,{empty:r,ranges:i}=n;return r||t&&i.forEach(t=>{e.removeMark(t.$from.pos,t.$to.pos)}),!0},unsetMark:(e,t={})=>({tr:n,state:r,dispatch:i})=>{var o;let{extendEmptyMarkRange:a=!1}=t,{selection:u}=n,s=GP(e,r.schema),{$from:l,empty:c,ranges:d}=u;if(!i)return!0;if(c&&a){let{from:e,to:t}=u,r=null===(o=l.marks().find(e=>e.type===s))||void 0===o?void 0:o.attrs,i=GB(l,s,r);i&&(e=i.from,t=i.to),n.removeMark(e,t,s)}else d.forEach(e=>{n.removeMark(e.$from.pos,e.$to.pos,s)});return n.removeStoredMark(s),!0},updateAttributes:(e,t={})=>({tr:n,state:r,dispatch:i})=>{let o=null,a=null,u=GG("string"==typeof e?e:e.name,r.schema);return!!u&&("node"===u&&(o=Gh(e,r.schema)),"mark"===u&&(a=GP(e,r.schema)),i&&n.selection.ranges.forEach(e=>{let i=e.$from.pos,u=e.$to.pos;r.doc.nodesBetween(i,u,(e,r)=>{o&&o===e.type&&n.setNodeMarkup(r,void 0,{...e.attrs,...t}),a&&e.marks.length&&e.marks.forEach(o=>{if(a===o.type){let s=Math.max(r,i),l=Math.min(r+e.nodeSize,u);n.addMark(s,l,a.create({...o.attrs,...t}))}})})}),!0)},wrapIn:(e,t={})=>({state:n,dispatch:r})=>(function(e,t=null){return function(n,r){let{$from:i,$to:o}=n.selection,a=i.blockRange(o),u=a&&zS(a,e,t);return!!u&&(r&&r(n.tr.wrap(a,u).scrollIntoView()),!0)}})(Gh(e,n.schema),t)(n,r),wrapInList:(e,t={})=>({state:n,dispatch:r})=>(function(e,t=null){return function(n,r){let{$from:i,$to:o}=n.selection,a=i.blockRange(o),u=!1,s=a;if(!a)return!1;if(a.depth>=2&&i.node(a.depth-1).type.compatibleContent(e)&&0==a.startIndex){if(0==i.index(a.depth-1))return!1;let e=n.doc.resolve(a.start-2);s=new Vq(e,e,a.depth),a.endIndex<a.parent.childCount&&(a=new Vq(i,n.doc.resolve(o.end(a.depth)),a.depth)),u=!0}let l=zS(s,e,t,a);return!!l&&(r&&r((function(e,t,n,r,i){let o=V_.empty;for(let e=n.length-1;e>=0;e--)o=V_.from(n[e].type.create(n[e].attrs,o));e.step(new zx(t.start-(r?2:0),t.end,t.start,t.end,new VM(o,0,0),n.length,!0));let a=0;for(let e=0;e<n.length;e++)n[e].type==i&&(a=e+1);let u=n.length-a,s=t.start+n.length-(r?2:0),l=t.parent;for(let n=t.startIndex,r=t.endIndex,i=!0;n<r;n++,i=!1)!i&&zI(e.doc,s,u)&&(e.split(s,u),s+=2*u),s+=l.child(n).nodeSize;return e})(n.tr,a,l,u,e).scrollIntoView()),!0)}})(Gh(e,n.schema),t)(n,r)});function G9(e){return new G_({find:e.find,handler:({state:t,range:n,match:r})=>{let i=Gy(e.getAttributes,void 0,r);if(!1===i||null===i)return null;let{tr:o}=t,a=r[r.length-1],u=r[0];if(a){let r=u.search(/\S/),s=n.from+u.indexOf(a),l=s+a.length;if(GX(n.from,n.to,t.doc).filter(t=>t.mark.type.excluded.find(n=>n===e.type&&n!==t.mark.type)).filter(e=>e.to>s).length)return null;l<n.to&&o.delete(l,n.to),s>n.from&&o.delete(n.from+r,s);let c=n.from+r+a.length;o.addMark(n.from+r,c,e.type.create(i||{})),o.removeStoredMark(e.type)}}})}function G4(e){return new G_({find:e.find,handler:({state:t,range:n,match:r})=>{let i=t.doc.resolve(n.from),o=Gy(e.getAttributes,void 0,r)||{};if(!i.node(-1).canReplaceWith(i.index(-1),i.indexAfter(-1),e.type))return null;t.tr.delete(n.from,n.to).setBlockType(n.from,n.from,e.type,o)}})}function G7(e){return new G_({find:e.find,handler:({state:t,range:n,match:r,chain:i})=>{let o=Gy(e.getAttributes,void 0,r)||{},a=t.tr.delete(n.from,n.to),u=a.doc.resolve(n.from).blockRange(),s=u&&function(e,t,n=null,r=e){let i=function(e,t){let{parent:n,startIndex:r,endIndex:i}=e,o=n.contentMatchAt(r).findWrapping(t);if(!o)return null;let a=o.length?o[0]:t;return n.canReplaceWith(r,i,a)?o:null}(e,t),o=i&&function(e,t){let{parent:n,startIndex:r,endIndex:i}=e,o=n.child(r),a=t.contentMatch.findWrapping(o.type);if(!a)return null;let u=(a.length?a[a.length-1]:t).contentMatch;for(let e=r;u&&e<i;e++)u=u.matchType(n.child(e).type);return u&&u.validEnd?a:null}(r,t);return o?i.map(HP).concat({type:t,attrs:n}).concat(o.map(HP)):null}(u,e.type,o);if(!s)return null;if(a.wrap(u,s),e.keepMarks&&e.editor){let{selection:n,storedMarks:r}=t,{splittableMarks:i}=e.editor.extensionManager,o=r||n.$to.parentOffset&&n.$from.marks();if(o){let e=o.filter(e=>i.includes(e.type.name));a.ensureMarks(e)}}if(e.keepAttributes){let t="bulletList"===e.type.name||"orderedList"===e.type.name?"listItem":"taskList";i().updateAttributes(t,o).run()}let l=a.doc.resolve(n.from-1).nodeBefore;l&&l.type===e.type&&HD(a.doc,n.from-1)&&(!e.joinPredicate||e.joinPredicate(r,l))&&a.join(n.from-1)}})}GU.create({name:"commands",addCommands:()=>({...G3})}),GU.create({name:"editable",addProseMirrorPlugins(){return[new z$({key:new z1("editable"),props:{editable:()=>this.editor.options.editable}})]}}),GU.create({name:"focusEvents",addProseMirrorPlugins(){let{editor:e}=this;return[new z$({key:new z1("focusEvents"),props:{handleDOMEvents:{focus:(t,n)=>{e.isFocused=!0;let r=e.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return t.dispatch(r),!1},blur:(t,n)=>{e.isFocused=!1;let r=e.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return t.dispatch(r),!1}}}})]}}),GU.create({name:"keymap",addKeyboardShortcuts(){let e=()=>this.editor.commands.first(({commands:e})=>[()=>e.undoInputRule(),()=>e.command(({tr:t})=>{let{selection:n,doc:r}=t,{empty:i,$anchor:o}=n,{pos:a,parent:u}=o,s=o.parent.isTextblock&&a>0?t.doc.resolve(a-1):o,l=s.parent.type.spec.isolating,c=o.pos-o.parentOffset,d=l&&1===s.parent.childCount?c===o.pos:zB.atStart(r).from===a;return!!i&&!!d&&!!u.type.isTextblock&&!u.textContent.length&&e.clearNodes()}),()=>e.deleteSelection(),()=>e.joinBackward(),()=>e.selectNodeBackward()]),t=()=>this.editor.commands.first(({commands:e})=>[()=>e.deleteSelection(),()=>e.deleteCurrentNode(),()=>e.joinForward(),()=>e.selectNodeForward()]),n={Enter:()=>this.editor.commands.first(({commands:e})=>[()=>e.newlineInCode(),()=>e.createParagraphNear(),()=>e.liftEmptyBlock(),()=>e.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:e,"Mod-Backspace":e,"Shift-Backspace":e,Delete:t,"Mod-Delete":t,"Mod-a":()=>this.editor.commands.selectAll()},r={...n},i={...n,"Ctrl-h":e,"Alt-Backspace":e,"Ctrl-d":t,"Ctrl-Alt-Backspace":t,"Alt-Delete":t,"Alt-d":t,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return GN()||GY()?i:r},addProseMirrorPlugins(){return[new z$({key:new z1("clearDocument"),appendTransaction:(e,t,n)=>{if(!(e.some(e=>e.docChanged)&&!t.doc.eq(n.doc)))return;let{empty:r,from:i,to:o}=t.selection,a=zB.atStart(t.doc).from,u=zB.atEnd(t.doc).to;if(r||!(i===a&&o===u)||0!==n.doc.textBetween(0,n.doc.content.size," "," ").length)return;let s=n.tr,l=Gc({state:n,transaction:s}),{commands:c}=new Gd({editor:this.editor,state:l});if(c.clearNodes(),s.steps.length)return s}})]}}),GU.create({name:"tabindex",addProseMirrorPlugins(){return[new z$({key:new z1("tabindex"),props:{attributes:this.editor.isEditable?{tabindex:"0"}:{}}})]}});let G8=class e{constructor(e={}){this.type="mark",this.name="mark",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&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=Gy(Gf(this,"addOptions",{name:this.name}))),this.storage=Gy(Gf(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(t={}){return new e(t)}configure(e={}){let t=this.extend();return t.options=GF(this.options,e),t.storage=Gy(Gf(t,"addStorage",{name:t.name,options:t.options})),t}extend(t={}){let n=new e({...this.config,...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=Gy(Gf(n,"addOptions",{name:n.name})),n.storage=Gy(Gf(n,"addStorage",{name:n.name,options:n.options})),n}static handleExit({editor:e,mark:t}){let{tr:n}=e.state,r=e.state.selection.$from;if(r.pos===r.end()){let i=r.marks();if(!i.find(e=>(null==e?void 0:e.type.name)===t.name))return!1;let o=i.find(e=>(null==e?void 0:e.type.name)===t.name);return o&&n.removeStoredMark(o),n.insertText(" ",r.pos),e.view.dispatch(n),!0}return!1}};class Ze{constructor(e={}){this.type="node",this.name="node",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&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=Gy(Gf(this,"addOptions",{name:this.name}))),this.storage=Gy(Gf(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new Ze(e)}configure(e={}){let t=this.extend();return t.options=GF(this.options,e),t.storage=Gy(Gf(t,"addStorage",{name:t.name,options:t.options})),t}extend(e={}){let t=new Ze({...this.config,...e});return t.parent=this,this.child=t,t.name=e.name?e.name:t.parent.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${t.name}".`),t.options=Gy(Gf(t,"addOptions",{name:t.name})),t.storage=Gy(Gf(t,"addStorage",{name:t.name,options:t.options})),t}}class Zt{constructor(e,t,n){this.isDragging=!1,this.component=e,this.editor=t.editor,this.options={stopEvent:null,ignoreMutation:null,...n},this.extension=t.extension,this.node=t.node,this.decorations=t.decorations,this.getPos=t.getPos,this.mount()}mount(){}get dom(){return this.editor.view.dom}get contentDOM(){return null}onDragStart(e){var t,n,r,i,o,a,u;let{view:s}=this.editor,l=e.target,c=3===l.nodeType?null===(t=l.parentElement)||void 0===t?void 0:t.closest("[data-drag-handle]"):l.closest("[data-drag-handle]");if(!this.dom||!(null===(n=this.contentDOM)||void 0===n)&&n.contains(l)||!c)return;let d=0,f=0;if(this.dom!==c){let t=this.dom.getBoundingClientRect(),n=c.getBoundingClientRect(),u=null!==(r=e.offsetX)&&void 0!==r?r:null===(i=e.nativeEvent)||void 0===i?void 0:i.offsetX,s=null!==(o=e.offsetY)&&void 0!==o?o:null===(a=e.nativeEvent)||void 0===a?void 0:a.offsetY;d=n.x-t.x+u,f=n.y-t.y+s}null===(u=e.dataTransfer)||void 0===u||u.setDragImage(this.dom,d,f);let p=zQ.create(s.state.doc,this.getPos()),A=s.state.tr.setSelection(p);s.dispatch(A)}stopEvent(e){var t;if(!this.dom)return!1;if("function"==typeof this.options.stopEvent)return this.options.stopEvent({event:e});let n=e.target;if(!(this.dom.contains(n)&&!(!(null===(t=this.contentDOM)||void 0===t)&&t.contains(n))))return!1;let r=e.type.startsWith("drag"),i="drop"===e.type;if((["INPUT","BUTTON","SELECT","TEXTAREA"].includes(n.tagName)||n.isContentEditable)&&!i&&!r)return!0;let{isEditable:o}=this.editor,{isDragging:a}=this,u=!!this.node.type.spec.draggable,s=zQ.isSelectable(this.node),l="copy"===e.type,c="paste"===e.type,d="cut"===e.type,f="mousedown"===e.type;if(!u&&s&&r&&e.preventDefault(),u&&r&&!a)return e.preventDefault(),!1;if(u&&o&&!a&&f){let e=n.closest("[data-drag-handle]");e&&(this.dom===e||this.dom.contains(e))&&(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!(a||i||l||c||d||f&&s)}ignoreMutation(e){return!this.dom||!this.contentDOM||("function"==typeof this.options.ignoreMutation?this.options.ignoreMutation({mutation:e}):!!this.node.isLeaf||!!this.node.isAtom||!("selection"===e.type||this.dom.contains(e.target)&&"childList"===e.type&&(GN()||"Android"===navigator.platform||/android/i.test(navigator.userAgent))&&this.editor.isFocused&&[...Array.from(e.addedNodes),...Array.from(e.removedNodes)].every(e=>e.isContentEditable))&&(this.contentDOM===e.target&&"attributes"===e.type||!this.contentDOM.contains(e.target)))}updateAttributes(e){this.editor.commands.command(({tr:t})=>{let n=this.getPos();return t.setNodeMarkup(n,void 0,{...this.node.attrs,...e}),!0})}deleteNode(){let e=this.getPos(),t=e+this.node.nodeSize;this.editor.commands.deleteRange({from:e,to:t})}}function Zn(e){return new GR({find:e.find,handler:({state:t,range:n,match:r,pasteEvent:i})=>{let o=Gy(e.getAttributes,void 0,r,i);if(!1===o||null===o)return null;let{tr:a}=t,u=r[r.length-1],s=r[0],l=n.to;if(u){let r=s.search(/\S/),i=n.from+s.indexOf(u),c=i+u.length;if(GX(n.from,n.to,t.doc).filter(t=>t.mark.type.excluded.find(n=>n===e.type&&n!==t.mark.type)).filter(e=>e.to>i).length)return null;c<n.to&&a.delete(c,n.to),i>n.from&&a.delete(n.from+r,i),l=n.from+r+u.length,a.addMark(n.from+r,l,e.type.create(o||{})),a.removeStoredMark(e.type)}}})}var Zr=function(){};Zr.prototype.append=function(e){return e.length?(e=Zr.from(e),!this.length&&e||e.length<200&&this.leafAppend(e)||this.length<200&&e.leafPrepend(this)||this.appendInner(e)):this},Zr.prototype.prepend=function(e){return e.length?Zr.from(e).append(this):this},Zr.prototype.appendInner=function(e){return new Zo(this,e)},Zr.prototype.slice=function(e,t){return void 0===e&&(e=0),void 0===t&&(t=this.length),e>=t?Zr.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))},Zr.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},Zr.prototype.forEach=function(e,t,n){void 0===t&&(t=0),void 0===n&&(n=this.length),t<=n?this.forEachInner(e,t,n,0):this.forEachInvertedInner(e,t,n,0)},Zr.prototype.map=function(e,t,n){void 0===t&&(t=0),void 0===n&&(n=this.length);var r=[];return this.forEach(function(t,n){return r.push(e(t,n))},t,n),r},Zr.from=function(e){return e instanceof Zr?e:e&&e.length?new Zi(e):Zr.empty};var Zi=function(e){function t(t){e.call(this),this.values=t}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={length:{configurable:!0},depth:{configurable:!0}};return t.prototype.flatten=function(){return this.values},t.prototype.sliceInner=function(e,n){return 0==e&&n==this.length?this:new t(this.values.slice(e,n))},t.prototype.getInner=function(e){return this.values[e]},t.prototype.forEachInner=function(e,t,n,r){for(var i=t;i<n;i++)if(!1===e(this.values[i],r+i))return!1},t.prototype.forEachInvertedInner=function(e,t,n,r){for(var i=t-1;i>=n;i--)if(!1===e(this.values[i],r+i))return!1},t.prototype.leafAppend=function(e){if(this.length+e.length<=200)return new t(this.values.concat(e.flatten()))},t.prototype.leafPrepend=function(e){if(this.length+e.length<=200)return new t(e.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(t.prototype,n),t}(Zr);Zr.empty=new Zi([]);var Zo=function(e){function t(t,n){e.call(this),this.left=t,this.right=n,this.length=t.length+n.length,this.depth=Math.max(t.depth,n.depth)+1}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},t.prototype.getInner=function(e){return e<this.left.length?this.left.get(e):this.right.get(e-this.left.length)},t.prototype.forEachInner=function(e,t,n,r){var i=this.left.length;if(t<i&&!1===this.left.forEachInner(e,t,Math.min(n,i),r)||n>i&&!1===this.right.forEachInner(e,Math.max(t-i,0),Math.min(this.length,n)-i,r+i))return!1},t.prototype.forEachInvertedInner=function(e,t,n,r){var i=this.left.length;if(t>i&&!1===this.right.forEachInvertedInner(e,t-i,Math.max(n,i)-i,r+i)||n<i&&!1===this.left.forEachInvertedInner(e,Math.min(t,i),n,r))return!1},t.prototype.sliceInner=function(e,t){if(0==e&&t==this.length)return this;var n=this.left.length;return t<=n?this.left.slice(e,t):e>=n?this.right.slice(e-n,t-n):this.left.slice(e,n).append(this.right.slice(0,t-n))},t.prototype.leafAppend=function(e){var n=this.right.leafAppend(e);if(n)return new t(this.left,n)},t.prototype.leafPrepend=function(e){var n=this.left.leafPrepend(e);if(n)return new t(n,this.right)},t.prototype.appendInner=function(e){return this.left.depth>=Math.max(this.right.depth,e.depth)+1?new t(this.left,new t(this.right,e)):new t(this,e)},t}(Zr);class Za{constructor(e,t){this.items=e,this.eventCount=t}popEvent(e,t){let n,r;if(0==this.eventCount)return null;let i=this.items.length;for(;;i--)if(this.items.get(i-1).selection){--i;break}t&&(r=(n=this.remapping(i,this.items.length)).maps.length);let o=e.tr,a,u,s=[],l=[];return this.items.forEach((e,t)=>{if(!e.step){n||(r=(n=this.remapping(i,t+1)).maps.length),r--,l.push(e);return}if(n){l.push(new Zu(e.map));let t=e.step.map(n.slice(r)),i;t&&o.maybeStep(t).doc&&(i=o.mapping.maps[o.mapping.maps.length-1],s.push(new Zu(i,void 0,void 0,s.length+l.length))),r--,i&&n.appendMap(i,r)}else o.maybeStep(e.step);if(e.selection)return a=n?e.selection.map(n.slice(r)):e.selection,u=new Za(this.items.slice(0,i).append(l.reverse().concat(s)),this.eventCount-1),!1},this.items.length,0),{remaining:u,transform:o,selection:a}}addTransform(e,t,n,r){var i,o;let a,u=[],s=this.eventCount,l=this.items,c=!r&&l.length?l.get(l.length-1):null;for(let n=0;n<e.steps.length;n++){let i=e.steps[n].invert(e.docs[n]),o=new Zu(e.mapping.maps[n],i,t),a;(a=c&&c.merge(o))&&(o=a,n?u.pop():l=l.slice(0,l.length-1)),u.push(o),t&&(s++,t=void 0),r||(c=o)}let d=s-n.depth;return d>Zl&&(i=l,o=d,i.forEach((e,t)=>{if(e.selection&&0==o--)return a=t,!1}),l=i.slice(a),s-=d),new Za(l.append(u),s)}remapping(e,t){let n=new zc;return this.items.forEach((t,r)=>{let i=null!=t.mirrorOffset&&r-t.mirrorOffset>=e?n.maps.length-t.mirrorOffset:void 0;n.appendMap(t.map,i)},e,t),n}addMaps(e){return 0==this.eventCount?this:new Za(this.items.append(e.map(e=>new Zu(e))),this.eventCount)}rebased(e,t){if(!this.eventCount)return this;let n=[],r=Math.max(0,this.items.length-t),i=e.mapping,o=e.steps.length,a=this.eventCount;this.items.forEach(e=>{e.selection&&a--},r);let u=t;this.items.forEach(t=>{let r=i.getMirror(--u);if(null==r)return;o=Math.min(o,r);let s=i.maps[r];if(t.step){let o=e.steps[r].invert(e.docs[r]),l=t.selection&&t.selection.map(i.slice(u+1,r));l&&a++,n.push(new Zu(s,o,l))}else n.push(new Zu(s))},r);let s=[];for(let e=t;e<o;e++)s.push(new Zu(i.maps[e]));let l=new Za(this.items.slice(0,r).append(s).append(n),a);return l.emptyItemCount()>500&&(l=l.compress(this.items.length-n.length)),l}emptyItemCount(){let e=0;return this.items.forEach(t=>{t.step||e++}),e}compress(e=this.items.length){let t=this.remapping(0,e),n=t.maps.length,r=[],i=0;return this.items.forEach((o,a)=>{if(a>=e)r.push(o),o.selection&&i++;else if(o.step){let e=o.step.map(t.slice(n)),a=e&&e.getMap();if(n--,a&&t.appendMap(a,n),e){let u=o.selection&&o.selection.map(t.slice(n));u&&i++;let s=new Zu(a.invert(),e,u),l,c=r.length-1;(l=r.length&&r[c].merge(s))?r[c]=l:r.push(s)}}else o.map&&n--},this.items.length,0),new Za(Zr.from(r.reverse()),i)}}Za.empty=new Za(Zr.empty,0);class Zu{constructor(e,t,n,r){this.map=e,this.step=t,this.selection=n,this.mirrorOffset=r}merge(e){if(this.step&&e.step&&!e.selection){let t=e.step.merge(this.step);if(t)return new Zu(t.getMap().invert(),t,this.selection)}}}class Zs{constructor(e,t,n,r,i){this.done=e,this.undone=t,this.prevRanges=n,this.prevTime=r,this.prevComposition=i}}let Zl=20;function Zc(e){let t=[];return e.forEach((e,n,r,i)=>t.push(r,i)),t}function Zd(e,t){if(!e)return null;let n=[];for(let r=0;r<e.length;r+=2){let i=t.map(e[r],1),o=t.map(e[r+1],-1);i<=o&&n.push(i,o)}return n}function Zf(e,t,n,r){let i=Zh(t),o=Zm.get(t).spec.config,a=(r?e.undone:e.done).popEvent(t,i);if(!a)return;let u=a.selection.resolve(a.transform.doc),s=(r?e.done:e.undone).addTransform(a.transform,t.selection.getBookmark(),o,i),l=new Zs(r?s:a.remaining,r?a.remaining:s,null,0,-1);n(a.transform.setSelection(u).setMeta(Zm,{redo:r,historyState:l}).scrollIntoView())}let Zp=!1,ZA=null;function Zh(e){let t=e.plugins;if(ZA!=t){Zp=!1,ZA=t;for(let e=0;e<t.length;e++)if(t[e].spec.historyPreserveItems){Zp=!0;break}}return Zp}let Zm=new z1("history"),Zg=new z1("closeHistory"),Zy=(e,t)=>{let n=Zm.getState(e);return!!n&&0!=n.done.eventCount&&(t&&Zf(n,e,t,!1),!0)},Zv=(e,t)=>{let n=Zm.getState(e);return!!n&&0!=n.undone.eventCount&&(t&&Zf(n,e,t,!0),!0)},Zx=GU.create({name:"history",addOptions:()=>({depth:100,newGroupDelay:500}),addCommands:()=>({undo:()=>({state:e,dispatch:t})=>Zy(e,t),redo:()=>({state:e,dispatch:t})=>Zv(e,t)}),addProseMirrorPlugins(){return[function(e={}){return new z$({key:Zm,state:{init:()=>new Zs(Za.empty,Za.empty,null,0,-1),apply:(t,n,r)=>(function(e,t,n,r){let i=n.getMeta(Zm),o;if(i)return i.historyState;n.getMeta(Zg)&&(e=new Zs(e.done,e.undone,null,0,-1));let a=n.getMeta("appendedTransaction");if(0==n.steps.length)return e;if(a&&a.getMeta(Zm))return a.getMeta(Zm).redo?new Zs(e.done.addTransform(n,void 0,r,Zh(t)),e.undone,Zc(n.mapping.maps[n.steps.length-1]),e.prevTime,e.prevComposition):new Zs(e.done,e.undone.addTransform(n,void 0,r,Zh(t)),null,e.prevTime,e.prevComposition);if(!1===n.getMeta("addToHistory")||a&&!1===a.getMeta("addToHistory"))return(o=n.getMeta("rebased"))?new Zs(e.done.rebased(n,o),e.undone.rebased(n,o),Zd(e.prevRanges,n.mapping),e.prevTime,e.prevComposition):new Zs(e.done.addMaps(n.mapping.maps),e.undone.addMaps(n.mapping.maps),Zd(e.prevRanges,n.mapping),e.prevTime,e.prevComposition);{let i=n.getMeta("composition"),o=0==e.prevTime||!a&&e.prevComposition!=i&&(e.prevTime<(n.time||0)-r.newGroupDelay||!function(e,t){if(!t)return!1;if(!e.docChanged)return!0;let n=!1;return e.mapping.maps[0].forEach((e,r)=>{for(let i=0;i<t.length;i+=2)e<=t[i+1]&&r>=t[i]&&(n=!0)}),n}(n,e.prevRanges)),u=a?Zd(e.prevRanges,n.mapping):Zc(n.mapping.maps[n.steps.length-1]);return new Zs(e.done.addTransform(n,o?t.selection.getBookmark():void 0,r,Zh(t)),Za.empty,u,n.time,i??e.prevComposition)}})(n,r,t,e)},config:e={depth:e.depth||100,newGroupDelay:e.newGroupDelay||500},props:{handleDOMEvents:{beforeinput(e,t){let n=t.inputType,r="historyUndo"==n?Zy:"historyRedo"==n?Zv:null;return!!r&&(t.preventDefault(),r(e.state,e.dispatch))}}}})}(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}});var Zb="bottom",ZC="right",ZS="left",Zw="auto",ZI=["top",Zb,ZC,ZS],Z_="start",ZT="viewport",ZO="popper",ZR=ZI.reduce(function(e,t){return e.concat([t+"-"+Z_,t+"-end"])},[]),Zk=[].concat(ZI,[Zw]).reduce(function(e,t){return e.concat([t,t+"-"+Z_,t+"-end"])},[]),ZE=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function ZM(e){return e?(e.nodeName||"").toLowerCase():null}function Zj(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function ZF(e){var t=Zj(e).Element;return e instanceof t||e instanceof Element}function ZU(e){var t=Zj(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function ZL(e){if(typeof ShadowRoot>"u")return!1;var t=Zj(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}let ZK={name:"applyStyles",enabled:!0,phase:"write",fn:function(e){var t=e.state;Object.keys(t.elements).forEach(function(e){var n=t.styles[e]||{},r=t.attributes[e]||{},i=t.elements[e];ZU(i)&&ZM(i)&&(Object.assign(i.style,n),Object.keys(r).forEach(function(e){var t=r[e];!1===t?i.removeAttribute(e):i.setAttribute(e,!0===t?"":t)}))})},effect:function(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach(function(e){var r=t.elements[e],i=t.attributes[e]||{},o=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:n[e]).reduce(function(e,t){return e[t]="",e},{});ZU(r)&&ZM(r)&&(Object.assign(r.style,o),Object.keys(i).forEach(function(e){r.removeAttribute(e)}))})}},requires:["computeStyles"]};function ZB(e){return e.split("-")[0]}var ZP=Math.max,ZW=Math.min,ZD=Math.round;function ZN(){var e=navigator.userAgentData;return null!=e&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function Zq(){return!/^((?!chrome|android).)*safari/i.test(ZN())}function ZQ(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);var r=e.getBoundingClientRect(),i=1,o=1;t&&ZU(e)&&(i=e.offsetWidth>0&&ZD(r.width)/e.offsetWidth||1,o=e.offsetHeight>0&&ZD(r.height)/e.offsetHeight||1);var a=(ZF(e)?Zj(e):window).visualViewport,u=!Zq()&&n,s=(r.left+(u&&a?a.offsetLeft:0))/i,l=(r.top+(u&&a?a.offsetTop:0))/o,c=r.width/i,d=r.height/o;return{width:c,height:d,top:l,right:s+c,bottom:l+d,left:s,x:s,y:l}}function ZV(e){var t=ZQ(e),n=e.offsetWidth,r=e.offsetHeight;return 1>=Math.abs(t.width-n)&&(n=t.width),1>=Math.abs(t.height-r)&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function Zz(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&ZL(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function ZY(e){return Zj(e).getComputedStyle(e)}function ZH(e){return((ZF(e)?e.ownerDocument:e.document)||window.document).documentElement}function ZG(e){return"html"===ZM(e)?e:e.assignedSlot||e.parentNode||(ZL(e)?e.host:null)||ZH(e)}function ZZ(e){return ZU(e)&&"fixed"!==ZY(e).position?e.offsetParent:null}function ZJ(e){for(var t=Zj(e),n=ZZ(e);n&&["table","td","th"].indexOf(ZM(n))>=0&&"static"===ZY(n).position;)n=ZZ(n);return n&&("html"===ZM(n)||"body"===ZM(n)&&"static"===ZY(n).position)?t:n||function(e){var t=/firefox/i.test(ZN());if(/Trident/i.test(ZN())&&ZU(e)&&"fixed"===ZY(e).position)return null;var n=ZG(e);for(ZL(n)&&(n=n.host);ZU(n)&&0>["html","body"].indexOf(ZM(n));){var r=ZY(n);if("none"!==r.transform||"none"!==r.perspective||"paint"===r.contain||-1!==["transform","perspective"].indexOf(r.willChange)||t&&"filter"===r.willChange||t&&r.filter&&"none"!==r.filter)return n;n=n.parentNode}return null}(e)||t}function Z$(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function ZX(e,t,n){return ZP(e,ZW(t,n))}function Z0(){return{top:0,right:0,bottom:0,left:0}}function Z1(e){return Object.assign({},Z0(),e)}function Z2(e,t){return t.reduce(function(t,n){return t[n]=e,t},{})}function Z6(e){return e.split("-")[1]}var Z5={top:"auto",right:"auto",bottom:"auto",left:"auto"};function Z3(e){var t,n,r,i,o,a,u,s=e.popper,l=e.popperRect,c=e.placement,d=e.variation,f=e.offsets,p=e.position,A=e.gpuAcceleration,h=e.adaptive,m=e.roundOffsets,g=e.isFixed,y=f.x,v=void 0===y?0:y,x=f.y,b=void 0===x?0:x,C="function"==typeof m?m({x:v,y:b}):{x:v,y:b};v=C.x,b=C.y;var S=f.hasOwnProperty("x"),w=f.hasOwnProperty("y"),I=ZS,_="top",T=window;if(h){var O=ZJ(s),R="clientHeight",k="clientWidth";O===Zj(s)&&"static"!==ZY(O=ZH(s)).position&&"absolute"===p&&(R="scrollHeight",k="scrollWidth"),("top"===c||(c===ZS||c===ZC)&&"end"===d)&&(_=Zb,b-=(g&&O===T&&T.visualViewport?T.visualViewport.height:O[R])-l.height,b*=A?1:-1),(c===ZS||("top"===c||c===Zb)&&"end"===d)&&(I=ZC,v-=(g&&O===T&&T.visualViewport?T.visualViewport.width:O[k])-l.width,v*=A?1:-1)}var E=Object.assign({position:p},h&&Z5),M=!0===m?(t={x:v,y:b},n=Zj(s),r=t.x,i=t.y,{x:ZD(r*(o=n.devicePixelRatio||1))/o||0,y:ZD(i*o)/o||0}):{x:v,y:b};return(v=M.x,b=M.y,A)?Object.assign({},E,((a={})[_]=w?"0":"",a[I]=S?"0":"",a.transform=1>=(T.devicePixelRatio||1)?"translate("+v+"px, "+b+"px)":"translate3d("+v+"px, "+b+"px, 0)",a)):Object.assign({},E,((u={})[_]=w?b+"px":"",u[I]=S?v+"px":"",u.transform="",u))}var Z9={passive:!0},Z4={left:"right",right:"left",bottom:"top",top:"bottom"};function Z7(e){return e.replace(/left|right|bottom|top/g,function(e){return Z4[e]})}var Z8={start:"end",end:"start"};function Je(e){return e.replace(/start|end/g,function(e){return Z8[e]})}function Jt(e){var t=Zj(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function Jn(e){return ZQ(ZH(e)).left+Jt(e).scrollLeft}function Jr(e){var t=ZY(e),n=t.overflow,r=t.overflowX,i=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}function Ji(e,t){void 0===t&&(t=[]);var n,r=function e(t){return["html","body","#document"].indexOf(ZM(t))>=0?t.ownerDocument.body:ZU(t)&&Jr(t)?t:e(ZG(t))}(e),i=r===(null==(n=e.ownerDocument)?void 0:n.body),o=Zj(r),a=i?[o].concat(o.visualViewport||[],Jr(r)?r:[]):r,u=t.concat(a);return i?u:u.concat(Ji(ZG(a)))}function Jo(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function Ja(e,t,n){var r,i,o,a,u,s,l,c,d,f;return t===ZT?Jo(function(e,t){var n=Zj(e),r=ZH(e),i=n.visualViewport,o=r.clientWidth,a=r.clientHeight,u=0,s=0;if(i){o=i.width,a=i.height;var l=Zq();(l||!l&&"fixed"===t)&&(u=i.offsetLeft,s=i.offsetTop)}return{width:o,height:a,x:u+Jn(e),y:s}}(e,n)):ZF(t)?((r=ZQ(t,!1,"fixed"===n)).top=r.top+t.clientTop,r.left=r.left+t.clientLeft,r.bottom=r.top+t.clientHeight,r.right=r.left+t.clientWidth,r.width=t.clientWidth,r.height=t.clientHeight,r.x=r.left,r.y=r.top,r):Jo((i=ZH(e),a=ZH(i),u=Jt(i),s=null==(o=i.ownerDocument)?void 0:o.body,l=ZP(a.scrollWidth,a.clientWidth,s?s.scrollWidth:0,s?s.clientWidth:0),c=ZP(a.scrollHeight,a.clientHeight,s?s.scrollHeight:0,s?s.clientHeight:0),d=-u.scrollLeft+Jn(i),f=-u.scrollTop,"rtl"===ZY(s||a).direction&&(d+=ZP(a.clientWidth,s?s.clientWidth:0)-l),{width:l,height:c,x:d,y:f}))}function Ju(e){var t,n=e.reference,r=e.element,i=e.placement,o=i?ZB(i):null,a=i?Z6(i):null,u=n.x+n.width/2-r.width/2,s=n.y+n.height/2-r.height/2;switch(o){case"top":t={x:u,y:n.y-r.height};break;case Zb:t={x:u,y:n.y+n.height};break;case ZC:t={x:n.x+n.width,y:s};break;case ZS:t={x:n.x-r.width,y:s};break;default:t={x:n.x,y:n.y}}var l=o?Z$(o):null;if(null!=l){var c="y"===l?"height":"width";switch(a){case Z_:t[l]=t[l]-(n[c]/2-r[c]/2);break;case"end":t[l]=t[l]+(n[c]/2-r[c]/2)}}return t}function Js(e,t){void 0===t&&(t={});var n,r,i,o,a,u,s,l,c=t,d=c.placement,f=void 0===d?e.placement:d,p=c.strategy,A=void 0===p?e.strategy:p,h=c.boundary,m=c.rootBoundary,g=c.elementContext,y=void 0===g?ZO:g,v=c.altBoundary,x=c.padding,b=void 0===x?0:x,C=Z1("number"!=typeof b?b:Z2(b,ZI)),S=e.rects.popper,w=e.elements[void 0!==v&&v?y===ZO?"reference":ZO:y],I=(n=ZF(w)?w:w.contextElement||ZH(e.elements.popper),r=void 0===h?"clippingParents":h,i=void 0===m?ZT:m,s=(u=[].concat("clippingParents"===r?(o=Ji(ZG(n)),ZF(a=["absolute","fixed"].indexOf(ZY(n).position)>=0&&ZU(n)?ZJ(n):n)?o.filter(function(e){return ZF(e)&&Zz(e,a)&&"body"!==ZM(e)}):[]):[].concat(r),[i]))[0],(l=u.reduce(function(e,t){var r=Ja(n,t,A);return e.top=ZP(r.top,e.top),e.right=ZW(r.right,e.right),e.bottom=ZW(r.bottom,e.bottom),e.left=ZP(r.left,e.left),e},Ja(n,s,A))).width=l.right-l.left,l.height=l.bottom-l.top,l.x=l.left,l.y=l.top,l),_=ZQ(e.elements.reference),T=Ju({reference:_,element:S,strategy:"absolute",placement:f}),O=Jo(Object.assign({},S,T)),R=y===ZO?O:_,k={top:I.top-R.top+C.top,bottom:R.bottom-I.bottom+C.bottom,left:I.left-R.left+C.left,right:R.right-I.right+C.right},E=e.modifiersData.offset;if(y===ZO&&E){var M=E[f];Object.keys(k).forEach(function(e){var t=[ZC,Zb].indexOf(e)>=0?1:-1,n=["top",Zb].indexOf(e)>=0?"y":"x";k[e]+=M[n]*t})}return k}function Jl(e,t,n){return void 0===n&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function Jc(e){return["top",ZC,Zb,ZS].some(function(t){return e[t]>=0})}var Jd={placement:"bottom",modifiers:[],strategy:"absolute"};function Jf(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return!t.some(function(e){return!(e&&"function"==typeof e.getBoundingClientRect)})}var Jp=(f=void 0===(d=(c={defaultModifiers:[{name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(e){var t=e.state,n=e.instance,r=e.options,i=r.scroll,o=void 0===i||i,a=r.resize,u=void 0===a||a,s=Zj(t.elements.popper),l=[].concat(t.scrollParents.reference,t.scrollParents.popper);return o&&l.forEach(function(e){e.addEventListener("scroll",n.update,Z9)}),u&&s.addEventListener("resize",n.update,Z9),function(){o&&l.forEach(function(e){e.removeEventListener("scroll",n.update,Z9)}),u&&s.removeEventListener("resize",n.update,Z9)}},data:{}},{name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state,n=e.name;t.modifiersData[n]=Ju({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})},data:{}},{name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(e){var t=e.state,n=e.options,r=n.gpuAcceleration,i=n.adaptive,o=n.roundOffsets,a=void 0===o||o,u={placement:ZB(t.placement),variation:Z6(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:void 0===r||r,isFixed:"fixed"===t.options.strategy};null!=t.modifiersData.popperOffsets&&(t.styles.popper=Object.assign({},t.styles.popper,Z3(Object.assign({},u,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:void 0===i||i,roundOffsets:a})))),null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign({},t.styles.arrow,Z3(Object.assign({},u,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:a})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})},data:{}},ZK,{name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(e){var t=e.state,n=e.options,r=e.name,i=n.offset,o=void 0===i?[0,0]:i,a=Zk.reduce(function(e,n){var r,i,a,u,s,l;return e[n]=(r=t.rects,a=[ZS,"top"].indexOf(i=ZB(n))>=0?-1:1,s=(u="function"==typeof o?o(Object.assign({},r,{placement:n})):o)[0],l=u[1],s=s||0,l=(l||0)*a,[ZS,ZC].indexOf(i)>=0?{x:l,y:s}:{x:s,y:l}),e},{}),u=a[t.placement],s=u.x,l=u.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=s,t.modifiersData.popperOffsets.y+=l),t.modifiersData[r]=a}},{name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var i=n.mainAxis,o=void 0===i||i,a=n.altAxis,u=void 0===a||a,s=n.fallbackPlacements,l=n.padding,c=n.boundary,d=n.rootBoundary,f=n.altBoundary,p=n.flipVariations,A=void 0===p||p,h=n.allowedAutoPlacements,m=t.options.placement,g=ZB(m),y=g===m,v=s||(y||!A?[Z7(m)]:function(e){if(ZB(e)===Zw)return[];var t=Z7(e);return[Je(e),t,Je(t)]}(m)),x=[m].concat(v).reduce(function(e,n){var r,i,o,a,u,s,f,p,m,g,y,v;return e.concat(ZB(n)===Zw?(i=(r={placement:n,boundary:c,rootBoundary:d,padding:l,flipVariations:A,allowedAutoPlacements:h}).placement,o=r.boundary,a=r.rootBoundary,u=r.padding,s=r.flipVariations,p=void 0===(f=r.allowedAutoPlacements)?Zk:f,0===(y=(g=(m=Z6(i))?s?ZR:ZR.filter(function(e){return Z6(e)===m}):ZI).filter(function(e){return p.indexOf(e)>=0})).length&&(y=g),Object.keys(v=y.reduce(function(e,n){return e[n]=Js(t,{placement:n,boundary:o,rootBoundary:a,padding:u})[ZB(n)],e},{})).sort(function(e,t){return v[e]-v[t]})):n)},[]),b=t.rects.reference,C=t.rects.popper,S=new Map,w=!0,I=x[0],_=0;_<x.length;_++){var T=x[_],O=ZB(T),R=Z6(T)===Z_,k=["top",Zb].indexOf(O)>=0,E=k?"width":"height",M=Js(t,{placement:T,boundary:c,rootBoundary:d,altBoundary:f,padding:l}),j=k?R?ZC:ZS:R?Zb:"top";b[E]>C[E]&&(j=Z7(j));var F=Z7(j),U=[];if(o&&U.push(M[O]<=0),u&&U.push(M[j]<=0,M[F]<=0),U.every(function(e){return e})){I=T,w=!1;break}S.set(T,U)}if(w)for(var L=A?3:1,K=function(e){var t=x.find(function(t){var n=S.get(t);if(n)return n.slice(0,e).every(function(e){return e})});if(t)return I=t,"break"},B=L;B>0&&"break"!==K(B);B--);t.placement!==I&&(t.modifiersData[r]._skip=!0,t.placement=I,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}},{name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name,i=n.mainAxis,o=n.altAxis,a=n.boundary,u=n.rootBoundary,s=n.altBoundary,l=n.padding,c=n.tether,d=void 0===c||c,f=n.tetherOffset,p=void 0===f?0:f,A=Js(t,{boundary:a,rootBoundary:u,padding:l,altBoundary:s}),h=ZB(t.placement),m=Z6(t.placement),g=!m,y=Z$(h),v="x"===y?"y":"x",x=t.modifiersData.popperOffsets,b=t.rects.reference,C=t.rects.popper,S="function"==typeof p?p(Object.assign({},t.rects,{placement:t.placement})):p,w="number"==typeof S?{mainAxis:S,altAxis:S}:Object.assign({mainAxis:0,altAxis:0},S),I=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,_={x:0,y:0};if(x){if(void 0===i||i){var T,O="y"===y?"top":ZS,R="y"===y?Zb:ZC,k="y"===y?"height":"width",E=x[y],M=E+A[O],j=E-A[R],F=d?-C[k]/2:0,U=m===Z_?b[k]:C[k],L=m===Z_?-C[k]:-b[k],K=t.elements.arrow,B=d&&K?ZV(K):{width:0,height:0},P=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:Z0(),W=P[O],D=P[R],N=ZX(0,b[k],B[k]),q=g?b[k]/2-F-N-W-w.mainAxis:U-N-W-w.mainAxis,Q=g?-b[k]/2+F+N+D+w.mainAxis:L+N+D+w.mainAxis,V=t.elements.arrow&&ZJ(t.elements.arrow),z=V?"y"===y?V.clientTop||0:V.clientLeft||0:0,Y=null!=(T=null==I?void 0:I[y])?T:0,H=ZX(d?ZW(M,E+q-Y-z):M,E,d?ZP(j,E+Q-Y):j);x[y]=H,_[y]=H-E}if(void 0!==o&&o){var G,Z,J="x"===y?"top":ZS,$="x"===y?Zb:ZC,X=x[v],ee="y"===v?"height":"width",et=X+A[J],en=X-A[$],er=-1!==["top",ZS].indexOf(h),ei=null!=(Z=null==I?void 0:I[v])?Z:0,eo=er?et:X-b[ee]-C[ee]-ei+w.altAxis,ea=er?X+b[ee]+C[ee]-ei-w.altAxis:en,eu=d&&er?(G=ZX(eo,X,ea))>ea?ea:G:ZX(d?eo:et,X,d?ea:en);x[v]=eu,_[v]=eu-X}t.modifiersData[r]=_}},requiresIfExists:["offset"]},{name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,n=e.state,r=e.name,i=e.options,o=n.elements.arrow,a=n.modifiersData.popperOffsets,u=ZB(n.placement),s=Z$(u),l=[ZS,ZC].indexOf(u)>=0?"height":"width";if(!(!o||!a)){var c,d=Z1("number"!=typeof(c="function"==typeof(c=i.padding)?c(Object.assign({},n.rects,{placement:n.placement})):c)?c:Z2(c,ZI)),f=ZV(o),p="y"===s?"top":ZS,A="y"===s?Zb:ZC,h=n.rects.reference[l]+n.rects.reference[s]-a[s]-n.rects.popper[l],m=a[s]-n.rects.reference[s],g=ZJ(o),y=g?"y"===s?g.clientHeight||0:g.clientWidth||0:0,v=d[p],x=y-f[l]-d[A],b=y/2-f[l]/2+(h/2-m/2),C=ZX(v,b,x);n.modifiersData[r]=((t={})[s]=C,t.centerOffset=C-b,t)}},effect:function(e){var t=e.state,n=e.options.element,r=void 0===n?"[data-popper-arrow]":n;null==r||("string"!=typeof r||(r=t.elements.popper.querySelector(r)))&&Zz(t.elements.popper,r)&&(t.elements.arrow=r)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]},{name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(e){var t=e.state,n=e.name,r=t.rects.reference,i=t.rects.popper,o=t.modifiersData.preventOverflow,a=Js(t,{elementContext:"reference"}),u=Js(t,{altBoundary:!0}),s=Jl(a,r),l=Jl(u,i,o),c=Jc(s),d=Jc(l);t.modifiersData[n]={referenceClippingOffsets:s,popperEscapeOffsets:l,isReferenceHidden:c,hasPopperEscaped:d},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":c,"data-popper-escaped":d})}}]}).defaultModifiers)?[]:d,A=void 0===(p=c.defaultOptions)?Jd:p,function(e,t,n){void 0===n&&(n=A);var r,i,o={placement:"bottom",orderedModifiers:[],options:Object.assign({},Jd,A),modifiersData:{},elements:{reference:e,popper:t},attributes:{},styles:{}},a=[],u=!1,s={state:o,setOptions:function(n){var r,i,u,c,d,p="function"==typeof n?n(o.options):n;l(),o.options=Object.assign({},A,o.options,p),o.scrollParents={reference:ZF(e)?Ji(e):e.contextElement?Ji(e.contextElement):[],popper:Ji(t)};var h=(i=Object.keys(r=[].concat(f,o.options.modifiers).reduce(function(e,t){var n=e[t.name];return e[t.name]=n?Object.assign({},n,t,{options:Object.assign({},n.options,t.options),data:Object.assign({},n.data,t.data)}):t,e},{})).map(function(e){return r[e]}),u=new Map,c=new Set,d=[],i.forEach(function(e){u.set(e.name,e)}),i.forEach(function(e){c.has(e.name)||function e(t){c.add(t.name),[].concat(t.requires||[],t.requiresIfExists||[]).forEach(function(t){if(!c.has(t)){var n=u.get(t);n&&e(n)}}),d.push(t)}(e)}),ZE.reduce(function(e,t){return e.concat(d.filter(function(e){return e.phase===t}))},[]));return o.orderedModifiers=h.filter(function(e){return e.enabled}),o.orderedModifiers.forEach(function(e){var t=e.name,n=e.options,r=e.effect;if("function"==typeof r){var i=r({state:o,name:t,instance:s,options:void 0===n?{}:n});a.push(i||function(){})}}),s.update()},forceUpdate:function(){if(!u){var e=o.elements,t=e.reference,n=e.popper;if(Jf(t,n)){o.rects={reference:(r=ZJ(n),i="fixed"===o.options.strategy,d=ZU(r),f=ZU(r)&&(l=ZD((a=r.getBoundingClientRect()).width)/r.offsetWidth||1,c=ZD(a.height)/r.offsetHeight||1,1!==l||1!==c),p=ZH(r),A=ZQ(t,f,i),h={scrollLeft:0,scrollTop:0},m={x:0,y:0},(d||!d&&!i)&&(("body"!==ZM(r)||Jr(p))&&(h=r!==Zj(r)&&ZU(r)?{scrollLeft:r.scrollLeft,scrollTop:r.scrollTop}:Jt(r)),ZU(r)?(m=ZQ(r,!0),m.x+=r.clientLeft,m.y+=r.clientTop):p&&(m.x=Jn(p))),{x:A.left+h.scrollLeft-m.x,y:A.top+h.scrollTop-m.y,width:A.width,height:A.height}),popper:ZV(n)},o.reset=!1,o.placement=o.options.placement,o.orderedModifiers.forEach(function(e){return o.modifiersData[e.name]=Object.assign({},e.data)});for(var r,i,a,l,c,d,f,p,A,h,m,g=0;g<o.orderedModifiers.length;g++){if(!0===o.reset){o.reset=!1,g=-1;continue}var y=o.orderedModifiers[g],v=y.fn,x=y.options,b=void 0===x?{}:x,C=y.name;"function"==typeof v&&(o=v({state:o,options:b,name:C,instance:s})||o)}}}},update:(r=function(){return new Promise(function(e){s.forceUpdate(),e(o)})},function(){return i||(i=new Promise(function(e){Promise.resolve().then(function(){i=void 0,e(r())})})),i}),destroy:function(){l(),u=!0}};if(!Jf(e,t))return s;function l(){a.forEach(function(e){return e()}),a=[]}return s.setOptions(n).then(function(e){!u&&n.onFirstUpdate&&n.onFirstUpdate(e)}),s}),JA="tippy-content",Jh="tippy-arrow",Jm="tippy-svg-arrow",Jg={passive:!0,capture:!0},Jy=function(){return document.body};function Jv(e,t,n){return Array.isArray(e)?e[t]??(Array.isArray(n)?n[t]:n):e}function Jx(e,t){var n=({}).toString.call(e);return 0===n.indexOf("[object")&&n.indexOf(t+"]")>-1}function Jb(e,t){return"function"==typeof e?e.apply(void 0,t):e}function JC(e,t){var n;return 0===t?e:function(r){clearTimeout(n),n=setTimeout(function(){e(r)},t)}}function JS(e){return[].concat(e)}function Jw(e,t){-1===e.indexOf(t)&&e.push(t)}function JI(e){return[].slice.call(e)}function J_(e){return Object.keys(e).reduce(function(t,n){return void 0!==e[n]&&(t[n]=e[n]),t},{})}function JT(){return document.createElement("div")}function JO(e){return["Element","Fragment"].some(function(t){return Jx(e,t)})}function JR(e,t){e.forEach(function(e){e&&(e.style.transitionDuration=t+"ms")})}function Jk(e,t){e.forEach(function(e){e&&e.setAttribute("data-state",t)})}function JE(e,t,n){var r=t+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(t){e[r](t,n)})}function JM(e,t){for(var n,r=t;r;){if(e.contains(r))return!0;r=null==r.getRootNode||null==(n=r.getRootNode())?void 0:n.host}return!1}var Jj={isTouch:!1},JF=0;function JU(){Jj.isTouch||(Jj.isTouch=!0,window.performance&&document.addEventListener("mousemove",JL))}function JL(){var e=performance.now();e-JF<20&&(Jj.isTouch=!1,document.removeEventListener("mousemove",JL)),JF=e}function JK(){var e=document.activeElement;if(e&&e._tippy&&e._tippy.reference===e){var t=e._tippy;e.blur&&!t.state.isVisible&&e.blur()}}var JB=!!("u">typeof window&&"u">typeof document)&&!!window.msCrypto,JP=Object.assign({appendTo:Jy,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}),JW=Object.keys(JP);function JD(e){var t=(e.plugins||[]).reduce(function(t,n){var r,i=n.name,o=n.defaultValue;return i&&(t[i]=void 0!==e[i]?e[i]:null!=(r=JP[i])?r:o),t},{});return Object.assign({},e,t)}function JN(e,t){var n,r=Object.assign({},t,{content:Jb(t.content,[e])},t.ignoreAttributes?{}:((n=t.plugins)?Object.keys(JD(Object.assign({},JP,{plugins:n}))):JW).reduce(function(t,n){var r=(e.getAttribute("data-tippy-"+n)||"").trim();if(!r)return t;if("content"===n)t[n]=r;else try{t[n]=JSON.parse(r)}catch{t[n]=r}return t},{}));return r.aria=Object.assign({},JP.aria,r.aria),r.aria={expanded:"auto"===r.aria.expanded?t.interactive:r.aria.expanded,content:"auto"===r.aria.content?t.interactive?null:"describedby":r.aria.content},r}function Jq(e,t){e.innerHTML=t}function JQ(e){var t=JT();return!0===e?t.className=Jh:(t.className=Jm,JO(e)?t.appendChild(e):Jq(t,e)),t}function JV(e,t){JO(t.content)?(Jq(e,""),e.appendChild(t.content)):"function"!=typeof t.content&&(t.allowHTML?Jq(e,t.content):e.textContent=t.content)}function Jz(e){var t=e.firstElementChild,n=JI(t.children);return{box:t,content:n.find(function(e){return e.classList.contains(JA)}),arrow:n.find(function(e){return e.classList.contains(Jh)||e.classList.contains(Jm)}),backdrop:n.find(function(e){return e.classList.contains("tippy-backdrop")})}}function JY(e){var t=JT(),n=JT();n.className="tippy-box",n.setAttribute("data-state","hidden"),n.setAttribute("tabindex","-1");var r=JT();function i(n,r){var i=Jz(t),o=i.box,a=i.content,u=i.arrow;r.theme?o.setAttribute("data-theme",r.theme):o.removeAttribute("data-theme"),"string"==typeof r.animation?o.setAttribute("data-animation",r.animation):o.removeAttribute("data-animation"),r.inertia?o.setAttribute("data-inertia",""):o.removeAttribute("data-inertia"),o.style.maxWidth="number"==typeof r.maxWidth?r.maxWidth+"px":r.maxWidth,r.role?o.setAttribute("role",r.role):o.removeAttribute("role"),(n.content!==r.content||n.allowHTML!==r.allowHTML)&&JV(a,e.props),r.arrow?u?n.arrow!==r.arrow&&(o.removeChild(u),o.appendChild(JQ(r.arrow))):o.appendChild(JQ(r.arrow)):u&&o.removeChild(u)}return r.className=JA,r.setAttribute("data-state","hidden"),JV(r,e.props),t.appendChild(n),n.appendChild(r),i(e.props,e.props),{popper:t,onUpdate:i}}JY.$$tippy=!0;var JH=1,JG=[],JZ=[];function JJ(e,t){void 0===t&&(t={});var n=JP.plugins.concat(t.plugins||[]);document.addEventListener("touchstart",JU,Jg),window.addEventListener("blur",JK);var r=Object.assign({},t,{plugins:n}),i=(JO(e)?[e]:Jx(e,"NodeList")?JI(e):Array.isArray(e)?e:JI(document.querySelectorAll(e))).reduce(function(e,t){var n=t&&function(e,t){var n,r,i,o,a,u,s,l,c=JN(e,Object.assign({},JP,JD(J_(t)))),d=!1,f=!1,p=!1,A=!1,h=[],m=JC(V,c.interactiveDebounce),g=JH++,y=(n=c.plugins).filter(function(e,t){return n.indexOf(e)===t}),v={id:g,reference:e,popper:JT(),popperInstance:null,props:c,state:{isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},plugins:y,clearDelayTimeouts:function(){clearTimeout(r),clearTimeout(i),cancelAnimationFrame(o)},setProps:function(t){if(!v.state.isDestroyed){E("onBeforeUpdate",[v,t]),q();var n=v.props,r=JN(e,Object.assign({},n,J_(t),{ignoreAttributes:!0}));v.props=r,N(),n.interactiveDebounce!==r.interactiveDebounce&&(F(),m=JC(V,r.interactiveDebounce)),n.triggerTarget&&!r.triggerTarget?JS(n.triggerTarget).forEach(function(e){e.removeAttribute("aria-expanded")}):r.triggerTarget&&e.removeAttribute("aria-expanded"),j(),k(),C&&C(n,r),v.popperInstance&&(G(),J().forEach(function(e){requestAnimationFrame(e._tippy.popperInstance.forceUpdate)})),E("onAfterUpdate",[v,t])}},setContent:function(e){v.setProps({content:e})},show:function(){var t=v.state.isVisible,n=v.state.isDestroyed,r=!v.state.isEnabled,i=Jj.isTouch&&!v.props.touch,o=Jv(v.props.duration,0,JP.duration);if(!(t||n||r||i)&&!(l||e).hasAttribute("disabled")&&(E("onShow",[v],!1),!1!==v.props.onShow(v))){if(v.state.isVisible=!0,T()&&(b.style.visibility="visible"),k(),B(),v.state.isMounted||(b.style.transition="none"),T()){var a,u,c,d=Jz(b);JR([d.box,d.content],0)}s=function(){var e;if(!(!v.state.isVisible||A)){if(A=!0,b.offsetHeight,b.style.transition=v.props.moveTransition,T()&&v.props.animation){var t=Jz(b),n=t.box,r=t.content;JR([n,r],o),Jk([n,r],"visible")}M(),j(),Jw(JZ,v),null==(e=v.popperInstance)||e.forceUpdate(),E("onMount",[v]),v.props.animation&&T()&&W(o,function(){v.state.isShown=!0,E("onShown",[v])})}},u=v.props.appendTo,c=l||e,(a=v.props.interactive&&u===Jy||"parent"===u?c.parentNode:Jb(u,[c])).contains(b)||a.appendChild(b),v.state.isMounted=!0,G()}},hide:function(){var e=!v.state.isVisible,t=v.state.isDestroyed,n=!v.state.isEnabled,r=Jv(v.props.duration,1,JP.duration);if(!(e||t||n)&&(E("onHide",[v],!1),!1!==v.props.onHide(v))){if(v.state.isVisible=!1,v.state.isShown=!1,A=!1,d=!1,T()&&(b.style.visibility="hidden"),F(),P(),k(!0),T()){var i,o=Jz(b),a=o.box,u=o.content;v.props.animation&&(JR([a,u],r),Jk([a,u],"hidden"))}M(),j(),v.props.animation?T()&&(i=v.unmount,W(r,function(){!v.state.isVisible&&b.parentNode&&b.parentNode.contains(b)&&i()})):v.unmount()}},hideWithInteractivity:function(e){O().addEventListener("mousemove",m),Jw(JG,m),m(e)},enable:function(){v.state.isEnabled=!0},disable:function(){v.hide(),v.state.isEnabled=!1},unmount:function(){v.state.isVisible&&v.hide(),v.state.isMounted&&(Z(),J().forEach(function(e){e._tippy.unmount()}),b.parentNode&&b.parentNode.removeChild(b),JZ=JZ.filter(function(e){return e!==v}),v.state.isMounted=!1,E("onHidden",[v]))},destroy:function(){v.state.isDestroyed||(v.clearDelayTimeouts(),v.unmount(),q(),delete e._tippy,v.state.isDestroyed=!0,E("onDestroy",[v]))}};if(!c.render)return v;var x=c.render(v),b=x.popper,C=x.onUpdate;b.setAttribute("data-tippy-root",""),b.id="tippy-"+v.id,v.popper=b,e._tippy=v,b._tippy=v;var S=y.map(function(e){return e.fn(v)}),w=e.hasAttribute("aria-expanded");return N(),j(),k(),E("onCreate",[v]),c.showOnCreate&&$(),b.addEventListener("mouseenter",function(){v.props.interactive&&v.state.isVisible&&v.clearDelayTimeouts()}),b.addEventListener("mouseleave",function(){v.props.interactive&&v.props.trigger.indexOf("mouseenter")>=0&&O().addEventListener("mousemove",m)}),v;function I(){var e=v.props.touch;return Array.isArray(e)?e:[e,0]}function _(){return"hold"===I()[0]}function T(){var e;return!!(null!=(e=v.props.render)&&e.$$tippy)}function O(){var t,n,r=(l||e).parentNode;return r&&null!=(n=JS(r)[0])&&null!=(t=n.ownerDocument)&&t.body?n.ownerDocument:document}function R(e){return v.state.isMounted&&!v.state.isVisible||Jj.isTouch||a&&"focus"===a.type?0:Jv(v.props.delay,e?0:1,JP.delay)}function k(e){void 0===e&&(e=!1),b.style.pointerEvents=v.props.interactive&&!e?"":"none",b.style.zIndex=""+v.props.zIndex}function E(e,t,n){if(void 0===n&&(n=!0),S.forEach(function(n){n[e]&&n[e].apply(n,t)}),n){var r;(r=v.props)[e].apply(r,t)}}function M(){var t=v.props.aria;if(t.content){var n="aria-"+t.content,r=b.id;JS(v.props.triggerTarget||e).forEach(function(e){var t=e.getAttribute(n);if(v.state.isVisible)e.setAttribute(n,t?t+" "+r:r);else{var i=t&&t.replace(r,"").trim();i?e.setAttribute(n,i):e.removeAttribute(n)}})}}function j(){w||!v.props.aria.expanded||JS(v.props.triggerTarget||e).forEach(function(t){v.props.interactive?t.setAttribute("aria-expanded",v.state.isVisible&&t===(l||e)?"true":"false"):t.removeAttribute("aria-expanded")})}function F(){O().removeEventListener("mousemove",m),JG=JG.filter(function(e){return e!==m})}function U(t){if(!(Jj.isTouch&&(p||"mousedown"===t.type))){var n=t.composedPath&&t.composedPath()[0]||t.target;if(!(v.props.interactive&&JM(b,n))){if(JS(v.props.triggerTarget||e).some(function(e){return JM(e,n)})){if(Jj.isTouch||v.state.isVisible&&v.props.trigger.indexOf("click")>=0)return}else E("onClickOutside",[v,t]);!0===v.props.hideOnClick&&(v.clearDelayTimeouts(),v.hide(),f=!0,setTimeout(function(){f=!1}),v.state.isMounted||P())}}}function L(){p=!0}function K(){p=!1}function B(){var e=O();e.addEventListener("mousedown",U,!0),e.addEventListener("touchend",U,Jg),e.addEventListener("touchstart",K,Jg),e.addEventListener("touchmove",L,Jg)}function P(){var e=O();e.removeEventListener("mousedown",U,!0),e.removeEventListener("touchend",U,Jg),e.removeEventListener("touchstart",K,Jg),e.removeEventListener("touchmove",L,Jg)}function W(e,t){var n=Jz(b).box;function r(e){e.target===n&&(JE(n,"remove",r),t())}if(0===e)return t();JE(n,"remove",u),JE(n,"add",r),u=r}function D(t,n,r){void 0===r&&(r=!1),JS(v.props.triggerTarget||e).forEach(function(e){e.addEventListener(t,n,r),h.push({node:e,eventType:t,handler:n,options:r})})}function N(){_()&&(D("touchstart",Q,{passive:!0}),D("touchend",z,{passive:!0})),v.props.trigger.split(/\s+/).filter(Boolean).forEach(function(e){if("manual"!==e)switch(D(e,Q),e){case"mouseenter":D("mouseleave",z);break;case"focus":D(JB?"focusout":"blur",Y);break;case"focusin":D("focusout",Y)}})}function q(){h.forEach(function(e){var t=e.node,n=e.eventType,r=e.handler,i=e.options;t.removeEventListener(n,r,i)}),h=[]}function Q(e){var t,n=!1;if(!(!v.state.isEnabled||H(e)||f)){var r=(null==(t=a)?void 0:t.type)==="focus";a=e,l=e.currentTarget,j(),!v.state.isVisible&&Jx(e,"MouseEvent")&&JG.forEach(function(t){return t(e)}),"click"===e.type&&(0>v.props.trigger.indexOf("mouseenter")||d)&&!1!==v.props.hideOnClick&&v.state.isVisible?n=!0:$(e),"click"===e.type&&(d=!n),n&&!r&&X(e)}}function V(t){var n,r,i,o=t.target,a=(l||e).contains(o)||b.contains(o);!("mousemove"===t.type&&a)&&(n=J().concat(b).map(function(e){var t,n=null==(t=e._tippy.popperInstance)?void 0:t.state;return n?{popperRect:e.getBoundingClientRect(),popperState:n,props:c}:null}).filter(Boolean),r=t.clientX,i=t.clientY,n.every(function(e){var t=e.popperRect,n=e.popperState,o=e.props.interactiveBorder,a=n.placement.split("-")[0],u=n.modifiersData.offset;if(!u)return!0;var s="bottom"===a?u.top.y:0,l="top"===a?u.bottom.y:0,c="right"===a?u.left.x:0,d="left"===a?u.right.x:0,f=t.top-i+s>o,p=i-t.bottom-l>o,A=t.left-r+c>o,h=r-t.right-d>o;return f||p||A||h})&&(F(),X(t)))}function z(e){if(!(H(e)||v.props.trigger.indexOf("click")>=0&&d)){if(v.props.interactive){v.hideWithInteractivity(e);return}X(e)}}function Y(t){0>v.props.trigger.indexOf("focusin")&&t.target!==(l||e)||v.props.interactive&&t.relatedTarget&&b.contains(t.relatedTarget)||X(t)}function H(e){return!!Jj.isTouch&&_()!==e.type.indexOf("touch")>=0}function G(){Z();var t=v.props,n=t.popperOptions,r=t.placement,i=t.offset,o=t.getReferenceClientRect,a=t.moveTransition,u=T()?Jz(b).arrow:null,c=o?{getBoundingClientRect:o,contextElement:o.contextElement||l||e}:e,d=[{name:"offset",options:{offset:i}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!a}},{name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(e){var t=e.state;if(T()){var n=Jz(b).box;["placement","reference-hidden","escaped"].forEach(function(e){"placement"===e?n.setAttribute("data-placement",t.placement):t.attributes.popper["data-popper-"+e]?n.setAttribute("data-"+e,""):n.removeAttribute("data-"+e)}),t.attributes.popper={}}}}];T()&&u&&d.push({name:"arrow",options:{element:u,padding:3}}),d.push.apply(d,(null==n?void 0:n.modifiers)||[]),v.popperInstance=Jp(c,b,Object.assign({},n,{placement:r,onFirstUpdate:s,modifiers:d}))}function Z(){v.popperInstance&&(v.popperInstance.destroy(),v.popperInstance=null)}function J(){return JI(b.querySelectorAll("[data-tippy-root]"))}function $(e){v.clearDelayTimeouts(),e&&E("onTrigger",[v,e]),B();var t=R(!0),n=I(),i=n[0],o=n[1];Jj.isTouch&&"hold"===i&&o&&(t=o),t?r=setTimeout(function(){v.show()},t):v.show()}function X(e){if(v.clearDelayTimeouts(),E("onUntrigger",[v,e]),!v.state.isVisible){P();return}if(!(v.props.trigger.indexOf("mouseenter")>=0&&v.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(e.type)>=0&&d)){var t=R(!1);t?i=setTimeout(function(){v.state.isVisible&&v.hide()},t):o=requestAnimationFrame(function(){v.hide()})}}}(t,r);return n&&e.push(n),e},[]);return JO(e)?i[0]:i}JJ.defaultProps=JP,JJ.setDefaultProps=function(e){Object.keys(e).forEach(function(t){JP[t]=e[t]})},JJ.currentInput=Jj,Object.assign({},ZK,{effect:function(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow)}}),JJ.setDefaultProps({render:JY});class J${constructor({editor:e,element:t,view:n,tippyOptions:r={},updateDelay:i=250,shouldShow:o}){this.preventHide=!1,this.shouldShow=({view:e,state:t,from:n,to:r})=>{let{doc:i,selection:o}=t,{empty:a}=o,u=!i.textBetween(n,r).length&&GW(t.selection),s=this.element.contains(document.activeElement);return!(!(e.hasFocus()||s)||a||u||!this.editor.isEditable)},this.mousedownHandler=()=>{this.preventHide=!0},this.dragstartHandler=()=>{this.hide()},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:e})=>{var t;if(this.preventHide){this.preventHide=!1;return}null!=e&&e.relatedTarget&&!(null===(t=this.element.parentNode)||void 0===t)&&t.contains(e.relatedTarget)||this.hide()},this.tippyBlurHandler=e=>{this.blurHandler({event:e})},this.handleDebouncedUpdate=(e,t)=>{let n=!(null!=t&&t.selection.eq(e.state.selection)),r=!(null!=t&&t.doc.eq(e.state.doc));(n||r)&&(this.updateDebounceTimer&&clearTimeout(this.updateDebounceTimer),this.updateDebounceTimer=window.setTimeout(()=>{this.updateHandler(e,n,r,t)},this.updateDelay))},this.updateHandler=(e,t,n,r)=>{var i,o,a;let{state:u,composing:s}=e,{selection:l}=u;if(s||!t&&!n)return;this.createTooltip();let{ranges:c}=l,d=Math.min(...c.map(e=>e.$from.pos)),f=Math.max(...c.map(e=>e.$to.pos));if(!(null===(i=this.shouldShow)||void 0===i?void 0:i.call(this,{editor:this.editor,view:e,state:u,oldState:r,from:d,to:f}))){this.hide();return}null===(o=this.tippy)||void 0===o||o.setProps({getReferenceClientRect:(null===(a=this.tippyOptions)||void 0===a?void 0:a.getReferenceClientRect)||(()=>{if(u.selection instanceof zQ){let t=e.nodeDOM(d),n=t.dataset.nodeViewWrapper?t:t.querySelector("[data-node-view-wrapper]");if(n&&(t=n.firstChild),t)return t.getBoundingClientRect()}return function(e,t,n){let r=e.state.doc.content.size,i=GD(t,0,r),o=GD(n,0,r),a=e.coordsAtPos(i),u=e.coordsAtPos(o,-1),s=Math.min(a.top,u.top),l=Math.max(a.bottom,u.bottom),c=Math.min(a.left,u.left),d=Math.max(a.right,u.right),f={top:s,bottom:l,left:c,right:d,width:d-c,height:l-s,x:c,y:s};return{...f,toJSON:()=>f}}(e,d,f)})}),this.show()},this.editor=e,this.element=t,this.view=n,this.updateDelay=i,o&&(this.shouldShow=o),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=r,this.element.remove(),this.element.style.visibility="visible"}createTooltip(){let{element:e}=this.editor.options,t=!!e.parentElement;this.tippy||!t||(this.tippy=JJ(e,{duration:0,getReferenceClientRect:null,content:this.element,interactive:!0,trigger:"manual",placement:"top",hideOnClick:"toggle",...this.tippyOptions}),this.tippy.popper.firstChild&&this.tippy.popper.firstChild.addEventListener("blur",this.tippyBlurHandler))}update(e,t){let{state:n}=e,r=n.selection.$from.pos!==n.selection.$to.pos;if(this.updateDelay>0&&r){this.handleDebouncedUpdate(e,t);return}let i=!(null!=t&&t.selection.eq(e.state.selection)),o=!(null!=t&&t.doc.eq(e.state.doc));this.updateHandler(e,i,o,t)}show(){var e;null===(e=this.tippy)||void 0===e||e.show()}hide(){var e;null===(e=this.tippy)||void 0===e||e.hide()}destroy(){var e,t;!(null===(e=this.tippy)||void 0===e)&&e.popper.firstChild&&this.tippy.popper.firstChild.removeEventListener("blur",this.tippyBlurHandler),null===(t=this.tippy)||void 0===t||t.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 JX=e=>new z$({key:"string"==typeof e.pluginKey?new z1(e.pluginKey):e.pluginKey,view:t=>new J$({view:t,...e})});GU.create({name:"bubbleMenu",addOptions:()=>({element:null,tippyOptions:{},pluginKey:"bubbleMenu",updateDelay:void 0,shouldShow:null}),addProseMirrorPlugins(){return this.options.element?[JX({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,updateDelay:this.options.updateDelay,shouldShow:this.options.shouldShow})]:[]}});let J0=(...e)=>t=>{e.forEach(e=>{"function"==typeof e?e(t):e&&(e.current=t)})},J1=({renderers:e})=>x.createElement(x.Fragment,null,Object.entries(e).map(([e,t])=>F.createPortal(t.reactElement,t.element,e)));class J2 extends x.Component{constructor(e){super(e),this.editorContentRef=x.createRef(),this.initialized=!1,this.state={renderers:{}}}componentDidMount(){this.init()}componentDidUpdate(){this.init()}init(){let{editor:e}=this.props;if(e&&e.options.element){if(e.contentComponent)return;let t=this.editorContentRef.current;t.append(...e.options.element.childNodes),e.setOptions({element:t}),e.contentComponent=this,e.createNodeViews(),this.initialized=!0}}maybeFlushSync(e){this.initialized?(0,F.flushSync)(e):e()}setRenderer(e,t){this.maybeFlushSync(()=>{this.setState(({renderers:n})=>({renderers:{...n,[e]:t}}))})}removeRenderer(e){this.maybeFlushSync(()=>{this.setState(({renderers:t})=>{let n={...t};return delete n[e],{renderers:n}})})}componentWillUnmount(){let{editor:e}=this.props;if(!e||(this.initialized=!1,e.isDestroyed||e.view.setProps({nodeViews:{}}),e.contentComponent=null,!e.options.element.firstChild))return;let t=document.createElement("div");t.append(...e.options.element.childNodes),e.setOptions({element:t})}render(){let{editor:e,innerRef:t,...n}=this.props;return x.createElement(x.Fragment,null,x.createElement("div",{ref:J0(t,this.editorContentRef),...n}),x.createElement(J1,{renderers:this.state.renderers}))}}let J6=(0,x.forwardRef)((e,t)=>{let n=x.useMemo(()=>Math.floor(4294967295*Math.random()).toString(),[e.editor]);return x.createElement(J2,{key:n,innerRef:t,...e})}),J5=x.memo(J6),J3=(0,x.createContext)({editor:null});J3.Consumer;let J9=()=>(0,x.useContext)(J3),J4=e=>{let[t,n]=(0,x.useState)(null),{editor:r}=J9();return(0,x.useEffect)(()=>{var n;if(!t||!(null===(n=e.editor)||void 0===n)&&n.isDestroyed||null!=r&&r.isDestroyed)return;let{pluginKey:i="bubbleMenu",editor:o,tippyOptions:a={},updateDelay:u,shouldShow:s=null}=e,l=o||r;if(!l){console.warn("BubbleMenu component is not rendered inside of an editor component or does not have editor prop.");return}let c=JX({updateDelay:u,editor:l,element:t,pluginKey:i,shouldShow:s,tippyOptions:a});return l.registerPlugin(c),()=>l.unregisterPlugin(i)},[e.editor,r,t]),x.createElement("div",{ref:n,className:e.className,style:{visibility:"hidden"}},e.children)},J7=(0,x.createContext)({onDragStart:void 0}),J8=()=>(0,x.useContext)(J7),$e=x.forwardRef((e,t)=>{let{onDragStart:n}=J8(),r=e.as||"div";return x.createElement(r,{...e,ref:t,"data-node-view-wrapper":"",onDragStart:n,style:{whiteSpace:"normal",...e.style}})});class $t{constructor(e,{editor:t,props:n={},as:r="div",className:i="",attrs:o}){this.ref=null,this.id=Math.floor(4294967295*Math.random()).toString(),this.component=e,this.editor=t,this.props=n,this.element=document.createElement(r),this.element.classList.add("react-renderer"),i&&this.element.classList.add(...i.split(" ")),o&&Object.keys(o).forEach(e=>{this.element.setAttribute(e,o[e])}),this.render()}render(){var e,t,n;let r=this.component,i=this.props;("function"==typeof r&&r.prototype&&r.prototype.isReactComponent||"object"==typeof r&&(null===(n=r.$$typeof)||void 0===n?void 0:n.toString())==="Symbol(react.forward_ref)")&&(i.ref=e=>{this.ref=e}),this.reactElement=x.createElement(r,{...i}),null===(t=null===(e=this.editor)||void 0===e?void 0:e.contentComponent)||void 0===t||t.setRenderer(this.id,this)}updateProps(e={}){this.props={...this.props,...e},this.render()}destroy(){var e,t;null===(t=null===(e=this.editor)||void 0===e?void 0:e.contentComponent)||void 0===t||t.removeRenderer(this.id)}}class $n extends Zt{mount(){let e={editor:this.editor,node:this.node,decorations:this.decorations,selected:!1,extension:this.extension,getPos:()=>this.getPos(),updateAttributes:(e={})=>this.updateAttributes(e),deleteNode:()=>this.deleteNode()};if(!this.component.displayName){let e;this.component.displayName=(e=this.extension.name).charAt(0).toUpperCase()+e.substring(1)}let t=e=>{let t=this.component,n=this.onDragStart.bind(this);return x.createElement(x.Fragment,null,x.createElement(J7.Provider,{value:{onDragStart:n,nodeViewContentRef:e=>{e&&this.contentDOMElement&&e.firstChild!==this.contentDOMElement&&e.appendChild(this.contentDOMElement)}}},x.createElement(t,{...e})))};t.displayName="ReactNodeView",this.node.isLeaf?this.contentDOMElement=null:this.options.contentDOMElementTag?this.contentDOMElement=document.createElement(this.options.contentDOMElementTag):this.contentDOMElement=document.createElement(this.node.isInline?"span":"div"),this.contentDOMElement&&(this.contentDOMElement.style.whiteSpace="inherit");let n=this.node.isInline?"span":"div";this.options.as&&(n=this.options.as);let{className:r=""}=this.options;this.handleSelectionUpdate=this.handleSelectionUpdate.bind(this),this.editor.on("selectionUpdate",this.handleSelectionUpdate),this.renderer=new $t(t,{editor:this.editor,props:e,as:n,className:`node-${this.node.type.name} ${r}`.trim(),attrs:this.options.attrs})}get dom(){var e;if(this.renderer.element.firstElementChild&&!(!(null===(e=this.renderer.element.firstElementChild)||void 0===e)&&e.hasAttribute("data-node-view-wrapper")))throw Error("Please use the NodeViewWrapper component for your node view.");return this.renderer.element}get contentDOM(){return this.node.isLeaf?null:this.contentDOMElement}handleSelectionUpdate(){let{from:e,to:t}=this.editor.state.selection;if(e<=this.getPos()&&t>=this.getPos()+this.node.nodeSize){if(this.renderer.props.selected)return;this.selectNode()}else{if(!this.renderer.props.selected)return;this.deselectNode()}}update(e,t){let n=e=>{this.renderer.updateProps(e)};if(e.type!==this.node.type)return!1;if("function"==typeof this.options.update){let r=this.node,i=this.decorations;return this.node=e,this.decorations=t,this.options.update({oldNode:r,oldDecorations:i,newNode:e,newDecorations:t,updateProps:()=>n({node:e,decorations:t})})}return e===this.node&&this.decorations===t||(this.node=e,this.decorations=t,n({node:e,decorations:t})),!0}selectNode(){this.renderer.updateProps({selected:!0}),this.renderer.element.classList.add("ProseMirror-selectednode")}deselectNode(){this.renderer.updateProps({selected:!1}),this.renderer.element.classList.remove("ProseMirror-selectednode")}destroy(){this.renderer.destroy(),this.editor.off("selectionUpdate",this.handleSelectionUpdate),this.contentDOMElement=null}}function $r(e,t){return n=>n.editor.contentComponent?new $n(e,n,t):{}}let $i=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,$o=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,$a=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,$u=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,$s=G8.create({name:"bold",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"strong"},{tag:"b",getAttrs:e=>"normal"!==e.style.fontWeight&&null},{style:"font-weight",getAttrs:e=>/^(bold(er)?|[5-9]\d{2,})$/.test(e)&&null}],renderHTML({HTMLAttributes:e}){return["strong",Gm(this.options.HTMLAttributes,e),0]},addCommands(){return{setBold:()=>({commands:e})=>e.setMark(this.name),toggleBold:()=>({commands:e})=>e.toggleMark(this.name),unsetBold:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[G9({find:$i,type:this.type}),G9({find:$a,type:this.type})]},addPasteRules(){return[Zn({find:$o,type:this.type}),Zn({find:$u,type:this.type})]}});var $l=((o=$l||{}).Document="document",o.Mark="mark",o.Node="node",o),$c=((a=$c||{}).Text="text",a.Embed="embed",a.Image="image",a);class $d{constructor(e,t,n){B(this,"extType","document"),this.name=e,this.component=t,this.converter=n}}class $f{constructor(e,t,n,r,i,o=!1){B(this,"extType","node"),B(this,"nodeType","text"),this.richTextNodeTypes=e,this.name=t,this.component=n,this.converter=r,this.placeholder=i,this.lockedFormat=o}}function $p(e){return e instanceof $f}class $A{constructor(e,t,n,r){B(this,"extType","node"),B(this,"nodeType","embed"),this.richTextNodeTypes=e,this.name=t,this.component=n,this.converter=r}}class $h{constructor(e,t,n,r){B(this,"extType","node"),B(this,"nodeType","image"),this.richTextNodeTypes=e,this.name=t,this.component=n,this.converter=r}}class $m extends $f{constructor(e,t,n,r,i){super(e,"heading",t,r,i),this.levels=n}}class $g extends $f{constructor(e,t,n,r){super(e,t,n,r)}}function $y(e){return e instanceof $g}let $v=Ze.create({name:"hardBreak",addOptions:()=>({keepMarks:!0,HTMLAttributes:{}}),inline:!0,group:"inline",selectable:!1,parseHTML:()=>[{tag:"br"}],renderHTML({HTMLAttributes:e}){return["br",Gm(this.options.HTMLAttributes,e)]},renderText:()=>`
|
|
18
|
-
`,addCommands(){return{setHardBreak:()=>({commands:e,chain:t,state:n,editor:r})=>e.first([()=>e.exitCode(),()=>e.command(()=>{let{selection:e,storedMarks:i}=n;if(e.$from.parent.type.spec.isolating)return!1;let{keepMarks:o}=this.options,{splittableMarks:a}=r.extensionManager,u=i||e.$to.parentOffset&&e.$from.marks();return t().insertContent({type:this.name}).command(({tr:e,dispatch:t})=>{if(t&&u&&o){let t=u.filter(e=>a.includes(e.type.name));e.ensureMarks(t)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),$x={isHardBreak:e=>e.type.name===$v.name,children:{reduce(e,t,n){let r=n;return e.forEach((e,n,i)=>{r=t(r,e,i)}),r},map(e,t){return this.reduce(e,(e,n)=>[...e,t(n)],[])},exists(e,t){return this.reduce(e,(e,n)=>e||t(n),!1)},filter(e,t){return this.reduce(e,(e,n)=>[...e,...t(n)?[n]:[]],[])}},marks:{reduce(e,t,n){let r=n;return e.marks.forEach((e,n)=>{r=t(r,e,n)}),r},map(e,t){return this.reduce(e,(e,n)=>[...e,t(n)],[])},filter(e,t){return this.reduce(e,(e,n)=>[...e,...t(n)?[n]:[]],[])}}};function $b(){return{extensions:etd(),nodeTypes:new Set((0,S.XP)(Lm.RichTextNodeTypeCodec.keys))}}class $C{constructor(e,t,n){B(this,"extType",$l.Mark),B(this,"richTextNodeTypes",[Lm.RichTextNodeType.strong]),this.name=e,this.component=t,this.converter=n}}let $S="bold",$w=$s.extend({name:$S}),$I=new $C($S,$w,{fromPrismic:e=>function(){var t;return null==(t=e.marks[$w.name])?void 0:t.create()},toPrismic(){}}),$_=Ze.create({name:"listItem",addOptions:()=>({HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}),content:"paragraph block*",defining:!0,parseHTML:()=>[{tag:"li"}],renderHTML({HTMLAttributes:e}){return["li",Gm(this.options.HTMLAttributes,e),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)}}}),$T=G8.create({name:"textStyle",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"span",getAttrs:e=>!!e.hasAttribute("style")&&{}}],renderHTML({HTMLAttributes:e}){return["span",Gm(this.options.HTMLAttributes,e),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:e,commands:t})=>!!Object.entries(GJ(e,this.type)).some(([,e])=>!!e)||t.unsetMark(this.name)}}}),$O=/^\s*([-+*])\s$/,$R=Ze.create({name:"bulletList",addOptions:()=>({itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}),group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML:()=>[{tag:"ul"}],renderHTML({HTMLAttributes:e}){return["ul",Gm(this.options.HTMLAttributes,e),0]},addCommands(){return{toggleBulletList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes($_.name,this.editor.getAttributes($T.name)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let e=G7({find:$O,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(e=G7({find:$O,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes($T.name),editor:this.editor})),[e]}}),$k=Ze.create({name:"doc",topNode:!0,content:"block+"}),$E=Ze.create({name:"listItem",addOptions:()=>({HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}),content:"paragraph block*",defining:!0,parseHTML:()=>[{tag:"li"}],renderHTML({HTMLAttributes:e}){return["li",Gm(this.options.HTMLAttributes,e),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}).extend({name:"listItem",content:"paragraph*",addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name)}}}),$M={component:$E,converter:{fromPrismic:e=>function(t){var n;let r=eeb.converter.fromPrismic(e)(t);if(r)return null==(n=e.nodes[$E.name])?void 0:n.create({},r)},toPrismic:(e,t)=>$x.children.reduce(e,(e,n)=>{let r=eeb.converter.toPrismic(n);return[...e,...r instanceof Array?r.map(e=>({...e,type:t})):r?[{...r,type:t}]:[]]},[])},placeholder:"List"},$j={listItem:"list-item",oListItem:"o-list-item",list:"group-list-item",oList:"group-o-list-item",span:"span"},$F=()=>(++$F.i).toString();$F.i=0;let $U=e=>{let t=$B(e),n=[];for(let e=0;e<t.length;e++)n.push($P(t[e]));return{key:$F(),children:n}},$L=(e,t=[])=>({key:$F(),type:e.type,text:"text"in e?e.text:void 0,node:e,children:t}),$K=e=>$L({type:$j.span,text:e,spans:[]}),$B=e=>{let t=e.slice(0);for(let e=0;e<t.length;e++){let n=t[e];if(n.type===$j.listItem||n.type===$j.oListItem){let r=[n];for(;t[e+1]&&t[e+1].type===n.type;)r.push(t[e+1]),t.splice(e,1);n.type===$j.listItem?t[e]={type:$j.list,items:r}:t[e]={type:$j.oList,items:r}}}return t},$P=e=>{if("text"in e)return $L(e,$W(e.spans,e));if("items"in e){let t=[];for(let n=0;n<e.items.length;n++)t.push($P(e.items[n]));return $L(e,t)}return $L(e)},$W=(e,t,n)=>{if(!e.length)return[$K(t.text)];let r=e.slice(0);r.sort((e,t)=>e.start-t.start||t.end-e.end);let i=[];for(let e=0;e<r.length;e++){let o=r[e],a=n&&n.start||0,u=o.start-a,s=o.end-a,l=t.text.slice(u,s),c=[];for(let t=e;t<r.length;t++){let e=r[t];e!==o&&e.start>=o.start&&e.end<=o.end&&(c.push(e),r.splice(t,1),t--)}0===e&&u>0&&i.push($K(t.text.slice(0,u)));let d={...o,text:l};i.push($L(d,$W(c,{...t,text:l},o))),s<t.text.length&&i.push($K(t.text.slice(s,r[e+1]?r[e+1].start-a:void 0)))}return i},$D=(e,t)=>$N($U(e).children,t),$N=(e,t)=>{let n=[];for(let r=0;r<e.length;r++){let i=e[r],o=t(i.type,i.node,i.text,$N(i.children,t),i.key);null!=o&&n.push(o)}return n},$q=Ze.create({name:"text",group:"inline"});function $Q(e){return e.sort((e,t)=>e.start-t.start)}let $V=$v.extend({name:"hard_break"}),$z=`
|
|
19
|
-
`,$Y={fromPrismic:e=>function(t){var n;if(t===$z)return null==(n=e.nodes[$V.name])?void 0:n.create({})},toPrismic(e){if(e.type.name===$V.name)return $z}},$H={isEmptyLine:e=>0===e.length,isFirst:e=>0===e},$G={name:$V.name,component:$V,converter:$Y,splitTextToNodes:function(e,t){return function(n){let r=$Y.fromPrismic(e)($z);if(!r)return[n(t)];let i=t.split($z);return 1===i.length?t.length?[n(t)]:[r]:i.reduce((e,t,i)=>$H.isFirst(i)?$H.isEmptyLine(t)?e:[...e,n(t)]:$H.isEmptyLine(t)?[...e,r]:[...e,r,n(t)],[])}}},$Z={fromPrismic:e=>t=>{switch(t.type){case"hyperlink":return etn.converter.fromPrismic(e)(t);case"em":return ee5.converter.fromPrismic(e)(t);case"strong":return $I.converter.fromPrismic(e)(t);case"label":return ee7.converter.fromPrismic(e)(t);case"list-item":return}},toPrismic(e,t,n){let r=etc.find(t=>e.type.name===t.name);if(!r)throw Error(`Invalid mark extension '${e.type.name}'.`);switch(r.name){case"bold":return{type:"strong",start:t,end:n};case"em":return{type:r.name,start:t,end:n};case"hyperlink":case"label":return{type:r.name,start:t,end:n,data:r.converter.toPrismic(e)}}}},$J={strong:"bold",label:"label",em:"em",hyperlink:"hyperlink","list-item":void 0},$$=$q.extend({name:"text"}),$X={name:$$.name,component:$$,converter:{fromPrismic:e=>function(t,n,r=!1){return $D([{type:t,text:n.content.text,spans:n.content.spans||[]}],function(e,t=!1){return(n,r,i,o)=>{if("span"===n&&i&&i.length)return t?[e.text(i)]:$G.splitTextToNodes(e,i)(t=>e.text(t));let a=$Z.fromPrismic(e)(r);return a?o.flat().map(e=>{let t=[...e.marks,a].sort((e,t)=>e.type.name.localeCompare(t.type.name));return e.mark(t)}):o.flat()}}(e,r)).flat()},toPrismic(e,t,n){let r=$x.children.reduce(e,(e,t)=>{let n=t.type.name===$G.name?$G.converter.toPrismic(t):t.textContent,r=n?e.text+n:e.text,i=e.text.length,o=r.length,a=t.marks.length?$x.marks.map(t,e=>$Z.toPrismic(e,i,o)):void 0;return{...e,text:r,spans:a?[...e.spans,...a]:e.spans}},{text:"",spans:[]});return{type:t,content:{text:r.text,spans:[...function(e){let t=Object.entries(e.reduce((e,t)=>{let n=(e[t.type]||[]).concat(t);return{...e,[t.type]:n}},{})).map(([e,t])=>$Q(t).reduce((e,t)=>{if(!e.length)return[t];let n=e.length-1,r=e[n];return r?r.end<t.start?[...e,t]:r.end>=t.end?e:[...e.slice(0,n),{...r,end:t.end}]:e},[])).flat();return $Q(t)}(r.spans)].sort((e,t)=>e.type.localeCompare(t.type))},...n}}}},$0="document",$1=new $d($0,function(e){return $k.extend({name:$0,content:e?"block+":"block"})},function(e){return{fromPrismic(t,n,r){var i;let o=r.value.reduce((r,i)=>{let{extension:o,block:a}=function(e,t,n,r){var i;let o=e.find(e=>e.richTextNodeTypes.includes(t.type)&&r.has(t.type));if(o)return{extension:o,block:t};if(!Q.TextBlock.is(t))return{extension:void 0,block:t};let a=e.find(e=>$p(e)&&e.name in n.nodes),u=null==(i=t.content.spans)?void 0:i.filter(e=>{let t=$J[e.type];return t&&t in n.marks});return{extension:a,block:{...t,content:{text:t.content.text,spans:u}}}}(e,i,t,n),u=function(e){let{extension:t,block:n,schema:r}=e;if(t)switch(t.nodeType){case $c.Embed:return Q.EmbedBlock.is(n)?t.converter.fromPrismic(r)(n):void 0;case $c.Text:return Q.TextBlock.is(n)?t.converter.fromPrismic(r)(n):void 0;case $c.Image:return Q.ImageBlock.is(n)?t.converter.fromPrismic(r)(n):void 0}}({extension:o,block:a,schema:t}),s=r.slice(0,r.length-1),l=function(e){let{node:t,previousNode:n}=e;return t&&n&&t.type.name===n.type.name&&(t.type.name===eeR.name||t.type.name===etl.name)?{merged:!0,updatedNode:n.copy(n.content.append(t.content))}:{merged:!1,updatedNode:t}}({node:u,previousNode:(0,R.Z$)(r)});return l.updatedNode?[...l.merged?s:r,l.updatedNode]:r},[]);return null==(i=t.nodes[$0])?void 0:i.create({},o)},toPrismic:t=>({__TYPE__:"StructuredTextContent",value:[...$x.children.reduce(t,(t,n)=>{let r=Object.values(e).find(e=>n.type.name===e.name),i=null==r?void 0:r.converter.toPrismic(n);return i||console.warn(`Cannot convert node of type '${n.type.name}'.`),i?[...t,...i instanceof Array?i:[i]]:t},[])]})}}),$2=GU.create({name:"placeholder",addOptions:()=>({emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Write something …",showOnlyWhenEditable:!0,considerAnyAsEmpty:!1,showOnlyCurrent:!0,includeChildren:!1}),addProseMirrorPlugins(){return[new z$({key:new z1("placeholder"),props:{decorations:({doc:e,selection:t})=>{var n;let r=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:i}=t,o=[];if(!r)return null;let{firstChild:a}=e.content,u=a&&a.type.isLeaf,s=a&&a.isAtom,l=!!this.options.considerAnyAsEmpty||a&&a.type.name===(null===(n=e.type.contentMatch.defaultType)||void 0===n?void 0:n.name),c=e.content.childCount<=1&&a&&l&&a.nodeSize<=2&&(!u||!s);return e.descendants((e,t)=>{let n=i>=t&&i<=t+e.nodeSize,r=!e.isLeaf&&!e.childCount;if((n||!this.options.showOnlyCurrent)&&r){let r=[this.options.emptyNodeClass];c&&r.push(this.options.emptyEditorClass);let i=Ho.node(t,t+e.nodeSize,{class:r.join(" "),"data-placeholder":"function"==typeof this.options.placeholder?this.options.placeholder({editor:this.editor,node:e,pos:t,hasAnchor:n}):this.options.placeholder});o.push(i)}return this.options.includeChildren}),Hs.create(e,o)}}})]}}),$6=e=>$2.configure({includeChildren:!0,placeholder:t=>(function({props:e,params:t}){let{editor:n,hasAnchor:r,node:i}=e,{placeholderByNodeType:o,unfocusedPlaceholder:a,nodeExtensions:u}=t,s=!$x.children.exists(n.state.doc,e=>e===i),l=n.isEditable,c=n.isFocused&&r,d=i.type.name!==eeb.name,f=c||d||s,p=u.filter(e=>e!==eeb).length>1,A=function(){if(s)return $M.placeholder;let e=o[i.type.name];return"string"==typeof e?e:null==e?void 0:e(i.attrs)}();return a&&!c&&n.isEmpty?a:("Type '/' for commands"===A?l&&f&&p:l&&f)&&A||""})({props:t,params:e}),showOnlyCurrent:!1,showOnlyWhenEditable:!1});function $5(e){return e.split("-")[1]}function $3(e){return"y"===e?"height":"width"}function $9(e){return e.split("-")[0]}function $4(e){return["top","bottom"].includes($9(e))?"x":"y"}function $7(e,t,n){let r,{reference:i,floating:o}=e,a=i.x+i.width/2-o.width/2,u=i.y+i.height/2-o.height/2,s=$4(t),l=$3(s),c=i[l]/2-o[l]/2,d="x"===s;switch($9(t)){case"top":r={x:a,y:i.y-o.height};break;case"bottom":r={x:a,y:i.y+i.height};break;case"right":r={x:i.x+i.width,y:u};break;case"left":r={x:i.x-o.width,y:u};break;default:r={x:i.x,y:i.y}}switch($5(t)){case"start":r[s]-=c*(n&&d?-1:1);break;case"end":r[s]+=c*(n&&d?-1:1)}return r}let $8=async(e,t,n)=>{let{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:a}=n,u=o.filter(Boolean),s=await (null==a.isRTL?void 0:a.isRTL(t)),l=await a.getElementRects({reference:e,floating:t,strategy:i}),{x:c,y:d}=$7(l,r,s),f=r,p={},A=0;for(let n=0;n<u.length;n++){let{name:o,fn:h}=u[n],{x:m,y:g,data:y,reset:v}=await h({x:c,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:p,rects:l,platform:a,elements:{reference:e,floating:t}});c=m??c,d=g??d,p={...p,[o]:{...p[o],...y}},v&&A<=50&&(A++,"object"==typeof v&&(v.placement&&(f=v.placement),v.rects&&(l=!0===v.rects?await a.getElementRects({reference:e,floating:t,strategy:i}):v.rects),{x:c,y:d}=$7(l,f,s)),n=-1)}return{x:c,y:d,placement:f,strategy:i,middlewareData:p}};function Xe(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}async function Xt(e,t){var n;void 0===t&&(t={});let{x:r,y:i,platform:o,rects:a,elements:u,strategy:s}=e,{boundary:l="clippingAncestors",rootBoundary:c="viewport",elementContext:d="floating",altBoundary:f=!1,padding:p=0}=t,A="number"!=typeof p?{top:0,right:0,bottom:0,left:0,...p}:{top:p,right:p,bottom:p,left:p},h=u[f?"floating"===d?"reference":"floating":d],m=Xe(await o.getClippingRect({element:null==(n=await (null==o.isElement?void 0:o.isElement(h)))||n?h:h.contextElement||await (null==o.getDocumentElement?void 0:o.getDocumentElement(u.floating)),boundary:l,rootBoundary:c,strategy:s})),g="floating"===d?{...a.floating,x:r,y:i}:a.reference,y=await (null==o.getOffsetParent?void 0:o.getOffsetParent(u.floating)),v=await (null==o.isElement?void 0:o.isElement(y))&&await (null==o.getScale?void 0:o.getScale(y))||{x:1,y:1},x=Xe(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({rect:g,offsetParent:y,strategy:s}):g);return{top:(m.top-x.top+A.top)/v.y,bottom:(x.bottom-m.bottom+A.bottom)/v.y,left:(m.left-x.left+A.left)/v.x,right:(x.right-m.right+A.right)/v.x}}let Xn=Math.min,Xr=Math.max;["top","right","bottom","left"].reduce((e,t)=>e.concat(t,t+"-start",t+"-end"),[]);let Xi={left:"right",right:"left",bottom:"top",top:"bottom"};function Xo(e){return e.replace(/left|right|bottom|top/g,e=>Xi[e])}let Xa={start:"end",end:"start"};function Xu(e){return e.replace(/start|end/g,e=>Xa[e])}function Xs(e){return"x"===e?"y":"x"}function Xl(e){var t;return(null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function Xc(e){return Xl(e).getComputedStyle(e)}let Xd=Math.min,Xf=Math.max,Xp=Math.round;function XA(e){let t=Xc(e),n=parseFloat(t.width),r=parseFloat(t.height),i=e.offsetWidth,o=e.offsetHeight,a=Xp(n)!==i||Xp(r)!==o;return a&&(n=i,r=o),{width:n,height:r,fallback:a}}function Xh(e){return Xv(e)?(e.nodeName||"").toLowerCase():""}function Xm(){if(i)return i;let e=navigator.userAgentData;return e&&Array.isArray(e.brands)?i=e.brands.map(e=>e.brand+"/"+e.version).join(" "):navigator.userAgent}function Xg(e){return e instanceof Xl(e).HTMLElement}function Xy(e){return e instanceof Xl(e).Element}function Xv(e){return e instanceof Xl(e).Node}function Xx(e){return!(typeof ShadowRoot>"u")&&(e instanceof Xl(e).ShadowRoot||e instanceof ShadowRoot)}function Xb(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=Xc(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(i)}function XC(e){let t=/firefox/i.test(Xm()),n=Xc(e),r=n.backdropFilter||n.WebkitBackdropFilter;return"none"!==n.transform||"none"!==n.perspective||!!r&&"none"!==r||t&&"filter"===n.willChange||t&&!!n.filter&&"none"!==n.filter||["transform","perspective"].some(e=>n.willChange.includes(e))||["paint","layout","strict","content"].some(e=>{let t=n.contain;return null!=t&&t.includes(e)})}function XS(){return/^((?!chrome|android).)*safari/i.test(Xm())}function Xw(e){return["html","body","#document"].includes(Xh(e))}function XI(e){return Xy(e)?e:e.contextElement}let X_={x:1,y:1};function XT(e){let t=XI(e);if(!Xg(t))return X_;let n=t.getBoundingClientRect(),{width:r,height:i,fallback:o}=XA(t),a=(o?Xp(n.width):n.width)/r,u=(o?Xp(n.height):n.height)/i;return a&&Number.isFinite(a)||(a=1),u&&Number.isFinite(u)||(u=1),{x:a,y:u}}function XO(e,t,n,r){var i,o;void 0===t&&(t=!1),void 0===n&&(n=!1);let a=e.getBoundingClientRect(),u=XI(e),s=X_;t&&(r?Xy(r)&&(s=XT(r)):s=XT(e));let l=u?Xl(u):window,c=XS()&&n,d=(a.left+(c&&(null==(i=l.visualViewport)?void 0:i.offsetLeft)||0))/s.x,f=(a.top+(c&&(null==(o=l.visualViewport)?void 0:o.offsetTop)||0))/s.y,p=a.width/s.x,A=a.height/s.y;if(u){let e=Xl(u),t=r&&Xy(r)?Xl(r):r,n=e.frameElement;for(;n&&r&&t!==e;){let e=XT(n),t=n.getBoundingClientRect(),r=getComputedStyle(n);t.x+=(n.clientLeft+parseFloat(r.paddingLeft))*e.x,t.y+=(n.clientTop+parseFloat(r.paddingTop))*e.y,d*=e.x,f*=e.y,p*=e.x,A*=e.y,d+=t.x,f+=t.y,n=Xl(n).frameElement}}return{width:p,height:A,top:f,right:d+p,bottom:f+A,left:d,x:d,y:f}}function XR(e){return((Xv(e)?e.ownerDocument:e.document)||window.document).documentElement}function Xk(e){return Xy(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function XE(e){return XO(XR(e)).left+Xk(e).scrollLeft}function XM(e){if("html"===Xh(e))return e;let t=e.assignedSlot||e.parentNode||Xx(e)&&e.host||XR(e);return Xx(t)?t.host:t}function Xj(e,t){var n;void 0===t&&(t=[]);let r=function e(t){let n=XM(t);return Xw(n)?n.ownerDocument.body:Xg(n)&&Xb(n)?n:e(n)}(e),i=r===(null==(n=e.ownerDocument)?void 0:n.body),o=Xl(r);return i?t.concat(o,o.visualViewport||[],Xb(r)?r:[]):t.concat(r,Xj(r))}function XF(e,t,n){let r;if("viewport"===t)r=function(e,t){let n=Xl(e),r=XR(e),i=n.visualViewport,o=r.clientWidth,a=r.clientHeight,u=0,s=0;if(i){o=i.width,a=i.height;let e=XS();(!e||e&&"fixed"===t)&&(u=i.offsetLeft,s=i.offsetTop)}return{width:o,height:a,x:u,y:s}}(e,n);else if("document"===t)r=function(e){let t=XR(e),n=Xk(e),r=e.ownerDocument.body,i=Xf(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),o=Xf(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),a=-n.scrollLeft+XE(e),u=-n.scrollTop;return"rtl"===Xc(r).direction&&(a+=Xf(t.clientWidth,r.clientWidth)-i),{width:i,height:o,x:a,y:u}}(XR(e));else if(Xy(t))r=function(e,t){let n=XO(e,!0,"fixed"===t),r=n.top+e.clientTop,i=n.left+e.clientLeft,o=Xg(e)?XT(e):{x:1,y:1};return{width:e.clientWidth*o.x,height:e.clientHeight*o.y,x:i*o.x,y:r*o.y}}(t,n);else{let n={...t};if(XS()){var i,o;let t=Xl(e);n.x-=(null==(i=t.visualViewport)?void 0:i.offsetLeft)||0,n.y-=(null==(o=t.visualViewport)?void 0:o.offsetTop)||0}r=n}return Xe(r)}function XU(e,t){return Xg(e)&&"fixed"!==Xc(e).position?t?t(e):e.offsetParent:null}function XL(e,t){let n=Xl(e),r=XU(e,t);for(;r&&["table","td","th"].includes(Xh(r))&&"static"===Xc(r).position;)r=XU(r,t);return r&&("html"===Xh(r)||"body"===Xh(r)&&"static"===Xc(r).position&&!XC(r))?n:r||function(e){let t=XM(e);for(;Xg(t)&&!Xw(t);){if(XC(t))return t;t=XM(t)}return null}(e)||n}let XK={getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,o=[..."clippingAncestors"===n?function(e,t){let n=t.get(e);if(n)return n;let r=Xj(e).filter(e=>Xy(e)&&"body"!==Xh(e)),i=null,o="fixed"===Xc(e).position,a=o?XM(e):e;for(;Xy(a)&&!Xw(a);){let e=Xc(a),t=XC(a);"fixed"===e.position?i=null:(o?t||i:t||"static"!==e.position||!i||!["absolute","fixed"].includes(i.position))?i=e:r=r.filter(e=>e!==a),a=XM(a)}return t.set(e,r),r}(t,this._c):[].concat(n),r],a=o[0],u=o.reduce((e,n)=>{let r=XF(t,n,i);return e.top=Xf(r.top,e.top),e.right=Xd(r.right,e.right),e.bottom=Xd(r.bottom,e.bottom),e.left=Xf(r.left,e.left),e},XF(t,a,i));return{width:u.right-u.left,height:u.bottom-u.top,x:u.left,y:u.top}},convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{rect:t,offsetParent:n,strategy:r}=e,i=Xg(n),o=XR(n);if(n===o)return t;let a={scrollLeft:0,scrollTop:0},u={x:1,y:1},s={x:0,y:0};if((i||!i&&"fixed"!==r)&&(("body"!==Xh(n)||Xb(o))&&(a=Xk(n)),Xg(n))){let e=XO(n);u=XT(n),s.x=e.x+n.clientLeft,s.y=e.y+n.clientTop}return{width:t.width*u.x,height:t.height*u.y,x:t.x*u.x-a.scrollLeft*u.x+s.x,y:t.y*u.y-a.scrollTop*u.y+s.y}},isElement:Xy,getDimensions:function(e){return Xg(e)?XA(e):e.getBoundingClientRect()},getOffsetParent:XL,getDocumentElement:XR,getScale:XT,async getElementRects(e){let{reference:t,floating:n,strategy:r}=e,i=this.getOffsetParent||XL,o=this.getDimensions;return{reference:function(e,t,n){let r=Xg(t),i=XR(t),o=XO(e,!0,"fixed"===n,t),a={scrollLeft:0,scrollTop:0},u={x:0,y:0};if(r||!r&&"fixed"!==n){if(("body"!==Xh(t)||Xb(i))&&(a=Xk(t)),Xg(t)){let e=XO(t,!0);u.x=e.x+t.clientLeft,u.y=e.y+t.clientTop}else i&&(u.x=XE(i))}return{x:o.left+a.scrollLeft-u.x,y:o.top+a.scrollTop-u.y,width:o.width,height:o.height}}(t,await i(n),r),floating:{x:0,y:0,...await o(n)}}},getClientRects:e=>Array.from(e.getClientRects()),isRTL:e=>"rtl"===Xc(e).direction};function XB(e,t,n,r){void 0===r&&(r={});let{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:a=!0,animationFrame:u=!1}=r,s=i&&!u,l=s||o?[...Xy(e)?Xj(e):e.contextElement?Xj(e.contextElement):[],...Xj(t)]:[];l.forEach(e=>{s&&e.addEventListener("scroll",n,{passive:!0}),o&&e.addEventListener("resize",n)});let c,d=null;if(a){let r=!0;d=new ResizeObserver(()=>{r||n(),r=!1}),Xy(e)&&!u&&d.observe(e),Xy(e)||!e.contextElement||u||d.observe(e.contextElement),d.observe(t)}let f=u?XO(e):null;return u&&function t(){let r=XO(e);f&&(r.x!==f.x||r.y!==f.y||r.width!==f.width||r.height!==f.height)&&n(),f=r,c=requestAnimationFrame(t)}(),n(),()=>{var e;l.forEach(e=>{s&&e.removeEventListener("scroll",n),o&&e.removeEventListener("resize",n)}),null==(e=d)||e.disconnect(),d=null,u&&cancelAnimationFrame(c)}}let XP=(e,t,n)=>{let r=new Map,i={platform:XK,...n},o={...i.platform,_c:r};return $8(e,t,{...i,platform:o})};var XW="u">typeof document?x.useLayoutEffect:x.useEffect;function XD(e,t){let n,r,i;if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if((n=e.length)!=t.length)return!1;for(r=n;0!=r--;)if(!XD(e[r],t[r]))return!1;return!0}if((n=(i=Object.keys(e)).length)!==Object.keys(t).length)return!1;for(r=n;0!=r--;)if(!Object.prototype.hasOwnProperty.call(t,i[r]))return!1;for(r=n;0!=r--;){let n=i[r];if(!("_owner"===n&&e.$$typeof)&&!XD(e[n],t[n]))return!1}return!0}return e!=e&&t!=t}function XN(e){let t=x.useRef(e);return XW(()=>{t.current=e}),t}var Xq="u">typeof document?x.useLayoutEffect:x.useEffect;let XQ=!1,XV=0,Xz=()=>"floating-ui-"+XV++,XY=(Bx||(Bx=n.t(x,2)))["useId".toString()]??function(){let[e,t]=x.useState(()=>XQ?Xz():void 0);return Xq(()=>{null==e&&t(Xz())},[]),x.useEffect(()=>{XQ||(XQ=!0)},[]),e},XH=x.createContext(null),XG=x.createContext(null),XZ=()=>{var e,t;return null!=(e=null==(t=x.useContext(XH))?void 0:t.id)?e:null},XJ=()=>x.useContext(XG);function X$(e){var t;return null!=(t=null==e?void 0:e.ownerDocument)?t:document}function XX(e){var t;return null!=(t=X$(e).defaultView)?t:window}function X0(e){return!!e&&e instanceof XX(e).Element}let X1=(Bx||(Bx=n.t(x,2)))["useInsertionEffect".toString()];function X2(e){let t=x.useRef(()=>{});return X1?X1(()=>{t.current=e}):t.current=e,x.useCallback(function(){for(var e=arguments.length,n=Array(e),r=0;r<e;r++)n[r]=arguments[r];return null==t.current?void 0:t.current(...n)},[])}function X6(e,t,n){let r=new Map;return{..."floating"===n&&{tabIndex:-1},...e,...t.map(e=>e?e[n]:null).concat(e).reduce((e,t)=>(t&&Object.entries(t).forEach(t=>{let[n,i]=t;if(0===n.indexOf("on")){if(r.has(n)||r.set(n,[]),"function"==typeof i){var o;null==(o=r.get(n))||o.push(i),e[n]=function(){for(var e,t=arguments.length,i=Array(t),o=0;o<t;o++)i[o]=arguments[o];null==(e=r.get(n))||e.forEach(e=>e(...i))}}}else e[n]=i}),e),{})}}function X5(e,t){var n,r;let i=null!=(n=e.filter(e=>{var n;return e.parentId===t&&(null==(n=e.context)?void 0:n.open)}))?n:[],o=i;for(;o.length;)o=null!=(r=e.filter(e=>{var t;return null==(t=o)?void 0:t.some(t=>{var n;return e.parentId===t.id&&(null==(n=e.context)?void 0:n.open)})}))?r:[],i=i.concat(o);return i}function X3(e){let t=e.activeElement;for(;(null==(n=t)||null==(r=n.shadowRoot)?void 0:r.activeElement)!=null;){var n,r;t=t.shadowRoot.activeElement}return t}function X9(e){e.preventDefault(),e.stopPropagation()}function X4(e){let t=(0,x.useRef)();return Xq(()=>{t.current=e},[e]),t.current}let X7=function(e,t){let{open:n}=e,{enabled:r=!0,role:i="dialog"}=void 0===t?{}:t,o=XY(),a=XY(),u={id:o,role:i};return r?"tooltip"===i?{reference:{"aria-describedby":n?o:void 0},floating:u}:{reference:{"aria-expanded":n?"true":"false","aria-haspopup":"alertdialog"===i?"dialog":i,"aria-controls":n?o:void 0,..."listbox"===i&&{role:"combobox"},..."menu"===i&&{id:a}},floating:{...u,..."menu"===i&&{"aria-labelledby":a}}}:{}};function X8(e,t){return null!=t&&("composedPath"in e?e.composedPath().includes(t):null!=e.target&&t.contains(e.target))}let eee=function(e,t){let{open:n,onOpenChange:r,refs:i,events:o,nodeId:a}=e,{enabled:u=!0,escapeKey:s=!0,outsidePointerDown:l=!0,referencePointerDown:c=!1,ancestorScroll:d=!1,bubbles:f=!0}=void 0===t?{}:t,p=XJ(),A=null!=XZ(),h=x.useRef(!1);return x.useEffect(()=>{if(!n||!u)return;function e(e){"Escape"!==e.key||!f&&p&&X5(p.nodesRef.current,a).length>0||(o.emit("dismiss",{preventScroll:!1}),r(!1))}function t(e){var t;let n=h.current;if(h.current=!1,n)return;let u="composedPath"in e?e.composedPath()[0]:e.target;if(X0(u)&&i.floating.current){let n=null!=(t=i.floating.current.ownerDocument.defaultView)?t:window,r=u.scrollWidth>u.clientWidth,o=u.scrollHeight>u.clientHeight,a=o&&e.offsetX>u.clientWidth;if(o&&"rtl"===n.getComputedStyle(u).direction&&(a=e.offsetX<=u.offsetWidth-u.clientWidth),a||r&&e.offsetY>u.clientHeight)return}let s=p&&X5(p.nodesRef.current,a).some(t=>{var n;return X8(e,null==(n=t.context)?void 0:n.refs.floating.current)});X8(e,i.floating.current)||X8(e,i.domReference.current)||s||!f&&p&&X5(p.nodesRef.current,a).length>0||(o.emit("dismiss",!!A&&{preventScroll:!0}),r(!1))}function c(){r(!1)}let m=X$(i.floating.current);s&&m.addEventListener("keydown",e),l&&m.addEventListener("pointerdown",t);let g=(d?[...X0(i.reference.current)?Xj(i.reference.current):[],...X0(i.floating.current)?Xj(i.floating.current):[]]:[]).filter(e=>{var t;return e!==(null==(t=m.defaultView)?void 0:t.visualViewport)});return g.forEach(e=>e.addEventListener("scroll",c,{passive:!0})),()=>{s&&m.removeEventListener("keydown",e),l&&m.removeEventListener("pointerdown",t),g.forEach(e=>e.removeEventListener("scroll",c))}},[s,l,o,p,a,n,r,d,u,f,i,A]),u?{reference:{onPointerDown(){c&&(o.emit("dismiss"),r(!1))}},floating:{onPointerDownCapture(){h.current=!0}}}:{}},eet="ArrowUp",een="ArrowDown",eer="ArrowLeft",eei="ArrowRight";function eeo(e,t,n){return Math.floor(e/t)!==n}function eea(e,t){return t<0||t>=e.current.length}function eeu(e,t){let{startingIndex:n=-1,decrement:r=!1,disabledIndices:i,amount:o=1}=void 0===t?{}:t,a=e.current,u=n;do{var s,l;u+=r?-o:o}while(u>=0&&u<=a.length-1&&(i?i.includes(u):null==a[u]||null!=(s=a[u])&&s.hasAttribute("disabled")||(null==(l=a[u])?void 0:l.getAttribute("aria-disabled"))==="true"));return u}function ees(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function eel(e,t){return ees(t,e===eet||e===een,e===eer||e===eei)}function eec(e,t,n){return ees(t,e===een,n?e===eer:e===eei)||"Enter"===e||" "==e||""===e}function eed(e,t){return eeu(e,{disabledIndices:t})}function eef(e,t){return eeu(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}let eep=function(e,t){let{open:n,onOpenChange:r,refs:i}=e,{listRef:o,activeIndex:a,onNavigate:u=()=>{},enabled:s=!0,selectedIndex:l=null,allowEscape:c=!1,loop:d=!1,nested:f=!1,rtl:p=!1,virtual:A=!1,focusItemOnOpen:h="auto",focusItemOnHover:m=!0,openOnArrowKeyDown:g=!0,disabledIndices:y,orientation:v="vertical",cols:b=1}=void 0===t?{listRef:{current:[]},activeIndex:null,onNavigate:()=>{}}:t,C=XZ(),S=XJ(),w=X4(n),I=X2(u),_=X2(X4(u)),T=x.useRef(h),O=x.useRef(l??-1),R=x.useRef(null),k=function(e){let t=(0,x.useRef)(e);return Xq(()=>{t.current=e}),t}(y),E=x.useRef(!1),M=x.useRef(-1),[j,F]=x.useState(),U=x.useCallback((e,t)=>{M.current=requestAnimationFrame(()=>{var n,r;A?F(null==(n=e.current[t.current])?void 0:n.id):null==(r=e.current[t.current])||r.focus({preventScroll:!0})})},[A]);function L(e){var t,a;if(E.current=!0,f&&(t=e.key,ees(v,p?t===eei:t===eer,t===eet))){X9(e),r(!1),(a=i.domReference.current)&&a instanceof XX(a).HTMLElement&&i.domReference.current.focus();return}let u=O.current,s=eed(o,y),l=eef(o,y);if("Home"===e.key&&(O.current=s,I(O.current)),"End"===e.key&&(O.current=l,I(O.current)),b>1){let t=O.current;if(e.key===eet){if(X9(e),-1===t)O.current=l;else if(O.current=eeu(o,{startingIndex:t,amount:b,decrement:!0,disabledIndices:y}),d&&(t-b<s||O.current<0)){let e=t%b,n=l%b,r=l-(n-e);n===e?O.current=l:O.current=n>e?r:r-b}eea(o,O.current)&&(O.current=t),I(O.current)}if(e.key===een&&(X9(e),-1===t?O.current=s:(O.current=eeu(o,{startingIndex:t,amount:b,disabledIndices:y}),d&&t+b>l&&(O.current=eeu(o,{startingIndex:t%b-b,amount:b,disabledIndices:y}))),eea(o,O.current)&&(O.current=t),I(O.current)),"both"===v){let n=Math.floor(t/b);e.key===eei&&(X9(e),t%b!=b-1?(O.current=eeu(o,{startingIndex:t,disabledIndices:y}),d&&eeo(O.current,b,n)&&(O.current=eeu(o,{startingIndex:t-t%b-1,disabledIndices:y}))):d&&(O.current=eeu(o,{startingIndex:t-t%b-1,disabledIndices:y})),eeo(O.current,b,n)&&(O.current=t)),e.key===eer&&(X9(e),t%b!=0?(O.current=eeu(o,{startingIndex:t,disabledIndices:y,decrement:!0}),d&&eeo(O.current,b,n)&&(O.current=eeu(o,{startingIndex:t+(b-t%b),decrement:!0,disabledIndices:y}))):d&&(O.current=eeu(o,{startingIndex:t+(b-t%b),decrement:!0,disabledIndices:y})),eeo(O.current,b,n)&&(O.current=t));let r=Math.floor(l/b)===n;eea(o,O.current)&&(d&&r?O.current=e.key===eer?l:eeu(o,{startingIndex:t-t%b-1,disabledIndices:y}):O.current=t),I(O.current);return}}if(eel(e.key,v)){if(X9(e),n&&!A&&X3(e.currentTarget.ownerDocument)===e.currentTarget){O.current=eec(e.key,v,p)?s:l,I(O.current);return}eec(e.key,v,p)?d?O.current=u>=l?c&&u!==o.current.length?-1:s:eeu(o,{startingIndex:u,disabledIndices:y}):O.current=Math.min(l,eeu(o,{startingIndex:u,disabledIndices:y})):d?O.current=u<=s?c&&-1!==u?o.current.length:l:eeu(o,{startingIndex:u,decrement:!0,disabledIndices:y}):O.current=Math.max(s,eeu(o,{startingIndex:u,decrement:!0,disabledIndices:y})),eea(o,O.current)?I(null):I(O.current)}}return Xq(()=>{s&&(!w&&n&&T.current&&null!=l&&I(l),w&&!n&&(cancelAnimationFrame(M.current),O.current=-1,_(null)))},[n,w,l,o,U,s,I,_]),Xq(()=>{s&&n&&(null==a?null==l&&(w&&(O.current=-1,U(o,O)),!w&&T.current&&(null!=R.current||!0===T.current&&null==R.current)&&(O.current=null==R.current||eec(R.current,v,p)||f?eed(o,k.current):eef(o,k.current),I(O.current),U(o,O))):eea(o,a)||(O.current=a,U(o,O)))},[n,w,a,l,f,o,I,U,s,c,v,p,A,k]),Xq(()=>{if(s&&!n&&w){var e,t;let n=null==S||null==(e=S.nodesRef.current.find(e=>e.id===C))||null==(t=e.context)?void 0:t.refs.floating.current;n&&!n.contains(X3(X$(n)))&&n.focus({preventScroll:!0})}},[s,n,w,S,C]),Xq(()=>{R.current=null}),s?{reference:{...A&&n&&null!=a&&{"aria-activedescendant":j},onKeyDown(e){if(E.current=!0,A&&n)return L(e);if((0===e.key.indexOf("Arrow")||"Enter"===e.key||" "===e.key||""===e.key)&&(R.current=e.key),f){var t;t=e.key,ees(v,p?t===eer:t===eei,t===een)&&(X9(e),n?(O.current=eed(o,y),I(O.current)):r(!0));return}eel(e.key,v)&&(null!=l&&(O.current=l),X9(e),!n&&g?r(!0):L(e),n&&I(O.current))}},floating:{"aria-orientation":"both"===v?void 0:v,...A&&null!=a&&{"aria-activedescendant":j},onKeyDown:L,onPointerMove(){E.current=!1}},item:{onFocus(e){let{currentTarget:t}=e,n=o.current.indexOf(t);-1!==n&&I(n)},onClick:e=>{let{currentTarget:t}=e;return t.focus({preventScroll:!0})},...m&&{onMouseMove(e){let{currentTarget:t}=e;if(t){let e=o.current.indexOf(t);-1!==e&&I(e)}},onPointerLeave(){if(!E.current&&(O.current=-1,U(o,O),I(null),!A)){var e;null==(e=i.floating.current)||e.focus({preventScroll:!0})}}}}}:{}},eeA=new z1("suggestion"),eeh=Ze.create({name:"paragraph",priority:1e3,addOptions:()=>({HTMLAttributes:{}}),group:"block",content:"inline*",parseHTML:()=>[{tag:"p"}],renderHTML({HTMLAttributes:e}){return["p",Gm(this.options.HTMLAttributes,e),0]},addCommands(){return{setParagraph:()=>({commands:e})=>e.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),eem=Lm.RichTextNodeType.rtl,eeg=GU.create({name:"textDirection",addOptions:()=>({supportedExtensionNames:[]}),addGlobalAttributes(){return[{types:this.options.supportedExtensionNames,attributes:{dir:{default:"ltr",parseHTML:e=>e.getAttribute("dir"),renderHTML:e=>({dir:eev(e.dir)})}}}]},addCommands(){return{setDirection:e=>({commands:t})=>{switch(e){case"ltr":return t.setLeftToRight();case"rtl":return t.setRightToLeft()}},toggleDirection:e=>({commands:t})=>t.setDirection("rtl"===e?"ltr":"rtl"),setRightToLeft:()=>({commands:e})=>this.options.supportedExtensionNames.every(t=>e.updateAttributes(t,{dir:"rtl"})),setLeftToRight:()=>({commands:e})=>this.options.supportedExtensionNames.every(t=>e.resetAttributes(t,"dir"))}},addKeyboardShortcuts(){return{"Mod-Shift-r":()=>this.editor.commands.setRightToLeft(),"Mod-Shift-l":()=>this.editor.commands.setLeftToRight()}}}),eey={parseNodeAttrsDirection:e=>eev(e.dir),fromPrismic:e=>({dir:eev(e.direction)}),toPrismic(e){return{direction:this.parseNodeAttrsDirection(e.attrs)}}};function eev(e){return"rtl"===e?"rtl":"ltr"}let eex=eeh.extend({name:"paragraph",parseHTML:()=>[{tag:"p"}],renderHTML({HTMLAttributes:e}){return["p",Gm(this.options.HTMLAttributes,e),0]}}),eeb=new $f([Lm.RichTextNodeType.paragraph],eex.name,eex,{fromPrismic:e=>function(t){var n;let r=$X.converter.fromPrismic(e)(eex.name,t);return null==(n=e.nodes[eex.name])?void 0:n.create(eey.fromPrismic(t),r)},toPrismic:e=>$X.converter.toPrismic(e,Lm.RichTextNodeType.paragraph,eey.toPrismic(e))},"Type '/' for commands"),eeC=["ArrowDown","ArrowUp","End","Home"],eeS=["Enter"],eew=["Escape",...eeC,...eeS],eeI=GU.create({name:"slash-commands",addOptions:()=>({nodeTypes:[]}),addProseMirrorPlugins(){let e=etg(etf,this.options.nodeTypes);return e.length>1?[function({pluginKey:e=eeA,editor:t,char:n="@",allowSpaces:r=!1,allowedPrefixes:i=[" "],startOfLine:o=!1,decorationTag:a="span",decorationClass:u="suggestion",command:s=()=>null,items:l=()=>[],render:c=()=>({}),allow:d=()=>!0,findSuggestionMatch:f=function(e){var t;let{char:n,allowSpaces:r,allowedPrefixes:i,startOfLine:o,$position:a}=e,u=n.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"),s=RegExp(`\\s${u}$`),l=o?"^":"",c=r?RegExp(`${l}${u}.*?(?=\\s${u}|$)`,"gm"):RegExp(`${l}(?:^)?${u}[^\\s${u}]*`,"gm"),d=(null===(t=a.nodeBefore)||void 0===t?void 0:t.isText)&&a.nodeBefore.text;if(!d)return null;let f=a.pos-d.length,p=Array.from(d.matchAll(c)).pop();if(!p||void 0===p.input||void 0===p.index)return null;let A=p.input.slice(Math.max(0,p.index-1),p.index),h=RegExp(`^[${null==i?void 0:i.join("")}\0]?$`).test(A);if(null!==i&&!h)return null;let m=f+p.index,g=m+p[0].length;return r&&s.test(d.slice(g-1,g+1))&&(p[0]+=" ",g+=1),m<a.pos&&g>=a.pos?{range:{from:m,to:g},query:p[0].slice(n.length),text:p[0]}:null}}){let p;let A=null==c?void 0:c(),h=new z$({key:e,view(){return{update:async(e,n)=>{var r,i,o,a,u,c,d;let f=null===(r=this.key)||void 0===r?void 0:r.getState(n),h=null===(i=this.key)||void 0===i?void 0:i.getState(e.state),m=f.active&&h.active&&f.range.from!==h.range.from,g=!f.active&&h.active,y=f.active&&!h.active,v=!g&&!y&&f.query!==h.query,x=g||m,b=v&&!m,C=y||m;if(!x&&!b&&!C)return;let S=C&&!x?f:h,w=e.dom.querySelector(`[data-decoration-id="${S.decorationId}"]`);p={editor:t,range:S.range,query:S.query,text:S.text,items:[],command:e=>s({editor:t,range:S.range,props:e}),decorationNode:w,clientRect:w?()=>{var n;let{decorationId:r}=null===(n=this.key)||void 0===n?void 0:n.getState(t.state),i=e.dom.querySelector(`[data-decoration-id="${r}"]`);return(null==i?void 0:i.getBoundingClientRect())||null}:null},x&&(null===(o=null==A?void 0:A.onBeforeStart)||void 0===o||o.call(A,p)),b&&(null===(a=null==A?void 0:A.onBeforeUpdate)||void 0===a||a.call(A,p)),(b||x)&&(p.items=await l({editor:t,query:S.query})),C&&(null===(u=null==A?void 0:A.onExit)||void 0===u||u.call(A,p)),b&&(null===(c=null==A?void 0:A.onUpdate)||void 0===c||c.call(A,p)),x&&(null===(d=null==A?void 0:A.onStart)||void 0===d||d.call(A,p))},destroy:()=>{var e;p&&(null===(e=null==A?void 0:A.onExit)||void 0===e||e.call(A,p))}}},state:{init:()=>({active:!1,range:{from:0,to:0},query:null,text:null,composing:!1}),apply(e,a,u,s){let{isEditable:l}=t,{composing:c}=t.view,{selection:p}=e,{empty:A,from:h}=p,m={...a};if(m.composing=c,l&&(A||t.view.composing)){(h<a.range.from||h>a.range.to)&&!c&&!a.composing&&(m.active=!1);let e=f({char:n,allowSpaces:r,allowedPrefixes:i,startOfLine:o,$position:p.$from}),u=`id_${Math.floor(4294967295*Math.random())}`;e&&d({editor:t,state:s,range:e.range})?(m.active=!0,m.decorationId=a.decorationId?a.decorationId:u,m.range=e.range,m.query=e.query,m.text=e.text):m.active=!1}else m.active=!1;return m.active||(m.decorationId=null,m.range={from:0,to:0},m.query=null,m.text=null),m}},props:{handleKeyDown(e,t){var n;let{active:r,range:i}=h.getState(e.state);return r&&(null===(n=null==A?void 0:A.onKeyDown)||void 0===n?void 0:n.call(A,{view:e,event:t,range:i}))||!1},decorations(e){let{active:t,range:n,decorationId:r}=h.getState(e);return t?Hs.create(e.doc,[Ho.inline(n.from,n.to,{nodeName:a,class:u,"data-decoration-id":r})]):null}}});return h}({allowSpaces:!0,char:"/",editor:this.editor,startOfLine:!0,allow:({state:e})=>{let t=e.selection.$from;return t.parent.type.name===eeb.name&&1===t.depth},command:({editor:e,props:t,range:n})=>{t.runCommands(e,{deleteRange:n})},items:({query:t})=>{let n=t.toLocaleLowerCase().trim();return e.filter(e=>{var t,r;return(null==(t=e.shortText)?void 0:t.toLocaleLowerCase().includes(n))||(null==(r=e.text)?void 0:r.toLocaleLowerCase().includes(n))})},render:()=>{let e;return{onStart:t=>{e=new $t(ee_,{editor:t.editor,props:t}),document.body.appendChild(e.element)},onUpdate:t=>{null==e||e.updateProps(t)},onKeyDown:({event:t})=>{var n;return!!(eew.includes(t.key)&&null!=(n=null==e?void 0:e.ref)&&n.handleKeyDown(t))},onExit:()=>{null==e||e.destroy(),null==e||e.element.remove()}}}})]:[]}}),ee_=(0,x.forwardRef)(function(e,t){var n,r,i,o;let{command:a,decorationNode:u,editor:s,items:l}=e,[c,d]=(0,x.useState)(!0),{context:f,floating:p,reference:A,x:h,y:m}=function(e){let{open:t=!1,onOpenChange:n,whileElementsMounted:r,placement:i,middleware:o,strategy:a,nodeId:u}=void 0===e?{}:e,[s,l]=x.useState(null),c=XJ(),d=x.useRef(null),f=x.useRef({}),p=x.useState(()=>(function(){let e=new Map;return{emit(t,n){var r;null==(r=e.get(t))||r.forEach(e=>e(n))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){e.set(t,(e.get(t)||[]).filter(e=>e!==n))}}})())[0],A=function(e){void 0===e&&(e={});let{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,whileElementsMounted:o,open:a}=e,[u,s]=x.useState({x:null,y:null,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[l,c]=x.useState(r);XD(l,r)||c(r);let d=x.useRef(null),f=x.useRef(null),p=x.useRef(u),A=XN(o),h=XN(i),[m,g]=x.useState(null),[y,v]=x.useState(null),b=x.useCallback(e=>{d.current!==e&&(d.current=e,g(e))},[]),C=x.useCallback(e=>{f.current!==e&&(f.current=e,v(e))},[]),S=x.useCallback(()=>{if(!d.current||!f.current)return;let e={placement:t,strategy:n,middleware:l};h.current&&(e.platform=h.current),XP(d.current,f.current,e).then(e=>{let t={...e,isPositioned:!0};w.current&&!XD(p.current,t)&&(p.current=t,F.flushSync(()=>{s(t)}))})},[l,t,n,h]);XW(()=>{!1===a&&p.current.isPositioned&&(p.current.isPositioned=!1,s(e=>({...e,isPositioned:!1})))},[a]);let w=x.useRef(!1);XW(()=>(w.current=!0,()=>{w.current=!1}),[]),XW(()=>{if(m&&y){if(A.current)return A.current(m,y,S);S()}},[m,y,S,A]);let I=x.useMemo(()=>({reference:d,floating:f,setReference:b,setFloating:C}),[b,C]),_=x.useMemo(()=>({reference:m,floating:y}),[m,y]);return x.useMemo(()=>({...u,update:S,refs:I,elements:_,reference:b,floating:C}),[u,S,I,_,b,C])}({placement:i,middleware:o,strategy:a,whileElementsMounted:r}),h=X2(n),m=x.useMemo(()=>({...A.refs,domReference:d}),[A.refs]),g=x.useMemo(()=>({...A,refs:m,dataRef:f,nodeId:u,events:p,open:t,onOpenChange:h,_:{domReference:s}}),[A,u,p,t,h,m,s]);Xq(()=>{let e=null==c?void 0:c.nodesRef.current.find(e=>e.id===u);e&&(e.context=g)});let{reference:y}=A,v=x.useCallback(e=>{(X0(e)||null===e)&&(g.refs.domReference.current=e,l(e)),y(e)},[y,g.refs]);return x.useMemo(()=>({...A,context:g,refs:m,reference:v}),[A,m,g,v])}({middleware:[{name:"offset",options:0,async fn(e){let{x:t,y:n}=e,r=await async function(e,t){let{placement:n,platform:r,elements:i}=e,o=await (null==r.isRTL?void 0:r.isRTL(i.floating)),a=$9(n),u=$5(n),s="x"===$4(n),l=["left","top"].includes(a)?-1:1,c=o&&s?-1:1,{mainAxis:d,crossAxis:f,alignmentAxis:p}={mainAxis:t,crossAxis:0,alignmentAxis:null};return u&&"number"==typeof p&&(f="end"===u?-1*p:p),s?{x:f*c,y:d*l}:{x:d*l,y:f*c}}(e,0);return{x:t+r.x,y:n+r.y,data:r}}},(void 0===n&&(n={}),{name:"flip",options:n,async fn(e){var t,r,i,o;let{placement:a,middlewareData:u,rects:s,initialPlacement:l,platform:c,elements:d}=e,{mainAxis:f=!0,crossAxis:p=!0,fallbackPlacements:A,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:g=!0,...y}=n,v=$9(a),x=$9(l)===l,b=await (null==c.isRTL?void 0:c.isRTL(d.floating)),C=A||(x||!g?[Xo(l)]:function(e){let t=Xo(e);return[Xu(e),t,Xu(t)]}(l));A||"none"===m||C.push(...function(e,t,n,r){let i=$5(e),o=function(e,t,n){let r=["left","right"],i=["right","left"];switch(e){case"top":case"bottom":return n?t?i:r:t?r:i;case"left":case"right":return t?["top","bottom"]:["bottom","top"];default:return[]}}($9(e),"start"===n,r);return i&&(o=o.map(e=>e+"-"+i),t&&(o=o.concat(o.map(Xu)))),o}(l,g,m,b));let S=[l,...C],w=await Xt(e,y),I=[],_=(null==(t=u.flip)?void 0:t.overflows)||[];if(f&&I.push(w[v]),p){let{main:e,cross:t}=function(e,t,n){void 0===n&&(n=!1);let r=$5(e),i=$4(e),o=$3(i),a="x"===i?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[o]>t.floating[o]&&(a=Xo(a)),{main:a,cross:Xo(a)}}(a,s,b);I.push(w[e],w[t])}if(_=[..._,{placement:a,overflows:I}],!I.every(e=>e<=0)){let e=((null==(r=u.flip)?void 0:r.index)||0)+1,t=S[e];if(t)return{data:{index:e,overflows:_},reset:{placement:t}};let n=null==(i=_.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:i.placement;if(!n)switch(h){case"bestFit":{let e=null==(o=_.map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0])?void 0:o[0];e&&(n=e);break}case"initialPlacement":n=l}if(a!==n)return{reset:{placement:n}}}return{}}}),{name:"shift",options:i={limiter:(void 0===r&&(r={}),{options:r,fn(e){let{x:t,y:n,placement:i,rects:o,middlewareData:a}=e,{offset:u=0,mainAxis:s=!0,crossAxis:l=!0}=r,c={x:t,y:n},d=$4(i),f=Xs(d),p=c[d],A=c[f],h="function"==typeof u?u(e):u,m="number"==typeof h?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(s){let e="y"===d?"height":"width",t=o.reference[d]-o.floating[e]+m.mainAxis,n=o.reference[d]+o.reference[e]-m.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){var g,y;let e="y"===d?"width":"height",t=["top","left"].includes($9(i)),n=o.reference[f]-o.floating[e]+(t&&(null==(g=a.offset)?void 0:g[f])||0)+(t?0:m.crossAxis),r=o.reference[f]+o.reference[e]+(t?0:(null==(y=a.offset)?void 0:y[f])||0)-(t?m.crossAxis:0);A<n?A=n:A>r&&(A=r)}return{[d]:p,[f]:A}}})},async fn(e){let{x:t,y:n,placement:r}=e,{mainAxis:o=!0,crossAxis:a=!1,limiter:u={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...s}=i,l={x:t,y:n},c=await Xt(e,s),d=$4($9(r)),f=Xs(d),p=l[d],A=l[f];if(o){let e="y"===d?"bottom":"right";p=Xr(p+c["y"===d?"top":"left"],Xn(p,p-c[e]))}if(a){let e="y"===f?"bottom":"right";A=Xr(A+c["y"===f?"top":"left"],Xn(A,A-c[e]))}let h=u.fn({...e,[d]:p,[f]:A});return{...h,data:{x:h.x-t,y:h.y-n}}}}],onOpenChange:d,open:c,placement:"top-start",strategy:"fixed",whileElementsMounted:XB});(0,x.useLayoutEffect)(()=>{A(u)},[A,u]),(0,x.useEffect)(()=>{let e;let t=()=>{e=window.setTimeout(()=>{d(!0)})},n=()=>{d(!1)};return s.on("focus",t).on("blur",n),()=>{s.off("focus",t).off("blur",n),clearTimeout(e)}},[s]);let[g,y]=(0,x.useState)(0),v=(0,x.useRef)([]);(0,w.pQ)(l,()=>{y(0),v.current=[]});let{getFloatingProps:C,getItemProps:S,getReferenceProps:I}=(o=[eee(f,{outsidePointerDown:!1}),eep(f,{activeIndex:g,listRef:v,onNavigate:e=>{y(t=>e??t)},openOnArrowKeyDown:!1,virtual:!0}),X7(f,{role:"menu"})],{getReferenceProps:e=>X6(e,o,"reference"),getFloatingProps:e=>X6(e,o,"floating"),getItemProps:e=>X6(e,o,"item")}),_=I().onKeyDown;return(0,x.useImperativeHandle)(t,()=>({handleKeyDown:e=>{if(!c)return!1;if(eeC.includes(e.key)&&_(e),eeS.includes(e.key)){let e=l[g];void 0!==e&&a(e)}return!0}}),[g,a,l,_,c]),c?q.jsx(b.xu,{...C(),minWidth:256,backgroundColor:"grey1",border:!0,borderStyle:"solid",borderRadius:6,flexDirection:"column",ref:p,top:0,left:0,position:"fixed",transform:null!==h&&null!==m?`translate3d(${Math.round(h)}px, ${Math.round(m)}px, 0)`:"translate3d(0, -200%, 0)",overflow:"hidden",children:q.jsxs("div",{style:{boxShadow:"0px 2px 10px 0px hsla(0, 0%, 0%, 0.1)"},children:[l.map((e,t)=>{let n=S({onClick:()=>{a(e)},onPointerDown:e=>{e.preventDefault()}});return(0,x.createElement)(eeT,{...n,key:e.nodeType,ref:e=>{v.current[t]=e},active:t===g,isFirstItem:0===t,isLastItem:t===l.length-1,shortcut:`/${e.shortText??""}`},e.text)}),0===l.length&&q.jsx(eeT,{...S({onPointerDown:e=>{e.preventDefault()}}),disabled:!0,ref:e=>{v.current[0]=e},children:"No results"})]})}):null}),eeT=(0,x.forwardRef)(function(e,t){let{children:n,disabled:r=!1,shortcut:i,active:o=!1,isFirstItem:a=!1,isLastItem:u=!1,...s}=e;return q.jsx("div",{...s,role:"button",style:{cursor:r?"default":"pointer"},ref:t,children:q.jsxs(b.xu,{alignItems:"center",height:32,flexDirection:"row",gap:8,padding:8,backgroundColor:o?"grey4":"inherit",justifyContent:"space-between",opacity:r?.5:1,children:[q.jsx(b.xv,{color:"grey12",component:"span",children:n}),i&&q.jsx(b.xv,{color:"inherit",component:"span",variant:"small",children:i})]})})}),eeO=$R.extend({name:"bulletList",parseHTML:()=>[{tag:"ul"}],renderHTML({HTMLAttributes:e}){return["ul",Gm(this.options.HTMLAttributes,e),0]}}).configure({itemTypeName:"listItem"}),eeR=new $g([Lm.RichTextNodeType.list],eeO.name,eeO,{fromPrismic:e=>function(t){var n;let r=$M.converter.fromPrismic(e)(t);if(r)return null==(n=e.nodes[eeO.name])?void 0:n.create(eey.fromPrismic(t),r)},toPrismic:e=>$x.children.map(e,e=>$M.converter.toPrismic(e,Lm.RichTextNodeType.list).filter(_.$)).flat()}),eek=/^```([a-z]+)?[\s\n]$/,eeE=/^~~~([a-z]+)?[\s\n]$/,eeM=Ze.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:e=>{var t;let{languageClassPrefix:n}=this.options;return[...(null===(t=e.firstElementChild)||void 0===t?void 0:t.classList)||[]].filter(e=>e.startsWith(n)).map(e=>e.replace(n,""))[0]||null},rendered:!1}}},parseHTML:()=>[{tag:"pre",preserveWhitespace:"full"}],renderHTML({node:e,HTMLAttributes:t}){return["pre",Gm(this.options.HTMLAttributes,t),["code",{class:e.attrs.language?this.options.languageClassPrefix+e.attrs.language:null},0]]},addCommands(){return{setCodeBlock:e=>({commands:t})=>t.setNode(this.name,e),toggleCodeBlock:e=>({commands:t})=>t.toggleNode(this.name,"paragraph",e)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{let{empty:e,$anchor:t}=this.editor.state.selection,n=1===t.pos;return!!e&&t.parent.type.name===this.name&&(!!n||!t.parent.textContent.length)&&this.editor.commands.clearNodes()},Enter:({editor:e})=>{if(!this.options.exitOnTripleEnter)return!1;let{state:t}=e,{selection:n}=t,{$from:r,empty:i}=n;if(!i||r.parent.type!==this.type)return!1;let o=r.parentOffset===r.parent.nodeSize-2,a=r.parent.textContent.endsWith(`
|
|
20
|
-
|
|
21
|
-
`);return!!o&&!!a&&e.chain().command(({tr:e})=>(e.delete(r.pos-2,r.pos),!0)).exitCode().run()},ArrowDown:({editor:e})=>{if(!this.options.exitOnArrowDown)return!1;let{state:t}=e,{selection:n,doc:r}=t,{$from:i,empty:o}=n;if(!o||i.parent.type!==this.type||i.parentOffset!==i.parent.nodeSize-2)return!1;let a=i.after();return!(void 0===a||r.nodeAt(a))&&e.commands.exitCode()}}},addInputRules(){return[G4({find:eek,type:this.type,getAttributes:e=>({language:e[1]})}),G4({find:eeE,type:this.type,getAttributes:e=>({language:e[1]})})]},addProseMirrorPlugins(){return[new z$({key:new z1("codeBlockVSCodeHandler"),props:{handlePaste:(e,t)=>{if(!t.clipboardData||this.editor.isActive(this.type.name))return!1;let n=t.clipboardData.getData("text/plain"),r=t.clipboardData.getData("vscode-editor-data"),i=r?JSON.parse(r):void 0,o=null==i?void 0:i.mode;if(!n||!o)return!1;let{tr:a}=e.state;return a.replaceSelectionWith(this.type.create({language:o})),a.setSelection(zN.near(a.doc.resolve(Math.max(0,a.selection.from-2)))),a.insertText(n.replace(/\r\n?/g,`
|
|
22
|
-
`)),a.setMeta("paste",!0),e.dispatch(a),!0}}})]}}).extend({name:"preformatted",addAttributes(){return{language:{default:null,parseHTML:e=>{var t;let{languageClassPrefix:n}=this.options;return[...(null==(t=e.firstElementChild)?void 0:t.classList)||[]].filter(e=>e.startsWith(n)).map(e=>e.replace(n,""))[0]||null},renderHTML:e=>e.language?{class:this.options.languageClassPrefix+e.language}:null}}},parseHTML:()=>[{tag:"pre",preserveWhitespace:"full"}],renderHTML({HTMLAttributes:e}){return["pre",Gm(this.options.HTMLAttributes),["code",e,0]]}}).configure({exitOnTripleEnter:!1}),eej=new $f([Lm.RichTextNodeType.preformatted],eeM.name,eeM,{fromPrismic:e=>function(t){var n;let r=$X.converter.fromPrismic(e)(eeM.name,t,!0);return null==(n=e.nodes[eeM.name])?void 0:n.create(eey.fromPrismic(t),r)},toPrismic:e=>$X.converter.toPrismic(e,Lm.RichTextNodeType.preformatted,eey.toPrismic(e))},"",!0);function eeF(e){let{editor:t,getPos:n,node:r}=e,[i,o]=(0,x.useState)(!1);return(0,x.useEffect)(()=>{function e(){let{from:e,to:i}=t.state.selection,a=n(),u=n()+r.nodeSize;o(e<=a&&i>=u)}function i(){o(!1)}return t.on("blur",i),t.on("selectionUpdate",e),()=>{t.off("blur",i),t.off("selectionUpdate",e)}},[t,n,r.nodeSize]),{selected:i}}function eeU(e){let t=(0,x.useRef)(null),n=(0,x.useRef)(null),{onKeyDown:r,url:i,urlChanged:o,onContentChange:a,debouncedUrl:u,content:s}=function(e,t,n){let{node:r}=e,i=r.attrs.content,o=(0,w.R9)(e.updateAttributes),a=(0,w.$P)({initialState:(null==i?void 0:i.embed_url)??"",startTransition:x.startTransition});function u(e){o({content:e})}let{onKeyDown:s}=function(e,t,n,r){let{editor:i,getPos:o,node:a}=e,[u,s]=(0,x.useState)(!0);return(0,x.useEffect)(()=>{u&&e.editor.isFocused&&(0,b.rI)(()=>{var e;return null==(e=n.current)?void 0:e.focus()})},[n,u,e.editor.isFocused]),{containerRef:r,inputRef:n,onKeyDown:function(e){let n=o(),r=o()+a.nodeSize;"Enter"===e.code&&(s(!1),i.chain().insertContentAt(r,{type:"paragraph"}).focus(r+1).run()),"Backspace"===e.code&&""===t&&i.chain().deleteRange({from:n,to:r}).focus(r+1).run(),"ArrowUp"===e.code&&(s(!1),i.chain().focus(n-1).run()),"ArrowDown"===e.code&&(s(!1),i.chain().focus(r+1).run())}}}(e,a.value,t,n);return{inputRef:t,containerRef:n,onKeyDown:s,url:a.value,urlChanged:function(e){a.set(e),(0,C.ju)(e)||u(void 0)},onContentChange:u,debouncedUrl:a.debouncedValue,content:e.node.attrs.content}}(e,t,n),{selected:l}=eeF(e);return q.jsx($e,{className:"custom-embed",children:q.jsxs("div",{contentEditable:"false",suppressContentEditableWarning:!0,children:[q.jsxs(b.xu,{flexGrow:1,alignItems:"center",children:[q.jsx(b.I5,{size:"small",name:"cloud",color:"grey11"}),q.jsx(b.xu,{flexGrow:1,height:40,ref:n,children:q.jsx(Qt,{id:"id",ref:t,value:i,variant:(0,C.ju)(i)?"link":"normal",placeholder:"Paste your link here",onValueChange:o,onKeyDown:r})})]}),(0,C.ju)(i)&&q.jsx(Qo,{selected:l,debouncedUrl:u,onContentChange:a,content:s})]})})}let eeL=Ze.create({name:"embed",group:"block",atom:!0,content:"block*",marks:"",addAttributes:()=>({content:{default:void 0}}),addCommands(){return{setEmbed:()=>({tr:e,dispatch:t})=>{let n=this.type.create();return t&&e.replaceSelectionWith(n),!0}}},parseHTML:()=>[{tag:"embed"}],renderHTML:()=>["embed"],addNodeView:()=>$r(eeU)}),eeK=new $A([Lm.RichTextNodeType.embed],eeL.name,eeL,{fromPrismic:e=>function(t){var n;return null==(n=e.nodes[eeL.name])?void 0:n.create({content:t.data})},toPrismic:e=>void 0===e.attrs.content?{type:"embed",data:{type:"embed",embed_url:"",__TYPE__:"EmbedContent",all:[]}}:{type:"embed",data:{...e.attrs.content}}}),eeB=Ze.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(e=>({tag:`h${e}`,attrs:{level:e}}))},renderHTML({node:e,HTMLAttributes:t}){return[`h${this.options.levels.includes(e.attrs.level)?e.attrs.level:this.options.levels[0]}`,Gm(this.options.HTMLAttributes,t),0]},addCommands(){return{setHeading:e=>({commands:t})=>!!this.options.levels.includes(e.level)&&t.setNode(this.name,e),toggleHeading:e=>({commands:t})=>!!this.options.levels.includes(e.level)&&t.toggleNode(this.name,"paragraph",e)}},addKeyboardShortcuts(){return this.options.levels.reduce((e,t)=>({...e,[`Mod-Alt-${t}`]:()=>this.editor.commands.toggleHeading({level:t})}),{})},addInputRules(){return this.options.levels.map(e=>G4({find:RegExp(`^(#{1,${e}})\\s$`),type:this.type,getAttributes:{level:e}}))}}),eeP="heading";function eeW(e){switch(e){case 1:return Lm.RichTextNodeType.heading1;case 2:return Lm.RichTextNodeType.heading2;case 3:return Lm.RichTextNodeType.heading3;case 4:return Lm.RichTextNodeType.heading4;case 5:return Lm.RichTextNodeType.heading5;case 6:return Lm.RichTextNodeType.heading6}}function eeD(e){return{fullName:eeW(e),level:e}}let eeN=[1,2,3,4,5,6];function eeq(e,t=eeN){let n=RegExp(`^heading([${t.join(",")}]){1}$`),r=e.match(n);if(!r||!r[1])return;let i=parseInt(r[1]);return{fullName:eeW(i),level:i}}function eeQ(e,t){let n=e.level;if(t.includes(n))return{fullName:eeW(n),level:n}}let eeV=e=>{let t=e[0]??1;return{fromPrismic:n=>function(r){var i;let o=$X.converter.fromPrismic(n)(eeP,r),a=eeq(r.type,e)||eeD(t);return null==(i=n.nodes[eeP])?void 0:i.create({level:a.level,...eey.fromPrismic(r)},o)},toPrismic(n){let{fullName:r}=eeQ(n.attrs,e)||eeD(t);return $X.converter.toPrismic(n,r,eey.toPrismic(n))}}},eez=e=>{let t=e?e.size?Array.from(e.values()).reduce((e,t)=>{let n=eeq(t);return n?[...e,n.level]:e},[]).sort((e,t)=>e-t):[]:eeN;if(t)return new $m(t.map(e=>eeW(e)),eeB.extend({name:"heading"}).configure({levels:t}),t,eeV(t),e=>{let n=eeQ(e,t);return n&&`Heading ${n.level}`})};function eeY(e){let{node:t}=e,n=t.attrs.content,{selected:r}=eeF(e),i={width:void 0,height:void 0,name:qE},{onMediaSelected:o,onCropperDialogClose:a,isUpdating:u,updateContent:s,onClear:l}=function(e){let{content:t,thumbnail:n,imageViewProps:{getPos:r,updateAttributes:i,editor:o,node:a}}=e,[u,s]=(0,x.useTransition)();function l(e){s(()=>i({content:e}))}return{onMediaSelected:function(e){let n=qU(e),i=r()+a.nodeSize;l({...t,...n}),o.chain().focus(i+1).run()},onCropperDialogClose:function({croppedImages:e}){if(!t)return;let r=e[n.name];if(!r)return;let i=QO({content:t,croppedImage:r});i!==t&&l(i)},isUpdating:u,updateContent:l,onClear:function(){let e=r(),t=r()+a.nodeSize;o.chain().deleteRange({from:e,to:t}).focus(t).run()}}}({content:n,thumbnail:i,imageViewProps:e}),[c,d]=(0,x.useState)(!1),f="Feature image",p=(null==n?void 0:n.width)===0&&(null==n?void 0:n.height)===0,A=n&&!p?[`${n.width}\xd7${n.height}px`]:[],h={thumbnail:i,contentView:n,labels:qM(i,n,n)};return q.jsx($e,{className:"custom-image",children:q.jsx("div",{contentEditable:"false",suppressContentEditableWarning:!0,children:q.jsx(Q_,{isMediaDialogOpen:c,selected:r,onMediaSelected:o,onMediaDialogOpenChange:d,children:q.jsx(x.Suspense,{fallback:eeH,children:null!=n&&n.url?q.jsx(Vr,{allContentViews:[n],content:n,contentView:n,fieldLabel:f,id:"id",imageLabel:A,initialImages:[h],isUpdating:u,readOnly:!1,thumbnailName:i.name,onClear:l,onContentChange:s,onCropperDialogClose:a,onMediaDialogOpenChange:d}):q.jsx(Qg,{fieldLabel:f,isUpdating:u,readOnly:!1,onMediaDialogOpenChange:d})})})})})}let eeH=q.jsx("div",{style:{height:144}}),eeG=Ze.create({name:"image",group:"block",atom:!0,addAttributes:()=>({content:{default:void 0}}),addCommands(){return{setImage:()=>e=>{let{dispatch:t,tr:n}=e,r=this.type.create();return t&&n.replaceSelectionWith(r),!0}}},parseHTML:()=>[{tag:"image"}],renderHTML:({HTMLAttributes:e})=>["image",Gm(e)],addNodeView:()=>$r(eeY)}),eeZ=new $h([Lm.RichTextNodeType.image],eeG.name,eeG,{fromPrismic:e=>function(t){var n;return null==(n=e.nodes[eeG.name])?void 0:n.create({content:t.data})},toPrismic(e){if(void 0!==e.attrs.content)return{type:"image",data:{...e.attrs.content}}}}),eeJ=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,ee$=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,eeX=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,ee0=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,ee1=G8.create({name:"italic",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"em"},{tag:"i",getAttrs:e=>"normal"!==e.style.fontStyle&&null},{style:"font-style=italic"}],renderHTML({HTMLAttributes:e}){return["em",Gm(this.options.HTMLAttributes,e),0]},addCommands(){return{setItalic:()=>({commands:e})=>e.setMark(this.name),toggleItalic:()=>({commands:e})=>e.toggleMark(this.name),unsetItalic:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[G9({find:eeJ,type:this.type}),G9({find:eeX,type:this.type})]},addPasteRules(){return[Zn({find:ee$,type:this.type}),Zn({find:ee0,type:this.type})]}});class ee2{constructor(e,t,n){B(this,"extType",$l.Mark),B(this,"richTextNodeTypes",[Lm.RichTextNodeType.em]),this.name=e,this.component=t,this.converter=n}}let ee6=ee1.extend({name:"em"}),ee5=new ee2("em",ee6,{fromPrismic:e=>function(){var t;return null==(t=e.marks[ee6.name])?void 0:t.create()},toPrismic(){}});class ee3{constructor(e,t,n){B(this,"extType",$l.Mark),B(this,"richTextNodeTypes",[]),this.name=e,this.component=t,this.converter=n}}let ee9="label",ee4=G8.create({name:ee9,priority:1e3,keepOnSplit:!1,inclusive:!1,addOptions:()=>({htmlAttributes:{style:"background-color: hsl(251, 89%, 96%); border: 1px dashed rgba(68, 53, 146, 0.4); border-radius: 0px 2px 2px 2px"}}),addAttributes:()=>({label:{default:""}}),addCommands(){return{setLabel:e=>({chain:t})=>t().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMark(this.name,e).run(),unsetLabel:()=>({chain:e})=>e().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},renderHTML({HTMLAttributes:e}){return["span",Gm(this.options.htmlAttributes,e),0]}}),ee7=new ee3(ee9,ee4,{fromPrismic:e=>function(t){var n;let r=t.data,i={type:ee4.name,label:r};return null==(n=e.marks[ee4.name])?void 0:n.create(i)},toPrismic:e=>e.attrs.label});class ee8{constructor(e,t,n){B(this,"extType",$l.Mark),B(this,"richTextNodeTypes",[Lm.RichTextNodeType.hyperlink]),this.name=e,this.component=t,this.converter=n}}let ete="hyperlink",ett=G8.create({name:ete,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:e}){return["a",Gm(this.options.htmlAttributes,e),0]},addCommands(){return{setWebLink:e=>({chain:t})=>t().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMark(this.name,e).setMeta("preventAutolink",!0).run(),setDocumentLink:e=>({chain:t})=>t().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMark(this.name,e).setMeta("preventAutolink",!0).run(),setMediaLink:e=>({chain:t})=>{let n=etr(Q4({media:e.media}).value);return t().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMark(this.name,{media:n}).setMeta("preventAutolink",!0).run()},unsetLink:()=>({chain:e})=>e().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}}}),etn=new ee8(ete,ett,{fromPrismic:e=>function(t){var n,r,i,o;let a=t.data;if("DocumentLink"===a.__TYPE__){let t={type:ett.name,id:a.id};return null==(n=e.marks[ett.name])?void 0:n.create(t)}if("ImageLink"===a.__TYPE__){let t={type:ett.name,media:etr(a)};return null==(r=e.marks[ett.name])?void 0:r.create(t)}if("FileLink"===a.__TYPE__){let t={type:ett.name,media:etr(a)};return null==(i=e.marks[ett.name])?void 0:i.create(t)}if("ExternalLink"===a.__TYPE__){let t={type:ett.name,url:a.url,href:a.url,target:a.target};return null==(o=e.marks[ett.name])?void 0:o.create(t)}},toPrismic:e=>e.attrs.media?eti(e.attrs.media):e.attrs.id?{__TYPE__:"DocumentLink",id:e.attrs.id}:{__TYPE__:"ExternalLink",url:e.attrs.href,target:e.attrs.target}});function etr(e){return JSON.stringify(e)}function eti(e){return JSON.parse(e)}let eto=Ze.create({name:"listItem",addOptions:()=>({HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}),content:"paragraph block*",defining:!0,parseHTML:()=>[{tag:"li"}],renderHTML({HTMLAttributes:e}){return["li",Gm(this.options.HTMLAttributes,e),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)}}}),eta=G8.create({name:"textStyle",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"span",getAttrs:e=>!!e.hasAttribute("style")&&{}}],renderHTML({HTMLAttributes:e}){return["span",Gm(this.options.HTMLAttributes,e),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:e,commands:t})=>!!Object.entries(GJ(e,this.type)).some(([,e])=>!!e)||t.unsetMark(this.name)}}}),etu=/^(\d+)\.\s$/,ets=Ze.create({name:"orderedList",addOptions:()=>({itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}),group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes:()=>({start:{default:1,parseHTML:e=>e.hasAttribute("start")?parseInt(e.getAttribute("start")||"",10):1}}),parseHTML:()=>[{tag:"ol"}],renderHTML({HTMLAttributes:e}){let{start:t,...n}=e;return 1===t?["ol",Gm(this.options.HTMLAttributes,n),0]:["ol",Gm(this.options.HTMLAttributes,e),0]},addCommands(){return{toggleOrderedList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(eto.name,this.editor.getAttributes(eta.name)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let e=G7({find:etu,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(e=G7({find:etu,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(eta.name)}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1],editor:this.editor})),[e]}}).extend({name:"orderedList",addAttributes:()=>({start:{default:1,parseHTML:e=>e.hasAttribute("start")?parseInt(e.getAttribute("start")||"",10):1}}),renderHTML({HTMLAttributes:e}){let{start:t,...n}=e;return 1===t?["ol",Gm(this.options.HTMLAttributes,n),0]:["ol",Gm(this.options.HTMLAttributes,e),0]},addCommands(){return{toggleOrderedList:()=>({commands:e})=>e.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}}}).configure({itemTypeName:"listItem"}),etl=new $g([Lm.RichTextNodeType.orderedList],ets.name,ets,{fromPrismic:e=>function(t){var n;let r=$M.converter.fromPrismic(e)(t);if(r)return null==(n=e.nodes[ets.name])?void 0:n.create(eey.fromPrismic(t),r)},toPrismic:e=>$x.children.map(e,e=>$M.converter.toPrismic(e,Lm.RichTextNodeType.orderedList).filter(_.$)).flat()}),etc=[$I,ee5,etn,ee7];function etd(e){return[eeb,eeR,etl,eez(e),eej,eeK,eeZ,...etc].filter(_.$)}let etf=[{nodeType:Lm.RichTextNodeType.paragraph,icon:"textFields",isActive:e=>e.isActive(eeb.name)&&!e.isActive(eeR.name)&&!e.isActive(etl.name),runCommands:eth((e,t)=>e.clearNodes().setDirection(etm(t))),shortText:"par",text:"Paragraph"},{nodeType:Lm.RichTextNodeType.heading1,icon:"looks1",isActive:e=>e.isActive(eeP,{level:1}),runCommands:eth((e,t)=>e.setHeading({level:1}).setDirection(etm(t))),shortText:"h1",text:"Heading 1"},{nodeType:Lm.RichTextNodeType.heading2,icon:"looks2",isActive:e=>e.isActive(eeP,{level:2}),runCommands:eth((e,t)=>e.setHeading({level:2}).setDirection(etm(t))),shortText:"h2",text:"Heading 2"},{nodeType:Lm.RichTextNodeType.heading3,icon:"looks3",isActive:e=>e.isActive(eeP,{level:3}),runCommands:eth((e,t)=>e.setHeading({level:3}).setDirection(etm(t))),shortText:"h3",text:"Heading 3"},{nodeType:Lm.RichTextNodeType.heading4,icon:"looks4",isActive:e=>e.isActive(eeP,{level:4}),runCommands:eth((e,t)=>e.setHeading({level:4}).setDirection(etm(t))),shortText:"h4",text:"Heading 4"},{nodeType:Lm.RichTextNodeType.heading5,icon:"looks5",isActive:e=>e.isActive(eeP,{level:5}),runCommands:eth((e,t)=>e.setHeading({level:5}).setDirection(etm(t))),shortText:"h5",text:"Heading 5"},{nodeType:Lm.RichTextNodeType.heading6,icon:"looks6",isActive:e=>e.isActive(eeP,{level:6}),runCommands:eth((e,t)=>e.setHeading({level:6}).setDirection(etm(t))),shortText:"h6",text:"Heading 6"},{nodeType:Lm.RichTextNodeType.list,icon:"formatListBulleted",isActive:e=>e.isActive(eeR.name),runCommands:eth((e,t)=>e.toggleBulletList().setDirection(etm(t))),shortText:"bull",text:"Bulleted list"},{nodeType:Lm.RichTextNodeType.orderedList,icon:"formatListNumbered",isActive:e=>e.isActive(etl.name),runCommands:eth((e,t)=>e.toggleOrderedList().setDirection(etm(t))),shortText:"num",text:"Numbered list"},{nodeType:Lm.RichTextNodeType.preformatted,icon:"dataObject",isActive:e=>e.isActive(eej.name),runCommands:eth((e,t)=>e.setCodeBlock().setDirection(etm(t))),shortText:"code",text:"Code"},{nodeType:Lm.RichTextNodeType.embed,icon:"cloud",isActive:e=>e.isActive(eeK.name),runCommands:eth(e=>e.setEmbed()),shortText:"emb",text:"Embed"},{nodeType:Lm.RichTextNodeType.image,icon:"image",isActive:e=>e.isActive(eeZ.name),runCommands:eth(e=>e.setImage()),shortText:"img",text:"Image"}],etp=[{nodeType:Lm.RichTextNodeType.strong,icon:"formatBold",isActive:e=>e.isActive($I.name),runCommands:eth(e=>e.toggleBold())},{nodeType:Lm.RichTextNodeType.em,icon:"formatItalic",isActive:e=>e.isActive(ee5.name),runCommands:eth(e=>e.toggleItalic())}],etA=[{nodeType:Lm.RichTextNodeType.rtl,icon:"formatTextDirectionRToL",isActive:e=>e.isActive({dir:"rtl"}),runCommands:eth((e,t)=>e.toggleDirection(etm(t)))}];function eth(e){return(t,n={})=>{let r=!0===n.can?t.can().chain():t.chain().focus();return void 0!==n.deleteRange&&(r=r.deleteRange(n.deleteRange)),n.can?function(e,t,n){try{return n(t,e).run()}catch{return!1}}(t,r,e):e(r,t).run()}}function etm(e){let t=e.state.selection.$from.parent.attrs;return eey.parseNodeAttrsDirection(t)}function etg(e,t){return e.filter(e=>t.includes(e.nodeType))}function ety(e){let{items:t,editor:n}=e;return 0===t.length?null:q.jsxs(q.Fragment,{children:[q.jsx(b.Jf,{}),t.map(e=>q.jsx(b.r8,{disabled:!e.runCommands(n,{can:!0}),onPressedChange:()=>{e.runCommands(n)},pressed:e.isActive(n),startIcon:e.icon},e.nodeType))]})}function etv(e){let{labels:t,editor:n}=e,r=n.getAttributes("label").label;return q.jsxs(q.Fragment,{children:[q.jsx(b.Jf,{}),q.jsxs(b.h_,{children:[q.jsx(b.$F,{disabled:0===t.length,children:q.jsx(b.zx,{endIcon:"arrowDropDown",size:"small",color:"grey",children:etx(r??"Labels")})}),q.jsx(b.AW,{align:"start",asPortal:!1,maxHeight:256,avoidCollisions:!1,children:t.map((e,t)=>{let i=r===e;return q.jsx(b.Xi,{onSelect:()=>i?n.commands.unsetLabel():function(e,t){eth(e=>e.setLabel({label:t}))(e)}(n,e),endIcon:i&&q.jsx(b.I5,{name:"check",size:"extraSmall"}),children:etx(e)},`${e}-${t}`)})})]})]})}function etx(e){return(0,T.tx)(e,20)}function etb(e){let{editor:t}=e,n=t.getAttributes("label");if(!n.label)return null;let r=n.label;return q.jsx(b.xu,{backgroundColor:"purple9",padding:{block:2,inline:4},alignItems:"center",borderRadius:{topLeft:2,topRight:2,bottomRight:2},maxWidth:125,children:q.jsx(b.xv,{color:"white",variant:"small",noWrap:!0,children:r})})}function etC(e){let{disabled:t,showWebLinkModal:n,showDocumentsLinkModal:r,showMediaLinkModal:i}=function(e){let{editor:t,setModal:n}=e;return{disabled:!eth(e=>e.setWebLink({href:""}))(t,{can:!0}),showWebLinkModal:function(){n("webLink")},showDocumentsLinkModal:function(){n("documentLink")},showMediaLinkModal:function(){n("mediaLink")}}}(e);return q.jsxs(q.Fragment,{children:[q.jsx(b.Jf,{}),q.jsxs(b.yM,{density:"compact",children:[q.jsx(b.hA,{disabled:t,startIcon:"link",onClick:n},Lm.RichTextNodeType.hyperlink),q.jsxs(b.h_,{children:[q.jsx(b.$F,{children:q.jsx(b.hA,{startIcon:"arrowDropDown"})}),q.jsxs(b.AW,{align:"end",asPortal:!1,children:[q.jsx(b.Xi,{startIcon:q.jsx(b.I5,{name:"public"}),onSelect:n,children:"Link to web page"}),q.jsx(b.Xi,{startIcon:q.jsx(b.I5,{name:"description"}),onSelect:r,children:"Link to document"}),q.jsx(b.Xi,{startIcon:q.jsx(b.I5,{name:"image"}),onSelect:i,children:"Link to media"})]})]})]})]})}function etS(e){let{docId:t,onEdit:n,onUnlink:r}=e,i=function(e){let t=WS();t.searchDocuments||WI("searchDocuments");let{coreApiBaseUrl:n,authStrategy:r}=t;return(0,O.QT)(Nh,[n,r,e])}(t),o=WS();if(!i)return null;let a=i.versions[0],u=Wp({status:null==a?void 0:a.status,releaseId:(null==a?void 0:a.status)==="release"?a.release_id:void 0,documentId:i.id,versionId:null==a?void 0:a.version_id,baseUrl:o.baseUrl}),s=(null==a?void 0:a.preview_summary)??"",l=(null==a?void 0:a.custom_type_label)??"";return q.jsx(b.oZ,{url:u,title:i.title,subTitle:l,description:s,onEdit:n,onUnlink:r,largeIconName:"description"})}function etw(e){let{editor:t}=e,{searchDocuments:n}=WS(),r=t.getAttributes(Lm.RichTextNodeType.hyperlink);if(r.id&&n){let t=r.id;return q.jsx(etI,{docId:t,...e})}if(r.href){let t=r.href;return q.jsx(et_,{url:t,...e})}if(r.media){let t=eti(r.media);return q.jsx(etT,{media:t,...e})}return null}function etI(e){let{editor:t,onEditDocumentLink:n,docId:r}=e;return q.jsx(b.SV,{renderError:()=>q.jsx(b.oZ,{url:"",title:"Failed to Load Linked Document Data",subTitle:"",error:!0,onEdit:n,onUnlink:()=>etO(t)}),children:q.jsx(x.Suspense,{fallback:q.jsx(b.oZ,{url:"",title:"",subTitle:"",loading:!0,onEdit:n,onUnlink:()=>etO(t)}),children:q.jsx(etS,{docId:r,onEdit:n,onUnlink:()=>etO(t)})})})}function et_(e){let{url:t,editor:n,onEditWebLink:r}=e,i=(0,C.ju)(t);return i?q.jsx(b.oZ,{url:t,title:(0,C.S$)(i),subTitle:t,onEdit:r,onUnlink:()=>etO(n)}):q.jsx(b.oZ,{url:t,title:"",subTitle:t,onEdit:r,onUnlink:()=>etO(n)})}function etT(e){let{media:t,editor:n,onEditMediaLink:r}=e;return"ImageLink"===t.__TYPE__?q.jsx(b.Qi,{url:t.url,title:t.name,subTitle:`${t.width} x ${t.height} pixels`,onEdit:r,onUnlink:()=>etO(n)}):"FileLink"===t.__TYPE__?q.jsx(b.oZ,{url:t.url,title:t.name,subTitle:function(e){let{filename:t}=e,n=t.split(".").pop();return n?n.toLowerCase():""}({filename:t.name}),onEdit:r,onUnlink:()=>etO(n),largeIconName:"insertDriveFile"}):null}function etO(e){eth(e=>e.unsetLink())(e)}function etR(e){let{open:t}=e,{onOpenChange:n,onSelectDocument:r}=function(e){let{editor:t,setOpen:n}=e;return{onSelectDocument:function(e){eth(t=>t.extendMarkRange(Lm.RichTextNodeType.hyperlink).setDocumentLink({id:e}))(t),n(!1)},onOpenChange:function(e){n(e)}}}(e);return q.jsx(QZ,{open:t,onOpenChange:n,onSelectDocument:r})}function etk(e){let{open:t}=e,{onOpenChange:n,onMediaSelected:r}=function(e){let{editor:t,setOpen:n}=e;return{onMediaSelected:function(e){eth(t=>t.extendMarkRange(Lm.RichTextNodeType.hyperlink).setMediaLink({media:e}))(t),n(!1)},onOpenChange:n}}(e);return q.jsx(QI,{open:t,onOpenChange:n,onMediaSelected:r,assetType:"all"})}function etE(e){let{open:t,setOpen:n}=e,{url:r,setUrl:i,openInNewTab:o,setOpenInNewTab:a,disabled:u,onUpdate:s}=function(e){let{editor:t,open:n,setOpen:r}=e,i=function(e){let t=e.getAttributes(Lm.RichTextNodeType.hyperlink);return{url:t.href??"",openInNewTab:"_blank"===t.target}}(t),[o,a]=(0,x.useState)(i.url),[u,s]=(0,x.useState)(i.openInNewTab);(0,w.pQ)(n,()=>{n&&(a(i.url),s(i.openInNewTab))});let l=!o||o===i.url&&u===i.openInNewTab;return{url:o,setUrl:a,openInNewTab:u,disabled:l,setOpenInNewTab:s,onUpdate:function(){let e=u?"_blank":"_self";eth(t=>t.extendMarkRange(Lm.RichTextNodeType.hyperlink).setWebLink({href:o,target:e}))(t),r(!1)}}}(e);return q.jsxs(b.Vq,{open:t,onOpenChange:n,size:"small",children:[q.jsx(b.fK,{title:"Set Link URL"}),q.jsxs(b.cZ,{padding:16,children:[q.jsx(b.yt,{value:r,onValueChange:i,placeholder:"Paste URL",icon:"public"}),r&&q.jsx(b.W4,{value:"Open in new tab",children:q.jsx(b.XZ,{checked:o,onCheckedChange:a})})]}),q.jsxs(b.kX,{children:[q.jsx(b.PO,{}),q.jsx(b._d,{onClick:s,disabled:u,children:"Update"})]})]})}function etM(e){let{items:t,editor:n}=e;return 0===t.length?null:q.jsxs(q.Fragment,{children:[q.jsx(b.Jf,{}),q.jsx(b.dV,{onValueChange:e=>{t.forEach(t=>{(t.isActive(n)&&!e.includes(t.nodeType)||!t.isActive(n)&&e.includes(t.nodeType))&&t.runCommands(n)})},type:"multiple",value:t.filter(e=>e.isActive(n)).map(e=>e.nodeType),children:t.map(e=>q.jsx(b.nG,{disabled:!e.runCommands(n,{can:!0}),startIcon:e.icon,value:e.nodeType},e.nodeType))},"mark")]})}function etj(e){var t;let{items:n,editor:r}=e;return 0===n.length?null:q.jsxs(b.h_,{children:[q.jsx(b.$F,{disabled:1===n.length,children:q.jsx(b.zx,{endIcon:"arrowDropDown",size:"small",color:"grey",children:(null==(t=n.find(e=>e.isActive(r)))?void 0:t.text)??""})}),q.jsx(b.AW,{align:"start",asPortal:!1,maxHeight:256,avoidCollisions:!1,children:n.map(e=>q.jsx(b.Xi,{onSelect:()=>{e.runCommands(r)},children:e.text},e.nodeType))})]})}function etF(e){return{duration:100,hideOnClick:!0,offset:e,placement:"top-start",appendTo:document.querySelector("body > div")??"parent"}}function etU(e){let{editor:t,nodeTypes:n,labels:r}=e,[i,o]=(0,x.useState)(),a=n.includes(Lm.RichTextNodeType.hyperlink),u=!i,{shouldShowBubbleMenu:s,shouldshowPopover:l}=function(e){let{editor:t}=e;return{shouldShowBubbleMenu:function(e){let{view:n,state:r,from:i,to:o}=e;if(!n.hasFocus())return!1;let{doc:a,selection:u}=r;return!(t.isActive(Lm.RichTextNodeType.preformatted)||u.empty||0===a.textBetween(i,o).length)},shouldshowPopover:function(e,t){let{view:n,state:r,from:i,to:o}=e,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(e=>e.type.name===t))}}}({editor:t}),[c,d]=(0,x.useState)(!0);return(0,x.useEffect)(()=>{d(!1)},[]),c?null:q.jsxs(q.Fragment,{children:[q.jsx(J4,{editor:t,tippyOptions:etF([-48,0]),shouldShow:s,children:u&&q.jsx(etL,{editor:t,nodeTypes:n,labels:r,setModal:o})}),q.jsx(J4,{editor:t,tippyOptions:etF([-48,0]),shouldShow:e=>l(e,"hyperlink"),children:u&&q.jsx(etw,{editor:t,onEditWebLink:()=>o("webLink"),onEditDocumentLink:()=>o("documentLink"),onEditMediaLink:()=>o("mediaLink")})}),q.jsx(J4,{editor:t,tippyOptions:etF([0,0]),shouldShow:e=>l(e,"label"),children:q.jsx(etb,{editor:t})}),a&&q.jsxs(q.Fragment,{children:[q.jsx(etE,{open:"webLink"===i,setOpen:function(e){o(e?"webLink":void 0)},editor:t}),q.jsx(etR,{open:"documentLink"===i,setOpen:function(e){o(e?"documentLink":void 0)},editor:t}),q.jsx(etk,{open:"mediaLink"===i,setOpen:function(e){o(e?"mediaLink":void 0)},editor:t})]})]})}function etL(e){let{editor:t,nodeTypes:n,labels:r,setModal:i}=e,o=n.includes("hyperlink"),a=r.length>0,u=etg(etf,n),s=etg(etp,n),l=etg(etA,n),c=u.length+s.length+l.length+Number(o);return 0===c?null:q.jsxs(b.o8,{children:[q.jsx(etj,{items:u,editor:t}),a&&q.jsx(etv,{labels:r,editor:t}),q.jsx(etM,{items:s,editor:t}),o&&q.jsx(etC,{editor:t,setModal:i}),q.jsx(ety,{items:l,editor:t}),c>1&&q.jsxs(q.Fragment,{children:[q.jsx(b.Jf,{}),q.jsx(b.hA,{onClick:()=>{t.chain().focus().clearNodes().unsetAllMarks().run()},startIcon:"formatClear"},"clear")]})]})}function etK(e){let{content:t,field:n,id:r,readOnly:i}=e,o=function(e){var t,n;let r=`${(null==(t=e.config)?void 0:t.multi)??""}-${(null==(n=e.config)?void 0:n.single)??""}`;return(0,x.useMemo)(()=>{var t;let{extensions:n,nodeTypes:r}=function(e){if(!e||!(null!=e&&e.single)&&!(null!=e&&e.multi))return $b();let t=new Set((e.single||e.multi||"").split(/\s*,\s*/).map(e=>{let t=Lm.RichTextNodeTypeCodec.decode(e);return"Right"===t._tag?t.right:void 0}).filter(_.$));if(!t.size)return $b();let n=function(e,t){var n;let r=new Set(e);return(0,j.G)(r,$y)&&r.add(eeb),(0,j.G)(r,$p)||r.add(eeb),null!=(n=null==t?void 0:t.labels)&&n.length&&r.add(ee7),[...r]}(etd(t).filter(e=>(0,j.G)(t,t=>e.richTextNodeTypes.includes(t))),e);return{nodeTypes:t,extensions:n}}(e.config),i=n.filter(etB),o=n.flatMap(e=>e.richTextNodeTypes),a=n.map(e=>e.component),u=n.filter(etP).map(e=>e.name),s=[...a,...function(e,t){var n,r;let i=t.map(e=>e.richTextNodeTypes).flat(),o={placeholderByNodeType:t.reduce((e,t)=>(t.nodeType===$c.Text&&(e[t.name]=t.placeholder),e),{}),unfocusedPlaceholder:null==(n=e.config)?void 0:n.placeholder,nodeExtensions:t},a=i.includes(Lm.RichTextNodeType.orderedList)||i.includes(Lm.RichTextNodeType.list);return[$1.component((null==(r=e.config)?void 0:r.single)===void 0),$X.component,$G.component,$6(o),a?$M.component:void 0,eeI.configure({nodeTypes:i})].filter(_.$)}(e,i),eeg.configure({supportedExtensionNames:u}),Zx],l=s.map(e=>e.name),c=Gb(GM.resolve(s),void 0);return{allComponents:s,extensionNames:l,nodeTypes:r,nodeExtensions:i,names:o,schema:c,labels:Array.from((null==(t=e.config)?void 0:t.labels)??[])}},[r])}(n),a=t&&$1.converter(o.nodeExtensions).fromPrismic(o.schema,o.nodeTypes,t),u=(0,w.R9)(e.onContentChange),s=(0,b.jE)({content:null==a?void 0:a.toJSON(),editable:!i,editorProps:{attributes:{class:`${b.rk} ${b.bN}`,id:r,tabIndex:"0"}},extensions:o.allComponents,injectCSS:!1,onUpdate({editor:e}){if(e.isEmpty)return u(void 0);u($1.converter(o.nodeExtensions).toPrismic(e.state.doc))}},[o,i]);return q.jsxs(b.gN,{children:[q.jsx(b.Qy,{htmlFor:r,children:q9(n)}),q.jsxs(b.JO,{children:[s.isEditable&&q.jsx(etU,{editor:s,nodeTypes:o.names.concat(eem),labels:o.labels}),q.jsx(J5,{editor:s,style:{flexGrow:1}})]})]})}function etB(e){return e.extType===$l.Node}function etP(e){return!(e.extType!==$l.Node||e.nodeType!==$c.Text||e.lockedFormat)}function etW(e){var t,n,r,i;let{content:o,field:a,id:u,readOnly:s,onContentChange:l}=e,{placeholder:c,options:d}=a.config??{},f=!!(null!=d&&d.includes("")),p=(null==(r=a.config)?void 0:r.default_value)===void 0||null==(i=a.config.options)?void 0:i[0],A=function(e){let{content:t,placeholder:n,defaultValue:r,canHaveEmptyValue:i}=e,{value:o}=t??{};return""===o&&i?etD:(""===o&&(o=void 0),o??r??n)}({content:o,placeholder:c,defaultValue:p,canHaveEmptyValue:f}),h=c&&void 0===p;return q.jsxs(b.gN,{children:[q.jsx(b.fw,{name:"arrowDropDownCircle"}),q.jsx(b.Qy,{htmlFor:u,children:q9(a)}),q.jsx(b.JO,{children:q.jsxs(b.Ph,{id:u,size:"large",color:"grey",value:A,disabled:s,renderTrigger:()=>q.jsx(b.JF,{id:u}),onValueChange:e=>{l(function(e){let{placeholder:t}=e,{value:n}=e;if(n!==t)return n===etD&&(n=""),{__TYPE__:"FieldContent",type:"Select",value:n}}({value:e,placeholder:c}))},children:[h&&q.jsx(b.Ql,{value:c,children:c}),null==(n=null==(t=a.config)?void 0:t.options)?void 0:n.map(e=>q.jsx(b.Ql,{value:e||etD,children:e},e))]})})]})}let etD=" ";function etN(e){let{id:t,readOnly:n,field:r,content:i,onContentChange:o}=e,a=null!=i&&i.value?(0,I._O)(i.value):void 0;return q.jsxs(b.gN,{children:[q.jsx(b.fw,{name:"event"}),q.jsx(b.Qy,{id:t,children:q9(r)}),q.jsx(b.JO,{children:q.jsx(b.xu,{padding:{left:4,right:12},width:"100%",flexDirection:"column",justifyContent:"center",children:q.jsx(b.Wr,{mode:"date-time","aria-labelledby":t,disabled:n,value:a,onValueChange:e=>o(function(e){if(e)return{__TYPE__:"FieldContent",type:"Timestamp",value:function(e){let t=`${e.getUTCFullYear()}`.padStart(4,"0"),n=`${e.getUTCMonth()+1}`.padStart(2,"0"),r=`${e.getUTCDate()}`.padStart(2,"0"),i=`${e.getUTCHours()}`.padStart(2,"0"),o=`${e.getUTCMinutes()}`.padStart(2,"0");return`${t}-${n}-${r}T${i}:${o}:00+00:00`}(e)}}(e))})})})]})}function etq(e){let{id:t,readOnly:n,content:r,nestableWidget:i}=e,o=(0,w.R9)(e.onContentChange);return(0,x.useMemo)(()=>{let e={id:t,readOnly:n,onContentChange:o};return"Boolean"===i.type?q.jsx(q7,{...e,field:i,content:Q.isBooleanContent(r)?r:void 0}):"Date"===i.type?q.jsx(Qe,{...e,field:i,content:Q.isDateContent(r)?r:void 0}):"Timestamp"===i.type?q.jsx(etN,{...e,field:i,content:Q.isTimestampContent(r)?r:void 0}):"Image"===i.type?q.jsx(Vi,{...e,field:i,content:Q.isImageContent(r)?r:void 0}):"Link"===i.type?q.jsx(Q7,{...e,field:i,content:Q.isLinkContent(r)?r:void 0}):"Number"===i.type?q.jsx(Vw,{...e,field:i,content:Q.isNumberContent(r)?r:void 0}):"StructuredText"===i.type?q.jsx(etK,{...e,field:i,content:Q.isRichTextContent(r)?r:void 0}):"Select"===i.type?q.jsx(etW,{...e,field:i,content:Q.isSelectContent(r)?r:void 0}):"Text"===i.type?q.jsx(VS,{...e,field:i,content:Q.isTextContent(r)?r:void 0}):"Embed"===i.type?q.jsx(Qc,{...e,field:i,content:Q.isEmbedContent(r)?r:void 0}):"Color"===i.type?q.jsx(q8,{...e,field:i,content:Q.isColorContent(r)?r:void 0}):"GeoPoint"===i.type?q.jsx(Qh,{...e,field:i,content:Q.isGeoPointContent(r)?r:void 0}):"IntegrationFields"===i.type?q.jsx(VC,{...e,field:i,content:Q.isIntegrationFieldContent(r)?r:void 0}):null},[r,t,i,o,n])}function etQ(e){var t,n;let{group:r,content:i,onContentChange:o,...a}=e;return q.jsx(etY,{...a,title:etV(r),addItemButtonTitle:`Add item in "${etV(r)}"`,repeatable:(null==(t=r.config)?void 0:t.repeat)!==!1,repeatableZone:(null==(n=r.config)?void 0:n.fields)??{},content:null==i?void 0:i.value,onContentChange:e=>{o({__TYPE__:"GroupContentType",value:e})}})}function etV(e){var t;return(null==(t=e.config)?void 0:t.label)??e.fieldset??e.type}function etz(e){let{id:t,readOnly:n,content:r,widget:i}=e,o=(0,w.R9)(e.onContentChange);return(0,x.useMemo)(()=>{let e={id:t,readOnly:n,onContentChange:o};return"Group"===i.type?q.jsx(etQ,{...e,group:i,content:Q.isGroupContent(r)?r:void 0}):q.jsx(etq,{...e,nestableWidget:i,content:Q.isNestableContent(r)?r:void 0})},[r,t,i,o,n])}function etY(e){let{id:t,title:n,addItemButtonTitle:r,content:i,onContentChange:o,readOnly:a,repeatable:u=!0,repeatableZone:s}=e,l=Object.entries(s),c=i??[etH];!u&&c.length>1&&(c=c.slice(0,1));let{scrollOffsetTop:d}=WS(),f=(0,x.useRef)(new WeakMap);function p(e){return f.current.get(e)??"!bugged!"}function A(e){let{index:t,offset:n}=e;o((0,R.pB)(c,t,t+n))}function h(e){let{index:t}=e;o((0,R.$E)(c,t))}return!function(e,t){t.forEach(t=>{e.has(t)||e.set(t,(0,U.d)())})}(f.current,c),0===Object.keys(s).length?null:q.jsx(b.ZA,{title:n??"Repeatable zone",addItemButtonTitle:r??"Add item in repeatable zone",items:c,maxItems:u?void 0:1,getItemKey:p,onAddItem:function(){o(c.concat(etG()))},dnd:{scrollOffsetTop:d,onReorder:function(e){o(e)},renderDragPreview:({index:e})=>q.jsx(etZ,{title:n??"Repeatable zone",index:e}),renderDropIndicator:etJ},children:(e,n)=>{let r=new Map(e.value),i=p(e);return q.jsx(b.En,{keepLoaded:!0,loadWhenSearching:!0,children:q.jsx(b.MN,{index:n,title:`${n+1} • Item`,onMove:A,onDelete:h,children:l.map(([u,s])=>q.jsx(etz,{id:`${t}[${i}].${u}`,content:r.get(u),widget:s,onContentChange:t=>(function(e,t,n,r){let i=function(e,t){let[n,r]=t;return r?etG(Array.from(new Map(e.value).set(n,r))):etG(e.value.filter(([e])=>e!==n))}(e,[n,r]),a=function(e,t){let[n,r]=t;return r?e.map((e,t)=>t===n?r:e):e.filter((e,t)=>t!==n)}(c,[t,i]);(function(e,t,n){let r=e.get(t);void 0!==r&&e.set(n,r)})(f.current,e,i),o(a)})(e,n,u,t),readOnly:a},u))})})}})}let etH={__TYPE__:"GroupItemContent",value:[]};function etG(e=[]){return{__TYPE__:"GroupItemContent",value:e}}function etZ(e){let{title:t,index:n}=e;return q.jsxs(b.xu,{padding:{block:8,inline:12},backgroundColor:"grey3",border:!0,borderRadius:6,alignItems:"center",justifyContent:"space-between",width:"100%",children:[q.jsxs("div",{children:[q.jsx(b.xv,{variant:"smallBold",color:"grey11",children:t??"Repeatable zone"}),q.jsxs(b.xv,{variant:"small",color:"grey11",children:[n+1," • Item"]})]}),q.jsx(b.I5,{name:"dragIndicator",size:"small",color:"grey8"})]})}function etJ(e){let{isDropTarget:t,itemIndex:n,position:r}=e,i=t?q.jsx(b.x1,{color:"purple",thickness:2,sx:{position:"absolute",left:0,right:0,bottom:0===n&&"before"===r?0:void 0}},"line"):void 0;return q.jsx(b.Fp,{enterDuration:150,children:i})}function et$(e){let{content:t,id:n,slicePrimaryZone:r,onContentChange:i,readOnly:o}=e,a=(0,x.useMemo)(()=>Object.entries(r),[r]);return q.jsx(q.Fragment,{children:a.map(([e,r])=>{let a=t[e];return q.jsx(etz,{id:`${n}.${e}`,readOnly:o,widget:r,content:Q.isSlicePrimaryContent(a)?a:void 0,onContentChange:n=>{i(n?{...t,[e]:n}:(0,S.ud)(t,e))}},e)})})}function etX(e){var t;let{config:n,content:r,sliceKey:i,readOnly:o=!1,sharedSlice:a,onContentChange:u,...s}=e,l=(t=r.variation,(0,x.useMemo)(()=>a.variations.find(e=>e.id===t),[a,t])),c=(0,x.useId)(),d={id:s.id??c,readOnly:o},{selected:f,selectionId:p,selection:A}=function(e){let{sliceKey:t}=e||{},n=(0,x.useContext)(q3);return{selectionId:function(e,t){if(t)return`${e}___${t}`}("sliceFieldSet",t),selected:t===(null==n?void 0:n.id),selection:n}}({sliceKey:i});return void 0===l?null:q.jsx(WC.Provider,{value:n,children:q.jsxs(b.C3,{id:p,selected:f,onFocus:function(){i&&A.update("sliceFieldSet",i)},legend:[a.name,l.name].join(" • "),children:[q.jsx(b.En,{heightEstimate:400,gap:16,keepLoaded:!0,loadWhenSearching:!0,children:q.jsx(et$,{...d,slicePrimaryZone:l.primary??{},content:r.primary,onContentChange:e=>{u({...r,primary:e})}})}),q.jsx(etY,{...d,repeatableZone:l.items??{},content:r.items,onContentChange:e=>{u({...r,items:e})}})]})})}}}]);
|