@prismicio/editor-fields 0.4.49-alpha.feat-onboarding-guide.15 → 0.4.49-alpha.feat-onboarding-guide.16

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/dist/index.cjs.js CHANGED
@@ -29,42 +29,42 @@ Check the top-level render call using <`+te+">.")}return V}}function Yc(R,V){{if
29
29
  `,e)}function x0e(e){return e.value+r4(e.forest)}function i4(e,t){var n=t(e),r=n[0],i=n[1];return{value:r,forest:o4(i,t)}}function o4(e,t){return e.map(function(n){return i4(n,t)})}function a4(e){var t=s4(e);return function(n,r){return e.chain(r(n),function(i){var o=i[0],a=i[1];return e.map(t(a,r),function(s){return{value:o,forest:s}})})}}function s4(e){var t=yv(e);return function(n,r){return b(n,t(function(i){return a4(e)(i,r)}))}}function w0e(e){var t=function(n){return e(n.value,n.forest.map(t))};return t}var Ns=function(e,t){return b(e,m0(t))},cd=function(e,t){return b(e,ch(function(n){return b(t,m0(n))}))},s$=function(e,t){return b(e,ch(t))},u$=function(e,t,n){return b(e,g0(t,n))},c$=function(e){var t=l4(e);return function(n,r){return b(n,t(r))}},l$=function(e,t,n){return b(e,f$(t,n))},u4=function(e,t){return b(e,h0(t))},c4=function(e){var t=p$(e);return function(n,r){return b(n,t(r))}},E0e=function(e){return function(t){return cd(t,e)}},ch=function(e){return function(t){var n=e(t.value),r=n.value,i=n.forest,o=aI().concat;return{value:r,forest:o(i,t.forest.map(ch(e)))}}},h0=function(e){return function(t){return{value:e(t),forest:t.forest.map(h0(e))}}},$0e=h0(N),R0e=ch(N),m0=function(e){return function(t){return{value:e(t.value),forest:t.forest.map(m0(e))}}},g0=function(e,t){return function(n){for(var r=t(e,n.value),i=n.forest.length,o=0;o<i;o++)r=b(n.forest[o],g0(r,t));return r}},l4=function(e){return function(t){return g0(e.empty,function(n,r){return e.concat(n,t(r))})}},f$=function(e,t){return function(n){for(var r=e,i=n.forest.length,o=i-1;o>=0;o--)r=b(n.forest[o],f$(r,t));return t(n.value,r)}},d$=function(e){return e.value},p$=function(e){var t=yv(e),n=function(r){return function(i){return e.ap(e.map(r(i.value),function(o){return function(a){return{value:o,forest:a}}}),b(i.forest,t(n(r))))}};return n},A$=function(e){return p$(e)(N)},ld=function(e){return t4(e)},Ji="Tree",h$={URI:Ji,map:Ns},O0e=Qe(h$),F0e={URI:Ji,of:ld},v0={URI:Ji,map:Ns,ap:cd},k0e=Mt(v0),M0e=Lt(v0),L0e={URI:Ji,map:Ns,ap:cd,of:ld},m$={URI:Ji,map:Ns,ap:cd,chain:s$},j0e={URI:Ji,map:Ns,ap:cd,of:ld,chain:s$},U0e=At(m$),B0e={URI:Ji,reduce:u$,foldMap:c$,reduceRight:l$},P0e={URI:Ji,map:Ns,reduce:u$,foldMap:c$,reduceRight:l$,traverse:c4,sequence:A$},W0e={URI:Ji,map:Ns,extend:u4,extract:d$},D0e=ld(on),K0e=Ut(h$),N0e=Bt(m$),q0e=jt(v0);function V0e(e){var t=function(n,r){return e.equals(n,r.value)||r.forest.some(function(i){return t(n,i)})};return t}var f4=function(e){return function(t){return e(t.value)||t.forest.some(f4(e))}},Q0e={URI:Ji,map:Ns,of:ld,ap:cd,chain:s$,reduce:u$,foldMap:c$,reduceRight:l$,traverse:c4,sequence:A$,extract:d$,extend:u4};const z0e=Object.freeze(Object.defineProperty({__proto__:null,Applicative:L0e,Apply:v0,Chain:m$,Comonad:W0e,Do:D0e,Foldable:B0e,Functor:h$,Monad:j0e,Pointed:F0e,Traversable:P0e,URI:Ji,ap:E0e,apFirst:k0e,apS:q0e,apSecond:M0e,bind:N0e,bindTo:K0e,chain:ch,chainFirst:U0e,drawForest:r4,drawTree:x0e,duplicate:$0e,elem:V0e,exists:f4,extend:h0,extract:d$,flap:O0e,flatten:R0e,fold:w0e,foldMap:l4,getEq:T0e,getShow:I0e,make:t4,map:m0,of:ld,reduce:g0,reduceRight:f$,sequence:A$,traverse:p$,tree:Q0e,unfoldForest:o4,unfoldForestM:s4,unfoldTree:i4,unfoldTreeM:a4},Symbol.toStringTag,{value:"Module"}));var kr=rn,fr=Mn,H0e=function(e){return[fr(e),kr(e)]};function g$(e){return{URI:Qr,_E:void 0,map:lh,ap:function(t,n){return[kr(t)(kr(n)),e.concat(fr(t),fr(n))]}}}var d4=function(e){return function(t){return[t,e.empty]}};function Y0e(e){var t=g$(e);return{URI:Qr,_E:void 0,map:t.map,ap:t.ap,of:d4(e)}}function v$(e){var t=g$(e);return{URI:Qr,_E:void 0,map:t.map,ap:t.ap,chain:function(n,r){var i=r(kr(n)),o=i[0],a=i[1];return[o,e.concat(fr(n),a)]}}}function G0e(e){var t=v$(e);return{URI:Qr,_E:void 0,map:t.map,ap:t.ap,chain:t.chain,of:d4(e)}}function J0e(e){var t=function(r,i){for(var o=i(r),a=e.empty,s=kr(o);s._tag==="Left";)a=e.concat(a,fr(o)),o=i(s.left),s=kr(o);return[s.right,e.concat(a,fr(o))]},n=v$(e);return{URI:Qr,_E:void 0,map:n.map,ap:n.ap,chain:n.chain,chainRec:t}}var p4=function(e,t){return b(e,y4(t))},lh=function(e,t){return b(e,S$(t))},A4=function(e,t,n){return b(e,v4(t,n))},h4=function(e,t){return b(e,_$(t))},m4=function(e,t){return b(e,I$(t))},y$=function(e,t,n){return b(e,C4(t,n))},b$=function(e){var t=b4();return function(n,r){return b(n,t(r))}},C$=function(e,t,n){return b(e,S4(t,n))};function g4(e){var t=_4(e);return function(n,r){return b(n,t(r))}}var v4=function(e,t){return function(n){return[t(kr(n)),e(fr(n))]}},S$=function(e){return function(t){return[e(kr(t)),fr(t)]}},_$=function(e){return function(t){return[kr(t),e(fr(t))]}},y4=function(e){return function(t){return[kr(t),fr(e)]}},I$=function(e){return function(t){return[e(t),fr(t)]}},Z0e=I$(N),T$=Gy,b4=qw,C4=Nw,S4=Vw,_4=function(e){return function(t){return function(n){return e.map(t(kr(n)),function(r){return[r,fr(n)]})}}},x$=function(e){return function(t){return e.map(kr(t),function(n){return[n,fr(t)]})}},Qr="Tuple",I4={URI:Qr,map:lh},X0e=Qe(I4),ebe={URI:Qr,bimap:A4,mapLeft:h4},tbe={URI:Qr,compose:p4},nbe={URI:Qr,map:lh,extend:m4,extract:T$},rbe={URI:Qr,reduce:y$,foldMap:b$,reduceRight:C$},ibe={URI:Qr,map:lh,reduce:y$,foldMap:b$,reduceRight:C$,traverse:g4,sequence:x$},obe=S$,abe=_$,sbe={URI:Qr,compose:p4,map:lh,bimap:A4,mapLeft:h4,extract:T$,extend:m4,reduce:y$,foldMap:b$,reduceRight:C$,traverse:g4,sequence:x$};const ube=Object.freeze(Object.defineProperty({__proto__:null,Bifunctor:ebe,Comonad:nbe,Foldable:rbe,Functor:I4,Semigroupoid:tbe,Traversable:ibe,URI:Qr,bimap:v4,compose:y4,duplicate:Z0e,extend:I$,extract:T$,flap:X0e,foldMap:b4,fst:kr,getApplicative:Y0e,getApply:g$,getChain:v$,getChainRec:J0e,getMonad:G0e,map:obe,mapFst:S$,mapLeft:abe,mapSnd:_$,reduce:C4,reduceRight:S4,sequence:x$,snd:fr,swap:H0e,traverse:_4,tuple:sbe},Symbol.toStringTag,{value:"Module"})),cbe=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));function lbe(e,t){var n=XM(t,Ts(e));return{map:n.map,ap:n.ap,of:n.of,chain:function(r,i){return t.chain(r,function(o){return nn(o)?t.of(ta(o.left)):i(o.right)})},alt:function(r,i){return t.chain(r,function(o){return oS(o)?t.of(o):t.map(i(),function(a){return nn(a)?ta(e.concat(o.left,a.left)):a})})}}}const fbe=Object.freeze(Object.defineProperty({__proto__:null,getValidationM:lbe},Symbol.toStringTag,{value:"Module"}));var T4=lS(void 0),dbe={concat:T4.concat,empty:void 0};const pbe=Object.freeze(Object.defineProperty({__proto__:null,Monoid:dbe,Semigroup:T4},Symbol.toStringTag,{value:"Module"}));var Abe=function(e){return function(){return[void 0,e]}},hbe=function(e){return function(){var t=e(),n=t[0],r=t[1];return[[n,r],r]}},mbe=function(e){return function(){var t=e(),n=t[0],r=n[0],i=n[1],o=t[1];return[r,i(o)]}},gbe=function(e){return function(t){return function(){var n=t(),r=n[0],i=n[1];return[[r,e(i)],i]}}},vbe=function(e){return function(t){return function(){var n=t(),r=n[0],i=n[1];return[r,e(i)]}}},fh=function(e,t){return b(e,x4(t))},x4=function(e){return function(t){return function(){var n=t(),r=n[0],i=n[1];return[e(r),i]}}},kc="Writer",w4=function(e){return{URI:kc,_E:void 0,of:function(t){return function(){return[t,e.empty]}}}},w$=function(e){return{URI:kc,_E:void 0,map:fh,ap:function(t,n){return function(){var r=t(),i=r[0],o=r[1],a=n(),s=a[0],u=a[1];return[i(s),e.concat(o,u)]}}}},E4=function(e){var t=w$(e),n=w4(e);return{URI:kc,_E:void 0,map:fh,ap:t.ap,of:n.of}};function $4(e){var t=w$(e);return{URI:kc,_E:void 0,map:fh,ap:t.ap,chain:function(n,r){return function(){var i=n(),o=i[0],a=i[1],s=r(o)(),u=s[0],c=s[1];return[u,e.concat(a,c)]}}}}function ybe(e){var t=E4(e),n=$4(e);return{URI:kc,_E:void 0,map:fh,ap:t.ap,of:t.of,chain:n.chain}}var E$={URI:kc,map:fh},bbe=Qe(E$),Cbe=function(e){return e()[0]},Sbe=function(e){return e()[1]},_be=function(e){return e()[0]},Ibe=function(e){return e()[1]},Tbe=E$;const xbe=Object.freeze(Object.defineProperty({__proto__:null,Functor:E$,URI:kc,censor:vbe,evalWriter:_be,evaluate:Cbe,execWriter:Ibe,execute:Sbe,flap:bbe,getApplicative:E4,getApply:w$,getChain:$4,getMonad:ybe,getPointed:w4,listen:hbe,listens:gbe,map:x4,pass:mbe,tell:Abe,writer:Tbe},Symbol.toStringTag,{value:"Module"}));function wbe(e){var t=function(n,r){return function(){return e.map(n(),function(i){var o=i[0],a=i[1];return[r(o),a]})}};return{map:t,evalWriter:function(n){return e.map(n(),function(r){var i=r[0];return i})},execWriter:function(n){return e.map(n(),function(r){r[0];var i=r[1];return i})},tell:function(n){return function(){return e.of([void 0,n])}},listen:function(n){return function(){return e.map(n(),function(r){var i=r[0],o=r[1];return[[i,o],o]})}},pass:function(n){return function(){return e.map(n(),function(r){var i=r[0],o=i[0],a=i[1],s=r[1];return[o,a(s)]})}},listens:function(n,r){return function(){return e.map(n(),function(i){var o=i[0],a=i[1];return[[o,r(a)],a]})}},censor:function(n,r){return function(){return e.map(n(),function(i){var o=i[0],a=i[1];return[o,r(a)]})}},getMonad:function(n){return{_E:void 0,map:t,of:function(r){return function(){return e.of([r,n.empty])}},ap:function(r,i){return function(){return e.chain(r(),function(o){var a=o[0],s=o[1];return e.map(i(),function(u){var c=u[0],l=u[1];return[a(c),n.concat(s,l)]})})}},chain:function(r,i){return function(){return e.chain(r(),function(o){var a=o[0],s=o[1];return e.map(i(a)(),function(u){var c=u[0],l=u[1];return[c,n.concat(s,l)]})})}}}}}}const Ebe=Object.freeze(Object.defineProperty({__proto__:null,getWriterM:wbe},Symbol.toStringTag,{value:"Module"})),$be=Object.freeze(Object.defineProperty({__proto__:null,alt:Bz,alternative:Wz,applicative:iH,apply:nH,array:ZX,bifunctor:XX,boolean:see,booleanAlgebra:dee,bounded:mee,boundedDistributiveLattice:yee,boundedJoinSemilattice:bee,boundedLattice:Cee,boundedMeetSemilattice:See,category:_ee,chain:oH,chainRec:Iee,choice:wee,comonad:Eee,compactable:yte,console:Ite,const:Pte,contravariant:Wte,date:Hte,distributiveLattice:gee,either:zB,eitherT:jne,endomorphism:Bne,eq:vH,extend:Pne,field:Kne,filterable:qne,filterableWithIndex:Vne,foldable:Jne,foldableWithIndex:Xne,fromEither:aH,fromIO:ere,fromReader:Sre,fromState:Kre,fromTask:Nre,fromThese:qre,function:ZM,functor:rH,functorWithIndex:Qre,group:zre,heytingAlgebra:Hre,hkt:Yre,identity:gie,invariant:vie,io:Uie,ioEither:Uoe,ioOption:Rae,ioRef:Fae,joinSemilattice:kae,json:jae,lattice:Uae,magma:jH,map:Qse,meetSemilattice:zse,monad:Hse,monadIO:Yse,monadTask:Gse,monadThrow:Jse,monoid:lue,naturalTransformation:fue,nonEmptyArray:xG,number:kG,option:gte,optionT:Poe,ord:FH,ordering:vue,pipeable:jue,pointed:Uue,predicate:kee,profunctor:Bue,random:Kue,reader:Cre,readerEither:Bce,readerT:Dce,readerTask:Yle,readerTaskEither:Spe,readonlyArray:pZ,readonlyMap:lse,readonlyNonEmptyArray:MY,readonlyRecord:pAe,readonlySet:RAe,readonlyTuple:VAe,record:Qhe,refinement:tme,ring:ome,semigroup:_L,semigroupoid:ame,semiring:ume,separated:PG,set:Rme,show:jme,state:Dre,stateReaderTaskEither:Gge,stateT:Bme,store:ove,string:Ppe,strong:uve,struct:fve,task:ple,taskEither:ode,taskOption:dye,taskThese:d0e,these:Pye,theseT:Dye,traced:b0e,traversable:S0e,traversableWithIndex:_0e,tree:z0e,tuple:ube,unfoldable:cbe,validationT:fbe,void:pbe,witherable:WG,writer:xbe,writerT:Ebe,zero:DG},Symbol.toStringTag,{value:"Module"})),lt=Ku($be);var ln={},El={},hn={},Ge={};(function(e){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;var t=function(S){return function(){return{meet:function(y,T){return function(w){return S.meet(y(w),T(w))}},join:function(y,T){return function(w){return S.join(y(w),T(w))}},zero:function(){return S.zero},one:function(){return S.one},implies:function(y,T){return function(w){return S.implies(y(w),T(w))}},not:function(y){return function(T){return S.not(y(T))}}}}};e.getBooleanAlgebra=t;var n=function(S){return function(){return{concat:function(y,T){return function(w){return S.concat(y(w),T(w))}}}}};e.getSemigroup=n;var r=function(S){var y=(0,e.getSemigroup)(S);return function(){return{concat:y().concat,empty:function(){return S.empty}}}};e.getMonoid=r;var i=function(S){return{add:function(y,T){return function(w){return S.add(y(w),T(w))}},zero:function(){return S.zero},mul:function(y,T){return function(w){return S.mul(y(w),T(w))}},one:function(){return S.one}}};e.getSemiring=i;var o=function(S){var y=(0,e.getSemiring)(S);return{add:y.add,mul:y.mul,one:y.one,zero:y.zero,sub:function(T,w){return function(O){return S.sub(T(O),w(O))}}}};e.getRing=o;var a=function(S){return function(y){return y(S)}};e.apply=a;function s(S){return S}e.identity=s,e.unsafeCoerce=s;function u(S){return function(){return S}}e.constant=u,e.constTrue=u(!0),e.constFalse=u(!1),e.constNull=u(null),e.constUndefined=u(void 0),e.constVoid=e.constUndefined;function c(S){return function(y,T){return S(T,y)}}e.flip=c;function l(S,y,T,w,O,E,F,W,K){switch(arguments.length){case 1:return S;case 2:return function(){return y(S.apply(this,arguments))};case 3:return function(){return T(y(S.apply(this,arguments)))};case 4:return function(){return w(T(y(S.apply(this,arguments))))};case 5:return function(){return O(w(T(y(S.apply(this,arguments)))))};case 6:return function(){return E(O(w(T(y(S.apply(this,arguments))))))};case 7:return function(){return F(E(O(w(T(y(S.apply(this,arguments)))))))};case 8:return function(){return W(F(E(O(w(T(y(S.apply(this,arguments))))))))};case 9:return function(){return K(W(F(E(O(w(T(y(S.apply(this,arguments)))))))))}}}e.flow=l;function d(){for(var S=[],y=0;y<arguments.length;y++)S[y]=arguments[y];return S}e.tuple=d;function p(S){return S+1}e.increment=p;function A(S){return S-1}e.decrement=A;function m(S){throw new Error("Called `absurd` function which should be uncallable")}e.absurd=m;function v(S){return function(y){return S.apply(void 0,y)}}e.tupled=v;function _(S){return function(){for(var y=[],T=0;T<arguments.length;T++)y[T]=arguments[T];return S(y)}}e.untupled=_;function C(S,y,T,w,O,E,F,W,K){switch(arguments.length){case 1:return S;case 2:return y(S);case 3:return T(y(S));case 4:return w(T(y(S)));case 5:return O(w(T(y(S))));case 6:return E(O(w(T(y(S)))));case 7:return F(E(O(w(T(y(S))))));case 8:return W(F(E(O(w(T(y(S)))))));case 9:return K(W(F(E(O(w(T(y(S))))))));default:{for(var J=arguments[0],ee=1;ee<arguments.length;ee++)J=arguments[ee](J);return J}}}e.pipe=C,e.hole=m;var I=function(S,y){return y};e.SK=I;function x(S){return function(y){return!S(y)}}e.not=x;var g=function(){return{concat:function(S,y){return l(S,y)},empty:s}};e.getEndomorphismMonoid=g})(Ge);var Le={},Rbe=me&&me.__spreadArray||function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))};Object.defineProperty(Le,"__esModule",{value:!0});Le.fromReadonlyNonEmptyArray=Le.has=Le.emptyRecord=Le.emptyReadonlyArray=Le.tail=Le.head=Le.isNonEmpty=Le.singleton=Le.right=Le.left=Le.isRight=Le.isLeft=Le.some=Le.none=Le.isSome=Le.isNone=void 0;var Obe=function(e){return e._tag==="None"};Le.isNone=Obe;var Fbe=function(e){return e._tag==="Some"};Le.isSome=Fbe;Le.none={_tag:"None"};var kbe=function(e){return{_tag:"Some",value:e}};Le.some=kbe;var Mbe=function(e){return e._tag==="Left"};Le.isLeft=Mbe;var Lbe=function(e){return e._tag==="Right"};Le.isRight=Lbe;var jbe=function(e){return{_tag:"Left",left:e}};Le.left=jbe;var Ube=function(e){return{_tag:"Right",right:e}};Le.right=Ube;var Bbe=function(e){return[e]};Le.singleton=Bbe;var Pbe=function(e){return e.length>0};Le.isNonEmpty=Pbe;var Wbe=function(e){return e[0]};Le.head=Wbe;var Dbe=function(e){return e.slice(1)};Le.tail=Dbe;Le.emptyReadonlyArray=[];Le.emptyRecord={};Le.has=Object.prototype.hasOwnProperty;var Kbe=function(e){return Rbe([e[0]],e.slice(1),!0)};Le.fromReadonlyNonEmptyArray=Kbe;var Nbe=me&&me.__createBinding||(Object.create?function(e,t,n,r){r===void 0&&(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){r===void 0&&(r=n),e[r]=t[n]}),qbe=me&&me.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Vbe=me&&me.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&Nbe(t,e,n);return qbe(t,e),t};Object.defineProperty(hn,"__esModule",{value:!0});hn.sequenceS=hn.sequenceT=hn.getApplySemigroup=hn.apS=hn.apSecond=hn.apFirst=hn.ap=void 0;var Qbe=Ge,zbe=Vbe(Le);function Hbe(e,t){return function(n){return function(r){return e.ap(e.map(r,function(i){return function(o){return t.ap(i,o)}}),n)}}}hn.ap=Hbe;function Ybe(e){return function(t){return function(n){return e.ap(e.map(n,function(r){return function(){return r}}),t)}}}hn.apFirst=Ybe;function Gbe(e){return function(t){return function(n){return e.ap(e.map(n,function(){return function(r){return r}}),t)}}}hn.apSecond=Gbe;function Jbe(e){return function(t,n){return function(r){return e.ap(e.map(r,function(i){return function(o){var a;return Object.assign({},i,(a={},a[t]=o,a))}}),n)}}}hn.apS=Jbe;function Zbe(e){return function(t){return{concat:function(n,r){return e.ap(e.map(n,function(i){return function(o){return t.concat(i,o)}}),r)}}}}hn.getApplySemigroup=Zbe;function $$(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,t===0?e.apply(null,i):$$(e,t-1,i)}}var db={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]}}}}}};function Xbe(e){return zbe.has.call(db,e)||(db[e]=$$(Qbe.tuple,e-1,[])),db[e]}function e1e(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];for(var r=t.length,i=Xbe(r),o=e.map(t[0],i),a=1;a<r;a++)o=e.ap(o,t[a]);return o}}hn.sequenceT=e1e;function t1e(e){var t=e.length;switch(t){case 1:return function(n){var r;return r={},r[e[0]]=n,r};case 2:return function(n){return function(r){var i;return i={},i[e[0]]=n,i[e[1]]=r,i}};case 3:return function(n){return function(r){return function(i){var o;return o={},o[e[0]]=n,o[e[1]]=r,o[e[2]]=i,o}}};case 4:return function(n){return function(r){return function(i){return function(o){var a;return a={},a[e[0]]=n,a[e[1]]=r,a[e[2]]=i,a[e[3]]=o,a}}}};case 5:return function(n){return function(r){return function(i){return function(o){return function(a){var s;return s={},s[e[0]]=n,s[e[1]]=r,s[e[2]]=i,s[e[3]]=o,s[e[4]]=a,s}}}}};default:return $$(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,[])}}function n1e(e){return function(t){for(var n=Object.keys(t),r=n.length,i=t1e(n),o=e.map(t[n[0]],i),a=1;a<r;a++)o=e.ap(o,t[n[a]]);return o}}hn.sequenceS=n1e;var ei={};Object.defineProperty(ei,"__esModule",{value:!0});ei.getFunctorComposition=ei.bindTo=ei.flap=ei.map=void 0;var r1e=Ge;function R4(e,t){return function(n){return function(r){return e.map(r,function(i){return t.map(i,n)})}}}ei.map=R4;function i1e(e){return function(t){return function(n){return e.map(n,function(r){return r(t)})}}}ei.flap=i1e;function o1e(e){return function(t){return function(n){return e.map(n,function(r){var i;return i={},i[t]=r,i})}}}ei.bindTo=o1e;function a1e(e,t){var n=R4(e,t);return{map:function(r,i){return(0,r1e.pipe)(r,n(i))}}}ei.getFunctorComposition=a1e;Object.defineProperty(El,"__esModule",{value:!0});El.getApplicativeComposition=El.getApplicativeMonoid=void 0;var O4=hn,s1e=Ge,u1e=ei;function c1e(e){var t=(0,O4.getApplySemigroup)(e);return function(n){return{concat:t(n).concat,empty:e.of(n.empty)}}}El.getApplicativeMonoid=c1e;function l1e(e,t){var n=(0,u1e.getFunctorComposition)(e,t).map,r=(0,O4.ap)(e,t);return{map:n,of:function(i){return e.of(t.of(i))},ap:function(i,o){return(0,s1e.pipe)(i,r(o))}}}El.getApplicativeComposition=l1e;var xu={};Object.defineProperty(xu,"__esModule",{value:!0});xu.bind=xu.chainFirst=void 0;function f1e(e){return function(t){return function(n){return e.chain(n,function(r){return e.map(t(r),function(){return r})})}}}xu.chainFirst=f1e;function d1e(e){return function(t,n){return function(r){return e.chain(r,function(i){return e.map(n(i),function(o){var a;return Object.assign({},i,(a={},a[t]=o,a))})})}}}xu.bind=d1e;var y0={};Object.defineProperty(y0,"__esModule",{value:!0});y0.tailRec=void 0;var p1e=function(e,t){for(var n=t(e);n._tag==="Left";)n=t(n.left);return n.right};y0.tailRec=p1e;var Xt={},A1e=me&&me.__createBinding||(Object.create?function(e,t,n,r){r===void 0&&(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){r===void 0&&(r=n),e[r]=t[n]}),h1e=me&&me.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),m1e=me&&me.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&A1e(t,e,n);return h1e(t,e),t};Object.defineProperty(Xt,"__esModule",{value:!0});Xt.filterOrElse=Xt.chainFirstEitherK=Xt.chainEitherK=Xt.fromEitherK=Xt.chainOptionK=Xt.fromOptionK=Xt.fromPredicate=Xt.fromOption=void 0;var g1e=xu,R$=Ge,fu=m1e(Le);function F4(e){return function(t){return function(n){return e.fromEither(fu.isNone(n)?fu.left(t()):fu.right(n.value))}}}Xt.fromOption=F4;function v1e(e){return function(t,n){return function(r){return e.fromEither(t(r)?fu.right(r):fu.left(n(r)))}}}Xt.fromPredicate=v1e;function k4(e){var t=F4(e);return function(n){var r=t(n);return function(i){return(0,R$.flow)(i,r)}}}Xt.fromOptionK=k4;function y1e(e,t){var n=k4(e);return function(r){var i=n(r);return function(o){return function(a){return t.chain(a,i(o))}}}}Xt.chainOptionK=y1e;function O$(e){return function(t){return(0,R$.flow)(t,e.fromEither)}}Xt.fromEitherK=O$;function b1e(e,t){var n=O$(e);return function(r){return function(i){return t.chain(i,n(r))}}}Xt.chainEitherK=b1e;function C1e(e,t){return(0,R$.flow)(O$(e),(0,g1e.chainFirst)(t))}Xt.chainFirstEitherK=C1e;function S1e(e,t){return function(n,r){return function(i){return t.chain(i,function(o){return e.fromEither(n(o)?fu.right(o):fu.left(r(o)))})}}}Xt.filterOrElse=S1e;var M4={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.right=e.left=e.flap=e.Functor=e.Bifunctor=e.URI=e.bimap=e.mapLeft=e.map=e.separated=void 0;var t=Ge,n=ei,r=function(p,A){return{left:p,right:A}};e.separated=r;var i=function(p,A){return(0,t.pipe)(p,(0,e.map)(A))},o=function(p,A){return(0,t.pipe)(p,(0,e.mapLeft)(A))},a=function(p,A,m){return(0,t.pipe)(p,(0,e.bimap)(A,m))},s=function(p){return function(A){return(0,e.separated)((0,e.left)(A),p((0,e.right)(A)))}};e.map=s;var u=function(p){return function(A){return(0,e.separated)(p((0,e.left)(A)),(0,e.right)(A))}};e.mapLeft=u;var c=function(p,A){return function(m){return(0,e.separated)(p((0,e.left)(m)),A((0,e.right)(m)))}};e.bimap=c,e.URI="Separated",e.Bifunctor={URI:e.URI,mapLeft:o,bimap:a},e.Functor={URI:e.URI,map:i},e.flap=(0,n.flap)(e.Functor);var l=function(p){return p.left};e.left=l;var d=function(p){return p.right};e.right=d})(M4);var rs={},_1e=me&&me.__createBinding||(Object.create?function(e,t,n,r){r===void 0&&(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){r===void 0&&(r=n),e[r]=t[n]}),I1e=me&&me.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),T1e=me&&me.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&_1e(t,e,n);return I1e(t,e),t};Object.defineProperty(rs,"__esModule",{value:!0});rs.filterE=rs.witherDefault=rs.wiltDefault=void 0;var WO=T1e(Le);function x1e(e,t){return function(n){var r=e.traverse(n);return function(i,o){return n.map(r(i,o),t.separate)}}}rs.wiltDefault=x1e;function w1e(e,t){return function(n){var r=e.traverse(n);return function(i,o){return n.map(r(i,o),t.compact)}}}rs.witherDefault=w1e;function E1e(e){return function(t){var n=e.wither(t);return function(r){return function(i){return n(i,function(o){return t.map(r(o),function(a){return a?WO.some(o):WO.none})})}}}}rs.filterE=E1e;(function(e){var t=me&&me.__createBinding||(Object.create?function(U,j,D,Me){Me===void 0&&(Me=D);var B=Object.getOwnPropertyDescriptor(j,D);(!B||("get"in B?!j.__esModule:B.writable||B.configurable))&&(B={enumerable:!0,get:function(){return j[D]}}),Object.defineProperty(U,Me,B)}:function(U,j,D,Me){Me===void 0&&(Me=D),U[Me]=j[D]}),n=me&&me.__setModuleDefault||(Object.create?function(U,j){Object.defineProperty(U,"default",{enumerable:!0,value:j})}:function(U,j){U.default=j}),r=me&&me.__importStar||function(U){if(U&&U.__esModule)return U;var j={};if(U!=null)for(var D in U)D!=="default"&&Object.prototype.hasOwnProperty.call(U,D)&&t(j,U,D);return n(j,U),j};Object.defineProperty(e,"__esModule",{value:!0}),e.fold=e.match=e.foldW=e.matchW=e.isRight=e.isLeft=e.fromOption=e.fromPredicate=e.FromEither=e.MonadThrow=e.throwError=e.ChainRec=e.Extend=e.extend=e.Alt=e.alt=e.altW=e.Bifunctor=e.mapLeft=e.bimap=e.Traversable=e.sequence=e.traverse=e.Foldable=e.reduceRight=e.foldMap=e.reduce=e.Monad=e.Chain=e.chain=e.chainW=e.Applicative=e.Apply=e.ap=e.apW=e.Pointed=e.of=e.Functor=e.map=e.getAltValidation=e.getApplicativeValidation=e.getWitherable=e.getFilterable=e.getCompactable=e.getSemigroup=e.getEq=e.getShow=e.URI=e.right=e.left=void 0,e.getValidation=e.getValidationMonoid=e.getValidationSemigroup=e.getApplyMonoid=e.getApplySemigroup=e.either=e.stringifyJSON=e.parseJSON=e.sequenceArray=e.traverseArray=e.traverseArrayWithIndex=e.traverseReadonlyArrayWithIndex=e.traverseReadonlyNonEmptyArrayWithIndex=e.ApT=e.apSW=e.apS=e.bindW=e.bind=e.bindTo=e.Do=e.exists=e.elem=e.toError=e.toUnion=e.chainNullableK=e.fromNullableK=e.tryCatchK=e.tryCatch=e.fromNullable=e.orElse=e.orElseW=e.swap=e.filterOrElseW=e.filterOrElse=e.chainOptionK=e.fromOptionK=e.duplicate=e.flatten=e.flattenW=e.chainFirstW=e.chainFirst=e.apSecondW=e.apSecond=e.apFirstW=e.apFirst=e.flap=e.getOrElse=e.getOrElseW=void 0;var i=El,o=hn,a=xu,s=y0,u=Xt,c=Ge,l=ei,d=r(Le),p=M4,A=rs;e.left=d.left,e.right=d.right;var m=function(U,j){return(0,c.pipe)(U,(0,e.map)(j))},v=function(U,j){return(0,c.pipe)(U,(0,e.ap)(j))},_=function(U,j){return(0,c.pipe)(U,(0,e.chain)(j))},C=function(U,j,D){return(0,c.pipe)(U,(0,e.reduce)(j,D))},I=function(U){return function(j,D){var Me=(0,e.foldMap)(U);return(0,c.pipe)(j,Me(D))}},x=function(U,j,D){return(0,c.pipe)(U,(0,e.reduceRight)(j,D))},g=function(U){var j=(0,e.traverse)(U);return function(D,Me){return(0,c.pipe)(D,j(Me))}},S=function(U,j,D){return(0,c.pipe)(U,(0,e.bimap)(j,D))},y=function(U,j){return(0,c.pipe)(U,(0,e.mapLeft)(j))},T=function(U,j){return(0,c.pipe)(U,(0,e.alt)(j))},w=function(U,j){return(0,c.pipe)(U,(0,e.extend)(j))},O=function(U,j){return(0,s.tailRec)(j(U),function(D){return(0,e.isLeft)(D)?(0,e.right)((0,e.left)(D.left)):(0,e.isLeft)(D.right)?(0,e.left)(j(D.right.left)):(0,e.right)((0,e.right)(D.right.right))})};e.URI="Either";var E=function(U,j){return{show:function(D){return(0,e.isLeft)(D)?"left(".concat(U.show(D.left),")"):"right(".concat(j.show(D.right),")")}}};e.getShow=E;var F=function(U,j){return{equals:function(D,Me){return D===Me||((0,e.isLeft)(D)?(0,e.isLeft)(Me)&&U.equals(D.left,Me.left):(0,e.isRight)(Me)&&j.equals(D.right,Me.right))}}};e.getEq=F;var W=function(U){return{concat:function(j,D){return(0,e.isLeft)(D)?j:(0,e.isLeft)(j)?D:(0,e.right)(U.concat(j.right,D.right))}}};e.getSemigroup=W;var K=function(U){var j=(0,e.left)(U.empty);return{URI:e.URI,_E:void 0,compact:function(D){return(0,e.isLeft)(D)?D:D.right._tag==="None"?j:(0,e.right)(D.right.value)},separate:function(D){return(0,e.isLeft)(D)?(0,p.separated)(D,D):(0,e.isLeft)(D.right)?(0,p.separated)((0,e.right)(D.right.left),j):(0,p.separated)(j,(0,e.right)(D.right.right))}}};e.getCompactable=K;var J=function(U){var j=(0,e.left)(U.empty),D=(0,e.getCompactable)(U),Me=D.compact,B=D.separate,ie=function(he,we){return(0,e.isLeft)(he)||we(he.right)?he:j},ge=function(he,we){return(0,e.isLeft)(he)?(0,p.separated)(he,he):we(he.right)?(0,p.separated)(j,(0,e.right)(he.right)):(0,p.separated)((0,e.right)(he.right),j)};return{URI:e.URI,_E:void 0,map:m,compact:Me,separate:B,filter:ie,filterMap:function(he,we){if((0,e.isLeft)(he))return he;var ut=we(he.right);return ut._tag==="None"?j:(0,e.right)(ut.value)},partition:ge,partitionMap:function(he,we){if((0,e.isLeft)(he))return(0,p.separated)(he,he);var ut=we(he.right);return(0,e.isLeft)(ut)?(0,p.separated)((0,e.right)(ut.left),j):(0,p.separated)(j,(0,e.right)(ut.right))}}};e.getFilterable=J;var ee=function(U){var j=(0,e.getFilterable)(U),D=(0,e.getCompactable)(U);return{URI:e.URI,_E:void 0,map:m,compact:j.compact,separate:j.separate,filter:j.filter,filterMap:j.filterMap,partition:j.partition,partitionMap:j.partitionMap,traverse:g,sequence:e.sequence,reduce:C,foldMap:I,reduceRight:x,wither:(0,A.witherDefault)(e.Traversable,D),wilt:(0,A.wiltDefault)(e.Traversable,D)}};e.getWitherable=ee;var re=function(U){return{URI:e.URI,_E:void 0,map:m,ap:function(j,D){return(0,e.isLeft)(j)?(0,e.isLeft)(D)?(0,e.left)(U.concat(j.left,D.left)):j:(0,e.isLeft)(D)?D:(0,e.right)(j.right(D.right))},of:e.of}};e.getApplicativeValidation=re;var P=function(U){return{URI:e.URI,_E:void 0,map:m,alt:function(j,D){if((0,e.isRight)(j))return j;var Me=D();return(0,e.isLeft)(Me)?(0,e.left)(U.concat(j.left,Me.left)):Me}}};e.getAltValidation=P;var Y=function(U){return function(j){return(0,e.isLeft)(j)?j:(0,e.right)(U(j.right))}};e.map=Y,e.Functor={URI:e.URI,map:m},e.of=e.right,e.Pointed={URI:e.URI,of:e.of};var M=function(U){return function(j){return(0,e.isLeft)(j)?j:(0,e.isLeft)(U)?U:(0,e.right)(j.right(U.right))}};e.apW=M,e.ap=e.apW,e.Apply={URI:e.URI,map:m,ap:v},e.Applicative={URI:e.URI,map:m,ap:v,of:e.of};var k=function(U){return function(j){return(0,e.isLeft)(j)?j:U(j.right)}};e.chainW=k,e.chain=e.chainW,e.Chain={URI:e.URI,map:m,ap:v,chain:_},e.Monad={URI:e.URI,map:m,ap:v,of:e.of,chain:_};var q=function(U,j){return function(D){return(0,e.isLeft)(D)?U:j(U,D.right)}};e.reduce=q;var ue=function(U){return function(j){return function(D){return(0,e.isLeft)(D)?U.empty:j(D.right)}}};e.foldMap=ue;var ke=function(U,j){return function(D){return(0,e.isLeft)(D)?U:j(D.right,U)}};e.reduceRight=ke,e.Foldable={URI:e.URI,reduce:C,foldMap:I,reduceRight:x};var Ie=function(U){return function(j){return function(D){return(0,e.isLeft)(D)?U.of((0,e.left)(D.left)):U.map(j(D.right),e.right)}}};e.traverse=Ie;var rt=function(U){return function(j){return(0,e.isLeft)(j)?U.of((0,e.left)(j.left)):U.map(j.right,e.right)}};e.sequence=rt,e.Traversable={URI:e.URI,map:m,reduce:C,foldMap:I,reduceRight:x,traverse:g,sequence:e.sequence};var at=function(U,j){return function(D){return(0,e.isLeft)(D)?(0,e.left)(U(D.left)):(0,e.right)(j(D.right))}};e.bimap=at;var fn=function(U){return function(j){return(0,e.isLeft)(j)?(0,e.left)(U(j.left)):j}};e.mapLeft=fn,e.Bifunctor={URI:e.URI,bimap:S,mapLeft:y};var Zt=function(U){return function(j){return(0,e.isLeft)(j)?U():j}};e.altW=Zt,e.alt=e.altW,e.Alt={URI:e.URI,map:m,alt:T};var rr=function(U){return function(j){return(0,e.isLeft)(j)?j:(0,e.right)(U(j))}};e.extend=rr,e.Extend={URI:e.URI,map:m,extend:w},e.ChainRec={URI:e.URI,map:m,ap:v,chain:_,chainRec:O},e.throwError=e.left,e.MonadThrow={URI:e.URI,map:m,ap:v,of:e.of,chain:_,throwError:e.throwError},e.FromEither={URI:e.URI,fromEither:c.identity},e.fromPredicate=(0,u.fromPredicate)(e.FromEither),e.fromOption=(0,u.fromOption)(e.FromEither),e.isLeft=d.isLeft,e.isRight=d.isRight;var dn=function(U,j){return function(D){return(0,e.isLeft)(D)?U(D.left):j(D.right)}};e.matchW=dn,e.foldW=e.matchW,e.match=e.matchW,e.fold=e.match;var Hr=function(U){return function(j){return(0,e.isLeft)(j)?U(j.left):j.right}};e.getOrElseW=Hr,e.getOrElse=e.getOrElseW,e.flap=(0,l.flap)(e.Functor),e.apFirst=(0,o.apFirst)(e.Apply),e.apFirstW=e.apFirst,e.apSecond=(0,o.apSecond)(e.Apply),e.apSecondW=e.apSecond,e.chainFirst=(0,a.chainFirst)(e.Chain),e.chainFirstW=e.chainFirst,e.flattenW=(0,e.chainW)(c.identity),e.flatten=e.flattenW,e.duplicate=(0,e.extend)(c.identity),e.fromOptionK=(0,u.fromOptionK)(e.FromEither),e.chainOptionK=(0,u.chainOptionK)(e.FromEither,e.Chain),e.filterOrElse=(0,u.filterOrElse)(e.FromEither,e.Chain),e.filterOrElseW=e.filterOrElse;var Yr=function(U){return(0,e.isLeft)(U)?(0,e.right)(U.left):(0,e.left)(U.right)};e.swap=Yr;var De=function(U){return function(j){return(0,e.isLeft)(j)?U(j.left):j}};e.orElseW=De,e.orElse=e.orElseW;var dt=function(U){return function(j){return j==null?(0,e.left)(U):(0,e.right)(j)}};e.fromNullable=dt;var St=function(U,j){try{return(0,e.right)(U())}catch(D){return(0,e.left)(j(D))}};e.tryCatch=St;var st=function(U,j){return function(){for(var D=[],Me=0;Me<arguments.length;Me++)D[Me]=arguments[Me];return(0,e.tryCatch)(function(){return U.apply(void 0,D)},j)}};e.tryCatchK=st;var Wt=function(U){var j=(0,e.fromNullable)(U);return function(D){return(0,c.flow)(D,j)}};e.fromNullableK=Wt;var gi=function(U){var j=(0,e.fromNullableK)(U);return function(D){return(0,e.chain)(j(D))}};e.chainNullableK=gi,e.toUnion=(0,e.foldW)(c.identity,c.identity);function _r(U){return U instanceof Error?U:new Error(String(U))}e.toError=_r;function ir(U){return function(j,D){if(D===void 0){var Me=ir(U);return function(B){return Me(j,B)}}return(0,e.isLeft)(D)?!1:U.equals(j,D.right)}}e.elem=ir;var Gr=function(U){return function(j){return(0,e.isLeft)(j)?!1:U(j.right)}};e.exists=Gr,e.Do=(0,e.of)(d.emptyRecord),e.bindTo=(0,l.bindTo)(e.Functor),e.bind=(0,a.bind)(e.Chain),e.bindW=e.bind,e.apS=(0,o.apS)(e.Apply),e.apSW=e.apS,e.ApT=(0,e.of)(d.emptyReadonlyArray);var vi=function(U){return function(j){var D=U(0,d.head(j));if((0,e.isLeft)(D))return D;for(var Me=[D.right],B=1;B<j.length;B++){var ie=U(B,j[B]);if((0,e.isLeft)(ie))return ie;Me.push(ie.right)}return(0,e.right)(Me)}};e.traverseReadonlyNonEmptyArrayWithIndex=vi;var yi=function(U){var j=(0,e.traverseReadonlyNonEmptyArrayWithIndex)(U);return function(D){return d.isNonEmpty(D)?j(D):e.ApT}};e.traverseReadonlyArrayWithIndex=yi,e.traverseArrayWithIndex=e.traverseReadonlyArrayWithIndex;var jo=function(U){return(0,e.traverseReadonlyArrayWithIndex)(function(j,D){return U(D)})};e.traverseArray=jo,e.sequenceArray=(0,e.traverseArray)(c.identity);function Uo(U,j){return(0,e.tryCatch)(function(){return JSON.parse(U)},j)}e.parseJSON=Uo;var Bo=function(U,j){return(0,e.tryCatch)(function(){var D=JSON.stringify(U);if(typeof D!="string")throw new Error("Converting unsupported structure to JSON");return D},j)};e.stringifyJSON=Bo,e.either={URI:e.URI,map:m,of:e.of,ap:v,chain:_,reduce:C,foldMap:I,reduceRight:x,traverse:g,sequence:e.sequence,bimap:S,mapLeft:y,alt:T,extend:w,chainRec:O,throwError:e.throwError},e.getApplySemigroup=(0,o.getApplySemigroup)(e.Apply),e.getApplyMonoid=(0,i.getApplicativeMonoid)(e.Applicative);var Jr=function(U,j){return(0,o.getApplySemigroup)((0,e.getApplicativeValidation)(U))(j)};e.getValidationSemigroup=Jr;var za=function(U,j){return(0,i.getApplicativeMonoid)((0,e.getApplicativeValidation)(U))(j)};e.getValidationMonoid=za;function Vc(U){var j=(0,e.getApplicativeValidation)(U).ap,D=(0,e.getAltValidation)(U).alt;return{URI:e.URI,_E:void 0,map:m,of:e.of,chain:_,bimap:S,mapLeft:y,reduce:C,foldMap:I,reduceRight:x,extend:w,traverse:g,sequence:e.sequence,chainRec:O,throwError:e.throwError,ap:j,alt:D}}e.getValidation=Vc})(ln);var et=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),$l=function(){return $l=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},$l.apply(this,arguments)},$1e=function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))},ko=wt,tt=function(e,t,n){return ko([{value:e,context:t,message:n}])},Re=Ye,_e=function(){function e(t,n,r,i){this.name=t,this.is=n,this.validate=r,this.encode=i,this.decode=this.decode.bind(this)}return e.prototype.pipe=function(t,n){var r=this;return n===void 0&&(n="pipe(".concat(this.name,", ").concat(t.name,")")),new e(n,t.is,function(i,o){var a=r.validate(i,o);return se(a)?a:t.validate(a.right,o)},this.encode===We&&t.encode===We?We:function(i){return r.encode(t.encode(i))})},e.prototype.asDecoder=function(){return this},e.prototype.asEncoder=function(){return this},e.prototype.decode=function(t){return this.validate(t,[{key:"",type:this,actual:t}])},e}(),We=function(e){return e};function L4(e){return e.displayName||e.name||"<function".concat(e.length,">")}function R1e(e,t){return{key:e,type:t}}function Mi(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 ia(e,t){for(var n=t.length,r=0;r<n;r++)e.push(t[r])}var wu=Object.prototype.hasOwnProperty;function D1(e){return Object.keys(e).map(function(t){return"".concat(t,": ").concat(e[t].name)}).join(", ")}function ep(e){for(var t=0;t<e.length;t++)if(e[t].encode!==We)return!1;return!0}function j4(e){return"{ ".concat(D1(e)," }")}function U4(e){return"Partial<".concat(e,">")}function O1e(e,t,n,r){r===void 0&&(r="{ [K in ".concat(t.name,"]: ").concat(n.name," }"));var i=e.length;return new L$(r,function(o){return zn.is(o)&&e.every(function(a){return n.is(o[a])})},function(o,a){var s=zn.validate(o,a);if(se(s))return s;for(var u=s.right,c={},l=[],d=!1,p=0;p<i;p++){var A=e[p],m=u[A],v=n.validate(m,Mi(a,A,n,m));if(se(v))ia(l,v.left);else{var _=v.right;d=d||_!==m,c[A]=_}}return l.length>0?ko(l):Re(d||Object.keys(u).length!==i?c:u)},n.encode===We?We:function(o){for(var a={},s=0;s<i;s++){var u=e[s];a[u]=n.encode(o[u])}return a},t,n)}function F$(e){var t;if(W4(e)){var n=e.value;if(Zi.is(n))return t={},t[n]=null,t}else{if(U1e(e))return e.keys;if(K4(e)){var r=e.types.map(function(i){return F$(i)});return r.some(_m.is)?void 0:Object.assign.apply(Object,$1e([{}],r,!1))}}}function F1e(e,t,n){return n===void 0&&(n="{ [K in ".concat(e.name,"]: ").concat(t.name," }")),new L$(n,function(r){return zn.is(r)?Object.keys(r).every(function(i){return e.is(i)&&t.is(r[i])}):KO(t)&&Array.isArray(r)},function(r,i){if(zn.is(r)){for(var o={},a=[],s=Object.keys(r),u=s.length,c=!1,l=0;l<u;l++){var d=s[l],p=r[d],A=e.validate(d,Mi(i,d,e,d));if(se(A))ia(a,A.left);else{var m=A.right;c=c||m!==d,d=m;var v=t.validate(p,Mi(i,d,t,p));if(se(v))ia(a,v.left);else{var _=v.right;c=c||_!==p,o[d]=_}}}return a.length>0?ko(a):Re(c?o:r)}return KO(t)&&Array.isArray(r)?Re(r):tt(r,i)},e.encode===We&&t.encode===We?We:function(r){for(var i={},o=Object.keys(r),a=o.length,s=0;s<a;s++){var u=o[s];i[String(e.encode(u))]=t.encode(r[u])}return i},e,t)}function B4(e){return"("+e.map(function(t){return t.name}).join(" | ")+")"}function K1(e,t){for(var n=!0,r=!0,i=!zn.is(e),o=0,a=t;o<a.length;o++){var s=a[o];s!==e&&(n=!1),zn.is(s)&&(r=!1)}if(n)return e;if(r)return t[t.length-1];for(var u={},c=0,l=t;c<l.length;c++){var s=l[c];for(var d in s)(!wu.call(u,d)||i||s[d]!==e[d])&&(u[d]=s[d])}return u}function N1(e){switch(e._tag){case"RefinementType":case"ReadonlyType":return N1(e.type);case"InterfaceType":case"StrictType":case"PartialType":return e.props;case"IntersectionType":return e.types.reduce(function(t,n){return Object.assign(t,N1(n))},{})}}function DO(e,t){for(var n=Object.getOwnPropertyNames(e),r=!1,i={},o=0;o<n.length;o++){var a=n[o];wu.call(t,a)?i[a]=e[a]:r=!0}return r?i:e}function k1e(e){return D4(e)?"{| ".concat(D1(e.props)," |}"):B1e(e)?U4("{| ".concat(D1(e.props)," |}")):"Exact<".concat(e.name,">")}function M1e(e){return e.length>0}var ar={};function P4(e,t){for(var n=[],r=0,i=e;r<i.length;r++){var o=i[r];t.indexOf(o)!==-1&&n.push(o)}return n}function L1e(e,t){if(e===ar)return t;if(t===ar)return e;var n=Object.assign({},e);for(var r in t)if(wu.call(e,r)){var i=P4(e[r],t[r]);if(M1e(i))n[r]=i;else{n=ar;break}}else n[r]=t[r];return n}function j1e(e,t){if(e===ar||t===ar)return ar;var n=ar;for(var r in e)if(wu.call(t,r)){var i=P4(e[r],t[r]);i.length===0&&(n===ar&&(n={}),n[r]=e[r].concat(t[r]))}return n}function KO(e){return e._tag==="AnyType"}function W4(e){return e._tag==="LiteralType"}function U1e(e){return e._tag==="KeyofType"}function D4(e){return e._tag==="InterfaceType"}function B1e(e){return e._tag==="PartialType"}function P1e(e){return e._tag==="StrictType"}function W1e(e){return e._tag==="ExactType"}function D1e(e){return e._tag==="RefinementType"}function K1e(e){return e._tag==="IntersectionType"}function K4(e){return e._tag==="UnionType"}function N1e(e){return e._tag==="RecursiveType"}var pb=[];function Ja(e){if(pb.indexOf(e)!==-1)return ar;if(D4(e)||P1e(e)){var t=ar;for(var n in e.props){var r=e.props[n];W4(r)&&(t===ar&&(t={}),t[n]=[r.value])}return t}else{if(W1e(e)||D1e(e))return Ja(e.type);if(K1e(e))return e.types.reduce(function(o,a){return L1e(o,Ja(a))},ar);if(K4(e))return e.types.slice(1).reduce(function(o,a){return j1e(o,Ja(a))},Ja(e.types[0]));if(N1e(e)){pb.push(e);var i=Ja(e.type);return pb.pop(),i}}return ar}function N4(e){var t=Ja(e[0]),n=Object.keys(t),r=e.length,i=function(c){for(var l=t[c].slice(),d=[t[c]],p=1;p<r;p++){var A=e[p],m=Ja(A),v=m[c];if(v===void 0)return"continue-keys";if(v.some(function(_){return l.indexOf(_)!==-1}))return"continue-keys";l.push.apply(l,v),d.push(v)}return{value:[c,d]}};e:for(var o=0,a=n;o<a.length;o++){var s=a[o],u=i(s);if(typeof u=="object")return u.value;switch(u){case"continue-keys":continue e}}}var q4=function(e){et(t,e);function t(){var n=e.call(this,"null",function(r){return r===null},function(r,i){return n.is(r)?Re(r):tt(r,i)},We)||this;return n._tag="NullType",n}return t}(_e),q1=new q4,V4=function(e){et(t,e);function t(){var n=e.call(this,"undefined",function(r){return r===void 0},function(r,i){return n.is(r)?Re(r):tt(r,i)},We)||this;return n._tag="UndefinedType",n}return t}(_e),_m=new V4,Q4=function(e){et(t,e);function t(){var n=e.call(this,"void",_m.is,_m.validate,We)||this;return n._tag="VoidType",n}return t}(_e),NO=new Q4,z4=function(e){et(t,e);function t(){var n=e.call(this,"unknown",function(r){return!0},Re,We)||this;return n._tag="UnknownType",n}return t}(_e),q1e=new z4,H4=function(e){et(t,e);function t(){var n=e.call(this,"string",function(r){return typeof r=="string"},function(r,i){return n.is(r)?Re(r):tt(r,i)},We)||this;return n._tag="StringType",n}return t}(_e),Zi=new H4,Y4=function(e){et(t,e);function t(){var n=e.call(this,"number",function(r){return typeof r=="number"},function(r,i){return n.is(r)?Re(r):tt(r,i)},We)||this;return n._tag="NumberType",n}return t}(_e),Mc=new Y4,G4=function(e){et(t,e);function t(){var n=e.call(this,"bigint",function(r){return typeof r=="bigint"},function(r,i){return n.is(r)?Re(r):tt(r,i)},We)||this;return n._tag="BigIntType",n}return t}(_e),V1e=new G4,J4=function(e){et(t,e);function t(){var n=e.call(this,"boolean",function(r){return typeof r=="boolean"},function(r,i){return n.is(r)?Re(r):tt(r,i)},We)||this;return n._tag="BooleanType",n}return t}(_e),b0=new J4,Z4=function(e){et(t,e);function t(){var n=e.call(this,"UnknownArray",Array.isArray,function(r,i){return n.is(r)?Re(r):tt(r,i)},We)||this;return n._tag="AnyArrayType",n}return t}(_e),Rl=new Z4,X4=function(e){et(t,e);function t(){var n=e.call(this,"UnknownRecord",function(r){var i=Object.prototype.toString.call(r);return i==="[object Object]"||i==="[object Window]"},function(r,i){return n.is(r)?Re(r):tt(r,i)},We)||this;return n._tag="AnyDictionaryType",n}return t}(_e),zn=new X4,e9=function(e){et(t,e);function t(n,r,i,o,a){var s=e.call(this,n,r,i,o)||this;return s.value=a,s._tag="LiteralType",s}return t}(_e);function dh(e,t){t===void 0&&(t=JSON.stringify(e));var n=function(r){return r===e};return new e9(t,n,function(r,i){return n(r)?Re(e):tt(r,i)},We,e)}var t9=function(e){et(t,e);function t(n,r,i,o,a){var s=e.call(this,n,r,i,o)||this;return s.keys=a,s._tag="KeyofType",s}return t}(_e);function Q1e(e,t){t===void 0&&(t=Object.keys(e).map(function(r){return JSON.stringify(r)}).join(" | "));var n=function(r){return Zi.is(r)&&wu.call(e,r)};return new t9(t,n,function(r,i){return n(r)?Re(r):tt(r,i)},We,e)}var n9=function(e){et(t,e);function t(n,r,i,o,a,s){var u=e.call(this,n,r,i,o)||this;return u.type=a,u.predicate=s,u._tag="RefinementType",u}return t}(_e);function C0(e,t,n){return B$(e,t,n)}var Im=C0(Mc,function(e){return Number.isInteger(e)},"Int"),k$=function(e){et(t,e);function t(n,r,i,o,a){var s=e.call(this,n,r,i,o)||this;return s.runDefinition=a,s._tag="RecursiveType",s}return t}(_e);Object.defineProperty(k$.prototype,"type",{get:function(){return this.runDefinition()},enumerable:!0,configurable:!0});function M$(e,t){var n,r=function(){return n||(n=t(i),n.name=e),n},i=new k$(e,function(o){return r().is(o)},function(o,a){return r().validate(o,a)},function(o){return r().encode(o)},r);return i}var r9=function(e){et(t,e);function t(n,r,i,o,a){var s=e.call(this,n,r,i,o)||this;return s.type=a,s._tag="ArrayType",s}return t}(_e);function S0(e,t){return t===void 0&&(t="Array<".concat(e.name,">")),new r9(t,function(n){return Rl.is(n)&&n.every(e.is)},function(n,r){var i=Rl.validate(n,r);if(se(i))return i;for(var o=i.right,a=o.length,s=o,u=[],c=0;c<a;c++){var l=o[c],d=e.validate(l,Mi(r,String(c),e,l));if(se(d))ia(u,d.left);else{var p=d.right;p!==l&&(s===o&&(s=o.slice()),s[c]=p)}}return u.length>0?ko(u):Re(s)},e.encode===We?We:function(n){return n.map(e.encode)},e)}var i9=function(e){et(t,e);function t(n,r,i,o,a){var s=e.call(this,n,r,i,o)||this;return s.props=a,s._tag="InterfaceType",s}return t}(_e);function V1(e,t){t===void 0&&(t=j4(e));var n=Object.keys(e),r=n.map(function(o){return e[o]}),i=n.length;return new i9(t,function(o){if(zn.is(o)){for(var a=0;a<i;a++){var s=n[a],u=o[s];if(u===void 0&&!wu.call(o,s)||!r[a].is(u))return!1}return!0}return!1},function(o,a){var s=zn.validate(o,a);if(se(s))return s;for(var u=s.right,c=u,l=[],d=0;d<i;d++){var p=n[d],A=c[p],m=r[d],v=m.validate(A,Mi(a,p,m,A));if(se(v))ia(l,v.left);else{var _=v.right;(_!==A||_===void 0&&!wu.call(c,p))&&(c===u&&(c=$l({},u)),c[p]=_)}}return l.length>0?ko(l):Re(c)},ep(r)?We:function(o){for(var a=$l({},o),s=0;s<i;s++){var u=n[s],c=r[s].encode;c!==We&&(a[u]=c(o[u]))}return a},e)}var o9=function(e){et(t,e);function t(n,r,i,o,a){var s=e.call(this,n,r,i,o)||this;return s.props=a,s._tag="PartialType",s}return t}(_e);function z1e(e,t){t===void 0&&(t=U4(j4(e)));var n=Object.keys(e),r=n.map(function(o){return e[o]}),i=n.length;return new o9(t,function(o){if(zn.is(o)){for(var a=0;a<i;a++){var s=n[a],u=o[s];if(u!==void 0&&!e[s].is(u))return!1}return!0}return!1},function(o,a){var s=zn.validate(o,a);if(se(s))return s;for(var u=s.right,c=u,l=[],d=0;d<i;d++){var p=n[d],A=c[p],m=e[p],v=m.validate(A,Mi(a,p,m,A));if(se(v))A!==void 0&&ia(l,v.left);else{var _=v.right;_!==A&&(c===u&&(c=$l({},u)),c[p]=_)}}return l.length>0?ko(l):Re(c)},ep(r)?We:function(o){for(var a=$l({},o),s=0;s<i;s++){var u=n[s],c=o[u];c!==void 0&&(a[u]=r[s].encode(c))}return a},e)}var L$=function(e){et(t,e);function t(n,r,i,o,a,s){var u=e.call(this,n,r,i,o)||this;return u.domain=a,u.codomain=s,u._tag="DictionaryType",u}return t}(_e);function j$(e,t,n){var r=F$(e);return r?O1e(Object.keys(r),e,t,n):F1e(e,t,n)}var U$=function(e){et(t,e);function t(n,r,i,o,a){var s=e.call(this,n,r,i,o)||this;return s.types=a,s._tag="UnionType",s}return t}(_e);function ph(e,t){t===void 0&&(t=B4(e));var n=N4(e);if(n!==void 0&&e.length>0){var r=n[0],i=n[1],o=i.length,a=function(s){for(var u=0;u<o;u++)if(i[u].indexOf(s)!==-1)return u};return new Tm(t,function(s){if(zn.is(s)){var u=a(s[r]);return u!==void 0?e[u].is(s):!1}return!1},function(s,u){var c=zn.validate(s,u);if(se(c))return c;var l=c.right,d=a(l[r]);if(d===void 0)return tt(s,u);var p=e[d];return p.validate(l,Mi(u,String(d),p,l))},ep(e)?We:function(s){var u=a(s[r]);if(u===void 0)throw new Error("no codec found to encode value in union codec ".concat(t));return e[u].encode(s)},e,r)}else return new U$(t,function(s){return e.some(function(u){return u.is(s)})},function(s,u){for(var c=[],l=0;l<e.length;l++){var d=e[l],p=d.validate(s,Mi(u,String(l),d,s));if(se(p))ia(c,p.left);else return Re(p.right)}return ko(c)},ep(e)?We:function(s){for(var u=0,c=e;u<c.length;u++){var l=c[u];if(l.is(s))return l.encode(s)}throw new Error("no codec found to encode value in union type ".concat(t))},e)}var a9=function(e){et(t,e);function t(n,r,i,o,a){var s=e.call(this,n,r,i,o)||this;return s.types=a,s._tag="IntersectionType",s}return t}(_e);function H1e(e,t){t===void 0&&(t="(".concat(e.map(function(r){return r.name}).join(" & "),")"));var n=e.length;return new a9(t,function(r){return e.every(function(i){return i.is(r)})},e.length===0?Re:function(r,i){for(var o=[],a=[],s=0;s<n;s++){var u=e[s],c=u.validate(r,Mi(i,String(s),u,r));se(c)?ia(a,c.left):o.push(c.right)}return a.length>0?ko(a):Re(K1(r,o))},e.length===0?We:function(r){return K1(r,e.map(function(i){return i.encode(r)}))},e)}var s9=function(e){et(t,e);function t(n,r,i,o,a){var s=e.call(this,n,r,i,o)||this;return s.types=a,s._tag="TupleType",s}return t}(_e);function Y1e(e,t){t===void 0&&(t="[".concat(e.map(function(r){return r.name}).join(", "),"]"));var n=e.length;return new s9(t,function(r){return Rl.is(r)&&r.length===n&&e.every(function(i,o){return i.is(r[o])})},function(r,i){var o=Rl.validate(r,i);if(se(o))return o;for(var a=o.right,s=a.length>n?a.slice(0,n):a,u=[],c=0;c<n;c++){var l=a[c],d=e[c],p=d.validate(l,Mi(i,String(c),d,l));if(se(p))ia(u,p.left);else{var A=p.right;A!==l&&(s===a&&(s=a.slice()),s[c]=A)}}return u.length>0?ko(u):Re(s)},ep(e)?We:function(r){return e.map(function(i,o){return i.encode(r[o])})},e)}var u9=function(e){et(t,e);function t(n,r,i,o,a){var s=e.call(this,n,r,i,o)||this;return s.type=a,s._tag="ReadonlyType",s}return t}(_e);function G1e(e,t){return t===void 0&&(t="Readonly<".concat(e.name,">")),new u9(t,e.is,e.validate,e.encode,e)}var c9=function(e){et(t,e);function t(n,r,i,o,a){var s=e.call(this,n,r,i,o)||this;return s.type=a,s._tag="ReadonlyArrayType",s}return t}(_e);function l9(e,t){t===void 0&&(t="ReadonlyArray<".concat(e.name,">"));var n=S0(e);return new c9(t,n.is,n.validate,n.encode,e)}var tp=function(e,t){return d9(V1(e),t)},f9=function(e){et(t,e);function t(n,r,i,o,a){var s=e.call(this,n,r,i,o)||this;return s.type=a,s._tag="ExactType",s}return t}(_e);function d9(e,t){t===void 0&&(t=k1e(e));var n=N1(e);return new f9(t,e.is,function(r,i){var o=zn.validate(r,i);if(se(o))return o;var a=e.validate(r,i);return se(a)?a:Ye(DO(a.right,n))},function(r){return e.encode(DO(r,n))},e)}var p9=function(e){et(t,e);function t(){var n=e.call(this,"Function",function(r){return typeof r=="function"},function(r,i){return n.is(r)?Re(r):tt(r,i)},We)||this;return n._tag="FunctionType",n}return t}(_e),J1e=new p9,Tm=function(e){et(t,e);function t(n,r,i,o,a,s){var u=e.call(this,n,r,i,o,a)||this;return u.tag=s,u}return t}(U$),Z1e=function(e,t,n){n===void 0&&(n=B4(t));var r=ph(t,n);return r instanceof Tm?r:(console.warn("[io-ts] Cannot build a tagged union for ".concat(n,", returning a de-optimized union")),new Tm(n,r.is,r.validate,r.encode,t,e))},X1e=function(e,t){return{value:e,context:t}},A9=function(e){return[{key:"",type:e}]},h9=function(e){et(t,e);function t(){var n=e.call(this,"never",function(r){return!1},function(r,i){return tt(r,i)},function(){throw new Error("cannot encode never")})||this;return n._tag="NeverType",n}return t}(_e),eCe=new h9,m9=function(e){et(t,e);function t(){var n=e.call(this,"any",function(r){return!0},Re,We)||this;return n._tag="AnyType",n}return t}(_e),tCe=new m9,nCe=zn,g9=function(e){et(t,e);function t(){var n=e.call(this,"object",function(r){return r!==null&&typeof r=="object"},function(r,i){return n.is(r)?Re(r):tt(r,i)},We)||this;return n._tag="ObjectType",n}return t}(_e),rCe=new g9;function B$(e,t,n){return n===void 0&&(n="(".concat(e.name," | ").concat(L4(t),")")),new n9(n,function(r){return e.is(r)&&t(r)},function(r,i){var o=e.validate(r,i);if(se(o))return o;var a=o.right;return t(a)?Re(a):tt(a,i)},e.encode,e,t)}var iCe=B$(Mc,Number.isInteger,"Integer"),oCe=j$,aCe=function(e){et(t,e);function t(n,r,i,o,a){var s=e.call(this,n,r,i,o)||this;return s.props=a,s._tag="StrictType",s}return t}(_e);function sCe(e){return e}function uCe(e){return function(){return e}}const cCe=Object.freeze(Object.defineProperty({__proto__:null,AnyArrayType:Z4,AnyDictionaryType:X4,AnyType:m9,Array:Rl,ArrayType:r9,BigIntType:G4,BooleanType:J4,Dictionary:nCe,DictionaryType:L$,ExactType:f9,Function:J1e,FunctionType:p9,Int:Im,Integer:iCe,InterfaceType:i9,IntersectionType:a9,KeyofType:t9,LiteralType:e9,NeverType:h9,NullType:q4,NumberType:Y4,ObjectType:g9,PartialType:o9,ReadonlyArrayType:c9,ReadonlyType:u9,RecursiveType:k$,RefinementType:n9,StrictType:aCe,StringType:H4,TaggedUnionType:Tm,TupleType:s9,Type:_e,UndefinedType:V4,UnionType:U$,UnknownArray:Rl,UnknownRecord:zn,UnknownType:z4,VoidType:Q4,alias:uCe,any:tCe,appendContext:Mi,array:S0,bigint:V1e,boolean:b0,brand:C0,clean:sCe,dictionary:oCe,emptyTags:ar,exact:d9,failure:tt,failures:ko,getContextEntry:R1e,getDefaultContext:A9,getDomainKeys:F$,getFunctionName:L4,getIndex:N4,getTags:Ja,getValidationError:X1e,identity:We,interface:V1,intersection:H1e,keyof:Q1e,literal:dh,mergeAll:K1,never:eCe,null:q1,nullType:q1,number:Mc,object:rCe,partial:z1e,readonly:G1e,readonlyArray:l9,record:j$,recursion:M$,refinement:B$,strict:tp,string:Zi,success:Re,taggedUnion:Z1e,tuple:Y1e,type:V1,undefined:_m,union:ph,unknown:q1e,void:NO,voidType:NO},Symbol.toStringTag,{value:"Module"})),Z=Ku(cCe);var Ah={};Object.defineProperty(Ah,"__esModule",{value:!0});Ah.ContentPath=void 0;const qO="::";Ah.ContentPath={serialize(e){return e.map(t=>t.key).join(qO)},current(e){return e[e.length-1]},append(e,t){return e+qO+t},make(e){return e.reduce((t,{key:n,type:r})=>n?t.concat({key:n,type:r}):t,[])}};var Lc={},_0={};Object.defineProperty(_0,"__esModule",{value:!0});_0.getAssetOrThrow=void 0;const lCe=e=>t=>{const n=e[t];if(!n)throw new Error(`Missing asset with id '${t}'!`);return n};_0.getAssetOrThrow=lCe;var I0={};Object.defineProperty(I0,"__esModule",{value:!0});I0.getEmbedOrThrow=void 0;const fCe=e=>t=>{const n=e[t];if(!n)throw new Error(`Missing embed with url '${t}'`);return n};I0.getEmbedOrThrow=fCe;var T0={},Xe={};const Xi=Ku(ZM);function v9(e,t,n){return n===void 0&&(n=e.name),new _e(n,e.is,e.validate,function(r){return t(e.encode(r))})}const dCe=Object.freeze(Object.defineProperty({__proto__:null,mapOutput:v9},Symbol.toStringTag,{value:"Module"}));var y9=C0(Zi,function(e){return e.length>0},"NonEmptyString");function b9(e,t){t===void 0&&(t="NonEmptyArray<"+e.name+">");var n=S0(e);return new _e(t,function(r){return n.is(r)&&Vt(r)},function(r,i){return le(n.validate(r,i),ui(function(o){var a=YS(o);return qe(a)?tt(r,i):Re(a.value)}))},function(r){return n.encode(r)})}function C9(e,t,n){n===void 0&&(n="Set<"+e.name+">");var r=S0(e),i=AN(t),o=fN(t);return new _e(n,function(a){return a instanceof Set&&pN(e.is)(a)},function(a,s){return le(r.validate(a,s),ui(function(u){var c=o(u);return c.size!==u.length?tt(a,s):Re(c)}))},function(a){return r.encode(i(a))})}function pCe(e,t,n){return n===void 0&&(n="ReadonlySet<"+e.name+">"),C9(e,t,n)}function P$(e,t){return new _e(e,t,function(n,r){return t(n)?Re(n):tt(n,r)},We)}var ACe=function(e){return e instanceof Date},hCe=P$("Date",ACe),mCe=function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))},gCe=function(e,t){return{get:e,reverseGet:t}},S9=function(e){return qs(e.get,H(e.reverseGet,pr))},vCe=function(e){return jc(H(e.get,Tt),e.reverseGet)},yCe=function(e){return Ka(H(e.get,Tt),H(e.reverseGet,pr))},bCe=function(e){return fd(function(t){return function(n){return function(r){return t.map(n(e.get(r)),function(i){return e.reverseGet(i)})}}})},qs=function(e,t){return{get:e,set:t}},W$=function(e){return Ka(H(e.get,Tt),e.set)},CCe=function(e){return fd(function(t){return function(n){return function(r){return t.map(n(e.get(r)),function(i){return e.set(i)(r)})}}})},_9=function(e){return function(t){return qs(function(n){return e.get(t.get(n))},function(n){return function(r){return t.set(e.set(n)(t.get(r)))(r)}})}},SCe=function(e){return function(t){return jc(H(t.getOption,Zp(e.getOption)),H(e.reverseGet,t.reverseGet))}},_Ce=function(e){return function(t){return Uc(D$(e))(W$(t))}},ICe=function(){return qs(N,pr)},TCe=function(e){return function(t){return qs(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={},i[e]=n,i)))(r)}})}},xCe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(n){return qs(function(r){for(var i=n.get(r),o={},a=0,s=e;a<s.length;a++){var u=s[a];o[u]=i[u]}return o},function(r){return function(i){for(var o=n.get(i),a=0,s=e;a<s.length;a++){var u=s[a];if(r[u]!==o[u])return n.set(Object.assign({},o,r))(i)}return i}})}},wCe=function(e){return function(t){return qs(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)}})}},ECe=function(e){return function(t){return le(t,_9(GCe().at(e)))}},jc=function(e,t){return{getOption:e,reverseGet:t}},D$=function(e){return Ka(e.getOption,function(t){return T9(t)(e)})},I9=function(e){return fd(function(t){return function(n){return function(r){return le(e.getOption(r),Is(function(){return t.of(r)},function(i){return t.map(n(i),function(o){return T9(o)(e)(r)})}))}}})},$Ce=function(e){return function(t){return function(n){return le(t.getOption(n),bo(function(r){var i=e(r);return i===r?n:t.reverseGet(i)}))}}},RCe=function(e){return function(t){var n=$Ce(e)(t);return function(r){return le(n(r),wI(function(){return r}))}}},T9=function(e){return RCe(function(){return e})},OCe=function(e){return function(t){return Uc(W$(e))(D$(t))}},FCe=function(){return jc(Ju,N)},K$=function(e){return jc(Cv(e),N)},kCe=function(){return jc(N,Tt)},MCe=function(){return jc(gf,Ye)},LCe=function(){return jc(function(e){return se(e)?Tt(e.left):ot},wt)},Ka=function(e,t){return{getOption:e,set:t}},jCe=function(e){return fd(function(t){return function(n){return function(r){return le(e.getOption(r),Is(function(){return t.of(r)},function(i){return t.map(n(i),function(o){return e.set(o)(r)})}))}}})},x9=function(e){return function(t){return function(n){return le(t.getOption(n),bo(function(r){var i=e(r);return i===r?n:t.set(i)(n)}))}}},w9=function(e){return function(t){var n=x9(e)(t);return function(r){return le(n(r),wI(function(){return r}))}}},Uc=function(e){return function(t){return Ka(H(t.getOption,Zp(e.getOption)),function(n){return w9(e.set(n))(t)})}},UCe=function(e){return function(t){return le(t,Uc(QCe().index(e)))}},BCe=function(e){return function(t){return le(t,Uc(zCe().index(e)))}},PCe=function(e){return function(t){return le(t,Uc(HCe().index(e)))}},WCe=function(e){return Ka(tv(e),function(t){return function(n){return le(ev(e)(n),Is(function(){return n},function(r){return fv(r,t,n)}))}})},E9=function(e,t,n){if(n[e]===t)return n;var r=mCe([n[0]],n.slice(1),!0);return r[e]=t,r},DCe=function(e){return Ka(tv(e),function(t){return function(n){return le(ev(e)(n),Is(function(){return n},function(r){return E9(r,t,n)}))}})},fd=function(e){return{modifyF:e}};function N$(e){return function(t){return fd(function(n){return function(r){return t.modifyF(n)(e.modifyF(n)(r))}})}}var KCe={URI:"Identity",map:function(e,t){return t(e)},of:N,ap:function(e,t){return e(t)}},NCe=function(e){return e.URI==="Identity"};function qCe(e){return function(){return fd(function(t){var n=NCe(t)?e.map:e.traverse(t);return function(r){return function(i){return n(i,r)}}})}}function VCe(e){return N$(qCe(e)())}var q$=function(e){return{index:e}},QCe=function(){return q$(function(e){return Ka(function(t){return Su(e,t)},function(t){return function(n){return le(Su(e,n),Is(function(){return n},function(){return fv(e,t,n)}))}})})},zCe=function(){return q$(function(e){return Ka(function(t){return Su(e,t)},function(t){return function(n){return le(Su(e,n),Is(function(){return n},function(){return E9(e,t,n)}))}})})},HCe=function(){return q$(function(e){return Ka(function(t){return _u(e,t)},function(t){return function(n){return n[e]===t||qe(_u(e,n))?n:ww(e,t)(n)}})})},YCe=function(e){return{at:e}};function GCe(){return YCe(function(e){return qs(function(t){return _u(e,t)},Is(function(){return hw(e)},function(t){return ww(e,t)}))})}var $9=gCe,Q1=S9,z1=vCe,H1=yCe,Y1=bCe,JCe=function(e){return function(t){return $9(H(t.get,e.get),H(e.reverseGet,t.reverseGet))}},ZCe=function(e){return $9(e.reverseGet,e.get)},XCe=function(e){return function(t){return function(n){return t.reverseGet(e(t.get(n)))}}},R9=qs,xm=ICe,ls=W$,Ol=CCe,Eu=_9,eSe=Eu,tSe=H(S9,Eu),Bc=_Ce,V$=function(e){return H(ls,Uc(e))},nSe=function(e){return H(Ol,N$(e))},O9=function(e){return function(t){return function(n){var r=t.get(n),i=e(r);return r===i?n:t.set(i)(n)}}};function rSe(e){return function(t){return function(n){return function(r){return le(n.get(r),t,function(i){return e.map(i,function(o){return n.set(o)(r)})})}}}}var iSe=function(e){return Bc(FCe())(e)};function oSe(e){return Bc(K$(e))}var F9=TCe,k9=xCe,aSe=wCe,sSe=function(e){return H(ls,UCe(e))},uSe=function(e){return H(ls,BCe(e))},cSe=function(e){return H(ls,PCe(e))},lSe=ECe,fSe=Bc(kCe()),dSe=Bc(MCe()),pSe=Bc(LCe());function ASe(e){return H(Ol,VCe(e))}function hSe(e){return V$(WCe(e))}function mSe(e){return V$(DCe(e))}var gSe=function(e,t){return function(n){return M9(n,e,t)}},M9=function(e,t,n){return R9(H(e.get,t),H(n,e.set))},x0="monocle-ts/Lens",vSe={URI:x0,imap:M9},L9={URI:x0,compose:function(e,t){return Eu(e)(t)}},ySe={URI:x0,compose:L9.compose,id:xm};const bSe=Object.freeze(Object.defineProperty({__proto__:null,Category:ySe,Invariant:vSe,Semigroupoid:L9,URI:x0,asOptional:ls,asTraversal:Ol,atKey:lSe,component:aSe,compose:Eu,composeIso:tSe,composeLens:eSe,composeOptional:V$,composePrism:Bc,composeTraversal:nSe,filter:oSe,findFirst:hSe,findFirstNonEmpty:mSe,fromNullable:iSe,id:xm,imap:gSe,index:sSe,indexNonEmpty:uSe,key:cSe,left:pSe,lens:R9,modify:O9,modifyF:rSe,prop:F9,props:k9,right:dSe,some:fSe,traverse:ASe},Symbol.toStringTag,{value:"Module"}));var VO=jCe,ou=Uc,CSe=x9,SSe=w9,_Se=K$,G1=D$,J1=I9,Z1=SCe,ISe=OCe,Go=N$,j9=function(e){return function(t){return t.modifyF(KCe)(e)}},TSe=function(e){return j9(function(){return e})};function xSe(e){return Go(I9(K$(e)))}var QO=function(e){return new B9(e.get,e.reverseGet)},fl=function(e){return new Q$(e.get,e.set)},Rd=function(e){return new P9(e.getOption,e.reverseGet)},ti=function(e){return new wSe(e.getOption,e.set)},xr=function(e){return new ESe(e.modifyF)},U9=function(e,t,n){var r;return n===e[t]?e:Object.assign({},e,(r={},r[t]=n,r))},B9=function(){function e(t,n){this.get=t,this.reverseGet=n,this._tag="Iso",this.unwrap=this.get,this.to=this.get,this.wrap=this.reverseGet,this.from=this.reverseGet}return e.prototype.reverse=function(){return QO(ZCe(this))},e.prototype.modify=function(t){return XCe(t)(this)},e.prototype.asLens=function(){return fl(Q1(this))},e.prototype.asPrism=function(){return Rd(z1(this))},e.prototype.asOptional=function(){return ti(H1(this))},e.prototype.asTraversal=function(){return xr(Y1(this))},e.prototype.asFold=function(){var t=this;return new dd(function(){return function(n){return function(r){return n(t.get(r))}}})},e.prototype.asGetter=function(){var t=this;return new D9(function(n){return t.get(n)})},e.prototype.asSetter=function(){var t=this;return new hh(function(n){return t.modify(n)})},e.prototype.compose=function(t){return QO(JCe(t)(this))},e.prototype.composeIso=function(t){return this.compose(t)},e.prototype.composeLens=function(t){return fl(le(this,Q1,Eu(t)))},e.prototype.composePrism=function(t){return Rd(le(this,z1,Z1(t)))},e.prototype.composeOptional=function(t){return ti(le(this,H1,ou(t)))},e.prototype.composeTraversal=function(t){return xr(le(this,Y1,Go(t)))},e.prototype.composeFold=function(t){return this.asFold().compose(t)},e.prototype.composeGetter=function(t){return this.asGetter().compose(t)},e.prototype.composeSetter=function(t){return this.asSetter().compose(t)},e}(),Q$=function(){function e(t,n){this.get=t,this.set=n,this._tag="Lens"}return e.fromPath=function(){var t=e.fromProp();return function(n){var r=t(n[0]);return n.slice(1).reduce(function(i,o){return i.compose(t(o))},r)}},e.fromProp=function(){return function(t){return fl(le(xm(),F9(t)))}},e.fromProps=function(){return function(t){return fl(le(xm(),k9.apply(bSe,t)))}},e.fromNullableProp=function(){return function(t,n){return new e(function(r){var i=Ju(r[t]);return qe(i)?n:i.value},function(r){return function(i){return U9(i,t,r)}})}},e.prototype.modify=function(t){return O9(t)(this)},e.prototype.asOptional=function(){return ti(ls(this))},e.prototype.asTraversal=function(){return xr(Ol(this))},e.prototype.asSetter=function(){var t=this;return new hh(function(n){return t.modify(n)})},e.prototype.asGetter=function(){var t=this;return new D9(function(n){return t.get(n)})},e.prototype.asFold=function(){var t=this;return new dd(function(){return function(n){return function(r){return n(t.get(r))}}})},e.prototype.compose=function(t){return fl(Eu(t)(this))},e.prototype.composeLens=function(t){return this.compose(t)},e.prototype.composeGetter=function(t){return this.asGetter().compose(t)},e.prototype.composeFold=function(t){return this.asFold().compose(t)},e.prototype.composeOptional=function(t){return ti(le(this,ls,ou(t)))},e.prototype.composeTraversal=function(t){return xr(le(this,Ol,Go(t)))},e.prototype.composeSetter=function(t){return this.asSetter().compose(t)},e.prototype.composeIso=function(t){return fl(le(this,Eu(le(t,Q1))))},e.prototype.composePrism=function(t){return ti(Bc(t)(this))},e}(),P9=function(){function e(t,n){this.getOption=t,this.reverseGet=n,this._tag="Prism"}return e.fromPredicate=function(t){return Rd(_Se(t))},e.some=function(){return W9},e.prototype.modify=function(t){var n=this;return function(r){var i=n.modifyOption(t)(r);return qe(i)?r:i.value}},e.prototype.modifyOption=function(t){var n=this;return function(r){return aB.map(n.getOption(r),function(i){var o=t(i);return o===i?r:n.reverseGet(o)})}},e.prototype.set=function(t){return this.modify(function(){return t})},e.prototype.asOptional=function(){return ti(G1(this))},e.prototype.asTraversal=function(){return xr(J1(this))},e.prototype.asSetter=function(){var t=this;return new hh(function(n){return t.modify(n)})},e.prototype.asFold=function(){var t=this;return new dd(function(n){return function(r){return function(i){var o=t.getOption(i);return qe(o)?n.empty:r(o.value)}}})},e.prototype.compose=function(t){return Rd(Z1(t)(this))},e.prototype.composePrism=function(t){return this.compose(t)},e.prototype.composeOptional=function(t){return ti(le(this,G1,ou(t)))},e.prototype.composeTraversal=function(t){return xr(le(this,J1,Go(t)))},e.prototype.composeFold=function(t){return this.asFold().compose(t)},e.prototype.composeSetter=function(t){return this.asSetter().compose(t)},e.prototype.composeIso=function(t){return Rd(le(this,Z1(le(t,z1))))},e.prototype.composeLens=function(t){return ti(ISe(t)(this))},e.prototype.composeGetter=function(t){return this.asFold().compose(t.asFold())},e}(),W9=new P9(N,Tt),wSe=function(){function e(t,n){this.getOption=t,this.set=n,this._tag="Optional"}return e.fromPath=function(){var t=e.fromNullableProp();return function(n){var r=t(n[0]);return n.slice(1).reduce(function(i,o){return i.compose(t(o))},r)}},e.fromNullableProp=function(){return function(t){return new e(function(n){return Ju(n[t])},function(n){return function(r){return r[t]==null?r:U9(r,t,n)}})}},e.fromOptionProp=function(){var t=Q$.fromProp();return function(n){return t(n).composePrism(W9)}},e.prototype.modify=function(t){return SSe(t)(this)},e.prototype.modifyOption=function(t){return CSe(t)(this)},e.prototype.asTraversal=function(){return xr(VO(this))},e.prototype.asFold=function(){var t=this;return new dd(function(n){return function(r){return function(i){var o=t.getOption(i);return qe(o)?n.empty:r(o.value)}}})},e.prototype.asSetter=function(){var t=this;return new hh(function(n){return t.modify(n)})},e.prototype.compose=function(t){return ti(ou(t)(this))},e.prototype.composeOptional=function(t){return this.compose(t)},e.prototype.composeTraversal=function(t){return xr(le(this,VO,Go(t)))},e.prototype.composeFold=function(t){return this.asFold().compose(t)},e.prototype.composeSetter=function(t){return this.asSetter().compose(t)},e.prototype.composeLens=function(t){return ti(le(this,ou(le(t,ls))))},e.prototype.composePrism=function(t){return ti(le(this,ou(le(t,G1))))},e.prototype.composeIso=function(t){return ti(le(this,ou(le(t,H1))))},e.prototype.composeGetter=function(t){return this.asFold().compose(t.asFold())},e}(),ESe=function(){function e(t){this.modifyF=t,this._tag="Traversal"}return e.prototype.modify=function(t){return j9(t)(this)},e.prototype.set=function(t){return TSe(t)(this)},e.prototype.filter=function(t){return xr(xSe(t)(this))},e.prototype.asFold=function(){var t=this;return new dd(function(n){return function(r){return t.modifyF(cB(n))(function(i){return vf(r(i))})}})},e.prototype.asSetter=function(){var t=this;return new hh(function(n){return t.modify(n)})},e.prototype.compose=function(t){return xr(Go(t)(this))},e.prototype.composeTraversal=function(t){return this.compose(t)},e.prototype.composeFold=function(t){return this.asFold().compose(t)},e.prototype.composeSetter=function(t){return this.asSetter().compose(t)},e.prototype.composeOptional=function(t){return this.compose(t.asTraversal())},e.prototype.composeLens=function(t){return xr(le(this,Go(le(t,Ol))))},e.prototype.composePrism=function(t){return xr(le(this,Go(le(t,J1))))},e.prototype.composeIso=function(t){return xr(le(this,Go(le(t,Y1))))},e.prototype.composeGetter=function(t){return this.asFold().compose(t.asFold())},e}(),D9=function(){function e(t){this.get=t,this._tag="Getter"}return e.prototype.asFold=function(){var t=this;return new dd(function(){return function(n){return function(r){return n(t.get(r))}}})},e.prototype.compose=function(t){var n=this;return new e(function(r){return t.get(n.get(r))})},e.prototype.composeGetter=function(t){return this.compose(t)},e.prototype.composeFold=function(t){return this.asFold().compose(t)},e.prototype.composeLens=function(t){return this.compose(t.asGetter())},e.prototype.composeIso=function(t){return this.compose(t.asGetter())},e.prototype.composeTraversal=function(t){return this.asFold().compose(t.asFold())},e.prototype.composeOptional=function(t){return this.asFold().compose(t.asFold())},e.prototype.composePrism=function(t){return this.asFold().compose(t.asFold())},e}(),dd=function(){function e(t){this.foldMap=t,this._tag="Fold",this.getAll=t(aI())(_s),this.exist=t(UD),this.all=t(jD),this.foldMapFirst=t(sB())}return e.prototype.compose=function(t){var n=this;return new e(function(r){return function(i){return n.foldMap(r)(t.foldMap(r)(i))}})},e.prototype.composeFold=function(t){return this.compose(t)},e.prototype.composeGetter=function(t){return this.compose(t.asFold())},e.prototype.composeTraversal=function(t){return this.compose(t.asFold())},e.prototype.composeOptional=function(t){return this.compose(t.asFold())},e.prototype.composeLens=function(t){return this.compose(t.asFold())},e.prototype.composePrism=function(t){return this.compose(t.asFold())},e.prototype.composeIso=function(t){return this.compose(t.asFold())},e.prototype.find=function(t){return this.foldMapFirst(Cv(t))},e.prototype.headOption=function(t){return this.find(function(){return!0})(t)},e}(),hh=function(){function e(t){this.modify=t,this._tag="Setter"}return e.prototype.set=function(t){return this.modify(pr(t))},e.prototype.compose=function(t){var n=this;return new e(function(r){return n.modify(t.modify(r))})},e.prototype.composeSetter=function(t){return this.compose(t)},e.prototype.composeTraversal=function(t){return this.compose(t.asSetter())},e.prototype.composeOptional=function(t){return this.compose(t.asSetter())},e.prototype.composeLens=function(t){return this.compose(t.asSetter())},e.prototype.composePrism=function(t){return this.compose(t.asSetter())},e.prototype.composeIso=function(t){return this.compose(t.asSetter())},e}(),$Se=new B9(bl,bl);function RSe(){return $Se}function OSe(e,t){t===void 0&&(t="fromNewtype("+e.name+")");var n=RSe();return new _e(t,function(r){return e.is(r)},function(r,i){return le(e.validate(r,i),tc(n.wrap))},function(r){return e.encode(n.unwrap(r))})}var FSe=tp({_tag:dh("None")}),kSe=dh("Some");function K9(e,t){return t===void 0&&(t="Option<"+e.name+">"),ph([FSe,tp({_tag:kSe,value:e},"Some<"+e.name+">")],t)}function MSe(e,t){return t===void 0&&(t="Option<"+e.name+">"),new _e(t,K9(e).is,function(n,r){return n==null?Re(ot):le(e.validate(n,r),tc(Tt))},function(n){return EI(le(n,bo(e.encode)))})}var LSe=new _e("DateFromISOString",function(e){return e instanceof Date},function(e,t){return le(Zi.validate(e,t),ui(function(n){var r=new Date(n);return isNaN(r.getTime())?tt(e,t):Re(r)}))},function(e){return e.toISOString()});function jSe(e,t){return t===void 0&&(t="ReadonlyNonEmptyArray<"+e.name+">"),b9(e,t)}function N9(e){var t=Object.create(Object.getPrototypeOf(e));return Object.assign(t,e),t}var USe=new _e("DateFromNumber",function(e){return e instanceof Date},function(e,t){return le(Mc.validate(e,t),ui(function(n){var r=new Date(n);return isNaN(r.getTime())?tt(e,t):Re(r)}))},function(e){return e.getTime()});function w0(e,t,n){n===void 0&&(n=e.name);var r=N9(e);return r.validate=t,r.decode=function(i){return t(i,A9(r))},r.name=n,r}function BSe(e,t,n){return n===void 0&&(n="withFallback("+e.name+")"),w0(e,function(r,i){return PB(function(){return Re(t)})(e.validate(r,i))},n)}var PSe=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,WSe=C0(Zi,function(e){return PSe.test(e)},"UUID");function DSe(e,t,n){return n===void 0&&(n="fromNullable("+e.name+")"),w0(e,function(r,i){return r==null?Re(t):e.validate(r,i)},n)}var KSe=new _e("BooleanFromString",b0.is,function(e,t){return le(Zi.validate(e,t),ui(function(n){return n==="true"?Re(!0):n==="false"?Re(!1):tt(e,t)}))},String);function NSe(e,t){return w0(e,function(n,r){return aA(function(){return[{value:n,context:r,message:t(n,r),actual:n}]})(e.validate(n,r))})}function q9(e){switch(e._tag){case"InterfaceType":return e.props;case"ExactType":return q9(e.type)}}var qSe=Q$.fromProp();function VSe(e){var t={};for(var n in q9(e))t[n]=qSe(n);return t}var QSe=function(e){return Object.prototype.toString.call(e)==="[object RegExp]"},zSe=P$("RegExp",QSe),HSe=new _e("DateFromUnixTime",function(e){return e instanceof Date},function(e,t){return le(Im.validate(e,t),ui(function(n){var r=new Date(n*1e3);return isNaN(r.getTime())?tt(e,t):Re(r)}))},function(e){return Math.floor(e.getTime()/1e3)}),X1=new _e("NumberFromString",Mc.is,function(e,t){return le(Zi.validate(e,t),ui(function(n){var r=+n;return isNaN(r)||n.trim()===""?tt(e,t):Re(r)}))},String),YSe=new _e("IntFromString",Im.is,function(e,t){return le(X1.validate(e,t),ui(function(n){return Im.is(n)?Re(n):tt(e,t)}))},X1.encode),V9=M$("JsonArray",function(){return l9(E0)}),Q9=M$("JsonRecord",function(){return j$(Zi,E0)}),E0=ph([b0,Mc,Zi,q1,V9,Q9],"Json"),GSe=new _e("JsonFromString",E0.is,function(e,t){try{return Re(JSON.parse(e))}catch{return tt(e,t)}},function(e){return JSON.stringify(e)}),JSe=dh("Left"),ZSe=dh("Right");function XSe(e,t,n){return n===void 0&&(n="Either<"+e.name+", "+t.name+">"),ph([tp({_tag:JSe,left:e},"Left<"+e.name+">"),tp({_tag:ZSe,right:t},"Right<"+e.name+">")],n)}var e_e=new _e("BigIntFromString",function(e){return typeof e=="bigint"},function(e,t){return le(Zi.validate(e,t),ui(function(n){if(!y9.is(n.trim()))return tt(e,t);try{return Re(BigInt(n))}catch{return tt(e,t)}}))},String);function t_e(e,t,n){return n===void 0&&(n=e.name),new _e(n,e.is,e.validate,t)}var n_e=new _e("BooleanFromNumber",b0.is,function(e,t){return le(Mc.validate(e,t),tc(function(n){return n!==0}))},Number);const r_e=Object.freeze(Object.defineProperty({__proto__:null,BigIntFromString:e_e,BooleanFromNumber:n_e,BooleanFromString:KSe,DateFromISOString:LSe,DateFromNumber:USe,DateFromUnixTime:HSe,IntFromString:YSe,Json:E0,JsonArray:V9,JsonFromString:GSe,JsonRecord:Q9,NonEmptyString:y9,NumberFromString:X1,UUID:WSe,clone:N9,date:hCe,either:XSe,fromNewtype:OSe,fromNullable:DSe,fromRefinement:P$,getLenses:VSe,mapOutput:v9,nonEmptyArray:b9,option:K9,optionFromNullable:MSe,readonlyNonEmptyArray:jSe,readonlySetFromArray:pCe,regexp:zSe,setFromArray:C9,withEncode:t_e,withFallback:BSe,withMessage:NSe,withValidate:w0},Symbol.toStringTag,{value:"Module"})),$0=Ku(r_e),i_e=Ku(dCe);Object.defineProperty(Xe,"__esModule",{value:!0});Xe.withCustomError=Xe.addType=Xe.isEmpty=Xe.objectToMap=Xe.grouped=Xe.formatDate=Xe.formatDateTime=Xe.filterDouble=Xe.refineType=Xe.nullable=void 0;const o_e=Q,z9=lt,a_e=Xi,pl=(0,o_e.__importStar)(Z),s_e=$0,u_e=i_e;function c_e(e){return pl.union([e,pl.null,pl.undefined])}Xe.nullable=c_e;function l_e(e,t,n){return new pl.Type(t,e.is,(r,i)=>(0,a_e.pipe)(e.validate(r,i),z9.either.chain(o=>n(o)?pl.success(o):pl.failure(r,i))),e.encode)}Xe.refineType=l_e;function f_e(e){if(e==="")return null;const t=Number(e);return Number.isNaN(t)?null:t}Xe.filterDouble=f_e;function d_e(e){return e.toISOString().replace(/\.\d{3}Z$/,"+0000")}Xe.formatDateTime=d_e;function p_e(e){return e.toISOString().replace(/T.*/,"")}Xe.formatDate=p_e;function A_e(e,t){return e.reduce((n,r,i)=>(i%t===0?n.push([r]):n[Math.floor(i/t)].push(r),n),new Array)}Xe.grouped=A_e;function h_e(e){return new Map(Object.entries(e))}Xe.objectToMap=h_e;function m_e(e){for(const t in e)return!1;return!0}Xe.isEmpty=m_e;function g_e(e,t){return(0,u_e.mapOutput)(e,n=>({...n,__TYPE__:t}))}Xe.addType=g_e;function v_e(e,t){return(0,s_e.withValidate)(e,(n,r)=>z9.either.mapLeft(i=>i.find(o=>o.message)?i:[{value:n,context:r,message:t(n,r),actual:n}])(e.validate(n,r)))}Xe.withCustomError=v_e;Object.defineProperty(T0,"__esModule",{value:!0});T0.WidgetKey=void 0;const y_e=Q,b_e=(0,y_e.__importStar)(Z),C_e=Xe,S_e=new RegExp("^[^<>]+$");T0.WidgetKey=(0,C_e.refineType)(b_e.string,"WidgetKey",e=>e.length===0||S_e.test(e));(function(e){Object.defineProperty(e,"__esModule",{value:!0});const t=Q;(0,t.__exportStar)(_0,e),(0,t.__exportStar)(I0,e),(0,t.__exportStar)(T0,e)})(Lc);var fe={},H9={},pd={},R0={},O0={};Object.defineProperty(O0,"__esModule",{value:!0});O0.clone=void 0;function __e(e){var t=Object.create(Object.getPrototypeOf(e));return Object.assign(t,e),t}O0.clone=__e;var I_e=me&&me.__createBinding||(Object.create?function(e,t,n,r){r===void 0&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]}),T_e=me&&me.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),x_e=me&&me.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)Object.hasOwnProperty.call(e,n)&&I_e(t,e,n);return T_e(t,e),t};Object.defineProperty(R0,"__esModule",{value:!0});R0.withValidate=void 0;var w_e=x_e(Z),E_e=O0;function $_e(e,t,n){n===void 0&&(n=e.name);var r=E_e.clone(e);return r.validate=t,r.decode=function(i){return t(i,w_e.getDefaultContext(r))},r.name=n,r}R0.withValidate=$_e;var R_e=me&&me.__createBinding||(Object.create?function(e,t,n,r){r===void 0&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]}),O_e=me&&me.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),F_e=me&&me.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)Object.hasOwnProperty.call(e,n)&&R_e(t,e,n);return O_e(t,e),t};Object.defineProperty(pd,"__esModule",{value:!0});pd.withFallback=void 0;var k_e=F_e(Z),M_e=R0,L_e=ln;function j_e(e,t,n){return n===void 0&&(n="withFallback("+e.name+")"),M_e.withValidate(e,function(r,i){return L_e.orElse(function(){return k_e.success(t)})(e.validate(r,i))},n)}pd.withFallback=j_e;var Ab={},en={};Object.defineProperty(en,"__esModule",{value:!0});en.EmptyArray=en.EmptyObject=en.Boolean=en.NumberOrNull=en.Number=en.StringOrNull=en.String=void 0;const U_e=Q,B_e=lt,P_e=Ge,Kt=(0,U_e.__importStar)(Z),mh=Xe;en.String=(0,mh.withCustomError)(Kt.string,()=>"The value must be a string");en.StringOrNull=(0,mh.withCustomError)(Kt.union([Kt.string,Kt.null]),()=>"The value must be a string or null");en.Number=(0,mh.withCustomError)(Kt.number,()=>"The value must be a number");en.NumberOrNull=(0,mh.withCustomError)(Kt.union([Kt.number,Kt.null]),()=>"The value must be a number or null");en.Boolean=(0,mh.withCustomError)(Kt.boolean,()=>"The value must be a boolean");en.EmptyObject=Kt.UnknownRecord.pipe(new Kt.Type("emptyObject",e=>Kt.UnknownRecord.is(e),(e,t)=>Object.keys(e).length>0?Kt.failure(e,t,"The object is not empty."):Kt.success({}),Kt.identity));en.EmptyArray=new Kt.Type("emptyArray",e=>Kt.UnknownArray.is(e)&&e.length===0,(e,t)=>(0,P_e.pipe)(Kt.UnknownArray.decode(e),B_e.either.chain(n=>n.length>0?Kt.failure(e,t,"The array is not empty."):Kt.success(new Array))),()=>[]);var jh={};const Na=Ku(zB);var zO;function W_e(){if(zO)return jh;zO=1,Object.defineProperty(jh,"__esModule",{value:!0});const e=Q,t=Na,n=Xi,r=(0,e.__importStar)(Z),i=ft();return jh.default=new r.Type("dateFromString",o=>o instanceof Date,(o,a)=>(0,n.pipe)(i.String.validate(o,a),(0,t.chain)(s=>{const u=new Date(s);return isNaN(u.getTime())?r.failure(o,a):r.success(u)})),o=>o.toISOString()),jh}var z$={};Object.defineProperty(z$,"__esModule",{value:!0});const D_e=Q,K_e=Na,N_e=Xi,Jc=(0,D_e.__importStar)(Z);z$.default=new Jc.Type("dateFromStringOrNumber",e=>e instanceof Date,(e,t)=>(0,N_e.pipe)(Jc.union([Jc.number,Jc.string]).validate(e,t),(0,K_e.chain)(n=>{const r=new Date(n);return isNaN(r.getTime())?Jc.failure(e,t):Jc.success(r)})),e=>e);var H$={};Object.defineProperty(H$,"__esModule",{value:!0});const q_e=Q,V_e=Na,Q_e=Xi,Uh=(0,q_e.__importStar)(Z);H$.default=new Uh.Type("dateFromTsMs",e=>e instanceof Date,(e,t)=>(0,Q_e.pipe)(Uh.number.validate(e,t),(0,V_e.chain)(n=>{const r=new Date(n);return isNaN(r.getTime())?Uh.failure(e,t):Uh.success(r)})),e=>e.getTime());var Y9={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.EmptyArrayOrElse=e.EmptyObjectOrElse=e.NullOrElse=e.DefaultOrElse=void 0;const t=Q,n=ln,r=(0,t.__importStar)(Z),i=en,o=c=>l=>new r.Type(`DefaultOrElse<${c.name}, ${l.name}>`,d=>d===null||l.is(d),(d,p)=>(0,n.isRight)(c.validate(d,p))?r.success(null):l.validate(d,p),d=>d?l.encode(d):void 0);e.DefaultOrElse=o;const a=c=>(0,e.DefaultOrElse)(r.null)(c);e.NullOrElse=a;const s=c=>(0,e.DefaultOrElse)(i.EmptyObject)(c);e.EmptyObjectOrElse=s;const u=c=>(0,e.DefaultOrElse)(i.EmptyArray)(c);e.EmptyArrayOrElse=u})(Y9);var Y$={};Object.defineProperty(Y$,"__esModule",{value:!0});const z_e=Q,H_e=Na,Y_e=Xi,Zs=(0,z_e.__importStar)(Z);Y$.default=new Zs.Type("IntFromNumber",Zs.Int.is,(e,t)=>(0,Y_e.pipe)(Zs.number.validate(e,t),(0,H_e.chain)(n=>Zs.Int.is(n)?Zs.success(n):Zs.success(Math.round(n)))),Zs.Int.encode);var G$={};Object.defineProperty(G$,"__esModule",{value:!0});const G_e=Q,J_e=Na,Z_e=Xi,Zc=(0,G_e.__importStar)(Z),X_e=/^([0-9]+)px$/;G$.default=new Zc.Type("IntFromPixels",Zc.Int.is,(e,t)=>(0,Z_e.pipe)(Zc.string.validate(e,t),(0,J_e.chain)(n=>{try{const r=n.match(X_e);if(!r)return Zc.failure(e,t);const i=parseInt(r[1]);return Zc.success(i)}catch{return Zc.failure(e,t)}})),String);var J$={};Object.defineProperty(J$,"__esModule",{value:!0});const eIe=Q,tIe=(0,eIe.__importStar)(Z),HO=Xe;J$.default=(0,HO.withCustomError)((0,HO.refineType)(tIe.string,"nonEmptyString",e=>e.trim().length>0),()=>"The value must be a non-empty string");var Z$={},F0={};Object.defineProperty(F0,"__esModule",{value:!0});const nIe=Q,rIe=(0,nIe.__importStar)(Z),iIe=Xe;F0.default=(0,iIe.nullable)(rIe.string);Object.defineProperty(Z$,"__esModule",{value:!0});const oIe=Q,aIe=Na,sIe=Xi,hb=Z,uIe=(0,oIe.__importDefault)(F0);Z$.default=new hb.Type("nonEmptyStringOrNull",e=>typeof e=="string"||e===null,(e,t)=>(0,sIe.pipe)(uIe.default.validate(e,t),(0,aIe.chain)(n=>typeof n=="string"&&n.length>0?(0,hb.success)(n):(0,hb.success)(null))),e=>e);var X$={};Object.defineProperty(X$,"__esModule",{value:!0});const cIe=Q,lIe=(0,cIe.__importStar)(Z),fIe=Xe;X$.default=(0,fIe.nullable)(lIe.number);var eR={};Object.defineProperty(eR,"__esModule",{value:!0});const dIe=Q,Bh=(0,dIe.__importStar)(Z),YO=en;eR.default=(e,t,n)=>YO.Number.pipe(new Bh.Type("numberInRange",r=>YO.Number.is(r),(r,i)=>r>t||r<e?Bh.failure(r,i,`${n} must be a number between ${e} and ${t}`):Bh.success(r),Bh.identity));var tR={};Object.defineProperty(tR,"__esModule",{value:!0});const pIe=Q,AIe=Na,hIe=Xi,Ph=(0,pIe.__importStar)(Z);tR.default=new Ph.Type("StringFromInt",Ph.string.is,(e,t)=>(0,hIe.pipe)(Ph.boolean.validate(e,t),(0,AIe.chain)(n=>Ph.success(n.toString()))),e=>e);var nR={};Object.defineProperty(nR,"__esModule",{value:!0});const mIe=Q,gIe=Na,vIe=Xi,Wh=(0,mIe.__importStar)(Z);nR.default=new Wh.Type("StringFromInt",Wh.string.is,(e,t)=>(0,vIe.pipe)(Wh.number.validate(e,t),(0,gIe.chain)(n=>Wh.success(n.toString()))),e=>e);var GO;function ft(){return GO||(GO=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.StringOrNull=e.StringFromNumber=e.StringFromBoolean=e.NumberRange=e.NumberOrNull=e.NonEmptyStringOrNull=e.NonEmptyString=e.IntFromPixels=e.IntFromNumber=e.Function=e.DateFromTsMs=e.DateFromStringOrNumber=e.DateFromString=void 0;const t=Q;(0,t.__exportStar)(en,e);var n=W_e();Object.defineProperty(e,"DateFromString",{enumerable:!0,get:function(){return(0,t.__importDefault)(n).default}});var r=z$;Object.defineProperty(e,"DateFromStringOrNumber",{enumerable:!0,get:function(){return(0,t.__importDefault)(r).default}});var i=H$;Object.defineProperty(e,"DateFromTsMs",{enumerable:!0,get:function(){return(0,t.__importDefault)(i).default}}),(0,t.__exportStar)(Y9,e),e.Function=(0,t.__importStar)(Xe);var o=Y$;Object.defineProperty(e,"IntFromNumber",{enumerable:!0,get:function(){return(0,t.__importDefault)(o).default}});var a=G$;Object.defineProperty(e,"IntFromPixels",{enumerable:!0,get:function(){return(0,t.__importDefault)(a).default}});var s=J$;Object.defineProperty(e,"NonEmptyString",{enumerable:!0,get:function(){return(0,t.__importDefault)(s).default}});var u=Z$;Object.defineProperty(e,"NonEmptyStringOrNull",{enumerable:!0,get:function(){return(0,t.__importDefault)(u).default}});var c=X$;Object.defineProperty(e,"NumberOrNull",{enumerable:!0,get:function(){return(0,t.__importDefault)(c).default}});var l=eR;Object.defineProperty(e,"NumberRange",{enumerable:!0,get:function(){return(0,t.__importDefault)(l).default}});var d=tR;Object.defineProperty(e,"StringFromBoolean",{enumerable:!0,get:function(){return(0,t.__importDefault)(d).default}});var p=nR;Object.defineProperty(e,"StringFromNumber",{enumerable:!0,get:function(){return(0,t.__importDefault)(p).default}});var A=F0;Object.defineProperty(e,"StringOrNull",{enumerable:!0,get:function(){return(0,t.__importDefault)(A).default}})}(Ab)),Ab}var Ti={},wr={},Ad={},qa={},rR={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.BooleanField=e.BooleanConfig=e.BooleanFieldType=void 0;const n=(0,Q.__importStar)(Z),r=ft();e.BooleanFieldType="Boolean",e.BooleanConfig=n.exact(n.partial({label:r.StringOrNull,default_value:n.boolean,placeholder_true:n.string,placeholder_false:n.string})),e.BooleanField=n.exact(n.intersection([n.type({type:n.literal(e.BooleanFieldType)}),n.partial({config:e.BooleanConfig})]))})(rR);var iR={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Color=e.ColorConfig=e.ColorFieldType=void 0;const n=(0,Q.__importStar)(Z),r=ft();e.ColorFieldType="Color",e.ColorConfig=n.exact(n.partial({label:r.StringOrNull,placeholder:n.string})),e.Color=n.exact(n.intersection([n.type({type:n.literal(e.ColorFieldType)}),n.partial({fieldset:r.StringOrNull,config:e.ColorConfig})]))})(iR);var oR={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Date=e.DateConfig=e.DateFieldType=void 0;const n=(0,Q.__importStar)(Z),r=ft();e.DateFieldType="Date",e.DateConfig=n.exact(n.partial({label:r.StringOrNull,placeholder:n.string,default:n.string})),e.Date=n.exact(n.intersection([n.type({type:n.literal(e.DateFieldType)}),n.partial({fieldset:r.StringOrNull,config:e.DateConfig})]))})(oR);var aR={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Embed=e.EmbedConfig=e.EmbedFieldType=void 0;const n=(0,Q.__importStar)(Z),r=ft();e.EmbedFieldType="Embed",e.EmbedConfig=n.exact(n.partial({label:r.StringOrNull,placeholder:n.string,useAsTitle:n.boolean})),e.Embed=n.exact(n.intersection([n.type({type:n.literal(e.EmbedFieldType)}),n.partial({fieldset:r.StringOrNull,config:e.EmbedConfig})]))})(aR);var sR={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.GeoPoint=e.GeoPointConfig=e.GeoPointFieldType=void 0;const n=(0,Q.__importStar)(Z),r=ft();e.GeoPointFieldType="GeoPoint",e.GeoPointConfig=n.exact(n.partial({label:r.StringOrNull})),e.GeoPoint=n.exact(n.intersection([n.type({type:n.literal(e.GeoPointFieldType)}),n.partial({fieldset:r.StringOrNull,config:e.GeoPointConfig})]))})(sR);var uR={},gh={},k0={},hd={},$u={};Object.defineProperty($u,"__esModule",{value:!0});$u.pipe=$u.pipeable=void 0;var eC=Ge,yIe=function(e){return typeof e.map=="function"},bIe=function(e){return typeof e.contramap=="function"},CIe=function(e){return typeof e.mapWithIndex=="function"},SIe=function(e){return typeof e.ap=="function"},_Ie=function(e){return typeof e.chain=="function"},IIe=function(e){return typeof e.bimap=="function"},TIe=function(e){return typeof e.extend=="function"},xIe=function(e){return typeof e.reduce=="function"},wIe=function(e){return typeof e.reduceWithIndex=="function"},EIe=function(e){return typeof e.alt=="function"},$Ie=function(e){return typeof e.compact=="function"},RIe=function(e){return typeof e.filter=="function"},OIe=function(e){return typeof e.filterWithIndex=="function"},FIe=function(e){return typeof e.promap=="function"},kIe=function(e){return typeof e.compose=="function"},MIe=function(e){return typeof e.throwError=="function"};function LIe(e){var t={};if(yIe(e)){var n=function(M){return function(k){return e.map(k,M)}};t.map=n}if(bIe(e)){var r=function(M){return function(k){return e.contramap(k,M)}};t.contramap=r}if(CIe(e)){var i=function(M){return function(k){return e.mapWithIndex(k,M)}};t.mapWithIndex=i}if(SIe(e)){var o=function(M){return function(k){return e.ap(k,M)}},a=function(M){return function(k){return e.ap(e.map(k,function(q){return function(){return q}}),M)}};t.ap=o,t.apFirst=a,t.apSecond=function(M){return function(k){return e.ap(e.map(k,function(){return function(q){return q}}),M)}}}if(_Ie(e)){var s=function(M){return function(k){return e.chain(k,M)}},u=function(M){return function(k){return e.chain(k,function(q){return e.map(M(q),function(){return q})})}},c=function(M){return e.chain(M,eC.identity)};t.chain=s,t.chainFirst=u,t.flatten=c}if(IIe(e)){var l=function(M,k){return function(q){return e.bimap(q,M,k)}},d=function(M){return function(k){return e.mapLeft(k,M)}};t.bimap=l,t.mapLeft=d}if(TIe(e)){var p=function(M){return function(k){return e.extend(k,M)}},A=function(M){return e.extend(M,eC.identity)};t.extend=p,t.duplicate=A}if(xIe(e)){var m=function(M,k){return function(q){return e.reduce(q,M,k)}},v=function(M){var k=e.foldMap(M);return function(q){return function(ue){return k(ue,q)}}},_=function(M,k){return function(q){return e.reduceRight(q,M,k)}};t.reduce=m,t.foldMap=v,t.reduceRight=_}if(wIe(e)){var C=function(M,k){return function(q){return e.reduceWithIndex(q,M,k)}},I=function(M){var k=e.foldMapWithIndex(M);return function(q){return function(ue){return k(ue,q)}}},x=function(M,k){return function(q){return e.reduceRightWithIndex(q,M,k)}};t.reduceWithIndex=C,t.foldMapWithIndex=I,t.reduceRightWithIndex=x}if(EIe(e)){var g=function(M){return function(k){return e.alt(k,M)}};t.alt=g}if($Ie(e)&&(t.compact=e.compact,t.separate=e.separate),RIe(e)){var S=function(M){return function(k){return e.filter(k,M)}},y=function(M){return function(k){return e.filterMap(k,M)}},T=function(M){return function(k){return e.partition(k,M)}},w=function(M){return function(k){return e.partitionMap(k,M)}};t.filter=S,t.filterMap=y,t.partition=T,t.partitionMap=w}if(OIe(e)){var O=function(M){return function(k){return e.filterWithIndex(k,M)}},E=function(M){return function(k){return e.filterMapWithIndex(k,M)}},F=function(M){return function(k){return e.partitionWithIndex(k,M)}},W=function(M){return function(k){return e.partitionMapWithIndex(k,M)}};t.filterWithIndex=O,t.filterMapWithIndex=E,t.partitionWithIndex=F,t.partitionMapWithIndex=W}if(FIe(e)){var K=function(M,k){return function(q){return e.promap(q,M,k)}};t.promap=K}if(kIe(e)){var J=function(M){return function(k){return e.compose(k,M)}};t.compose=J}if(MIe(e)){var ee=function(M){return function(k){return k._tag==="None"?e.throwError(M()):e.of(k.value)}},re=function(M){return M._tag==="Left"?e.throwError(M.left):e.of(M.right)},P=function(M,k){return function(q){return M(q)?e.of(q):e.throwError(k(q))}},Y=function(M,k){return function(q){return e.chain(q,function(ue){return M(ue)?e.of(ue):e.throwError(k(ue))})}};t.fromOption=ee,t.fromEither=re,t.fromPredicate=P,t.filterOrElse=Y}return t}$u.pipeable=LIe;$u.pipe=eC.pipe;var jIe=me&&me.__createBinding||(Object.create?function(e,t,n,r){r===void 0&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]}),UIe=me&&me.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),BIe=me&&me.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)Object.hasOwnProperty.call(e,n)&&jIe(t,e,n);return UIe(t,e),t};Object.defineProperty(hd,"__esModule",{value:!0});hd.NumberFromString=void 0;var yd=BIe(Z),PIe=$u,WIe=ln;hd.NumberFromString=new yd.Type("NumberFromString",yd.number.is,function(e,t){return PIe.pipe(yd.string.validate(e,t),WIe.chain(function(n){var r=+n;return isNaN(r)||n.trim()===""?yd.failure(e,t):yd.success(r)}))},String);var DIe=me&&me.__createBinding||(Object.create?function(e,t,n,r){r===void 0&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]}),KIe=me&&me.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),NIe=me&&me.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)Object.hasOwnProperty.call(e,n)&&DIe(t,e,n);return KIe(t,e),t};Object.defineProperty(k0,"__esModule",{value:!0});k0.IntFromString=void 0;var bd=NIe(Z),JO=hd,qIe=$u,VIe=ln;k0.IntFromString=new bd.Type("IntFromString",bd.Int.is,function(e,t){return qIe.pipe(JO.NumberFromString.validate(e,t),VIe.chain(function(n){return bd.Int.is(n)?bd.success(n):bd.failure(e,t)}))},JO.NumberFromString.encode);Object.defineProperty(gh,"__esModule",{value:!0});const QIe=Q,zIe=ln,qo=(0,QIe.__importStar)(Z),HIe=k0,ZO=ft(),XO=new qo.Type("SideConstraints",e=>!e||typeof e=="number",(e,t)=>zIe.either.chain(qo.union([qo.literal("auto"),qo.literal(""),qo.Int,HIe.IntFromString,ZO.IntFromNumber,ZO.IntFromPixels,qo.null]).validate(e,t),n=>n==="auto"||n===""?qo.success(null):qo.success(n)),e=>e),YIe=qo.partial({width:XO,height:XO});gh.default=YIe;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Image=e.ImageConfig=e.Thumbnail=e.ImageFieldType=void 0;const t=Q,n=(0,t.__importStar)(Z),r=ft(),i=(0,t.__importDefault)(gh);e.ImageFieldType="Image",e.Thumbnail=n.exact(n.intersection([n.type({name:n.string}),i.default])),e.ImageConfig=n.exact(n.partial({label:r.StringOrNull,placeholder:n.string,constraint:i.default,thumbnails:n.readonlyArray(e.Thumbnail)})),e.Image=n.exact(n.intersection([n.type({type:n.literal(e.ImageFieldType)}),n.partial({fieldset:r.StringOrNull,config:e.ImageConfig})]))})(uR);var cR={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.IntegrationField=e.IntegrationFieldConfig=e.IntegrationFieldType=void 0;const n=(0,Q.__importStar)(Z),r=ft();e.IntegrationFieldType="IntegrationFields",e.IntegrationFieldConfig=n.exact(n.partial({label:r.StringOrNull,placeholder:n.string,catalog:n.string})),e.IntegrationField=n.exact(n.intersection([n.type({type:n.literal(e.IntegrationFieldType)}),n.partial({fieldset:r.StringOrNull,config:e.IntegrationFieldConfig})]))})(cR);var lR={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Link=e.LinkConfig=e.LinkFieldType=void 0;const t=Q,n=ln,r=(0,t.__importStar)(Z),i=pd,o=ft(),a=c=>{if(c instanceof Array&&c.reduce((d,p)=>d&&typeof p=="string",!0))return r.success(c)},s=c=>{if(typeof c=="string")return r.success([c])},u=new r.Type("MasksArrayString",c=>c instanceof Array,(c,l)=>n.either.chain(r.union([r.array(r.string),r.string]).validate(c,l),d=>a(d)||s(d)||r.failure(c,l)),c=>c);e.LinkFieldType="Link",e.LinkConfig=r.exact(r.partial({label:o.StringOrNull,useAsTitle:r.boolean,placeholder:r.string,select:(0,i.withFallback)(r.union([r.literal("media"),r.literal("document"),r.literal("web"),r.null]),null),customtypes:r.readonlyArray(r.string),masks:u,tags:u,allowTargetBlank:r.boolean,allowText:r.boolean})),e.Link=r.exact(r.intersection([r.type({type:r.literal(e.LinkFieldType)}),r.partial({fieldset:o.StringOrNull,config:e.LinkConfig})]))})(lR);var fR={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Number=e.NumberConfig=e.NumberFieldType=void 0;const n=(0,Q.__importStar)(Z),r=hd,i=ft();e.NumberFieldType="Number",e.NumberConfig=n.exact(n.partial({label:i.StringOrNull,placeholder:n.string,min:n.union([n.number,r.NumberFromString]),max:n.union([n.number,r.NumberFromString]),step:n.union([n.number,r.NumberFromString])})),e.Number=n.exact(n.intersection([n.type({type:n.literal(e.NumberFieldType)}),n.partial({fieldset:i.StringOrNull,config:e.NumberConfig})]))})(fR);var dR={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Range=e.RangeConfig=e.RangeFieldType=void 0;const n=(0,Q.__importStar)(Z),r=hd,i=ft();e.RangeFieldType="Range",e.RangeConfig=n.exact(n.partial({label:i.StringOrNull,placeholder:n.string,min:n.union([n.number,r.NumberFromString]),max:n.union([n.number,r.NumberFromString]),step:n.union([n.number,r.NumberFromString])})),e.Range=n.exact(n.intersection([n.type({type:n.literal(e.RangeFieldType)}),n.partial({fieldset:i.StringOrNull,config:e.RangeConfig})]))})(dR);var pR={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.RichText=e.RichTextConfig=e.RichTextNodeTypeCodec=e.RichTextNodeType=e.DEFAULT_OPTION=e.RichTextFieldType=void 0;const t=Q,n=lt,r=ln,i=Ge,o=(0,t.__importStar)(Z),a=ft(),s=(0,t.__importDefault)(gh);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=o.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});const u=new o.Type("RichTextOptions",m=>typeof m=="string",m=>(0,i.pipe)(o.union([o.string,o.null]).decode(m),n.either.map(v=>{if(!v)return e.DEFAULT_OPTION;const C=v.split(",").map(I=>I.trim()).filter(I=>(0,r.getOrElseW)(()=>{})(e.RichTextNodeTypeCodec.decode(I)));return C.length?C.join(","):e.DEFAULT_OPTION})),m=>m),c=m=>{if(!m)return o.success([])},l=m=>{if(m instanceof Object){const v=m;if(!Object.entries(v).length)return o.success([]);if(v[""])return o.success(v[""].map(C=>C.name));const _=Object.entries(v).reduce((C,[,I])=>C.concat(I.map(x=>x.name)),[]).filter(Boolean);return o.success(_)}},d=m=>{if(m instanceof Array&&m.reduce((_,C)=>_&&typeof C=="string",!0))return o.success(m)},p=m=>{if(typeof m=="string")return o.success([m])},A=new o.Type("RichTextLabels",m=>m instanceof Array,(m,v)=>{const _=o.record(o.string,o.readonlyArray(o.record(o.literal("name"),o.string))),C=o.readonlyArray(o.string);return(0,i.pipe)(o.union([_,C,o.string,o.null]).decode(m),n.either.chain(I=>c(I)||d(I)||l(I)||p(I)||o.failure(m,v)))},m=>m);e.RichTextConfig=o.exact(o.partial({label:a.StringOrNull,placeholder:o.string,useAsTitle:o.boolean,single:u,multi:u,imageConstraint:s.default,labels:A,allowTargetBlank:o.boolean})),e.RichText=o.exact(o.intersection([o.type({type:o.literal(e.RichTextFieldType)}),o.partial({fieldset:a.StringOrNull,config:e.RichTextConfig})]))})(pR);var AR={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Select=e.SelectConfig=e.SelectFieldType=void 0;const n=(0,Q.__importStar)(Z),r=ft();e.SelectFieldType="Select",e.SelectConfig=n.exact(n.partial({label:r.StringOrNull,placeholder:n.string,default_value:n.string,options:n.readonlyArray(n.union([n.string,r.StringFromNumber,r.StringFromBoolean]))})),e.Select=n.exact(n.intersection([n.type({type:n.literal(e.SelectFieldType)}),n.partial({fieldset:r.StringOrNull,config:e.SelectConfig})]))})(AR);var hR={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Separator=e.SeparatorConfig=e.SeparatorFieldType=void 0;const n=(0,Q.__importStar)(Z),r=ft();e.SeparatorFieldType="Separator",e.SeparatorConfig=n.exact(n.partial({label:r.StringOrNull})),e.Separator=n.exact(n.intersection([n.type({type:n.literal(e.SeparatorFieldType)}),n.partial({config:e.SeparatorConfig})]))})(hR);var mR={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Text=e.TextConfig=e.TextFieldType=void 0;const n=(0,Q.__importStar)(Z),r=ft();e.TextFieldType="Text",e.TextConfig=n.exact(n.partial({label:r.StringOrNull,useAsTitle:n.boolean,placeholder:n.string})),e.Text=n.exact(n.intersection([n.type({type:n.literal(e.TextFieldType)}),n.partial({fieldset:r.StringOrNull,config:e.TextConfig})]))})(mR);var gR={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Timestamp=e.TimestampConfig=e.TimestampFieldType=void 0;const n=(0,Q.__importStar)(Z),r=ft();e.TimestampFieldType="Timestamp",e.TimestampConfig=n.exact(n.partial({label:r.StringOrNull,placeholder:n.string,default:n.string})),e.Timestamp=n.exact(n.intersection([n.type({type:n.literal(e.TimestampFieldType)}),n.partial({fieldset:r.StringOrNull,config:e.TimestampConfig})]))})(gR);Object.defineProperty(qa,"__esModule",{value:!0});qa.NestableWidget=void 0;const GIe=Q,JIe=(0,GIe.__importStar)(Z),ZIe=rR,XIe=iR,eTe=oR,tTe=aR,nTe=sR,rTe=uR,iTe=cR,oTe=lR,aTe=fR,sTe=dR,uTe=pR,cTe=AR,lTe=hR,fTe=mR,dTe=gR;qa.NestableWidget=JIe.union([XIe.Color,ZIe.BooleanField,tTe.Embed,nTe.GeoPoint,eTe.Date,aTe.Number,sTe.Range,uTe.RichText,cTe.Select,lTe.Separator,fTe.Text,dTe.Timestamp,oTe.Link,rTe.Image,iTe.IntegrationField]);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Group=e.GroupConfig=e.NestedGroup=e.NestedGroupConfig=e.GroupFieldType=void 0;const n=(0,Q.__importStar)(Z),r=Lc,i=ft(),o=qa;e.GroupFieldType="Group";const a=u=>n.exact(n.partial({label:i.StringOrNull,repeat:n.boolean,fields:n.record(r.WidgetKey,u)})),s=u=>n.exact(n.intersection([n.type({type:n.literal(e.GroupFieldType)}),n.partial({fieldset:i.StringOrNull,icon:n.string,description:n.string,config:a(u)})]));e.NestedGroupConfig=a(o.NestableWidget),e.NestedGroup=s(o.NestableWidget),e.GroupConfig=a(n.union([o.NestableWidget,e.NestedGroup])),e.Group=s(n.union([o.NestableWidget,e.NestedGroup]))})(Ad);var vh={};(function(e){Object.defineProperty(e,"__esModule",{value:!0});const t=Q;(0,t.__exportStar)(rR,e),(0,t.__exportStar)(iR,e),(0,t.__exportStar)(oR,e),(0,t.__exportStar)(aR,e),(0,t.__exportStar)(sR,e),(0,t.__exportStar)(uR,e),(0,t.__exportStar)(cR,e),(0,t.__exportStar)(lR,e),(0,t.__exportStar)(qa,e),(0,t.__exportStar)(fR,e),(0,t.__exportStar)(dR,e),(0,t.__exportStar)(pR,e),(0,t.__exportStar)(AR,e),(0,t.__exportStar)(hR,e),(0,t.__exportStar)(mR,e),(0,t.__exportStar)(gR,e)})(vh);var vR={},M0={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.isCompositeSlice=e.CompositeSlice=e.CompositeSliceConfig=e.CompositeSliceType=void 0;const n=(0,Q.__importStar)(Z),r=Lc,i=ft(),o=qa;e.CompositeSliceType="Slice",e.CompositeSliceConfig=n.exact(n.partial({label:i.StringOrNull})),e.CompositeSlice=n.exact(n.intersection([n.type({type:n.literal(e.CompositeSliceType)}),n.partial({fieldset:i.StringOrNull,description:n.string,icon:n.string,display:n.string,"non-repeat":n.record(r.WidgetKey,o.NestableWidget),repeat:n.record(r.WidgetKey,o.NestableWidget),config:e.CompositeSliceConfig})]));function a(s){return s.type==="Slice"}e.isCompositeSlice=a})(M0);var Ru={};Object.defineProperty(Ru,"__esModule",{value:!0});Ru.isLegacySlice=Ru.LegacySlice=void 0;const pTe=Q,ATe=(0,pTe.__importStar)(Z),hTe=Ad,mTe=qa;Ru.LegacySlice=ATe.union([mTe.NestableWidget,hTe.NestedGroup]);function gTe(e){return e.type!=="Slice"&&e.type!=="SharedSlice"}Ru.isLegacySlice=gTe;var yh={},Ou={};Object.defineProperty(Ou,"__esModule",{value:!0});Ou.isSlicePrimaryWidget=Ou.SlicePrimaryWidget=void 0;const vTe=Q,yTe=(0,vTe.__importStar)(Z),G9=Ad,J9=vh;Ou.SlicePrimaryWidget=yTe.union([J9.NestableWidget,G9.Group]);const bTe=e=>J9.NestableWidget.is(e)||G9.Group.is(e);Ou.isSlicePrimaryWidget=bTe;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.isDynamicSharedSlice=e.isStaticSharedSlice=e.SharedSlice=e.SharedSliceType=e.Variation=void 0;const n=(0,Q.__importStar)(Z),r=pd,i=Lc,o=qa,a=Ou,s="https://images.prismic.io/slice-machine/621a5ec4-0387-4bc5-9860-2dd46cbc07cd_default_ss.png?auto=compress,format";e.Variation=n.exact(n.intersection([n.type({id:n.string,name:n.string,description:n.string,imageUrl:(0,r.withFallback)(n.string,s),docURL:n.string,version:n.string}),n.partial({display:n.string,primary:n.record(i.WidgetKey,a.SlicePrimaryWidget),items:n.record(i.WidgetKey,o.NestableWidget)})])),e.SharedSliceType="SharedSlice";const u=n.string,c=n.string;e.SharedSlice=n.exact(n.intersection([n.type({id:n.string,type:n.literal(e.SharedSliceType),name:n.string,variations:n.readonlyArray(e.Variation)}),n.partial({description:n.string,legacyPaths:n.record(u,c)})]));function l(p){return p.type==="SharedSlice"}e.isStaticSharedSlice=l;function d(p){return p.type==="SharedSlice"}e.isDynamicSharedSlice=d})(yh);var bh={};Object.defineProperty(bh,"__esModule",{value:!0});bh.SharedSliceRef=void 0;const CTe=Q,mb=(0,CTe.__importStar)(Z),STe=yh;bh.SharedSliceRef=mb.exact(mb.type({type:mb.literal(STe.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;const n=(0,Q.__importStar)(Z),r=Lc,i=ft(),o=M0,a=Ru,s=yh,u=bh;e.LegacySlicesFieldType="Choice",e.SlicesFieldType="Slices",e.SlicesLabels=n.union([n.record(n.string,n.readonlyArray(n.exact(n.intersection([n.type({name:n.string}),n.partial({display:n.string})])))),n.null]);function c(p){return n.exact(n.partial({label:i.StringOrNull,labels:e.SlicesLabels,choices:n.record(r.WidgetKey,n.union([a.LegacySlice,o.CompositeSlice,p]))}))}e.slicesConfigReader=c,e.StaticSlicesConfig=c(s.SharedSlice),e.DynamicSlicesConfig=c(u.SharedSliceRef);const l={toStatic(p,A){const m=Object.entries(p.choices||{}).reduce((v,[_,C])=>{if(C.type==="SharedSlice"){const I=A.get(_);return I?{...v,[_]:I}:v}else return{...v,[_]:C}},{});return{...p,choices:m}}};function d(p){return n.exact(n.intersection([n.type({type:n.keyof({[e.SlicesFieldType]:null,[e.LegacySlicesFieldType]:null})}),n.partial({fieldset:i.StringOrNull,config:p})]))}e.slicesReader=d,e.StaticSlices=d(e.StaticSlicesConfig),e.DynamicSlices=d(e.DynamicSlicesConfig),e.Slices={toStatic(p,A){return p.config?{...p,config:l.toStatic(p.config,A)}:p}}})(vR);var yR={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.UID=e.UIDConfig=e.UIDFieldType=void 0;const n=(0,Q.__importStar)(Z),r=ft();e.UIDFieldType="UID",e.UIDConfig=n.exact(n.partial({label:r.StringOrNull,useAsTitle:n.boolean,placeholder:n.string})),e.UID=n.exact(n.intersection([n.type({type:n.literal(e.UIDFieldType)}),n.partial({fieldset:r.StringOrNull,config:e.UIDConfig})]))})(yR);Object.defineProperty(wr,"__esModule",{value:!0});wr.Widgets=wr.FieldType=wr.DynamicWidget=wr.StaticWidget=wr.widgetReader=void 0;const _Te=Q,Z9=(0,_Te.__importStar)(Z),X9=Ad,Nn=vh,ITe=qa,np=vR,eq=yR;function bR(e){return Z9.union([eq.UID,ITe.NestableWidget,X9.Group,e])}wr.widgetReader=bR;wr.StaticWidget=bR(np.StaticSlices);wr.DynamicWidget=bR(np.DynamicSlices);wr.FieldType=Z9.keyof({[Nn.ColorFieldType]:null,[Nn.BooleanFieldType]:null,[Nn.NumberFieldType]:null,[Nn.EmbedFieldType]:null,[Nn.GeoPointFieldType]:null,[Nn.DateFieldType]:null,[Nn.RangeFieldType]:null,[Nn.RichTextFieldType]:null,[Nn.SelectFieldType]:null,[Nn.SeparatorFieldType]:null,[Nn.TextFieldType]:null,[Nn.TimestampFieldType]:null,[Nn.LinkFieldType]:null,[Nn.ImageFieldType]:null,[Nn.IntegrationFieldType]:null,[eq.UIDFieldType]:null,[X9.GroupFieldType]:null,[np.SlicesFieldType]:null,[np.LegacySlicesFieldType]:null});wr.Widgets={toStatic(e,t){switch(e.type){case"Choice":case"Slices":return np.Slices.toStatic(e,t);default:return e}}};Object.defineProperty(Ti,"__esModule",{value:!0});Ti.Sections=Ti.DynamicSection=Ti.StaticSection=Ti.sectionReader=void 0;const TTe=Q,xTe=(0,TTe.__importStar)(Z),wTe=Lc,CR=wr;function SR(e){return xTe.record(wTe.WidgetKey,e)}Ti.sectionReader=SR;Ti.StaticSection=SR(CR.StaticWidget);Ti.DynamicSection=SR(CR.DynamicWidget);Ti.Sections={toStatic(e,t){return Object.entries(e).reduce((r,[i,o])=>({...r,[i]:CR.Widgets.toStatic(o,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;const t=Q,n=ln,r=(0,t.__importStar)(Z),i=pd,o=ft(),a=Ti;e.CustomTypeFormat={page:"page",custom:"custom"};class s extends Error{constructor(g){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=g,this.message=this._formatError(g)}_formatError(g){return`The following slices doesn't exists in your Prismic repository:
30
30
  ${g.map(y=>` - ${y}`).join(`
31
31
  `)}
32
- `}}function u(x){return r.exact(r.intersection([r.type({id:r.string,label:o.StringOrNull,repeatable:(0,i.withFallback)(r.boolean,!0),json:r.record(r.string,x),status:(0,i.withFallback)(r.boolean,!0)}),r.partial({format:(0,i.withFallback)(r.keyof(e.CustomTypeFormat),"custom")})]))}e.StaticCustomType=u(a.StaticSection),e.CustomType=u(a.DynamicSection);function c(x){return Object.entries(x.json).reduce((g,[,S])=>{const y=Object.entries(S);return g.concat(y)},[])}e.flattenWidgets=c;function l(x){return Object.entries(x.json).reduce((g,[,S])=>{const y=Object.entries(S);return g.concat(y)},[])}e.flattenSections=l;function d(x){return c(x).filter(([,y])=>y.type==="Slices").reduce((y,[,T])=>{const w=Object.entries(T.config&&T.config.choices?T.config.choices:{}).filter(([,O])=>O.type==="SharedSlice").map(([O])=>O);return y.concat(w)},[])}function p(x){const g=d(x);return function(S){return g.map(S)}}function A(x,g){const S=Object.entries(x.json).reduce((y,[T,w])=>({...y,[T]:a.Sections.toStatic(w,g)}),{});return{...x,json:S}}e.toStatic=A;function m(x,g){const S=p(x)(y=>{if(!g.get(y))return y}).filter(Boolean);return S.length>0?(0,n.left)(new s(S)):(0,n.right)(x)}e.validateSlices=m;function v(x,g){const S=Object.entries(x.json).reduce((y,[T,w])=>{const O=Object.entries(w).reduce((E,[F,W])=>{const K=g(F,W);return K?{...E,[F]:K}:E},{});return{...y,[T]:O}},{});return{...x,json:S}}e.collectWidgets=v;function _(x,g){return v(x,(S,y)=>{if(y.type==="Slices"){if(!y.config||!y.config.choices)return y;const T=Object.entries(y.config.choices).reduce((O,[E,F])=>F.type==="SharedSlice"&&!g.get(E)?O:{...O,[E]:F},{}),w={...y.config,choices:T};return{...y,config:w}}return y})}e.filterMissingSharedSlices=_;function C(x){return Object.values(x.json).reduce((g,S)=>({...g,...S}),{})}e.flattenCustomTypeFields=C;function I(x){return Object.entries(x.fields).reduce((g,[,S])=>{var y;return S.type==="Slices"||S.type==="Choice"?{...g,...Object.entries(((y=S.config)===null||y===void 0?void 0:y.choices)||{}).reduce((T,[w,O])=>O.type==="SharedSlice"?{...T,[w]:O}:T,{})}:g},{})}e.collectSharedSlices=I})(H9);var tq={},L0={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.DiffOperation=void 0,function(t){t.Added="added",t.Removed="removed",t.Updated="updated"}(e.DiffOperation||(e.DiffOperation={}))})(L0);var j0={},Xo={},U0={};Object.defineProperty(U0,"__esModule",{value:!0});U0.HexaColor=void 0;const ETe=/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/;U0.HexaColor={is:e=>ETe.test(e)};var B0={};Object.defineProperty(B0,"__esModule",{value:!0});B0.toRecord=void 0;function $Te(e,t){return e.reduce((n,r)=>{const i=t(r);return{...n,[i]:r}},{})}B0.toRecord=$Te;var Er={};Object.defineProperty(Er,"__esModule",{value:!0});Er.mapValues=Er.isObject=Er.withOptionals=Er.isNotEmpty=Er.zipObjects=void 0;const RTe=Q,OTe=ln,gb=(0,RTe.__importStar)(Z);function FTe(e,t){return[...new Set(Object.keys(e||{}).concat(Object.keys(t||{})))].reduce((r,i)=>{const o=e==null?void 0:e[i],a=t==null?void 0:t[i];return{...r,[i]:{left:o,right:a}}},{})}Er.zipObjects=FTe;function kTe(e){return!!Object.keys(e).length}Er.isNotEmpty=kTe;function MTe(e,t){return{...e,...t.reduce((n,[r,i])=>i?{...n,[r]:i}:n,{})}}Er.withOptionals=MTe;const LTe=gb.record(gb.string,gb.unknown);function jTe(e){return(0,OTe.isRight)(LTe.decode(e))}Er.isObject=jTe;function UTe(e,t){return Object.entries(e).reduce((n,[r,i])=>({...n,[r]:t(i,r)}),{})}Er.mapValues=UTe;Object.defineProperty(Xo,"__esModule",{value:!0});Xo.Objects=Xo.Arrays=Xo.HexaColorCode=void 0;const _R=Q;Xo.HexaColorCode=(0,_R.__importStar)(U0);Xo.Arrays=(0,_R.__importStar)(B0);Xo.Objects=(0,_R.__importStar)(Er);var Ch={};Object.defineProperty(Ch,"__esModule",{value:!0});Ch.VariationComparator=void 0;const wm=Xo,vb=Ad,Za=L0;function BTe(e,t){const n=wm.Objects.zipObjects(e,t);return Object.entries(n).reduce((r,[i,o])=>i==="primary"||i==="items"||(o==null?void 0:o.left)===(o==null?void 0:o.right)?r:{...r,[i]:o==null?void 0:o.right},{})}function Em(e,t){const n=wm.Objects.zipObjects(e,t),r=Object.entries(n).reduce((i,[o,a])=>{if(JSON.stringify(a==null?void 0:a.left)===JSON.stringify(a==null?void 0:a.right))return i;const s=(()=>{var u,c,l,d,p,A,m;if(!(!(a!=null&&a.left)&&!(a!=null&&a.right))){if(a!=null&&a.left&&!a.right)return{op:Za.DiffOperation.Removed};if(!(a!=null&&a.left)&&(a!=null&&a.right)){if(((u=a.right)===null||u===void 0?void 0:u.type)===vb.GroupFieldType){const v={...a.right,config:{...a.right.config,fields:{}}};return v.config.fields=Em(void 0,(c=a.right.config)===null||c===void 0?void 0:c.fields)||{},{op:Za.DiffOperation.Added,value:v}}return{op:Za.DiffOperation.Added,value:a.right}}if(((l=a.right)===null||l===void 0?void 0:l.type)===vb.GroupFieldType){const v={...a.right,config:{...a.right.config,fields:{}}};return v.config.fields=Em(((d=a.left)===null||d===void 0?void 0:d.type)===vb.GroupFieldType?(A=(p=a.left)===null||p===void 0?void 0:p.config)===null||A===void 0?void 0:A.fields:void 0,(m=a.right.config)===null||m===void 0?void 0:m.fields)||{},{op:Za.DiffOperation.Updated,value:v}}return{op:Za.DiffOperation.Updated,value:a.right}}})();return s?{...i,[o]:s}:i},{});return wm.Objects.isNotEmpty(r)?r:void 0}Ch.VariationComparator={compare(e,t){if(e&&!t)return{op:Za.DiffOperation.Removed};if(!e&&t)return{op:Za.DiffOperation.Added,value:t};const n=BTe(e,t),r=Em(e==null?void 0:e.primary,t==null?void 0:t.primary),i=Em(e==null?void 0:e.items,t==null?void 0:t.items),o={...n,...r?{primary:r}:{},...i?{items:i}:{}};if(wm.Objects.isNotEmpty(o))return{op:Za.DiffOperation.Updated,value:o}}};Object.defineProperty(j0,"__esModule",{value:!0});j0.SliceComparator=void 0;const nl=Xo,yb=L0,PTe=Ch;function WTe(e,t){const n=nl.Objects.zipObjects(e,t);return Object.entries(n).reduce((r,[i,o])=>i==="variations"||(o==null?void 0:o.left)===(o==null?void 0:o.right)?r:{...r,[i]:o==null?void 0:o.right},{})}j0.SliceComparator={compare(e,t){if(!e&&t)return{op:yb.DiffOperation.Added,value:t};if(e&&!t)return{op:yb.DiffOperation.Removed};const n=WTe(e,t),r=nl.Objects.zipObjects(e&&nl.Arrays.toRecord(e.variations,a=>a.id),t&&nl.Arrays.toRecord(t.variations,a=>a.id)),i=Object.entries(r).reduce((a,[s,u])=>{if(!u)return a;const c=PTe.VariationComparator.compare(u.left,u.right);return c?{...a,[s]:c}:a},{}),o={...n,...nl.Objects.isNotEmpty(i)?{variations:i}:{}};if(nl.Objects.isNotEmpty(o))return{op:yb.DiffOperation.Updated,value:o}}};var nq={};Object.defineProperty(nq,"__esModule",{value:!0});(function(e){Object.defineProperty(e,"__esModule",{value:!0});const t=Q;(0,t.__exportStar)(L0,e),(0,t.__exportStar)(j0,e),(0,t.__exportStar)(Ch,e),(0,t.__exportStar)(nq,e)})(tq);var Mo={},rq={};(function(e){var t=me&&me.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(e,"__esModule",{value:!0}),e.ImageConstraint=void 0;var n=gh;Object.defineProperty(e,"ImageConstraint",{enumerable:!0,get:function(){return t(n).default}})})(rq);var iq={},oq={};Object.defineProperty(oq,"__esModule",{value:!0});var P0={};Object.defineProperty(P0,"__esModule",{value:!0});P0.SlicesTypes=void 0;const DTe=Q,KTe=(0,DTe.__importStar)(Z),NTe=M0,qTe=yh;P0.SlicesTypes=KTe.keyof({[NTe.CompositeSliceType]:null,[qTe.SharedSliceType]:null});(function(e){Object.defineProperty(e,"__esModule",{value:!0});const t=Q;(0,t.__exportStar)(M0,e),(0,t.__exportStar)(Ru,e),(0,t.__exportStar)(yh,e),(0,t.__exportStar)(bh,e),(0,t.__exportStar)(oq,e),(0,t.__exportStar)(Ou,e),(0,t.__exportStar)(vR,e),(0,t.__exportStar)(P0,e)})(iq);(function(e){Object.defineProperty(e,"__esModule",{value:!0});const t=Q;(0,t.__exportStar)(Ad,e),(0,t.__exportStar)(vh,e),(0,t.__exportStar)(rq,e),(0,t.__exportStar)(iq,e),(0,t.__exportStar)(yR,e),(0,t.__exportStar)(wr,e)})(Mo);(function(e){Object.defineProperty(e,"__esModule",{value:!0});const t=Q;(0,t.__exportStar)(H9,e),(0,t.__exportStar)(tq,e),(0,t.__exportStar)(Ti,e),(0,t.__exportStar)(Mo,e)})(fe);var bb={},Cb={},Xs={},eF;function Pt(){if(eF)return Xs;eF=1,Object.defineProperty(Xs,"__esModule",{value:!0}),Xs.hasContentType=Xs.hasFieldContentType=void 0;const e=ln,t=ER();function n(i){var o;return r(i)&&i.__TYPE__===t.FieldContentType&&((o=i)===null||o===void 0?void 0:o.type)!==void 0&&typeof i.type=="string"&&(0,e.isRight)(t.FieldType.decode(i.type))}Xs.hasFieldContentType=n;function r(i){return typeof i=="object"&&i!==null&&"__TYPE__"in i}return Xs.hasContentType=r,Xs}var tF;function aq(){return tF||(tF=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.EmptyContent=e.EmptyLegacy=e.isEmptyContent=e.EmptyContentType=void 0;const t=Q,n=lt,r=Ge,i=(0,t.__importStar)(Z),o=Pt();e.EmptyContentType="EmptyContent";const a=c=>(0,o.hasContentType)(c)&&c.__TYPE__===e.EmptyContentType;e.isEmptyContent=a;const s=i.union([i.null,i.type({value:i.null})]),u=c=>new i.Type("EmptyLegacy",e.isEmptyContent,l=>(0,r.pipe)(s.decode(l),n.either.map(()=>({type:c,__TYPE__:e.EmptyContentType}))),()=>null);e.EmptyLegacy=u,e.EmptyContent=i.strict({type:i.string,__TYPE__:i.literal(e.EmptyContentType)})}(Cb)),Cb}var Sb={},Qn={};Object.defineProperty(Qn,"__esModule",{value:!0});Qn.defaultCtx=Qn.getFieldCtx=Qn.LegacyContentCtx=Qn.FieldOrSliceType=void 0;const VTe=Q,QTe=(0,VTe.__importStar)(Z),nF=Mo;Qn.FieldOrSliceType=QTe.union([nF.FieldType,nF.SlicesTypes]);class IR{constructor(t,n,r){Object.defineProperty(this,"fieldKey",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"prefixedKey",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"keyOfType",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"fieldPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"fieldType",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"allTypes",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.fieldKey=t,this.fieldPath=n||[],this.allTypes=r||new Map;const i=Array.of(this.fieldPath,[this.fieldKey]).flat().join(".");this.prefixedKey=i,this.keyOfType=`${i}_TYPE`,this.fieldType=this.allTypes.get(this.prefixedKey)}}Qn.LegacyContentCtx=IR;function zTe(e,t,n){return new IR(e,[...t.fieldPath,t.fieldKey,...n||[]],t.allTypes)}Qn.getFieldCtx=zTe;function HTe(e,t=new Map){return new IR(e,[],t)}Qn.defaultCtx=HTe;var _b={},Ib={},rF;function sq(){return rF||(rF=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.BooleanContentDefaultValue=e.BooleanContent=e.BooleanLegacy=e.isBooleanContent=e.BooleanContentType=void 0;const t=Q,n=lt,r=Ge,i=(0,t.__importStar)(Z),o=Pt();e.BooleanContentType="BooleanContent";const a=c=>(0,o.hasContentType)(c)&&c.__TYPE__===e.BooleanContentType;e.isBooleanContent=a;const s=c=>new i.Type("BooleanLegacy",e.isBooleanContent,l=>(0,r.pipe)(i.boolean.decode(l),n.either.map(d=>e.BooleanContent.encode({value:d,__TYPE__:e.BooleanContentType}))),l=>({content:l.value,types:{[c.keyOfType]:"Boolean"}}));e.BooleanLegacy=s,e.BooleanContent=i.strict({__TYPE__:i.literal(e.BooleanContentType),value:i.boolean});const u=c=>{var l;return((l=c.config)===null||l===void 0?void 0:l.default_value)!==void 0?{__TYPE__:e.BooleanContentType,value:c.config.default_value||!1}:void 0};e.BooleanContentDefaultValue=u}(Ib)),Ib}var Tb={},iF;function TR(){return iF||(iF=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.EmbedContent=e.EmbedLegacy=e.EmbedContentLegacy=e.isEmbedContent=e.EmbedContentType=void 0;const t=Q,n=lt,r=Ge,i=(0,t.__importStar)(Z),o=ft(),a=Pt();e.EmbedContentType="EmbedContent";const s=c=>(0,a.hasContentType)(c)&&c.__TYPE__===e.EmbedContentType;e.isEmbedContent=s,e.EmbedContentLegacy=i.exact(i.intersection([i.type({embed_url:i.string,type:i.string}),i.partial({version:i.union([i.string,i.number,i.null]),title:o.StringOrNull,author_name:o.StringOrNull,author_url:o.StringOrNull,provider_name:o.StringOrNull,provider_url:o.StringOrNull,cache_age:i.union([i.string,i.number,i.null]),thumbnail_url:o.StringOrNull,thumbnail_width:o.NumberOrNull,thumbnail_height:o.NumberOrNull,html:o.StringOrNull})]));const u=c=>new i.Type("EmbedLegacy",e.isEmbedContent,l=>(0,r.pipe)(e.EmbedContentLegacy.decode(l),n.either.map(d=>({...d,all:l,__TYPE__:e.EmbedContentType}))),l=>({content:l.all,types:{[c.keyOfType]:"Embed"}}));e.EmbedLegacy=u,e.EmbedContent=i.intersection([e.EmbedContentLegacy,i.strict({__TYPE__:i.literal(e.EmbedContentType),all:i.unknown})])}(Tb)),Tb}var xb={},wb={},Va={};Object.defineProperty(Va,"__esModule",{value:!0});const YTe=Q,GTe=Na,JTe=Xi,Dh=(0,YTe.__importStar)(Z);function ZTe(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)}Va.default=new Dh.Type("TrimmedString",Dh.string.is,(e,t)=>(0,JTe.pipe)(Dh.string.validate(e,t),(0,GTe.chain)(n=>Dh.success(ZTe(n)))),e=>e);var hi={};Object.defineProperty(hi,"__esModule",{value:!0});hi.FieldContentType=void 0;hi.FieldContentType="FieldContent";var oF;function aF(){return oF||(oF=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ColorContent=e.ColorLegacy=e.isColorContent=void 0;const t=Q,n=lt,r=Ge,i=(0,t.__importStar)(Z),o=Mo,a=(0,t.__importDefault)(Va),s=Pt(),u=hi,c=d=>(0,s.hasContentType)(d)&&d.__TYPE__===u.FieldContentType&&(0,s.hasFieldContentType)(d)&&d.type==="Color";e.isColorContent=c;const l=d=>new i.Type("ColorLegacy",e.isColorContent,p=>(0,r.pipe)(a.default.decode(p),n.either.map(A=>e.ColorContent.encode({value:A,type:o.ColorFieldType,__TYPE__:u.FieldContentType}))),p=>({content:p.value,types:{[d.keyOfType]:o.ColorFieldType}}));e.ColorLegacy=l,e.ColorContent=i.strict({type:i.literal(o.ColorFieldType),value:a.default,__TYPE__:i.literal(u.FieldContentType)})}(wb)),wb}var Eb={},sF;function uF(){return sF||(sF=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.DateContent=e.DateLegacy=e.isDateContent=void 0;const t=Q,n=lt,r=Ge,i=(0,t.__importStar)(Z),o=Mo,a=(0,t.__importDefault)(Va),s=Pt(),u=hi,c=d=>(0,s.hasContentType)(d)&&d.__TYPE__===u.FieldContentType&&(0,s.hasFieldContentType)(d)&&d.type==="Date";e.isDateContent=c;const l=d=>new i.Type("DateLegacy",e.isDateContent,p=>(0,r.pipe)(a.default.decode(p),n.either.map(A=>e.DateContent.encode({value:A,type:o.DateFieldType,__TYPE__:u.FieldContentType}))),p=>({content:p.value,types:{[d.keyOfType]:o.DateFieldType}}));e.DateLegacy=l,e.DateContent=i.strict({type:i.literal(o.DateFieldType),value:a.default,__TYPE__:i.literal(u.FieldContentType)})}(Eb)),Eb}var $b={},cF;function lF(){return cF||(cF=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.NumberContent=e.NumberLegacy=e.isNumberContent=void 0;const t=Q,n=lt,r=Ge,i=(0,t.__importStar)(Z),o=Mo,a=(0,t.__importDefault)(Va),s=Pt(),u=hi,c=d=>(0,s.hasContentType)(d)&&d.__TYPE__===u.FieldContentType&&(0,s.hasFieldContentType)(d)&&d.type==="Number";e.isNumberContent=c;const l=d=>new i.Type("NumberLegacy",e.isNumberContent,p=>(0,r.pipe)(a.default.decode(p),n.either.map(A=>e.NumberContent.encode({value:A,type:o.NumberFieldType,__TYPE__:u.FieldContentType}))),p=>({content:p.value,types:{[d.keyOfType]:o.NumberFieldType}}));e.NumberLegacy=l,e.NumberContent=i.strict({type:i.literal(o.NumberFieldType),value:a.default,__TYPE__:i.literal(u.FieldContentType)})}($b)),$b}var Rb={},fF;function dF(){return fF||(fF=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.RangeContent=e.RangeLegacy=e.isRangeContent=void 0;const t=Q,n=lt,r=Ge,i=(0,t.__importStar)(Z),o=Mo,a=(0,t.__importDefault)(Va),s=Pt(),u=hi,c=d=>(0,s.hasContentType)(d)&&d.__TYPE__===u.FieldContentType&&(0,s.hasFieldContentType)(d)&&d.type==="Range";e.isRangeContent=c;const l=d=>new i.Type("RangeLegacy",e.isRangeContent,p=>(0,r.pipe)(a.default.decode(p),n.either.map(A=>e.RangeContent.encode({value:A,type:o.RangeFieldType,__TYPE__:u.FieldContentType}))),p=>({content:p.value,types:{[d.keyOfType]:o.RangeFieldType}}));e.RangeLegacy=l,e.RangeContent=i.strict({type:i.literal(o.RangeFieldType),value:a.default,__TYPE__:i.literal(u.FieldContentType)})}(Rb)),Rb}var Ob={},pF;function AF(){return pF||(pF=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.SelectContentDefaultValue=e.SelectContent=e.SelectLegacy=e.isSelectContent=void 0;const t=Q,n=lt,r=Ge,i=(0,t.__importStar)(Z),o=Mo,a=(0,t.__importDefault)(Va),s=Pt(),u=hi,c=p=>(0,s.hasContentType)(p)&&p.__TYPE__===u.FieldContentType&&(0,s.hasFieldContentType)(p)&&p.type==="Select";e.isSelectContent=c;const l=p=>new i.Type("SelectLegacy",e.isSelectContent,A=>(0,r.pipe)(a.default.decode(A),n.either.map(m=>e.SelectContent.encode({value:m,type:o.SelectFieldType,__TYPE__:u.FieldContentType}))),A=>({content:A.value,types:{[p.keyOfType]:o.SelectFieldType}}));e.SelectLegacy=l,e.SelectContent=i.strict({type:i.literal(o.SelectFieldType),value:a.default,__TYPE__:i.literal(u.FieldContentType)});const d=p=>{var A;return!((A=p.config)===null||A===void 0)&&A.default_value?{__TYPE__:u.FieldContentType,type:o.SelectFieldType,value:p.config.default_value||""}:void 0};e.SelectContentDefaultValue=d}(Ob)),Ob}var Fb={},hF;function mF(){return hF||(hF=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.TextContent=e.TextLegacy=e.isTextContent=void 0;const t=Q,n=lt,r=Ge,i=(0,t.__importStar)(Z),o=Mo,a=(0,t.__importDefault)(Va),s=Pt(),u=hi,c=d=>(0,s.hasContentType)(d)&&d.__TYPE__===u.FieldContentType&&(0,s.hasFieldContentType)(d)&&d.type==="Text";e.isTextContent=c;const l=d=>new i.Type("TextLegacy",e.isTextContent,p=>(0,r.pipe)(a.default.decode(p),n.either.map(A=>e.TextContent.encode({value:A,type:o.TextFieldType,__TYPE__:u.FieldContentType}))),p=>({content:p.value,types:{[d.keyOfType]:o.TextFieldType}}));e.TextLegacy=l,e.TextContent=i.strict({type:i.literal(o.TextFieldType),value:a.default,__TYPE__:i.literal(u.FieldContentType)})}(Fb)),Fb}var kb={},gF;function vF(){return gF||(gF=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.TimestampContent=e.TimestampLegacy=e.isTimestampContent=void 0;const t=Q,n=lt,r=Ge,i=(0,t.__importStar)(Z),o=Mo,a=(0,t.__importDefault)(Va),s=Pt(),u=hi,c=d=>(0,s.hasContentType)(d)&&d.__TYPE__===u.FieldContentType&&(0,s.hasFieldContentType)(d)&&d.type==="Timestamp";e.isTimestampContent=c;const l=d=>new i.Type("TimestampLegacy",e.isTimestampContent,p=>(0,r.pipe)(a.default.decode(p),n.either.map(A=>e.TimestampContent.encode({value:A,type:o.TimestampFieldType,__TYPE__:u.FieldContentType}))),p=>({content:p.value,types:{[d.keyOfType]:o.TimestampFieldType}}));e.TimestampLegacy=l,e.TimestampContent=i.strict({type:i.literal(o.TimestampFieldType),value:a.default,__TYPE__:i.literal(u.FieldContentType)})}(kb)),kb}var yF;function uq(){return yF||(yF=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.FieldContent=e.FieldType=void 0;const t=Q,n=(0,t.__importStar)(Z),r=aF(),i=uF(),o=lF(),a=dF(),s=AF(),u=mF(),c=vF();e.FieldType=n.keyof({Text:null,Date:null,Timestamp:null,Color:null,Number:null,Range:null,Select:null}),e.FieldContent=n.union([i.DateContent,r.ColorContent,o.NumberContent,a.RangeContent,s.SelectContent,u.TextContent,c.TimestampContent]),(0,t.__exportStar)(aF(),e),(0,t.__exportStar)(hi,e),(0,t.__exportStar)(uF(),e),(0,t.__exportStar)(lF(),e),(0,t.__exportStar)(dF(),e),(0,t.__exportStar)(AF(),e),(0,t.__exportStar)(mF(),e),(0,t.__exportStar)(vF(),e)}(xb)),xb}var Mb={},bF;function cq(){return bF||(bF=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.GeoPointContent=e.GeoPointLegacy=e.isGeoPointContent=e.GeoPointContentType=void 0;const t=Q,n=lt,r=Xi,i=(0,t.__importStar)(Z),o=Pt();e.GeoPointContentType="GeoPointContent";const a=c=>(0,o.hasContentType)(c)&&c.__TYPE__===e.GeoPointContentType;e.isGeoPointContent=a;const s=i.strict({position:i.strict({lat:i.number,lng:i.number})}),u=c=>new i.Type("GeoPointLegacy",e.isGeoPointContent,l=>(0,r.pipe)(s.decode(l),n.either.map(d=>e.GeoPointContent.encode({...d,__TYPE__:e.GeoPointContentType}))),l=>({content:{position:l.position},types:{[c.keyOfType]:"GeoPoint"}}));e.GeoPointLegacy=u,e.GeoPointContent=i.intersection([s,i.strict({__TYPE__:i.literal(e.GeoPointContentType)})])}(Mb)),Mb}var Lb={},CF;function xR(){return CF||(CF=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ImageContent=e.ImageLegacy=e.ImageContentView=e.isImageContent=e.ImageContentType=void 0;const t=Q,n=lt,r=Ge,i=(0,t.__importStar)(Z),o=Er,a=ft(),s=Pt();e.ImageContentType="ImageContent";const u=p=>(0,s.hasContentType)(p)&&p.__TYPE__===e.ImageContentType;e.isImageContent=u;const c=i.exact(i.type({id:i.string,url:i.string,width:i.number,height:i.number}));e.ImageContentView=i.exact(i.intersection([i.type({origin:c,width:i.number,height:i.number,edit:i.type({zoom:i.number,crop:i.type({x:i.number,y:i.number}),background:i.string})}),i.partial({url:i.string,credits:a.NonEmptyStringOrNull,alt:a.NonEmptyStringOrNull,provider:a.StringOrNull})]));const l=i.intersection([e.ImageContentView,i.partial({thumbnails:i.record(i.string,e.ImageContentView)})]),d=p=>new i.Type("ImageLegacy",e.isImageContent,A=>(0,r.pipe)(l.decode(A),n.either.map(m=>e.ImageContent.encode({...m,__TYPE__:e.ImageContentType}))),A=>({content:(0,o.withOptionals)({edit:A.edit,height:A.height,origin:A.origin,width:A.width},[["alt",A.alt],["credits",A.credits],["provider",A.provider],["thumbnails",A.thumbnails],["url",A.url]]),types:{[p.keyOfType]:"Image"}}));e.ImageLegacy=d,e.ImageContent=i.intersection([l,i.strict({__TYPE__:i.literal(e.ImageContentType)})])}(Lb)),Lb}var jb={},SF;function lq(){return SF||(SF=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.IntegrationFieldContent=e.IntegrationFieldLegacy=e.isIntegrationFieldContent=e.IntegrationFieldContentType=void 0;const t=Q,n=lt,r=Ge,i=(0,t.__importStar)(Z),o=Pt();e.IntegrationFieldContentType="IntegrationFieldsContent";const a=u=>(0,o.hasContentType)(u)&&u.__TYPE__===e.IntegrationFieldContentType;e.isIntegrationFieldContent=a;const s=u=>new i.Type("IntegrationFieldLegacy",e.isIntegrationFieldContent,c=>(0,r.pipe)(i.string.decode(c),n.either.map(l=>e.IntegrationFieldContent.encode({value:l,__TYPE__:e.IntegrationFieldContentType}))),c=>({content:c.value,types:{[u.keyOfType]:"IntegrationFields"}}));e.IntegrationFieldLegacy=s,e.IntegrationFieldContent=i.strict({__TYPE__:i.literal(e.IntegrationFieldContentType),value:i.string})}(jb)),jb}var Ub={},_F;function wR(){return _F||(_F=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.FilledLinkContent=e.FilledLink=e.FilledLinkContentLegacy=e.FilledLinkLegacy=e.isFilledLinkContent=e.LinkContent=e.Link=e.LinkContentLegacy=e.LinkLegacy=e.isLinkContent=e.LinkContentType=e.AnyLinkContent=e.AnyLinkType=e.ExternalLinkContent=e.FilledExternalLinkContent=e.ExternalLinkType=e.DocumentLinkContent=e.FilledDocumentLinkContent=e.DocumentLinkType=e.MediaLinkContent=e.MediaLinkType=e.FileLinkContent=e.FilledFileLinkContent=e.FileLinkType=e.ImageLinkContent=e.FilledImageLinkContent=e.ImageLinkType=void 0;const t=Q,n=lt,r=Ge,i=(0,t.__importStar)(Z),o=$0,a=ft(),s=Xe,u=Pt();e.ImageLinkType="ImageLink";const c=i.intersection([i.strict({kind:i.string,id:i.string,url:i.string,height:i.string,width:i.string,size:i.string,name:i.string}),i.exact(i.partial({date:a.StringOrNull}))]),l=new i.Type("FilledImageLink",P=>(0,u.hasContentType)(P)&&P.__TYPE__===e.ImageLinkType,P=>(0,r.pipe)(c.decode(P),n.either.map(Y=>e.FilledImageLinkContent.encode({...Y,__TYPE__:e.ImageLinkType}))),P=>c.encode(P));e.FilledImageLinkContent=i.intersection([i.strict({__TYPE__:i.literal(e.ImageLinkType)}),c]);const d=i.union([i.intersection([c,i.exact(i.partial({text:i.string}))]),i.strict({kind:i.literal("image"),text:i.string})]),p=new i.Type("ImageLink",P=>(0,u.hasContentType)(P)&&P.__TYPE__===e.ImageLinkType,P=>(0,r.pipe)(d.decode(P),n.either.map(Y=>e.ImageLinkContent.encode({...Y,__TYPE__:e.ImageLinkType}))),P=>d.encode(P));e.ImageLinkContent=i.intersection([i.strict({__TYPE__:i.literal(e.ImageLinkType)}),d]),e.FileLinkType="FileLink";const A=i.exact(i.intersection([i.type({kind:i.string,id:i.string,url:i.string,name:i.string,size:(0,o.withFallback)(i.string,"0")}),i.partial({date:a.StringOrNull})])),m=new i.Type("FilledFileLink",P=>(0,u.hasContentType)(P)&&P.__TYPE__===e.FileLinkType,P=>(0,r.pipe)(A.decode(P),n.either.map(Y=>e.FilledFileLinkContent.encode({...Y,__TYPE__:e.FileLinkType}))),P=>A.encode(P));e.FilledFileLinkContent=i.intersection([i.strict({__TYPE__:i.literal(e.FileLinkType)}),A]);const v=i.union([i.intersection([A,i.exact(i.partial({text:i.string}))]),i.strict({kind:i.literal("file"),text:i.string})]),_=new i.Type("FileLink",P=>(0,u.hasContentType)(P)&&P.__TYPE__===e.FileLinkType,P=>(0,r.pipe)(v.decode(P),n.either.map(Y=>e.FileLinkContent.encode({...Y,__TYPE__:e.FileLinkType}))),P=>v.encode(P));e.FileLinkContent=i.intersection([i.strict({__TYPE__:i.literal(e.FileLinkType)}),v]),e.MediaLinkType="MediaLink";const C=i.strict({kind:i.literal("media"),text:i.string}),I=new i.Type("MediaLink",P=>(0,u.hasContentType)(P)&&P.__TYPE__===e.MediaLinkType,P=>(0,r.pipe)(C.decode(P),n.either.map(Y=>e.MediaLinkContent.encode({...Y,__TYPE__:e.MediaLinkType}))),P=>C.encode(P));e.MediaLinkContent=i.intersection([i.strict({__TYPE__:i.literal(e.MediaLinkType)}),C]),e.DocumentLinkType="DocumentLink";const x=i.strict({id:a.NonEmptyString}),g=new i.Type("FilledDocumentLink",P=>(0,u.hasContentType)(P)&&P.__TYPE__===e.DocumentLinkType,P=>(0,r.pipe)(x.decode(P),n.either.map(Y=>e.FilledDocumentLinkContent.encode({...Y,__TYPE__:e.DocumentLinkType}))),P=>x.encode(P));e.FilledDocumentLinkContent=i.intersection([i.strict({__TYPE__:i.literal(e.DocumentLinkType)}),x]);const S=i.union([i.intersection([x,i.exact(i.partial({text:i.string}))]),i.strict({kind:i.literal("document"),text:i.string})]),y=new i.Type("DocumentLink",P=>(0,u.hasContentType)(P)&&P.__TYPE__===e.DocumentLinkType,P=>(0,r.pipe)(S.decode(P),n.either.map(Y=>e.DocumentLinkContent.encode({...Y,__TYPE__:e.DocumentLinkType}))),P=>S.encode(P));e.DocumentLinkContent=i.intersection([i.strict({__TYPE__:i.literal(e.DocumentLinkType)}),S]),e.ExternalLinkType="ExternalLink";const T=i.exact(i.intersection([i.type({url:i.string}),i.partial({kind:i.literal("web"),target:a.StringOrNull,preview:(0,s.nullable)(i.partial({title:i.string}))})])),w=new i.Type("FilledExternalLink",P=>(0,u.hasContentType)(P)&&P.__TYPE__===e.ExternalLinkType,P=>(0,r.pipe)(T.decode(P),n.either.map(Y=>e.FilledExternalLinkContent.encode({...Y,__TYPE__:e.ExternalLinkType}))),P=>T.encode(P));e.FilledExternalLinkContent=i.intersection([i.strict({__TYPE__:i.literal(e.ExternalLinkType)}),T]);const O=i.union([i.intersection([T,i.exact(i.partial({text:i.string}))]),i.strict({kind:i.literal("web"),text:i.string})]),E=new i.Type("ExternalLink",P=>(0,u.hasContentType)(P)&&P.__TYPE__===e.ExternalLinkType,P=>(0,r.pipe)(O.decode(P),n.either.map(Y=>e.ExternalLinkContent.encode({...Y,__TYPE__:e.ExternalLinkType}))),P=>O.encode(P));e.ExternalLinkContent=i.intersection([i.strict({__TYPE__:i.literal(e.ExternalLinkType)}),O]),e.AnyLinkType="AnyLink";const F=i.strict({text:i.string}),W=new i.Type("AnyLink",P=>(0,u.hasContentType)(P)&&P.__TYPE__===e.AnyLinkType,P=>(0,r.pipe)(F.decode(P),n.either.map(Y=>e.AnyLinkContent.encode({...Y,__TYPE__:e.AnyLinkType}))),P=>F.encode(P));e.AnyLinkContent=i.intersection([i.strict({__TYPE__:i.literal(e.AnyLinkType)}),F]),e.LinkContentType="LinkContent";const K=P=>(0,u.hasContentType)(P)&&P.__TYPE__===e.LinkContentType;e.isLinkContent=K,e.LinkLegacy=i.union([p,_,y,E,I,W]);const J=P=>new i.Type("LinkLegacy",e.isLinkContent,Y=>(0,r.pipe)(e.LinkLegacy.decode(Y),n.either.map(M=>e.LinkContent.encode({value:M,__TYPE__:e.LinkContentType}))),Y=>({content:e.LinkLegacy.encode(Y.value),types:{[P.keyOfType]:"Link"}}));e.LinkContentLegacy=J,e.Link=i.union([e.ImageLinkContent,e.FileLinkContent,e.DocumentLinkContent,e.ExternalLinkContent,e.MediaLinkContent,e.AnyLinkContent]),e.LinkContent=i.strict({__TYPE__:i.literal(e.LinkContentType),value:e.Link});const ee=P=>(0,u.hasContentType)(P)&&P.__TYPE__===e.LinkContentType;e.isFilledLinkContent=ee,e.FilledLinkLegacy=i.union([l,m,g,w]);const re=P=>new i.Type("FilledLinkLegacy",e.isFilledLinkContent,Y=>(0,r.pipe)(e.FilledLinkLegacy.decode(Y),n.either.map(M=>e.FilledLinkContent.encode({value:M,__TYPE__:e.LinkContentType}))),Y=>({content:e.FilledLinkLegacy.encode(Y.value),types:{[P.keyOfType]:"Link"}}));e.FilledLinkContentLegacy=re,e.FilledLink=i.union([e.FilledImageLinkContent,e.FilledFileLinkContent,e.FilledDocumentLinkContent,e.FilledExternalLinkContent]),e.FilledLinkContent=i.strict({__TYPE__:i.literal(e.LinkContentType),value:e.FilledLink})}(Ub)),Ub}var Ci={},Bb={},Pb={},IF;function TF(){return IF||(IF=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;const t=Q,n=lt,r=ln,i=Ge,o=(0,t.__importStar)(Z),a=$0,s=vh,u=ft(),c=Xe,l=TR(),d=xR(),p=wR(),A=E=>o.strict({data:E,start:o.number,end:o.number,type:o.literal(s.RichTextNodeType.hyperlink)}),m=o.strict({data:(0,a.withFallback)(o.string,""),start:o.number,end:o.number,type:o.literal("label")}),v=o.strict({start:o.number,end:o.number,type:o.keyof({[s.RichTextNodeType.strong]:null,[s.RichTextNodeType.em]:null,"list-item":null})});e.Span=o.union([A(p.FilledLink),m,v]),e.SpanLegacy=o.union([A(p.FilledLinkLegacy),m,v]);const _=E=>new o.Type("ValidatedSpans",F=>Array.isArray(F)&&F.every(E.is),(F,W)=>{if(Array.isArray(F)){const K=F.reduce((J,ee)=>{const re=E.decode(ee);return(0,r.isLeft)(re)?J:[...J,re.right]},[]).sort((J,ee)=>J.start-ee.start);return o.success(K)}else return o.failure(F,W)},F=>F.reduce((W,K)=>{const J=E.encode(K);return[...W,J]},[]));e.ValidatedSpans=_;const C=E=>o.exact(o.intersection([o.type({type:o.literal(s.RichTextNodeType.image),data:o.intersection([d.ImageContentView,o.partial({linkTo:(0,c.nullable)(E)})])}),o.partial({label:u.StringOrNull,direction:u.StringOrNull})]));e.ImageBlock=C(p.FilledLink);const I=C(p.FilledLinkLegacy);function x(E){return E.type===s.RichTextNodeType.image}e.checkImageBlock=x;const g=o.exact(o.intersection([o.type({type:o.literal(s.RichTextNodeType.embed),data:o.unknown}),o.partial({label:u.StringOrNull,direction:u.StringOrNull})])),S=new o.Type("EmbedBlockLegacy",E=>E.type==="embed",E=>(0,i.pipe)(g.decode(E),n.either.chain(F=>n.either.map(W=>[F,W])(l.EmbedContentLegacy.decode(F.data))),n.either.map(([F,W])=>e.EmbedBlock.encode({...F,data:{...W,__TYPE__:l.EmbedContentType,all:F.data}}))),E=>({...g.encode(E),data:l.EmbedContentLegacy.encode(E.data)}));e.EmbedBlock=o.exact(o.intersection([o.type({type:o.literal(s.RichTextNodeType.embed),data:l.EmbedContent}),o.partial({label:u.StringOrNull,direction:u.StringOrNull})]));function y(E){return E.type===s.RichTextNodeType.embed}e.checkEmbedBlock=y;const T=E=>o.exact(o.intersection([o.type({type:(0,c.refineType)(s.RichTextNodeTypeCodec,`string which isn't ${s.RichTextNodeType.image} ${s.RichTextNodeType.embed}`,F=>F!==s.RichTextNodeType.image&&F!==s.RichTextNodeType.embed),content:o.intersection([o.type({text:o.string}),o.partial({spans:(0,e.ValidatedSpans)(E)})])}),o.partial({label:o.string,direction:o.string})]));e.TextBlock=T(e.Span);const w=T(e.SpanLegacy),O=o.union([S,I,w]);e.BlockLegacy=new o.Type("BlockLegacy",E=>S.is(E)||I.is(E)||w.is(E),E=>O.decode(E),E=>(()=>e.ImageBlock.is(E)?I.encode(E):e.EmbedBlock.is(E)?S.encode(E):w.encode(E))()),e.Block=o.union([e.ImageBlock,e.EmbedBlock,e.TextBlock])}(Pb)),Pb}var xF;function fq(){return xF||(xF=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.RichTextLegacy=e.RichTextContent=e.isRichTextContent=e.RichTextContentType=void 0;const t=Q,n=lt,r=Ge,i=(0,t.__importStar)(Z),o=Pt(),a=TF();e.RichTextContentType="StructuredTextContent";const s=l=>(0,o.hasContentType)(l)&&l.__TYPE__===e.RichTextContentType;e.isRichTextContent=s;const u=i.array(a.BlockLegacy);e.RichTextContent=i.strict({__TYPE__:i.literal(e.RichTextContentType),value:i.array(a.Block)}),(0,t.__exportStar)(TF(),e);const c=l=>new i.Type("RichTextLegacy",e.isRichTextContent,d=>(0,r.pipe)(u.decode(d),n.either.map(p=>({value:p,__TYPE__:e.RichTextContentType}))),d=>({content:u.encode(d.value),types:{[l.keyOfType]:"StructuredText"}}));e.RichTextLegacy=c}(Bb)),Bb}var Wb={},wF;function dq(){return wF||(wF=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.SeparatorContent=e.SeparatorLegacy=e.isSeparatorContent=e.SeparatorContentType=void 0;const n=(0,Q.__importStar)(Z),r=Pt();e.SeparatorContentType="SeparatorContent";const i=a=>(0,r.hasContentType)(a)&&a.__TYPE__===e.SeparatorContentType;e.isSeparatorContent=i;const o=a=>new n.Type("SeparatorLegacy",e.isSeparatorContent,()=>n.success(e.SeparatorContent.encode({__TYPE__:e.SeparatorContentType})),()=>({content:{},types:{[a.keyOfType]:"Separator"}}));e.SeparatorLegacy=o,e.SeparatorContent=n.strict({__TYPE__:n.literal(e.SeparatorContentType)})}(Wb)),Wb}var EF;function XTe(){if(EF)return Ci;EF=1,Object.defineProperty(Ci,"__esModule",{value:!0}),Ci.NestableLegacy=Ci.isNestableContent=Ci.NestableContentDefaultValue=Ci.NestableContent=void 0;const e=Q,t=ln,n=(0,e.__importStar)(Z),r=aq(),i=sq(),o=TR(),a=uq(),s=hi,u=cq(),c=xR(),l=lq(),d=wR(),p=fq(),A=dq();Ci.NestableContent=n.union([r.EmptyContent,i.BooleanContent,o.EmbedContent,a.TextContent,a.TimestampContent,a.SelectContent,a.RangeContent,a.NumberContent,a.DateContent,a.ColorContent,u.GeoPointContent,c.ImageContent,l.IntegrationFieldContent,d.LinkContent,p.RichTextContent,A.SeparatorContent]);const m=C=>{switch(C.type){case"Boolean":return(0,i.BooleanContentDefaultValue)(C);case"Select":return(0,a.SelectContentDefaultValue)(C);default:return}};Ci.NestableContentDefaultValue=m;const v=C=>(0,a.isTextContent)(C)||(0,a.isColorContent)(C)||(0,a.isDateContent)(C)||(0,a.isTimestampContent)(C)||(0,a.isNumberContent)(C)||(0,a.isRangeContent)(C)||(0,a.isSelectContent)(C)||(0,u.isGeoPointContent)(C)||(0,p.isRichTextContent)(C)||(0,i.isBooleanContent)(C)||(0,o.isEmbedContent)(C)||(0,c.isImageContent)(C)||(0,l.isIntegrationFieldContent)(C)||(0,d.isLinkContent)(C)||(0,A.isSeparatorContent)(C)||(0,r.isEmptyContent)(C);Ci.isNestableContent=v;const _=C=>({decode(I){if(!C.fieldType)return;const x=(0,r.EmptyLegacy)(C.fieldType).decode(I);if((0,t.isRight)(x))return x;const g=(()=>{switch(C.fieldType){case"Text":return(0,a.TextLegacy)(C);case"Color":return(0,a.ColorLegacy)(C);case"Date":return(0,a.DateLegacy)(C);case"Timestamp":return(0,a.TimestampLegacy)(C);case"Number":return(0,a.NumberLegacy)(C);case"Range":return(0,a.RangeLegacy)(C);case"Select":return(0,a.SelectLegacy)(C);case"GeoPoint":return(0,u.GeoPointLegacy)(C);case"StructuredText":return(0,p.RichTextLegacy)(C);case"Boolean":return(0,i.BooleanLegacy)(C);case"Embed":return(0,o.EmbedLegacy)(C);case"Image":return(0,c.ImageLegacy)(C);case"IntegrationFields":return(0,l.IntegrationFieldLegacy)(C);case"Link":return(0,d.LinkContentLegacy)(C);case"Separator":return(0,A.SeparatorLegacy)(C);default:return}})();if(g)return g.decode(I)},encode(I){switch(I.__TYPE__){case s.FieldContentType:return I.type==="Text"?(0,a.TextLegacy)(C).encode(I):I.type==="Color"?(0,a.ColorLegacy)(C).encode(I):I.type==="Range"?(0,a.RangeLegacy)(C).encode(I):I.type==="Date"?(0,a.DateLegacy)(C).encode(I):I.type==="Number"?(0,a.NumberLegacy)(C).encode(I):I.type==="Timestamp"?(0,a.TimestampLegacy)(C).encode(I):I.type==="Select"?(0,a.SelectLegacy)(C).encode(I):void 0;case u.GeoPointContentType:return(0,u.GeoPointLegacy)(C).encode(I);case p.RichTextContentType:return(0,p.RichTextLegacy)(C).encode(I);case o.EmbedContentType:return(0,o.EmbedLegacy)(C).encode(I);case i.BooleanContentType:return(0,i.BooleanLegacy)(C).encode(I);case c.ImageContentType:return(0,c.ImageLegacy)(C).encode(I);case l.IntegrationFieldContentType:return(0,l.IntegrationFieldLegacy)(C).encode(I);case d.LinkContentType:return(0,d.LinkContentLegacy)(C).encode(I);case A.SeparatorContentType:return(0,A.SeparatorLegacy)(C).encode(I);default:return}}});return Ci.NestableLegacy=_,Ci}var $F;function Lo(){return $F||($F=1,function(e){Object.defineProperty(e,"__esModule",{value:!0});const t=Q;(0,t.__exportStar)(sq(),e),(0,t.__exportStar)(TR(),e),(0,t.__exportStar)(uq(),e),(0,t.__exportStar)(cq(),e),(0,t.__exportStar)(xR(),e),(0,t.__exportStar)(lq(),e),(0,t.__exportStar)(wR(),e),(0,t.__exportStar)(XTe(),e),(0,t.__exportStar)(fq(),e),(0,t.__exportStar)(dq(),e)}(_b)),_b}var Do={},RF;function W0(){if(RF)return Do;RF=1,Object.defineProperty(Do,"__esModule",{value:!0}),Do.repeatableContentWithDefaultNestableContentValues=Do.withDefaultNestableContentValues=Do.withDefaultSlicePrimaryContentValues=void 0;const e=fe,t=Qa(),n=Lo();function r(a,s){const u=s;for(const[c,l]of Object.entries(a)){const d=s[c];if(d===void 0){if(l.type===e.GroupFieldType)u[c]=(0,t.groupContentWithDefaultValues)(l,t.GroupContentDefaultValue);else{const p=(0,n.NestableContentDefaultValue)(l);p&&(u[c]=p)}continue}l.type===e.GroupFieldType&&(0,t.isGroupContent)(d)&&(u[c]=(0,t.groupContentWithDefaultValues)(l,d))}return u}Do.withDefaultSlicePrimaryContentValues=r;function i(a,s){return Object.entries(a).reduce((u,[c,l])=>{if(s[c]===void 0){const d=(0,n.NestableContentDefaultValue)(l);return d!==void 0?{...u,[c]:d}:u}return u},s)}Do.withDefaultNestableContentValues=i;function o(a,s){const u=Object.entries(a);return s.map(c=>u.reduce((l,[d,p])=>{var A;const m=c.value.find(([v])=>v===d);if(p.type==="Group"){const v=(0,t.groupContentWithDefaultValues)(p,(A=m==null?void 0:m[1])!==null&&A!==void 0?A:{__TYPE__:t.GroupContentType,value:[]});return{...l,value:[...l.value.filter(([_])=>_!==d),...v?[[d,v]]:[]]}}else if(!m){const v=(0,n.NestableContentDefaultValue)(p);return{...l,value:[...l.value,...v?[[d,v]]:[]]}}return l},c))}return Do.repeatableContentWithDefaultNestableContentValues=o,Do}var OF;function Qa(){return OF||(OF=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;const t=Q,n=lt,r=ln,i=Ge,o=(0,t.__importStar)(Z),a=fe,s=Qn,u=Pt(),c=Lo(),l=W0();e.GroupItemContentType="GroupItemContent",e.GroupContentType="GroupContentType",e.GroupItemContent=o.recursion("GroupItemContent",()=>o.strict({__TYPE__:o.literal(e.GroupItemContentType),value:o.array(o.tuple([o.string,o.union([c.NestableContent,e.GroupContent])]))})),e.GroupContent=o.recursion("GroupContent",()=>o.strict({__TYPE__:o.literal(e.GroupContentType),value:o.array(e.GroupItemContent)})),e.isGroupContent=e.GroupContent.is,e.GroupContentDefaultValue={__TYPE__:e.GroupContentType,value:[]};const d=o.record(o.string,o.unknown),p=C=>new o.Type("GroupItemLegacy",I=>(0,u.hasContentType)(I)&&I.__TYPE__===e.GroupItemContentType,I=>(0,i.pipe)(d.decode(I),n.either.map(g=>({value:Object.entries(g).reduce((y,[T,w])=>{const O=(0,s.getFieldCtx)(T,C),E=O.fieldType===a.GroupFieldType?(0,e.GroupLegacy)(O).decode(w):(0,c.NestableLegacy)(O).decode(w);return!E||(0,r.isLeft)(E)?y:[...y,[T,E.right]]},[]),__TYPE__:e.GroupItemContentType}))),I=>I.value.reduce((x,[g,S])=>{const y=(0,s.getFieldCtx)(g,C),T=(0,e.isGroupContent)(S)?(0,e.GroupLegacy)(y).encode(S):(0,c.NestableLegacy)(y).encode(S);return T?{content:{...x.content,[g]:T.content},types:{...x.types,...T.types}}:x},{content:{},types:{}}));e.GroupItemLegacy=p;const A=C=>{const I=o.array(o.union([o.null,(0,e.GroupItemLegacy)(C)])),x=o.array((0,e.GroupItemLegacy)(C));return new o.Type("GroupLegacy",e.isGroupContent,g=>(0,i.pipe)(I.decode(g),n.either.map(S=>({value:S.map(y=>y===null?{__TYPE__:e.GroupItemContentType,value:[]}:y),__TYPE__:e.GroupContentType}))),g=>{const S=x.encode(g.value);return{content:S.map(y=>y.content),types:S.reduce((y,T)=>({...y,...T.types}),{[C.keyOfType]:a.GroupFieldType})}})};e.GroupLegacy=A;function m(C,I){var x;const g=(x=C.config)===null||x===void 0?void 0:x.fields;return g?{...I,value:(0,l.repeatableContentWithDefaultNestableContentValues)(g,I.value)}:I}e.groupContentWithDefaultValues=m;function v({path:C,key:I,apiId:x,model:g,content:S}){return y=>{var T;const w=_({path:C,model:(T=g==null?void 0:g.config)===null||T===void 0?void 0:T.fields,content:S.value})(y);return y({path:C,key:I,apiId:x,model:g,content:{__TYPE__:S.__TYPE__,value:w}})}}e.traverseGroupContent=v;function _({path:C,model:I,content:x}){return g=>x.map((S,y)=>{const T=C.concat([{key:y.toString(),type:"GroupItem"}]),w=S.value.reduce((O,[E,F])=>{const W=I==null?void 0:I[E];let K;return(!W||(W==null?void 0:W.type)===a.GroupFieldType)&&F.__TYPE__===e.GroupContentType?K=v({path:T.concat([{key:E,type:"Widget"}]),key:E,apiId:E,model:W,content:F})(g):K=g({path:T.concat([{key:E,type:"Widget"}]),key:E,apiId:E,model:W,content:F}),!K||!((0,c.isNestableContent)(K)||(0,e.isGroupContent)(K))?O:O.concat([[E,K]])},[]);return{__TYPE__:S.__TYPE__,value:w}})}e.traverseGroupItemsContent=_}(Sb)),Sb}var Db={},Kb={},Nb={},eu={},FF;function pq(){if(FF)return eu;FF=1,Object.defineProperty(eu,"__esModule",{value:!0}),eu.RepeatableWidgets=eu.RepeatableWidgetsLegacy=void 0;const t=(0,Q.__importStar)(Z),n=Qa(),r=Lo(),i=s=>t.array((0,n.GroupItemLegacy)(s));eu.RepeatableWidgetsLegacy=i;const o=t.tuple([t.string,t.union([r.NestableContent,n.GroupContent])]),a=t.strict({__TYPE__:t.literal(n.GroupItemContentType),value:t.array(o)});return eu.RepeatableWidgets=t.array(a),eu}var kF;function $m(){return kF||(kF=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;const t=Q,n=lt,r=ln,i=Ge,o=(0,t.__importStar)(Z),a=Qn,s=Pt(),u=Qa(),c=Lo(),l=W0(),d=pq();e.CompositeSliceContentType="CompositeSliceContent";const p=I=>(0,s.hasContentType)(I)&&I.__TYPE__===e.CompositeSliceContentType;e.isCompositeSliceContent=p;const A=o.exact(o.partial({repeat:o.array(o.unknown),"non-repeat":o.UnknownRecord})),m=I=>new o.Type("CompositeSliceLegacy",e.isCompositeSliceContent,x=>(0,i.pipe)(A.decode(x),n.either.map(g=>{const S=(()=>{const T=(0,a.getFieldCtx)("repeat",I),w=(0,d.RepeatableWidgetsLegacy)(T).decode(g.repeat);if(!(!w||(0,r.isLeft)(w)))return w.right})()||[];return{nonRepeat:Object.entries(g["non-repeat"]||{}).reduce((T,[w,O])=>{const E=(0,a.getFieldCtx)(w,I,["non-repeat"]);if(!E)return T;const F=(0,c.NestableLegacy)(E).decode(O);return!F||(0,r.isLeft)(F)?T:{...T,[w]:F.right}},{}),repeat:S,__TYPE__:e.CompositeSliceContentType}})),x=>{const g=Object.entries(x.nonRepeat).reduce((y,[T,w])=>{const O=(0,a.getFieldCtx)(T,I,["non-repeat"]),E=(0,c.NestableLegacy)(O).encode(w);return E?{content:{...y.content,[T]:E.content},types:{...y.types,...E.types}}:y},{content:{},types:{}}),S=(()=>{const y=(0,a.getFieldCtx)("repeat",I);return(0,d.RepeatableWidgetsLegacy)(y).encode(x.repeat)})()||[];return{content:{"non-repeat":g.content,repeat:S.map(y=>y.content)},types:{[I.keyOfType]:"Slice",...g.types,...S.reduce((y,T)=>({...y,...T.types}),{})}}});e.CompositeSliceLegacy=m,e.CompositeSliceContent=o.strict({__TYPE__:o.literal(e.CompositeSliceContentType),nonRepeat:o.record(o.string,c.NestableContent),repeat:d.RepeatableWidgets});function v(I,x){var g,S;const y=(0,l.withDefaultNestableContentValues)((g=I["non-repeat"])!==null&&g!==void 0?g:{},x.nonRepeat),T=(0,l.repeatableContentWithDefaultNestableContentValues)((S=I.repeat)!==null&&S!==void 0?S:{},x.repeat);return{...x,nonRepeat:y,repeat:T}}e.compositeSliceContentWithDefaultValues=v;function _({path:I,sliceKey:x,sliceName:g,model:S,content:y}){return(T,w)=>{const O=Object.entries(y.widget.nonRepeat).reduce((F,[W,K])=>{const J=(()=>{var re,P,Y;return(S==null?void 0:S.type)==="SharedSlice"?(P=(re=S==null?void 0:S.fields)===null||re===void 0?void 0:re.primary)===null||P===void 0?void 0:P[W]:(Y=S==null?void 0:S["non-repeat"])===null||Y===void 0?void 0:Y[W]})(),ee=T({path:I.concat([{key:"non-repeat",type:"primary"},{key:W,type:"Widget"}]),key:W,apiId:g,model:J,content:K});return ee?(0,c.isNestableContent)(ee)?{...F,[W]:ee}:(console.warn(`Warn: Non nestable content with key [${W}] detected in a composite slice [${g}] with key [${x}]`),F):F},{}),E=(0,u.traverseGroupItemsContent)({path:I.concat([{key:"repeat",type:"items"}]),model:(S==null?void 0:S.type)==="SharedSlice"?S==null?void 0:S.fields.items:S==null?void 0:S.repeat,content:y.widget.repeat})(T);return w({key:x,apiId:g,path:I,model:S,content:{...y,widget:{__TYPE__:"CompositeSliceContent",repeat:E,nonRepeat:O}}})}}e.traverseCompositeSliceContent=_;function C(I,x){const[,g]=x.key.split("$");return{key:`${I.sliceName}$${g}`,name:I.sliceName,maybeLabel:x.maybeLabel,widget:{__TYPE__:"SharedSliceContent",variation:I.variationId,primary:Object.entries(x.widget.nonRepeat).reduce((S,[y,T])=>{var w;return!((w=I.fields.primary)===null||w===void 0)&&w[y]?{...S,[y]:T}:(console.warn(`The widget ${y} in the non-repeat zone of the composite slice [${I.sliceName}] with key [${x.key}] doesn't exist in the model.`),S)},{}),items:x.widget.repeat.map(S=>({__TYPE__:"GroupItemContent",value:S.value.reduce((y,[T,w])=>{var O;return!((O=I.fields.items)===null||O===void 0)&&O[T]?y.concat([[T,w]]):(console.warn(`The widget ${T} in the repeat zone of the composite slice [${I.sliceName}] with key [${x.key}] doesn't exist in the model.`),y)},[])}),[])}}}e.migrateCompositeSlice=C}(Nb)),Nb}var qb={},Ko={},MF;function Aq(){if(MF)return Ko;MF=1,Object.defineProperty(Ko,"__esModule",{value:!0}),Ko.isSlicePrimaryContent=Ko.SlicePrimaryLegacy=Ko.SlicePrimaryContent=void 0;const t=(0,Q.__importStar)(Z),n=fe,r=Qa(),i=Lo();Ko.SlicePrimaryContent=t.union([i.NestableContent,r.GroupContent]);const o=s=>{const u=(0,r.GroupLegacy)(s),c=(0,i.NestableLegacy)(s);return{decode(l){return s.fieldType===n.GroupFieldType?u.decode(l):c.decode(l)},encode(l){return(0,r.isGroupContent)(l)?u.encode(l):c.encode(l)}}};Ko.SlicePrimaryLegacy=o;const a=s=>(0,i.isNestableContent)(s)||(0,r.isGroupContent)(s);return Ko.isSlicePrimaryContent=a,Ko}var LF;function Rm(){return LF||(LF=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.traverseSharedSliceContent=e.sharedSliceContentWithDefaultValues=e.SharedSliceContent=e.SharedSliceLegacy=e.isSharedSliceContent=e.SharedSliceContentType=void 0;const t=Q,n=lt,r=ln,i=Ge,o=(0,t.__importStar)(Z),a=$0,s=fe,u=Qn,c=Pt(),l=Qa(),d=Lo(),p=W0(),A=pq(),m=Aq();e.SharedSliceContentType="SharedSliceContent";const v=g=>(0,c.hasContentType)(g)&&g.__TYPE__===e.SharedSliceContentType;e.isSharedSliceContent=v;const _=o.exact(o.type({variation:o.string,items:(0,a.withFallback)(o.array(o.unknown),[]),primary:(0,a.withFallback)(o.UnknownRecord,{})})),C=g=>new o.Type("SharedSliceLegacy",e.isSharedSliceContent,S=>(0,i.pipe)(_.decode(S),n.either.map(y=>{const T=(()=>{const O=(0,u.getFieldCtx)("items",g,["variations",y.variation]),E=(0,A.RepeatableWidgetsLegacy)(O).decode(y.items);if(!(!E||(0,r.isLeft)(E)))return E.right})()||[],w=Object.entries(y.primary).reduce((O,[E,F])=>{const W=(0,u.getFieldCtx)(E,g,["variations",y.variation,"primary"]),K=(0,m.SlicePrimaryLegacy)(W).decode(F);return!K||(0,r.isLeft)(K)?O:{...O,[E]:K.right}},{});return{variation:y.variation,primary:w,items:T,__TYPE__:e.SharedSliceContentType}})),S=>{const y=Object.entries(S.primary).reduce((w,[O,E])=>{const F=(0,u.getFieldCtx)(O,g,["variations",S.variation,"primary"]),W=(0,m.SlicePrimaryLegacy)(F).encode(E);return W?{content:{...w.content,[O]:W.content},types:{...w.types,...W.types}}:w},{content:{},types:{}}),T=(()=>{const w=(0,u.getFieldCtx)("items",g,["variations",S.variation]);return(0,A.RepeatableWidgetsLegacy)(w).encode(S.items)})()||[];return{content:{primary:y.content,items:T.map(w=>w.content),variation:S.variation},types:{[g.keyOfType]:"SharedSlice",...y.types,...T.reduce((w,O)=>({...w,...O.types}),{})}}});e.SharedSliceLegacy=C,e.SharedSliceContent=o.strict({__TYPE__:o.literal(e.SharedSliceContentType),variation:o.string,primary:o.record(o.string,m.SlicePrimaryContent),items:A.RepeatableWidgets});function I(g,S){var y,T;const w=g.variations.find(K=>K.id===S.variation),O=(y=w==null?void 0:w.primary)!==null&&y!==void 0?y:{},E=(T=w==null?void 0:w.items)!==null&&T!==void 0?T:{},F=(0,p.withDefaultSlicePrimaryContentValues)(O,S.primary),W=(0,p.repeatableContentWithDefaultNestableContentValues)(E,S.items);return{...S,primary:F,items:W}}e.sharedSliceContentWithDefaultValues=I;function x({path:g,sliceKey:S,sliceName:y,model:T,content:w}){return(O,E)=>{const F=Object.entries(w.widget.primary).reduce((K,[J,ee])=>{var re,P;const Y=(P=(re=T==null?void 0:T.fields)===null||re===void 0?void 0:re.primary)===null||P===void 0?void 0:P[J],M=(()=>(0,l.isGroupContent)(ee)?(0,l.traverseGroupContent)({path:g.concat([{key:"primary",type:"primary"},{key:J,type:"Widget"}]),key:J,apiId:J,content:ee,model:(Y==null?void 0:Y.type)===s.GroupFieldType?Y:void 0})(O):(0,d.isNestableContent)(ee)?O({path:g.concat([{key:"primary",type:"primary"},{key:J,type:"Widget"}]),key:J,apiId:J,model:Y,content:ee}):void 0)();return M?((0,m.isSlicePrimaryContent)(M)||console.warn(`Warn: Non nestable or group content with key [${J}] detected in a shared slice [${y}] with key [${S}]`),{...K,[J]:M}):K},{}),W=(0,l.traverseGroupItemsContent)({path:g.concat([{key:"items",type:"items"}]),model:T==null?void 0:T.fields.items,content:w.widget.items})(O);return E({key:S,apiId:y,path:g,model:T,content:{...w,widget:{__TYPE__:"SharedSliceContent",variation:w.widget.variation,primary:F,items:W}}})}}e.traverseSharedSliceContent=x}(qb)),qb}var Tr={},jF;function Om(){if(jF)return Tr;jF=1,Object.defineProperty(Tr,"__esModule",{value:!0}),Tr.migrateSimpleSlice=Tr.traverseSimpleSliceContent=Tr.SimpleSliceLegacy=Tr.isSimpleSliceContent=Tr.SimpleSliceContent=void 0;const t=(0,Q.__importStar)(Z),n=Qa(),r=Lo();Tr.SimpleSliceContent=t.union([r.NestableContent,n.GroupContent]);const i=u=>(0,r.isNestableContent)(u)||(0,n.isGroupContent)(u);Tr.isSimpleSliceContent=i;const o=u=>({decode:(()=>u.fieldType==="Group"?(0,n.GroupLegacy)(u).decode.bind(null):(0,r.NestableLegacy)(u).decode.bind(null))(),encode:c=>{switch(c.__TYPE__){case"GroupContentType":return(0,n.GroupLegacy)(u).encode(c);default:return(0,r.NestableLegacy)(u).encode(c)}}});Tr.SimpleSliceLegacy=o;function a({path:u,sliceKey:c,sliceName:l,model:d,content:p}){return(A,m)=>{if((0,n.isGroupContent)(p.widget)){const _=(0,n.traverseGroupContent)({path:u,key:p.key,apiId:p.name,model:(()=>{if((d==null?void 0:d.type)==="Group")return d;if((d==null?void 0:d.type)==="SharedSlice")return{type:"Group",config:{fields:d.fields.items||{}}}})(),content:p.widget})(A);return _&&m({key:p.key,apiId:p.name,path:u,model:d,content:{...p,widget:_}})}const v=A({key:p.key,apiId:p.name,path:u,model:(()=>{var _;if((d==null?void 0:d.type)==="SharedSlice")return(_=d.fields.primary)===null||_===void 0?void 0:_[p.name];if((d==null?void 0:d.type)!=="Group")return d})(),content:p.widget});return v&&m({key:c,apiId:l,path:u,model:d,content:{...p,widget:v}})}}Tr.traverseSimpleSliceContent=a;function s(u,c){var l;const[,d]=c.key.split("$"),p=`${u.sliceName}$${d}`;return c.widget.__TYPE__==="GroupContentType"?{key:p,name:u.sliceName,maybeLabel:c.maybeLabel,widget:{__TYPE__:"SharedSliceContent",variation:u.variationId,primary:{},items:c.widget.value.map(A=>({__TYPE__:"GroupItemContent",value:A.value.reduce((m,[v,_])=>{var C;return!((C=u.fields.items)===null||C===void 0)&&C[v]?m.concat([[v,_]]):m},[])}),[])}}:{key:p,name:u.sliceName,maybeLabel:c.maybeLabel,widget:{__TYPE__:"SharedSliceContent",variation:u.variationId,primary:!((l=u.fields.primary)===null||l===void 0)&&l[c.name]?{[c.name]:c.widget}:{},items:[]}}}return Tr.migrateSimpleSlice=s,Tr}var UF;function hq(){return UF||(UF=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.SliceContent=e.SliceLegacy=void 0;const t=Q,n=(0,t.__importStar)(Z),r=$m(),i=Rm(),o=Om(),a=s=>({decode:u=>(()=>{switch(s.fieldType){case"Slice":return(0,r.CompositeSliceLegacy)(s);case"SharedSlice":return(0,i.SharedSliceLegacy)(s);default:return(0,o.SimpleSliceLegacy)(s)}})().decode(u),encode:u=>{switch(u.__TYPE__){case"SharedSliceContent":return(0,i.SharedSliceLegacy)(s).encode(u);case"CompositeSliceContent":return(0,r.CompositeSliceLegacy)(s).encode(u);default:return(0,o.SimpleSliceLegacy)(s).encode(u)}}});e.SliceLegacy=a,e.SliceContent=n.union([r.CompositeSliceContent,i.SharedSliceContent,o.SimpleSliceContent]),(0,t.__exportStar)($m(),e),(0,t.__exportStar)(Rm(),e),(0,t.__exportStar)(Om(),e),(0,t.__exportStar)(Aq(),e)}(Kb)),Kb}var pn={},BF;function mq(){if(BF)return pn;BF=1,Object.defineProperty(pn,"__esModule",{value:!0}),pn.migrateSliceItem=pn.SlicesItemLegacy=pn.sliceItemContentWithDefaultValues=pn.isSimpleSliceItemContent=pn.isCompositeSliceItemContent=pn.isSharedSliceItemContent=pn.SliceItemContent=void 0;const e=Q,t=lt,n=ln,r=Ge,i=(0,e.__importStar)(Z),o=Xe,a=Qn,s=Qa(),u=Lo(),c=W0(),l=hq(),d=$m(),p=Rm(),A=Om();pn.SliceItemContent=i.type({key:i.string,name:i.string,maybeLabel:i.union([i.string,i.undefined]),widget:l.SliceContent});function m(S){return(0,p.isSharedSliceContent)(S.widget)}pn.isSharedSliceItemContent=m;function v(S){return(0,d.isCompositeSliceContent)(S.widget)}pn.isCompositeSliceItemContent=v;function _(S){return(0,s.isGroupContent)(S.widget)||(0,u.isNestableContent)(S.widget)}pn.isSimpleSliceItemContent=_;function C(S,y){var T;if(S.type==="SharedSlice"&&(0,p.isSharedSliceContent)(y))return(0,l.sharedSliceContentWithDefaultValues)(S,y);if(S.type==="Slice"&&(0,d.isCompositeSliceContent)(y))return(0,l.compositeSliceContentWithDefaultValues)(S,y);if(S.type==="Group"&&(0,s.isGroupContent)(y)&&(!((T=S.config)===null||T===void 0)&&T.fields)){const w=(0,c.repeatableContentWithDefaultNestableContentValues)(S.config.fields,y.value);return{...y,value:w}}return y}pn.sliceItemContentWithDefaultValues=C;const I=i.exact(i.intersection([i.type({key:i.string,value:i.unknown}),i.partial({label:(0,o.nullable)(i.string)})])),x=S=>new i.Type("SlicesItemLegacy",y=>((0,p.isSharedSliceContent)(y.widget),(0,d.isCompositeSliceContent)(y.widget),(0,A.isSimpleSliceContent)(y.widget)),(y,T)=>(0,r.pipe)(I.decode(y),t.either.chain(w=>{var O;const E=w.key.indexOf("$"),F=w.key.substring(0,E>0?E:void 0),W=(0,a.getFieldCtx)(F,S),K=(0,l.SliceLegacy)(W).decode(w.value);return!K||(0,n.isLeft)(K)?i.failure(y,T):i.success({key:w.key,name:F,maybeLabel:(O=w.label)!==null&&O!==void 0?O:void 0,widget:K.right})})),y=>{const T=(0,a.getFieldCtx)(y.name,S),w=(0,l.SliceLegacy)(T).encode(y.widget);return{content:{key:y.key,label:y.maybeLabel,value:(w==null?void 0:w.content)||{}},types:(w==null?void 0:w.types)||{}}});pn.SlicesItemLegacy=x;const g=({model:S,content:y})=>v(y)&&(S==null?void 0:S.type)==="SharedSlice"?(0,d.migrateCompositeSlice)(S,y):_(y)&&(S==null?void 0:S.type)==="SharedSlice"?(0,A.migrateSimpleSlice)(S,y):y;return pn.migrateSliceItem=g,pn}var Vb={},PF;function exe(){return PF||(PF=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.traverseSlices=e.slicesContentWithDefaultValues=e.SlicesContent=e.SlicesLegacy=e.isSlicesContent=e.SlicesContentType=void 0;const t=Q,n=lt,r=Ge,i=(0,t.__importStar)(Z),o=Ah,a=fe,s=Pt(),u=$m(),c=Rm(),l=Om(),d=mq();e.SlicesContentType="SliceContentType";const p=C=>(0,s.hasContentType)(C)&&C.__TYPE__===e.SlicesContentType;e.isSlicesContent=p;const A=C=>{const I=i.array((0,d.SlicesItemLegacy)(C));return new i.Type("SlicesLegacy",e.isSlicesContent,x=>(0,r.pipe)(I.decode(x),n.either.map(g=>({__TYPE__:e.SlicesContentType,value:g}))),x=>{const g=I.encode(x.value);return{content:g.map(S=>S.content),types:g.reduce((S,y)=>({...S,...y.types}),{[C.keyOfType]:"Slices"})}})};e.SlicesLegacy=A,e.SlicesContent=i.type({__TYPE__:i.literal(e.SlicesContentType),value:i.array(d.SliceItemContent)});function m(C,I){var x;const g=(x=C==null?void 0:C.config)===null||x===void 0?void 0:x.choices;if(g===void 0)return I;const S=I.value.map(y=>{const T=g[y.name];if(T){const w=(0,d.sliceItemContentWithDefaultValues)(T,y.widget);return{...y,widget:w}}return y});return{...I,value:S}}e.slicesContentWithDefaultValues=m;function v(C,I,x){var g,S;const y=(S=(g=I==null?void 0:I.config)===null||g===void 0?void 0:g.choices)===null||S===void 0?void 0:S[x.name],T=()=>{if((0,d.isSharedSliceItemContent)(x)&&y&&(0,a.isStaticSharedSlice)(y)){const E=y.variations.find(F=>F.id===x.widget.variation);return E?{type:"SharedSlice",sliceName:y.id,variationId:E.id,fields:{primary:E.primary||{},items:E.items||{}}}:void 0}},w=()=>{var E;const F=o.ContentPath.append(o.ContentPath.serialize(C),x.name),W=Object.values(((E=I==null?void 0:I.config)===null||E===void 0?void 0:E.choices)||{}).find(J=>{var ee;return(0,a.isStaticSharedSlice)(J)?!!(!((ee=J.legacyPaths)===null||ee===void 0)&&ee[F]):!1});if(!W)return;const K=W==null?void 0:W.variations.find(J=>{var ee;return J.id===((ee=W.legacyPaths)===null||ee===void 0?void 0:ee[F])});if(K)return{type:"SharedSlice",sliceName:W.id,variationId:K.id,fields:{primary:K.primary||{},items:K.items||{}}}},O=()=>{if(y){if((0,a.isCompositeSlice)(y))return{type:"Slice","non-repeat":y["non-repeat"]||{},repeat:y.repeat||{}};if((0,a.isLegacySlice)(y))return y}};return T()||w()||O()}function _({path:C,key:I,model:x,content:g}){return({transformWidget:S=({content:T})=>T,transformSlice:y=({content:T})=>T})=>{const T=g.value.reduce((w,O)=>{const E=x&&v(C,x,O),F=(()=>{if((0,d.isSharedSliceItemContent)(O))return(0,c.traverseSharedSliceContent)({path:C.concat({key:O.key,type:"SharedSlice"}),sliceKey:O.key,sliceName:O.name,model:(E==null?void 0:E.type)==="SharedSlice"?E:void 0,content:O})(S,y);if((0,d.isCompositeSliceItemContent)(O))return(0,u.traverseCompositeSliceContent)({path:C.concat({key:O.key,type:"Slice"}),sliceKey:O.key,sliceName:O.name,model:(E==null?void 0:E.type)==="Slice"||(E==null?void 0:E.type)==="SharedSlice"?E:void 0,content:O})(S,y);if((0,d.isSimpleSliceItemContent)(O))return(0,l.traverseSimpleSliceContent)({path:C.concat({key:O.key,type:"LegacySlice"}),sliceKey:O.key,sliceName:O.name,model:E&&(E==null?void 0:E.type)!=="Slice"?E:void 0,content:O})(S,y)})();return F?w.concat(F):w},[]);return S({path:C,key:I,apiId:I,model:x,content:{__TYPE__:g.__TYPE__,value:T}})}}e.traverseSlices=_}(Vb)),Vb}var WF;function gq(){return WF||(WF=1,function(e){Object.defineProperty(e,"__esModule",{value:!0});const t=Q;(0,t.__exportStar)(hq(),e),(0,t.__exportStar)(mq(),e),(0,t.__exportStar)(exe(),e)}(Db)),Db}var Qb={},DF;function vq(){return DF||(DF=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.UIDContent=e.UIDLegacy=e.isUIDContent=e.UIDContentType=void 0;const t=Q,n=lt,r=Ge,i=(0,t.__importStar)(Z),o=Pt();e.UIDContentType="UIDContent";const a=u=>(0,o.hasContentType)(u)&&u.__TYPE__===e.UIDContentType;e.isUIDContent=a;const s=u=>new i.Type("UIDLegacy",e.isUIDContent,c=>(0,r.pipe)(i.string.decode(c),n.either.map(l=>e.UIDContent.encode({value:l,__TYPE__:e.UIDContentType}))),c=>({content:c.value,types:{[u.keyOfType]:"UID"}}));e.UIDLegacy=s,e.UIDContent=i.type({__TYPE__:i.literal(e.UIDContentType),value:i.string})}(Qb)),Qb}var No={},KF;function txe(){if(KF)return No;KF=1,Object.defineProperty(No,"__esModule",{value:!0}),No.WidgetLegacy=No.isWidgetContent=No.WidgetContent=void 0;const t=(0,Q.__importStar)(Z),n=Qa(),r=Lo(),i=gq(),o=vq();No.WidgetContent=t.union([n.GroupContent,r.NestableContent,o.UIDContent,i.SlicesContent]);const a=u=>(0,n.isGroupContent)(u)||(0,r.isNestableContent)(u)||(0,o.isUIDContent)(u)||(0,i.isSlicesContent)(u);No.isWidgetContent=a;const s=u=>({decode(c){if(!u.fieldType)return;const l=(()=>{switch(u.fieldType){case"UID":return(0,o.UIDLegacy)(u);case"Group":return(0,n.GroupLegacy)(u);case"Choice":case"Slices":return(0,i.SlicesLegacy)(u);default:return(0,r.NestableLegacy)(u)}})();if(l)return l.decode(c)},encode(c){switch(c.__TYPE__){case o.UIDContentType:return(0,o.UIDLegacy)(u).encode(c);case n.GroupContentType:return(0,n.GroupLegacy)(u).encode(c);case i.SlicesContentType:return(0,i.SlicesLegacy)(u).encode(c);default:return(0,r.NestableLegacy)(u).encode(c)}}});return No.WidgetLegacy=s,No}var NF;function ER(){return NF||(NF=1,function(e){Object.defineProperty(e,"__esModule",{value:!0});const t=Q;(0,t.__exportStar)(aq(),e),(0,t.__exportStar)(Qa(),e),(0,t.__exportStar)(Lo(),e),(0,t.__exportStar)(gq(),e),(0,t.__exportStar)(vq(),e),(0,t.__exportStar)(txe(),e)}(bb)),bb}Object.defineProperty(or,"__esModule",{value:!0});or.migrateDocument=or.collectWidgets=or.traverseDocument=or.fillDocumentWithDefaultValues=or.DocumentLegacy=or.Document=void 0;const nxe=Q,yq=lt,$R=ln,bq=Ge,Fl=(0,nxe.__importStar)(Z),Cq=Ah,RR=Lc,kl=fe,_i=ER(),tC=Qn;or.Document=Fl.record(RR.WidgetKey,_i.WidgetContent);const rxe=Fl.record(RR.WidgetKey,Fl.unknown),OR=e=>new Fl.Type("Document",t=>!!t&&typeof t=="object",t=>(0,bq.pipe)(rxe.decode(t),yq.either.map(n=>Object.entries(n).reduce((r,[i,o])=>{const a=(0,tC.defaultCtx)(i,e),s=(0,_i.WidgetLegacy)(a).decode(o);return!s||(0,$R.isLeft)(s)?r:{...r,[i]:s.right}},{}))),t=>Object.entries(t).reduce((n,[r,i])=>{const o=(0,tC.defaultCtx)(r,e),a=(0,_i.WidgetLegacy)(o).encode(i);return a?{content:{...n.content,[r]:a.content},types:{...n.types,...a.types}}:n},{content:{},types:{}}));function Sq(e){const t=Object.entries(e),{types:n,widgets:r}=t.reduce((a,[s,u])=>{if(s.endsWith("_TYPE")){const c=tC.FieldOrSliceType.decode(u);if((0,$R.isRight)(c))return{...a,types:a.types.set(s.substring(0,s.length-5),c.right)}}return!s.endsWith("_POSITION")&&!s.endsWith("_TYPE")?{...a,widgets:{...a.widgets,[s]:u}}:a},{types:new Map,widgets:{}}),i=e.slugs_INTERNAL||[],o=e.uid;return{widgets:r,types:n,uid:o,slugs:i}}function ixe(e,t){const n=(0,bq.pipe)(Fl.record(RR.WidgetKey,Fl.unknown).decode(e),yq.either.chain(r=>{const{types:i,widgets:o}=Sq(r);return OR(i).decode(o)}));return(0,$R.isLeft)(n)?void 0:_q(n.right,t)}function oxe(e){const t=OR().encode(e);return{...t.content,...t.types}}or.DocumentLegacy={_codec:OR,extractMetadata:Sq,parse:ixe,encode:oxe};function FR(e){return{customTypeId:e==null?void 0:e.id,fields:Object.fromEntries((0,kl.flattenSections)(e))}}function axe(e,t){const{fields:n}=e&&kl.StaticCustomType.is(e)?FR(e):e;return Object.entries(n).reduce((r,[i,o])=>{const a=t[i],s=(()=>{switch(o.type){case"Group":return(0,_i.isGroupContent)(a)?(0,_i.groupContentWithDefaultValues)(o,a):a;case"Choice":case"Slices":return(0,_i.isSlicesContent)(a)?(0,_i.slicesContentWithDefaultValues)(o,a):a;default:return a===void 0&&kl.NestableWidget.is(o)?(0,_i.NestableContentDefaultValue)(o):a}})();return s?{...r,[i]:s}:r},t)}or.fillDocumentWithDefaultValues=axe;function kR({document:e,customType:t}){const n=t&&kl.StaticCustomType.is(t)?FR(t):t;return({transformWidget:r=({content:o})=>o,transformSlice:i=({content:o})=>o})=>{const o=n&&Object.entries(n.fields).reduce((a,[s,u])=>({...a,[s]:u}),{});return Object.entries(e).reduce((a,[s,u])=>{const c=o&&o[s],l=Cq.ContentPath.make([{key:n==null?void 0:n.customTypeId,type:"CustomType"},{key:s,type:"Widget"}]),d=(()=>{switch(u.__TYPE__){case"SliceContentType":return(0,_i.traverseSlices)({path:l,key:s,model:(c==null?void 0:c.type)==="Slices"||(c==null?void 0:c.type)==="Choice"?c:void 0,content:u})({transformWidget:r,transformSlice:i});case"GroupContentType":return(0,_i.traverseGroupContent)({path:l,key:s,apiId:s,model:(c==null?void 0:c.type)==="Group"?c:void 0,content:u})(r);default:return r({path:l,key:s,apiId:s,model:(c==null?void 0:c.type)!=="Group"&&(c==null?void 0:c.type)!=="Slices"&&(c==null?void 0:c.type)!=="Choice"?c:void 0,content:u})}})();return{...a,...d?{[s]:d}:{}}},{})}}or.traverseDocument=kR;function sxe(e,t){const n={};return kR({document:e})({transformWidget:({content:r,path:i})=>{const o=Cq.ContentPath.serialize(i);return t(r,i)&&(n[o]=r),r}}),n}or.collectWidgets=sxe;function _q(e,t){const n=kl.StaticCustomType.is(t)?FR(t):t;return Object.values((0,kl.collectSharedSlices)(n)).some(i=>!!i.legacyPaths)?kR({document:e,customType:t})({transformSlice:_i.migrateSliceItem}):e}or.migrateDocument=_q;(function(e){Object.defineProperty(e,"__esModule",{value:!0});const t=Q;(0,t.__exportStar)(or,e),(0,t.__exportStar)(ER(),e),(0,t.__exportStar)(Qn,e)})(Ce);function uxe(e,t){const n=cxe(e,t),r=lxe(e,n);return Ce.fillDocumentWithDefaultValues(e,r)}function cxe(e,t){return fe.flattenSections(e).reduce((r,[i,o])=>!t[i]&&o.type==="Group"?{...r,[i]:Iq}:r,t)}function lxe(e,t){return Ce.traverseDocument({document:t,customType:e})({transformWidget({model:n,content:r}){return n?r:void 0},transformSlice(n){return n.model?n.content:void 0}})}const Iq={__TYPE__:"GroupContentType",value:[{__TYPE__:"GroupItemContent",value:[]}]},Tq={unclassified:{title:"Draft",color:"amber"},published:{title:"Live",color:"green"},release:{title:"Planned",color:"purple"},archived:{title:"Archived",color:"grey"}},xq={unclassified:["unclassified","published"],archived:["unclassified","published"],release:["release","published"],published:["published"]};function MR(e){const{documentId:t,versionId:n,baseUrl:r,status:i,releaseId:o}=e,a={s:i,v:n,r:o},s=Fr.createRouteParams({params:a}),u=new URLSearchParams(s).toString();return new URL(`pages/${t}?${u}`,r)}function wq(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var fxe=Te.createContext(wq()),dxe=({children:e})=>{const[t]=Te.useState(()=>wq());return f.jsx(fxe.Provider,{value:t,children:typeof e=="function"?e(t):e})};function pxe(e){const{children:t,...n}=e;return f.jsx(dxe,{children:({reset:r})=>f.jsx(h.ErrorBoundary,{...n,onReset:r,children:t})})}const Axe="media-library-",qF=`${Axe}newMediaLibraryFeaturesBannerClosed`;function Eq(e){const{maxWidth:t}=e,[n,r]=$.useState(()=>!(_d.localStorage.isAvailable()&&_d.localStorage.read(qF)));function i(){r(!1),_d.localStorage.isAvailable()&&_d.localStorage.write(qF,String(Date.now()))}return n?f.jsx(h.Box,{justifyContent:"center",padding:{inline:16,block:12},backgroundColor:"purple9",children:f.jsxs(h.Box,{maxWidth:t,width:"100%",alignItems:"center",gap:8,children:[f.jsx(h.CircleIcon,{color:"purple",name:"autoFixHigh",size:"extraSmall",variant:"solid"}),f.jsxs("div",{children:[f.jsx(h.Text,{color:"white",variant:"bold",children:"New features on the Media Library now available!"}),f.jsxs(h.Box,{gap:4,flexWrap:"wrap",children:[f.jsx(h.Text,{color:"white",children:"Media Tagging, Filtering, Improved Search & Bulk Deletion"}),f.jsx(h.Text,{color:"white",variant:"bold",href:"https://prismic.io/lp/new-media-library",target:"_blank",rel:"noopener noreferrer",underline:!0,children:"Find out More →"})]})]}),f.jsx(h.Button,{invisible:!0,color:"white",sx:{marginLeft:"auto",marginBottom:"auto",flexShrink:0},underline:!0,onClick:i,children:"Close"})]})}):null}const $q=$.createContext(void 0),hxe={selectedIds:new Set,excludedIds:new Set,isAllSelected:!1};function Rq(e){const{children:t,initialState:n,initialTotalItemCount:r,isSelectAllEnabled:i=!1}=e,o=$.useRef(),a=$.useRef(r||0);function s(){if(n&&n.selectedIds){const T=[...n.selectedIds].pop();T&&(o.current=T)}return{...hxe,...n}}const[u,c]=$.useState(s),l=$.useMemo(()=>{const{selectedIds:T,excludedIds:w,isAllSelected:O}=u;return O?a.current-w.size:T.size},[u]),d=$.useCallback(T=>{const{isAllSelected:w,selectedIds:O,excludedIds:E}=u;return w?!E.has(T):O.has(T)},[u]),p=$.useCallback(()=>{const{isAllSelected:T,selectedIds:w,excludedIds:O}=u;return{selectedIds:[...w],excludedIds:[...O],isAllSelected:T,selectedCount:l}},[u,l]),A=Ne.useStableCallback(()=>{i&&c({isAllSelected:!0,selectedIds:new Set,excludedIds:new Set})}),m=Ne.useStableCallback(()=>{c({isAllSelected:!1,selectedIds:new Set,excludedIds:new Set})});$.useEffect(()=>{const{isAllSelected:T,selectedIds:w,excludedIds:O}=u,E=a.current;if(!(E===0||!i)){if(T&&O.size===E){m();return}if(!T&&w.size===E){A();return}}},[u,i,A,m]);const v=Ne.useStableCallback(T=>{const{id:w,isSingleSelection:O,metaKey:E,shiftKey:F,ids:W}=T;return F&&W&&W.length>0&&o.current?C(w,W,o.current):O&&!E?_(w):d(w)?g([w]):x([w]),o.current=w,d(w)});function _(T){d(T)&&l===1?c(w=>({...w,selectedIds:new Set})):c({isAllSelected:!1,selectedIds:new Set([T]),excludedIds:new Set})}function C(T,w,O){const E=mxe(w,O,T),F=d(T);return F?g(E):x(E),F}const I=Ne.useStableCallback(()=>{l>0?m():A()});function x(T){const{isAllSelected:w}=u;if(w){c(O=>({...O,excludedIds:VF(O.excludedIds,T)}));return}c(O=>({...O,selectedIds:QF(O.selectedIds,T)}))}function g(T){const{isAllSelected:w}=u;if(w){c(O=>({...O,excludedIds:QF(O.excludedIds,T)}));return}c(O=>({...O,selectedIds:VF(O.selectedIds,T)}))}function S(T){a.current=T}const y=$.useMemo(()=>({selectedCount:l,state:u,totalItemCount:a.current,isSelected:d,isSelectAllEnabled:i,getSelectionState:p,toggleSelection:v,toggleSelectAll:I,clearSelection:m,setTotalItemCount:S}),[u,m,p,i,d,l,I,v]);return f.jsx($q.Provider,{value:y,children:t})}function Vs(e){const t=$.useContext($q);if(t===void 0)throw new Error("useSelectionManagerContext must be used within a SelectionManagerProvider");const{totalItemCount:n,onChangeSelection:r}=e||{},{setTotalItemCount:i,totalItemCount:o,state:a,getSelectionState:s,...u}=t;n!==void 0&&n!==o&&i(n);const c=Ne.useStableCallback(r);return $.useEffect(()=>{c==null||c(s())},[s,c,a]),{...u,getSelectionState:s,isAllSelected:a.isAllSelected}}function mxe(e,t,n){const r=e.indexOf(t),i=e.indexOf(n);if(r===-1||i===-1)throw new Error("Both startValue and endValue must be in the array");return r<=i?e.slice(r,i+1):e.slice(i,r+1)}function VF(e,t){const n=new Set(e);return t.forEach(r=>n.delete(r)),n}function QF(e,t){return new Set([...e,...t])}const D0=$.createContext(void 0);function Ee(){const e=$.useContext(D0);if(!e)throw new Error("Missing EditorConfigContext.Provider");return e}class nC extends Error{}function Jt(e){throw new nC(`Missing EditorConfig.${e}`)}function gxe(){if(new URL(location.href).searchParams.has("debug"))return;const n=console.error.bind(console);console.error=(...r)=>{r[0]instanceof nC||vxe(r)||n(...r)},window.addEventListener("error",r=>{r.error instanceof nC&&r.preventDefault(),yxe(r.error)&&r.preventDefault()})}function vxe(e){const t="Warning: flushSync was called from inside a lifecycle method",n=typeof e[0]=="string"&&e[0].includes(t),r=typeof e[1]=="string"&&e[1].includes("RichTextField");return n&&r}function yxe(e){const t=/Invalid content for node document: <(bulletList|orderedList)\(listItem*/,n=e.message;return!!(typeof n=="string"&&n.match(t))}var He;(function(e){e.assertEqual=i=>i;function t(i){}e.assertIs=t;function n(i){throw new Error}e.assertNever=n,e.arrayToEnum=i=>{const o={};for(const a of i)o[a]=a;return o},e.getValidEnumValues=i=>{const o=e.objectKeys(i).filter(s=>typeof i[i[s]]!="number"),a={};for(const s of o)a[s]=i[s];return e.objectValues(a)},e.objectValues=i=>e.objectKeys(i).map(function(o){return i[o]}),e.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{const o=[];for(const a in i)Object.prototype.hasOwnProperty.call(i,a)&&o.push(a);return o},e.find=(i,o)=>{for(const a of i)if(o(a))return a},e.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&isFinite(i)&&Math.floor(i)===i;function r(i,o=" | "){return i.map(a=>typeof a=="string"?`'${a}'`:a).join(o)}e.joinValues=r,e.jsonStringifyReplacer=(i,o)=>typeof o=="bigint"?o.toString():o})(He||(He={}));var rC;(function(e){e.mergeShapes=(t,n)=>({...t,...n})})(rC||(rC={}));const ne=He.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Xa=e=>{switch(typeof e){case"undefined":return ne.undefined;case"string":return ne.string;case"number":return isNaN(e)?ne.nan:ne.number;case"boolean":return ne.boolean;case"function":return ne.function;case"bigint":return ne.bigint;case"symbol":return ne.symbol;case"object":return Array.isArray(e)?ne.array:e===null?ne.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?ne.promise:typeof Map<"u"&&e instanceof Map?ne.map:typeof Set<"u"&&e instanceof Set?ne.set:typeof Date<"u"&&e instanceof Date?ne.date:ne.object;default:return ne.unknown}},G=He.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"]),bxe=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:");class Ei extends Error{constructor(t){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=t}get errors(){return this.issues}format(t){const n=t||function(o){return o.message},r={_errors:[]},i=o=>{for(const a of o.issues)if(a.code==="invalid_union")a.unionErrors.map(i);else if(a.code==="invalid_return_type")i(a.returnTypeError);else if(a.code==="invalid_arguments")i(a.argumentsError);else if(a.path.length===0)r._errors.push(n(a));else{let s=r,u=0;for(;u<a.path.length;){const c=a.path[u];u===a.path.length-1?(s[c]=s[c]||{_errors:[]},s[c]._errors.push(n(a))):s[c]=s[c]||{_errors:[]},s=s[c],u++}}};return i(this),r}toString(){return this.message}get message(){return JSON.stringify(this.issues,He.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=n=>n.message){const n={},r=[];for(const i of this.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}Ei.create=e=>new Ei(e);const rp=(e,t)=>{let n;switch(e.code){case G.invalid_type:e.received===ne.undefined?n="Required":n=`Expected ${e.expected}, received ${e.received}`;break;case G.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,He.jsonStringifyReplacer)}`;break;case G.unrecognized_keys:n=`Unrecognized key(s) in object: ${He.joinValues(e.keys,", ")}`;break;case G.invalid_union:n="Invalid input";break;case G.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${He.joinValues(e.options)}`;break;case G.invalid_enum_value:n=`Invalid enum value. Expected ${He.joinValues(e.options)}, received '${e.received}'`;break;case G.invalid_arguments:n="Invalid function arguments";break;case G.invalid_return_type:n="Invalid function return type";break;case G.invalid_date:n="Invalid date";break;case G.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(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}"`:He.assertNever(e.validation):e.validation!=="regex"?n=`Invalid ${e.validation}`:n="Invalid";break;case G.too_small:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:n="Invalid input";break;case G.too_big:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?n=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:n="Invalid input";break;case G.custom:n="Invalid input";break;case G.invalid_intersection_types:n="Intersection results could not be merged";break;case G.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case G.not_finite:n="Number must be finite";break;default:n=t.defaultError,He.assertNever(e)}return{message:n}};let Oq=rp;function Cxe(e){Oq=e}function Fm(){return Oq}const km=e=>{const{data:t,path:n,errorMaps:r,issueData:i}=e,o=[...n,...i.path||[]],a={...i,path:o};let s="";const u=r.filter(c=>!!c).slice().reverse();for(const c of u)s=c(a,{data:t,defaultError:s}).message;return{...i,path:o,message:i.message||s}},Sxe=[];function oe(e,t){const n=km({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,Fm(),rp].filter(r=>!!r)});e.common.issues.push(n)}class Ln{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,n){const r=[];for(const i of n){if(i.status==="aborted")return xe;i.status==="dirty"&&t.dirty(),r.push(i.value)}return{status:t.value,value:r}}static async mergeObjectAsync(t,n){const r=[];for(const i of n)r.push({key:await i.key,value:await i.value});return Ln.mergeObjectSync(t,r)}static mergeObjectSync(t,n){const r={};for(const i of n){const{key:o,value:a}=i;if(o.status==="aborted"||a.status==="aborted")return xe;o.status==="dirty"&&t.dirty(),a.status==="dirty"&&t.dirty(),(typeof a.value<"u"||i.alwaysSet)&&(r[o.value]=a.value)}return{status:t.value,value:r}}}const xe=Object.freeze({status:"aborted"}),Fq=e=>({status:"dirty",value:e}),Hn=e=>({status:"valid",value:e}),iC=e=>e.status==="aborted",oC=e=>e.status==="dirty",Mm=e=>e.status==="valid",Lm=e=>typeof Promise<"u"&&e instanceof Promise;var Ae;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(Ae||(Ae={}));class po{constructor(t,n,r,i){this._cachedPath=[],this.parent=t,this.data=n,this._path=r,this._key=i}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const zF=(e,t)=>{if(Mm(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new Ei(e.common.issues);return this._error=n,this._error}}};function $e(e){if(!e)return{};const{errorMap:t,invalid_type_error:n,required_error:r,description:i}=e;if(t&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:i}:{errorMap:(a,s)=>a.code!=="invalid_type"?{message:s.defaultError}:typeof s.data>"u"?{message:r??s.defaultError}:{message:n??s.defaultError},description:i}}class Fe{constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(t){return Xa(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:Xa(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new Ln,ctx:{common:t.parent.common,data:t.data,parsedType:Xa(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const n=this._parse(t);if(Lm(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(t){const n=this._parse(t);return Promise.resolve(n)}parse(t,n){const r=this.safeParse(t,n);if(r.success)return r.data;throw r.error}safeParse(t,n){var r;const i={common:{issues:[],async:(r=n==null?void 0:n.async)!==null&&r!==void 0?r:!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Xa(t)},o=this._parseSync({data:t,path:i.path,parent:i});return zF(i,o)}async parseAsync(t,n){const r=await this.safeParseAsync(t,n);if(r.success)return r.data;throw r.error}async safeParseAsync(t,n){const r={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Xa(t)},i=this._parse({data:t,path:r.path,parent:r}),o=await(Lm(i)?i:Promise.resolve(i));return zF(r,o)}refine(t,n){const r=i=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(i):n;return this._refinement((i,o)=>{const a=t(i),s=()=>o.addIssue({code:G.custom,...r(i)});return typeof Promise<"u"&&a instanceof Promise?a.then(u=>u?!0:(s(),!1)):a?!0:(s(),!1)})}refinement(t,n){return this._refinement((r,i)=>t(r)?!0:(i.addIssue(typeof n=="function"?n(r,i):n),!1))}_refinement(t){return new Li({schema:this,typeName:ye.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}optional(){return ea.create(this,this._def)}nullable(){return Mu.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return $i.create(this,this._def)}promise(){return Ll.create(this,this._def)}or(t){return sp.create([this,t],this._def)}and(t){return up.create(this,t,this._def)}transform(t){return new Li({...$e(this._def),schema:this,typeName:ye.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const n=typeof t=="function"?t:()=>t;return new pp({...$e(this._def),innerType:this,defaultValue:n,typeName:ye.ZodDefault})}brand(){return new Mq({typeName:ye.ZodBranded,type:this,...$e(this._def)})}catch(t){const n=typeof t=="function"?t:()=>t;return new Pm({...$e(this._def),innerType:this,catchValue:n,typeName:ye.ZodCatch})}describe(t){const n=this.constructor;return new n({...this._def,description:t})}pipe(t){return Sh.create(this,t)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const _xe=/^c[^\s-]{8,}$/i,Ixe=/^[a-z][a-z0-9]*$/,Txe=/[0-9A-HJKMNP-TV-Z]{26}/,xxe=/^([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,wxe=/^(([^<>()[\]\\.,;:\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,})+))$/,Exe=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u"),$xe=/^(((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}))$/,Rxe=/^(([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})))$/,Oxe=e=>e.precision?e.offset?new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${e.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`):new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${e.precision}}Z$`):e.precision===0?e.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"):e.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$");function Fxe(e,t){return!!((t==="v4"||!t)&&$xe.test(e)||(t==="v6"||!t)&&Rxe.test(e))}class xi extends Fe{constructor(){super(...arguments),this._regex=(t,n,r)=>this.refinement(i=>t.test(i),{validation:n,code:G.invalid_string,...Ae.errToObj(r)}),this.nonempty=t=>this.min(1,Ae.errToObj(t)),this.trim=()=>new xi({...this._def,checks:[...this._def.checks,{kind:"trim"}]}),this.toLowerCase=()=>new xi({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]}),this.toUpperCase=()=>new xi({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==ne.string){const o=this._getOrReturnCtx(t);return oe(o,{code:G.invalid_type,expected:ne.string,received:o.parsedType}),xe}const r=new Ln;let i;for(const o of this._def.checks)if(o.kind==="min")t.data.length<o.value&&(i=this._getOrReturnCtx(t,i),oe(i,{code:G.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),r.dirty());else if(o.kind==="max")t.data.length>o.value&&(i=this._getOrReturnCtx(t,i),oe(i,{code:G.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),r.dirty());else if(o.kind==="length"){const a=t.data.length>o.value,s=t.data.length<o.value;(a||s)&&(i=this._getOrReturnCtx(t,i),a?oe(i,{code:G.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):s&&oe(i,{code:G.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),r.dirty())}else if(o.kind==="email")wxe.test(t.data)||(i=this._getOrReturnCtx(t,i),oe(i,{validation:"email",code:G.invalid_string,message:o.message}),r.dirty());else if(o.kind==="emoji")Exe.test(t.data)||(i=this._getOrReturnCtx(t,i),oe(i,{validation:"emoji",code:G.invalid_string,message:o.message}),r.dirty());else if(o.kind==="uuid")xxe.test(t.data)||(i=this._getOrReturnCtx(t,i),oe(i,{validation:"uuid",code:G.invalid_string,message:o.message}),r.dirty());else if(o.kind==="cuid")_xe.test(t.data)||(i=this._getOrReturnCtx(t,i),oe(i,{validation:"cuid",code:G.invalid_string,message:o.message}),r.dirty());else if(o.kind==="cuid2")Ixe.test(t.data)||(i=this._getOrReturnCtx(t,i),oe(i,{validation:"cuid2",code:G.invalid_string,message:o.message}),r.dirty());else if(o.kind==="ulid")Txe.test(t.data)||(i=this._getOrReturnCtx(t,i),oe(i,{validation:"ulid",code:G.invalid_string,message:o.message}),r.dirty());else if(o.kind==="url")try{new URL(t.data)}catch{i=this._getOrReturnCtx(t,i),oe(i,{validation:"url",code:G.invalid_string,message:o.message}),r.dirty()}else o.kind==="regex"?(o.regex.lastIndex=0,o.regex.test(t.data)||(i=this._getOrReturnCtx(t,i),oe(i,{validation:"regex",code:G.invalid_string,message:o.message}),r.dirty())):o.kind==="trim"?t.data=t.data.trim():o.kind==="includes"?t.data.includes(o.value,o.position)||(i=this._getOrReturnCtx(t,i),oe(i,{code:G.invalid_string,validation:{includes:o.value,position:o.position},message:o.message}),r.dirty()):o.kind==="toLowerCase"?t.data=t.data.toLowerCase():o.kind==="toUpperCase"?t.data=t.data.toUpperCase():o.kind==="startsWith"?t.data.startsWith(o.value)||(i=this._getOrReturnCtx(t,i),oe(i,{code:G.invalid_string,validation:{startsWith:o.value},message:o.message}),r.dirty()):o.kind==="endsWith"?t.data.endsWith(o.value)||(i=this._getOrReturnCtx(t,i),oe(i,{code:G.invalid_string,validation:{endsWith:o.value},message:o.message}),r.dirty()):o.kind==="datetime"?Oxe(o).test(t.data)||(i=this._getOrReturnCtx(t,i),oe(i,{code:G.invalid_string,validation:"datetime",message:o.message}),r.dirty()):o.kind==="ip"?Fxe(t.data,o.version)||(i=this._getOrReturnCtx(t,i),oe(i,{validation:"ip",code:G.invalid_string,message:o.message}),r.dirty()):He.assertNever(o);return{status:r.value,value:t.data}}_addCheck(t){return new xi({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...Ae.errToObj(t)})}url(t){return this._addCheck({kind:"url",...Ae.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...Ae.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...Ae.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...Ae.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...Ae.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...Ae.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...Ae.errToObj(t)})}datetime(t){var n;return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,offset:(n=t==null?void 0:t.offset)!==null&&n!==void 0?n:!1,...Ae.errToObj(t==null?void 0:t.message)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...Ae.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n==null?void 0:n.position,...Ae.errToObj(n==null?void 0:n.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...Ae.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...Ae.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...Ae.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...Ae.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...Ae.errToObj(n)})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get minLength(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxLength(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}xi.create=e=>{var t;return new xi({checks:[],typeName:ye.ZodString,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...$e(e)})};function kxe(e,t){const n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,i=n>r?n:r,o=parseInt(e.toFixed(i).replace(".","")),a=parseInt(t.toFixed(i).replace(".",""));return o%a/Math.pow(10,i)}class fs extends Fe{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==ne.number){const o=this._getOrReturnCtx(t);return oe(o,{code:G.invalid_type,expected:ne.number,received:o.parsedType}),xe}let r;const i=new Ln;for(const o of this._def.checks)o.kind==="int"?He.isInteger(t.data)||(r=this._getOrReturnCtx(t,r),oe(r,{code:G.invalid_type,expected:"integer",received:"float",message:o.message}),i.dirty()):o.kind==="min"?(o.inclusive?t.data<o.value:t.data<=o.value)&&(r=this._getOrReturnCtx(t,r),oe(r,{code:G.too_small,minimum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),i.dirty()):o.kind==="max"?(o.inclusive?t.data>o.value:t.data>=o.value)&&(r=this._getOrReturnCtx(t,r),oe(r,{code:G.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),i.dirty()):o.kind==="multipleOf"?kxe(t.data,o.value)!==0&&(r=this._getOrReturnCtx(t,r),oe(r,{code:G.not_multiple_of,multipleOf:o.value,message:o.message}),i.dirty()):o.kind==="finite"?Number.isFinite(t.data)||(r=this._getOrReturnCtx(t,r),oe(r,{code:G.not_finite,message:o.message}),i.dirty()):He.assertNever(o);return{status:i.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,Ae.toString(n))}gt(t,n){return this.setLimit("min",t,!1,Ae.toString(n))}lte(t,n){return this.setLimit("max",t,!0,Ae.toString(n))}lt(t,n){return this.setLimit("max",t,!1,Ae.toString(n))}setLimit(t,n,r,i){return new fs({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:Ae.toString(i)}]})}_addCheck(t){return new fs({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:Ae.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Ae.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Ae.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Ae.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Ae.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:Ae.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:Ae.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Ae.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Ae.toString(t)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&He.isInteger(t.value))}get isFinite(){let t=null,n=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(t===null||r.value<t)&&(t=r.value)}return Number.isFinite(n)&&Number.isFinite(t)}}fs.create=e=>new fs({checks:[],typeName:ye.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...$e(e)});class ds extends Fe{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce&&(t.data=BigInt(t.data)),this._getType(t)!==ne.bigint){const o=this._getOrReturnCtx(t);return oe(o,{code:G.invalid_type,expected:ne.bigint,received:o.parsedType}),xe}let r;const i=new Ln;for(const o of this._def.checks)o.kind==="min"?(o.inclusive?t.data<o.value:t.data<=o.value)&&(r=this._getOrReturnCtx(t,r),oe(r,{code:G.too_small,type:"bigint",minimum:o.value,inclusive:o.inclusive,message:o.message}),i.dirty()):o.kind==="max"?(o.inclusive?t.data>o.value:t.data>=o.value)&&(r=this._getOrReturnCtx(t,r),oe(r,{code:G.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),i.dirty()):o.kind==="multipleOf"?t.data%o.value!==BigInt(0)&&(r=this._getOrReturnCtx(t,r),oe(r,{code:G.not_multiple_of,multipleOf:o.value,message:o.message}),i.dirty()):He.assertNever(o);return{status:i.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,Ae.toString(n))}gt(t,n){return this.setLimit("min",t,!1,Ae.toString(n))}lte(t,n){return this.setLimit("max",t,!0,Ae.toString(n))}lt(t,n){return this.setLimit("max",t,!1,Ae.toString(n))}setLimit(t,n,r,i){return new ds({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:Ae.toString(i)}]})}_addCheck(t){return new ds({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Ae.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Ae.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Ae.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Ae.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:Ae.toString(n)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}ds.create=e=>{var t;return new ds({checks:[],typeName:ye.ZodBigInt,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...$e(e)})};class ip extends Fe{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==ne.boolean){const r=this._getOrReturnCtx(t);return oe(r,{code:G.invalid_type,expected:ne.boolean,received:r.parsedType}),xe}return Hn(t.data)}}ip.create=e=>new ip({typeName:ye.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...$e(e)});class Fu extends Fe{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==ne.date){const o=this._getOrReturnCtx(t);return oe(o,{code:G.invalid_type,expected:ne.date,received:o.parsedType}),xe}if(isNaN(t.data.getTime())){const o=this._getOrReturnCtx(t);return oe(o,{code:G.invalid_date}),xe}const r=new Ln;let i;for(const o of this._def.checks)o.kind==="min"?t.data.getTime()<o.value&&(i=this._getOrReturnCtx(t,i),oe(i,{code:G.too_small,message:o.message,inclusive:!0,exact:!1,minimum:o.value,type:"date"}),r.dirty()):o.kind==="max"?t.data.getTime()>o.value&&(i=this._getOrReturnCtx(t,i),oe(i,{code:G.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),r.dirty()):He.assertNever(o);return{status:r.value,value:new Date(t.data.getTime())}}_addCheck(t){return new Fu({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:Ae.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:Ae.toString(n)})}get minDate(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t!=null?new Date(t):null}}Fu.create=e=>new Fu({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:ye.ZodDate,...$e(e)});class jm extends Fe{_parse(t){if(this._getType(t)!==ne.symbol){const r=this._getOrReturnCtx(t);return oe(r,{code:G.invalid_type,expected:ne.symbol,received:r.parsedType}),xe}return Hn(t.data)}}jm.create=e=>new jm({typeName:ye.ZodSymbol,...$e(e)});class op extends Fe{_parse(t){if(this._getType(t)!==ne.undefined){const r=this._getOrReturnCtx(t);return oe(r,{code:G.invalid_type,expected:ne.undefined,received:r.parsedType}),xe}return Hn(t.data)}}op.create=e=>new op({typeName:ye.ZodUndefined,...$e(e)});class ap extends Fe{_parse(t){if(this._getType(t)!==ne.null){const r=this._getOrReturnCtx(t);return oe(r,{code:G.invalid_type,expected:ne.null,received:r.parsedType}),xe}return Hn(t.data)}}ap.create=e=>new ap({typeName:ye.ZodNull,...$e(e)});class Ml extends Fe{constructor(){super(...arguments),this._any=!0}_parse(t){return Hn(t.data)}}Ml.create=e=>new Ml({typeName:ye.ZodAny,...$e(e)});class du extends Fe{constructor(){super(...arguments),this._unknown=!0}_parse(t){return Hn(t.data)}}du.create=e=>new du({typeName:ye.ZodUnknown,...$e(e)});class oa extends Fe{_parse(t){const n=this._getOrReturnCtx(t);return oe(n,{code:G.invalid_type,expected:ne.never,received:n.parsedType}),xe}}oa.create=e=>new oa({typeName:ye.ZodNever,...$e(e)});class Um extends Fe{_parse(t){if(this._getType(t)!==ne.undefined){const r=this._getOrReturnCtx(t);return oe(r,{code:G.invalid_type,expected:ne.void,received:r.parsedType}),xe}return Hn(t.data)}}Um.create=e=>new Um({typeName:ye.ZodVoid,...$e(e)});class $i extends Fe{_parse(t){const{ctx:n,status:r}=this._processInputParams(t),i=this._def;if(n.parsedType!==ne.array)return oe(n,{code:G.invalid_type,expected:ne.array,received:n.parsedType}),xe;if(i.exactLength!==null){const a=n.data.length>i.exactLength.value,s=n.data.length<i.exactLength.value;(a||s)&&(oe(n,{code:a?G.too_big:G.too_small,minimum:s?i.exactLength.value:void 0,maximum:a?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),r.dirty())}if(i.minLength!==null&&n.data.length<i.minLength.value&&(oe(n,{code:G.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),r.dirty()),i.maxLength!==null&&n.data.length>i.maxLength.value&&(oe(n,{code:G.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((a,s)=>i.type._parseAsync(new po(n,a,n.path,s)))).then(a=>Ln.mergeArray(r,a));const o=[...n.data].map((a,s)=>i.type._parseSync(new po(n,a,n.path,s)));return Ln.mergeArray(r,o)}get element(){return this._def.type}min(t,n){return new $i({...this._def,minLength:{value:t,message:Ae.toString(n)}})}max(t,n){return new $i({...this._def,maxLength:{value:t,message:Ae.toString(n)}})}length(t,n){return new $i({...this._def,exactLength:{value:t,message:Ae.toString(n)}})}nonempty(t){return this.min(1,t)}}$i.create=(e,t)=>new $i({type:e,minLength:null,maxLength:null,exactLength:null,typeName:ye.ZodArray,...$e(t)});function rl(e){if(e instanceof _t){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=ea.create(rl(r))}return new _t({...e._def,shape:()=>t})}else return e instanceof $i?new $i({...e._def,type:rl(e.element)}):e instanceof ea?ea.create(rl(e.unwrap())):e instanceof Mu?Mu.create(rl(e.unwrap())):e instanceof Ao?Ao.create(e.items.map(t=>rl(t))):e}class _t extends Fe{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const t=this._def.shape(),n=He.objectKeys(t);return this._cached={shape:t,keys:n}}_parse(t){if(this._getType(t)!==ne.object){const c=this._getOrReturnCtx(t);return oe(c,{code:G.invalid_type,expected:ne.object,received:c.parsedType}),xe}const{status:r,ctx:i}=this._processInputParams(t),{shape:o,keys:a}=this._getCached(),s=[];if(!(this._def.catchall instanceof oa&&this._def.unknownKeys==="strip"))for(const c in i.data)a.includes(c)||s.push(c);const u=[];for(const c of a){const l=o[c],d=i.data[c];u.push({key:{status:"valid",value:c},value:l._parse(new po(i,d,i.path,c)),alwaysSet:c in i.data})}if(this._def.catchall instanceof oa){const c=this._def.unknownKeys;if(c==="passthrough")for(const l of s)u.push({key:{status:"valid",value:l},value:{status:"valid",value:i.data[l]}});else if(c==="strict")s.length>0&&(oe(i,{code:G.unrecognized_keys,keys:s}),r.dirty());else if(c!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const c=this._def.catchall;for(const l of s){const d=i.data[l];u.push({key:{status:"valid",value:l},value:c._parse(new po(i,d,i.path,l)),alwaysSet:l in i.data})}}return i.common.async?Promise.resolve().then(async()=>{const c=[];for(const l of u){const d=await l.key;c.push({key:d,value:await l.value,alwaysSet:l.alwaysSet})}return c}).then(c=>Ln.mergeObjectSync(r,c)):Ln.mergeObjectSync(r,u)}get shape(){return this._def.shape()}strict(t){return Ae.errToObj,new _t({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(n,r)=>{var i,o,a,s;const u=(a=(o=(i=this._def).errorMap)===null||o===void 0?void 0:o.call(i,n,r).message)!==null&&a!==void 0?a:r.defaultError;return n.code==="unrecognized_keys"?{message:(s=Ae.errToObj(t).message)!==null&&s!==void 0?s:u}:{message:u}}}:{}})}strip(){return new _t({...this._def,unknownKeys:"strip"})}passthrough(){return new _t({...this._def,unknownKeys:"passthrough"})}extend(t){return new _t({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new _t({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:ye.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new _t({...this._def,catchall:t})}pick(t){const n={};return He.objectKeys(t).forEach(r=>{t[r]&&this.shape[r]&&(n[r]=this.shape[r])}),new _t({...this._def,shape:()=>n})}omit(t){const n={};return He.objectKeys(this.shape).forEach(r=>{t[r]||(n[r]=this.shape[r])}),new _t({...this._def,shape:()=>n})}deepPartial(){return rl(this)}partial(t){const n={};return He.objectKeys(this.shape).forEach(r=>{const i=this.shape[r];t&&!t[r]?n[r]=i:n[r]=i.optional()}),new _t({...this._def,shape:()=>n})}required(t){const n={};return He.objectKeys(this.shape).forEach(r=>{if(t&&!t[r])n[r]=this.shape[r];else{let o=this.shape[r];for(;o instanceof ea;)o=o._def.innerType;n[r]=o}}),new _t({...this._def,shape:()=>n})}keyof(){return kq(He.objectKeys(this.shape))}}_t.create=(e,t)=>new _t({shape:()=>e,unknownKeys:"strip",catchall:oa.create(),typeName:ye.ZodObject,...$e(t)});_t.strictCreate=(e,t)=>new _t({shape:()=>e,unknownKeys:"strict",catchall:oa.create(),typeName:ye.ZodObject,...$e(t)});_t.lazycreate=(e,t)=>new _t({shape:e,unknownKeys:"strip",catchall:oa.create(),typeName:ye.ZodObject,...$e(t)});class sp extends Fe{_parse(t){const{ctx:n}=this._processInputParams(t),r=this._def.options;function i(o){for(const s of o)if(s.result.status==="valid")return s.result;for(const s of o)if(s.result.status==="dirty")return n.common.issues.push(...s.ctx.common.issues),s.result;const a=o.map(s=>new Ei(s.ctx.common.issues));return oe(n,{code:G.invalid_union,unionErrors:a}),xe}if(n.common.async)return Promise.all(r.map(async o=>{const a={...n,common:{...n.common,issues:[]},parent:null};return{result:await o._parseAsync({data:n.data,path:n.path,parent:a}),ctx:a}})).then(i);{let o;const a=[];for(const u of r){const c={...n,common:{...n.common,issues:[]},parent:null},l=u._parseSync({data:n.data,path:n.path,parent:c});if(l.status==="valid")return l;l.status==="dirty"&&!o&&(o={result:l,ctx:c}),c.common.issues.length&&a.push(c.common.issues)}if(o)return n.common.issues.push(...o.ctx.common.issues),o.result;const s=a.map(u=>new Ei(u));return oe(n,{code:G.invalid_union,unionErrors:s}),xe}}get options(){return this._def.options}}sp.create=(e,t)=>new sp({options:e,typeName:ye.ZodUnion,...$e(t)});const nm=e=>e instanceof lp?nm(e.schema):e instanceof Li?nm(e.innerType()):e instanceof fp?[e.value]:e instanceof ps?e.options:e instanceof dp?Object.keys(e.enum):e instanceof pp?nm(e._def.innerType):e instanceof op?[void 0]:e instanceof ap?[null]:null;class K0 extends Fe{_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==ne.object)return oe(n,{code:G.invalid_type,expected:ne.object,received:n.parsedType}),xe;const r=this.discriminator,i=n.data[r],o=this.optionsMap.get(i);return o?n.common.async?o._parseAsync({data:n.data,path:n.path,parent:n}):o._parseSync({data:n.data,path:n.path,parent:n}):(oe(n,{code:G.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),xe)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,r){const i=new Map;for(const o of n){const a=nm(o.shape[t]);if(!a)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(const s of a){if(i.has(s))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(s)}`);i.set(s,o)}}return new K0({typeName:ye.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:i,...$e(r)})}}function aC(e,t){const n=Xa(e),r=Xa(t);if(e===t)return{valid:!0,data:e};if(n===ne.object&&r===ne.object){const i=He.objectKeys(t),o=He.objectKeys(e).filter(s=>i.indexOf(s)!==-1),a={...e,...t};for(const s of o){const u=aC(e[s],t[s]);if(!u.valid)return{valid:!1};a[s]=u.data}return{valid:!0,data:a}}else if(n===ne.array&&r===ne.array){if(e.length!==t.length)return{valid:!1};const i=[];for(let o=0;o<e.length;o++){const a=e[o],s=t[o],u=aC(a,s);if(!u.valid)return{valid:!1};i.push(u.data)}return{valid:!0,data:i}}else return n===ne.date&&r===ne.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class up extends Fe{_parse(t){const{status:n,ctx:r}=this._processInputParams(t),i=(o,a)=>{if(iC(o)||iC(a))return xe;const s=aC(o.value,a.value);return s.valid?((oC(o)||oC(a))&&n.dirty(),{status:n.value,value:s.data}):(oe(r,{code:G.invalid_intersection_types}),xe)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([o,a])=>i(o,a)):i(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}up.create=(e,t,n)=>new up({left:e,right:t,typeName:ye.ZodIntersection,...$e(n)});class Ao extends Fe{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==ne.array)return oe(r,{code:G.invalid_type,expected:ne.array,received:r.parsedType}),xe;if(r.data.length<this._def.items.length)return oe(r,{code:G.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),xe;!this._def.rest&&r.data.length>this._def.items.length&&(oe(r,{code:G.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const o=[...r.data].map((a,s)=>{const u=this._def.items[s]||this._def.rest;return u?u._parse(new po(r,a,r.path,s)):null}).filter(a=>!!a);return r.common.async?Promise.all(o).then(a=>Ln.mergeArray(n,a)):Ln.mergeArray(n,o)}get items(){return this._def.items}rest(t){return new Ao({...this._def,rest:t})}}Ao.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Ao({items:e,typeName:ye.ZodTuple,rest:null,...$e(t)})};class cp extends Fe{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==ne.object)return oe(r,{code:G.invalid_type,expected:ne.object,received:r.parsedType}),xe;const i=[],o=this._def.keyType,a=this._def.valueType;for(const s in r.data)i.push({key:o._parse(new po(r,s,r.path,s)),value:a._parse(new po(r,r.data[s],r.path,s))});return r.common.async?Ln.mergeObjectAsync(n,i):Ln.mergeObjectSync(n,i)}get element(){return this._def.valueType}static create(t,n,r){return n instanceof Fe?new cp({keyType:t,valueType:n,typeName:ye.ZodRecord,...$e(r)}):new cp({keyType:xi.create(),valueType:t,typeName:ye.ZodRecord,...$e(n)})}}class Bm extends Fe{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==ne.map)return oe(r,{code:G.invalid_type,expected:ne.map,received:r.parsedType}),xe;const i=this._def.keyType,o=this._def.valueType,a=[...r.data.entries()].map(([s,u],c)=>({key:i._parse(new po(r,s,r.path,[c,"key"])),value:o._parse(new po(r,u,r.path,[c,"value"]))}));if(r.common.async){const s=new Map;return Promise.resolve().then(async()=>{for(const u of a){const c=await u.key,l=await u.value;if(c.status==="aborted"||l.status==="aborted")return xe;(c.status==="dirty"||l.status==="dirty")&&n.dirty(),s.set(c.value,l.value)}return{status:n.value,value:s}})}else{const s=new Map;for(const u of a){const c=u.key,l=u.value;if(c.status==="aborted"||l.status==="aborted")return xe;(c.status==="dirty"||l.status==="dirty")&&n.dirty(),s.set(c.value,l.value)}return{status:n.value,value:s}}}}Bm.create=(e,t,n)=>new Bm({valueType:t,keyType:e,typeName:ye.ZodMap,...$e(n)});class ku extends Fe{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==ne.set)return oe(r,{code:G.invalid_type,expected:ne.set,received:r.parsedType}),xe;const i=this._def;i.minSize!==null&&r.data.size<i.minSize.value&&(oe(r,{code:G.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),n.dirty()),i.maxSize!==null&&r.data.size>i.maxSize.value&&(oe(r,{code:G.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),n.dirty());const o=this._def.valueType;function a(u){const c=new Set;for(const l of u){if(l.status==="aborted")return xe;l.status==="dirty"&&n.dirty(),c.add(l.value)}return{status:n.value,value:c}}const s=[...r.data.values()].map((u,c)=>o._parse(new po(r,u,r.path,c)));return r.common.async?Promise.all(s).then(u=>a(u)):a(s)}min(t,n){return new ku({...this._def,minSize:{value:t,message:Ae.toString(n)}})}max(t,n){return new ku({...this._def,maxSize:{value:t,message:Ae.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}}ku.create=(e,t)=>new ku({valueType:e,minSize:null,maxSize:null,typeName:ye.ZodSet,...$e(t)});class Al extends Fe{constructor(){super(...arguments),this.validate=this.implement}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==ne.function)return oe(n,{code:G.invalid_type,expected:ne.function,received:n.parsedType}),xe;function r(s,u){return km({data:s,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Fm(),rp].filter(c=>!!c),issueData:{code:G.invalid_arguments,argumentsError:u}})}function i(s,u){return km({data:s,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Fm(),rp].filter(c=>!!c),issueData:{code:G.invalid_return_type,returnTypeError:u}})}const o={errorMap:n.common.contextualErrorMap},a=n.data;return this._def.returns instanceof Ll?Hn(async(...s)=>{const u=new Ei([]),c=await this._def.args.parseAsync(s,o).catch(p=>{throw u.addIssue(r(s,p)),u}),l=await a(...c);return await this._def.returns._def.type.parseAsync(l,o).catch(p=>{throw u.addIssue(i(l,p)),u})}):Hn((...s)=>{const u=this._def.args.safeParse(s,o);if(!u.success)throw new Ei([r(s,u.error)]);const c=a(...u.data),l=this._def.returns.safeParse(c,o);if(!l.success)throw new Ei([i(c,l.error)]);return l.data})}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new Al({...this._def,args:Ao.create(t).rest(du.create())})}returns(t){return new Al({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,n,r){return new Al({args:t||Ao.create([]).rest(du.create()),returns:n||du.create(),typeName:ye.ZodFunction,...$e(r)})}}class lp extends Fe{get schema(){return this._def.getter()}_parse(t){const{ctx:n}=this._processInputParams(t);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}lp.create=(e,t)=>new lp({getter:e,typeName:ye.ZodLazy,...$e(t)});class fp extends Fe{_parse(t){if(t.data!==this._def.value){const n=this._getOrReturnCtx(t);return oe(n,{received:n.data,code:G.invalid_literal,expected:this._def.value}),xe}return{status:"valid",value:t.data}}get value(){return this._def.value}}fp.create=(e,t)=>new fp({value:e,typeName:ye.ZodLiteral,...$e(t)});function kq(e,t){return new ps({values:e,typeName:ye.ZodEnum,...$e(t)})}class ps extends Fe{_parse(t){if(typeof t.data!="string"){const n=this._getOrReturnCtx(t),r=this._def.values;return oe(n,{expected:He.joinValues(r),received:n.parsedType,code:G.invalid_type}),xe}if(this._def.values.indexOf(t.data)===-1){const n=this._getOrReturnCtx(t),r=this._def.values;return oe(n,{received:n.data,code:G.invalid_enum_value,options:r}),xe}return Hn(t.data)}get options(){return this._def.values}get enum(){const t={};for(const n of this._def.values)t[n]=n;return t}get Values(){const t={};for(const n of this._def.values)t[n]=n;return t}get Enum(){const t={};for(const n of this._def.values)t[n]=n;return t}extract(t){return ps.create(t)}exclude(t){return ps.create(this.options.filter(n=>!t.includes(n)))}}ps.create=kq;class dp extends Fe{_parse(t){const n=He.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(t);if(r.parsedType!==ne.string&&r.parsedType!==ne.number){const i=He.objectValues(n);return oe(r,{expected:He.joinValues(i),received:r.parsedType,code:G.invalid_type}),xe}if(n.indexOf(t.data)===-1){const i=He.objectValues(n);return oe(r,{received:r.data,code:G.invalid_enum_value,options:i}),xe}return Hn(t.data)}get enum(){return this._def.values}}dp.create=(e,t)=>new dp({values:e,typeName:ye.ZodNativeEnum,...$e(t)});class Ll extends Fe{unwrap(){return this._def.type}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==ne.promise&&n.common.async===!1)return oe(n,{code:G.invalid_type,expected:ne.promise,received:n.parsedType}),xe;const r=n.parsedType===ne.promise?n.data:Promise.resolve(n.data);return Hn(r.then(i=>this._def.type.parseAsync(i,{path:n.path,errorMap:n.common.contextualErrorMap})))}}Ll.create=(e,t)=>new Ll({type:e,typeName:ye.ZodPromise,...$e(t)});class Li extends Fe{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ye.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:n,ctx:r}=this._processInputParams(t),i=this._def.effect||null;if(i.type==="preprocess"){const a=i.transform(r.data);return r.common.async?Promise.resolve(a).then(s=>this._def.schema._parseAsync({data:s,path:r.path,parent:r})):this._def.schema._parseSync({data:a,path:r.path,parent:r})}const o={addIssue:a=>{oe(r,a),a.fatal?n.abort():n.dirty()},get path(){return r.path}};if(o.addIssue=o.addIssue.bind(o),i.type==="refinement"){const a=s=>{const u=i.refinement(s,o);if(r.common.async)return Promise.resolve(u);if(u instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return s};if(r.common.async===!1){const s=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return s.status==="aborted"?xe:(s.status==="dirty"&&n.dirty(),a(s.value),{status:n.value,value:s.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(s=>s.status==="aborted"?xe:(s.status==="dirty"&&n.dirty(),a(s.value).then(()=>({status:n.value,value:s.value}))))}if(i.type==="transform")if(r.common.async===!1){const a=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!Mm(a))return a;const s=i.transform(a.value,o);if(s instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:s}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(a=>Mm(a)?Promise.resolve(i.transform(a.value,o)).then(s=>({status:n.value,value:s})):a);He.assertNever(i)}}Li.create=(e,t,n)=>new Li({schema:e,typeName:ye.ZodEffects,effect:t,...$e(n)});Li.createWithPreprocess=(e,t,n)=>new Li({schema:t,effect:{type:"preprocess",transform:e},typeName:ye.ZodEffects,...$e(n)});class ea extends Fe{_parse(t){return this._getType(t)===ne.undefined?Hn(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}ea.create=(e,t)=>new ea({innerType:e,typeName:ye.ZodOptional,...$e(t)});class Mu extends Fe{_parse(t){return this._getType(t)===ne.null?Hn(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Mu.create=(e,t)=>new Mu({innerType:e,typeName:ye.ZodNullable,...$e(t)});class pp extends Fe{_parse(t){const{ctx:n}=this._processInputParams(t);let r=n.data;return n.parsedType===ne.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}pp.create=(e,t)=>new pp({innerType:e,typeName:ye.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...$e(t)});class Pm extends Fe{_parse(t){const{ctx:n}=this._processInputParams(t),r={...n,common:{...n.common,issues:[]}},i=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return Lm(i)?i.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new Ei(r.common.issues)},input:r.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Ei(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}Pm.create=(e,t)=>new Pm({innerType:e,typeName:ye.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...$e(t)});class Wm extends Fe{_parse(t){if(this._getType(t)!==ne.nan){const r=this._getOrReturnCtx(t);return oe(r,{code:G.invalid_type,expected:ne.nan,received:r.parsedType}),xe}return{status:"valid",value:t.data}}}Wm.create=e=>new Wm({typeName:ye.ZodNaN,...$e(e)});const Mxe=Symbol("zod_brand");class Mq extends Fe{_parse(t){const{ctx:n}=this._processInputParams(t),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}}class Sh extends Fe{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.common.async)return(async()=>{const o=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return o.status==="aborted"?xe:o.status==="dirty"?(n.dirty(),Fq(o.value)):this._def.out._parseAsync({data:o.value,path:r.path,parent:r})})();{const i=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?xe:i.status==="dirty"?(n.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:r.path,parent:r})}}static create(t,n){return new Sh({in:t,out:n,typeName:ye.ZodPipeline})}}const Lq=(e,t={},n)=>e?Ml.create().superRefine((r,i)=>{var o,a;if(!e(r)){const s=typeof t=="function"?t(r):typeof t=="string"?{message:t}:t,u=(a=(o=s.fatal)!==null&&o!==void 0?o:n)!==null&&a!==void 0?a:!0,c=typeof s=="string"?{message:s}:s;i.addIssue({code:"custom",...c,fatal:u})}}):Ml.create(),Lxe={object:_t.lazycreate};var ye;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline"})(ye||(ye={}));const jxe=(e,t={message:`Input not instance of ${e.name}`})=>Lq(n=>n instanceof e,t),Yo=xi.create,Dm=fs.create,Uxe=Wm.create,Bxe=ds.create,jq=ip.create,Pxe=Fu.create,Wxe=jm.create,Dxe=op.create,Kxe=ap.create,Nxe=Ml.create,qxe=du.create,Vxe=oa.create,Qxe=Um.create,Uq=$i.create,Ap=_t.create,zxe=_t.strictCreate,Hxe=sp.create,Yxe=K0.create,Gxe=up.create,Jxe=Ao.create,Zxe=cp.create,Xxe=Bm.create,ewe=ku.create,twe=Al.create,nwe=lp.create,rwe=fp.create,iwe=ps.create,owe=dp.create,awe=Ll.create,HF=Li.create,swe=ea.create,uwe=Mu.create,cwe=Li.createWithPreprocess,lwe=Sh.create,fwe=()=>Yo().optional(),dwe=()=>Dm().optional(),pwe=()=>jq().optional(),Awe={string:e=>xi.create({...e,coerce:!0}),number:e=>fs.create({...e,coerce:!0}),boolean:e=>ip.create({...e,coerce:!0}),bigint:e=>ds.create({...e,coerce:!0}),date:e=>Fu.create({...e,coerce:!0})},hwe=xe;var L=Object.freeze({__proto__:null,defaultErrorMap:rp,setErrorMap:Cxe,getErrorMap:Fm,makeIssue:km,EMPTY_PATH:Sxe,addIssueToContext:oe,ParseStatus:Ln,INVALID:xe,DIRTY:Fq,OK:Hn,isAborted:iC,isDirty:oC,isValid:Mm,isAsync:Lm,get util(){return He},get objectUtil(){return rC},ZodParsedType:ne,getParsedType:Xa,ZodType:Fe,ZodString:xi,ZodNumber:fs,ZodBigInt:ds,ZodBoolean:ip,ZodDate:Fu,ZodSymbol:jm,ZodUndefined:op,ZodNull:ap,ZodAny:Ml,ZodUnknown:du,ZodNever:oa,ZodVoid:Um,ZodArray:$i,ZodObject:_t,ZodUnion:sp,ZodDiscriminatedUnion:K0,ZodIntersection:up,ZodTuple:Ao,ZodRecord:cp,ZodMap:Bm,ZodSet:ku,ZodFunction:Al,ZodLazy:lp,ZodLiteral:fp,ZodEnum:ps,ZodNativeEnum:dp,ZodPromise:Ll,ZodEffects:Li,ZodTransformer:Li,ZodOptional:ea,ZodNullable:Mu,ZodDefault:pp,ZodCatch:Pm,ZodNaN:Wm,BRAND:Mxe,ZodBranded:Mq,ZodPipeline:Sh,custom:Lq,Schema:Fe,ZodSchema:Fe,late:Lxe,get ZodFirstPartyTypeKind(){return ye},coerce:Awe,any:Nxe,array:Uq,bigint:Bxe,boolean:jq,date:Pxe,discriminatedUnion:Yxe,effect:HF,enum:iwe,function:twe,instanceof:jxe,intersection:Gxe,lazy:nwe,literal:rwe,map:Xxe,nan:Uxe,nativeEnum:owe,never:Vxe,null:Kxe,nullable:uwe,number:Dm,object:Ap,oboolean:pwe,onumber:dwe,optional:swe,ostring:fwe,pipeline:lwe,preprocess:cwe,promise:awe,record:Zxe,set:ewe,strictObject:zxe,string:Yo,symbol:Wxe,transformer:HF,tuple:Jxe,undefined:Dxe,union:Hxe,unknown:qxe,void:Qxe,NEVER:hwe,ZodIssueCode:G,quotelessJson:bxe,ZodError:Ei});const mwe=L.object({id:L.string(),label:L.string(),repeatable:L.boolean(),status:L.boolean()}),gwe=L.array(mwe);function Bq(e,t,n){return pe.request(new URL("customtypes",e),{headers:{repository:t},credentials:pe.getRequestCredentials(n),okType:gwe})}const vwe=L.object({first_name:L.string().optional(),last_name:L.string().optional(),email:L.string().optional(),uploadedAvatar:L.string().optional()}),LR=L.object({id:L.string(),name:L.string(),is_master:L.boolean().optional()}),ywe=L.discriminatedUnion("status",[L.object({status:L.literal("unclassified")}),L.object({status:L.literal("published")}),L.object({status:L.literal("release"),release_id:L.string()}),L.object({status:L.literal("archived")})]).and(L.object({version_id:L.string(),tags:L.array(L.string()),custom_type_label:L.string(),preview_summary:L.string().optional(),preview_image:L.string().optional(),last_modified_date:L.coerce.date(),author:vwe,uid:L.string().optional()})),jR=L.object({id:L.string(),title:L.string().nullish().transform(e=>e??"Untitled"),custom_type_id:L.string(),group_lang_id:L.string(),language:LR,versions:L.array(ywe)}),Pq=L.object({total:L.number(),cursor:L.string().optional(),results:L.array(jR)}),bwe=L.object({id:L.string(),title:L.string(),repository_id:L.string(),tags:L.array(L.string()).optional()}).passthrough(),Cwe=L.object({results:L.array(bwe)});function UR(e,t,n,r,i){const o=new URL("documents",e);return r&&o.searchParams.set("limit",r.toString()),i&&o.searchParams.set("cursor",i),o.search+=`&${n}`,pe.request(o,{credentials:pe.getRequestCredentials(t),okType:Pq})}function Wq(e){const{baseUrl:t,authStrategy:n,limit:r,cursor:i,status:o,authors:a,language:s,group_lang_id:u,document_id:c,customTypes:l,tags:d,term:p,signal:A}=e,m=new URL("documents",t),v=[];return r&&v.push({name:"limit",values:[r.toString()]}),i&&v.push({name:"cursor",values:[i]}),o!=null&&o.length&&v.push({name:"status",values:o}),a!=null&&a.length&&v.push({name:"authors",values:a}),s&&v.push({name:"language",values:[s]}),u&&v.push({name:"group_lang_id",values:[u]}),c!=null&&c.length&&v.push({name:"document_id",values:c}),l!=null&&l.length&&v.push({name:"customTypes",values:l}),d!=null&&d.length&&v.push({name:"tags",values:d}),p&&v.push({name:"term",values:[p]}),m.search=new URLSearchParams(N0(v)).toString(),pe.request(m,{credentials:pe.getRequestCredentials(n),okType:Pq,signal:A})}function Dq(e,t,n,r){const i=new URL(e);return i.search=n,pe.request(i,{credentials:pe.getRequestCredentials(t),okType:Cwe,...r})}function Kq(e){const{repository:t,searchTerm:n,tags:r,localeId:i,customTypesIds:o}=e,a=new URLSearchParams;return a.append("repository",t),n&&a.append("searchTerm",n),r!=null&&r.length&&a.append("tags",r.toString()),i&&a.append("localeId",i),o!=null&&o.length&&a.append("customTypesIds",o.toString()),a.toString()}function N0(e){return e.reduce((t,n)=>{if(n.values.every(i=>i===""||i===void 0))return t;const r=n.values.map(i=>[n.name,i??""]);return t.concat(r)},[])}function Nq(e,t,n){return pe.request(new URL(`documents/${n}`,e),{credentials:pe.getRequestCredentials(t),okType:jR})}const Swe=L.custom().transform((e,t)=>{const n=Ce.Document.decode(e);return n._tag==="Left"?(t.addIssue({code:L.ZodIssueCode.custom,message:"Invalid document."}),L.NEVER):n.right});function BR(e){const t=Vl.keys(e).flatMap(r=>{const i=e[r];return i?{name:r,values:i}:[]});return new URLSearchParams(N0(t)).toString()}async function qq(e,t,n){if(n.length===0)return[];const r=n.slice(0,50).map(({id:a})=>a),i=await Wq({baseUrl:e,authStrategy:t,document_id:r}),o=new Map(r.map((a,s)=>[a,s]));return i.results.sort((a,s)=>{const u=o.get(a.id),c=o.get(s.id);return(u??1/0)-(c??1/0)})}const _we=L.unknown().transform((e,t)=>{const n=Ce.SliceItemContent.decode(e);return n._tag==="Right"?n.right:(t.addIssue({code:L.ZodIssueCode.custom,message:"Invalid slice content."}),L.NEVER)}),Jo={all:()=>["documents"],lists:()=>[...Jo.all(),"list"],list:e=>[...Jo.lists(),e],infiniteLists:()=>[...Jo.all(),"list:infinite"],infiniteList:e=>[...Jo.infiniteLists(),e]};function Iwe(e,t){e.setQueriesData({queryKey:Jo.lists()},n=>n&&YF(n,t)),e.setQueriesData({queryKey:Jo.infiniteLists()},n=>n&&{...n,pages:n.pages.map(r=>YF(r,t))})}function YF(e,t){const n=e.results.flatMap(r=>{const i=t(r,e);return i?[i]:[]});return{...e,results:n,total:e.total+(n.length-e.results.length)}}async function Twe(e){await e.invalidateQueries({queryKey:Jo.lists()}),await e.invalidateQueries({queryKey:Jo.infiniteLists()})}const xwe=["createPrismicProject","chooseLocale","createProject","setupSliceMachine","createPageType","codePage","createSlice","reviewAndPush","createContent","renderPage"],PR=L.enum(xwe),wwe=["next","nuxt","sveltekit","other"],Ewe=L.enum(wwe),Vq=L.object({completedSteps:L.array(PR),isDismissed:L.boolean(),context:L.object({framework:Ewe,starterId:L.string().nullable()})}),Qq=L.object({completedSteps:L.array(PR)}),zq=L.object({isDismissed:L.boolean()});function $we(e,t,n){const r=new URL("onboarding",e);return r.searchParams.append("repository",t),pe.request(r,{headers:{repository:t},credentials:pe.getRequestCredentials(n),okType:Vq})}function Rwe(e,t,n,r){const i=new URL(`onboarding/${e}/toggle`,t);return i.searchParams.append("repository",n),pe.request(i,{method:"PATCH",headers:{repository:n},credentials:pe.getRequestCredentials(r),okType:Qq})}function Owe(e,t,n){const r=new URL("onboarding/toggle",e);return r.searchParams.append("repository",t),pe.request(r,{method:"PATCH",headers:{repository:t},credentials:pe.getRequestCredentials(n),okType:zq})}const Fwe=L.object({id:L.string(),firstname:L.string().optional(),lastname:L.string().optional(),email:L.string(),uploadedAvatar:L.string().optional()}),kwe=L.array(Fwe),Mwe=L.object({slicemachineEnabled:L.boolean()}),Hq=["next","nuxt","sveltekit"];function Lwe(e){return Hq.includes(e)}const jwe=L.preprocess(e=>typeof e=="string"&&Lwe(e)?e:"other",L.enum([...Hq,"other"])),Uwe=L.object({simulator_url:L.string().url().nullish(),languages:L.array(LR).transform(e=>Qt.sort(e,t=>t.name)),authors:kwe.optional().default([]),quotas:Mwe.optional().default({slicemachineEnabled:!1}),framework:jwe.optional().default("other"),starterId:L.string().optional(),storageVersion:L.object({major:L.number().int(),minor:L.number().int()})}).transform(({simulator_url:e,framework:t,...n})=>{const r=e&&Yq(e)?e:void 0;return{...n,framework:t,simulatorUrl:r,isSupportedFramework:t!=="other"}});function q0(e,t){return pe.request(new URL("repository",e),{credentials:pe.getRequestCredentials(t),okType:Uwe})}function Yq(e){const t=Fr.toURL(e);return t?t.pathname.endsWith("/slice-simulator"):!1}const Bwe=L.object({results:L.array(L.string())});function Gq(e,t){return pe.request(new URL("repository/tags",e),{credentials:pe.getRequestCredentials(t),okType:Bwe})}const Jq=L.enum(["Owner","Administrator","Writer","Manager","Readonly"]),Pwe=L.record(Jq.optional()),Wwe=Jq.or(Pwe),Dwe={SuperUser:"SuperUser",Owner:"Owner",Administrator:"Administrator",Manager:"Publisher",Writer:"Writer",Readonly:"Contributor"},Zq=L.object({shortId:L.string(),intercomHash:L.string(),email:L.string(),firstName:L.string(),lastName:L.string(),superPower:L.boolean(),repositories:L.array(L.object({domain:L.string(),role:Wwe}))});function Xq(e,t){const n=new URL("profile",e);return pe.request(n,{credentials:pe.getRequestCredentials(t),okType:Zq})}function WR(){const e=Ee();e.userServiceBaseUrl||Jt("userServiceBaseUrl");const{authStrategy:t,userServiceBaseUrl:n}=e;return Ve.useRequest(Xq,[n,t])}const Kwe="https://prismic.io/docs/guides/manage-images#supported-media";function _h(){const e=Ee();e.mediaLibrary||Jt("mediaLibrary");const{assetsApiBaseUrl:t,authStrategy:n,repository:r}=e,{items:i}=Ve.useRequest(e7,[t,r,n]);return{tags:i}}function e7(e,t,n){return pe.request(new URL("tags",e),{credentials:pe.getRequestCredentials(n),okType:Nwe,headers:{repository:t}})}const t7=1,n7=20,DR=L.string().min(t7).max(n7),KR=L.object({id:L.string(),name:DR,uploader_id:L.string().optional(),created_at:L.number(),last_modified:L.number(),count:L.number().optional().default(0)}),Nwe=L.object({items:L.array(KR)});function Ih(e){Ve.updateFetcherData(e7,t=>{const{items:n}=t,r=e(n);if(r)return{items:r}})}function qwe(e){const{assetType:t,keyword:n,mode:r,tagIds:i}=e,o=Ee();o.mediaLibrary||Jt("mediaLibrary");const{onAnalyticsEvent:a}=o,s=Ve.useFetcherData(mi),u=s[s.length-1],c=$.useRef(u);c.current=u,$.useEffect(()=>{if(!a||!n||!c.current||c.current.keyword!==n)return;const l=String(n.split(" ").length),d=String(c.current.total),p=i.join(",");a("Media Library Search",{searchQuery:n,numberOfWords:l,numberOfResults:d,timeToGetResults:c.current.time,assetType:t,mode:r,tags:p})},[n,t,r,a,i])}function Vwe(e){const{assetType:t,mediaDialogOpen:n}=e,r=Ee(),i=Ve.useFetcherData(mi),o=$.useRef(0);$.useEffect(()=>{n&&(o.current=performance.now())},[n]);function a(s){if(!r.onAnalyticsEvent||!r.mediaLibrary)return;const u=i[i.length-1];if(!u)return;const{keyword:c,uploaderId:l,tags:d}=u,p=o7(i,c,t,l,d),A=String(c.split(" ").length),m=String(u.total),v=p.findIndex(x=>x.id===s),_=String(v+1),C=[s].join(","),I=(performance.now()-o.current).toFixed(0);r.onAnalyticsEvent("Media Added To Page",{assetType:t,searchQuery:c,numberOfWords:A,numberOfResults:m,searchPosition:_,mediaIds:C,timeToAddMediaToPage:I,tags:d})}return a}const Kh=L.array(L.string()).optional().transform(e=>e==null?void 0:e[0]),V0=L.object({id:L.string(),kind:L.string(),extension:L.string().optional(),filename:L.string(),width:L.number().optional(),height:L.number().optional(),last_modified:L.number(),url:L.string(),alt:L.string().optional(),uploader_id:L.string().optional(),size:L.number(),notes:L.string().optional(),credits:L.string().optional(),search_highlight:L.object({filename:Kh,alt:Kh,notes:Kh,credits:Kh}).optional(),tags:L.array(KR)}),r7={"X-Prismic-Source":"Wroom"},Qwe=L.object({total:L.number(),cursor:L.string().optional(),items:L.array(V0)}),i7=30;function mi(e,t,n,r,i,o,a,s,u){const c=e?new URL("assets",e):void 0,l=new URLSearchParams(N0([{name:"limit",values:[`${i7}`]},{name:"cursor",values:[u]},{name:"keyword",values:[r]},{name:"assetType",values:[i]},{name:"uploaderId",values:[o]},{name:"tags",values:a.split(",")}])).toString(),d=Qwe.transform(A=>({...A,keyword:r,assetType:i,uploaderId:o,tags:a,page:s})),p=performance.now();return pe.request(`${(c==null?void 0:c.href)??""}?${l}`,{headers:{repository:t,...r7},credentials:pe.getRequestCredentials(n),okType:d}).then(A=>({...A,time:(performance.now()-p).toFixed(0)}))}Ve.cache.registerFetcherConfig(mi,{revalidationStrategy:{type:"never"}});const Vn={keyword:"",assetType:"all",uploaderId:void 0,tagIds:[]};function zwe(e){const{initialAssetType:t=Vn.assetType,mode:n}=e,r=Ee(),[i,o]=$.useState({...Vn,assetType:t,page:0});r.mediaLibrary||Jt("mediaLibrary");const{assetsApiBaseUrl:a,authStrategy:s,repository:u}=r,{page:c,cursor:l,keyword:d,assetType:p,uploaderId:A,tagIds:m}=i,v=Ve.useRequest(mi,hp({assetsApiBaseUrl:a,authStrategy:s,repository:u,keyword:d,assetType:p,uploaderId:A,tagIds:m,page:c,cursor:l}));qwe({assetType:p,keyword:d,tagIds:m,mode:n});const _=Jwe(d,p,A,m),C=v.total!==_.length;function I(){v.cursor!==void 0&&o(y=>({...y,page:y.page+1,cursor:v.cursor}))}function x(y){o(T=>({...T,page:0,cursor:void 0})),Lu((T,w)=>{if(w.page===0)return[...y,...T]})}function g(y){o(T=>({...T,...y,page:0,cursor:void 0}))}function S(){o(y=>({...y,...Vn,assetType:t==="all"?Vn.assetType:y.assetType,page:0,cursor:void 0}))}return{keyword:d,assetType:p,uploaderId:A,tagIds:m,setFilters:g,resetFilters:S,media:_,mediaTotal:v.total,limit:i7,hasNextPage:C,fetchNextPage:I,updateMedia:Hwe,unshiftMedia:x,deleteMedia:Ywe,deleteSearchData:Gwe,revalidateFirstPage:a7}}function Hwe(e){Lu(t=>t.flatMap(n=>{const r=e.find(i=>i.id===n.id);return r?r.response===void 0?[]:{...n,...r.response}:n}))}function Ywe(e){Lu(t=>t.filter(n=>!e.includes(n.id)))}function Gwe(e){const{keyword:t,assetType:n,uploaderId:r,tagIds:i}=e,o=i==null?void 0:i.join(",");Ve.updateFetcherData(mi,a=>{if(!(a.keyword===t&&a.assetType===n&&a.uploaderId===r&&a.tags===o))return a})}function o7(e,t,n,r,i){const o=e.filter(u=>u.keyword===t&&u.assetType===n&&u.uploaderId===r&&u.tags===i),s=Qt.sort(o,u=>u.page).flatMap(u=>u.items);return t?Qt.uniqBy(s,u=>u.id):s}function Jwe(e,t,n,r){const i=Ve.useFetcherData(mi);return o7(i,e,t,n,r.join(","))}function Lu(e){Ve.updateFetcherData(mi,t=>{const{items:n,total:r}=t,i=e(n,t);if(i)return{...t,total:r+(i.length-n.length),items:i}})}function a7(e){const{config:t,keyword:n=Vn.keyword,assetType:r=Vn.assetType,tagIds:i=Vn.tagIds}=e;if(!t.mediaLibrary)throw new Error("media library is not configured");const{assetsApiBaseUrl:o,authStrategy:a,repository:s}=t;Ve.revalidateData(mi,hp({assetsApiBaseUrl:o,repository:s,authStrategy:a,keyword:n,assetType:r,tagIds:i,page:0}))}function s7(e){const{config:t,keyword:n=Vn.keyword,assetType:r=Vn.assetType,tagIds:i=Vn.tagIds}=e;if(!t.mediaLibrary)throw new Error("media library is not configured");Ve.updateFetcherData(mi,o=>o.page===0?o:void 0),a7({config:t,keyword:n,assetType:r,tagIds:i})}function hp(e){return[e.assetsApiBaseUrl,e.repository,e.authStrategy,e.keyword,e.assetType,e.uploaderId,e.tagIds.join(","),e.page,e.cursor]}function u7(){const e=Ee();e.mediaLibrary||Jt("mediaLibrary");const{assetsApiBaseUrl:t,coreApiBaseUrl:n,authStrategy:r,repository:i}=e,{authors:o}=Ve.useRequest(q0,[n,r]),{items:a}=Ve.useRequest(c7,[t,i,r]),{shortId:s}=WR(),u=new Map(o.map(d=>[d.id,d])),c=[];for(const d of a){if(d.id==="ghost"){c.push({id:d.id,name:"Ghost",uploadedAvatar:"https://images.prismic.io/page-builder-assets/ZuAXWBoQrfVKl5sD_ghost_user.png?auto=format,compress&w=64"});continue}const p=u.get(d.id);if(!p)continue;let A;if(p.uploadedAvatar){const m=new URL(p.uploadedAvatar);m.searchParams.set("w","64"),A=m.toString()}c.push({id:d.id,name:[p.firstname,p.lastname].filter(Boolean).join(" "),firstName:p.firstname,lastName:p.lastname,email:p.email,uploadedAvatar:A})}const l=new Map(c.map(d=>[d.id,d]));return{uploaders:Qt.sort(c,d=>d.id===s?0:1,d=>d.name),uploadersById:l}}function c7(e,t,n){return pe.request(new URL("uploaders",e),{credentials:pe.getRequestCredentials(n),okType:Xwe,headers:{repository:t}})}const Zwe=L.object({id:L.string()}),Xwe=L.object({items:L.array(Zwe)});function l7(){const e=Ee();e.mediaLibrary||Jt("mediaLibrary");const{assetsApiBaseUrl:t,authStrategy:n,repository:r}=e;return()=>{Ve.revalidateData(c7,[t,r,n])}}function eEe(e){const{revalidate:t,config:n,keyword:r,assetType:i,uploaderId:o,tagIds:a}=e,{assetsApiBaseUrl:s=void 0,repository:u="",authStrategy:c="token"}=n.mediaLibrary?n:{},[l,d]=$.useState(!1),[p,A]=$.useState(!1),m={assetsApiBaseUrl:s,repository:u,authStrategy:c,keyword:r,assetType:i,uploaderId:o,tagIds:a,page:0},{revalidateData:v}=Ve.useCacheRevalidation({fetcher:mi,requestParams:hp(m),validator:(I,x)=>{var y,T;const g=((y=I.items[0])==null?void 0:y.id)??"",S=((T=x.items[0])==null?void 0:T.id)??"";return g!==S||I.total!==(x==null?void 0:x.total)},onCacheInvalidated:()=>A(!0),every:6e4}),_=I=>{v(hp({...m,...I}))};$.useEffect(()=>{l&&(A(!1),d(!1))},[l]);function C(){d(!0),t()}return{isMediaRevalidationInProgress:l,isMediaCacheInvalid:p,revalidateMedia:C,revalidateWithParams:_}}function tEe(e){const{onBeforeUpload:t,onComplete:n}=e,[r,i]=$.useState([]),o=r.some(l=>l.status==="idle"||l.status==="uploading"),a=Ee();function s(){if(!r.length||r.some(A=>A.status==="uploading")||r.every(A=>A.status==="error"))return;const l=r.find(A=>A.status==="idle");if(!l)return;let d=r;function p(A){d=A(d),i(d),d.every(v=>v.status==="success"||v.status==="error")&&setTimeout(()=>{i([]),n==null||n(d)},1500)}p(A=>A.map(m=>m.id===l.id?{...m,status:"uploading"}:m)),nEe({file:l.file,config:a}).then(A=>{p(m=>m.map(v=>v.id===l.id?{...v,status:"success",response:A}:v))}).catch(()=>{p(A=>A.map(m=>m.id===l.id?{...m,status:"error"}:m))})}function u(l){const d=l.map(p=>({id:`temp-${crypto.randomUUID()}`,file:p,status:"idle"}));i(d),t(d)}const c=$.useCallback(l=>{const d=[{...l,status:"idle"},...r.filter(p=>p.id!==l.id)];i(d),t(d)},[t,r]);return $.useEffect(s,[a,r,n]),{isUploading:o,uploadingFiles:r,onFilesSelected:u,onRetry:c}}function nEe(e){const{file:t,config:n}=e;if(!n.mediaLibrary)throw new Error("Media Library not configured.");const{assetsApiBaseUrl:r,repository:i,authStrategy:o}=n,a=new FormData;return a.append(t.name,t),pe.request(new URL("assets",r),{headers:{repository:i,"Content-Type":"multipart/form-data",...r7},method:"POST",body:a,credentials:pe.getRequestCredentials(o),okType:V0})}const f7=$.createContext(void 0);function rEe(e){const{children:t,assetType:n=Vn.assetType,onSelectedChange:r,actionContainerRef:i}=e,o=r?"select":"browse",[a,s]=$.useTransition(),[u,c]=$.useTransition(),l=Ee(),{showAlert:d}=h.useAlert(),p=WR(),A=l7(),{keyword:m,assetType:v,uploaderId:_,tagIds:C,setFilters:I,resetFilters:x,media:g,fetchNextPage:S,hasNextPage:y,updateMedia:T,unshiftMedia:w,deleteMedia:O,mediaTotal:E,deleteSearchData:F,revalidateFirstPage:W}=zwe({initialAssetType:n,mode:o}),[K,J]=$.useState();function ee(){s7({config:l,keyword:m,assetType:v,uploaderId:_,tagIds:C})}const{isMediaRevalidationInProgress:re,isMediaCacheInvalid:P,revalidateMedia:Y,revalidateWithParams:M}=eEe({config:l,revalidate:ee,keyword:m,assetType:v,uploaderId:_,tagIds:C});function k(De){const dt=De.keyword===Vn.keyword,St=De.assetType===n,st=De.uploaderId===Vn.uploaderId,Wt=De.tagIds.length===Vn.tagIds.length&&De.tagIds.every((gi,_r)=>gi===Vn.tagIds[_r]);return dt&&St&&st&&Wt}function q(De){const dt={keyword:m,assetType:v,tagIds:C,uploaderId:_,...De};k(dt)?M(De):F(dt),c(()=>{I(De),at.clearSelection()})}const{isUploading:ue,onFilesSelected:ke,uploadingFiles:Ie,onRetry:rt}=tEe({onBeforeUpload:De=>{x();const dt=De.filter(st=>st.status==="idle").map(st=>({id:st.id,url:URL.createObjectURL(st.file),filename:st.file.name,size:st.file.size,extension:st.file.type,kind:st.file.type,last_modified:st.file.lastModified,tags:[],uploader_id:p.shortId}));w(dt);const[St]=dt??[];St&&at.toggleSelection({id:St.id,isSingleSelection:!0})},onComplete:De=>{const dt=De.flatMap(Wt=>Wt.status==="success"?Wt:(dn(Wt),{id:Wt.id,response:void 0}));T(dt),W({config:l,assetType:v,tagIds:C}),A();const St=dt[0];!St||!St.response||!at.isSelected(St.id)||at.toggleSelection({id:St.response.id,isSingleSelection:!0})}}),at=Vs({totalItemCount:E,onChangeSelection:({selectedIds:De,selectedCount:dt})=>{if(Yr(!1),!!r){if(dt===1){const[St]=[...De];if(Ie.some(Wt=>Wt.id===St&&Wt.status!=="success")){r(new Set);return}}r(new Set(De))}}});function fn(De){ue||ke(De)}function Zt(){y&&s(S)}function rr(De,dt){T([{id:De,response:dt}])}function dn(De){const dt=Ep.overflow(De.file.name,30);d({id:De.id,title:`The specified file "${dt}" could not be uploaded.`,subtitle:f.jsxs(h.Text,{color:"inherit",children:["Read more about our"," ",f.jsx(h.Text,{color:"tomato11",href:Kwe,underline:!0,children:"supported media"}),"."]}),buttons:{action:{text:"Retry upload",icon:"cloudUpload",onClick:()=>rt(De)}}})}const[Hr,Yr]=$.useState(!1);return f.jsx(f7.Provider,{value:{isFetchingMedia:a,media:g,mediaTotal:E,onScrollToBottom:Zt,actionContainerRef:i,onFilesUpload:fn,isUploading:ue,uploadingFiles:Ie,isMediaRevalidationInProgress:re,isMediaCacheInvalid:P,revalidateMedia:Y,deleteMedia:O,updateMedia:rr,keyword:m,isSearchingMedia:u,assetType:v,initialAssetType:n,uploaderId:_,tagManagerOpen:Hr,setTagManagerOpen:Yr,tagIds:C,onFilterChange:q,openMediaSection:K,setOpenMediaSection:J},children:t})}function Ct(){const e=$.useContext(f7);if(!e)throw new Error("useMediaLibrary must be used within a MediaLibraryProvider");return e}function iEe(){const e=Ee(),{initialAssetType:t}=Ct(),{assetsApiBaseUrl:n=void 0,repository:r="",authStrategy:i="token"}=e.mediaLibrary?e:{},{total:o}=Ve.useRequest(mi,hp({assetsApiBaseUrl:n,authStrategy:i,repository:r,assetType:t,keyword:"",tagIds:[],page:0}));return o}function d7(){return iEe()===0}function oEe(){return d7()?f.jsx(aEe,{}):f.jsx(A7,{})}function p7(e){const{children:t}=e;return f.jsx(h.Box,{justifyContent:"center",flexDirection:"column",height:"100%",children:t})}function A7(){return f.jsx(p7,{children:f.jsxs(h.BlankSlate,{children:[f.jsx(h.BlankSlateIcon,{name:"close",lineColor:"purple10",backgroundColor:"purple3",borderColor:"purple6",borderStyle:"dashed",size:"xlarge"}),f.jsx(h.BlankSlateTitle,{size:"big",children:"Oops!"}),f.jsx(h.BlankSlateDescription,{width:360,children:"No items found matching your search"})]})})}function aEe(){const{onFilesUpload:e}=Ct();return f.jsx(p7,{children:f.jsxs(h.Box,{gap:20,flexDirection:"column",alignItems:"center",children:[f.jsx(h.Box,{maxWidth:375,children:f.jsx(h.BlankSlateTitle,{size:"big",children:"Start by uploading your files!"})}),f.jsx(h.Box,{border:!0,borderStyle:"dashed",borderRadius:4,justifyContent:"center",children:f.jsxs(h.BlankSlate,{sx:{marginBlock:80,marginInline:48},children:[f.jsx(h.BlankSlateIcon,{name:"cloudUpload",lineColor:"purple11",backgroundColor:"purple5",size:"large"}),f.jsx(h.BlankSlateTitle,{children:"Drop your files anywhere to upload or ..."}),f.jsx(h.FileUploadButton,{onFilesSelected:e,renderButton:t=>f.jsx(h.Box,{display:"inline-flex",as:"span",children:f.jsx(h.Button,{onClick:t,color:"grey",children:"Upload media"})})}),f.jsx(h.BlankSlateDescription,{children:"Maximum upload size file: 128 MB"})]})})]})})}const jl={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 sEe(){const{actionContainerRef:e,isUploading:t,onFilesUpload:n,assetType:r}=Ct(),i=(e==null?void 0:e.current)!==void 0;return f.jsx(h7,{actionContainerRef:e,children:f.jsxs(h.Box,{width:"100%",gap:16,children:[f.jsx(uEe,{}),f.jsx(h.Tooltip,{title:jl.warning.uploadWhileUploading.title,content:jl.warning.uploadWhileUploading.description,visible:t,stableMount:!0,children:f.jsx(h.FileUploadButton,{disabled:t,onFilesSelected:n,startIcon:"cloudUpload",color:i?"purple":"grey",size:"large",assetType:r,children:"Upload media"})})]})})}function uEe(){const{keyword:e,onFilterChange:t,isFetchingMedia:n}=Ct(),[r,i]=$.useState(e);return Ne.useOnChange(e,()=>{e===""&&i("")}),Ne.useDebounce(r,300,Ne.useStableCallback(o=>t({keyword:o}))),f.jsx(h.Box,{width:"100%",flexDirection:"column",children:f.jsx(h.FormSearchInput,{value:r,placeholder:"Search",onValueChange:i,maxLength:200,isLoading:n&&e!==r})})}function h7(e){const{children:t,actionContainerRef:n}=e,r=(n==null?void 0:n.current)!==void 0,i=r?h.Portal:$.Fragment,o=r?{container:n.current,asChild:!0}:{},a=Ne.useForceUpdate();return $.useLayoutEffect(()=>{a()},[a]),f.jsx(i,{...o,children:t})}function cEe(e){const{children:t}=e,{onFilesUpload:n,assetType:r}=Ct();return f.jsx(h.FileDropZone,{overlay:f.jsx(lEe,{}),onFilesSelected:n,assetType:r,children:t})}function lEe(){const{isUploading:e}=Ct(),t=e?jl.warning.uploadWhileUploading.title:"Drop files here",n=e?jl.warning.uploadWhileUploading.description:"Drop your files to upload them instantly to the media library.";return f.jsx(h.Box,{justifyContent:"center",flexDirection:"column",height:"100%",children:f.jsxs(h.BlankSlate,{children:[f.jsx(h.BlankSlateIcon,{name:e?"block":"cloudUpload",lineColor:e?"tomato11":"purple10",backgroundColor:e?"tomato2":"purple3",borderColor:e?"tomato6":"purple6",borderStyle:"dashed",size:"xlarge"}),f.jsx(h.BlankSlateTitle,{size:"big",children:t}),f.jsx(h.BlankSlateDescription,{width:360,children:n})]})})}function m7(){return f.jsx(h.DefaultErrorMessage,{title:"Oops! Something went wrong",description:"An error occurred while searching for your image.",errorImageSrc:h.dialogErrorImage,sx:{marginBlock:"auto",marginInline:"auto"}})}function g7(e){const{mediaList:t,mediaActions:n,mediaToolbar:r,sidePane:i}=e,o=h.useMediaQuery({min:"medium"}),a=i&&o;return f.jsxs(h.Box,{display:"grid",gridTemplateRows:"auto auto 1fr",gridTemplateColumns:a?"1fr 380px":"1fr",width:"100%",height:"100%",children:[f.jsxs(h.Box,{position:"relative",display:"grid",gap:16,gridColumn:"1",gridRow:"1",padding:{right:16,bottom:16},children:[n,r]}),f.jsx(h.Box,{position:"relative",display:"grid",gridColumn:"1",gridRow:"2 / -1",children:t}),a&&i]})}function fEe(){var p;const{onScrollToBottom:e,media:t,isUploading:n,uploadingFiles:r,isSearchingMedia:i,isMediaRevalidationInProgress:o,setOpenMediaSection:a,isFetchingMedia:s}=Ct(),u=Vs(),c=$.useRef(null);function l(A){u.toggleSelection({id:A,isSingleSelection:!0}),a("tags")}(n||i||o)&&((p=c.current)==null||p.scrollTo({top:0,behavior:"instant"}));function d(A,m,v){const _=m.shiftKey?t.map(({id:C})=>C):void 0;u.toggleSelection({id:A,isSingleSelection:v==="single",metaKey:m.metaKey,shiftKey:m.shiftKey,ids:_})}return f.jsxs(v7,{onScrollToBottom:e,scrollAreaRef:c,children:[t.map(A=>{var m,v;return f.jsx(h.MediaCard,{"aria-label":"media item",...A,filenameHighlight:(m=A.search_highlight)==null?void 0:m.filename,loading:i,status:(v=r.find(_=>_.id===A.id))==null?void 0:v.status,selected:u.isSelected(A.id),onCardClick:_=>d(A.id,_,"single"),onCheckedChange:(_,C)=>d(A.id,C,"multi"),onAddTagClick:()=>l(A.id)},A.id)}),f.jsx(h.Box,{gridColumn:"1 / -1",justifyContent:"center",children:f.jsx(h.AnimatedElement,{animation:{name:"fade"},children:s&&f.jsx(h.Text,{align:"center",color:"grey11",sx:{marginBlock:8},children:"Loading more items ..."})})})]})}function v7(e){const{children:t,scrollAreaRef:n,onScrollToBottom:r}=e,i=16,o=4,a="250px",s=`calc((100% - ${i*(o-1)}px) / ${o})`;return f.jsx(h.ScrollArea,{"aria-label":"Media list",ref:n,style:{display:"grid",gridTemplateColumns:`repeat(auto-fill, minmax(max(${a}, ${s}), 1fr))`,gridTemplateRows:"1fr 1fr 1fr ",gap:i,padding:2,paddingBottom:16,position:"relative"},onScrollToBottom:r,threshold:500,children:t})}function y7(e){const{children:t,hasSelectedMedia:n}=e;return f.jsx(h.Box,{overflow:"hidden",gridColumn:"2 / -1",gridRow:"1 / -1",children:f.jsx(h.ScrollArea,{style:{display:"grid",height:"100%"},children:f.jsx(h.Box,{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 b7(e){const{onFilesUpload:t,isUploading:n,isInitialLoad:r=!1}=e,i=r||n;return f.jsxs(h.Box,{flexDirection:"column",justifyContent:"center",alignItems:"center",padding:16,gap:16,width:"100%",children:[f.jsx(h.BlankSlateIcon,{name:"cloudUpload",lineColor:"purple11",backgroundColor:"purple5",size:"large"}),f.jsx(h.Box,{flexDirection:"column",gap:4,children:f.jsxs(h.Text,{align:"center",children:["Select or"," ",f.jsx(h.FileUploadButton,{disabled:i,onFilesSelected:t,renderButton:o=>f.jsx(h.Tooltip,{title:jl.warning.uploadWhileUploading.title,content:jl.warning.uploadWhileUploading.description,visible:n,children:f.jsx(h.Box,{display:"inline-flex",as:"span",children:f.jsx(h.Button,{disabled:i,onClick:o,invisible:!0,children:"upload"})})})})," ","media."]})}),f.jsx(h.FileUploadButton,{disabled:i,onFilesSelected:t,color:"grey",children:"Upload media"})]})}function C7(e){const{count:t}=e;return f.jsxs(h.Text,{variant:"bold",children:[t," item",t==1?"":"s"]})}function dEe(e){const{actionContainerRef:t}=e;return f.jsx(g7,{sidePane:f.jsx(hEe,{}),mediaActions:f.jsx(AEe,{actionContainerRef:t}),mediaToolbar:f.jsx(h.Skeleton,{color:"grey5",borderRadius:12,children:f.jsx(C7,{count:888})}),mediaList:f.jsx(pEe,{})})}function pEe(){return f.jsx(v7,{children:Qt.range(1,24).map(e=>f.jsx(S7,{},e))})}function AEe(e){const{actionContainerRef:t}=e,n=Ne.useForceUpdate();return $.useLayoutEffect(()=>{n()},[n]),f.jsx(h7,{actionContainerRef:t,children:f.jsxs(h.Box,{width:"100%",gap:16,children:[f.jsx(h.Box,{width:"100%",flexDirection:"column",children:f.jsx(h.FormSearchInput,{placeholder:"Search",maxLength:200,value:"",disabled:!0,onValueChange:()=>{}})}),f.jsx(h.FileUploadButton,{disabled:!0,onFilesSelected:()=>{},startIcon:"cloudUpload",color:t?"purple":"grey",size:"large",children:"Upload media"})]})})}function hEe(){return f.jsx(y7,{hasSelectedMedia:!1,children:f.jsx(b7,{onFilesUpload:()=>{},isUploading:!1,isInitialLoad:!0})})}function S7(){return f.jsxs(h.Box,{height:302,width:"100%",flexDirection:"column",padding:16,backgroundColor:"grey1",border:!0,borderStyle:"solid",borderRadius:6,children:[f.jsx(h.Skeleton,{height:164,width:"100%"}),f.jsx(h.Skeleton,{height:16,width:"100%",sx:{marginTop:12}}),f.jsx(h.Skeleton,{height:10,width:100,sx:{marginTop:8}}),f.jsx(h.Skeleton,{height:1,width:"100%",sx:{marginTop:20,marginBottom:16}}),f.jsxs(h.Box,{flexDirection:"row",gap:8,children:[f.jsx(h.Skeleton,{height:24,width:54}),f.jsx(h.Skeleton,{height:24,width:45}),f.jsx(h.Skeleton,{height:24,width:62})]})]})}const _7=$.createContext({showToast:()=>{}});function mEe(e){const{children:t}=e,[n,r]=$.useState({title:"",seconds:5}),[i,o]=$.useState(!1),{title:a,action:s,seconds:u=1,icon:c="check"}=n,l=$.useMemo(()=>({showToast:d=>{r({seconds:u,...d}),o(!0)}}),[u]);return f.jsxs(f.Fragment,{children:[f.jsx(gEe,{}),f.jsx(h.Toast,{anchor:f.jsx(h.Box,{position:"absolute",justifyContent:"center",width:"100%",bottom:72}),open:i,onOpenChange:o,title:a,action:s,seconds:u,icon:c}),f.jsx(_7.Provider,{value:l,children:t})]})}function I7(){return $.useContext(_7)}function gEe(){const{revalidateMedia:e,isMediaCacheInvalid:t}=Ct(),[n,r]=$.useState(t);return Ne.useOnChange(t,r),f.jsx(h.Toast,{anchor:f.jsx(h.Box,{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 Pc(){const{media:e}=Ct(),t=Vs();return e.filter(({id:n})=>t.isSelected(n))}function vEe(){const[e,t]=$.useState(!1),n=Pc(),r=Vs(),i=$.useMemo(()=>n.some(({id:a})=>a.startsWith("temp")),[n]),[o]=n;return o?r.selectedCount>1?f.jsxs(h.Box,{gap:8,alignItems:"center",children:[f.jsxs(h.Text,{variant:"emphasized",noWrap:!0,sx:{flexGrow:1},children:[r.selectedCount," media selected"]}),f.jsx(h.Tooltip,{content:"Open all selected media in new tabs",children:f.jsx(h.IconButton,{icon:"openInFull",variant:"solid",size:"small",onClick:()=>n.forEach(a=>window.open(a.url,"_blank"))})}),f.jsx(h.Tooltip,{content:"Remove selected media",children:f.jsx(h.IconButton,{icon:"delete",variant:"solid",color:"tomato",size:"small",hiddenLabel:"Remove media",onClick:()=>t(!0),disabled:i})}),f.jsx(GF,{open:e,onOpenChange:t,media:n})]}):f.jsxs(h.Box,{gap:8,alignItems:"center",children:[f.jsx(h.Text,{variant:"emphasized",noWrap:!0,sx:{flexGrow:1},children:o.filename}),f.jsxs(h.Box,{gap:8,children:[f.jsx(h.Tooltip,{content:"Open media in new tab",children:f.jsx(h.IconButton,{icon:"openInFull",variant:"solid",size:"small",hiddenLabel:"Open media in new tab",onClick:()=>window.open(o.url,"_blank"),disabled:i})}),f.jsx(h.Tooltip,{content:"Copy media URL",children:f.jsx(h.IconButton,{icon:"link",variant:"solid",size:"small",hiddenLabel:"Copy media URL",onClick:()=>navigator.clipboard.writeText(o.url),disabled:i})}),f.jsx(h.Tooltip,{content:"Remove media",children:f.jsx(h.IconButton,{icon:"delete",variant:"solid",color:"tomato",size:"small",hiddenLabel:"Remove media",onClick:()=>t(!0),disabled:i})}),f.jsx(GF,{open:e,onOpenChange:t,media:o})]})]}):null}function GF(e){const{open:t,onOpenChange:n,media:r}=e,i=Ee(),{showAlert:o}=h.useAlert(),{deleteMedia:a}=Ct(),s=Vs(),u=l7(),[c,l]=$.useState(!1),d=Array.isArray(r),p=d?"these items":"this item";function A(){l(!0);const v=s.getSelectionState().selectedIds;bEe({ids:v,config:i}).then(()=>{n(!1),a(v),s.clearSelection(),u()}).catch(()=>{n(!1),o({title:"Error",subtitle:`Something went wrong when removing ${p}.`})}).finally(()=>{l(!1)})}return f.jsxs(h.Dialog,{onOpenChange:n,open:t,size:"small",children:[f.jsx(h.DialogHeader,{icon:"alert",title:`Remove ${p} from your media library?`}),f.jsx(h.DialogContent,{children:f.jsxs(h.Box,{padding:16,flexDirection:"column",children:[f.jsxs(h.Text,{children:["You are about to delete ",p,":  ",!d&&f.jsx("b",{children:r.filename})]}),d&&f.jsx(yEe,{media:r})]})}),f.jsxs(h.DialogActions,{children:[f.jsx(h.DialogCancelButton,{}),f.jsxs(h.DialogActionButton,{onClick:A,color:"tomato",loading:c,children:["Yes, I want to remove ",p]})]})]})}const zb=15;function yEe(e){const{media:t}=e,n=t.slice(0,zb),r=t.length>zb,i=r?t.length-zb:0,o=i===1?"item":"items";return f.jsxs(h.UnorderedList,{density:"compact",sx:{marginTop:8},children:[n.map((a,s)=>f.jsx(h.ListItem,{children:f.jsx("b",{children:a.filename})},s)),r&&f.jsxs(h.ListItem,{children:["And ",f.jsx("b",{children:i})," more ",o,"..."]})]})}function bEe(e){const{ids:t,config:n}=e;if(!n.mediaLibrary)throw new Error("Media Library not configured.");if(t.length===0)throw new Error("No ids provided during media deletion");const{assetsApiBaseUrl:r,repository:i,authStrategy:o}=n;if(t.length===1){const[a]=t;return pe.request(new URL(`assets/${a}`,r),{headers:{repository:i},method:"DELETE",credentials:pe.getRequestCredentials(o),okType:L.unknown()})}return pe.request(new URL("assets/bulk-delete",r),{headers:{repository:i},method:"POST",credentials:pe.getRequestCredentials(o),okType:L.unknown(),body:{ids:t}})}function CEe(){var o;const e=Pc(),{uploadingFiles:t}=Ct(),[n]=e;if(!n)return null;if(e.length===2)return f.jsx(Hb,{children:e.map((a,s)=>f.jsx("div",{style:{position:"absolute",transform:s===0?"translateX(25%) rotate(15deg) ":"translateX(-25%) rotate(-15deg) "},children:f.jsx(JF,{media:a})},a.id))});if(e.length>2)return f.jsx(Hb,{children:e.slice(-4).map((a,s)=>f.jsx("div",{style:{position:"absolute",paddingRight:s*16},children:f.jsx(JF,{media:a})},a.id))});const r=(o=t.find(a=>a.id===n.id))==null?void 0:o.status,i=n.kind.startsWith("image");return f.jsx(h.Box,{flexDirection:"column",children:f.jsx(h.CheckerBoard,{children:f.jsx(Hb,{uploadStatus:r,hasImage:i,children:i?f.jsx(h.Image,{src:n.url,alt:n.alt,sizing:"contain"}):f.jsx(h.MediaCardPlaceholder,{kind:n.kind,filename:n.filename})})})})}function Hb(e){const{children:t,uploadStatus:n,hasImage:r}=e;return f.jsxs(h.Box,{flexDirection:"column",alignItems:"center",justifyContent:"center",position:"relative",height:200,width:"100%",backgroundColor:r?"transparent":"purple2",children:[t,n&&f.jsx(SEe,{uploadStatus:n})]})}function SEe(e){const{uploadStatus:t}=e,{value:n,color:r,height:i,transition:o}=_Ee(t);return f.jsx(h.Box,{position:"absolute",backgroundColor:"greyAlpha1",width:"100%",height:"100%",padding:{inline:16},justifyContent:"end",flexDirection:"column",children:f.jsx(h.ProgressBar,{value:n,color:r,height:i,transition:o})})}function _Ee(e){switch(e){case"idle":return{value:0,height:"collapsed",color:"grey4"};case"uploading":return{value:90,transition:"slow",color:"purple9"};case"success":return{value:100,height:"collapsed",color:"purple9"};case"error":return{value:100,color:"tomato11"}}}function JF(e){const{media:t}=e;return f.jsx(h.Box,{width:111,height:152,children:t.kind==="image"?f.jsx(h.Image,{borderRadius:8,src:t.url,alt:t.alt,sizing:"cover"}):f.jsx(h.MediaCardPlaceholder,{kind:t.kind,filename:t.filename})})}const es=2e3,md="__MAIN_THUMBNAIL__";function sC(e,t,n){const r=e.name===md?void 0:e.name;let i;return t?io.isDefined(n)?i=[n.width,n.height]:io.isDefined(e.width)||io.isDefined(e.height)?i=[e.width??void 0,e.height??void 0]:i=[t.origin.width,t.origin.height]:i=void 0,[r,i?`${i[0]??"auto"}×${i[1]??"auto"}px`:void 0]}function IEe(e){var t,n;return[{...(t=e.config)==null?void 0:t.constraint,name:md}].concat(((n=e.config)==null?void 0:n.thumbnails)??[])}function TEe(e,t){var a,s;const{__TYPE__:n,thumbnails:r,...i}=t,o=(s=(a=e.config)==null?void 0:a.thumbnails)==null?void 0:s.map(({name:u})=>r==null?void 0:r[u]);return[i,...o??[]]}function xEe(e,t,n,r){const i=r.length===0?void 0:r;return e===md||!Ce.isImageContent(t)?{...t,alt:i}:{...t,thumbnails:{...t.thumbnails,[e]:{...n,alt:i}}}}function wEe(e,t){const{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]}function EEe(e,t,n,r,i){if(MEe(e)==="svg")return e;const o=new URL(e);if(i){const{x:a,y:s,width:u,height:c}=t,l=[...o.searchParams.entries(),["rect",[a,s,u,c].join(",")],["w",n],["h",r]];o.search=l.map(d=>d.join("=")).join("&")}return o.toString()}function T7(e){const 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 $Ee(e){const 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()}function REe(e){return e!=null&&e.url?T7(e.url):void 0}function OEe(e,t,n,r){var s,u,c,l,d;if(!n||e===md){const p=(s=t.config)==null?void 0:s.thumbnails,A=p&&Object.fromEntries(p.map(m=>[m.name,rm(r,m)]));return{__TYPE__:"ImageContent",...rm(r,(u=t.config)==null?void 0:u.constraint),thumbnails:A}}const i=(l=(c=t.config)==null?void 0:c.thumbnails)==null?void 0:l.find(p=>p.name===e);if(!i)return n;const o=(d=n.thumbnails)==null?void 0:d[e],a=rm(r,i);return a.url===(o==null?void 0:o.url)?n:{...n,thumbnails:Vl.mapValues(n.thumbnails??{},(p,A)=>A===e?a:p)}}function FEe(e){return"kind"in e&&"extension"in e}function rm(e,t){const{width:n,height:r,rect:i}=kEe({...e,width:(e==null?void 0:e.width)??es,height:(e==null?void 0:e.height)??es},t),o=!!(t!=null&&t.width||t!=null&&t.height);return{provider:"imgix",url:EEe(e.url,i,n,r,o),alt:e.alt,...FEe(e)?{credits:e.credits}:{},origin:{id:e.id,url:e.url,width:e.width??es,height:e.height??es},width:n,height:r,edit:{background:"transparent",zoom:1,crop:{x:i.x,y:i.y}}}}function kEe(e,t){const[n,r]=wEe(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),s=Math.round(n/i),u=Math.round(r/i);return{width:n,height:r,rect:{x:o,y:a,width:s,height:u}}}function MEe(e){const{pathname:t}=new URL(e),n=t.lastIndexOf(".");if(n!==-1)return t.substring(n).slice(1).toLowerCase()}function LEe(e){if(!e)return"";const{filename:t,extension:n}=e;if(!n)return t;const r=new RegExp(`\\.${n}$`);return t.replace(r,"")}function jEe(e){const t=e.length,n={},r=[];return e.forEach(o=>{o.tags.forEach(a=>{n[a.id]||(n[a.id]=0,r.push(a)),n[a.id]++})}),r.filter(o=>n[o.id]===t)}function x7(e){const{tags:t,toggleAssetTag:n,getTagsLabel:r}=e,{setTagManagerOpen:i}=Ct(),{showToast:o}=I7(),{showAlert:a}=h.useAlert(),[s,u]=$.useState("");async function c(l,d){u("");try{await n(l,d),o({title:"Media tags were updated",seconds:3})}catch{a({title:"Error",subtitle:"Something went wrong when updating media tags"})}}return f.jsxs(h.Box,{flexDirection:"column",children:[f.jsxs(h.Box,{justifyContent:"space-between",children:[f.jsx(h.Text,{color:"grey12",variant:"bold",children:r()}),f.jsx(h.Button,{startIcon:"edit",invisible:!0,color:"dark",onClick:()=>i(!0),children:"Manage tags"})]}),f.jsxs(h.ComboBox,{sx:{marginTop:4,marginBottom:8},children:[f.jsx(UEe,{searchTerm:s,setSearchTerm:u}),f.jsx(h.ComboBoxContent,{children:f.jsx(h.ErrorBoundary,{renderError:()=>f.jsx(h.Text,{color:"grey9",variant:"small",sx:{marginBlock:8,marginInline:8},children:"Error getting tags"}),children:f.jsx($.Suspense,{fallback:f.jsx(h.Box,{padding:8,flexDirection:"column",gap:8,children:Qt.range(1,6).map(l=>f.jsx(h.Skeleton,{height:24,width:85},l))}),children:f.jsx(BEe,{searchTerm:s,assignedTags:t,onToggleAssetTag:c})})})})]}),f.jsx(h.Box,{flexDirection:"column",alignItems:"flex-start",gap:8,children:t.map(l=>f.jsx(h.Badge,{title:l.name,size:"medium",color:"purple",selected:!0,onClose:()=>c(l,"remove")},l.id))})]})}function UEe(e){const{searchTerm:t,setSearchTerm:n}=e,r=$.useRef(null),{openMediaSection:i,setOpenMediaSection:o}=Ct();return $.useEffect(()=>{var a;i==="tags"&&((a=r.current)==null||a.focus(),o(void 0))},[i,o]),f.jsx(h.ComboBoxInput,{value:t,onValueChange:n,placeholder:"Add or create a new tag",ref:r})}function BEe(e){const{searchTerm:t,assignedTags:n,onToggleAssetTag:r}=e,[i]=Pc(),o=Ee(),{showAlert:a}=h.useAlert(),{tags:s}=_h(),u=$.useMemo(()=>{const p=t.toLowerCase();return s.filter(A=>A.name.toLowerCase().includes(p))},[s,t]),l=DR.safeParse(t).success&&s.every(p=>p.name!==t);async function d(){if(!t||!i)return;let p;try{p=await PEe({name:t,config:o}),Ih(A=>[p,...A])}catch{a({title:"Error",subtitle:`Something went wrong when creating the tag ${t}`});return}await r(p,"add")}return i?f.jsxs(f.Fragment,{children:[!u.length&&f.jsx(h.Text,{color:"grey9",variant:"small",sx:{marginBlock:8,marginInline:8},children:"No tags found"}),u.map((p,A)=>f.jsx(h.ComboBoxItem,{value:p.id,onCheckedChange:m=>r(p,m?"add":"remove"),checked:n.some(m=>m.id===p.id),children:f.jsx(h.Badge,{title:p.name,color:"purple",size:"medium",sx:{marginInline:8,marginBottom:A===u.length-1?8:4,marginTop:A===0?8:4}})},p.id)),l&&f.jsx(h.ComboBoxItem,{value:"new",onCheckedChange:d,children:f.jsxs(h.Box,{padding:8,flexDirection:"row",alignItems:"center",gap:4,children:[f.jsx(h.Icon,{name:"add",size:"small",color:"grey11"}),f.jsxs(h.Text,{color:"grey12",children:['Create tag "',t,'"']})]})})]}):null}function PEe(e){const{name:t,config:n}=e;n.mediaLibrary||Jt("mediaLibrary");const{assetsApiBaseUrl:r,repository:i,authStrategy:o}=n;return pe.request(new URL("tags",r),{headers:{repository:i},body:{name:t},method:"POST",credentials:pe.getRequestCredentials(o),okType:KR})}function WEe(e){const{selectedMedia:t}=e,n=Ee(),r=$.useMemo(()=>jEe(t),[t]);async function i(a,s){const u=s==="remove",c=t.map(d=>d.id);let l=[];Lu(d=>(l=d,d.map(p=>c.includes(p.id)?u?NEe(p,a):KEe(p,a):p)));try{await DEe({tagId:a.id,assetIds:c,operation:u?"remove":"add",config:n});const d=t.length*(u?-1:1);Ih(p=>p.map(A=>A.id===a.id?{...A,count:A.count+d}:A))}catch(d){throw Lu(()=>l),d}}function o(){const a=r.length;return a>1?`${a} tags in common`:a===1?"1 tag in common":"Common tags"}return f.jsx(x7,{tags:r,getTagsLabel:o,toggleAssetTag:i})}function DEe(e){const{tagId:t,assetIds:n,config:r,operation:i}=e;if(!r.mediaLibrary)throw new Error("Media Library not configured.");const{assetsApiBaseUrl:o,repository:a,authStrategy:s}=r;return pe.request(new URL(`tags/${t}/assets`,o),{headers:{repository:a},body:{assetIds:n},method:i==="add"?"POST":"DELETE",credentials:pe.getRequestCredentials(s),okType:L.unknown()})}function KEe(e,t){return e.tags.some(({id:r})=>r===t.id)?e:{...e,tags:[...e.tags,t]}}function NEe(e,t){const n=e.tags.filter(r=>r.id!==t.id);return{...e,tags:n}}function qEe(e){const{selectedMedia:t}=e,n=t.tags,r=Ee(),{updateMedia:i}=Ct();async function o(s,u){const c=t.tags,l=u==="remove",d=l?c.filter(p=>p.id!==s.id):[...c,s];i(t.id,{tags:d});try{await VEe({mediaId:t.id,config:r,tags:d.map(p=>p.id)}),Ih(p=>p.map(A=>A.id===s.id?{...A,count:A.count+(l?-1:1)}:A))}catch(p){throw i(t.id,{tags:c}),p}}function a(){const s=n.length;return s>1?`${s} tags`:s===1?"1 tag":"Tags"}return f.jsx(x7,{tags:n,getTagsLabel:a,toggleAssetTag:o})}function VEe(e){const{mediaId:t,config:n,tags:r}=e;if(!n.mediaLibrary)throw new Error("Media Library not configured.");const{assetsApiBaseUrl:i,repository:o,authStrategy:a}=n;return pe.request(new URL(`assets/${t}`,i),{headers:{repository:o},body:{tags:r},method:"PATCH",credentials:pe.getRequestCredentials(a),okType:V0})}function QEe(){const[e,t]=$.useState("description");if(Pc().length!==1)return f.jsx(JEe,{});const r=e==="description",i=e==="more-info";return f.jsxs(f.Fragment,{children:[f.jsxs(h.Box,{display:"grid",gridTemplateColumns:"1fr 1fr",backgroundColor:"grey2",border:!0,borderStyle:"solid",borderRadius:8,children:[f.jsx(h.Tab,{selected:r,outline:r,transparent:!0,onClick:()=>t("description"),children:"Description"}),f.jsx(h.Tab,{selected:i,outline:i,transparent:!0,onClick:()=>t("more-info"),children:"More info"})]}),f.jsx(zEe,{tab:e})]})}function zEe(e){const{tab:t}=e;switch(t){case"description":return f.jsx(HEe,{});case"more-info":return f.jsx(YEe,{})}}function HEe(){const{title:e,alt:t,onBlur:n,isUploading:r,selectedMedia:i}=E7();if(!i)return null;const{extension:o}=i;return f.jsxs(h.Box,{flexDirection:"column",gap:16,children:[f.jsx(h.FormInput,{value:e.value,onValueChange:e.set,label:"Media title",placeholder:"Media title",onBlur:n,disabled:r,suffix:o?`.${o}`:void 0}),f.jsx(h.FormInputField,{label:"Alternative text",children:f.jsx(h.ContentEditable,{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&&f.jsx(qEe,{selectedMedia:i})]})}function YEe(){const{credits:e,notes:t,onBlur:n,isUploading:r,selectedMedia:i}=E7();if(!i)return null;const{uploader_id:o}=i,a=e$e(i);return f.jsxs(h.Box,{gap:8,flexDirection:"column",children:[a.map(s=>f.jsxs(h.Box,{gap:8,children:[f.jsxs(h.Text,{color:"grey11",children:[s.label,":"]}),f.jsx(h.Text,{children:s.value})]},s.label)),f.jsxs(h.Box,{gap:8,children:[f.jsx(h.Text,{color:"grey11",children:"Uploaded by:"}),f.jsx(h.ErrorBoundary,{renderError:()=>f.jsx(h.Text,{color:"grey11",children:"Error getting uploader"}),children:f.jsx($.Suspense,{fallback:f.jsx(w7,{}),children:f.jsx(GEe,{uploaderId:o})})})]}),f.jsx(h.FormInputField,{label:"Copyright",children:f.jsx(h.ContentEditable,{content:e.displayValue,contentVersion:e.version,readOnly:r,placeholder:"Media copyrights or credits",multiline:!0,decorations:{em:"highlight"},onChange:e.onChange,onBlur:n})}),f.jsx(h.FormInputField,{label:"Private notes",children:f.jsx(h.ContentEditable,{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 GEe(e){const{uploaderId:t}=e,{uploadersById:n}=u7(),r=n.get(t??"ghost");return t&&!r?f.jsx(w7,{}):r?f.jsxs(f.Fragment,{children:[f.jsx(h.Avatar,{size:24,firstName:r.firstName,lastName:r.lastName,imageUrl:r.uploadedAvatar,hasBorder:!1}),f.jsx(h.Text,{children:r.name})]}):null}function w7(){return f.jsx(h.Skeleton,{width:128})}function JEe(){const e=Pc(),{uploadingFiles:t}=Ct(),n=$.useMemo(()=>t.some(r=>e.some(i=>r.id===i.id)&&r.status!=="success"),[e,t]);return f.jsx(f.Fragment,{children:!n&&f.jsx(WEe,{selectedMedia:e})})}function E7(){const[e]=Pc(),{updateMedia:t,uploadingFiles:n}=Ct(),r=Ee(),{showToast:i}=I7(),o=(e==null?void 0:e.id)??"",a=Nh(e,"alt"),s=Nh(e,"notes"),u=Nh(e,"credits"),c=Nh(e,"filename",LEe),l=n.some(p=>p.id===(e==null?void 0:e.id)&&p.status!=="success");function d(){if(!e||!c.changed&&!a.changed&&!u.changed&&!s.changed)return;const{extension:p,search_highlight:A}=e,m=p?`${c.value}.${p}`:c.value;t(o,{filename:m,alt:a.value,credits:u.value,notes:s.value,search_highlight:{alt:a.changed||A==null?void 0:A.alt,credits:u.changed||A==null?void 0:A.credits,filename:c.changed||A==null?void 0:A.filename,notes:s.changed||A==null?void 0:A.notes}}),XEe({id:o,config:r,metadata:{filename:m,alt:a.value,credits:u.value,notes:s.value}}).then(()=>{i({title:"Media metadata has been saved.",seconds:3})}).catch(v=>{console.error(v)})}return{selectedMedia:e,onBlur:d,isUploading:l,title:c,alt:a,credits:u,notes:s,extension:e==null?void 0:e.extension}}function Nh(e,t,n=r=>r==null?void 0:r[t]){var c;const r=n(e)??"",[i,o]=$.useState(r);Ne.useOnChange(e==null?void 0:e.id,()=>o(r));const a=(c=e==null?void 0:e.search_highlight)==null?void 0:c[t],s=!!a;function u(l){const{from:d,to:p}=l.state.selection;l.commands.selectAll(),l.commands.unsetAllMarks(),l.commands.setTextSelection({from:d,to:p}),o(l.getText())}return{value:i,set:o,displayValue:ZEe(a??i)??"",onChange:u,version:`${(e==null?void 0:e.id)??""}_${s}`,changed:i!==r}}function ZEe(e){return e==null?void 0:e.replace(/\n/g,"<br>")}function XEe(e){const{id:t,config:n,metadata:r}=e;if(!n.mediaLibrary)throw new Error("Media Library not configured.");const{assetsApiBaseUrl:i,repository:o,authStrategy:a}=n;return pe.request(new URL(`assets/${t}`,i),{headers:{repository:o},body:{...r},method:"PATCH",credentials:pe.getRequestCredentials(a),okType:V0})}function e$e(e){const{width:t,height:n,last_modified:r,size:i,extension:o}=e,a=t&&n,s={label:"Date",value:ZC.prettyPrintDate(new Date(r))},u={label:"File size",value:Ep.formatBytes(i)},c=a?{label:"Dimensions",value:`${t}×${n}`}:void 0,l=a?{label:"Ratio",value:((t??0)/(n??0)).toFixed(1)}:void 0,d=o?{label:"Extension",value:o.toUpperCase()}:void 0;return[s,u,c,l,d].filter(io.isDefined)}function t$e(){const{setTagManagerOpen:e}=Ct(),[t,n]=$.useState("");return f.jsxs(h.Box,{gap:20,flexDirection:"column",height:"100%",children:[f.jsxs(h.Box,{alignItems:"center",gap:4,children:[f.jsx(h.IconButton,{icon:"close",size:"small",hasPadding:!1,onClick:()=>e(!1)}),f.jsx(h.Text,{variant:"bold",children:"Tags management"})]}),f.jsxs(h.Box,{gap:16,flexDirection:"column",height:"100%",children:[f.jsx(h.FormSearchInput,{value:t,onValueChange:n,placeholder:"Search for tags",endAdornment:!1,autoFocus:!0}),f.jsx(h.ErrorBoundary,{renderError:()=>f.jsx(o$e,{}),children:f.jsx($.Suspense,{fallback:f.jsx(u$e,{}),children:f.jsx(n$e,{searchTerm:t})})})]})]})}function n$e(e){const{searchTerm:t}=e,{tags:n}=_h(),r=n.filter(i=>i.name.toLowerCase().includes(t.toLowerCase()));return r.length===0?f.jsx(h.Text,{color:"grey9",variant:"small",children:"No tags found"}):f.jsx(h.AnimatedList,{ariaLabel:"Tags list",getItemKey:i=>i.id,gap:16,items:r,children:i=>f.jsx(r$e,{tag:i})})}function r$e(e){const{tag:t}=e,[n,r]=$.useState(!1),i=Ee(),{showAlert:o}=h.useAlert(),{showToast:a}=h.useToast(),{tags:s}=_h();async function u(c){if(!DR.safeParse(c).success){o({title:"Error",subtitle:`Failed to rename tag "${t.name}" to "${c}". Tag name must be at least ${t7} and at maximum ${n7} characters long.`});return}if(s.some(p=>p.name===c)){o({title:"Error",subtitle:`Failed to rename tag "${t.name}" to "${c}". Tag with name "${c}" already exists.`});return}try{await s$e({id:t.id,name:c,config:i}),Ih(p=>p.map(A=>A.id===t.id?{...A,name:c}:A)),Lu(p=>p.map(A=>{if(A.tags.findIndex(v=>v.id===t.id)!==-1){const v=A.tags.map(_=>_.id===t.id?{..._,name:c}:_);return{...A,tags:v}}return A})),a({title:`Tag "${t.name}" renamed to "${c}"`,seconds:3})}catch{o({title:"Error",subtitle:"Something went wrong when renaming the tag."})}}return f.jsxs(f.Fragment,{children:[f.jsxs(h.Box,{justifyContent:"space-between",children:[f.jsx(h.Badge,{title:t.name,color:"purple",size:"medium",onEdit:u}),f.jsx(h.Button,{invisible:!0,color:"tomato",textWeight:"normal",onClick:()=>r(!0),children:"Delete"})]}),f.jsx(i$e,{open:n,onOpenChange:r,tag:t})]})}function i$e(e){const{open:t,onOpenChange:n,tag:r}=e,{id:i,name:o,count:a}=r,s=Ee(),{showAlert:u}=h.useAlert(),[c,l]=$.useState(!1);async function d(){l(!0);try{await a$e({id:i,config:s}),Ih(p=>p.filter(A=>A.id!==i)),Lu(p=>p.map(A=>{if(A.tags.findIndex(v=>v.id===i)!==-1){const v=A.tags.filter(_=>_.id!==i);return{...A,tags:v}}return A}))}catch{u({title:"Error",subtitle:"Something went wrong when removing the tag."})}finally{l(!1),n(!1)}}return f.jsxs(h.Dialog,{onOpenChange:n,open:t,size:"small",children:[f.jsx(h.DialogHeader,{title:`This tag is being used on ${a} media item${a===1?"":"s"}`}),f.jsx(h.DialogContent,{padding:16,children:f.jsxs(h.Text,{children:["You are about to delete the tag name ",f.jsx("b",{children:o}),"."," ",a>0&&`This tag is being
32
+ `}}function u(x){return r.exact(r.intersection([r.type({id:r.string,label:o.StringOrNull,repeatable:(0,i.withFallback)(r.boolean,!0),json:r.record(r.string,x),status:(0,i.withFallback)(r.boolean,!0)}),r.partial({format:(0,i.withFallback)(r.keyof(e.CustomTypeFormat),"custom")})]))}e.StaticCustomType=u(a.StaticSection),e.CustomType=u(a.DynamicSection);function c(x){return Object.entries(x.json).reduce((g,[,S])=>{const y=Object.entries(S);return g.concat(y)},[])}e.flattenWidgets=c;function l(x){return Object.entries(x.json).reduce((g,[,S])=>{const y=Object.entries(S);return g.concat(y)},[])}e.flattenSections=l;function d(x){return c(x).filter(([,y])=>y.type==="Slices").reduce((y,[,T])=>{const w=Object.entries(T.config&&T.config.choices?T.config.choices:{}).filter(([,O])=>O.type==="SharedSlice").map(([O])=>O);return y.concat(w)},[])}function p(x){const g=d(x);return function(S){return g.map(S)}}function A(x,g){const S=Object.entries(x.json).reduce((y,[T,w])=>({...y,[T]:a.Sections.toStatic(w,g)}),{});return{...x,json:S}}e.toStatic=A;function m(x,g){const S=p(x)(y=>{if(!g.get(y))return y}).filter(Boolean);return S.length>0?(0,n.left)(new s(S)):(0,n.right)(x)}e.validateSlices=m;function v(x,g){const S=Object.entries(x.json).reduce((y,[T,w])=>{const O=Object.entries(w).reduce((E,[F,W])=>{const K=g(F,W);return K?{...E,[F]:K}:E},{});return{...y,[T]:O}},{});return{...x,json:S}}e.collectWidgets=v;function _(x,g){return v(x,(S,y)=>{if(y.type==="Slices"){if(!y.config||!y.config.choices)return y;const T=Object.entries(y.config.choices).reduce((O,[E,F])=>F.type==="SharedSlice"&&!g.get(E)?O:{...O,[E]:F},{}),w={...y.config,choices:T};return{...y,config:w}}return y})}e.filterMissingSharedSlices=_;function C(x){return Object.values(x.json).reduce((g,S)=>({...g,...S}),{})}e.flattenCustomTypeFields=C;function I(x){return Object.entries(x.fields).reduce((g,[,S])=>{var y;return S.type==="Slices"||S.type==="Choice"?{...g,...Object.entries(((y=S.config)===null||y===void 0?void 0:y.choices)||{}).reduce((T,[w,O])=>O.type==="SharedSlice"?{...T,[w]:O}:T,{})}:g},{})}e.collectSharedSlices=I})(H9);var tq={},L0={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.DiffOperation=void 0,function(t){t.Added="added",t.Removed="removed",t.Updated="updated"}(e.DiffOperation||(e.DiffOperation={}))})(L0);var j0={},Xo={},U0={};Object.defineProperty(U0,"__esModule",{value:!0});U0.HexaColor=void 0;const ETe=/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/;U0.HexaColor={is:e=>ETe.test(e)};var B0={};Object.defineProperty(B0,"__esModule",{value:!0});B0.toRecord=void 0;function $Te(e,t){return e.reduce((n,r)=>{const i=t(r);return{...n,[i]:r}},{})}B0.toRecord=$Te;var Er={};Object.defineProperty(Er,"__esModule",{value:!0});Er.mapValues=Er.isObject=Er.withOptionals=Er.isNotEmpty=Er.zipObjects=void 0;const RTe=Q,OTe=ln,gb=(0,RTe.__importStar)(Z);function FTe(e,t){return[...new Set(Object.keys(e||{}).concat(Object.keys(t||{})))].reduce((r,i)=>{const o=e==null?void 0:e[i],a=t==null?void 0:t[i];return{...r,[i]:{left:o,right:a}}},{})}Er.zipObjects=FTe;function kTe(e){return!!Object.keys(e).length}Er.isNotEmpty=kTe;function MTe(e,t){return{...e,...t.reduce((n,[r,i])=>i?{...n,[r]:i}:n,{})}}Er.withOptionals=MTe;const LTe=gb.record(gb.string,gb.unknown);function jTe(e){return(0,OTe.isRight)(LTe.decode(e))}Er.isObject=jTe;function UTe(e,t){return Object.entries(e).reduce((n,[r,i])=>({...n,[r]:t(i,r)}),{})}Er.mapValues=UTe;Object.defineProperty(Xo,"__esModule",{value:!0});Xo.Objects=Xo.Arrays=Xo.HexaColorCode=void 0;const _R=Q;Xo.HexaColorCode=(0,_R.__importStar)(U0);Xo.Arrays=(0,_R.__importStar)(B0);Xo.Objects=(0,_R.__importStar)(Er);var Ch={};Object.defineProperty(Ch,"__esModule",{value:!0});Ch.VariationComparator=void 0;const wm=Xo,vb=Ad,Za=L0;function BTe(e,t){const n=wm.Objects.zipObjects(e,t);return Object.entries(n).reduce((r,[i,o])=>i==="primary"||i==="items"||(o==null?void 0:o.left)===(o==null?void 0:o.right)?r:{...r,[i]:o==null?void 0:o.right},{})}function Em(e,t){const n=wm.Objects.zipObjects(e,t),r=Object.entries(n).reduce((i,[o,a])=>{if(JSON.stringify(a==null?void 0:a.left)===JSON.stringify(a==null?void 0:a.right))return i;const s=(()=>{var u,c,l,d,p,A,m;if(!(!(a!=null&&a.left)&&!(a!=null&&a.right))){if(a!=null&&a.left&&!a.right)return{op:Za.DiffOperation.Removed};if(!(a!=null&&a.left)&&(a!=null&&a.right)){if(((u=a.right)===null||u===void 0?void 0:u.type)===vb.GroupFieldType){const v={...a.right,config:{...a.right.config,fields:{}}};return v.config.fields=Em(void 0,(c=a.right.config)===null||c===void 0?void 0:c.fields)||{},{op:Za.DiffOperation.Added,value:v}}return{op:Za.DiffOperation.Added,value:a.right}}if(((l=a.right)===null||l===void 0?void 0:l.type)===vb.GroupFieldType){const v={...a.right,config:{...a.right.config,fields:{}}};return v.config.fields=Em(((d=a.left)===null||d===void 0?void 0:d.type)===vb.GroupFieldType?(A=(p=a.left)===null||p===void 0?void 0:p.config)===null||A===void 0?void 0:A.fields:void 0,(m=a.right.config)===null||m===void 0?void 0:m.fields)||{},{op:Za.DiffOperation.Updated,value:v}}return{op:Za.DiffOperation.Updated,value:a.right}}})();return s?{...i,[o]:s}:i},{});return wm.Objects.isNotEmpty(r)?r:void 0}Ch.VariationComparator={compare(e,t){if(e&&!t)return{op:Za.DiffOperation.Removed};if(!e&&t)return{op:Za.DiffOperation.Added,value:t};const n=BTe(e,t),r=Em(e==null?void 0:e.primary,t==null?void 0:t.primary),i=Em(e==null?void 0:e.items,t==null?void 0:t.items),o={...n,...r?{primary:r}:{},...i?{items:i}:{}};if(wm.Objects.isNotEmpty(o))return{op:Za.DiffOperation.Updated,value:o}}};Object.defineProperty(j0,"__esModule",{value:!0});j0.SliceComparator=void 0;const nl=Xo,yb=L0,PTe=Ch;function WTe(e,t){const n=nl.Objects.zipObjects(e,t);return Object.entries(n).reduce((r,[i,o])=>i==="variations"||(o==null?void 0:o.left)===(o==null?void 0:o.right)?r:{...r,[i]:o==null?void 0:o.right},{})}j0.SliceComparator={compare(e,t){if(!e&&t)return{op:yb.DiffOperation.Added,value:t};if(e&&!t)return{op:yb.DiffOperation.Removed};const n=WTe(e,t),r=nl.Objects.zipObjects(e&&nl.Arrays.toRecord(e.variations,a=>a.id),t&&nl.Arrays.toRecord(t.variations,a=>a.id)),i=Object.entries(r).reduce((a,[s,u])=>{if(!u)return a;const c=PTe.VariationComparator.compare(u.left,u.right);return c?{...a,[s]:c}:a},{}),o={...n,...nl.Objects.isNotEmpty(i)?{variations:i}:{}};if(nl.Objects.isNotEmpty(o))return{op:yb.DiffOperation.Updated,value:o}}};var nq={};Object.defineProperty(nq,"__esModule",{value:!0});(function(e){Object.defineProperty(e,"__esModule",{value:!0});const t=Q;(0,t.__exportStar)(L0,e),(0,t.__exportStar)(j0,e),(0,t.__exportStar)(Ch,e),(0,t.__exportStar)(nq,e)})(tq);var Mo={},rq={};(function(e){var t=me&&me.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(e,"__esModule",{value:!0}),e.ImageConstraint=void 0;var n=gh;Object.defineProperty(e,"ImageConstraint",{enumerable:!0,get:function(){return t(n).default}})})(rq);var iq={},oq={};Object.defineProperty(oq,"__esModule",{value:!0});var P0={};Object.defineProperty(P0,"__esModule",{value:!0});P0.SlicesTypes=void 0;const DTe=Q,KTe=(0,DTe.__importStar)(Z),NTe=M0,qTe=yh;P0.SlicesTypes=KTe.keyof({[NTe.CompositeSliceType]:null,[qTe.SharedSliceType]:null});(function(e){Object.defineProperty(e,"__esModule",{value:!0});const t=Q;(0,t.__exportStar)(M0,e),(0,t.__exportStar)(Ru,e),(0,t.__exportStar)(yh,e),(0,t.__exportStar)(bh,e),(0,t.__exportStar)(oq,e),(0,t.__exportStar)(Ou,e),(0,t.__exportStar)(vR,e),(0,t.__exportStar)(P0,e)})(iq);(function(e){Object.defineProperty(e,"__esModule",{value:!0});const t=Q;(0,t.__exportStar)(Ad,e),(0,t.__exportStar)(vh,e),(0,t.__exportStar)(rq,e),(0,t.__exportStar)(iq,e),(0,t.__exportStar)(yR,e),(0,t.__exportStar)(wr,e)})(Mo);(function(e){Object.defineProperty(e,"__esModule",{value:!0});const t=Q;(0,t.__exportStar)(H9,e),(0,t.__exportStar)(tq,e),(0,t.__exportStar)(Ti,e),(0,t.__exportStar)(Mo,e)})(fe);var bb={},Cb={},Xs={},eF;function Pt(){if(eF)return Xs;eF=1,Object.defineProperty(Xs,"__esModule",{value:!0}),Xs.hasContentType=Xs.hasFieldContentType=void 0;const e=ln,t=ER();function n(i){var o;return r(i)&&i.__TYPE__===t.FieldContentType&&((o=i)===null||o===void 0?void 0:o.type)!==void 0&&typeof i.type=="string"&&(0,e.isRight)(t.FieldType.decode(i.type))}Xs.hasFieldContentType=n;function r(i){return typeof i=="object"&&i!==null&&"__TYPE__"in i}return Xs.hasContentType=r,Xs}var tF;function aq(){return tF||(tF=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.EmptyContent=e.EmptyLegacy=e.isEmptyContent=e.EmptyContentType=void 0;const t=Q,n=lt,r=Ge,i=(0,t.__importStar)(Z),o=Pt();e.EmptyContentType="EmptyContent";const a=c=>(0,o.hasContentType)(c)&&c.__TYPE__===e.EmptyContentType;e.isEmptyContent=a;const s=i.union([i.null,i.type({value:i.null})]),u=c=>new i.Type("EmptyLegacy",e.isEmptyContent,l=>(0,r.pipe)(s.decode(l),n.either.map(()=>({type:c,__TYPE__:e.EmptyContentType}))),()=>null);e.EmptyLegacy=u,e.EmptyContent=i.strict({type:i.string,__TYPE__:i.literal(e.EmptyContentType)})}(Cb)),Cb}var Sb={},Qn={};Object.defineProperty(Qn,"__esModule",{value:!0});Qn.defaultCtx=Qn.getFieldCtx=Qn.LegacyContentCtx=Qn.FieldOrSliceType=void 0;const VTe=Q,QTe=(0,VTe.__importStar)(Z),nF=Mo;Qn.FieldOrSliceType=QTe.union([nF.FieldType,nF.SlicesTypes]);class IR{constructor(t,n,r){Object.defineProperty(this,"fieldKey",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"prefixedKey",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"keyOfType",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"fieldPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"fieldType",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"allTypes",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.fieldKey=t,this.fieldPath=n||[],this.allTypes=r||new Map;const i=Array.of(this.fieldPath,[this.fieldKey]).flat().join(".");this.prefixedKey=i,this.keyOfType=`${i}_TYPE`,this.fieldType=this.allTypes.get(this.prefixedKey)}}Qn.LegacyContentCtx=IR;function zTe(e,t,n){return new IR(e,[...t.fieldPath,t.fieldKey,...n||[]],t.allTypes)}Qn.getFieldCtx=zTe;function HTe(e,t=new Map){return new IR(e,[],t)}Qn.defaultCtx=HTe;var _b={},Ib={},rF;function sq(){return rF||(rF=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.BooleanContentDefaultValue=e.BooleanContent=e.BooleanLegacy=e.isBooleanContent=e.BooleanContentType=void 0;const t=Q,n=lt,r=Ge,i=(0,t.__importStar)(Z),o=Pt();e.BooleanContentType="BooleanContent";const a=c=>(0,o.hasContentType)(c)&&c.__TYPE__===e.BooleanContentType;e.isBooleanContent=a;const s=c=>new i.Type("BooleanLegacy",e.isBooleanContent,l=>(0,r.pipe)(i.boolean.decode(l),n.either.map(d=>e.BooleanContent.encode({value:d,__TYPE__:e.BooleanContentType}))),l=>({content:l.value,types:{[c.keyOfType]:"Boolean"}}));e.BooleanLegacy=s,e.BooleanContent=i.strict({__TYPE__:i.literal(e.BooleanContentType),value:i.boolean});const u=c=>{var l;return((l=c.config)===null||l===void 0?void 0:l.default_value)!==void 0?{__TYPE__:e.BooleanContentType,value:c.config.default_value||!1}:void 0};e.BooleanContentDefaultValue=u}(Ib)),Ib}var Tb={},iF;function TR(){return iF||(iF=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.EmbedContent=e.EmbedLegacy=e.EmbedContentLegacy=e.isEmbedContent=e.EmbedContentType=void 0;const t=Q,n=lt,r=Ge,i=(0,t.__importStar)(Z),o=ft(),a=Pt();e.EmbedContentType="EmbedContent";const s=c=>(0,a.hasContentType)(c)&&c.__TYPE__===e.EmbedContentType;e.isEmbedContent=s,e.EmbedContentLegacy=i.exact(i.intersection([i.type({embed_url:i.string,type:i.string}),i.partial({version:i.union([i.string,i.number,i.null]),title:o.StringOrNull,author_name:o.StringOrNull,author_url:o.StringOrNull,provider_name:o.StringOrNull,provider_url:o.StringOrNull,cache_age:i.union([i.string,i.number,i.null]),thumbnail_url:o.StringOrNull,thumbnail_width:o.NumberOrNull,thumbnail_height:o.NumberOrNull,html:o.StringOrNull})]));const u=c=>new i.Type("EmbedLegacy",e.isEmbedContent,l=>(0,r.pipe)(e.EmbedContentLegacy.decode(l),n.either.map(d=>({...d,all:l,__TYPE__:e.EmbedContentType}))),l=>({content:l.all,types:{[c.keyOfType]:"Embed"}}));e.EmbedLegacy=u,e.EmbedContent=i.intersection([e.EmbedContentLegacy,i.strict({__TYPE__:i.literal(e.EmbedContentType),all:i.unknown})])}(Tb)),Tb}var xb={},wb={},Va={};Object.defineProperty(Va,"__esModule",{value:!0});const YTe=Q,GTe=Na,JTe=Xi,Dh=(0,YTe.__importStar)(Z);function ZTe(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)}Va.default=new Dh.Type("TrimmedString",Dh.string.is,(e,t)=>(0,JTe.pipe)(Dh.string.validate(e,t),(0,GTe.chain)(n=>Dh.success(ZTe(n)))),e=>e);var hi={};Object.defineProperty(hi,"__esModule",{value:!0});hi.FieldContentType=void 0;hi.FieldContentType="FieldContent";var oF;function aF(){return oF||(oF=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ColorContent=e.ColorLegacy=e.isColorContent=void 0;const t=Q,n=lt,r=Ge,i=(0,t.__importStar)(Z),o=Mo,a=(0,t.__importDefault)(Va),s=Pt(),u=hi,c=d=>(0,s.hasContentType)(d)&&d.__TYPE__===u.FieldContentType&&(0,s.hasFieldContentType)(d)&&d.type==="Color";e.isColorContent=c;const l=d=>new i.Type("ColorLegacy",e.isColorContent,p=>(0,r.pipe)(a.default.decode(p),n.either.map(A=>e.ColorContent.encode({value:A,type:o.ColorFieldType,__TYPE__:u.FieldContentType}))),p=>({content:p.value,types:{[d.keyOfType]:o.ColorFieldType}}));e.ColorLegacy=l,e.ColorContent=i.strict({type:i.literal(o.ColorFieldType),value:a.default,__TYPE__:i.literal(u.FieldContentType)})}(wb)),wb}var Eb={},sF;function uF(){return sF||(sF=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.DateContent=e.DateLegacy=e.isDateContent=void 0;const t=Q,n=lt,r=Ge,i=(0,t.__importStar)(Z),o=Mo,a=(0,t.__importDefault)(Va),s=Pt(),u=hi,c=d=>(0,s.hasContentType)(d)&&d.__TYPE__===u.FieldContentType&&(0,s.hasFieldContentType)(d)&&d.type==="Date";e.isDateContent=c;const l=d=>new i.Type("DateLegacy",e.isDateContent,p=>(0,r.pipe)(a.default.decode(p),n.either.map(A=>e.DateContent.encode({value:A,type:o.DateFieldType,__TYPE__:u.FieldContentType}))),p=>({content:p.value,types:{[d.keyOfType]:o.DateFieldType}}));e.DateLegacy=l,e.DateContent=i.strict({type:i.literal(o.DateFieldType),value:a.default,__TYPE__:i.literal(u.FieldContentType)})}(Eb)),Eb}var $b={},cF;function lF(){return cF||(cF=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.NumberContent=e.NumberLegacy=e.isNumberContent=void 0;const t=Q,n=lt,r=Ge,i=(0,t.__importStar)(Z),o=Mo,a=(0,t.__importDefault)(Va),s=Pt(),u=hi,c=d=>(0,s.hasContentType)(d)&&d.__TYPE__===u.FieldContentType&&(0,s.hasFieldContentType)(d)&&d.type==="Number";e.isNumberContent=c;const l=d=>new i.Type("NumberLegacy",e.isNumberContent,p=>(0,r.pipe)(a.default.decode(p),n.either.map(A=>e.NumberContent.encode({value:A,type:o.NumberFieldType,__TYPE__:u.FieldContentType}))),p=>({content:p.value,types:{[d.keyOfType]:o.NumberFieldType}}));e.NumberLegacy=l,e.NumberContent=i.strict({type:i.literal(o.NumberFieldType),value:a.default,__TYPE__:i.literal(u.FieldContentType)})}($b)),$b}var Rb={},fF;function dF(){return fF||(fF=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.RangeContent=e.RangeLegacy=e.isRangeContent=void 0;const t=Q,n=lt,r=Ge,i=(0,t.__importStar)(Z),o=Mo,a=(0,t.__importDefault)(Va),s=Pt(),u=hi,c=d=>(0,s.hasContentType)(d)&&d.__TYPE__===u.FieldContentType&&(0,s.hasFieldContentType)(d)&&d.type==="Range";e.isRangeContent=c;const l=d=>new i.Type("RangeLegacy",e.isRangeContent,p=>(0,r.pipe)(a.default.decode(p),n.either.map(A=>e.RangeContent.encode({value:A,type:o.RangeFieldType,__TYPE__:u.FieldContentType}))),p=>({content:p.value,types:{[d.keyOfType]:o.RangeFieldType}}));e.RangeLegacy=l,e.RangeContent=i.strict({type:i.literal(o.RangeFieldType),value:a.default,__TYPE__:i.literal(u.FieldContentType)})}(Rb)),Rb}var Ob={},pF;function AF(){return pF||(pF=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.SelectContentDefaultValue=e.SelectContent=e.SelectLegacy=e.isSelectContent=void 0;const t=Q,n=lt,r=Ge,i=(0,t.__importStar)(Z),o=Mo,a=(0,t.__importDefault)(Va),s=Pt(),u=hi,c=p=>(0,s.hasContentType)(p)&&p.__TYPE__===u.FieldContentType&&(0,s.hasFieldContentType)(p)&&p.type==="Select";e.isSelectContent=c;const l=p=>new i.Type("SelectLegacy",e.isSelectContent,A=>(0,r.pipe)(a.default.decode(A),n.either.map(m=>e.SelectContent.encode({value:m,type:o.SelectFieldType,__TYPE__:u.FieldContentType}))),A=>({content:A.value,types:{[p.keyOfType]:o.SelectFieldType}}));e.SelectLegacy=l,e.SelectContent=i.strict({type:i.literal(o.SelectFieldType),value:a.default,__TYPE__:i.literal(u.FieldContentType)});const d=p=>{var A;return!((A=p.config)===null||A===void 0)&&A.default_value?{__TYPE__:u.FieldContentType,type:o.SelectFieldType,value:p.config.default_value||""}:void 0};e.SelectContentDefaultValue=d}(Ob)),Ob}var Fb={},hF;function mF(){return hF||(hF=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.TextContent=e.TextLegacy=e.isTextContent=void 0;const t=Q,n=lt,r=Ge,i=(0,t.__importStar)(Z),o=Mo,a=(0,t.__importDefault)(Va),s=Pt(),u=hi,c=d=>(0,s.hasContentType)(d)&&d.__TYPE__===u.FieldContentType&&(0,s.hasFieldContentType)(d)&&d.type==="Text";e.isTextContent=c;const l=d=>new i.Type("TextLegacy",e.isTextContent,p=>(0,r.pipe)(a.default.decode(p),n.either.map(A=>e.TextContent.encode({value:A,type:o.TextFieldType,__TYPE__:u.FieldContentType}))),p=>({content:p.value,types:{[d.keyOfType]:o.TextFieldType}}));e.TextLegacy=l,e.TextContent=i.strict({type:i.literal(o.TextFieldType),value:a.default,__TYPE__:i.literal(u.FieldContentType)})}(Fb)),Fb}var kb={},gF;function vF(){return gF||(gF=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.TimestampContent=e.TimestampLegacy=e.isTimestampContent=void 0;const t=Q,n=lt,r=Ge,i=(0,t.__importStar)(Z),o=Mo,a=(0,t.__importDefault)(Va),s=Pt(),u=hi,c=d=>(0,s.hasContentType)(d)&&d.__TYPE__===u.FieldContentType&&(0,s.hasFieldContentType)(d)&&d.type==="Timestamp";e.isTimestampContent=c;const l=d=>new i.Type("TimestampLegacy",e.isTimestampContent,p=>(0,r.pipe)(a.default.decode(p),n.either.map(A=>e.TimestampContent.encode({value:A,type:o.TimestampFieldType,__TYPE__:u.FieldContentType}))),p=>({content:p.value,types:{[d.keyOfType]:o.TimestampFieldType}}));e.TimestampLegacy=l,e.TimestampContent=i.strict({type:i.literal(o.TimestampFieldType),value:a.default,__TYPE__:i.literal(u.FieldContentType)})}(kb)),kb}var yF;function uq(){return yF||(yF=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.FieldContent=e.FieldType=void 0;const t=Q,n=(0,t.__importStar)(Z),r=aF(),i=uF(),o=lF(),a=dF(),s=AF(),u=mF(),c=vF();e.FieldType=n.keyof({Text:null,Date:null,Timestamp:null,Color:null,Number:null,Range:null,Select:null}),e.FieldContent=n.union([i.DateContent,r.ColorContent,o.NumberContent,a.RangeContent,s.SelectContent,u.TextContent,c.TimestampContent]),(0,t.__exportStar)(aF(),e),(0,t.__exportStar)(hi,e),(0,t.__exportStar)(uF(),e),(0,t.__exportStar)(lF(),e),(0,t.__exportStar)(dF(),e),(0,t.__exportStar)(AF(),e),(0,t.__exportStar)(mF(),e),(0,t.__exportStar)(vF(),e)}(xb)),xb}var Mb={},bF;function cq(){return bF||(bF=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.GeoPointContent=e.GeoPointLegacy=e.isGeoPointContent=e.GeoPointContentType=void 0;const t=Q,n=lt,r=Xi,i=(0,t.__importStar)(Z),o=Pt();e.GeoPointContentType="GeoPointContent";const a=c=>(0,o.hasContentType)(c)&&c.__TYPE__===e.GeoPointContentType;e.isGeoPointContent=a;const s=i.strict({position:i.strict({lat:i.number,lng:i.number})}),u=c=>new i.Type("GeoPointLegacy",e.isGeoPointContent,l=>(0,r.pipe)(s.decode(l),n.either.map(d=>e.GeoPointContent.encode({...d,__TYPE__:e.GeoPointContentType}))),l=>({content:{position:l.position},types:{[c.keyOfType]:"GeoPoint"}}));e.GeoPointLegacy=u,e.GeoPointContent=i.intersection([s,i.strict({__TYPE__:i.literal(e.GeoPointContentType)})])}(Mb)),Mb}var Lb={},CF;function xR(){return CF||(CF=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ImageContent=e.ImageLegacy=e.ImageContentView=e.isImageContent=e.ImageContentType=void 0;const t=Q,n=lt,r=Ge,i=(0,t.__importStar)(Z),o=Er,a=ft(),s=Pt();e.ImageContentType="ImageContent";const u=p=>(0,s.hasContentType)(p)&&p.__TYPE__===e.ImageContentType;e.isImageContent=u;const c=i.exact(i.type({id:i.string,url:i.string,width:i.number,height:i.number}));e.ImageContentView=i.exact(i.intersection([i.type({origin:c,width:i.number,height:i.number,edit:i.type({zoom:i.number,crop:i.type({x:i.number,y:i.number}),background:i.string})}),i.partial({url:i.string,credits:a.NonEmptyStringOrNull,alt:a.NonEmptyStringOrNull,provider:a.StringOrNull})]));const l=i.intersection([e.ImageContentView,i.partial({thumbnails:i.record(i.string,e.ImageContentView)})]),d=p=>new i.Type("ImageLegacy",e.isImageContent,A=>(0,r.pipe)(l.decode(A),n.either.map(m=>e.ImageContent.encode({...m,__TYPE__:e.ImageContentType}))),A=>({content:(0,o.withOptionals)({edit:A.edit,height:A.height,origin:A.origin,width:A.width},[["alt",A.alt],["credits",A.credits],["provider",A.provider],["thumbnails",A.thumbnails],["url",A.url]]),types:{[p.keyOfType]:"Image"}}));e.ImageLegacy=d,e.ImageContent=i.intersection([l,i.strict({__TYPE__:i.literal(e.ImageContentType)})])}(Lb)),Lb}var jb={},SF;function lq(){return SF||(SF=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.IntegrationFieldContent=e.IntegrationFieldLegacy=e.isIntegrationFieldContent=e.IntegrationFieldContentType=void 0;const t=Q,n=lt,r=Ge,i=(0,t.__importStar)(Z),o=Pt();e.IntegrationFieldContentType="IntegrationFieldsContent";const a=u=>(0,o.hasContentType)(u)&&u.__TYPE__===e.IntegrationFieldContentType;e.isIntegrationFieldContent=a;const s=u=>new i.Type("IntegrationFieldLegacy",e.isIntegrationFieldContent,c=>(0,r.pipe)(i.string.decode(c),n.either.map(l=>e.IntegrationFieldContent.encode({value:l,__TYPE__:e.IntegrationFieldContentType}))),c=>({content:c.value,types:{[u.keyOfType]:"IntegrationFields"}}));e.IntegrationFieldLegacy=s,e.IntegrationFieldContent=i.strict({__TYPE__:i.literal(e.IntegrationFieldContentType),value:i.string})}(jb)),jb}var Ub={},_F;function wR(){return _F||(_F=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.FilledLinkContent=e.FilledLink=e.FilledLinkContentLegacy=e.FilledLinkLegacy=e.isFilledLinkContent=e.LinkContent=e.Link=e.LinkContentLegacy=e.LinkLegacy=e.isLinkContent=e.LinkContentType=e.AnyLinkContent=e.AnyLinkType=e.ExternalLinkContent=e.FilledExternalLinkContent=e.ExternalLinkType=e.DocumentLinkContent=e.FilledDocumentLinkContent=e.DocumentLinkType=e.MediaLinkContent=e.MediaLinkType=e.FileLinkContent=e.FilledFileLinkContent=e.FileLinkType=e.ImageLinkContent=e.FilledImageLinkContent=e.ImageLinkType=void 0;const t=Q,n=lt,r=Ge,i=(0,t.__importStar)(Z),o=$0,a=ft(),s=Xe,u=Pt();e.ImageLinkType="ImageLink";const c=i.intersection([i.strict({kind:i.string,id:i.string,url:i.string,height:i.string,width:i.string,size:i.string,name:i.string}),i.exact(i.partial({date:a.StringOrNull}))]),l=new i.Type("FilledImageLink",P=>(0,u.hasContentType)(P)&&P.__TYPE__===e.ImageLinkType,P=>(0,r.pipe)(c.decode(P),n.either.map(Y=>e.FilledImageLinkContent.encode({...Y,__TYPE__:e.ImageLinkType}))),P=>c.encode(P));e.FilledImageLinkContent=i.intersection([i.strict({__TYPE__:i.literal(e.ImageLinkType)}),c]);const d=i.union([i.intersection([c,i.exact(i.partial({text:i.string}))]),i.strict({kind:i.literal("image"),text:i.string})]),p=new i.Type("ImageLink",P=>(0,u.hasContentType)(P)&&P.__TYPE__===e.ImageLinkType,P=>(0,r.pipe)(d.decode(P),n.either.map(Y=>e.ImageLinkContent.encode({...Y,__TYPE__:e.ImageLinkType}))),P=>d.encode(P));e.ImageLinkContent=i.intersection([i.strict({__TYPE__:i.literal(e.ImageLinkType)}),d]),e.FileLinkType="FileLink";const A=i.exact(i.intersection([i.type({kind:i.string,id:i.string,url:i.string,name:i.string,size:(0,o.withFallback)(i.string,"0")}),i.partial({date:a.StringOrNull})])),m=new i.Type("FilledFileLink",P=>(0,u.hasContentType)(P)&&P.__TYPE__===e.FileLinkType,P=>(0,r.pipe)(A.decode(P),n.either.map(Y=>e.FilledFileLinkContent.encode({...Y,__TYPE__:e.FileLinkType}))),P=>A.encode(P));e.FilledFileLinkContent=i.intersection([i.strict({__TYPE__:i.literal(e.FileLinkType)}),A]);const v=i.union([i.intersection([A,i.exact(i.partial({text:i.string}))]),i.strict({kind:i.literal("file"),text:i.string})]),_=new i.Type("FileLink",P=>(0,u.hasContentType)(P)&&P.__TYPE__===e.FileLinkType,P=>(0,r.pipe)(v.decode(P),n.either.map(Y=>e.FileLinkContent.encode({...Y,__TYPE__:e.FileLinkType}))),P=>v.encode(P));e.FileLinkContent=i.intersection([i.strict({__TYPE__:i.literal(e.FileLinkType)}),v]),e.MediaLinkType="MediaLink";const C=i.strict({kind:i.literal("media"),text:i.string}),I=new i.Type("MediaLink",P=>(0,u.hasContentType)(P)&&P.__TYPE__===e.MediaLinkType,P=>(0,r.pipe)(C.decode(P),n.either.map(Y=>e.MediaLinkContent.encode({...Y,__TYPE__:e.MediaLinkType}))),P=>C.encode(P));e.MediaLinkContent=i.intersection([i.strict({__TYPE__:i.literal(e.MediaLinkType)}),C]),e.DocumentLinkType="DocumentLink";const x=i.strict({id:a.NonEmptyString}),g=new i.Type("FilledDocumentLink",P=>(0,u.hasContentType)(P)&&P.__TYPE__===e.DocumentLinkType,P=>(0,r.pipe)(x.decode(P),n.either.map(Y=>e.FilledDocumentLinkContent.encode({...Y,__TYPE__:e.DocumentLinkType}))),P=>x.encode(P));e.FilledDocumentLinkContent=i.intersection([i.strict({__TYPE__:i.literal(e.DocumentLinkType)}),x]);const S=i.union([i.intersection([x,i.exact(i.partial({text:i.string}))]),i.strict({kind:i.literal("document"),text:i.string})]),y=new i.Type("DocumentLink",P=>(0,u.hasContentType)(P)&&P.__TYPE__===e.DocumentLinkType,P=>(0,r.pipe)(S.decode(P),n.either.map(Y=>e.DocumentLinkContent.encode({...Y,__TYPE__:e.DocumentLinkType}))),P=>S.encode(P));e.DocumentLinkContent=i.intersection([i.strict({__TYPE__:i.literal(e.DocumentLinkType)}),S]),e.ExternalLinkType="ExternalLink";const T=i.exact(i.intersection([i.type({url:i.string}),i.partial({kind:i.literal("web"),target:a.StringOrNull,preview:(0,s.nullable)(i.partial({title:i.string}))})])),w=new i.Type("FilledExternalLink",P=>(0,u.hasContentType)(P)&&P.__TYPE__===e.ExternalLinkType,P=>(0,r.pipe)(T.decode(P),n.either.map(Y=>e.FilledExternalLinkContent.encode({...Y,__TYPE__:e.ExternalLinkType}))),P=>T.encode(P));e.FilledExternalLinkContent=i.intersection([i.strict({__TYPE__:i.literal(e.ExternalLinkType)}),T]);const O=i.union([i.intersection([T,i.exact(i.partial({text:i.string}))]),i.strict({kind:i.literal("web"),text:i.string})]),E=new i.Type("ExternalLink",P=>(0,u.hasContentType)(P)&&P.__TYPE__===e.ExternalLinkType,P=>(0,r.pipe)(O.decode(P),n.either.map(Y=>e.ExternalLinkContent.encode({...Y,__TYPE__:e.ExternalLinkType}))),P=>O.encode(P));e.ExternalLinkContent=i.intersection([i.strict({__TYPE__:i.literal(e.ExternalLinkType)}),O]),e.AnyLinkType="AnyLink";const F=i.strict({text:i.string}),W=new i.Type("AnyLink",P=>(0,u.hasContentType)(P)&&P.__TYPE__===e.AnyLinkType,P=>(0,r.pipe)(F.decode(P),n.either.map(Y=>e.AnyLinkContent.encode({...Y,__TYPE__:e.AnyLinkType}))),P=>F.encode(P));e.AnyLinkContent=i.intersection([i.strict({__TYPE__:i.literal(e.AnyLinkType)}),F]),e.LinkContentType="LinkContent";const K=P=>(0,u.hasContentType)(P)&&P.__TYPE__===e.LinkContentType;e.isLinkContent=K,e.LinkLegacy=i.union([p,_,y,E,I,W]);const J=P=>new i.Type("LinkLegacy",e.isLinkContent,Y=>(0,r.pipe)(e.LinkLegacy.decode(Y),n.either.map(M=>e.LinkContent.encode({value:M,__TYPE__:e.LinkContentType}))),Y=>({content:e.LinkLegacy.encode(Y.value),types:{[P.keyOfType]:"Link"}}));e.LinkContentLegacy=J,e.Link=i.union([e.ImageLinkContent,e.FileLinkContent,e.DocumentLinkContent,e.ExternalLinkContent,e.MediaLinkContent,e.AnyLinkContent]),e.LinkContent=i.strict({__TYPE__:i.literal(e.LinkContentType),value:e.Link});const ee=P=>(0,u.hasContentType)(P)&&P.__TYPE__===e.LinkContentType;e.isFilledLinkContent=ee,e.FilledLinkLegacy=i.union([l,m,g,w]);const re=P=>new i.Type("FilledLinkLegacy",e.isFilledLinkContent,Y=>(0,r.pipe)(e.FilledLinkLegacy.decode(Y),n.either.map(M=>e.FilledLinkContent.encode({value:M,__TYPE__:e.LinkContentType}))),Y=>({content:e.FilledLinkLegacy.encode(Y.value),types:{[P.keyOfType]:"Link"}}));e.FilledLinkContentLegacy=re,e.FilledLink=i.union([e.FilledImageLinkContent,e.FilledFileLinkContent,e.FilledDocumentLinkContent,e.FilledExternalLinkContent]),e.FilledLinkContent=i.strict({__TYPE__:i.literal(e.LinkContentType),value:e.FilledLink})}(Ub)),Ub}var Ci={},Bb={},Pb={},IF;function TF(){return IF||(IF=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;const t=Q,n=lt,r=ln,i=Ge,o=(0,t.__importStar)(Z),a=$0,s=vh,u=ft(),c=Xe,l=TR(),d=xR(),p=wR(),A=E=>o.strict({data:E,start:o.number,end:o.number,type:o.literal(s.RichTextNodeType.hyperlink)}),m=o.strict({data:(0,a.withFallback)(o.string,""),start:o.number,end:o.number,type:o.literal("label")}),v=o.strict({start:o.number,end:o.number,type:o.keyof({[s.RichTextNodeType.strong]:null,[s.RichTextNodeType.em]:null,"list-item":null})});e.Span=o.union([A(p.FilledLink),m,v]),e.SpanLegacy=o.union([A(p.FilledLinkLegacy),m,v]);const _=E=>new o.Type("ValidatedSpans",F=>Array.isArray(F)&&F.every(E.is),(F,W)=>{if(Array.isArray(F)){const K=F.reduce((J,ee)=>{const re=E.decode(ee);return(0,r.isLeft)(re)?J:[...J,re.right]},[]).sort((J,ee)=>J.start-ee.start);return o.success(K)}else return o.failure(F,W)},F=>F.reduce((W,K)=>{const J=E.encode(K);return[...W,J]},[]));e.ValidatedSpans=_;const C=E=>o.exact(o.intersection([o.type({type:o.literal(s.RichTextNodeType.image),data:o.intersection([d.ImageContentView,o.partial({linkTo:(0,c.nullable)(E)})])}),o.partial({label:u.StringOrNull,direction:u.StringOrNull})]));e.ImageBlock=C(p.FilledLink);const I=C(p.FilledLinkLegacy);function x(E){return E.type===s.RichTextNodeType.image}e.checkImageBlock=x;const g=o.exact(o.intersection([o.type({type:o.literal(s.RichTextNodeType.embed),data:o.unknown}),o.partial({label:u.StringOrNull,direction:u.StringOrNull})])),S=new o.Type("EmbedBlockLegacy",E=>E.type==="embed",E=>(0,i.pipe)(g.decode(E),n.either.chain(F=>n.either.map(W=>[F,W])(l.EmbedContentLegacy.decode(F.data))),n.either.map(([F,W])=>e.EmbedBlock.encode({...F,data:{...W,__TYPE__:l.EmbedContentType,all:F.data}}))),E=>({...g.encode(E),data:l.EmbedContentLegacy.encode(E.data)}));e.EmbedBlock=o.exact(o.intersection([o.type({type:o.literal(s.RichTextNodeType.embed),data:l.EmbedContent}),o.partial({label:u.StringOrNull,direction:u.StringOrNull})]));function y(E){return E.type===s.RichTextNodeType.embed}e.checkEmbedBlock=y;const T=E=>o.exact(o.intersection([o.type({type:(0,c.refineType)(s.RichTextNodeTypeCodec,`string which isn't ${s.RichTextNodeType.image} ${s.RichTextNodeType.embed}`,F=>F!==s.RichTextNodeType.image&&F!==s.RichTextNodeType.embed),content:o.intersection([o.type({text:o.string}),o.partial({spans:(0,e.ValidatedSpans)(E)})])}),o.partial({label:o.string,direction:o.string})]));e.TextBlock=T(e.Span);const w=T(e.SpanLegacy),O=o.union([S,I,w]);e.BlockLegacy=new o.Type("BlockLegacy",E=>S.is(E)||I.is(E)||w.is(E),E=>O.decode(E),E=>(()=>e.ImageBlock.is(E)?I.encode(E):e.EmbedBlock.is(E)?S.encode(E):w.encode(E))()),e.Block=o.union([e.ImageBlock,e.EmbedBlock,e.TextBlock])}(Pb)),Pb}var xF;function fq(){return xF||(xF=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.RichTextLegacy=e.RichTextContent=e.isRichTextContent=e.RichTextContentType=void 0;const t=Q,n=lt,r=Ge,i=(0,t.__importStar)(Z),o=Pt(),a=TF();e.RichTextContentType="StructuredTextContent";const s=l=>(0,o.hasContentType)(l)&&l.__TYPE__===e.RichTextContentType;e.isRichTextContent=s;const u=i.array(a.BlockLegacy);e.RichTextContent=i.strict({__TYPE__:i.literal(e.RichTextContentType),value:i.array(a.Block)}),(0,t.__exportStar)(TF(),e);const c=l=>new i.Type("RichTextLegacy",e.isRichTextContent,d=>(0,r.pipe)(u.decode(d),n.either.map(p=>({value:p,__TYPE__:e.RichTextContentType}))),d=>({content:u.encode(d.value),types:{[l.keyOfType]:"StructuredText"}}));e.RichTextLegacy=c}(Bb)),Bb}var Wb={},wF;function dq(){return wF||(wF=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.SeparatorContent=e.SeparatorLegacy=e.isSeparatorContent=e.SeparatorContentType=void 0;const n=(0,Q.__importStar)(Z),r=Pt();e.SeparatorContentType="SeparatorContent";const i=a=>(0,r.hasContentType)(a)&&a.__TYPE__===e.SeparatorContentType;e.isSeparatorContent=i;const o=a=>new n.Type("SeparatorLegacy",e.isSeparatorContent,()=>n.success(e.SeparatorContent.encode({__TYPE__:e.SeparatorContentType})),()=>({content:{},types:{[a.keyOfType]:"Separator"}}));e.SeparatorLegacy=o,e.SeparatorContent=n.strict({__TYPE__:n.literal(e.SeparatorContentType)})}(Wb)),Wb}var EF;function XTe(){if(EF)return Ci;EF=1,Object.defineProperty(Ci,"__esModule",{value:!0}),Ci.NestableLegacy=Ci.isNestableContent=Ci.NestableContentDefaultValue=Ci.NestableContent=void 0;const e=Q,t=ln,n=(0,e.__importStar)(Z),r=aq(),i=sq(),o=TR(),a=uq(),s=hi,u=cq(),c=xR(),l=lq(),d=wR(),p=fq(),A=dq();Ci.NestableContent=n.union([r.EmptyContent,i.BooleanContent,o.EmbedContent,a.TextContent,a.TimestampContent,a.SelectContent,a.RangeContent,a.NumberContent,a.DateContent,a.ColorContent,u.GeoPointContent,c.ImageContent,l.IntegrationFieldContent,d.LinkContent,p.RichTextContent,A.SeparatorContent]);const m=C=>{switch(C.type){case"Boolean":return(0,i.BooleanContentDefaultValue)(C);case"Select":return(0,a.SelectContentDefaultValue)(C);default:return}};Ci.NestableContentDefaultValue=m;const v=C=>(0,a.isTextContent)(C)||(0,a.isColorContent)(C)||(0,a.isDateContent)(C)||(0,a.isTimestampContent)(C)||(0,a.isNumberContent)(C)||(0,a.isRangeContent)(C)||(0,a.isSelectContent)(C)||(0,u.isGeoPointContent)(C)||(0,p.isRichTextContent)(C)||(0,i.isBooleanContent)(C)||(0,o.isEmbedContent)(C)||(0,c.isImageContent)(C)||(0,l.isIntegrationFieldContent)(C)||(0,d.isLinkContent)(C)||(0,A.isSeparatorContent)(C)||(0,r.isEmptyContent)(C);Ci.isNestableContent=v;const _=C=>({decode(I){if(!C.fieldType)return;const x=(0,r.EmptyLegacy)(C.fieldType).decode(I);if((0,t.isRight)(x))return x;const g=(()=>{switch(C.fieldType){case"Text":return(0,a.TextLegacy)(C);case"Color":return(0,a.ColorLegacy)(C);case"Date":return(0,a.DateLegacy)(C);case"Timestamp":return(0,a.TimestampLegacy)(C);case"Number":return(0,a.NumberLegacy)(C);case"Range":return(0,a.RangeLegacy)(C);case"Select":return(0,a.SelectLegacy)(C);case"GeoPoint":return(0,u.GeoPointLegacy)(C);case"StructuredText":return(0,p.RichTextLegacy)(C);case"Boolean":return(0,i.BooleanLegacy)(C);case"Embed":return(0,o.EmbedLegacy)(C);case"Image":return(0,c.ImageLegacy)(C);case"IntegrationFields":return(0,l.IntegrationFieldLegacy)(C);case"Link":return(0,d.LinkContentLegacy)(C);case"Separator":return(0,A.SeparatorLegacy)(C);default:return}})();if(g)return g.decode(I)},encode(I){switch(I.__TYPE__){case s.FieldContentType:return I.type==="Text"?(0,a.TextLegacy)(C).encode(I):I.type==="Color"?(0,a.ColorLegacy)(C).encode(I):I.type==="Range"?(0,a.RangeLegacy)(C).encode(I):I.type==="Date"?(0,a.DateLegacy)(C).encode(I):I.type==="Number"?(0,a.NumberLegacy)(C).encode(I):I.type==="Timestamp"?(0,a.TimestampLegacy)(C).encode(I):I.type==="Select"?(0,a.SelectLegacy)(C).encode(I):void 0;case u.GeoPointContentType:return(0,u.GeoPointLegacy)(C).encode(I);case p.RichTextContentType:return(0,p.RichTextLegacy)(C).encode(I);case o.EmbedContentType:return(0,o.EmbedLegacy)(C).encode(I);case i.BooleanContentType:return(0,i.BooleanLegacy)(C).encode(I);case c.ImageContentType:return(0,c.ImageLegacy)(C).encode(I);case l.IntegrationFieldContentType:return(0,l.IntegrationFieldLegacy)(C).encode(I);case d.LinkContentType:return(0,d.LinkContentLegacy)(C).encode(I);case A.SeparatorContentType:return(0,A.SeparatorLegacy)(C).encode(I);default:return}}});return Ci.NestableLegacy=_,Ci}var $F;function Lo(){return $F||($F=1,function(e){Object.defineProperty(e,"__esModule",{value:!0});const t=Q;(0,t.__exportStar)(sq(),e),(0,t.__exportStar)(TR(),e),(0,t.__exportStar)(uq(),e),(0,t.__exportStar)(cq(),e),(0,t.__exportStar)(xR(),e),(0,t.__exportStar)(lq(),e),(0,t.__exportStar)(wR(),e),(0,t.__exportStar)(XTe(),e),(0,t.__exportStar)(fq(),e),(0,t.__exportStar)(dq(),e)}(_b)),_b}var Do={},RF;function W0(){if(RF)return Do;RF=1,Object.defineProperty(Do,"__esModule",{value:!0}),Do.repeatableContentWithDefaultNestableContentValues=Do.withDefaultNestableContentValues=Do.withDefaultSlicePrimaryContentValues=void 0;const e=fe,t=Qa(),n=Lo();function r(a,s){const u=s;for(const[c,l]of Object.entries(a)){const d=s[c];if(d===void 0){if(l.type===e.GroupFieldType)u[c]=(0,t.groupContentWithDefaultValues)(l,t.GroupContentDefaultValue);else{const p=(0,n.NestableContentDefaultValue)(l);p&&(u[c]=p)}continue}l.type===e.GroupFieldType&&(0,t.isGroupContent)(d)&&(u[c]=(0,t.groupContentWithDefaultValues)(l,d))}return u}Do.withDefaultSlicePrimaryContentValues=r;function i(a,s){return Object.entries(a).reduce((u,[c,l])=>{if(s[c]===void 0){const d=(0,n.NestableContentDefaultValue)(l);return d!==void 0?{...u,[c]:d}:u}return u},s)}Do.withDefaultNestableContentValues=i;function o(a,s){const u=Object.entries(a);return s.map(c=>u.reduce((l,[d,p])=>{var A;const m=c.value.find(([v])=>v===d);if(p.type==="Group"){const v=(0,t.groupContentWithDefaultValues)(p,(A=m==null?void 0:m[1])!==null&&A!==void 0?A:{__TYPE__:t.GroupContentType,value:[]});return{...l,value:[...l.value.filter(([_])=>_!==d),...v?[[d,v]]:[]]}}else if(!m){const v=(0,n.NestableContentDefaultValue)(p);return{...l,value:[...l.value,...v?[[d,v]]:[]]}}return l},c))}return Do.repeatableContentWithDefaultNestableContentValues=o,Do}var OF;function Qa(){return OF||(OF=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;const t=Q,n=lt,r=ln,i=Ge,o=(0,t.__importStar)(Z),a=fe,s=Qn,u=Pt(),c=Lo(),l=W0();e.GroupItemContentType="GroupItemContent",e.GroupContentType="GroupContentType",e.GroupItemContent=o.recursion("GroupItemContent",()=>o.strict({__TYPE__:o.literal(e.GroupItemContentType),value:o.array(o.tuple([o.string,o.union([c.NestableContent,e.GroupContent])]))})),e.GroupContent=o.recursion("GroupContent",()=>o.strict({__TYPE__:o.literal(e.GroupContentType),value:o.array(e.GroupItemContent)})),e.isGroupContent=e.GroupContent.is,e.GroupContentDefaultValue={__TYPE__:e.GroupContentType,value:[]};const d=o.record(o.string,o.unknown),p=C=>new o.Type("GroupItemLegacy",I=>(0,u.hasContentType)(I)&&I.__TYPE__===e.GroupItemContentType,I=>(0,i.pipe)(d.decode(I),n.either.map(g=>({value:Object.entries(g).reduce((y,[T,w])=>{const O=(0,s.getFieldCtx)(T,C),E=O.fieldType===a.GroupFieldType?(0,e.GroupLegacy)(O).decode(w):(0,c.NestableLegacy)(O).decode(w);return!E||(0,r.isLeft)(E)?y:[...y,[T,E.right]]},[]),__TYPE__:e.GroupItemContentType}))),I=>I.value.reduce((x,[g,S])=>{const y=(0,s.getFieldCtx)(g,C),T=(0,e.isGroupContent)(S)?(0,e.GroupLegacy)(y).encode(S):(0,c.NestableLegacy)(y).encode(S);return T?{content:{...x.content,[g]:T.content},types:{...x.types,...T.types}}:x},{content:{},types:{}}));e.GroupItemLegacy=p;const A=C=>{const I=o.array(o.union([o.null,(0,e.GroupItemLegacy)(C)])),x=o.array((0,e.GroupItemLegacy)(C));return new o.Type("GroupLegacy",e.isGroupContent,g=>(0,i.pipe)(I.decode(g),n.either.map(S=>({value:S.map(y=>y===null?{__TYPE__:e.GroupItemContentType,value:[]}:y),__TYPE__:e.GroupContentType}))),g=>{const S=x.encode(g.value);return{content:S.map(y=>y.content),types:S.reduce((y,T)=>({...y,...T.types}),{[C.keyOfType]:a.GroupFieldType})}})};e.GroupLegacy=A;function m(C,I){var x;const g=(x=C.config)===null||x===void 0?void 0:x.fields;return g?{...I,value:(0,l.repeatableContentWithDefaultNestableContentValues)(g,I.value)}:I}e.groupContentWithDefaultValues=m;function v({path:C,key:I,apiId:x,model:g,content:S}){return y=>{var T;const w=_({path:C,model:(T=g==null?void 0:g.config)===null||T===void 0?void 0:T.fields,content:S.value})(y);return y({path:C,key:I,apiId:x,model:g,content:{__TYPE__:S.__TYPE__,value:w}})}}e.traverseGroupContent=v;function _({path:C,model:I,content:x}){return g=>x.map((S,y)=>{const T=C.concat([{key:y.toString(),type:"GroupItem"}]),w=S.value.reduce((O,[E,F])=>{const W=I==null?void 0:I[E];let K;return(!W||(W==null?void 0:W.type)===a.GroupFieldType)&&F.__TYPE__===e.GroupContentType?K=v({path:T.concat([{key:E,type:"Widget"}]),key:E,apiId:E,model:W,content:F})(g):K=g({path:T.concat([{key:E,type:"Widget"}]),key:E,apiId:E,model:W,content:F}),!K||!((0,c.isNestableContent)(K)||(0,e.isGroupContent)(K))?O:O.concat([[E,K]])},[]);return{__TYPE__:S.__TYPE__,value:w}})}e.traverseGroupItemsContent=_}(Sb)),Sb}var Db={},Kb={},Nb={},eu={},FF;function pq(){if(FF)return eu;FF=1,Object.defineProperty(eu,"__esModule",{value:!0}),eu.RepeatableWidgets=eu.RepeatableWidgetsLegacy=void 0;const t=(0,Q.__importStar)(Z),n=Qa(),r=Lo(),i=s=>t.array((0,n.GroupItemLegacy)(s));eu.RepeatableWidgetsLegacy=i;const o=t.tuple([t.string,t.union([r.NestableContent,n.GroupContent])]),a=t.strict({__TYPE__:t.literal(n.GroupItemContentType),value:t.array(o)});return eu.RepeatableWidgets=t.array(a),eu}var kF;function $m(){return kF||(kF=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;const t=Q,n=lt,r=ln,i=Ge,o=(0,t.__importStar)(Z),a=Qn,s=Pt(),u=Qa(),c=Lo(),l=W0(),d=pq();e.CompositeSliceContentType="CompositeSliceContent";const p=I=>(0,s.hasContentType)(I)&&I.__TYPE__===e.CompositeSliceContentType;e.isCompositeSliceContent=p;const A=o.exact(o.partial({repeat:o.array(o.unknown),"non-repeat":o.UnknownRecord})),m=I=>new o.Type("CompositeSliceLegacy",e.isCompositeSliceContent,x=>(0,i.pipe)(A.decode(x),n.either.map(g=>{const S=(()=>{const T=(0,a.getFieldCtx)("repeat",I),w=(0,d.RepeatableWidgetsLegacy)(T).decode(g.repeat);if(!(!w||(0,r.isLeft)(w)))return w.right})()||[];return{nonRepeat:Object.entries(g["non-repeat"]||{}).reduce((T,[w,O])=>{const E=(0,a.getFieldCtx)(w,I,["non-repeat"]);if(!E)return T;const F=(0,c.NestableLegacy)(E).decode(O);return!F||(0,r.isLeft)(F)?T:{...T,[w]:F.right}},{}),repeat:S,__TYPE__:e.CompositeSliceContentType}})),x=>{const g=Object.entries(x.nonRepeat).reduce((y,[T,w])=>{const O=(0,a.getFieldCtx)(T,I,["non-repeat"]),E=(0,c.NestableLegacy)(O).encode(w);return E?{content:{...y.content,[T]:E.content},types:{...y.types,...E.types}}:y},{content:{},types:{}}),S=(()=>{const y=(0,a.getFieldCtx)("repeat",I);return(0,d.RepeatableWidgetsLegacy)(y).encode(x.repeat)})()||[];return{content:{"non-repeat":g.content,repeat:S.map(y=>y.content)},types:{[I.keyOfType]:"Slice",...g.types,...S.reduce((y,T)=>({...y,...T.types}),{})}}});e.CompositeSliceLegacy=m,e.CompositeSliceContent=o.strict({__TYPE__:o.literal(e.CompositeSliceContentType),nonRepeat:o.record(o.string,c.NestableContent),repeat:d.RepeatableWidgets});function v(I,x){var g,S;const y=(0,l.withDefaultNestableContentValues)((g=I["non-repeat"])!==null&&g!==void 0?g:{},x.nonRepeat),T=(0,l.repeatableContentWithDefaultNestableContentValues)((S=I.repeat)!==null&&S!==void 0?S:{},x.repeat);return{...x,nonRepeat:y,repeat:T}}e.compositeSliceContentWithDefaultValues=v;function _({path:I,sliceKey:x,sliceName:g,model:S,content:y}){return(T,w)=>{const O=Object.entries(y.widget.nonRepeat).reduce((F,[W,K])=>{const J=(()=>{var re,P,Y;return(S==null?void 0:S.type)==="SharedSlice"?(P=(re=S==null?void 0:S.fields)===null||re===void 0?void 0:re.primary)===null||P===void 0?void 0:P[W]:(Y=S==null?void 0:S["non-repeat"])===null||Y===void 0?void 0:Y[W]})(),ee=T({path:I.concat([{key:"non-repeat",type:"primary"},{key:W,type:"Widget"}]),key:W,apiId:g,model:J,content:K});return ee?(0,c.isNestableContent)(ee)?{...F,[W]:ee}:(console.warn(`Warn: Non nestable content with key [${W}] detected in a composite slice [${g}] with key [${x}]`),F):F},{}),E=(0,u.traverseGroupItemsContent)({path:I.concat([{key:"repeat",type:"items"}]),model:(S==null?void 0:S.type)==="SharedSlice"?S==null?void 0:S.fields.items:S==null?void 0:S.repeat,content:y.widget.repeat})(T);return w({key:x,apiId:g,path:I,model:S,content:{...y,widget:{__TYPE__:"CompositeSliceContent",repeat:E,nonRepeat:O}}})}}e.traverseCompositeSliceContent=_;function C(I,x){const[,g]=x.key.split("$");return{key:`${I.sliceName}$${g}`,name:I.sliceName,maybeLabel:x.maybeLabel,widget:{__TYPE__:"SharedSliceContent",variation:I.variationId,primary:Object.entries(x.widget.nonRepeat).reduce((S,[y,T])=>{var w;return!((w=I.fields.primary)===null||w===void 0)&&w[y]?{...S,[y]:T}:(console.warn(`The widget ${y} in the non-repeat zone of the composite slice [${I.sliceName}] with key [${x.key}] doesn't exist in the model.`),S)},{}),items:x.widget.repeat.map(S=>({__TYPE__:"GroupItemContent",value:S.value.reduce((y,[T,w])=>{var O;return!((O=I.fields.items)===null||O===void 0)&&O[T]?y.concat([[T,w]]):(console.warn(`The widget ${T} in the repeat zone of the composite slice [${I.sliceName}] with key [${x.key}] doesn't exist in the model.`),y)},[])}),[])}}}e.migrateCompositeSlice=C}(Nb)),Nb}var qb={},Ko={},MF;function Aq(){if(MF)return Ko;MF=1,Object.defineProperty(Ko,"__esModule",{value:!0}),Ko.isSlicePrimaryContent=Ko.SlicePrimaryLegacy=Ko.SlicePrimaryContent=void 0;const t=(0,Q.__importStar)(Z),n=fe,r=Qa(),i=Lo();Ko.SlicePrimaryContent=t.union([i.NestableContent,r.GroupContent]);const o=s=>{const u=(0,r.GroupLegacy)(s),c=(0,i.NestableLegacy)(s);return{decode(l){return s.fieldType===n.GroupFieldType?u.decode(l):c.decode(l)},encode(l){return(0,r.isGroupContent)(l)?u.encode(l):c.encode(l)}}};Ko.SlicePrimaryLegacy=o;const a=s=>(0,i.isNestableContent)(s)||(0,r.isGroupContent)(s);return Ko.isSlicePrimaryContent=a,Ko}var LF;function Rm(){return LF||(LF=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.traverseSharedSliceContent=e.sharedSliceContentWithDefaultValues=e.SharedSliceContent=e.SharedSliceLegacy=e.isSharedSliceContent=e.SharedSliceContentType=void 0;const t=Q,n=lt,r=ln,i=Ge,o=(0,t.__importStar)(Z),a=$0,s=fe,u=Qn,c=Pt(),l=Qa(),d=Lo(),p=W0(),A=pq(),m=Aq();e.SharedSliceContentType="SharedSliceContent";const v=g=>(0,c.hasContentType)(g)&&g.__TYPE__===e.SharedSliceContentType;e.isSharedSliceContent=v;const _=o.exact(o.type({variation:o.string,items:(0,a.withFallback)(o.array(o.unknown),[]),primary:(0,a.withFallback)(o.UnknownRecord,{})})),C=g=>new o.Type("SharedSliceLegacy",e.isSharedSliceContent,S=>(0,i.pipe)(_.decode(S),n.either.map(y=>{const T=(()=>{const O=(0,u.getFieldCtx)("items",g,["variations",y.variation]),E=(0,A.RepeatableWidgetsLegacy)(O).decode(y.items);if(!(!E||(0,r.isLeft)(E)))return E.right})()||[],w=Object.entries(y.primary).reduce((O,[E,F])=>{const W=(0,u.getFieldCtx)(E,g,["variations",y.variation,"primary"]),K=(0,m.SlicePrimaryLegacy)(W).decode(F);return!K||(0,r.isLeft)(K)?O:{...O,[E]:K.right}},{});return{variation:y.variation,primary:w,items:T,__TYPE__:e.SharedSliceContentType}})),S=>{const y=Object.entries(S.primary).reduce((w,[O,E])=>{const F=(0,u.getFieldCtx)(O,g,["variations",S.variation,"primary"]),W=(0,m.SlicePrimaryLegacy)(F).encode(E);return W?{content:{...w.content,[O]:W.content},types:{...w.types,...W.types}}:w},{content:{},types:{}}),T=(()=>{const w=(0,u.getFieldCtx)("items",g,["variations",S.variation]);return(0,A.RepeatableWidgetsLegacy)(w).encode(S.items)})()||[];return{content:{primary:y.content,items:T.map(w=>w.content),variation:S.variation},types:{[g.keyOfType]:"SharedSlice",...y.types,...T.reduce((w,O)=>({...w,...O.types}),{})}}});e.SharedSliceLegacy=C,e.SharedSliceContent=o.strict({__TYPE__:o.literal(e.SharedSliceContentType),variation:o.string,primary:o.record(o.string,m.SlicePrimaryContent),items:A.RepeatableWidgets});function I(g,S){var y,T;const w=g.variations.find(K=>K.id===S.variation),O=(y=w==null?void 0:w.primary)!==null&&y!==void 0?y:{},E=(T=w==null?void 0:w.items)!==null&&T!==void 0?T:{},F=(0,p.withDefaultSlicePrimaryContentValues)(O,S.primary),W=(0,p.repeatableContentWithDefaultNestableContentValues)(E,S.items);return{...S,primary:F,items:W}}e.sharedSliceContentWithDefaultValues=I;function x({path:g,sliceKey:S,sliceName:y,model:T,content:w}){return(O,E)=>{const F=Object.entries(w.widget.primary).reduce((K,[J,ee])=>{var re,P;const Y=(P=(re=T==null?void 0:T.fields)===null||re===void 0?void 0:re.primary)===null||P===void 0?void 0:P[J],M=(()=>(0,l.isGroupContent)(ee)?(0,l.traverseGroupContent)({path:g.concat([{key:"primary",type:"primary"},{key:J,type:"Widget"}]),key:J,apiId:J,content:ee,model:(Y==null?void 0:Y.type)===s.GroupFieldType?Y:void 0})(O):(0,d.isNestableContent)(ee)?O({path:g.concat([{key:"primary",type:"primary"},{key:J,type:"Widget"}]),key:J,apiId:J,model:Y,content:ee}):void 0)();return M?((0,m.isSlicePrimaryContent)(M)||console.warn(`Warn: Non nestable or group content with key [${J}] detected in a shared slice [${y}] with key [${S}]`),{...K,[J]:M}):K},{}),W=(0,l.traverseGroupItemsContent)({path:g.concat([{key:"items",type:"items"}]),model:T==null?void 0:T.fields.items,content:w.widget.items})(O);return E({key:S,apiId:y,path:g,model:T,content:{...w,widget:{__TYPE__:"SharedSliceContent",variation:w.widget.variation,primary:F,items:W}}})}}e.traverseSharedSliceContent=x}(qb)),qb}var Tr={},jF;function Om(){if(jF)return Tr;jF=1,Object.defineProperty(Tr,"__esModule",{value:!0}),Tr.migrateSimpleSlice=Tr.traverseSimpleSliceContent=Tr.SimpleSliceLegacy=Tr.isSimpleSliceContent=Tr.SimpleSliceContent=void 0;const t=(0,Q.__importStar)(Z),n=Qa(),r=Lo();Tr.SimpleSliceContent=t.union([r.NestableContent,n.GroupContent]);const i=u=>(0,r.isNestableContent)(u)||(0,n.isGroupContent)(u);Tr.isSimpleSliceContent=i;const o=u=>({decode:(()=>u.fieldType==="Group"?(0,n.GroupLegacy)(u).decode.bind(null):(0,r.NestableLegacy)(u).decode.bind(null))(),encode:c=>{switch(c.__TYPE__){case"GroupContentType":return(0,n.GroupLegacy)(u).encode(c);default:return(0,r.NestableLegacy)(u).encode(c)}}});Tr.SimpleSliceLegacy=o;function a({path:u,sliceKey:c,sliceName:l,model:d,content:p}){return(A,m)=>{if((0,n.isGroupContent)(p.widget)){const _=(0,n.traverseGroupContent)({path:u,key:p.key,apiId:p.name,model:(()=>{if((d==null?void 0:d.type)==="Group")return d;if((d==null?void 0:d.type)==="SharedSlice")return{type:"Group",config:{fields:d.fields.items||{}}}})(),content:p.widget})(A);return _&&m({key:p.key,apiId:p.name,path:u,model:d,content:{...p,widget:_}})}const v=A({key:p.key,apiId:p.name,path:u,model:(()=>{var _;if((d==null?void 0:d.type)==="SharedSlice")return(_=d.fields.primary)===null||_===void 0?void 0:_[p.name];if((d==null?void 0:d.type)!=="Group")return d})(),content:p.widget});return v&&m({key:c,apiId:l,path:u,model:d,content:{...p,widget:v}})}}Tr.traverseSimpleSliceContent=a;function s(u,c){var l;const[,d]=c.key.split("$"),p=`${u.sliceName}$${d}`;return c.widget.__TYPE__==="GroupContentType"?{key:p,name:u.sliceName,maybeLabel:c.maybeLabel,widget:{__TYPE__:"SharedSliceContent",variation:u.variationId,primary:{},items:c.widget.value.map(A=>({__TYPE__:"GroupItemContent",value:A.value.reduce((m,[v,_])=>{var C;return!((C=u.fields.items)===null||C===void 0)&&C[v]?m.concat([[v,_]]):m},[])}),[])}}:{key:p,name:u.sliceName,maybeLabel:c.maybeLabel,widget:{__TYPE__:"SharedSliceContent",variation:u.variationId,primary:!((l=u.fields.primary)===null||l===void 0)&&l[c.name]?{[c.name]:c.widget}:{},items:[]}}}return Tr.migrateSimpleSlice=s,Tr}var UF;function hq(){return UF||(UF=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.SliceContent=e.SliceLegacy=void 0;const t=Q,n=(0,t.__importStar)(Z),r=$m(),i=Rm(),o=Om(),a=s=>({decode:u=>(()=>{switch(s.fieldType){case"Slice":return(0,r.CompositeSliceLegacy)(s);case"SharedSlice":return(0,i.SharedSliceLegacy)(s);default:return(0,o.SimpleSliceLegacy)(s)}})().decode(u),encode:u=>{switch(u.__TYPE__){case"SharedSliceContent":return(0,i.SharedSliceLegacy)(s).encode(u);case"CompositeSliceContent":return(0,r.CompositeSliceLegacy)(s).encode(u);default:return(0,o.SimpleSliceLegacy)(s).encode(u)}}});e.SliceLegacy=a,e.SliceContent=n.union([r.CompositeSliceContent,i.SharedSliceContent,o.SimpleSliceContent]),(0,t.__exportStar)($m(),e),(0,t.__exportStar)(Rm(),e),(0,t.__exportStar)(Om(),e),(0,t.__exportStar)(Aq(),e)}(Kb)),Kb}var pn={},BF;function mq(){if(BF)return pn;BF=1,Object.defineProperty(pn,"__esModule",{value:!0}),pn.migrateSliceItem=pn.SlicesItemLegacy=pn.sliceItemContentWithDefaultValues=pn.isSimpleSliceItemContent=pn.isCompositeSliceItemContent=pn.isSharedSliceItemContent=pn.SliceItemContent=void 0;const e=Q,t=lt,n=ln,r=Ge,i=(0,e.__importStar)(Z),o=Xe,a=Qn,s=Qa(),u=Lo(),c=W0(),l=hq(),d=$m(),p=Rm(),A=Om();pn.SliceItemContent=i.type({key:i.string,name:i.string,maybeLabel:i.union([i.string,i.undefined]),widget:l.SliceContent});function m(S){return(0,p.isSharedSliceContent)(S.widget)}pn.isSharedSliceItemContent=m;function v(S){return(0,d.isCompositeSliceContent)(S.widget)}pn.isCompositeSliceItemContent=v;function _(S){return(0,s.isGroupContent)(S.widget)||(0,u.isNestableContent)(S.widget)}pn.isSimpleSliceItemContent=_;function C(S,y){var T;if(S.type==="SharedSlice"&&(0,p.isSharedSliceContent)(y))return(0,l.sharedSliceContentWithDefaultValues)(S,y);if(S.type==="Slice"&&(0,d.isCompositeSliceContent)(y))return(0,l.compositeSliceContentWithDefaultValues)(S,y);if(S.type==="Group"&&(0,s.isGroupContent)(y)&&(!((T=S.config)===null||T===void 0)&&T.fields)){const w=(0,c.repeatableContentWithDefaultNestableContentValues)(S.config.fields,y.value);return{...y,value:w}}return y}pn.sliceItemContentWithDefaultValues=C;const I=i.exact(i.intersection([i.type({key:i.string,value:i.unknown}),i.partial({label:(0,o.nullable)(i.string)})])),x=S=>new i.Type("SlicesItemLegacy",y=>((0,p.isSharedSliceContent)(y.widget),(0,d.isCompositeSliceContent)(y.widget),(0,A.isSimpleSliceContent)(y.widget)),(y,T)=>(0,r.pipe)(I.decode(y),t.either.chain(w=>{var O;const E=w.key.indexOf("$"),F=w.key.substring(0,E>0?E:void 0),W=(0,a.getFieldCtx)(F,S),K=(0,l.SliceLegacy)(W).decode(w.value);return!K||(0,n.isLeft)(K)?i.failure(y,T):i.success({key:w.key,name:F,maybeLabel:(O=w.label)!==null&&O!==void 0?O:void 0,widget:K.right})})),y=>{const T=(0,a.getFieldCtx)(y.name,S),w=(0,l.SliceLegacy)(T).encode(y.widget);return{content:{key:y.key,label:y.maybeLabel,value:(w==null?void 0:w.content)||{}},types:(w==null?void 0:w.types)||{}}});pn.SlicesItemLegacy=x;const g=({model:S,content:y})=>v(y)&&(S==null?void 0:S.type)==="SharedSlice"?(0,d.migrateCompositeSlice)(S,y):_(y)&&(S==null?void 0:S.type)==="SharedSlice"?(0,A.migrateSimpleSlice)(S,y):y;return pn.migrateSliceItem=g,pn}var Vb={},PF;function exe(){return PF||(PF=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.traverseSlices=e.slicesContentWithDefaultValues=e.SlicesContent=e.SlicesLegacy=e.isSlicesContent=e.SlicesContentType=void 0;const t=Q,n=lt,r=Ge,i=(0,t.__importStar)(Z),o=Ah,a=fe,s=Pt(),u=$m(),c=Rm(),l=Om(),d=mq();e.SlicesContentType="SliceContentType";const p=C=>(0,s.hasContentType)(C)&&C.__TYPE__===e.SlicesContentType;e.isSlicesContent=p;const A=C=>{const I=i.array((0,d.SlicesItemLegacy)(C));return new i.Type("SlicesLegacy",e.isSlicesContent,x=>(0,r.pipe)(I.decode(x),n.either.map(g=>({__TYPE__:e.SlicesContentType,value:g}))),x=>{const g=I.encode(x.value);return{content:g.map(S=>S.content),types:g.reduce((S,y)=>({...S,...y.types}),{[C.keyOfType]:"Slices"})}})};e.SlicesLegacy=A,e.SlicesContent=i.type({__TYPE__:i.literal(e.SlicesContentType),value:i.array(d.SliceItemContent)});function m(C,I){var x;const g=(x=C==null?void 0:C.config)===null||x===void 0?void 0:x.choices;if(g===void 0)return I;const S=I.value.map(y=>{const T=g[y.name];if(T){const w=(0,d.sliceItemContentWithDefaultValues)(T,y.widget);return{...y,widget:w}}return y});return{...I,value:S}}e.slicesContentWithDefaultValues=m;function v(C,I,x){var g,S;const y=(S=(g=I==null?void 0:I.config)===null||g===void 0?void 0:g.choices)===null||S===void 0?void 0:S[x.name],T=()=>{if((0,d.isSharedSliceItemContent)(x)&&y&&(0,a.isStaticSharedSlice)(y)){const E=y.variations.find(F=>F.id===x.widget.variation);return E?{type:"SharedSlice",sliceName:y.id,variationId:E.id,fields:{primary:E.primary||{},items:E.items||{}}}:void 0}},w=()=>{var E;const F=o.ContentPath.append(o.ContentPath.serialize(C),x.name),W=Object.values(((E=I==null?void 0:I.config)===null||E===void 0?void 0:E.choices)||{}).find(J=>{var ee;return(0,a.isStaticSharedSlice)(J)?!!(!((ee=J.legacyPaths)===null||ee===void 0)&&ee[F]):!1});if(!W)return;const K=W==null?void 0:W.variations.find(J=>{var ee;return J.id===((ee=W.legacyPaths)===null||ee===void 0?void 0:ee[F])});if(K)return{type:"SharedSlice",sliceName:W.id,variationId:K.id,fields:{primary:K.primary||{},items:K.items||{}}}},O=()=>{if(y){if((0,a.isCompositeSlice)(y))return{type:"Slice","non-repeat":y["non-repeat"]||{},repeat:y.repeat||{}};if((0,a.isLegacySlice)(y))return y}};return T()||w()||O()}function _({path:C,key:I,model:x,content:g}){return({transformWidget:S=({content:T})=>T,transformSlice:y=({content:T})=>T})=>{const T=g.value.reduce((w,O)=>{const E=x&&v(C,x,O),F=(()=>{if((0,d.isSharedSliceItemContent)(O))return(0,c.traverseSharedSliceContent)({path:C.concat({key:O.key,type:"SharedSlice"}),sliceKey:O.key,sliceName:O.name,model:(E==null?void 0:E.type)==="SharedSlice"?E:void 0,content:O})(S,y);if((0,d.isCompositeSliceItemContent)(O))return(0,u.traverseCompositeSliceContent)({path:C.concat({key:O.key,type:"Slice"}),sliceKey:O.key,sliceName:O.name,model:(E==null?void 0:E.type)==="Slice"||(E==null?void 0:E.type)==="SharedSlice"?E:void 0,content:O})(S,y);if((0,d.isSimpleSliceItemContent)(O))return(0,l.traverseSimpleSliceContent)({path:C.concat({key:O.key,type:"LegacySlice"}),sliceKey:O.key,sliceName:O.name,model:E&&(E==null?void 0:E.type)!=="Slice"?E:void 0,content:O})(S,y)})();return F?w.concat(F):w},[]);return S({path:C,key:I,apiId:I,model:x,content:{__TYPE__:g.__TYPE__,value:T}})}}e.traverseSlices=_}(Vb)),Vb}var WF;function gq(){return WF||(WF=1,function(e){Object.defineProperty(e,"__esModule",{value:!0});const t=Q;(0,t.__exportStar)(hq(),e),(0,t.__exportStar)(mq(),e),(0,t.__exportStar)(exe(),e)}(Db)),Db}var Qb={},DF;function vq(){return DF||(DF=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.UIDContent=e.UIDLegacy=e.isUIDContent=e.UIDContentType=void 0;const t=Q,n=lt,r=Ge,i=(0,t.__importStar)(Z),o=Pt();e.UIDContentType="UIDContent";const a=u=>(0,o.hasContentType)(u)&&u.__TYPE__===e.UIDContentType;e.isUIDContent=a;const s=u=>new i.Type("UIDLegacy",e.isUIDContent,c=>(0,r.pipe)(i.string.decode(c),n.either.map(l=>e.UIDContent.encode({value:l,__TYPE__:e.UIDContentType}))),c=>({content:c.value,types:{[u.keyOfType]:"UID"}}));e.UIDLegacy=s,e.UIDContent=i.type({__TYPE__:i.literal(e.UIDContentType),value:i.string})}(Qb)),Qb}var No={},KF;function txe(){if(KF)return No;KF=1,Object.defineProperty(No,"__esModule",{value:!0}),No.WidgetLegacy=No.isWidgetContent=No.WidgetContent=void 0;const t=(0,Q.__importStar)(Z),n=Qa(),r=Lo(),i=gq(),o=vq();No.WidgetContent=t.union([n.GroupContent,r.NestableContent,o.UIDContent,i.SlicesContent]);const a=u=>(0,n.isGroupContent)(u)||(0,r.isNestableContent)(u)||(0,o.isUIDContent)(u)||(0,i.isSlicesContent)(u);No.isWidgetContent=a;const s=u=>({decode(c){if(!u.fieldType)return;const l=(()=>{switch(u.fieldType){case"UID":return(0,o.UIDLegacy)(u);case"Group":return(0,n.GroupLegacy)(u);case"Choice":case"Slices":return(0,i.SlicesLegacy)(u);default:return(0,r.NestableLegacy)(u)}})();if(l)return l.decode(c)},encode(c){switch(c.__TYPE__){case o.UIDContentType:return(0,o.UIDLegacy)(u).encode(c);case n.GroupContentType:return(0,n.GroupLegacy)(u).encode(c);case i.SlicesContentType:return(0,i.SlicesLegacy)(u).encode(c);default:return(0,r.NestableLegacy)(u).encode(c)}}});return No.WidgetLegacy=s,No}var NF;function ER(){return NF||(NF=1,function(e){Object.defineProperty(e,"__esModule",{value:!0});const t=Q;(0,t.__exportStar)(aq(),e),(0,t.__exportStar)(Qa(),e),(0,t.__exportStar)(Lo(),e),(0,t.__exportStar)(gq(),e),(0,t.__exportStar)(vq(),e),(0,t.__exportStar)(txe(),e)}(bb)),bb}Object.defineProperty(or,"__esModule",{value:!0});or.migrateDocument=or.collectWidgets=or.traverseDocument=or.fillDocumentWithDefaultValues=or.DocumentLegacy=or.Document=void 0;const nxe=Q,yq=lt,$R=ln,bq=Ge,Fl=(0,nxe.__importStar)(Z),Cq=Ah,RR=Lc,kl=fe,_i=ER(),tC=Qn;or.Document=Fl.record(RR.WidgetKey,_i.WidgetContent);const rxe=Fl.record(RR.WidgetKey,Fl.unknown),OR=e=>new Fl.Type("Document",t=>!!t&&typeof t=="object",t=>(0,bq.pipe)(rxe.decode(t),yq.either.map(n=>Object.entries(n).reduce((r,[i,o])=>{const a=(0,tC.defaultCtx)(i,e),s=(0,_i.WidgetLegacy)(a).decode(o);return!s||(0,$R.isLeft)(s)?r:{...r,[i]:s.right}},{}))),t=>Object.entries(t).reduce((n,[r,i])=>{const o=(0,tC.defaultCtx)(r,e),a=(0,_i.WidgetLegacy)(o).encode(i);return a?{content:{...n.content,[r]:a.content},types:{...n.types,...a.types}}:n},{content:{},types:{}}));function Sq(e){const t=Object.entries(e),{types:n,widgets:r}=t.reduce((a,[s,u])=>{if(s.endsWith("_TYPE")){const c=tC.FieldOrSliceType.decode(u);if((0,$R.isRight)(c))return{...a,types:a.types.set(s.substring(0,s.length-5),c.right)}}return!s.endsWith("_POSITION")&&!s.endsWith("_TYPE")?{...a,widgets:{...a.widgets,[s]:u}}:a},{types:new Map,widgets:{}}),i=e.slugs_INTERNAL||[],o=e.uid;return{widgets:r,types:n,uid:o,slugs:i}}function ixe(e,t){const n=(0,bq.pipe)(Fl.record(RR.WidgetKey,Fl.unknown).decode(e),yq.either.chain(r=>{const{types:i,widgets:o}=Sq(r);return OR(i).decode(o)}));return(0,$R.isLeft)(n)?void 0:_q(n.right,t)}function oxe(e){const t=OR().encode(e);return{...t.content,...t.types}}or.DocumentLegacy={_codec:OR,extractMetadata:Sq,parse:ixe,encode:oxe};function FR(e){return{customTypeId:e==null?void 0:e.id,fields:Object.fromEntries((0,kl.flattenSections)(e))}}function axe(e,t){const{fields:n}=e&&kl.StaticCustomType.is(e)?FR(e):e;return Object.entries(n).reduce((r,[i,o])=>{const a=t[i],s=(()=>{switch(o.type){case"Group":return(0,_i.isGroupContent)(a)?(0,_i.groupContentWithDefaultValues)(o,a):a;case"Choice":case"Slices":return(0,_i.isSlicesContent)(a)?(0,_i.slicesContentWithDefaultValues)(o,a):a;default:return a===void 0&&kl.NestableWidget.is(o)?(0,_i.NestableContentDefaultValue)(o):a}})();return s?{...r,[i]:s}:r},t)}or.fillDocumentWithDefaultValues=axe;function kR({document:e,customType:t}){const n=t&&kl.StaticCustomType.is(t)?FR(t):t;return({transformWidget:r=({content:o})=>o,transformSlice:i=({content:o})=>o})=>{const o=n&&Object.entries(n.fields).reduce((a,[s,u])=>({...a,[s]:u}),{});return Object.entries(e).reduce((a,[s,u])=>{const c=o&&o[s],l=Cq.ContentPath.make([{key:n==null?void 0:n.customTypeId,type:"CustomType"},{key:s,type:"Widget"}]),d=(()=>{switch(u.__TYPE__){case"SliceContentType":return(0,_i.traverseSlices)({path:l,key:s,model:(c==null?void 0:c.type)==="Slices"||(c==null?void 0:c.type)==="Choice"?c:void 0,content:u})({transformWidget:r,transformSlice:i});case"GroupContentType":return(0,_i.traverseGroupContent)({path:l,key:s,apiId:s,model:(c==null?void 0:c.type)==="Group"?c:void 0,content:u})(r);default:return r({path:l,key:s,apiId:s,model:(c==null?void 0:c.type)!=="Group"&&(c==null?void 0:c.type)!=="Slices"&&(c==null?void 0:c.type)!=="Choice"?c:void 0,content:u})}})();return{...a,...d?{[s]:d}:{}}},{})}}or.traverseDocument=kR;function sxe(e,t){const n={};return kR({document:e})({transformWidget:({content:r,path:i})=>{const o=Cq.ContentPath.serialize(i);return t(r,i)&&(n[o]=r),r}}),n}or.collectWidgets=sxe;function _q(e,t){const n=kl.StaticCustomType.is(t)?FR(t):t;return Object.values((0,kl.collectSharedSlices)(n)).some(i=>!!i.legacyPaths)?kR({document:e,customType:t})({transformSlice:_i.migrateSliceItem}):e}or.migrateDocument=_q;(function(e){Object.defineProperty(e,"__esModule",{value:!0});const t=Q;(0,t.__exportStar)(or,e),(0,t.__exportStar)(ER(),e),(0,t.__exportStar)(Qn,e)})(Ce);function uxe(e,t){const n=cxe(e,t),r=lxe(e,n);return Ce.fillDocumentWithDefaultValues(e,r)}function cxe(e,t){return fe.flattenSections(e).reduce((r,[i,o])=>!t[i]&&o.type==="Group"?{...r,[i]:Iq}:r,t)}function lxe(e,t){return Ce.traverseDocument({document:t,customType:e})({transformWidget({model:n,content:r}){return n?r:void 0},transformSlice(n){return n.model?n.content:void 0}})}const Iq={__TYPE__:"GroupContentType",value:[{__TYPE__:"GroupItemContent",value:[]}]},Tq={unclassified:{title:"Draft",color:"amber"},published:{title:"Live",color:"green"},release:{title:"Planned",color:"purple"},archived:{title:"Archived",color:"grey"}},xq={unclassified:["unclassified","published"],archived:["unclassified","published"],release:["release","published"],published:["published"]};function MR(e){const{documentId:t,versionId:n,baseUrl:r,status:i,releaseId:o}=e,a={s:i,v:n,r:o},s=Fr.createRouteParams({params:a}),u=new URLSearchParams(s).toString();return new URL(`pages/${t}?${u}`,r)}function wq(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var fxe=Te.createContext(wq()),dxe=({children:e})=>{const[t]=Te.useState(()=>wq());return f.jsx(fxe.Provider,{value:t,children:typeof e=="function"?e(t):e})};function pxe(e){const{children:t,...n}=e;return f.jsx(dxe,{children:({reset:r})=>f.jsx(h.ErrorBoundary,{...n,onReset:r,children:t})})}const Axe="media-library-",qF=`${Axe}newMediaLibraryFeaturesBannerClosed`;function Eq(e){const{maxWidth:t}=e,[n,r]=$.useState(()=>!(_d.localStorage.isAvailable()&&_d.localStorage.read(qF)));function i(){r(!1),_d.localStorage.isAvailable()&&_d.localStorage.write(qF,String(Date.now()))}return n?f.jsx(h.Box,{justifyContent:"center",padding:{inline:16,block:12},backgroundColor:"purple9",children:f.jsxs(h.Box,{maxWidth:t,width:"100%",alignItems:"center",gap:8,children:[f.jsx(h.CircleIcon,{color:"purple",name:"autoFixHigh",size:"extraSmall",variant:"solid"}),f.jsxs("div",{children:[f.jsx(h.Text,{color:"white",variant:"bold",children:"New features on the Media Library now available!"}),f.jsxs(h.Box,{gap:4,flexWrap:"wrap",children:[f.jsx(h.Text,{color:"white",children:"Media Tagging, Filtering, Improved Search & Bulk Deletion"}),f.jsx(h.Text,{color:"white",variant:"bold",href:"https://prismic.io/lp/new-media-library",target:"_blank",rel:"noopener noreferrer",underline:!0,children:"Find out More →"})]})]}),f.jsx(h.Button,{invisible:!0,color:"white",sx:{marginLeft:"auto",marginBottom:"auto",flexShrink:0},underline:!0,onClick:i,children:"Close"})]})}):null}const $q=$.createContext(void 0),hxe={selectedIds:new Set,excludedIds:new Set,isAllSelected:!1};function Rq(e){const{children:t,initialState:n,initialTotalItemCount:r,isSelectAllEnabled:i=!1}=e,o=$.useRef(),a=$.useRef(r||0);function s(){if(n&&n.selectedIds){const T=[...n.selectedIds].pop();T&&(o.current=T)}return{...hxe,...n}}const[u,c]=$.useState(s),l=$.useMemo(()=>{const{selectedIds:T,excludedIds:w,isAllSelected:O}=u;return O?a.current-w.size:T.size},[u]),d=$.useCallback(T=>{const{isAllSelected:w,selectedIds:O,excludedIds:E}=u;return w?!E.has(T):O.has(T)},[u]),p=$.useCallback(()=>{const{isAllSelected:T,selectedIds:w,excludedIds:O}=u;return{selectedIds:[...w],excludedIds:[...O],isAllSelected:T,selectedCount:l}},[u,l]),A=Ne.useStableCallback(()=>{i&&c({isAllSelected:!0,selectedIds:new Set,excludedIds:new Set})}),m=Ne.useStableCallback(()=>{c({isAllSelected:!1,selectedIds:new Set,excludedIds:new Set})});$.useEffect(()=>{const{isAllSelected:T,selectedIds:w,excludedIds:O}=u,E=a.current;if(!(E===0||!i)){if(T&&O.size===E){m();return}if(!T&&w.size===E){A();return}}},[u,i,A,m]);const v=Ne.useStableCallback(T=>{const{id:w,isSingleSelection:O,metaKey:E,shiftKey:F,ids:W}=T;return F&&W&&W.length>0&&o.current?C(w,W,o.current):O&&!E?_(w):d(w)?g([w]):x([w]),o.current=w,d(w)});function _(T){d(T)&&l===1?c(w=>({...w,selectedIds:new Set})):c({isAllSelected:!1,selectedIds:new Set([T]),excludedIds:new Set})}function C(T,w,O){const E=mxe(w,O,T),F=d(T);return F?g(E):x(E),F}const I=Ne.useStableCallback(()=>{l>0?m():A()});function x(T){const{isAllSelected:w}=u;if(w){c(O=>({...O,excludedIds:VF(O.excludedIds,T)}));return}c(O=>({...O,selectedIds:QF(O.selectedIds,T)}))}function g(T){const{isAllSelected:w}=u;if(w){c(O=>({...O,excludedIds:QF(O.excludedIds,T)}));return}c(O=>({...O,selectedIds:VF(O.selectedIds,T)}))}function S(T){a.current=T}const y=$.useMemo(()=>({selectedCount:l,state:u,totalItemCount:a.current,isSelected:d,isSelectAllEnabled:i,getSelectionState:p,toggleSelection:v,toggleSelectAll:I,clearSelection:m,setTotalItemCount:S}),[u,m,p,i,d,l,I,v]);return f.jsx($q.Provider,{value:y,children:t})}function Vs(e){const t=$.useContext($q);if(t===void 0)throw new Error("useSelectionManagerContext must be used within a SelectionManagerProvider");const{totalItemCount:n,onChangeSelection:r}=e||{},{setTotalItemCount:i,totalItemCount:o,state:a,getSelectionState:s,...u}=t;n!==void 0&&n!==o&&i(n);const c=Ne.useStableCallback(r);return $.useEffect(()=>{c==null||c(s())},[s,c,a]),{...u,getSelectionState:s,isAllSelected:a.isAllSelected}}function mxe(e,t,n){const r=e.indexOf(t),i=e.indexOf(n);if(r===-1||i===-1)throw new Error("Both startValue and endValue must be in the array");return r<=i?e.slice(r,i+1):e.slice(i,r+1)}function VF(e,t){const n=new Set(e);return t.forEach(r=>n.delete(r)),n}function QF(e,t){return new Set([...e,...t])}const D0=$.createContext(void 0);function Ee(){const e=$.useContext(D0);if(!e)throw new Error("Missing EditorConfigContext.Provider");return e}class nC extends Error{}function Jt(e){throw new nC(`Missing EditorConfig.${e}`)}function gxe(){if(new URL(location.href).searchParams.has("debug"))return;const n=console.error.bind(console);console.error=(...r)=>{r[0]instanceof nC||vxe(r)||n(...r)},window.addEventListener("error",r=>{r.error instanceof nC&&r.preventDefault(),yxe(r.error)&&r.preventDefault()})}function vxe(e){const t="Warning: flushSync was called from inside a lifecycle method",n=typeof e[0]=="string"&&e[0].includes(t),r=typeof e[1]=="string"&&e[1].includes("RichTextField");return n&&r}function yxe(e){const t=/Invalid content for node document: <(bulletList|orderedList)\(listItem*/,n=e.message;return!!(typeof n=="string"&&n.match(t))}var He;(function(e){e.assertEqual=i=>i;function t(i){}e.assertIs=t;function n(i){throw new Error}e.assertNever=n,e.arrayToEnum=i=>{const o={};for(const a of i)o[a]=a;return o},e.getValidEnumValues=i=>{const o=e.objectKeys(i).filter(s=>typeof i[i[s]]!="number"),a={};for(const s of o)a[s]=i[s];return e.objectValues(a)},e.objectValues=i=>e.objectKeys(i).map(function(o){return i[o]}),e.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{const o=[];for(const a in i)Object.prototype.hasOwnProperty.call(i,a)&&o.push(a);return o},e.find=(i,o)=>{for(const a of i)if(o(a))return a},e.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&isFinite(i)&&Math.floor(i)===i;function r(i,o=" | "){return i.map(a=>typeof a=="string"?`'${a}'`:a).join(o)}e.joinValues=r,e.jsonStringifyReplacer=(i,o)=>typeof o=="bigint"?o.toString():o})(He||(He={}));var rC;(function(e){e.mergeShapes=(t,n)=>({...t,...n})})(rC||(rC={}));const ne=He.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Xa=e=>{switch(typeof e){case"undefined":return ne.undefined;case"string":return ne.string;case"number":return isNaN(e)?ne.nan:ne.number;case"boolean":return ne.boolean;case"function":return ne.function;case"bigint":return ne.bigint;case"symbol":return ne.symbol;case"object":return Array.isArray(e)?ne.array:e===null?ne.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?ne.promise:typeof Map<"u"&&e instanceof Map?ne.map:typeof Set<"u"&&e instanceof Set?ne.set:typeof Date<"u"&&e instanceof Date?ne.date:ne.object;default:return ne.unknown}},G=He.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"]),bxe=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:");class Ei extends Error{constructor(t){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=t}get errors(){return this.issues}format(t){const n=t||function(o){return o.message},r={_errors:[]},i=o=>{for(const a of o.issues)if(a.code==="invalid_union")a.unionErrors.map(i);else if(a.code==="invalid_return_type")i(a.returnTypeError);else if(a.code==="invalid_arguments")i(a.argumentsError);else if(a.path.length===0)r._errors.push(n(a));else{let s=r,u=0;for(;u<a.path.length;){const c=a.path[u];u===a.path.length-1?(s[c]=s[c]||{_errors:[]},s[c]._errors.push(n(a))):s[c]=s[c]||{_errors:[]},s=s[c],u++}}};return i(this),r}toString(){return this.message}get message(){return JSON.stringify(this.issues,He.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=n=>n.message){const n={},r=[];for(const i of this.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}Ei.create=e=>new Ei(e);const rp=(e,t)=>{let n;switch(e.code){case G.invalid_type:e.received===ne.undefined?n="Required":n=`Expected ${e.expected}, received ${e.received}`;break;case G.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,He.jsonStringifyReplacer)}`;break;case G.unrecognized_keys:n=`Unrecognized key(s) in object: ${He.joinValues(e.keys,", ")}`;break;case G.invalid_union:n="Invalid input";break;case G.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${He.joinValues(e.options)}`;break;case G.invalid_enum_value:n=`Invalid enum value. Expected ${He.joinValues(e.options)}, received '${e.received}'`;break;case G.invalid_arguments:n="Invalid function arguments";break;case G.invalid_return_type:n="Invalid function return type";break;case G.invalid_date:n="Invalid date";break;case G.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(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}"`:He.assertNever(e.validation):e.validation!=="regex"?n=`Invalid ${e.validation}`:n="Invalid";break;case G.too_small:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:n="Invalid input";break;case G.too_big:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?n=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:n="Invalid input";break;case G.custom:n="Invalid input";break;case G.invalid_intersection_types:n="Intersection results could not be merged";break;case G.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case G.not_finite:n="Number must be finite";break;default:n=t.defaultError,He.assertNever(e)}return{message:n}};let Oq=rp;function Cxe(e){Oq=e}function Fm(){return Oq}const km=e=>{const{data:t,path:n,errorMaps:r,issueData:i}=e,o=[...n,...i.path||[]],a={...i,path:o};let s="";const u=r.filter(c=>!!c).slice().reverse();for(const c of u)s=c(a,{data:t,defaultError:s}).message;return{...i,path:o,message:i.message||s}},Sxe=[];function oe(e,t){const n=km({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,Fm(),rp].filter(r=>!!r)});e.common.issues.push(n)}class Ln{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,n){const r=[];for(const i of n){if(i.status==="aborted")return xe;i.status==="dirty"&&t.dirty(),r.push(i.value)}return{status:t.value,value:r}}static async mergeObjectAsync(t,n){const r=[];for(const i of n)r.push({key:await i.key,value:await i.value});return Ln.mergeObjectSync(t,r)}static mergeObjectSync(t,n){const r={};for(const i of n){const{key:o,value:a}=i;if(o.status==="aborted"||a.status==="aborted")return xe;o.status==="dirty"&&t.dirty(),a.status==="dirty"&&t.dirty(),(typeof a.value<"u"||i.alwaysSet)&&(r[o.value]=a.value)}return{status:t.value,value:r}}}const xe=Object.freeze({status:"aborted"}),Fq=e=>({status:"dirty",value:e}),Hn=e=>({status:"valid",value:e}),iC=e=>e.status==="aborted",oC=e=>e.status==="dirty",Mm=e=>e.status==="valid",Lm=e=>typeof Promise<"u"&&e instanceof Promise;var Ae;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(Ae||(Ae={}));class po{constructor(t,n,r,i){this._cachedPath=[],this.parent=t,this.data=n,this._path=r,this._key=i}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const zF=(e,t)=>{if(Mm(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new Ei(e.common.issues);return this._error=n,this._error}}};function $e(e){if(!e)return{};const{errorMap:t,invalid_type_error:n,required_error:r,description:i}=e;if(t&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:i}:{errorMap:(a,s)=>a.code!=="invalid_type"?{message:s.defaultError}:typeof s.data>"u"?{message:r??s.defaultError}:{message:n??s.defaultError},description:i}}class Fe{constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(t){return Xa(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:Xa(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new Ln,ctx:{common:t.parent.common,data:t.data,parsedType:Xa(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const n=this._parse(t);if(Lm(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(t){const n=this._parse(t);return Promise.resolve(n)}parse(t,n){const r=this.safeParse(t,n);if(r.success)return r.data;throw r.error}safeParse(t,n){var r;const i={common:{issues:[],async:(r=n==null?void 0:n.async)!==null&&r!==void 0?r:!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Xa(t)},o=this._parseSync({data:t,path:i.path,parent:i});return zF(i,o)}async parseAsync(t,n){const r=await this.safeParseAsync(t,n);if(r.success)return r.data;throw r.error}async safeParseAsync(t,n){const r={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Xa(t)},i=this._parse({data:t,path:r.path,parent:r}),o=await(Lm(i)?i:Promise.resolve(i));return zF(r,o)}refine(t,n){const r=i=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(i):n;return this._refinement((i,o)=>{const a=t(i),s=()=>o.addIssue({code:G.custom,...r(i)});return typeof Promise<"u"&&a instanceof Promise?a.then(u=>u?!0:(s(),!1)):a?!0:(s(),!1)})}refinement(t,n){return this._refinement((r,i)=>t(r)?!0:(i.addIssue(typeof n=="function"?n(r,i):n),!1))}_refinement(t){return new Li({schema:this,typeName:ye.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}optional(){return ea.create(this,this._def)}nullable(){return Mu.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return $i.create(this,this._def)}promise(){return Ll.create(this,this._def)}or(t){return sp.create([this,t],this._def)}and(t){return up.create(this,t,this._def)}transform(t){return new Li({...$e(this._def),schema:this,typeName:ye.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const n=typeof t=="function"?t:()=>t;return new pp({...$e(this._def),innerType:this,defaultValue:n,typeName:ye.ZodDefault})}brand(){return new Mq({typeName:ye.ZodBranded,type:this,...$e(this._def)})}catch(t){const n=typeof t=="function"?t:()=>t;return new Pm({...$e(this._def),innerType:this,catchValue:n,typeName:ye.ZodCatch})}describe(t){const n=this.constructor;return new n({...this._def,description:t})}pipe(t){return Sh.create(this,t)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const _xe=/^c[^\s-]{8,}$/i,Ixe=/^[a-z][a-z0-9]*$/,Txe=/[0-9A-HJKMNP-TV-Z]{26}/,xxe=/^([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,wxe=/^(([^<>()[\]\\.,;:\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,})+))$/,Exe=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u"),$xe=/^(((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}))$/,Rxe=/^(([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})))$/,Oxe=e=>e.precision?e.offset?new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${e.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`):new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${e.precision}}Z$`):e.precision===0?e.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"):e.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$");function Fxe(e,t){return!!((t==="v4"||!t)&&$xe.test(e)||(t==="v6"||!t)&&Rxe.test(e))}class xi extends Fe{constructor(){super(...arguments),this._regex=(t,n,r)=>this.refinement(i=>t.test(i),{validation:n,code:G.invalid_string,...Ae.errToObj(r)}),this.nonempty=t=>this.min(1,Ae.errToObj(t)),this.trim=()=>new xi({...this._def,checks:[...this._def.checks,{kind:"trim"}]}),this.toLowerCase=()=>new xi({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]}),this.toUpperCase=()=>new xi({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==ne.string){const o=this._getOrReturnCtx(t);return oe(o,{code:G.invalid_type,expected:ne.string,received:o.parsedType}),xe}const r=new Ln;let i;for(const o of this._def.checks)if(o.kind==="min")t.data.length<o.value&&(i=this._getOrReturnCtx(t,i),oe(i,{code:G.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),r.dirty());else if(o.kind==="max")t.data.length>o.value&&(i=this._getOrReturnCtx(t,i),oe(i,{code:G.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),r.dirty());else if(o.kind==="length"){const a=t.data.length>o.value,s=t.data.length<o.value;(a||s)&&(i=this._getOrReturnCtx(t,i),a?oe(i,{code:G.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):s&&oe(i,{code:G.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),r.dirty())}else if(o.kind==="email")wxe.test(t.data)||(i=this._getOrReturnCtx(t,i),oe(i,{validation:"email",code:G.invalid_string,message:o.message}),r.dirty());else if(o.kind==="emoji")Exe.test(t.data)||(i=this._getOrReturnCtx(t,i),oe(i,{validation:"emoji",code:G.invalid_string,message:o.message}),r.dirty());else if(o.kind==="uuid")xxe.test(t.data)||(i=this._getOrReturnCtx(t,i),oe(i,{validation:"uuid",code:G.invalid_string,message:o.message}),r.dirty());else if(o.kind==="cuid")_xe.test(t.data)||(i=this._getOrReturnCtx(t,i),oe(i,{validation:"cuid",code:G.invalid_string,message:o.message}),r.dirty());else if(o.kind==="cuid2")Ixe.test(t.data)||(i=this._getOrReturnCtx(t,i),oe(i,{validation:"cuid2",code:G.invalid_string,message:o.message}),r.dirty());else if(o.kind==="ulid")Txe.test(t.data)||(i=this._getOrReturnCtx(t,i),oe(i,{validation:"ulid",code:G.invalid_string,message:o.message}),r.dirty());else if(o.kind==="url")try{new URL(t.data)}catch{i=this._getOrReturnCtx(t,i),oe(i,{validation:"url",code:G.invalid_string,message:o.message}),r.dirty()}else o.kind==="regex"?(o.regex.lastIndex=0,o.regex.test(t.data)||(i=this._getOrReturnCtx(t,i),oe(i,{validation:"regex",code:G.invalid_string,message:o.message}),r.dirty())):o.kind==="trim"?t.data=t.data.trim():o.kind==="includes"?t.data.includes(o.value,o.position)||(i=this._getOrReturnCtx(t,i),oe(i,{code:G.invalid_string,validation:{includes:o.value,position:o.position},message:o.message}),r.dirty()):o.kind==="toLowerCase"?t.data=t.data.toLowerCase():o.kind==="toUpperCase"?t.data=t.data.toUpperCase():o.kind==="startsWith"?t.data.startsWith(o.value)||(i=this._getOrReturnCtx(t,i),oe(i,{code:G.invalid_string,validation:{startsWith:o.value},message:o.message}),r.dirty()):o.kind==="endsWith"?t.data.endsWith(o.value)||(i=this._getOrReturnCtx(t,i),oe(i,{code:G.invalid_string,validation:{endsWith:o.value},message:o.message}),r.dirty()):o.kind==="datetime"?Oxe(o).test(t.data)||(i=this._getOrReturnCtx(t,i),oe(i,{code:G.invalid_string,validation:"datetime",message:o.message}),r.dirty()):o.kind==="ip"?Fxe(t.data,o.version)||(i=this._getOrReturnCtx(t,i),oe(i,{validation:"ip",code:G.invalid_string,message:o.message}),r.dirty()):He.assertNever(o);return{status:r.value,value:t.data}}_addCheck(t){return new xi({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...Ae.errToObj(t)})}url(t){return this._addCheck({kind:"url",...Ae.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...Ae.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...Ae.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...Ae.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...Ae.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...Ae.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...Ae.errToObj(t)})}datetime(t){var n;return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,offset:(n=t==null?void 0:t.offset)!==null&&n!==void 0?n:!1,...Ae.errToObj(t==null?void 0:t.message)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...Ae.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n==null?void 0:n.position,...Ae.errToObj(n==null?void 0:n.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...Ae.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...Ae.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...Ae.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...Ae.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...Ae.errToObj(n)})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get minLength(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxLength(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}xi.create=e=>{var t;return new xi({checks:[],typeName:ye.ZodString,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...$e(e)})};function kxe(e,t){const n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,i=n>r?n:r,o=parseInt(e.toFixed(i).replace(".","")),a=parseInt(t.toFixed(i).replace(".",""));return o%a/Math.pow(10,i)}class fs extends Fe{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==ne.number){const o=this._getOrReturnCtx(t);return oe(o,{code:G.invalid_type,expected:ne.number,received:o.parsedType}),xe}let r;const i=new Ln;for(const o of this._def.checks)o.kind==="int"?He.isInteger(t.data)||(r=this._getOrReturnCtx(t,r),oe(r,{code:G.invalid_type,expected:"integer",received:"float",message:o.message}),i.dirty()):o.kind==="min"?(o.inclusive?t.data<o.value:t.data<=o.value)&&(r=this._getOrReturnCtx(t,r),oe(r,{code:G.too_small,minimum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),i.dirty()):o.kind==="max"?(o.inclusive?t.data>o.value:t.data>=o.value)&&(r=this._getOrReturnCtx(t,r),oe(r,{code:G.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),i.dirty()):o.kind==="multipleOf"?kxe(t.data,o.value)!==0&&(r=this._getOrReturnCtx(t,r),oe(r,{code:G.not_multiple_of,multipleOf:o.value,message:o.message}),i.dirty()):o.kind==="finite"?Number.isFinite(t.data)||(r=this._getOrReturnCtx(t,r),oe(r,{code:G.not_finite,message:o.message}),i.dirty()):He.assertNever(o);return{status:i.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,Ae.toString(n))}gt(t,n){return this.setLimit("min",t,!1,Ae.toString(n))}lte(t,n){return this.setLimit("max",t,!0,Ae.toString(n))}lt(t,n){return this.setLimit("max",t,!1,Ae.toString(n))}setLimit(t,n,r,i){return new fs({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:Ae.toString(i)}]})}_addCheck(t){return new fs({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:Ae.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Ae.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Ae.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Ae.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Ae.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:Ae.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:Ae.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Ae.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Ae.toString(t)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&He.isInteger(t.value))}get isFinite(){let t=null,n=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(t===null||r.value<t)&&(t=r.value)}return Number.isFinite(n)&&Number.isFinite(t)}}fs.create=e=>new fs({checks:[],typeName:ye.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...$e(e)});class ds extends Fe{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce&&(t.data=BigInt(t.data)),this._getType(t)!==ne.bigint){const o=this._getOrReturnCtx(t);return oe(o,{code:G.invalid_type,expected:ne.bigint,received:o.parsedType}),xe}let r;const i=new Ln;for(const o of this._def.checks)o.kind==="min"?(o.inclusive?t.data<o.value:t.data<=o.value)&&(r=this._getOrReturnCtx(t,r),oe(r,{code:G.too_small,type:"bigint",minimum:o.value,inclusive:o.inclusive,message:o.message}),i.dirty()):o.kind==="max"?(o.inclusive?t.data>o.value:t.data>=o.value)&&(r=this._getOrReturnCtx(t,r),oe(r,{code:G.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),i.dirty()):o.kind==="multipleOf"?t.data%o.value!==BigInt(0)&&(r=this._getOrReturnCtx(t,r),oe(r,{code:G.not_multiple_of,multipleOf:o.value,message:o.message}),i.dirty()):He.assertNever(o);return{status:i.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,Ae.toString(n))}gt(t,n){return this.setLimit("min",t,!1,Ae.toString(n))}lte(t,n){return this.setLimit("max",t,!0,Ae.toString(n))}lt(t,n){return this.setLimit("max",t,!1,Ae.toString(n))}setLimit(t,n,r,i){return new ds({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:Ae.toString(i)}]})}_addCheck(t){return new ds({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Ae.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Ae.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Ae.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Ae.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:Ae.toString(n)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}ds.create=e=>{var t;return new ds({checks:[],typeName:ye.ZodBigInt,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...$e(e)})};class ip extends Fe{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==ne.boolean){const r=this._getOrReturnCtx(t);return oe(r,{code:G.invalid_type,expected:ne.boolean,received:r.parsedType}),xe}return Hn(t.data)}}ip.create=e=>new ip({typeName:ye.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...$e(e)});class Fu extends Fe{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==ne.date){const o=this._getOrReturnCtx(t);return oe(o,{code:G.invalid_type,expected:ne.date,received:o.parsedType}),xe}if(isNaN(t.data.getTime())){const o=this._getOrReturnCtx(t);return oe(o,{code:G.invalid_date}),xe}const r=new Ln;let i;for(const o of this._def.checks)o.kind==="min"?t.data.getTime()<o.value&&(i=this._getOrReturnCtx(t,i),oe(i,{code:G.too_small,message:o.message,inclusive:!0,exact:!1,minimum:o.value,type:"date"}),r.dirty()):o.kind==="max"?t.data.getTime()>o.value&&(i=this._getOrReturnCtx(t,i),oe(i,{code:G.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),r.dirty()):He.assertNever(o);return{status:r.value,value:new Date(t.data.getTime())}}_addCheck(t){return new Fu({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:Ae.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:Ae.toString(n)})}get minDate(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t!=null?new Date(t):null}}Fu.create=e=>new Fu({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:ye.ZodDate,...$e(e)});class jm extends Fe{_parse(t){if(this._getType(t)!==ne.symbol){const r=this._getOrReturnCtx(t);return oe(r,{code:G.invalid_type,expected:ne.symbol,received:r.parsedType}),xe}return Hn(t.data)}}jm.create=e=>new jm({typeName:ye.ZodSymbol,...$e(e)});class op extends Fe{_parse(t){if(this._getType(t)!==ne.undefined){const r=this._getOrReturnCtx(t);return oe(r,{code:G.invalid_type,expected:ne.undefined,received:r.parsedType}),xe}return Hn(t.data)}}op.create=e=>new op({typeName:ye.ZodUndefined,...$e(e)});class ap extends Fe{_parse(t){if(this._getType(t)!==ne.null){const r=this._getOrReturnCtx(t);return oe(r,{code:G.invalid_type,expected:ne.null,received:r.parsedType}),xe}return Hn(t.data)}}ap.create=e=>new ap({typeName:ye.ZodNull,...$e(e)});class Ml extends Fe{constructor(){super(...arguments),this._any=!0}_parse(t){return Hn(t.data)}}Ml.create=e=>new Ml({typeName:ye.ZodAny,...$e(e)});class du extends Fe{constructor(){super(...arguments),this._unknown=!0}_parse(t){return Hn(t.data)}}du.create=e=>new du({typeName:ye.ZodUnknown,...$e(e)});class oa extends Fe{_parse(t){const n=this._getOrReturnCtx(t);return oe(n,{code:G.invalid_type,expected:ne.never,received:n.parsedType}),xe}}oa.create=e=>new oa({typeName:ye.ZodNever,...$e(e)});class Um extends Fe{_parse(t){if(this._getType(t)!==ne.undefined){const r=this._getOrReturnCtx(t);return oe(r,{code:G.invalid_type,expected:ne.void,received:r.parsedType}),xe}return Hn(t.data)}}Um.create=e=>new Um({typeName:ye.ZodVoid,...$e(e)});class $i extends Fe{_parse(t){const{ctx:n,status:r}=this._processInputParams(t),i=this._def;if(n.parsedType!==ne.array)return oe(n,{code:G.invalid_type,expected:ne.array,received:n.parsedType}),xe;if(i.exactLength!==null){const a=n.data.length>i.exactLength.value,s=n.data.length<i.exactLength.value;(a||s)&&(oe(n,{code:a?G.too_big:G.too_small,minimum:s?i.exactLength.value:void 0,maximum:a?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),r.dirty())}if(i.minLength!==null&&n.data.length<i.minLength.value&&(oe(n,{code:G.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),r.dirty()),i.maxLength!==null&&n.data.length>i.maxLength.value&&(oe(n,{code:G.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((a,s)=>i.type._parseAsync(new po(n,a,n.path,s)))).then(a=>Ln.mergeArray(r,a));const o=[...n.data].map((a,s)=>i.type._parseSync(new po(n,a,n.path,s)));return Ln.mergeArray(r,o)}get element(){return this._def.type}min(t,n){return new $i({...this._def,minLength:{value:t,message:Ae.toString(n)}})}max(t,n){return new $i({...this._def,maxLength:{value:t,message:Ae.toString(n)}})}length(t,n){return new $i({...this._def,exactLength:{value:t,message:Ae.toString(n)}})}nonempty(t){return this.min(1,t)}}$i.create=(e,t)=>new $i({type:e,minLength:null,maxLength:null,exactLength:null,typeName:ye.ZodArray,...$e(t)});function rl(e){if(e instanceof _t){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=ea.create(rl(r))}return new _t({...e._def,shape:()=>t})}else return e instanceof $i?new $i({...e._def,type:rl(e.element)}):e instanceof ea?ea.create(rl(e.unwrap())):e instanceof Mu?Mu.create(rl(e.unwrap())):e instanceof Ao?Ao.create(e.items.map(t=>rl(t))):e}class _t extends Fe{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const t=this._def.shape(),n=He.objectKeys(t);return this._cached={shape:t,keys:n}}_parse(t){if(this._getType(t)!==ne.object){const c=this._getOrReturnCtx(t);return oe(c,{code:G.invalid_type,expected:ne.object,received:c.parsedType}),xe}const{status:r,ctx:i}=this._processInputParams(t),{shape:o,keys:a}=this._getCached(),s=[];if(!(this._def.catchall instanceof oa&&this._def.unknownKeys==="strip"))for(const c in i.data)a.includes(c)||s.push(c);const u=[];for(const c of a){const l=o[c],d=i.data[c];u.push({key:{status:"valid",value:c},value:l._parse(new po(i,d,i.path,c)),alwaysSet:c in i.data})}if(this._def.catchall instanceof oa){const c=this._def.unknownKeys;if(c==="passthrough")for(const l of s)u.push({key:{status:"valid",value:l},value:{status:"valid",value:i.data[l]}});else if(c==="strict")s.length>0&&(oe(i,{code:G.unrecognized_keys,keys:s}),r.dirty());else if(c!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const c=this._def.catchall;for(const l of s){const d=i.data[l];u.push({key:{status:"valid",value:l},value:c._parse(new po(i,d,i.path,l)),alwaysSet:l in i.data})}}return i.common.async?Promise.resolve().then(async()=>{const c=[];for(const l of u){const d=await l.key;c.push({key:d,value:await l.value,alwaysSet:l.alwaysSet})}return c}).then(c=>Ln.mergeObjectSync(r,c)):Ln.mergeObjectSync(r,u)}get shape(){return this._def.shape()}strict(t){return Ae.errToObj,new _t({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(n,r)=>{var i,o,a,s;const u=(a=(o=(i=this._def).errorMap)===null||o===void 0?void 0:o.call(i,n,r).message)!==null&&a!==void 0?a:r.defaultError;return n.code==="unrecognized_keys"?{message:(s=Ae.errToObj(t).message)!==null&&s!==void 0?s:u}:{message:u}}}:{}})}strip(){return new _t({...this._def,unknownKeys:"strip"})}passthrough(){return new _t({...this._def,unknownKeys:"passthrough"})}extend(t){return new _t({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new _t({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:ye.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new _t({...this._def,catchall:t})}pick(t){const n={};return He.objectKeys(t).forEach(r=>{t[r]&&this.shape[r]&&(n[r]=this.shape[r])}),new _t({...this._def,shape:()=>n})}omit(t){const n={};return He.objectKeys(this.shape).forEach(r=>{t[r]||(n[r]=this.shape[r])}),new _t({...this._def,shape:()=>n})}deepPartial(){return rl(this)}partial(t){const n={};return He.objectKeys(this.shape).forEach(r=>{const i=this.shape[r];t&&!t[r]?n[r]=i:n[r]=i.optional()}),new _t({...this._def,shape:()=>n})}required(t){const n={};return He.objectKeys(this.shape).forEach(r=>{if(t&&!t[r])n[r]=this.shape[r];else{let o=this.shape[r];for(;o instanceof ea;)o=o._def.innerType;n[r]=o}}),new _t({...this._def,shape:()=>n})}keyof(){return kq(He.objectKeys(this.shape))}}_t.create=(e,t)=>new _t({shape:()=>e,unknownKeys:"strip",catchall:oa.create(),typeName:ye.ZodObject,...$e(t)});_t.strictCreate=(e,t)=>new _t({shape:()=>e,unknownKeys:"strict",catchall:oa.create(),typeName:ye.ZodObject,...$e(t)});_t.lazycreate=(e,t)=>new _t({shape:e,unknownKeys:"strip",catchall:oa.create(),typeName:ye.ZodObject,...$e(t)});class sp extends Fe{_parse(t){const{ctx:n}=this._processInputParams(t),r=this._def.options;function i(o){for(const s of o)if(s.result.status==="valid")return s.result;for(const s of o)if(s.result.status==="dirty")return n.common.issues.push(...s.ctx.common.issues),s.result;const a=o.map(s=>new Ei(s.ctx.common.issues));return oe(n,{code:G.invalid_union,unionErrors:a}),xe}if(n.common.async)return Promise.all(r.map(async o=>{const a={...n,common:{...n.common,issues:[]},parent:null};return{result:await o._parseAsync({data:n.data,path:n.path,parent:a}),ctx:a}})).then(i);{let o;const a=[];for(const u of r){const c={...n,common:{...n.common,issues:[]},parent:null},l=u._parseSync({data:n.data,path:n.path,parent:c});if(l.status==="valid")return l;l.status==="dirty"&&!o&&(o={result:l,ctx:c}),c.common.issues.length&&a.push(c.common.issues)}if(o)return n.common.issues.push(...o.ctx.common.issues),o.result;const s=a.map(u=>new Ei(u));return oe(n,{code:G.invalid_union,unionErrors:s}),xe}}get options(){return this._def.options}}sp.create=(e,t)=>new sp({options:e,typeName:ye.ZodUnion,...$e(t)});const nm=e=>e instanceof lp?nm(e.schema):e instanceof Li?nm(e.innerType()):e instanceof fp?[e.value]:e instanceof ps?e.options:e instanceof dp?Object.keys(e.enum):e instanceof pp?nm(e._def.innerType):e instanceof op?[void 0]:e instanceof ap?[null]:null;class K0 extends Fe{_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==ne.object)return oe(n,{code:G.invalid_type,expected:ne.object,received:n.parsedType}),xe;const r=this.discriminator,i=n.data[r],o=this.optionsMap.get(i);return o?n.common.async?o._parseAsync({data:n.data,path:n.path,parent:n}):o._parseSync({data:n.data,path:n.path,parent:n}):(oe(n,{code:G.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),xe)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,r){const i=new Map;for(const o of n){const a=nm(o.shape[t]);if(!a)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(const s of a){if(i.has(s))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(s)}`);i.set(s,o)}}return new K0({typeName:ye.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:i,...$e(r)})}}function aC(e,t){const n=Xa(e),r=Xa(t);if(e===t)return{valid:!0,data:e};if(n===ne.object&&r===ne.object){const i=He.objectKeys(t),o=He.objectKeys(e).filter(s=>i.indexOf(s)!==-1),a={...e,...t};for(const s of o){const u=aC(e[s],t[s]);if(!u.valid)return{valid:!1};a[s]=u.data}return{valid:!0,data:a}}else if(n===ne.array&&r===ne.array){if(e.length!==t.length)return{valid:!1};const i=[];for(let o=0;o<e.length;o++){const a=e[o],s=t[o],u=aC(a,s);if(!u.valid)return{valid:!1};i.push(u.data)}return{valid:!0,data:i}}else return n===ne.date&&r===ne.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class up extends Fe{_parse(t){const{status:n,ctx:r}=this._processInputParams(t),i=(o,a)=>{if(iC(o)||iC(a))return xe;const s=aC(o.value,a.value);return s.valid?((oC(o)||oC(a))&&n.dirty(),{status:n.value,value:s.data}):(oe(r,{code:G.invalid_intersection_types}),xe)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([o,a])=>i(o,a)):i(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}up.create=(e,t,n)=>new up({left:e,right:t,typeName:ye.ZodIntersection,...$e(n)});class Ao extends Fe{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==ne.array)return oe(r,{code:G.invalid_type,expected:ne.array,received:r.parsedType}),xe;if(r.data.length<this._def.items.length)return oe(r,{code:G.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),xe;!this._def.rest&&r.data.length>this._def.items.length&&(oe(r,{code:G.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const o=[...r.data].map((a,s)=>{const u=this._def.items[s]||this._def.rest;return u?u._parse(new po(r,a,r.path,s)):null}).filter(a=>!!a);return r.common.async?Promise.all(o).then(a=>Ln.mergeArray(n,a)):Ln.mergeArray(n,o)}get items(){return this._def.items}rest(t){return new Ao({...this._def,rest:t})}}Ao.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Ao({items:e,typeName:ye.ZodTuple,rest:null,...$e(t)})};class cp extends Fe{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==ne.object)return oe(r,{code:G.invalid_type,expected:ne.object,received:r.parsedType}),xe;const i=[],o=this._def.keyType,a=this._def.valueType;for(const s in r.data)i.push({key:o._parse(new po(r,s,r.path,s)),value:a._parse(new po(r,r.data[s],r.path,s))});return r.common.async?Ln.mergeObjectAsync(n,i):Ln.mergeObjectSync(n,i)}get element(){return this._def.valueType}static create(t,n,r){return n instanceof Fe?new cp({keyType:t,valueType:n,typeName:ye.ZodRecord,...$e(r)}):new cp({keyType:xi.create(),valueType:t,typeName:ye.ZodRecord,...$e(n)})}}class Bm extends Fe{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==ne.map)return oe(r,{code:G.invalid_type,expected:ne.map,received:r.parsedType}),xe;const i=this._def.keyType,o=this._def.valueType,a=[...r.data.entries()].map(([s,u],c)=>({key:i._parse(new po(r,s,r.path,[c,"key"])),value:o._parse(new po(r,u,r.path,[c,"value"]))}));if(r.common.async){const s=new Map;return Promise.resolve().then(async()=>{for(const u of a){const c=await u.key,l=await u.value;if(c.status==="aborted"||l.status==="aborted")return xe;(c.status==="dirty"||l.status==="dirty")&&n.dirty(),s.set(c.value,l.value)}return{status:n.value,value:s}})}else{const s=new Map;for(const u of a){const c=u.key,l=u.value;if(c.status==="aborted"||l.status==="aborted")return xe;(c.status==="dirty"||l.status==="dirty")&&n.dirty(),s.set(c.value,l.value)}return{status:n.value,value:s}}}}Bm.create=(e,t,n)=>new Bm({valueType:t,keyType:e,typeName:ye.ZodMap,...$e(n)});class ku extends Fe{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==ne.set)return oe(r,{code:G.invalid_type,expected:ne.set,received:r.parsedType}),xe;const i=this._def;i.minSize!==null&&r.data.size<i.minSize.value&&(oe(r,{code:G.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),n.dirty()),i.maxSize!==null&&r.data.size>i.maxSize.value&&(oe(r,{code:G.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),n.dirty());const o=this._def.valueType;function a(u){const c=new Set;for(const l of u){if(l.status==="aborted")return xe;l.status==="dirty"&&n.dirty(),c.add(l.value)}return{status:n.value,value:c}}const s=[...r.data.values()].map((u,c)=>o._parse(new po(r,u,r.path,c)));return r.common.async?Promise.all(s).then(u=>a(u)):a(s)}min(t,n){return new ku({...this._def,minSize:{value:t,message:Ae.toString(n)}})}max(t,n){return new ku({...this._def,maxSize:{value:t,message:Ae.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}}ku.create=(e,t)=>new ku({valueType:e,minSize:null,maxSize:null,typeName:ye.ZodSet,...$e(t)});class Al extends Fe{constructor(){super(...arguments),this.validate=this.implement}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==ne.function)return oe(n,{code:G.invalid_type,expected:ne.function,received:n.parsedType}),xe;function r(s,u){return km({data:s,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Fm(),rp].filter(c=>!!c),issueData:{code:G.invalid_arguments,argumentsError:u}})}function i(s,u){return km({data:s,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Fm(),rp].filter(c=>!!c),issueData:{code:G.invalid_return_type,returnTypeError:u}})}const o={errorMap:n.common.contextualErrorMap},a=n.data;return this._def.returns instanceof Ll?Hn(async(...s)=>{const u=new Ei([]),c=await this._def.args.parseAsync(s,o).catch(p=>{throw u.addIssue(r(s,p)),u}),l=await a(...c);return await this._def.returns._def.type.parseAsync(l,o).catch(p=>{throw u.addIssue(i(l,p)),u})}):Hn((...s)=>{const u=this._def.args.safeParse(s,o);if(!u.success)throw new Ei([r(s,u.error)]);const c=a(...u.data),l=this._def.returns.safeParse(c,o);if(!l.success)throw new Ei([i(c,l.error)]);return l.data})}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new Al({...this._def,args:Ao.create(t).rest(du.create())})}returns(t){return new Al({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,n,r){return new Al({args:t||Ao.create([]).rest(du.create()),returns:n||du.create(),typeName:ye.ZodFunction,...$e(r)})}}class lp extends Fe{get schema(){return this._def.getter()}_parse(t){const{ctx:n}=this._processInputParams(t);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}lp.create=(e,t)=>new lp({getter:e,typeName:ye.ZodLazy,...$e(t)});class fp extends Fe{_parse(t){if(t.data!==this._def.value){const n=this._getOrReturnCtx(t);return oe(n,{received:n.data,code:G.invalid_literal,expected:this._def.value}),xe}return{status:"valid",value:t.data}}get value(){return this._def.value}}fp.create=(e,t)=>new fp({value:e,typeName:ye.ZodLiteral,...$e(t)});function kq(e,t){return new ps({values:e,typeName:ye.ZodEnum,...$e(t)})}class ps extends Fe{_parse(t){if(typeof t.data!="string"){const n=this._getOrReturnCtx(t),r=this._def.values;return oe(n,{expected:He.joinValues(r),received:n.parsedType,code:G.invalid_type}),xe}if(this._def.values.indexOf(t.data)===-1){const n=this._getOrReturnCtx(t),r=this._def.values;return oe(n,{received:n.data,code:G.invalid_enum_value,options:r}),xe}return Hn(t.data)}get options(){return this._def.values}get enum(){const t={};for(const n of this._def.values)t[n]=n;return t}get Values(){const t={};for(const n of this._def.values)t[n]=n;return t}get Enum(){const t={};for(const n of this._def.values)t[n]=n;return t}extract(t){return ps.create(t)}exclude(t){return ps.create(this.options.filter(n=>!t.includes(n)))}}ps.create=kq;class dp extends Fe{_parse(t){const n=He.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(t);if(r.parsedType!==ne.string&&r.parsedType!==ne.number){const i=He.objectValues(n);return oe(r,{expected:He.joinValues(i),received:r.parsedType,code:G.invalid_type}),xe}if(n.indexOf(t.data)===-1){const i=He.objectValues(n);return oe(r,{received:r.data,code:G.invalid_enum_value,options:i}),xe}return Hn(t.data)}get enum(){return this._def.values}}dp.create=(e,t)=>new dp({values:e,typeName:ye.ZodNativeEnum,...$e(t)});class Ll extends Fe{unwrap(){return this._def.type}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==ne.promise&&n.common.async===!1)return oe(n,{code:G.invalid_type,expected:ne.promise,received:n.parsedType}),xe;const r=n.parsedType===ne.promise?n.data:Promise.resolve(n.data);return Hn(r.then(i=>this._def.type.parseAsync(i,{path:n.path,errorMap:n.common.contextualErrorMap})))}}Ll.create=(e,t)=>new Ll({type:e,typeName:ye.ZodPromise,...$e(t)});class Li extends Fe{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ye.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:n,ctx:r}=this._processInputParams(t),i=this._def.effect||null;if(i.type==="preprocess"){const a=i.transform(r.data);return r.common.async?Promise.resolve(a).then(s=>this._def.schema._parseAsync({data:s,path:r.path,parent:r})):this._def.schema._parseSync({data:a,path:r.path,parent:r})}const o={addIssue:a=>{oe(r,a),a.fatal?n.abort():n.dirty()},get path(){return r.path}};if(o.addIssue=o.addIssue.bind(o),i.type==="refinement"){const a=s=>{const u=i.refinement(s,o);if(r.common.async)return Promise.resolve(u);if(u instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return s};if(r.common.async===!1){const s=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return s.status==="aborted"?xe:(s.status==="dirty"&&n.dirty(),a(s.value),{status:n.value,value:s.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(s=>s.status==="aborted"?xe:(s.status==="dirty"&&n.dirty(),a(s.value).then(()=>({status:n.value,value:s.value}))))}if(i.type==="transform")if(r.common.async===!1){const a=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!Mm(a))return a;const s=i.transform(a.value,o);if(s instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:s}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(a=>Mm(a)?Promise.resolve(i.transform(a.value,o)).then(s=>({status:n.value,value:s})):a);He.assertNever(i)}}Li.create=(e,t,n)=>new Li({schema:e,typeName:ye.ZodEffects,effect:t,...$e(n)});Li.createWithPreprocess=(e,t,n)=>new Li({schema:t,effect:{type:"preprocess",transform:e},typeName:ye.ZodEffects,...$e(n)});class ea extends Fe{_parse(t){return this._getType(t)===ne.undefined?Hn(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}ea.create=(e,t)=>new ea({innerType:e,typeName:ye.ZodOptional,...$e(t)});class Mu extends Fe{_parse(t){return this._getType(t)===ne.null?Hn(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Mu.create=(e,t)=>new Mu({innerType:e,typeName:ye.ZodNullable,...$e(t)});class pp extends Fe{_parse(t){const{ctx:n}=this._processInputParams(t);let r=n.data;return n.parsedType===ne.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}pp.create=(e,t)=>new pp({innerType:e,typeName:ye.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...$e(t)});class Pm extends Fe{_parse(t){const{ctx:n}=this._processInputParams(t),r={...n,common:{...n.common,issues:[]}},i=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return Lm(i)?i.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new Ei(r.common.issues)},input:r.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Ei(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}Pm.create=(e,t)=>new Pm({innerType:e,typeName:ye.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...$e(t)});class Wm extends Fe{_parse(t){if(this._getType(t)!==ne.nan){const r=this._getOrReturnCtx(t);return oe(r,{code:G.invalid_type,expected:ne.nan,received:r.parsedType}),xe}return{status:"valid",value:t.data}}}Wm.create=e=>new Wm({typeName:ye.ZodNaN,...$e(e)});const Mxe=Symbol("zod_brand");class Mq extends Fe{_parse(t){const{ctx:n}=this._processInputParams(t),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}}class Sh extends Fe{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.common.async)return(async()=>{const o=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return o.status==="aborted"?xe:o.status==="dirty"?(n.dirty(),Fq(o.value)):this._def.out._parseAsync({data:o.value,path:r.path,parent:r})})();{const i=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?xe:i.status==="dirty"?(n.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:r.path,parent:r})}}static create(t,n){return new Sh({in:t,out:n,typeName:ye.ZodPipeline})}}const Lq=(e,t={},n)=>e?Ml.create().superRefine((r,i)=>{var o,a;if(!e(r)){const s=typeof t=="function"?t(r):typeof t=="string"?{message:t}:t,u=(a=(o=s.fatal)!==null&&o!==void 0?o:n)!==null&&a!==void 0?a:!0,c=typeof s=="string"?{message:s}:s;i.addIssue({code:"custom",...c,fatal:u})}}):Ml.create(),Lxe={object:_t.lazycreate};var ye;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline"})(ye||(ye={}));const jxe=(e,t={message:`Input not instance of ${e.name}`})=>Lq(n=>n instanceof e,t),Yo=xi.create,Dm=fs.create,Uxe=Wm.create,Bxe=ds.create,jq=ip.create,Pxe=Fu.create,Wxe=jm.create,Dxe=op.create,Kxe=ap.create,Nxe=Ml.create,qxe=du.create,Vxe=oa.create,Qxe=Um.create,Uq=$i.create,Ap=_t.create,zxe=_t.strictCreate,Hxe=sp.create,Yxe=K0.create,Gxe=up.create,Jxe=Ao.create,Zxe=cp.create,Xxe=Bm.create,ewe=ku.create,twe=Al.create,nwe=lp.create,rwe=fp.create,iwe=ps.create,owe=dp.create,awe=Ll.create,HF=Li.create,swe=ea.create,uwe=Mu.create,cwe=Li.createWithPreprocess,lwe=Sh.create,fwe=()=>Yo().optional(),dwe=()=>Dm().optional(),pwe=()=>jq().optional(),Awe={string:e=>xi.create({...e,coerce:!0}),number:e=>fs.create({...e,coerce:!0}),boolean:e=>ip.create({...e,coerce:!0}),bigint:e=>ds.create({...e,coerce:!0}),date:e=>Fu.create({...e,coerce:!0})},hwe=xe;var L=Object.freeze({__proto__:null,defaultErrorMap:rp,setErrorMap:Cxe,getErrorMap:Fm,makeIssue:km,EMPTY_PATH:Sxe,addIssueToContext:oe,ParseStatus:Ln,INVALID:xe,DIRTY:Fq,OK:Hn,isAborted:iC,isDirty:oC,isValid:Mm,isAsync:Lm,get util(){return He},get objectUtil(){return rC},ZodParsedType:ne,getParsedType:Xa,ZodType:Fe,ZodString:xi,ZodNumber:fs,ZodBigInt:ds,ZodBoolean:ip,ZodDate:Fu,ZodSymbol:jm,ZodUndefined:op,ZodNull:ap,ZodAny:Ml,ZodUnknown:du,ZodNever:oa,ZodVoid:Um,ZodArray:$i,ZodObject:_t,ZodUnion:sp,ZodDiscriminatedUnion:K0,ZodIntersection:up,ZodTuple:Ao,ZodRecord:cp,ZodMap:Bm,ZodSet:ku,ZodFunction:Al,ZodLazy:lp,ZodLiteral:fp,ZodEnum:ps,ZodNativeEnum:dp,ZodPromise:Ll,ZodEffects:Li,ZodTransformer:Li,ZodOptional:ea,ZodNullable:Mu,ZodDefault:pp,ZodCatch:Pm,ZodNaN:Wm,BRAND:Mxe,ZodBranded:Mq,ZodPipeline:Sh,custom:Lq,Schema:Fe,ZodSchema:Fe,late:Lxe,get ZodFirstPartyTypeKind(){return ye},coerce:Awe,any:Nxe,array:Uq,bigint:Bxe,boolean:jq,date:Pxe,discriminatedUnion:Yxe,effect:HF,enum:iwe,function:twe,instanceof:jxe,intersection:Gxe,lazy:nwe,literal:rwe,map:Xxe,nan:Uxe,nativeEnum:owe,never:Vxe,null:Kxe,nullable:uwe,number:Dm,object:Ap,oboolean:pwe,onumber:dwe,optional:swe,ostring:fwe,pipeline:lwe,preprocess:cwe,promise:awe,record:Zxe,set:ewe,strictObject:zxe,string:Yo,symbol:Wxe,transformer:HF,tuple:Jxe,undefined:Dxe,union:Hxe,unknown:qxe,void:Qxe,NEVER:hwe,ZodIssueCode:G,quotelessJson:bxe,ZodError:Ei});const mwe=L.object({id:L.string(),label:L.string(),repeatable:L.boolean(),status:L.boolean()}),gwe=L.array(mwe);function Bq(e,t,n){return pe.request(new URL("customtypes",e),{headers:{repository:t},credentials:pe.getRequestCredentials(n),okType:gwe})}const vwe=L.object({first_name:L.string().optional(),last_name:L.string().optional(),email:L.string().optional(),uploadedAvatar:L.string().optional()}),LR=L.object({id:L.string(),name:L.string(),is_master:L.boolean().optional()}),ywe=L.discriminatedUnion("status",[L.object({status:L.literal("unclassified")}),L.object({status:L.literal("published")}),L.object({status:L.literal("release"),release_id:L.string()}),L.object({status:L.literal("archived")})]).and(L.object({version_id:L.string(),tags:L.array(L.string()),custom_type_label:L.string(),preview_summary:L.string().optional(),preview_image:L.string().optional(),last_modified_date:L.coerce.date(),author:vwe,uid:L.string().optional()})),jR=L.object({id:L.string(),title:L.string().nullish().transform(e=>e??"Untitled"),custom_type_id:L.string(),group_lang_id:L.string(),language:LR,versions:L.array(ywe)}),Pq=L.object({total:L.number(),cursor:L.string().optional(),results:L.array(jR)}),bwe=L.object({id:L.string(),title:L.string(),repository_id:L.string(),tags:L.array(L.string()).optional()}).passthrough(),Cwe=L.object({results:L.array(bwe)});function UR(e,t,n,r,i){const o=new URL("documents",e);return r&&o.searchParams.set("limit",r.toString()),i&&o.searchParams.set("cursor",i),o.search+=`&${n}`,pe.request(o,{credentials:pe.getRequestCredentials(t),okType:Pq})}function Wq(e){const{baseUrl:t,authStrategy:n,limit:r,cursor:i,status:o,authors:a,language:s,group_lang_id:u,document_id:c,customTypes:l,tags:d,term:p,signal:A}=e,m=new URL("documents",t),v=[];return r&&v.push({name:"limit",values:[r.toString()]}),i&&v.push({name:"cursor",values:[i]}),o!=null&&o.length&&v.push({name:"status",values:o}),a!=null&&a.length&&v.push({name:"authors",values:a}),s&&v.push({name:"language",values:[s]}),u&&v.push({name:"group_lang_id",values:[u]}),c!=null&&c.length&&v.push({name:"document_id",values:c}),l!=null&&l.length&&v.push({name:"customTypes",values:l}),d!=null&&d.length&&v.push({name:"tags",values:d}),p&&v.push({name:"term",values:[p]}),m.search=new URLSearchParams(N0(v)).toString(),pe.request(m,{credentials:pe.getRequestCredentials(n),okType:Pq,signal:A})}function Dq(e,t,n,r){const i=new URL(e);return i.search=n,pe.request(i,{credentials:pe.getRequestCredentials(t),okType:Cwe,...r})}function Kq(e){const{repository:t,searchTerm:n,tags:r,localeId:i,customTypesIds:o}=e,a=new URLSearchParams;return a.append("repository",t),n&&a.append("searchTerm",n),r!=null&&r.length&&a.append("tags",r.toString()),i&&a.append("localeId",i),o!=null&&o.length&&a.append("customTypesIds",o.toString()),a.toString()}function N0(e){return e.reduce((t,n)=>{if(n.values.every(i=>i===""||i===void 0))return t;const r=n.values.map(i=>[n.name,i??""]);return t.concat(r)},[])}function Nq(e,t,n){return pe.request(new URL(`documents/${n}`,e),{credentials:pe.getRequestCredentials(t),okType:jR})}const Swe=L.custom().transform((e,t)=>{const n=Ce.Document.decode(e);return n._tag==="Left"?(t.addIssue({code:L.ZodIssueCode.custom,message:"Invalid document."}),L.NEVER):n.right});function BR(e){const t=Vl.keys(e).flatMap(r=>{const i=e[r];return i?{name:r,values:i}:[]});return new URLSearchParams(N0(t)).toString()}async function qq(e,t,n){if(n.length===0)return[];const r=n.slice(0,50).map(({id:a})=>a),i=await Wq({baseUrl:e,authStrategy:t,document_id:r}),o=new Map(r.map((a,s)=>[a,s]));return i.results.sort((a,s)=>{const u=o.get(a.id),c=o.get(s.id);return(u??1/0)-(c??1/0)})}const _we=L.unknown().transform((e,t)=>{const n=Ce.SliceItemContent.decode(e);return n._tag==="Right"?n.right:(t.addIssue({code:L.ZodIssueCode.custom,message:"Invalid slice content."}),L.NEVER)}),Jo={all:()=>["documents"],lists:()=>[...Jo.all(),"list"],list:e=>[...Jo.lists(),e],infiniteLists:()=>[...Jo.all(),"list:infinite"],infiniteList:e=>[...Jo.infiniteLists(),e]};function Iwe(e,t){e.setQueriesData({queryKey:Jo.lists()},n=>n&&YF(n,t)),e.setQueriesData({queryKey:Jo.infiniteLists()},n=>n&&{...n,pages:n.pages.map(r=>YF(r,t))})}function YF(e,t){const n=e.results.flatMap(r=>{const i=t(r,e);return i?[i]:[]});return{...e,results:n,total:e.total+(n.length-e.results.length)}}async function Twe(e){await e.invalidateQueries({queryKey:Jo.lists()}),await e.invalidateQueries({queryKey:Jo.infiniteLists()})}const xwe=L.object({id:L.string(),firstname:L.string().optional(),lastname:L.string().optional(),email:L.string(),uploadedAvatar:L.string().optional()}),wwe=L.array(xwe),Ewe=L.object({slicemachineEnabled:L.boolean()}),Vq=["next","nuxt","sveltekit"];function $we(e){return Vq.includes(e)}const PR=L.preprocess(e=>typeof e=="string"&&$we(e)?e:"other",L.enum([...Vq,"other"])),Rwe=L.object({simulator_url:L.string().url().nullish(),languages:L.array(LR).transform(e=>Qt.sort(e,t=>t.name)),authors:wwe.optional().default([]),quotas:Ewe.optional().default({slicemachineEnabled:!1}),framework:PR.optional().default("other"),starterId:L.string().optional(),storageVersion:L.object({major:L.number().int(),minor:L.number().int()})}).transform(({simulator_url:e,framework:t,...n})=>{const r=e&&Qq(e)?e:void 0;return{...n,framework:t,simulatorUrl:r,isSupportedFramework:t!=="other"}});function q0(e,t){return pe.request(new URL("repository",e),{credentials:pe.getRequestCredentials(t),okType:Rwe})}function Qq(e){const t=Fr.toURL(e);return t?t.pathname.endsWith("/slice-simulator"):!1}const Owe=L.object({results:L.array(L.string())});function zq(e,t){return pe.request(new URL("repository/tags",e),{credentials:pe.getRequestCredentials(t),okType:Owe})}const Hq=L.object({completedSteps:L.array(L.string()),isDismissed:L.boolean(),context:L.object({framework:PR.optional().default("other"),starterId:L.string().nullable()})}),Yq=L.object({completedSteps:L.array(L.string())}),Gq=L.object({isDismissed:L.boolean()});function Fwe(e,t,n){const r=new URL("onboarding",e);return r.searchParams.append("repository",t),pe.request(r,{headers:{repository:t},credentials:pe.getRequestCredentials(n),okType:Hq})}function kwe(e,t,n,r){const i=new URL(`onboarding/${e}/toggle`,t);return i.searchParams.append("repository",n),pe.request(i,{method:"PATCH",headers:{repository:n},credentials:pe.getRequestCredentials(r),okType:Yq})}function Mwe(e,t,n){const r=new URL("onboarding/toggle",e);return r.searchParams.append("repository",t),pe.request(r,{method:"PATCH",headers:{repository:t},credentials:pe.getRequestCredentials(n),okType:Gq})}const Jq=L.enum(["Owner","Administrator","Writer","Manager","Readonly"]),Lwe=L.record(Jq.optional()),jwe=Jq.or(Lwe),Uwe={SuperUser:"SuperUser",Owner:"Owner",Administrator:"Administrator",Manager:"Publisher",Writer:"Writer",Readonly:"Contributor"},Zq=L.object({shortId:L.string(),intercomHash:L.string(),email:L.string(),firstName:L.string(),lastName:L.string(),superPower:L.boolean(),repositories:L.array(L.object({domain:L.string(),role:jwe}))});function Xq(e,t){const n=new URL("profile",e);return pe.request(n,{credentials:pe.getRequestCredentials(t),okType:Zq})}function WR(){const e=Ee();e.userServiceBaseUrl||Jt("userServiceBaseUrl");const{authStrategy:t,userServiceBaseUrl:n}=e;return Ve.useRequest(Xq,[n,t])}const Bwe="https://prismic.io/docs/guides/manage-images#supported-media";function _h(){const e=Ee();e.mediaLibrary||Jt("mediaLibrary");const{assetsApiBaseUrl:t,authStrategy:n,repository:r}=e,{items:i}=Ve.useRequest(e7,[t,r,n]);return{tags:i}}function e7(e,t,n){return pe.request(new URL("tags",e),{credentials:pe.getRequestCredentials(n),okType:Pwe,headers:{repository:t}})}const t7=1,n7=20,DR=L.string().min(t7).max(n7),KR=L.object({id:L.string(),name:DR,uploader_id:L.string().optional(),created_at:L.number(),last_modified:L.number(),count:L.number().optional().default(0)}),Pwe=L.object({items:L.array(KR)});function Ih(e){Ve.updateFetcherData(e7,t=>{const{items:n}=t,r=e(n);if(r)return{items:r}})}function Wwe(e){const{assetType:t,keyword:n,mode:r,tagIds:i}=e,o=Ee();o.mediaLibrary||Jt("mediaLibrary");const{onAnalyticsEvent:a}=o,s=Ve.useFetcherData(mi),u=s[s.length-1],c=$.useRef(u);c.current=u,$.useEffect(()=>{if(!a||!n||!c.current||c.current.keyword!==n)return;const l=String(n.split(" ").length),d=String(c.current.total),p=i.join(",");a("Media Library Search",{searchQuery:n,numberOfWords:l,numberOfResults:d,timeToGetResults:c.current.time,assetType:t,mode:r,tags:p})},[n,t,r,a,i])}function Dwe(e){const{assetType:t,mediaDialogOpen:n}=e,r=Ee(),i=Ve.useFetcherData(mi),o=$.useRef(0);$.useEffect(()=>{n&&(o.current=performance.now())},[n]);function a(s){if(!r.onAnalyticsEvent||!r.mediaLibrary)return;const u=i[i.length-1];if(!u)return;const{keyword:c,uploaderId:l,tags:d}=u,p=o7(i,c,t,l,d),A=String(c.split(" ").length),m=String(u.total),v=p.findIndex(x=>x.id===s),_=String(v+1),C=[s].join(","),I=(performance.now()-o.current).toFixed(0);r.onAnalyticsEvent("Media Added To Page",{assetType:t,searchQuery:c,numberOfWords:A,numberOfResults:m,searchPosition:_,mediaIds:C,timeToAddMediaToPage:I,tags:d})}return a}const Kh=L.array(L.string()).optional().transform(e=>e==null?void 0:e[0]),V0=L.object({id:L.string(),kind:L.string(),extension:L.string().optional(),filename:L.string(),width:L.number().optional(),height:L.number().optional(),last_modified:L.number(),url:L.string(),alt:L.string().optional(),uploader_id:L.string().optional(),size:L.number(),notes:L.string().optional(),credits:L.string().optional(),search_highlight:L.object({filename:Kh,alt:Kh,notes:Kh,credits:Kh}).optional(),tags:L.array(KR)}),r7={"X-Prismic-Source":"Wroom"},Kwe=L.object({total:L.number(),cursor:L.string().optional(),items:L.array(V0)}),i7=30;function mi(e,t,n,r,i,o,a,s,u){const c=e?new URL("assets",e):void 0,l=new URLSearchParams(N0([{name:"limit",values:[`${i7}`]},{name:"cursor",values:[u]},{name:"keyword",values:[r]},{name:"assetType",values:[i]},{name:"uploaderId",values:[o]},{name:"tags",values:a.split(",")}])).toString(),d=Kwe.transform(A=>({...A,keyword:r,assetType:i,uploaderId:o,tags:a,page:s})),p=performance.now();return pe.request(`${(c==null?void 0:c.href)??""}?${l}`,{headers:{repository:t,...r7},credentials:pe.getRequestCredentials(n),okType:d}).then(A=>({...A,time:(performance.now()-p).toFixed(0)}))}Ve.cache.registerFetcherConfig(mi,{revalidationStrategy:{type:"never"}});const Vn={keyword:"",assetType:"all",uploaderId:void 0,tagIds:[]};function Nwe(e){const{initialAssetType:t=Vn.assetType,mode:n}=e,r=Ee(),[i,o]=$.useState({...Vn,assetType:t,page:0});r.mediaLibrary||Jt("mediaLibrary");const{assetsApiBaseUrl:a,authStrategy:s,repository:u}=r,{page:c,cursor:l,keyword:d,assetType:p,uploaderId:A,tagIds:m}=i,v=Ve.useRequest(mi,hp({assetsApiBaseUrl:a,authStrategy:s,repository:u,keyword:d,assetType:p,uploaderId:A,tagIds:m,page:c,cursor:l}));Wwe({assetType:p,keyword:d,tagIds:m,mode:n});const _=zwe(d,p,A,m),C=v.total!==_.length;function I(){v.cursor!==void 0&&o(y=>({...y,page:y.page+1,cursor:v.cursor}))}function x(y){o(T=>({...T,page:0,cursor:void 0})),Lu((T,w)=>{if(w.page===0)return[...y,...T]})}function g(y){o(T=>({...T,...y,page:0,cursor:void 0}))}function S(){o(y=>({...y,...Vn,assetType:t==="all"?Vn.assetType:y.assetType,page:0,cursor:void 0}))}return{keyword:d,assetType:p,uploaderId:A,tagIds:m,setFilters:g,resetFilters:S,media:_,mediaTotal:v.total,limit:i7,hasNextPage:C,fetchNextPage:I,updateMedia:qwe,unshiftMedia:x,deleteMedia:Vwe,deleteSearchData:Qwe,revalidateFirstPage:a7}}function qwe(e){Lu(t=>t.flatMap(n=>{const r=e.find(i=>i.id===n.id);return r?r.response===void 0?[]:{...n,...r.response}:n}))}function Vwe(e){Lu(t=>t.filter(n=>!e.includes(n.id)))}function Qwe(e){const{keyword:t,assetType:n,uploaderId:r,tagIds:i}=e,o=i==null?void 0:i.join(",");Ve.updateFetcherData(mi,a=>{if(!(a.keyword===t&&a.assetType===n&&a.uploaderId===r&&a.tags===o))return a})}function o7(e,t,n,r,i){const o=e.filter(u=>u.keyword===t&&u.assetType===n&&u.uploaderId===r&&u.tags===i),s=Qt.sort(o,u=>u.page).flatMap(u=>u.items);return t?Qt.uniqBy(s,u=>u.id):s}function zwe(e,t,n,r){const i=Ve.useFetcherData(mi);return o7(i,e,t,n,r.join(","))}function Lu(e){Ve.updateFetcherData(mi,t=>{const{items:n,total:r}=t,i=e(n,t);if(i)return{...t,total:r+(i.length-n.length),items:i}})}function a7(e){const{config:t,keyword:n=Vn.keyword,assetType:r=Vn.assetType,tagIds:i=Vn.tagIds}=e;if(!t.mediaLibrary)throw new Error("media library is not configured");const{assetsApiBaseUrl:o,authStrategy:a,repository:s}=t;Ve.revalidateData(mi,hp({assetsApiBaseUrl:o,repository:s,authStrategy:a,keyword:n,assetType:r,tagIds:i,page:0}))}function s7(e){const{config:t,keyword:n=Vn.keyword,assetType:r=Vn.assetType,tagIds:i=Vn.tagIds}=e;if(!t.mediaLibrary)throw new Error("media library is not configured");Ve.updateFetcherData(mi,o=>o.page===0?o:void 0),a7({config:t,keyword:n,assetType:r,tagIds:i})}function hp(e){return[e.assetsApiBaseUrl,e.repository,e.authStrategy,e.keyword,e.assetType,e.uploaderId,e.tagIds.join(","),e.page,e.cursor]}function u7(){const e=Ee();e.mediaLibrary||Jt("mediaLibrary");const{assetsApiBaseUrl:t,coreApiBaseUrl:n,authStrategy:r,repository:i}=e,{authors:o}=Ve.useRequest(q0,[n,r]),{items:a}=Ve.useRequest(c7,[t,i,r]),{shortId:s}=WR(),u=new Map(o.map(d=>[d.id,d])),c=[];for(const d of a){if(d.id==="ghost"){c.push({id:d.id,name:"Ghost",uploadedAvatar:"https://images.prismic.io/page-builder-assets/ZuAXWBoQrfVKl5sD_ghost_user.png?auto=format,compress&w=64"});continue}const p=u.get(d.id);if(!p)continue;let A;if(p.uploadedAvatar){const m=new URL(p.uploadedAvatar);m.searchParams.set("w","64"),A=m.toString()}c.push({id:d.id,name:[p.firstname,p.lastname].filter(Boolean).join(" "),firstName:p.firstname,lastName:p.lastname,email:p.email,uploadedAvatar:A})}const l=new Map(c.map(d=>[d.id,d]));return{uploaders:Qt.sort(c,d=>d.id===s?0:1,d=>d.name),uploadersById:l}}function c7(e,t,n){return pe.request(new URL("uploaders",e),{credentials:pe.getRequestCredentials(n),okType:Ywe,headers:{repository:t}})}const Hwe=L.object({id:L.string()}),Ywe=L.object({items:L.array(Hwe)});function l7(){const e=Ee();e.mediaLibrary||Jt("mediaLibrary");const{assetsApiBaseUrl:t,authStrategy:n,repository:r}=e;return()=>{Ve.revalidateData(c7,[t,r,n])}}function Gwe(e){const{revalidate:t,config:n,keyword:r,assetType:i,uploaderId:o,tagIds:a}=e,{assetsApiBaseUrl:s=void 0,repository:u="",authStrategy:c="token"}=n.mediaLibrary?n:{},[l,d]=$.useState(!1),[p,A]=$.useState(!1),m={assetsApiBaseUrl:s,repository:u,authStrategy:c,keyword:r,assetType:i,uploaderId:o,tagIds:a,page:0},{revalidateData:v}=Ve.useCacheRevalidation({fetcher:mi,requestParams:hp(m),validator:(I,x)=>{var y,T;const g=((y=I.items[0])==null?void 0:y.id)??"",S=((T=x.items[0])==null?void 0:T.id)??"";return g!==S||I.total!==(x==null?void 0:x.total)},onCacheInvalidated:()=>A(!0),every:6e4}),_=I=>{v(hp({...m,...I}))};$.useEffect(()=>{l&&(A(!1),d(!1))},[l]);function C(){d(!0),t()}return{isMediaRevalidationInProgress:l,isMediaCacheInvalid:p,revalidateMedia:C,revalidateWithParams:_}}function Jwe(e){const{onBeforeUpload:t,onComplete:n}=e,[r,i]=$.useState([]),o=r.some(l=>l.status==="idle"||l.status==="uploading"),a=Ee();function s(){if(!r.length||r.some(A=>A.status==="uploading")||r.every(A=>A.status==="error"))return;const l=r.find(A=>A.status==="idle");if(!l)return;let d=r;function p(A){d=A(d),i(d),d.every(v=>v.status==="success"||v.status==="error")&&setTimeout(()=>{i([]),n==null||n(d)},1500)}p(A=>A.map(m=>m.id===l.id?{...m,status:"uploading"}:m)),Zwe({file:l.file,config:a}).then(A=>{p(m=>m.map(v=>v.id===l.id?{...v,status:"success",response:A}:v))}).catch(()=>{p(A=>A.map(m=>m.id===l.id?{...m,status:"error"}:m))})}function u(l){const d=l.map(p=>({id:`temp-${crypto.randomUUID()}`,file:p,status:"idle"}));i(d),t(d)}const c=$.useCallback(l=>{const d=[{...l,status:"idle"},...r.filter(p=>p.id!==l.id)];i(d),t(d)},[t,r]);return $.useEffect(s,[a,r,n]),{isUploading:o,uploadingFiles:r,onFilesSelected:u,onRetry:c}}function Zwe(e){const{file:t,config:n}=e;if(!n.mediaLibrary)throw new Error("Media Library not configured.");const{assetsApiBaseUrl:r,repository:i,authStrategy:o}=n,a=new FormData;return a.append(t.name,t),pe.request(new URL("assets",r),{headers:{repository:i,"Content-Type":"multipart/form-data",...r7},method:"POST",body:a,credentials:pe.getRequestCredentials(o),okType:V0})}const f7=$.createContext(void 0);function Xwe(e){const{children:t,assetType:n=Vn.assetType,onSelectedChange:r,actionContainerRef:i}=e,o=r?"select":"browse",[a,s]=$.useTransition(),[u,c]=$.useTransition(),l=Ee(),{showAlert:d}=h.useAlert(),p=WR(),A=l7(),{keyword:m,assetType:v,uploaderId:_,tagIds:C,setFilters:I,resetFilters:x,media:g,fetchNextPage:S,hasNextPage:y,updateMedia:T,unshiftMedia:w,deleteMedia:O,mediaTotal:E,deleteSearchData:F,revalidateFirstPage:W}=Nwe({initialAssetType:n,mode:o}),[K,J]=$.useState();function ee(){s7({config:l,keyword:m,assetType:v,uploaderId:_,tagIds:C})}const{isMediaRevalidationInProgress:re,isMediaCacheInvalid:P,revalidateMedia:Y,revalidateWithParams:M}=Gwe({config:l,revalidate:ee,keyword:m,assetType:v,uploaderId:_,tagIds:C});function k(De){const dt=De.keyword===Vn.keyword,St=De.assetType===n,st=De.uploaderId===Vn.uploaderId,Wt=De.tagIds.length===Vn.tagIds.length&&De.tagIds.every((gi,_r)=>gi===Vn.tagIds[_r]);return dt&&St&&st&&Wt}function q(De){const dt={keyword:m,assetType:v,tagIds:C,uploaderId:_,...De};k(dt)?M(De):F(dt),c(()=>{I(De),at.clearSelection()})}const{isUploading:ue,onFilesSelected:ke,uploadingFiles:Ie,onRetry:rt}=Jwe({onBeforeUpload:De=>{x();const dt=De.filter(st=>st.status==="idle").map(st=>({id:st.id,url:URL.createObjectURL(st.file),filename:st.file.name,size:st.file.size,extension:st.file.type,kind:st.file.type,last_modified:st.file.lastModified,tags:[],uploader_id:p.shortId}));w(dt);const[St]=dt??[];St&&at.toggleSelection({id:St.id,isSingleSelection:!0})},onComplete:De=>{const dt=De.flatMap(Wt=>Wt.status==="success"?Wt:(dn(Wt),{id:Wt.id,response:void 0}));T(dt),W({config:l,assetType:v,tagIds:C}),A();const St=dt[0];!St||!St.response||!at.isSelected(St.id)||at.toggleSelection({id:St.response.id,isSingleSelection:!0})}}),at=Vs({totalItemCount:E,onChangeSelection:({selectedIds:De,selectedCount:dt})=>{if(Yr(!1),!!r){if(dt===1){const[St]=[...De];if(Ie.some(Wt=>Wt.id===St&&Wt.status!=="success")){r(new Set);return}}r(new Set(De))}}});function fn(De){ue||ke(De)}function Zt(){y&&s(S)}function rr(De,dt){T([{id:De,response:dt}])}function dn(De){const dt=Ep.overflow(De.file.name,30);d({id:De.id,title:`The specified file "${dt}" could not be uploaded.`,subtitle:f.jsxs(h.Text,{color:"inherit",children:["Read more about our"," ",f.jsx(h.Text,{color:"tomato11",href:Bwe,underline:!0,children:"supported media"}),"."]}),buttons:{action:{text:"Retry upload",icon:"cloudUpload",onClick:()=>rt(De)}}})}const[Hr,Yr]=$.useState(!1);return f.jsx(f7.Provider,{value:{isFetchingMedia:a,media:g,mediaTotal:E,onScrollToBottom:Zt,actionContainerRef:i,onFilesUpload:fn,isUploading:ue,uploadingFiles:Ie,isMediaRevalidationInProgress:re,isMediaCacheInvalid:P,revalidateMedia:Y,deleteMedia:O,updateMedia:rr,keyword:m,isSearchingMedia:u,assetType:v,initialAssetType:n,uploaderId:_,tagManagerOpen:Hr,setTagManagerOpen:Yr,tagIds:C,onFilterChange:q,openMediaSection:K,setOpenMediaSection:J},children:t})}function Ct(){const e=$.useContext(f7);if(!e)throw new Error("useMediaLibrary must be used within a MediaLibraryProvider");return e}function eEe(){const e=Ee(),{initialAssetType:t}=Ct(),{assetsApiBaseUrl:n=void 0,repository:r="",authStrategy:i="token"}=e.mediaLibrary?e:{},{total:o}=Ve.useRequest(mi,hp({assetsApiBaseUrl:n,authStrategy:i,repository:r,assetType:t,keyword:"",tagIds:[],page:0}));return o}function d7(){return eEe()===0}function tEe(){return d7()?f.jsx(nEe,{}):f.jsx(A7,{})}function p7(e){const{children:t}=e;return f.jsx(h.Box,{justifyContent:"center",flexDirection:"column",height:"100%",children:t})}function A7(){return f.jsx(p7,{children:f.jsxs(h.BlankSlate,{children:[f.jsx(h.BlankSlateIcon,{name:"close",lineColor:"purple10",backgroundColor:"purple3",borderColor:"purple6",borderStyle:"dashed",size:"xlarge"}),f.jsx(h.BlankSlateTitle,{size:"big",children:"Oops!"}),f.jsx(h.BlankSlateDescription,{width:360,children:"No items found matching your search"})]})})}function nEe(){const{onFilesUpload:e}=Ct();return f.jsx(p7,{children:f.jsxs(h.Box,{gap:20,flexDirection:"column",alignItems:"center",children:[f.jsx(h.Box,{maxWidth:375,children:f.jsx(h.BlankSlateTitle,{size:"big",children:"Start by uploading your files!"})}),f.jsx(h.Box,{border:!0,borderStyle:"dashed",borderRadius:4,justifyContent:"center",children:f.jsxs(h.BlankSlate,{sx:{marginBlock:80,marginInline:48},children:[f.jsx(h.BlankSlateIcon,{name:"cloudUpload",lineColor:"purple11",backgroundColor:"purple5",size:"large"}),f.jsx(h.BlankSlateTitle,{children:"Drop your files anywhere to upload or ..."}),f.jsx(h.FileUploadButton,{onFilesSelected:e,renderButton:t=>f.jsx(h.Box,{display:"inline-flex",as:"span",children:f.jsx(h.Button,{onClick:t,color:"grey",children:"Upload media"})})}),f.jsx(h.BlankSlateDescription,{children:"Maximum upload size file: 128 MB"})]})})]})})}const jl={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 rEe(){const{actionContainerRef:e,isUploading:t,onFilesUpload:n,assetType:r}=Ct(),i=(e==null?void 0:e.current)!==void 0;return f.jsx(h7,{actionContainerRef:e,children:f.jsxs(h.Box,{width:"100%",gap:16,children:[f.jsx(iEe,{}),f.jsx(h.Tooltip,{title:jl.warning.uploadWhileUploading.title,content:jl.warning.uploadWhileUploading.description,visible:t,stableMount:!0,children:f.jsx(h.FileUploadButton,{disabled:t,onFilesSelected:n,startIcon:"cloudUpload",color:i?"purple":"grey",size:"large",assetType:r,children:"Upload media"})})]})})}function iEe(){const{keyword:e,onFilterChange:t,isFetchingMedia:n}=Ct(),[r,i]=$.useState(e);return Ne.useOnChange(e,()=>{e===""&&i("")}),Ne.useDebounce(r,300,Ne.useStableCallback(o=>t({keyword:o}))),f.jsx(h.Box,{width:"100%",flexDirection:"column",children:f.jsx(h.FormSearchInput,{value:r,placeholder:"Search",onValueChange:i,maxLength:200,isLoading:n&&e!==r})})}function h7(e){const{children:t,actionContainerRef:n}=e,r=(n==null?void 0:n.current)!==void 0,i=r?h.Portal:$.Fragment,o=r?{container:n.current,asChild:!0}:{},a=Ne.useForceUpdate();return $.useLayoutEffect(()=>{a()},[a]),f.jsx(i,{...o,children:t})}function oEe(e){const{children:t}=e,{onFilesUpload:n,assetType:r}=Ct();return f.jsx(h.FileDropZone,{overlay:f.jsx(aEe,{}),onFilesSelected:n,assetType:r,children:t})}function aEe(){const{isUploading:e}=Ct(),t=e?jl.warning.uploadWhileUploading.title:"Drop files here",n=e?jl.warning.uploadWhileUploading.description:"Drop your files to upload them instantly to the media library.";return f.jsx(h.Box,{justifyContent:"center",flexDirection:"column",height:"100%",children:f.jsxs(h.BlankSlate,{children:[f.jsx(h.BlankSlateIcon,{name:e?"block":"cloudUpload",lineColor:e?"tomato11":"purple10",backgroundColor:e?"tomato2":"purple3",borderColor:e?"tomato6":"purple6",borderStyle:"dashed",size:"xlarge"}),f.jsx(h.BlankSlateTitle,{size:"big",children:t}),f.jsx(h.BlankSlateDescription,{width:360,children:n})]})})}function m7(){return f.jsx(h.DefaultErrorMessage,{title:"Oops! Something went wrong",description:"An error occurred while searching for your image.",errorImageSrc:h.dialogErrorImage,sx:{marginBlock:"auto",marginInline:"auto"}})}function g7(e){const{mediaList:t,mediaActions:n,mediaToolbar:r,sidePane:i}=e,o=h.useMediaQuery({min:"medium"}),a=i&&o;return f.jsxs(h.Box,{display:"grid",gridTemplateRows:"auto auto 1fr",gridTemplateColumns:a?"1fr 380px":"1fr",width:"100%",height:"100%",children:[f.jsxs(h.Box,{position:"relative",display:"grid",gap:16,gridColumn:"1",gridRow:"1",padding:{right:16,bottom:16},children:[n,r]}),f.jsx(h.Box,{position:"relative",display:"grid",gridColumn:"1",gridRow:"2 / -1",children:t}),a&&i]})}function sEe(){var p;const{onScrollToBottom:e,media:t,isUploading:n,uploadingFiles:r,isSearchingMedia:i,isMediaRevalidationInProgress:o,setOpenMediaSection:a,isFetchingMedia:s}=Ct(),u=Vs(),c=$.useRef(null);function l(A){u.toggleSelection({id:A,isSingleSelection:!0}),a("tags")}(n||i||o)&&((p=c.current)==null||p.scrollTo({top:0,behavior:"instant"}));function d(A,m,v){const _=m.shiftKey?t.map(({id:C})=>C):void 0;u.toggleSelection({id:A,isSingleSelection:v==="single",metaKey:m.metaKey,shiftKey:m.shiftKey,ids:_})}return f.jsxs(v7,{onScrollToBottom:e,scrollAreaRef:c,children:[t.map(A=>{var m,v;return f.jsx(h.MediaCard,{"aria-label":"media item",...A,filenameHighlight:(m=A.search_highlight)==null?void 0:m.filename,loading:i,status:(v=r.find(_=>_.id===A.id))==null?void 0:v.status,selected:u.isSelected(A.id),onCardClick:_=>d(A.id,_,"single"),onCheckedChange:(_,C)=>d(A.id,C,"multi"),onAddTagClick:()=>l(A.id)},A.id)}),f.jsx(h.Box,{gridColumn:"1 / -1",justifyContent:"center",children:f.jsx(h.AnimatedElement,{animation:{name:"fade"},children:s&&f.jsx(h.Text,{align:"center",color:"grey11",sx:{marginBlock:8},children:"Loading more items ..."})})})]})}function v7(e){const{children:t,scrollAreaRef:n,onScrollToBottom:r}=e,i=16,o=4,a="250px",s=`calc((100% - ${i*(o-1)}px) / ${o})`;return f.jsx(h.ScrollArea,{"aria-label":"Media list",ref:n,style:{display:"grid",gridTemplateColumns:`repeat(auto-fill, minmax(max(${a}, ${s}), 1fr))`,gridTemplateRows:"1fr 1fr 1fr ",gap:i,padding:2,paddingBottom:16,position:"relative"},onScrollToBottom:r,threshold:500,children:t})}function y7(e){const{children:t,hasSelectedMedia:n}=e;return f.jsx(h.Box,{overflow:"hidden",gridColumn:"2 / -1",gridRow:"1 / -1",children:f.jsx(h.ScrollArea,{style:{display:"grid",height:"100%"},children:f.jsx(h.Box,{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 b7(e){const{onFilesUpload:t,isUploading:n,isInitialLoad:r=!1}=e,i=r||n;return f.jsxs(h.Box,{flexDirection:"column",justifyContent:"center",alignItems:"center",padding:16,gap:16,width:"100%",children:[f.jsx(h.BlankSlateIcon,{name:"cloudUpload",lineColor:"purple11",backgroundColor:"purple5",size:"large"}),f.jsx(h.Box,{flexDirection:"column",gap:4,children:f.jsxs(h.Text,{align:"center",children:["Select or"," ",f.jsx(h.FileUploadButton,{disabled:i,onFilesSelected:t,renderButton:o=>f.jsx(h.Tooltip,{title:jl.warning.uploadWhileUploading.title,content:jl.warning.uploadWhileUploading.description,visible:n,children:f.jsx(h.Box,{display:"inline-flex",as:"span",children:f.jsx(h.Button,{disabled:i,onClick:o,invisible:!0,children:"upload"})})})})," ","media."]})}),f.jsx(h.FileUploadButton,{disabled:i,onFilesSelected:t,color:"grey",children:"Upload media"})]})}function C7(e){const{count:t}=e;return f.jsxs(h.Text,{variant:"bold",children:[t," item",t==1?"":"s"]})}function uEe(e){const{actionContainerRef:t}=e;return f.jsx(g7,{sidePane:f.jsx(fEe,{}),mediaActions:f.jsx(lEe,{actionContainerRef:t}),mediaToolbar:f.jsx(h.Skeleton,{color:"grey5",borderRadius:12,children:f.jsx(C7,{count:888})}),mediaList:f.jsx(cEe,{})})}function cEe(){return f.jsx(v7,{children:Qt.range(1,24).map(e=>f.jsx(S7,{},e))})}function lEe(e){const{actionContainerRef:t}=e,n=Ne.useForceUpdate();return $.useLayoutEffect(()=>{n()},[n]),f.jsx(h7,{actionContainerRef:t,children:f.jsxs(h.Box,{width:"100%",gap:16,children:[f.jsx(h.Box,{width:"100%",flexDirection:"column",children:f.jsx(h.FormSearchInput,{placeholder:"Search",maxLength:200,value:"",disabled:!0,onValueChange:()=>{}})}),f.jsx(h.FileUploadButton,{disabled:!0,onFilesSelected:()=>{},startIcon:"cloudUpload",color:t?"purple":"grey",size:"large",children:"Upload media"})]})})}function fEe(){return f.jsx(y7,{hasSelectedMedia:!1,children:f.jsx(b7,{onFilesUpload:()=>{},isUploading:!1,isInitialLoad:!0})})}function S7(){return f.jsxs(h.Box,{height:302,width:"100%",flexDirection:"column",padding:16,backgroundColor:"grey1",border:!0,borderStyle:"solid",borderRadius:6,children:[f.jsx(h.Skeleton,{height:164,width:"100%"}),f.jsx(h.Skeleton,{height:16,width:"100%",sx:{marginTop:12}}),f.jsx(h.Skeleton,{height:10,width:100,sx:{marginTop:8}}),f.jsx(h.Skeleton,{height:1,width:"100%",sx:{marginTop:20,marginBottom:16}}),f.jsxs(h.Box,{flexDirection:"row",gap:8,children:[f.jsx(h.Skeleton,{height:24,width:54}),f.jsx(h.Skeleton,{height:24,width:45}),f.jsx(h.Skeleton,{height:24,width:62})]})]})}const _7=$.createContext({showToast:()=>{}});function dEe(e){const{children:t}=e,[n,r]=$.useState({title:"",seconds:5}),[i,o]=$.useState(!1),{title:a,action:s,seconds:u=1,icon:c="check"}=n,l=$.useMemo(()=>({showToast:d=>{r({seconds:u,...d}),o(!0)}}),[u]);return f.jsxs(f.Fragment,{children:[f.jsx(pEe,{}),f.jsx(h.Toast,{anchor:f.jsx(h.Box,{position:"absolute",justifyContent:"center",width:"100%",bottom:72}),open:i,onOpenChange:o,title:a,action:s,seconds:u,icon:c}),f.jsx(_7.Provider,{value:l,children:t})]})}function I7(){return $.useContext(_7)}function pEe(){const{revalidateMedia:e,isMediaCacheInvalid:t}=Ct(),[n,r]=$.useState(t);return Ne.useOnChange(t,r),f.jsx(h.Toast,{anchor:f.jsx(h.Box,{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 Pc(){const{media:e}=Ct(),t=Vs();return e.filter(({id:n})=>t.isSelected(n))}function AEe(){const[e,t]=$.useState(!1),n=Pc(),r=Vs(),i=$.useMemo(()=>n.some(({id:a})=>a.startsWith("temp")),[n]),[o]=n;return o?r.selectedCount>1?f.jsxs(h.Box,{gap:8,alignItems:"center",children:[f.jsxs(h.Text,{variant:"emphasized",noWrap:!0,sx:{flexGrow:1},children:[r.selectedCount," media selected"]}),f.jsx(h.Tooltip,{content:"Open all selected media in new tabs",children:f.jsx(h.IconButton,{icon:"openInFull",variant:"solid",size:"small",onClick:()=>n.forEach(a=>window.open(a.url,"_blank"))})}),f.jsx(h.Tooltip,{content:"Remove selected media",children:f.jsx(h.IconButton,{icon:"delete",variant:"solid",color:"tomato",size:"small",hiddenLabel:"Remove media",onClick:()=>t(!0),disabled:i})}),f.jsx(GF,{open:e,onOpenChange:t,media:n})]}):f.jsxs(h.Box,{gap:8,alignItems:"center",children:[f.jsx(h.Text,{variant:"emphasized",noWrap:!0,sx:{flexGrow:1},children:o.filename}),f.jsxs(h.Box,{gap:8,children:[f.jsx(h.Tooltip,{content:"Open media in new tab",children:f.jsx(h.IconButton,{icon:"openInFull",variant:"solid",size:"small",hiddenLabel:"Open media in new tab",onClick:()=>window.open(o.url,"_blank"),disabled:i})}),f.jsx(h.Tooltip,{content:"Copy media URL",children:f.jsx(h.IconButton,{icon:"link",variant:"solid",size:"small",hiddenLabel:"Copy media URL",onClick:()=>navigator.clipboard.writeText(o.url),disabled:i})}),f.jsx(h.Tooltip,{content:"Remove media",children:f.jsx(h.IconButton,{icon:"delete",variant:"solid",color:"tomato",size:"small",hiddenLabel:"Remove media",onClick:()=>t(!0),disabled:i})}),f.jsx(GF,{open:e,onOpenChange:t,media:o})]})]}):null}function GF(e){const{open:t,onOpenChange:n,media:r}=e,i=Ee(),{showAlert:o}=h.useAlert(),{deleteMedia:a}=Ct(),s=Vs(),u=l7(),[c,l]=$.useState(!1),d=Array.isArray(r),p=d?"these items":"this item";function A(){l(!0);const v=s.getSelectionState().selectedIds;mEe({ids:v,config:i}).then(()=>{n(!1),a(v),s.clearSelection(),u()}).catch(()=>{n(!1),o({title:"Error",subtitle:`Something went wrong when removing ${p}.`})}).finally(()=>{l(!1)})}return f.jsxs(h.Dialog,{onOpenChange:n,open:t,size:"small",children:[f.jsx(h.DialogHeader,{icon:"alert",title:`Remove ${p} from your media library?`}),f.jsx(h.DialogContent,{children:f.jsxs(h.Box,{padding:16,flexDirection:"column",children:[f.jsxs(h.Text,{children:["You are about to delete ",p,":  ",!d&&f.jsx("b",{children:r.filename})]}),d&&f.jsx(hEe,{media:r})]})}),f.jsxs(h.DialogActions,{children:[f.jsx(h.DialogCancelButton,{}),f.jsxs(h.DialogActionButton,{onClick:A,color:"tomato",loading:c,children:["Yes, I want to remove ",p]})]})]})}const zb=15;function hEe(e){const{media:t}=e,n=t.slice(0,zb),r=t.length>zb,i=r?t.length-zb:0,o=i===1?"item":"items";return f.jsxs(h.UnorderedList,{density:"compact",sx:{marginTop:8},children:[n.map((a,s)=>f.jsx(h.ListItem,{children:f.jsx("b",{children:a.filename})},s)),r&&f.jsxs(h.ListItem,{children:["And ",f.jsx("b",{children:i})," more ",o,"..."]})]})}function mEe(e){const{ids:t,config:n}=e;if(!n.mediaLibrary)throw new Error("Media Library not configured.");if(t.length===0)throw new Error("No ids provided during media deletion");const{assetsApiBaseUrl:r,repository:i,authStrategy:o}=n;if(t.length===1){const[a]=t;return pe.request(new URL(`assets/${a}`,r),{headers:{repository:i},method:"DELETE",credentials:pe.getRequestCredentials(o),okType:L.unknown()})}return pe.request(new URL("assets/bulk-delete",r),{headers:{repository:i},method:"POST",credentials:pe.getRequestCredentials(o),okType:L.unknown(),body:{ids:t}})}function gEe(){var o;const e=Pc(),{uploadingFiles:t}=Ct(),[n]=e;if(!n)return null;if(e.length===2)return f.jsx(Hb,{children:e.map((a,s)=>f.jsx("div",{style:{position:"absolute",transform:s===0?"translateX(25%) rotate(15deg) ":"translateX(-25%) rotate(-15deg) "},children:f.jsx(JF,{media:a})},a.id))});if(e.length>2)return f.jsx(Hb,{children:e.slice(-4).map((a,s)=>f.jsx("div",{style:{position:"absolute",paddingRight:s*16},children:f.jsx(JF,{media:a})},a.id))});const r=(o=t.find(a=>a.id===n.id))==null?void 0:o.status,i=n.kind.startsWith("image");return f.jsx(h.Box,{flexDirection:"column",children:f.jsx(h.CheckerBoard,{children:f.jsx(Hb,{uploadStatus:r,hasImage:i,children:i?f.jsx(h.Image,{src:n.url,alt:n.alt,sizing:"contain"}):f.jsx(h.MediaCardPlaceholder,{kind:n.kind,filename:n.filename})})})})}function Hb(e){const{children:t,uploadStatus:n,hasImage:r}=e;return f.jsxs(h.Box,{flexDirection:"column",alignItems:"center",justifyContent:"center",position:"relative",height:200,width:"100%",backgroundColor:r?"transparent":"purple2",children:[t,n&&f.jsx(vEe,{uploadStatus:n})]})}function vEe(e){const{uploadStatus:t}=e,{value:n,color:r,height:i,transition:o}=yEe(t);return f.jsx(h.Box,{position:"absolute",backgroundColor:"greyAlpha1",width:"100%",height:"100%",padding:{inline:16},justifyContent:"end",flexDirection:"column",children:f.jsx(h.ProgressBar,{value:n,color:r,height:i,transition:o})})}function yEe(e){switch(e){case"idle":return{value:0,height:"collapsed",color:"grey4"};case"uploading":return{value:90,transition:"slow",color:"purple9"};case"success":return{value:100,height:"collapsed",color:"purple9"};case"error":return{value:100,color:"tomato11"}}}function JF(e){const{media:t}=e;return f.jsx(h.Box,{width:111,height:152,children:t.kind==="image"?f.jsx(h.Image,{borderRadius:8,src:t.url,alt:t.alt,sizing:"cover"}):f.jsx(h.MediaCardPlaceholder,{kind:t.kind,filename:t.filename})})}const es=2e3,md="__MAIN_THUMBNAIL__";function sC(e,t,n){const r=e.name===md?void 0:e.name;let i;return t?io.isDefined(n)?i=[n.width,n.height]:io.isDefined(e.width)||io.isDefined(e.height)?i=[e.width??void 0,e.height??void 0]:i=[t.origin.width,t.origin.height]:i=void 0,[r,i?`${i[0]??"auto"}×${i[1]??"auto"}px`:void 0]}function bEe(e){var t,n;return[{...(t=e.config)==null?void 0:t.constraint,name:md}].concat(((n=e.config)==null?void 0:n.thumbnails)??[])}function CEe(e,t){var a,s;const{__TYPE__:n,thumbnails:r,...i}=t,o=(s=(a=e.config)==null?void 0:a.thumbnails)==null?void 0:s.map(({name:u})=>r==null?void 0:r[u]);return[i,...o??[]]}function SEe(e,t,n,r){const i=r.length===0?void 0:r;return e===md||!Ce.isImageContent(t)?{...t,alt:i}:{...t,thumbnails:{...t.thumbnails,[e]:{...n,alt:i}}}}function _Ee(e,t){const{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]}function IEe(e,t,n,r,i){if(REe(e)==="svg")return e;const o=new URL(e);if(i){const{x:a,y:s,width:u,height:c}=t,l=[...o.searchParams.entries(),["rect",[a,s,u,c].join(",")],["w",n],["h",r]];o.search=l.map(d=>d.join("=")).join("&")}return o.toString()}function T7(e){const 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 TEe(e){const 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()}function xEe(e){return e!=null&&e.url?T7(e.url):void 0}function wEe(e,t,n,r){var s,u,c,l,d;if(!n||e===md){const p=(s=t.config)==null?void 0:s.thumbnails,A=p&&Object.fromEntries(p.map(m=>[m.name,rm(r,m)]));return{__TYPE__:"ImageContent",...rm(r,(u=t.config)==null?void 0:u.constraint),thumbnails:A}}const i=(l=(c=t.config)==null?void 0:c.thumbnails)==null?void 0:l.find(p=>p.name===e);if(!i)return n;const o=(d=n.thumbnails)==null?void 0:d[e],a=rm(r,i);return a.url===(o==null?void 0:o.url)?n:{...n,thumbnails:Vl.mapValues(n.thumbnails??{},(p,A)=>A===e?a:p)}}function EEe(e){return"kind"in e&&"extension"in e}function rm(e,t){const{width:n,height:r,rect:i}=$Ee({...e,width:(e==null?void 0:e.width)??es,height:(e==null?void 0:e.height)??es},t),o=!!(t!=null&&t.width||t!=null&&t.height);return{provider:"imgix",url:IEe(e.url,i,n,r,o),alt:e.alt,...EEe(e)?{credits:e.credits}:{},origin:{id:e.id,url:e.url,width:e.width??es,height:e.height??es},width:n,height:r,edit:{background:"transparent",zoom:1,crop:{x:i.x,y:i.y}}}}function $Ee(e,t){const[n,r]=_Ee(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),s=Math.round(n/i),u=Math.round(r/i);return{width:n,height:r,rect:{x:o,y:a,width:s,height:u}}}function REe(e){const{pathname:t}=new URL(e),n=t.lastIndexOf(".");if(n!==-1)return t.substring(n).slice(1).toLowerCase()}function OEe(e){if(!e)return"";const{filename:t,extension:n}=e;if(!n)return t;const r=new RegExp(`\\.${n}$`);return t.replace(r,"")}function FEe(e){const t=e.length,n={},r=[];return e.forEach(o=>{o.tags.forEach(a=>{n[a.id]||(n[a.id]=0,r.push(a)),n[a.id]++})}),r.filter(o=>n[o.id]===t)}function x7(e){const{tags:t,toggleAssetTag:n,getTagsLabel:r}=e,{setTagManagerOpen:i}=Ct(),{showToast:o}=I7(),{showAlert:a}=h.useAlert(),[s,u]=$.useState("");async function c(l,d){u("");try{await n(l,d),o({title:"Media tags were updated",seconds:3})}catch{a({title:"Error",subtitle:"Something went wrong when updating media tags"})}}return f.jsxs(h.Box,{flexDirection:"column",children:[f.jsxs(h.Box,{justifyContent:"space-between",children:[f.jsx(h.Text,{color:"grey12",variant:"bold",children:r()}),f.jsx(h.Button,{startIcon:"edit",invisible:!0,color:"dark",onClick:()=>i(!0),children:"Manage tags"})]}),f.jsxs(h.ComboBox,{sx:{marginTop:4,marginBottom:8},children:[f.jsx(kEe,{searchTerm:s,setSearchTerm:u}),f.jsx(h.ComboBoxContent,{children:f.jsx(h.ErrorBoundary,{renderError:()=>f.jsx(h.Text,{color:"grey9",variant:"small",sx:{marginBlock:8,marginInline:8},children:"Error getting tags"}),children:f.jsx($.Suspense,{fallback:f.jsx(h.Box,{padding:8,flexDirection:"column",gap:8,children:Qt.range(1,6).map(l=>f.jsx(h.Skeleton,{height:24,width:85},l))}),children:f.jsx(MEe,{searchTerm:s,assignedTags:t,onToggleAssetTag:c})})})})]}),f.jsx(h.Box,{flexDirection:"column",alignItems:"flex-start",gap:8,children:t.map(l=>f.jsx(h.Badge,{title:l.name,size:"medium",color:"purple",selected:!0,onClose:()=>c(l,"remove")},l.id))})]})}function kEe(e){const{searchTerm:t,setSearchTerm:n}=e,r=$.useRef(null),{openMediaSection:i,setOpenMediaSection:o}=Ct();return $.useEffect(()=>{var a;i==="tags"&&((a=r.current)==null||a.focus(),o(void 0))},[i,o]),f.jsx(h.ComboBoxInput,{value:t,onValueChange:n,placeholder:"Add or create a new tag",ref:r})}function MEe(e){const{searchTerm:t,assignedTags:n,onToggleAssetTag:r}=e,[i]=Pc(),o=Ee(),{showAlert:a}=h.useAlert(),{tags:s}=_h(),u=$.useMemo(()=>{const p=t.toLowerCase();return s.filter(A=>A.name.toLowerCase().includes(p))},[s,t]),l=DR.safeParse(t).success&&s.every(p=>p.name!==t);async function d(){if(!t||!i)return;let p;try{p=await LEe({name:t,config:o}),Ih(A=>[p,...A])}catch{a({title:"Error",subtitle:`Something went wrong when creating the tag ${t}`});return}await r(p,"add")}return i?f.jsxs(f.Fragment,{children:[!u.length&&f.jsx(h.Text,{color:"grey9",variant:"small",sx:{marginBlock:8,marginInline:8},children:"No tags found"}),u.map((p,A)=>f.jsx(h.ComboBoxItem,{value:p.id,onCheckedChange:m=>r(p,m?"add":"remove"),checked:n.some(m=>m.id===p.id),children:f.jsx(h.Badge,{title:p.name,color:"purple",size:"medium",sx:{marginInline:8,marginBottom:A===u.length-1?8:4,marginTop:A===0?8:4}})},p.id)),l&&f.jsx(h.ComboBoxItem,{value:"new",onCheckedChange:d,children:f.jsxs(h.Box,{padding:8,flexDirection:"row",alignItems:"center",gap:4,children:[f.jsx(h.Icon,{name:"add",size:"small",color:"grey11"}),f.jsxs(h.Text,{color:"grey12",children:['Create tag "',t,'"']})]})})]}):null}function LEe(e){const{name:t,config:n}=e;n.mediaLibrary||Jt("mediaLibrary");const{assetsApiBaseUrl:r,repository:i,authStrategy:o}=n;return pe.request(new URL("tags",r),{headers:{repository:i},body:{name:t},method:"POST",credentials:pe.getRequestCredentials(o),okType:KR})}function jEe(e){const{selectedMedia:t}=e,n=Ee(),r=$.useMemo(()=>FEe(t),[t]);async function i(a,s){const u=s==="remove",c=t.map(d=>d.id);let l=[];Lu(d=>(l=d,d.map(p=>c.includes(p.id)?u?PEe(p,a):BEe(p,a):p)));try{await UEe({tagId:a.id,assetIds:c,operation:u?"remove":"add",config:n});const d=t.length*(u?-1:1);Ih(p=>p.map(A=>A.id===a.id?{...A,count:A.count+d}:A))}catch(d){throw Lu(()=>l),d}}function o(){const a=r.length;return a>1?`${a} tags in common`:a===1?"1 tag in common":"Common tags"}return f.jsx(x7,{tags:r,getTagsLabel:o,toggleAssetTag:i})}function UEe(e){const{tagId:t,assetIds:n,config:r,operation:i}=e;if(!r.mediaLibrary)throw new Error("Media Library not configured.");const{assetsApiBaseUrl:o,repository:a,authStrategy:s}=r;return pe.request(new URL(`tags/${t}/assets`,o),{headers:{repository:a},body:{assetIds:n},method:i==="add"?"POST":"DELETE",credentials:pe.getRequestCredentials(s),okType:L.unknown()})}function BEe(e,t){return e.tags.some(({id:r})=>r===t.id)?e:{...e,tags:[...e.tags,t]}}function PEe(e,t){const n=e.tags.filter(r=>r.id!==t.id);return{...e,tags:n}}function WEe(e){const{selectedMedia:t}=e,n=t.tags,r=Ee(),{updateMedia:i}=Ct();async function o(s,u){const c=t.tags,l=u==="remove",d=l?c.filter(p=>p.id!==s.id):[...c,s];i(t.id,{tags:d});try{await DEe({mediaId:t.id,config:r,tags:d.map(p=>p.id)}),Ih(p=>p.map(A=>A.id===s.id?{...A,count:A.count+(l?-1:1)}:A))}catch(p){throw i(t.id,{tags:c}),p}}function a(){const s=n.length;return s>1?`${s} tags`:s===1?"1 tag":"Tags"}return f.jsx(x7,{tags:n,getTagsLabel:a,toggleAssetTag:o})}function DEe(e){const{mediaId:t,config:n,tags:r}=e;if(!n.mediaLibrary)throw new Error("Media Library not configured.");const{assetsApiBaseUrl:i,repository:o,authStrategy:a}=n;return pe.request(new URL(`assets/${t}`,i),{headers:{repository:o},body:{tags:r},method:"PATCH",credentials:pe.getRequestCredentials(a),okType:V0})}function KEe(){const[e,t]=$.useState("description");if(Pc().length!==1)return f.jsx(zEe,{});const r=e==="description",i=e==="more-info";return f.jsxs(f.Fragment,{children:[f.jsxs(h.Box,{display:"grid",gridTemplateColumns:"1fr 1fr",backgroundColor:"grey2",border:!0,borderStyle:"solid",borderRadius:8,children:[f.jsx(h.Tab,{selected:r,outline:r,transparent:!0,onClick:()=>t("description"),children:"Description"}),f.jsx(h.Tab,{selected:i,outline:i,transparent:!0,onClick:()=>t("more-info"),children:"More info"})]}),f.jsx(NEe,{tab:e})]})}function NEe(e){const{tab:t}=e;switch(t){case"description":return f.jsx(qEe,{});case"more-info":return f.jsx(VEe,{})}}function qEe(){const{title:e,alt:t,onBlur:n,isUploading:r,selectedMedia:i}=E7();if(!i)return null;const{extension:o}=i;return f.jsxs(h.Box,{flexDirection:"column",gap:16,children:[f.jsx(h.FormInput,{value:e.value,onValueChange:e.set,label:"Media title",placeholder:"Media title",onBlur:n,disabled:r,suffix:o?`.${o}`:void 0}),f.jsx(h.FormInputField,{label:"Alternative text",children:f.jsx(h.ContentEditable,{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&&f.jsx(WEe,{selectedMedia:i})]})}function VEe(){const{credits:e,notes:t,onBlur:n,isUploading:r,selectedMedia:i}=E7();if(!i)return null;const{uploader_id:o}=i,a=GEe(i);return f.jsxs(h.Box,{gap:8,flexDirection:"column",children:[a.map(s=>f.jsxs(h.Box,{gap:8,children:[f.jsxs(h.Text,{color:"grey11",children:[s.label,":"]}),f.jsx(h.Text,{children:s.value})]},s.label)),f.jsxs(h.Box,{gap:8,children:[f.jsx(h.Text,{color:"grey11",children:"Uploaded by:"}),f.jsx(h.ErrorBoundary,{renderError:()=>f.jsx(h.Text,{color:"grey11",children:"Error getting uploader"}),children:f.jsx($.Suspense,{fallback:f.jsx(w7,{}),children:f.jsx(QEe,{uploaderId:o})})})]}),f.jsx(h.FormInputField,{label:"Copyright",children:f.jsx(h.ContentEditable,{content:e.displayValue,contentVersion:e.version,readOnly:r,placeholder:"Media copyrights or credits",multiline:!0,decorations:{em:"highlight"},onChange:e.onChange,onBlur:n})}),f.jsx(h.FormInputField,{label:"Private notes",children:f.jsx(h.ContentEditable,{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 QEe(e){const{uploaderId:t}=e,{uploadersById:n}=u7(),r=n.get(t??"ghost");return t&&!r?f.jsx(w7,{}):r?f.jsxs(f.Fragment,{children:[f.jsx(h.Avatar,{size:24,firstName:r.firstName,lastName:r.lastName,imageUrl:r.uploadedAvatar,hasBorder:!1}),f.jsx(h.Text,{children:r.name})]}):null}function w7(){return f.jsx(h.Skeleton,{width:128})}function zEe(){const e=Pc(),{uploadingFiles:t}=Ct(),n=$.useMemo(()=>t.some(r=>e.some(i=>r.id===i.id)&&r.status!=="success"),[e,t]);return f.jsx(f.Fragment,{children:!n&&f.jsx(jEe,{selectedMedia:e})})}function E7(){const[e]=Pc(),{updateMedia:t,uploadingFiles:n}=Ct(),r=Ee(),{showToast:i}=I7(),o=(e==null?void 0:e.id)??"",a=Nh(e,"alt"),s=Nh(e,"notes"),u=Nh(e,"credits"),c=Nh(e,"filename",OEe),l=n.some(p=>p.id===(e==null?void 0:e.id)&&p.status!=="success");function d(){if(!e||!c.changed&&!a.changed&&!u.changed&&!s.changed)return;const{extension:p,search_highlight:A}=e,m=p?`${c.value}.${p}`:c.value;t(o,{filename:m,alt:a.value,credits:u.value,notes:s.value,search_highlight:{alt:a.changed||A==null?void 0:A.alt,credits:u.changed||A==null?void 0:A.credits,filename:c.changed||A==null?void 0:A.filename,notes:s.changed||A==null?void 0:A.notes}}),YEe({id:o,config:r,metadata:{filename:m,alt:a.value,credits:u.value,notes:s.value}}).then(()=>{i({title:"Media metadata has been saved.",seconds:3})}).catch(v=>{console.error(v)})}return{selectedMedia:e,onBlur:d,isUploading:l,title:c,alt:a,credits:u,notes:s,extension:e==null?void 0:e.extension}}function Nh(e,t,n=r=>r==null?void 0:r[t]){var c;const r=n(e)??"",[i,o]=$.useState(r);Ne.useOnChange(e==null?void 0:e.id,()=>o(r));const a=(c=e==null?void 0:e.search_highlight)==null?void 0:c[t],s=!!a;function u(l){const{from:d,to:p}=l.state.selection;l.commands.selectAll(),l.commands.unsetAllMarks(),l.commands.setTextSelection({from:d,to:p}),o(l.getText())}return{value:i,set:o,displayValue:HEe(a??i)??"",onChange:u,version:`${(e==null?void 0:e.id)??""}_${s}`,changed:i!==r}}function HEe(e){return e==null?void 0:e.replace(/\n/g,"<br>")}function YEe(e){const{id:t,config:n,metadata:r}=e;if(!n.mediaLibrary)throw new Error("Media Library not configured.");const{assetsApiBaseUrl:i,repository:o,authStrategy:a}=n;return pe.request(new URL(`assets/${t}`,i),{headers:{repository:o},body:{...r},method:"PATCH",credentials:pe.getRequestCredentials(a),okType:V0})}function GEe(e){const{width:t,height:n,last_modified:r,size:i,extension:o}=e,a=t&&n,s={label:"Date",value:ZC.prettyPrintDate(new Date(r))},u={label:"File size",value:Ep.formatBytes(i)},c=a?{label:"Dimensions",value:`${t}×${n}`}:void 0,l=a?{label:"Ratio",value:((t??0)/(n??0)).toFixed(1)}:void 0,d=o?{label:"Extension",value:o.toUpperCase()}:void 0;return[s,u,c,l,d].filter(io.isDefined)}function JEe(){const{setTagManagerOpen:e}=Ct(),[t,n]=$.useState("");return f.jsxs(h.Box,{gap:20,flexDirection:"column",height:"100%",children:[f.jsxs(h.Box,{alignItems:"center",gap:4,children:[f.jsx(h.IconButton,{icon:"close",size:"small",hasPadding:!1,onClick:()=>e(!1)}),f.jsx(h.Text,{variant:"bold",children:"Tags management"})]}),f.jsxs(h.Box,{gap:16,flexDirection:"column",height:"100%",children:[f.jsx(h.FormSearchInput,{value:t,onValueChange:n,placeholder:"Search for tags",endAdornment:!1,autoFocus:!0}),f.jsx(h.ErrorBoundary,{renderError:()=>f.jsx(t$e,{}),children:f.jsx($.Suspense,{fallback:f.jsx(i$e,{}),children:f.jsx(ZEe,{searchTerm:t})})})]})]})}function ZEe(e){const{searchTerm:t}=e,{tags:n}=_h(),r=n.filter(i=>i.name.toLowerCase().includes(t.toLowerCase()));return r.length===0?f.jsx(h.Text,{color:"grey9",variant:"small",children:"No tags found"}):f.jsx(h.AnimatedList,{ariaLabel:"Tags list",getItemKey:i=>i.id,gap:16,items:r,children:i=>f.jsx(XEe,{tag:i})})}function XEe(e){const{tag:t}=e,[n,r]=$.useState(!1),i=Ee(),{showAlert:o}=h.useAlert(),{showToast:a}=h.useToast(),{tags:s}=_h();async function u(c){if(!DR.safeParse(c).success){o({title:"Error",subtitle:`Failed to rename tag "${t.name}" to "${c}". Tag name must be at least ${t7} and at maximum ${n7} characters long.`});return}if(s.some(p=>p.name===c)){o({title:"Error",subtitle:`Failed to rename tag "${t.name}" to "${c}". Tag with name "${c}" already exists.`});return}try{await r$e({id:t.id,name:c,config:i}),Ih(p=>p.map(A=>A.id===t.id?{...A,name:c}:A)),Lu(p=>p.map(A=>{if(A.tags.findIndex(v=>v.id===t.id)!==-1){const v=A.tags.map(_=>_.id===t.id?{..._,name:c}:_);return{...A,tags:v}}return A})),a({title:`Tag "${t.name}" renamed to "${c}"`,seconds:3})}catch{o({title:"Error",subtitle:"Something went wrong when renaming the tag."})}}return f.jsxs(f.Fragment,{children:[f.jsxs(h.Box,{justifyContent:"space-between",children:[f.jsx(h.Badge,{title:t.name,color:"purple",size:"medium",onEdit:u}),f.jsx(h.Button,{invisible:!0,color:"tomato",textWeight:"normal",onClick:()=>r(!0),children:"Delete"})]}),f.jsx(e$e,{open:n,onOpenChange:r,tag:t})]})}function e$e(e){const{open:t,onOpenChange:n,tag:r}=e,{id:i,name:o,count:a}=r,s=Ee(),{showAlert:u}=h.useAlert(),[c,l]=$.useState(!1);async function d(){l(!0);try{await n$e({id:i,config:s}),Ih(p=>p.filter(A=>A.id!==i)),Lu(p=>p.map(A=>{if(A.tags.findIndex(v=>v.id===i)!==-1){const v=A.tags.filter(_=>_.id!==i);return{...A,tags:v}}return A}))}catch{u({title:"Error",subtitle:"Something went wrong when removing the tag."})}finally{l(!1),n(!1)}}return f.jsxs(h.Dialog,{onOpenChange:n,open:t,size:"small",children:[f.jsx(h.DialogHeader,{title:`This tag is being used on ${a} media item${a===1?"":"s"}`}),f.jsx(h.DialogContent,{padding:16,children:f.jsxs(h.Text,{children:["You are about to delete the tag name ",f.jsx("b",{children:o}),"."," ",a>0&&`This tag is being
33
33
  used on ${a} media item${a===1?"":"s"} and will be deleted
34
- from ${a===1?"it":"them"}.`]})}),f.jsxs(h.DialogActions,{children:[f.jsx(h.DialogCancelButton,{}),f.jsx(h.DialogActionButton,{onClick:d,color:"tomato",loading:c,children:"Yes, I want to delete"})]})]})}function o$e(){const e=$.useContext(Ve.ErrorBoundaryContext);return f.jsx(h.Box,{flexDirection:"column",children:f.jsxs(h.BlankSlate,{children:[f.jsx(h.BlankSlateIcon,{name:"close",lineColor:"purple10",backgroundColor:"purple3",borderColor:"purple6",borderStyle:"dashed"}),f.jsx(h.BlankSlateTitle,{size:"big",children:"Oops!"}),f.jsx(h.BlankSlateDescription,{width:360,children:"We couldn't load your media tags."}),f.jsx(h.BlankSlateActions,{children:f.jsx(h.Button,{onClick:e==null?void 0:e.reset,size:"medium",children:"Try again"})})]})})}function a$e(e){const{id:t,config:n}=e;n.mediaLibrary||Jt("mediaLibrary");const{assetsApiBaseUrl:r,repository:i,authStrategy:o}=n;return pe.request(new URL(`tags/${t}`,r),{headers:{repository:i},method:"DELETE",credentials:pe.getRequestCredentials(o),okType:L.unknown()})}function s$e(e){const{id:t,name:n,config:r}=e;r.mediaLibrary||Jt("mediaLibrary");const{assetsApiBaseUrl:i,repository:o,authStrategy:a}=r;return pe.request(new URL(`tags/${t}`,i),{headers:{repository:o},method:"PATCH",credentials:pe.getRequestCredentials(a),body:{name:n},okType:L.unknown()})}function u$e(){return f.jsx(h.Box,{flexDirection:"column",gap:16,children:Qt.range(1,6).map(e=>f.jsxs(h.Box,{justifyContent:"space-between",children:[f.jsx(h.Skeleton,{height:24,width:85}),f.jsx(h.Skeleton,{height:24,width:45})]},e))})}function c$e(){const e=Pc(),{onFilesUpload:t,isUploading:n,tagManagerOpen:r}=Ct();return e.length===0&&r===!1?f.jsx(b7,{onFilesUpload:t,isUploading:n}):f.jsx(h.Box,{flexDirection:"column",backgroundColor:"grey1",width:"100%",padding:16,gap:16,borderRadius:{topLeft:8,topRight:8},children:r?f.jsx(t$e,{}):f.jsxs(f.Fragment,{children:[f.jsx(vEe,{}),f.jsx(CEe,{}),f.jsx(QEe,{})]})})}function l$e(){const e=Vs();return f.jsx(y7,{hasSelectedMedia:e.selectedCount!==0,children:f.jsx(c$e,{})})}const uC={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"}},f$e=Object.entries(uC);function d$e(){const{assetType:e,initialAssetType:t,onFilterChange:n}=Ct(),[r,i]=$.useState(e);Ne.useOnChange(e,()=>{i(e)});const[o,a]=$.useState(!1);function s(p){a(!1),i(p),n({assetType:p})}const{icon:u,name:c}=uC[r],l=uC[t].name,d=t!=="all";return f.jsxs(h.DropdownMenu,{open:o,onOpenChange:a,children:[f.jsx(h.DropdownMenuTrigger,{disabled:d,children:f.jsx(p$e,{icon:u,isDropdownDisabled:d,buttonName:c,tooltipAssetTypeName:l})}),f.jsx(h.DropdownMenuContent,{minWidth:256,align:"start",childrenFocusScope:!0,children:f.jsx(f.Fragment,{children:f$e.filter(([p])=>p!==r).map(([p,{icon:A,name:m}])=>f.jsx(h.DropdownMenuItem,{startIcon:f.jsx(h.Icon,{name:A}),onSelect:()=>s(p),children:m},p))})})]})}const p$e=$.forwardRef(function(t,n){const{icon:r,isDropdownDisabled:i,buttonName:o,tooltipAssetTypeName:a,...s}=t;return f.jsx(h.Tooltip,{content:`You can only pick ${(a==null?void 0:a.toLocaleLowerCase())??"this type of media"}`,visible:i,children:f.jsx(h.Button,{startIcon:r,endIcon:"arrowDropDown",size:"small",color:"grey",disabled:i,ref:n,...s,children:o})})});function A$e(e){const{optimisticTagIds:t,setOptimisticTagIds:n}=e,{onFilterChange:r}=Ct(),{tags:i}=_h(),o=$.useMemo(()=>rz.groupBy(i,s=>s.id),[i]);function a(s){const u=t.filter(c=>c!==s.id);n(u),r({tagIds:u})}return f.jsx(f.Fragment,{children:t.map(s=>{var c;const u=(c=o.get(s))==null?void 0:c[0];return u?f.jsx(h.Badge,{title:u.name,size:"medium",color:"purple",onClose:()=>a(u),selected:!0},u.id):null})})}function h$e(){const{setTagManagerOpen:e,tagIds:t,onFilterChange:n}=Ct(),[r,i]=$.useState(""),[o,a]=$.useState(!1),[s,u]=$.useState(t);Ne.useOnChange(JSON.stringify(t),()=>{u(t)});function c(p){a(p),p||i("")}function l(p){const A=s.includes(p.id)?t.filter(m=>m!==p.id):[...t,p.id];u(A),n({tagIds:A}),a(!1)}function d(){a(!1),e(!0)}return f.jsxs(f.Fragment,{children:[f.jsxs(h.DropdownMenu,{open:o,onOpenChange:c,children:[f.jsx(h.DropdownMenuTrigger,{children:f.jsx(h.Button,{startIcon:"label",endIcon:"arrowDropDown",size:"small",color:"grey",children:"Tags"})}),f.jsx(h.DropdownMenuContent,{minWidth:256,align:"start",border:!1,childrenFocusScope:!0,children:f.jsxs(h.ComboBox,{variant:"attached",children:[f.jsx(h.ComboBoxInput,{value:r,onValueChange:i,placeholder:"Search for a tag",autoFocus:!0}),f.jsx(h.ComboBoxContent,{paddingBlock:4,children:f.jsx(h.ErrorBoundary,{renderError:()=>f.jsx(h.Text,{color:"grey9",variant:"small",sx:{marginBlock:8,marginInline:8},children:"Error getting tags"}),children:f.jsx($.Suspense,{fallback:f.jsx(h.Box,{padding:8,flexDirection:"column",gap:8,children:Qt.range(1,6).map(p=>f.jsx(h.Skeleton,{height:24,width:85},p))}),children:f.jsx(m$e,{searchTerm:r,setSearchTerm:i,onTagToggle:l,optimisticTagIds:s})})})}),f.jsx(h.ComboboxAction,{children:f.jsx(h.Button,{invisible:!0,startIcon:"edit",textWeight:"normal",color:"dark",onClick:d,children:"Manage tags"})})]})})]}),s.length>0&&f.jsx(h.ErrorBoundary,{children:f.jsx($.Suspense,{children:f.jsx(A$e,{optimisticTagIds:s,setOptimisticTagIds:u})})})]})}function m$e(e){const{onTagToggle:t,searchTerm:n,optimisticTagIds:r}=e,{tags:i}=_h(),o=$.useMemo(()=>{const a=n.toLowerCase();return i.filter(s=>s.name.toLowerCase().includes(a))},[i,n]);return f.jsxs(f.Fragment,{children:[!o.length&&f.jsx(h.Text,{color:"grey9",variant:"small",sx:{marginBlock:8,marginInline:8},children:"No tags found"}),o.map(a=>{const s=r.includes(a.id);return f.jsx(h.ComboBoxItem,{value:a.id,onCheckedChange:()=>t(a),checked:s,children:f.jsx(h.Badge,{title:a.name,color:"purple",sx:{marginLeft:8,marginBottom:4,marginTop:4},size:"medium"})},a.id)})]})}function g$e(){const{uploaderId:e,onFilterChange:t}=Ct(),[n,r]=$.useState(""),[i,o]=$.useState(!1),[a,s]=$.useState();Ne.useOnChange(e,()=>{e||s(void 0)});function u(l){o(l),l||r("")}function c(l){s(l),t({uploaderId:l==null?void 0:l.id}),o(!1)}return f.jsxs(h.DropdownMenu,{open:i,onOpenChange:u,children:[f.jsx(h.DropdownMenuTrigger,{children:f.jsx(h.Button,{startIcon:"people",renderStartIcon:l=>a?f.jsx(h.Avatar,{imageUrl:a==null?void 0:a.uploadedAvatar,firstName:a.firstName,lastName:a.lastName,size:16,hasBorder:!1}):l,endIcon:"arrowDropDown",size:"small",color:"grey",children:(a==null?void 0:a.name)??"All uploaders"})}),f.jsx(h.DropdownMenuContent,{minWidth:256,align:"start",border:!1,childrenFocusScope:!0,children:f.jsxs(h.ComboBox,{variant:"attached",children:[f.jsx(h.ComboBoxInput,{value:n,onValueChange:r,placeholder:"Search for uploaders",autoFocus:!0}),f.jsx(h.ComboBoxContent,{paddingBlock:4,children:f.jsx(h.ErrorBoundary,{renderError:()=>f.jsx(h.Text,{color:"grey9",variant:"small",sx:{marginBlock:8,marginInline:8},children:"Error getting uploaders"}),children:f.jsx($.Suspense,{fallback:f.jsx(y$e,{}),children:f.jsx(v$e,{searchTerm:n,setSearchTerm:r,onUploaderToggle:c,optimisticUploader:a})})})})]})})]})}function v$e(e){const{searchTerm:t,optimisticUploader:n,onUploaderToggle:r}=e,{uploaders:i}=u7(),o=$.useMemo(()=>{const a=t.toLowerCase();return Qt.sort(i.filter(s=>{var u;return s.name.toLowerCase().includes(a)||((u=s.email)==null?void 0:u.toLowerCase().includes(a))}),s=>(n==null?void 0:n.id)===(s==null?void 0:s.id)?0:1)},[i,n,t]);return o.length?f.jsx(f.Fragment,{children:o.map(a=>{const s=a.id===(n==null?void 0:n.id);return f.jsx(h.ComboBoxItem,{value:a.id,onCheckedChange:()=>s?r():r(a),checked:s,children:f.jsxs(h.Box,{alignItems:"center",padding:{top:8,bottom:8,left:16,right:16},gap:8,children:[f.jsx(h.Avatar,{firstName:a.firstName,lastName:a.lastName,imageUrl:a.uploadedAvatar,hasBorder:!1}),f.jsxs(h.Box,{display:"flex",flexDirection:"column",children:[f.jsx(h.Text,{color:"grey12",variant:"normal",children:a.name}),a.email&&f.jsx(h.Text,{color:"grey10",variant:"small",children:a.email})]})]})},a.id)})}):f.jsx(h.Text,{color:"grey9",variant:"small",sx:{marginBlock:8,marginInline:8},children:"No uploaders found"})}function y$e(){return f.jsx(h.Box,{padding:8,flexDirection:"column",gap:8,children:Qt.range(1,4).map(e=>f.jsx(h.Skeleton,{height:48,width:"full"},e))})}function b$e(){const{media:e,mediaTotal:t}=Ct(),n=Vs();return f.jsxs(h.Box,{alignItems:"center",gap:16,children:[n.isSelectAllEnabled&&f.jsx(h.Checkbox,{onCheckedChange:n.toggleSelectAll,checked:n.selectedCount>0,indeterminate:n.selectedCount!==t,onClick:r=>r.stopPropagation(),disabled:e.length===0}),e.length!==0&&f.jsx(C7,{count:t}),f.jsxs(h.Box,{gap:8,alignItems:"center",children:[f.jsx(h.Text,{children:"Filter:"}),f.jsx(d$e,{}),f.jsx(g$e,{}),f.jsx(h$e,{})]})]})}function $7(e){const{assetType:t,onSelectedChange:n,actionContainerRef:r}=e;return f.jsx(h.ErrorBoundary,{renderError:()=>f.jsx(m7,{}),children:f.jsx($.Suspense,{fallback:f.jsx(dEe,{actionContainerRef:r}),children:f.jsx(Rq,{children:f.jsx(rEe,{assetType:t,actionContainerRef:r,onSelectedChange:n,children:f.jsx(cEe,{children:f.jsx(C$e,{})})})})})})}function C$e(){const{media:e}=Ct(),t=d7();return f.jsx(mEe,{children:f.jsx(g7,{sidePane:t?void 0:f.jsx(l$e,{}),mediaActions:f.jsx(sEe,{}),mediaToolbar:f.jsx(b$e,{}),mediaList:e.length===0?f.jsx(oEe,{}):f.jsx(fEe,{})})})}function S$e(e){const{href:t}=e;return f.jsx(h.Box,{justifyContent:"center",padding:{block:6},children:f.jsxs(h.Text,{href:t,variant:"smallBold",color:"grey11",children:["Or watch our in-depth course",f.jsx(h.Icon,{name:"playCircle",color:"grey11",size:"small",sx:{marginLeft:4}})]})})}function _$e(e){const{step:t,stepIndex:n,isOpen:r,isStepComplete:i,onActionClick:o,onClose:a}=e,[s,u]=$.useState(!1),[c,l]=$.useState(d);function d(){return i?"Undo step":"Mark as done"}function p(){r&&l(d())}async function A(){try{u(!0),await o()}finally{u(!1)}}return f.jsxs(h.Dialog,{open:r,onOpenChange:a,onAnimationEnd:p,onAnimationStart:p,size:"small",children:[f.jsx(h.DialogHeader,{title:"Onboarding"}),f.jsxs(h.DialogContent,{children:[f.jsx(h.ScrollArea,{children:f.jsxs(h.Box,{as:"article",flexDirection:"column",padding:16,gap:16,children:[f.jsxs("section",{children:[f.jsxs(h.Text,{sx:{marginBottom:4},color:"purple9",variant:"bold",children:["Step ",n]}),f.jsx(h.Text,{variant:"h3",children:t.title}),t.content]}),t.videoUrl&&f.jsx(h.Video,{src:t.videoUrl,sizing:"contain",autoPlay:!0,loop:!0})]})}),f.jsxs(h.DialogActions,{children:[f.jsx(h.DialogCancelButton,{size:"medium",children:"Close"}),!t.defaultCompleted&&f.jsx(h.DialogActionButton,{size:"medium",onClick:A,loading:s,children:c})]})]})]})}function I$e(e){const{steps:t,completedSteps:n,onToggleStep:r,tracking:i}=e,[o,a]=$.useState(!1),[s,u]=$.useState(t[0]);if(!s)return null;function c(A){return t.findIndex(({id:m})=>m===A)}function l(A){return n.includes(A.id)}function d(A){u(A),a(!0),i.track({event:"shared-onboarding:step-opened",stepId:A.id,stepTitle:A.title,source:i.source})}async function p(){s&&await r(s),a(!1)}return f.jsxs(f.Fragment,{children:[f.jsx(_$e,{isOpen:o,step:s,stepIndex:c(s.id)+1,isStepComplete:l(s),onClose:()=>a(!1),onActionClick:p}),f.jsxs(h.DropdownMenu,{children:[f.jsx(h.DropdownMenuTrigger,{children:f.jsx(h.Button,{size:"large",color:"grey",sx:{width:"100%"},renderStartIcon:T$e,children:n.length>0?"Continue":"Start now"})}),f.jsxs(h.DropdownMenuContent,{side:"right",minWidth:256,collisionPadding:8,children:[f.jsx(h.DropdownMenuLabel,{children:f.jsx(h.Text,{variant:"small",color:"grey11",sx:{marginInline:8},children:"Progress"})}),t.map((A,m)=>{const v=l(A);return f.jsx(h.DropdownMenuItem,{onSelect:()=>d(A),description:A.description,completed:v,endAdornment:f.jsx(h.Icon,{name:"chevronRight",size:"small",color:"grey11"}),children:`${m+1} ${A.title}`},A.id)})]})]})]})}function T$e(){return f.jsx(h.Icon,{name:"arrowForward",size:"small",color:"grey11"})}function x$e(e){const{steps:t,completedSteps:n,tutorialLink:r,tracking:i,onToggleStep:o,onClose:a}=e;return f.jsx(h.Card,{color:"grey2",variant:"animated-light",paddingBlock:16,onClose:a,children:f.jsxs(h.CardContent,{children:[f.jsxs("div",{children:[f.jsx(h.Text,{variant:"bold",children:`Build your first page in ${t.length.toString()} simple steps
35
- steps`}),f.jsx(h.Text,{color:"grey11",variant:"small",children:"Render a live page with content coming from Prismic."})]}),f.jsx(h.ProgressBar,{value:n.length,max:t.length,displayLabel:!0,getValueLabel:(s,u)=>`${s}/${u}`}),f.jsx(I$e,{steps:t,completedSteps:n,onToggleStep:o,tracking:i}),r&&f.jsx(S$e,{href:r})]})})}function w$e(e,t){const n=e&&e!=="other"&&DM[e],r=n?`${n} `:"",i=[{id:"createPrismicProject",title:"Create your Prismic project",description:"Create and set up your project",defaultCompleted:!0,content:f.jsx(h.Text,{children:"A Prismic project is a space for managing and organizing the content of your website."})},{id:"chooseLocale",title:"Select your main locale",description:"Choose your first locale",defaultCompleted:!!t,content:f.jsx(h.Text,{children:"Locales allow you to create and manage multilingual versions of your content within a single Prismic project."})},{id:"createProject",title:`Create a ${r}project`,description:"Create and set up your project",videoUrl:"https://res.cloudinary.com/dmtf1daqp/video/upload/v1727768069/DEV_TOOLS/ONBOARDING_GUIDE/Pagebuilder_onboarding_step_3_puh6fx.mp4",content:f.jsx(h.Text,{children:"Now that you have a Prismic project to manage the content of your website, let's create the code project that will be querying your content."})},{id:"setupSliceMachine",title:"Set Up & run Slice Machine",description:"Prepare the code to fetch content",videoUrl:"https://res.cloudinary.com/dmtf1daqp/video/upload/v1727768069/DEV_TOOLS/ONBOARDING_GUIDE/page_builder_onboarding_step_4_yl8fb8.mp4",content:f.jsxs(f.Fragment,{children:[f.jsx(h.Text,{children:`Slice Machine is the Prismic tool for creating your content models.
34
+ from ${a===1?"it":"them"}.`]})}),f.jsxs(h.DialogActions,{children:[f.jsx(h.DialogCancelButton,{}),f.jsx(h.DialogActionButton,{onClick:d,color:"tomato",loading:c,children:"Yes, I want to delete"})]})]})}function t$e(){const e=$.useContext(Ve.ErrorBoundaryContext);return f.jsx(h.Box,{flexDirection:"column",children:f.jsxs(h.BlankSlate,{children:[f.jsx(h.BlankSlateIcon,{name:"close",lineColor:"purple10",backgroundColor:"purple3",borderColor:"purple6",borderStyle:"dashed"}),f.jsx(h.BlankSlateTitle,{size:"big",children:"Oops!"}),f.jsx(h.BlankSlateDescription,{width:360,children:"We couldn't load your media tags."}),f.jsx(h.BlankSlateActions,{children:f.jsx(h.Button,{onClick:e==null?void 0:e.reset,size:"medium",children:"Try again"})})]})})}function n$e(e){const{id:t,config:n}=e;n.mediaLibrary||Jt("mediaLibrary");const{assetsApiBaseUrl:r,repository:i,authStrategy:o}=n;return pe.request(new URL(`tags/${t}`,r),{headers:{repository:i},method:"DELETE",credentials:pe.getRequestCredentials(o),okType:L.unknown()})}function r$e(e){const{id:t,name:n,config:r}=e;r.mediaLibrary||Jt("mediaLibrary");const{assetsApiBaseUrl:i,repository:o,authStrategy:a}=r;return pe.request(new URL(`tags/${t}`,i),{headers:{repository:o},method:"PATCH",credentials:pe.getRequestCredentials(a),body:{name:n},okType:L.unknown()})}function i$e(){return f.jsx(h.Box,{flexDirection:"column",gap:16,children:Qt.range(1,6).map(e=>f.jsxs(h.Box,{justifyContent:"space-between",children:[f.jsx(h.Skeleton,{height:24,width:85}),f.jsx(h.Skeleton,{height:24,width:45})]},e))})}function o$e(){const e=Pc(),{onFilesUpload:t,isUploading:n,tagManagerOpen:r}=Ct();return e.length===0&&r===!1?f.jsx(b7,{onFilesUpload:t,isUploading:n}):f.jsx(h.Box,{flexDirection:"column",backgroundColor:"grey1",width:"100%",padding:16,gap:16,borderRadius:{topLeft:8,topRight:8},children:r?f.jsx(JEe,{}):f.jsxs(f.Fragment,{children:[f.jsx(AEe,{}),f.jsx(gEe,{}),f.jsx(KEe,{})]})})}function a$e(){const e=Vs();return f.jsx(y7,{hasSelectedMedia:e.selectedCount!==0,children:f.jsx(o$e,{})})}const uC={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"}},s$e=Object.entries(uC);function u$e(){const{assetType:e,initialAssetType:t,onFilterChange:n}=Ct(),[r,i]=$.useState(e);Ne.useOnChange(e,()=>{i(e)});const[o,a]=$.useState(!1);function s(p){a(!1),i(p),n({assetType:p})}const{icon:u,name:c}=uC[r],l=uC[t].name,d=t!=="all";return f.jsxs(h.DropdownMenu,{open:o,onOpenChange:a,children:[f.jsx(h.DropdownMenuTrigger,{disabled:d,children:f.jsx(c$e,{icon:u,isDropdownDisabled:d,buttonName:c,tooltipAssetTypeName:l})}),f.jsx(h.DropdownMenuContent,{minWidth:256,align:"start",childrenFocusScope:!0,children:f.jsx(f.Fragment,{children:s$e.filter(([p])=>p!==r).map(([p,{icon:A,name:m}])=>f.jsx(h.DropdownMenuItem,{startIcon:f.jsx(h.Icon,{name:A}),onSelect:()=>s(p),children:m},p))})})]})}const c$e=$.forwardRef(function(t,n){const{icon:r,isDropdownDisabled:i,buttonName:o,tooltipAssetTypeName:a,...s}=t;return f.jsx(h.Tooltip,{content:`You can only pick ${(a==null?void 0:a.toLocaleLowerCase())??"this type of media"}`,visible:i,children:f.jsx(h.Button,{startIcon:r,endIcon:"arrowDropDown",size:"small",color:"grey",disabled:i,ref:n,...s,children:o})})});function l$e(e){const{optimisticTagIds:t,setOptimisticTagIds:n}=e,{onFilterChange:r}=Ct(),{tags:i}=_h(),o=$.useMemo(()=>rz.groupBy(i,s=>s.id),[i]);function a(s){const u=t.filter(c=>c!==s.id);n(u),r({tagIds:u})}return f.jsx(f.Fragment,{children:t.map(s=>{var c;const u=(c=o.get(s))==null?void 0:c[0];return u?f.jsx(h.Badge,{title:u.name,size:"medium",color:"purple",onClose:()=>a(u),selected:!0},u.id):null})})}function f$e(){const{setTagManagerOpen:e,tagIds:t,onFilterChange:n}=Ct(),[r,i]=$.useState(""),[o,a]=$.useState(!1),[s,u]=$.useState(t);Ne.useOnChange(JSON.stringify(t),()=>{u(t)});function c(p){a(p),p||i("")}function l(p){const A=s.includes(p.id)?t.filter(m=>m!==p.id):[...t,p.id];u(A),n({tagIds:A}),a(!1)}function d(){a(!1),e(!0)}return f.jsxs(f.Fragment,{children:[f.jsxs(h.DropdownMenu,{open:o,onOpenChange:c,children:[f.jsx(h.DropdownMenuTrigger,{children:f.jsx(h.Button,{startIcon:"label",endIcon:"arrowDropDown",size:"small",color:"grey",children:"Tags"})}),f.jsx(h.DropdownMenuContent,{minWidth:256,align:"start",border:!1,childrenFocusScope:!0,children:f.jsxs(h.ComboBox,{variant:"attached",children:[f.jsx(h.ComboBoxInput,{value:r,onValueChange:i,placeholder:"Search for a tag",autoFocus:!0}),f.jsx(h.ComboBoxContent,{paddingBlock:4,children:f.jsx(h.ErrorBoundary,{renderError:()=>f.jsx(h.Text,{color:"grey9",variant:"small",sx:{marginBlock:8,marginInline:8},children:"Error getting tags"}),children:f.jsx($.Suspense,{fallback:f.jsx(h.Box,{padding:8,flexDirection:"column",gap:8,children:Qt.range(1,6).map(p=>f.jsx(h.Skeleton,{height:24,width:85},p))}),children:f.jsx(d$e,{searchTerm:r,setSearchTerm:i,onTagToggle:l,optimisticTagIds:s})})})}),f.jsx(h.ComboboxAction,{children:f.jsx(h.Button,{invisible:!0,startIcon:"edit",textWeight:"normal",color:"dark",onClick:d,children:"Manage tags"})})]})})]}),s.length>0&&f.jsx(h.ErrorBoundary,{children:f.jsx($.Suspense,{children:f.jsx(l$e,{optimisticTagIds:s,setOptimisticTagIds:u})})})]})}function d$e(e){const{onTagToggle:t,searchTerm:n,optimisticTagIds:r}=e,{tags:i}=_h(),o=$.useMemo(()=>{const a=n.toLowerCase();return i.filter(s=>s.name.toLowerCase().includes(a))},[i,n]);return f.jsxs(f.Fragment,{children:[!o.length&&f.jsx(h.Text,{color:"grey9",variant:"small",sx:{marginBlock:8,marginInline:8},children:"No tags found"}),o.map(a=>{const s=r.includes(a.id);return f.jsx(h.ComboBoxItem,{value:a.id,onCheckedChange:()=>t(a),checked:s,children:f.jsx(h.Badge,{title:a.name,color:"purple",sx:{marginLeft:8,marginBottom:4,marginTop:4},size:"medium"})},a.id)})]})}function p$e(){const{uploaderId:e,onFilterChange:t}=Ct(),[n,r]=$.useState(""),[i,o]=$.useState(!1),[a,s]=$.useState();Ne.useOnChange(e,()=>{e||s(void 0)});function u(l){o(l),l||r("")}function c(l){s(l),t({uploaderId:l==null?void 0:l.id}),o(!1)}return f.jsxs(h.DropdownMenu,{open:i,onOpenChange:u,children:[f.jsx(h.DropdownMenuTrigger,{children:f.jsx(h.Button,{startIcon:"people",renderStartIcon:l=>a?f.jsx(h.Avatar,{imageUrl:a==null?void 0:a.uploadedAvatar,firstName:a.firstName,lastName:a.lastName,size:16,hasBorder:!1}):l,endIcon:"arrowDropDown",size:"small",color:"grey",children:(a==null?void 0:a.name)??"All uploaders"})}),f.jsx(h.DropdownMenuContent,{minWidth:256,align:"start",border:!1,childrenFocusScope:!0,children:f.jsxs(h.ComboBox,{variant:"attached",children:[f.jsx(h.ComboBoxInput,{value:n,onValueChange:r,placeholder:"Search for uploaders",autoFocus:!0}),f.jsx(h.ComboBoxContent,{paddingBlock:4,children:f.jsx(h.ErrorBoundary,{renderError:()=>f.jsx(h.Text,{color:"grey9",variant:"small",sx:{marginBlock:8,marginInline:8},children:"Error getting uploaders"}),children:f.jsx($.Suspense,{fallback:f.jsx(h$e,{}),children:f.jsx(A$e,{searchTerm:n,setSearchTerm:r,onUploaderToggle:c,optimisticUploader:a})})})})]})})]})}function A$e(e){const{searchTerm:t,optimisticUploader:n,onUploaderToggle:r}=e,{uploaders:i}=u7(),o=$.useMemo(()=>{const a=t.toLowerCase();return Qt.sort(i.filter(s=>{var u;return s.name.toLowerCase().includes(a)||((u=s.email)==null?void 0:u.toLowerCase().includes(a))}),s=>(n==null?void 0:n.id)===(s==null?void 0:s.id)?0:1)},[i,n,t]);return o.length?f.jsx(f.Fragment,{children:o.map(a=>{const s=a.id===(n==null?void 0:n.id);return f.jsx(h.ComboBoxItem,{value:a.id,onCheckedChange:()=>s?r():r(a),checked:s,children:f.jsxs(h.Box,{alignItems:"center",padding:{top:8,bottom:8,left:16,right:16},gap:8,children:[f.jsx(h.Avatar,{firstName:a.firstName,lastName:a.lastName,imageUrl:a.uploadedAvatar,hasBorder:!1}),f.jsxs(h.Box,{display:"flex",flexDirection:"column",children:[f.jsx(h.Text,{color:"grey12",variant:"normal",children:a.name}),a.email&&f.jsx(h.Text,{color:"grey10",variant:"small",children:a.email})]})]})},a.id)})}):f.jsx(h.Text,{color:"grey9",variant:"small",sx:{marginBlock:8,marginInline:8},children:"No uploaders found"})}function h$e(){return f.jsx(h.Box,{padding:8,flexDirection:"column",gap:8,children:Qt.range(1,4).map(e=>f.jsx(h.Skeleton,{height:48,width:"full"},e))})}function m$e(){const{media:e,mediaTotal:t}=Ct(),n=Vs();return f.jsxs(h.Box,{alignItems:"center",gap:16,children:[n.isSelectAllEnabled&&f.jsx(h.Checkbox,{onCheckedChange:n.toggleSelectAll,checked:n.selectedCount>0,indeterminate:n.selectedCount!==t,onClick:r=>r.stopPropagation(),disabled:e.length===0}),e.length!==0&&f.jsx(C7,{count:t}),f.jsxs(h.Box,{gap:8,alignItems:"center",children:[f.jsx(h.Text,{children:"Filter:"}),f.jsx(u$e,{}),f.jsx(p$e,{}),f.jsx(f$e,{})]})]})}function $7(e){const{assetType:t,onSelectedChange:n,actionContainerRef:r}=e;return f.jsx(h.ErrorBoundary,{renderError:()=>f.jsx(m7,{}),children:f.jsx($.Suspense,{fallback:f.jsx(uEe,{actionContainerRef:r}),children:f.jsx(Rq,{children:f.jsx(Xwe,{assetType:t,actionContainerRef:r,onSelectedChange:n,children:f.jsx(oEe,{children:f.jsx(g$e,{})})})})})})}function g$e(){const{media:e}=Ct(),t=d7();return f.jsx(dEe,{children:f.jsx(g7,{sidePane:t?void 0:f.jsx(a$e,{}),mediaActions:f.jsx(rEe,{}),mediaToolbar:f.jsx(m$e,{}),mediaList:e.length===0?f.jsx(tEe,{}):f.jsx(sEe,{})})})}function v$e(e){const{href:t}=e;return f.jsx(h.Box,{justifyContent:"center",padding:{block:6},children:f.jsxs(h.Text,{href:t,variant:"smallBold",color:"grey11",children:["Or watch our in-depth course",f.jsx(h.Icon,{name:"playCircle",color:"grey11",size:"small",sx:{marginLeft:4}})]})})}function y$e(e){const{step:t,stepIndex:n,isOpen:r,isStepComplete:i,onActionClick:o,onClose:a}=e,[s,u]=$.useState(!1),[c,l]=$.useState(d);function d(){return i?"Undo step":"Mark as done"}function p(){r&&l(d())}async function A(){try{u(!0),await o()}finally{u(!1)}}return f.jsxs(h.Dialog,{open:r,onOpenChange:a,onAnimationEnd:p,onAnimationStart:p,size:"small",children:[f.jsx(h.DialogHeader,{title:"Onboarding"}),f.jsxs(h.DialogContent,{children:[f.jsx(h.ScrollArea,{children:f.jsxs(h.Box,{as:"article",flexDirection:"column",padding:16,gap:16,children:[f.jsxs("section",{children:[f.jsxs(h.Text,{sx:{marginBottom:4},color:"purple9",variant:"bold",children:["Step ",n]}),f.jsx(h.Text,{variant:"h3",children:t.title}),t.content]}),t.videoUrl&&f.jsx(h.Video,{src:t.videoUrl,sizing:"contain",autoPlay:!0,loop:!0})]})}),f.jsxs(h.DialogActions,{children:[f.jsx(h.DialogCancelButton,{size:"medium",children:"Close"}),!t.defaultCompleted&&f.jsx(h.DialogActionButton,{size:"medium",onClick:A,loading:s,children:c})]})]})]})}function b$e(e){const{steps:t,completedSteps:n,onToggleStep:r,tracking:i}=e,[o,a]=$.useState(!1),[s,u]=$.useState(t[0]);if(!s)return null;function c(A){return t.findIndex(({id:m})=>m===A)}function l(A){return n.includes(A.id)}function d(A){u(A),a(!0),i.track({event:"shared-onboarding:step-opened",stepId:A.id,stepTitle:A.title,source:i.source})}async function p(){s&&await r(s),a(!1)}return f.jsxs(f.Fragment,{children:[f.jsx(y$e,{isOpen:o,step:s,stepIndex:c(s.id)+1,isStepComplete:l(s),onClose:()=>a(!1),onActionClick:p}),f.jsxs(h.DropdownMenu,{children:[f.jsx(h.DropdownMenuTrigger,{children:f.jsx(h.Button,{size:"large",color:"grey",sx:{width:"100%"},renderStartIcon:C$e,children:n.length>0?"Continue":"Start now"})}),f.jsxs(h.DropdownMenuContent,{side:"right",minWidth:256,collisionPadding:8,children:[f.jsx(h.DropdownMenuLabel,{children:f.jsx(h.Text,{variant:"small",color:"grey11",sx:{marginInline:8},children:"Progress"})}),t.map((A,m)=>{const v=l(A);return f.jsx(h.DropdownMenuItem,{onSelect:()=>d(A),description:A.description,completed:v,endAdornment:f.jsx(h.Icon,{name:"chevronRight",size:"small",color:"grey11"}),children:`${m+1} ${A.title}`},A.id)})]})]})]})}function C$e(){return f.jsx(h.Icon,{name:"arrowForward",size:"small",color:"grey11"})}function S$e(e){const{steps:t,completedSteps:n,tutorialLink:r,tracking:i,onToggleStep:o,onClose:a}=e;return f.jsx(h.Card,{color:"grey2",variant:"animated-light",paddingBlock:16,onClose:a,children:f.jsxs(h.CardContent,{children:[f.jsxs("div",{children:[f.jsx(h.Text,{variant:"bold",children:`Build your first page in ${t.length.toString()} simple steps
35
+ steps`}),f.jsx(h.Text,{color:"grey11",variant:"small",children:"Render a live page with content coming from Prismic."})]}),f.jsx(h.ProgressBar,{value:n.length,max:t.length,displayLabel:!0,getValueLabel:(s,u)=>`${s}/${u}`}),f.jsx(b$e,{steps:t,completedSteps:n,onToggleStep:o,tracking:i}),r&&f.jsx(v$e,{href:r})]})})}function _$e(e,t){const n=e&&e!=="other"&&DM[e],r=n?`${n} `:"",i=[{id:"createPrismicProject",title:"Create your Prismic project",description:"Create and set up your project",defaultCompleted:!0,content:f.jsx(h.Text,{children:"A Prismic project is a space for managing and organizing the content of your website."})},{id:"chooseLocale",title:"Select your main locale",description:"Choose your first locale",defaultCompleted:!!t,content:f.jsx(h.Text,{children:"Locales allow you to create and manage multilingual versions of your content within a single Prismic project."})},{id:"createProject",title:`Create a ${r}project`,description:"Create and set up your project",videoUrl:"https://res.cloudinary.com/dmtf1daqp/video/upload/v1727768069/DEV_TOOLS/ONBOARDING_GUIDE/Pagebuilder_onboarding_step_3_puh6fx.mp4",content:f.jsx(h.Text,{children:"Now that you have a Prismic project to manage the content of your website, let's create the code project that will be querying your content."})},{id:"setupSliceMachine",title:"Set Up & run Slice Machine",description:"Prepare the code to fetch content",videoUrl:"https://res.cloudinary.com/dmtf1daqp/video/upload/v1727768069/DEV_TOOLS/ONBOARDING_GUIDE/page_builder_onboarding_step_4_yl8fb8.mp4",content:f.jsxs(f.Fragment,{children:[f.jsx(h.Text,{children:`Slice Machine is the Prismic tool for creating your content models.
36
36
  Install it in your ${r}project by running these commands: `}),f.jsx(KM,{code:`cd <your project name>
37
- npx @slicemachine/init@latest --repository <my-project>`,language:"bash",title:"Terminal",showLineNumbers:!1})]})},{id:"createPageType",title:"Create a Page Type",description:"Build the structure of your page",videoUrl:"https://res.cloudinary.com/dmtf1daqp/video/upload/v1721918320/DEV_TOOLS/ONBOARDING_GUIDE/Create_page_type_xdn13j.mp4",content:f.jsx(h.Text,{children:"A page type is a base content structure editors will use to create pages in the Page Builder (Prismic's content creation UI). A page type can be reusable (e.g., for multiple blog posts) or single (e.g., for a one-time page like the homepage)."})},{id:"codePage",title:"Code Your Page Type",description:"Prepare code to fetch content",videoUrl:"https://res.cloudinary.com/dmtf1daqp/video/upload/v1721918320/DEV_TOOLS/ONBOARDING_GUIDE/Step2_code_your_page_jatiur.mp4",content:f.jsx(h.Text,{children:"Prepare your code to query the content from the Prismic API."})},{id:"createSlice",title:"Create a Slice",description:"Build a reusable website section",videoUrl:"https://res.cloudinary.com/dmtf1daqp/video/upload/v1721918322/DEV_TOOLS/ONBOARDING_GUIDE/Step3_add_slice_qzmvxf.mp4",content:f.jsx(h.Text,{children:"Slices are website sections that can be reused on different pages with different content. Each slice has a code component automatically generated by Slice Machine. Start with a template and look at your code to see how it's structured."})},{id:"reviewAndPush",title:"Review and Push changes",description:"Enable editors to create content",videoUrl:"https://res.cloudinary.com/dmtf1daqp/video/upload/v1721918320/DEV_TOOLS/ONBOARDING_GUIDE/DevTools_Squad_push_changes_ovvmul.mp4",content:f.jsx(h.Text,{children:"Your page types and slices currently exist only in your local project. Push them to your repository to make them available for your content editors."})},{id:"createContent",title:"Create Content",description:"Publish a page to the Prismic API",videoUrl:"https://res.cloudinary.com/dmtf1daqp/video/upload/v1721918324/DEV_TOOLS/ONBOARDING_GUIDE/Cre%CC%81er_contenu_e%CC%81tape_4_z9vlzt.mp4",content:f.jsx(h.Text,{children:"In Prismic, content creation takes place in the Prismic Page Builder UI. Open the Page Builder and start creating your first page."})},{id:"renderPage",title:"Render Your Page",description:"View your page in the browser",videoUrl:"https://res.cloudinary.com/dmtf1daqp/video/upload/v1721918321/DEV_TOOLS/ONBOARDING_GUIDE/Step_6_Render_Page_tnauh9.mp4",content:f.jsxs(h.Text,{children:["Now that your content is published, you can run your project in your terminal and visit the page on your local server (e.g.,"," ",f.jsx(h.Text,{component:"code",children:"localhost:3000/example-page"}),"). Your content should now be visible!"]})}],o={next:"https://prismic.dev/course/next",nuxt:"https://prismic.dev/course/nuxt",sveltekit:"https://prismic.dev/course/sveltekit"};return{steps:i,defaultCompletedStepIds:i.flatMap(a=>a.defaultCompleted?[a.id]:[]),tutorialLink:e?o[e]:void 0}}const Yb=3e3,ZF=400;function E$e(e){const{onboardingState:t,tracking:n,onToggleStep:r,onToggleGuide:i}=e,{context:o,isDismissed:a}=t,{steps:s,defaultCompletedStepIds:u,tutorialLink:c}=w$e(o.framework,o.starterId),l=v(t.completedSteps),d=$$e(A,ZF);if(o.framework==="other")return null;function p(){i(),d.reset()}function A(){i()}async function m(_){const C=await r(_.id);C.includes(_.id)&&n.track({event:"shared-onboarding:step-completed",stepId:_.id,stepTitle:_.title,source:n.source}),v(C).length===s.length&&(n.track({event:"shared-onboarding:completed",source:n.source}),d.start())}function v(_){const C=s.map(({id:I})=>I);return Array.from(new Set([..._.filter(I=>C.includes(I)),...u]))}return f.jsxs(f.Fragment,{children:[a&&f.jsx(h.ActionListItem,{textVariant:"normal",backgroundColor:"transparent",startIcon:"notStarted",onClick:p,children:"Get started"}),!a&&f.jsx(h.AnimatedElement,{enterDuration:0,exitDuration:ZF,children:d.status!=="hidden"&&f.jsxs("div",{ref:d.refs.container,style:{position:"relative"},children:[f.jsx(x$e,{steps:s,completedSteps:l,tutorialLink:c,tracking:n,onToggleStep:m,onClose:d.status!=="animating"?A:void 0}),f.jsx("div",{ref:d.refs.cannon,style:{position:"absolute",bottom:0,left:0}})]})})]})}function $$e(e,t=400){const n=oz.useConfetti({config:{duration:Yb}}),[r,i]=$.useState("visible"),o=$.useRef(!1),a=$.useCallback(()=>{i("animating"),setTimeout(()=>i("hidden"),Yb-t),o.current||(setTimeout(e,Yb),o.current=!0)},[e,t]),s=()=>{n.throwConfetti(),a()},u=$.useCallback(()=>{i("visible"),o.current=!1},[]);return{refs:{container:n.confettiContainerRef,cannon:n.confettiCannonRef},status:r,start:s,reset:u}}const R7=$.createContext({editedUID:{current:!1},onEditUID:()=>{}});function O7(e){return Object.values(e.json).some(t=>{var n;return((n=t.uid)==null?void 0:n.type)==="UID"})}function R$e(e){const{content:t,customType:n}=e;return O7(n)&&!t.uid}function F7(e){const{documentId:t,documentsWithUid:n,uid:r}=e;return n.filter(i=>t!==i.id&&F$e({document:i,uid:r})&&O$e({...e,document:i}))}function O$e(e){const{customTypeId:t,languageId:n,document:r}=e,i=t===r.custom_type_id,o=n===r.language.id;return i&&o}function F$e(e){const{document:t,uid:n}=e,r=t.versions.filter(i=>i.uid===n);return r.length===0?!0:r.some(i=>i.status!=="archived")}function Q0(e,t){return`${e}___${t}`}const k7=$.createContext({ids:[],isSelected:()=>!1,update:()=>{}});function z0(){return $.useContext(k7)}function nr(e){var t;return((t=e.config)==null?void 0:t.label)??(e.type==="Boolean"||e.type==="Separator"?void 0:e.fieldset)??e.type}const NR="...";function k$e(e,t,n=NR){var r,i;return(t?(r=e.config)==null?void 0:r.placeholder_true:(i=e.config)==null?void 0:i.placeholder_false)||n}function Wc(e,t=NR){var n;return((n=e.config)==null?void 0:n.placeholder)||t}function M$e(e){var s;const{content:t,field:n,id:r,readOnly:i,onContentChange:o}=e,a=(t==null?void 0:t.value)??((s=n.config)==null?void 0:s.default_value)??!1;return f.jsxs(h.Field,{children:[f.jsx(h.FieldIcon,{name:"biToggle"}),f.jsx(h.FieldLabel,{htmlFor:r,children:nr(n)}),f.jsxs(h.FieldControl,{children:[f.jsx(h.Box,{padding:4,alignItems:"center",children:f.jsx(h.Text,{children:k$e(n,a)})}),f.jsx(h.Switch,{id:r,sx:{alignSelf:"center",marginLeft:"auto",marginRight:12},checked:a,onCheckedChange:u=>{i||o(L$e(u))}})]})]})}function L$e(e){return{__TYPE__:"BooleanContent",value:e}}function j$e(e){const{id:t,field:n,content:r,onContentChange:i}=e;return f.jsxs(h.Field,{children:[f.jsx(h.FieldIcon,{name:"colorLens"}),f.jsx(h.FieldLabel,{id:t,children:nr(n)}),f.jsx(h.FieldControl,{children:f.jsx(h.Box,{padding:{left:4},alignItems:"center",children:f.jsx(h.ColorInput,{onValueChange:o=>i(U$e(o)),value:r==null?void 0:r.value,"aria-labelledby":t,placeholder:Wc(n)})})})]})}function U$e(e){return e===void 0?void 0:{__TYPE__:"FieldContent",type:"Color",value:e}}function B$e(e){const{id:t,readOnly:n,field:r,content:i,onContentChange:o}=e,a=i!=null&&i.value?ZC.dateFromISOString(i.value):void 0;return f.jsxs(h.Field,{children:[f.jsx(h.FieldIcon,{name:"dateRange"}),f.jsx(h.FieldLabel,{id:t,children:nr(r)}),f.jsx(h.FieldControl,{children:f.jsx(h.Box,{padding:{left:4,right:12},width:"100%",flexDirection:"column",justifyContent:"center",children:f.jsx(h.DateInput,{mode:"date","aria-labelledby":t,disabled:n,value:a,onValueChange:s=>o(P$e(s))})})})]})}function P$e(e){if(e)return{__TYPE__:"FieldContent",type:"Date",value:W$e(e)}}function W$e(e){const t=`${e.getFullYear()}`.padStart(4,"0"),n=`${e.getMonth()+1}`.padStart(2,"0"),r=`${e.getDate()}`.padStart(2,"0");return`${t}-${n}-${r}`}const Qs=$.forwardRef(function(t,n){return f.jsx(h.TextInput,{padding:M7,...t,ref:n,sx:{...t.sx,alignSelf:"stretch"}})}),M7={input:{inline:4},adornment:{inline:12}},D$e=({provider:e})=>K$e[e.toLowerCase()]??f.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[f.jsx("g",{clipPath:"url(#clip0_6524_22412)",children:f.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"})}),f.jsx("defs",{children:f.jsx("clipPath",{id:"clip0_6524_22412",children:f.jsx("rect",{width:"16",height:"16",fill:"white"})})})]}),K$e={codepen:f.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[f.jsx("g",{clipPath:"url(#clip0_6523_22409)",children:f.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"})}),f.jsx("defs",{children:f.jsx("clipPath",{id:"clip0_6523_22409",children:f.jsx("rect",{width:"16",height:"16",fill:"white"})})})]}),codesandbox:f.jsxs("svg",{width:"14",height:"16",viewBox:"0 0 14 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[f.jsx("g",{clipPath:"url(#clip0_6523_22406)",children:f.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"})}),f.jsx("defs",{children:f.jsx("clipPath",{id:"clip0_6523_22406",children:f.jsx("rect",{width:"13.8378",height:"16",fill:"white"})})})]}),dailymotion:f.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[f.jsxs("g",{clipPath:"url(#clip0_6523_22345)",children:[f.jsx("path",{d:"M16 0H0V16H16V0Z",fill:"white"}),f.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"})]}),f.jsx("defs",{children:f.jsx("clipPath",{id:"clip0_6523_22345",children:f.jsx("rect",{width:"16",height:"16",fill:"white"})})})]}),flickr:f.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[f.jsx("rect",{width:"16",height:"16",fill:"white"}),f.jsxs("g",{clipPath:"url(#clip0_6523_22379)",children:[f.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"}),f.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"})]}),f.jsx("defs",{children:f.jsx("clipPath",{id:"clip0_6523_22379",children:f.jsx("rect",{width:"12",height:"5.568",fill:"white",transform:"translate(2 5)"})})})]}),giphy:f.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[f.jsx("rect",{width:"16",height:"16",fill:"#121212"}),f.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4 3.38889V12.2778H5.11111V3.38889H4Z",fill:"#00FF99"}),f.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.6663 5.61111V12.2778H11.7774V5.61111H10.6663Z",fill:"#9933FF"}),f.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.75 3H4V4.11111H8.83333V3H7.75Z",fill:"#FFF35C"}),f.jsx("path",{d:"M9.00041 4.11111H7.33374H8.83374V3.77778L9.00041 4.11111Z",fill:"#999999"}),f.jsx("path",{d:"M8.83374 4.11111H7.33374L8.44485 3L8.83374 3.77778V4.11111Z",fill:"#999237"}),f.jsx("path",{d:"M10.6663 7.44444V5.77778L11.7774 6.33333L10.6663 7.44444Z",fill:"#5C1F99"}),f.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.6667 11.8889H4V13H11.7778V11.8889H10.6667Z",fill:"#00CCFF"}),f.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:f.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:[f.jsxs("g",{clipPath:"url(#clip0_6523_22356)",children:[f.jsx("mask",{id:"mask0_6523_22356",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"16",height:"16",children:f.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"})}),f.jsxs("g",{mask:"url(#mask0_6523_22356)",children:[f.jsx("mask",{id:"mask1_6523_22356",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"-1",y:"-1",width:"18",height:"18",children:f.jsx("path",{d:"M16.5905 -0.583628H-0.603516V16.6106H16.5905V-0.583628Z",fill:"white"})}),f.jsxs("g",{mask:"url(#mask1_6523_22356)",children:[f.jsx("mask",{id:"mask2_6523_22356",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"-1",y:"-1",width:"18",height:"18",children:f.jsx("path",{d:"M16.6701 -0.663237H-0.683105V16.6902H16.6701V-0.663237Z",fill:"white"})}),f.jsxs("g",{mask:"url(#mask2_6523_22356)",children:[f.jsx("mask",{id:"mask3_6523_22356",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"-1",y:"-1",width:"18",height:"18",children:f.jsx("path",{d:"M16.6701 -0.663237H-0.683105V16.6902H16.6701V-0.663237Z",fill:"white"})}),f.jsx("g",{mask:"url(#mask3_6523_22356)",children:f.jsx("rect",{x:"-0.688721",y:"-0.665792",width:"17.3622",height:"17.3622",fill:"url(#pattern0)"})})]})]})]})]}),f.jsxs("defs",{children:[f.jsx("pattern",{id:"pattern0",patternContentUnits:"objectBoundingBox",width:"1",height:"1",children:f.jsx("use",{xlinkHref:"#image0_6523_22356",transform:"scale(0.000439947)"})}),f.jsx("clipPath",{id:"clip0_6523_22356",children:f.jsx("rect",{width:"16",height:"16",fill:"white"})}),f.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:f.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[f.jsxs("g",{clipPath:"url(#clip0_6570_25513)",children:[f.jsx("rect",{width:"15.996",height:"16",rx:"2",fill:"#CC2127"}),f.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"})]}),f.jsx("defs",{children:f.jsx("clipPath",{id:"clip0_6570_25513",children:f.jsx("rect",{width:"16",height:"16",fill:"white"})})})]}),spotify:f.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[f.jsx("g",{clipPath:"url(#clip0_6523_22402)",children:f.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"})}),f.jsx("defs",{children:f.jsx("clipPath",{id:"clip0_6523_22402",children:f.jsx("rect",{width:"16",height:"16",fill:"white"})})})]}),twitter:f.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:f.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:f.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[f.jsxs("g",{clipPath:"url(#clip0_6523_22340)",children:[f.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"}),f.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"})]}),f.jsx("defs",{children:f.jsx("clipPath",{id:"clip0_6523_22340",children:f.jsx("rect",{width:"16",height:"16",fill:"white"})})})]}),youtube:f.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[f.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"}),f.jsx("path",{d:"M6.36353 10.0058L10.5453 7.62974L6.36353 5.25349V10.0058Z",fill:"white"})]})};function L7(e){const{debouncedUrl:t,content:n,onContentChange:r,selected:i}=e,o=$.useRef(null),[a,s]=$.useState(!1);Ne.useOnChange(t,()=>{var c;a&&(s(!1),(c=o.current)==null||c.reset())});function u(){s(!0),r(void 0)}return Fr.toURL(t)?t===(n==null?void 0:n.embed_url)?f.jsx(cC,{content:n,selected:i}):f.jsx(h.ErrorBoundary,{ref:o,renderError:N$e,onError:u,children:f.jsx($.Suspense,{fallback:n&&f.jsx(cC,{content:n,selected:i}),children:f.jsx(q$e,{url:t,selected:i,onContentChange:r})})}):null}function N$e(){return f.jsxs(h.Box,{backgroundColor:"grey2",borderRadius:6,padding:16,gap:4,children:[f.jsx(h.Icon,{name:"alert",size:"small",color:"grey11"}),f.jsx(h.Text,{variant:"smallBold",color:"grey11",children:"There is no embed data available."})]})}function cC(e){const{content:t,selected:n}=e,{thumbnail:r,provider:i,author:o,url:a,subtitle:s}=H$e(t);return f.jsxs(h.PreviewCard,{selected:n,children:[f.jsx(h.PreviewImage,{src:r.url,aspectRatio:r.aspectRatio}),f.jsxs(h.PreviewContent,{children:[f.jsxs(h.Box,{display:"flex",alignItems:"center",gap:4,children:[f.jsx(D$e,{provider:i}),f.jsx(h.Text,{variant:"smallBold",color:"grey12",noWrap:!0,children:i}),o&&f.jsx(h.Text,{variant:"small",color:"grey11",noWrap:!0,children:o})]}),f.jsx(h.Text,{variant:"smallBold",href:a,children:s})]})]})}function q$e(e){const{url:t,onContentChange:n,selected:r}=e,i=V$e({url:t,onContentChange:n});return f.jsx(cC,{content:i,selected:r})}function V$e(e){const{url:t,onContentChange:n}=e,{embedApiEndpoint:r}=Ee(),i=Ve.useRequest(Q$e,[t,r]),o=Ne.useStableCallback(n);return $.useEffect(()=>{const a=h.handleEditorFlushSyncError(()=>o(i));return()=>{clearTimeout(a)}},[i,o]),i}function Q$e(e,t){const n=new URL(t);return n.searchParams.set("url",e),pe.request(n,{okType:z$e(e)})}function z$e(e){return L.object({type:L.string(),version:L.string().or(L.number()).nullish(),title:L.string().nullish(),author_name:L.string().nullish(),author_url:L.string().nullish(),provider_name:L.string().nullish(),provider_url:L.string().nullish(),cache_age:L.string().or(L.number()).nullish(),thumbnail_url:L.string().nullish(),thumbnail_width:L.number().nullish(),thumbnail_height:L.number().nullish(),html:L.string().nullish()}).passthrough().transform(t=>{const 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 H$e(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:e.type==="video"?"16:9":"1:1"},provider:e.provider_name??"",author:e.author_name??"",subtitle:t}}function Y$e(e){const{id:t,readOnly:n,field:r,content:i,onContentChange:o}=e,a=Ne.useDebounceState({initialState:(i==null?void 0:i.embed_url)??"",startTransition:$.startTransition});function s(u){a.set(u),Fr.toURL(u)||o(void 0)}return f.jsxs(h.Field,{footer:Fr.toURL(a.value)&&f.jsx(h.FieldFooter,{children:f.jsx(L7,{debouncedUrl:a.debouncedValue,content:i,onContentChange:o})}),children:[f.jsx(h.FieldIcon,{name:"cloud"}),f.jsx(h.FieldLabel,{htmlFor:t,children:nr(r)}),f.jsx(h.FieldControl,{children:f.jsx(Qs,{id:t,readOnly:n,placeholder:Wc(r),value:a.value,onValueChange:s,variant:Fr.toURL(a.value)?"link":"normal",endAdornment:f.jsx(h.Button,{startIcon:"close",color:"grey",size:"small",disabled:!a,onClick:()=>s("")})})})]})}function j7(e){return!(e.lat>85||e.lat<-85||e.lng>180||e.lng<-180)}function Gb(e){const t=/^.*@(-?\d+.\d+),(-?\d+.\d+).*$/,n=e.match(t);if(!n)return;const r=parseFloat(n[1]??""),i=parseFloat(n[2]??"");if(isNaN(r)||isNaN(i))return;const o={lat:r,lng:i};if(j7(o))return o}function XF(e){return e?`${e.lat}, ${e.lng}`:""}function ek(e){const t=/\(?([\d|.|-]*)[\s+]*,[\s]*([\d|.|-]*)\)?/,n=e.match(t);if(!n)return Gb(e);const r=parseFloat(n[1]??""),i=parseFloat(n[2]??"");if(isNaN(r)||isNaN(i))return Gb(e);const o={lat:r,lng:i};return j7(o)?o:Gb(e)}function G$e(e){const{field:t,id:n,readOnly:r,...i}=e,{onValueChange:o,displayedValue:a,onBlur:s,clearValue:u,isValidCoordinates:c}=J$e(i);return f.jsxs(h.Field,{children:[f.jsx(h.FieldIcon,{name:"place"}),f.jsx(h.FieldLabel,{htmlFor:n,children:nr(t)}),f.jsx(h.FieldControl,{children:f.jsx(Qs,{id:n,onValueChange:o,placeholder:NR,readOnly:r,value:a,onBlur:s,variant:c?"link":"normal",endAdornment:f.jsx(h.Button,{startIcon:"close",color:"grey",size:"small",disabled:!a,onClick:u})})})]})}function J$e(e){const{content:t,onContentChange:n}=e,r=XF(t==null?void 0:t.position),[i,o]=$.useState(r);function a(){const c=ek(i);if(!c)return o(""),n(void 0);const{lat:l,lng:d}=c;o(XF({lat:l,lng:d})),n({__TYPE__:"GeoPointContent",position:{lat:l,lng:d}})}function s(){o(""),n(void 0)}const u=!!ek(i);return{displayedValue:i,isValidCoordinates:u,onValueChange:o,onBlur:a,clearValue:s}}function U7(e){const{fieldLabel:t,imageLabel:n=[]}=e;return f.jsxs(h.CardHeaderTitle,{children:[f.jsx(h.Text,{variant:"bold",noWrap:!0,children:Ep.overflow(t,30)}),n.length!==0&&f.jsx(h.Text,{color:"grey11",noSelect:!0,children:` • ${n.join(" • ")}`})]})}function B7(e){const{fieldLabel:t,isUpdating:n,readOnly:r,onMediaDialogOpenChange:i}=e;return f.jsxs(f.Fragment,{children:[f.jsx(h.CardHeader,{sx:{flexWrap:"wrap"},children:f.jsx(U7,{fieldLabel:t})}),f.jsx(h.CardContent,{children:f.jsx(h.Card,{color:"grey2",variant:"dashed",paddingBlock:12,radius:4,sx:{width:"100%"},children:f.jsx(h.CardContent,{children:f.jsxs(h.BlankSlate,{variant:"horizontal",children:[f.jsx(h.BlankSlateIcon,{name:"cloudUpload",lineColor:"purple9",backgroundColor:"purple4",size:"small"}),f.jsx(h.BlankSlateTitle,{children:n?"Preparing your image...":"You haven't selected an image"}),!r&&f.jsx(h.BlankSlateActions,{children:f.jsx(h.Button,{disabled:n,onClick:()=>i(!0),size:"medium",children:"Select image"})})]})})})})]})}const Z$e=Ap({id:Yo(),width:Dm(),height:Dm(),urls:Ap({full:Yo(),small:Yo().transform($Ee)}),alt_description:Yo().optional(),description:Yo().nullable()}),X$e=Ap({results:Uq(Z$e)}).transform(e=>e.results);function P7(e,t){const n=new URL("search/photos",e);return n.searchParams.set("page","1"),n.searchParams.set("per_page","28"),n.searchParams.set("query",t),pe.request(n,{okType:X$e})}Ve.cache.registerFetcherConfig(P7,{cacheCapacity:5,revalidationStrategy:{type:"never"}});function eRe(e,t){const n=$.useRef(),r=Ee(),i=Ve.useRequest(P7,[e,t]);return Ne.useDebounce(t,1e3,()=>{var o;n.current&&t!==n.current&&((o=r.onAnalyticsEvent)==null||o.call(r,"Unsplash Image Searched")),n.current=t}),i}function tRe(e){const{onSelectedChange:t}=e,[n,r]=$.useTransition(),i=Ne.useDebounceState({initialState:"",ms:300,startTransition:r});return f.jsxs(h.Box,{flexDirection:"column",gap:16,width:"100%",position:"relative",children:[f.jsx(h.FormSearchInput,{value:i.value,placeholder:"Search on Unsplash.com",onValueChange:i.set}),f.jsx(h.ErrorBoundary,{renderError:()=>f.jsx(m7,{}),children:f.jsx($.Suspense,{fallback:f.jsx(rRe,{}),children:f.jsx(nRe,{term:i.debouncedValue,loading:n,onSelectedChange:t})})})]})}function nRe(e){const{term:t,onSelectedChange:n,loading:r}=e,{media:i,toggleSelected:o,selectedImageId:a}=iRe({term:t,onSelectedChange:n});return f.jsxs(f.Fragment,{children:[i.length>0&&f.jsx(W7,{children:i==null?void 0:i.map(s=>{const c=new URL(s.urls.full).searchParams.get("fm")??"jpg";return f.jsx(h.MediaCard,{url:s.urls.small,filename:s.description??"Unsplash Image",selected:a===s.id,onCardClick:()=>o(s),onCheckedChange:()=>o(s),extension:c,kind:"image",width:s.width,height:s.height,loading:r},s.id)})}),i.length===0&&f.jsx(A7,{})]})}function W7(e){const{children:t}=e;return f.jsx(h.ScrollArea,{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 rRe(){return f.jsx(W7,{children:Qt.range(1,24).map(e=>f.jsx(S7,{},e))})}function iRe(e){var c;const{term:t,onSelectedChange:n}=e,{unsplashApiBaseUrl:r}=Ee(),i=eRe(r,t||"citrus fruit"),o=(c=i==null?void 0:i[0])==null?void 0:c.id,[a,s]=$.useState();$.useEffect(()=>{n==null||n([]),s(void 0)},[o,n]);function u(l){if(l.id===a)return s(void 0),n==null?void 0:n([]);s(l.id),n==null||n([{...l,url:l.urls.full,alt:l.alt_description}])}return{media:i,toggleSelected:u,selectedImageId:a}}function qR(e){const{open:t,onOpenChange:n,onMediaSelected:r,assetType:i}=e,o=Ee(),a=o.mediaLibrary,[s,u]=$.useState(()=>a?"media":"unsplash"),[c,l]=$.useState(new Set),[d,p]=$.useState([]),A=c.size+d.length,m=Ve.useFetcherData(mi);$.useEffect(()=>{!t||!a||s7({config:o,assetType:i})},[t,o,i,a]);function v(S){if(S!=="media"&&S!=="unsplash")throw new Error(`Invalid option ${S}.`);u(S)}function _(S){S||l(new Set),n(S)}const C=Vwe({assetType:i,mediaDialogOpen:t});function I(){var S;if(s==="unsplash"){const y=d[0];if(!y)return;r(y),(S=o.onAnalyticsEvent)==null||S.call(o,"Unsplash Image Added")}else if(s==="media"){const w=m.flatMap(O=>O.items).filter(O=>c.has(O.id))[0];if(!w)return;r(w),C(w.id)}_(!1)}function x(){if(A===0)return"Select a media item to add to the page";if(A>1)return"Only one media item can be added to the page"}const{containerRef:g}=h.useAlert();return f.jsxs(h.Dialog,{open:t,onOpenChange:_,size:{width:"min(calc(100% - 48px), 2000px)",height:"calc(100% - 30px)"},position:"center",onPointerDownOutside:S=>{g&&Ne.refContainsTarget(g,S.target)&&S.preventDefault()},children:[f.jsx(h.DialogHeader,{icon:"image",title:"Media library"}),f.jsxs(h.DialogOptions,{value:s,onValueChange:v,padding:"small",width:"auto",children:[a&&f.jsx(h.DialogOptionsItem,{value:"media",icon:"photo"}),f.jsx(h.DialogOptionsItem,{value:"unsplash",icon:"unsplash"})]}),f.jsx(h.DialogContent,{children:f.jsxs(h.Box,{flexDirection:"column",flexGrow:1,overflow:"hidden",children:[f.jsx(Eq,{}),f.jsxs(h.Box,{overflow:"hidden",backgroundColor:"grey2",padding:{top:16,inline:16},flexGrow:1,children:[s==="media"&&f.jsx($7,{assetType:i,onSelectedChange:l}),s==="unsplash"&&f.jsx(tRe,{onSelectedChange:p})]})]})}),f.jsxs(h.DialogActions,{children:[f.jsx(h.DialogCancelButton,{}),f.jsx(h.DialogActionButton,{onClick:I,disabled:A!==1,tooltipLabel:x(),children:"Add to page"})]})]})}const D7=$.forwardRef(function(t,n){const{isMediaDialogOpen:r,selected:i,children:o,onMediaSelected:a,onMediaDialogOpenChange:s}=t;return f.jsxs(h.Card,{ref:n,color:i?"indigo2":"grey2",variant:i?"selected":"dashed",paddingBlock:12,radius:4,children:[o,f.jsx(qR,{open:r,onOpenChange:s,onMediaSelected:a,assetType:"image"})]})});function K7(e){const{contentView:t,croppedImage:n}=e,{width:r,height:i,x:o,y:a,zoom:s}=n,u=aRe({origin:t.origin,croppedImage:n});return{...t,width:r,height:i,url:u,edit:{...t.edit,zoom:s,crop:{x:o,y:a}}}}function oRe(e){var c,l,d;const{field:t,content:n,thumbnail:r,croppedImage:i}=e;if(r===md)return N7({content:n,croppedImage:i});const o=Ce.isImageContent(n),a=(l=(c=t==null?void 0:t.config)==null?void 0:c.thumbnails)==null?void 0:l.find(p=>p.name===r),s=o?(d=n.thumbnails)==null?void 0:d[r]:void 0;if(!a||!s)return n;const u=K7({contentView:s,croppedImage:i});return u.url===s.url?n:{...n,thumbnails:o?{...n.thumbnails,[r]:u}:void 0}}function N7(e){const{content:t,croppedImage:n}=e,r=K7({contentView:t,croppedImage:n});return r.url===t.url?t:{...t,...r}}function aRe(e){const{origin:t,croppedImage:n}=e,{x:r,y:i,width:o,height:a,cropHeight:s,cropWidth:u}=n,c=new URL(t.url),l=t.height!==a||t.width!==o;if(r!==0||i!==0||s!==t.height||u!==t.width){const p=[r,i,u,s].map(Math.round).join(",");c.searchParams.set("rect",p),c.searchParams.set("w",o.toString()),c.searchParams.set("h",a.toString())}return l&&(c.searchParams.set("w",o.toString()),c.searchParams.set("h",a.toString())),c.toString()}function sRe(e){const{edit:{crop:{x:t,y:n},zoom:r},width:i,height:o,origin:{width:a,height:s}}=e;let u,c;const l=a/s,d=i/o;return d>=l?(u=a/r,c=u/d):(c=s/r,u=c*d),{x:t,y:n,width:i,height:o,zoom:r,cropWidth:u,cropHeight:c}}function uRe(e){const{selectedImage:t,imageCrop:n,setImageCrop:r}=e,{width:i,height:o,zoom:a,cropHeight:s,cropWidth:u}=n,c=t.contentView,l={x:n.x,y:n.y,width:u,height:s},[d,p]=$.useState(),A=(c==null?void 0:c.origin.url)??"",m=!(t!=null&&t.thumbnail.height&&(t!=null&&t.thumbnail.width));function v(g,S){const y=parseInt(S);isNaN(y)||y<=0||!m||r({...n,[g]:y})}function _(g){r({...n,cropWidth:g.width,cropHeight:g.height,x:g.x,y:g.y})}function C(g){r({...n,zoom:g})}function I(){p(qh),r({...n,...qh})}function x(){c&&(p(qh),r({...n,...qh,zoom:1,cropWidth:c.width,cropHeight:c.height}))}return f.jsxs(h.Box,{padding:{inline:24,block:16},flexDirection:"column",gap:16,height:"100%",overflowY:"auto",alignItems:"center",children:[f.jsxs(h.Box,{gap:8,height:32,alignItems:"flex-start",width:"100%",children:[f.jsx(h.Tooltip,{content:"Center",children:f.jsx(h.Button,{color:"grey",size:"medium",startIcon:"centerFocusWeak",onClick:I})}),f.jsx(h.Tooltip,{content:"Cover",children:f.jsx(h.Button,{color:"grey",size:"medium",startIcon:"zoomOutMap",onClick:x})}),f.jsx(h.Separator,{orientation:"vertical"}),f.jsx(h.FormInput,{prefix:"W",prefixTooltip:"Width",placeholder:"width",type:"number",size:"medium",value:String(i),onValueChange:g=>v("width",g),sx:{width:100},disabled:!m}),f.jsx(h.FormInput,{prefix:"H",prefixTooltip:"Height",placeholder:"height",type:"number",size:"medium",value:String(o),onValueChange:g=>v("height",g),sx:{width:100},disabled:!m})]}),f.jsx(h.Cropper,{image:A,aspect:i/o,crop:d??{x:0,y:0},onCropChange:p,zoom:a,onZoomChange:C,onCropAreaChange:(g,S)=>_(S),initialCroppedAreaPixels:l}),f.jsx(h.Box,{width:"100%",maxWidth:320,children:f.jsx(h.Slider,{min:1,max:3,step:.01,value:[a],onValueChange:([g])=>C(g??1)})})]})}const qh={x:0,y:0};function cRe(e){const{trigger:t,initialImages:n,renderTooltip:r}=e,{open:i,onOpenChange:o,ready:a,option:s,selectedImage:u,croppedImage:c,setCroppedImage:l,setReady:d,setOption:p}=lRe(e);return f.jsxs(h.Dialog,{trigger:t,onAnimationEnd:()=>d(!0),open:i,onOpenChange:o,renderTooltip:r,children:[f.jsx(h.DialogHeader,{icon:"photo",title:"Image editor"}),f.jsx(h.DialogOptions,{value:String(s),onValueChange:A=>p(Number(A)),children:n.map((A,m)=>f.jsx(h.DialogOptionsItem,{value:String(m),icon:"photo",title:A.labels[0]??"Main",subtitle:A.labels[1]??""},A.thumbnail.name))}),u&&f.jsx(h.DialogContent,{children:a&&c&&f.jsx(uRe,{selectedImage:u,imageCrop:c,setImageCrop:l},u.thumbnail.name)})]})}function lRe(e){const{initialImages:t,initialOption:n,onClose:r}=e,[i,o]=$.useState(_),[a,s]=$.useState(!1),[u,c]=$.useState(!1),[l,d]=$.useState(n);function p(C){C?(d(n),o(_())):(c(!1),r({option:l,croppedImages:i})),s(C)}const A=t[l],m=i[(A==null?void 0:A.thumbnail.name)??""];function v(C){if(!A)return;const I=A.thumbnail.name;o({...i,[I]:C})}function _(){return t.reduce((C,I)=>(I.contentView&&(C[I.thumbnail.name]=sRe(I.contentView)),C),{})}return{open:a,ready:u,option:l,selectedImage:A,croppedImage:m,setCroppedImage:v,setReady:c,setOption:d,onClose:r,onOpenChange:p}}function fRe(e){const{readOnly:t,altText:n,selected:r,onValueChange:i}=e,o=$.useId();return f.jsxs(h.Field,{selected:r,children:[f.jsx(h.FieldLabel,{htmlFor:o,children:"Alt text"}),f.jsx(h.FieldControl,{children:f.jsx(h.Box,{flexGrow:1,height:40,children:f.jsx(Qs,{id:o,placeholder:"Short description for the visually impaired",readOnly:t,value:n,padding:{input:{inline:12}},onValueChange:i})})})]})}function dRe(e){const{fieldLabel:t,imageLabel:n,initialImages:r,page:i,displaySeparator:o=!0,isSVGContentView:a,visibility:s,onClear:u,onCropperDialogClose:c,onMediaDialogOpenChange:l}=e;return f.jsxs(h.Box,{display:"flex",flexDirection:"column",gap:12,children:[f.jsxs(h.Box,{display:"flex",alignItems:"center",justifyContent:"space-between",flexWrap:"wrap",gap:4,children:[f.jsx(U7,{fieldLabel:t,imageLabel:n}),f.jsxs(h.CardHeaderActions,{sx:{visibility:s},children:[f.jsx(cRe,{trigger:f.jsx(h.Button,{startIcon:"crop",disabled:a,hiddenLabel:"Crop & Resize"}),renderTooltip:d=>f.jsx(h.Tooltip,{content:"Crop & Resize",children:d}),initialImages:r,initialOption:i,onClose:c}),f.jsx(h.Tooltip,{content:"Replace",children:f.jsx(h.Button,{startIcon:"imageSearch",hiddenLabel:"Replace",onClick:()=>l(!0)})}),f.jsx(h.Tooltip,{content:"Clear",children:f.jsx(h.Button,{onClick:u,startIcon:"delete",hiddenLabel:"Clear"})})]})]}),o&&f.jsx(h.Separator,{style:"dashed",decorative:!0})]})}function ju(e){const{description:t,largeIconName:n="public",loading:r,error:i,onEdit:o,onUnlink:a}=e,s=i?f.jsx(gRe,{}):f.jsx(mRe,{...e,largeIconName:n,loading:r});return f.jsx(h.Card,{sx:{width:420},children:f.jsxs(h.CardContent,{gap:12,children:[f.jsxs(h.Box,{display:"grid",gridTemplateColumns:"max-content 1fr min-content",gridTemplateRows:"1fr",gap:8,children:[s,f.jsxs(h.ButtonGroup,{size:"medium",color:"grey",sx:{justifySelf:"end"},children:[o&&f.jsx(h.Button,{startIcon:"edit",onClick:o}),a&&f.jsx(h.Button,{startIcon:"linkOff",onClick:a})]})]}),!i&&f.jsx(hRe,{description:t,loading:r})]})})}function pRe(e){const{url:t,title:n,loading:r}=e;return r?f.jsx(q7,{height:16,width:80}):n?f.jsx(h.Text,{variant:"smallBold",href:t==null?void 0:t.toString(),children:n}):null}function ARe(e){const{subTitle:t,loading:n}=e;return n?f.jsx(h.Box,{padding:{block:2},children:f.jsx(q7,{height:12,width:60})}):t?f.jsx(h.Text,{variant:"small",color:"grey11",noWrap:!0,children:t}):null}function hRe(e){const{description:t,loading:n}=e;return!t||n?null:f.jsx(h.Text,{variant:"small",color:"grey11",children:t})}function mRe(e){const{largeIconName:t,title:n,url:r,loading:i,subTitle:o}=e;return f.jsxs(f.Fragment,{children:[f.jsx(h.ConjoinedIcons,{largeIconName:t,smallIconName:"link"}),f.jsxs(h.Box,{flexDirection:"column",minWidth:0,children:[f.jsx(pRe,{title:n,url:r,loading:i}),f.jsx(ARe,{subTitle:o,loading:i})]})]})}function gRe(){return f.jsxs(h.Box,{alignItems:"center",gap:8,children:[f.jsx(h.CircleIcon,{name:"alert",color:"tomato",size:"small"}),f.jsx(h.Text,{color:"tomato11",children:"Failed to load linked document data"})]})}function q7(e){const{width:t,height:n}=e;return f.jsx(h.Skeleton,{color:"grey5",borderRadius:6,width:t,height:n})}function vRe(e){const{documentType:t,documentUrl:n,title:r,statusColor:i,description:o,tags:a,tagsFilter:s,previewImageUrl:u,onSelect:c}=e;function l(d){return d.nativeEvent instanceof MouseEvent&&(d.metaKey||d.ctrlKey)?window.open(n,"_blank"):c()}return f.jsxs(h.Card,{paddingBlock:16,onSelect:l,children:[f.jsx(h.CardContent,{children:f.jsxs(h.Box,{justifyContent:"space-between",children:[f.jsxs(h.Box,{flexDirection:"column",gap:4,alignItems:"flex-start",flexGrow:1,children:[f.jsx(yRe,{documentType:t}),f.jsx(bRe,{title:r,statusColor:i}),f.jsx(CRe,{description:o})]}),f.jsx(SRe,{previewImageUrl:u})]})}),a.length>0&&f.jsx(_Re,{tags:a,tagsFilter:s})]})}function yRe(e){const{documentType:t}=e;return f.jsx(h.Badge,{maxWidth:150,size:"medium",title:`Type: ${t}`,icon:"description"})}function bRe(e){const{title:t,statusColor:n}=e;return f.jsxs(h.Box,{gap:8,alignItems:"center",children:[f.jsx(h.Dot,{color:n}),f.jsx(h.Text,{variant:"bold",children:t})]})}function CRe(e){const{description:t}=e,n=t==null?void 0:t.substring(0,150);return n?f.jsx(h.Text,{variant:"small",color:"grey11",children:`${n}${n!==t?"...":""}`}):f.jsx(h.Text,{variant:"smallItalic",color:"grey11",children:"No description available"})}function SRe(e){const{previewImageUrl:t}=e;return f.jsx(h.Box,{width:142,height:90,backgroundColor:"grey2",border:!0,borderRadius:6,flexDirection:"column",alignItems:"center",justifyContent:"center",gap:4,flexShrink:0,padding:8,children:t?f.jsx(h.Image,{src:t,sizing:"cover"}):f.jsxs(f.Fragment,{children:[f.jsx(h.Icon,{name:"hideImage",size:"large",color:"grey11"}),f.jsx(h.Text,{color:"grey11",variant:"small",children:"No preview available"})]})})}function _Re(e){const{tags:t}=e;return f.jsxs(h.CardFooter,{children:[f.jsxs(h.Box,{gap:4,alignItems:"center",children:[f.jsx(h.Icon,{name:"label",size:"small",color:"grey11"}),f.jsx(h.Text,{variant:"small",color:"grey11",children:"Tags:"})]}),f.jsx(h.TextOverflow,{children:t.map(n=>f.jsx(h.Badge,{size:"medium",title:n,sx:{marginRight:8}},n))})]})}function IRe(e){var g,S;const{searchTerm:t,tagsFilter:n,typesFilter:r,localesFilter:i}=e,o=Ee();o.searchDocuments||Jt("searchDocuments");const{coreApiBaseUrl:a,documentSearchBaseUrl:s,authStrategy:u,status:c,repository:l}=o,{storageVersion:d}=Ve.useRequest(q0,[a,u]),p=d.major>=7;function A(){return p?Kq({repository:l,searchTerm:t,customTypesIds:[...Fn.map(r,y=>y.id)],tags:[...Fn.map(n,y=>y.id)],localeId:[...Fn.map(i,y=>y.id)][0]}):BR({tags:[...Fn.map(n,y=>y.id)],customTypes:[...Fn.map(r,y=>y.id)],language:[...Fn.map(i,y=>y.id)],term:[t]})}const[m,v]=$.useState([]),[_,C]=$.useState(""),I=A(),x=Ve.useRequest(V7,[a,s,u,I,c,p]);return I!==_?(C(I),v(x.results)):x.results.length>0&&((g=Qt.last(m))==null?void 0:g.id)!==((S=Qt.last(x.results))==null?void 0:S.id)&&v(y=>y.concat(x.results)),{documents:m,response:x}}Ve.cache.registerFetcherConfig(V7,{cacheCapacity:500,revalidationStrategy:{type:"never"}});async function V7(e,t,n,r,i,o){const a=xq[i];if(!o){const l=await UR(e,n,r,200);return tk(l.results,a)}const s=await Dq(t,n,r),u=await qq(e,n,s.results);return tk(u,a)}function tk(e,t){return{results:e.flatMap(r=>{const i=r.versions.filter(o=>t.includes(o.status));return i.length===0?[]:{...r,versions:i}})}}function nk(){const e=Ee();e.searchDocuments||Jt("searchDocuments");const{coreApiBaseUrl:t,authStrategy:n}=e,r=Ve.useRequest(q0,[t,n]);return new Set(r.languages.map(i=>({id:i.id,label:i.name})))}function TRe(){const e=Ee();e.searchDocuments||Jt("searchDocuments");const{coreApiBaseUrl:t,authStrategy:n}=e,r=Ve.useRequest(Gq,[t,n]);return new Set(r.results.map(i=>({id:i,label:i})))}function xRe(){const e=Ee();e.searchDocuments||Jt("searchDocuments");const{customTypesApiBaseUrl:t,repository:n,authStrategy:r}=e,i=Ve.useRequest(Bq,[t,n,r]);return new Set(i)}function wRe(e,t){const n=Ee(),r=Ne.useDebounceState({initialState:""}),[i,o]=$.useState(new Set),[a,s]=$.useState(new Set);function u(){return!n.searchDocuments||!n.localeId?new Set:new Set([{id:n.localeId,label:n.localeId}])}const[c,l]=$.useState(u),d=Fn.union(a,Km(e)),p=Fn.union(i,Km(t));return{searchTerm:r,filteredTags:i,setFilteredTags:o,filteredCustomTypes:a,setFilteredCustomTypes:s,filteredLocales:c,setFilteredLocales:l,typesFilter:d,tagsFilter:p}}function Km(e){return e?Fn.map(e,t=>({id:t,label:t})):new Set}function ERe(e){const{filteredLocales:t,setFilteredLocales:n,filteredTags:r,setFilteredTags:i,filteredCustomTypes:o,setFilteredCustomTypes:a,fixedTags:s,fixedCustomTypes:u}=e;return f.jsxs(f.Fragment,{children:[f.jsx(RRe,{selectedValues:t,onSelectedValuesChange:n}),f.jsx(lC,{selectedValues:r,fixedSelectedValues:Km(s),onSelectedValuesChange:i,label:"Tags",icon:"label",fetchFilters:TRe}),f.jsx(lC,{selectedValues:o,fixedSelectedValues:Km(u),onSelectedValuesChange:a,label:"Type",icon:"description",fetchFilters:xRe})]})}function lC(e){const[t,n]=$.useState(!1),r=$.useRef(null);return f.jsx(h.ErrorBoundary,{ref:r,renderError:()=>{var i;return f.jsx(h.FilterField,{mode:"error",onErrorRetry:(i=r.current)==null?void 0:i.reset,open:t,setOpen:n,values:new Set,...e})},children:f.jsx($.Suspense,{fallback:f.jsx(h.FilterField,{mode:"loading",open:t,setOpen:n,values:new Set,...e}),children:f.jsx($Re,{open:t,setOpen:n,...e})})})}function $Re(e){const{open:t,setOpen:n,onSelectedValuesChange:r,fixedSelectedValues:i,selectedValues:o,label:a,icon:s,fetchFilters:u,multiple:c}=e,l=u();return f.jsx(h.FilterField,{open:t,setOpen:n,label:a,icon:s,selectedValues:o,values:new Set(l),fixedSelectedValues:i,onSelectedValuesChange:r,multiple:c})}function RRe(e){const{selectedValues:t,onSelectedValuesChange:n}=e,[r,i]=$.useState(Fn.first(t));function o(s){n(s),i(Fn.first(s))}const a=Fn.find(nk(),s=>{var u;return s.id===((u=Fn.first(t))==null?void 0:u.id)});return(a==null?void 0:a.label)!==(r==null?void 0:r.label)&&i(a),f.jsx(lC,{selectedValues:new Set(r?[r]:[]),onSelectedValuesChange:o,label:"Locale",icon:"public",fetchFilters:nk,multiple:!1})}function Q7(e){const{onSelectDocument:t,fixedCustomTypes:n,fixedTags:r,...i}=e,o=Ee(),{searchTerm:a,filteredTags:s,setFilteredTags:u,filteredCustomTypes:c,setFilteredCustomTypes:l,filteredLocales:d,setFilteredLocales:p,typesFilter:A,tagsFilter:m}=wRe(n,r),[v,_]=$.useTransition();return f.jsx(h.Dialog,{size:{height:727,width:656},hasClose:!1,...i,children:f.jsx(h.DialogContent,{children:f.jsxs(h.Box,{flexDirection:"column",height:"100%",children:[f.jsxs(h.Box,{padding:{top:16,inline:16,bottom:8},flexDirection:"column",gap:12,children:[f.jsx(h.FormInput,{value:a.value,onValueChange:a.set,placeholder:"Search a page",icon:"search"}),o.searchDocuments&&f.jsx(ERe,{filteredTags:s,setFilteredTags:u,filteredCustomTypes:c,setFilteredCustomTypes:l,filteredLocales:d,setFilteredLocales:p,fixedTags:r,fixedCustomTypes:n}),f.jsx(h.Text,{variant:"smallBold",color:"grey11",children:"Link to a document"})]}),o.searchDocuments?f.jsx(h.ErrorBoundary,{renderError:ORe,children:f.jsx($.Suspense,{fallback:f.jsx(kRe,{}),children:f.jsx(FRe,{searchTerm:a.debouncedValue,tagsFilter:m,typesFilter:A,localesFilter:d,startTransition:_,isLoadingDocuments:v,onSelectDocument:t})})}):f.jsx(z7,{message:"Slice Machine does not yet support mock data for linked documents in the simulator."})]})})})}function ORe(){return f.jsx(h.Box,{height:"100%",flexDirection:"column",alignItems:"center",justifyContent:"center",children:f.jsx(h.DefaultErrorMessage,{title:"Request failed",description:"An error occurred while fetching documents.",errorImageSrc:h.dialogErrorImage})})}function FRe(e){const{searchTerm:t,tagsFilter:n,typesFilter:r,localesFilter:i,isLoadingDocuments:o,onSelectDocument:a}=e,{documents:s}=IRe({searchTerm:t,tagsFilter:n,localesFilter:i,typesFilter:r}),u=Ee();return f.jsxs(h.ScrollArea,{style:{flexGrow:1,paddingTop:h.theme.space[10],paddingBottom:h.theme.space[16],paddingInline:h.theme.space[16],display:"flex",flexDirection:"column",gap:h.theme.space[12]},children:[s.length===0&&f.jsx(z7,{}),s.map(c=>{const l=c.versions[0];if(!l)return null;const d=MR({documentId:c.id,versionId:l.status==="archived"?l.version_id:void 0,releaseId:l.status==="release"?l.release_id:void 0,status:l.status,baseUrl:u.baseUrl}),p=MRe({tags:l.tags,tagsFilter:n});return f.jsx(vRe,{documentType:l.custom_type_label,documentUrl:d,description:l.preview_summary,tags:p,title:c.title,previewImageUrl:l.preview_image,onSelect:()=>a(c.id),statusColor:Tq[l.status].color},`${c.id}-${l.status}`)}),f.jsx(h.AnimatedElement,{animation:{name:"fade"},children:o&&f.jsx(h.Text,{color:"grey11",align:"center",sx:{marginBlock:8},children:"Loading more results ..."})})]})}function z7(e){const{message:t="We can't find any versions matching this request"}=e,n="Oops!";return f.jsx(h.Box,{justifyContent:"center",flexDirection:"column",height:"100%",children:f.jsxs(h.BlankSlate,{children:[f.jsx(h.BlankSlateIcon,{name:"close",lineColor:"purple10",backgroundColor:"purple3",borderColor:"purple6",borderStyle:"dashed",size:"xlarge"}),f.jsx(h.BlankSlateTitle,{size:"big",children:n}),f.jsx(h.BlankSlateDescription,{width:360,children:t})]})})}function kRe(){return f.jsx(h.Box,{flexDirection:"column",gap:12,padding:{top:10,inline:16,bottom:16},children:Qt.range(1,5).map(e=>f.jsx(h.Skeleton,{height:150},e))})}function MRe(e){const{tags:t,tagsFilter:n}=e,r=[...n].map(o=>o.label).reverse();return Qt.sort(t,o=>-r.indexOf(o))}function H7(e){const{hasLink:t,onUnlink:n,selectEnabled:r,selectedType:i,value:o,onOpenLinkModal:a,onValueChange:s,openInNewTab:u=!0,condensedButtons:c=!1,showNewTabButton:l=!1,displayTextEnabled:d}=e;return f.jsxs(f.Fragment,{children:[!d&&l&&u&&f.jsx(h.Badge,{title:"Open in a new tab",color:"indigo",size:"small",icon:"openInNew",onClick:a}),!t&&r&&f.jsxs(h.Select,{value:i==="any"?void 0:i,color:"grey",size:"small",boldTriggerText:!0,position:"popper",sideOffset:4,startIcon:im({selectType:i}),disabled:!r,onValueChange:s,placeholder:c?"":Xc("any"),onlyStartIcon:c&&i!==void 0,renderTrigger:({button:p})=>f.jsx(h.Tooltip,{content:Xc(i),visible:c,children:p}),children:[f.jsx(h.SelectItem,{value:"web",icon:"public",children:Xc("web")}),f.jsx(h.SelectItem,{value:"document",icon:"description",children:Xc("document")}),f.jsx(h.SelectItem,{value:"media",icon:"image",children:Xc("media")})]},i===void 0?"unlinked":"linked"),!t&&!r&&f.jsx(h.Button,{startIcon:im({selectType:i}),color:"grey",textColor:"link",textWeight:"normal",size:"small",onClick:a,children:Xc(i)}),t&&!d&&f.jsx(h.Button,{startIcon:"close",color:"grey",size:"small",onClick:n,"aria-label":"Close"}),t&&d&&f.jsxs(h.ButtonGroup,{density:"compact",children:[f.jsx(h.Button,{startIcon:im({selectType:i}),renderEndIcon:()=>u&&i==="web"?f.jsx(h.Icon,{name:"openInNew",size:"extraSmall",color:"indigo11"}):null,color:"grey",textColor:"link",textWeight:"normal",size:"small",disabled:!t,onClick:a,children:o.length>30?`${o.slice(0,30)}...`:o}),f.jsx(h.Button,{startIcon:"close",color:"grey",size:"small",onClick:n})]})]})}function Xc(e){if(!e||e==="any")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"}}function Y7(e){const{onEdit:t,onUnlink:n,url:r,title:i,subTitle:o}=e;return f.jsx(h.Card,{paddingBlock:16,children:f.jsxs(h.CardContent,{sx:{width:433},children:[f.jsx(jRe,{url:r,title:i,subTitle:o,onEdit:t,onUnlink:n}),r&&f.jsx(h.CheckerBoard,{children:f.jsx(LRe,{children:f.jsx(h.Image,{src:r,alt:i,sizing:"contain"})})})]})})}function LRe(e){const{children:t}=e;return f.jsx(h.Box,{flexDirection:"column",alignItems:"center",justifyContent:"center",position:"relative",height:327,children:t})}function jRe(e){const{url:t,title:n,subTitle:r,onEdit:i,onUnlink:o}=e;return f.jsxs(h.Box,{flexDirection:"row",justifyContent:"space-between",gap:8,children:[f.jsxs(h.Box,{gap:8,minWidth:0,children:[f.jsx(h.ConjoinedIcons,{largeIconName:"image",smallIconName:"link"}),f.jsxs(h.Box,{flexDirection:"column",minWidth:0,children:[f.jsx(h.Text,{noWrap:!0,variant:"smallBold",href:t,inline:!0,children:n}),f.jsx(h.Text,{variant:"small",color:"grey11",children:r})]})]}),f.jsxs(h.ButtonGroup,{size:"medium",color:"grey",children:[i&&f.jsx(URe,{onEdit:i}),o&&f.jsx(BRe,{onUnlink:o})]})]})}function URe(e){const{onEdit:t}=e;return f.jsx(h.Tooltip,{content:"Edit link",side:"top",stableMount:!0,zIndexHack:!0,children:f.jsx(h.Button,{startIcon:"edit",onClick:t})})}function BRe(e){const{onUnlink:t}=e;return f.jsx(h.Tooltip,{content:"Remove link",side:"top",stableMount:!0,zIndexHack:!0,children:f.jsx(h.Button,{startIcon:"linkOff",onClick:t})})}function PRe(e){var w,O;const{field:t,content:n,onContentChange:r}=e,i=v(),o=((w=t.config)==null?void 0:w.allowText)??!1,a=o&&(n==null?void 0:n.value.text)||void 0,[s,u]=$.useState(m),c=Ce.FilledExternalLinkContent.is(n==null?void 0:n.value)&&(n==null?void 0:n.value.target)||void 0,[l,d]=$.useState(!1),p=$.useRef(null);Ne.useOnChange(i,y);const A=s?WRe[s]:void 0;function m(){var E,F;return!((E=t.config)!=null&&E.select)||n!=null&&n.value.__TYPE__?n==null?void 0:n.value.__TYPE__:rk[(F=t.config)==null?void 0:F.select]}function v(){return n?Ce.FilledDocumentLinkContent.is(n.value)?n.value.id:Ce.FilledExternalLinkContent.is(n.value)?n.value.url:Ce.FilledFileLinkContent.is(n.value)||Ce.FilledImageLinkContent.is(n.value)?n.value.name:"":""}function _(E){var F;if(!E)return r(void 0);switch((F=t.config)==null?void 0:F.select){case"web":return r({__TYPE__:"LinkContent",value:{__TYPE__:"ExternalLink",kind:"web",text:E}});case"document":return r({__TYPE__:"LinkContent",value:{__TYPE__:"DocumentLink",kind:"document",text:E}});case"media":return r({__TYPE__:"LinkContent",value:{__TYPE__:"MediaLink",kind:"media",text:E}});default:return r({__TYPE__:"LinkContent",value:{__TYPE__:"AnyLink",text:E}})}}function C(E,F){if(!E)return _(a);const W=F?"_blank":void 0;switch(s){case"ExternalLink":return r({__TYPE__:"LinkContent",value:{__TYPE__:"ExternalLink",url:E,target:W,text:a}});case"DocumentLink":return r({__TYPE__:"LinkContent",value:{__TYPE__:"DocumentLink",id:E,text:a}});default:return r(void 0)}}function I(E){return n?r({__TYPE__:n.__TYPE__,value:{...n.value,text:E}}):_(E)}function x(E){u(E?rk[E]:void 0),C("")}function g(E){C(E)}function S(){d(!0)}function y(){var E;l&&(d(!1),(E=p.current)==null||E.reset())}function T(E){const F=J7({media:E});switch(F.value.__TYPE__){case"ImageLink":return r({__TYPE__:F.__TYPE__,value:{...F.value,text:a}});case"FileLink":return r({__TYPE__:F.__TYPE__,value:{...F.value,text:a}})}}return{contentType:s,selectType:A,fieldValue:i,onDisplayTextChange:I,onValueChange:C,onTypeChange:x,placeholder:Wc(t),isTypeSelectEnabled:!((O=t.config)!=null&&O.select),onDocumentSelected:g,onError:S,errorBoundaryRef:p,isTargetNewTab:c==="_blank",onMediaSelected:T,displayTextEnabled:o,displayText:a??""}}const WRe={AnyLink:"any",DocumentLink:"document",ExternalLink:"web",FileLink:"media",ImageLink:"media",MediaLink:"media"},rk={any:"AnyLink",document:"DocumentLink",web:"ExternalLink",media:"FileLink"};function DRe(e){const t=Ee();t.searchDocuments||Jt("searchDocuments");const{coreApiBaseUrl:n,authStrategy:r}=t;return Ve.useRequest(G7,[n,r,e]).title}const KRe=Ap({id:Yo(),title:Yo()});function G7(e,t,n){return pe.request(new URL(`documents/${n}`,e),{credentials:pe.getRequestCredentials(t),okType:KRe})}Ve.cache.registerFetcherConfig(G7,{concurrency:50});function J7(e){var i,o,a,s,u,c;const{media:t}=e,n="kind"in t;return n&&t.kind==="image"?{__TYPE__:"LinkContent",value:{__TYPE__:"ImageLink",id:t.id,name:t.filename,url:t.url,kind:t.kind,size:t.size.toString(),height:((i=t.height)==null?void 0:i.toString())??`${es}`,width:((o=t.width)==null?void 0:o.toString())??`${es}`,date:((a=t.last_modified)==null?void 0:a.toString())??""}}:n?{__TYPE__:"LinkContent",value:{__TYPE__:"FileLink",id:t.id,name:t.filename,kind:t.kind,url:t.url,size:t.size.toString(),date:((s=t.last_modified)==null?void 0:s.toString())??""}}:{__TYPE__:"LinkContent",value:{__TYPE__:"ImageLink",id:t.id,name:(t==null?void 0:t.alt)??t.url,kind:"image",url:t.url,size:"0",height:((u=t.height)==null?void 0:u.toString())??`${es}`,width:((c=t.width)==null?void 0:c.toString())??`${es}`}}}function NRe(e){const{open:t,setOpen:n,showNewTabButton:r}=e,{url:i,setUrl:o,openInNewTab:a,setOpenInNewTab:s,disabled:u,onUpdate:c}=qRe(e);return f.jsxs(h.Dialog,{open:t,onOpenChange:n,size:"small",children:[f.jsx(h.DialogHeader,{title:"Set Link URL"}),f.jsxs(h.DialogContent,{padding:16,children:[f.jsx(h.FormInput,{value:i,onValueChange:o,placeholder:"Paste URL",icon:"public"}),r&&f.jsx(h.InlineLabel,{value:"Open in a new tab",children:f.jsx(h.Checkbox,{checked:a,onCheckedChange:s})})]}),f.jsxs(h.DialogActions,{children:[f.jsx(h.DialogCancelButton,{}),f.jsx(h.DialogActionButton,{onClick:c,disabled:u,children:"Update"})]})]})}function qRe(e){const{url:t,openInNewTab:n,onUpdate:r,open:i,setOpen:o}=e,[a,s]=$.useState(t),[u,c]=$.useState(n);Ne.useOnChange(i,()=>{i&&(s(t),c(n))});const l=!a||a===t&&u===n;function d(){r(a,u),o(!1)}return{url:a,setUrl:s,openInNewTab:u,disabled:l,setOpenInNewTab:c,onUpdate:d}}function Z7(e){var ee,re,P,Y;const{content:t,field:n,id:r,onContentChange:i,condensedButtons:o=!1}=e,[a,s]=$.useState(!1),[u,c]=$.useState(!1),[l,d]=$.useState(),{contentType:p,fieldValue:A,errorBoundaryRef:m,onDocumentSelected:v,onError:_,onMediaSelected:C,onValueChange:I,selectType:x,onTypeChange:g,isTypeSelectEnabled:S,displayTextEnabled:y,...T}=PRe({content:t,field:n,onContentChange:i});Ne.useOnChange(l,()=>{x!==void 0&&!l&&!A&&S&&g(void 0)});const w=a||u,O=p==="DocumentLink"&&A!=="",F=p==="ExternalLink"&&Fr.toURL(A),W=!!((ee=n.config)!=null&&ee.allowTargetBlank),K={...T,id:r,onBlur:()=>s(!1),onFocus:()=>{s(!0)},onOpenLinkModal:()=>{switch(s(!0),p){case"DocumentLink":return d("document");case"ExternalLink":return d("web");case"FileLink":case"ImageLink":case"MediaLink":return d("media");default:return d(void 0)}},onUnlink:()=>{S?g(void 0):I("")},onSelectValueChange:M=>{g(M),d(M)},value:A,condensedButtons:o,allowTargetBlank:W,selectType:x,onValueChange:I,isTypeSelectEnabled:S,displayTextEnabled:y},{searchDocuments:J}=Ee();return f.jsxs(f.Fragment,{children:[f.jsxs(h.Popover,{onMouseOverChange:c,open:w,align:"start",sideOffset:-3,openDelay:100,closeDelay:200,focusOnEnter:!1,anchor:f.jsxs(h.Field,{onMouseOverChange:s,children:[f.jsx(h.FieldIcon,{name:im({selectType:x,displayTextEnabled:y})}),f.jsx(h.FieldLabel,{htmlFor:r,children:nr(n)}),f.jsx(h.FieldControl,{children:O&&J?f.jsx(YRe,{errorBoundaryRef:m,onError:_,fallback:f.jsx(fC,{...K,value:"..."}),renderError:()=>VRe(K),children:f.jsx(HRe,{...K,documentId:A})}):f.jsx(fC,{...K})})]}),children:[F&&f.jsx(ju,{url:F,title:Fr.getUrlTitle(F)??"",subTitle:F.toString()}),t&&Ce.FilledImageLinkContent.is(t.value)&&f.jsx(Y7,{url:t.value.url,title:t.value.name,subTitle:`${t.value.width} x ${t.value.height} pixels`})]}),f.jsx(NRe,{open:l==="web",setOpen:M=>d(M?"web":void 0),url:A,openInNewTab:T.isTargetNewTab,showNewTabButton:!!((re=n.config)!=null&&re.allowTargetBlank),onUpdate:(M,k)=>I(M,k)}),f.jsx(qR,{open:l==="media",onOpenChange:M=>d(M?"media":void 0),onMediaSelected:C,assetType:"all"}),f.jsx(Q7,{open:l==="document",onOpenChange:M=>d(M?"document":void 0),onSelectDocument:M=>{d(void 0),v(M)},fixedCustomTypes:new Set((P=n.config)==null?void 0:P.customtypes),fixedTags:new Set((Y=n.config)==null?void 0:Y.tags)})]})}function VRe(e){return f.jsx(fC,{...e})}function QRe(e){return{onValueChange:e.displayTextEnabled?e.onDisplayTextChange:e.onValueChange,placeholder:e.displayTextEnabled?"Add your display text":e.placeholder,readOnly:!e.displayTextEnabled,value:e.displayTextEnabled?e.displayText:e.value,variant:e.displayTextEnabled?"normal":"link",onFocus:e.displayTextEnabled?e.onFocus:e.onOpenLinkModal,cursor:X7({displayTextEnabled:e.displayTextEnabled,isTypeSelectEnabled:e.isTypeSelectEnabled,value:e.value})}}function fC(e){const{id:t,value:n,onOpenLinkModal:r,onBlur:i,isTypeSelectEnabled:o,selectType:a,onSelectValueChange:s,onUnlink:u,isTargetNewTab:c,condensedButtons:l,allowTargetBlank:d,displayTextEnabled:p}=e,A=QRe(e);return f.jsx(Qs,{id:t,...A,onBlur:i,textOverflow:"ellipsis",endAdornment:f.jsx(H7,{hasLink:!!(n&&a),onUnlink:u,selectEnabled:o,selectedType:a,value:n,onOpenLinkModal:r,onValueChange:s,openInNewTab:c,condensedButtons:l,showNewTabButton:d&&a==="web",displayTextEnabled:p})})}function zRe(e,t){return{onValueChange:e.displayTextEnabled?e.onDisplayTextChange:void 0,placeholder:e.displayTextEnabled?"Add your display text":void 0,readOnly:!e.displayTextEnabled,value:e.displayTextEnabled?e.displayText:t,variant:e.displayTextEnabled?"normal":"link",onFocus:e.displayTextEnabled?e.onFocus:e.onOpenLinkModal,cursor:X7({displayTextEnabled:e.displayTextEnabled,isTypeSelectEnabled:e.isTypeSelectEnabled,value:t})}}function HRe(e){const{id:t,documentId:n,onOpenLinkModal:r,isTypeSelectEnabled:i,selectType:o,displayTextEnabled:a,condensedButtons:s,onSelectValueChange:u,onUnlink:c}=e,l=DRe(n),d=zRe(e,l);return f.jsx(Qs,{id:t,...d,textOverflow:"ellipsis",endAdornment:f.jsx(H7,{hasLink:!0,onUnlink:c,selectEnabled:i,selectedType:o,value:l,onOpenLinkModal:r,condensedButtons:s,onValueChange:u,displayTextEnabled:a})})}function YRe(e){const{errorBoundaryRef:t,onError:n,children:r,fallback:i,renderError:o}=e;return f.jsx(h.ErrorBoundary,{ref:t,onError:n,renderError:o,children:f.jsx($.Suspense,{fallback:i,children:r})})}function im(e){const{selectType:t,displayTextEnabled:n}=e;if(n)return"notes";switch(t){case"document":return"description";case"web":return"public";case"media":return"image";default:return"link"}}function X7(e){const{displayTextEnabled:t,isTypeSelectEnabled:n,value:r}=e;return t?"text":n&&!r?"default":"pointer"}function GRe(e){const{onContentChange:t,...n}=e;function r(i){const o=Ce.FilledLinkContent.is(i)?i:void 0;t(o)}return f.jsx(Z7,{...n,onContentChange:r})}function JRe(e){const{linkTo:t,onLinkToChange:n}=e;return f.jsx(GRe,{content:ZRe(t),onContentChange:r=>n(XRe(r)),field:{type:"Link",config:{label:"Link",allowTargetBlank:!0,allowText:!1}},condensedButtons:!0})}function ZRe(e){return e?{__TYPE__:"LinkContent",value:e}:void 0}function XRe(e){return e==null?void 0:e.value}function e8(e){var x,g;const{allContentViews:t,content:n,contentView:r,fieldLabel:i,imageLabel:o,initialImages:a,isUpdating:s,page:u=0,readOnly:c,thumbnailName:l,onClear:d,onContentChange:p,onCropperDialogClose:A,onPageChange:m,onMediaDialogOpenChange:v}=e,_=((g=(x=n==null?void 0:n.url)==null?void 0:x.split("?")[0])==null?void 0:g.slice(-4))===".svg",C=n!=null&&n.url&&!c?"visible":"hidden",I=!Ce.isImageContent(n);return f.jsxs(h.Box,{display:"flex",gap:12,padding:{inline:12},children:[f.jsx(h.Box,{children:f.jsx(h.Carousel,{getItemSource:REe,items:t,onPageChange:m,page:u,buttonSize:"small",renderPrevTooltip:S=>f.jsx(h.Tooltip,{content:"Previous",children:S}),renderNextTooltip:S=>f.jsx(h.Tooltip,{content:"Next",children:S}),style:I?{width:181,height:142}:{width:123,height:93},children:S=>(S==null?void 0:S.url)&&f.jsx(h.CarouselItem,{"aria-label":"Image Field Item",src:T7(S.url),alt:S.alt??void 0,isUpdating:s,disableAnimation:I},`${l}_${S.url}`)})}),f.jsxs(h.Box,{width:"100%",display:"flex",flexDirection:"column",gap:I?16:12,children:[f.jsx(dRe,{fieldLabel:i,imageLabel:o,initialImages:a,page:u,displaySeparator:!I,isSVGContentView:_,visibility:C,onClear:d,onCropperDialogClose:A,onMediaDialogOpenChange:v}),f.jsx(fRe,{readOnly:c||!r,altText:(r==null?void 0:r.alt)??"",onValueChange:S=>{r&&p(xEe(l,n,r,S))}}),I&&f.jsx(JRe,{linkTo:n.linkTo,onLinkToChange:S=>{p({...n,linkTo:S})}})]})]})}function eOe(e){const{content:t,onContentChange:n,field:r}=e,[i,o]=$.useState(0),[a,s]=$.useTransition(),u=IEe(r),c=u[i],l=t?TEe(r,t):void 0,d=l==null?void 0:l[i];function p(_){if(!c)return;const C=OEe(c.name,r,t,_);C!==t&&s(()=>n(C))}function A(_){s(()=>o(_))}function m({option:_,croppedImages:C}){if(o(_),!t)return;const I=Object.entries(C).reduce((x,[g,S])=>oRe({field:r,content:x,thumbnail:g,croppedImage:S}),t);I!==t&&s(()=>n(I))}function v(){o==null||o(0),n(void 0)}return{onCropperDialogClose:m,onPageChange:A,onMediaSelected:p,isUpdating:a,page:i,thumbnail:c,allThumbnails:u,allContentViews:l,contentView:d,onClear:v}}function tOe(e){const{content:t,field:n,readOnly:r,onContentChange:i}=e,o=t&&t.origin.url.length>0,{onCropperDialogClose:a,onPageChange:s,onMediaSelected:u,isUpdating:c,page:l,thumbnail:d,allThumbnails:p,allContentViews:A,contentView:m,onClear:v}=eOe({field:n,content:t,onContentChange:i}),[_,C]=$.useState(!1),I=nr(n),x=p.map((y,T)=>{const w=A==null?void 0:A[T];return{thumbnail:y,contentView:w,labels:sC(y,t,w)}}),g=d&&o?sC(d,t,m).filter(io.isDefined):[],S=d&&t&&o&&A;return f.jsx(D7,{isMediaDialogOpen:_,onMediaSelected:u,onMediaDialogOpenChange:C,children:f.jsx($.Suspense,{fallback:f.jsx("div",{style:{height:95}}),children:S?f.jsx(e8,{allContentViews:A,content:t,contentView:m,fieldLabel:I,imageLabel:g,initialImages:x,isUpdating:c,page:l,readOnly:r,thumbnailName:d.name,onClear:v,onContentChange:i,onCropperDialogClose:a,onMediaDialogOpenChange:C,onPageChange:s}):f.jsx(B7,{fieldLabel:I,isUpdating:c,readOnly:r,onMediaDialogOpenChange:C})})})}function nOe(e){var _,C;const{searchTerm:t,catalogId:n}=e,r=Ee();r.integrationFields||Jt("integrationFields");const{integrationFieldsApiBaseUrl:i,repository:o,authStrategy:a}=r,[s,u]=$.useState(1),[c,l]=$.useState([]),[d,p]=$.useState(""),A=Ve.useRequest(rOe,[i,a,o,n,t,t===d?s:1]);t!==d?(p(t),u(1),l(A.items)):A.items.length>0&&((_=Qt.last(c))==null?void 0:_.id)!==((C=Qt.last(A.items))==null?void 0:C.id)&&l(I=>I.concat(A.items));const m=s<A.totalPages;function v(){m&&u(I=>I+1)}return{items:c,response:A,fetchNextPage:v,hasNextPage:m}}function rOe(e,t,n,r,i,o=1,a=30){const s=new URL(`if/search/${r}`,e);return s.searchParams.set("searchTerm",i),s.searchParams.set("limit",a.toString()),s.searchParams.set("page",o.toString()),pe.request(s,{headers:{repository:n},credentials:pe.getRequestCredentials(t),okType:iOe})}const t8=L.object({id:L.string(),title:L.string(),imageURL:L.string().optional(),description:L.string().optional()}),iOe=L.object({items:L.array(t8),totalPages:L.number(),page:L.number()});function n8(e){const{itemId:t,catalogId:n}=e,r=Ee();r.integrationFields||Jt("integrationFields");const{integrationFieldsApiBaseUrl:i,repository:o,authStrategy:a}=r,u=Ve.useRequest(oOe,[i,a,o,n,t]).items[0];if(!u)throw new Error("Item not found");return{item:u}}function oOe(e,t,n,r,i){const o=new URL(`if/read/${r}`,e);return o.searchParams.set("ids",[i].toString()),pe.request(o,{headers:{repository:n},credentials:pe.getRequestCredentials(t),okType:aOe})}const aOe=L.object({items:L.array(t8)});function VR(e){const{item:t,onClick:n,catalogId:r}=e;return f.jsxs(h.PreviewCard,{variant:"large",onClick:n,children:[f.jsx(sOe,{src:t.imageURL??"",alt:t.title}),f.jsxs(h.PreviewContent,{children:[f.jsx(h.Badge,{title:`Catalog: ${r}`,icon:"multipleStop",size:"medium"}),f.jsx(h.Text,{variant:"bold",color:"grey12",sx:{marginTop:4},children:t.title}),f.jsx(h.Text,{variant:"small",color:"grey11",children:t.description??t.id})]})]})}const Vh=76;function sOe(e){const{src:t,alt:n}=e;return t?f.jsx(h.PreviewImage,{src:t,alt:n,width:Vh,height:Vh,framed:!0}):f.jsxs(h.Box,{borderRadius:6,backgroundColor:"grey2",height:Vh,width:Vh,flexDirection:"column",alignItems:"center",justifyContent:"center",border:!0,padding:{inline:4,block:8},children:[f.jsx(h.Icon,{name:"hideImage",size:"large",color:"grey11"}),f.jsx(h.Text,{color:"grey11",variant:"small",noSelect:!0,align:"center",children:"No preview image"})]})}function il(){return f.jsxs(h.PreviewCard,{variant:"large",children:[f.jsx(h.Skeleton,{height:76,width:76}),f.jsxs(h.PreviewContent,{children:[f.jsx(h.Skeleton,{height:24,width:168}),f.jsx(h.Skeleton,{height:24,width:240,sx:{marginTop:4}}),f.jsx(h.Skeleton,{height:16,width:144})]})]})}function uOe(e){const{open:t,onOpenChange:n,catalogId:r,onSelectItem:i}=e,o=Ne.useDebounceState({initialState:""}),a=Ee();return f.jsx(h.Dialog,{open:t,onOpenChange:n,hasClose:!1,size:{width:612,height:724},children:f.jsx(h.DialogContent,{children:f.jsxs(h.Box,{flexDirection:"column",height:"100%",children:[f.jsxs(h.Box,{padding:{top:16,inline:16},flexDirection:"column",gap:8,children:[f.jsx(h.FormSearchInput,{value:o.value,onValueChange:o.set,placeholder:"Search in your catalog"}),f.jsx(h.Text,{variant:"smallBold",color:"grey11",children:"Select an item"})]}),a.integrationFields?f.jsx(h.ErrorBoundary,{renderError:()=>f.jsx(dC,{message:"There was an error while fetching your catalog items."}),children:f.jsx($.Suspense,{fallback:f.jsxs(h.Box,{flexDirection:"column",gap:12,padding:{top:10,inline:16,bottom:16},children:[f.jsx(il,{}),f.jsx(il,{}),f.jsx(il,{}),f.jsx(il,{}),f.jsx(il,{})]}),children:f.jsx(cOe,{searchTerm:o.debouncedValue,catalogId:r,onItemClick:i})})}):f.jsx(dC,{message:"Slice Machine does not yet support mock data for integration field in the simulator."})]})})})}function cOe(e){const{catalogId:t,searchTerm:n,onItemClick:r}=e,[i,o]=$.useTransition(),{items:a,hasNextPage:s,fetchNextPage:u}=nOe({catalogId:t,searchTerm:n});return f.jsx(f.Fragment,{children:f.jsxs(h.ScrollArea,{onScrollToBottom:()=>s&&o(u),style:{flexGrow:1,paddingTop:h.theme.space[10],paddingBottom:h.theme.space[16],paddingInline:h.theme.space[16],display:"flex",flexDirection:"column",gap:h.theme.space[12]},threshold:252,children:[a.length===0?f.jsx(dC,{}):a.map(c=>f.jsx(VR,{item:c,catalogId:t,onClick:()=>r(c)},c.id)),f.jsx(h.AnimatedElement,{animation:{name:"fade"},children:i&&f.jsx(h.Text,{color:"grey11",align:"center",sx:{marginBlock:8},children:"Loading more results ..."})})]})})}function dC(e){const{message:t="We can't find any items matching your search"}=e,n="Oops!";return f.jsx(h.Box,{justifyContent:"center",flexDirection:"column",height:"100%",children:f.jsxs(h.BlankSlate,{children:[f.jsx(h.BlankSlateIcon,{name:"close",lineColor:"purple10",backgroundColor:"purple3",borderColor:"purple6",borderStyle:"dashed",size:"xlarge"}),f.jsx(h.BlankSlateTitle,{size:"big",children:n}),f.jsx(h.BlankSlateDescription,{width:360,children:t})]})})}function lOe(e){const{itemId:t,item:n}=e,r=Ee();return t&&n&&n.id===t?f.jsx(ol,{...e,value:n.title}):t&&r.integrationFields?f.jsx(h.ErrorBoundary,{renderError:()=>f.jsx(ol,{...e,value:t}),children:f.jsx($.Suspense,{fallback:f.jsx(ol,{...e,value:t}),children:f.jsx(pOe,{...e,itemId:t})},t)},t):t&&!r.integrationFields?f.jsx(ol,{...e,value:t}):f.jsx(ol,{...e,value:""})}function fOe(e){const{catalogId:t,itemId:n,item:r}=e,i=Ee();return n&&r&&r.id===n?f.jsx(h.FieldFooter,{children:f.jsx(VR,{catalogId:t,item:r})}):n&&i.integrationFields?f.jsx(h.ErrorBoundary,{renderError:()=>null,children:f.jsx(h.FieldFooter,{children:f.jsx($.Suspense,{fallback:f.jsx(il,{}),children:f.jsx(dOe,{catalogId:t,itemId:n})},n)})},n):null}function dOe(e){const{itemId:t,catalogId:n}=e,{item:r}=n8({catalogId:n,itemId:t});return f.jsx(VR,{catalogId:n,item:r})}function ol(e){const{id:t,field:n,readOnly:r,value:i,onFocus:o,onClearItem:a}=e;return f.jsx(Qs,{id:t,placeholder:Wc(n),readOnly:!0,variant:"link",value:i,...!r&&{cursor:"pointer",onFocus:o},endAdornment:f.jsx(h.Button,{startIcon:"close",color:"grey",size:"small",disabled:!i,onClick:a})})}function pOe(e){const{itemId:t,catalogId:n}=e,{item:r}=n8({catalogId:n,itemId:t});return f.jsx(ol,{...e,value:r.title})}function AOe(e){var A;const{id:t,field:n,content:r,readOnly:i,onContentChange:o}=e,[a,s]=$.useState(!1),[u,c]=$.useState(),l=(A=n.config)==null?void 0:A.catalog;if(!l)return null;function d(m){o({value:m.id,__TYPE__:"IntegrationFieldsContent"}),c(m),s(!1)}function p(){o(void 0),c(void 0)}return f.jsxs(f.Fragment,{children:[f.jsxs(h.Field,{footer:f.jsx(fOe,{catalogId:l,item:u,itemId:r==null?void 0:r.value}),children:[f.jsx(h.FieldIcon,{name:"multipleStop"}),f.jsx(h.FieldLabel,{htmlFor:t,children:nr(n)}),f.jsx(h.FieldControl,{children:f.jsx(lOe,{id:t,field:n,readOnly:i,catalogId:l,item:u,itemId:r==null?void 0:r.value,onFocus:()=>s(!0),onClearItem:p})})]}),f.jsx(uOe,{open:a,onOpenChange:s,catalogId:l,onSelectItem:d})]})}function hOe(e){const{content:t,field:n,id:r,onContentChange:i,readOnly:o}=e;return f.jsxs(h.Field,{children:[f.jsx(h.FieldIcon,{name:"notes"}),f.jsx(h.FieldLabel,{htmlFor:r,children:nr(n)}),f.jsx(h.FieldControl,{children:f.jsx(h.TextArea,{id:r,placeholder:Wc(n),readOnly:o,paddingLeft:4,paddingRight:12,sx:{flexGrow:1},value:(t==null?void 0:t.value)??"",onChange:a=>{i(mOe(a))}})})]})}function mOe(e){return e.length===0?void 0:{__TYPE__:"FieldContent",type:"Text",value:e}}const gOe=({content:e,field:t,id:n,onContentChange:r,readOnly:i})=>{var s,u;const o=Number(e==null?void 0:e.value),a=Number.isFinite(o)?o:void 0;return f.jsxs(h.Field,{children:[f.jsx(h.FieldIcon,{name:"pin"}),f.jsx(h.FieldLabel,{htmlFor:n,children:nr(t)}),f.jsx(h.FieldControl,{children:f.jsx(h.NumberInput,{id:n,value:a,min:(s=t.config)==null?void 0:s.min,max:(u=t.config)==null?void 0:u.max,padding:M7,placeholder:Wc(t),readOnly:i,onValueChange:c=>r(vOe(c))})})]})};function vOe(e){return e===void 0?void 0:{__TYPE__:"FieldContent",type:"Number",value:String(e)}}function An(e){this.content=e}An.prototype={constructor:An,find:function(e){for(var t=0;t<this.content.length;t+=2)if(this.content[t]===e)return t;return-1},get:function(e){var t=this.find(e);return t==-1?void 0:this.content[t+1]},update:function(e,t,n){var r=n&&n!=e?this.remove(n):this,i=r.find(e),o=r.content.slice();return i==-1?o.push(n||e,t):(o[i+1]=t,n&&(o[i]=n)),new An(o)},remove:function(e){var t=this.find(e);if(t==-1)return this;var n=this.content.slice();return n.splice(t,2),new An(n)},addToStart:function(e,t){return new An([e,t].concat(this.remove(e).content))},addToEnd:function(e,t){var n=this.remove(e).content.slice();return n.push(e,t),new An(n)},addBefore:function(e,t,n){var r=this.remove(t),i=r.content.slice(),o=r.find(e);return i.splice(o==-1?i.length:o,0,t,n),new An(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=An.from(e),e.size?new An(e.content.concat(this.subtract(e).content)):this},append:function(e){return e=An.from(e),e.size?new An(this.subtract(e).content.concat(e.content)):this},subtract:function(e){var t=this;e=An.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}};An.from=function(e){if(e instanceof An)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new An(t)};function r8(e,t,n){for(let r=0;;r++){if(r==e.childCount||r==t.childCount)return e.childCount==t.childCount?null:n;let i=e.child(r),o=t.child(r);if(i==o){n+=i.nodeSize;continue}if(!i.sameMarkup(o))return n;if(i.isText&&i.text!=o.text){for(let a=0;i.text[a]==o.text[a];a++)n++;return n}if(i.content.size||o.content.size){let a=r8(i.content,o.content,n+1);if(a!=null)return a}n+=i.nodeSize}}function i8(e,t,n,r){for(let i=e.childCount,o=t.childCount;;){if(i==0||o==0)return i==o?null:{a:n,b:r};let a=e.child(--i),s=t.child(--o),u=a.nodeSize;if(a==s){n-=u,r-=u;continue}if(!a.sameMarkup(s))return{a:n,b:r};if(a.isText&&a.text!=s.text){let c=0,l=Math.min(a.text.length,s.text.length);for(;c<l&&a.text[a.text.length-c-1]==s.text[s.text.length-c-1];)c++,n--,r--;return{a:n,b:r}}if(a.content.size||s.content.size){let c=i8(a.content,s.content,n-1,r-1);if(c)return c}n-=u,r-=u}}class X{constructor(t,n){if(this.content=t,this.size=n||0,n==null)for(let r=0;r<t.length;r++)this.size+=t[r].nodeSize}nodesBetween(t,n,r,i=0,o){for(let a=0,s=0;s<n;a++){let u=this.content[a],c=s+u.nodeSize;if(c>t&&r(u,i+s,o||null,a)!==!1&&u.content.size){let l=s+1;u.nodesBetween(Math.max(0,t-l),Math.min(u.content.size,n-l),r,i+l)}s=c}}descendants(t){this.nodesBetween(0,this.size,t)}textBetween(t,n,r,i){let o="",a=!0;return this.nodesBetween(t,n,(s,u)=>{s.isText?(o+=s.text.slice(Math.max(t,u)-u,n-u),a=!r):s.isLeaf?(i?o+=typeof i=="function"?i(s):i:s.type.spec.leafText&&(o+=s.type.spec.leafText(s)),a=!r):!a&&s.isBlock&&(o+=r,a=!0)},0),o}append(t){if(!t.size)return this;if(!this.size)return t;let n=this.lastChild,r=t.firstChild,i=this.content.slice(),o=0;for(n.isText&&n.sameMarkup(r)&&(i[i.length-1]=n.withText(n.text+r.text),o=1);o<t.content.length;o++)i.push(t.content[o]);return new X(i,this.size+t.size)}cut(t,n=this.size){if(t==0&&n==this.size)return this;let r=[],i=0;if(n>t)for(let o=0,a=0;a<n;o++){let s=this.content[o],u=a+s.nodeSize;u>t&&((a<t||u>n)&&(s.isText?s=s.cut(Math.max(0,t-a),Math.min(s.text.length,n-a)):s=s.cut(Math.max(0,t-a-1),Math.min(s.content.size,n-a-1))),r.push(s),i+=s.nodeSize),a=u}return new X(r,i)}cutByIndex(t,n){return t==n?X.empty:t==0&&n==this.content.length?this:new X(this.content.slice(t,n))}replaceChild(t,n){let r=this.content[t];if(r==n)return this;let i=this.content.slice(),o=this.size+n.nodeSize-r.nodeSize;return i[t]=n,new X(i,o)}addToStart(t){return new X([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new X(this.content.concat(t),this.size+t.nodeSize)}eq(t){if(this.content.length!=t.content.length)return!1;for(let n=0;n<this.content.length;n++)if(!this.content[n].eq(t.content[n]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(t){let n=this.content[t];if(!n)throw new RangeError("Index "+t+" out of range for "+this);return n}maybeChild(t){return this.content[t]||null}forEach(t){for(let n=0,r=0;n<this.content.length;n++){let i=this.content[n];t(i,r,n),r+=i.nodeSize}}findDiffStart(t,n=0){return r8(this,t,n)}findDiffEnd(t,n=this.size,r=t.size){return i8(this,t,n,r)}findIndex(t,n=-1){if(t==0)return Qh(0,t);if(t==this.size)return Qh(this.content.length,t);if(t>this.size||t<0)throw new RangeError(`Position ${t} outside of fragment (${this})`);for(let r=0,i=0;;r++){let o=this.child(r),a=i+o.nodeSize;if(a>=t)return a==t||n>0?Qh(r+1,a):Qh(r,i);i=a}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(t=>t.toJSON()):null}static fromJSON(t,n){if(!n)return X.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new X(n.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return X.empty;let n,r=0;for(let i=0;i<t.length;i++){let o=t[i];r+=o.nodeSize,i&&o.isText&&t[i-1].sameMarkup(o)?(n||(n=t.slice(0,i)),n[n.length-1]=o.withText(n[n.length-1].text+o.text)):n&&n.push(o)}return new X(n||t,r)}static from(t){if(!t)return X.empty;if(t instanceof X)return t;if(Array.isArray(t))return this.fromArray(t);if(t.attrs)return new X([t],t.nodeSize);throw new RangeError("Can not convert "+t+" to a Fragment"+(t.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}X.empty=new X([],0);const Jb={index:0,offset:0};function Qh(e,t){return Jb.index=e,Jb.offset=t,Jb}function Nm(e,t){if(e===t)return!0;if(!(e&&typeof e=="object")||!(t&&typeof t=="object"))return!1;let n=Array.isArray(e);if(Array.isArray(t)!=n)return!1;if(n){if(e.length!=t.length)return!1;for(let r=0;r<e.length;r++)if(!Nm(e[r],t[r]))return!1}else{for(let r in e)if(!(r in t)||!Nm(e[r],t[r]))return!1;for(let r in t)if(!(r in e))return!1}return!0}let vt=class pC{constructor(t,n){this.type=t,this.attrs=n}addToSet(t){let n,r=!1;for(let i=0;i<t.length;i++){let o=t[i];if(this.eq(o))return t;if(this.type.excludes(o.type))n||(n=t.slice(0,i));else{if(o.type.excludes(this.type))return t;!r&&o.type.rank>this.type.rank&&(n||(n=t.slice(0,i)),n.push(this),r=!0),n&&n.push(o)}}return n||(n=t.slice()),r||n.push(this),n}removeFromSet(t){for(let n=0;n<t.length;n++)if(this.eq(t[n]))return t.slice(0,n).concat(t.slice(n+1));return t}isInSet(t){for(let n=0;n<t.length;n++)if(this.eq(t[n]))return!0;return!1}eq(t){return this==t||this.type==t.type&&Nm(this.attrs,t.attrs)}toJSON(){let t={type:this.type.name};for(let n in this.attrs){t.attrs=this.attrs;break}return t}static fromJSON(t,n){if(!n)throw new RangeError("Invalid input for Mark.fromJSON");let r=t.marks[n.type];if(!r)throw new RangeError(`There is no mark type ${n.type} in this schema`);return r.create(n.attrs)}static sameSet(t,n){if(t==n)return!0;if(t.length!=n.length)return!1;for(let r=0;r<t.length;r++)if(!t[r].eq(n[r]))return!1;return!0}static setFrom(t){if(!t||Array.isArray(t)&&t.length==0)return pC.none;if(t instanceof pC)return[t];let n=t.slice();return n.sort((r,i)=>r.type.rank-i.type.rank),n}};vt.none=[];class mp extends Error{}class ae{constructor(t,n,r){this.content=t,this.openStart=n,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(t,n){let r=a8(this.content,t+this.openStart,n);return r&&new ae(r,this.openStart,this.openEnd)}removeBetween(t,n){return new ae(o8(this.content,t+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(t){return this.content.eq(t.content)&&this.openStart==t.openStart&&this.openEnd==t.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let t={content:this.content.toJSON()};return this.openStart>0&&(t.openStart=this.openStart),this.openEnd>0&&(t.openEnd=this.openEnd),t}static fromJSON(t,n){if(!n)return ae.empty;let r=n.openStart||0,i=n.openEnd||0;if(typeof r!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new ae(X.fromJSON(t,n.content),r,i)}static maxOpen(t,n=!0){let r=0,i=0;for(let o=t.firstChild;o&&!o.isLeaf&&(n||!o.type.spec.isolating);o=o.firstChild)r++;for(let o=t.lastChild;o&&!o.isLeaf&&(n||!o.type.spec.isolating);o=o.lastChild)i++;return new ae(t,r,i)}}ae.empty=new ae(X.empty,0,0);function o8(e,t,n){let{index:r,offset:i}=e.findIndex(t),o=e.maybeChild(r),{index:a,offset:s}=e.findIndex(n);if(i==t||o.isText){if(s!=n&&!e.child(a).isText)throw new RangeError("Removing non-flat range");return e.cut(0,t).append(e.cut(n))}if(r!=a)throw new RangeError("Removing non-flat range");return e.replaceChild(r,o.copy(o8(o.content,t-i-1,n-i-1)))}function a8(e,t,n,r){let{index:i,offset:o}=e.findIndex(t),a=e.maybeChild(i);if(o==t||a.isText)return r&&!r.canReplace(i,i,n)?null:e.cut(0,t).append(n).append(e.cut(t));let s=a8(a.content,t-o-1,n);return s&&e.replaceChild(i,a.copy(s))}function yOe(e,t,n){if(n.openStart>e.depth)throw new mp("Inserted content deeper than insertion position");if(e.depth-n.openStart!=t.depth-n.openEnd)throw new mp("Inconsistent open depths");return s8(e,t,n,0)}function s8(e,t,n,r){let i=e.index(r),o=e.node(r);if(i==t.index(r)&&r<e.depth-n.openStart){let a=s8(e,t,n,r+1);return o.copy(o.content.replaceChild(i,a))}else if(n.content.size)if(!n.openStart&&!n.openEnd&&e.depth==r&&t.depth==r){let a=e.parent,s=a.content;return Au(a,s.cut(0,e.parentOffset).append(n.content).append(s.cut(t.parentOffset)))}else{let{start:a,end:s}=bOe(n,e);return Au(o,c8(e,a,s,t,r))}else return Au(o,qm(e,t,r))}function u8(e,t){if(!t.type.compatibleContent(e.type))throw new mp("Cannot join "+t.type.name+" onto "+e.type.name)}function AC(e,t,n){let r=e.node(n);return u8(r,t.node(n)),r}function pu(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 Od(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&&(pu(e.nodeAfter,r),o++));for(let s=o;s<a;s++)pu(i.child(s),r);t&&t.depth==n&&t.textOffset&&pu(t.nodeBefore,r)}function Au(e,t){return e.type.checkContent(t),e.copy(t)}function c8(e,t,n,r,i){let o=e.depth>i&&AC(e,t,i+1),a=r.depth>i&&AC(n,r,i+1),s=[];return Od(null,e,i,s),o&&a&&t.index(i)==n.index(i)?(u8(o,a),pu(Au(o,c8(e,t,n,r,i+1)),s)):(o&&pu(Au(o,qm(e,t,i+1)),s),Od(t,n,i,s),a&&pu(Au(a,qm(n,r,i+1)),s)),Od(r,null,i,s),new X(s)}function qm(e,t,n){let r=[];if(Od(null,e,n,r),e.depth>n){let i=AC(e,t,n+1);pu(Au(i,qm(e,t,n+1)),r)}return Od(t,null,n,r),new X(r)}function bOe(e,t){let n=t.depth-e.openStart,i=t.node(n).copy(e.content);for(let o=n-1;o>=0;o--)i=t.node(o).copy(X.from(i));return{start:i.resolveNoCache(e.openStart+n),end:i.resolveNoCache(i.content.size-e.openEnd-n)}}class gp{constructor(t,n,r){this.pos=t,this.path=n,this.parentOffset=r,this.depth=n.length/3-1}resolveDepth(t){return t==null?this.depth:t<0?this.depth+t:t}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(t){return this.path[this.resolveDepth(t)*3]}index(t){return this.path[this.resolveDepth(t)*3+1]}indexAfter(t){return t=this.resolveDepth(t),this.index(t)+(t==this.depth&&!this.textOffset?0:1)}start(t){return t=this.resolveDepth(t),t==0?0:this.path[t*3-1]+1}end(t){return t=this.resolveDepth(t),this.start(t)+this.node(t).content.size}before(t){if(t=this.resolveDepth(t),!t)throw new RangeError("There is no position before the top-level node");return t==this.depth+1?this.pos:this.path[t*3-1]}after(t){if(t=this.resolveDepth(t),!t)throw new RangeError("There is no position after the top-level node");return t==this.depth+1?this.pos:this.path[t*3-1]+this.path[t*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let t=this.parent,n=this.index(this.depth);if(n==t.childCount)return null;let r=this.pos-this.path[this.path.length-1],i=t.child(n);return r?t.child(n).cut(r):i}get nodeBefore(){let t=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(t).cut(0,n):t==0?null:this.parent.child(t-1)}posAtIndex(t,n){n=this.resolveDepth(n);let r=this.path[n*3],i=n==0?0:this.path[n*3-1]+1;for(let o=0;o<t;o++)i+=r.child(o).nodeSize;return i}marks(){let t=this.parent,n=this.index();if(t.content.size==0)return vt.none;if(this.textOffset)return t.child(n).marks;let r=t.maybeChild(n-1),i=t.maybeChild(n);if(!r){let s=r;r=i,i=s}let o=r.marks;for(var a=0;a<o.length;a++)o[a].type.spec.inclusive===!1&&(!i||!o[a].isInSet(i.marks))&&(o=o[a--].removeFromSet(o));return o}marksAcross(t){let n=this.parent.maybeChild(this.index());if(!n||!n.isInline)return null;let r=n.marks,i=t.parent.maybeChild(t.index());for(var o=0;o<r.length;o++)r[o].type.spec.inclusive===!1&&(!i||!r[o].isInSet(i.marks))&&(r=r[o--].removeFromSet(r));return r}sharedDepth(t){for(let n=this.depth;n>0;n--)if(this.start(n)<=t&&this.end(n)>=t)return n;return 0}blockRange(t=this,n){if(t.pos<this.pos)return t.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==t.pos?1:0);r>=0;r--)if(t.pos<=this.end(r)&&(!n||n(this.node(r))))return new Vm(this,t,r);return null}sameParent(t){return this.pos-this.parentOffset==t.pos-t.parentOffset}max(t){return t.pos>this.pos?t:this}min(t){return t.pos<this.pos?t:this}toString(){let t="";for(let n=1;n<=this.depth;n++)t+=(t?"/":"")+this.node(n).type.name+"_"+this.index(n-1);return t+":"+this.parentOffset}static resolve(t,n){if(!(n>=0&&n<=t.content.size))throw new RangeError("Position "+n+" out of range");let r=[],i=0,o=n;for(let a=t;;){let{index:s,offset:u}=a.content.findIndex(o),c=o-u;if(r.push(a,s,i+u),!c||(a=a.child(s),a.isText))break;o=c-1,i+=u+1}return new gp(n,r,o)}static resolveCached(t,n){for(let i=0;i<Zb.length;i++){let o=Zb[i];if(o.pos==n&&o.doc==t)return o}let r=Zb[Xb]=gp.resolve(t,n);return Xb=(Xb+1)%COe,r}}let Zb=[],Xb=0,COe=12;class Vm{constructor(t,n,r){this.$from=t,this.$to=n,this.depth=r}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const SOe=Object.create(null);let hl=class hC{constructor(t,n,r,i=vt.none){this.type=t,this.attrs=n,this.marks=i,this.content=r||X.empty}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(t){return this.content.child(t)}maybeChild(t){return this.content.maybeChild(t)}forEach(t){this.content.forEach(t)}nodesBetween(t,n,r,i=0){this.content.nodesBetween(t,n,r,i,this)}descendants(t){this.nodesBetween(0,this.content.size,t)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(t,n,r,i){return this.content.textBetween(t,n,r,i)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(t){return this==t||this.sameMarkup(t)&&this.content.eq(t.content)}sameMarkup(t){return this.hasMarkup(t.type,t.attrs,t.marks)}hasMarkup(t,n,r){return this.type==t&&Nm(this.attrs,n||t.defaultAttrs||SOe)&&vt.sameSet(this.marks,r||vt.none)}copy(t=null){return t==this.content?this:new hC(this.type,this.attrs,t,this.marks)}mark(t){return t==this.marks?this:new hC(this.type,this.attrs,this.content,t)}cut(t,n=this.content.size){return t==0&&n==this.content.size?this:this.copy(this.content.cut(t,n))}slice(t,n=this.content.size,r=!1){if(t==n)return ae.empty;let i=this.resolve(t),o=this.resolve(n),a=r?0:i.sharedDepth(n),s=i.start(a),c=i.node(a).content.cut(i.pos-s,o.pos-s);return new ae(c,i.depth-a,o.depth-a)}replace(t,n,r){return yOe(this.resolve(t),this.resolve(n),r)}nodeAt(t){for(let n=this;;){let{index:r,offset:i}=n.content.findIndex(t);if(n=n.maybeChild(r),!n)return null;if(i==t||n.isText)return n;t-=i+1}}childAfter(t){let{index:n,offset:r}=this.content.findIndex(t);return{node:this.content.maybeChild(n),index:n,offset:r}}childBefore(t){if(t==0)return{node:null,index:0,offset:0};let{index:n,offset:r}=this.content.findIndex(t);if(r<t)return{node:this.content.child(n),index:n,offset:r};let i=this.content.child(n-1);return{node:i,index:n-1,offset:r-i.nodeSize}}resolve(t){return gp.resolveCached(this,t)}resolveNoCache(t){return gp.resolve(this,t)}rangeHasMark(t,n,r){let i=!1;return n>t&&this.nodesBetween(t,n,o=>(r.isInSet(o.marks)&&(i=!0),!i)),i}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let t=this.type.name;return this.content.size&&(t+="("+this.content.toStringInner()+")"),l8(this.marks,t)}contentMatchAt(t){let n=this.type.contentMatch.matchFragment(this.content,0,t);if(!n)throw new Error("Called contentMatchAt on a node with invalid content");return n}canReplace(t,n,r=X.empty,i=0,o=r.childCount){let a=this.contentMatchAt(t).matchFragment(r,i,o),s=a&&a.matchFragment(this.content,n);if(!s||!s.validEnd)return!1;for(let u=i;u<o;u++)if(!this.type.allowsMarks(r.child(u).marks))return!1;return!0}canReplaceWith(t,n,r,i){if(i&&!this.type.allowsMarks(i))return!1;let o=this.contentMatchAt(t).matchType(r),a=o&&o.matchFragment(this.content,n);return a?a.validEnd:!1}canAppend(t){return t.content.size?this.canReplace(this.childCount,this.childCount,t.content):this.type.compatibleContent(t.type)}check(){this.type.checkContent(this.content);let t=vt.none;for(let n=0;n<this.marks.length;n++)t=this.marks[n].addToSet(t);if(!vt.sameSet(t,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(n=>n.type.name)}`);this.content.forEach(n=>n.check())}toJSON(){let t={type:this.type.name};for(let n in this.attrs){t.attrs=this.attrs;break}return this.content.size&&(t.content=this.content.toJSON()),this.marks.length&&(t.marks=this.marks.map(n=>n.toJSON())),t}static fromJSON(t,n){if(!n)throw new RangeError("Invalid input for Node.fromJSON");let r=null;if(n.marks){if(!Array.isArray(n.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=n.marks.map(t.markFromJSON)}if(n.type=="text"){if(typeof n.text!="string")throw new RangeError("Invalid text node in JSON");return t.text(n.text,r)}let i=X.fromJSON(t,n.content);return t.nodeType(n.type).create(n.attrs,i,r)}};hl.prototype.text=void 0;class Qm extends hl{constructor(t,n,r,i){if(super(t,n,null,i),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):l8(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(t,n){return this.text.slice(t,n)}get nodeSize(){return this.text.length}mark(t){return t==this.marks?this:new Qm(this.type,this.attrs,this.text,t)}withText(t){return t==this.text?this:new Qm(this.type,this.attrs,t,this.marks)}cut(t=0,n=this.text.length){return t==0&&n==this.text.length?this:this.withText(this.text.slice(t,n))}eq(t){return this.sameMarkup(t)&&this.text==t.text}toJSON(){let t=super.toJSON();return t.text=this.text,t}}function l8(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+"("+t+")";return t}class Uu{constructor(t){this.validEnd=t,this.next=[],this.wrapCache=[]}static parse(t,n){let r=new _Oe(t,n);if(r.next==null)return Uu.empty;let i=f8(r);r.next&&r.err("Unexpected trailing text");let o=ROe($Oe(i));return OOe(o,r),o}matchType(t){for(let n=0;n<this.next.length;n++)if(this.next[n].type==t)return this.next[n].next;return null}matchFragment(t,n=0,r=t.childCount){let i=this;for(let o=n;i&&o<r;o++)i=i.matchType(t.child(o).type);return i}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let t=0;t<this.next.length;t++){let{type:n}=this.next[t];if(!(n.isText||n.hasRequiredAttrs()))return n}return null}compatible(t){for(let n=0;n<this.next.length;n++)for(let r=0;r<t.next.length;r++)if(this.next[n].type==t.next[r].type)return!0;return!1}fillBefore(t,n=!1,r=0){let i=[this];function o(a,s){let u=a.matchFragment(t,r);if(u&&(!n||u.validEnd))return X.from(s.map(c=>c.createAndFill()));for(let c=0;c<a.next.length;c++){let{type:l,next:d}=a.next[c];if(!(l.isText||l.hasRequiredAttrs())&&i.indexOf(d)==-1){i.push(d);let p=o(d,s.concat(l));if(p)return p}}return null}return o(this,[])}findWrapping(t){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==t)return this.wrapCache[r+1];let n=this.computeWrapping(t);return this.wrapCache.push(t,n),n}computeWrapping(t){let n=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let i=r.shift(),o=i.match;if(o.matchType(t)){let a=[];for(let s=i;s.type;s=s.via)a.push(s.type);return a.reverse()}for(let a=0;a<o.next.length;a++){let{type:s,next:u}=o.next[a];!s.isLeaf&&!s.hasRequiredAttrs()&&!(s.name in n)&&(!i.type||u.validEnd)&&(r.push({match:s.contentMatch,type:s,via:i}),n[s.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(t){if(t>=this.next.length)throw new RangeError(`There's no ${t}th edge in this content match`);return this.next[t]}toString(){let t=[];function n(r){t.push(r);for(let i=0;i<r.next.length;i++)t.indexOf(r.next[i].next)==-1&&n(r.next[i].next)}return n(this),t.map((r,i)=>{let o=i+(r.validEnd?"*":" ")+" ";for(let a=0;a<r.next.length;a++)o+=(a?", ":"")+r.next[a].type.name+"->"+t.indexOf(r.next[a].next);return o}).join(`
38
- `)}}Uu.empty=new Uu(!0);class _Oe{constructor(t,n){this.string=t,this.nodeTypes=n,this.inline=null,this.pos=0,this.tokens=t.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(t){return this.next==t&&(this.pos++||!0)}err(t){throw new SyntaxError(t+" (in content expression '"+this.string+"')")}}function f8(e){let t=[];do t.push(IOe(e));while(e.eat("|"));return t.length==1?t[0]:{type:"choice",exprs:t}}function IOe(e){let t=[];do t.push(TOe(e));while(e.next&&e.next!=")"&&e.next!="|");return t.length==1?t[0]:{type:"seq",exprs:t}}function TOe(e){let t=EOe(e);for(;;)if(e.eat("+"))t={type:"plus",expr:t};else if(e.eat("*"))t={type:"star",expr:t};else if(e.eat("?"))t={type:"opt",expr:t};else if(e.eat("{"))t=xOe(e,t);else break;return t}function ik(e){/\D/.test(e.next)&&e.err("Expected number, got '"+e.next+"'");let t=Number(e.next);return e.pos++,t}function xOe(e,t){let n=ik(e),r=n;return e.eat(",")&&(e.next!="}"?r=ik(e):r=-1),e.eat("}")||e.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:t}}function wOe(e,t){let n=e.nodeTypes,r=n[t];if(r)return[r];let i=[];for(let o in n){let a=n[o];a.groups.indexOf(t)>-1&&i.push(a)}return i.length==0&&e.err("No node type or group '"+t+"' found"),i}function EOe(e){if(e.eat("(")){let t=f8(e);return e.eat(")")||e.err("Missing closing paren"),t}else if(/\W/.test(e.next))e.err("Unexpected token '"+e.next+"'");else{let t=wOe(e,e.next).map(n=>(e.inline==null?e.inline=n.isInline:e.inline!=n.isInline&&e.err("Mixing inline and block content"),{type:"name",value:n}));return e.pos++,t.length==1?t[0]:{type:"choice",exprs:t}}}function $Oe(e){let t=[[]];return i(o(e,0),n()),t;function n(){return t.push([])-1}function r(a,s,u){let c={term:u,to:s};return t[a].push(c),c}function i(a,s){a.forEach(u=>u.to=s)}function o(a,s){if(a.type=="choice")return a.exprs.reduce((u,c)=>u.concat(o(c,s)),[]);if(a.type=="seq")for(let u=0;;u++){let c=o(a.exprs[u],s);if(u==a.exprs.length-1)return c;i(c,s=n())}else if(a.type=="star"){let u=n();return r(s,u),i(o(a.expr,u),u),[r(u)]}else if(a.type=="plus"){let u=n();return i(o(a.expr,s),u),i(o(a.expr,u),u),[r(u)]}else{if(a.type=="opt")return[r(s)].concat(o(a.expr,s));if(a.type=="range"){let u=s;for(let c=0;c<a.min;c++){let l=n();i(o(a.expr,u),l),u=l}if(a.max==-1)i(o(a.expr,u),u);else for(let c=a.min;c<a.max;c++){let l=n();r(u,l),i(o(a.expr,u),l),u=l}return[r(u)]}else{if(a.type=="name")return[r(s,void 0,a.value)];throw new Error("Unknown expr type")}}}}function d8(e,t){return t-e}function ok(e,t){let n=[];return r(t),n.sort(d8);function r(i){let o=e[i];if(o.length==1&&!o[0].term)return r(o[0].to);n.push(i);for(let a=0;a<o.length;a++){let{term:s,to:u}=o[a];!s&&n.indexOf(u)==-1&&r(u)}}}function ROe(e){let t=Object.create(null);return n(ok(e,0));function n(r){let i=[];r.forEach(a=>{e[a].forEach(({term:s,to:u})=>{if(!s)return;let c;for(let l=0;l<i.length;l++)i[l][0]==s&&(c=i[l][1]);ok(e,u).forEach(l=>{c||i.push([s,c=[]]),c.indexOf(l)==-1&&c.push(l)})})});let o=t[r.join(",")]=new Uu(r.indexOf(e.length-1)>-1);for(let a=0;a<i.length;a++){let s=i[a][1].sort(d8);o.next.push({type:i[a][0],next:t[s.join(",")]||n(s)})}return o}}function OOe(e,t){for(let n=0,r=[e];n<r.length;n++){let i=r[n],o=!i.validEnd,a=[];for(let s=0;s<i.next.length;s++){let{type:u,next:c}=i.next[s];a.push(u.name),o&&!(u.isText||u.hasRequiredAttrs())&&(o=!1),r.indexOf(c)==-1&&r.push(c)}o&&t.err("Only non-generatable nodes ("+a.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function p8(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 A8(e,t){let n=Object.create(null);for(let r in e){let i=t&&t[r];if(i===void 0){let o=e[r];if(o.hasDefault)i=o.default;else throw new RangeError("No value supplied for attribute "+r)}n[r]=i}return n}function h8(e){let t=Object.create(null);if(e)for(let n in e)t[n]=new FOe(e[n]);return t}let ak=class m8{constructor(t,n,r){this.name=t,this.schema=n,this.spec=r,this.markSet=null,this.groups=r.group?r.group.split(" "):[],this.attrs=h8(r.attrs),this.defaultAttrs=p8(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(r.inline||t=="text"),this.isText=t=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==Uu.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let t in this.attrs)if(this.attrs[t].isRequired)return!0;return!1}compatibleContent(t){return this==t||this.contentMatch.compatible(t.contentMatch)}computeAttrs(t){return!t&&this.defaultAttrs?this.defaultAttrs:A8(this.attrs,t)}create(t=null,n,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new hl(this,this.computeAttrs(t),X.from(n),vt.setFrom(r))}createChecked(t=null,n,r){return n=X.from(n),this.checkContent(n),new hl(this,this.computeAttrs(t),n,vt.setFrom(r))}createAndFill(t=null,n,r){if(t=this.computeAttrs(t),n=X.from(n),n.size){let a=this.contentMatch.fillBefore(n);if(!a)return null;n=a.append(n)}let i=this.contentMatch.matchFragment(n),o=i&&i.fillBefore(X.empty,!0);return o?new hl(this,t,n.append(o),vt.setFrom(r)):null}validContent(t){let n=this.contentMatch.matchFragment(t);if(!n||!n.validEnd)return!1;for(let r=0;r<t.childCount;r++)if(!this.allowsMarks(t.child(r).marks))return!1;return!0}checkContent(t){if(!this.validContent(t))throw new RangeError(`Invalid content for node ${this.name}: ${t.toString().slice(0,50)}`)}allowsMarkType(t){return this.markSet==null||this.markSet.indexOf(t)>-1}allowsMarks(t){if(this.markSet==null)return!0;for(let n=0;n<t.length;n++)if(!this.allowsMarkType(t[n].type))return!1;return!0}allowedMarks(t){if(this.markSet==null)return t;let n;for(let r=0;r<t.length;r++)this.allowsMarkType(t[r].type)?n&&n.push(t[r]):n||(n=t.slice(0,r));return n?n.length?n:vt.none:t}static compile(t,n){let r=Object.create(null);t.forEach((o,a)=>r[o]=new m8(o,n,a));let i=n.spec.topNode||"doc";if(!r[i])throw new RangeError("Schema is missing its top node type ('"+i+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let o in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};class FOe{constructor(t){this.hasDefault=Object.prototype.hasOwnProperty.call(t,"default"),this.default=t.default}get isRequired(){return!this.hasDefault}}class QR{constructor(t,n,r,i){this.name=t,this.rank=n,this.schema=r,this.spec=i,this.attrs=h8(i.attrs),this.excluded=null;let o=p8(this.attrs);this.instance=o?new vt(this,o):null}create(t=null){return!t&&this.instance?this.instance:new vt(this,A8(this.attrs,t))}static compile(t,n){let r=Object.create(null),i=0;return t.forEach((o,a)=>r[o]=new QR(o,i++,n,a)),r}removeFromSet(t){for(var n=0;n<t.length;n++)t[n].type==this&&(t=t.slice(0,n).concat(t.slice(n+1)),n--);return t}isInSet(t){for(let n=0;n<t.length;n++)if(t[n].type==this)return t[n]}excludes(t){return this.excluded.indexOf(t)>-1}}class g8{constructor(t){this.cached=Object.create(null);let n=this.spec={};for(let i in t)n[i]=t[i];n.nodes=An.from(t.nodes),n.marks=An.from(t.marks||{}),this.nodes=ak.compile(this.spec.nodes,this),this.marks=QR.compile(this.spec.marks,this);let r=Object.create(null);for(let i in this.nodes){if(i in this.marks)throw new RangeError(i+" can not be both a node and a mark");let o=this.nodes[i],a=o.spec.content||"",s=o.spec.marks;o.contentMatch=r[a]||(r[a]=Uu.parse(a,this.nodes)),o.inlineContent=o.contentMatch.inlineContent,o.markSet=s=="_"?null:s?sk(this,s.split(" ")):s==""||!o.inlineContent?[]:null}for(let i in this.marks){let o=this.marks[i],a=o.spec.excludes;o.excluded=a==null?[o]:a==""?[]:sk(this,a.split(" "))}this.nodeFromJSON=this.nodeFromJSON.bind(this),this.markFromJSON=this.markFromJSON.bind(this),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(t,n=null,r,i){if(typeof t=="string")t=this.nodeType(t);else if(t instanceof ak){if(t.schema!=this)throw new RangeError("Node type from different schema used ("+t.name+")")}else throw new RangeError("Invalid node type: "+t);return t.createChecked(n,r,i)}text(t,n){let r=this.nodes.text;return new Qm(r,r.defaultAttrs,t,vt.setFrom(n))}mark(t,n){return typeof t=="string"&&(t=this.marks[t]),t.create(n)}nodeFromJSON(t){return hl.fromJSON(this,t)}markFromJSON(t){return vt.fromJSON(this,t)}nodeType(t){let n=this.nodes[t];if(!n)throw new RangeError("Unknown node type: "+t);return n}}function sk(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 s in e.marks){let u=e.marks[s];(i=="_"||u.spec.group&&u.spec.group.split(" ").indexOf(i)>-1)&&n.push(a=u)}if(!a)throw new SyntaxError("Unknown mark type: '"+t[r]+"'")}return n}class hu{constructor(t,n){this.schema=t,this.rules=n,this.tags=[],this.styles=[],n.forEach(r=>{r.tag?this.tags.push(r):r.style&&this.styles.push(r)}),this.normalizeLists=!this.tags.some(r=>{if(!/^(ul|ol)\b/.test(r.tag)||!r.node)return!1;let i=t.nodes[r.node];return i.contentMatch.matchType(i)})}parse(t,n={}){let r=new ck(this,n,!1);return r.addAll(t,n.from,n.to),r.finish()}parseSlice(t,n={}){let r=new ck(this,n,!0);return r.addAll(t,n.from,n.to),ae.maxOpen(r.finish())}matchTag(t,n,r){for(let i=r?this.tags.indexOf(r)+1:0;i<this.tags.length;i++){let o=this.tags[i];if(LOe(t,o.tag)&&(o.namespace===void 0||t.namespaceURI==o.namespace)&&(!o.context||n.matchesContext(o.context))){if(o.getAttrs){let a=o.getAttrs(t);if(a===!1)continue;o.attrs=a||void 0}return o}}}matchStyle(t,n,r,i){for(let o=i?this.styles.indexOf(i)+1:0;o<this.styles.length;o++){let a=this.styles[o],s=a.style;if(!(s.indexOf(t)!=0||a.context&&!r.matchesContext(a.context)||s.length>t.length&&(s.charCodeAt(t.length)!=61||s.slice(t.length+1)!=n))){if(a.getAttrs){let u=a.getAttrs(n);if(u===!1)continue;a.attrs=u||void 0}return a}}}static schemaRules(t){let n=[];function r(i){let o=i.priority==null?50:i.priority,a=0;for(;a<n.length;a++){let s=n[a];if((s.priority==null?50:s.priority)<o)break}n.splice(a,0,i)}for(let i in t.marks){let o=t.marks[i].spec.parseDOM;o&&o.forEach(a=>{r(a=lk(a)),a.mark||a.ignore||a.clearMark||(a.mark=i)})}for(let i in t.nodes){let o=t.nodes[i].spec.parseDOM;o&&o.forEach(a=>{r(a=lk(a)),a.node||a.ignore||a.mark||(a.node=i)})}return n}static fromSchema(t){return t.cached.domParser||(t.cached.domParser=new hu(t,hu.schemaRules(t)))}}const v8={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},kOe={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},y8={ol:!0,ul:!0},zm=1,Hm=2,Fd=4;function uk(e,t,n){return t!=null?(t?zm:0)|(t==="full"?Hm:0):e&&e.whitespace=="pre"?zm|Hm:n&~Fd}class zh{constructor(t,n,r,i,o,a,s){this.type=t,this.attrs=n,this.marks=r,this.pendingMarks=i,this.solid=o,this.options=s,this.content=[],this.activeMarks=vt.none,this.stashMarks=[],this.match=a||(s&Fd?null:t.contentMatch)}findWrapping(t){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(X.from(t));if(n)this.match=this.type.contentMatch.matchFragment(n);else{let r=this.type.contentMatch,i;return(i=r.findWrapping(t.type))?(this.match=r,i):null}}return this.match.findWrapping(t.type)}finish(t){if(!(this.options&zm)){let r=this.content[this.content.length-1],i;if(r&&r.isText&&(i=/[ \t\r\n\u000c]+$/.exec(r.text))){let o=r;r.text.length==i[0].length?this.content.pop():this.content[this.content.length-1]=o.withText(o.text.slice(0,o.text.length-i[0].length))}}let n=X.from(this.content);return!t&&this.match&&(n=n.append(this.match.fillBefore(X.empty,!0))),this.type?this.type.create(this.attrs,n,this.marks):n}popFromStashMark(t){for(let n=this.stashMarks.length-1;n>=0;n--)if(t.eq(this.stashMarks[n]))return this.stashMarks.splice(n,1)[0]}applyPending(t){for(let n=0,r=this.pendingMarks;n<r.length;n++){let i=r[n];(this.type?this.type.allowsMarkType(i.type):UOe(i.type,t))&&!i.isInSet(this.activeMarks)&&(this.activeMarks=i.addToSet(this.activeMarks),this.pendingMarks=i.removeFromSet(this.pendingMarks))}}inlineContext(t){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:t.parentNode&&!v8.hasOwnProperty(t.parentNode.nodeName.toLowerCase())}}class ck{constructor(t,n,r){this.parser=t,this.options=n,this.isOpen=r,this.open=0;let i=n.topNode,o,a=uk(null,n.preserveWhitespace,0)|(r?Fd:0);i?o=new zh(i.type,i.attrs,vt.none,vt.none,!0,n.topMatch||i.type.contentMatch,a):r?o=new zh(null,null,vt.none,vt.none,!0,null,a):o=new zh(t.schema.topNodeType,null,vt.none,vt.none,!0,null,a),this.nodes=[o],this.find=n.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(t){if(t.nodeType==3)this.addTextNode(t);else if(t.nodeType==1){let n=t.getAttribute("style");if(!n)this.addElement(t);else{let r=this.readStyles(jOe(n));if(!r)return;let[i,o]=r,a=this.top;for(let s=0;s<o.length;s++)this.removePendingMark(o[s],a);for(let s=0;s<i.length;s++)this.addPendingMark(i[s]);this.addElement(t);for(let s=0;s<i.length;s++)this.removePendingMark(i[s],a);for(let s=0;s<o.length;s++)this.addPendingMark(o[s])}}}addTextNode(t){let n=t.nodeValue,r=this.top;if(r.options&Hm||r.inlineContext(t)||/[^ \t\r\n\u000c]/.test(n)){if(r.options&zm)r.options&Hm?n=n.replace(/\r\n?/g,`
39
- `):n=n.replace(/\r?\n|\r/g," ");else if(n=n.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(n)&&this.open==this.nodes.length-1){let i=r.content[r.content.length-1],o=t.previousSibling;(!i||o&&o.nodeName=="BR"||i.isText&&/[ \t\r\n\u000c]$/.test(i.text))&&(n=n.slice(1))}n&&this.insertNode(this.parser.schema.text(n)),this.findInText(t)}else this.findInside(t)}addElement(t,n){let r=t.nodeName.toLowerCase(),i;y8.hasOwnProperty(r)&&this.parser.normalizeLists&&MOe(t);let o=this.options.ruleFromNode&&this.options.ruleFromNode(t)||(i=this.parser.matchTag(t,this,n));if(o?o.ignore:kOe.hasOwnProperty(r))this.findInside(t),this.ignoreFallback(t);else if(!o||o.skip||o.closeParent){o&&o.closeParent?this.open=Math.max(0,this.open-1):o&&o.skip.nodeType&&(t=o.skip);let a,s=this.top,u=this.needsBlock;if(v8.hasOwnProperty(r))s.content.length&&s.content[0].isInline&&this.open&&(this.open--,s=this.top),a=!0,s.type||(this.needsBlock=!0);else if(!t.firstChild){this.leafFallback(t);return}this.addAll(t),a&&this.sync(s),this.needsBlock=u}else this.addElementByRule(t,o,o.consuming===!1?i:void 0)}leafFallback(t){t.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(t.ownerDocument.createTextNode(`
40
- `))}ignoreFallback(t){t.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"))}readStyles(t){let n=vt.none,r=vt.none;e:for(let i=0;i<t.length;i+=2)for(let o=void 0;;){let a=this.parser.matchStyle(t[i],t[i+1],this,o);if(!a)continue e;if(a.ignore)return null;if(a.clearMark?this.top.pendingMarks.forEach(s=>{a.clearMark(s)&&(r=s.addToSet(r))}):n=this.parser.schema.marks[a.mark].create(a.attrs).addToSet(n),a.consuming===!1)o=a;else break}return[n,r]}addElementByRule(t,n,r){let i,o,a;n.node?(o=this.parser.schema.nodes[n.node],o.isLeaf?this.insertNode(o.create(n.attrs))||this.leafFallback(t):i=this.enter(o,n.attrs||null,n.preserveWhitespace)):(a=this.parser.schema.marks[n.mark].create(n.attrs),this.addPendingMark(a));let s=this.top;if(o&&o.isLeaf)this.findInside(t);else if(r)this.addElement(t,r);else if(n.getContent)this.findInside(t),n.getContent(t,this.parser.schema).forEach(u=>this.insertNode(u));else{let u=t;typeof n.contentElement=="string"?u=t.querySelector(n.contentElement):typeof n.contentElement=="function"?u=n.contentElement(t):n.contentElement&&(u=n.contentElement),this.findAround(t,u,!0),this.addAll(u)}i&&this.sync(s)&&this.open--,a&&this.removePendingMark(a,s)}addAll(t,n,r){let i=n||0;for(let o=n?t.childNodes[n]:t.firstChild,a=r==null?null:t.childNodes[r];o!=a;o=o.nextSibling,++i)this.findAtPoint(t,i),this.addDOM(o);this.findAtPoint(t,i)}findPlace(t){let n,r;for(let i=this.open;i>=0;i--){let o=this.nodes[i],a=o.findWrapping(t);if(a&&(!n||n.length>a.length)&&(n=a,r=o,!a.length)||o.solid)break}if(!n)return!1;this.sync(r);for(let i=0;i<n.length;i++)this.enterInner(n[i],null,!1);return!0}insertNode(t){if(t.isInline&&this.needsBlock&&!this.top.type){let n=this.textblockFromContext();n&&this.enterInner(n)}if(this.findPlace(t)){this.closeExtra();let n=this.top;n.applyPending(t.type),n.match&&(n.match=n.match.matchType(t.type));let r=n.activeMarks;for(let i=0;i<t.marks.length;i++)(!n.type||n.type.allowsMarkType(t.marks[i].type))&&(r=t.marks[i].addToSet(r));return n.content.push(t.mark(r)),!0}return!1}enter(t,n,r){let i=this.findPlace(t.create(n));return i&&this.enterInner(t,n,!0,r),i}enterInner(t,n=null,r=!1,i){this.closeExtra();let o=this.top;o.applyPending(t),o.match=o.match&&o.match.matchType(t);let a=uk(t,i,o.options);o.options&Fd&&o.content.length==0&&(a|=Fd),this.nodes.push(new zh(t,n,o.activeMarks,o.pendingMarks,r,null,a)),this.open++}closeExtra(t=!1){let n=this.nodes.length-1;if(n>this.open){for(;n>this.open;n--)this.nodes[n-1].content.push(this.nodes[n].finish(t));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(this.isOpen||this.options.topOpen)}sync(t){for(let n=this.open;n>=0;n--)if(this.nodes[n]==t)return this.open=n,!0;return!1}get currentPos(){this.closeExtra();let t=0;for(let n=this.open;n>=0;n--){let r=this.nodes[n].content;for(let i=r.length-1;i>=0;i--)t+=r[i].nodeSize;n&&t++}return t}findAtPoint(t,n){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].node==t&&this.find[r].offset==n&&(this.find[r].pos=this.currentPos)}findInside(t){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].pos==null&&t.nodeType==1&&t.contains(this.find[n].node)&&(this.find[n].pos=this.currentPos)}findAround(t,n,r){if(t!=n&&this.find)for(let i=0;i<this.find.length;i++)this.find[i].pos==null&&t.nodeType==1&&t.contains(this.find[i].node)&&n.compareDocumentPosition(this.find[i].node)&(r?2:4)&&(this.find[i].pos=this.currentPos)}findInText(t){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==t&&(this.find[n].pos=this.currentPos-(t.nodeValue.length-this.find[n].offset))}matchesContext(t){if(t.indexOf("|")>-1)return t.split(/\s*\|\s*/).some(this.matchesContext,this);let n=t.split("/"),r=this.options.context,i=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),o=-(r?r.depth+1:0)+(i?0:1),a=(s,u)=>{for(;s>=0;s--){let c=n[s];if(c==""){if(s==n.length-1||s==0)continue;for(;u>=o;u--)if(a(s-1,u))return!0;return!1}else{let l=u>0||u==0&&i?this.nodes[u].type:r&&u>=o?r.node(u-o).type:null;if(!l||l.name!=c&&l.groups.indexOf(c)==-1)return!1;u--}}return!0};return a(n.length-1,this.open)}textblockFromContext(){let t=this.options.context;if(t)for(let n=t.depth;n>=0;n--){let r=t.node(n).contentMatchAt(t.indexAfter(n)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let n in this.parser.schema.nodes){let r=this.parser.schema.nodes[n];if(r.isTextblock&&r.defaultAttrs)return r}}addPendingMark(t){let n=BOe(t,this.top.pendingMarks);n&&this.top.stashMarks.push(n),this.top.pendingMarks=t.addToSet(this.top.pendingMarks)}removePendingMark(t,n){for(let r=this.open;r>=0;r--){let i=this.nodes[r];if(i.pendingMarks.lastIndexOf(t)>-1)i.pendingMarks=t.removeFromSet(i.pendingMarks);else{i.activeMarks=t.removeFromSet(i.activeMarks);let a=i.popFromStashMark(t);a&&i.type&&i.type.allowsMarkType(a.type)&&(i.activeMarks=a.addToSet(i.activeMarks))}if(i==n)break}}}function MOe(e){for(let t=e.firstChild,n=null;t;t=t.nextSibling){let r=t.nodeType==1?t.nodeName.toLowerCase():null;r&&y8.hasOwnProperty(r)&&n?(n.appendChild(t),t=n):r=="li"?n=t:r&&(n=null)}}function LOe(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function jOe(e){let t=/\s*([\w-]+)\s*:\s*([^;]+)/g,n,r=[];for(;n=t.exec(e);)r.push(n[1],n[2].trim());return r}function lk(e){let t={};for(let n in e)t[n]=e[n];return t}function UOe(e,t){let n=t.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(e))continue;let o=[],a=s=>{o.push(s);for(let u=0;u<s.edgeCount;u++){let{type:c,next:l}=s.edge(u);if(c==t||o.indexOf(l)<0&&a(l))return!0}};if(a(i.contentMatch))return!0}}function BOe(e,t){for(let n=0;n<t.length;n++)if(e.eq(t[n]))return t[n]}class au{constructor(t,n){this.nodes=t,this.marks=n}serializeFragment(t,n={},r){r||(r=e1(n).createDocumentFragment());let i=r,o=[];return t.forEach(a=>{if(o.length||a.marks.length){let s=0,u=0;for(;s<o.length&&u<a.marks.length;){let c=a.marks[u];if(!this.marks[c.type.name]){u++;continue}if(!c.eq(o[s][0])||c.type.spec.spanning===!1)break;s++,u++}for(;s<o.length;)i=o.pop()[1];for(;u<a.marks.length;){let c=a.marks[u++],l=this.serializeMark(c,a.isInline,n);l&&(o.push([c,i]),i.appendChild(l.dom),i=l.contentDOM||l.dom)}}i.appendChild(this.serializeNodeInner(a,n))}),r}serializeNodeInner(t,n){let{dom:r,contentDOM:i}=au.renderSpec(e1(n),this.nodes[t.type.name](t));if(i){if(t.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(t.content,n,i)}return r}serializeNode(t,n={}){let r=this.serializeNodeInner(t,n);for(let i=t.marks.length-1;i>=0;i--){let o=this.serializeMark(t.marks[i],t.isInline,n);o&&((o.contentDOM||o.dom).appendChild(r),r=o.dom)}return r}serializeMark(t,n,r={}){let i=this.marks[t.type.name];return i&&au.renderSpec(e1(r),i(t,n))}static renderSpec(t,n,r=null){if(typeof n=="string")return{dom:t.createTextNode(n)};if(n.nodeType!=null)return{dom:n};if(n.dom&&n.dom.nodeType!=null)return n;let i=n[0],o=i.indexOf(" ");o>0&&(r=i.slice(0,o),i=i.slice(o+1));let a,s=r?t.createElementNS(r,i):t.createElement(i),u=n[1],c=1;if(u&&typeof u=="object"&&u.nodeType==null&&!Array.isArray(u)){c=2;for(let l in u)if(u[l]!=null){let d=l.indexOf(" ");d>0?s.setAttributeNS(l.slice(0,d),l.slice(d+1),u[l]):s.setAttribute(l,u[l])}}for(let l=c;l<n.length;l++){let d=n[l];if(d===0){if(l<n.length-1||l>c)throw new RangeError("Content hole must be the only child of its parent node");return{dom:s,contentDOM:s}}else{let{dom:p,contentDOM:A}=au.renderSpec(t,d,r);if(s.appendChild(p),A){if(a)throw new RangeError("Multiple content holes");a=A}}}return{dom:s,contentDOM:a}}static fromSchema(t){return t.cached.domSerializer||(t.cached.domSerializer=new au(this.nodesFromSchema(t),this.marksFromSchema(t)))}static nodesFromSchema(t){let n=fk(t.nodes);return n.text||(n.text=r=>r.text),n}static marksFromSchema(t){return fk(t.marks)}}function fk(e){let t={};for(let n in e){let r=e[n].spec.toDOM;r&&(t[n]=r)}return t}function e1(e){return e.document||window.document}const b8=65535,C8=Math.pow(2,16);function POe(e,t){return e+t*C8}function dk(e){return e&b8}function WOe(e){return(e-(e&b8))/C8}const S8=1,_8=2,om=4,I8=8;let mC=class{constructor(t,n,r){this.pos=t,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&I8)>0}get deletedBefore(){return(this.delInfo&(S8|om))>0}get deletedAfter(){return(this.delInfo&(_8|om))>0}get deletedAcross(){return(this.delInfo&om)>0}},Ul=class al{constructor(t,n=!1){if(this.ranges=t,this.inverted=n,!t.length&&al.empty)return al.empty}recover(t){let n=0,r=dk(t);if(!this.inverted)for(let i=0;i<r;i++)n+=this.ranges[i*3+2]-this.ranges[i*3+1];return this.ranges[r*3]+n+WOe(t)}mapResult(t,n=1){return this._map(t,n,!1)}map(t,n=1){return this._map(t,n,!0)}_map(t,n,r){let i=0,o=this.inverted?2:1,a=this.inverted?1:2;for(let s=0;s<this.ranges.length;s+=3){let u=this.ranges[s]-(this.inverted?i:0);if(u>t)break;let c=this.ranges[s+o],l=this.ranges[s+a],d=u+c;if(t<=d){let p=c?t==u?-1:t==d?1:n:n,A=u+i+(p<0?0:l);if(r)return A;let m=t==(n<0?u:d)?null:POe(s/3,t-u),v=t==u?_8:t==d?S8:om;return(n<0?t!=u:t!=d)&&(v|=I8),new mC(A,v,m)}i+=l-c}return r?t+i:new mC(t+i,0,null)}touches(t,n){let r=0,i=dk(n),o=this.inverted?2:1,a=this.inverted?1:2;for(let s=0;s<this.ranges.length;s+=3){let u=this.ranges[s]-(this.inverted?r:0);if(u>t)break;let c=this.ranges[s+o],l=u+c;if(t<=l&&s==i*3)return!0;r+=this.ranges[s+a]-c}return!1}forEach(t){let n=this.inverted?2:1,r=this.inverted?1:2;for(let i=0,o=0;i<this.ranges.length;i+=3){let a=this.ranges[i],s=a-(this.inverted?o:0),u=a+(this.inverted?0:o),c=this.ranges[i+n],l=this.ranges[i+r];t(s,s+c,u,u+l),o+=l-c}}invert(){return new al(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(t){return t==0?al.empty:new al(t<0?[0,-t,0]:[0,0,t])}};Ul.empty=new Ul([]);class kd{constructor(t=[],n,r=0,i=t.length){this.maps=t,this.mirror=n,this.from=r,this.to=i}slice(t=0,n=this.maps.length){return new kd(this.maps,this.mirror,t,n)}copy(){return new kd(this.maps.slice(),this.mirror&&this.mirror.slice(),this.from,this.to)}appendMap(t,n){this.to=this.maps.push(t),n!=null&&this.setMirror(this.maps.length-1,n)}appendMapping(t){for(let n=0,r=this.maps.length;n<t.maps.length;n++){let i=t.getMirror(n);this.appendMap(t.maps[n],i!=null&&i<n?r+i:void 0)}}getMirror(t){if(this.mirror){for(let n=0;n<this.mirror.length;n++)if(this.mirror[n]==t)return this.mirror[n+(n%2?-1:1)]}}setMirror(t,n){this.mirror||(this.mirror=[]),this.mirror.push(t,n)}appendMappingInverted(t){for(let n=t.maps.length-1,r=this.maps.length+t.maps.length;n>=0;n--){let i=t.getMirror(n);this.appendMap(t.maps[n].invert(),i!=null&&i>n?r-i-1:void 0)}}invert(){let t=new kd;return t.appendMappingInverted(this),t}map(t,n=1){if(this.mirror)return this._map(t,n,!0);for(let r=this.from;r<this.to;r++)t=this.maps[r].map(t,n);return t}mapResult(t,n=1){return this._map(t,n,!1)}_map(t,n,r){let i=0;for(let o=this.from;o<this.to;o++){let a=this.maps[o],s=a.mapResult(t,n);if(s.recover!=null){let u=this.getMirror(o);if(u!=null&&u>o&&u<this.to){o=u,t=this.maps[u].recover(s.recover);continue}}i|=s.delInfo,t=s.pos}return r?t:new mC(t,i,null)}}const t1=Object.create(null);let Sr=class{getMap(){return Ul.empty}merge(t){return null}static fromJSON(t,n){if(!n||!n.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=t1[n.stepType];if(!r)throw new RangeError(`No step type ${n.stepType} defined`);return r.fromJSON(t,n)}static jsonID(t,n){if(t in t1)throw new RangeError("Duplicate use of step JSON ID "+t);return t1[t]=n,n.prototype.jsonID=t,n}},sr=class Id{constructor(t,n){this.doc=t,this.failed=n}static ok(t){return new Id(t,null)}static fail(t){return new Id(null,t)}static fromReplace(t,n,r,i){try{return Id.ok(t.replace(n,r,i))}catch(o){if(o instanceof mp)return Id.fail(o.message);throw o}}};function zR(e,t,n){let r=[];for(let i=0;i<e.childCount;i++){let o=e.child(i);o.content.size&&(o=o.copy(zR(o.content,t,o))),o.isInline&&(o=t(o,n,i)),r.push(o)}return X.fromArray(r)}let T8=class Td extends Sr{constructor(t,n,r){super(),this.from=t,this.to=n,this.mark=r}apply(t){let n=t.slice(this.from,this.to),r=t.resolve(this.from),i=r.node(r.sharedDepth(this.to)),o=new ae(zR(n.content,(a,s)=>!a.isAtom||!s.type.allowsMarkType(this.mark.type)?a:a.mark(this.mark.addToSet(a.marks)),i),n.openStart,n.openEnd);return sr.fromReplace(t,this.from,this.to,o)}invert(){return new x8(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 Td(n.pos,r.pos,this.mark)}merge(t){return t instanceof Td&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new Td(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new Td(n.from,n.to,t.markFromJSON(n.mark))}};Sr.jsonID("addMark",T8);let x8=class xd extends Sr{constructor(t,n,r){super(),this.from=t,this.to=n,this.mark=r}apply(t){let n=t.slice(this.from,this.to),r=new ae(zR(n.content,i=>i.mark(this.mark.removeFromSet(i.marks)),t),n.openStart,n.openEnd);return sr.fromReplace(t,this.from,this.to,r)}invert(){return new T8(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 xd(n.pos,r.pos,this.mark)}merge(t){return t instanceof xd&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new xd(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new xd(n.from,n.to,t.markFromJSON(n.mark))}};Sr.jsonID("removeMark",x8);let w8=class wd extends Sr{constructor(t,n){super(),this.pos=t,this.mark=n}apply(t){let n=t.nodeAt(this.pos);if(!n)return sr.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return sr.fromReplace(t,this.pos,this.pos+1,new ae(X.from(r),0,n.isLeaf?0:1))}invert(t){let n=t.nodeAt(this.pos);if(n){let r=this.mark.addToSet(n.marks);if(r.length==n.marks.length){for(let i=0;i<n.marks.length;i++)if(!n.marks[i].isInSet(r))return new wd(this.pos,n.marks[i]);return new wd(this.pos,this.mark)}}return new E8(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new wd(n.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new wd(n.pos,t.markFromJSON(n.mark))}};Sr.jsonID("addNodeMark",w8);let E8=class gC extends Sr{constructor(t,n){super(),this.pos=t,this.mark=n}apply(t){let n=t.nodeAt(this.pos);if(!n)return sr.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.removeFromSet(n.marks));return sr.fromReplace(t,this.pos,this.pos+1,new ae(X.from(r),0,n.isLeaf?0:1))}invert(t){let n=t.nodeAt(this.pos);return!n||!this.mark.isInSet(n.marks)?this:new w8(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new gC(n.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new gC(n.pos,t.markFromJSON(n.mark))}};Sr.jsonID("removeNodeMark",E8);let Th=class tu extends Sr{constructor(t,n,r,i=!1){super(),this.from=t,this.to=n,this.slice=r,this.structure=i}apply(t){return this.structure&&vC(t,this.from,this.to)?sr.fail("Structure replace would overwrite content"):sr.fromReplace(t,this.from,this.to,this.slice)}getMap(){return new Ul([this.from,this.to-this.from,this.slice.size])}invert(t){return new tu(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 tu(n.pos,Math.max(n.pos,r.pos),this.slice)}merge(t){if(!(t instanceof tu)||t.structure||this.structure)return null;if(this.from+this.slice.size==t.from&&!this.slice.openEnd&&!t.slice.openStart){let n=this.slice.size+t.slice.size==0?ae.empty:new ae(this.slice.content.append(t.slice.content),this.slice.openStart,t.slice.openEnd);return new tu(this.from,this.to+(t.to-t.from),n,this.structure)}else if(t.to==this.from&&!this.slice.openStart&&!t.slice.openEnd){let n=this.slice.size+t.slice.size==0?ae.empty:new ae(t.slice.content.append(this.slice.content),t.slice.openStart,this.slice.openEnd);return new tu(t.from,this.to,n,this.structure)}else return null}toJSON(){let t={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new tu(n.from,n.to,ae.fromJSON(t,n.slice),!!n.structure)}};Sr.jsonID("replace",Th);let aa=class am extends Sr{constructor(t,n,r,i,o,a,s=!1){super(),this.from=t,this.to=n,this.gapFrom=r,this.gapTo=i,this.slice=o,this.insert=a,this.structure=s}apply(t){if(this.structure&&(vC(t,this.from,this.gapFrom)||vC(t,this.gapTo,this.to)))return sr.fail("Structure gap-replace would overwrite content");let n=t.slice(this.gapFrom,this.gapTo);if(n.openStart||n.openEnd)return sr.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,n.content);return r?sr.fromReplace(t,this.from,this.to,r):sr.fail("Content does not fit in gap")}getMap(){return new Ul([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 am(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 am(n.pos,r.pos,i,o,this.slice,this.insert,this.structure)}toJSON(){let t={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number"||typeof n.gapFrom!="number"||typeof n.gapTo!="number"||typeof n.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new am(n.from,n.to,n.gapFrom,n.gapTo,ae.fromJSON(t,n.slice),n.insert,!!n.structure)}};Sr.jsonID("replaceAround",aa);function vC(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 a=r.node(o).maybeChild(r.indexAfter(o));for(;i>0;){if(!a||a.isLeaf)return!0;a=a.firstChild,i--}}return!1}function DOe(e,t,n){return(t==0||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function xh(e){let n=e.parent.content.cutByIndex(e.startIndex,e.endIndex);for(let r=e.depth;;--r){let i=e.$from.node(r),o=e.$from.index(r),a=e.$to.indexAfter(r);if(r<e.depth&&i.canReplace(o,a,n))return r;if(r==0||i.type.spec.isolating||!DOe(i,o,a))break}return null}function $8(e,t,n=null,r=e){let i=KOe(e,t),o=i&&NOe(r,t);return o?i.map(pk).concat({type:t,attrs:n}).concat(o.map(pk)):null}function pk(e){return{type:e,attrs:null}}function KOe(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}function NOe(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 c=r;u&&c<i;c++)u=u.matchType(n.child(c).type);return!u||!u.validEnd?null:a}function R8(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 c=i.depth-1,l=n-2;c>o;c--,l--){let d=i.node(c),p=i.index(c);if(d.type.spec.isolating)return!1;let A=d.content.cutByIndex(p,d.childCount),m=r&&r[l+1];m&&(A=A.replaceChild(0,m.type.create(m.attrs)));let v=r&&r[l]||d;if(!d.canReplace(p+1,d.childCount)||!v.type.validContent(A))return!1}let s=i.indexAfter(o),u=r&&r[0];return i.node(o).canReplaceWith(s,s,u?u.type:i.node(o+1).type)}function wh(e,t){let n=e.resolve(t),r=n.index();return O8(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function O8(e,t){return!!(e&&t&&!e.isLeaf&&e.canAppend(t))}function F8(e,t,n=-1){let r=e.resolve(t);for(let i=r.depth;;i--){let o,a,s=r.index(i);if(i==r.depth?(o=r.nodeBefore,a=r.nodeAfter):n>0?(o=r.node(i+1),s++,a=r.node(i).maybeChild(s)):(o=r.node(i).maybeChild(s-1),a=r.node(i+1)),o&&!o.isTextblock&&O8(o,a)&&r.node(i).canReplace(s,s+1))return t;if(i==0)break;t=n<0?r.before(i):r.after(i)}}function qOe(e,t,n){let r=e.resolve(t);if(!n.content.size)return t;let i=n.content;for(let o=0;o<n.openStart;o++)i=i.firstChild.content;for(let o=1;o<=(n.openStart==0&&n.size?2:1);o++)for(let a=r.depth;a>=0;a--){let s=a==r.depth?0:r.pos<=(r.start(a+1)+r.end(a+1))/2?-1:1,u=r.index(a)+(s>0?1:0),c=r.node(a),l=!1;if(o==1)l=c.canReplace(u,u,i);else{let d=c.contentMatchAt(u).findWrapping(i.firstChild.type);l=d&&c.canReplaceWith(u,u,d[0])}if(l)return s==0?r.pos:s<0?r.before(a+1):r.after(a+1)}return null}function HR(e,t,n=t,r=ae.empty){if(t==n&&!r.size)return null;let i=e.resolve(t),o=e.resolve(n);return VOe(i,o,r)?new Th(t,n,r):new QOe(i,o,r).fit()}function VOe(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}class QOe{constructor(t,n,r){this.$from=t,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=X.empty;for(let i=0;i<=t.depth;i++){let o=t.node(i);this.frontier.push({type:o.type,match:o.contentMatchAt(t.indexAfter(i))})}for(let i=t.depth;i>0;i--)this.placed=X.from(t.node(i).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let c=this.findFittable();c?this.placeNodes(c):this.openMore()||this.dropNode()}let t=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,r=this.$from,i=this.close(t<0?this.$to:r.doc.resolve(t));if(!i)return null;let o=this.placed,a=r.depth,s=i.depth;for(;a&&s&&o.childCount==1;)o=o.firstChild.content,a--,s--;let u=new ae(o,a,s);return t>-1?new aa(r.pos,t,this.$to.pos,this.$to.end(),u,n):u.size||r.pos!=this.$to.pos?new Th(r.pos,i.pos,u):null}findFittable(){let t=this.unplaced.openStart;for(let n=this.unplaced.content,r=0,i=this.unplaced.openEnd;r<t;r++){let o=n.firstChild;if(n.childCount>1&&(i=0),o.type.spec.isolating&&i<=r){t=r;break}n=o.content}for(let n=1;n<=2;n++)for(let r=n==1?t:this.unplaced.openStart;r>=0;r--){let i,o=null;r?(o=n1(this.unplaced.content,r-1).firstChild,i=o.content):i=this.unplaced.content;let a=i.firstChild;for(let s=this.depth;s>=0;s--){let{type:u,match:c}=this.frontier[s],l,d=null;if(n==1&&(a?c.matchType(a.type)||(d=c.fillBefore(X.from(a),!1)):o&&u.compatibleContent(o.type)))return{sliceDepth:r,frontierDepth:s,parent:o,inject:d};if(n==2&&a&&(l=c.findWrapping(a.type)))return{sliceDepth:r,frontierDepth:s,parent:o,wrap:l};if(o&&c.matchType(o.type))break}}}openMore(){let{content:t,openStart:n,openEnd:r}=this.unplaced,i=n1(t,n);return!i.childCount||i.firstChild.isLeaf?!1:(this.unplaced=new ae(t,n+1,Math.max(r,i.size+n>=t.size-r?n+1:0)),!0)}dropNode(){let{content:t,openStart:n,openEnd:r}=this.unplaced,i=n1(t,n);if(i.childCount<=1&&n>0){let o=t.size-n<=n+i.size;this.unplaced=new ae(Ed(t,n-1,1),n-1,o?n-1:r)}else this.unplaced=new ae(Ed(t,n,1),n,r)}placeNodes({sliceDepth:t,frontierDepth:n,parent:r,inject:i,wrap:o}){for(;this.depth>n;)this.closeFrontierNode();if(o)for(let v=0;v<o.length;v++)this.openFrontierNode(o[v]);let a=this.unplaced,s=r?r.content:a.content,u=a.openStart-t,c=0,l=[],{match:d,type:p}=this.frontier[n];if(i){for(let v=0;v<i.childCount;v++)l.push(i.child(v));d=d.matchFragment(i)}let A=s.size+t-(a.content.size-a.openEnd);for(;c<s.childCount;){let v=s.child(c),_=d.matchType(v.type);if(!_)break;c++,(c>1||u==0||v.content.size)&&(d=_,l.push(k8(v.mark(p.allowedMarks(v.marks)),c==1?u:0,c==s.childCount?A:-1)))}let m=c==s.childCount;m||(A=-1),this.placed=$d(this.placed,n,X.from(l)),this.frontier[n].match=d,m&&A<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let v=0,_=s;v<A;v++){let C=_.lastChild;this.frontier.push({type:C.type,match:C.contentMatchAt(C.childCount)}),_=C.content}this.unplaced=m?t==0?ae.empty:new ae(Ed(a.content,t-1,1),t-1,A<0?a.openEnd:t-1):new ae(Ed(a.content,t,c),a.openStart,a.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let t=this.frontier[this.depth],n;if(!t.type.isTextblock||!r1(this.$to,this.$to.depth,t.type,t.match,!1)||this.$to.depth==this.depth&&(n=this.findCloseLevel(this.$to))&&n.depth==this.depth)return-1;let{depth:r}=this.$to,i=this.$to.after(r);for(;r>1&&i==this.$to.end(--r);)++i;return i}findCloseLevel(t){e:for(let n=Math.min(this.depth,t.depth);n>=0;n--){let{match:r,type:i}=this.frontier[n],o=n<t.depth&&t.end(n+1)==t.pos+(t.depth-(n+1)),a=r1(t,n,i,r,o);if(a){for(let s=n-1;s>=0;s--){let{match:u,type:c}=this.frontier[s],l=r1(t,s,c,u,!0);if(!l||l.childCount)continue e}return{depth:n,fit:a,move:o?t.doc.resolve(t.after(n+1)):t}}}}close(t){let n=this.findCloseLevel(t);if(!n)return null;for(;this.depth>n.depth;)this.closeFrontierNode();n.fit.childCount&&(this.placed=$d(this.placed,n.depth,n.fit)),t=n.move;for(let r=n.depth+1;r<=t.depth;r++){let i=t.node(r),o=i.type.contentMatch.fillBefore(i.content,!0,t.index(r));this.openFrontierNode(i.type,i.attrs,o)}return t}openFrontierNode(t,n=null,r){let i=this.frontier[this.depth];i.match=i.match.matchType(t),this.placed=$d(this.placed,this.depth,X.from(t.create(n,r))),this.frontier.push({type:t,match:t.contentMatch})}closeFrontierNode(){let n=this.frontier.pop().match.fillBefore(X.empty,!0);n.childCount&&(this.placed=$d(this.placed,this.frontier.length,n))}}function Ed(e,t,n){return t==0?e.cutByIndex(n,e.childCount):e.replaceChild(0,e.firstChild.copy(Ed(e.firstChild.content,t-1,n)))}function $d(e,t,n){return t==0?e.append(n):e.replaceChild(e.childCount-1,e.lastChild.copy($d(e.lastChild.content,t-1,n)))}function n1(e,t){for(let n=0;n<t;n++)e=e.firstChild.content;return e}function k8(e,t,n){if(t<=0)return e;let r=e.content;return t>1&&(r=r.replaceChild(0,k8(r.firstChild,t-1,r.childCount==1?n-1:0))),t>0&&(r=e.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(e.type.contentMatch.matchFragment(r).fillBefore(X.empty,!0)))),e.copy(r)}function r1(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 s=r.fillBefore(o.content,!0,a);return s&&!zOe(n,o.content,a)?s:null}function zOe(e,t,n){for(let r=n;r<t.childCount;r++)if(!e.allowsMarks(t.child(r).marks))return!0;return!1}let HOe=class sm extends Sr{constructor(t,n,r){super(),this.pos=t,this.attr=n,this.value=r}apply(t){let n=t.nodeAt(this.pos);if(!n)return sr.fail("No node at attribute step's position");let r=Object.create(null);for(let o in n.attrs)r[o]=n.attrs[o];r[this.attr]=this.value;let i=n.type.create(r,null,n.marks);return sr.fromReplace(t,this.pos,this.pos+1,new ae(X.from(i),0,n.isLeaf?0:1))}getMap(){return Ul.empty}invert(t){return new sm(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 sm(n.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(t,n){if(typeof n.pos!="number"||typeof n.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new sm(n.pos,n.attr,n.value)}};Sr.jsonID("attr",HOe);let vp=class extends Error{};vp=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n};vp.prototype=Object.create(Error.prototype);vp.prototype.constructor=vp;vp.prototype.name="TransformError";const i1=Object.create(null);class ze{constructor(t,n,r){this.$anchor=t,this.$head=n,this.ranges=r||[new YOe(t.min(n),t.max(n))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let t=this.ranges;for(let n=0;n<t.length;n++)if(t[n].$from.pos!=t[n].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(t,n=ae.empty){let r=n.content.lastChild,i=null;for(let s=0;s<n.openEnd;s++)i=r,r=r.lastChild;let o=t.steps.length,a=this.ranges;for(let s=0;s<a.length;s++){let{$from:u,$to:c}=a[s],l=t.mapping.slice(o);t.replaceRange(l.map(u.pos),l.map(c.pos),s?ae.empty:n),s==0&&mk(t,o,(r?r.isInline:i&&i.isTextblock)?-1:1)}}replaceWith(t,n){let r=t.steps.length,i=this.ranges;for(let o=0;o<i.length;o++){let{$from:a,$to:s}=i[o],u=t.mapping.slice(r),c=u.map(a.pos),l=u.map(s.pos);o?t.deleteRange(c,l):(t.replaceRangeWith(c,l,n),mk(t,r,n.isInline?-1:1))}}static findFrom(t,n,r=!1){let i=t.parent.inlineContent?new Be(t):sl(t.node(0),t.parent,t.pos,t.index(),n,r);if(i)return i;for(let o=t.depth-1;o>=0;o--){let a=n<0?sl(t.node(0),t.node(o),t.before(o+1),t.index(o),n,r):sl(t.node(0),t.node(o),t.after(o+1),t.index(o)+1,n,r);if(a)return a}return null}static near(t,n=1){return this.findFrom(t,n)||this.findFrom(t,-n)||new Ri(t.node(0))}static atStart(t){return sl(t,t,0,0,1)||new Ri(t)}static atEnd(t){return sl(t,t,t.content.size,t.childCount,-1)||new Ri(t)}static fromJSON(t,n){if(!n||!n.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=i1[n.type];if(!r)throw new RangeError(`No selection type ${n.type} defined`);return r.fromJSON(t,n)}static jsonID(t,n){if(t in i1)throw new RangeError("Duplicate use of selection JSON ID "+t);return i1[t]=n,n.prototype.jsonID=t,n}getBookmark(){return Be.between(this.$anchor,this.$head).getBookmark()}}ze.prototype.visible=!0;class YOe{constructor(t,n){this.$from=t,this.$to=n}}let Ak=!1;function hk(e){!Ak&&!e.parent.inlineContent&&(Ak=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+e.parent.type.name+")"))}class Be extends ze{constructor(t,n=t){hk(t),hk(n),super(t,n)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(t,n){let r=t.resolve(n.map(this.head));if(!r.parent.inlineContent)return ze.near(r);let i=t.resolve(n.map(this.anchor));return new Be(i.parent.inlineContent?i:r,r)}replace(t,n=ae.empty){if(super.replace(t,n),n==ae.empty){let r=this.$from.marksAcross(this.$to);r&&t.ensureMarks(r)}}eq(t){return t instanceof Be&&t.anchor==this.anchor&&t.head==this.head}getBookmark(){return new H0(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(t,n){if(typeof n.anchor!="number"||typeof n.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new Be(t.resolve(n.anchor),t.resolve(n.head))}static create(t,n,r=n){let i=t.resolve(n);return new this(i,r==n?i:t.resolve(r))}static between(t,n,r){let i=t.pos-n.pos;if((!r||i)&&(r=i>=0?1:-1),!n.parent.inlineContent){let o=ze.findFrom(n,r,!0)||ze.findFrom(n,-r,!0);if(o)n=o.$head;else return ze.near(n,r)}return t.parent.inlineContent||(i==0?t=n:(t=(ze.findFrom(t,-r,!0)||ze.findFrom(t,r,!0)).$anchor,t.pos<n.pos!=i<0&&(t=n))),new Be(t,n)}}ze.jsonID("text",Be);class H0{constructor(t,n){this.anchor=t,this.head=n}map(t){return new H0(t.map(this.anchor),t.map(this.head))}resolve(t){return Be.between(t.resolve(this.anchor),t.resolve(this.head))}}class ve extends ze{constructor(t){let n=t.nodeAfter,r=t.node(0).resolve(t.pos+n.nodeSize);super(t,r),this.node=n}map(t,n){let{deleted:r,pos:i}=n.mapResult(this.anchor),o=t.resolve(i);return r?ze.near(o):new ve(o)}content(){return new ae(X.from(this.node),0,0)}eq(t){return t instanceof ve&&t.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new YR(this.anchor)}static fromJSON(t,n){if(typeof n.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new ve(t.resolve(n.anchor))}static create(t,n){return new ve(t.resolve(n))}static isSelectable(t){return!t.isText&&t.type.spec.selectable!==!1}}ve.prototype.visible=!1;ze.jsonID("node",ve);class YR{constructor(t){this.anchor=t}map(t){let{deleted:n,pos:r}=t.mapResult(this.anchor);return n?new H0(r,r):new YR(r)}resolve(t){let n=t.resolve(this.anchor),r=n.nodeAfter;return r&&ve.isSelectable(r)?new ve(n):ze.near(n)}}class Ri extends ze{constructor(t){super(t.resolve(0),t.resolve(t.content.size))}replace(t,n=ae.empty){if(n==ae.empty){t.delete(0,t.doc.content.size);let r=ze.atStart(t.doc);r.eq(t.selection)||t.setSelection(r)}else super.replace(t,n)}toJSON(){return{type:"all"}}static fromJSON(t){return new Ri(t)}map(t){return new Ri(t)}eq(t){return t instanceof Ri}getBookmark(){return GOe}}ze.jsonID("all",Ri);const GOe={map(){return this},resolve(e){return new Ri(e)}};function sl(e,t,n,r,i,o=!1){if(t.inlineContent)return Be.create(e,n);for(let a=r-(i>0?0:1);i>0?a<t.childCount:a>=0;a+=i){let s=t.child(a);if(s.isAtom){if(!o&&ve.isSelectable(s))return ve.create(e,n-(i<0?s.nodeSize:0))}else{let u=sl(e,s,n+i,i<0?s.childCount:0,i,o);if(u)return u}n+=s.nodeSize*i}return null}function mk(e,t,n){let r=e.steps.length-1;if(r<t)return;let i=e.steps[r];if(!(i instanceof Th||i instanceof aa))return;let o=e.mapping.maps[r],a;o.forEach((s,u,c,l)=>{a==null&&(a=l)}),e.setSelection(ze.near(e.doc.resolve(a),n))}function gk(e,t){return!t||!e?e:e.bind(t)}class Hh{constructor(t,n,r){this.name=t,this.init=gk(n.init,r),this.apply=gk(n.apply,r)}}new Hh("doc",{init(e){return e.doc||e.schema.topNodeType.createAndFill()},apply(e){return e.doc}}),new Hh("selection",{init(e,t){return e.selection||ze.atStart(t.doc)},apply(e){return e.selection}}),new Hh("storedMarks",{init(e){return e.storedMarks||null},apply(e,t,n,r){return r.selection.$cursor?e.storedMarks:null}}),new Hh("scrollToSelection",{init(){return 0},apply(e,t){return e.scrolledIntoView?t+1:t}});function M8(e,t,n){for(let r in e){let i=e[r];i instanceof Function?i=i.bind(t):r=="handleDOMEvents"&&(i=M8(i,t,{})),n[r]=i}return n}class zr{constructor(t){this.spec=t,this.props={},t.props&&M8(t.props,this,this.props),this.key=t.key?t.key.key:L8("plugin")}getState(t){return t[this.key]}}const o1=Object.create(null);function L8(e){return e in o1?e+"$"+ ++o1[e]:(o1[e]=0,e+"$")}class eo{constructor(t="key"){this.key=L8(t)}get(t){return t.config.pluginsByKey[this.key]}getState(t){return t[this.key]}}const Dc=function(e){for(var t=0;;t++)if(e=e.previousSibling,!e)return t},j8=function(e,t,n,r){return n&&(vk(e,t,n,r,-1)||vk(e,t,n,r,1))},JOe=/^(img|br|input|textarea|hr)$/i;function vk(e,t,n,r,i){for(;;){if(e==n&&t==r)return!0;if(t==(i<0?0:Ym(e))){let o=e.parentNode;if(!o||o.nodeType!=1||GR(e)||JOe.test(e.nodeName)||e.contentEditable=="false")return!1;t=Dc(e)+(i<0?0:1),e=o}else if(e.nodeType==1){if(e=e.childNodes[t+(i<0?-1:0)],e.contentEditable=="false")return!1;t=i<0?Ym(e):0}else return!1}}function Ym(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function ZOe(e,t,n){for(let r=t==0,i=t==Ym(e);r||i;){if(e==n)return!0;let o=Dc(e);if(e=e.parentNode,!e)return!1;r=r&&o==0,i=i&&o==Ym(e)}}function GR(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)}const U8=function(e){return e.focusNode&&j8(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)};function B8(e,t){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=e,n.key=n.code=t,n}const ho=typeof navigator<"u"?navigator:null,yk=typeof document<"u"?document:null,zs=ho&&ho.userAgent||"",yC=/Edge\/(\d+)/.exec(zs),P8=/MSIE \d/.exec(zs),bC=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(zs),Eh=!!(P8||bC||yC),W8=P8?document.documentMode:bC?+bC[1]:yC?+yC[1]:0,Y0=!Eh&&/gecko\/(\d+)/i.test(zs);Y0&&+(/Firefox\/(\d+)/.exec(zs)||[0,0])[1];const CC=!Eh&&/Chrome\/(\d+)/.exec(zs),Hs=!!CC,D8=CC?+CC[1]:0,Kc=!Eh&&!!ho&&/Apple Computer/.test(ho.vendor),JR=Kc&&(/Mobile\/\w+/.test(zs)||!!ho&&ho.maxTouchPoints>2),Xr=JR||(ho?/Mac/.test(ho.platform):!1),XOe=ho?/Win/.test(ho.platform):!1,$h=/Android \d/.test(zs),ZR=!!yk&&"webkitFontSmoothing"in yk.documentElement.style,eFe=ZR?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function tFe(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&&i.size==0,a=e.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(a<0)return null;let s=r.resolve(a),u,c;if(U8(n)){for(u=s;i&&!i.node;)i=i.parent;let l=i.node;if(i&&l.isAtom&&ve.isSelectable(l)&&i.parent&&!(l.isInline&&ZOe(n.focusNode,n.focusOffset,i.dom))){let d=i.posBefore;c=new ve(a==d?s:r.resolve(d))}}else{let l=e.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(l<0)return null;u=r.resolve(l)}if(!c){let l=t=="pointer"||e.state.selection.head<s.pos&&!o?1:-1;c=N8(e,u,s,l)}return c}function K8(e){return e.editable?e.hasFocus():oFe(e)&&document.activeElement&&document.activeElement.contains(e.dom)}function XR(e,t=!1){let n=e.state.selection;if(iFe(e,n),!!K8(e)){if(!t&&e.input.mouseDown&&e.input.mouseDown.allowDefault&&Hs){let r=e.domSelectionRange(),i=e.domObserver.currentSelection;if(r.anchorNode&&i.anchorNode&&j8(r.anchorNode,r.anchorOffset,i.anchorNode,i.anchorOffset)){e.input.mouseDown.delayedSelectionSync=!0,e.domObserver.setCurSelection();return}}if(e.domObserver.disconnectSelection(),e.cursorWrapper)rFe(e);else{let{anchor:r,head:i}=n,o,a;bk&&!(n instanceof Be)&&(n.$from.parent.inlineContent||(o=Ck(e,n.from)),!n.empty&&!n.$from.parent.inlineContent&&(a=Ck(e,n.to))),e.docView.setSelection(r,i,e.root,t),bk&&(o&&Sk(o),a&&Sk(a)),n.visible?e.dom.classList.remove("ProseMirror-hideselection"):(e.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&nFe(e))}e.domObserver.setCurSelection(),e.domObserver.connectSelection()}}const bk=Kc||Hs&&D8<63;function Ck(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(Kc&&i&&i.contentEditable=="false")return a1(i);if((!i||i.contentEditable=="false")&&(!o||o.contentEditable=="false")){if(i)return a1(i);if(o)return a1(o)}}function a1(e){return e.contentEditable="true",Kc&&e.draggable&&(e.draggable=!1,e.wasDraggable=!0),e}function Sk(e){e.contentEditable="false",e.wasDraggable&&(e.draggable=!0,e.wasDraggable=null)}function nFe(e){let t=e.dom.ownerDocument;t.removeEventListener("selectionchange",e.input.hideSelectionGuard);let n=e.domSelectionRange(),r=n.anchorNode,i=n.anchorOffset;t.addEventListener("selectionchange",e.input.hideSelectionGuard=()=>{(n.anchorNode!=r||n.anchorOffset!=i)&&(t.removeEventListener("selectionchange",e.input.hideSelectionGuard),setTimeout(()=>{(!K8(e)||e.state.selection.visible)&&e.dom.classList.remove("ProseMirror-hideselection")},20))})}function rFe(e){let t=e.domSelection(),n=document.createRange();if(!t)return;let r=e.cursorWrapper.dom,i=r.nodeName=="IMG";i?n.setStart(r.parentNode,Dc(r)+1):n.setStart(r,0),n.collapse(!0),t.removeAllRanges(),t.addRange(n),!i&&!e.state.selection.visible&&Eh&&W8<=11&&(r.disabled=!0,r.disabled=!1)}function iFe(e,t){if(t instanceof ve){let n=e.docView.descAt(t.from);n!=e.lastSelectedViewDesc&&(_k(e),n&&n.selectNode(),e.lastSelectedViewDesc=n)}else _k(e)}function _k(e){e.lastSelectedViewDesc&&(e.lastSelectedViewDesc.parent&&e.lastSelectedViewDesc.deselectNode(),e.lastSelectedViewDesc=void 0)}function N8(e,t,n,r){return e.someProp("createSelectionBetween",i=>i(e,t,n))||Be.between(t,n,r)}function oFe(e){let t=e.domSelectionRange();if(!t.anchorNode)return!1;try{return e.dom.contains(t.anchorNode.nodeType==3?t.anchorNode.parentNode:t.anchorNode)&&(e.editable||e.dom.contains(t.focusNode.nodeType==3?t.focusNode.parentNode:t.focusNode))}catch{return!1}}function SC(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&&ze.findFrom(o,t)}function Ya(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function Ik(e,t,n){let r=e.state.selection;if(r instanceof Be)if(n.indexOf("s")>-1){let{$head:i}=r,o=i.textOffset?null:t<0?i.nodeBefore:i.nodeAfter;if(!o||o.isText||!o.isLeaf)return!1;let a=e.state.doc.resolve(i.pos+o.nodeSize*(t<0?-1:1));return Ya(e,new Be(r.$anchor,a))}else if(r.empty){if(e.endOfTextblock(t>0?"forward":"backward")){let i=SC(e.state,t);return i&&i instanceof ve?Ya(e,i):!1}else if(!(Xr&&n.indexOf("m")>-1)){let i=r.$head,o=i.textOffset?null:t<0?i.nodeBefore:i.nodeAfter,a;if(!o||o.isText)return!1;let s=t<0?i.pos-o.nodeSize:i.pos;return o.isAtom||(a=e.docView.descAt(s))&&!a.contentDOM?ve.isSelectable(o)?Ya(e,new ve(t<0?e.state.doc.resolve(i.pos-o.nodeSize):i)):ZR?Ya(e,new Be(e.state.doc.resolve(t<0?s:s+o.nodeSize))):!1:!1}}else return!1;else{if(r instanceof ve&&r.node.isInline)return Ya(e,new Be(t>0?r.$to:r.$from));{let i=SC(e.state,t);return i?Ya(e,i):!1}}}function Gm(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function Md(e,t){let n=e.pmViewDesc;return n&&n.size==0&&(t<0||e.nextSibling||e.nodeName!="BR")}function el(e,t){return t<0?aFe(e):sFe(e)}function aFe(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i,o,a=!1;for(Y0&&n.nodeType==1&&r<Gm(n)&&Md(n.childNodes[r],-1)&&(a=!0);;)if(r>0){if(n.nodeType!=1)break;{let s=n.childNodes[r-1];if(Md(s,-1))i=n,o=--r;else if(s.nodeType==3)n=s,r=n.nodeValue.length;else break}}else{if(q8(n))break;{let s=n.previousSibling;for(;s&&Md(s,-1);)i=n.parentNode,o=Dc(s),s=s.previousSibling;if(s)n=s,r=Gm(n);else{if(n=n.parentNode,n==e.dom)break;r=0}}}a?_C(e,n,r):i&&_C(e,i,o)}function sFe(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i=Gm(n),o,a;for(;;)if(r<i){if(n.nodeType!=1)break;let s=n.childNodes[r];if(Md(s,1))o=n,a=++r;else break}else{if(q8(n))break;{let s=n.nextSibling;for(;s&&Md(s,1);)o=s.parentNode,a=Dc(s)+1,s=s.nextSibling;if(s)n=s,r=0,i=Gm(n);else{if(n=n.parentNode,n==e.dom)break;r=i=0}}}o&&_C(e,o,a)}function q8(e){let t=e.pmViewDesc;return t&&t.node&&t.node.isBlock}function uFe(e,t){for(;e&&t==e.childNodes.length&&!GR(e);)t=Dc(e)+1,e=e.parentNode;for(;e&&t<e.childNodes.length;){let n=e.childNodes[t];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable=="false")break;e=n,t=0}}function cFe(e,t){for(;e&&!t&&!GR(e);)t=Dc(e),e=e.parentNode;for(;e&&t;){let n=e.childNodes[t-1];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable=="false")break;e=n,t=e.childNodes.length}}function _C(e,t,n){if(t.nodeType!=3){let o,a;(a=uFe(t,n))?(t=a,n=0):(o=cFe(t,n))&&(t=o,n=o.nodeValue.length)}let r=e.domSelection();if(!r)return;if(U8(r)){let o=document.createRange();o.setEnd(t,n),o.setStart(t,n),r.removeAllRanges(),r.addRange(o)}else r.extend&&r.extend(t,n);e.domObserver.setCurSelection();let{state:i}=e;setTimeout(()=>{e.state==i&&XR(e)},50)}function Tk(e,t){let n=e.state.doc.resolve(t);if(!(Hs||XOe)&&n.parent.inlineContent){let i=e.coordsAtPos(t);if(t>n.start()){let o=e.coordsAtPos(t-1),a=(o.top+o.bottom)/2;if(a>i.top&&a<i.bottom&&Math.abs(o.left-i.left)>1)return o.left<i.left?"ltr":"rtl"}if(t<n.end()){let o=e.coordsAtPos(t+1),a=(o.top+o.bottom)/2;if(a>i.top&&a<i.bottom&&Math.abs(o.left-i.left)>1)return o.left>i.left?"ltr":"rtl"}}return getComputedStyle(e.dom).direction=="rtl"?"rtl":"ltr"}function xk(e,t,n){let r=e.state.selection;if(r instanceof Be&&!r.empty||n.indexOf("s")>-1||Xr&&n.indexOf("m")>-1)return!1;let{$from:i,$to:o}=r;if(!i.parent.inlineContent||e.endOfTextblock(t<0?"up":"down")){let a=SC(e.state,t);if(a&&a instanceof ve)return Ya(e,a)}if(!i.parent.inlineContent){let a=t<0?i:o,s=r instanceof Ri?ze.near(a,t):ze.findFrom(a,t);return s?Ya(e,s):!1}return!1}function wk(e,t){if(!(e.state.selection instanceof Be))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 a=e.state.tr;return t<0?a.delete(n.pos-o.nodeSize,n.pos):a.delete(n.pos,n.pos+o.nodeSize),e.dispatch(a),!0}return!1}function Ek(e,t,n){e.domObserver.stop(),t.contentEditable=n,e.domObserver.start()}function lFe(e){if(!Kc||e.state.selection.$head.parentOffset>0)return!1;let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(t&&t.nodeType==1&&n==0&&t.firstChild&&t.firstChild.contentEditable=="false"){let r=t.firstChild;Ek(e,r,"true"),setTimeout(()=>Ek(e,r,"false"),20)}return!1}function fFe(e){let t="";return e.ctrlKey&&(t+="c"),e.metaKey&&(t+="m"),e.altKey&&(t+="a"),e.shiftKey&&(t+="s"),t}function dFe(e,t){let n=t.keyCode,r=fFe(t);if(n==8||Xr&&n==72&&r=="c")return wk(e,-1)||el(e,-1);if(n==46&&!t.shiftKey||Xr&&n==68&&r=="c")return wk(e,1)||el(e,1);if(n==13||n==27)return!0;if(n==37||Xr&&n==66&&r=="c"){let i=n==37?Tk(e,e.state.selection.from)=="ltr"?-1:1:-1;return Ik(e,i,r)||el(e,i)}else if(n==39||Xr&&n==70&&r=="c"){let i=n==39?Tk(e,e.state.selection.from)=="ltr"?1:-1:1;return Ik(e,i,r)||el(e,i)}else{if(n==38||Xr&&n==80&&r=="c")return xk(e,-1,r)||el(e,-1);if(n==40||Xr&&n==78&&r=="c")return lFe(e)||xk(e,1,r)||el(e,1);if(r==(Xr?"m":"c")&&(n==66||n==73||n==89||n==90))return!0}return!1}function V8(e,t){e.someProp("transformCopied",A=>{t=A(t,e)});let n=[],{content:r,openStart:i,openEnd:o}=t;for(;i>1&&o>1&&r.childCount==1&&r.firstChild.childCount==1;){i--,o--;let A=r.firstChild;n.push(A.type.name,A.attrs!=A.type.defaultAttrs?A.attrs:null),r=A.content}let a=e.someProp("clipboardSerializer")||au.fromSchema(e.state.schema),s=J8(),u=s.createElement("div");u.appendChild(a.serializeFragment(r,{document:s}));let c=u.firstChild,l,d=0;for(;c&&c.nodeType==1&&(l=G8[c.nodeName.toLowerCase()]);){for(let A=l.length-1;A>=0;A--){let m=s.createElement(l[A]);for(;u.firstChild;)m.appendChild(u.firstChild);u.appendChild(m),d++}c=u.firstChild}c&&c.nodeType==1&&c.setAttribute("data-pm-slice",`${i} ${o}${d?` -${d}`:""} ${JSON.stringify(n)}`);let p=e.someProp("clipboardTextSerializer",A=>A(t,e))||t.content.textBetween(0,t.content.size,`
37
+ npx @slicemachine/init@latest --repository <my-project>`,language:"bash",title:"Terminal",showLineNumbers:!1})]})},{id:"createPageType",title:"Create a Page Type",description:"Build the structure of your page",videoUrl:"https://res.cloudinary.com/dmtf1daqp/video/upload/v1721918320/DEV_TOOLS/ONBOARDING_GUIDE/Create_page_type_xdn13j.mp4",content:f.jsx(h.Text,{children:"A page type is a base content structure editors will use to create pages in the Page Builder (Prismic's content creation UI). A page type can be reusable (e.g., for multiple blog posts) or single (e.g., for a one-time page like the homepage)."})},{id:"codePage",title:"Code Your Page Type",description:"Prepare code to fetch content",videoUrl:"https://res.cloudinary.com/dmtf1daqp/video/upload/v1721918320/DEV_TOOLS/ONBOARDING_GUIDE/Step2_code_your_page_jatiur.mp4",content:f.jsx(h.Text,{children:"Prepare your code to query the content from the Prismic API."})},{id:"createSlice",title:"Create a Slice",description:"Build a reusable website section",videoUrl:"https://res.cloudinary.com/dmtf1daqp/video/upload/v1721918322/DEV_TOOLS/ONBOARDING_GUIDE/Step3_add_slice_qzmvxf.mp4",content:f.jsx(h.Text,{children:"Slices are website sections that can be reused on different pages with different content. Each slice has a code component automatically generated by Slice Machine. Start with a template and look at your code to see how it's structured."})},{id:"reviewAndPush",title:"Review and Push changes",description:"Enable editors to create content",videoUrl:"https://res.cloudinary.com/dmtf1daqp/video/upload/v1721918320/DEV_TOOLS/ONBOARDING_GUIDE/DevTools_Squad_push_changes_ovvmul.mp4",content:f.jsx(h.Text,{children:"Your page types and slices currently exist only in your local project. Push them to your repository to make them available for your content editors."})},{id:"createContent",title:"Create Content",description:"Publish a page to the Prismic API",videoUrl:"https://res.cloudinary.com/dmtf1daqp/video/upload/v1721918324/DEV_TOOLS/ONBOARDING_GUIDE/Cre%CC%81er_contenu_e%CC%81tape_4_z9vlzt.mp4",content:f.jsx(h.Text,{children:"In Prismic, content creation takes place in the Prismic Page Builder UI. Open the Page Builder and start creating your first page."})},{id:"renderPage",title:"Render Your Page",description:"View your page in the browser",videoUrl:"https://res.cloudinary.com/dmtf1daqp/video/upload/v1721918321/DEV_TOOLS/ONBOARDING_GUIDE/Step_6_Render_Page_tnauh9.mp4",content:f.jsxs(h.Text,{children:["Now that your content is published, you can run your project in your terminal and visit the page on your local server (e.g.,"," ",f.jsx(h.Text,{component:"code",children:"localhost:3000/example-page"}),"). Your content should now be visible!"]})}],o={next:"https://prismic.dev/course/next",nuxt:"https://prismic.dev/course/nuxt",sveltekit:"https://prismic.dev/course/sveltekit"};return{steps:i,defaultCompletedStepIds:i.flatMap(a=>a.defaultCompleted?[a.id]:[]),tutorialLink:e?o[e]:void 0}}const Yb=3e3,ZF=400;function I$e(e){const{onboardingState:t,tracking:n,onToggleStep:r,onToggleGuide:i}=e,{context:o,isDismissed:a}=t,{steps:s,defaultCompletedStepIds:u,tutorialLink:c}=_$e(o.framework,o.starterId),l=v(t.completedSteps),d=T$e(A,ZF);if(o.framework==="other")return null;function p(){i(),d.reset()}function A(){i()}async function m(_){const C=await r(_.id);C.includes(_.id)&&n.track({event:"shared-onboarding:step-completed",stepId:_.id,stepTitle:_.title,source:n.source}),v(C).length===s.length&&(n.track({event:"shared-onboarding:completed",source:n.source}),d.start())}function v(_){const C=s.map(({id:I})=>I);return Array.from(new Set([..._.filter(I=>C.includes(I)),...u]))}return f.jsxs(f.Fragment,{children:[a&&f.jsx(h.ActionListItem,{textVariant:"normal",backgroundColor:"transparent",startIcon:"notStarted",onClick:p,children:"Get started"}),!a&&f.jsx(h.AnimatedElement,{enterDuration:0,exitDuration:ZF,children:d.status!=="hidden"&&f.jsxs("div",{ref:d.refs.container,style:{position:"relative"},children:[f.jsx(S$e,{steps:s,completedSteps:l,tutorialLink:c,tracking:n,onToggleStep:m,onClose:d.status!=="animating"?A:void 0}),f.jsx("div",{ref:d.refs.cannon,style:{position:"absolute",bottom:0,left:0}})]})})]})}function T$e(e,t=400){const n=oz.useConfetti({config:{duration:Yb}}),[r,i]=$.useState("visible"),o=$.useRef(!1),a=$.useCallback(()=>{i("animating"),setTimeout(()=>i("hidden"),Yb-t),o.current||(setTimeout(e,Yb),o.current=!0)},[e,t]),s=()=>{n.throwConfetti(),a()},u=$.useCallback(()=>{i("visible"),o.current=!1},[]);return{refs:{container:n.confettiContainerRef,cannon:n.confettiCannonRef},status:r,start:s,reset:u}}const R7=$.createContext({editedUID:{current:!1},onEditUID:()=>{}});function O7(e){return Object.values(e.json).some(t=>{var n;return((n=t.uid)==null?void 0:n.type)==="UID"})}function x$e(e){const{content:t,customType:n}=e;return O7(n)&&!t.uid}function F7(e){const{documentId:t,documentsWithUid:n,uid:r}=e;return n.filter(i=>t!==i.id&&E$e({document:i,uid:r})&&w$e({...e,document:i}))}function w$e(e){const{customTypeId:t,languageId:n,document:r}=e,i=t===r.custom_type_id,o=n===r.language.id;return i&&o}function E$e(e){const{document:t,uid:n}=e,r=t.versions.filter(i=>i.uid===n);return r.length===0?!0:r.some(i=>i.status!=="archived")}function Q0(e,t){return`${e}___${t}`}const k7=$.createContext({ids:[],isSelected:()=>!1,update:()=>{}});function z0(){return $.useContext(k7)}function nr(e){var t;return((t=e.config)==null?void 0:t.label)??(e.type==="Boolean"||e.type==="Separator"?void 0:e.fieldset)??e.type}const NR="...";function $$e(e,t,n=NR){var r,i;return(t?(r=e.config)==null?void 0:r.placeholder_true:(i=e.config)==null?void 0:i.placeholder_false)||n}function Wc(e,t=NR){var n;return((n=e.config)==null?void 0:n.placeholder)||t}function R$e(e){var s;const{content:t,field:n,id:r,readOnly:i,onContentChange:o}=e,a=(t==null?void 0:t.value)??((s=n.config)==null?void 0:s.default_value)??!1;return f.jsxs(h.Field,{children:[f.jsx(h.FieldIcon,{name:"biToggle"}),f.jsx(h.FieldLabel,{htmlFor:r,children:nr(n)}),f.jsxs(h.FieldControl,{children:[f.jsx(h.Box,{padding:4,alignItems:"center",children:f.jsx(h.Text,{children:$$e(n,a)})}),f.jsx(h.Switch,{id:r,sx:{alignSelf:"center",marginLeft:"auto",marginRight:12},checked:a,onCheckedChange:u=>{i||o(O$e(u))}})]})]})}function O$e(e){return{__TYPE__:"BooleanContent",value:e}}function F$e(e){const{id:t,field:n,content:r,onContentChange:i}=e;return f.jsxs(h.Field,{children:[f.jsx(h.FieldIcon,{name:"colorLens"}),f.jsx(h.FieldLabel,{id:t,children:nr(n)}),f.jsx(h.FieldControl,{children:f.jsx(h.Box,{padding:{left:4},alignItems:"center",children:f.jsx(h.ColorInput,{onValueChange:o=>i(k$e(o)),value:r==null?void 0:r.value,"aria-labelledby":t,placeholder:Wc(n)})})})]})}function k$e(e){return e===void 0?void 0:{__TYPE__:"FieldContent",type:"Color",value:e}}function M$e(e){const{id:t,readOnly:n,field:r,content:i,onContentChange:o}=e,a=i!=null&&i.value?ZC.dateFromISOString(i.value):void 0;return f.jsxs(h.Field,{children:[f.jsx(h.FieldIcon,{name:"dateRange"}),f.jsx(h.FieldLabel,{id:t,children:nr(r)}),f.jsx(h.FieldControl,{children:f.jsx(h.Box,{padding:{left:4,right:12},width:"100%",flexDirection:"column",justifyContent:"center",children:f.jsx(h.DateInput,{mode:"date","aria-labelledby":t,disabled:n,value:a,onValueChange:s=>o(L$e(s))})})})]})}function L$e(e){if(e)return{__TYPE__:"FieldContent",type:"Date",value:j$e(e)}}function j$e(e){const t=`${e.getFullYear()}`.padStart(4,"0"),n=`${e.getMonth()+1}`.padStart(2,"0"),r=`${e.getDate()}`.padStart(2,"0");return`${t}-${n}-${r}`}const Qs=$.forwardRef(function(t,n){return f.jsx(h.TextInput,{padding:M7,...t,ref:n,sx:{...t.sx,alignSelf:"stretch"}})}),M7={input:{inline:4},adornment:{inline:12}},U$e=({provider:e})=>B$e[e.toLowerCase()]??f.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[f.jsx("g",{clipPath:"url(#clip0_6524_22412)",children:f.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"})}),f.jsx("defs",{children:f.jsx("clipPath",{id:"clip0_6524_22412",children:f.jsx("rect",{width:"16",height:"16",fill:"white"})})})]}),B$e={codepen:f.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[f.jsx("g",{clipPath:"url(#clip0_6523_22409)",children:f.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"})}),f.jsx("defs",{children:f.jsx("clipPath",{id:"clip0_6523_22409",children:f.jsx("rect",{width:"16",height:"16",fill:"white"})})})]}),codesandbox:f.jsxs("svg",{width:"14",height:"16",viewBox:"0 0 14 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[f.jsx("g",{clipPath:"url(#clip0_6523_22406)",children:f.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"})}),f.jsx("defs",{children:f.jsx("clipPath",{id:"clip0_6523_22406",children:f.jsx("rect",{width:"13.8378",height:"16",fill:"white"})})})]}),dailymotion:f.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[f.jsxs("g",{clipPath:"url(#clip0_6523_22345)",children:[f.jsx("path",{d:"M16 0H0V16H16V0Z",fill:"white"}),f.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"})]}),f.jsx("defs",{children:f.jsx("clipPath",{id:"clip0_6523_22345",children:f.jsx("rect",{width:"16",height:"16",fill:"white"})})})]}),flickr:f.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[f.jsx("rect",{width:"16",height:"16",fill:"white"}),f.jsxs("g",{clipPath:"url(#clip0_6523_22379)",children:[f.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"}),f.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"})]}),f.jsx("defs",{children:f.jsx("clipPath",{id:"clip0_6523_22379",children:f.jsx("rect",{width:"12",height:"5.568",fill:"white",transform:"translate(2 5)"})})})]}),giphy:f.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[f.jsx("rect",{width:"16",height:"16",fill:"#121212"}),f.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4 3.38889V12.2778H5.11111V3.38889H4Z",fill:"#00FF99"}),f.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.6663 5.61111V12.2778H11.7774V5.61111H10.6663Z",fill:"#9933FF"}),f.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.75 3H4V4.11111H8.83333V3H7.75Z",fill:"#FFF35C"}),f.jsx("path",{d:"M9.00041 4.11111H7.33374H8.83374V3.77778L9.00041 4.11111Z",fill:"#999999"}),f.jsx("path",{d:"M8.83374 4.11111H7.33374L8.44485 3L8.83374 3.77778V4.11111Z",fill:"#999237"}),f.jsx("path",{d:"M10.6663 7.44444V5.77778L11.7774 6.33333L10.6663 7.44444Z",fill:"#5C1F99"}),f.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.6667 11.8889H4V13H11.7778V11.8889H10.6667Z",fill:"#00CCFF"}),f.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:f.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:[f.jsxs("g",{clipPath:"url(#clip0_6523_22356)",children:[f.jsx("mask",{id:"mask0_6523_22356",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"16",height:"16",children:f.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"})}),f.jsxs("g",{mask:"url(#mask0_6523_22356)",children:[f.jsx("mask",{id:"mask1_6523_22356",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"-1",y:"-1",width:"18",height:"18",children:f.jsx("path",{d:"M16.5905 -0.583628H-0.603516V16.6106H16.5905V-0.583628Z",fill:"white"})}),f.jsxs("g",{mask:"url(#mask1_6523_22356)",children:[f.jsx("mask",{id:"mask2_6523_22356",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"-1",y:"-1",width:"18",height:"18",children:f.jsx("path",{d:"M16.6701 -0.663237H-0.683105V16.6902H16.6701V-0.663237Z",fill:"white"})}),f.jsxs("g",{mask:"url(#mask2_6523_22356)",children:[f.jsx("mask",{id:"mask3_6523_22356",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"-1",y:"-1",width:"18",height:"18",children:f.jsx("path",{d:"M16.6701 -0.663237H-0.683105V16.6902H16.6701V-0.663237Z",fill:"white"})}),f.jsx("g",{mask:"url(#mask3_6523_22356)",children:f.jsx("rect",{x:"-0.688721",y:"-0.665792",width:"17.3622",height:"17.3622",fill:"url(#pattern0)"})})]})]})]})]}),f.jsxs("defs",{children:[f.jsx("pattern",{id:"pattern0",patternContentUnits:"objectBoundingBox",width:"1",height:"1",children:f.jsx("use",{xlinkHref:"#image0_6523_22356",transform:"scale(0.000439947)"})}),f.jsx("clipPath",{id:"clip0_6523_22356",children:f.jsx("rect",{width:"16",height:"16",fill:"white"})}),f.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:f.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[f.jsxs("g",{clipPath:"url(#clip0_6570_25513)",children:[f.jsx("rect",{width:"15.996",height:"16",rx:"2",fill:"#CC2127"}),f.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"})]}),f.jsx("defs",{children:f.jsx("clipPath",{id:"clip0_6570_25513",children:f.jsx("rect",{width:"16",height:"16",fill:"white"})})})]}),spotify:f.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[f.jsx("g",{clipPath:"url(#clip0_6523_22402)",children:f.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"})}),f.jsx("defs",{children:f.jsx("clipPath",{id:"clip0_6523_22402",children:f.jsx("rect",{width:"16",height:"16",fill:"white"})})})]}),twitter:f.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:f.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:f.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[f.jsxs("g",{clipPath:"url(#clip0_6523_22340)",children:[f.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"}),f.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"})]}),f.jsx("defs",{children:f.jsx("clipPath",{id:"clip0_6523_22340",children:f.jsx("rect",{width:"16",height:"16",fill:"white"})})})]}),youtube:f.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[f.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"}),f.jsx("path",{d:"M6.36353 10.0058L10.5453 7.62974L6.36353 5.25349V10.0058Z",fill:"white"})]})};function L7(e){const{debouncedUrl:t,content:n,onContentChange:r,selected:i}=e,o=$.useRef(null),[a,s]=$.useState(!1);Ne.useOnChange(t,()=>{var c;a&&(s(!1),(c=o.current)==null||c.reset())});function u(){s(!0),r(void 0)}return Fr.toURL(t)?t===(n==null?void 0:n.embed_url)?f.jsx(cC,{content:n,selected:i}):f.jsx(h.ErrorBoundary,{ref:o,renderError:P$e,onError:u,children:f.jsx($.Suspense,{fallback:n&&f.jsx(cC,{content:n,selected:i}),children:f.jsx(W$e,{url:t,selected:i,onContentChange:r})})}):null}function P$e(){return f.jsxs(h.Box,{backgroundColor:"grey2",borderRadius:6,padding:16,gap:4,children:[f.jsx(h.Icon,{name:"alert",size:"small",color:"grey11"}),f.jsx(h.Text,{variant:"smallBold",color:"grey11",children:"There is no embed data available."})]})}function cC(e){const{content:t,selected:n}=e,{thumbnail:r,provider:i,author:o,url:a,subtitle:s}=q$e(t);return f.jsxs(h.PreviewCard,{selected:n,children:[f.jsx(h.PreviewImage,{src:r.url,aspectRatio:r.aspectRatio}),f.jsxs(h.PreviewContent,{children:[f.jsxs(h.Box,{display:"flex",alignItems:"center",gap:4,children:[f.jsx(U$e,{provider:i}),f.jsx(h.Text,{variant:"smallBold",color:"grey12",noWrap:!0,children:i}),o&&f.jsx(h.Text,{variant:"small",color:"grey11",noWrap:!0,children:o})]}),f.jsx(h.Text,{variant:"smallBold",href:a,children:s})]})]})}function W$e(e){const{url:t,onContentChange:n,selected:r}=e,i=D$e({url:t,onContentChange:n});return f.jsx(cC,{content:i,selected:r})}function D$e(e){const{url:t,onContentChange:n}=e,{embedApiEndpoint:r}=Ee(),i=Ve.useRequest(K$e,[t,r]),o=Ne.useStableCallback(n);return $.useEffect(()=>{const a=h.handleEditorFlushSyncError(()=>o(i));return()=>{clearTimeout(a)}},[i,o]),i}function K$e(e,t){const n=new URL(t);return n.searchParams.set("url",e),pe.request(n,{okType:N$e(e)})}function N$e(e){return L.object({type:L.string(),version:L.string().or(L.number()).nullish(),title:L.string().nullish(),author_name:L.string().nullish(),author_url:L.string().nullish(),provider_name:L.string().nullish(),provider_url:L.string().nullish(),cache_age:L.string().or(L.number()).nullish(),thumbnail_url:L.string().nullish(),thumbnail_width:L.number().nullish(),thumbnail_height:L.number().nullish(),html:L.string().nullish()}).passthrough().transform(t=>{const 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 q$e(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:e.type==="video"?"16:9":"1:1"},provider:e.provider_name??"",author:e.author_name??"",subtitle:t}}function V$e(e){const{id:t,readOnly:n,field:r,content:i,onContentChange:o}=e,a=Ne.useDebounceState({initialState:(i==null?void 0:i.embed_url)??"",startTransition:$.startTransition});function s(u){a.set(u),Fr.toURL(u)||o(void 0)}return f.jsxs(h.Field,{footer:Fr.toURL(a.value)&&f.jsx(h.FieldFooter,{children:f.jsx(L7,{debouncedUrl:a.debouncedValue,content:i,onContentChange:o})}),children:[f.jsx(h.FieldIcon,{name:"cloud"}),f.jsx(h.FieldLabel,{htmlFor:t,children:nr(r)}),f.jsx(h.FieldControl,{children:f.jsx(Qs,{id:t,readOnly:n,placeholder:Wc(r),value:a.value,onValueChange:s,variant:Fr.toURL(a.value)?"link":"normal",endAdornment:f.jsx(h.Button,{startIcon:"close",color:"grey",size:"small",disabled:!a,onClick:()=>s("")})})})]})}function j7(e){return!(e.lat>85||e.lat<-85||e.lng>180||e.lng<-180)}function Gb(e){const t=/^.*@(-?\d+.\d+),(-?\d+.\d+).*$/,n=e.match(t);if(!n)return;const r=parseFloat(n[1]??""),i=parseFloat(n[2]??"");if(isNaN(r)||isNaN(i))return;const o={lat:r,lng:i};if(j7(o))return o}function XF(e){return e?`${e.lat}, ${e.lng}`:""}function ek(e){const t=/\(?([\d|.|-]*)[\s+]*,[\s]*([\d|.|-]*)\)?/,n=e.match(t);if(!n)return Gb(e);const r=parseFloat(n[1]??""),i=parseFloat(n[2]??"");if(isNaN(r)||isNaN(i))return Gb(e);const o={lat:r,lng:i};return j7(o)?o:Gb(e)}function Q$e(e){const{field:t,id:n,readOnly:r,...i}=e,{onValueChange:o,displayedValue:a,onBlur:s,clearValue:u,isValidCoordinates:c}=z$e(i);return f.jsxs(h.Field,{children:[f.jsx(h.FieldIcon,{name:"place"}),f.jsx(h.FieldLabel,{htmlFor:n,children:nr(t)}),f.jsx(h.FieldControl,{children:f.jsx(Qs,{id:n,onValueChange:o,placeholder:NR,readOnly:r,value:a,onBlur:s,variant:c?"link":"normal",endAdornment:f.jsx(h.Button,{startIcon:"close",color:"grey",size:"small",disabled:!a,onClick:u})})})]})}function z$e(e){const{content:t,onContentChange:n}=e,r=XF(t==null?void 0:t.position),[i,o]=$.useState(r);function a(){const c=ek(i);if(!c)return o(""),n(void 0);const{lat:l,lng:d}=c;o(XF({lat:l,lng:d})),n({__TYPE__:"GeoPointContent",position:{lat:l,lng:d}})}function s(){o(""),n(void 0)}const u=!!ek(i);return{displayedValue:i,isValidCoordinates:u,onValueChange:o,onBlur:a,clearValue:s}}function U7(e){const{fieldLabel:t,imageLabel:n=[]}=e;return f.jsxs(h.CardHeaderTitle,{children:[f.jsx(h.Text,{variant:"bold",noWrap:!0,children:Ep.overflow(t,30)}),n.length!==0&&f.jsx(h.Text,{color:"grey11",noSelect:!0,children:` • ${n.join(" • ")}`})]})}function B7(e){const{fieldLabel:t,isUpdating:n,readOnly:r,onMediaDialogOpenChange:i}=e;return f.jsxs(f.Fragment,{children:[f.jsx(h.CardHeader,{sx:{flexWrap:"wrap"},children:f.jsx(U7,{fieldLabel:t})}),f.jsx(h.CardContent,{children:f.jsx(h.Card,{color:"grey2",variant:"dashed",paddingBlock:12,radius:4,sx:{width:"100%"},children:f.jsx(h.CardContent,{children:f.jsxs(h.BlankSlate,{variant:"horizontal",children:[f.jsx(h.BlankSlateIcon,{name:"cloudUpload",lineColor:"purple9",backgroundColor:"purple4",size:"small"}),f.jsx(h.BlankSlateTitle,{children:n?"Preparing your image...":"You haven't selected an image"}),!r&&f.jsx(h.BlankSlateActions,{children:f.jsx(h.Button,{disabled:n,onClick:()=>i(!0),size:"medium",children:"Select image"})})]})})})})]})}const H$e=Ap({id:Yo(),width:Dm(),height:Dm(),urls:Ap({full:Yo(),small:Yo().transform(TEe)}),alt_description:Yo().optional(),description:Yo().nullable()}),Y$e=Ap({results:Uq(H$e)}).transform(e=>e.results);function P7(e,t){const n=new URL("search/photos",e);return n.searchParams.set("page","1"),n.searchParams.set("per_page","28"),n.searchParams.set("query",t),pe.request(n,{okType:Y$e})}Ve.cache.registerFetcherConfig(P7,{cacheCapacity:5,revalidationStrategy:{type:"never"}});function G$e(e,t){const n=$.useRef(),r=Ee(),i=Ve.useRequest(P7,[e,t]);return Ne.useDebounce(t,1e3,()=>{var o;n.current&&t!==n.current&&((o=r.onAnalyticsEvent)==null||o.call(r,"Unsplash Image Searched")),n.current=t}),i}function J$e(e){const{onSelectedChange:t}=e,[n,r]=$.useTransition(),i=Ne.useDebounceState({initialState:"",ms:300,startTransition:r});return f.jsxs(h.Box,{flexDirection:"column",gap:16,width:"100%",position:"relative",children:[f.jsx(h.FormSearchInput,{value:i.value,placeholder:"Search on Unsplash.com",onValueChange:i.set}),f.jsx(h.ErrorBoundary,{renderError:()=>f.jsx(m7,{}),children:f.jsx($.Suspense,{fallback:f.jsx(X$e,{}),children:f.jsx(Z$e,{term:i.debouncedValue,loading:n,onSelectedChange:t})})})]})}function Z$e(e){const{term:t,onSelectedChange:n,loading:r}=e,{media:i,toggleSelected:o,selectedImageId:a}=eRe({term:t,onSelectedChange:n});return f.jsxs(f.Fragment,{children:[i.length>0&&f.jsx(W7,{children:i==null?void 0:i.map(s=>{const c=new URL(s.urls.full).searchParams.get("fm")??"jpg";return f.jsx(h.MediaCard,{url:s.urls.small,filename:s.description??"Unsplash Image",selected:a===s.id,onCardClick:()=>o(s),onCheckedChange:()=>o(s),extension:c,kind:"image",width:s.width,height:s.height,loading:r},s.id)})}),i.length===0&&f.jsx(A7,{})]})}function W7(e){const{children:t}=e;return f.jsx(h.ScrollArea,{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 X$e(){return f.jsx(W7,{children:Qt.range(1,24).map(e=>f.jsx(S7,{},e))})}function eRe(e){var c;const{term:t,onSelectedChange:n}=e,{unsplashApiBaseUrl:r}=Ee(),i=G$e(r,t||"citrus fruit"),o=(c=i==null?void 0:i[0])==null?void 0:c.id,[a,s]=$.useState();$.useEffect(()=>{n==null||n([]),s(void 0)},[o,n]);function u(l){if(l.id===a)return s(void 0),n==null?void 0:n([]);s(l.id),n==null||n([{...l,url:l.urls.full,alt:l.alt_description}])}return{media:i,toggleSelected:u,selectedImageId:a}}function qR(e){const{open:t,onOpenChange:n,onMediaSelected:r,assetType:i}=e,o=Ee(),a=o.mediaLibrary,[s,u]=$.useState(()=>a?"media":"unsplash"),[c,l]=$.useState(new Set),[d,p]=$.useState([]),A=c.size+d.length,m=Ve.useFetcherData(mi);$.useEffect(()=>{!t||!a||s7({config:o,assetType:i})},[t,o,i,a]);function v(S){if(S!=="media"&&S!=="unsplash")throw new Error(`Invalid option ${S}.`);u(S)}function _(S){S||l(new Set),n(S)}const C=Dwe({assetType:i,mediaDialogOpen:t});function I(){var S;if(s==="unsplash"){const y=d[0];if(!y)return;r(y),(S=o.onAnalyticsEvent)==null||S.call(o,"Unsplash Image Added")}else if(s==="media"){const w=m.flatMap(O=>O.items).filter(O=>c.has(O.id))[0];if(!w)return;r(w),C(w.id)}_(!1)}function x(){if(A===0)return"Select a media item to add to the page";if(A>1)return"Only one media item can be added to the page"}const{containerRef:g}=h.useAlert();return f.jsxs(h.Dialog,{open:t,onOpenChange:_,size:{width:"min(calc(100% - 48px), 2000px)",height:"calc(100% - 30px)"},position:"center",onPointerDownOutside:S=>{g&&Ne.refContainsTarget(g,S.target)&&S.preventDefault()},children:[f.jsx(h.DialogHeader,{icon:"image",title:"Media library"}),f.jsxs(h.DialogOptions,{value:s,onValueChange:v,padding:"small",width:"auto",children:[a&&f.jsx(h.DialogOptionsItem,{value:"media",icon:"photo"}),f.jsx(h.DialogOptionsItem,{value:"unsplash",icon:"unsplash"})]}),f.jsx(h.DialogContent,{children:f.jsxs(h.Box,{flexDirection:"column",flexGrow:1,overflow:"hidden",children:[f.jsx(Eq,{}),f.jsxs(h.Box,{overflow:"hidden",backgroundColor:"grey2",padding:{top:16,inline:16},flexGrow:1,children:[s==="media"&&f.jsx($7,{assetType:i,onSelectedChange:l}),s==="unsplash"&&f.jsx(J$e,{onSelectedChange:p})]})]})}),f.jsxs(h.DialogActions,{children:[f.jsx(h.DialogCancelButton,{}),f.jsx(h.DialogActionButton,{onClick:I,disabled:A!==1,tooltipLabel:x(),children:"Add to page"})]})]})}const D7=$.forwardRef(function(t,n){const{isMediaDialogOpen:r,selected:i,children:o,onMediaSelected:a,onMediaDialogOpenChange:s}=t;return f.jsxs(h.Card,{ref:n,color:i?"indigo2":"grey2",variant:i?"selected":"dashed",paddingBlock:12,radius:4,children:[o,f.jsx(qR,{open:r,onOpenChange:s,onMediaSelected:a,assetType:"image"})]})});function K7(e){const{contentView:t,croppedImage:n}=e,{width:r,height:i,x:o,y:a,zoom:s}=n,u=nRe({origin:t.origin,croppedImage:n});return{...t,width:r,height:i,url:u,edit:{...t.edit,zoom:s,crop:{x:o,y:a}}}}function tRe(e){var c,l,d;const{field:t,content:n,thumbnail:r,croppedImage:i}=e;if(r===md)return N7({content:n,croppedImage:i});const o=Ce.isImageContent(n),a=(l=(c=t==null?void 0:t.config)==null?void 0:c.thumbnails)==null?void 0:l.find(p=>p.name===r),s=o?(d=n.thumbnails)==null?void 0:d[r]:void 0;if(!a||!s)return n;const u=K7({contentView:s,croppedImage:i});return u.url===s.url?n:{...n,thumbnails:o?{...n.thumbnails,[r]:u}:void 0}}function N7(e){const{content:t,croppedImage:n}=e,r=K7({contentView:t,croppedImage:n});return r.url===t.url?t:{...t,...r}}function nRe(e){const{origin:t,croppedImage:n}=e,{x:r,y:i,width:o,height:a,cropHeight:s,cropWidth:u}=n,c=new URL(t.url),l=t.height!==a||t.width!==o;if(r!==0||i!==0||s!==t.height||u!==t.width){const p=[r,i,u,s].map(Math.round).join(",");c.searchParams.set("rect",p),c.searchParams.set("w",o.toString()),c.searchParams.set("h",a.toString())}return l&&(c.searchParams.set("w",o.toString()),c.searchParams.set("h",a.toString())),c.toString()}function rRe(e){const{edit:{crop:{x:t,y:n},zoom:r},width:i,height:o,origin:{width:a,height:s}}=e;let u,c;const l=a/s,d=i/o;return d>=l?(u=a/r,c=u/d):(c=s/r,u=c*d),{x:t,y:n,width:i,height:o,zoom:r,cropWidth:u,cropHeight:c}}function iRe(e){const{selectedImage:t,imageCrop:n,setImageCrop:r}=e,{width:i,height:o,zoom:a,cropHeight:s,cropWidth:u}=n,c=t.contentView,l={x:n.x,y:n.y,width:u,height:s},[d,p]=$.useState(),A=(c==null?void 0:c.origin.url)??"",m=!(t!=null&&t.thumbnail.height&&(t!=null&&t.thumbnail.width));function v(g,S){const y=parseInt(S);isNaN(y)||y<=0||!m||r({...n,[g]:y})}function _(g){r({...n,cropWidth:g.width,cropHeight:g.height,x:g.x,y:g.y})}function C(g){r({...n,zoom:g})}function I(){p(qh),r({...n,...qh})}function x(){c&&(p(qh),r({...n,...qh,zoom:1,cropWidth:c.width,cropHeight:c.height}))}return f.jsxs(h.Box,{padding:{inline:24,block:16},flexDirection:"column",gap:16,height:"100%",overflowY:"auto",alignItems:"center",children:[f.jsxs(h.Box,{gap:8,height:32,alignItems:"flex-start",width:"100%",children:[f.jsx(h.Tooltip,{content:"Center",children:f.jsx(h.Button,{color:"grey",size:"medium",startIcon:"centerFocusWeak",onClick:I})}),f.jsx(h.Tooltip,{content:"Cover",children:f.jsx(h.Button,{color:"grey",size:"medium",startIcon:"zoomOutMap",onClick:x})}),f.jsx(h.Separator,{orientation:"vertical"}),f.jsx(h.FormInput,{prefix:"W",prefixTooltip:"Width",placeholder:"width",type:"number",size:"medium",value:String(i),onValueChange:g=>v("width",g),sx:{width:100},disabled:!m}),f.jsx(h.FormInput,{prefix:"H",prefixTooltip:"Height",placeholder:"height",type:"number",size:"medium",value:String(o),onValueChange:g=>v("height",g),sx:{width:100},disabled:!m})]}),f.jsx(h.Cropper,{image:A,aspect:i/o,crop:d??{x:0,y:0},onCropChange:p,zoom:a,onZoomChange:C,onCropAreaChange:(g,S)=>_(S),initialCroppedAreaPixels:l}),f.jsx(h.Box,{width:"100%",maxWidth:320,children:f.jsx(h.Slider,{min:1,max:3,step:.01,value:[a],onValueChange:([g])=>C(g??1)})})]})}const qh={x:0,y:0};function oRe(e){const{trigger:t,initialImages:n,renderTooltip:r}=e,{open:i,onOpenChange:o,ready:a,option:s,selectedImage:u,croppedImage:c,setCroppedImage:l,setReady:d,setOption:p}=aRe(e);return f.jsxs(h.Dialog,{trigger:t,onAnimationEnd:()=>d(!0),open:i,onOpenChange:o,renderTooltip:r,children:[f.jsx(h.DialogHeader,{icon:"photo",title:"Image editor"}),f.jsx(h.DialogOptions,{value:String(s),onValueChange:A=>p(Number(A)),children:n.map((A,m)=>f.jsx(h.DialogOptionsItem,{value:String(m),icon:"photo",title:A.labels[0]??"Main",subtitle:A.labels[1]??""},A.thumbnail.name))}),u&&f.jsx(h.DialogContent,{children:a&&c&&f.jsx(iRe,{selectedImage:u,imageCrop:c,setImageCrop:l},u.thumbnail.name)})]})}function aRe(e){const{initialImages:t,initialOption:n,onClose:r}=e,[i,o]=$.useState(_),[a,s]=$.useState(!1),[u,c]=$.useState(!1),[l,d]=$.useState(n);function p(C){C?(d(n),o(_())):(c(!1),r({option:l,croppedImages:i})),s(C)}const A=t[l],m=i[(A==null?void 0:A.thumbnail.name)??""];function v(C){if(!A)return;const I=A.thumbnail.name;o({...i,[I]:C})}function _(){return t.reduce((C,I)=>(I.contentView&&(C[I.thumbnail.name]=rRe(I.contentView)),C),{})}return{open:a,ready:u,option:l,selectedImage:A,croppedImage:m,setCroppedImage:v,setReady:c,setOption:d,onClose:r,onOpenChange:p}}function sRe(e){const{readOnly:t,altText:n,selected:r,onValueChange:i}=e,o=$.useId();return f.jsxs(h.Field,{selected:r,children:[f.jsx(h.FieldLabel,{htmlFor:o,children:"Alt text"}),f.jsx(h.FieldControl,{children:f.jsx(h.Box,{flexGrow:1,height:40,children:f.jsx(Qs,{id:o,placeholder:"Short description for the visually impaired",readOnly:t,value:n,padding:{input:{inline:12}},onValueChange:i})})})]})}function uRe(e){const{fieldLabel:t,imageLabel:n,initialImages:r,page:i,displaySeparator:o=!0,isSVGContentView:a,visibility:s,onClear:u,onCropperDialogClose:c,onMediaDialogOpenChange:l}=e;return f.jsxs(h.Box,{display:"flex",flexDirection:"column",gap:12,children:[f.jsxs(h.Box,{display:"flex",alignItems:"center",justifyContent:"space-between",flexWrap:"wrap",gap:4,children:[f.jsx(U7,{fieldLabel:t,imageLabel:n}),f.jsxs(h.CardHeaderActions,{sx:{visibility:s},children:[f.jsx(oRe,{trigger:f.jsx(h.Button,{startIcon:"crop",disabled:a,hiddenLabel:"Crop & Resize"}),renderTooltip:d=>f.jsx(h.Tooltip,{content:"Crop & Resize",children:d}),initialImages:r,initialOption:i,onClose:c}),f.jsx(h.Tooltip,{content:"Replace",children:f.jsx(h.Button,{startIcon:"imageSearch",hiddenLabel:"Replace",onClick:()=>l(!0)})}),f.jsx(h.Tooltip,{content:"Clear",children:f.jsx(h.Button,{onClick:u,startIcon:"delete",hiddenLabel:"Clear"})})]})]}),o&&f.jsx(h.Separator,{style:"dashed",decorative:!0})]})}function ju(e){const{description:t,largeIconName:n="public",loading:r,error:i,onEdit:o,onUnlink:a}=e,s=i?f.jsx(pRe,{}):f.jsx(dRe,{...e,largeIconName:n,loading:r});return f.jsx(h.Card,{sx:{width:420},children:f.jsxs(h.CardContent,{gap:12,children:[f.jsxs(h.Box,{display:"grid",gridTemplateColumns:"max-content 1fr min-content",gridTemplateRows:"1fr",gap:8,children:[s,f.jsxs(h.ButtonGroup,{size:"medium",color:"grey",sx:{justifySelf:"end"},children:[o&&f.jsx(h.Button,{startIcon:"edit",onClick:o}),a&&f.jsx(h.Button,{startIcon:"linkOff",onClick:a})]})]}),!i&&f.jsx(fRe,{description:t,loading:r})]})})}function cRe(e){const{url:t,title:n,loading:r}=e;return r?f.jsx(q7,{height:16,width:80}):n?f.jsx(h.Text,{variant:"smallBold",href:t==null?void 0:t.toString(),children:n}):null}function lRe(e){const{subTitle:t,loading:n}=e;return n?f.jsx(h.Box,{padding:{block:2},children:f.jsx(q7,{height:12,width:60})}):t?f.jsx(h.Text,{variant:"small",color:"grey11",noWrap:!0,children:t}):null}function fRe(e){const{description:t,loading:n}=e;return!t||n?null:f.jsx(h.Text,{variant:"small",color:"grey11",children:t})}function dRe(e){const{largeIconName:t,title:n,url:r,loading:i,subTitle:o}=e;return f.jsxs(f.Fragment,{children:[f.jsx(h.ConjoinedIcons,{largeIconName:t,smallIconName:"link"}),f.jsxs(h.Box,{flexDirection:"column",minWidth:0,children:[f.jsx(cRe,{title:n,url:r,loading:i}),f.jsx(lRe,{subTitle:o,loading:i})]})]})}function pRe(){return f.jsxs(h.Box,{alignItems:"center",gap:8,children:[f.jsx(h.CircleIcon,{name:"alert",color:"tomato",size:"small"}),f.jsx(h.Text,{color:"tomato11",children:"Failed to load linked document data"})]})}function q7(e){const{width:t,height:n}=e;return f.jsx(h.Skeleton,{color:"grey5",borderRadius:6,width:t,height:n})}function ARe(e){const{documentType:t,documentUrl:n,title:r,statusColor:i,description:o,tags:a,tagsFilter:s,previewImageUrl:u,onSelect:c}=e;function l(d){return d.nativeEvent instanceof MouseEvent&&(d.metaKey||d.ctrlKey)?window.open(n,"_blank"):c()}return f.jsxs(h.Card,{paddingBlock:16,onSelect:l,children:[f.jsx(h.CardContent,{children:f.jsxs(h.Box,{justifyContent:"space-between",children:[f.jsxs(h.Box,{flexDirection:"column",gap:4,alignItems:"flex-start",flexGrow:1,children:[f.jsx(hRe,{documentType:t}),f.jsx(mRe,{title:r,statusColor:i}),f.jsx(gRe,{description:o})]}),f.jsx(vRe,{previewImageUrl:u})]})}),a.length>0&&f.jsx(yRe,{tags:a,tagsFilter:s})]})}function hRe(e){const{documentType:t}=e;return f.jsx(h.Badge,{maxWidth:150,size:"medium",title:`Type: ${t}`,icon:"description"})}function mRe(e){const{title:t,statusColor:n}=e;return f.jsxs(h.Box,{gap:8,alignItems:"center",children:[f.jsx(h.Dot,{color:n}),f.jsx(h.Text,{variant:"bold",children:t})]})}function gRe(e){const{description:t}=e,n=t==null?void 0:t.substring(0,150);return n?f.jsx(h.Text,{variant:"small",color:"grey11",children:`${n}${n!==t?"...":""}`}):f.jsx(h.Text,{variant:"smallItalic",color:"grey11",children:"No description available"})}function vRe(e){const{previewImageUrl:t}=e;return f.jsx(h.Box,{width:142,height:90,backgroundColor:"grey2",border:!0,borderRadius:6,flexDirection:"column",alignItems:"center",justifyContent:"center",gap:4,flexShrink:0,padding:8,children:t?f.jsx(h.Image,{src:t,sizing:"cover"}):f.jsxs(f.Fragment,{children:[f.jsx(h.Icon,{name:"hideImage",size:"large",color:"grey11"}),f.jsx(h.Text,{color:"grey11",variant:"small",children:"No preview available"})]})})}function yRe(e){const{tags:t}=e;return f.jsxs(h.CardFooter,{children:[f.jsxs(h.Box,{gap:4,alignItems:"center",children:[f.jsx(h.Icon,{name:"label",size:"small",color:"grey11"}),f.jsx(h.Text,{variant:"small",color:"grey11",children:"Tags:"})]}),f.jsx(h.TextOverflow,{children:t.map(n=>f.jsx(h.Badge,{size:"medium",title:n,sx:{marginRight:8}},n))})]})}function bRe(e){var g,S;const{searchTerm:t,tagsFilter:n,typesFilter:r,localesFilter:i}=e,o=Ee();o.searchDocuments||Jt("searchDocuments");const{coreApiBaseUrl:a,documentSearchBaseUrl:s,authStrategy:u,status:c,repository:l}=o,{storageVersion:d}=Ve.useRequest(q0,[a,u]),p=d.major>=7;function A(){return p?Kq({repository:l,searchTerm:t,customTypesIds:[...Fn.map(r,y=>y.id)],tags:[...Fn.map(n,y=>y.id)],localeId:[...Fn.map(i,y=>y.id)][0]}):BR({tags:[...Fn.map(n,y=>y.id)],customTypes:[...Fn.map(r,y=>y.id)],language:[...Fn.map(i,y=>y.id)],term:[t]})}const[m,v]=$.useState([]),[_,C]=$.useState(""),I=A(),x=Ve.useRequest(V7,[a,s,u,I,c,p]);return I!==_?(C(I),v(x.results)):x.results.length>0&&((g=Qt.last(m))==null?void 0:g.id)!==((S=Qt.last(x.results))==null?void 0:S.id)&&v(y=>y.concat(x.results)),{documents:m,response:x}}Ve.cache.registerFetcherConfig(V7,{cacheCapacity:500,revalidationStrategy:{type:"never"}});async function V7(e,t,n,r,i,o){const a=xq[i];if(!o){const l=await UR(e,n,r,200);return tk(l.results,a)}const s=await Dq(t,n,r),u=await qq(e,n,s.results);return tk(u,a)}function tk(e,t){return{results:e.flatMap(r=>{const i=r.versions.filter(o=>t.includes(o.status));return i.length===0?[]:{...r,versions:i}})}}function nk(){const e=Ee();e.searchDocuments||Jt("searchDocuments");const{coreApiBaseUrl:t,authStrategy:n}=e,r=Ve.useRequest(q0,[t,n]);return new Set(r.languages.map(i=>({id:i.id,label:i.name})))}function CRe(){const e=Ee();e.searchDocuments||Jt("searchDocuments");const{coreApiBaseUrl:t,authStrategy:n}=e,r=Ve.useRequest(zq,[t,n]);return new Set(r.results.map(i=>({id:i,label:i})))}function SRe(){const e=Ee();e.searchDocuments||Jt("searchDocuments");const{customTypesApiBaseUrl:t,repository:n,authStrategy:r}=e,i=Ve.useRequest(Bq,[t,n,r]);return new Set(i)}function _Re(e,t){const n=Ee(),r=Ne.useDebounceState({initialState:""}),[i,o]=$.useState(new Set),[a,s]=$.useState(new Set);function u(){return!n.searchDocuments||!n.localeId?new Set:new Set([{id:n.localeId,label:n.localeId}])}const[c,l]=$.useState(u),d=Fn.union(a,Km(e)),p=Fn.union(i,Km(t));return{searchTerm:r,filteredTags:i,setFilteredTags:o,filteredCustomTypes:a,setFilteredCustomTypes:s,filteredLocales:c,setFilteredLocales:l,typesFilter:d,tagsFilter:p}}function Km(e){return e?Fn.map(e,t=>({id:t,label:t})):new Set}function IRe(e){const{filteredLocales:t,setFilteredLocales:n,filteredTags:r,setFilteredTags:i,filteredCustomTypes:o,setFilteredCustomTypes:a,fixedTags:s,fixedCustomTypes:u}=e;return f.jsxs(f.Fragment,{children:[f.jsx(xRe,{selectedValues:t,onSelectedValuesChange:n}),f.jsx(lC,{selectedValues:r,fixedSelectedValues:Km(s),onSelectedValuesChange:i,label:"Tags",icon:"label",fetchFilters:CRe}),f.jsx(lC,{selectedValues:o,fixedSelectedValues:Km(u),onSelectedValuesChange:a,label:"Type",icon:"description",fetchFilters:SRe})]})}function lC(e){const[t,n]=$.useState(!1),r=$.useRef(null);return f.jsx(h.ErrorBoundary,{ref:r,renderError:()=>{var i;return f.jsx(h.FilterField,{mode:"error",onErrorRetry:(i=r.current)==null?void 0:i.reset,open:t,setOpen:n,values:new Set,...e})},children:f.jsx($.Suspense,{fallback:f.jsx(h.FilterField,{mode:"loading",open:t,setOpen:n,values:new Set,...e}),children:f.jsx(TRe,{open:t,setOpen:n,...e})})})}function TRe(e){const{open:t,setOpen:n,onSelectedValuesChange:r,fixedSelectedValues:i,selectedValues:o,label:a,icon:s,fetchFilters:u,multiple:c}=e,l=u();return f.jsx(h.FilterField,{open:t,setOpen:n,label:a,icon:s,selectedValues:o,values:new Set(l),fixedSelectedValues:i,onSelectedValuesChange:r,multiple:c})}function xRe(e){const{selectedValues:t,onSelectedValuesChange:n}=e,[r,i]=$.useState(Fn.first(t));function o(s){n(s),i(Fn.first(s))}const a=Fn.find(nk(),s=>{var u;return s.id===((u=Fn.first(t))==null?void 0:u.id)});return(a==null?void 0:a.label)!==(r==null?void 0:r.label)&&i(a),f.jsx(lC,{selectedValues:new Set(r?[r]:[]),onSelectedValuesChange:o,label:"Locale",icon:"public",fetchFilters:nk,multiple:!1})}function Q7(e){const{onSelectDocument:t,fixedCustomTypes:n,fixedTags:r,...i}=e,o=Ee(),{searchTerm:a,filteredTags:s,setFilteredTags:u,filteredCustomTypes:c,setFilteredCustomTypes:l,filteredLocales:d,setFilteredLocales:p,typesFilter:A,tagsFilter:m}=_Re(n,r),[v,_]=$.useTransition();return f.jsx(h.Dialog,{size:{height:727,width:656},hasClose:!1,...i,children:f.jsx(h.DialogContent,{children:f.jsxs(h.Box,{flexDirection:"column",height:"100%",children:[f.jsxs(h.Box,{padding:{top:16,inline:16,bottom:8},flexDirection:"column",gap:12,children:[f.jsx(h.FormInput,{value:a.value,onValueChange:a.set,placeholder:"Search a page",icon:"search"}),o.searchDocuments&&f.jsx(IRe,{filteredTags:s,setFilteredTags:u,filteredCustomTypes:c,setFilteredCustomTypes:l,filteredLocales:d,setFilteredLocales:p,fixedTags:r,fixedCustomTypes:n}),f.jsx(h.Text,{variant:"smallBold",color:"grey11",children:"Link to a document"})]}),o.searchDocuments?f.jsx(h.ErrorBoundary,{renderError:wRe,children:f.jsx($.Suspense,{fallback:f.jsx($Re,{}),children:f.jsx(ERe,{searchTerm:a.debouncedValue,tagsFilter:m,typesFilter:A,localesFilter:d,startTransition:_,isLoadingDocuments:v,onSelectDocument:t})})}):f.jsx(z7,{message:"Slice Machine does not yet support mock data for linked documents in the simulator."})]})})})}function wRe(){return f.jsx(h.Box,{height:"100%",flexDirection:"column",alignItems:"center",justifyContent:"center",children:f.jsx(h.DefaultErrorMessage,{title:"Request failed",description:"An error occurred while fetching documents.",errorImageSrc:h.dialogErrorImage})})}function ERe(e){const{searchTerm:t,tagsFilter:n,typesFilter:r,localesFilter:i,isLoadingDocuments:o,onSelectDocument:a}=e,{documents:s}=bRe({searchTerm:t,tagsFilter:n,localesFilter:i,typesFilter:r}),u=Ee();return f.jsxs(h.ScrollArea,{style:{flexGrow:1,paddingTop:h.theme.space[10],paddingBottom:h.theme.space[16],paddingInline:h.theme.space[16],display:"flex",flexDirection:"column",gap:h.theme.space[12]},children:[s.length===0&&f.jsx(z7,{}),s.map(c=>{const l=c.versions[0];if(!l)return null;const d=MR({documentId:c.id,versionId:l.status==="archived"?l.version_id:void 0,releaseId:l.status==="release"?l.release_id:void 0,status:l.status,baseUrl:u.baseUrl}),p=RRe({tags:l.tags,tagsFilter:n});return f.jsx(ARe,{documentType:l.custom_type_label,documentUrl:d,description:l.preview_summary,tags:p,title:c.title,previewImageUrl:l.preview_image,onSelect:()=>a(c.id),statusColor:Tq[l.status].color},`${c.id}-${l.status}`)}),f.jsx(h.AnimatedElement,{animation:{name:"fade"},children:o&&f.jsx(h.Text,{color:"grey11",align:"center",sx:{marginBlock:8},children:"Loading more results ..."})})]})}function z7(e){const{message:t="We can't find any versions matching this request"}=e,n="Oops!";return f.jsx(h.Box,{justifyContent:"center",flexDirection:"column",height:"100%",children:f.jsxs(h.BlankSlate,{children:[f.jsx(h.BlankSlateIcon,{name:"close",lineColor:"purple10",backgroundColor:"purple3",borderColor:"purple6",borderStyle:"dashed",size:"xlarge"}),f.jsx(h.BlankSlateTitle,{size:"big",children:n}),f.jsx(h.BlankSlateDescription,{width:360,children:t})]})})}function $Re(){return f.jsx(h.Box,{flexDirection:"column",gap:12,padding:{top:10,inline:16,bottom:16},children:Qt.range(1,5).map(e=>f.jsx(h.Skeleton,{height:150},e))})}function RRe(e){const{tags:t,tagsFilter:n}=e,r=[...n].map(o=>o.label).reverse();return Qt.sort(t,o=>-r.indexOf(o))}function H7(e){const{hasLink:t,onUnlink:n,selectEnabled:r,selectedType:i,value:o,onOpenLinkModal:a,onValueChange:s,openInNewTab:u=!0,condensedButtons:c=!1,showNewTabButton:l=!1,displayTextEnabled:d}=e;return f.jsxs(f.Fragment,{children:[!d&&l&&u&&f.jsx(h.Badge,{title:"Open in a new tab",color:"indigo",size:"small",icon:"openInNew",onClick:a}),!t&&r&&f.jsxs(h.Select,{value:i==="any"?void 0:i,color:"grey",size:"small",boldTriggerText:!0,position:"popper",sideOffset:4,startIcon:im({selectType:i}),disabled:!r,onValueChange:s,placeholder:c?"":Xc("any"),onlyStartIcon:c&&i!==void 0,renderTrigger:({button:p})=>f.jsx(h.Tooltip,{content:Xc(i),visible:c,children:p}),children:[f.jsx(h.SelectItem,{value:"web",icon:"public",children:Xc("web")}),f.jsx(h.SelectItem,{value:"document",icon:"description",children:Xc("document")}),f.jsx(h.SelectItem,{value:"media",icon:"image",children:Xc("media")})]},i===void 0?"unlinked":"linked"),!t&&!r&&f.jsx(h.Button,{startIcon:im({selectType:i}),color:"grey",textColor:"link",textWeight:"normal",size:"small",onClick:a,children:Xc(i)}),t&&!d&&f.jsx(h.Button,{startIcon:"close",color:"grey",size:"small",onClick:n,"aria-label":"Close"}),t&&d&&f.jsxs(h.ButtonGroup,{density:"compact",children:[f.jsx(h.Button,{startIcon:im({selectType:i}),renderEndIcon:()=>u&&i==="web"?f.jsx(h.Icon,{name:"openInNew",size:"extraSmall",color:"indigo11"}):null,color:"grey",textColor:"link",textWeight:"normal",size:"small",disabled:!t,onClick:a,children:o.length>30?`${o.slice(0,30)}...`:o}),f.jsx(h.Button,{startIcon:"close",color:"grey",size:"small",onClick:n})]})]})}function Xc(e){if(!e||e==="any")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"}}function Y7(e){const{onEdit:t,onUnlink:n,url:r,title:i,subTitle:o}=e;return f.jsx(h.Card,{paddingBlock:16,children:f.jsxs(h.CardContent,{sx:{width:433},children:[f.jsx(FRe,{url:r,title:i,subTitle:o,onEdit:t,onUnlink:n}),r&&f.jsx(h.CheckerBoard,{children:f.jsx(ORe,{children:f.jsx(h.Image,{src:r,alt:i,sizing:"contain"})})})]})})}function ORe(e){const{children:t}=e;return f.jsx(h.Box,{flexDirection:"column",alignItems:"center",justifyContent:"center",position:"relative",height:327,children:t})}function FRe(e){const{url:t,title:n,subTitle:r,onEdit:i,onUnlink:o}=e;return f.jsxs(h.Box,{flexDirection:"row",justifyContent:"space-between",gap:8,children:[f.jsxs(h.Box,{gap:8,minWidth:0,children:[f.jsx(h.ConjoinedIcons,{largeIconName:"image",smallIconName:"link"}),f.jsxs(h.Box,{flexDirection:"column",minWidth:0,children:[f.jsx(h.Text,{noWrap:!0,variant:"smallBold",href:t,inline:!0,children:n}),f.jsx(h.Text,{variant:"small",color:"grey11",children:r})]})]}),f.jsxs(h.ButtonGroup,{size:"medium",color:"grey",children:[i&&f.jsx(kRe,{onEdit:i}),o&&f.jsx(MRe,{onUnlink:o})]})]})}function kRe(e){const{onEdit:t}=e;return f.jsx(h.Tooltip,{content:"Edit link",side:"top",stableMount:!0,zIndexHack:!0,children:f.jsx(h.Button,{startIcon:"edit",onClick:t})})}function MRe(e){const{onUnlink:t}=e;return f.jsx(h.Tooltip,{content:"Remove link",side:"top",stableMount:!0,zIndexHack:!0,children:f.jsx(h.Button,{startIcon:"linkOff",onClick:t})})}function LRe(e){var w,O;const{field:t,content:n,onContentChange:r}=e,i=v(),o=((w=t.config)==null?void 0:w.allowText)??!1,a=o&&(n==null?void 0:n.value.text)||void 0,[s,u]=$.useState(m),c=Ce.FilledExternalLinkContent.is(n==null?void 0:n.value)&&(n==null?void 0:n.value.target)||void 0,[l,d]=$.useState(!1),p=$.useRef(null);Ne.useOnChange(i,y);const A=s?jRe[s]:void 0;function m(){var E,F;return!((E=t.config)!=null&&E.select)||n!=null&&n.value.__TYPE__?n==null?void 0:n.value.__TYPE__:rk[(F=t.config)==null?void 0:F.select]}function v(){return n?Ce.FilledDocumentLinkContent.is(n.value)?n.value.id:Ce.FilledExternalLinkContent.is(n.value)?n.value.url:Ce.FilledFileLinkContent.is(n.value)||Ce.FilledImageLinkContent.is(n.value)?n.value.name:"":""}function _(E){var F;if(!E)return r(void 0);switch((F=t.config)==null?void 0:F.select){case"web":return r({__TYPE__:"LinkContent",value:{__TYPE__:"ExternalLink",kind:"web",text:E}});case"document":return r({__TYPE__:"LinkContent",value:{__TYPE__:"DocumentLink",kind:"document",text:E}});case"media":return r({__TYPE__:"LinkContent",value:{__TYPE__:"MediaLink",kind:"media",text:E}});default:return r({__TYPE__:"LinkContent",value:{__TYPE__:"AnyLink",text:E}})}}function C(E,F){if(!E)return _(a);const W=F?"_blank":void 0;switch(s){case"ExternalLink":return r({__TYPE__:"LinkContent",value:{__TYPE__:"ExternalLink",url:E,target:W,text:a}});case"DocumentLink":return r({__TYPE__:"LinkContent",value:{__TYPE__:"DocumentLink",id:E,text:a}});default:return r(void 0)}}function I(E){return n?r({__TYPE__:n.__TYPE__,value:{...n.value,text:E}}):_(E)}function x(E){u(E?rk[E]:void 0),C("")}function g(E){C(E)}function S(){d(!0)}function y(){var E;l&&(d(!1),(E=p.current)==null||E.reset())}function T(E){const F=J7({media:E});switch(F.value.__TYPE__){case"ImageLink":return r({__TYPE__:F.__TYPE__,value:{...F.value,text:a}});case"FileLink":return r({__TYPE__:F.__TYPE__,value:{...F.value,text:a}})}}return{contentType:s,selectType:A,fieldValue:i,onDisplayTextChange:I,onValueChange:C,onTypeChange:x,placeholder:Wc(t),isTypeSelectEnabled:!((O=t.config)!=null&&O.select),onDocumentSelected:g,onError:S,errorBoundaryRef:p,isTargetNewTab:c==="_blank",onMediaSelected:T,displayTextEnabled:o,displayText:a??""}}const jRe={AnyLink:"any",DocumentLink:"document",ExternalLink:"web",FileLink:"media",ImageLink:"media",MediaLink:"media"},rk={any:"AnyLink",document:"DocumentLink",web:"ExternalLink",media:"FileLink"};function URe(e){const t=Ee();t.searchDocuments||Jt("searchDocuments");const{coreApiBaseUrl:n,authStrategy:r}=t;return Ve.useRequest(G7,[n,r,e]).title}const BRe=Ap({id:Yo(),title:Yo()});function G7(e,t,n){return pe.request(new URL(`documents/${n}`,e),{credentials:pe.getRequestCredentials(t),okType:BRe})}Ve.cache.registerFetcherConfig(G7,{concurrency:50});function J7(e){var i,o,a,s,u,c;const{media:t}=e,n="kind"in t;return n&&t.kind==="image"?{__TYPE__:"LinkContent",value:{__TYPE__:"ImageLink",id:t.id,name:t.filename,url:t.url,kind:t.kind,size:t.size.toString(),height:((i=t.height)==null?void 0:i.toString())??`${es}`,width:((o=t.width)==null?void 0:o.toString())??`${es}`,date:((a=t.last_modified)==null?void 0:a.toString())??""}}:n?{__TYPE__:"LinkContent",value:{__TYPE__:"FileLink",id:t.id,name:t.filename,kind:t.kind,url:t.url,size:t.size.toString(),date:((s=t.last_modified)==null?void 0:s.toString())??""}}:{__TYPE__:"LinkContent",value:{__TYPE__:"ImageLink",id:t.id,name:(t==null?void 0:t.alt)??t.url,kind:"image",url:t.url,size:"0",height:((u=t.height)==null?void 0:u.toString())??`${es}`,width:((c=t.width)==null?void 0:c.toString())??`${es}`}}}function PRe(e){const{open:t,setOpen:n,showNewTabButton:r}=e,{url:i,setUrl:o,openInNewTab:a,setOpenInNewTab:s,disabled:u,onUpdate:c}=WRe(e);return f.jsxs(h.Dialog,{open:t,onOpenChange:n,size:"small",children:[f.jsx(h.DialogHeader,{title:"Set Link URL"}),f.jsxs(h.DialogContent,{padding:16,children:[f.jsx(h.FormInput,{value:i,onValueChange:o,placeholder:"Paste URL",icon:"public"}),r&&f.jsx(h.InlineLabel,{value:"Open in a new tab",children:f.jsx(h.Checkbox,{checked:a,onCheckedChange:s})})]}),f.jsxs(h.DialogActions,{children:[f.jsx(h.DialogCancelButton,{}),f.jsx(h.DialogActionButton,{onClick:c,disabled:u,children:"Update"})]})]})}function WRe(e){const{url:t,openInNewTab:n,onUpdate:r,open:i,setOpen:o}=e,[a,s]=$.useState(t),[u,c]=$.useState(n);Ne.useOnChange(i,()=>{i&&(s(t),c(n))});const l=!a||a===t&&u===n;function d(){r(a,u),o(!1)}return{url:a,setUrl:s,openInNewTab:u,disabled:l,setOpenInNewTab:c,onUpdate:d}}function Z7(e){var ee,re,P,Y;const{content:t,field:n,id:r,onContentChange:i,condensedButtons:o=!1}=e,[a,s]=$.useState(!1),[u,c]=$.useState(!1),[l,d]=$.useState(),{contentType:p,fieldValue:A,errorBoundaryRef:m,onDocumentSelected:v,onError:_,onMediaSelected:C,onValueChange:I,selectType:x,onTypeChange:g,isTypeSelectEnabled:S,displayTextEnabled:y,...T}=LRe({content:t,field:n,onContentChange:i});Ne.useOnChange(l,()=>{x!==void 0&&!l&&!A&&S&&g(void 0)});const w=a||u,O=p==="DocumentLink"&&A!=="",F=p==="ExternalLink"&&Fr.toURL(A),W=!!((ee=n.config)!=null&&ee.allowTargetBlank),K={...T,id:r,onBlur:()=>s(!1),onFocus:()=>{s(!0)},onOpenLinkModal:()=>{switch(s(!0),p){case"DocumentLink":return d("document");case"ExternalLink":return d("web");case"FileLink":case"ImageLink":case"MediaLink":return d("media");default:return d(void 0)}},onUnlink:()=>{S?g(void 0):I("")},onSelectValueChange:M=>{g(M),d(M)},value:A,condensedButtons:o,allowTargetBlank:W,selectType:x,onValueChange:I,isTypeSelectEnabled:S,displayTextEnabled:y},{searchDocuments:J}=Ee();return f.jsxs(f.Fragment,{children:[f.jsxs(h.Popover,{onMouseOverChange:c,open:w,align:"start",sideOffset:-3,openDelay:100,closeDelay:200,focusOnEnter:!1,anchor:f.jsxs(h.Field,{onMouseOverChange:s,children:[f.jsx(h.FieldIcon,{name:im({selectType:x,displayTextEnabled:y})}),f.jsx(h.FieldLabel,{htmlFor:r,children:nr(n)}),f.jsx(h.FieldControl,{children:O&&J?f.jsx(VRe,{errorBoundaryRef:m,onError:_,fallback:f.jsx(fC,{...K,value:"..."}),renderError:()=>DRe(K),children:f.jsx(qRe,{...K,documentId:A})}):f.jsx(fC,{...K})})]}),children:[F&&f.jsx(ju,{url:F,title:Fr.getUrlTitle(F)??"",subTitle:F.toString()}),t&&Ce.FilledImageLinkContent.is(t.value)&&f.jsx(Y7,{url:t.value.url,title:t.value.name,subTitle:`${t.value.width} x ${t.value.height} pixels`})]}),f.jsx(PRe,{open:l==="web",setOpen:M=>d(M?"web":void 0),url:A,openInNewTab:T.isTargetNewTab,showNewTabButton:!!((re=n.config)!=null&&re.allowTargetBlank),onUpdate:(M,k)=>I(M,k)}),f.jsx(qR,{open:l==="media",onOpenChange:M=>d(M?"media":void 0),onMediaSelected:C,assetType:"all"}),f.jsx(Q7,{open:l==="document",onOpenChange:M=>d(M?"document":void 0),onSelectDocument:M=>{d(void 0),v(M)},fixedCustomTypes:new Set((P=n.config)==null?void 0:P.customtypes),fixedTags:new Set((Y=n.config)==null?void 0:Y.tags)})]})}function DRe(e){return f.jsx(fC,{...e})}function KRe(e){return{onValueChange:e.displayTextEnabled?e.onDisplayTextChange:e.onValueChange,placeholder:e.displayTextEnabled?"Add your display text":e.placeholder,readOnly:!e.displayTextEnabled,value:e.displayTextEnabled?e.displayText:e.value,variant:e.displayTextEnabled?"normal":"link",onFocus:e.displayTextEnabled?e.onFocus:e.onOpenLinkModal,cursor:X7({displayTextEnabled:e.displayTextEnabled,isTypeSelectEnabled:e.isTypeSelectEnabled,value:e.value})}}function fC(e){const{id:t,value:n,onOpenLinkModal:r,onBlur:i,isTypeSelectEnabled:o,selectType:a,onSelectValueChange:s,onUnlink:u,isTargetNewTab:c,condensedButtons:l,allowTargetBlank:d,displayTextEnabled:p}=e,A=KRe(e);return f.jsx(Qs,{id:t,...A,onBlur:i,textOverflow:"ellipsis",endAdornment:f.jsx(H7,{hasLink:!!(n&&a),onUnlink:u,selectEnabled:o,selectedType:a,value:n,onOpenLinkModal:r,onValueChange:s,openInNewTab:c,condensedButtons:l,showNewTabButton:d&&a==="web",displayTextEnabled:p})})}function NRe(e,t){return{onValueChange:e.displayTextEnabled?e.onDisplayTextChange:void 0,placeholder:e.displayTextEnabled?"Add your display text":void 0,readOnly:!e.displayTextEnabled,value:e.displayTextEnabled?e.displayText:t,variant:e.displayTextEnabled?"normal":"link",onFocus:e.displayTextEnabled?e.onFocus:e.onOpenLinkModal,cursor:X7({displayTextEnabled:e.displayTextEnabled,isTypeSelectEnabled:e.isTypeSelectEnabled,value:t})}}function qRe(e){const{id:t,documentId:n,onOpenLinkModal:r,isTypeSelectEnabled:i,selectType:o,displayTextEnabled:a,condensedButtons:s,onSelectValueChange:u,onUnlink:c}=e,l=URe(n),d=NRe(e,l);return f.jsx(Qs,{id:t,...d,textOverflow:"ellipsis",endAdornment:f.jsx(H7,{hasLink:!0,onUnlink:c,selectEnabled:i,selectedType:o,value:l,onOpenLinkModal:r,condensedButtons:s,onValueChange:u,displayTextEnabled:a})})}function VRe(e){const{errorBoundaryRef:t,onError:n,children:r,fallback:i,renderError:o}=e;return f.jsx(h.ErrorBoundary,{ref:t,onError:n,renderError:o,children:f.jsx($.Suspense,{fallback:i,children:r})})}function im(e){const{selectType:t,displayTextEnabled:n}=e;if(n)return"notes";switch(t){case"document":return"description";case"web":return"public";case"media":return"image";default:return"link"}}function X7(e){const{displayTextEnabled:t,isTypeSelectEnabled:n,value:r}=e;return t?"text":n&&!r?"default":"pointer"}function QRe(e){const{onContentChange:t,...n}=e;function r(i){const o=Ce.FilledLinkContent.is(i)?i:void 0;t(o)}return f.jsx(Z7,{...n,onContentChange:r})}function zRe(e){const{linkTo:t,onLinkToChange:n}=e;return f.jsx(QRe,{content:HRe(t),onContentChange:r=>n(YRe(r)),field:{type:"Link",config:{label:"Link",allowTargetBlank:!0,allowText:!1}},condensedButtons:!0})}function HRe(e){return e?{__TYPE__:"LinkContent",value:e}:void 0}function YRe(e){return e==null?void 0:e.value}function e8(e){var x,g;const{allContentViews:t,content:n,contentView:r,fieldLabel:i,imageLabel:o,initialImages:a,isUpdating:s,page:u=0,readOnly:c,thumbnailName:l,onClear:d,onContentChange:p,onCropperDialogClose:A,onPageChange:m,onMediaDialogOpenChange:v}=e,_=((g=(x=n==null?void 0:n.url)==null?void 0:x.split("?")[0])==null?void 0:g.slice(-4))===".svg",C=n!=null&&n.url&&!c?"visible":"hidden",I=!Ce.isImageContent(n);return f.jsxs(h.Box,{display:"flex",gap:12,padding:{inline:12},children:[f.jsx(h.Box,{children:f.jsx(h.Carousel,{getItemSource:xEe,items:t,onPageChange:m,page:u,buttonSize:"small",renderPrevTooltip:S=>f.jsx(h.Tooltip,{content:"Previous",children:S}),renderNextTooltip:S=>f.jsx(h.Tooltip,{content:"Next",children:S}),style:I?{width:181,height:142}:{width:123,height:93},children:S=>(S==null?void 0:S.url)&&f.jsx(h.CarouselItem,{"aria-label":"Image Field Item",src:T7(S.url),alt:S.alt??void 0,isUpdating:s,disableAnimation:I},`${l}_${S.url}`)})}),f.jsxs(h.Box,{width:"100%",display:"flex",flexDirection:"column",gap:I?16:12,children:[f.jsx(uRe,{fieldLabel:i,imageLabel:o,initialImages:a,page:u,displaySeparator:!I,isSVGContentView:_,visibility:C,onClear:d,onCropperDialogClose:A,onMediaDialogOpenChange:v}),f.jsx(sRe,{readOnly:c||!r,altText:(r==null?void 0:r.alt)??"",onValueChange:S=>{r&&p(SEe(l,n,r,S))}}),I&&f.jsx(zRe,{linkTo:n.linkTo,onLinkToChange:S=>{p({...n,linkTo:S})}})]})]})}function GRe(e){const{content:t,onContentChange:n,field:r}=e,[i,o]=$.useState(0),[a,s]=$.useTransition(),u=bEe(r),c=u[i],l=t?CEe(r,t):void 0,d=l==null?void 0:l[i];function p(_){if(!c)return;const C=wEe(c.name,r,t,_);C!==t&&s(()=>n(C))}function A(_){s(()=>o(_))}function m({option:_,croppedImages:C}){if(o(_),!t)return;const I=Object.entries(C).reduce((x,[g,S])=>tRe({field:r,content:x,thumbnail:g,croppedImage:S}),t);I!==t&&s(()=>n(I))}function v(){o==null||o(0),n(void 0)}return{onCropperDialogClose:m,onPageChange:A,onMediaSelected:p,isUpdating:a,page:i,thumbnail:c,allThumbnails:u,allContentViews:l,contentView:d,onClear:v}}function JRe(e){const{content:t,field:n,readOnly:r,onContentChange:i}=e,o=t&&t.origin.url.length>0,{onCropperDialogClose:a,onPageChange:s,onMediaSelected:u,isUpdating:c,page:l,thumbnail:d,allThumbnails:p,allContentViews:A,contentView:m,onClear:v}=GRe({field:n,content:t,onContentChange:i}),[_,C]=$.useState(!1),I=nr(n),x=p.map((y,T)=>{const w=A==null?void 0:A[T];return{thumbnail:y,contentView:w,labels:sC(y,t,w)}}),g=d&&o?sC(d,t,m).filter(io.isDefined):[],S=d&&t&&o&&A;return f.jsx(D7,{isMediaDialogOpen:_,onMediaSelected:u,onMediaDialogOpenChange:C,children:f.jsx($.Suspense,{fallback:f.jsx("div",{style:{height:95}}),children:S?f.jsx(e8,{allContentViews:A,content:t,contentView:m,fieldLabel:I,imageLabel:g,initialImages:x,isUpdating:c,page:l,readOnly:r,thumbnailName:d.name,onClear:v,onContentChange:i,onCropperDialogClose:a,onMediaDialogOpenChange:C,onPageChange:s}):f.jsx(B7,{fieldLabel:I,isUpdating:c,readOnly:r,onMediaDialogOpenChange:C})})})}function ZRe(e){var _,C;const{searchTerm:t,catalogId:n}=e,r=Ee();r.integrationFields||Jt("integrationFields");const{integrationFieldsApiBaseUrl:i,repository:o,authStrategy:a}=r,[s,u]=$.useState(1),[c,l]=$.useState([]),[d,p]=$.useState(""),A=Ve.useRequest(XRe,[i,a,o,n,t,t===d?s:1]);t!==d?(p(t),u(1),l(A.items)):A.items.length>0&&((_=Qt.last(c))==null?void 0:_.id)!==((C=Qt.last(A.items))==null?void 0:C.id)&&l(I=>I.concat(A.items));const m=s<A.totalPages;function v(){m&&u(I=>I+1)}return{items:c,response:A,fetchNextPage:v,hasNextPage:m}}function XRe(e,t,n,r,i,o=1,a=30){const s=new URL(`if/search/${r}`,e);return s.searchParams.set("searchTerm",i),s.searchParams.set("limit",a.toString()),s.searchParams.set("page",o.toString()),pe.request(s,{headers:{repository:n},credentials:pe.getRequestCredentials(t),okType:eOe})}const t8=L.object({id:L.string(),title:L.string(),imageURL:L.string().optional(),description:L.string().optional()}),eOe=L.object({items:L.array(t8),totalPages:L.number(),page:L.number()});function n8(e){const{itemId:t,catalogId:n}=e,r=Ee();r.integrationFields||Jt("integrationFields");const{integrationFieldsApiBaseUrl:i,repository:o,authStrategy:a}=r,u=Ve.useRequest(tOe,[i,a,o,n,t]).items[0];if(!u)throw new Error("Item not found");return{item:u}}function tOe(e,t,n,r,i){const o=new URL(`if/read/${r}`,e);return o.searchParams.set("ids",[i].toString()),pe.request(o,{headers:{repository:n},credentials:pe.getRequestCredentials(t),okType:nOe})}const nOe=L.object({items:L.array(t8)});function VR(e){const{item:t,onClick:n,catalogId:r}=e;return f.jsxs(h.PreviewCard,{variant:"large",onClick:n,children:[f.jsx(rOe,{src:t.imageURL??"",alt:t.title}),f.jsxs(h.PreviewContent,{children:[f.jsx(h.Badge,{title:`Catalog: ${r}`,icon:"multipleStop",size:"medium"}),f.jsx(h.Text,{variant:"bold",color:"grey12",sx:{marginTop:4},children:t.title}),f.jsx(h.Text,{variant:"small",color:"grey11",children:t.description??t.id})]})]})}const Vh=76;function rOe(e){const{src:t,alt:n}=e;return t?f.jsx(h.PreviewImage,{src:t,alt:n,width:Vh,height:Vh,framed:!0}):f.jsxs(h.Box,{borderRadius:6,backgroundColor:"grey2",height:Vh,width:Vh,flexDirection:"column",alignItems:"center",justifyContent:"center",border:!0,padding:{inline:4,block:8},children:[f.jsx(h.Icon,{name:"hideImage",size:"large",color:"grey11"}),f.jsx(h.Text,{color:"grey11",variant:"small",noSelect:!0,align:"center",children:"No preview image"})]})}function il(){return f.jsxs(h.PreviewCard,{variant:"large",children:[f.jsx(h.Skeleton,{height:76,width:76}),f.jsxs(h.PreviewContent,{children:[f.jsx(h.Skeleton,{height:24,width:168}),f.jsx(h.Skeleton,{height:24,width:240,sx:{marginTop:4}}),f.jsx(h.Skeleton,{height:16,width:144})]})]})}function iOe(e){const{open:t,onOpenChange:n,catalogId:r,onSelectItem:i}=e,o=Ne.useDebounceState({initialState:""}),a=Ee();return f.jsx(h.Dialog,{open:t,onOpenChange:n,hasClose:!1,size:{width:612,height:724},children:f.jsx(h.DialogContent,{children:f.jsxs(h.Box,{flexDirection:"column",height:"100%",children:[f.jsxs(h.Box,{padding:{top:16,inline:16},flexDirection:"column",gap:8,children:[f.jsx(h.FormSearchInput,{value:o.value,onValueChange:o.set,placeholder:"Search in your catalog"}),f.jsx(h.Text,{variant:"smallBold",color:"grey11",children:"Select an item"})]}),a.integrationFields?f.jsx(h.ErrorBoundary,{renderError:()=>f.jsx(dC,{message:"There was an error while fetching your catalog items."}),children:f.jsx($.Suspense,{fallback:f.jsxs(h.Box,{flexDirection:"column",gap:12,padding:{top:10,inline:16,bottom:16},children:[f.jsx(il,{}),f.jsx(il,{}),f.jsx(il,{}),f.jsx(il,{}),f.jsx(il,{})]}),children:f.jsx(oOe,{searchTerm:o.debouncedValue,catalogId:r,onItemClick:i})})}):f.jsx(dC,{message:"Slice Machine does not yet support mock data for integration field in the simulator."})]})})})}function oOe(e){const{catalogId:t,searchTerm:n,onItemClick:r}=e,[i,o]=$.useTransition(),{items:a,hasNextPage:s,fetchNextPage:u}=ZRe({catalogId:t,searchTerm:n});return f.jsx(f.Fragment,{children:f.jsxs(h.ScrollArea,{onScrollToBottom:()=>s&&o(u),style:{flexGrow:1,paddingTop:h.theme.space[10],paddingBottom:h.theme.space[16],paddingInline:h.theme.space[16],display:"flex",flexDirection:"column",gap:h.theme.space[12]},threshold:252,children:[a.length===0?f.jsx(dC,{}):a.map(c=>f.jsx(VR,{item:c,catalogId:t,onClick:()=>r(c)},c.id)),f.jsx(h.AnimatedElement,{animation:{name:"fade"},children:i&&f.jsx(h.Text,{color:"grey11",align:"center",sx:{marginBlock:8},children:"Loading more results ..."})})]})})}function dC(e){const{message:t="We can't find any items matching your search"}=e,n="Oops!";return f.jsx(h.Box,{justifyContent:"center",flexDirection:"column",height:"100%",children:f.jsxs(h.BlankSlate,{children:[f.jsx(h.BlankSlateIcon,{name:"close",lineColor:"purple10",backgroundColor:"purple3",borderColor:"purple6",borderStyle:"dashed",size:"xlarge"}),f.jsx(h.BlankSlateTitle,{size:"big",children:n}),f.jsx(h.BlankSlateDescription,{width:360,children:t})]})})}function aOe(e){const{itemId:t,item:n}=e,r=Ee();return t&&n&&n.id===t?f.jsx(ol,{...e,value:n.title}):t&&r.integrationFields?f.jsx(h.ErrorBoundary,{renderError:()=>f.jsx(ol,{...e,value:t}),children:f.jsx($.Suspense,{fallback:f.jsx(ol,{...e,value:t}),children:f.jsx(cOe,{...e,itemId:t})},t)},t):t&&!r.integrationFields?f.jsx(ol,{...e,value:t}):f.jsx(ol,{...e,value:""})}function sOe(e){const{catalogId:t,itemId:n,item:r}=e,i=Ee();return n&&r&&r.id===n?f.jsx(h.FieldFooter,{children:f.jsx(VR,{catalogId:t,item:r})}):n&&i.integrationFields?f.jsx(h.ErrorBoundary,{renderError:()=>null,children:f.jsx(h.FieldFooter,{children:f.jsx($.Suspense,{fallback:f.jsx(il,{}),children:f.jsx(uOe,{catalogId:t,itemId:n})},n)})},n):null}function uOe(e){const{itemId:t,catalogId:n}=e,{item:r}=n8({catalogId:n,itemId:t});return f.jsx(VR,{catalogId:n,item:r})}function ol(e){const{id:t,field:n,readOnly:r,value:i,onFocus:o,onClearItem:a}=e;return f.jsx(Qs,{id:t,placeholder:Wc(n),readOnly:!0,variant:"link",value:i,...!r&&{cursor:"pointer",onFocus:o},endAdornment:f.jsx(h.Button,{startIcon:"close",color:"grey",size:"small",disabled:!i,onClick:a})})}function cOe(e){const{itemId:t,catalogId:n}=e,{item:r}=n8({catalogId:n,itemId:t});return f.jsx(ol,{...e,value:r.title})}function lOe(e){var A;const{id:t,field:n,content:r,readOnly:i,onContentChange:o}=e,[a,s]=$.useState(!1),[u,c]=$.useState(),l=(A=n.config)==null?void 0:A.catalog;if(!l)return null;function d(m){o({value:m.id,__TYPE__:"IntegrationFieldsContent"}),c(m),s(!1)}function p(){o(void 0),c(void 0)}return f.jsxs(f.Fragment,{children:[f.jsxs(h.Field,{footer:f.jsx(sOe,{catalogId:l,item:u,itemId:r==null?void 0:r.value}),children:[f.jsx(h.FieldIcon,{name:"multipleStop"}),f.jsx(h.FieldLabel,{htmlFor:t,children:nr(n)}),f.jsx(h.FieldControl,{children:f.jsx(aOe,{id:t,field:n,readOnly:i,catalogId:l,item:u,itemId:r==null?void 0:r.value,onFocus:()=>s(!0),onClearItem:p})})]}),f.jsx(iOe,{open:a,onOpenChange:s,catalogId:l,onSelectItem:d})]})}function fOe(e){const{content:t,field:n,id:r,onContentChange:i,readOnly:o}=e;return f.jsxs(h.Field,{children:[f.jsx(h.FieldIcon,{name:"notes"}),f.jsx(h.FieldLabel,{htmlFor:r,children:nr(n)}),f.jsx(h.FieldControl,{children:f.jsx(h.TextArea,{id:r,placeholder:Wc(n),readOnly:o,paddingLeft:4,paddingRight:12,sx:{flexGrow:1},value:(t==null?void 0:t.value)??"",onChange:a=>{i(dOe(a))}})})]})}function dOe(e){return e.length===0?void 0:{__TYPE__:"FieldContent",type:"Text",value:e}}const pOe=({content:e,field:t,id:n,onContentChange:r,readOnly:i})=>{var s,u;const o=Number(e==null?void 0:e.value),a=Number.isFinite(o)?o:void 0;return f.jsxs(h.Field,{children:[f.jsx(h.FieldIcon,{name:"pin"}),f.jsx(h.FieldLabel,{htmlFor:n,children:nr(t)}),f.jsx(h.FieldControl,{children:f.jsx(h.NumberInput,{id:n,value:a,min:(s=t.config)==null?void 0:s.min,max:(u=t.config)==null?void 0:u.max,padding:M7,placeholder:Wc(t),readOnly:i,onValueChange:c=>r(AOe(c))})})]})};function AOe(e){return e===void 0?void 0:{__TYPE__:"FieldContent",type:"Number",value:String(e)}}function An(e){this.content=e}An.prototype={constructor:An,find:function(e){for(var t=0;t<this.content.length;t+=2)if(this.content[t]===e)return t;return-1},get:function(e){var t=this.find(e);return t==-1?void 0:this.content[t+1]},update:function(e,t,n){var r=n&&n!=e?this.remove(n):this,i=r.find(e),o=r.content.slice();return i==-1?o.push(n||e,t):(o[i+1]=t,n&&(o[i]=n)),new An(o)},remove:function(e){var t=this.find(e);if(t==-1)return this;var n=this.content.slice();return n.splice(t,2),new An(n)},addToStart:function(e,t){return new An([e,t].concat(this.remove(e).content))},addToEnd:function(e,t){var n=this.remove(e).content.slice();return n.push(e,t),new An(n)},addBefore:function(e,t,n){var r=this.remove(t),i=r.content.slice(),o=r.find(e);return i.splice(o==-1?i.length:o,0,t,n),new An(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=An.from(e),e.size?new An(e.content.concat(this.subtract(e).content)):this},append:function(e){return e=An.from(e),e.size?new An(this.subtract(e).content.concat(e.content)):this},subtract:function(e){var t=this;e=An.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}};An.from=function(e){if(e instanceof An)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new An(t)};function r8(e,t,n){for(let r=0;;r++){if(r==e.childCount||r==t.childCount)return e.childCount==t.childCount?null:n;let i=e.child(r),o=t.child(r);if(i==o){n+=i.nodeSize;continue}if(!i.sameMarkup(o))return n;if(i.isText&&i.text!=o.text){for(let a=0;i.text[a]==o.text[a];a++)n++;return n}if(i.content.size||o.content.size){let a=r8(i.content,o.content,n+1);if(a!=null)return a}n+=i.nodeSize}}function i8(e,t,n,r){for(let i=e.childCount,o=t.childCount;;){if(i==0||o==0)return i==o?null:{a:n,b:r};let a=e.child(--i),s=t.child(--o),u=a.nodeSize;if(a==s){n-=u,r-=u;continue}if(!a.sameMarkup(s))return{a:n,b:r};if(a.isText&&a.text!=s.text){let c=0,l=Math.min(a.text.length,s.text.length);for(;c<l&&a.text[a.text.length-c-1]==s.text[s.text.length-c-1];)c++,n--,r--;return{a:n,b:r}}if(a.content.size||s.content.size){let c=i8(a.content,s.content,n-1,r-1);if(c)return c}n-=u,r-=u}}class X{constructor(t,n){if(this.content=t,this.size=n||0,n==null)for(let r=0;r<t.length;r++)this.size+=t[r].nodeSize}nodesBetween(t,n,r,i=0,o){for(let a=0,s=0;s<n;a++){let u=this.content[a],c=s+u.nodeSize;if(c>t&&r(u,i+s,o||null,a)!==!1&&u.content.size){let l=s+1;u.nodesBetween(Math.max(0,t-l),Math.min(u.content.size,n-l),r,i+l)}s=c}}descendants(t){this.nodesBetween(0,this.size,t)}textBetween(t,n,r,i){let o="",a=!0;return this.nodesBetween(t,n,(s,u)=>{s.isText?(o+=s.text.slice(Math.max(t,u)-u,n-u),a=!r):s.isLeaf?(i?o+=typeof i=="function"?i(s):i:s.type.spec.leafText&&(o+=s.type.spec.leafText(s)),a=!r):!a&&s.isBlock&&(o+=r,a=!0)},0),o}append(t){if(!t.size)return this;if(!this.size)return t;let n=this.lastChild,r=t.firstChild,i=this.content.slice(),o=0;for(n.isText&&n.sameMarkup(r)&&(i[i.length-1]=n.withText(n.text+r.text),o=1);o<t.content.length;o++)i.push(t.content[o]);return new X(i,this.size+t.size)}cut(t,n=this.size){if(t==0&&n==this.size)return this;let r=[],i=0;if(n>t)for(let o=0,a=0;a<n;o++){let s=this.content[o],u=a+s.nodeSize;u>t&&((a<t||u>n)&&(s.isText?s=s.cut(Math.max(0,t-a),Math.min(s.text.length,n-a)):s=s.cut(Math.max(0,t-a-1),Math.min(s.content.size,n-a-1))),r.push(s),i+=s.nodeSize),a=u}return new X(r,i)}cutByIndex(t,n){return t==n?X.empty:t==0&&n==this.content.length?this:new X(this.content.slice(t,n))}replaceChild(t,n){let r=this.content[t];if(r==n)return this;let i=this.content.slice(),o=this.size+n.nodeSize-r.nodeSize;return i[t]=n,new X(i,o)}addToStart(t){return new X([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new X(this.content.concat(t),this.size+t.nodeSize)}eq(t){if(this.content.length!=t.content.length)return!1;for(let n=0;n<this.content.length;n++)if(!this.content[n].eq(t.content[n]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(t){let n=this.content[t];if(!n)throw new RangeError("Index "+t+" out of range for "+this);return n}maybeChild(t){return this.content[t]||null}forEach(t){for(let n=0,r=0;n<this.content.length;n++){let i=this.content[n];t(i,r,n),r+=i.nodeSize}}findDiffStart(t,n=0){return r8(this,t,n)}findDiffEnd(t,n=this.size,r=t.size){return i8(this,t,n,r)}findIndex(t,n=-1){if(t==0)return Qh(0,t);if(t==this.size)return Qh(this.content.length,t);if(t>this.size||t<0)throw new RangeError(`Position ${t} outside of fragment (${this})`);for(let r=0,i=0;;r++){let o=this.child(r),a=i+o.nodeSize;if(a>=t)return a==t||n>0?Qh(r+1,a):Qh(r,i);i=a}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(t=>t.toJSON()):null}static fromJSON(t,n){if(!n)return X.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new X(n.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return X.empty;let n,r=0;for(let i=0;i<t.length;i++){let o=t[i];r+=o.nodeSize,i&&o.isText&&t[i-1].sameMarkup(o)?(n||(n=t.slice(0,i)),n[n.length-1]=o.withText(n[n.length-1].text+o.text)):n&&n.push(o)}return new X(n||t,r)}static from(t){if(!t)return X.empty;if(t instanceof X)return t;if(Array.isArray(t))return this.fromArray(t);if(t.attrs)return new X([t],t.nodeSize);throw new RangeError("Can not convert "+t+" to a Fragment"+(t.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}X.empty=new X([],0);const Jb={index:0,offset:0};function Qh(e,t){return Jb.index=e,Jb.offset=t,Jb}function Nm(e,t){if(e===t)return!0;if(!(e&&typeof e=="object")||!(t&&typeof t=="object"))return!1;let n=Array.isArray(e);if(Array.isArray(t)!=n)return!1;if(n){if(e.length!=t.length)return!1;for(let r=0;r<e.length;r++)if(!Nm(e[r],t[r]))return!1}else{for(let r in e)if(!(r in t)||!Nm(e[r],t[r]))return!1;for(let r in t)if(!(r in e))return!1}return!0}let vt=class pC{constructor(t,n){this.type=t,this.attrs=n}addToSet(t){let n,r=!1;for(let i=0;i<t.length;i++){let o=t[i];if(this.eq(o))return t;if(this.type.excludes(o.type))n||(n=t.slice(0,i));else{if(o.type.excludes(this.type))return t;!r&&o.type.rank>this.type.rank&&(n||(n=t.slice(0,i)),n.push(this),r=!0),n&&n.push(o)}}return n||(n=t.slice()),r||n.push(this),n}removeFromSet(t){for(let n=0;n<t.length;n++)if(this.eq(t[n]))return t.slice(0,n).concat(t.slice(n+1));return t}isInSet(t){for(let n=0;n<t.length;n++)if(this.eq(t[n]))return!0;return!1}eq(t){return this==t||this.type==t.type&&Nm(this.attrs,t.attrs)}toJSON(){let t={type:this.type.name};for(let n in this.attrs){t.attrs=this.attrs;break}return t}static fromJSON(t,n){if(!n)throw new RangeError("Invalid input for Mark.fromJSON");let r=t.marks[n.type];if(!r)throw new RangeError(`There is no mark type ${n.type} in this schema`);return r.create(n.attrs)}static sameSet(t,n){if(t==n)return!0;if(t.length!=n.length)return!1;for(let r=0;r<t.length;r++)if(!t[r].eq(n[r]))return!1;return!0}static setFrom(t){if(!t||Array.isArray(t)&&t.length==0)return pC.none;if(t instanceof pC)return[t];let n=t.slice();return n.sort((r,i)=>r.type.rank-i.type.rank),n}};vt.none=[];class mp extends Error{}class ae{constructor(t,n,r){this.content=t,this.openStart=n,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(t,n){let r=a8(this.content,t+this.openStart,n);return r&&new ae(r,this.openStart,this.openEnd)}removeBetween(t,n){return new ae(o8(this.content,t+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(t){return this.content.eq(t.content)&&this.openStart==t.openStart&&this.openEnd==t.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let t={content:this.content.toJSON()};return this.openStart>0&&(t.openStart=this.openStart),this.openEnd>0&&(t.openEnd=this.openEnd),t}static fromJSON(t,n){if(!n)return ae.empty;let r=n.openStart||0,i=n.openEnd||0;if(typeof r!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new ae(X.fromJSON(t,n.content),r,i)}static maxOpen(t,n=!0){let r=0,i=0;for(let o=t.firstChild;o&&!o.isLeaf&&(n||!o.type.spec.isolating);o=o.firstChild)r++;for(let o=t.lastChild;o&&!o.isLeaf&&(n||!o.type.spec.isolating);o=o.lastChild)i++;return new ae(t,r,i)}}ae.empty=new ae(X.empty,0,0);function o8(e,t,n){let{index:r,offset:i}=e.findIndex(t),o=e.maybeChild(r),{index:a,offset:s}=e.findIndex(n);if(i==t||o.isText){if(s!=n&&!e.child(a).isText)throw new RangeError("Removing non-flat range");return e.cut(0,t).append(e.cut(n))}if(r!=a)throw new RangeError("Removing non-flat range");return e.replaceChild(r,o.copy(o8(o.content,t-i-1,n-i-1)))}function a8(e,t,n,r){let{index:i,offset:o}=e.findIndex(t),a=e.maybeChild(i);if(o==t||a.isText)return r&&!r.canReplace(i,i,n)?null:e.cut(0,t).append(n).append(e.cut(t));let s=a8(a.content,t-o-1,n);return s&&e.replaceChild(i,a.copy(s))}function hOe(e,t,n){if(n.openStart>e.depth)throw new mp("Inserted content deeper than insertion position");if(e.depth-n.openStart!=t.depth-n.openEnd)throw new mp("Inconsistent open depths");return s8(e,t,n,0)}function s8(e,t,n,r){let i=e.index(r),o=e.node(r);if(i==t.index(r)&&r<e.depth-n.openStart){let a=s8(e,t,n,r+1);return o.copy(o.content.replaceChild(i,a))}else if(n.content.size)if(!n.openStart&&!n.openEnd&&e.depth==r&&t.depth==r){let a=e.parent,s=a.content;return Au(a,s.cut(0,e.parentOffset).append(n.content).append(s.cut(t.parentOffset)))}else{let{start:a,end:s}=mOe(n,e);return Au(o,c8(e,a,s,t,r))}else return Au(o,qm(e,t,r))}function u8(e,t){if(!t.type.compatibleContent(e.type))throw new mp("Cannot join "+t.type.name+" onto "+e.type.name)}function AC(e,t,n){let r=e.node(n);return u8(r,t.node(n)),r}function pu(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 Od(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&&(pu(e.nodeAfter,r),o++));for(let s=o;s<a;s++)pu(i.child(s),r);t&&t.depth==n&&t.textOffset&&pu(t.nodeBefore,r)}function Au(e,t){return e.type.checkContent(t),e.copy(t)}function c8(e,t,n,r,i){let o=e.depth>i&&AC(e,t,i+1),a=r.depth>i&&AC(n,r,i+1),s=[];return Od(null,e,i,s),o&&a&&t.index(i)==n.index(i)?(u8(o,a),pu(Au(o,c8(e,t,n,r,i+1)),s)):(o&&pu(Au(o,qm(e,t,i+1)),s),Od(t,n,i,s),a&&pu(Au(a,qm(n,r,i+1)),s)),Od(r,null,i,s),new X(s)}function qm(e,t,n){let r=[];if(Od(null,e,n,r),e.depth>n){let i=AC(e,t,n+1);pu(Au(i,qm(e,t,n+1)),r)}return Od(t,null,n,r),new X(r)}function mOe(e,t){let n=t.depth-e.openStart,i=t.node(n).copy(e.content);for(let o=n-1;o>=0;o--)i=t.node(o).copy(X.from(i));return{start:i.resolveNoCache(e.openStart+n),end:i.resolveNoCache(i.content.size-e.openEnd-n)}}class gp{constructor(t,n,r){this.pos=t,this.path=n,this.parentOffset=r,this.depth=n.length/3-1}resolveDepth(t){return t==null?this.depth:t<0?this.depth+t:t}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(t){return this.path[this.resolveDepth(t)*3]}index(t){return this.path[this.resolveDepth(t)*3+1]}indexAfter(t){return t=this.resolveDepth(t),this.index(t)+(t==this.depth&&!this.textOffset?0:1)}start(t){return t=this.resolveDepth(t),t==0?0:this.path[t*3-1]+1}end(t){return t=this.resolveDepth(t),this.start(t)+this.node(t).content.size}before(t){if(t=this.resolveDepth(t),!t)throw new RangeError("There is no position before the top-level node");return t==this.depth+1?this.pos:this.path[t*3-1]}after(t){if(t=this.resolveDepth(t),!t)throw new RangeError("There is no position after the top-level node");return t==this.depth+1?this.pos:this.path[t*3-1]+this.path[t*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let t=this.parent,n=this.index(this.depth);if(n==t.childCount)return null;let r=this.pos-this.path[this.path.length-1],i=t.child(n);return r?t.child(n).cut(r):i}get nodeBefore(){let t=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(t).cut(0,n):t==0?null:this.parent.child(t-1)}posAtIndex(t,n){n=this.resolveDepth(n);let r=this.path[n*3],i=n==0?0:this.path[n*3-1]+1;for(let o=0;o<t;o++)i+=r.child(o).nodeSize;return i}marks(){let t=this.parent,n=this.index();if(t.content.size==0)return vt.none;if(this.textOffset)return t.child(n).marks;let r=t.maybeChild(n-1),i=t.maybeChild(n);if(!r){let s=r;r=i,i=s}let o=r.marks;for(var a=0;a<o.length;a++)o[a].type.spec.inclusive===!1&&(!i||!o[a].isInSet(i.marks))&&(o=o[a--].removeFromSet(o));return o}marksAcross(t){let n=this.parent.maybeChild(this.index());if(!n||!n.isInline)return null;let r=n.marks,i=t.parent.maybeChild(t.index());for(var o=0;o<r.length;o++)r[o].type.spec.inclusive===!1&&(!i||!r[o].isInSet(i.marks))&&(r=r[o--].removeFromSet(r));return r}sharedDepth(t){for(let n=this.depth;n>0;n--)if(this.start(n)<=t&&this.end(n)>=t)return n;return 0}blockRange(t=this,n){if(t.pos<this.pos)return t.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==t.pos?1:0);r>=0;r--)if(t.pos<=this.end(r)&&(!n||n(this.node(r))))return new Vm(this,t,r);return null}sameParent(t){return this.pos-this.parentOffset==t.pos-t.parentOffset}max(t){return t.pos>this.pos?t:this}min(t){return t.pos<this.pos?t:this}toString(){let t="";for(let n=1;n<=this.depth;n++)t+=(t?"/":"")+this.node(n).type.name+"_"+this.index(n-1);return t+":"+this.parentOffset}static resolve(t,n){if(!(n>=0&&n<=t.content.size))throw new RangeError("Position "+n+" out of range");let r=[],i=0,o=n;for(let a=t;;){let{index:s,offset:u}=a.content.findIndex(o),c=o-u;if(r.push(a,s,i+u),!c||(a=a.child(s),a.isText))break;o=c-1,i+=u+1}return new gp(n,r,o)}static resolveCached(t,n){for(let i=0;i<Zb.length;i++){let o=Zb[i];if(o.pos==n&&o.doc==t)return o}let r=Zb[Xb]=gp.resolve(t,n);return Xb=(Xb+1)%gOe,r}}let Zb=[],Xb=0,gOe=12;class Vm{constructor(t,n,r){this.$from=t,this.$to=n,this.depth=r}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const vOe=Object.create(null);let hl=class hC{constructor(t,n,r,i=vt.none){this.type=t,this.attrs=n,this.marks=i,this.content=r||X.empty}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(t){return this.content.child(t)}maybeChild(t){return this.content.maybeChild(t)}forEach(t){this.content.forEach(t)}nodesBetween(t,n,r,i=0){this.content.nodesBetween(t,n,r,i,this)}descendants(t){this.nodesBetween(0,this.content.size,t)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(t,n,r,i){return this.content.textBetween(t,n,r,i)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(t){return this==t||this.sameMarkup(t)&&this.content.eq(t.content)}sameMarkup(t){return this.hasMarkup(t.type,t.attrs,t.marks)}hasMarkup(t,n,r){return this.type==t&&Nm(this.attrs,n||t.defaultAttrs||vOe)&&vt.sameSet(this.marks,r||vt.none)}copy(t=null){return t==this.content?this:new hC(this.type,this.attrs,t,this.marks)}mark(t){return t==this.marks?this:new hC(this.type,this.attrs,this.content,t)}cut(t,n=this.content.size){return t==0&&n==this.content.size?this:this.copy(this.content.cut(t,n))}slice(t,n=this.content.size,r=!1){if(t==n)return ae.empty;let i=this.resolve(t),o=this.resolve(n),a=r?0:i.sharedDepth(n),s=i.start(a),c=i.node(a).content.cut(i.pos-s,o.pos-s);return new ae(c,i.depth-a,o.depth-a)}replace(t,n,r){return hOe(this.resolve(t),this.resolve(n),r)}nodeAt(t){for(let n=this;;){let{index:r,offset:i}=n.content.findIndex(t);if(n=n.maybeChild(r),!n)return null;if(i==t||n.isText)return n;t-=i+1}}childAfter(t){let{index:n,offset:r}=this.content.findIndex(t);return{node:this.content.maybeChild(n),index:n,offset:r}}childBefore(t){if(t==0)return{node:null,index:0,offset:0};let{index:n,offset:r}=this.content.findIndex(t);if(r<t)return{node:this.content.child(n),index:n,offset:r};let i=this.content.child(n-1);return{node:i,index:n-1,offset:r-i.nodeSize}}resolve(t){return gp.resolveCached(this,t)}resolveNoCache(t){return gp.resolve(this,t)}rangeHasMark(t,n,r){let i=!1;return n>t&&this.nodesBetween(t,n,o=>(r.isInSet(o.marks)&&(i=!0),!i)),i}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let t=this.type.name;return this.content.size&&(t+="("+this.content.toStringInner()+")"),l8(this.marks,t)}contentMatchAt(t){let n=this.type.contentMatch.matchFragment(this.content,0,t);if(!n)throw new Error("Called contentMatchAt on a node with invalid content");return n}canReplace(t,n,r=X.empty,i=0,o=r.childCount){let a=this.contentMatchAt(t).matchFragment(r,i,o),s=a&&a.matchFragment(this.content,n);if(!s||!s.validEnd)return!1;for(let u=i;u<o;u++)if(!this.type.allowsMarks(r.child(u).marks))return!1;return!0}canReplaceWith(t,n,r,i){if(i&&!this.type.allowsMarks(i))return!1;let o=this.contentMatchAt(t).matchType(r),a=o&&o.matchFragment(this.content,n);return a?a.validEnd:!1}canAppend(t){return t.content.size?this.canReplace(this.childCount,this.childCount,t.content):this.type.compatibleContent(t.type)}check(){this.type.checkContent(this.content);let t=vt.none;for(let n=0;n<this.marks.length;n++)t=this.marks[n].addToSet(t);if(!vt.sameSet(t,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(n=>n.type.name)}`);this.content.forEach(n=>n.check())}toJSON(){let t={type:this.type.name};for(let n in this.attrs){t.attrs=this.attrs;break}return this.content.size&&(t.content=this.content.toJSON()),this.marks.length&&(t.marks=this.marks.map(n=>n.toJSON())),t}static fromJSON(t,n){if(!n)throw new RangeError("Invalid input for Node.fromJSON");let r=null;if(n.marks){if(!Array.isArray(n.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=n.marks.map(t.markFromJSON)}if(n.type=="text"){if(typeof n.text!="string")throw new RangeError("Invalid text node in JSON");return t.text(n.text,r)}let i=X.fromJSON(t,n.content);return t.nodeType(n.type).create(n.attrs,i,r)}};hl.prototype.text=void 0;class Qm extends hl{constructor(t,n,r,i){if(super(t,n,null,i),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):l8(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(t,n){return this.text.slice(t,n)}get nodeSize(){return this.text.length}mark(t){return t==this.marks?this:new Qm(this.type,this.attrs,this.text,t)}withText(t){return t==this.text?this:new Qm(this.type,this.attrs,t,this.marks)}cut(t=0,n=this.text.length){return t==0&&n==this.text.length?this:this.withText(this.text.slice(t,n))}eq(t){return this.sameMarkup(t)&&this.text==t.text}toJSON(){let t=super.toJSON();return t.text=this.text,t}}function l8(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+"("+t+")";return t}class Uu{constructor(t){this.validEnd=t,this.next=[],this.wrapCache=[]}static parse(t,n){let r=new yOe(t,n);if(r.next==null)return Uu.empty;let i=f8(r);r.next&&r.err("Unexpected trailing text");let o=xOe(TOe(i));return wOe(o,r),o}matchType(t){for(let n=0;n<this.next.length;n++)if(this.next[n].type==t)return this.next[n].next;return null}matchFragment(t,n=0,r=t.childCount){let i=this;for(let o=n;i&&o<r;o++)i=i.matchType(t.child(o).type);return i}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let t=0;t<this.next.length;t++){let{type:n}=this.next[t];if(!(n.isText||n.hasRequiredAttrs()))return n}return null}compatible(t){for(let n=0;n<this.next.length;n++)for(let r=0;r<t.next.length;r++)if(this.next[n].type==t.next[r].type)return!0;return!1}fillBefore(t,n=!1,r=0){let i=[this];function o(a,s){let u=a.matchFragment(t,r);if(u&&(!n||u.validEnd))return X.from(s.map(c=>c.createAndFill()));for(let c=0;c<a.next.length;c++){let{type:l,next:d}=a.next[c];if(!(l.isText||l.hasRequiredAttrs())&&i.indexOf(d)==-1){i.push(d);let p=o(d,s.concat(l));if(p)return p}}return null}return o(this,[])}findWrapping(t){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==t)return this.wrapCache[r+1];let n=this.computeWrapping(t);return this.wrapCache.push(t,n),n}computeWrapping(t){let n=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let i=r.shift(),o=i.match;if(o.matchType(t)){let a=[];for(let s=i;s.type;s=s.via)a.push(s.type);return a.reverse()}for(let a=0;a<o.next.length;a++){let{type:s,next:u}=o.next[a];!s.isLeaf&&!s.hasRequiredAttrs()&&!(s.name in n)&&(!i.type||u.validEnd)&&(r.push({match:s.contentMatch,type:s,via:i}),n[s.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(t){if(t>=this.next.length)throw new RangeError(`There's no ${t}th edge in this content match`);return this.next[t]}toString(){let t=[];function n(r){t.push(r);for(let i=0;i<r.next.length;i++)t.indexOf(r.next[i].next)==-1&&n(r.next[i].next)}return n(this),t.map((r,i)=>{let o=i+(r.validEnd?"*":" ")+" ";for(let a=0;a<r.next.length;a++)o+=(a?", ":"")+r.next[a].type.name+"->"+t.indexOf(r.next[a].next);return o}).join(`
38
+ `)}}Uu.empty=new Uu(!0);class yOe{constructor(t,n){this.string=t,this.nodeTypes=n,this.inline=null,this.pos=0,this.tokens=t.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(t){return this.next==t&&(this.pos++||!0)}err(t){throw new SyntaxError(t+" (in content expression '"+this.string+"')")}}function f8(e){let t=[];do t.push(bOe(e));while(e.eat("|"));return t.length==1?t[0]:{type:"choice",exprs:t}}function bOe(e){let t=[];do t.push(COe(e));while(e.next&&e.next!=")"&&e.next!="|");return t.length==1?t[0]:{type:"seq",exprs:t}}function COe(e){let t=IOe(e);for(;;)if(e.eat("+"))t={type:"plus",expr:t};else if(e.eat("*"))t={type:"star",expr:t};else if(e.eat("?"))t={type:"opt",expr:t};else if(e.eat("{"))t=SOe(e,t);else break;return t}function ik(e){/\D/.test(e.next)&&e.err("Expected number, got '"+e.next+"'");let t=Number(e.next);return e.pos++,t}function SOe(e,t){let n=ik(e),r=n;return e.eat(",")&&(e.next!="}"?r=ik(e):r=-1),e.eat("}")||e.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:t}}function _Oe(e,t){let n=e.nodeTypes,r=n[t];if(r)return[r];let i=[];for(let o in n){let a=n[o];a.groups.indexOf(t)>-1&&i.push(a)}return i.length==0&&e.err("No node type or group '"+t+"' found"),i}function IOe(e){if(e.eat("(")){let t=f8(e);return e.eat(")")||e.err("Missing closing paren"),t}else if(/\W/.test(e.next))e.err("Unexpected token '"+e.next+"'");else{let t=_Oe(e,e.next).map(n=>(e.inline==null?e.inline=n.isInline:e.inline!=n.isInline&&e.err("Mixing inline and block content"),{type:"name",value:n}));return e.pos++,t.length==1?t[0]:{type:"choice",exprs:t}}}function TOe(e){let t=[[]];return i(o(e,0),n()),t;function n(){return t.push([])-1}function r(a,s,u){let c={term:u,to:s};return t[a].push(c),c}function i(a,s){a.forEach(u=>u.to=s)}function o(a,s){if(a.type=="choice")return a.exprs.reduce((u,c)=>u.concat(o(c,s)),[]);if(a.type=="seq")for(let u=0;;u++){let c=o(a.exprs[u],s);if(u==a.exprs.length-1)return c;i(c,s=n())}else if(a.type=="star"){let u=n();return r(s,u),i(o(a.expr,u),u),[r(u)]}else if(a.type=="plus"){let u=n();return i(o(a.expr,s),u),i(o(a.expr,u),u),[r(u)]}else{if(a.type=="opt")return[r(s)].concat(o(a.expr,s));if(a.type=="range"){let u=s;for(let c=0;c<a.min;c++){let l=n();i(o(a.expr,u),l),u=l}if(a.max==-1)i(o(a.expr,u),u);else for(let c=a.min;c<a.max;c++){let l=n();r(u,l),i(o(a.expr,u),l),u=l}return[r(u)]}else{if(a.type=="name")return[r(s,void 0,a.value)];throw new Error("Unknown expr type")}}}}function d8(e,t){return t-e}function ok(e,t){let n=[];return r(t),n.sort(d8);function r(i){let o=e[i];if(o.length==1&&!o[0].term)return r(o[0].to);n.push(i);for(let a=0;a<o.length;a++){let{term:s,to:u}=o[a];!s&&n.indexOf(u)==-1&&r(u)}}}function xOe(e){let t=Object.create(null);return n(ok(e,0));function n(r){let i=[];r.forEach(a=>{e[a].forEach(({term:s,to:u})=>{if(!s)return;let c;for(let l=0;l<i.length;l++)i[l][0]==s&&(c=i[l][1]);ok(e,u).forEach(l=>{c||i.push([s,c=[]]),c.indexOf(l)==-1&&c.push(l)})})});let o=t[r.join(",")]=new Uu(r.indexOf(e.length-1)>-1);for(let a=0;a<i.length;a++){let s=i[a][1].sort(d8);o.next.push({type:i[a][0],next:t[s.join(",")]||n(s)})}return o}}function wOe(e,t){for(let n=0,r=[e];n<r.length;n++){let i=r[n],o=!i.validEnd,a=[];for(let s=0;s<i.next.length;s++){let{type:u,next:c}=i.next[s];a.push(u.name),o&&!(u.isText||u.hasRequiredAttrs())&&(o=!1),r.indexOf(c)==-1&&r.push(c)}o&&t.err("Only non-generatable nodes ("+a.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function p8(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 A8(e,t){let n=Object.create(null);for(let r in e){let i=t&&t[r];if(i===void 0){let o=e[r];if(o.hasDefault)i=o.default;else throw new RangeError("No value supplied for attribute "+r)}n[r]=i}return n}function h8(e){let t=Object.create(null);if(e)for(let n in e)t[n]=new EOe(e[n]);return t}let ak=class m8{constructor(t,n,r){this.name=t,this.schema=n,this.spec=r,this.markSet=null,this.groups=r.group?r.group.split(" "):[],this.attrs=h8(r.attrs),this.defaultAttrs=p8(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(r.inline||t=="text"),this.isText=t=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==Uu.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let t in this.attrs)if(this.attrs[t].isRequired)return!0;return!1}compatibleContent(t){return this==t||this.contentMatch.compatible(t.contentMatch)}computeAttrs(t){return!t&&this.defaultAttrs?this.defaultAttrs:A8(this.attrs,t)}create(t=null,n,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new hl(this,this.computeAttrs(t),X.from(n),vt.setFrom(r))}createChecked(t=null,n,r){return n=X.from(n),this.checkContent(n),new hl(this,this.computeAttrs(t),n,vt.setFrom(r))}createAndFill(t=null,n,r){if(t=this.computeAttrs(t),n=X.from(n),n.size){let a=this.contentMatch.fillBefore(n);if(!a)return null;n=a.append(n)}let i=this.contentMatch.matchFragment(n),o=i&&i.fillBefore(X.empty,!0);return o?new hl(this,t,n.append(o),vt.setFrom(r)):null}validContent(t){let n=this.contentMatch.matchFragment(t);if(!n||!n.validEnd)return!1;for(let r=0;r<t.childCount;r++)if(!this.allowsMarks(t.child(r).marks))return!1;return!0}checkContent(t){if(!this.validContent(t))throw new RangeError(`Invalid content for node ${this.name}: ${t.toString().slice(0,50)}`)}allowsMarkType(t){return this.markSet==null||this.markSet.indexOf(t)>-1}allowsMarks(t){if(this.markSet==null)return!0;for(let n=0;n<t.length;n++)if(!this.allowsMarkType(t[n].type))return!1;return!0}allowedMarks(t){if(this.markSet==null)return t;let n;for(let r=0;r<t.length;r++)this.allowsMarkType(t[r].type)?n&&n.push(t[r]):n||(n=t.slice(0,r));return n?n.length?n:vt.none:t}static compile(t,n){let r=Object.create(null);t.forEach((o,a)=>r[o]=new m8(o,n,a));let i=n.spec.topNode||"doc";if(!r[i])throw new RangeError("Schema is missing its top node type ('"+i+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let o in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};class EOe{constructor(t){this.hasDefault=Object.prototype.hasOwnProperty.call(t,"default"),this.default=t.default}get isRequired(){return!this.hasDefault}}class QR{constructor(t,n,r,i){this.name=t,this.rank=n,this.schema=r,this.spec=i,this.attrs=h8(i.attrs),this.excluded=null;let o=p8(this.attrs);this.instance=o?new vt(this,o):null}create(t=null){return!t&&this.instance?this.instance:new vt(this,A8(this.attrs,t))}static compile(t,n){let r=Object.create(null),i=0;return t.forEach((o,a)=>r[o]=new QR(o,i++,n,a)),r}removeFromSet(t){for(var n=0;n<t.length;n++)t[n].type==this&&(t=t.slice(0,n).concat(t.slice(n+1)),n--);return t}isInSet(t){for(let n=0;n<t.length;n++)if(t[n].type==this)return t[n]}excludes(t){return this.excluded.indexOf(t)>-1}}class g8{constructor(t){this.cached=Object.create(null);let n=this.spec={};for(let i in t)n[i]=t[i];n.nodes=An.from(t.nodes),n.marks=An.from(t.marks||{}),this.nodes=ak.compile(this.spec.nodes,this),this.marks=QR.compile(this.spec.marks,this);let r=Object.create(null);for(let i in this.nodes){if(i in this.marks)throw new RangeError(i+" can not be both a node and a mark");let o=this.nodes[i],a=o.spec.content||"",s=o.spec.marks;o.contentMatch=r[a]||(r[a]=Uu.parse(a,this.nodes)),o.inlineContent=o.contentMatch.inlineContent,o.markSet=s=="_"?null:s?sk(this,s.split(" ")):s==""||!o.inlineContent?[]:null}for(let i in this.marks){let o=this.marks[i],a=o.spec.excludes;o.excluded=a==null?[o]:a==""?[]:sk(this,a.split(" "))}this.nodeFromJSON=this.nodeFromJSON.bind(this),this.markFromJSON=this.markFromJSON.bind(this),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(t,n=null,r,i){if(typeof t=="string")t=this.nodeType(t);else if(t instanceof ak){if(t.schema!=this)throw new RangeError("Node type from different schema used ("+t.name+")")}else throw new RangeError("Invalid node type: "+t);return t.createChecked(n,r,i)}text(t,n){let r=this.nodes.text;return new Qm(r,r.defaultAttrs,t,vt.setFrom(n))}mark(t,n){return typeof t=="string"&&(t=this.marks[t]),t.create(n)}nodeFromJSON(t){return hl.fromJSON(this,t)}markFromJSON(t){return vt.fromJSON(this,t)}nodeType(t){let n=this.nodes[t];if(!n)throw new RangeError("Unknown node type: "+t);return n}}function sk(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 s in e.marks){let u=e.marks[s];(i=="_"||u.spec.group&&u.spec.group.split(" ").indexOf(i)>-1)&&n.push(a=u)}if(!a)throw new SyntaxError("Unknown mark type: '"+t[r]+"'")}return n}class hu{constructor(t,n){this.schema=t,this.rules=n,this.tags=[],this.styles=[],n.forEach(r=>{r.tag?this.tags.push(r):r.style&&this.styles.push(r)}),this.normalizeLists=!this.tags.some(r=>{if(!/^(ul|ol)\b/.test(r.tag)||!r.node)return!1;let i=t.nodes[r.node];return i.contentMatch.matchType(i)})}parse(t,n={}){let r=new ck(this,n,!1);return r.addAll(t,n.from,n.to),r.finish()}parseSlice(t,n={}){let r=new ck(this,n,!0);return r.addAll(t,n.from,n.to),ae.maxOpen(r.finish())}matchTag(t,n,r){for(let i=r?this.tags.indexOf(r)+1:0;i<this.tags.length;i++){let o=this.tags[i];if(OOe(t,o.tag)&&(o.namespace===void 0||t.namespaceURI==o.namespace)&&(!o.context||n.matchesContext(o.context))){if(o.getAttrs){let a=o.getAttrs(t);if(a===!1)continue;o.attrs=a||void 0}return o}}}matchStyle(t,n,r,i){for(let o=i?this.styles.indexOf(i)+1:0;o<this.styles.length;o++){let a=this.styles[o],s=a.style;if(!(s.indexOf(t)!=0||a.context&&!r.matchesContext(a.context)||s.length>t.length&&(s.charCodeAt(t.length)!=61||s.slice(t.length+1)!=n))){if(a.getAttrs){let u=a.getAttrs(n);if(u===!1)continue;a.attrs=u||void 0}return a}}}static schemaRules(t){let n=[];function r(i){let o=i.priority==null?50:i.priority,a=0;for(;a<n.length;a++){let s=n[a];if((s.priority==null?50:s.priority)<o)break}n.splice(a,0,i)}for(let i in t.marks){let o=t.marks[i].spec.parseDOM;o&&o.forEach(a=>{r(a=lk(a)),a.mark||a.ignore||a.clearMark||(a.mark=i)})}for(let i in t.nodes){let o=t.nodes[i].spec.parseDOM;o&&o.forEach(a=>{r(a=lk(a)),a.node||a.ignore||a.mark||(a.node=i)})}return n}static fromSchema(t){return t.cached.domParser||(t.cached.domParser=new hu(t,hu.schemaRules(t)))}}const v8={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},$Oe={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},y8={ol:!0,ul:!0},zm=1,Hm=2,Fd=4;function uk(e,t,n){return t!=null?(t?zm:0)|(t==="full"?Hm:0):e&&e.whitespace=="pre"?zm|Hm:n&~Fd}class zh{constructor(t,n,r,i,o,a,s){this.type=t,this.attrs=n,this.marks=r,this.pendingMarks=i,this.solid=o,this.options=s,this.content=[],this.activeMarks=vt.none,this.stashMarks=[],this.match=a||(s&Fd?null:t.contentMatch)}findWrapping(t){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(X.from(t));if(n)this.match=this.type.contentMatch.matchFragment(n);else{let r=this.type.contentMatch,i;return(i=r.findWrapping(t.type))?(this.match=r,i):null}}return this.match.findWrapping(t.type)}finish(t){if(!(this.options&zm)){let r=this.content[this.content.length-1],i;if(r&&r.isText&&(i=/[ \t\r\n\u000c]+$/.exec(r.text))){let o=r;r.text.length==i[0].length?this.content.pop():this.content[this.content.length-1]=o.withText(o.text.slice(0,o.text.length-i[0].length))}}let n=X.from(this.content);return!t&&this.match&&(n=n.append(this.match.fillBefore(X.empty,!0))),this.type?this.type.create(this.attrs,n,this.marks):n}popFromStashMark(t){for(let n=this.stashMarks.length-1;n>=0;n--)if(t.eq(this.stashMarks[n]))return this.stashMarks.splice(n,1)[0]}applyPending(t){for(let n=0,r=this.pendingMarks;n<r.length;n++){let i=r[n];(this.type?this.type.allowsMarkType(i.type):kOe(i.type,t))&&!i.isInSet(this.activeMarks)&&(this.activeMarks=i.addToSet(this.activeMarks),this.pendingMarks=i.removeFromSet(this.pendingMarks))}}inlineContext(t){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:t.parentNode&&!v8.hasOwnProperty(t.parentNode.nodeName.toLowerCase())}}class ck{constructor(t,n,r){this.parser=t,this.options=n,this.isOpen=r,this.open=0;let i=n.topNode,o,a=uk(null,n.preserveWhitespace,0)|(r?Fd:0);i?o=new zh(i.type,i.attrs,vt.none,vt.none,!0,n.topMatch||i.type.contentMatch,a):r?o=new zh(null,null,vt.none,vt.none,!0,null,a):o=new zh(t.schema.topNodeType,null,vt.none,vt.none,!0,null,a),this.nodes=[o],this.find=n.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(t){if(t.nodeType==3)this.addTextNode(t);else if(t.nodeType==1){let n=t.getAttribute("style");if(!n)this.addElement(t);else{let r=this.readStyles(FOe(n));if(!r)return;let[i,o]=r,a=this.top;for(let s=0;s<o.length;s++)this.removePendingMark(o[s],a);for(let s=0;s<i.length;s++)this.addPendingMark(i[s]);this.addElement(t);for(let s=0;s<i.length;s++)this.removePendingMark(i[s],a);for(let s=0;s<o.length;s++)this.addPendingMark(o[s])}}}addTextNode(t){let n=t.nodeValue,r=this.top;if(r.options&Hm||r.inlineContext(t)||/[^ \t\r\n\u000c]/.test(n)){if(r.options&zm)r.options&Hm?n=n.replace(/\r\n?/g,`
39
+ `):n=n.replace(/\r?\n|\r/g," ");else if(n=n.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(n)&&this.open==this.nodes.length-1){let i=r.content[r.content.length-1],o=t.previousSibling;(!i||o&&o.nodeName=="BR"||i.isText&&/[ \t\r\n\u000c]$/.test(i.text))&&(n=n.slice(1))}n&&this.insertNode(this.parser.schema.text(n)),this.findInText(t)}else this.findInside(t)}addElement(t,n){let r=t.nodeName.toLowerCase(),i;y8.hasOwnProperty(r)&&this.parser.normalizeLists&&ROe(t);let o=this.options.ruleFromNode&&this.options.ruleFromNode(t)||(i=this.parser.matchTag(t,this,n));if(o?o.ignore:$Oe.hasOwnProperty(r))this.findInside(t),this.ignoreFallback(t);else if(!o||o.skip||o.closeParent){o&&o.closeParent?this.open=Math.max(0,this.open-1):o&&o.skip.nodeType&&(t=o.skip);let a,s=this.top,u=this.needsBlock;if(v8.hasOwnProperty(r))s.content.length&&s.content[0].isInline&&this.open&&(this.open--,s=this.top),a=!0,s.type||(this.needsBlock=!0);else if(!t.firstChild){this.leafFallback(t);return}this.addAll(t),a&&this.sync(s),this.needsBlock=u}else this.addElementByRule(t,o,o.consuming===!1?i:void 0)}leafFallback(t){t.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(t.ownerDocument.createTextNode(`
40
+ `))}ignoreFallback(t){t.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"))}readStyles(t){let n=vt.none,r=vt.none;e:for(let i=0;i<t.length;i+=2)for(let o=void 0;;){let a=this.parser.matchStyle(t[i],t[i+1],this,o);if(!a)continue e;if(a.ignore)return null;if(a.clearMark?this.top.pendingMarks.forEach(s=>{a.clearMark(s)&&(r=s.addToSet(r))}):n=this.parser.schema.marks[a.mark].create(a.attrs).addToSet(n),a.consuming===!1)o=a;else break}return[n,r]}addElementByRule(t,n,r){let i,o,a;n.node?(o=this.parser.schema.nodes[n.node],o.isLeaf?this.insertNode(o.create(n.attrs))||this.leafFallback(t):i=this.enter(o,n.attrs||null,n.preserveWhitespace)):(a=this.parser.schema.marks[n.mark].create(n.attrs),this.addPendingMark(a));let s=this.top;if(o&&o.isLeaf)this.findInside(t);else if(r)this.addElement(t,r);else if(n.getContent)this.findInside(t),n.getContent(t,this.parser.schema).forEach(u=>this.insertNode(u));else{let u=t;typeof n.contentElement=="string"?u=t.querySelector(n.contentElement):typeof n.contentElement=="function"?u=n.contentElement(t):n.contentElement&&(u=n.contentElement),this.findAround(t,u,!0),this.addAll(u)}i&&this.sync(s)&&this.open--,a&&this.removePendingMark(a,s)}addAll(t,n,r){let i=n||0;for(let o=n?t.childNodes[n]:t.firstChild,a=r==null?null:t.childNodes[r];o!=a;o=o.nextSibling,++i)this.findAtPoint(t,i),this.addDOM(o);this.findAtPoint(t,i)}findPlace(t){let n,r;for(let i=this.open;i>=0;i--){let o=this.nodes[i],a=o.findWrapping(t);if(a&&(!n||n.length>a.length)&&(n=a,r=o,!a.length)||o.solid)break}if(!n)return!1;this.sync(r);for(let i=0;i<n.length;i++)this.enterInner(n[i],null,!1);return!0}insertNode(t){if(t.isInline&&this.needsBlock&&!this.top.type){let n=this.textblockFromContext();n&&this.enterInner(n)}if(this.findPlace(t)){this.closeExtra();let n=this.top;n.applyPending(t.type),n.match&&(n.match=n.match.matchType(t.type));let r=n.activeMarks;for(let i=0;i<t.marks.length;i++)(!n.type||n.type.allowsMarkType(t.marks[i].type))&&(r=t.marks[i].addToSet(r));return n.content.push(t.mark(r)),!0}return!1}enter(t,n,r){let i=this.findPlace(t.create(n));return i&&this.enterInner(t,n,!0,r),i}enterInner(t,n=null,r=!1,i){this.closeExtra();let o=this.top;o.applyPending(t),o.match=o.match&&o.match.matchType(t);let a=uk(t,i,o.options);o.options&Fd&&o.content.length==0&&(a|=Fd),this.nodes.push(new zh(t,n,o.activeMarks,o.pendingMarks,r,null,a)),this.open++}closeExtra(t=!1){let n=this.nodes.length-1;if(n>this.open){for(;n>this.open;n--)this.nodes[n-1].content.push(this.nodes[n].finish(t));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(this.isOpen||this.options.topOpen)}sync(t){for(let n=this.open;n>=0;n--)if(this.nodes[n]==t)return this.open=n,!0;return!1}get currentPos(){this.closeExtra();let t=0;for(let n=this.open;n>=0;n--){let r=this.nodes[n].content;for(let i=r.length-1;i>=0;i--)t+=r[i].nodeSize;n&&t++}return t}findAtPoint(t,n){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].node==t&&this.find[r].offset==n&&(this.find[r].pos=this.currentPos)}findInside(t){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].pos==null&&t.nodeType==1&&t.contains(this.find[n].node)&&(this.find[n].pos=this.currentPos)}findAround(t,n,r){if(t!=n&&this.find)for(let i=0;i<this.find.length;i++)this.find[i].pos==null&&t.nodeType==1&&t.contains(this.find[i].node)&&n.compareDocumentPosition(this.find[i].node)&(r?2:4)&&(this.find[i].pos=this.currentPos)}findInText(t){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==t&&(this.find[n].pos=this.currentPos-(t.nodeValue.length-this.find[n].offset))}matchesContext(t){if(t.indexOf("|")>-1)return t.split(/\s*\|\s*/).some(this.matchesContext,this);let n=t.split("/"),r=this.options.context,i=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),o=-(r?r.depth+1:0)+(i?0:1),a=(s,u)=>{for(;s>=0;s--){let c=n[s];if(c==""){if(s==n.length-1||s==0)continue;for(;u>=o;u--)if(a(s-1,u))return!0;return!1}else{let l=u>0||u==0&&i?this.nodes[u].type:r&&u>=o?r.node(u-o).type:null;if(!l||l.name!=c&&l.groups.indexOf(c)==-1)return!1;u--}}return!0};return a(n.length-1,this.open)}textblockFromContext(){let t=this.options.context;if(t)for(let n=t.depth;n>=0;n--){let r=t.node(n).contentMatchAt(t.indexAfter(n)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let n in this.parser.schema.nodes){let r=this.parser.schema.nodes[n];if(r.isTextblock&&r.defaultAttrs)return r}}addPendingMark(t){let n=MOe(t,this.top.pendingMarks);n&&this.top.stashMarks.push(n),this.top.pendingMarks=t.addToSet(this.top.pendingMarks)}removePendingMark(t,n){for(let r=this.open;r>=0;r--){let i=this.nodes[r];if(i.pendingMarks.lastIndexOf(t)>-1)i.pendingMarks=t.removeFromSet(i.pendingMarks);else{i.activeMarks=t.removeFromSet(i.activeMarks);let a=i.popFromStashMark(t);a&&i.type&&i.type.allowsMarkType(a.type)&&(i.activeMarks=a.addToSet(i.activeMarks))}if(i==n)break}}}function ROe(e){for(let t=e.firstChild,n=null;t;t=t.nextSibling){let r=t.nodeType==1?t.nodeName.toLowerCase():null;r&&y8.hasOwnProperty(r)&&n?(n.appendChild(t),t=n):r=="li"?n=t:r&&(n=null)}}function OOe(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function FOe(e){let t=/\s*([\w-]+)\s*:\s*([^;]+)/g,n,r=[];for(;n=t.exec(e);)r.push(n[1],n[2].trim());return r}function lk(e){let t={};for(let n in e)t[n]=e[n];return t}function kOe(e,t){let n=t.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(e))continue;let o=[],a=s=>{o.push(s);for(let u=0;u<s.edgeCount;u++){let{type:c,next:l}=s.edge(u);if(c==t||o.indexOf(l)<0&&a(l))return!0}};if(a(i.contentMatch))return!0}}function MOe(e,t){for(let n=0;n<t.length;n++)if(e.eq(t[n]))return t[n]}class au{constructor(t,n){this.nodes=t,this.marks=n}serializeFragment(t,n={},r){r||(r=e1(n).createDocumentFragment());let i=r,o=[];return t.forEach(a=>{if(o.length||a.marks.length){let s=0,u=0;for(;s<o.length&&u<a.marks.length;){let c=a.marks[u];if(!this.marks[c.type.name]){u++;continue}if(!c.eq(o[s][0])||c.type.spec.spanning===!1)break;s++,u++}for(;s<o.length;)i=o.pop()[1];for(;u<a.marks.length;){let c=a.marks[u++],l=this.serializeMark(c,a.isInline,n);l&&(o.push([c,i]),i.appendChild(l.dom),i=l.contentDOM||l.dom)}}i.appendChild(this.serializeNodeInner(a,n))}),r}serializeNodeInner(t,n){let{dom:r,contentDOM:i}=au.renderSpec(e1(n),this.nodes[t.type.name](t));if(i){if(t.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(t.content,n,i)}return r}serializeNode(t,n={}){let r=this.serializeNodeInner(t,n);for(let i=t.marks.length-1;i>=0;i--){let o=this.serializeMark(t.marks[i],t.isInline,n);o&&((o.contentDOM||o.dom).appendChild(r),r=o.dom)}return r}serializeMark(t,n,r={}){let i=this.marks[t.type.name];return i&&au.renderSpec(e1(r),i(t,n))}static renderSpec(t,n,r=null){if(typeof n=="string")return{dom:t.createTextNode(n)};if(n.nodeType!=null)return{dom:n};if(n.dom&&n.dom.nodeType!=null)return n;let i=n[0],o=i.indexOf(" ");o>0&&(r=i.slice(0,o),i=i.slice(o+1));let a,s=r?t.createElementNS(r,i):t.createElement(i),u=n[1],c=1;if(u&&typeof u=="object"&&u.nodeType==null&&!Array.isArray(u)){c=2;for(let l in u)if(u[l]!=null){let d=l.indexOf(" ");d>0?s.setAttributeNS(l.slice(0,d),l.slice(d+1),u[l]):s.setAttribute(l,u[l])}}for(let l=c;l<n.length;l++){let d=n[l];if(d===0){if(l<n.length-1||l>c)throw new RangeError("Content hole must be the only child of its parent node");return{dom:s,contentDOM:s}}else{let{dom:p,contentDOM:A}=au.renderSpec(t,d,r);if(s.appendChild(p),A){if(a)throw new RangeError("Multiple content holes");a=A}}}return{dom:s,contentDOM:a}}static fromSchema(t){return t.cached.domSerializer||(t.cached.domSerializer=new au(this.nodesFromSchema(t),this.marksFromSchema(t)))}static nodesFromSchema(t){let n=fk(t.nodes);return n.text||(n.text=r=>r.text),n}static marksFromSchema(t){return fk(t.marks)}}function fk(e){let t={};for(let n in e){let r=e[n].spec.toDOM;r&&(t[n]=r)}return t}function e1(e){return e.document||window.document}const b8=65535,C8=Math.pow(2,16);function LOe(e,t){return e+t*C8}function dk(e){return e&b8}function jOe(e){return(e-(e&b8))/C8}const S8=1,_8=2,om=4,I8=8;let mC=class{constructor(t,n,r){this.pos=t,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&I8)>0}get deletedBefore(){return(this.delInfo&(S8|om))>0}get deletedAfter(){return(this.delInfo&(_8|om))>0}get deletedAcross(){return(this.delInfo&om)>0}},Ul=class al{constructor(t,n=!1){if(this.ranges=t,this.inverted=n,!t.length&&al.empty)return al.empty}recover(t){let n=0,r=dk(t);if(!this.inverted)for(let i=0;i<r;i++)n+=this.ranges[i*3+2]-this.ranges[i*3+1];return this.ranges[r*3]+n+jOe(t)}mapResult(t,n=1){return this._map(t,n,!1)}map(t,n=1){return this._map(t,n,!0)}_map(t,n,r){let i=0,o=this.inverted?2:1,a=this.inverted?1:2;for(let s=0;s<this.ranges.length;s+=3){let u=this.ranges[s]-(this.inverted?i:0);if(u>t)break;let c=this.ranges[s+o],l=this.ranges[s+a],d=u+c;if(t<=d){let p=c?t==u?-1:t==d?1:n:n,A=u+i+(p<0?0:l);if(r)return A;let m=t==(n<0?u:d)?null:LOe(s/3,t-u),v=t==u?_8:t==d?S8:om;return(n<0?t!=u:t!=d)&&(v|=I8),new mC(A,v,m)}i+=l-c}return r?t+i:new mC(t+i,0,null)}touches(t,n){let r=0,i=dk(n),o=this.inverted?2:1,a=this.inverted?1:2;for(let s=0;s<this.ranges.length;s+=3){let u=this.ranges[s]-(this.inverted?r:0);if(u>t)break;let c=this.ranges[s+o],l=u+c;if(t<=l&&s==i*3)return!0;r+=this.ranges[s+a]-c}return!1}forEach(t){let n=this.inverted?2:1,r=this.inverted?1:2;for(let i=0,o=0;i<this.ranges.length;i+=3){let a=this.ranges[i],s=a-(this.inverted?o:0),u=a+(this.inverted?0:o),c=this.ranges[i+n],l=this.ranges[i+r];t(s,s+c,u,u+l),o+=l-c}}invert(){return new al(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(t){return t==0?al.empty:new al(t<0?[0,-t,0]:[0,0,t])}};Ul.empty=new Ul([]);class kd{constructor(t=[],n,r=0,i=t.length){this.maps=t,this.mirror=n,this.from=r,this.to=i}slice(t=0,n=this.maps.length){return new kd(this.maps,this.mirror,t,n)}copy(){return new kd(this.maps.slice(),this.mirror&&this.mirror.slice(),this.from,this.to)}appendMap(t,n){this.to=this.maps.push(t),n!=null&&this.setMirror(this.maps.length-1,n)}appendMapping(t){for(let n=0,r=this.maps.length;n<t.maps.length;n++){let i=t.getMirror(n);this.appendMap(t.maps[n],i!=null&&i<n?r+i:void 0)}}getMirror(t){if(this.mirror){for(let n=0;n<this.mirror.length;n++)if(this.mirror[n]==t)return this.mirror[n+(n%2?-1:1)]}}setMirror(t,n){this.mirror||(this.mirror=[]),this.mirror.push(t,n)}appendMappingInverted(t){for(let n=t.maps.length-1,r=this.maps.length+t.maps.length;n>=0;n--){let i=t.getMirror(n);this.appendMap(t.maps[n].invert(),i!=null&&i>n?r-i-1:void 0)}}invert(){let t=new kd;return t.appendMappingInverted(this),t}map(t,n=1){if(this.mirror)return this._map(t,n,!0);for(let r=this.from;r<this.to;r++)t=this.maps[r].map(t,n);return t}mapResult(t,n=1){return this._map(t,n,!1)}_map(t,n,r){let i=0;for(let o=this.from;o<this.to;o++){let a=this.maps[o],s=a.mapResult(t,n);if(s.recover!=null){let u=this.getMirror(o);if(u!=null&&u>o&&u<this.to){o=u,t=this.maps[u].recover(s.recover);continue}}i|=s.delInfo,t=s.pos}return r?t:new mC(t,i,null)}}const t1=Object.create(null);let Sr=class{getMap(){return Ul.empty}merge(t){return null}static fromJSON(t,n){if(!n||!n.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=t1[n.stepType];if(!r)throw new RangeError(`No step type ${n.stepType} defined`);return r.fromJSON(t,n)}static jsonID(t,n){if(t in t1)throw new RangeError("Duplicate use of step JSON ID "+t);return t1[t]=n,n.prototype.jsonID=t,n}},sr=class Id{constructor(t,n){this.doc=t,this.failed=n}static ok(t){return new Id(t,null)}static fail(t){return new Id(null,t)}static fromReplace(t,n,r,i){try{return Id.ok(t.replace(n,r,i))}catch(o){if(o instanceof mp)return Id.fail(o.message);throw o}}};function zR(e,t,n){let r=[];for(let i=0;i<e.childCount;i++){let o=e.child(i);o.content.size&&(o=o.copy(zR(o.content,t,o))),o.isInline&&(o=t(o,n,i)),r.push(o)}return X.fromArray(r)}let T8=class Td extends Sr{constructor(t,n,r){super(),this.from=t,this.to=n,this.mark=r}apply(t){let n=t.slice(this.from,this.to),r=t.resolve(this.from),i=r.node(r.sharedDepth(this.to)),o=new ae(zR(n.content,(a,s)=>!a.isAtom||!s.type.allowsMarkType(this.mark.type)?a:a.mark(this.mark.addToSet(a.marks)),i),n.openStart,n.openEnd);return sr.fromReplace(t,this.from,this.to,o)}invert(){return new x8(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 Td(n.pos,r.pos,this.mark)}merge(t){return t instanceof Td&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new Td(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new Td(n.from,n.to,t.markFromJSON(n.mark))}};Sr.jsonID("addMark",T8);let x8=class xd extends Sr{constructor(t,n,r){super(),this.from=t,this.to=n,this.mark=r}apply(t){let n=t.slice(this.from,this.to),r=new ae(zR(n.content,i=>i.mark(this.mark.removeFromSet(i.marks)),t),n.openStart,n.openEnd);return sr.fromReplace(t,this.from,this.to,r)}invert(){return new T8(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 xd(n.pos,r.pos,this.mark)}merge(t){return t instanceof xd&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new xd(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new xd(n.from,n.to,t.markFromJSON(n.mark))}};Sr.jsonID("removeMark",x8);let w8=class wd extends Sr{constructor(t,n){super(),this.pos=t,this.mark=n}apply(t){let n=t.nodeAt(this.pos);if(!n)return sr.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return sr.fromReplace(t,this.pos,this.pos+1,new ae(X.from(r),0,n.isLeaf?0:1))}invert(t){let n=t.nodeAt(this.pos);if(n){let r=this.mark.addToSet(n.marks);if(r.length==n.marks.length){for(let i=0;i<n.marks.length;i++)if(!n.marks[i].isInSet(r))return new wd(this.pos,n.marks[i]);return new wd(this.pos,this.mark)}}return new E8(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new wd(n.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new wd(n.pos,t.markFromJSON(n.mark))}};Sr.jsonID("addNodeMark",w8);let E8=class gC extends Sr{constructor(t,n){super(),this.pos=t,this.mark=n}apply(t){let n=t.nodeAt(this.pos);if(!n)return sr.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.removeFromSet(n.marks));return sr.fromReplace(t,this.pos,this.pos+1,new ae(X.from(r),0,n.isLeaf?0:1))}invert(t){let n=t.nodeAt(this.pos);return!n||!this.mark.isInSet(n.marks)?this:new w8(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new gC(n.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new gC(n.pos,t.markFromJSON(n.mark))}};Sr.jsonID("removeNodeMark",E8);let Th=class tu extends Sr{constructor(t,n,r,i=!1){super(),this.from=t,this.to=n,this.slice=r,this.structure=i}apply(t){return this.structure&&vC(t,this.from,this.to)?sr.fail("Structure replace would overwrite content"):sr.fromReplace(t,this.from,this.to,this.slice)}getMap(){return new Ul([this.from,this.to-this.from,this.slice.size])}invert(t){return new tu(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 tu(n.pos,Math.max(n.pos,r.pos),this.slice)}merge(t){if(!(t instanceof tu)||t.structure||this.structure)return null;if(this.from+this.slice.size==t.from&&!this.slice.openEnd&&!t.slice.openStart){let n=this.slice.size+t.slice.size==0?ae.empty:new ae(this.slice.content.append(t.slice.content),this.slice.openStart,t.slice.openEnd);return new tu(this.from,this.to+(t.to-t.from),n,this.structure)}else if(t.to==this.from&&!this.slice.openStart&&!t.slice.openEnd){let n=this.slice.size+t.slice.size==0?ae.empty:new ae(t.slice.content.append(this.slice.content),t.slice.openStart,this.slice.openEnd);return new tu(t.from,this.to,n,this.structure)}else return null}toJSON(){let t={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new tu(n.from,n.to,ae.fromJSON(t,n.slice),!!n.structure)}};Sr.jsonID("replace",Th);let aa=class am extends Sr{constructor(t,n,r,i,o,a,s=!1){super(),this.from=t,this.to=n,this.gapFrom=r,this.gapTo=i,this.slice=o,this.insert=a,this.structure=s}apply(t){if(this.structure&&(vC(t,this.from,this.gapFrom)||vC(t,this.gapTo,this.to)))return sr.fail("Structure gap-replace would overwrite content");let n=t.slice(this.gapFrom,this.gapTo);if(n.openStart||n.openEnd)return sr.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,n.content);return r?sr.fromReplace(t,this.from,this.to,r):sr.fail("Content does not fit in gap")}getMap(){return new Ul([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 am(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 am(n.pos,r.pos,i,o,this.slice,this.insert,this.structure)}toJSON(){let t={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number"||typeof n.gapFrom!="number"||typeof n.gapTo!="number"||typeof n.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new am(n.from,n.to,n.gapFrom,n.gapTo,ae.fromJSON(t,n.slice),n.insert,!!n.structure)}};Sr.jsonID("replaceAround",aa);function vC(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 a=r.node(o).maybeChild(r.indexAfter(o));for(;i>0;){if(!a||a.isLeaf)return!0;a=a.firstChild,i--}}return!1}function UOe(e,t,n){return(t==0||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function xh(e){let n=e.parent.content.cutByIndex(e.startIndex,e.endIndex);for(let r=e.depth;;--r){let i=e.$from.node(r),o=e.$from.index(r),a=e.$to.indexAfter(r);if(r<e.depth&&i.canReplace(o,a,n))return r;if(r==0||i.type.spec.isolating||!UOe(i,o,a))break}return null}function $8(e,t,n=null,r=e){let i=BOe(e,t),o=i&&POe(r,t);return o?i.map(pk).concat({type:t,attrs:n}).concat(o.map(pk)):null}function pk(e){return{type:e,attrs:null}}function BOe(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}function POe(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 c=r;u&&c<i;c++)u=u.matchType(n.child(c).type);return!u||!u.validEnd?null:a}function R8(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 c=i.depth-1,l=n-2;c>o;c--,l--){let d=i.node(c),p=i.index(c);if(d.type.spec.isolating)return!1;let A=d.content.cutByIndex(p,d.childCount),m=r&&r[l+1];m&&(A=A.replaceChild(0,m.type.create(m.attrs)));let v=r&&r[l]||d;if(!d.canReplace(p+1,d.childCount)||!v.type.validContent(A))return!1}let s=i.indexAfter(o),u=r&&r[0];return i.node(o).canReplaceWith(s,s,u?u.type:i.node(o+1).type)}function wh(e,t){let n=e.resolve(t),r=n.index();return O8(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function O8(e,t){return!!(e&&t&&!e.isLeaf&&e.canAppend(t))}function F8(e,t,n=-1){let r=e.resolve(t);for(let i=r.depth;;i--){let o,a,s=r.index(i);if(i==r.depth?(o=r.nodeBefore,a=r.nodeAfter):n>0?(o=r.node(i+1),s++,a=r.node(i).maybeChild(s)):(o=r.node(i).maybeChild(s-1),a=r.node(i+1)),o&&!o.isTextblock&&O8(o,a)&&r.node(i).canReplace(s,s+1))return t;if(i==0)break;t=n<0?r.before(i):r.after(i)}}function WOe(e,t,n){let r=e.resolve(t);if(!n.content.size)return t;let i=n.content;for(let o=0;o<n.openStart;o++)i=i.firstChild.content;for(let o=1;o<=(n.openStart==0&&n.size?2:1);o++)for(let a=r.depth;a>=0;a--){let s=a==r.depth?0:r.pos<=(r.start(a+1)+r.end(a+1))/2?-1:1,u=r.index(a)+(s>0?1:0),c=r.node(a),l=!1;if(o==1)l=c.canReplace(u,u,i);else{let d=c.contentMatchAt(u).findWrapping(i.firstChild.type);l=d&&c.canReplaceWith(u,u,d[0])}if(l)return s==0?r.pos:s<0?r.before(a+1):r.after(a+1)}return null}function HR(e,t,n=t,r=ae.empty){if(t==n&&!r.size)return null;let i=e.resolve(t),o=e.resolve(n);return DOe(i,o,r)?new Th(t,n,r):new KOe(i,o,r).fit()}function DOe(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}class KOe{constructor(t,n,r){this.$from=t,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=X.empty;for(let i=0;i<=t.depth;i++){let o=t.node(i);this.frontier.push({type:o.type,match:o.contentMatchAt(t.indexAfter(i))})}for(let i=t.depth;i>0;i--)this.placed=X.from(t.node(i).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let c=this.findFittable();c?this.placeNodes(c):this.openMore()||this.dropNode()}let t=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,r=this.$from,i=this.close(t<0?this.$to:r.doc.resolve(t));if(!i)return null;let o=this.placed,a=r.depth,s=i.depth;for(;a&&s&&o.childCount==1;)o=o.firstChild.content,a--,s--;let u=new ae(o,a,s);return t>-1?new aa(r.pos,t,this.$to.pos,this.$to.end(),u,n):u.size||r.pos!=this.$to.pos?new Th(r.pos,i.pos,u):null}findFittable(){let t=this.unplaced.openStart;for(let n=this.unplaced.content,r=0,i=this.unplaced.openEnd;r<t;r++){let o=n.firstChild;if(n.childCount>1&&(i=0),o.type.spec.isolating&&i<=r){t=r;break}n=o.content}for(let n=1;n<=2;n++)for(let r=n==1?t:this.unplaced.openStart;r>=0;r--){let i,o=null;r?(o=n1(this.unplaced.content,r-1).firstChild,i=o.content):i=this.unplaced.content;let a=i.firstChild;for(let s=this.depth;s>=0;s--){let{type:u,match:c}=this.frontier[s],l,d=null;if(n==1&&(a?c.matchType(a.type)||(d=c.fillBefore(X.from(a),!1)):o&&u.compatibleContent(o.type)))return{sliceDepth:r,frontierDepth:s,parent:o,inject:d};if(n==2&&a&&(l=c.findWrapping(a.type)))return{sliceDepth:r,frontierDepth:s,parent:o,wrap:l};if(o&&c.matchType(o.type))break}}}openMore(){let{content:t,openStart:n,openEnd:r}=this.unplaced,i=n1(t,n);return!i.childCount||i.firstChild.isLeaf?!1:(this.unplaced=new ae(t,n+1,Math.max(r,i.size+n>=t.size-r?n+1:0)),!0)}dropNode(){let{content:t,openStart:n,openEnd:r}=this.unplaced,i=n1(t,n);if(i.childCount<=1&&n>0){let o=t.size-n<=n+i.size;this.unplaced=new ae(Ed(t,n-1,1),n-1,o?n-1:r)}else this.unplaced=new ae(Ed(t,n,1),n,r)}placeNodes({sliceDepth:t,frontierDepth:n,parent:r,inject:i,wrap:o}){for(;this.depth>n;)this.closeFrontierNode();if(o)for(let v=0;v<o.length;v++)this.openFrontierNode(o[v]);let a=this.unplaced,s=r?r.content:a.content,u=a.openStart-t,c=0,l=[],{match:d,type:p}=this.frontier[n];if(i){for(let v=0;v<i.childCount;v++)l.push(i.child(v));d=d.matchFragment(i)}let A=s.size+t-(a.content.size-a.openEnd);for(;c<s.childCount;){let v=s.child(c),_=d.matchType(v.type);if(!_)break;c++,(c>1||u==0||v.content.size)&&(d=_,l.push(k8(v.mark(p.allowedMarks(v.marks)),c==1?u:0,c==s.childCount?A:-1)))}let m=c==s.childCount;m||(A=-1),this.placed=$d(this.placed,n,X.from(l)),this.frontier[n].match=d,m&&A<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let v=0,_=s;v<A;v++){let C=_.lastChild;this.frontier.push({type:C.type,match:C.contentMatchAt(C.childCount)}),_=C.content}this.unplaced=m?t==0?ae.empty:new ae(Ed(a.content,t-1,1),t-1,A<0?a.openEnd:t-1):new ae(Ed(a.content,t,c),a.openStart,a.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let t=this.frontier[this.depth],n;if(!t.type.isTextblock||!r1(this.$to,this.$to.depth,t.type,t.match,!1)||this.$to.depth==this.depth&&(n=this.findCloseLevel(this.$to))&&n.depth==this.depth)return-1;let{depth:r}=this.$to,i=this.$to.after(r);for(;r>1&&i==this.$to.end(--r);)++i;return i}findCloseLevel(t){e:for(let n=Math.min(this.depth,t.depth);n>=0;n--){let{match:r,type:i}=this.frontier[n],o=n<t.depth&&t.end(n+1)==t.pos+(t.depth-(n+1)),a=r1(t,n,i,r,o);if(a){for(let s=n-1;s>=0;s--){let{match:u,type:c}=this.frontier[s],l=r1(t,s,c,u,!0);if(!l||l.childCount)continue e}return{depth:n,fit:a,move:o?t.doc.resolve(t.after(n+1)):t}}}}close(t){let n=this.findCloseLevel(t);if(!n)return null;for(;this.depth>n.depth;)this.closeFrontierNode();n.fit.childCount&&(this.placed=$d(this.placed,n.depth,n.fit)),t=n.move;for(let r=n.depth+1;r<=t.depth;r++){let i=t.node(r),o=i.type.contentMatch.fillBefore(i.content,!0,t.index(r));this.openFrontierNode(i.type,i.attrs,o)}return t}openFrontierNode(t,n=null,r){let i=this.frontier[this.depth];i.match=i.match.matchType(t),this.placed=$d(this.placed,this.depth,X.from(t.create(n,r))),this.frontier.push({type:t,match:t.contentMatch})}closeFrontierNode(){let n=this.frontier.pop().match.fillBefore(X.empty,!0);n.childCount&&(this.placed=$d(this.placed,this.frontier.length,n))}}function Ed(e,t,n){return t==0?e.cutByIndex(n,e.childCount):e.replaceChild(0,e.firstChild.copy(Ed(e.firstChild.content,t-1,n)))}function $d(e,t,n){return t==0?e.append(n):e.replaceChild(e.childCount-1,e.lastChild.copy($d(e.lastChild.content,t-1,n)))}function n1(e,t){for(let n=0;n<t;n++)e=e.firstChild.content;return e}function k8(e,t,n){if(t<=0)return e;let r=e.content;return t>1&&(r=r.replaceChild(0,k8(r.firstChild,t-1,r.childCount==1?n-1:0))),t>0&&(r=e.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(e.type.contentMatch.matchFragment(r).fillBefore(X.empty,!0)))),e.copy(r)}function r1(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 s=r.fillBefore(o.content,!0,a);return s&&!NOe(n,o.content,a)?s:null}function NOe(e,t,n){for(let r=n;r<t.childCount;r++)if(!e.allowsMarks(t.child(r).marks))return!0;return!1}let qOe=class sm extends Sr{constructor(t,n,r){super(),this.pos=t,this.attr=n,this.value=r}apply(t){let n=t.nodeAt(this.pos);if(!n)return sr.fail("No node at attribute step's position");let r=Object.create(null);for(let o in n.attrs)r[o]=n.attrs[o];r[this.attr]=this.value;let i=n.type.create(r,null,n.marks);return sr.fromReplace(t,this.pos,this.pos+1,new ae(X.from(i),0,n.isLeaf?0:1))}getMap(){return Ul.empty}invert(t){return new sm(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 sm(n.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(t,n){if(typeof n.pos!="number"||typeof n.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new sm(n.pos,n.attr,n.value)}};Sr.jsonID("attr",qOe);let vp=class extends Error{};vp=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n};vp.prototype=Object.create(Error.prototype);vp.prototype.constructor=vp;vp.prototype.name="TransformError";const i1=Object.create(null);class ze{constructor(t,n,r){this.$anchor=t,this.$head=n,this.ranges=r||[new VOe(t.min(n),t.max(n))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let t=this.ranges;for(let n=0;n<t.length;n++)if(t[n].$from.pos!=t[n].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(t,n=ae.empty){let r=n.content.lastChild,i=null;for(let s=0;s<n.openEnd;s++)i=r,r=r.lastChild;let o=t.steps.length,a=this.ranges;for(let s=0;s<a.length;s++){let{$from:u,$to:c}=a[s],l=t.mapping.slice(o);t.replaceRange(l.map(u.pos),l.map(c.pos),s?ae.empty:n),s==0&&mk(t,o,(r?r.isInline:i&&i.isTextblock)?-1:1)}}replaceWith(t,n){let r=t.steps.length,i=this.ranges;for(let o=0;o<i.length;o++){let{$from:a,$to:s}=i[o],u=t.mapping.slice(r),c=u.map(a.pos),l=u.map(s.pos);o?t.deleteRange(c,l):(t.replaceRangeWith(c,l,n),mk(t,r,n.isInline?-1:1))}}static findFrom(t,n,r=!1){let i=t.parent.inlineContent?new Be(t):sl(t.node(0),t.parent,t.pos,t.index(),n,r);if(i)return i;for(let o=t.depth-1;o>=0;o--){let a=n<0?sl(t.node(0),t.node(o),t.before(o+1),t.index(o),n,r):sl(t.node(0),t.node(o),t.after(o+1),t.index(o)+1,n,r);if(a)return a}return null}static near(t,n=1){return this.findFrom(t,n)||this.findFrom(t,-n)||new Ri(t.node(0))}static atStart(t){return sl(t,t,0,0,1)||new Ri(t)}static atEnd(t){return sl(t,t,t.content.size,t.childCount,-1)||new Ri(t)}static fromJSON(t,n){if(!n||!n.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=i1[n.type];if(!r)throw new RangeError(`No selection type ${n.type} defined`);return r.fromJSON(t,n)}static jsonID(t,n){if(t in i1)throw new RangeError("Duplicate use of selection JSON ID "+t);return i1[t]=n,n.prototype.jsonID=t,n}getBookmark(){return Be.between(this.$anchor,this.$head).getBookmark()}}ze.prototype.visible=!0;class VOe{constructor(t,n){this.$from=t,this.$to=n}}let Ak=!1;function hk(e){!Ak&&!e.parent.inlineContent&&(Ak=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+e.parent.type.name+")"))}class Be extends ze{constructor(t,n=t){hk(t),hk(n),super(t,n)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(t,n){let r=t.resolve(n.map(this.head));if(!r.parent.inlineContent)return ze.near(r);let i=t.resolve(n.map(this.anchor));return new Be(i.parent.inlineContent?i:r,r)}replace(t,n=ae.empty){if(super.replace(t,n),n==ae.empty){let r=this.$from.marksAcross(this.$to);r&&t.ensureMarks(r)}}eq(t){return t instanceof Be&&t.anchor==this.anchor&&t.head==this.head}getBookmark(){return new H0(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(t,n){if(typeof n.anchor!="number"||typeof n.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new Be(t.resolve(n.anchor),t.resolve(n.head))}static create(t,n,r=n){let i=t.resolve(n);return new this(i,r==n?i:t.resolve(r))}static between(t,n,r){let i=t.pos-n.pos;if((!r||i)&&(r=i>=0?1:-1),!n.parent.inlineContent){let o=ze.findFrom(n,r,!0)||ze.findFrom(n,-r,!0);if(o)n=o.$head;else return ze.near(n,r)}return t.parent.inlineContent||(i==0?t=n:(t=(ze.findFrom(t,-r,!0)||ze.findFrom(t,r,!0)).$anchor,t.pos<n.pos!=i<0&&(t=n))),new Be(t,n)}}ze.jsonID("text",Be);class H0{constructor(t,n){this.anchor=t,this.head=n}map(t){return new H0(t.map(this.anchor),t.map(this.head))}resolve(t){return Be.between(t.resolve(this.anchor),t.resolve(this.head))}}class ve extends ze{constructor(t){let n=t.nodeAfter,r=t.node(0).resolve(t.pos+n.nodeSize);super(t,r),this.node=n}map(t,n){let{deleted:r,pos:i}=n.mapResult(this.anchor),o=t.resolve(i);return r?ze.near(o):new ve(o)}content(){return new ae(X.from(this.node),0,0)}eq(t){return t instanceof ve&&t.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new YR(this.anchor)}static fromJSON(t,n){if(typeof n.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new ve(t.resolve(n.anchor))}static create(t,n){return new ve(t.resolve(n))}static isSelectable(t){return!t.isText&&t.type.spec.selectable!==!1}}ve.prototype.visible=!1;ze.jsonID("node",ve);class YR{constructor(t){this.anchor=t}map(t){let{deleted:n,pos:r}=t.mapResult(this.anchor);return n?new H0(r,r):new YR(r)}resolve(t){let n=t.resolve(this.anchor),r=n.nodeAfter;return r&&ve.isSelectable(r)?new ve(n):ze.near(n)}}class Ri extends ze{constructor(t){super(t.resolve(0),t.resolve(t.content.size))}replace(t,n=ae.empty){if(n==ae.empty){t.delete(0,t.doc.content.size);let r=ze.atStart(t.doc);r.eq(t.selection)||t.setSelection(r)}else super.replace(t,n)}toJSON(){return{type:"all"}}static fromJSON(t){return new Ri(t)}map(t){return new Ri(t)}eq(t){return t instanceof Ri}getBookmark(){return QOe}}ze.jsonID("all",Ri);const QOe={map(){return this},resolve(e){return new Ri(e)}};function sl(e,t,n,r,i,o=!1){if(t.inlineContent)return Be.create(e,n);for(let a=r-(i>0?0:1);i>0?a<t.childCount:a>=0;a+=i){let s=t.child(a);if(s.isAtom){if(!o&&ve.isSelectable(s))return ve.create(e,n-(i<0?s.nodeSize:0))}else{let u=sl(e,s,n+i,i<0?s.childCount:0,i,o);if(u)return u}n+=s.nodeSize*i}return null}function mk(e,t,n){let r=e.steps.length-1;if(r<t)return;let i=e.steps[r];if(!(i instanceof Th||i instanceof aa))return;let o=e.mapping.maps[r],a;o.forEach((s,u,c,l)=>{a==null&&(a=l)}),e.setSelection(ze.near(e.doc.resolve(a),n))}function gk(e,t){return!t||!e?e:e.bind(t)}class Hh{constructor(t,n,r){this.name=t,this.init=gk(n.init,r),this.apply=gk(n.apply,r)}}new Hh("doc",{init(e){return e.doc||e.schema.topNodeType.createAndFill()},apply(e){return e.doc}}),new Hh("selection",{init(e,t){return e.selection||ze.atStart(t.doc)},apply(e){return e.selection}}),new Hh("storedMarks",{init(e){return e.storedMarks||null},apply(e,t,n,r){return r.selection.$cursor?e.storedMarks:null}}),new Hh("scrollToSelection",{init(){return 0},apply(e,t){return e.scrolledIntoView?t+1:t}});function M8(e,t,n){for(let r in e){let i=e[r];i instanceof Function?i=i.bind(t):r=="handleDOMEvents"&&(i=M8(i,t,{})),n[r]=i}return n}class zr{constructor(t){this.spec=t,this.props={},t.props&&M8(t.props,this,this.props),this.key=t.key?t.key.key:L8("plugin")}getState(t){return t[this.key]}}const o1=Object.create(null);function L8(e){return e in o1?e+"$"+ ++o1[e]:(o1[e]=0,e+"$")}class eo{constructor(t="key"){this.key=L8(t)}get(t){return t.config.pluginsByKey[this.key]}getState(t){return t[this.key]}}const Dc=function(e){for(var t=0;;t++)if(e=e.previousSibling,!e)return t},j8=function(e,t,n,r){return n&&(vk(e,t,n,r,-1)||vk(e,t,n,r,1))},zOe=/^(img|br|input|textarea|hr)$/i;function vk(e,t,n,r,i){for(;;){if(e==n&&t==r)return!0;if(t==(i<0?0:Ym(e))){let o=e.parentNode;if(!o||o.nodeType!=1||GR(e)||zOe.test(e.nodeName)||e.contentEditable=="false")return!1;t=Dc(e)+(i<0?0:1),e=o}else if(e.nodeType==1){if(e=e.childNodes[t+(i<0?-1:0)],e.contentEditable=="false")return!1;t=i<0?Ym(e):0}else return!1}}function Ym(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function HOe(e,t,n){for(let r=t==0,i=t==Ym(e);r||i;){if(e==n)return!0;let o=Dc(e);if(e=e.parentNode,!e)return!1;r=r&&o==0,i=i&&o==Ym(e)}}function GR(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)}const U8=function(e){return e.focusNode&&j8(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)};function B8(e,t){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=e,n.key=n.code=t,n}const ho=typeof navigator<"u"?navigator:null,yk=typeof document<"u"?document:null,zs=ho&&ho.userAgent||"",yC=/Edge\/(\d+)/.exec(zs),P8=/MSIE \d/.exec(zs),bC=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(zs),Eh=!!(P8||bC||yC),W8=P8?document.documentMode:bC?+bC[1]:yC?+yC[1]:0,Y0=!Eh&&/gecko\/(\d+)/i.test(zs);Y0&&+(/Firefox\/(\d+)/.exec(zs)||[0,0])[1];const CC=!Eh&&/Chrome\/(\d+)/.exec(zs),Hs=!!CC,D8=CC?+CC[1]:0,Kc=!Eh&&!!ho&&/Apple Computer/.test(ho.vendor),JR=Kc&&(/Mobile\/\w+/.test(zs)||!!ho&&ho.maxTouchPoints>2),Xr=JR||(ho?/Mac/.test(ho.platform):!1),YOe=ho?/Win/.test(ho.platform):!1,$h=/Android \d/.test(zs),ZR=!!yk&&"webkitFontSmoothing"in yk.documentElement.style,GOe=ZR?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function JOe(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&&i.size==0,a=e.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(a<0)return null;let s=r.resolve(a),u,c;if(U8(n)){for(u=s;i&&!i.node;)i=i.parent;let l=i.node;if(i&&l.isAtom&&ve.isSelectable(l)&&i.parent&&!(l.isInline&&HOe(n.focusNode,n.focusOffset,i.dom))){let d=i.posBefore;c=new ve(a==d?s:r.resolve(d))}}else{let l=e.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(l<0)return null;u=r.resolve(l)}if(!c){let l=t=="pointer"||e.state.selection.head<s.pos&&!o?1:-1;c=N8(e,u,s,l)}return c}function K8(e){return e.editable?e.hasFocus():tFe(e)&&document.activeElement&&document.activeElement.contains(e.dom)}function XR(e,t=!1){let n=e.state.selection;if(eFe(e,n),!!K8(e)){if(!t&&e.input.mouseDown&&e.input.mouseDown.allowDefault&&Hs){let r=e.domSelectionRange(),i=e.domObserver.currentSelection;if(r.anchorNode&&i.anchorNode&&j8(r.anchorNode,r.anchorOffset,i.anchorNode,i.anchorOffset)){e.input.mouseDown.delayedSelectionSync=!0,e.domObserver.setCurSelection();return}}if(e.domObserver.disconnectSelection(),e.cursorWrapper)XOe(e);else{let{anchor:r,head:i}=n,o,a;bk&&!(n instanceof Be)&&(n.$from.parent.inlineContent||(o=Ck(e,n.from)),!n.empty&&!n.$from.parent.inlineContent&&(a=Ck(e,n.to))),e.docView.setSelection(r,i,e.root,t),bk&&(o&&Sk(o),a&&Sk(a)),n.visible?e.dom.classList.remove("ProseMirror-hideselection"):(e.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&ZOe(e))}e.domObserver.setCurSelection(),e.domObserver.connectSelection()}}const bk=Kc||Hs&&D8<63;function Ck(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(Kc&&i&&i.contentEditable=="false")return a1(i);if((!i||i.contentEditable=="false")&&(!o||o.contentEditable=="false")){if(i)return a1(i);if(o)return a1(o)}}function a1(e){return e.contentEditable="true",Kc&&e.draggable&&(e.draggable=!1,e.wasDraggable=!0),e}function Sk(e){e.contentEditable="false",e.wasDraggable&&(e.draggable=!0,e.wasDraggable=null)}function ZOe(e){let t=e.dom.ownerDocument;t.removeEventListener("selectionchange",e.input.hideSelectionGuard);let n=e.domSelectionRange(),r=n.anchorNode,i=n.anchorOffset;t.addEventListener("selectionchange",e.input.hideSelectionGuard=()=>{(n.anchorNode!=r||n.anchorOffset!=i)&&(t.removeEventListener("selectionchange",e.input.hideSelectionGuard),setTimeout(()=>{(!K8(e)||e.state.selection.visible)&&e.dom.classList.remove("ProseMirror-hideselection")},20))})}function XOe(e){let t=e.domSelection(),n=document.createRange();if(!t)return;let r=e.cursorWrapper.dom,i=r.nodeName=="IMG";i?n.setStart(r.parentNode,Dc(r)+1):n.setStart(r,0),n.collapse(!0),t.removeAllRanges(),t.addRange(n),!i&&!e.state.selection.visible&&Eh&&W8<=11&&(r.disabled=!0,r.disabled=!1)}function eFe(e,t){if(t instanceof ve){let n=e.docView.descAt(t.from);n!=e.lastSelectedViewDesc&&(_k(e),n&&n.selectNode(),e.lastSelectedViewDesc=n)}else _k(e)}function _k(e){e.lastSelectedViewDesc&&(e.lastSelectedViewDesc.parent&&e.lastSelectedViewDesc.deselectNode(),e.lastSelectedViewDesc=void 0)}function N8(e,t,n,r){return e.someProp("createSelectionBetween",i=>i(e,t,n))||Be.between(t,n,r)}function tFe(e){let t=e.domSelectionRange();if(!t.anchorNode)return!1;try{return e.dom.contains(t.anchorNode.nodeType==3?t.anchorNode.parentNode:t.anchorNode)&&(e.editable||e.dom.contains(t.focusNode.nodeType==3?t.focusNode.parentNode:t.focusNode))}catch{return!1}}function SC(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&&ze.findFrom(o,t)}function Ya(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function Ik(e,t,n){let r=e.state.selection;if(r instanceof Be)if(n.indexOf("s")>-1){let{$head:i}=r,o=i.textOffset?null:t<0?i.nodeBefore:i.nodeAfter;if(!o||o.isText||!o.isLeaf)return!1;let a=e.state.doc.resolve(i.pos+o.nodeSize*(t<0?-1:1));return Ya(e,new Be(r.$anchor,a))}else if(r.empty){if(e.endOfTextblock(t>0?"forward":"backward")){let i=SC(e.state,t);return i&&i instanceof ve?Ya(e,i):!1}else if(!(Xr&&n.indexOf("m")>-1)){let i=r.$head,o=i.textOffset?null:t<0?i.nodeBefore:i.nodeAfter,a;if(!o||o.isText)return!1;let s=t<0?i.pos-o.nodeSize:i.pos;return o.isAtom||(a=e.docView.descAt(s))&&!a.contentDOM?ve.isSelectable(o)?Ya(e,new ve(t<0?e.state.doc.resolve(i.pos-o.nodeSize):i)):ZR?Ya(e,new Be(e.state.doc.resolve(t<0?s:s+o.nodeSize))):!1:!1}}else return!1;else{if(r instanceof ve&&r.node.isInline)return Ya(e,new Be(t>0?r.$to:r.$from));{let i=SC(e.state,t);return i?Ya(e,i):!1}}}function Gm(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function Md(e,t){let n=e.pmViewDesc;return n&&n.size==0&&(t<0||e.nextSibling||e.nodeName!="BR")}function el(e,t){return t<0?nFe(e):rFe(e)}function nFe(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i,o,a=!1;for(Y0&&n.nodeType==1&&r<Gm(n)&&Md(n.childNodes[r],-1)&&(a=!0);;)if(r>0){if(n.nodeType!=1)break;{let s=n.childNodes[r-1];if(Md(s,-1))i=n,o=--r;else if(s.nodeType==3)n=s,r=n.nodeValue.length;else break}}else{if(q8(n))break;{let s=n.previousSibling;for(;s&&Md(s,-1);)i=n.parentNode,o=Dc(s),s=s.previousSibling;if(s)n=s,r=Gm(n);else{if(n=n.parentNode,n==e.dom)break;r=0}}}a?_C(e,n,r):i&&_C(e,i,o)}function rFe(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i=Gm(n),o,a;for(;;)if(r<i){if(n.nodeType!=1)break;let s=n.childNodes[r];if(Md(s,1))o=n,a=++r;else break}else{if(q8(n))break;{let s=n.nextSibling;for(;s&&Md(s,1);)o=s.parentNode,a=Dc(s)+1,s=s.nextSibling;if(s)n=s,r=0,i=Gm(n);else{if(n=n.parentNode,n==e.dom)break;r=i=0}}}o&&_C(e,o,a)}function q8(e){let t=e.pmViewDesc;return t&&t.node&&t.node.isBlock}function iFe(e,t){for(;e&&t==e.childNodes.length&&!GR(e);)t=Dc(e)+1,e=e.parentNode;for(;e&&t<e.childNodes.length;){let n=e.childNodes[t];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable=="false")break;e=n,t=0}}function oFe(e,t){for(;e&&!t&&!GR(e);)t=Dc(e),e=e.parentNode;for(;e&&t;){let n=e.childNodes[t-1];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable=="false")break;e=n,t=e.childNodes.length}}function _C(e,t,n){if(t.nodeType!=3){let o,a;(a=iFe(t,n))?(t=a,n=0):(o=oFe(t,n))&&(t=o,n=o.nodeValue.length)}let r=e.domSelection();if(!r)return;if(U8(r)){let o=document.createRange();o.setEnd(t,n),o.setStart(t,n),r.removeAllRanges(),r.addRange(o)}else r.extend&&r.extend(t,n);e.domObserver.setCurSelection();let{state:i}=e;setTimeout(()=>{e.state==i&&XR(e)},50)}function Tk(e,t){let n=e.state.doc.resolve(t);if(!(Hs||YOe)&&n.parent.inlineContent){let i=e.coordsAtPos(t);if(t>n.start()){let o=e.coordsAtPos(t-1),a=(o.top+o.bottom)/2;if(a>i.top&&a<i.bottom&&Math.abs(o.left-i.left)>1)return o.left<i.left?"ltr":"rtl"}if(t<n.end()){let o=e.coordsAtPos(t+1),a=(o.top+o.bottom)/2;if(a>i.top&&a<i.bottom&&Math.abs(o.left-i.left)>1)return o.left>i.left?"ltr":"rtl"}}return getComputedStyle(e.dom).direction=="rtl"?"rtl":"ltr"}function xk(e,t,n){let r=e.state.selection;if(r instanceof Be&&!r.empty||n.indexOf("s")>-1||Xr&&n.indexOf("m")>-1)return!1;let{$from:i,$to:o}=r;if(!i.parent.inlineContent||e.endOfTextblock(t<0?"up":"down")){let a=SC(e.state,t);if(a&&a instanceof ve)return Ya(e,a)}if(!i.parent.inlineContent){let a=t<0?i:o,s=r instanceof Ri?ze.near(a,t):ze.findFrom(a,t);return s?Ya(e,s):!1}return!1}function wk(e,t){if(!(e.state.selection instanceof Be))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 a=e.state.tr;return t<0?a.delete(n.pos-o.nodeSize,n.pos):a.delete(n.pos,n.pos+o.nodeSize),e.dispatch(a),!0}return!1}function Ek(e,t,n){e.domObserver.stop(),t.contentEditable=n,e.domObserver.start()}function aFe(e){if(!Kc||e.state.selection.$head.parentOffset>0)return!1;let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(t&&t.nodeType==1&&n==0&&t.firstChild&&t.firstChild.contentEditable=="false"){let r=t.firstChild;Ek(e,r,"true"),setTimeout(()=>Ek(e,r,"false"),20)}return!1}function sFe(e){let t="";return e.ctrlKey&&(t+="c"),e.metaKey&&(t+="m"),e.altKey&&(t+="a"),e.shiftKey&&(t+="s"),t}function uFe(e,t){let n=t.keyCode,r=sFe(t);if(n==8||Xr&&n==72&&r=="c")return wk(e,-1)||el(e,-1);if(n==46&&!t.shiftKey||Xr&&n==68&&r=="c")return wk(e,1)||el(e,1);if(n==13||n==27)return!0;if(n==37||Xr&&n==66&&r=="c"){let i=n==37?Tk(e,e.state.selection.from)=="ltr"?-1:1:-1;return Ik(e,i,r)||el(e,i)}else if(n==39||Xr&&n==70&&r=="c"){let i=n==39?Tk(e,e.state.selection.from)=="ltr"?1:-1:1;return Ik(e,i,r)||el(e,i)}else{if(n==38||Xr&&n==80&&r=="c")return xk(e,-1,r)||el(e,-1);if(n==40||Xr&&n==78&&r=="c")return aFe(e)||xk(e,1,r)||el(e,1);if(r==(Xr?"m":"c")&&(n==66||n==73||n==89||n==90))return!0}return!1}function V8(e,t){e.someProp("transformCopied",A=>{t=A(t,e)});let n=[],{content:r,openStart:i,openEnd:o}=t;for(;i>1&&o>1&&r.childCount==1&&r.firstChild.childCount==1;){i--,o--;let A=r.firstChild;n.push(A.type.name,A.attrs!=A.type.defaultAttrs?A.attrs:null),r=A.content}let a=e.someProp("clipboardSerializer")||au.fromSchema(e.state.schema),s=J8(),u=s.createElement("div");u.appendChild(a.serializeFragment(r,{document:s}));let c=u.firstChild,l,d=0;for(;c&&c.nodeType==1&&(l=G8[c.nodeName.toLowerCase()]);){for(let A=l.length-1;A>=0;A--){let m=s.createElement(l[A]);for(;u.firstChild;)m.appendChild(u.firstChild);u.appendChild(m),d++}c=u.firstChild}c&&c.nodeType==1&&c.setAttribute("data-pm-slice",`${i} ${o}${d?` -${d}`:""} ${JSON.stringify(n)}`);let p=e.someProp("clipboardTextSerializer",A=>A(t,e))||t.content.textBetween(0,t.content.size,`
41
41
 
42
42
  `);return{dom:u,text:p,slice:t}}function Q8(e,t,n,r,i){let o=i.parent.type.spec.code,a,s;if(!n&&!t)return null;let u=t&&(r||o||!n);if(u){if(e.someProp("transformPastedText",p=>{t=p(t,o||r,e)}),o)return t?new ae(X.from(e.state.schema.text(t.replace(/\r\n?/g,`
43
- `))),0,0):ae.empty;let d=e.someProp("clipboardTextParser",p=>p(t,i,r,e));if(d)s=d;else{let p=i.marks(),{schema:A}=e.state,m=au.fromSchema(A);a=document.createElement("div"),t.split(/(?:\r\n?|\n)+/).forEach(v=>{let _=a.appendChild(document.createElement("p"));v&&_.appendChild(m.serializeNode(A.text(v,p)))})}}else e.someProp("transformPastedHTML",d=>{n=d(n,e)}),a=hFe(n),ZR&&mFe(a);let c=a&&a.querySelector("[data-pm-slice]"),l=c&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(c.getAttribute("data-pm-slice")||"");if(l&&l[3])for(let d=+l[3];d>0;d--){let p=a.firstChild;for(;p&&p.nodeType!=1;)p=p.nextSibling;if(!p)break;a=p}if(s||(s=(e.someProp("clipboardParser")||e.someProp("domParser")||hu.fromSchema(e.state.schema)).parseSlice(a,{preserveWhitespace:!!(u||l),context:i,ruleFromNode(p){return p.nodeName=="BR"&&!p.nextSibling&&p.parentNode&&!pFe.test(p.parentNode.nodeName)?{ignore:!0}:null}})),l)s=gFe($k(s,+l[1],+l[2]),l[4]);else if(s=ae.maxOpen(AFe(s.content,i),!0),s.openStart||s.openEnd){let d=0,p=0;for(let A=s.content.firstChild;d<s.openStart&&!A.type.spec.isolating;d++,A=A.firstChild);for(let A=s.content.lastChild;p<s.openEnd&&!A.type.spec.isolating;p++,A=A.lastChild);s=$k(s,d,p)}return e.someProp("transformPasted",d=>{s=d(s,e)}),s}const pFe=/^(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 AFe(e,t){if(e.childCount<2)return e;for(let n=t.depth;n>=0;n--){let i=t.node(n).contentMatchAt(t.index(n)),o,a=[];if(e.forEach(s=>{if(!a)return;let u=i.findWrapping(s.type),c;if(!u)return a=null;if(c=a.length&&o.length&&H8(u,o,s,a[a.length-1],0))a[a.length-1]=c;else{a.length&&(a[a.length-1]=Y8(a[a.length-1],o.length));let l=z8(s,u);a.push(l),i=i.matchType(l.type),o=u}}),a)return X.from(a)}return e}function z8(e,t,n=0){for(let r=t.length-1;r>=n;r--)e=t[r].create(null,X.from(e));return e}function H8(e,t,n,r,i){if(i<e.length&&i<t.length&&e[i]==t[i]){let o=H8(e,t,n,r.lastChild,i+1);if(o)return r.copy(r.content.replaceChild(r.childCount-1,o));if(r.contentMatchAt(r.childCount).matchType(i==e.length-1?n.type:e[i+1]))return r.copy(r.content.append(X.from(z8(n,e,i+1))))}}function Y8(e,t){if(t==0)return e;let n=e.content.replaceChild(e.childCount-1,Y8(e.lastChild,t-1)),r=e.contentMatchAt(e.childCount).fillBefore(X.empty,!0);return e.copy(n.append(r))}function IC(e,t,n,r,i,o){let a=t<0?e.firstChild:e.lastChild,s=a.content;return e.childCount>1&&(o=0),i<r-1&&(s=IC(s,t,n,r,i+1,o)),i>=n&&(s=t<0?a.contentMatchAt(0).fillBefore(s,o<=i).append(s):s.append(a.contentMatchAt(a.childCount).fillBefore(X.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,a.copy(s))}function $k(e,t,n){return t<e.openStart&&(e=new ae(IC(e.content,-1,t,e.openStart,0,e.openEnd),t,e.openEnd)),n<e.openEnd&&(e=new ae(IC(e.content,1,n,e.openEnd,0,0),e.openStart,n)),e}const G8={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]};let Rk=null;function J8(){return Rk||(Rk=document.implementation.createHTMLDocument("title"))}function hFe(e){let t=/^(\s*<meta [^>]*>)*/.exec(e);t&&(e=e.slice(t[0].length));let n=J8().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(e),i;if((i=r&&G8[r[1].toLowerCase()])&&(e=i.map(o=>"<"+o+">").join("")+e+i.map(o=>"</"+o+">").reverse().join("")),n.innerHTML=e,i)for(let o=0;o<i.length;o++)n=n.querySelector(i[o])||n;return n}function mFe(e){let t=e.querySelectorAll(Hs?"span:not([class]):not([style])":"span.Apple-converted-space");for(let n=0;n<t.length;n++){let r=t[n];r.childNodes.length==1&&r.textContent==" "&&r.parentNode&&r.parentNode.replaceChild(e.ownerDocument.createTextNode(" "),r)}}function gFe(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 s=r.length-2;s>=0;s-=2){let u=n.nodes[r[s]];if(!u||u.hasRequiredAttrs())break;i=X.from(u.create(r[s+1],i)),o++,a++}return new ae(i,o,a)}const to={},Mr={};function ts(e,t){e.input.lastSelectionOrigin=t,e.input.lastSelectionTime=Date.now()}Mr.keydown=(e,t)=>{let n=t;if(e.input.shiftKey=n.keyCode==16||n.shiftKey,!X8(e,n)&&(e.input.lastKeyCode=n.keyCode,e.input.lastKeyCodeTime=Date.now(),!($h&&Hs&&n.keyCode==13)))if(n.keyCode!=229&&e.domObserver.forceFlush(),JR&&n.keyCode==13&&!n.ctrlKey&&!n.altKey&&!n.metaKey){let r=Date.now();e.input.lastIOSEnter=r,e.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{e.input.lastIOSEnter==r&&(e.someProp("handleKeyDown",i=>i(e,B8(13,"Enter"))),e.input.lastIOSEnter=0)},200)}else e.someProp("handleKeyDown",r=>r(e,n))||dFe(e,n)?n.preventDefault():ts(e,"key")};Mr.keyup=(e,t)=>{t.keyCode==16&&(e.input.shiftKey=!1)};Mr.keypress=(e,t)=>{let n=t;if(X8(e,n)||!n.charCode||n.ctrlKey&&!n.altKey||Xr&&n.metaKey)return;if(e.someProp("handleKeyPress",i=>i(e,n))){n.preventDefault();return}let r=e.state.selection;if(!(r instanceof Be)||!r.$from.sameParent(r.$to)){let i=String.fromCharCode(n.charCode);!/[\r\n]/.test(i)&&!e.someProp("handleTextInput",o=>o(e,r.$from.pos,r.$to.pos,i))&&e.dispatch(e.state.tr.insertText(i).scrollIntoView()),n.preventDefault()}};function G0(e){return{left:e.clientX,top:e.clientY}}function vFe(e,t){let n=t.x-e.clientX,r=t.y-e.clientY;return n*n+r*r<100}function eO(e,t,n,r,i){if(r==-1)return!1;let o=e.state.doc.resolve(r);for(let a=o.depth+1;a>0;a--)if(e.someProp(t,s=>a>o.depth?s(e,n,o.nodeAfter,o.before(a),i,!0):s(e,n,o.node(a),o.before(a),i,!1)))return!0;return!1}function ml(e,t,n){if(e.focused||e.focus(),e.state.selection.eq(t))return;let r=e.state.tr.setSelection(t);n=="pointer"&&r.setMeta("pointer",!0),e.dispatch(r)}function yFe(e,t){if(t==-1)return!1;let n=e.state.doc.resolve(t),r=n.nodeAfter;return r&&r.isAtom&&ve.isSelectable(r)?(ml(e,new ve(n),"pointer"),!0):!1}function bFe(e,t){if(t==-1)return!1;let n=e.state.selection,r,i;n instanceof ve&&(r=n.node);let o=e.state.doc.resolve(t);for(let a=o.depth+1;a>0;a--){let s=a>o.depth?o.nodeAfter:o.node(a);if(ve.isSelectable(s)){r&&n.$from.depth>0&&a>=n.$from.depth&&o.before(n.$from.depth+1)==n.$from.pos?i=o.before(n.$from.depth):i=o.before(a);break}}return i!=null?(ml(e,ve.create(e.state.doc,i),"pointer"),!0):!1}function CFe(e,t,n,r,i){return eO(e,"handleClickOn",t,n,r)||e.someProp("handleClick",o=>o(e,t,r))||(i?bFe(e,n):yFe(e,n))}function SFe(e,t,n,r){return eO(e,"handleDoubleClickOn",t,n,r)||e.someProp("handleDoubleClick",i=>i(e,t,r))}function _Fe(e,t,n,r){return eO(e,"handleTripleClickOn",t,n,r)||e.someProp("handleTripleClick",i=>i(e,t,r))||IFe(e,n,r)}function IFe(e,t,n){if(n.button!=0)return!1;let r=e.state.doc;if(t==-1)return r.inlineContent?(ml(e,Be.create(r,0,r.content.size),"pointer"),!0):!1;let i=r.resolve(t);for(let o=i.depth+1;o>0;o--){let a=o>i.depth?i.nodeAfter:i.node(o),s=i.before(o);if(a.inlineContent)ml(e,Be.create(r,s+1,s+1+a.content.size),"pointer");else if(ve.isSelectable(a))ml(e,ve.create(r,s),"pointer");else continue;return!0}}function tO(e){return Jm(e)}const Z8=Xr?"metaKey":"ctrlKey";to.mousedown=(e,t)=>{let n=t;e.input.shiftKey=n.shiftKey;let r=tO(e),i=Date.now(),o="singleClick";i-e.input.lastClick.time<500&&vFe(n,e.input.lastClick)&&!n[Z8]&&(e.input.lastClick.type=="singleClick"?o="doubleClick":e.input.lastClick.type=="doubleClick"&&(o="tripleClick")),e.input.lastClick={time:i,x:n.clientX,y:n.clientY,type:o};let a=e.posAtCoords(G0(n));a&&(o=="singleClick"?(e.input.mouseDown&&e.input.mouseDown.done(),e.input.mouseDown=new TFe(e,a,n,!!r)):(o=="doubleClick"?SFe:_Fe)(e,a.pos,a.inside,n)?n.preventDefault():ts(e,"pointer"))};class TFe{constructor(t,n,r,i){this.view=t,this.pos=n,this.event=r,this.flushed=i,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=t.state.doc,this.selectNode=!!r[Z8],this.allowDefault=r.shiftKey;let o,a;if(n.inside>-1)o=t.state.doc.nodeAt(n.inside),a=n.inside;else{let l=t.state.doc.resolve(n.pos);o=l.parent,a=l.depth?l.before():0}const s=i?null:r.target,u=s?t.docView.nearestDesc(s,!0):null;this.target=u&&u.dom.nodeType==1?u.dom:null;let{selection:c}=t.state;(r.button==0&&o.type.spec.draggable&&o.type.spec.selectable!==!1||c instanceof ve&&c.from<=a&&c.to>a)&&(this.mightDrag={node:o,pos:a,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&Y0&&!this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),t.root.addEventListener("mouseup",this.up=this.up.bind(this)),t.root.addEventListener("mousemove",this.move=this.move.bind(this)),ts(t,"pointer")}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>XR(this.view)),this.view.input.mouseDown=null}up(t){if(this.done(),!this.view.dom.contains(t.target))return;let n=this.pos;this.view.state.doc!=this.startDoc&&(n=this.view.posAtCoords(G0(t))),this.updateAllowDefault(t),this.allowDefault||!n?ts(this.view,"pointer"):CFe(this.view,n.pos,n.inside,t,this.selectNode)?t.preventDefault():t.button==0&&(this.flushed||Kc&&this.mightDrag&&!this.mightDrag.node.isAtom||Hs&&!this.view.state.selection.visible&&Math.min(Math.abs(n.pos-this.view.state.selection.from),Math.abs(n.pos-this.view.state.selection.to))<=2)?(ml(this.view,ze.near(this.view.state.doc.resolve(n.pos)),"pointer"),t.preventDefault()):ts(this.view,"pointer")}move(t){this.updateAllowDefault(t),ts(this.view,"pointer"),t.buttons==0&&this.done()}updateAllowDefault(t){!this.allowDefault&&(Math.abs(this.event.x-t.clientX)>4||Math.abs(this.event.y-t.clientY)>4)&&(this.allowDefault=!0)}}to.touchstart=e=>{e.input.lastTouch=Date.now(),tO(e),ts(e,"pointer")};to.touchmove=e=>{e.input.lastTouch=Date.now(),ts(e,"pointer")};to.contextmenu=e=>tO(e);function X8(e,t){return e.composing?!0:Kc&&Math.abs(t.timeStamp-e.input.compositionEndedAt)<500?(e.input.compositionEndedAt=-2e8,!0):!1}const xFe=$h?5e3:-1;Mr.compositionstart=Mr.compositionupdate=e=>{if(!e.composing){e.domObserver.flush();let{state:t}=e,n=t.selection.$to;if(t.selection instanceof Be&&(t.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(r=>r.type.spec.inclusive===!1)))e.markCursor=e.state.storedMarks||n.marks(),Jm(e,!0),e.markCursor=null;else if(Jm(e,!t.selection.empty),Y0&&t.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let r=e.domSelectionRange();for(let i=r.focusNode,o=r.focusOffset;i&&i.nodeType==1&&o!=0;){let a=o<0?i.lastChild:i.childNodes[o-1];if(!a)break;if(a.nodeType==3){let s=e.domSelection();s&&s.collapse(a,a.nodeValue.length);break}else i=a,o=-1}}e.input.composing=!0}eV(e,xFe)};Mr.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.compositionNode=null,e.input.compositionPendingChanges&&Promise.resolve().then(()=>e.domObserver.flush()),e.input.compositionID++,eV(e,20))};function eV(e,t){clearTimeout(e.input.composingTimeout),t>-1&&(e.input.composingTimeout=setTimeout(()=>Jm(e),t))}function wFe(e){for(e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=EFe());e.input.compositionNodes.length>0;)e.input.compositionNodes.pop().markParentsDirty()}function EFe(){let e=document.createEvent("Event");return e.initEvent("event",!0,!0),e.timeStamp}function Jm(e,t=!1){if(!($h&&e.domObserver.flushingSoon>=0)){if(e.domObserver.forceFlush(),wFe(e),t||e.docView&&e.docView.dirty){let n=tFe(e);return n&&!n.eq(e.state.selection)?e.dispatch(e.state.tr.setSelection(n)):(e.markCursor||t)&&!e.state.selection.empty?e.dispatch(e.state.tr.deleteSelection()):e.updateState(e.state),!0}return!1}}function $Fe(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)}const yp=Eh&&W8<15||JR&&eFe<604;to.copy=Mr.cut=(e,t)=>{let n=t,r=e.state.selection,i=n.type=="cut";if(r.empty)return;let o=yp?null:n.clipboardData,a=r.content(),{dom:s,text:u}=V8(e,a);o?(n.preventDefault(),o.clearData(),o.setData("text/html",s.innerHTML),o.setData("text/plain",u)):$Fe(e,s),i&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function RFe(e){return e.openStart==0&&e.openEnd==0&&e.content.childCount==1?e.content.firstChild:null}function OFe(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&&e.input.lastKeyCode!=45;setTimeout(()=>{e.focus(),r.parentNode&&r.parentNode.removeChild(r),n?TC(e,r.value,null,i,t):TC(e,r.textContent,r.innerHTML,i,t)},50)}function TC(e,t,n,r,i){let o=Q8(e,t,n,r,e.state.selection.$from);if(e.someProp("handlePaste",u=>u(e,i,o||ae.empty)))return!0;if(!o)return!1;let a=RFe(o),s=a?e.state.tr.replaceSelectionWith(a,r):e.state.tr.replaceSelection(o);return e.dispatch(s.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function tV(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," "):""}Mr.paste=(e,t)=>{let n=t;if(e.composing&&!$h)return;let r=yp?null:n.clipboardData,i=e.input.shiftKey&&e.input.lastKeyCode!=45;r&&TC(e,tV(r),r.getData("text/html"),i,n)?n.preventDefault():OFe(e,n)};class FFe{constructor(t,n,r){this.slice=t,this.move=n,this.node=r}}const nV=Xr?"altKey":"ctrlKey";to.dragstart=(e,t)=>{let n=t,r=e.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let i=e.state.selection,o=i.empty?null:e.posAtCoords(G0(n)),a;if(!(o&&o.pos>=i.from&&o.pos<=(i instanceof ve?i.to-1:i.to))){if(r&&r.mightDrag)a=ve.create(e.state.doc,r.mightDrag.pos);else if(n.target&&n.target.nodeType==1){let d=e.docView.nearestDesc(n.target,!0);d&&d.node.type.spec.draggable&&d!=e.docView&&(a=ve.create(e.state.doc,d.posBefore))}}let s=(a||e.state.selection).content(),{dom:u,text:c,slice:l}=V8(e,s);(!n.dataTransfer.files.length||!Hs||D8>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(yp?"Text":"text/html",u.innerHTML),n.dataTransfer.effectAllowed="copyMove",yp||n.dataTransfer.setData("text/plain",c),e.dragging=new FFe(l,!n[nV],a)};to.dragend=e=>{let t=e.dragging;window.setTimeout(()=>{e.dragging==t&&(e.dragging=null)},50)};Mr.dragover=Mr.dragenter=(e,t)=>t.preventDefault();Mr.drop=(e,t)=>{let n=t,r=e.dragging;if(e.dragging=null,!n.dataTransfer)return;let i=e.posAtCoords(G0(n));if(!i)return;let o=e.state.doc.resolve(i.pos),a=r&&r.slice;a?e.someProp("transformPasted",m=>{a=m(a,e)}):a=Q8(e,tV(n.dataTransfer),yp?null:n.dataTransfer.getData("text/html"),!1,o);let s=!!(r&&!n[nV]);if(e.someProp("handleDrop",m=>m(e,n,a||ae.empty,s))){n.preventDefault();return}if(!a)return;n.preventDefault();let u=a?qOe(e.state.doc,o.pos,a):o.pos;u==null&&(u=o.pos);let c=e.state.tr;if(s){let{node:m}=r;m?m.replace(c):c.deleteSelection()}let l=c.mapping.map(u),d=a.openStart==0&&a.openEnd==0&&a.content.childCount==1,p=c.doc;if(d?c.replaceRangeWith(l,l,a.content.firstChild):c.replaceRange(l,l,a),c.doc.eq(p))return;let A=c.doc.resolve(l);if(d&&ve.isSelectable(a.content.firstChild)&&A.nodeAfter&&A.nodeAfter.sameMarkup(a.content.firstChild))c.setSelection(new ve(A));else{let m=c.mapping.map(u);c.mapping.maps[c.mapping.maps.length-1].forEach((v,_,C,I)=>m=I),c.setSelection(N8(e,A,c.doc.resolve(m)))}e.focus(),e.dispatch(c.setMeta("uiEvent","drop"))};to.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())&&XR(e)},20))};to.blur=(e,t)=>{let n=t;e.focused&&(e.domObserver.stop(),e.dom.classList.remove("ProseMirror-focused"),e.domObserver.start(),n.relatedTarget&&e.dom.contains(n.relatedTarget)&&e.domObserver.currentSelection.clear(),e.focused=!1)};to.beforeinput=(e,t)=>{if(Hs&&$h&&t.inputType=="deleteContentBackward"){e.domObserver.flushSoon();let{domChangeCount:r}=e.input;setTimeout(()=>{if(e.input.domChangeCount!=r||(e.dom.blur(),e.focus(),e.someProp("handleKeyDown",o=>o(e,B8(8,"Backspace")))))return;let{$cursor:i}=e.state.selection;i&&i.pos>0&&e.dispatch(e.state.tr.delete(i.pos-1,i.pos).scrollIntoView())},50)}};for(let e in Mr)to[e]=Mr[e];function bp(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 Zm{constructor(t,n){this.toDOM=t,this.spec=n||mu,this.side=this.spec.side||0}map(t,n,r,i){let{pos:o,deleted:a}=t.mapResult(n.from+i,this.side<0?-1:1);return a?null:new wi(o-r,o-r,this)}valid(){return!0}eq(t){return this==t||t instanceof Zm&&(this.spec.key&&this.spec.key==t.spec.key||this.toDOM==t.toDOM&&bp(this.spec,t.spec))}destroy(t){this.spec.destroy&&this.spec.destroy(t)}}class is{constructor(t,n){this.attrs=t,this.spec=n||mu}map(t,n,r,i){let o=t.map(n.from+i,this.spec.inclusiveStart?-1:1)-r,a=t.map(n.to+i,this.spec.inclusiveEnd?1:-1)-r;return o>=a?null:new wi(o,a,this)}valid(t,n){return n.from<n.to}eq(t){return this==t||t instanceof is&&bp(this.attrs,t.attrs)&&bp(this.spec,t.spec)}static is(t){return t.type instanceof is}destroy(){}}let kFe=class rV{constructor(t,n){this.attrs=t,this.spec=n||mu}map(t,n,r,i){let o=t.mapResult(n.from+i,1);if(o.deleted)return null;let a=t.mapResult(n.to+i,-1);return a.deleted||a.pos<=o.pos?null:new wi(o.pos-r,a.pos-r,this)}valid(t,n){let{index:r,offset:i}=t.content.findIndex(n.from),o;return i==n.from&&!(o=t.child(r)).isText&&i+o.nodeSize==n.to}eq(t){return this==t||t instanceof rV&&bp(this.attrs,t.attrs)&&bp(this.spec,t.spec)}destroy(){}};class wi{constructor(t,n,r){this.from=t,this.to=n,this.type=r}copy(t,n){return new wi(t,n,this.type)}eq(t,n=0){return this.type.eq(t.type)&&this.from+n==t.from&&this.to+n==t.to}map(t,n,r){return this.type.map(t,this,n,r)}static widget(t,n,r){return new wi(t,t,new Zm(n,r))}static inline(t,n,r,i){return new wi(t,n,new is(r,i))}static node(t,n,r,i){return new wi(t,n,new kFe(r,i))}get spec(){return this.type.spec}get inline(){return this.type instanceof is}get widget(){return this.type instanceof Zm}}const ul=[],mu={};class Ht{constructor(t,n){this.local=t.length?t:ul,this.children=n.length?n:ul}static create(t,n){return n.length?Xm(n,t,0,mu):qn}find(t,n,r){let i=[];return this.findInner(t??0,n??1e9,i,0,r),i}findInner(t,n,r,i,o){for(let a=0;a<this.local.length;a++){let s=this.local[a];s.from<=n&&s.to>=t&&(!o||o(s.spec))&&r.push(s.copy(s.from+i,s.to+i))}for(let a=0;a<this.children.length;a+=3)if(this.children[a]<n&&this.children[a+1]>t){let s=this.children[a]+1;this.children[a+2].findInner(t-s,n-s,r,i+s,o)}}map(t,n,r){return this==qn||t.maps.length==0?this:this.mapInner(t,n,0,0,r||mu)}mapInner(t,n,r,i,o){let a;for(let s=0;s<this.local.length;s++){let u=this.local[s].map(t,r,i);u&&u.type.valid(n,u)?(a||(a=[])).push(u):o.onRemove&&o.onRemove(this.local[s].spec)}return this.children.length?MFe(this.children,a||[],t,n,r,i,o):a?new Ht(a.sort(gu),ul):qn}add(t,n){return n.length?this==qn?Ht.create(t,n):this.addInner(t,n,0):this}addInner(t,n,r){let i,o=0;t.forEach((s,u)=>{let c=u+r,l;if(l=oV(n,s,c)){for(i||(i=this.children.slice());o<i.length&&i[o]<u;)o+=3;i[o]==u?i[o+2]=i[o+2].addInner(s,l,c+1):i.splice(o,0,u,u+s.nodeSize,Xm(l,s,c+1,mu)),o+=3}});let a=iV(o?aV(n):n,-r);for(let s=0;s<a.length;s++)a[s].type.valid(t,a[s])||a.splice(s--,1);return new Ht(a.length?this.local.concat(a).sort(gu):this.local,i||this.children)}remove(t){return t.length==0||this==qn?this:this.removeInner(t,0)}removeInner(t,n){let r=this.children,i=this.local;for(let o=0;o<r.length;o+=3){let a,s=r[o]+n,u=r[o+1]+n;for(let l=0,d;l<t.length;l++)(d=t[l])&&d.from>s&&d.to<u&&(t[l]=null,(a||(a=[])).push(d));if(!a)continue;r==this.children&&(r=this.children.slice());let c=r[o+2].removeInner(a,s+1);c!=qn?r[o+2]=c:(r.splice(o,3),o-=3)}if(i.length){for(let o=0,a;o<t.length;o++)if(a=t[o])for(let s=0;s<i.length;s++)i[s].eq(a,n)&&(i==this.local&&(i=this.local.slice()),i.splice(s--,1))}return r==this.children&&i==this.local?this:i.length||r.length?new Ht(i,r):qn}forChild(t,n){if(this==qn)return this;if(n.isLeaf)return Ht.empty;let r,i;for(let s=0;s<this.children.length;s+=3)if(this.children[s]>=t){this.children[s]==t&&(r=this.children[s+2]);break}let o=t+1,a=o+n.content.size;for(let s=0;s<this.local.length;s++){let u=this.local[s];if(u.from<a&&u.to>o&&u.type instanceof is){let c=Math.max(o,u.from)-o,l=Math.min(a,u.to)-o;c<l&&(i||(i=[])).push(u.copy(c,l))}}if(i){let s=new Ht(i.sort(gu),ul);return r?new iu([s,r]):s}return r||qn}eq(t){if(this==t)return!0;if(!(t instanceof Ht)||this.local.length!=t.local.length||this.children.length!=t.children.length)return!1;for(let n=0;n<this.local.length;n++)if(!this.local[n].eq(t.local[n]))return!1;for(let n=0;n<this.children.length;n+=3)if(this.children[n]!=t.children[n]||this.children[n+1]!=t.children[n+1]||!this.children[n+2].eq(t.children[n+2]))return!1;return!0}locals(t){return nO(this.localsInner(t))}localsInner(t){if(this==qn)return ul;if(t.inlineContent||!this.local.some(is.is))return this.local;let n=[];for(let r=0;r<this.local.length;r++)this.local[r].type instanceof is||n.push(this.local[r]);return n}forEachSet(t){t(this)}}Ht.empty=new Ht([],[]);Ht.removeOverlap=nO;const qn=Ht.empty;class iu{constructor(t){this.members=t}map(t,n){const r=this.members.map(i=>i.map(t,n,mu));return iu.from(r)}forChild(t,n){if(n.isLeaf)return Ht.empty;let r=[];for(let i=0;i<this.members.length;i++){let o=this.members[i].forChild(t,n);o!=qn&&(o instanceof iu?r=r.concat(o.members):r.push(o))}return iu.from(r)}eq(t){if(!(t instanceof iu)||t.members.length!=this.members.length)return!1;for(let n=0;n<this.members.length;n++)if(!this.members[n].eq(t.members[n]))return!1;return!0}locals(t){let n,r=!0;for(let i=0;i<this.members.length;i++){let o=this.members[i].localsInner(t);if(o.length)if(!n)n=o;else{r&&(n=n.slice(),r=!1);for(let a=0;a<o.length;a++)n.push(o[a])}}return n?nO(r?n:n.sort(gu)):ul}static from(t){switch(t.length){case 0:return qn;case 1:return t[0];default:return new iu(t.every(n=>n instanceof Ht)?t:t.reduce((n,r)=>n.concat(r instanceof Ht?r:r.members),[]))}}forEachSet(t){for(let n=0;n<this.members.length;n++)this.members[n].forEachSet(t)}}function MFe(e,t,n,r,i,o,a){let s=e.slice();for(let c=0,l=o;c<n.maps.length;c++){let d=0;n.maps[c].forEach((p,A,m,v)=>{let _=v-m-(A-p);for(let C=0;C<s.length;C+=3){let I=s[C+1];if(I<0||p>I+l-d)continue;let x=s[C]+l-d;A>=x?s[C+1]=p<=x?-2:-1:p>=l&&_&&(s[C]+=_,s[C+1]+=_)}d+=_}),l=n.maps[c].map(l,-1)}let u=!1;for(let c=0;c<s.length;c+=3)if(s[c+1]<0){if(s[c+1]==-2){u=!0,s[c+1]=-1;continue}let l=n.map(e[c]+o),d=l-i;if(d<0||d>=r.content.size){u=!0;continue}let p=n.map(e[c+1]+o,-1),A=p-i,{index:m,offset:v}=r.content.findIndex(d),_=r.maybeChild(m);if(_&&v==d&&v+_.nodeSize==A){let C=s[c+2].mapInner(n,_,l+1,e[c]+o+1,a);C!=qn?(s[c]=d,s[c+1]=A,s[c+2]=C):(s[c+1]=-2,u=!0)}else u=!0}if(u){let c=LFe(s,e,t,n,i,o,a),l=Xm(c,r,0,a);t=l.local;for(let d=0;d<s.length;d+=3)s[d+1]<0&&(s.splice(d,3),d-=3);for(let d=0,p=0;d<l.children.length;d+=3){let A=l.children[d];for(;p<s.length&&s[p]<A;)p+=3;s.splice(p,0,l.children[d],l.children[d+1],l.children[d+2])}}return new Ht(t.sort(gu),s)}function iV(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 wi(i.from+t,i.to+t,i.type))}return n}function LFe(e,t,n,r,i,o,a){function s(u,c){for(let l=0;l<u.local.length;l++){let d=u.local[l].map(r,i,c);d?n.push(d):a.onRemove&&a.onRemove(u.local[l].spec)}for(let l=0;l<u.children.length;l+=3)s(u.children[l+2],u.children[l]+c+1)}for(let u=0;u<e.length;u+=3)e[u+1]==-1&&s(e[u+2],t[u]+o+1);return n}function oV(e,t,n){if(t.isLeaf)return null;let r=n+t.nodeSize,i=null;for(let o=0,a;o<e.length;o++)(a=e[o])&&a.from>n&&a.to<r&&((i||(i=[])).push(a),e[o]=null);return i}function aV(e){let t=[];for(let n=0;n<e.length;n++)e[n]!=null&&t.push(e[n]);return t}function Xm(e,t,n,r){let i=[],o=!1;t.forEach((s,u)=>{let c=oV(e,s,u+n);if(c){o=!0;let l=Xm(c,s,n+u+1,r);l!=qn&&i.push(u,u+s.nodeSize,l)}});let a=iV(o?aV(e):e,-n).sort(gu);for(let s=0;s<a.length;s++)a[s].type.valid(t,a[s])||(r.onRemove&&r.onRemove(a[s].spec),a.splice(s--,1));return a.length||i.length?new Ht(a,i):qn}function gu(e,t){return e.from-t.from||e.to-t.to}function nO(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),Ok(t,i+1,o.copy(r.to,o.to)));continue}else{o.from<r.to&&(t==e&&(t=e.slice()),t[n]=r.copy(r.from,o.from),Ok(t,i,r.copy(o.from,r.to)));break}}}return t}function Ok(e,t,n){for(;t<e.length&&gu(n,e[t])>0;)t++;e.splice(t,0,n)}var As={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:"'"},eg={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},jFe=typeof navigator<"u"&&/Mac/.test(navigator.platform),UFe=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var mn=0;mn<10;mn++)As[48+mn]=As[96+mn]=String(mn);for(var mn=1;mn<=24;mn++)As[mn+111]="F"+mn;for(var mn=65;mn<=90;mn++)As[mn]=String.fromCharCode(mn+32),eg[mn]=String.fromCharCode(mn);for(var s1 in As)eg.hasOwnProperty(s1)||(eg[s1]=As[s1]);function BFe(e){var t=jFe&&e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey||UFe&&e.shiftKey&&e.key&&e.key.length==1||e.key=="Unidentified",n=!t&&e.key||(e.shiftKey?eg:As)[e.keyCode]||e.key||"Unidentified";return n=="Esc"&&(n="Escape"),n=="Del"&&(n="Delete"),n=="Left"&&(n="ArrowLeft"),n=="Up"&&(n="ArrowUp"),n=="Right"&&(n="ArrowRight"),n=="Down"&&(n="ArrowDown"),n}const PFe=typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!1;function WFe(e){let t=e.split(/-(?!$)/),n=t[t.length-1];n=="Space"&&(n=" ");let r,i,o,a;for(let s=0;s<t.length-1;s++){let u=t[s];if(/^(cmd|meta|m)$/i.test(u))a=!0;else if(/^a(lt)?$/i.test(u))r=!0;else if(/^(c|ctrl|control)$/i.test(u))i=!0;else if(/^s(hift)?$/i.test(u))o=!0;else if(/^mod$/i.test(u))PFe?a=!0:i=!0;else throw new Error("Unrecognized modifier name: "+u)}return r&&(n="Alt-"+n),i&&(n="Ctrl-"+n),a&&(n="Meta-"+n),o&&(n="Shift-"+n),n}function DFe(e){let t=Object.create(null);for(let n in e)t[WFe(n)]=e[n];return t}function u1(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}function KFe(e){return new zr({props:{handleKeyDown:NFe(e)}})}function NFe(e){let t=DFe(e);return function(n,r){let i=BFe(r),o,a=t[u1(i,r)];if(a&&a(n.state,n.dispatch,n))return!0;if(i.length==1&&i!=" "){if(r.shiftKey){let s=t[u1(i,r,!1)];if(s&&s(n.state,n.dispatch,n))return!0}if((r.shiftKey||r.altKey||r.metaKey||i.charCodeAt(0)>127)&&(o=As[r.keyCode])&&o!=i){let s=t[u1(o,r)];if(s&&s(n.state,n.dispatch,n))return!0}}return!1}}const sV=65535,uV=Math.pow(2,16);function qFe(e,t){return e+t*uV}function Fk(e){return e&sV}function VFe(e){return(e-(e&sV))/uV}const cV=1,lV=2,um=4,fV=8;class kk{constructor(t,n,r){this.pos=t,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&fV)>0}get deletedBefore(){return(this.delInfo&(cV|um))>0}get deletedAfter(){return(this.delInfo&(lV|um))>0}get deletedAcross(){return(this.delInfo&um)>0}}class $r{constructor(t,n=!1){if(this.ranges=t,this.inverted=n,!t.length&&$r.empty)return $r.empty}recover(t){let n=0,r=Fk(t);if(!this.inverted)for(let i=0;i<r;i++)n+=this.ranges[i*3+2]-this.ranges[i*3+1];return this.ranges[r*3]+n+VFe(t)}mapResult(t,n=1){return this._map(t,n,!1)}map(t,n=1){return this._map(t,n,!0)}_map(t,n,r){let i=0,o=this.inverted?2:1,a=this.inverted?1:2;for(let s=0;s<this.ranges.length;s+=3){let u=this.ranges[s]-(this.inverted?i:0);if(u>t)break;let c=this.ranges[s+o],l=this.ranges[s+a],d=u+c;if(t<=d){let p=c?t==u?-1:t==d?1:n:n,A=u+i+(p<0?0:l);if(r)return A;let m=t==(n<0?u:d)?null:qFe(s/3,t-u),v=t==u?lV:t==d?cV:um;return(n<0?t!=u:t!=d)&&(v|=fV),new kk(A,v,m)}i+=l-c}return r?t+i:new kk(t+i,0,null)}touches(t,n){let r=0,i=Fk(n),o=this.inverted?2:1,a=this.inverted?1:2;for(let s=0;s<this.ranges.length;s+=3){let u=this.ranges[s]-(this.inverted?r:0);if(u>t)break;let c=this.ranges[s+o],l=u+c;if(t<=l&&s==i*3)return!0;r+=this.ranges[s+a]-c}return!1}forEach(t){let n=this.inverted?2:1,r=this.inverted?1:2;for(let i=0,o=0;i<this.ranges.length;i+=3){let a=this.ranges[i],s=a-(this.inverted?o:0),u=a+(this.inverted?0:o),c=this.ranges[i+n],l=this.ranges[i+r];t(s,s+c,u,u+l),o+=l-c}}invert(){return new $r(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(t){return t==0?$r.empty:new $r(t<0?[0,-t,0]:[0,0,t])}}$r.empty=new $r([]);const c1=Object.create(null);class Wn{getMap(){return $r.empty}merge(t){return null}static fromJSON(t,n){if(!n||!n.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=c1[n.stepType];if(!r)throw new RangeError(`No step type ${n.stepType} defined`);return r.fromJSON(t,n)}static jsonID(t,n){if(t in c1)throw new RangeError("Duplicate use of step JSON ID "+t);return c1[t]=n,n.prototype.jsonID=t,n}}class Nt{constructor(t,n){this.doc=t,this.failed=n}static ok(t){return new Nt(t,null)}static fail(t){return new Nt(null,t)}static fromReplace(t,n,r,i){try{return Nt.ok(t.replace(n,r,i))}catch(o){if(o instanceof mp)return Nt.fail(o.message);throw o}}}function rO(e,t,n){let r=[];for(let i=0;i<e.childCount;i++){let o=e.child(i);o.content.size&&(o=o.copy(rO(o.content,t,o))),o.isInline&&(o=t(o,n,i)),r.push(o)}return X.fromArray(r)}class su extends Wn{constructor(t,n,r){super(),this.from=t,this.to=n,this.mark=r}apply(t){let n=t.slice(this.from,this.to),r=t.resolve(this.from),i=r.node(r.sharedDepth(this.to)),o=new ae(rO(n.content,(a,s)=>!a.isAtom||!s.type.allowsMarkType(this.mark.type)?a:a.mark(this.mark.addToSet(a.marks)),i),n.openStart,n.openEnd);return Nt.fromReplace(t,this.from,this.to,o)}invert(){return new uu(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 su(n.pos,r.pos,this.mark)}merge(t){return t instanceof su&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new su(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new su(n.from,n.to,t.markFromJSON(n.mark))}}Wn.jsonID("addMark",su);class uu extends Wn{constructor(t,n,r){super(),this.from=t,this.to=n,this.mark=r}apply(t){let n=t.slice(this.from,this.to),r=new ae(rO(n.content,i=>i.mark(this.mark.removeFromSet(i.marks)),t),n.openStart,n.openEnd);return Nt.fromReplace(t,this.from,this.to,r)}invert(){return new su(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 uu(n.pos,r.pos,this.mark)}merge(t){return t instanceof uu&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new uu(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new uu(n.from,n.to,t.markFromJSON(n.mark))}}Wn.jsonID("removeMark",uu);class cu extends Wn{constructor(t,n){super(),this.pos=t,this.mark=n}apply(t){let n=t.nodeAt(this.pos);if(!n)return Nt.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return Nt.fromReplace(t,this.pos,this.pos+1,new ae(X.from(r),0,n.isLeaf?0:1))}invert(t){let n=t.nodeAt(this.pos);if(n){let r=this.mark.addToSet(n.marks);if(r.length==n.marks.length){for(let i=0;i<n.marks.length;i++)if(!n.marks[i].isInSet(r))return new cu(this.pos,n.marks[i]);return new cu(this.pos,this.mark)}}return new Cp(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new cu(n.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new cu(n.pos,t.markFromJSON(n.mark))}}Wn.jsonID("addNodeMark",cu);class Cp extends Wn{constructor(t,n){super(),this.pos=t,this.mark=n}apply(t){let n=t.nodeAt(this.pos);if(!n)return Nt.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.removeFromSet(n.marks));return Nt.fromReplace(t,this.pos,this.pos+1,new ae(X.from(r),0,n.isLeaf?0:1))}invert(t){let n=t.nodeAt(this.pos);return!n||!this.mark.isInSet(n.marks)?this:new cu(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new Cp(n.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new Cp(n.pos,t.markFromJSON(n.mark))}}Wn.jsonID("removeNodeMark",Cp);class zo extends Wn{constructor(t,n,r,i=!1){super(),this.from=t,this.to=n,this.slice=r,this.structure=i}apply(t){return this.structure&&xC(t,this.from,this.to)?Nt.fail("Structure replace would overwrite content"):Nt.fromReplace(t,this.from,this.to,this.slice)}getMap(){return new $r([this.from,this.to-this.from,this.slice.size])}invert(t){return new zo(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 zo(n.pos,Math.max(n.pos,r.pos),this.slice)}merge(t){if(!(t instanceof zo)||t.structure||this.structure)return null;if(this.from+this.slice.size==t.from&&!this.slice.openEnd&&!t.slice.openStart){let n=this.slice.size+t.slice.size==0?ae.empty:new ae(this.slice.content.append(t.slice.content),this.slice.openStart,t.slice.openEnd);return new zo(this.from,this.to+(t.to-t.from),n,this.structure)}else if(t.to==this.from&&!this.slice.openStart&&!t.slice.openEnd){let n=this.slice.size+t.slice.size==0?ae.empty:new ae(t.slice.content.append(this.slice.content),t.slice.openStart,this.slice.openEnd);return new zo(t.from,this.to,n,this.structure)}else return null}toJSON(){let t={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new zo(n.from,n.to,ae.fromJSON(t,n.slice),!!n.structure)}}Wn.jsonID("replace",zo);class gl extends Wn{constructor(t,n,r,i,o,a,s=!1){super(),this.from=t,this.to=n,this.gapFrom=r,this.gapTo=i,this.slice=o,this.insert=a,this.structure=s}apply(t){if(this.structure&&(xC(t,this.from,this.gapFrom)||xC(t,this.gapTo,this.to)))return Nt.fail("Structure gap-replace would overwrite content");let n=t.slice(this.gapFrom,this.gapTo);if(n.openStart||n.openEnd)return Nt.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,n.content);return r?Nt.fromReplace(t,this.from,this.to,r):Nt.fail("Content does not fit in gap")}getMap(){return new $r([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 gl(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,t.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1),i=this.from==this.gapFrom?n.pos:t.map(this.gapFrom,-1),o=this.to==this.gapTo?r.pos:t.map(this.gapTo,1);return n.deletedAcross&&r.deletedAcross||i<n.pos||o>r.pos?null:new gl(n.pos,r.pos,i,o,this.slice,this.insert,this.structure)}toJSON(){let t={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number"||typeof n.gapFrom!="number"||typeof n.gapTo!="number"||typeof n.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new gl(n.from,n.to,n.gapFrom,n.gapTo,ae.fromJSON(t,n.slice),n.insert,!!n.structure)}}Wn.jsonID("replaceAround",gl);function xC(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 a=r.node(o).maybeChild(r.indexAfter(o));for(;i>0;){if(!a||a.isLeaf)return!0;a=a.firstChild,i--}}return!1}function QFe(e,t,n){return(t==0||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function zFe(e){let n=e.parent.content.cutByIndex(e.startIndex,e.endIndex);for(let r=e.depth;;--r){let i=e.$from.node(r),o=e.$from.index(r),a=e.$to.indexAfter(r);if(r<e.depth&&i.canReplace(o,a,n))return r;if(r==0||i.type.spec.isolating||!QFe(i,o,a))break}return null}function HFe(e,t,n=null,r=e){let i=YFe(e,t),o=i&&GFe(r,t);return o?i.map(Mk).concat({type:t,attrs:n}).concat(o.map(Mk)):null}function Mk(e){return{type:e,attrs:null}}function YFe(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}function GFe(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 c=r;u&&c<i;c++)u=u.matchType(n.child(c).type);return!u||!u.validEnd?null:a}function cm(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 c=i.depth-1,l=n-2;c>o;c--,l--){let d=i.node(c),p=i.index(c);if(d.type.spec.isolating)return!1;let A=d.content.cutByIndex(p,d.childCount),m=r&&r[l+1];m&&(A=A.replaceChild(0,m.type.create(m.attrs)));let v=r&&r[l]||d;if(!d.canReplace(p+1,d.childCount)||!v.type.validContent(A))return!1}let s=i.indexAfter(o),u=r&&r[0];return i.node(o).canReplaceWith(s,s,u?u.type:i.node(o+1).type)}function iO(e,t){let n=e.resolve(t),r=n.index();return dV(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function dV(e,t){return!!(e&&t&&!e.isLeaf&&e.canAppend(t))}function pV(e,t,n=-1){let r=e.resolve(t);for(let i=r.depth;;i--){let o,a,s=r.index(i);if(i==r.depth?(o=r.nodeBefore,a=r.nodeAfter):n>0?(o=r.node(i+1),s++,a=r.node(i).maybeChild(s)):(o=r.node(i).maybeChild(s-1),a=r.node(i+1)),o&&!o.isTextblock&&dV(o,a)&&r.node(i).canReplace(s,s+1))return t;if(i==0)break;t=n<0?r.before(i):r.after(i)}}class Ld extends Wn{constructor(t,n,r){super(),this.pos=t,this.attr=n,this.value=r}apply(t){let n=t.nodeAt(this.pos);if(!n)return Nt.fail("No node at attribute step's position");let r=Object.create(null);for(let o in n.attrs)r[o]=n.attrs[o];r[this.attr]=this.value;let i=n.type.create(r,null,n.marks);return Nt.fromReplace(t,this.pos,this.pos+1,new ae(X.from(i),0,n.isLeaf?0:1))}getMap(){return $r.empty}invert(t){return new Ld(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 Ld(n.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(t,n){if(typeof n.pos!="number"||typeof n.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new Ld(n.pos,n.attr,n.value)}}Wn.jsonID("attr",Ld);class tg extends Wn{constructor(t,n){super(),this.attr=t,this.value=n}apply(t){let n=Object.create(null);for(let i in t.attrs)n[i]=t.attrs[i];n[this.attr]=this.value;let r=t.type.create(n,t.content,t.marks);return Nt.ok(r)}getMap(){return $r.empty}invert(t){return new tg(this.attr,t.attrs[this.attr])}map(t){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(t,n){if(typeof n.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new tg(n.attr,n.value)}}Wn.jsonID("docAttr",tg);let Sp=class extends Error{};Sp=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n};Sp.prototype=Object.create(Error.prototype);Sp.prototype.constructor=Sp;Sp.prototype.name="TransformError";const JFe=(e,t)=>e.selection.empty?!1:(t&&t(e.tr.deleteSelection().scrollIntoView()),!0);function AV(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock("backward",e):n.parentOffset>0)?null:n}const ZFe=(e,t,n)=>{let r=AV(e,n);if(!r)return!1;let i=oO(r);if(!i){let a=r.blockRange(),s=a&&xh(a);return s==null?!1:(t&&t(e.tr.lift(a,s).scrollIntoView()),!0)}let o=i.nodeBefore;if(!o.type.spec.isolating&&vV(e,i,t))return!0;if(r.parent.content.size==0&&(Bl(o,"end")||ve.isSelectable(o))){let a=HR(e.doc,r.before(),r.after(),ae.empty);if(a&&a.slice.size<a.to-a.from){if(t){let s=e.tr.step(a);s.setSelection(Bl(o,"end")?ze.findFrom(s.doc.resolve(s.mapping.map(i.pos,-1)),-1):ve.create(s.doc,i.pos-o.nodeSize)),t(s.scrollIntoView())}return!0}}return o.isAtom&&i.depth==r.depth-1?(t&&t(e.tr.delete(i.pos-o.nodeSize,i.pos).scrollIntoView()),!0):!1},XFe=(e,t,n)=>{let r=AV(e,n);if(!r)return!1;let i=oO(r);return i?hV(e,i,t):!1},eke=(e,t,n)=>{let r=mV(e,n);if(!r)return!1;let i=aO(r);return i?hV(e,i,t):!1};function hV(e,t,n){let r=t.nodeBefore,i=r,o=t.pos-1;for(;!i.isTextblock;o--){if(i.type.spec.isolating)return!1;let l=i.lastChild;if(!l)return!1;i=l}let a=t.nodeAfter,s=a,u=t.pos+1;for(;!s.isTextblock;u++){if(s.type.spec.isolating)return!1;let l=s.firstChild;if(!l)return!1;s=l}let c=HR(e.doc,o,u,ae.empty);if(!c||c.from!=o||c instanceof Th&&c.slice.size>=u-o)return!1;if(n){let l=e.tr.step(c);l.setSelection(Be.create(l.doc,o)),n(l.scrollIntoView())}return!0}function Bl(e,t,n=!1){for(let r=e;r;r=t=="start"?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&r.childCount!=1)return!1}return!1}const tke=(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=oO(r)}let a=o&&o.nodeBefore;return!a||!ve.isSelectable(a)?!1:(t&&t(e.tr.setSelection(ve.create(e.doc,o.pos-a.nodeSize)).scrollIntoView()),!0)};function oO(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 mV(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock("forward",e):n.parentOffset<n.parent.content.size)?null:n}const nke=(e,t,n)=>{let r=mV(e,n);if(!r)return!1;let i=aO(r);if(!i)return!1;let o=i.nodeAfter;if(vV(e,i,t))return!0;if(r.parent.content.size==0&&(Bl(o,"start")||ve.isSelectable(o))){let a=HR(e.doc,r.before(),r.after(),ae.empty);if(a&&a.slice.size<a.to-a.from){if(t){let s=e.tr.step(a);s.setSelection(Bl(o,"start")?ze.findFrom(s.doc.resolve(s.mapping.map(i.pos)),1):ve.create(s.doc,s.mapping.map(i.pos))),t(s.scrollIntoView())}return!0}}return o.isAtom&&i.depth==r.depth-1?(t&&t(e.tr.delete(i.pos,i.pos+o.nodeSize).scrollIntoView()),!0):!1},rke=(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=aO(r)}let a=o&&o.nodeAfter;return!a||!ve.isSelectable(a)?!1:(t&&t(e.tr.setSelection(ve.create(e.doc,o.pos)).scrollIntoView()),!0)};function aO(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}const ike=(e,t)=>{let n=e.selection,r=n instanceof ve,i;if(r){if(n.node.isTextblock||!wh(e.doc,n.from))return!1;i=n.from}else if(i=F8(e.doc,n.from,-1),i==null)return!1;if(t){let o=e.tr.join(i);r&&o.setSelection(ve.create(o.doc,i-e.doc.resolve(i).nodeBefore.nodeSize)),t(o.scrollIntoView())}return!0},oke=(e,t)=>{let n=e.selection,r;if(n instanceof ve){if(n.node.isTextblock||!wh(e.doc,n.to))return!1;r=n.to}else if(r=F8(e.doc,n.to,1),r==null)return!1;return t&&t(e.tr.join(r).scrollIntoView()),!0},ake=(e,t)=>{let{$from:n,$to:r}=e.selection,i=n.blockRange(r),o=i&&xh(i);return o==null?!1:(t&&t(e.tr.lift(i,o).scrollIntoView()),!0)},ske=(e,t)=>{let{$head:n,$anchor:r}=e.selection;return!n.parent.type.spec.code||!n.sameParent(r)?!1:(t&&t(e.tr.insertText(`
44
- `).scrollIntoView()),!0)};function gV(e){for(let t=0;t<e.edgeCount;t++){let{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}const uke=(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=gV(i.contentMatchAt(o));if(!a||!i.canReplaceWith(o,o,a))return!1;if(t){let s=n.after(),u=e.tr.replaceWith(s,s,a.createAndFill());u.setSelection(ze.near(u.doc.resolve(s),1)),t(u.scrollIntoView())}return!0},cke=(e,t)=>{let n=e.selection,{$from:r,$to:i}=n;if(n instanceof Ri||r.parent.inlineContent||i.parent.inlineContent)return!1;let o=gV(i.parent.contentMatchAt(i.indexAfter()));if(!o||!o.isTextblock)return!1;if(t){let a=(!r.parentOffset&&i.index()<i.parent.childCount?r:i).pos,s=e.tr.insert(a,o.createAndFill());s.setSelection(Be.create(s.doc,a+1)),t(s.scrollIntoView())}return!0},lke=(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 o=n.before();if(R8(e.doc,o))return t&&t(e.tr.split(o).scrollIntoView()),!0}let r=n.blockRange(),i=r&&xh(r);return i==null?!1:(t&&t(e.tr.lift(r,i).scrollIntoView()),!0)},fke=(e,t)=>{let{$from:n,to:r}=e.selection,i,o=n.sharedDepth(r);return o==0?!1:(i=n.before(o),t&&t(e.tr.setSelection(ve.create(e.doc,i))),!0)};function dke(e,t,n){let r=t.nodeBefore,i=t.nodeAfter,o=t.index();return!r||!i||!r.type.compatibleContent(i.type)?!1:!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||wh(e.doc,t.pos))?!1:(n&&n(e.tr.clearIncompatible(t.pos,r.type,r.contentMatchAt(r.childCount)).join(t.pos).scrollIntoView()),!0)}function vV(e,t,n){let r=t.nodeBefore,i=t.nodeAfter,o,a;if(r.type.spec.isolating||i.type.spec.isolating)return!1;if(dke(e,t,n))return!0;let s=t.parent.canReplace(t.index(),t.index()+1);if(s&&(o=(a=r.contentMatchAt(r.childCount)).findWrapping(i.type))&&a.matchType(o[0]||i.type).validEnd){if(n){let d=t.pos+i.nodeSize,p=X.empty;for(let v=o.length-1;v>=0;v--)p=X.from(o[v].create(null,p));p=X.from(r.copy(p));let A=e.tr.step(new aa(t.pos-1,d,t.pos,d,new ae(p,1,0),o.length,!0)),m=d+2*o.length;wh(A.doc,m)&&A.join(m),n(A.scrollIntoView())}return!0}let u=ze.findFrom(t,1),c=u&&u.$from.blockRange(u.$to),l=c&&xh(c);if(l!=null&&l>=t.depth)return n&&n(e.tr.lift(c,l).scrollIntoView()),!0;if(s&&Bl(i,"start",!0)&&Bl(r,"end")){let d=r,p=[];for(;p.push(d),!d.isTextblock;)d=d.lastChild;let A=i,m=1;for(;!A.isTextblock;A=A.firstChild)m++;if(d.canReplace(d.childCount,d.childCount,A.content)){if(n){let v=X.empty;for(let C=p.length-1;C>=0;C--)v=X.from(p[C].copy(v));let _=e.tr.step(new aa(t.pos-p.length,t.pos+i.nodeSize,t.pos+m,t.pos+i.nodeSize-m,new ae(v,p.length,0),0,!0));n(_.scrollIntoView())}return!0}}return!1}function yV(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(Be.create(t.doc,e<0?i.start(o):i.end(o)))),!0):!1}}const pke=yV(-1),Ake=yV(1);function hke(e,t=null){return function(n,r){let{$from:i,$to:o}=n.selection,a=i.blockRange(o),s=a&&$8(a,e,t);return s?(r&&r(n.tr.wrap(a,s).scrollIntoView()),!0):!1}}function Lk(e,t=null){return function(n,r){let i=!1;for(let o=0;o<n.selection.ranges.length&&!i;o++){let{$from:{pos:a},$to:{pos:s}}=n.selection.ranges[o];n.doc.nodesBetween(a,s,(u,c)=>{if(i)return!1;if(!(!u.isTextblock||u.hasMarkup(e,t)))if(u.type==e)i=!0;else{let l=n.doc.resolve(c),d=l.index();i=l.parent.canReplaceWith(d,d+1,e)}})}if(!i)return!1;if(r){let o=n.tr;for(let a=0;a<n.selection.ranges.length;a++){let{$from:{pos:s},$to:{pos:u}}=n.selection.ranges[a];o.setBlockType(s,u,e,t)}r(o.scrollIntoView())}return!0}}typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform&&os.platform()=="darwin";function mke(e,t=null){return function(n,r){let{$from:i,$to:o}=n.selection,a=i.blockRange(o),s=!1,u=a;if(!a)return!1;if(a.depth>=2&&i.node(a.depth-1).type.compatibleContent(e)&&a.startIndex==0){if(i.index(a.depth-1)==0)return!1;let l=n.doc.resolve(a.start-2);u=new Vm(l,l,a.depth),a.endIndex<a.parent.childCount&&(a=new Vm(i,n.doc.resolve(o.end(a.depth)),a.depth)),s=!0}let c=$8(u,e,t,a);return c?(r&&r(gke(n.tr,a,c,s,e).scrollIntoView()),!0):!1}}function gke(e,t,n,r,i){let o=X.empty;for(let l=n.length-1;l>=0;l--)o=X.from(n[l].type.create(n[l].attrs,o));e.step(new aa(t.start-(r?2:0),t.end,t.start,t.end,new ae(o,0,0),n.length,!0));let a=0;for(let l=0;l<n.length;l++)n[l].type==i&&(a=l+1);let s=n.length-a,u=t.start+n.length-(r?2:0),c=t.parent;for(let l=t.startIndex,d=t.endIndex,p=!0;l<d;l++,p=!1)!p&&R8(e.doc,u,s)&&(e.split(u,s),u+=2*s),u+=c.child(l).nodeSize;return e}function vke(e){return function(t,n){let{$from:r,$to:i}=t.selection,o=r.blockRange(i,a=>a.childCount>0&&a.firstChild.type==e);return o?n?r.node(o.depth-1).type==e?yke(t,n,e,o):bke(t,n,o):!0:!1}}function yke(e,t,n,r){let i=e.tr,o=r.end,a=r.$to.end(r.depth);o<a&&(i.step(new aa(o-1,a,o,a,new ae(X.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new Vm(i.doc.resolve(r.$from.pos),i.doc.resolve(a),r.depth));const s=xh(r);if(s==null)return!1;i.lift(r,s);let u=i.mapping.map(o,-1)-1;return wh(i.doc,u)&&i.join(u),t(i.scrollIntoView()),!0}function bke(e,t,n){let r=e.tr,i=n.parent;for(let A=n.end,m=n.endIndex-1,v=n.startIndex;m>v;m--)A-=i.child(m).nodeSize,r.delete(A-1,A+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 s=n.startIndex==0,u=n.endIndex==i.childCount,c=o.node(-1),l=o.index(-1);if(!c.canReplace(l+(s?0:1),l+1,a.content.append(u?X.empty:X.from(i))))return!1;let d=o.pos,p=d+a.nodeSize;return r.step(new aa(d-(s?1:0),p+(u?1:0),d+1,p-1,new ae((s?X.empty:X.from(i.copy(X.empty))).append(u?X.empty:X.from(i.copy(X.empty))),s?0:1,u?0:1),s?0:1)),t(r.scrollIntoView()),!0}function Cke(e){return function(t,n){let{$from:r,$to:i}=t.selection,o=r.blockRange(i,c=>c.childCount>0&&c.firstChild.type==e);if(!o)return!1;let a=o.startIndex;if(a==0)return!1;let s=o.parent,u=s.child(a-1);if(u.type!=e)return!1;if(n){let c=u.lastChild&&u.lastChild.type==s.type,l=X.from(c?e.create():null),d=new ae(X.from(e.create(null,X.from(s.type.create(null,l)))),c?3:1,0),p=o.start,A=o.end;n(t.tr.step(new aa(p-(c?3:1),A,p,A,d,1,!0)).scrollIntoView())}return!0}}function J0(e){const{state:t,transaction:n}=e;let{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}}}class sO{constructor(t){this.editor=t.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=t.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:t,editor:n,state:r}=this,{view:i}=n,{tr:o}=r,a=this.buildProps(o);return Object.fromEntries(Object.entries(t).map(([s,u])=>[s,(...l)=>{const d=u(...l)(a);return!o.getMeta("preventDispatch")&&!this.hasCustomState&&i.dispatch(o),d}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(t,n=!0){const{rawCommands:r,editor:i,state:o}=this,{view:a}=i,s=[],u=!!t,c=t||o.tr,l=()=>(!u&&n&&!c.getMeta("preventDispatch")&&!this.hasCustomState&&a.dispatch(c),s.every(p=>p===!0)),d={...Object.fromEntries(Object.entries(r).map(([p,A])=>[p,(...v)=>{const _=this.buildProps(c,n),C=A(...v)(_);return s.push(C),d}])),run:l};return d}createCan(t){const{rawCommands:n,state:r}=this,i=!1,o=t||r.tr,a=this.buildProps(o,i);return{...Object.fromEntries(Object.entries(n).map(([u,c])=>[u,(...l)=>c(...l)({...a,dispatch:void 0})])),chain:()=>this.createChain(o,i)}}buildProps(t,n=!0){const{rawCommands:r,editor:i,state:o}=this,{view:a}=i,s={tr:t,editor:i,view:a,state:J0({state:o,transaction:t}),dispatch:n?()=>{}:void 0,chain:()=>this.createChain(t,n),can:()=>this.createCan(t),get commands(){return Object.fromEntries(Object.entries(r).map(([u,c])=>[u,(...l)=>c(...l)(s)]))}};return s}}function ce(e,t,n){return e.config[t]===void 0&&e.parent?ce(e.parent,t,n):typeof e.config[t]=="function"?e.config[t].bind({...n,parent:e.parent?ce(e.parent,t,n):null}):e.config[t]}function Z0(e){const t=e.filter(i=>i.type==="extension"),n=e.filter(i=>i.type==="node"),r=e.filter(i=>i.type==="mark");return{baseExtensions:t,nodeExtensions:n,markExtensions:r}}function bV(e){const t=[],{nodeExtensions:n,markExtensions:r}=Z0(e),i=[...n,...r],o={default:null,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return e.forEach(a=>{const s={name:a.name,options:a.options,storage:a.storage,extensions:i},u=ce(a,"addGlobalAttributes",s);if(!u)return;u().forEach(l=>{l.types.forEach(d=>{Object.entries(l.attributes).forEach(([p,A])=>{t.push({type:d,name:p,attribute:{...o,...A}})})})})}),i.forEach(a=>{const s={name:a.name,options:a.options,storage:a.storage},u=ce(a,"addAttributes",s);if(!u)return;const c=u();Object.entries(c).forEach(([l,d])=>{const p={...o,...d};typeof(p==null?void 0:p.default)=="function"&&(p.default=p.default()),p!=null&&p.isRequired&&(p==null?void 0:p.default)===void 0&&delete p.default,t.push({type:a.name,name:l,attribute:p})})}),t}function Cn(e,t){if(typeof e=="string"){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 Et(...e){return e.filter(t=>!!t).reduce((t,n)=>{const r={...t};return Object.entries(n).forEach(([i,o])=>{if(!r[i]){r[i]=o;return}if(i==="class"){const s=o?o.split(" "):[],u=r[i]?r[i].split(" "):[],c=s.filter(l=>!u.includes(l));r[i]=[...u,...c].join(" ")}else i==="style"?r[i]=[r[i],o].join("; "):r[i]=o}),r},{})}function wC(e,t){return t.filter(n=>n.attribute.rendered).map(n=>n.attribute.renderHTML?n.attribute.renderHTML(e.attrs)||{}:{[n.name]:e.attrs[n.name]}).reduce((n,r)=>Et(n,r),{})}function Ske(e){return typeof e=="function"}function Ue(e,t=void 0,...n){return Ske(e)?t?e.bind(t)(...n):e(...n):e}function _ke(e={}){return Object.keys(e).length===0&&e.constructor===Object}function Ike(e){return typeof e!="string"?e:e.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(e):e==="true"?!0:e==="false"?!1:e}function jk(e,t){return"style"in e?e:{...e,getAttrs:n=>{const r=e.getAttrs?e.getAttrs(n):e.attrs;if(r===!1)return!1;const i=t.reduce((o,a)=>{const s=a.attribute.parseHTML?a.attribute.parseHTML(n):Ike(n.getAttribute(a.name));return s==null?o:{...o,[a.name]:s}},{});return{...r,...i}}}}function Uk(e){return Object.fromEntries(Object.entries(e).filter(([t,n])=>t==="attrs"&&_ke(n)?!1:n!=null))}function CV(e,t){var n;const r=bV(e),{nodeExtensions:i,markExtensions:o}=Z0(e),a=(n=i.find(c=>ce(c,"topNode")))===null||n===void 0?void 0:n.name,s=Object.fromEntries(i.map(c=>{const l=r.filter(C=>C.type===c.name),d={name:c.name,options:c.options,storage:c.storage,editor:t},p=e.reduce((C,I)=>{const x=ce(I,"extendNodeSchema",d);return{...C,...x?x(c):{}}},{}),A=Uk({...p,content:Ue(ce(c,"content",d)),marks:Ue(ce(c,"marks",d)),group:Ue(ce(c,"group",d)),inline:Ue(ce(c,"inline",d)),atom:Ue(ce(c,"atom",d)),selectable:Ue(ce(c,"selectable",d)),draggable:Ue(ce(c,"draggable",d)),code:Ue(ce(c,"code",d)),whitespace:Ue(ce(c,"whitespace",d)),defining:Ue(ce(c,"defining",d)),isolating:Ue(ce(c,"isolating",d)),attrs:Object.fromEntries(l.map(C=>{var I;return[C.name,{default:(I=C==null?void 0:C.attribute)===null||I===void 0?void 0:I.default}]}))}),m=Ue(ce(c,"parseHTML",d));m&&(A.parseDOM=m.map(C=>jk(C,l)));const v=ce(c,"renderHTML",d);v&&(A.toDOM=C=>v({node:C,HTMLAttributes:wC(C,l)}));const _=ce(c,"renderText",d);return _&&(A.toText=_),[c.name,A]})),u=Object.fromEntries(o.map(c=>{const l=r.filter(_=>_.type===c.name),d={name:c.name,options:c.options,storage:c.storage,editor:t},p=e.reduce((_,C)=>{const I=ce(C,"extendMarkSchema",d);return{..._,...I?I(c):{}}},{}),A=Uk({...p,inclusive:Ue(ce(c,"inclusive",d)),excludes:Ue(ce(c,"excludes",d)),group:Ue(ce(c,"group",d)),spanning:Ue(ce(c,"spanning",d)),code:Ue(ce(c,"code",d)),attrs:Object.fromEntries(l.map(_=>{var C;return[_.name,{default:(C=_==null?void 0:_.attribute)===null||C===void 0?void 0:C.default}]}))}),m=Ue(ce(c,"parseHTML",d));m&&(A.parseDOM=m.map(_=>jk(_,l)));const v=ce(c,"renderHTML",d);return v&&(A.toDOM=_=>v({mark:_,HTMLAttributes:wC(_,l)})),[c.name,A]}));return new g8({topNode:a,nodes:s,marks:u})}function l1(e,t){return t.nodes[e]||t.marks[e]||null}function Bk(e,t){return Array.isArray(t)?t.some(n=>(typeof n=="string"?n:n.name)===e.name):t}const Tke=(e,t=500)=>{let n="";const r=e.parentOffset;return e.parent.nodesBetween(Math.max(0,r-t),r,(i,o,a,s)=>{var u,c;const l=((c=(u=i.type.spec).toText)===null||c===void 0?void 0:c.call(u,{node:i,pos:o,parent:a,index:s}))||i.textContent||"%leaf%";n+=i.isAtom&&!i.isText?l:l.slice(0,Math.max(0,r-o))}),n};function uO(e){return Object.prototype.toString.call(e)==="[object RegExp]"}class cO{constructor(t){this.find=t.find,this.handler=t.handler}}const xke=(e,t)=>{if(uO(t))return t.exec(e);const n=t(e);if(!n)return null;const 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 Yh(e){var t;const{editor:n,from:r,to:i,text:o,rules:a,plugin:s}=e,{view:u}=n;if(u.composing)return!1;const c=u.state.doc.resolve(r);if(c.parent.type.spec.code||!((t=c.nodeBefore||c.nodeAfter)===null||t===void 0)&&t.marks.find(p=>p.type.spec.code))return!1;let l=!1;const d=Tke(c)+o;return a.forEach(p=>{if(l)return;const A=xke(d,p.find);if(!A)return;const m=u.state.tr,v=J0({state:u.state,transaction:m}),_={from:r-(A[0].length-o.length),to:i},{commands:C,chain:I,can:x}=new sO({editor:n,state:v});p.handler({state:v,range:_,match:A,commands:C,chain:I,can:x})===null||!m.steps.length||(m.setMeta(s,{transform:m,from:r,to:i,text:o}),u.dispatch(m),l=!0)}),l}function wke(e){const{editor:t,rules:n}=e,r=new zr({state:{init(){return null},apply(i,o){const a=i.getMeta(r);if(a)return a;const s=i.getMeta("applyInputRules");return!!s&&setTimeout(()=>{const{from:c,text:l}=s,d=c+l.length;Yh({editor:t,from:c,to:d,text:l,rules:n,plugin:r})}),i.selectionSet||i.docChanged?null:o}},props:{handleTextInput(i,o,a,s){return Yh({editor:t,from:o,to:a,text:s,rules:n,plugin:r})},handleDOMEvents:{compositionend:i=>(setTimeout(()=>{const{$cursor:o}=i.state.selection;o&&Yh({editor:t,from:o.pos,to:o.pos,text:"",rules:n,plugin:r})}),!1)},handleKeyDown(i,o){if(o.key!=="Enter")return!1;const{$cursor:a}=i.state.selection;return a?Yh({editor:t,from:a.pos,to:a.pos,text:`
45
- `,rules:n,plugin:r}):!1}},isInputRules:!0});return r}function Eke(e){return typeof e=="number"}class $ke{constructor(t){this.find=t.find,this.handler=t.handler}}const Rke=(e,t,n)=>{if(uO(t))return[...e.matchAll(t)];const r=t(e,n);return r?r.map(i=>{const o=[i.text];return o.index=i.index,o.input=e,o.data=i.data,i.replaceWith&&(i.text.includes(i.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),o.push(i.replaceWith)),o}):[]};function Oke(e){const{editor:t,state:n,from:r,to:i,rule:o,pasteEvent:a,dropEvent:s}=e,{commands:u,chain:c,can:l}=new sO({editor:t,state:n}),d=[];return n.doc.nodesBetween(r,i,(A,m)=>{if(!A.isTextblock||A.type.spec.code)return;const v=Math.max(r,m),_=Math.min(i,m+A.content.size),C=A.textBetween(v-m,_-m,void 0,"");Rke(C,o.find,a).forEach(x=>{if(x.index===void 0)return;const g=v+x.index+1,S=g+x[0].length,y={from:n.tr.mapping.map(g),to:n.tr.mapping.map(S)},T=o.handler({state:n,range:y,match:x,commands:u,chain:c,can:l,pasteEvent:a,dropEvent:s});d.push(T)})}),d.every(A=>A!==null)}const Fke=e=>{var t;const n=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return(t=n.clipboardData)===null||t===void 0||t.setData("text/html",e),n};function kke(e){const{editor:t,rules:n}=e;let r=null,i=!1,o=!1,a=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,s=typeof DragEvent<"u"?new DragEvent("drop"):null;const u=({state:l,from:d,to:p,rule:A,pasteEvt:m})=>{const v=l.tr,_=J0({state:l,transaction:v});if(!(!Oke({editor:t,state:_,from:Math.max(d-1,0),to:p.b-1,rule:A,pasteEvent:m,dropEvent:s})||!v.steps.length))return s=typeof DragEvent<"u"?new DragEvent("drop"):null,a=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,v};return n.map(l=>new zr({view(d){const p=A=>{var m;r=!((m=d.dom.parentElement)===null||m===void 0)&&m.contains(A.target)?d.dom.parentElement:null};return window.addEventListener("dragstart",p),{destroy(){window.removeEventListener("dragstart",p)}}},props:{handleDOMEvents:{drop:(d,p)=>(o=r===d.dom.parentElement,s=p,!1),paste:(d,p)=>{var A;const m=(A=p.clipboardData)===null||A===void 0?void 0:A.getData("text/html");return a=p,i=!!(m!=null&&m.includes("data-pm-slice")),!1}}},appendTransaction:(d,p,A)=>{const m=d[0],v=m.getMeta("uiEvent")==="paste"&&!i,_=m.getMeta("uiEvent")==="drop"&&!o,C=m.getMeta("applyPasteRules"),I=!!C;if(!v&&!_&&!I)return;if(I){const{from:S,text:y}=C,T=S+y.length,w=Fke(y);return u({rule:l,state:A,from:S,to:{b:T},pasteEvt:w})}const x=p.doc.content.findDiffStart(A.doc.content),g=p.doc.content.findDiffEnd(A.doc.content);if(!(!Eke(x)||!g||x===g.b))return u({rule:l,state:A,from:x,to:g,pasteEvt:a})}}))}function Mke(e){const t=e.filter((n,r)=>e.indexOf(n)!==r);return Array.from(new Set(t))}class dl{constructor(t,n){this.splittableMarks=[],this.editor=n,this.extensions=dl.resolve(t),this.schema=CV(this.extensions,n),this.setupExtensions()}static resolve(t){const n=dl.sort(dl.flatten(t)),r=Mke(n.map(i=>i.name));return r.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${r.map(i=>`'${i}'`).join(", ")}]. This can lead to issues.`),n}static flatten(t){return t.map(n=>{const r={name:n.name,options:n.options,storage:n.storage},i=ce(n,"addExtensions",r);return i?[n,...this.flatten(i())]:n}).flat(10)}static sort(t){return t.sort((r,i)=>{const o=ce(r,"priority")||100,a=ce(i,"priority")||100;return o>a?-1:o<a?1:0})}get commands(){return this.extensions.reduce((t,n)=>{const r={name:n.name,options:n.options,storage:n.storage,editor:this.editor,type:l1(n.name,this.schema)},i=ce(n,"addCommands",r);return i?{...t,...i()}:t},{})}get plugins(){const{editor:t}=this,n=dl.sort([...this.extensions].reverse()),r=[],i=[],o=n.map(a=>{const s={name:a.name,options:a.options,storage:a.storage,editor:t,type:l1(a.name,this.schema)},u=[],c=ce(a,"addKeyboardShortcuts",s);let l={};if(a.type==="mark"&&ce(a,"exitable",s)&&(l.ArrowRight=()=>Nc.handleExit({editor:t,mark:a})),c){const v=Object.fromEntries(Object.entries(c()).map(([_,C])=>[_,()=>C({editor:t})]));l={...l,...v}}const d=KFe(l);u.push(d);const p=ce(a,"addInputRules",s);Bk(a,t.options.enableInputRules)&&p&&r.push(...p());const A=ce(a,"addPasteRules",s);Bk(a,t.options.enablePasteRules)&&A&&i.push(...A());const m=ce(a,"addProseMirrorPlugins",s);if(m){const v=m();u.push(...v)}return u}).flat();return[wke({editor:t,rules:r}),...kke({editor:t,rules:i}),...o]}get attributes(){return bV(this.extensions)}get nodeViews(){const{editor:t}=this,{nodeExtensions:n}=Z0(this.extensions);return Object.fromEntries(n.filter(r=>!!ce(r,"addNodeView")).map(r=>{const i=this.attributes.filter(u=>u.type===r.name),o={name:r.name,options:r.options,storage:r.storage,editor:t,type:Cn(r.name,this.schema)},a=ce(r,"addNodeView",o);if(!a)return[];const s=(u,c,l,d)=>{const p=wC(u,i);return a()({editor:t,node:u,getPos:l,decorations:d,HTMLAttributes:p,extension:r})};return[r.name,s]}))}setupExtensions(){this.extensions.forEach(t=>{var n;this.editor.extensionStorage[t.name]=t.storage;const r={name:t.name,options:t.options,storage:t.storage,editor:this.editor,type:l1(t.name,this.schema)};t.type==="mark"&&(!((n=Ue(ce(t,"keepOnSplit",r)))!==null&&n!==void 0)||n)&&this.splittableMarks.push(t.name);const i=ce(t,"onBeforeCreate",r),o=ce(t,"onCreate",r),a=ce(t,"onUpdate",r),s=ce(t,"onSelectionUpdate",r),u=ce(t,"onTransaction",r),c=ce(t,"onFocus",r),l=ce(t,"onBlur",r),d=ce(t,"onDestroy",r);i&&this.editor.on("beforeCreate",i),o&&this.editor.on("create",o),a&&this.editor.on("update",a),s&&this.editor.on("selectionUpdate",s),u&&this.editor.on("transaction",u),c&&this.editor.on("focus",c),l&&this.editor.on("blur",l),d&&this.editor.on("destroy",d)})}}function Lke(e){return Object.prototype.toString.call(e).slice(8,-1)}function Gh(e){return Lke(e)!=="Object"?!1:e.constructor===Object&&Object.getPrototypeOf(e)===Object.prototype}function X0(e,t){const n={...e};return Gh(e)&&Gh(t)&&Object.keys(t).forEach(r=>{Gh(t[r])&&Gh(e[r])?n[r]=X0(e[r],t[r]):n[r]=t[r]}),n}class dr{constructor(t={}){this.type="extension",this.name="extension",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...t},this.name=this.config.name,t.defaultOptions&&Object.keys(t.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=Ue(ce(this,"addOptions",{name:this.name}))),this.storage=Ue(ce(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(t={}){return new dr(t)}configure(t={}){const n=this.extend({...this.config,addOptions:()=>X0(this.options,t)});return n.name=this.name,n.parent=this.parent,n}extend(t={}){const n=new dr({...this.config,...t});return n.parent=this,this.child=n,n.name=t.name?t.name:n.parent.name,t.defaultOptions&&Object.keys(t.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=Ue(ce(n,"addOptions",{name:n.name})),n.storage=Ue(ce(n,"addStorage",{name:n.name,options:n.options})),n}}function jke(e,t,n){const{from:r,to:i}=t,{blockSeparator:o=`
43
+ `))),0,0):ae.empty;let d=e.someProp("clipboardTextParser",p=>p(t,i,r,e));if(d)s=d;else{let p=i.marks(),{schema:A}=e.state,m=au.fromSchema(A);a=document.createElement("div"),t.split(/(?:\r\n?|\n)+/).forEach(v=>{let _=a.appendChild(document.createElement("p"));v&&_.appendChild(m.serializeNode(A.text(v,p)))})}}else e.someProp("transformPastedHTML",d=>{n=d(n,e)}),a=fFe(n),ZR&&dFe(a);let c=a&&a.querySelector("[data-pm-slice]"),l=c&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(c.getAttribute("data-pm-slice")||"");if(l&&l[3])for(let d=+l[3];d>0;d--){let p=a.firstChild;for(;p&&p.nodeType!=1;)p=p.nextSibling;if(!p)break;a=p}if(s||(s=(e.someProp("clipboardParser")||e.someProp("domParser")||hu.fromSchema(e.state.schema)).parseSlice(a,{preserveWhitespace:!!(u||l),context:i,ruleFromNode(p){return p.nodeName=="BR"&&!p.nextSibling&&p.parentNode&&!cFe.test(p.parentNode.nodeName)?{ignore:!0}:null}})),l)s=pFe($k(s,+l[1],+l[2]),l[4]);else if(s=ae.maxOpen(lFe(s.content,i),!0),s.openStart||s.openEnd){let d=0,p=0;for(let A=s.content.firstChild;d<s.openStart&&!A.type.spec.isolating;d++,A=A.firstChild);for(let A=s.content.lastChild;p<s.openEnd&&!A.type.spec.isolating;p++,A=A.lastChild);s=$k(s,d,p)}return e.someProp("transformPasted",d=>{s=d(s,e)}),s}const cFe=/^(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 lFe(e,t){if(e.childCount<2)return e;for(let n=t.depth;n>=0;n--){let i=t.node(n).contentMatchAt(t.index(n)),o,a=[];if(e.forEach(s=>{if(!a)return;let u=i.findWrapping(s.type),c;if(!u)return a=null;if(c=a.length&&o.length&&H8(u,o,s,a[a.length-1],0))a[a.length-1]=c;else{a.length&&(a[a.length-1]=Y8(a[a.length-1],o.length));let l=z8(s,u);a.push(l),i=i.matchType(l.type),o=u}}),a)return X.from(a)}return e}function z8(e,t,n=0){for(let r=t.length-1;r>=n;r--)e=t[r].create(null,X.from(e));return e}function H8(e,t,n,r,i){if(i<e.length&&i<t.length&&e[i]==t[i]){let o=H8(e,t,n,r.lastChild,i+1);if(o)return r.copy(r.content.replaceChild(r.childCount-1,o));if(r.contentMatchAt(r.childCount).matchType(i==e.length-1?n.type:e[i+1]))return r.copy(r.content.append(X.from(z8(n,e,i+1))))}}function Y8(e,t){if(t==0)return e;let n=e.content.replaceChild(e.childCount-1,Y8(e.lastChild,t-1)),r=e.contentMatchAt(e.childCount).fillBefore(X.empty,!0);return e.copy(n.append(r))}function IC(e,t,n,r,i,o){let a=t<0?e.firstChild:e.lastChild,s=a.content;return e.childCount>1&&(o=0),i<r-1&&(s=IC(s,t,n,r,i+1,o)),i>=n&&(s=t<0?a.contentMatchAt(0).fillBefore(s,o<=i).append(s):s.append(a.contentMatchAt(a.childCount).fillBefore(X.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,a.copy(s))}function $k(e,t,n){return t<e.openStart&&(e=new ae(IC(e.content,-1,t,e.openStart,0,e.openEnd),t,e.openEnd)),n<e.openEnd&&(e=new ae(IC(e.content,1,n,e.openEnd,0,0),e.openStart,n)),e}const G8={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]};let Rk=null;function J8(){return Rk||(Rk=document.implementation.createHTMLDocument("title"))}function fFe(e){let t=/^(\s*<meta [^>]*>)*/.exec(e);t&&(e=e.slice(t[0].length));let n=J8().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(e),i;if((i=r&&G8[r[1].toLowerCase()])&&(e=i.map(o=>"<"+o+">").join("")+e+i.map(o=>"</"+o+">").reverse().join("")),n.innerHTML=e,i)for(let o=0;o<i.length;o++)n=n.querySelector(i[o])||n;return n}function dFe(e){let t=e.querySelectorAll(Hs?"span:not([class]):not([style])":"span.Apple-converted-space");for(let n=0;n<t.length;n++){let r=t[n];r.childNodes.length==1&&r.textContent==" "&&r.parentNode&&r.parentNode.replaceChild(e.ownerDocument.createTextNode(" "),r)}}function pFe(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 s=r.length-2;s>=0;s-=2){let u=n.nodes[r[s]];if(!u||u.hasRequiredAttrs())break;i=X.from(u.create(r[s+1],i)),o++,a++}return new ae(i,o,a)}const to={},Mr={};function ts(e,t){e.input.lastSelectionOrigin=t,e.input.lastSelectionTime=Date.now()}Mr.keydown=(e,t)=>{let n=t;if(e.input.shiftKey=n.keyCode==16||n.shiftKey,!X8(e,n)&&(e.input.lastKeyCode=n.keyCode,e.input.lastKeyCodeTime=Date.now(),!($h&&Hs&&n.keyCode==13)))if(n.keyCode!=229&&e.domObserver.forceFlush(),JR&&n.keyCode==13&&!n.ctrlKey&&!n.altKey&&!n.metaKey){let r=Date.now();e.input.lastIOSEnter=r,e.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{e.input.lastIOSEnter==r&&(e.someProp("handleKeyDown",i=>i(e,B8(13,"Enter"))),e.input.lastIOSEnter=0)},200)}else e.someProp("handleKeyDown",r=>r(e,n))||uFe(e,n)?n.preventDefault():ts(e,"key")};Mr.keyup=(e,t)=>{t.keyCode==16&&(e.input.shiftKey=!1)};Mr.keypress=(e,t)=>{let n=t;if(X8(e,n)||!n.charCode||n.ctrlKey&&!n.altKey||Xr&&n.metaKey)return;if(e.someProp("handleKeyPress",i=>i(e,n))){n.preventDefault();return}let r=e.state.selection;if(!(r instanceof Be)||!r.$from.sameParent(r.$to)){let i=String.fromCharCode(n.charCode);!/[\r\n]/.test(i)&&!e.someProp("handleTextInput",o=>o(e,r.$from.pos,r.$to.pos,i))&&e.dispatch(e.state.tr.insertText(i).scrollIntoView()),n.preventDefault()}};function G0(e){return{left:e.clientX,top:e.clientY}}function AFe(e,t){let n=t.x-e.clientX,r=t.y-e.clientY;return n*n+r*r<100}function eO(e,t,n,r,i){if(r==-1)return!1;let o=e.state.doc.resolve(r);for(let a=o.depth+1;a>0;a--)if(e.someProp(t,s=>a>o.depth?s(e,n,o.nodeAfter,o.before(a),i,!0):s(e,n,o.node(a),o.before(a),i,!1)))return!0;return!1}function ml(e,t,n){if(e.focused||e.focus(),e.state.selection.eq(t))return;let r=e.state.tr.setSelection(t);n=="pointer"&&r.setMeta("pointer",!0),e.dispatch(r)}function hFe(e,t){if(t==-1)return!1;let n=e.state.doc.resolve(t),r=n.nodeAfter;return r&&r.isAtom&&ve.isSelectable(r)?(ml(e,new ve(n),"pointer"),!0):!1}function mFe(e,t){if(t==-1)return!1;let n=e.state.selection,r,i;n instanceof ve&&(r=n.node);let o=e.state.doc.resolve(t);for(let a=o.depth+1;a>0;a--){let s=a>o.depth?o.nodeAfter:o.node(a);if(ve.isSelectable(s)){r&&n.$from.depth>0&&a>=n.$from.depth&&o.before(n.$from.depth+1)==n.$from.pos?i=o.before(n.$from.depth):i=o.before(a);break}}return i!=null?(ml(e,ve.create(e.state.doc,i),"pointer"),!0):!1}function gFe(e,t,n,r,i){return eO(e,"handleClickOn",t,n,r)||e.someProp("handleClick",o=>o(e,t,r))||(i?mFe(e,n):hFe(e,n))}function vFe(e,t,n,r){return eO(e,"handleDoubleClickOn",t,n,r)||e.someProp("handleDoubleClick",i=>i(e,t,r))}function yFe(e,t,n,r){return eO(e,"handleTripleClickOn",t,n,r)||e.someProp("handleTripleClick",i=>i(e,t,r))||bFe(e,n,r)}function bFe(e,t,n){if(n.button!=0)return!1;let r=e.state.doc;if(t==-1)return r.inlineContent?(ml(e,Be.create(r,0,r.content.size),"pointer"),!0):!1;let i=r.resolve(t);for(let o=i.depth+1;o>0;o--){let a=o>i.depth?i.nodeAfter:i.node(o),s=i.before(o);if(a.inlineContent)ml(e,Be.create(r,s+1,s+1+a.content.size),"pointer");else if(ve.isSelectable(a))ml(e,ve.create(r,s),"pointer");else continue;return!0}}function tO(e){return Jm(e)}const Z8=Xr?"metaKey":"ctrlKey";to.mousedown=(e,t)=>{let n=t;e.input.shiftKey=n.shiftKey;let r=tO(e),i=Date.now(),o="singleClick";i-e.input.lastClick.time<500&&AFe(n,e.input.lastClick)&&!n[Z8]&&(e.input.lastClick.type=="singleClick"?o="doubleClick":e.input.lastClick.type=="doubleClick"&&(o="tripleClick")),e.input.lastClick={time:i,x:n.clientX,y:n.clientY,type:o};let a=e.posAtCoords(G0(n));a&&(o=="singleClick"?(e.input.mouseDown&&e.input.mouseDown.done(),e.input.mouseDown=new CFe(e,a,n,!!r)):(o=="doubleClick"?vFe:yFe)(e,a.pos,a.inside,n)?n.preventDefault():ts(e,"pointer"))};class CFe{constructor(t,n,r,i){this.view=t,this.pos=n,this.event=r,this.flushed=i,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=t.state.doc,this.selectNode=!!r[Z8],this.allowDefault=r.shiftKey;let o,a;if(n.inside>-1)o=t.state.doc.nodeAt(n.inside),a=n.inside;else{let l=t.state.doc.resolve(n.pos);o=l.parent,a=l.depth?l.before():0}const s=i?null:r.target,u=s?t.docView.nearestDesc(s,!0):null;this.target=u&&u.dom.nodeType==1?u.dom:null;let{selection:c}=t.state;(r.button==0&&o.type.spec.draggable&&o.type.spec.selectable!==!1||c instanceof ve&&c.from<=a&&c.to>a)&&(this.mightDrag={node:o,pos:a,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&Y0&&!this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),t.root.addEventListener("mouseup",this.up=this.up.bind(this)),t.root.addEventListener("mousemove",this.move=this.move.bind(this)),ts(t,"pointer")}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>XR(this.view)),this.view.input.mouseDown=null}up(t){if(this.done(),!this.view.dom.contains(t.target))return;let n=this.pos;this.view.state.doc!=this.startDoc&&(n=this.view.posAtCoords(G0(t))),this.updateAllowDefault(t),this.allowDefault||!n?ts(this.view,"pointer"):gFe(this.view,n.pos,n.inside,t,this.selectNode)?t.preventDefault():t.button==0&&(this.flushed||Kc&&this.mightDrag&&!this.mightDrag.node.isAtom||Hs&&!this.view.state.selection.visible&&Math.min(Math.abs(n.pos-this.view.state.selection.from),Math.abs(n.pos-this.view.state.selection.to))<=2)?(ml(this.view,ze.near(this.view.state.doc.resolve(n.pos)),"pointer"),t.preventDefault()):ts(this.view,"pointer")}move(t){this.updateAllowDefault(t),ts(this.view,"pointer"),t.buttons==0&&this.done()}updateAllowDefault(t){!this.allowDefault&&(Math.abs(this.event.x-t.clientX)>4||Math.abs(this.event.y-t.clientY)>4)&&(this.allowDefault=!0)}}to.touchstart=e=>{e.input.lastTouch=Date.now(),tO(e),ts(e,"pointer")};to.touchmove=e=>{e.input.lastTouch=Date.now(),ts(e,"pointer")};to.contextmenu=e=>tO(e);function X8(e,t){return e.composing?!0:Kc&&Math.abs(t.timeStamp-e.input.compositionEndedAt)<500?(e.input.compositionEndedAt=-2e8,!0):!1}const SFe=$h?5e3:-1;Mr.compositionstart=Mr.compositionupdate=e=>{if(!e.composing){e.domObserver.flush();let{state:t}=e,n=t.selection.$to;if(t.selection instanceof Be&&(t.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(r=>r.type.spec.inclusive===!1)))e.markCursor=e.state.storedMarks||n.marks(),Jm(e,!0),e.markCursor=null;else if(Jm(e,!t.selection.empty),Y0&&t.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let r=e.domSelectionRange();for(let i=r.focusNode,o=r.focusOffset;i&&i.nodeType==1&&o!=0;){let a=o<0?i.lastChild:i.childNodes[o-1];if(!a)break;if(a.nodeType==3){let s=e.domSelection();s&&s.collapse(a,a.nodeValue.length);break}else i=a,o=-1}}e.input.composing=!0}eV(e,SFe)};Mr.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.compositionNode=null,e.input.compositionPendingChanges&&Promise.resolve().then(()=>e.domObserver.flush()),e.input.compositionID++,eV(e,20))};function eV(e,t){clearTimeout(e.input.composingTimeout),t>-1&&(e.input.composingTimeout=setTimeout(()=>Jm(e),t))}function _Fe(e){for(e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=IFe());e.input.compositionNodes.length>0;)e.input.compositionNodes.pop().markParentsDirty()}function IFe(){let e=document.createEvent("Event");return e.initEvent("event",!0,!0),e.timeStamp}function Jm(e,t=!1){if(!($h&&e.domObserver.flushingSoon>=0)){if(e.domObserver.forceFlush(),_Fe(e),t||e.docView&&e.docView.dirty){let n=JOe(e);return n&&!n.eq(e.state.selection)?e.dispatch(e.state.tr.setSelection(n)):(e.markCursor||t)&&!e.state.selection.empty?e.dispatch(e.state.tr.deleteSelection()):e.updateState(e.state),!0}return!1}}function TFe(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)}const yp=Eh&&W8<15||JR&&GOe<604;to.copy=Mr.cut=(e,t)=>{let n=t,r=e.state.selection,i=n.type=="cut";if(r.empty)return;let o=yp?null:n.clipboardData,a=r.content(),{dom:s,text:u}=V8(e,a);o?(n.preventDefault(),o.clearData(),o.setData("text/html",s.innerHTML),o.setData("text/plain",u)):TFe(e,s),i&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function xFe(e){return e.openStart==0&&e.openEnd==0&&e.content.childCount==1?e.content.firstChild:null}function wFe(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&&e.input.lastKeyCode!=45;setTimeout(()=>{e.focus(),r.parentNode&&r.parentNode.removeChild(r),n?TC(e,r.value,null,i,t):TC(e,r.textContent,r.innerHTML,i,t)},50)}function TC(e,t,n,r,i){let o=Q8(e,t,n,r,e.state.selection.$from);if(e.someProp("handlePaste",u=>u(e,i,o||ae.empty)))return!0;if(!o)return!1;let a=xFe(o),s=a?e.state.tr.replaceSelectionWith(a,r):e.state.tr.replaceSelection(o);return e.dispatch(s.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function tV(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," "):""}Mr.paste=(e,t)=>{let n=t;if(e.composing&&!$h)return;let r=yp?null:n.clipboardData,i=e.input.shiftKey&&e.input.lastKeyCode!=45;r&&TC(e,tV(r),r.getData("text/html"),i,n)?n.preventDefault():wFe(e,n)};class EFe{constructor(t,n,r){this.slice=t,this.move=n,this.node=r}}const nV=Xr?"altKey":"ctrlKey";to.dragstart=(e,t)=>{let n=t,r=e.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let i=e.state.selection,o=i.empty?null:e.posAtCoords(G0(n)),a;if(!(o&&o.pos>=i.from&&o.pos<=(i instanceof ve?i.to-1:i.to))){if(r&&r.mightDrag)a=ve.create(e.state.doc,r.mightDrag.pos);else if(n.target&&n.target.nodeType==1){let d=e.docView.nearestDesc(n.target,!0);d&&d.node.type.spec.draggable&&d!=e.docView&&(a=ve.create(e.state.doc,d.posBefore))}}let s=(a||e.state.selection).content(),{dom:u,text:c,slice:l}=V8(e,s);(!n.dataTransfer.files.length||!Hs||D8>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(yp?"Text":"text/html",u.innerHTML),n.dataTransfer.effectAllowed="copyMove",yp||n.dataTransfer.setData("text/plain",c),e.dragging=new EFe(l,!n[nV],a)};to.dragend=e=>{let t=e.dragging;window.setTimeout(()=>{e.dragging==t&&(e.dragging=null)},50)};Mr.dragover=Mr.dragenter=(e,t)=>t.preventDefault();Mr.drop=(e,t)=>{let n=t,r=e.dragging;if(e.dragging=null,!n.dataTransfer)return;let i=e.posAtCoords(G0(n));if(!i)return;let o=e.state.doc.resolve(i.pos),a=r&&r.slice;a?e.someProp("transformPasted",m=>{a=m(a,e)}):a=Q8(e,tV(n.dataTransfer),yp?null:n.dataTransfer.getData("text/html"),!1,o);let s=!!(r&&!n[nV]);if(e.someProp("handleDrop",m=>m(e,n,a||ae.empty,s))){n.preventDefault();return}if(!a)return;n.preventDefault();let u=a?WOe(e.state.doc,o.pos,a):o.pos;u==null&&(u=o.pos);let c=e.state.tr;if(s){let{node:m}=r;m?m.replace(c):c.deleteSelection()}let l=c.mapping.map(u),d=a.openStart==0&&a.openEnd==0&&a.content.childCount==1,p=c.doc;if(d?c.replaceRangeWith(l,l,a.content.firstChild):c.replaceRange(l,l,a),c.doc.eq(p))return;let A=c.doc.resolve(l);if(d&&ve.isSelectable(a.content.firstChild)&&A.nodeAfter&&A.nodeAfter.sameMarkup(a.content.firstChild))c.setSelection(new ve(A));else{let m=c.mapping.map(u);c.mapping.maps[c.mapping.maps.length-1].forEach((v,_,C,I)=>m=I),c.setSelection(N8(e,A,c.doc.resolve(m)))}e.focus(),e.dispatch(c.setMeta("uiEvent","drop"))};to.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())&&XR(e)},20))};to.blur=(e,t)=>{let n=t;e.focused&&(e.domObserver.stop(),e.dom.classList.remove("ProseMirror-focused"),e.domObserver.start(),n.relatedTarget&&e.dom.contains(n.relatedTarget)&&e.domObserver.currentSelection.clear(),e.focused=!1)};to.beforeinput=(e,t)=>{if(Hs&&$h&&t.inputType=="deleteContentBackward"){e.domObserver.flushSoon();let{domChangeCount:r}=e.input;setTimeout(()=>{if(e.input.domChangeCount!=r||(e.dom.blur(),e.focus(),e.someProp("handleKeyDown",o=>o(e,B8(8,"Backspace")))))return;let{$cursor:i}=e.state.selection;i&&i.pos>0&&e.dispatch(e.state.tr.delete(i.pos-1,i.pos).scrollIntoView())},50)}};for(let e in Mr)to[e]=Mr[e];function bp(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 Zm{constructor(t,n){this.toDOM=t,this.spec=n||mu,this.side=this.spec.side||0}map(t,n,r,i){let{pos:o,deleted:a}=t.mapResult(n.from+i,this.side<0?-1:1);return a?null:new wi(o-r,o-r,this)}valid(){return!0}eq(t){return this==t||t instanceof Zm&&(this.spec.key&&this.spec.key==t.spec.key||this.toDOM==t.toDOM&&bp(this.spec,t.spec))}destroy(t){this.spec.destroy&&this.spec.destroy(t)}}class is{constructor(t,n){this.attrs=t,this.spec=n||mu}map(t,n,r,i){let o=t.map(n.from+i,this.spec.inclusiveStart?-1:1)-r,a=t.map(n.to+i,this.spec.inclusiveEnd?1:-1)-r;return o>=a?null:new wi(o,a,this)}valid(t,n){return n.from<n.to}eq(t){return this==t||t instanceof is&&bp(this.attrs,t.attrs)&&bp(this.spec,t.spec)}static is(t){return t.type instanceof is}destroy(){}}let $Fe=class rV{constructor(t,n){this.attrs=t,this.spec=n||mu}map(t,n,r,i){let o=t.mapResult(n.from+i,1);if(o.deleted)return null;let a=t.mapResult(n.to+i,-1);return a.deleted||a.pos<=o.pos?null:new wi(o.pos-r,a.pos-r,this)}valid(t,n){let{index:r,offset:i}=t.content.findIndex(n.from),o;return i==n.from&&!(o=t.child(r)).isText&&i+o.nodeSize==n.to}eq(t){return this==t||t instanceof rV&&bp(this.attrs,t.attrs)&&bp(this.spec,t.spec)}destroy(){}};class wi{constructor(t,n,r){this.from=t,this.to=n,this.type=r}copy(t,n){return new wi(t,n,this.type)}eq(t,n=0){return this.type.eq(t.type)&&this.from+n==t.from&&this.to+n==t.to}map(t,n,r){return this.type.map(t,this,n,r)}static widget(t,n,r){return new wi(t,t,new Zm(n,r))}static inline(t,n,r,i){return new wi(t,n,new is(r,i))}static node(t,n,r,i){return new wi(t,n,new $Fe(r,i))}get spec(){return this.type.spec}get inline(){return this.type instanceof is}get widget(){return this.type instanceof Zm}}const ul=[],mu={};class Ht{constructor(t,n){this.local=t.length?t:ul,this.children=n.length?n:ul}static create(t,n){return n.length?Xm(n,t,0,mu):qn}find(t,n,r){let i=[];return this.findInner(t??0,n??1e9,i,0,r),i}findInner(t,n,r,i,o){for(let a=0;a<this.local.length;a++){let s=this.local[a];s.from<=n&&s.to>=t&&(!o||o(s.spec))&&r.push(s.copy(s.from+i,s.to+i))}for(let a=0;a<this.children.length;a+=3)if(this.children[a]<n&&this.children[a+1]>t){let s=this.children[a]+1;this.children[a+2].findInner(t-s,n-s,r,i+s,o)}}map(t,n,r){return this==qn||t.maps.length==0?this:this.mapInner(t,n,0,0,r||mu)}mapInner(t,n,r,i,o){let a;for(let s=0;s<this.local.length;s++){let u=this.local[s].map(t,r,i);u&&u.type.valid(n,u)?(a||(a=[])).push(u):o.onRemove&&o.onRemove(this.local[s].spec)}return this.children.length?RFe(this.children,a||[],t,n,r,i,o):a?new Ht(a.sort(gu),ul):qn}add(t,n){return n.length?this==qn?Ht.create(t,n):this.addInner(t,n,0):this}addInner(t,n,r){let i,o=0;t.forEach((s,u)=>{let c=u+r,l;if(l=oV(n,s,c)){for(i||(i=this.children.slice());o<i.length&&i[o]<u;)o+=3;i[o]==u?i[o+2]=i[o+2].addInner(s,l,c+1):i.splice(o,0,u,u+s.nodeSize,Xm(l,s,c+1,mu)),o+=3}});let a=iV(o?aV(n):n,-r);for(let s=0;s<a.length;s++)a[s].type.valid(t,a[s])||a.splice(s--,1);return new Ht(a.length?this.local.concat(a).sort(gu):this.local,i||this.children)}remove(t){return t.length==0||this==qn?this:this.removeInner(t,0)}removeInner(t,n){let r=this.children,i=this.local;for(let o=0;o<r.length;o+=3){let a,s=r[o]+n,u=r[o+1]+n;for(let l=0,d;l<t.length;l++)(d=t[l])&&d.from>s&&d.to<u&&(t[l]=null,(a||(a=[])).push(d));if(!a)continue;r==this.children&&(r=this.children.slice());let c=r[o+2].removeInner(a,s+1);c!=qn?r[o+2]=c:(r.splice(o,3),o-=3)}if(i.length){for(let o=0,a;o<t.length;o++)if(a=t[o])for(let s=0;s<i.length;s++)i[s].eq(a,n)&&(i==this.local&&(i=this.local.slice()),i.splice(s--,1))}return r==this.children&&i==this.local?this:i.length||r.length?new Ht(i,r):qn}forChild(t,n){if(this==qn)return this;if(n.isLeaf)return Ht.empty;let r,i;for(let s=0;s<this.children.length;s+=3)if(this.children[s]>=t){this.children[s]==t&&(r=this.children[s+2]);break}let o=t+1,a=o+n.content.size;for(let s=0;s<this.local.length;s++){let u=this.local[s];if(u.from<a&&u.to>o&&u.type instanceof is){let c=Math.max(o,u.from)-o,l=Math.min(a,u.to)-o;c<l&&(i||(i=[])).push(u.copy(c,l))}}if(i){let s=new Ht(i.sort(gu),ul);return r?new iu([s,r]):s}return r||qn}eq(t){if(this==t)return!0;if(!(t instanceof Ht)||this.local.length!=t.local.length||this.children.length!=t.children.length)return!1;for(let n=0;n<this.local.length;n++)if(!this.local[n].eq(t.local[n]))return!1;for(let n=0;n<this.children.length;n+=3)if(this.children[n]!=t.children[n]||this.children[n+1]!=t.children[n+1]||!this.children[n+2].eq(t.children[n+2]))return!1;return!0}locals(t){return nO(this.localsInner(t))}localsInner(t){if(this==qn)return ul;if(t.inlineContent||!this.local.some(is.is))return this.local;let n=[];for(let r=0;r<this.local.length;r++)this.local[r].type instanceof is||n.push(this.local[r]);return n}forEachSet(t){t(this)}}Ht.empty=new Ht([],[]);Ht.removeOverlap=nO;const qn=Ht.empty;class iu{constructor(t){this.members=t}map(t,n){const r=this.members.map(i=>i.map(t,n,mu));return iu.from(r)}forChild(t,n){if(n.isLeaf)return Ht.empty;let r=[];for(let i=0;i<this.members.length;i++){let o=this.members[i].forChild(t,n);o!=qn&&(o instanceof iu?r=r.concat(o.members):r.push(o))}return iu.from(r)}eq(t){if(!(t instanceof iu)||t.members.length!=this.members.length)return!1;for(let n=0;n<this.members.length;n++)if(!this.members[n].eq(t.members[n]))return!1;return!0}locals(t){let n,r=!0;for(let i=0;i<this.members.length;i++){let o=this.members[i].localsInner(t);if(o.length)if(!n)n=o;else{r&&(n=n.slice(),r=!1);for(let a=0;a<o.length;a++)n.push(o[a])}}return n?nO(r?n:n.sort(gu)):ul}static from(t){switch(t.length){case 0:return qn;case 1:return t[0];default:return new iu(t.every(n=>n instanceof Ht)?t:t.reduce((n,r)=>n.concat(r instanceof Ht?r:r.members),[]))}}forEachSet(t){for(let n=0;n<this.members.length;n++)this.members[n].forEachSet(t)}}function RFe(e,t,n,r,i,o,a){let s=e.slice();for(let c=0,l=o;c<n.maps.length;c++){let d=0;n.maps[c].forEach((p,A,m,v)=>{let _=v-m-(A-p);for(let C=0;C<s.length;C+=3){let I=s[C+1];if(I<0||p>I+l-d)continue;let x=s[C]+l-d;A>=x?s[C+1]=p<=x?-2:-1:p>=l&&_&&(s[C]+=_,s[C+1]+=_)}d+=_}),l=n.maps[c].map(l,-1)}let u=!1;for(let c=0;c<s.length;c+=3)if(s[c+1]<0){if(s[c+1]==-2){u=!0,s[c+1]=-1;continue}let l=n.map(e[c]+o),d=l-i;if(d<0||d>=r.content.size){u=!0;continue}let p=n.map(e[c+1]+o,-1),A=p-i,{index:m,offset:v}=r.content.findIndex(d),_=r.maybeChild(m);if(_&&v==d&&v+_.nodeSize==A){let C=s[c+2].mapInner(n,_,l+1,e[c]+o+1,a);C!=qn?(s[c]=d,s[c+1]=A,s[c+2]=C):(s[c+1]=-2,u=!0)}else u=!0}if(u){let c=OFe(s,e,t,n,i,o,a),l=Xm(c,r,0,a);t=l.local;for(let d=0;d<s.length;d+=3)s[d+1]<0&&(s.splice(d,3),d-=3);for(let d=0,p=0;d<l.children.length;d+=3){let A=l.children[d];for(;p<s.length&&s[p]<A;)p+=3;s.splice(p,0,l.children[d],l.children[d+1],l.children[d+2])}}return new Ht(t.sort(gu),s)}function iV(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 wi(i.from+t,i.to+t,i.type))}return n}function OFe(e,t,n,r,i,o,a){function s(u,c){for(let l=0;l<u.local.length;l++){let d=u.local[l].map(r,i,c);d?n.push(d):a.onRemove&&a.onRemove(u.local[l].spec)}for(let l=0;l<u.children.length;l+=3)s(u.children[l+2],u.children[l]+c+1)}for(let u=0;u<e.length;u+=3)e[u+1]==-1&&s(e[u+2],t[u]+o+1);return n}function oV(e,t,n){if(t.isLeaf)return null;let r=n+t.nodeSize,i=null;for(let o=0,a;o<e.length;o++)(a=e[o])&&a.from>n&&a.to<r&&((i||(i=[])).push(a),e[o]=null);return i}function aV(e){let t=[];for(let n=0;n<e.length;n++)e[n]!=null&&t.push(e[n]);return t}function Xm(e,t,n,r){let i=[],o=!1;t.forEach((s,u)=>{let c=oV(e,s,u+n);if(c){o=!0;let l=Xm(c,s,n+u+1,r);l!=qn&&i.push(u,u+s.nodeSize,l)}});let a=iV(o?aV(e):e,-n).sort(gu);for(let s=0;s<a.length;s++)a[s].type.valid(t,a[s])||(r.onRemove&&r.onRemove(a[s].spec),a.splice(s--,1));return a.length||i.length?new Ht(a,i):qn}function gu(e,t){return e.from-t.from||e.to-t.to}function nO(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),Ok(t,i+1,o.copy(r.to,o.to)));continue}else{o.from<r.to&&(t==e&&(t=e.slice()),t[n]=r.copy(r.from,o.from),Ok(t,i,r.copy(o.from,r.to)));break}}}return t}function Ok(e,t,n){for(;t<e.length&&gu(n,e[t])>0;)t++;e.splice(t,0,n)}var As={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:"'"},eg={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},FFe=typeof navigator<"u"&&/Mac/.test(navigator.platform),kFe=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var mn=0;mn<10;mn++)As[48+mn]=As[96+mn]=String(mn);for(var mn=1;mn<=24;mn++)As[mn+111]="F"+mn;for(var mn=65;mn<=90;mn++)As[mn]=String.fromCharCode(mn+32),eg[mn]=String.fromCharCode(mn);for(var s1 in As)eg.hasOwnProperty(s1)||(eg[s1]=As[s1]);function MFe(e){var t=FFe&&e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey||kFe&&e.shiftKey&&e.key&&e.key.length==1||e.key=="Unidentified",n=!t&&e.key||(e.shiftKey?eg:As)[e.keyCode]||e.key||"Unidentified";return n=="Esc"&&(n="Escape"),n=="Del"&&(n="Delete"),n=="Left"&&(n="ArrowLeft"),n=="Up"&&(n="ArrowUp"),n=="Right"&&(n="ArrowRight"),n=="Down"&&(n="ArrowDown"),n}const LFe=typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!1;function jFe(e){let t=e.split(/-(?!$)/),n=t[t.length-1];n=="Space"&&(n=" ");let r,i,o,a;for(let s=0;s<t.length-1;s++){let u=t[s];if(/^(cmd|meta|m)$/i.test(u))a=!0;else if(/^a(lt)?$/i.test(u))r=!0;else if(/^(c|ctrl|control)$/i.test(u))i=!0;else if(/^s(hift)?$/i.test(u))o=!0;else if(/^mod$/i.test(u))LFe?a=!0:i=!0;else throw new Error("Unrecognized modifier name: "+u)}return r&&(n="Alt-"+n),i&&(n="Ctrl-"+n),a&&(n="Meta-"+n),o&&(n="Shift-"+n),n}function UFe(e){let t=Object.create(null);for(let n in e)t[jFe(n)]=e[n];return t}function u1(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}function BFe(e){return new zr({props:{handleKeyDown:PFe(e)}})}function PFe(e){let t=UFe(e);return function(n,r){let i=MFe(r),o,a=t[u1(i,r)];if(a&&a(n.state,n.dispatch,n))return!0;if(i.length==1&&i!=" "){if(r.shiftKey){let s=t[u1(i,r,!1)];if(s&&s(n.state,n.dispatch,n))return!0}if((r.shiftKey||r.altKey||r.metaKey||i.charCodeAt(0)>127)&&(o=As[r.keyCode])&&o!=i){let s=t[u1(o,r)];if(s&&s(n.state,n.dispatch,n))return!0}}return!1}}const sV=65535,uV=Math.pow(2,16);function WFe(e,t){return e+t*uV}function Fk(e){return e&sV}function DFe(e){return(e-(e&sV))/uV}const cV=1,lV=2,um=4,fV=8;class kk{constructor(t,n,r){this.pos=t,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&fV)>0}get deletedBefore(){return(this.delInfo&(cV|um))>0}get deletedAfter(){return(this.delInfo&(lV|um))>0}get deletedAcross(){return(this.delInfo&um)>0}}class $r{constructor(t,n=!1){if(this.ranges=t,this.inverted=n,!t.length&&$r.empty)return $r.empty}recover(t){let n=0,r=Fk(t);if(!this.inverted)for(let i=0;i<r;i++)n+=this.ranges[i*3+2]-this.ranges[i*3+1];return this.ranges[r*3]+n+DFe(t)}mapResult(t,n=1){return this._map(t,n,!1)}map(t,n=1){return this._map(t,n,!0)}_map(t,n,r){let i=0,o=this.inverted?2:1,a=this.inverted?1:2;for(let s=0;s<this.ranges.length;s+=3){let u=this.ranges[s]-(this.inverted?i:0);if(u>t)break;let c=this.ranges[s+o],l=this.ranges[s+a],d=u+c;if(t<=d){let p=c?t==u?-1:t==d?1:n:n,A=u+i+(p<0?0:l);if(r)return A;let m=t==(n<0?u:d)?null:WFe(s/3,t-u),v=t==u?lV:t==d?cV:um;return(n<0?t!=u:t!=d)&&(v|=fV),new kk(A,v,m)}i+=l-c}return r?t+i:new kk(t+i,0,null)}touches(t,n){let r=0,i=Fk(n),o=this.inverted?2:1,a=this.inverted?1:2;for(let s=0;s<this.ranges.length;s+=3){let u=this.ranges[s]-(this.inverted?r:0);if(u>t)break;let c=this.ranges[s+o],l=u+c;if(t<=l&&s==i*3)return!0;r+=this.ranges[s+a]-c}return!1}forEach(t){let n=this.inverted?2:1,r=this.inverted?1:2;for(let i=0,o=0;i<this.ranges.length;i+=3){let a=this.ranges[i],s=a-(this.inverted?o:0),u=a+(this.inverted?0:o),c=this.ranges[i+n],l=this.ranges[i+r];t(s,s+c,u,u+l),o+=l-c}}invert(){return new $r(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(t){return t==0?$r.empty:new $r(t<0?[0,-t,0]:[0,0,t])}}$r.empty=new $r([]);const c1=Object.create(null);class Wn{getMap(){return $r.empty}merge(t){return null}static fromJSON(t,n){if(!n||!n.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=c1[n.stepType];if(!r)throw new RangeError(`No step type ${n.stepType} defined`);return r.fromJSON(t,n)}static jsonID(t,n){if(t in c1)throw new RangeError("Duplicate use of step JSON ID "+t);return c1[t]=n,n.prototype.jsonID=t,n}}class Nt{constructor(t,n){this.doc=t,this.failed=n}static ok(t){return new Nt(t,null)}static fail(t){return new Nt(null,t)}static fromReplace(t,n,r,i){try{return Nt.ok(t.replace(n,r,i))}catch(o){if(o instanceof mp)return Nt.fail(o.message);throw o}}}function rO(e,t,n){let r=[];for(let i=0;i<e.childCount;i++){let o=e.child(i);o.content.size&&(o=o.copy(rO(o.content,t,o))),o.isInline&&(o=t(o,n,i)),r.push(o)}return X.fromArray(r)}class su extends Wn{constructor(t,n,r){super(),this.from=t,this.to=n,this.mark=r}apply(t){let n=t.slice(this.from,this.to),r=t.resolve(this.from),i=r.node(r.sharedDepth(this.to)),o=new ae(rO(n.content,(a,s)=>!a.isAtom||!s.type.allowsMarkType(this.mark.type)?a:a.mark(this.mark.addToSet(a.marks)),i),n.openStart,n.openEnd);return Nt.fromReplace(t,this.from,this.to,o)}invert(){return new uu(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 su(n.pos,r.pos,this.mark)}merge(t){return t instanceof su&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new su(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new su(n.from,n.to,t.markFromJSON(n.mark))}}Wn.jsonID("addMark",su);class uu extends Wn{constructor(t,n,r){super(),this.from=t,this.to=n,this.mark=r}apply(t){let n=t.slice(this.from,this.to),r=new ae(rO(n.content,i=>i.mark(this.mark.removeFromSet(i.marks)),t),n.openStart,n.openEnd);return Nt.fromReplace(t,this.from,this.to,r)}invert(){return new su(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 uu(n.pos,r.pos,this.mark)}merge(t){return t instanceof uu&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new uu(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new uu(n.from,n.to,t.markFromJSON(n.mark))}}Wn.jsonID("removeMark",uu);class cu extends Wn{constructor(t,n){super(),this.pos=t,this.mark=n}apply(t){let n=t.nodeAt(this.pos);if(!n)return Nt.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return Nt.fromReplace(t,this.pos,this.pos+1,new ae(X.from(r),0,n.isLeaf?0:1))}invert(t){let n=t.nodeAt(this.pos);if(n){let r=this.mark.addToSet(n.marks);if(r.length==n.marks.length){for(let i=0;i<n.marks.length;i++)if(!n.marks[i].isInSet(r))return new cu(this.pos,n.marks[i]);return new cu(this.pos,this.mark)}}return new Cp(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new cu(n.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new cu(n.pos,t.markFromJSON(n.mark))}}Wn.jsonID("addNodeMark",cu);class Cp extends Wn{constructor(t,n){super(),this.pos=t,this.mark=n}apply(t){let n=t.nodeAt(this.pos);if(!n)return Nt.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.removeFromSet(n.marks));return Nt.fromReplace(t,this.pos,this.pos+1,new ae(X.from(r),0,n.isLeaf?0:1))}invert(t){let n=t.nodeAt(this.pos);return!n||!this.mark.isInSet(n.marks)?this:new cu(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new Cp(n.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new Cp(n.pos,t.markFromJSON(n.mark))}}Wn.jsonID("removeNodeMark",Cp);class zo extends Wn{constructor(t,n,r,i=!1){super(),this.from=t,this.to=n,this.slice=r,this.structure=i}apply(t){return this.structure&&xC(t,this.from,this.to)?Nt.fail("Structure replace would overwrite content"):Nt.fromReplace(t,this.from,this.to,this.slice)}getMap(){return new $r([this.from,this.to-this.from,this.slice.size])}invert(t){return new zo(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 zo(n.pos,Math.max(n.pos,r.pos),this.slice)}merge(t){if(!(t instanceof zo)||t.structure||this.structure)return null;if(this.from+this.slice.size==t.from&&!this.slice.openEnd&&!t.slice.openStart){let n=this.slice.size+t.slice.size==0?ae.empty:new ae(this.slice.content.append(t.slice.content),this.slice.openStart,t.slice.openEnd);return new zo(this.from,this.to+(t.to-t.from),n,this.structure)}else if(t.to==this.from&&!this.slice.openStart&&!t.slice.openEnd){let n=this.slice.size+t.slice.size==0?ae.empty:new ae(t.slice.content.append(this.slice.content),t.slice.openStart,this.slice.openEnd);return new zo(t.from,this.to,n,this.structure)}else return null}toJSON(){let t={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new zo(n.from,n.to,ae.fromJSON(t,n.slice),!!n.structure)}}Wn.jsonID("replace",zo);class gl extends Wn{constructor(t,n,r,i,o,a,s=!1){super(),this.from=t,this.to=n,this.gapFrom=r,this.gapTo=i,this.slice=o,this.insert=a,this.structure=s}apply(t){if(this.structure&&(xC(t,this.from,this.gapFrom)||xC(t,this.gapTo,this.to)))return Nt.fail("Structure gap-replace would overwrite content");let n=t.slice(this.gapFrom,this.gapTo);if(n.openStart||n.openEnd)return Nt.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,n.content);return r?Nt.fromReplace(t,this.from,this.to,r):Nt.fail("Content does not fit in gap")}getMap(){return new $r([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 gl(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,t.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1),i=this.from==this.gapFrom?n.pos:t.map(this.gapFrom,-1),o=this.to==this.gapTo?r.pos:t.map(this.gapTo,1);return n.deletedAcross&&r.deletedAcross||i<n.pos||o>r.pos?null:new gl(n.pos,r.pos,i,o,this.slice,this.insert,this.structure)}toJSON(){let t={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number"||typeof n.gapFrom!="number"||typeof n.gapTo!="number"||typeof n.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new gl(n.from,n.to,n.gapFrom,n.gapTo,ae.fromJSON(t,n.slice),n.insert,!!n.structure)}}Wn.jsonID("replaceAround",gl);function xC(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 a=r.node(o).maybeChild(r.indexAfter(o));for(;i>0;){if(!a||a.isLeaf)return!0;a=a.firstChild,i--}}return!1}function KFe(e,t,n){return(t==0||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function NFe(e){let n=e.parent.content.cutByIndex(e.startIndex,e.endIndex);for(let r=e.depth;;--r){let i=e.$from.node(r),o=e.$from.index(r),a=e.$to.indexAfter(r);if(r<e.depth&&i.canReplace(o,a,n))return r;if(r==0||i.type.spec.isolating||!KFe(i,o,a))break}return null}function qFe(e,t,n=null,r=e){let i=VFe(e,t),o=i&&QFe(r,t);return o?i.map(Mk).concat({type:t,attrs:n}).concat(o.map(Mk)):null}function Mk(e){return{type:e,attrs:null}}function VFe(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}function QFe(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 c=r;u&&c<i;c++)u=u.matchType(n.child(c).type);return!u||!u.validEnd?null:a}function cm(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 c=i.depth-1,l=n-2;c>o;c--,l--){let d=i.node(c),p=i.index(c);if(d.type.spec.isolating)return!1;let A=d.content.cutByIndex(p,d.childCount),m=r&&r[l+1];m&&(A=A.replaceChild(0,m.type.create(m.attrs)));let v=r&&r[l]||d;if(!d.canReplace(p+1,d.childCount)||!v.type.validContent(A))return!1}let s=i.indexAfter(o),u=r&&r[0];return i.node(o).canReplaceWith(s,s,u?u.type:i.node(o+1).type)}function iO(e,t){let n=e.resolve(t),r=n.index();return dV(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function dV(e,t){return!!(e&&t&&!e.isLeaf&&e.canAppend(t))}function pV(e,t,n=-1){let r=e.resolve(t);for(let i=r.depth;;i--){let o,a,s=r.index(i);if(i==r.depth?(o=r.nodeBefore,a=r.nodeAfter):n>0?(o=r.node(i+1),s++,a=r.node(i).maybeChild(s)):(o=r.node(i).maybeChild(s-1),a=r.node(i+1)),o&&!o.isTextblock&&dV(o,a)&&r.node(i).canReplace(s,s+1))return t;if(i==0)break;t=n<0?r.before(i):r.after(i)}}class Ld extends Wn{constructor(t,n,r){super(),this.pos=t,this.attr=n,this.value=r}apply(t){let n=t.nodeAt(this.pos);if(!n)return Nt.fail("No node at attribute step's position");let r=Object.create(null);for(let o in n.attrs)r[o]=n.attrs[o];r[this.attr]=this.value;let i=n.type.create(r,null,n.marks);return Nt.fromReplace(t,this.pos,this.pos+1,new ae(X.from(i),0,n.isLeaf?0:1))}getMap(){return $r.empty}invert(t){return new Ld(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 Ld(n.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(t,n){if(typeof n.pos!="number"||typeof n.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new Ld(n.pos,n.attr,n.value)}}Wn.jsonID("attr",Ld);class tg extends Wn{constructor(t,n){super(),this.attr=t,this.value=n}apply(t){let n=Object.create(null);for(let i in t.attrs)n[i]=t.attrs[i];n[this.attr]=this.value;let r=t.type.create(n,t.content,t.marks);return Nt.ok(r)}getMap(){return $r.empty}invert(t){return new tg(this.attr,t.attrs[this.attr])}map(t){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(t,n){if(typeof n.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new tg(n.attr,n.value)}}Wn.jsonID("docAttr",tg);let Sp=class extends Error{};Sp=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n};Sp.prototype=Object.create(Error.prototype);Sp.prototype.constructor=Sp;Sp.prototype.name="TransformError";const zFe=(e,t)=>e.selection.empty?!1:(t&&t(e.tr.deleteSelection().scrollIntoView()),!0);function AV(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock("backward",e):n.parentOffset>0)?null:n}const HFe=(e,t,n)=>{let r=AV(e,n);if(!r)return!1;let i=oO(r);if(!i){let a=r.blockRange(),s=a&&xh(a);return s==null?!1:(t&&t(e.tr.lift(a,s).scrollIntoView()),!0)}let o=i.nodeBefore;if(!o.type.spec.isolating&&vV(e,i,t))return!0;if(r.parent.content.size==0&&(Bl(o,"end")||ve.isSelectable(o))){let a=HR(e.doc,r.before(),r.after(),ae.empty);if(a&&a.slice.size<a.to-a.from){if(t){let s=e.tr.step(a);s.setSelection(Bl(o,"end")?ze.findFrom(s.doc.resolve(s.mapping.map(i.pos,-1)),-1):ve.create(s.doc,i.pos-o.nodeSize)),t(s.scrollIntoView())}return!0}}return o.isAtom&&i.depth==r.depth-1?(t&&t(e.tr.delete(i.pos-o.nodeSize,i.pos).scrollIntoView()),!0):!1},YFe=(e,t,n)=>{let r=AV(e,n);if(!r)return!1;let i=oO(r);return i?hV(e,i,t):!1},GFe=(e,t,n)=>{let r=mV(e,n);if(!r)return!1;let i=aO(r);return i?hV(e,i,t):!1};function hV(e,t,n){let r=t.nodeBefore,i=r,o=t.pos-1;for(;!i.isTextblock;o--){if(i.type.spec.isolating)return!1;let l=i.lastChild;if(!l)return!1;i=l}let a=t.nodeAfter,s=a,u=t.pos+1;for(;!s.isTextblock;u++){if(s.type.spec.isolating)return!1;let l=s.firstChild;if(!l)return!1;s=l}let c=HR(e.doc,o,u,ae.empty);if(!c||c.from!=o||c instanceof Th&&c.slice.size>=u-o)return!1;if(n){let l=e.tr.step(c);l.setSelection(Be.create(l.doc,o)),n(l.scrollIntoView())}return!0}function Bl(e,t,n=!1){for(let r=e;r;r=t=="start"?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&r.childCount!=1)return!1}return!1}const JFe=(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=oO(r)}let a=o&&o.nodeBefore;return!a||!ve.isSelectable(a)?!1:(t&&t(e.tr.setSelection(ve.create(e.doc,o.pos-a.nodeSize)).scrollIntoView()),!0)};function oO(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 mV(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock("forward",e):n.parentOffset<n.parent.content.size)?null:n}const ZFe=(e,t,n)=>{let r=mV(e,n);if(!r)return!1;let i=aO(r);if(!i)return!1;let o=i.nodeAfter;if(vV(e,i,t))return!0;if(r.parent.content.size==0&&(Bl(o,"start")||ve.isSelectable(o))){let a=HR(e.doc,r.before(),r.after(),ae.empty);if(a&&a.slice.size<a.to-a.from){if(t){let s=e.tr.step(a);s.setSelection(Bl(o,"start")?ze.findFrom(s.doc.resolve(s.mapping.map(i.pos)),1):ve.create(s.doc,s.mapping.map(i.pos))),t(s.scrollIntoView())}return!0}}return o.isAtom&&i.depth==r.depth-1?(t&&t(e.tr.delete(i.pos,i.pos+o.nodeSize).scrollIntoView()),!0):!1},XFe=(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=aO(r)}let a=o&&o.nodeAfter;return!a||!ve.isSelectable(a)?!1:(t&&t(e.tr.setSelection(ve.create(e.doc,o.pos)).scrollIntoView()),!0)};function aO(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}const eke=(e,t)=>{let n=e.selection,r=n instanceof ve,i;if(r){if(n.node.isTextblock||!wh(e.doc,n.from))return!1;i=n.from}else if(i=F8(e.doc,n.from,-1),i==null)return!1;if(t){let o=e.tr.join(i);r&&o.setSelection(ve.create(o.doc,i-e.doc.resolve(i).nodeBefore.nodeSize)),t(o.scrollIntoView())}return!0},tke=(e,t)=>{let n=e.selection,r;if(n instanceof ve){if(n.node.isTextblock||!wh(e.doc,n.to))return!1;r=n.to}else if(r=F8(e.doc,n.to,1),r==null)return!1;return t&&t(e.tr.join(r).scrollIntoView()),!0},nke=(e,t)=>{let{$from:n,$to:r}=e.selection,i=n.blockRange(r),o=i&&xh(i);return o==null?!1:(t&&t(e.tr.lift(i,o).scrollIntoView()),!0)},rke=(e,t)=>{let{$head:n,$anchor:r}=e.selection;return!n.parent.type.spec.code||!n.sameParent(r)?!1:(t&&t(e.tr.insertText(`
44
+ `).scrollIntoView()),!0)};function gV(e){for(let t=0;t<e.edgeCount;t++){let{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}const ike=(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=gV(i.contentMatchAt(o));if(!a||!i.canReplaceWith(o,o,a))return!1;if(t){let s=n.after(),u=e.tr.replaceWith(s,s,a.createAndFill());u.setSelection(ze.near(u.doc.resolve(s),1)),t(u.scrollIntoView())}return!0},oke=(e,t)=>{let n=e.selection,{$from:r,$to:i}=n;if(n instanceof Ri||r.parent.inlineContent||i.parent.inlineContent)return!1;let o=gV(i.parent.contentMatchAt(i.indexAfter()));if(!o||!o.isTextblock)return!1;if(t){let a=(!r.parentOffset&&i.index()<i.parent.childCount?r:i).pos,s=e.tr.insert(a,o.createAndFill());s.setSelection(Be.create(s.doc,a+1)),t(s.scrollIntoView())}return!0},ake=(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 o=n.before();if(R8(e.doc,o))return t&&t(e.tr.split(o).scrollIntoView()),!0}let r=n.blockRange(),i=r&&xh(r);return i==null?!1:(t&&t(e.tr.lift(r,i).scrollIntoView()),!0)},ske=(e,t)=>{let{$from:n,to:r}=e.selection,i,o=n.sharedDepth(r);return o==0?!1:(i=n.before(o),t&&t(e.tr.setSelection(ve.create(e.doc,i))),!0)};function uke(e,t,n){let r=t.nodeBefore,i=t.nodeAfter,o=t.index();return!r||!i||!r.type.compatibleContent(i.type)?!1:!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||wh(e.doc,t.pos))?!1:(n&&n(e.tr.clearIncompatible(t.pos,r.type,r.contentMatchAt(r.childCount)).join(t.pos).scrollIntoView()),!0)}function vV(e,t,n){let r=t.nodeBefore,i=t.nodeAfter,o,a;if(r.type.spec.isolating||i.type.spec.isolating)return!1;if(uke(e,t,n))return!0;let s=t.parent.canReplace(t.index(),t.index()+1);if(s&&(o=(a=r.contentMatchAt(r.childCount)).findWrapping(i.type))&&a.matchType(o[0]||i.type).validEnd){if(n){let d=t.pos+i.nodeSize,p=X.empty;for(let v=o.length-1;v>=0;v--)p=X.from(o[v].create(null,p));p=X.from(r.copy(p));let A=e.tr.step(new aa(t.pos-1,d,t.pos,d,new ae(p,1,0),o.length,!0)),m=d+2*o.length;wh(A.doc,m)&&A.join(m),n(A.scrollIntoView())}return!0}let u=ze.findFrom(t,1),c=u&&u.$from.blockRange(u.$to),l=c&&xh(c);if(l!=null&&l>=t.depth)return n&&n(e.tr.lift(c,l).scrollIntoView()),!0;if(s&&Bl(i,"start",!0)&&Bl(r,"end")){let d=r,p=[];for(;p.push(d),!d.isTextblock;)d=d.lastChild;let A=i,m=1;for(;!A.isTextblock;A=A.firstChild)m++;if(d.canReplace(d.childCount,d.childCount,A.content)){if(n){let v=X.empty;for(let C=p.length-1;C>=0;C--)v=X.from(p[C].copy(v));let _=e.tr.step(new aa(t.pos-p.length,t.pos+i.nodeSize,t.pos+m,t.pos+i.nodeSize-m,new ae(v,p.length,0),0,!0));n(_.scrollIntoView())}return!0}}return!1}function yV(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(Be.create(t.doc,e<0?i.start(o):i.end(o)))),!0):!1}}const cke=yV(-1),lke=yV(1);function fke(e,t=null){return function(n,r){let{$from:i,$to:o}=n.selection,a=i.blockRange(o),s=a&&$8(a,e,t);return s?(r&&r(n.tr.wrap(a,s).scrollIntoView()),!0):!1}}function Lk(e,t=null){return function(n,r){let i=!1;for(let o=0;o<n.selection.ranges.length&&!i;o++){let{$from:{pos:a},$to:{pos:s}}=n.selection.ranges[o];n.doc.nodesBetween(a,s,(u,c)=>{if(i)return!1;if(!(!u.isTextblock||u.hasMarkup(e,t)))if(u.type==e)i=!0;else{let l=n.doc.resolve(c),d=l.index();i=l.parent.canReplaceWith(d,d+1,e)}})}if(!i)return!1;if(r){let o=n.tr;for(let a=0;a<n.selection.ranges.length;a++){let{$from:{pos:s},$to:{pos:u}}=n.selection.ranges[a];o.setBlockType(s,u,e,t)}r(o.scrollIntoView())}return!0}}typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform&&os.platform()=="darwin";function dke(e,t=null){return function(n,r){let{$from:i,$to:o}=n.selection,a=i.blockRange(o),s=!1,u=a;if(!a)return!1;if(a.depth>=2&&i.node(a.depth-1).type.compatibleContent(e)&&a.startIndex==0){if(i.index(a.depth-1)==0)return!1;let l=n.doc.resolve(a.start-2);u=new Vm(l,l,a.depth),a.endIndex<a.parent.childCount&&(a=new Vm(i,n.doc.resolve(o.end(a.depth)),a.depth)),s=!0}let c=$8(u,e,t,a);return c?(r&&r(pke(n.tr,a,c,s,e).scrollIntoView()),!0):!1}}function pke(e,t,n,r,i){let o=X.empty;for(let l=n.length-1;l>=0;l--)o=X.from(n[l].type.create(n[l].attrs,o));e.step(new aa(t.start-(r?2:0),t.end,t.start,t.end,new ae(o,0,0),n.length,!0));let a=0;for(let l=0;l<n.length;l++)n[l].type==i&&(a=l+1);let s=n.length-a,u=t.start+n.length-(r?2:0),c=t.parent;for(let l=t.startIndex,d=t.endIndex,p=!0;l<d;l++,p=!1)!p&&R8(e.doc,u,s)&&(e.split(u,s),u+=2*s),u+=c.child(l).nodeSize;return e}function Ake(e){return function(t,n){let{$from:r,$to:i}=t.selection,o=r.blockRange(i,a=>a.childCount>0&&a.firstChild.type==e);return o?n?r.node(o.depth-1).type==e?hke(t,n,e,o):mke(t,n,o):!0:!1}}function hke(e,t,n,r){let i=e.tr,o=r.end,a=r.$to.end(r.depth);o<a&&(i.step(new aa(o-1,a,o,a,new ae(X.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new Vm(i.doc.resolve(r.$from.pos),i.doc.resolve(a),r.depth));const s=xh(r);if(s==null)return!1;i.lift(r,s);let u=i.mapping.map(o,-1)-1;return wh(i.doc,u)&&i.join(u),t(i.scrollIntoView()),!0}function mke(e,t,n){let r=e.tr,i=n.parent;for(let A=n.end,m=n.endIndex-1,v=n.startIndex;m>v;m--)A-=i.child(m).nodeSize,r.delete(A-1,A+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 s=n.startIndex==0,u=n.endIndex==i.childCount,c=o.node(-1),l=o.index(-1);if(!c.canReplace(l+(s?0:1),l+1,a.content.append(u?X.empty:X.from(i))))return!1;let d=o.pos,p=d+a.nodeSize;return r.step(new aa(d-(s?1:0),p+(u?1:0),d+1,p-1,new ae((s?X.empty:X.from(i.copy(X.empty))).append(u?X.empty:X.from(i.copy(X.empty))),s?0:1,u?0:1),s?0:1)),t(r.scrollIntoView()),!0}function gke(e){return function(t,n){let{$from:r,$to:i}=t.selection,o=r.blockRange(i,c=>c.childCount>0&&c.firstChild.type==e);if(!o)return!1;let a=o.startIndex;if(a==0)return!1;let s=o.parent,u=s.child(a-1);if(u.type!=e)return!1;if(n){let c=u.lastChild&&u.lastChild.type==s.type,l=X.from(c?e.create():null),d=new ae(X.from(e.create(null,X.from(s.type.create(null,l)))),c?3:1,0),p=o.start,A=o.end;n(t.tr.step(new aa(p-(c?3:1),A,p,A,d,1,!0)).scrollIntoView())}return!0}}function J0(e){const{state:t,transaction:n}=e;let{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}}}class sO{constructor(t){this.editor=t.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=t.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:t,editor:n,state:r}=this,{view:i}=n,{tr:o}=r,a=this.buildProps(o);return Object.fromEntries(Object.entries(t).map(([s,u])=>[s,(...l)=>{const d=u(...l)(a);return!o.getMeta("preventDispatch")&&!this.hasCustomState&&i.dispatch(o),d}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(t,n=!0){const{rawCommands:r,editor:i,state:o}=this,{view:a}=i,s=[],u=!!t,c=t||o.tr,l=()=>(!u&&n&&!c.getMeta("preventDispatch")&&!this.hasCustomState&&a.dispatch(c),s.every(p=>p===!0)),d={...Object.fromEntries(Object.entries(r).map(([p,A])=>[p,(...v)=>{const _=this.buildProps(c,n),C=A(...v)(_);return s.push(C),d}])),run:l};return d}createCan(t){const{rawCommands:n,state:r}=this,i=!1,o=t||r.tr,a=this.buildProps(o,i);return{...Object.fromEntries(Object.entries(n).map(([u,c])=>[u,(...l)=>c(...l)({...a,dispatch:void 0})])),chain:()=>this.createChain(o,i)}}buildProps(t,n=!0){const{rawCommands:r,editor:i,state:o}=this,{view:a}=i,s={tr:t,editor:i,view:a,state:J0({state:o,transaction:t}),dispatch:n?()=>{}:void 0,chain:()=>this.createChain(t,n),can:()=>this.createCan(t),get commands(){return Object.fromEntries(Object.entries(r).map(([u,c])=>[u,(...l)=>c(...l)(s)]))}};return s}}function ce(e,t,n){return e.config[t]===void 0&&e.parent?ce(e.parent,t,n):typeof e.config[t]=="function"?e.config[t].bind({...n,parent:e.parent?ce(e.parent,t,n):null}):e.config[t]}function Z0(e){const t=e.filter(i=>i.type==="extension"),n=e.filter(i=>i.type==="node"),r=e.filter(i=>i.type==="mark");return{baseExtensions:t,nodeExtensions:n,markExtensions:r}}function bV(e){const t=[],{nodeExtensions:n,markExtensions:r}=Z0(e),i=[...n,...r],o={default:null,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return e.forEach(a=>{const s={name:a.name,options:a.options,storage:a.storage,extensions:i},u=ce(a,"addGlobalAttributes",s);if(!u)return;u().forEach(l=>{l.types.forEach(d=>{Object.entries(l.attributes).forEach(([p,A])=>{t.push({type:d,name:p,attribute:{...o,...A}})})})})}),i.forEach(a=>{const s={name:a.name,options:a.options,storage:a.storage},u=ce(a,"addAttributes",s);if(!u)return;const c=u();Object.entries(c).forEach(([l,d])=>{const p={...o,...d};typeof(p==null?void 0:p.default)=="function"&&(p.default=p.default()),p!=null&&p.isRequired&&(p==null?void 0:p.default)===void 0&&delete p.default,t.push({type:a.name,name:l,attribute:p})})}),t}function Cn(e,t){if(typeof e=="string"){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 Et(...e){return e.filter(t=>!!t).reduce((t,n)=>{const r={...t};return Object.entries(n).forEach(([i,o])=>{if(!r[i]){r[i]=o;return}if(i==="class"){const s=o?o.split(" "):[],u=r[i]?r[i].split(" "):[],c=s.filter(l=>!u.includes(l));r[i]=[...u,...c].join(" ")}else i==="style"?r[i]=[r[i],o].join("; "):r[i]=o}),r},{})}function wC(e,t){return t.filter(n=>n.attribute.rendered).map(n=>n.attribute.renderHTML?n.attribute.renderHTML(e.attrs)||{}:{[n.name]:e.attrs[n.name]}).reduce((n,r)=>Et(n,r),{})}function vke(e){return typeof e=="function"}function Ue(e,t=void 0,...n){return vke(e)?t?e.bind(t)(...n):e(...n):e}function yke(e={}){return Object.keys(e).length===0&&e.constructor===Object}function bke(e){return typeof e!="string"?e:e.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(e):e==="true"?!0:e==="false"?!1:e}function jk(e,t){return"style"in e?e:{...e,getAttrs:n=>{const r=e.getAttrs?e.getAttrs(n):e.attrs;if(r===!1)return!1;const i=t.reduce((o,a)=>{const s=a.attribute.parseHTML?a.attribute.parseHTML(n):bke(n.getAttribute(a.name));return s==null?o:{...o,[a.name]:s}},{});return{...r,...i}}}}function Uk(e){return Object.fromEntries(Object.entries(e).filter(([t,n])=>t==="attrs"&&yke(n)?!1:n!=null))}function CV(e,t){var n;const r=bV(e),{nodeExtensions:i,markExtensions:o}=Z0(e),a=(n=i.find(c=>ce(c,"topNode")))===null||n===void 0?void 0:n.name,s=Object.fromEntries(i.map(c=>{const l=r.filter(C=>C.type===c.name),d={name:c.name,options:c.options,storage:c.storage,editor:t},p=e.reduce((C,I)=>{const x=ce(I,"extendNodeSchema",d);return{...C,...x?x(c):{}}},{}),A=Uk({...p,content:Ue(ce(c,"content",d)),marks:Ue(ce(c,"marks",d)),group:Ue(ce(c,"group",d)),inline:Ue(ce(c,"inline",d)),atom:Ue(ce(c,"atom",d)),selectable:Ue(ce(c,"selectable",d)),draggable:Ue(ce(c,"draggable",d)),code:Ue(ce(c,"code",d)),whitespace:Ue(ce(c,"whitespace",d)),defining:Ue(ce(c,"defining",d)),isolating:Ue(ce(c,"isolating",d)),attrs:Object.fromEntries(l.map(C=>{var I;return[C.name,{default:(I=C==null?void 0:C.attribute)===null||I===void 0?void 0:I.default}]}))}),m=Ue(ce(c,"parseHTML",d));m&&(A.parseDOM=m.map(C=>jk(C,l)));const v=ce(c,"renderHTML",d);v&&(A.toDOM=C=>v({node:C,HTMLAttributes:wC(C,l)}));const _=ce(c,"renderText",d);return _&&(A.toText=_),[c.name,A]})),u=Object.fromEntries(o.map(c=>{const l=r.filter(_=>_.type===c.name),d={name:c.name,options:c.options,storage:c.storage,editor:t},p=e.reduce((_,C)=>{const I=ce(C,"extendMarkSchema",d);return{..._,...I?I(c):{}}},{}),A=Uk({...p,inclusive:Ue(ce(c,"inclusive",d)),excludes:Ue(ce(c,"excludes",d)),group:Ue(ce(c,"group",d)),spanning:Ue(ce(c,"spanning",d)),code:Ue(ce(c,"code",d)),attrs:Object.fromEntries(l.map(_=>{var C;return[_.name,{default:(C=_==null?void 0:_.attribute)===null||C===void 0?void 0:C.default}]}))}),m=Ue(ce(c,"parseHTML",d));m&&(A.parseDOM=m.map(_=>jk(_,l)));const v=ce(c,"renderHTML",d);return v&&(A.toDOM=_=>v({mark:_,HTMLAttributes:wC(_,l)})),[c.name,A]}));return new g8({topNode:a,nodes:s,marks:u})}function l1(e,t){return t.nodes[e]||t.marks[e]||null}function Bk(e,t){return Array.isArray(t)?t.some(n=>(typeof n=="string"?n:n.name)===e.name):t}const Cke=(e,t=500)=>{let n="";const r=e.parentOffset;return e.parent.nodesBetween(Math.max(0,r-t),r,(i,o,a,s)=>{var u,c;const l=((c=(u=i.type.spec).toText)===null||c===void 0?void 0:c.call(u,{node:i,pos:o,parent:a,index:s}))||i.textContent||"%leaf%";n+=i.isAtom&&!i.isText?l:l.slice(0,Math.max(0,r-o))}),n};function uO(e){return Object.prototype.toString.call(e)==="[object RegExp]"}class cO{constructor(t){this.find=t.find,this.handler=t.handler}}const Ske=(e,t)=>{if(uO(t))return t.exec(e);const n=t(e);if(!n)return null;const 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 Yh(e){var t;const{editor:n,from:r,to:i,text:o,rules:a,plugin:s}=e,{view:u}=n;if(u.composing)return!1;const c=u.state.doc.resolve(r);if(c.parent.type.spec.code||!((t=c.nodeBefore||c.nodeAfter)===null||t===void 0)&&t.marks.find(p=>p.type.spec.code))return!1;let l=!1;const d=Cke(c)+o;return a.forEach(p=>{if(l)return;const A=Ske(d,p.find);if(!A)return;const m=u.state.tr,v=J0({state:u.state,transaction:m}),_={from:r-(A[0].length-o.length),to:i},{commands:C,chain:I,can:x}=new sO({editor:n,state:v});p.handler({state:v,range:_,match:A,commands:C,chain:I,can:x})===null||!m.steps.length||(m.setMeta(s,{transform:m,from:r,to:i,text:o}),u.dispatch(m),l=!0)}),l}function _ke(e){const{editor:t,rules:n}=e,r=new zr({state:{init(){return null},apply(i,o){const a=i.getMeta(r);if(a)return a;const s=i.getMeta("applyInputRules");return!!s&&setTimeout(()=>{const{from:c,text:l}=s,d=c+l.length;Yh({editor:t,from:c,to:d,text:l,rules:n,plugin:r})}),i.selectionSet||i.docChanged?null:o}},props:{handleTextInput(i,o,a,s){return Yh({editor:t,from:o,to:a,text:s,rules:n,plugin:r})},handleDOMEvents:{compositionend:i=>(setTimeout(()=>{const{$cursor:o}=i.state.selection;o&&Yh({editor:t,from:o.pos,to:o.pos,text:"",rules:n,plugin:r})}),!1)},handleKeyDown(i,o){if(o.key!=="Enter")return!1;const{$cursor:a}=i.state.selection;return a?Yh({editor:t,from:a.pos,to:a.pos,text:`
45
+ `,rules:n,plugin:r}):!1}},isInputRules:!0});return r}function Ike(e){return typeof e=="number"}class Tke{constructor(t){this.find=t.find,this.handler=t.handler}}const xke=(e,t,n)=>{if(uO(t))return[...e.matchAll(t)];const r=t(e,n);return r?r.map(i=>{const o=[i.text];return o.index=i.index,o.input=e,o.data=i.data,i.replaceWith&&(i.text.includes(i.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),o.push(i.replaceWith)),o}):[]};function wke(e){const{editor:t,state:n,from:r,to:i,rule:o,pasteEvent:a,dropEvent:s}=e,{commands:u,chain:c,can:l}=new sO({editor:t,state:n}),d=[];return n.doc.nodesBetween(r,i,(A,m)=>{if(!A.isTextblock||A.type.spec.code)return;const v=Math.max(r,m),_=Math.min(i,m+A.content.size),C=A.textBetween(v-m,_-m,void 0,"");xke(C,o.find,a).forEach(x=>{if(x.index===void 0)return;const g=v+x.index+1,S=g+x[0].length,y={from:n.tr.mapping.map(g),to:n.tr.mapping.map(S)},T=o.handler({state:n,range:y,match:x,commands:u,chain:c,can:l,pasteEvent:a,dropEvent:s});d.push(T)})}),d.every(A=>A!==null)}const Eke=e=>{var t;const n=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return(t=n.clipboardData)===null||t===void 0||t.setData("text/html",e),n};function $ke(e){const{editor:t,rules:n}=e;let r=null,i=!1,o=!1,a=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,s=typeof DragEvent<"u"?new DragEvent("drop"):null;const u=({state:l,from:d,to:p,rule:A,pasteEvt:m})=>{const v=l.tr,_=J0({state:l,transaction:v});if(!(!wke({editor:t,state:_,from:Math.max(d-1,0),to:p.b-1,rule:A,pasteEvent:m,dropEvent:s})||!v.steps.length))return s=typeof DragEvent<"u"?new DragEvent("drop"):null,a=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,v};return n.map(l=>new zr({view(d){const p=A=>{var m;r=!((m=d.dom.parentElement)===null||m===void 0)&&m.contains(A.target)?d.dom.parentElement:null};return window.addEventListener("dragstart",p),{destroy(){window.removeEventListener("dragstart",p)}}},props:{handleDOMEvents:{drop:(d,p)=>(o=r===d.dom.parentElement,s=p,!1),paste:(d,p)=>{var A;const m=(A=p.clipboardData)===null||A===void 0?void 0:A.getData("text/html");return a=p,i=!!(m!=null&&m.includes("data-pm-slice")),!1}}},appendTransaction:(d,p,A)=>{const m=d[0],v=m.getMeta("uiEvent")==="paste"&&!i,_=m.getMeta("uiEvent")==="drop"&&!o,C=m.getMeta("applyPasteRules"),I=!!C;if(!v&&!_&&!I)return;if(I){const{from:S,text:y}=C,T=S+y.length,w=Eke(y);return u({rule:l,state:A,from:S,to:{b:T},pasteEvt:w})}const x=p.doc.content.findDiffStart(A.doc.content),g=p.doc.content.findDiffEnd(A.doc.content);if(!(!Ike(x)||!g||x===g.b))return u({rule:l,state:A,from:x,to:g,pasteEvt:a})}}))}function Rke(e){const t=e.filter((n,r)=>e.indexOf(n)!==r);return Array.from(new Set(t))}class dl{constructor(t,n){this.splittableMarks=[],this.editor=n,this.extensions=dl.resolve(t),this.schema=CV(this.extensions,n),this.setupExtensions()}static resolve(t){const n=dl.sort(dl.flatten(t)),r=Rke(n.map(i=>i.name));return r.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${r.map(i=>`'${i}'`).join(", ")}]. This can lead to issues.`),n}static flatten(t){return t.map(n=>{const r={name:n.name,options:n.options,storage:n.storage},i=ce(n,"addExtensions",r);return i?[n,...this.flatten(i())]:n}).flat(10)}static sort(t){return t.sort((r,i)=>{const o=ce(r,"priority")||100,a=ce(i,"priority")||100;return o>a?-1:o<a?1:0})}get commands(){return this.extensions.reduce((t,n)=>{const r={name:n.name,options:n.options,storage:n.storage,editor:this.editor,type:l1(n.name,this.schema)},i=ce(n,"addCommands",r);return i?{...t,...i()}:t},{})}get plugins(){const{editor:t}=this,n=dl.sort([...this.extensions].reverse()),r=[],i=[],o=n.map(a=>{const s={name:a.name,options:a.options,storage:a.storage,editor:t,type:l1(a.name,this.schema)},u=[],c=ce(a,"addKeyboardShortcuts",s);let l={};if(a.type==="mark"&&ce(a,"exitable",s)&&(l.ArrowRight=()=>Nc.handleExit({editor:t,mark:a})),c){const v=Object.fromEntries(Object.entries(c()).map(([_,C])=>[_,()=>C({editor:t})]));l={...l,...v}}const d=BFe(l);u.push(d);const p=ce(a,"addInputRules",s);Bk(a,t.options.enableInputRules)&&p&&r.push(...p());const A=ce(a,"addPasteRules",s);Bk(a,t.options.enablePasteRules)&&A&&i.push(...A());const m=ce(a,"addProseMirrorPlugins",s);if(m){const v=m();u.push(...v)}return u}).flat();return[_ke({editor:t,rules:r}),...$ke({editor:t,rules:i}),...o]}get attributes(){return bV(this.extensions)}get nodeViews(){const{editor:t}=this,{nodeExtensions:n}=Z0(this.extensions);return Object.fromEntries(n.filter(r=>!!ce(r,"addNodeView")).map(r=>{const i=this.attributes.filter(u=>u.type===r.name),o={name:r.name,options:r.options,storage:r.storage,editor:t,type:Cn(r.name,this.schema)},a=ce(r,"addNodeView",o);if(!a)return[];const s=(u,c,l,d)=>{const p=wC(u,i);return a()({editor:t,node:u,getPos:l,decorations:d,HTMLAttributes:p,extension:r})};return[r.name,s]}))}setupExtensions(){this.extensions.forEach(t=>{var n;this.editor.extensionStorage[t.name]=t.storage;const r={name:t.name,options:t.options,storage:t.storage,editor:this.editor,type:l1(t.name,this.schema)};t.type==="mark"&&(!((n=Ue(ce(t,"keepOnSplit",r)))!==null&&n!==void 0)||n)&&this.splittableMarks.push(t.name);const i=ce(t,"onBeforeCreate",r),o=ce(t,"onCreate",r),a=ce(t,"onUpdate",r),s=ce(t,"onSelectionUpdate",r),u=ce(t,"onTransaction",r),c=ce(t,"onFocus",r),l=ce(t,"onBlur",r),d=ce(t,"onDestroy",r);i&&this.editor.on("beforeCreate",i),o&&this.editor.on("create",o),a&&this.editor.on("update",a),s&&this.editor.on("selectionUpdate",s),u&&this.editor.on("transaction",u),c&&this.editor.on("focus",c),l&&this.editor.on("blur",l),d&&this.editor.on("destroy",d)})}}function Oke(e){return Object.prototype.toString.call(e).slice(8,-1)}function Gh(e){return Oke(e)!=="Object"?!1:e.constructor===Object&&Object.getPrototypeOf(e)===Object.prototype}function X0(e,t){const n={...e};return Gh(e)&&Gh(t)&&Object.keys(t).forEach(r=>{Gh(t[r])&&Gh(e[r])?n[r]=X0(e[r],t[r]):n[r]=t[r]}),n}class dr{constructor(t={}){this.type="extension",this.name="extension",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...t},this.name=this.config.name,t.defaultOptions&&Object.keys(t.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=Ue(ce(this,"addOptions",{name:this.name}))),this.storage=Ue(ce(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(t={}){return new dr(t)}configure(t={}){const n=this.extend({...this.config,addOptions:()=>X0(this.options,t)});return n.name=this.name,n.parent=this.parent,n}extend(t={}){const n=new dr({...this.config,...t});return n.parent=this,this.child=n,n.name=t.name?t.name:n.parent.name,t.defaultOptions&&Object.keys(t.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=Ue(ce(n,"addOptions",{name:n.name})),n.storage=Ue(ce(n,"addStorage",{name:n.name,options:n.options})),n}}function Fke(e,t,n){const{from:r,to:i}=t,{blockSeparator:o=`
46
46
 
47
- `,textSerializers:a={}}=n||{};let s="";return e.nodesBetween(r,i,(u,c,l,d)=>{var p;u.isBlock&&c>r&&(s+=o);const A=a==null?void 0:a[u.type.name];if(A)return l&&(s+=A({node:u,pos:c,parent:l,index:d,range:t})),!1;u.isText&&(s+=(p=u==null?void 0:u.text)===null||p===void 0?void 0:p.slice(Math.max(r,c)-c,i-c))}),s}function Uke(e){return Object.fromEntries(Object.entries(e.nodes).filter(([,t])=>t.spec.toText).map(([t,n])=>[t,n.spec.toText]))}dr.create({name:"clipboardTextSerializer",addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new zr({key:new eo("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:e}=this,{state:t,schema:n}=e,{doc:r,selection:i}=t,{ranges:o}=i,a=Math.min(...o.map(l=>l.$from.pos)),s=Math.max(...o.map(l=>l.$to.pos)),u=Uke(n);return jke(r,{from:a,to:s},{...this.options.blockSeparator!==void 0?{blockSeparator:this.options.blockSeparator}:{},textSerializers:u})}}})]}});const Bke=()=>({editor:e,view:t})=>(requestAnimationFrame(()=>{var n;e.isDestroyed||(t.dom.blur(),(n=window==null?void 0:window.getSelection())===null||n===void 0||n.removeAllRanges())}),!0),Pke=(e=!1)=>({commands:t})=>t.setContent("",e),Wke=()=>({state:e,tr:t,dispatch:n})=>{const{selection:r}=t,{ranges:i}=r;return n&&i.forEach(({$from:o,$to:a})=>{e.doc.nodesBetween(o.pos,a.pos,(s,u)=>{if(s.type.isText)return;const{doc:c,mapping:l}=t,d=c.resolve(l.map(u)),p=c.resolve(l.map(u+s.nodeSize)),A=d.blockRange(p);if(!A)return;const m=zFe(A);if(s.type.isTextblock){const{defaultType:v}=d.parent.contentMatchAt(d.index());t.setNodeMarkup(A.start,v)}(m||m===0)&&t.lift(A,m)})}),!0},Dke=e=>t=>e(t),Kke=()=>({state:e,dispatch:t})=>cke(e,t),Nke=(e,t)=>({editor:n,tr:r})=>{const{state:i}=n,o=i.doc.slice(e.from,e.to);r.deleteRange(e.from,e.to);const a=r.mapping.map(t);return r.insert(a,o.content),r.setSelection(new Be(r.doc.resolve(a-1))),!0},qke=()=>({tr:e,dispatch:t})=>{const{selection:n}=e,r=n.$anchor.node();if(r.content.size>0)return!1;const i=e.selection.$anchor;for(let o=i.depth;o>0;o-=1)if(i.node(o).type===r.type){if(t){const s=i.before(o),u=i.after(o);e.delete(s,u).scrollIntoView()}return!0}return!1},Vke=e=>({tr:t,state:n,dispatch:r})=>{const i=Cn(e,n.schema),o=t.selection.$anchor;for(let a=o.depth;a>0;a-=1)if(o.node(a).type===i){if(r){const u=o.before(a),c=o.after(a);t.delete(u,c).scrollIntoView()}return!0}return!1},Qke=e=>({tr:t,dispatch:n})=>{const{from:r,to:i}=e;return n&&t.delete(r,i),!0},zke=()=>({state:e,dispatch:t})=>JFe(e,t),Hke=()=>({commands:e})=>e.keyboardShortcut("Enter"),Yke=()=>({state:e,dispatch:t})=>uke(e,t);function ng(e,t,n={strict:!0}){const r=Object.keys(t);return r.length?r.every(i=>n.strict?t[i]===e[i]:uO(t[i])?t[i].test(e[i]):t[i]===e[i]):!0}function EC(e,t,n={}){return e.find(r=>r.type===t&&ng(r.attrs,n))}function Gke(e,t,n={}){return!!EC(e,t,n)}function lO(e,t,n={}){if(!e||!t)return;let r=e.parent.childAfter(e.parentOffset);if(e.parentOffset===r.offset&&r.offset!==0&&(r=e.parent.childBefore(e.parentOffset)),!r.node)return;const i=EC([...r.node.marks],t,n);if(!i)return;let o=r.index,a=e.start()+r.offset,s=o+1,u=a+r.node.nodeSize;for(EC([...r.node.marks],t,n);o>0&&i.isInSet(e.parent.child(o-1).marks);)o-=1,a-=e.parent.child(o).nodeSize;for(;s<e.parent.childCount&&Gke([...e.parent.child(s).marks],t,n);)u+=e.parent.child(s).nodeSize,s+=1;return{from:a,to:u}}function Ys(e,t){if(typeof e=="string"){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}const Jke=(e,t={})=>({tr:n,state:r,dispatch:i})=>{const o=Ys(e,r.schema),{doc:a,selection:s}=n,{$from:u,from:c,to:l}=s;if(i){const d=lO(u,o,t);if(d&&d.from<=c&&d.to>=l){const p=Be.create(a,d.from,d.to);n.setSelection(p)}}return!0},Zke=e=>t=>{const n=typeof e=="function"?e(t):e;for(let r=0;r<n.length;r+=1)if(n[r](t))return!0;return!1};function fO(e){return e instanceof Be}function Zo(e=0,t=0,n=0){return Math.min(Math.max(e,t),n)}function Xke(e,t=null){if(!t)return null;const n=ze.atStart(e),r=ze.atEnd(e);if(t==="start"||t===!0)return n;if(t==="end")return r;const i=n.from,o=r.to;return t==="all"?Be.create(e,Zo(0,i,o),Zo(e.content.size,i,o)):Be.create(e,Zo(t,i,o),Zo(t,i,o))}function eb(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}const eMe=(e=null,t={})=>({editor:n,view:r,tr:i,dispatch:o})=>{t={scrollIntoView:!0,...t};const a=()=>{eb()&&r.dom.focus(),requestAnimationFrame(()=>{n.isDestroyed||(r.focus(),t!=null&&t.scrollIntoView&&n.commands.scrollIntoView())})};if(r.hasFocus()&&e===null||e===!1)return!0;if(o&&e===null&&!fO(n.state.selection))return a(),!0;const s=Xke(i.doc,e)||n.state.selection,u=n.state.selection.eq(s);return o&&(u||i.setSelection(s),u&&i.storedMarks&&i.setStoredMarks(i.storedMarks),a()),!0},tMe=(e,t)=>n=>e.every((r,i)=>t(r,{...n,index:i})),nMe=(e,t)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},e,t),SV=e=>{const t=e.childNodes;for(let n=t.length-1;n>=0;n-=1){const r=t[n];r.nodeType===3&&r.nodeValue&&/^(\n\s\s|\n)$/.test(r.nodeValue)?e.removeChild(r):r.nodeType===1&&SV(r)}return e};function Jh(e){const t=`<body>${e}</body>`,n=new window.DOMParser().parseFromString(t,"text/html").body;return SV(n)}function rg(e,t,n){n={slice:!0,parseOptions:{},...n};const r=typeof e=="object"&&e!==null,i=typeof e=="string";if(r)try{if(Array.isArray(e)&&e.length>0)return X.fromArray(e.map(s=>t.nodeFromJSON(s)));const a=t.nodeFromJSON(e);return n.errorOnInvalidContent&&a.check(),a}catch(o){if(n.errorOnInvalidContent)throw new Error("[tiptap error]: Invalid JSON content",{cause:o});return console.warn("[tiptap warn]: Invalid content.","Passed value:",e,"Error:",o),rg("",t,n)}if(i){if(n.errorOnInvalidContent){let a=!1,s="";const u=new g8({topNode:t.spec.topNode,marks:t.spec.marks,nodes:t.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:"inline*",group:"block",parseDOM:[{tag:"*",getAttrs:c=>(a=!0,s=typeof c=="string"?c:c.outerHTML,null)}]}})});if(n.slice?hu.fromSchema(u).parseSlice(Jh(e),n.parseOptions):hu.fromSchema(u).parse(Jh(e),n.parseOptions),n.errorOnInvalidContent&&a)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${s}`)})}const o=hu.fromSchema(t);return n.slice?o.parseSlice(Jh(e),n.parseOptions).content:o.parse(Jh(e),n.parseOptions)}return rg("",t,n)}function rMe(e,t,n){const r=e.steps.length-1;if(r<t)return;const i=e.steps[r];if(!(i instanceof zo||i instanceof gl))return;const o=e.mapping.maps[r];let a=0;o.forEach((s,u,c,l)=>{a===0&&(a=l)}),e.setSelection(ze.near(e.doc.resolve(a),n))}const iMe=e=>!("type"in e),oMe=(e,t,n)=>({tr:r,dispatch:i,editor:o})=>{var a;if(i){n={parseOptions:{},updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...n};let s;try{s=rg(t,o.schema,{parseOptions:{preserveWhitespace:"full",...n.parseOptions},errorOnInvalidContent:(a=n.errorOnInvalidContent)!==null&&a!==void 0?a:o.options.enableContentCheck})}catch(m){return o.emit("contentError",{editor:o,error:m,disableCollaboration:()=>{console.error("[tiptap error]: Unable to disable collaboration at this point in time")}}),!1}let{from:u,to:c}=typeof e=="number"?{from:e,to:e}:{from:e.from,to:e.to},l=!0,d=!0;if((iMe(s)?s:[s]).forEach(m=>{m.check(),l=l?m.isText&&m.marks.length===0:!1,d=d?m.isBlock:!1}),u===c&&d){const{parent:m}=r.doc.resolve(u);m.isTextblock&&!m.type.spec.code&&!m.childCount&&(u-=1,c+=1)}let A;l?(Array.isArray(t)?A=t.map(m=>m.text||"").join(""):typeof t=="object"&&t&&t.text?A=t.text:A=t,r.insertText(A,u,c)):(A=s,r.replaceWith(u,c,A)),n.updateSelection&&rMe(r,r.steps.length-1,-1),n.applyInputRules&&r.setMeta("applyInputRules",{from:u,text:A}),n.applyPasteRules&&r.setMeta("applyPasteRules",{from:u,text:A})}return!0},aMe=()=>({state:e,dispatch:t})=>ike(e,t),sMe=()=>({state:e,dispatch:t})=>oke(e,t),uMe=()=>({state:e,dispatch:t})=>ZFe(e,t),cMe=()=>({state:e,dispatch:t})=>nke(e,t),lMe=()=>({state:e,dispatch:t,tr:n})=>{try{const r=pV(e.doc,e.selection.$from.pos,-1);return r==null?!1:(n.join(r,2),t&&t(n),!0)}catch{return!1}},fMe=()=>({state:e,dispatch:t,tr:n})=>{try{const r=pV(e.doc,e.selection.$from.pos,1);return r==null?!1:(n.join(r,2),t&&t(n),!0)}catch{return!1}},dMe=()=>({state:e,dispatch:t})=>XFe(e,t),pMe=()=>({state:e,dispatch:t})=>eke(e,t);function _V(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function AMe(e){const t=e.split(/-(?!$)/);let n=t[t.length-1];n==="Space"&&(n=" ");let r,i,o,a;for(let s=0;s<t.length-1;s+=1){const u=t[s];if(/^(cmd|meta|m)$/i.test(u))a=!0;else if(/^a(lt)?$/i.test(u))r=!0;else if(/^(c|ctrl|control)$/i.test(u))i=!0;else if(/^s(hift)?$/i.test(u))o=!0;else if(/^mod$/i.test(u))eb()||_V()?a=!0:i=!0;else throw new Error(`Unrecognized modifier name: ${u}`)}return r&&(n=`Alt-${n}`),i&&(n=`Ctrl-${n}`),a&&(n=`Meta-${n}`),o&&(n=`Shift-${n}`),n}const hMe=e=>({editor:t,view:n,tr:r,dispatch:i})=>{const o=AMe(e).split(/-(?!$)/),a=o.find(c=>!["Alt","Ctrl","Meta","Shift"].includes(c)),s=new KeyboardEvent("keydown",{key:a==="Space"?" ":a,altKey:o.includes("Alt"),ctrlKey:o.includes("Ctrl"),metaKey:o.includes("Meta"),shiftKey:o.includes("Shift"),bubbles:!0,cancelable:!0}),u=t.captureTransaction(()=>{n.someProp("handleKeyDown",c=>c(n,s))});return u==null||u.steps.forEach(c=>{const l=c.map(r.mapping);l&&i&&r.maybeStep(l)}),!0};function dO(e,t,n={}){const{from:r,to:i,empty:o}=e.selection,a=t?Cn(t,e.schema):null,s=[];e.doc.nodesBetween(r,i,(d,p)=>{if(d.isText)return;const A=Math.max(r,p),m=Math.min(i,p+d.nodeSize);s.push({node:d,from:A,to:m})});const u=i-r,c=s.filter(d=>a?a.name===d.node.type.name:!0).filter(d=>ng(d.node.attrs,n,{strict:!1}));return o?!!c.length:c.reduce((d,p)=>d+p.to-p.from,0)>=u}const mMe=(e,t={})=>({state:n,dispatch:r})=>{const i=Cn(e,n.schema);return dO(n,i,t)?ake(n,r):!1},gMe=()=>({state:e,dispatch:t})=>lke(e,t),vMe=e=>({state:t,dispatch:n})=>{const r=Cn(e,t.schema);return vke(r)(t,n)},yMe=()=>({state:e,dispatch:t})=>ske(e,t);function IV(e,t){return t.nodes[e]?"node":t.marks[e]?"mark":null}function Pk(e,t){const n=typeof t=="string"?[t]:t;return Object.keys(e).reduce((r,i)=>(n.includes(i)||(r[i]=e[i]),r),{})}const bMe=(e,t)=>({tr:n,state:r,dispatch:i})=>{let o=null,a=null;const s=IV(typeof e=="string"?e:e.name,r.schema);return s?(s==="node"&&(o=Cn(e,r.schema)),s==="mark"&&(a=Ys(e,r.schema)),i&&n.selection.ranges.forEach(u=>{r.doc.nodesBetween(u.$from.pos,u.$to.pos,(c,l)=>{o&&o===c.type&&n.setNodeMarkup(l,void 0,Pk(c.attrs,t)),a&&c.marks.length&&c.marks.forEach(d=>{a===d.type&&n.addMark(l,l+c.nodeSize,a.create(Pk(d.attrs,t)))})})}),!0):!1},CMe=()=>({tr:e,dispatch:t})=>(t&&e.scrollIntoView(),!0),SMe=()=>({tr:e,commands:t})=>t.setTextSelection({from:0,to:e.doc.content.size}),_Me=()=>({state:e,dispatch:t})=>tke(e,t),IMe=()=>({state:e,dispatch:t})=>rke(e,t),TMe=()=>({state:e,dispatch:t})=>fke(e,t),xMe=()=>({state:e,dispatch:t})=>Ake(e,t),wMe=()=>({state:e,dispatch:t})=>pke(e,t);function EMe(e,t,n={},r={}){return rg(e,t,{slice:!1,parseOptions:n,errorOnInvalidContent:r.errorOnInvalidContent})}const $Me=(e,t=!1,n={},r={})=>({editor:i,tr:o,dispatch:a,commands:s})=>{var u,c;const{doc:l}=o;if(n.preserveWhitespace!=="full"){const d=EMe(e,i.schema,n,{errorOnInvalidContent:(u=r.errorOnInvalidContent)!==null&&u!==void 0?u:i.options.enableContentCheck});return a&&o.replaceWith(0,l.content.size,d).setMeta("preventUpdate",!t),!0}return a&&o.setMeta("preventUpdate",!t),s.insertContentAt({from:0,to:l.content.size},e,{parseOptions:n,errorOnInvalidContent:(c=r.errorOnInvalidContent)!==null&&c!==void 0?c:i.options.enableContentCheck})};function pO(e,t){const n=Ys(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,u=>{a.push(...u.marks)});const s=a.find(u=>u.type.name===n.name);return s?{...s.attrs}:{}}function RMe(e){for(let t=0;t<e.edgeCount;t+=1){const{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}function OMe(e,t){for(let n=e.depth;n>0;n-=1){const r=e.node(n);if(t(r))return{pos:n>0?e.before(n):0,start:e.start(n),depth:n,node:r}}}function AO(e){return t=>OMe(t.$from,e)}function FMe(e,t){const n=dl.resolve(e);return CV(n,t)}function TV(e,t,n){const r=[];return e===t?n.resolve(e).marks().forEach(i=>{const o=n.resolve(e),a=lO(o,i.type);a&&r.push({mark:i,...a})}):n.nodesBetween(e,t,(i,o)=>{!i||(i==null?void 0:i.nodeSize)===void 0||r.push(...i.marks.map(a=>({from:o,to:o+i.nodeSize,mark:a})))}),r}function lm(e,t,n){return Object.fromEntries(Object.entries(n).filter(([r])=>{const i=e.find(o=>o.type===t&&o.name===r);return i?i.attribute.keepOnSplit:!1}))}function kMe(e,t,n={}){const{empty:r,ranges:i}=e.selection,o=t?Ys(t,e.schema):null;if(r)return!!(e.storedMarks||e.selection.$from.marks()).filter(d=>o?o.name===d.type.name:!0).find(d=>ng(d.attrs,n,{strict:!1}));let a=0;const s=[];if(i.forEach(({$from:d,$to:p})=>{const A=d.pos,m=p.pos;e.doc.nodesBetween(A,m,(v,_)=>{if(!v.isText&&!v.marks.length)return;const C=Math.max(A,_),I=Math.min(m,_+v.nodeSize),x=I-C;a+=x,s.push(...v.marks.map(g=>({mark:g,from:C,to:I})))})}),a===0)return!1;const u=s.filter(d=>o?o.name===d.mark.type.name:!0).filter(d=>ng(d.mark.attrs,n,{strict:!1})).reduce((d,p)=>d+p.to-p.from,0),c=s.filter(d=>o?d.mark.type!==o&&d.mark.type.excludes(o):!0).reduce((d,p)=>d+p.to-p.from,0);return(u>0?u+c:u)>=a}function Wk(e,t){const{nodeExtensions:n}=Z0(t),r=n.find(a=>a.name===e);if(!r)return!1;const i={name:r.name,options:r.options,storage:r.storage},o=Ue(ce(r,"group",i));return typeof o!="string"?!1:o.split(" ").includes("list")}function xV(e,{checkChildren:t=!0,ignoreWhitespace:n=!1}={}){var r;if(n){if(e.type.name==="hardBreak")return!0;if(e.isText)return/^\s*$/m.test((r=e.text)!==null&&r!==void 0?r:"")}if(e.isText)return!e.text;if(e.isAtom||e.isLeaf)return!1;if(e.content.childCount===0)return!0;if(t){let i=!0;return e.content.forEach(o=>{i!==!1&&(xV(o,{ignoreWhitespace:n,checkChildren:t})||(i=!1))}),i}return!1}function MMe(e){return e instanceof ve}function LMe(e,t,n){const i=e.state.doc.content.size,o=Zo(t,0,i),a=Zo(n,0,i),s=e.coordsAtPos(o),u=e.coordsAtPos(a,-1),c=Math.min(s.top,u.top),l=Math.max(s.bottom,u.bottom),d=Math.min(s.left,u.left),p=Math.max(s.right,u.right),A=p-d,m=l-c,C={top:c,bottom:l,left:d,right:p,width:A,height:m,x:d,y:c};return{...C,toJSON:()=>C}}function jMe(e,t,n){var r;const{selection:i}=t;let o=null;if(fO(i)&&(o=i.$cursor),o){const s=(r=e.storedMarks)!==null&&r!==void 0?r:o.marks();return!!n.isInSet(s)||!s.some(u=>u.type.excludes(n))}const{ranges:a}=i;return a.some(({$from:s,$to:u})=>{let c=s.depth===0?e.doc.inlineContent&&e.doc.type.allowsMarkType(n):!1;return e.doc.nodesBetween(s.pos,u.pos,(l,d,p)=>{if(c)return!1;if(l.isInline){const A=!p||p.type.allowsMarkType(n),m=!!n.isInSet(l.marks)||!l.marks.some(v=>v.type.excludes(n));c=A&&m}return!c}),c})}const UMe=(e,t={})=>({tr:n,state:r,dispatch:i})=>{const{selection:o}=n,{empty:a,ranges:s}=o,u=Ys(e,r.schema);if(i)if(a){const c=pO(r,u);n.addStoredMark(u.create({...c,...t}))}else s.forEach(c=>{const l=c.$from.pos,d=c.$to.pos;r.doc.nodesBetween(l,d,(p,A)=>{const m=Math.max(A,l),v=Math.min(A+p.nodeSize,d);p.marks.find(C=>C.type===u)?p.marks.forEach(C=>{u===C.type&&n.addMark(m,v,u.create({...C.attrs,...t}))}):n.addMark(m,v,u.create(t))})});return jMe(r,n,u)},BMe=(e,t)=>({tr:n})=>(n.setMeta(e,t),!0),PMe=(e,t={})=>({state:n,dispatch:r,chain:i})=>{const o=Cn(e,n.schema);return o.isTextblock?i().command(({commands:a})=>Lk(o,t)(n)?!0:a.clearNodes()).command(({state:a})=>Lk(o,t)(a,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},WMe=e=>({tr:t,dispatch:n})=>{if(n){const{doc:r}=t,i=Zo(e,0,r.content.size),o=ve.create(r,i);t.setSelection(o)}return!0},DMe=e=>({tr:t,dispatch:n})=>{if(n){const{doc:r}=t,{from:i,to:o}=typeof e=="number"?{from:e,to:e}:e,a=Be.atStart(r).from,s=Be.atEnd(r).to,u=Zo(i,a,s),c=Zo(o,a,s),l=Be.create(r,u,c);t.setSelection(l)}return!0},KMe=e=>({state:t,dispatch:n})=>{const r=Cn(e,t.schema);return Cke(r)(t,n)};function Dk(e,t){const n=e.storedMarks||e.selection.$to.parentOffset&&e.selection.$from.marks();if(n){const r=n.filter(i=>t==null?void 0:t.includes(i.type.name));e.tr.ensureMarks(r)}}const NMe=({keepMarks:e=!0}={})=>({tr:t,state:n,dispatch:r,editor:i})=>{const{selection:o,doc:a}=t,{$from:s,$to:u}=o,c=i.extensionManager.attributes,l=lm(c,s.node().type.name,s.node().attrs);if(o instanceof ve&&o.node.isBlock)return!s.parentOffset||!cm(a,s.pos)?!1:(r&&(e&&Dk(n,i.extensionManager.splittableMarks),t.split(s.pos).scrollIntoView()),!0);if(!s.parent.isBlock)return!1;const d=u.parentOffset===u.parent.content.size,p=s.depth===0?void 0:RMe(s.node(-1).contentMatchAt(s.indexAfter(-1)));let A=d&&p?[{type:p,attrs:l}]:void 0,m=cm(t.doc,t.mapping.map(s.pos),1,A);if(!A&&!m&&cm(t.doc,t.mapping.map(s.pos),1,p?[{type:p}]:void 0)&&(m=!0,A=p?[{type:p,attrs:l}]:void 0),r){if(m&&(o instanceof Be&&t.deleteSelection(),t.split(t.mapping.map(s.pos),1,A),p&&!d&&!s.parentOffset&&s.parent.type!==p)){const v=t.mapping.map(s.before()),_=t.doc.resolve(v);s.node(-1).canReplaceWith(_.index(),_.index()+1,p)&&t.setNodeMarkup(t.mapping.map(s.before()),p)}e&&Dk(n,i.extensionManager.splittableMarks),t.scrollIntoView()}return m},qMe=(e,t={})=>({tr:n,state:r,dispatch:i,editor:o})=>{var a;const s=Cn(e,r.schema),{$from:u,$to:c}=r.selection,l=r.selection.node;if(l&&l.isBlock||u.depth<2||!u.sameParent(c))return!1;const d=u.node(-1);if(d.type!==s)return!1;const p=o.extensionManager.attributes;if(u.parent.content.size===0&&u.node(-1).childCount===u.indexAfter(-1)){if(u.depth===2||u.node(-3).type!==s||u.index(-2)!==u.node(-2).childCount-1)return!1;if(i){let C=X.empty;const I=u.index(-1)?1:u.index(-2)?2:3;for(let w=u.depth-I;w>=u.depth-3;w-=1)C=X.from(u.node(w).copy(C));const x=u.indexAfter(-1)<u.node(-2).childCount?1:u.indexAfter(-2)<u.node(-3).childCount?2:3,g={...lm(p,u.node().type.name,u.node().attrs),...t},S=((a=s.contentMatch.defaultType)===null||a===void 0?void 0:a.createAndFill(g))||void 0;C=C.append(X.from(s.createAndFill(null,S)||void 0));const y=u.before(u.depth-(I-1));n.replace(y,u.after(-x),new ae(C,4-I,0));let T=-1;n.doc.nodesBetween(y,n.doc.content.size,(w,O)=>{if(T>-1)return!1;w.isTextblock&&w.content.size===0&&(T=O+1)}),T>-1&&n.setSelection(Be.near(n.doc.resolve(T))),n.scrollIntoView()}return!0}const A=c.pos===u.end()?d.contentMatchAt(0).defaultType:null,m={...lm(p,d.type.name,d.attrs),...t},v={...lm(p,u.node().type.name,u.node().attrs),...t};n.delete(u.pos,c.pos);const _=A?[{type:s,attrs:m},{type:A,attrs:v}]:[{type:s,attrs:m}];if(!cm(n.doc,u.pos,2))return!1;if(i){const{selection:C,storedMarks:I}=r,{splittableMarks:x}=o.extensionManager,g=I||C.$to.parentOffset&&C.$from.marks();if(n.split(u.pos,2,_).scrollIntoView(),!g||!i)return!0;const S=g.filter(y=>x.includes(y.type.name));n.ensureMarks(S)}return!0},f1=(e,t)=>{const n=AO(a=>a.type===t)(e.selection);if(!n)return!0;const r=e.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(r===void 0)return!0;const i=e.doc.nodeAt(r);return n.node.type===(i==null?void 0:i.type)&&iO(e.doc,n.pos)&&e.join(n.pos),!0},d1=(e,t)=>{const n=AO(a=>a.type===t)(e.selection);if(!n)return!0;const r=e.doc.resolve(n.start).after(n.depth);if(r===void 0)return!0;const i=e.doc.nodeAt(r);return n.node.type===(i==null?void 0:i.type)&&iO(e.doc,r)&&e.join(r),!0},VMe=(e,t,n,r={})=>({editor:i,tr:o,state:a,dispatch:s,chain:u,commands:c,can:l})=>{const{extensions:d,splittableMarks:p}=i.extensionManager,A=Cn(e,a.schema),m=Cn(t,a.schema),{selection:v,storedMarks:_}=a,{$from:C,$to:I}=v,x=C.blockRange(I),g=_||v.$to.parentOffset&&v.$from.marks();if(!x)return!1;const S=AO(y=>Wk(y.type.name,d))(v);if(x.depth>=1&&S&&x.depth-S.depth<=1){if(S.node.type===A)return c.liftListItem(m);if(Wk(S.node.type.name,d)&&A.validContent(S.node.content)&&s)return u().command(()=>(o.setNodeMarkup(S.pos,A),!0)).command(()=>f1(o,A)).command(()=>d1(o,A)).run()}return!n||!g||!s?u().command(()=>l().wrapInList(A,r)?!0:c.clearNodes()).wrapInList(A,r).command(()=>f1(o,A)).command(()=>d1(o,A)).run():u().command(()=>{const y=l().wrapInList(A,r),T=g.filter(w=>p.includes(w.type.name));return o.ensureMarks(T),y?!0:c.clearNodes()}).wrapInList(A,r).command(()=>f1(o,A)).command(()=>d1(o,A)).run()},QMe=(e,t={},n={})=>({state:r,commands:i})=>{const{extendEmptyMarkRange:o=!1}=n,a=Ys(e,r.schema);return kMe(r,a,t)?i.unsetMark(a,{extendEmptyMarkRange:o}):i.setMark(a,t)},zMe=(e,t,n={})=>({state:r,commands:i})=>{const o=Cn(e,r.schema),a=Cn(t,r.schema);return dO(r,o,n)?i.setNode(a):i.setNode(o,n)},HMe=(e,t={})=>({state:n,commands:r})=>{const i=Cn(e,n.schema);return dO(n,i,t)?r.lift(i):r.wrapIn(i,t)},YMe=()=>({state:e,dispatch:t})=>{const n=e.plugins;for(let r=0;r<n.length;r+=1){const i=n[r];let o;if(i.spec.isInputRules&&(o=i.getState(e))){if(t){const a=e.tr,s=o.transform;for(let u=s.steps.length-1;u>=0;u-=1)a.step(s.steps[u].invert(s.docs[u]));if(o.text){const u=a.doc.resolve(o.from).marks();a.replaceWith(o.from,o.to,e.schema.text(o.text,u))}else a.delete(o.from,o.to)}return!0}}return!1},GMe=()=>({tr:e,dispatch:t})=>{const{selection:n}=e,{empty:r,ranges:i}=n;return r||t&&i.forEach(o=>{e.removeMark(o.$from.pos,o.$to.pos)}),!0},JMe=(e,t={})=>({tr:n,state:r,dispatch:i})=>{var o;const{extendEmptyMarkRange:a=!1}=t,{selection:s}=n,u=Ys(e,r.schema),{$from:c,empty:l,ranges:d}=s;if(!i)return!0;if(l&&a){let{from:p,to:A}=s;const m=(o=c.marks().find(_=>_.type===u))===null||o===void 0?void 0:o.attrs,v=lO(c,u,m);v&&(p=v.from,A=v.to),n.removeMark(p,A,u)}else d.forEach(p=>{n.removeMark(p.$from.pos,p.$to.pos,u)});return n.removeStoredMark(u),!0},ZMe=(e,t={})=>({tr:n,state:r,dispatch:i})=>{let o=null,a=null;const s=IV(typeof e=="string"?e:e.name,r.schema);return s?(s==="node"&&(o=Cn(e,r.schema)),s==="mark"&&(a=Ys(e,r.schema)),i&&n.selection.ranges.forEach(u=>{const c=u.$from.pos,l=u.$to.pos;r.doc.nodesBetween(c,l,(d,p)=>{o&&o===d.type&&n.setNodeMarkup(p,void 0,{...d.attrs,...t}),a&&d.marks.length&&d.marks.forEach(A=>{if(a===A.type){const m=Math.max(p,c),v=Math.min(p+d.nodeSize,l);n.addMark(m,v,a.create({...A.attrs,...t}))}})})}),!0):!1},XMe=(e,t={})=>({state:n,dispatch:r})=>{const i=Cn(e,n.schema);return hke(i,t)(n,r)},eLe=(e,t={})=>({state:n,dispatch:r})=>{const i=Cn(e,n.schema);return mke(i,t)(n,r)};var tLe=Object.freeze({__proto__:null,blur:Bke,clearContent:Pke,clearNodes:Wke,command:Dke,createParagraphNear:Kke,cut:Nke,deleteCurrentNode:qke,deleteNode:Vke,deleteRange:Qke,deleteSelection:zke,enter:Hke,exitCode:Yke,extendMarkRange:Jke,first:Zke,focus:eMe,forEach:tMe,insertContent:nMe,insertContentAt:oMe,joinBackward:uMe,joinDown:sMe,joinForward:cMe,joinItemBackward:lMe,joinItemForward:fMe,joinTextblockBackward:dMe,joinTextblockForward:pMe,joinUp:aMe,keyboardShortcut:hMe,lift:mMe,liftEmptyBlock:gMe,liftListItem:vMe,newlineInCode:yMe,resetAttributes:bMe,scrollIntoView:CMe,selectAll:SMe,selectNodeBackward:_Me,selectNodeForward:IMe,selectParentNode:TMe,selectTextblockEnd:xMe,selectTextblockStart:wMe,setContent:$Me,setMark:UMe,setMeta:BMe,setNode:PMe,setNodeSelection:WMe,setTextSelection:DMe,sinkListItem:KMe,splitBlock:NMe,splitListItem:qMe,toggleList:VMe,toggleMark:QMe,toggleNode:zMe,toggleWrap:HMe,undoInputRule:YMe,unsetAllMarks:GMe,unsetMark:JMe,updateAttributes:ZMe,wrapIn:XMe,wrapInList:eLe});dr.create({name:"commands",addCommands(){return{...tLe}}});dr.create({name:"editable",addProseMirrorPlugins(){return[new zr({key:new eo("editable"),props:{editable:()=>this.editor.options.editable}})]}});dr.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:e}=this;return[new zr({key:new eo("focusEvents"),props:{handleDOMEvents:{focus:(t,n)=>{e.isFocused=!0;const r=e.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return t.dispatch(r),!1},blur:(t,n)=>{e.isFocused=!1;const r=e.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return t.dispatch(r),!1}}}})]}});dr.create({name:"keymap",addKeyboardShortcuts(){const e=()=>this.editor.commands.first(({commands:a})=>[()=>a.undoInputRule(),()=>a.command(({tr:s})=>{const{selection:u,doc:c}=s,{empty:l,$anchor:d}=u,{pos:p,parent:A}=d,m=d.parent.isTextblock&&p>0?s.doc.resolve(p-1):d,v=m.parent.type.spec.isolating,_=d.pos-d.parentOffset,C=v&&m.parent.childCount===1?_===d.pos:ze.atStart(c).from===p;return!l||!A.type.isTextblock||A.textContent.length||!C||C&&d.parent.type.name==="paragraph"?!1:a.clearNodes()}),()=>a.deleteSelection(),()=>a.joinBackward(),()=>a.selectNodeBackward()]),t=()=>this.editor.commands.first(({commands:a})=>[()=>a.deleteSelection(),()=>a.deleteCurrentNode(),()=>a.joinForward(),()=>a.selectNodeForward()]),r={Enter:()=>this.editor.commands.first(({commands:a})=>[()=>a.newlineInCode(),()=>a.createParagraphNear(),()=>a.liftEmptyBlock(),()=>a.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()},i={...r},o={...r,"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 eb()||_V()?o:i},addProseMirrorPlugins(){return[new zr({key:new eo("clearDocument"),appendTransaction:(e,t,n)=>{if(!(e.some(m=>m.docChanged)&&!t.doc.eq(n.doc)))return;const{empty:i,from:o,to:a}=t.selection,s=ze.atStart(t.doc).from,u=ze.atEnd(t.doc).to;if(i||!(o===s&&a===u)||!(n.doc.textBetween(0,n.doc.content.size," "," ").length===0))return;const d=n.tr,p=J0({state:n,transaction:d}),{commands:A}=new sO({editor:this.editor,state:p});if(A.clearNodes(),!!d.steps.length)return d}})]}});dr.create({name:"tabindex",addProseMirrorPlugins(){return[new zr({key:new eo("tabindex"),props:{attributes:()=>this.editor.isEditable?{tabindex:"0"}:{}}})]}});function ig(e){return new cO({find:e.find,handler:({state:t,range:n,match:r})=>{const i=Ue(e.getAttributes,void 0,r);if(i===!1||i===null)return null;const{tr:o}=t,a=r[r.length-1],s=r[0];if(a){const u=s.search(/\S/),c=n.from+s.indexOf(a),l=c+a.length;if(TV(n.from,n.to,t.doc).filter(A=>A.mark.type.excluded.find(v=>v===e.type&&v!==A.mark.type)).filter(A=>A.to>c).length)return null;l<n.to&&o.delete(l,n.to),c>n.from&&o.delete(n.from+u,c);const p=n.from+u+a.length;o.addMark(n.from+u,p,e.type.create(i||{})),o.removeStoredMark(e.type)}}})}function $C(e){return new cO({find:e.find,handler:({state:t,range:n,match:r})=>{const i=t.doc.resolve(n.from),o=Ue(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 og(e){return new cO({find:e.find,handler:({state:t,range:n,match:r,chain:i})=>{const o=Ue(e.getAttributes,void 0,r)||{},a=t.tr.delete(n.from,n.to),u=a.doc.resolve(n.from).blockRange(),c=u&&HFe(u,e.type,o);if(!c)return null;if(a.wrap(u,c),e.keepMarks&&e.editor){const{selection:d,storedMarks:p}=t,{splittableMarks:A}=e.editor.extensionManager,m=p||d.$to.parentOffset&&d.$from.marks();if(m){const v=m.filter(_=>A.includes(_.type.name));a.ensureMarks(v)}}if(e.keepAttributes){const d=e.type.name==="bulletList"||e.type.name==="orderedList"?"listItem":"taskList";i().updateAttributes(d,o).run()}const l=a.doc.resolve(n.from-1).nodeBefore;l&&l.type===e.type&&iO(a.doc,n.from-1)&&(!e.joinPredicate||e.joinPredicate(r,l))&&a.join(n.from-1)}})}let Nc=class RC{constructor(t={}){this.type="mark",this.name="mark",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...t},this.name=this.config.name,t.defaultOptions&&Object.keys(t.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=Ue(ce(this,"addOptions",{name:this.name}))),this.storage=Ue(ce(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(t={}){return new RC(t)}configure(t={}){const n=this.extend({...this.config,addOptions:()=>X0(this.options,t)});return n.name=this.name,n.parent=this.parent,n}extend(t={}){const n=new RC(t);return n.parent=this,this.child=n,n.name=t.name?t.name:n.parent.name,t.defaultOptions&&Object.keys(t.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=Ue(ce(n,"addOptions",{name:n.name})),n.storage=Ue(ce(n,"addStorage",{name:n.name,options:n.options})),n}static handleExit({editor:t,mark:n}){const{tr:r}=t.state,i=t.state.selection.$from;if(i.pos===i.end()){const a=i.marks();if(!!!a.find(c=>(c==null?void 0:c.type.name)===n.name))return!1;const u=a.find(c=>(c==null?void 0:c.type.name)===n.name);return u&&r.removeStoredMark(u),r.insertText(" ",i.pos),t.view.dispatch(r),!0}return!1}};class jn{constructor(t={}){this.type="node",this.name="node",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...t},this.name=this.config.name,t.defaultOptions&&Object.keys(t.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=Ue(ce(this,"addOptions",{name:this.name}))),this.storage=Ue(ce(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(t={}){return new jn(t)}configure(t={}){const n=this.extend({...this.config,addOptions:()=>X0(this.options,t)});return n.name=this.name,n.parent=this.parent,n}extend(t={}){const n=new jn(t);return n.parent=this,this.child=n,n.name=t.name?t.name:n.parent.name,t.defaultOptions&&Object.keys(t.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=Ue(ce(n,"addOptions",{name:n.name})),n.storage=Ue(ce(n,"addStorage",{name:n.name,options:n.options})),n}}function nLe(){return navigator.platform==="Android"||/android/i.test(navigator.userAgent)}class rLe{constructor(t,n,r){this.isDragging=!1,this.component=t,this.editor=n.editor,this.options={stopEvent:null,ignoreMutation:null,...r},this.extension=n.extension,this.node=n.node,this.decorations=n.decorations,this.getPos=n.getPos,this.mount()}mount(){}get dom(){return this.editor.view.dom}get contentDOM(){return null}onDragStart(t){var n,r,i,o,a,s,u;const{view:c}=this.editor,l=t.target,d=l.nodeType===3?(n=l.parentElement)===null||n===void 0?void 0:n.closest("[data-drag-handle]"):l.closest("[data-drag-handle]");if(!this.dom||!((r=this.contentDOM)===null||r===void 0)&&r.contains(l)||!d)return;let p=0,A=0;if(this.dom!==d){const _=this.dom.getBoundingClientRect(),C=d.getBoundingClientRect(),I=(i=t.offsetX)!==null&&i!==void 0?i:(o=t.nativeEvent)===null||o===void 0?void 0:o.offsetX,x=(a=t.offsetY)!==null&&a!==void 0?a:(s=t.nativeEvent)===null||s===void 0?void 0:s.offsetY;p=C.x-_.x+I,A=C.y-_.y+x}(u=t.dataTransfer)===null||u===void 0||u.setDragImage(this.dom,p,A);const m=ve.create(c.state.doc,this.getPos()),v=c.state.tr.setSelection(m);c.dispatch(v)}stopEvent(t){var n;if(!this.dom)return!1;if(typeof this.options.stopEvent=="function")return this.options.stopEvent({event:t});const r=t.target;if(!(this.dom.contains(r)&&!(!((n=this.contentDOM)===null||n===void 0)&&n.contains(r))))return!1;const o=t.type.startsWith("drag"),a=t.type==="drop";if((["INPUT","BUTTON","SELECT","TEXTAREA"].includes(r.tagName)||r.isContentEditable)&&!a&&!o)return!0;const{isEditable:u}=this.editor,{isDragging:c}=this,l=!!this.node.type.spec.draggable,d=ve.isSelectable(this.node),p=t.type==="copy",A=t.type==="paste",m=t.type==="cut",v=t.type==="mousedown";if(!l&&d&&o&&t.preventDefault(),l&&o&&!c)return t.preventDefault(),!1;if(l&&u&&!c&&v){const _=r.closest("[data-drag-handle]");_&&(this.dom===_||this.dom.contains(_))&&(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!(c||a||p||A||m||v&&d)}ignoreMutation(t){return!this.dom||!this.contentDOM?!0:typeof this.options.ignoreMutation=="function"?this.options.ignoreMutation({mutation:t}):this.node.isLeaf||this.node.isAtom?!0:t.type==="selection"||this.dom.contains(t.target)&&t.type==="childList"&&(eb()||nLe())&&this.editor.isFocused&&[...Array.from(t.addedNodes),...Array.from(t.removedNodes)].every(r=>r.isContentEditable)?!1:this.contentDOM===t.target&&t.type==="attributes"?!0:!this.contentDOM.contains(t.target)}updateAttributes(t){this.editor.commands.command(({tr:n})=>{const r=this.getPos();return n.setNodeMarkup(r,void 0,{...this.node.attrs,...t}),!0})}deleteNode(){const t=this.getPos(),n=t+this.node.nodeSize;this.editor.commands.deleteRange({from:t,to:n})}}function ag(e){return new $ke({find:e.find,handler:({state:t,range:n,match:r,pasteEvent:i})=>{const o=Ue(e.getAttributes,void 0,r,i);if(o===!1||o===null)return null;const{tr:a}=t,s=r[r.length-1],u=r[0];let c=n.to;if(s){const l=u.search(/\S/),d=n.from+u.indexOf(s),p=d+s.length;if(TV(n.from,n.to,t.doc).filter(m=>m.mark.type.excluded.find(_=>_===e.type&&_!==m.mark.type)).filter(m=>m.to>d).length)return null;p<n.to&&a.delete(p,n.to),d>n.from&&a.delete(n.from+l,d),c=n.from+l+s.length,a.addMark(n.from+l,c,e.type.create(o||{})),a.removeStoredMark(e.type)}}})}function iLe(e){return e.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}var sg=200,tn=function(){};tn.prototype.append=function(t){return t.length?(t=tn.from(t),!this.length&&t||t.length<sg&&this.leafAppend(t)||this.length<sg&&t.leafPrepend(this)||this.appendInner(t)):this};tn.prototype.prepend=function(t){return t.length?tn.from(t).append(this):this};tn.prototype.appendInner=function(t){return new oLe(this,t)};tn.prototype.slice=function(t,n){return t===void 0&&(t=0),n===void 0&&(n=this.length),t>=n?tn.empty:this.sliceInner(Math.max(0,t),Math.min(this.length,n))};tn.prototype.get=function(t){if(!(t<0||t>=this.length))return this.getInner(t)};tn.prototype.forEach=function(t,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length),n<=r?this.forEachInner(t,n,r,0):this.forEachInvertedInner(t,n,r,0)};tn.prototype.map=function(t,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length);var i=[];return this.forEach(function(o,a){return i.push(t(o,a))},n,r),i};tn.from=function(t){return t instanceof tn?t:t&&t.length?new wV(t):tn.empty};var wV=function(e){function t(r){e.call(this),this.values=r}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(i,o){return i==0&&o==this.length?this:new t(this.values.slice(i,o))},t.prototype.getInner=function(i){return this.values[i]},t.prototype.forEachInner=function(i,o,a,s){for(var u=o;u<a;u++)if(i(this.values[u],s+u)===!1)return!1},t.prototype.forEachInvertedInner=function(i,o,a,s){for(var u=o-1;u>=a;u--)if(i(this.values[u],s+u)===!1)return!1},t.prototype.leafAppend=function(i){if(this.length+i.length<=sg)return new t(this.values.concat(i.flatten()))},t.prototype.leafPrepend=function(i){if(this.length+i.length<=sg)return new t(i.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(t.prototype,n),t}(tn);tn.empty=new wV([]);var oLe=function(e){function t(n,r){e.call(this),this.left=n,this.right=r,this.length=n.length+r.length,this.depth=Math.max(n.depth,r.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(r){return r<this.left.length?this.left.get(r):this.right.get(r-this.left.length)},t.prototype.forEachInner=function(r,i,o,a){var s=this.left.length;if(i<s&&this.left.forEachInner(r,i,Math.min(o,s),a)===!1||o>s&&this.right.forEachInner(r,Math.max(i-s,0),Math.min(this.length,o)-s,a+s)===!1)return!1},t.prototype.forEachInvertedInner=function(r,i,o,a){var s=this.left.length;if(i>s&&this.right.forEachInvertedInner(r,i-s,Math.max(o,s)-s,a+s)===!1||o<s&&this.left.forEachInvertedInner(r,Math.min(i,s),o,a)===!1)return!1},t.prototype.sliceInner=function(r,i){if(r==0&&i==this.length)return this;var o=this.left.length;return i<=o?this.left.slice(r,i):r>=o?this.right.slice(r-o,i-o):this.left.slice(r,o).append(this.right.slice(0,i-o))},t.prototype.leafAppend=function(r){var i=this.right.leafAppend(r);if(i)return new t(this.left,i)},t.prototype.leafPrepend=function(r){var i=this.left.leafPrepend(r);if(i)return new t(i,this.right)},t.prototype.appendInner=function(r){return this.left.depth>=Math.max(this.right.depth,r.depth)+1?new t(this.left,new t(this.right,r)):new t(this,r)},t}(tn);const aLe=500;class Ii{constructor(t,n){this.items=t,this.eventCount=n}popEvent(t,n){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let i,o;n&&(i=this.remapping(r,this.items.length),o=i.maps.length);let a=t.tr,s,u,c=[],l=[];return this.items.forEach((d,p)=>{if(!d.step){i||(i=this.remapping(r,p+1),o=i.maps.length),o--,l.push(d);return}if(i){l.push(new no(d.map));let A=d.step.map(i.slice(o)),m;A&&a.maybeStep(A).doc&&(m=a.mapping.maps[a.mapping.maps.length-1],c.push(new no(m,void 0,void 0,c.length+l.length))),o--,m&&i.appendMap(m,o)}else a.maybeStep(d.step);if(d.selection)return s=i?d.selection.map(i.slice(o)):d.selection,u=new Ii(this.items.slice(0,r).append(l.reverse().concat(c)),this.eventCount-1),!1},this.items.length,0),{remaining:u,transform:a,selection:s}}addTransform(t,n,r,i){let o=[],a=this.eventCount,s=this.items,u=!i&&s.length?s.get(s.length-1):null;for(let l=0;l<t.steps.length;l++){let d=t.steps[l].invert(t.docs[l]),p=new no(t.mapping.maps[l],d,n),A;(A=u&&u.merge(p))&&(p=A,l?o.pop():s=s.slice(0,s.length-1)),o.push(p),n&&(a++,n=void 0),i||(u=p)}let c=a-r.depth;return c>uLe&&(s=sLe(s,c),a-=c),new Ii(s.append(o),a)}remapping(t,n){let r=new kd;return this.items.forEach((i,o)=>{let a=i.mirrorOffset!=null&&o-i.mirrorOffset>=t?r.maps.length-i.mirrorOffset:void 0;r.appendMap(i.map,a)},t,n),r}addMaps(t){return this.eventCount==0?this:new Ii(this.items.append(t.map(n=>new no(n))),this.eventCount)}rebased(t,n){if(!this.eventCount)return this;let r=[],i=Math.max(0,this.items.length-n),o=t.mapping,a=t.steps.length,s=this.eventCount;this.items.forEach(p=>{p.selection&&s--},i);let u=n;this.items.forEach(p=>{let A=o.getMirror(--u);if(A==null)return;a=Math.min(a,A);let m=o.maps[A];if(p.step){let v=t.steps[A].invert(t.docs[A]),_=p.selection&&p.selection.map(o.slice(u+1,A));_&&s++,r.push(new no(m,v,_))}else r.push(new no(m))},i);let c=[];for(let p=n;p<a;p++)c.push(new no(o.maps[p]));let l=this.items.slice(0,i).append(c).append(r),d=new Ii(l,s);return d.emptyItemCount()>aLe&&(d=d.compress(this.items.length-r.length)),d}emptyItemCount(){let t=0;return this.items.forEach(n=>{n.step||t++}),t}compress(t=this.items.length){let n=this.remapping(0,t),r=n.maps.length,i=[],o=0;return this.items.forEach((a,s)=>{if(s>=t)i.push(a),a.selection&&o++;else if(a.step){let u=a.step.map(n.slice(r)),c=u&&u.getMap();if(r--,c&&n.appendMap(c,r),u){let l=a.selection&&a.selection.map(n.slice(r));l&&o++;let d=new no(c.invert(),u,l),p,A=i.length-1;(p=i.length&&i[A].merge(d))?i[A]=p:i.push(d)}}else a.map&&r--},this.items.length,0),new Ii(tn.from(i.reverse()),o)}}Ii.empty=new Ii(tn.empty,0);function sLe(e,t){let n;return e.forEach((r,i)=>{if(r.selection&&t--==0)return n=i,!1}),e.slice(n)}class no{constructor(t,n,r,i){this.map=t,this.step=n,this.selection=r,this.mirrorOffset=i}merge(t){if(this.step&&t.step&&!t.selection){let n=t.step.merge(this.step);if(n)return new no(n.getMap().invert(),n,this.selection)}}}class Ga{constructor(t,n,r,i,o){this.done=t,this.undone=n,this.prevRanges=r,this.prevTime=i,this.prevComposition=o}}const uLe=20;function cLe(e,t,n,r){let i=n.getMeta(vu),o;if(i)return i.historyState;n.getMeta(dLe)&&(e=new Ga(e.done,e.undone,null,0,-1));let a=n.getMeta("appendedTransaction");if(n.steps.length==0)return e;if(a&&a.getMeta(vu))return a.getMeta(vu).redo?new Ga(e.done.addTransform(n,void 0,r,fm(t)),e.undone,Kk(n.mapping.maps),e.prevTime,e.prevComposition):new Ga(e.done,e.undone.addTransform(n,void 0,r,fm(t)),null,e.prevTime,e.prevComposition);if(n.getMeta("addToHistory")!==!1&&!(a&&a.getMeta("addToHistory")===!1)){let s=n.getMeta("composition"),u=e.prevTime==0||!a&&e.prevComposition!=s&&(e.prevTime<(n.time||0)-r.newGroupDelay||!lLe(n,e.prevRanges)),c=a?p1(e.prevRanges,n.mapping):Kk(n.mapping.maps);return new Ga(e.done.addTransform(n,u?t.selection.getBookmark():void 0,r,fm(t)),Ii.empty,c,n.time,s??e.prevComposition)}else return(o=n.getMeta("rebased"))?new Ga(e.done.rebased(n,o),e.undone.rebased(n,o),p1(e.prevRanges,n.mapping),e.prevTime,e.prevComposition):new Ga(e.done.addMaps(n.mapping.maps),e.undone.addMaps(n.mapping.maps),p1(e.prevRanges,n.mapping),e.prevTime,e.prevComposition)}function lLe(e,t){if(!t)return!1;if(!e.docChanged)return!0;let n=!1;return e.mapping.maps[0].forEach((r,i)=>{for(let o=0;o<t.length;o+=2)r<=t[o+1]&&i>=t[o]&&(n=!0)}),n}function Kk(e){let t=[];for(let n=e.length-1;n>=0&&t.length==0;n--)e[n].forEach((r,i,o,a)=>t.push(o,a));return t}function p1(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 fLe(e,t,n){let r=fm(t),i=vu.get(t).spec.config,o=(n?e.undone:e.done).popEvent(t,r);if(!o)return null;let a=o.selection.resolve(o.transform.doc),s=(n?e.done:e.undone).addTransform(o.transform,t.selection.getBookmark(),i,r),u=new Ga(n?s:o.remaining,n?o.remaining:s,null,0,-1);return o.transform.setSelection(a).setMeta(vu,{redo:n,historyState:u})}let A1=!1,Nk=null;function fm(e){let t=e.plugins;if(Nk!=t){A1=!1,Nk=t;for(let n=0;n<t.length;n++)if(t[n].spec.historyPreserveItems){A1=!0;break}}return A1}const vu=new eo("history"),dLe=new eo("closeHistory");function pLe(e={}){return e={depth:e.depth||100,newGroupDelay:e.newGroupDelay||500},new zr({key:vu,state:{init(){return new Ga(Ii.empty,Ii.empty,null,0,-1)},apply(t,n,r){return cLe(n,r,t,e)}},config:e,props:{handleDOMEvents:{beforeinput(t,n){let r=n.inputType,i=r=="historyUndo"?$V:r=="historyRedo"?RV:null;return i?(n.preventDefault(),i(t.state,t.dispatch)):!1}}}})}function EV(e,t){return(n,r)=>{let i=vu.getState(n);if(!i||(e?i.undone:i.done).eventCount==0)return!1;if(r){let o=fLe(i,n,e);o&&r(t?o.scrollIntoView():o)}return!0}}const $V=EV(!1,!0),RV=EV(!0,!0),ALe=dr.create({name:"history",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:e,dispatch:t})=>$V(e,t),redo:()=>({state:e,dispatch:t})=>RV(e,t)}},addProseMirrorPlugins(){return[pLe(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 ur="top",ri="bottom",ii="right",cr="left",hO="auto",Rh=[ur,ri,ii,cr],Pl="start",_p="end",hLe="clippingParents",OV="viewport",Cd="popper",mLe="reference",qk=Rh.reduce(function(e,t){return e.concat([t+"-"+Pl,t+"-"+_p])},[]),FV=[].concat(Rh,[hO]).reduce(function(e,t){return e.concat([t,t+"-"+Pl,t+"-"+_p])},[]),gLe="beforeRead",vLe="read",yLe="afterRead",bLe="beforeMain",CLe="main",SLe="afterMain",_Le="beforeWrite",ILe="write",TLe="afterWrite",xLe=[gLe,vLe,yLe,bLe,CLe,SLe,_Le,ILe,TLe];function mo(e){return e?(e.nodeName||"").toLowerCase():null}function Lr(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function Bu(e){var t=Lr(e).Element;return e instanceof t||e instanceof Element}function ni(e){var t=Lr(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function mO(e){if(typeof ShadowRoot>"u")return!1;var t=Lr(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function wLe(e){var t=e.state;Object.keys(t.elements).forEach(function(n){var r=t.styles[n]||{},i=t.attributes[n]||{},o=t.elements[n];!ni(o)||!mo(o)||(Object.assign(o.style,r),Object.keys(i).forEach(function(a){var s=i[a];s===!1?o.removeAttribute(a):o.setAttribute(a,s===!0?"":s)}))})}function ELe(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(r){var i=t.elements[r],o=t.attributes[r]||{},a=Object.keys(t.styles.hasOwnProperty(r)?t.styles[r]:n[r]),s=a.reduce(function(u,c){return u[c]="",u},{});!ni(i)||!mo(i)||(Object.assign(i.style,s),Object.keys(o).forEach(function(u){i.removeAttribute(u)}))})}}const kV={name:"applyStyles",enabled:!0,phase:"write",fn:wLe,effect:ELe,requires:["computeStyles"]};function oo(e){return e.split("-")[0]}var yu=Math.max,ug=Math.min,Wl=Math.round;function OC(){var e=navigator.userAgentData;return e!=null&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function MV(){return!/^((?!chrome|android).)*safari/i.test(OC())}function Dl(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);var r=e.getBoundingClientRect(),i=1,o=1;t&&ni(e)&&(i=e.offsetWidth>0&&Wl(r.width)/e.offsetWidth||1,o=e.offsetHeight>0&&Wl(r.height)/e.offsetHeight||1);var a=Bu(e)?Lr(e):window,s=a.visualViewport,u=!MV()&&n,c=(r.left+(u&&s?s.offsetLeft:0))/i,l=(r.top+(u&&s?s.offsetTop:0))/o,d=r.width/i,p=r.height/o;return{width:d,height:p,top:l,right:c+d,bottom:l+p,left:c,x:c,y:l}}function gO(e){var t=Dl(e),n=e.offsetWidth,r=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function LV(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&mO(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function sa(e){return Lr(e).getComputedStyle(e)}function $Le(e){return["table","td","th"].indexOf(mo(e))>=0}function Gs(e){return((Bu(e)?e.ownerDocument:e.document)||window.document).documentElement}function tb(e){return mo(e)==="html"?e:e.assignedSlot||e.parentNode||(mO(e)?e.host:null)||Gs(e)}function Vk(e){return!ni(e)||sa(e).position==="fixed"?null:e.offsetParent}function RLe(e){var t=/firefox/i.test(OC()),n=/Trident/i.test(OC());if(n&&ni(e)){var r=sa(e);if(r.position==="fixed")return null}var i=tb(e);for(mO(i)&&(i=i.host);ni(i)&&["html","body"].indexOf(mo(i))<0;){var o=sa(i);if(o.transform!=="none"||o.perspective!=="none"||o.contain==="paint"||["transform","perspective"].indexOf(o.willChange)!==-1||t&&o.willChange==="filter"||t&&o.filter&&o.filter!=="none")return i;i=i.parentNode}return null}function Oh(e){for(var t=Lr(e),n=Vk(e);n&&$Le(n)&&sa(n).position==="static";)n=Vk(n);return n&&(mo(n)==="html"||mo(n)==="body"&&sa(n).position==="static")?t:n||RLe(e)||t}function vO(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function jd(e,t,n){return yu(e,ug(t,n))}function OLe(e,t,n){var r=jd(e,t,n);return r>n?n:r}function jV(){return{top:0,right:0,bottom:0,left:0}}function UV(e){return Object.assign({},jV(),e)}function BV(e,t){return t.reduce(function(n,r){return n[r]=e,n},{})}var FLe=function(t,n){return t=typeof t=="function"?t(Object.assign({},n.rects,{placement:n.placement})):t,UV(typeof t!="number"?t:BV(t,Rh))};function kLe(e){var t,n=e.state,r=e.name,i=e.options,o=n.elements.arrow,a=n.modifiersData.popperOffsets,s=oo(n.placement),u=vO(s),c=[cr,ii].indexOf(s)>=0,l=c?"height":"width";if(!(!o||!a)){var d=FLe(i.padding,n),p=gO(o),A=u==="y"?ur:cr,m=u==="y"?ri:ii,v=n.rects.reference[l]+n.rects.reference[u]-a[u]-n.rects.popper[l],_=a[u]-n.rects.reference[u],C=Oh(o),I=C?u==="y"?C.clientHeight||0:C.clientWidth||0:0,x=v/2-_/2,g=d[A],S=I-p[l]-d[m],y=I/2-p[l]/2+x,T=jd(g,y,S),w=u;n.modifiersData[r]=(t={},t[w]=T,t.centerOffset=T-y,t)}}function MLe(e){var t=e.state,n=e.options,r=n.element,i=r===void 0?"[data-popper-arrow]":r;i!=null&&(typeof i=="string"&&(i=t.elements.popper.querySelector(i),!i)||LV(t.elements.popper,i)&&(t.elements.arrow=i))}const LLe={name:"arrow",enabled:!0,phase:"main",fn:kLe,effect:MLe,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Kl(e){return e.split("-")[1]}var jLe={top:"auto",right:"auto",bottom:"auto",left:"auto"};function ULe(e,t){var n=e.x,r=e.y,i=t.devicePixelRatio||1;return{x:Wl(n*i)/i||0,y:Wl(r*i)/i||0}}function Qk(e){var t,n=e.popper,r=e.popperRect,i=e.placement,o=e.variation,a=e.offsets,s=e.position,u=e.gpuAcceleration,c=e.adaptive,l=e.roundOffsets,d=e.isFixed,p=a.x,A=p===void 0?0:p,m=a.y,v=m===void 0?0:m,_=typeof l=="function"?l({x:A,y:v}):{x:A,y:v};A=_.x,v=_.y;var C=a.hasOwnProperty("x"),I=a.hasOwnProperty("y"),x=cr,g=ur,S=window;if(c){var y=Oh(n),T="clientHeight",w="clientWidth";if(y===Lr(n)&&(y=Gs(n),sa(y).position!=="static"&&s==="absolute"&&(T="scrollHeight",w="scrollWidth")),y=y,i===ur||(i===cr||i===ii)&&o===_p){g=ri;var O=d&&y===S&&S.visualViewport?S.visualViewport.height:y[T];v-=O-r.height,v*=u?1:-1}if(i===cr||(i===ur||i===ri)&&o===_p){x=ii;var E=d&&y===S&&S.visualViewport?S.visualViewport.width:y[w];A-=E-r.width,A*=u?1:-1}}var F=Object.assign({position:s},c&&jLe),W=l===!0?ULe({x:A,y:v},Lr(n)):{x:A,y:v};if(A=W.x,v=W.y,u){var K;return Object.assign({},F,(K={},K[g]=I?"0":"",K[x]=C?"0":"",K.transform=(S.devicePixelRatio||1)<=1?"translate("+A+"px, "+v+"px)":"translate3d("+A+"px, "+v+"px, 0)",K))}return Object.assign({},F,(t={},t[g]=I?v+"px":"",t[x]=C?A+"px":"",t.transform="",t))}function BLe(e){var t=e.state,n=e.options,r=n.gpuAcceleration,i=r===void 0?!0:r,o=n.adaptive,a=o===void 0?!0:o,s=n.roundOffsets,u=s===void 0?!0:s,c={placement:oo(t.placement),variation:Kl(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:i,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,Qk(Object.assign({},c,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:a,roundOffsets:u})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,Qk(Object.assign({},c,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:u})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const PLe={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:BLe,data:{}};var Zh={passive:!0};function WLe(e){var t=e.state,n=e.instance,r=e.options,i=r.scroll,o=i===void 0?!0:i,a=r.resize,s=a===void 0?!0:a,u=Lr(t.elements.popper),c=[].concat(t.scrollParents.reference,t.scrollParents.popper);return o&&c.forEach(function(l){l.addEventListener("scroll",n.update,Zh)}),s&&u.addEventListener("resize",n.update,Zh),function(){o&&c.forEach(function(l){l.removeEventListener("scroll",n.update,Zh)}),s&&u.removeEventListener("resize",n.update,Zh)}}const DLe={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:WLe,data:{}};var KLe={left:"right",right:"left",bottom:"top",top:"bottom"};function dm(e){return e.replace(/left|right|bottom|top/g,function(t){return KLe[t]})}var NLe={start:"end",end:"start"};function zk(e){return e.replace(/start|end/g,function(t){return NLe[t]})}function yO(e){var t=Lr(e),n=t.pageXOffset,r=t.pageYOffset;return{scrollLeft:n,scrollTop:r}}function bO(e){return Dl(Gs(e)).left+yO(e).scrollLeft}function qLe(e,t){var n=Lr(e),r=Gs(e),i=n.visualViewport,o=r.clientWidth,a=r.clientHeight,s=0,u=0;if(i){o=i.width,a=i.height;var c=MV();(c||!c&&t==="fixed")&&(s=i.offsetLeft,u=i.offsetTop)}return{width:o,height:a,x:s+bO(e),y:u}}function VLe(e){var t,n=Gs(e),r=yO(e),i=(t=e.ownerDocument)==null?void 0:t.body,o=yu(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),a=yu(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),s=-r.scrollLeft+bO(e),u=-r.scrollTop;return sa(i||n).direction==="rtl"&&(s+=yu(n.clientWidth,i?i.clientWidth:0)-o),{width:o,height:a,x:s,y:u}}function CO(e){var t=sa(e),n=t.overflow,r=t.overflowX,i=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}function PV(e){return["html","body","#document"].indexOf(mo(e))>=0?e.ownerDocument.body:ni(e)&&CO(e)?e:PV(tb(e))}function Ud(e,t){var n;t===void 0&&(t=[]);var r=PV(e),i=r===((n=e.ownerDocument)==null?void 0:n.body),o=Lr(r),a=i?[o].concat(o.visualViewport||[],CO(r)?r:[]):r,s=t.concat(a);return i?s:s.concat(Ud(tb(a)))}function FC(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function QLe(e,t){var n=Dl(e,!1,t==="fixed");return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}function Hk(e,t,n){return t===OV?FC(qLe(e,n)):Bu(t)?QLe(t,n):FC(VLe(Gs(e)))}function zLe(e){var t=Ud(tb(e)),n=["absolute","fixed"].indexOf(sa(e).position)>=0,r=n&&ni(e)?Oh(e):e;return Bu(r)?t.filter(function(i){return Bu(i)&&LV(i,r)&&mo(i)!=="body"}):[]}function HLe(e,t,n,r){var i=t==="clippingParents"?zLe(e):[].concat(t),o=[].concat(i,[n]),a=o[0],s=o.reduce(function(u,c){var l=Hk(e,c,r);return u.top=yu(l.top,u.top),u.right=ug(l.right,u.right),u.bottom=ug(l.bottom,u.bottom),u.left=yu(l.left,u.left),u},Hk(e,a,r));return s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}function WV(e){var t=e.reference,n=e.element,r=e.placement,i=r?oo(r):null,o=r?Kl(r):null,a=t.x+t.width/2-n.width/2,s=t.y+t.height/2-n.height/2,u;switch(i){case ur:u={x:a,y:t.y-n.height};break;case ri:u={x:a,y:t.y+t.height};break;case ii:u={x:t.x+t.width,y:s};break;case cr:u={x:t.x-n.width,y:s};break;default:u={x:t.x,y:t.y}}var c=i?vO(i):null;if(c!=null){var l=c==="y"?"height":"width";switch(o){case Pl:u[c]=u[c]-(t[l]/2-n[l]/2);break;case _p:u[c]=u[c]+(t[l]/2-n[l]/2);break}}return u}function Ip(e,t){t===void 0&&(t={});var n=t,r=n.placement,i=r===void 0?e.placement:r,o=n.strategy,a=o===void 0?e.strategy:o,s=n.boundary,u=s===void 0?hLe:s,c=n.rootBoundary,l=c===void 0?OV:c,d=n.elementContext,p=d===void 0?Cd:d,A=n.altBoundary,m=A===void 0?!1:A,v=n.padding,_=v===void 0?0:v,C=UV(typeof _!="number"?_:BV(_,Rh)),I=p===Cd?mLe:Cd,x=e.rects.popper,g=e.elements[m?I:p],S=HLe(Bu(g)?g:g.contextElement||Gs(e.elements.popper),u,l,a),y=Dl(e.elements.reference),T=WV({reference:y,element:x,strategy:"absolute",placement:i}),w=FC(Object.assign({},x,T)),O=p===Cd?w:y,E={top:S.top-O.top+C.top,bottom:O.bottom-S.bottom+C.bottom,left:S.left-O.left+C.left,right:O.right-S.right+C.right},F=e.modifiersData.offset;if(p===Cd&&F){var W=F[i];Object.keys(E).forEach(function(K){var J=[ii,ri].indexOf(K)>=0?1:-1,ee=[ur,ri].indexOf(K)>=0?"y":"x";E[K]+=W[ee]*J})}return E}function YLe(e,t){t===void 0&&(t={});var n=t,r=n.placement,i=n.boundary,o=n.rootBoundary,a=n.padding,s=n.flipVariations,u=n.allowedAutoPlacements,c=u===void 0?FV:u,l=Kl(r),d=l?s?qk:qk.filter(function(m){return Kl(m)===l}):Rh,p=d.filter(function(m){return c.indexOf(m)>=0});p.length===0&&(p=d);var A=p.reduce(function(m,v){return m[v]=Ip(e,{placement:v,boundary:i,rootBoundary:o,padding:a})[oo(v)],m},{});return Object.keys(A).sort(function(m,v){return A[m]-A[v]})}function GLe(e){if(oo(e)===hO)return[];var t=dm(e);return[zk(e),t,zk(t)]}function JLe(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var i=n.mainAxis,o=i===void 0?!0:i,a=n.altAxis,s=a===void 0?!0:a,u=n.fallbackPlacements,c=n.padding,l=n.boundary,d=n.rootBoundary,p=n.altBoundary,A=n.flipVariations,m=A===void 0?!0:A,v=n.allowedAutoPlacements,_=t.options.placement,C=oo(_),I=C===_,x=u||(I||!m?[dm(_)]:GLe(_)),g=[_].concat(x).reduce(function(Ie,rt){return Ie.concat(oo(rt)===hO?YLe(t,{placement:rt,boundary:l,rootBoundary:d,padding:c,flipVariations:m,allowedAutoPlacements:v}):rt)},[]),S=t.rects.reference,y=t.rects.popper,T=new Map,w=!0,O=g[0],E=0;E<g.length;E++){var F=g[E],W=oo(F),K=Kl(F)===Pl,J=[ur,ri].indexOf(W)>=0,ee=J?"width":"height",re=Ip(t,{placement:F,boundary:l,rootBoundary:d,altBoundary:p,padding:c}),P=J?K?ii:cr:K?ri:ur;S[ee]>y[ee]&&(P=dm(P));var Y=dm(P),M=[];if(o&&M.push(re[W]<=0),s&&M.push(re[P]<=0,re[Y]<=0),M.every(function(Ie){return Ie})){O=F,w=!1;break}T.set(F,M)}if(w)for(var k=m?3:1,q=function(rt){var at=g.find(function(fn){var Zt=T.get(fn);if(Zt)return Zt.slice(0,rt).every(function(rr){return rr})});if(at)return O=at,"break"},ue=k;ue>0;ue--){var ke=q(ue);if(ke==="break")break}t.placement!==O&&(t.modifiersData[r]._skip=!0,t.placement=O,t.reset=!0)}}const ZLe={name:"flip",enabled:!0,phase:"main",fn:JLe,requiresIfExists:["offset"],data:{_skip:!1}};function Yk(e,t,n){return n===void 0&&(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 Gk(e){return[ur,ii,ri,cr].some(function(t){return e[t]>=0})}function XLe(e){var t=e.state,n=e.name,r=t.rects.reference,i=t.rects.popper,o=t.modifiersData.preventOverflow,a=Ip(t,{elementContext:"reference"}),s=Ip(t,{altBoundary:!0}),u=Yk(a,r),c=Yk(s,i,o),l=Gk(u),d=Gk(c);t.modifiersData[n]={referenceClippingOffsets:u,popperEscapeOffsets:c,isReferenceHidden:l,hasPopperEscaped:d},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":l,"data-popper-escaped":d})}const eje={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:XLe};function tje(e,t,n){var r=oo(e),i=[cr,ur].indexOf(r)>=0?-1:1,o=typeof n=="function"?n(Object.assign({},t,{placement:e})):n,a=o[0],s=o[1];return a=a||0,s=(s||0)*i,[cr,ii].indexOf(r)>=0?{x:s,y:a}:{x:a,y:s}}function nje(e){var t=e.state,n=e.options,r=e.name,i=n.offset,o=i===void 0?[0,0]:i,a=FV.reduce(function(l,d){return l[d]=tje(d,t.rects,o),l},{}),s=a[t.placement],u=s.x,c=s.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=u,t.modifiersData.popperOffsets.y+=c),t.modifiersData[r]=a}const rje={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:nje};function ije(e){var t=e.state,n=e.name;t.modifiersData[n]=WV({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})}const oje={name:"popperOffsets",enabled:!0,phase:"read",fn:ije,data:{}};function aje(e){return e==="x"?"y":"x"}function sje(e){var t=e.state,n=e.options,r=e.name,i=n.mainAxis,o=i===void 0?!0:i,a=n.altAxis,s=a===void 0?!1:a,u=n.boundary,c=n.rootBoundary,l=n.altBoundary,d=n.padding,p=n.tether,A=p===void 0?!0:p,m=n.tetherOffset,v=m===void 0?0:m,_=Ip(t,{boundary:u,rootBoundary:c,padding:d,altBoundary:l}),C=oo(t.placement),I=Kl(t.placement),x=!I,g=vO(C),S=aje(g),y=t.modifiersData.popperOffsets,T=t.rects.reference,w=t.rects.popper,O=typeof v=="function"?v(Object.assign({},t.rects,{placement:t.placement})):v,E=typeof O=="number"?{mainAxis:O,altAxis:O}:Object.assign({mainAxis:0,altAxis:0},O),F=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,W={x:0,y:0};if(y){if(o){var K,J=g==="y"?ur:cr,ee=g==="y"?ri:ii,re=g==="y"?"height":"width",P=y[g],Y=P+_[J],M=P-_[ee],k=A?-w[re]/2:0,q=I===Pl?T[re]:w[re],ue=I===Pl?-w[re]:-T[re],ke=t.elements.arrow,Ie=A&&ke?gO(ke):{width:0,height:0},rt=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:jV(),at=rt[J],fn=rt[ee],Zt=jd(0,T[re],Ie[re]),rr=x?T[re]/2-k-Zt-at-E.mainAxis:q-Zt-at-E.mainAxis,dn=x?-T[re]/2+k+Zt+fn+E.mainAxis:ue+Zt+fn+E.mainAxis,Hr=t.elements.arrow&&Oh(t.elements.arrow),Yr=Hr?g==="y"?Hr.clientTop||0:Hr.clientLeft||0:0,De=(K=F==null?void 0:F[g])!=null?K:0,dt=P+rr-De-Yr,St=P+dn-De,st=jd(A?ug(Y,dt):Y,P,A?yu(M,St):M);y[g]=st,W[g]=st-P}if(s){var Wt,gi=g==="x"?ur:cr,_r=g==="x"?ri:ii,ir=y[S],Gr=S==="y"?"height":"width",vi=ir+_[gi],yi=ir-_[_r],jo=[ur,cr].indexOf(C)!==-1,Uo=(Wt=F==null?void 0:F[S])!=null?Wt:0,Bo=jo?vi:ir-T[Gr]-w[Gr]-Uo+E.altAxis,Jr=jo?ir+T[Gr]+w[Gr]-Uo-E.altAxis:yi,za=A&&jo?OLe(Bo,ir,Jr):jd(A?Bo:vi,ir,A?Jr:yi);y[S]=za,W[S]=za-ir}t.modifiersData[r]=W}}const uje={name:"preventOverflow",enabled:!0,phase:"main",fn:sje,requiresIfExists:["offset"]};function cje(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function lje(e){return e===Lr(e)||!ni(e)?yO(e):cje(e)}function fje(e){var t=e.getBoundingClientRect(),n=Wl(t.width)/e.offsetWidth||1,r=Wl(t.height)/e.offsetHeight||1;return n!==1||r!==1}function dje(e,t,n){n===void 0&&(n=!1);var r=ni(t),i=ni(t)&&fje(t),o=Gs(t),a=Dl(e,i,n),s={scrollLeft:0,scrollTop:0},u={x:0,y:0};return(r||!r&&!n)&&((mo(t)!=="body"||CO(o))&&(s=lje(t)),ni(t)?(u=Dl(t,!0),u.x+=t.clientLeft,u.y+=t.clientTop):o&&(u.x=bO(o))),{x:a.left+s.scrollLeft-u.x,y:a.top+s.scrollTop-u.y,width:a.width,height:a.height}}function pje(e){var t=new Map,n=new Set,r=[];e.forEach(function(o){t.set(o.name,o)});function i(o){n.add(o.name);var a=[].concat(o.requires||[],o.requiresIfExists||[]);a.forEach(function(s){if(!n.has(s)){var u=t.get(s);u&&i(u)}}),r.push(o)}return e.forEach(function(o){n.has(o.name)||i(o)}),r}function Aje(e){var t=pje(e);return xLe.reduce(function(n,r){return n.concat(t.filter(function(i){return i.phase===r}))},[])}function hje(e){var t;return function(){return t||(t=new Promise(function(n){Promise.resolve().then(function(){t=void 0,n(e())})})),t}}function mje(e){var t=e.reduce(function(n,r){var i=n[r.name];return n[r.name]=i?Object.assign({},i,r,{options:Object.assign({},i.options,r.options),data:Object.assign({},i.data,r.data)}):r,n},{});return Object.keys(t).map(function(n){return t[n]})}var Jk={placement:"bottom",modifiers:[],strategy:"absolute"};function Zk(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return!t.some(function(r){return!(r&&typeof r.getBoundingClientRect=="function")})}function gje(e){e===void 0&&(e={});var t=e,n=t.defaultModifiers,r=n===void 0?[]:n,i=t.defaultOptions,o=i===void 0?Jk:i;return function(s,u,c){c===void 0&&(c=o);var l={placement:"bottom",orderedModifiers:[],options:Object.assign({},Jk,o),modifiersData:{},elements:{reference:s,popper:u},attributes:{},styles:{}},d=[],p=!1,A={state:l,setOptions:function(C){var I=typeof C=="function"?C(l.options):C;v(),l.options=Object.assign({},o,l.options,I),l.scrollParents={reference:Bu(s)?Ud(s):s.contextElement?Ud(s.contextElement):[],popper:Ud(u)};var x=Aje(mje([].concat(r,l.options.modifiers)));return l.orderedModifiers=x.filter(function(g){return g.enabled}),m(),A.update()},forceUpdate:function(){if(!p){var C=l.elements,I=C.reference,x=C.popper;if(Zk(I,x)){l.rects={reference:dje(I,Oh(x),l.options.strategy==="fixed"),popper:gO(x)},l.reset=!1,l.placement=l.options.placement,l.orderedModifiers.forEach(function(E){return l.modifiersData[E.name]=Object.assign({},E.data)});for(var g=0;g<l.orderedModifiers.length;g++){if(l.reset===!0){l.reset=!1,g=-1;continue}var S=l.orderedModifiers[g],y=S.fn,T=S.options,w=T===void 0?{}:T,O=S.name;typeof y=="function"&&(l=y({state:l,options:w,name:O,instance:A})||l)}}}},update:hje(function(){return new Promise(function(_){A.forceUpdate(),_(l)})}),destroy:function(){v(),p=!0}};if(!Zk(s,u))return A;A.setOptions(c).then(function(_){!p&&c.onFirstUpdate&&c.onFirstUpdate(_)});function m(){l.orderedModifiers.forEach(function(_){var C=_.name,I=_.options,x=I===void 0?{}:I,g=_.effect;if(typeof g=="function"){var S=g({state:l,name:C,instance:A,options:x}),y=function(){};d.push(S||y)}})}function v(){d.forEach(function(_){return _()}),d=[]}return A}}var vje=[DLe,oje,PLe,kV,rje,ZLe,uje,LLe,eje],yje=gje({defaultModifiers:vje}),bje="tippy-box",DV="tippy-content",Cje="tippy-backdrop",KV="tippy-arrow",NV="tippy-svg-arrow",nu={passive:!0,capture:!0},qV=function(){return document.body};function Sje(e,t){return{}.hasOwnProperty.call(e,t)}function h1(e,t,n){if(Array.isArray(e)){var r=e[t];return r??(Array.isArray(n)?n[t]:n)}return e}function SO(e,t){var n={}.toString.call(e);return n.indexOf("[object")===0&&n.indexOf(t+"]")>-1}function VV(e,t){return typeof e=="function"?e.apply(void 0,t):e}function Xk(e,t){if(t===0)return e;var n;return function(r){clearTimeout(n),n=setTimeout(function(){e(r)},t)}}function _je(e,t){var n=Object.assign({},e);return t.forEach(function(r){delete n[r]}),n}function Ije(e){return e.split(/\s+/).filter(Boolean)}function cl(e){return[].concat(e)}function eM(e,t){e.indexOf(t)===-1&&e.push(t)}function Tje(e){return e.filter(function(t,n){return e.indexOf(t)===n})}function xje(e){return e.split("-")[0]}function cg(e){return[].slice.call(e)}function tM(e){return Object.keys(e).reduce(function(t,n){return e[n]!==void 0&&(t[n]=e[n]),t},{})}function Bd(){return document.createElement("div")}function Tp(e){return["Element","Fragment"].some(function(t){return SO(e,t)})}function wje(e){return SO(e,"NodeList")}function Eje(e){return SO(e,"MouseEvent")}function $je(e){return!!(e&&e._tippy&&e._tippy.reference===e)}function Rje(e){return Tp(e)?[e]:wje(e)?cg(e):Array.isArray(e)?e:cg(document.querySelectorAll(e))}function m1(e,t){e.forEach(function(n){n&&(n.style.transitionDuration=t+"ms")})}function nM(e,t){e.forEach(function(n){n&&n.setAttribute("data-state",t)})}function Oje(e){var t,n=cl(e),r=n[0];return r!=null&&(t=r.ownerDocument)!=null&&t.body?r.ownerDocument:document}function Fje(e,t){var n=t.clientX,r=t.clientY;return e.every(function(i){var o=i.popperRect,a=i.popperState,s=i.props,u=s.interactiveBorder,c=xje(a.placement),l=a.modifiersData.offset;if(!l)return!0;var d=c==="bottom"?l.top.y:0,p=c==="top"?l.bottom.y:0,A=c==="right"?l.left.x:0,m=c==="left"?l.right.x:0,v=o.top-r+d>u,_=r-o.bottom-p>u,C=o.left-n+A>u,I=n-o.right-m>u;return v||_||C||I})}function g1(e,t,n){var r=t+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(i){e[r](i,n)})}function rM(e,t){for(var n=t;n;){var r;if(e.contains(n))return!0;n=n.getRootNode==null||(r=n.getRootNode())==null?void 0:r.host}return!1}var ro={isTouch:!1},iM=0;function kje(){ro.isTouch||(ro.isTouch=!0,window.performance&&document.addEventListener("mousemove",QV))}function QV(){var e=performance.now();e-iM<20&&(ro.isTouch=!1,document.removeEventListener("mousemove",QV)),iM=e}function Mje(){var e=document.activeElement;if($je(e)){var t=e._tippy;e.blur&&!t.state.isVisible&&e.blur()}}function Lje(){document.addEventListener("touchstart",kje,nu),window.addEventListener("blur",Mje)}var jje=typeof window<"u"&&typeof document<"u",Uje=jje?!!window.msCrypto:!1;function tl(e){var t=e==="destroy"?"n already-":" ";return[e+"() was called on a"+t+"destroyed instance. This is a no-op but","indicates a potential memory leak."].join(" ")}function oM(e){var t=/[ \t]{2,}/g,n=/^[ \t]*/gm;return e.replace(t," ").replace(n,"").trim()}function Bje(e){return oM(`
47
+ `,textSerializers:a={}}=n||{};let s="";return e.nodesBetween(r,i,(u,c,l,d)=>{var p;u.isBlock&&c>r&&(s+=o);const A=a==null?void 0:a[u.type.name];if(A)return l&&(s+=A({node:u,pos:c,parent:l,index:d,range:t})),!1;u.isText&&(s+=(p=u==null?void 0:u.text)===null||p===void 0?void 0:p.slice(Math.max(r,c)-c,i-c))}),s}function kke(e){return Object.fromEntries(Object.entries(e.nodes).filter(([,t])=>t.spec.toText).map(([t,n])=>[t,n.spec.toText]))}dr.create({name:"clipboardTextSerializer",addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new zr({key:new eo("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:e}=this,{state:t,schema:n}=e,{doc:r,selection:i}=t,{ranges:o}=i,a=Math.min(...o.map(l=>l.$from.pos)),s=Math.max(...o.map(l=>l.$to.pos)),u=kke(n);return Fke(r,{from:a,to:s},{...this.options.blockSeparator!==void 0?{blockSeparator:this.options.blockSeparator}:{},textSerializers:u})}}})]}});const Mke=()=>({editor:e,view:t})=>(requestAnimationFrame(()=>{var n;e.isDestroyed||(t.dom.blur(),(n=window==null?void 0:window.getSelection())===null||n===void 0||n.removeAllRanges())}),!0),Lke=(e=!1)=>({commands:t})=>t.setContent("",e),jke=()=>({state:e,tr:t,dispatch:n})=>{const{selection:r}=t,{ranges:i}=r;return n&&i.forEach(({$from:o,$to:a})=>{e.doc.nodesBetween(o.pos,a.pos,(s,u)=>{if(s.type.isText)return;const{doc:c,mapping:l}=t,d=c.resolve(l.map(u)),p=c.resolve(l.map(u+s.nodeSize)),A=d.blockRange(p);if(!A)return;const m=NFe(A);if(s.type.isTextblock){const{defaultType:v}=d.parent.contentMatchAt(d.index());t.setNodeMarkup(A.start,v)}(m||m===0)&&t.lift(A,m)})}),!0},Uke=e=>t=>e(t),Bke=()=>({state:e,dispatch:t})=>oke(e,t),Pke=(e,t)=>({editor:n,tr:r})=>{const{state:i}=n,o=i.doc.slice(e.from,e.to);r.deleteRange(e.from,e.to);const a=r.mapping.map(t);return r.insert(a,o.content),r.setSelection(new Be(r.doc.resolve(a-1))),!0},Wke=()=>({tr:e,dispatch:t})=>{const{selection:n}=e,r=n.$anchor.node();if(r.content.size>0)return!1;const i=e.selection.$anchor;for(let o=i.depth;o>0;o-=1)if(i.node(o).type===r.type){if(t){const s=i.before(o),u=i.after(o);e.delete(s,u).scrollIntoView()}return!0}return!1},Dke=e=>({tr:t,state:n,dispatch:r})=>{const i=Cn(e,n.schema),o=t.selection.$anchor;for(let a=o.depth;a>0;a-=1)if(o.node(a).type===i){if(r){const u=o.before(a),c=o.after(a);t.delete(u,c).scrollIntoView()}return!0}return!1},Kke=e=>({tr:t,dispatch:n})=>{const{from:r,to:i}=e;return n&&t.delete(r,i),!0},Nke=()=>({state:e,dispatch:t})=>zFe(e,t),qke=()=>({commands:e})=>e.keyboardShortcut("Enter"),Vke=()=>({state:e,dispatch:t})=>ike(e,t);function ng(e,t,n={strict:!0}){const r=Object.keys(t);return r.length?r.every(i=>n.strict?t[i]===e[i]:uO(t[i])?t[i].test(e[i]):t[i]===e[i]):!0}function EC(e,t,n={}){return e.find(r=>r.type===t&&ng(r.attrs,n))}function Qke(e,t,n={}){return!!EC(e,t,n)}function lO(e,t,n={}){if(!e||!t)return;let r=e.parent.childAfter(e.parentOffset);if(e.parentOffset===r.offset&&r.offset!==0&&(r=e.parent.childBefore(e.parentOffset)),!r.node)return;const i=EC([...r.node.marks],t,n);if(!i)return;let o=r.index,a=e.start()+r.offset,s=o+1,u=a+r.node.nodeSize;for(EC([...r.node.marks],t,n);o>0&&i.isInSet(e.parent.child(o-1).marks);)o-=1,a-=e.parent.child(o).nodeSize;for(;s<e.parent.childCount&&Qke([...e.parent.child(s).marks],t,n);)u+=e.parent.child(s).nodeSize,s+=1;return{from:a,to:u}}function Ys(e,t){if(typeof e=="string"){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}const zke=(e,t={})=>({tr:n,state:r,dispatch:i})=>{const o=Ys(e,r.schema),{doc:a,selection:s}=n,{$from:u,from:c,to:l}=s;if(i){const d=lO(u,o,t);if(d&&d.from<=c&&d.to>=l){const p=Be.create(a,d.from,d.to);n.setSelection(p)}}return!0},Hke=e=>t=>{const n=typeof e=="function"?e(t):e;for(let r=0;r<n.length;r+=1)if(n[r](t))return!0;return!1};function fO(e){return e instanceof Be}function Zo(e=0,t=0,n=0){return Math.min(Math.max(e,t),n)}function Yke(e,t=null){if(!t)return null;const n=ze.atStart(e),r=ze.atEnd(e);if(t==="start"||t===!0)return n;if(t==="end")return r;const i=n.from,o=r.to;return t==="all"?Be.create(e,Zo(0,i,o),Zo(e.content.size,i,o)):Be.create(e,Zo(t,i,o),Zo(t,i,o))}function eb(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}const Gke=(e=null,t={})=>({editor:n,view:r,tr:i,dispatch:o})=>{t={scrollIntoView:!0,...t};const a=()=>{eb()&&r.dom.focus(),requestAnimationFrame(()=>{n.isDestroyed||(r.focus(),t!=null&&t.scrollIntoView&&n.commands.scrollIntoView())})};if(r.hasFocus()&&e===null||e===!1)return!0;if(o&&e===null&&!fO(n.state.selection))return a(),!0;const s=Yke(i.doc,e)||n.state.selection,u=n.state.selection.eq(s);return o&&(u||i.setSelection(s),u&&i.storedMarks&&i.setStoredMarks(i.storedMarks),a()),!0},Jke=(e,t)=>n=>e.every((r,i)=>t(r,{...n,index:i})),Zke=(e,t)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},e,t),SV=e=>{const t=e.childNodes;for(let n=t.length-1;n>=0;n-=1){const r=t[n];r.nodeType===3&&r.nodeValue&&/^(\n\s\s|\n)$/.test(r.nodeValue)?e.removeChild(r):r.nodeType===1&&SV(r)}return e};function Jh(e){const t=`<body>${e}</body>`,n=new window.DOMParser().parseFromString(t,"text/html").body;return SV(n)}function rg(e,t,n){n={slice:!0,parseOptions:{},...n};const r=typeof e=="object"&&e!==null,i=typeof e=="string";if(r)try{if(Array.isArray(e)&&e.length>0)return X.fromArray(e.map(s=>t.nodeFromJSON(s)));const a=t.nodeFromJSON(e);return n.errorOnInvalidContent&&a.check(),a}catch(o){if(n.errorOnInvalidContent)throw new Error("[tiptap error]: Invalid JSON content",{cause:o});return console.warn("[tiptap warn]: Invalid content.","Passed value:",e,"Error:",o),rg("",t,n)}if(i){if(n.errorOnInvalidContent){let a=!1,s="";const u=new g8({topNode:t.spec.topNode,marks:t.spec.marks,nodes:t.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:"inline*",group:"block",parseDOM:[{tag:"*",getAttrs:c=>(a=!0,s=typeof c=="string"?c:c.outerHTML,null)}]}})});if(n.slice?hu.fromSchema(u).parseSlice(Jh(e),n.parseOptions):hu.fromSchema(u).parse(Jh(e),n.parseOptions),n.errorOnInvalidContent&&a)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${s}`)})}const o=hu.fromSchema(t);return n.slice?o.parseSlice(Jh(e),n.parseOptions).content:o.parse(Jh(e),n.parseOptions)}return rg("",t,n)}function Xke(e,t,n){const r=e.steps.length-1;if(r<t)return;const i=e.steps[r];if(!(i instanceof zo||i instanceof gl))return;const o=e.mapping.maps[r];let a=0;o.forEach((s,u,c,l)=>{a===0&&(a=l)}),e.setSelection(ze.near(e.doc.resolve(a),n))}const eMe=e=>!("type"in e),tMe=(e,t,n)=>({tr:r,dispatch:i,editor:o})=>{var a;if(i){n={parseOptions:{},updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...n};let s;try{s=rg(t,o.schema,{parseOptions:{preserveWhitespace:"full",...n.parseOptions},errorOnInvalidContent:(a=n.errorOnInvalidContent)!==null&&a!==void 0?a:o.options.enableContentCheck})}catch(m){return o.emit("contentError",{editor:o,error:m,disableCollaboration:()=>{console.error("[tiptap error]: Unable to disable collaboration at this point in time")}}),!1}let{from:u,to:c}=typeof e=="number"?{from:e,to:e}:{from:e.from,to:e.to},l=!0,d=!0;if((eMe(s)?s:[s]).forEach(m=>{m.check(),l=l?m.isText&&m.marks.length===0:!1,d=d?m.isBlock:!1}),u===c&&d){const{parent:m}=r.doc.resolve(u);m.isTextblock&&!m.type.spec.code&&!m.childCount&&(u-=1,c+=1)}let A;l?(Array.isArray(t)?A=t.map(m=>m.text||"").join(""):typeof t=="object"&&t&&t.text?A=t.text:A=t,r.insertText(A,u,c)):(A=s,r.replaceWith(u,c,A)),n.updateSelection&&Xke(r,r.steps.length-1,-1),n.applyInputRules&&r.setMeta("applyInputRules",{from:u,text:A}),n.applyPasteRules&&r.setMeta("applyPasteRules",{from:u,text:A})}return!0},nMe=()=>({state:e,dispatch:t})=>eke(e,t),rMe=()=>({state:e,dispatch:t})=>tke(e,t),iMe=()=>({state:e,dispatch:t})=>HFe(e,t),oMe=()=>({state:e,dispatch:t})=>ZFe(e,t),aMe=()=>({state:e,dispatch:t,tr:n})=>{try{const r=pV(e.doc,e.selection.$from.pos,-1);return r==null?!1:(n.join(r,2),t&&t(n),!0)}catch{return!1}},sMe=()=>({state:e,dispatch:t,tr:n})=>{try{const r=pV(e.doc,e.selection.$from.pos,1);return r==null?!1:(n.join(r,2),t&&t(n),!0)}catch{return!1}},uMe=()=>({state:e,dispatch:t})=>YFe(e,t),cMe=()=>({state:e,dispatch:t})=>GFe(e,t);function _V(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function lMe(e){const t=e.split(/-(?!$)/);let n=t[t.length-1];n==="Space"&&(n=" ");let r,i,o,a;for(let s=0;s<t.length-1;s+=1){const u=t[s];if(/^(cmd|meta|m)$/i.test(u))a=!0;else if(/^a(lt)?$/i.test(u))r=!0;else if(/^(c|ctrl|control)$/i.test(u))i=!0;else if(/^s(hift)?$/i.test(u))o=!0;else if(/^mod$/i.test(u))eb()||_V()?a=!0:i=!0;else throw new Error(`Unrecognized modifier name: ${u}`)}return r&&(n=`Alt-${n}`),i&&(n=`Ctrl-${n}`),a&&(n=`Meta-${n}`),o&&(n=`Shift-${n}`),n}const fMe=e=>({editor:t,view:n,tr:r,dispatch:i})=>{const o=lMe(e).split(/-(?!$)/),a=o.find(c=>!["Alt","Ctrl","Meta","Shift"].includes(c)),s=new KeyboardEvent("keydown",{key:a==="Space"?" ":a,altKey:o.includes("Alt"),ctrlKey:o.includes("Ctrl"),metaKey:o.includes("Meta"),shiftKey:o.includes("Shift"),bubbles:!0,cancelable:!0}),u=t.captureTransaction(()=>{n.someProp("handleKeyDown",c=>c(n,s))});return u==null||u.steps.forEach(c=>{const l=c.map(r.mapping);l&&i&&r.maybeStep(l)}),!0};function dO(e,t,n={}){const{from:r,to:i,empty:o}=e.selection,a=t?Cn(t,e.schema):null,s=[];e.doc.nodesBetween(r,i,(d,p)=>{if(d.isText)return;const A=Math.max(r,p),m=Math.min(i,p+d.nodeSize);s.push({node:d,from:A,to:m})});const u=i-r,c=s.filter(d=>a?a.name===d.node.type.name:!0).filter(d=>ng(d.node.attrs,n,{strict:!1}));return o?!!c.length:c.reduce((d,p)=>d+p.to-p.from,0)>=u}const dMe=(e,t={})=>({state:n,dispatch:r})=>{const i=Cn(e,n.schema);return dO(n,i,t)?nke(n,r):!1},pMe=()=>({state:e,dispatch:t})=>ake(e,t),AMe=e=>({state:t,dispatch:n})=>{const r=Cn(e,t.schema);return Ake(r)(t,n)},hMe=()=>({state:e,dispatch:t})=>rke(e,t);function IV(e,t){return t.nodes[e]?"node":t.marks[e]?"mark":null}function Pk(e,t){const n=typeof t=="string"?[t]:t;return Object.keys(e).reduce((r,i)=>(n.includes(i)||(r[i]=e[i]),r),{})}const mMe=(e,t)=>({tr:n,state:r,dispatch:i})=>{let o=null,a=null;const s=IV(typeof e=="string"?e:e.name,r.schema);return s?(s==="node"&&(o=Cn(e,r.schema)),s==="mark"&&(a=Ys(e,r.schema)),i&&n.selection.ranges.forEach(u=>{r.doc.nodesBetween(u.$from.pos,u.$to.pos,(c,l)=>{o&&o===c.type&&n.setNodeMarkup(l,void 0,Pk(c.attrs,t)),a&&c.marks.length&&c.marks.forEach(d=>{a===d.type&&n.addMark(l,l+c.nodeSize,a.create(Pk(d.attrs,t)))})})}),!0):!1},gMe=()=>({tr:e,dispatch:t})=>(t&&e.scrollIntoView(),!0),vMe=()=>({tr:e,commands:t})=>t.setTextSelection({from:0,to:e.doc.content.size}),yMe=()=>({state:e,dispatch:t})=>JFe(e,t),bMe=()=>({state:e,dispatch:t})=>XFe(e,t),CMe=()=>({state:e,dispatch:t})=>ske(e,t),SMe=()=>({state:e,dispatch:t})=>lke(e,t),_Me=()=>({state:e,dispatch:t})=>cke(e,t);function IMe(e,t,n={},r={}){return rg(e,t,{slice:!1,parseOptions:n,errorOnInvalidContent:r.errorOnInvalidContent})}const TMe=(e,t=!1,n={},r={})=>({editor:i,tr:o,dispatch:a,commands:s})=>{var u,c;const{doc:l}=o;if(n.preserveWhitespace!=="full"){const d=IMe(e,i.schema,n,{errorOnInvalidContent:(u=r.errorOnInvalidContent)!==null&&u!==void 0?u:i.options.enableContentCheck});return a&&o.replaceWith(0,l.content.size,d).setMeta("preventUpdate",!t),!0}return a&&o.setMeta("preventUpdate",!t),s.insertContentAt({from:0,to:l.content.size},e,{parseOptions:n,errorOnInvalidContent:(c=r.errorOnInvalidContent)!==null&&c!==void 0?c:i.options.enableContentCheck})};function pO(e,t){const n=Ys(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,u=>{a.push(...u.marks)});const s=a.find(u=>u.type.name===n.name);return s?{...s.attrs}:{}}function xMe(e){for(let t=0;t<e.edgeCount;t+=1){const{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}function wMe(e,t){for(let n=e.depth;n>0;n-=1){const r=e.node(n);if(t(r))return{pos:n>0?e.before(n):0,start:e.start(n),depth:n,node:r}}}function AO(e){return t=>wMe(t.$from,e)}function EMe(e,t){const n=dl.resolve(e);return CV(n,t)}function TV(e,t,n){const r=[];return e===t?n.resolve(e).marks().forEach(i=>{const o=n.resolve(e),a=lO(o,i.type);a&&r.push({mark:i,...a})}):n.nodesBetween(e,t,(i,o)=>{!i||(i==null?void 0:i.nodeSize)===void 0||r.push(...i.marks.map(a=>({from:o,to:o+i.nodeSize,mark:a})))}),r}function lm(e,t,n){return Object.fromEntries(Object.entries(n).filter(([r])=>{const i=e.find(o=>o.type===t&&o.name===r);return i?i.attribute.keepOnSplit:!1}))}function $Me(e,t,n={}){const{empty:r,ranges:i}=e.selection,o=t?Ys(t,e.schema):null;if(r)return!!(e.storedMarks||e.selection.$from.marks()).filter(d=>o?o.name===d.type.name:!0).find(d=>ng(d.attrs,n,{strict:!1}));let a=0;const s=[];if(i.forEach(({$from:d,$to:p})=>{const A=d.pos,m=p.pos;e.doc.nodesBetween(A,m,(v,_)=>{if(!v.isText&&!v.marks.length)return;const C=Math.max(A,_),I=Math.min(m,_+v.nodeSize),x=I-C;a+=x,s.push(...v.marks.map(g=>({mark:g,from:C,to:I})))})}),a===0)return!1;const u=s.filter(d=>o?o.name===d.mark.type.name:!0).filter(d=>ng(d.mark.attrs,n,{strict:!1})).reduce((d,p)=>d+p.to-p.from,0),c=s.filter(d=>o?d.mark.type!==o&&d.mark.type.excludes(o):!0).reduce((d,p)=>d+p.to-p.from,0);return(u>0?u+c:u)>=a}function Wk(e,t){const{nodeExtensions:n}=Z0(t),r=n.find(a=>a.name===e);if(!r)return!1;const i={name:r.name,options:r.options,storage:r.storage},o=Ue(ce(r,"group",i));return typeof o!="string"?!1:o.split(" ").includes("list")}function xV(e,{checkChildren:t=!0,ignoreWhitespace:n=!1}={}){var r;if(n){if(e.type.name==="hardBreak")return!0;if(e.isText)return/^\s*$/m.test((r=e.text)!==null&&r!==void 0?r:"")}if(e.isText)return!e.text;if(e.isAtom||e.isLeaf)return!1;if(e.content.childCount===0)return!0;if(t){let i=!0;return e.content.forEach(o=>{i!==!1&&(xV(o,{ignoreWhitespace:n,checkChildren:t})||(i=!1))}),i}return!1}function RMe(e){return e instanceof ve}function OMe(e,t,n){const i=e.state.doc.content.size,o=Zo(t,0,i),a=Zo(n,0,i),s=e.coordsAtPos(o),u=e.coordsAtPos(a,-1),c=Math.min(s.top,u.top),l=Math.max(s.bottom,u.bottom),d=Math.min(s.left,u.left),p=Math.max(s.right,u.right),A=p-d,m=l-c,C={top:c,bottom:l,left:d,right:p,width:A,height:m,x:d,y:c};return{...C,toJSON:()=>C}}function FMe(e,t,n){var r;const{selection:i}=t;let o=null;if(fO(i)&&(o=i.$cursor),o){const s=(r=e.storedMarks)!==null&&r!==void 0?r:o.marks();return!!n.isInSet(s)||!s.some(u=>u.type.excludes(n))}const{ranges:a}=i;return a.some(({$from:s,$to:u})=>{let c=s.depth===0?e.doc.inlineContent&&e.doc.type.allowsMarkType(n):!1;return e.doc.nodesBetween(s.pos,u.pos,(l,d,p)=>{if(c)return!1;if(l.isInline){const A=!p||p.type.allowsMarkType(n),m=!!n.isInSet(l.marks)||!l.marks.some(v=>v.type.excludes(n));c=A&&m}return!c}),c})}const kMe=(e,t={})=>({tr:n,state:r,dispatch:i})=>{const{selection:o}=n,{empty:a,ranges:s}=o,u=Ys(e,r.schema);if(i)if(a){const c=pO(r,u);n.addStoredMark(u.create({...c,...t}))}else s.forEach(c=>{const l=c.$from.pos,d=c.$to.pos;r.doc.nodesBetween(l,d,(p,A)=>{const m=Math.max(A,l),v=Math.min(A+p.nodeSize,d);p.marks.find(C=>C.type===u)?p.marks.forEach(C=>{u===C.type&&n.addMark(m,v,u.create({...C.attrs,...t}))}):n.addMark(m,v,u.create(t))})});return FMe(r,n,u)},MMe=(e,t)=>({tr:n})=>(n.setMeta(e,t),!0),LMe=(e,t={})=>({state:n,dispatch:r,chain:i})=>{const o=Cn(e,n.schema);return o.isTextblock?i().command(({commands:a})=>Lk(o,t)(n)?!0:a.clearNodes()).command(({state:a})=>Lk(o,t)(a,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},jMe=e=>({tr:t,dispatch:n})=>{if(n){const{doc:r}=t,i=Zo(e,0,r.content.size),o=ve.create(r,i);t.setSelection(o)}return!0},UMe=e=>({tr:t,dispatch:n})=>{if(n){const{doc:r}=t,{from:i,to:o}=typeof e=="number"?{from:e,to:e}:e,a=Be.atStart(r).from,s=Be.atEnd(r).to,u=Zo(i,a,s),c=Zo(o,a,s),l=Be.create(r,u,c);t.setSelection(l)}return!0},BMe=e=>({state:t,dispatch:n})=>{const r=Cn(e,t.schema);return gke(r)(t,n)};function Dk(e,t){const n=e.storedMarks||e.selection.$to.parentOffset&&e.selection.$from.marks();if(n){const r=n.filter(i=>t==null?void 0:t.includes(i.type.name));e.tr.ensureMarks(r)}}const PMe=({keepMarks:e=!0}={})=>({tr:t,state:n,dispatch:r,editor:i})=>{const{selection:o,doc:a}=t,{$from:s,$to:u}=o,c=i.extensionManager.attributes,l=lm(c,s.node().type.name,s.node().attrs);if(o instanceof ve&&o.node.isBlock)return!s.parentOffset||!cm(a,s.pos)?!1:(r&&(e&&Dk(n,i.extensionManager.splittableMarks),t.split(s.pos).scrollIntoView()),!0);if(!s.parent.isBlock)return!1;const d=u.parentOffset===u.parent.content.size,p=s.depth===0?void 0:xMe(s.node(-1).contentMatchAt(s.indexAfter(-1)));let A=d&&p?[{type:p,attrs:l}]:void 0,m=cm(t.doc,t.mapping.map(s.pos),1,A);if(!A&&!m&&cm(t.doc,t.mapping.map(s.pos),1,p?[{type:p}]:void 0)&&(m=!0,A=p?[{type:p,attrs:l}]:void 0),r){if(m&&(o instanceof Be&&t.deleteSelection(),t.split(t.mapping.map(s.pos),1,A),p&&!d&&!s.parentOffset&&s.parent.type!==p)){const v=t.mapping.map(s.before()),_=t.doc.resolve(v);s.node(-1).canReplaceWith(_.index(),_.index()+1,p)&&t.setNodeMarkup(t.mapping.map(s.before()),p)}e&&Dk(n,i.extensionManager.splittableMarks),t.scrollIntoView()}return m},WMe=(e,t={})=>({tr:n,state:r,dispatch:i,editor:o})=>{var a;const s=Cn(e,r.schema),{$from:u,$to:c}=r.selection,l=r.selection.node;if(l&&l.isBlock||u.depth<2||!u.sameParent(c))return!1;const d=u.node(-1);if(d.type!==s)return!1;const p=o.extensionManager.attributes;if(u.parent.content.size===0&&u.node(-1).childCount===u.indexAfter(-1)){if(u.depth===2||u.node(-3).type!==s||u.index(-2)!==u.node(-2).childCount-1)return!1;if(i){let C=X.empty;const I=u.index(-1)?1:u.index(-2)?2:3;for(let w=u.depth-I;w>=u.depth-3;w-=1)C=X.from(u.node(w).copy(C));const x=u.indexAfter(-1)<u.node(-2).childCount?1:u.indexAfter(-2)<u.node(-3).childCount?2:3,g={...lm(p,u.node().type.name,u.node().attrs),...t},S=((a=s.contentMatch.defaultType)===null||a===void 0?void 0:a.createAndFill(g))||void 0;C=C.append(X.from(s.createAndFill(null,S)||void 0));const y=u.before(u.depth-(I-1));n.replace(y,u.after(-x),new ae(C,4-I,0));let T=-1;n.doc.nodesBetween(y,n.doc.content.size,(w,O)=>{if(T>-1)return!1;w.isTextblock&&w.content.size===0&&(T=O+1)}),T>-1&&n.setSelection(Be.near(n.doc.resolve(T))),n.scrollIntoView()}return!0}const A=c.pos===u.end()?d.contentMatchAt(0).defaultType:null,m={...lm(p,d.type.name,d.attrs),...t},v={...lm(p,u.node().type.name,u.node().attrs),...t};n.delete(u.pos,c.pos);const _=A?[{type:s,attrs:m},{type:A,attrs:v}]:[{type:s,attrs:m}];if(!cm(n.doc,u.pos,2))return!1;if(i){const{selection:C,storedMarks:I}=r,{splittableMarks:x}=o.extensionManager,g=I||C.$to.parentOffset&&C.$from.marks();if(n.split(u.pos,2,_).scrollIntoView(),!g||!i)return!0;const S=g.filter(y=>x.includes(y.type.name));n.ensureMarks(S)}return!0},f1=(e,t)=>{const n=AO(a=>a.type===t)(e.selection);if(!n)return!0;const r=e.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(r===void 0)return!0;const i=e.doc.nodeAt(r);return n.node.type===(i==null?void 0:i.type)&&iO(e.doc,n.pos)&&e.join(n.pos),!0},d1=(e,t)=>{const n=AO(a=>a.type===t)(e.selection);if(!n)return!0;const r=e.doc.resolve(n.start).after(n.depth);if(r===void 0)return!0;const i=e.doc.nodeAt(r);return n.node.type===(i==null?void 0:i.type)&&iO(e.doc,r)&&e.join(r),!0},DMe=(e,t,n,r={})=>({editor:i,tr:o,state:a,dispatch:s,chain:u,commands:c,can:l})=>{const{extensions:d,splittableMarks:p}=i.extensionManager,A=Cn(e,a.schema),m=Cn(t,a.schema),{selection:v,storedMarks:_}=a,{$from:C,$to:I}=v,x=C.blockRange(I),g=_||v.$to.parentOffset&&v.$from.marks();if(!x)return!1;const S=AO(y=>Wk(y.type.name,d))(v);if(x.depth>=1&&S&&x.depth-S.depth<=1){if(S.node.type===A)return c.liftListItem(m);if(Wk(S.node.type.name,d)&&A.validContent(S.node.content)&&s)return u().command(()=>(o.setNodeMarkup(S.pos,A),!0)).command(()=>f1(o,A)).command(()=>d1(o,A)).run()}return!n||!g||!s?u().command(()=>l().wrapInList(A,r)?!0:c.clearNodes()).wrapInList(A,r).command(()=>f1(o,A)).command(()=>d1(o,A)).run():u().command(()=>{const y=l().wrapInList(A,r),T=g.filter(w=>p.includes(w.type.name));return o.ensureMarks(T),y?!0:c.clearNodes()}).wrapInList(A,r).command(()=>f1(o,A)).command(()=>d1(o,A)).run()},KMe=(e,t={},n={})=>({state:r,commands:i})=>{const{extendEmptyMarkRange:o=!1}=n,a=Ys(e,r.schema);return $Me(r,a,t)?i.unsetMark(a,{extendEmptyMarkRange:o}):i.setMark(a,t)},NMe=(e,t,n={})=>({state:r,commands:i})=>{const o=Cn(e,r.schema),a=Cn(t,r.schema);return dO(r,o,n)?i.setNode(a):i.setNode(o,n)},qMe=(e,t={})=>({state:n,commands:r})=>{const i=Cn(e,n.schema);return dO(n,i,t)?r.lift(i):r.wrapIn(i,t)},VMe=()=>({state:e,dispatch:t})=>{const n=e.plugins;for(let r=0;r<n.length;r+=1){const i=n[r];let o;if(i.spec.isInputRules&&(o=i.getState(e))){if(t){const a=e.tr,s=o.transform;for(let u=s.steps.length-1;u>=0;u-=1)a.step(s.steps[u].invert(s.docs[u]));if(o.text){const u=a.doc.resolve(o.from).marks();a.replaceWith(o.from,o.to,e.schema.text(o.text,u))}else a.delete(o.from,o.to)}return!0}}return!1},QMe=()=>({tr:e,dispatch:t})=>{const{selection:n}=e,{empty:r,ranges:i}=n;return r||t&&i.forEach(o=>{e.removeMark(o.$from.pos,o.$to.pos)}),!0},zMe=(e,t={})=>({tr:n,state:r,dispatch:i})=>{var o;const{extendEmptyMarkRange:a=!1}=t,{selection:s}=n,u=Ys(e,r.schema),{$from:c,empty:l,ranges:d}=s;if(!i)return!0;if(l&&a){let{from:p,to:A}=s;const m=(o=c.marks().find(_=>_.type===u))===null||o===void 0?void 0:o.attrs,v=lO(c,u,m);v&&(p=v.from,A=v.to),n.removeMark(p,A,u)}else d.forEach(p=>{n.removeMark(p.$from.pos,p.$to.pos,u)});return n.removeStoredMark(u),!0},HMe=(e,t={})=>({tr:n,state:r,dispatch:i})=>{let o=null,a=null;const s=IV(typeof e=="string"?e:e.name,r.schema);return s?(s==="node"&&(o=Cn(e,r.schema)),s==="mark"&&(a=Ys(e,r.schema)),i&&n.selection.ranges.forEach(u=>{const c=u.$from.pos,l=u.$to.pos;r.doc.nodesBetween(c,l,(d,p)=>{o&&o===d.type&&n.setNodeMarkup(p,void 0,{...d.attrs,...t}),a&&d.marks.length&&d.marks.forEach(A=>{if(a===A.type){const m=Math.max(p,c),v=Math.min(p+d.nodeSize,l);n.addMark(m,v,a.create({...A.attrs,...t}))}})})}),!0):!1},YMe=(e,t={})=>({state:n,dispatch:r})=>{const i=Cn(e,n.schema);return fke(i,t)(n,r)},GMe=(e,t={})=>({state:n,dispatch:r})=>{const i=Cn(e,n.schema);return dke(i,t)(n,r)};var JMe=Object.freeze({__proto__:null,blur:Mke,clearContent:Lke,clearNodes:jke,command:Uke,createParagraphNear:Bke,cut:Pke,deleteCurrentNode:Wke,deleteNode:Dke,deleteRange:Kke,deleteSelection:Nke,enter:qke,exitCode:Vke,extendMarkRange:zke,first:Hke,focus:Gke,forEach:Jke,insertContent:Zke,insertContentAt:tMe,joinBackward:iMe,joinDown:rMe,joinForward:oMe,joinItemBackward:aMe,joinItemForward:sMe,joinTextblockBackward:uMe,joinTextblockForward:cMe,joinUp:nMe,keyboardShortcut:fMe,lift:dMe,liftEmptyBlock:pMe,liftListItem:AMe,newlineInCode:hMe,resetAttributes:mMe,scrollIntoView:gMe,selectAll:vMe,selectNodeBackward:yMe,selectNodeForward:bMe,selectParentNode:CMe,selectTextblockEnd:SMe,selectTextblockStart:_Me,setContent:TMe,setMark:kMe,setMeta:MMe,setNode:LMe,setNodeSelection:jMe,setTextSelection:UMe,sinkListItem:BMe,splitBlock:PMe,splitListItem:WMe,toggleList:DMe,toggleMark:KMe,toggleNode:NMe,toggleWrap:qMe,undoInputRule:VMe,unsetAllMarks:QMe,unsetMark:zMe,updateAttributes:HMe,wrapIn:YMe,wrapInList:GMe});dr.create({name:"commands",addCommands(){return{...JMe}}});dr.create({name:"editable",addProseMirrorPlugins(){return[new zr({key:new eo("editable"),props:{editable:()=>this.editor.options.editable}})]}});dr.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:e}=this;return[new zr({key:new eo("focusEvents"),props:{handleDOMEvents:{focus:(t,n)=>{e.isFocused=!0;const r=e.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return t.dispatch(r),!1},blur:(t,n)=>{e.isFocused=!1;const r=e.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return t.dispatch(r),!1}}}})]}});dr.create({name:"keymap",addKeyboardShortcuts(){const e=()=>this.editor.commands.first(({commands:a})=>[()=>a.undoInputRule(),()=>a.command(({tr:s})=>{const{selection:u,doc:c}=s,{empty:l,$anchor:d}=u,{pos:p,parent:A}=d,m=d.parent.isTextblock&&p>0?s.doc.resolve(p-1):d,v=m.parent.type.spec.isolating,_=d.pos-d.parentOffset,C=v&&m.parent.childCount===1?_===d.pos:ze.atStart(c).from===p;return!l||!A.type.isTextblock||A.textContent.length||!C||C&&d.parent.type.name==="paragraph"?!1:a.clearNodes()}),()=>a.deleteSelection(),()=>a.joinBackward(),()=>a.selectNodeBackward()]),t=()=>this.editor.commands.first(({commands:a})=>[()=>a.deleteSelection(),()=>a.deleteCurrentNode(),()=>a.joinForward(),()=>a.selectNodeForward()]),r={Enter:()=>this.editor.commands.first(({commands:a})=>[()=>a.newlineInCode(),()=>a.createParagraphNear(),()=>a.liftEmptyBlock(),()=>a.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()},i={...r},o={...r,"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 eb()||_V()?o:i},addProseMirrorPlugins(){return[new zr({key:new eo("clearDocument"),appendTransaction:(e,t,n)=>{if(!(e.some(m=>m.docChanged)&&!t.doc.eq(n.doc)))return;const{empty:i,from:o,to:a}=t.selection,s=ze.atStart(t.doc).from,u=ze.atEnd(t.doc).to;if(i||!(o===s&&a===u)||!(n.doc.textBetween(0,n.doc.content.size," "," ").length===0))return;const d=n.tr,p=J0({state:n,transaction:d}),{commands:A}=new sO({editor:this.editor,state:p});if(A.clearNodes(),!!d.steps.length)return d}})]}});dr.create({name:"tabindex",addProseMirrorPlugins(){return[new zr({key:new eo("tabindex"),props:{attributes:()=>this.editor.isEditable?{tabindex:"0"}:{}}})]}});function ig(e){return new cO({find:e.find,handler:({state:t,range:n,match:r})=>{const i=Ue(e.getAttributes,void 0,r);if(i===!1||i===null)return null;const{tr:o}=t,a=r[r.length-1],s=r[0];if(a){const u=s.search(/\S/),c=n.from+s.indexOf(a),l=c+a.length;if(TV(n.from,n.to,t.doc).filter(A=>A.mark.type.excluded.find(v=>v===e.type&&v!==A.mark.type)).filter(A=>A.to>c).length)return null;l<n.to&&o.delete(l,n.to),c>n.from&&o.delete(n.from+u,c);const p=n.from+u+a.length;o.addMark(n.from+u,p,e.type.create(i||{})),o.removeStoredMark(e.type)}}})}function $C(e){return new cO({find:e.find,handler:({state:t,range:n,match:r})=>{const i=t.doc.resolve(n.from),o=Ue(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 og(e){return new cO({find:e.find,handler:({state:t,range:n,match:r,chain:i})=>{const o=Ue(e.getAttributes,void 0,r)||{},a=t.tr.delete(n.from,n.to),u=a.doc.resolve(n.from).blockRange(),c=u&&qFe(u,e.type,o);if(!c)return null;if(a.wrap(u,c),e.keepMarks&&e.editor){const{selection:d,storedMarks:p}=t,{splittableMarks:A}=e.editor.extensionManager,m=p||d.$to.parentOffset&&d.$from.marks();if(m){const v=m.filter(_=>A.includes(_.type.name));a.ensureMarks(v)}}if(e.keepAttributes){const d=e.type.name==="bulletList"||e.type.name==="orderedList"?"listItem":"taskList";i().updateAttributes(d,o).run()}const l=a.doc.resolve(n.from-1).nodeBefore;l&&l.type===e.type&&iO(a.doc,n.from-1)&&(!e.joinPredicate||e.joinPredicate(r,l))&&a.join(n.from-1)}})}let Nc=class RC{constructor(t={}){this.type="mark",this.name="mark",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...t},this.name=this.config.name,t.defaultOptions&&Object.keys(t.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=Ue(ce(this,"addOptions",{name:this.name}))),this.storage=Ue(ce(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(t={}){return new RC(t)}configure(t={}){const n=this.extend({...this.config,addOptions:()=>X0(this.options,t)});return n.name=this.name,n.parent=this.parent,n}extend(t={}){const n=new RC(t);return n.parent=this,this.child=n,n.name=t.name?t.name:n.parent.name,t.defaultOptions&&Object.keys(t.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=Ue(ce(n,"addOptions",{name:n.name})),n.storage=Ue(ce(n,"addStorage",{name:n.name,options:n.options})),n}static handleExit({editor:t,mark:n}){const{tr:r}=t.state,i=t.state.selection.$from;if(i.pos===i.end()){const a=i.marks();if(!!!a.find(c=>(c==null?void 0:c.type.name)===n.name))return!1;const u=a.find(c=>(c==null?void 0:c.type.name)===n.name);return u&&r.removeStoredMark(u),r.insertText(" ",i.pos),t.view.dispatch(r),!0}return!1}};class jn{constructor(t={}){this.type="node",this.name="node",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...t},this.name=this.config.name,t.defaultOptions&&Object.keys(t.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=Ue(ce(this,"addOptions",{name:this.name}))),this.storage=Ue(ce(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(t={}){return new jn(t)}configure(t={}){const n=this.extend({...this.config,addOptions:()=>X0(this.options,t)});return n.name=this.name,n.parent=this.parent,n}extend(t={}){const n=new jn(t);return n.parent=this,this.child=n,n.name=t.name?t.name:n.parent.name,t.defaultOptions&&Object.keys(t.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=Ue(ce(n,"addOptions",{name:n.name})),n.storage=Ue(ce(n,"addStorage",{name:n.name,options:n.options})),n}}function ZMe(){return navigator.platform==="Android"||/android/i.test(navigator.userAgent)}class XMe{constructor(t,n,r){this.isDragging=!1,this.component=t,this.editor=n.editor,this.options={stopEvent:null,ignoreMutation:null,...r},this.extension=n.extension,this.node=n.node,this.decorations=n.decorations,this.getPos=n.getPos,this.mount()}mount(){}get dom(){return this.editor.view.dom}get contentDOM(){return null}onDragStart(t){var n,r,i,o,a,s,u;const{view:c}=this.editor,l=t.target,d=l.nodeType===3?(n=l.parentElement)===null||n===void 0?void 0:n.closest("[data-drag-handle]"):l.closest("[data-drag-handle]");if(!this.dom||!((r=this.contentDOM)===null||r===void 0)&&r.contains(l)||!d)return;let p=0,A=0;if(this.dom!==d){const _=this.dom.getBoundingClientRect(),C=d.getBoundingClientRect(),I=(i=t.offsetX)!==null&&i!==void 0?i:(o=t.nativeEvent)===null||o===void 0?void 0:o.offsetX,x=(a=t.offsetY)!==null&&a!==void 0?a:(s=t.nativeEvent)===null||s===void 0?void 0:s.offsetY;p=C.x-_.x+I,A=C.y-_.y+x}(u=t.dataTransfer)===null||u===void 0||u.setDragImage(this.dom,p,A);const m=ve.create(c.state.doc,this.getPos()),v=c.state.tr.setSelection(m);c.dispatch(v)}stopEvent(t){var n;if(!this.dom)return!1;if(typeof this.options.stopEvent=="function")return this.options.stopEvent({event:t});const r=t.target;if(!(this.dom.contains(r)&&!(!((n=this.contentDOM)===null||n===void 0)&&n.contains(r))))return!1;const o=t.type.startsWith("drag"),a=t.type==="drop";if((["INPUT","BUTTON","SELECT","TEXTAREA"].includes(r.tagName)||r.isContentEditable)&&!a&&!o)return!0;const{isEditable:u}=this.editor,{isDragging:c}=this,l=!!this.node.type.spec.draggable,d=ve.isSelectable(this.node),p=t.type==="copy",A=t.type==="paste",m=t.type==="cut",v=t.type==="mousedown";if(!l&&d&&o&&t.preventDefault(),l&&o&&!c)return t.preventDefault(),!1;if(l&&u&&!c&&v){const _=r.closest("[data-drag-handle]");_&&(this.dom===_||this.dom.contains(_))&&(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!(c||a||p||A||m||v&&d)}ignoreMutation(t){return!this.dom||!this.contentDOM?!0:typeof this.options.ignoreMutation=="function"?this.options.ignoreMutation({mutation:t}):this.node.isLeaf||this.node.isAtom?!0:t.type==="selection"||this.dom.contains(t.target)&&t.type==="childList"&&(eb()||ZMe())&&this.editor.isFocused&&[...Array.from(t.addedNodes),...Array.from(t.removedNodes)].every(r=>r.isContentEditable)?!1:this.contentDOM===t.target&&t.type==="attributes"?!0:!this.contentDOM.contains(t.target)}updateAttributes(t){this.editor.commands.command(({tr:n})=>{const r=this.getPos();return n.setNodeMarkup(r,void 0,{...this.node.attrs,...t}),!0})}deleteNode(){const t=this.getPos(),n=t+this.node.nodeSize;this.editor.commands.deleteRange({from:t,to:n})}}function ag(e){return new Tke({find:e.find,handler:({state:t,range:n,match:r,pasteEvent:i})=>{const o=Ue(e.getAttributes,void 0,r,i);if(o===!1||o===null)return null;const{tr:a}=t,s=r[r.length-1],u=r[0];let c=n.to;if(s){const l=u.search(/\S/),d=n.from+u.indexOf(s),p=d+s.length;if(TV(n.from,n.to,t.doc).filter(m=>m.mark.type.excluded.find(_=>_===e.type&&_!==m.mark.type)).filter(m=>m.to>d).length)return null;p<n.to&&a.delete(p,n.to),d>n.from&&a.delete(n.from+l,d),c=n.from+l+s.length,a.addMark(n.from+l,c,e.type.create(o||{})),a.removeStoredMark(e.type)}}})}function eLe(e){return e.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}var sg=200,tn=function(){};tn.prototype.append=function(t){return t.length?(t=tn.from(t),!this.length&&t||t.length<sg&&this.leafAppend(t)||this.length<sg&&t.leafPrepend(this)||this.appendInner(t)):this};tn.prototype.prepend=function(t){return t.length?tn.from(t).append(this):this};tn.prototype.appendInner=function(t){return new tLe(this,t)};tn.prototype.slice=function(t,n){return t===void 0&&(t=0),n===void 0&&(n=this.length),t>=n?tn.empty:this.sliceInner(Math.max(0,t),Math.min(this.length,n))};tn.prototype.get=function(t){if(!(t<0||t>=this.length))return this.getInner(t)};tn.prototype.forEach=function(t,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length),n<=r?this.forEachInner(t,n,r,0):this.forEachInvertedInner(t,n,r,0)};tn.prototype.map=function(t,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length);var i=[];return this.forEach(function(o,a){return i.push(t(o,a))},n,r),i};tn.from=function(t){return t instanceof tn?t:t&&t.length?new wV(t):tn.empty};var wV=function(e){function t(r){e.call(this),this.values=r}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(i,o){return i==0&&o==this.length?this:new t(this.values.slice(i,o))},t.prototype.getInner=function(i){return this.values[i]},t.prototype.forEachInner=function(i,o,a,s){for(var u=o;u<a;u++)if(i(this.values[u],s+u)===!1)return!1},t.prototype.forEachInvertedInner=function(i,o,a,s){for(var u=o-1;u>=a;u--)if(i(this.values[u],s+u)===!1)return!1},t.prototype.leafAppend=function(i){if(this.length+i.length<=sg)return new t(this.values.concat(i.flatten()))},t.prototype.leafPrepend=function(i){if(this.length+i.length<=sg)return new t(i.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(t.prototype,n),t}(tn);tn.empty=new wV([]);var tLe=function(e){function t(n,r){e.call(this),this.left=n,this.right=r,this.length=n.length+r.length,this.depth=Math.max(n.depth,r.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(r){return r<this.left.length?this.left.get(r):this.right.get(r-this.left.length)},t.prototype.forEachInner=function(r,i,o,a){var s=this.left.length;if(i<s&&this.left.forEachInner(r,i,Math.min(o,s),a)===!1||o>s&&this.right.forEachInner(r,Math.max(i-s,0),Math.min(this.length,o)-s,a+s)===!1)return!1},t.prototype.forEachInvertedInner=function(r,i,o,a){var s=this.left.length;if(i>s&&this.right.forEachInvertedInner(r,i-s,Math.max(o,s)-s,a+s)===!1||o<s&&this.left.forEachInvertedInner(r,Math.min(i,s),o,a)===!1)return!1},t.prototype.sliceInner=function(r,i){if(r==0&&i==this.length)return this;var o=this.left.length;return i<=o?this.left.slice(r,i):r>=o?this.right.slice(r-o,i-o):this.left.slice(r,o).append(this.right.slice(0,i-o))},t.prototype.leafAppend=function(r){var i=this.right.leafAppend(r);if(i)return new t(this.left,i)},t.prototype.leafPrepend=function(r){var i=this.left.leafPrepend(r);if(i)return new t(i,this.right)},t.prototype.appendInner=function(r){return this.left.depth>=Math.max(this.right.depth,r.depth)+1?new t(this.left,new t(this.right,r)):new t(this,r)},t}(tn);const nLe=500;class Ii{constructor(t,n){this.items=t,this.eventCount=n}popEvent(t,n){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let i,o;n&&(i=this.remapping(r,this.items.length),o=i.maps.length);let a=t.tr,s,u,c=[],l=[];return this.items.forEach((d,p)=>{if(!d.step){i||(i=this.remapping(r,p+1),o=i.maps.length),o--,l.push(d);return}if(i){l.push(new no(d.map));let A=d.step.map(i.slice(o)),m;A&&a.maybeStep(A).doc&&(m=a.mapping.maps[a.mapping.maps.length-1],c.push(new no(m,void 0,void 0,c.length+l.length))),o--,m&&i.appendMap(m,o)}else a.maybeStep(d.step);if(d.selection)return s=i?d.selection.map(i.slice(o)):d.selection,u=new Ii(this.items.slice(0,r).append(l.reverse().concat(c)),this.eventCount-1),!1},this.items.length,0),{remaining:u,transform:a,selection:s}}addTransform(t,n,r,i){let o=[],a=this.eventCount,s=this.items,u=!i&&s.length?s.get(s.length-1):null;for(let l=0;l<t.steps.length;l++){let d=t.steps[l].invert(t.docs[l]),p=new no(t.mapping.maps[l],d,n),A;(A=u&&u.merge(p))&&(p=A,l?o.pop():s=s.slice(0,s.length-1)),o.push(p),n&&(a++,n=void 0),i||(u=p)}let c=a-r.depth;return c>iLe&&(s=rLe(s,c),a-=c),new Ii(s.append(o),a)}remapping(t,n){let r=new kd;return this.items.forEach((i,o)=>{let a=i.mirrorOffset!=null&&o-i.mirrorOffset>=t?r.maps.length-i.mirrorOffset:void 0;r.appendMap(i.map,a)},t,n),r}addMaps(t){return this.eventCount==0?this:new Ii(this.items.append(t.map(n=>new no(n))),this.eventCount)}rebased(t,n){if(!this.eventCount)return this;let r=[],i=Math.max(0,this.items.length-n),o=t.mapping,a=t.steps.length,s=this.eventCount;this.items.forEach(p=>{p.selection&&s--},i);let u=n;this.items.forEach(p=>{let A=o.getMirror(--u);if(A==null)return;a=Math.min(a,A);let m=o.maps[A];if(p.step){let v=t.steps[A].invert(t.docs[A]),_=p.selection&&p.selection.map(o.slice(u+1,A));_&&s++,r.push(new no(m,v,_))}else r.push(new no(m))},i);let c=[];for(let p=n;p<a;p++)c.push(new no(o.maps[p]));let l=this.items.slice(0,i).append(c).append(r),d=new Ii(l,s);return d.emptyItemCount()>nLe&&(d=d.compress(this.items.length-r.length)),d}emptyItemCount(){let t=0;return this.items.forEach(n=>{n.step||t++}),t}compress(t=this.items.length){let n=this.remapping(0,t),r=n.maps.length,i=[],o=0;return this.items.forEach((a,s)=>{if(s>=t)i.push(a),a.selection&&o++;else if(a.step){let u=a.step.map(n.slice(r)),c=u&&u.getMap();if(r--,c&&n.appendMap(c,r),u){let l=a.selection&&a.selection.map(n.slice(r));l&&o++;let d=new no(c.invert(),u,l),p,A=i.length-1;(p=i.length&&i[A].merge(d))?i[A]=p:i.push(d)}}else a.map&&r--},this.items.length,0),new Ii(tn.from(i.reverse()),o)}}Ii.empty=new Ii(tn.empty,0);function rLe(e,t){let n;return e.forEach((r,i)=>{if(r.selection&&t--==0)return n=i,!1}),e.slice(n)}class no{constructor(t,n,r,i){this.map=t,this.step=n,this.selection=r,this.mirrorOffset=i}merge(t){if(this.step&&t.step&&!t.selection){let n=t.step.merge(this.step);if(n)return new no(n.getMap().invert(),n,this.selection)}}}class Ga{constructor(t,n,r,i,o){this.done=t,this.undone=n,this.prevRanges=r,this.prevTime=i,this.prevComposition=o}}const iLe=20;function oLe(e,t,n,r){let i=n.getMeta(vu),o;if(i)return i.historyState;n.getMeta(uLe)&&(e=new Ga(e.done,e.undone,null,0,-1));let a=n.getMeta("appendedTransaction");if(n.steps.length==0)return e;if(a&&a.getMeta(vu))return a.getMeta(vu).redo?new Ga(e.done.addTransform(n,void 0,r,fm(t)),e.undone,Kk(n.mapping.maps),e.prevTime,e.prevComposition):new Ga(e.done,e.undone.addTransform(n,void 0,r,fm(t)),null,e.prevTime,e.prevComposition);if(n.getMeta("addToHistory")!==!1&&!(a&&a.getMeta("addToHistory")===!1)){let s=n.getMeta("composition"),u=e.prevTime==0||!a&&e.prevComposition!=s&&(e.prevTime<(n.time||0)-r.newGroupDelay||!aLe(n,e.prevRanges)),c=a?p1(e.prevRanges,n.mapping):Kk(n.mapping.maps);return new Ga(e.done.addTransform(n,u?t.selection.getBookmark():void 0,r,fm(t)),Ii.empty,c,n.time,s??e.prevComposition)}else return(o=n.getMeta("rebased"))?new Ga(e.done.rebased(n,o),e.undone.rebased(n,o),p1(e.prevRanges,n.mapping),e.prevTime,e.prevComposition):new Ga(e.done.addMaps(n.mapping.maps),e.undone.addMaps(n.mapping.maps),p1(e.prevRanges,n.mapping),e.prevTime,e.prevComposition)}function aLe(e,t){if(!t)return!1;if(!e.docChanged)return!0;let n=!1;return e.mapping.maps[0].forEach((r,i)=>{for(let o=0;o<t.length;o+=2)r<=t[o+1]&&i>=t[o]&&(n=!0)}),n}function Kk(e){let t=[];for(let n=e.length-1;n>=0&&t.length==0;n--)e[n].forEach((r,i,o,a)=>t.push(o,a));return t}function p1(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 sLe(e,t,n){let r=fm(t),i=vu.get(t).spec.config,o=(n?e.undone:e.done).popEvent(t,r);if(!o)return null;let a=o.selection.resolve(o.transform.doc),s=(n?e.done:e.undone).addTransform(o.transform,t.selection.getBookmark(),i,r),u=new Ga(n?s:o.remaining,n?o.remaining:s,null,0,-1);return o.transform.setSelection(a).setMeta(vu,{redo:n,historyState:u})}let A1=!1,Nk=null;function fm(e){let t=e.plugins;if(Nk!=t){A1=!1,Nk=t;for(let n=0;n<t.length;n++)if(t[n].spec.historyPreserveItems){A1=!0;break}}return A1}const vu=new eo("history"),uLe=new eo("closeHistory");function cLe(e={}){return e={depth:e.depth||100,newGroupDelay:e.newGroupDelay||500},new zr({key:vu,state:{init(){return new Ga(Ii.empty,Ii.empty,null,0,-1)},apply(t,n,r){return oLe(n,r,t,e)}},config:e,props:{handleDOMEvents:{beforeinput(t,n){let r=n.inputType,i=r=="historyUndo"?$V:r=="historyRedo"?RV:null;return i?(n.preventDefault(),i(t.state,t.dispatch)):!1}}}})}function EV(e,t){return(n,r)=>{let i=vu.getState(n);if(!i||(e?i.undone:i.done).eventCount==0)return!1;if(r){let o=sLe(i,n,e);o&&r(t?o.scrollIntoView():o)}return!0}}const $V=EV(!1,!0),RV=EV(!0,!0),lLe=dr.create({name:"history",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:e,dispatch:t})=>$V(e,t),redo:()=>({state:e,dispatch:t})=>RV(e,t)}},addProseMirrorPlugins(){return[cLe(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 ur="top",ri="bottom",ii="right",cr="left",hO="auto",Rh=[ur,ri,ii,cr],Pl="start",_p="end",fLe="clippingParents",OV="viewport",Cd="popper",dLe="reference",qk=Rh.reduce(function(e,t){return e.concat([t+"-"+Pl,t+"-"+_p])},[]),FV=[].concat(Rh,[hO]).reduce(function(e,t){return e.concat([t,t+"-"+Pl,t+"-"+_p])},[]),pLe="beforeRead",ALe="read",hLe="afterRead",mLe="beforeMain",gLe="main",vLe="afterMain",yLe="beforeWrite",bLe="write",CLe="afterWrite",SLe=[pLe,ALe,hLe,mLe,gLe,vLe,yLe,bLe,CLe];function mo(e){return e?(e.nodeName||"").toLowerCase():null}function Lr(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function Bu(e){var t=Lr(e).Element;return e instanceof t||e instanceof Element}function ni(e){var t=Lr(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function mO(e){if(typeof ShadowRoot>"u")return!1;var t=Lr(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function _Le(e){var t=e.state;Object.keys(t.elements).forEach(function(n){var r=t.styles[n]||{},i=t.attributes[n]||{},o=t.elements[n];!ni(o)||!mo(o)||(Object.assign(o.style,r),Object.keys(i).forEach(function(a){var s=i[a];s===!1?o.removeAttribute(a):o.setAttribute(a,s===!0?"":s)}))})}function ILe(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(r){var i=t.elements[r],o=t.attributes[r]||{},a=Object.keys(t.styles.hasOwnProperty(r)?t.styles[r]:n[r]),s=a.reduce(function(u,c){return u[c]="",u},{});!ni(i)||!mo(i)||(Object.assign(i.style,s),Object.keys(o).forEach(function(u){i.removeAttribute(u)}))})}}const kV={name:"applyStyles",enabled:!0,phase:"write",fn:_Le,effect:ILe,requires:["computeStyles"]};function oo(e){return e.split("-")[0]}var yu=Math.max,ug=Math.min,Wl=Math.round;function OC(){var e=navigator.userAgentData;return e!=null&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function MV(){return!/^((?!chrome|android).)*safari/i.test(OC())}function Dl(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);var r=e.getBoundingClientRect(),i=1,o=1;t&&ni(e)&&(i=e.offsetWidth>0&&Wl(r.width)/e.offsetWidth||1,o=e.offsetHeight>0&&Wl(r.height)/e.offsetHeight||1);var a=Bu(e)?Lr(e):window,s=a.visualViewport,u=!MV()&&n,c=(r.left+(u&&s?s.offsetLeft:0))/i,l=(r.top+(u&&s?s.offsetTop:0))/o,d=r.width/i,p=r.height/o;return{width:d,height:p,top:l,right:c+d,bottom:l+p,left:c,x:c,y:l}}function gO(e){var t=Dl(e),n=e.offsetWidth,r=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function LV(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&mO(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function sa(e){return Lr(e).getComputedStyle(e)}function TLe(e){return["table","td","th"].indexOf(mo(e))>=0}function Gs(e){return((Bu(e)?e.ownerDocument:e.document)||window.document).documentElement}function tb(e){return mo(e)==="html"?e:e.assignedSlot||e.parentNode||(mO(e)?e.host:null)||Gs(e)}function Vk(e){return!ni(e)||sa(e).position==="fixed"?null:e.offsetParent}function xLe(e){var t=/firefox/i.test(OC()),n=/Trident/i.test(OC());if(n&&ni(e)){var r=sa(e);if(r.position==="fixed")return null}var i=tb(e);for(mO(i)&&(i=i.host);ni(i)&&["html","body"].indexOf(mo(i))<0;){var o=sa(i);if(o.transform!=="none"||o.perspective!=="none"||o.contain==="paint"||["transform","perspective"].indexOf(o.willChange)!==-1||t&&o.willChange==="filter"||t&&o.filter&&o.filter!=="none")return i;i=i.parentNode}return null}function Oh(e){for(var t=Lr(e),n=Vk(e);n&&TLe(n)&&sa(n).position==="static";)n=Vk(n);return n&&(mo(n)==="html"||mo(n)==="body"&&sa(n).position==="static")?t:n||xLe(e)||t}function vO(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function jd(e,t,n){return yu(e,ug(t,n))}function wLe(e,t,n){var r=jd(e,t,n);return r>n?n:r}function jV(){return{top:0,right:0,bottom:0,left:0}}function UV(e){return Object.assign({},jV(),e)}function BV(e,t){return t.reduce(function(n,r){return n[r]=e,n},{})}var ELe=function(t,n){return t=typeof t=="function"?t(Object.assign({},n.rects,{placement:n.placement})):t,UV(typeof t!="number"?t:BV(t,Rh))};function $Le(e){var t,n=e.state,r=e.name,i=e.options,o=n.elements.arrow,a=n.modifiersData.popperOffsets,s=oo(n.placement),u=vO(s),c=[cr,ii].indexOf(s)>=0,l=c?"height":"width";if(!(!o||!a)){var d=ELe(i.padding,n),p=gO(o),A=u==="y"?ur:cr,m=u==="y"?ri:ii,v=n.rects.reference[l]+n.rects.reference[u]-a[u]-n.rects.popper[l],_=a[u]-n.rects.reference[u],C=Oh(o),I=C?u==="y"?C.clientHeight||0:C.clientWidth||0:0,x=v/2-_/2,g=d[A],S=I-p[l]-d[m],y=I/2-p[l]/2+x,T=jd(g,y,S),w=u;n.modifiersData[r]=(t={},t[w]=T,t.centerOffset=T-y,t)}}function RLe(e){var t=e.state,n=e.options,r=n.element,i=r===void 0?"[data-popper-arrow]":r;i!=null&&(typeof i=="string"&&(i=t.elements.popper.querySelector(i),!i)||LV(t.elements.popper,i)&&(t.elements.arrow=i))}const OLe={name:"arrow",enabled:!0,phase:"main",fn:$Le,effect:RLe,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Kl(e){return e.split("-")[1]}var FLe={top:"auto",right:"auto",bottom:"auto",left:"auto"};function kLe(e,t){var n=e.x,r=e.y,i=t.devicePixelRatio||1;return{x:Wl(n*i)/i||0,y:Wl(r*i)/i||0}}function Qk(e){var t,n=e.popper,r=e.popperRect,i=e.placement,o=e.variation,a=e.offsets,s=e.position,u=e.gpuAcceleration,c=e.adaptive,l=e.roundOffsets,d=e.isFixed,p=a.x,A=p===void 0?0:p,m=a.y,v=m===void 0?0:m,_=typeof l=="function"?l({x:A,y:v}):{x:A,y:v};A=_.x,v=_.y;var C=a.hasOwnProperty("x"),I=a.hasOwnProperty("y"),x=cr,g=ur,S=window;if(c){var y=Oh(n),T="clientHeight",w="clientWidth";if(y===Lr(n)&&(y=Gs(n),sa(y).position!=="static"&&s==="absolute"&&(T="scrollHeight",w="scrollWidth")),y=y,i===ur||(i===cr||i===ii)&&o===_p){g=ri;var O=d&&y===S&&S.visualViewport?S.visualViewport.height:y[T];v-=O-r.height,v*=u?1:-1}if(i===cr||(i===ur||i===ri)&&o===_p){x=ii;var E=d&&y===S&&S.visualViewport?S.visualViewport.width:y[w];A-=E-r.width,A*=u?1:-1}}var F=Object.assign({position:s},c&&FLe),W=l===!0?kLe({x:A,y:v},Lr(n)):{x:A,y:v};if(A=W.x,v=W.y,u){var K;return Object.assign({},F,(K={},K[g]=I?"0":"",K[x]=C?"0":"",K.transform=(S.devicePixelRatio||1)<=1?"translate("+A+"px, "+v+"px)":"translate3d("+A+"px, "+v+"px, 0)",K))}return Object.assign({},F,(t={},t[g]=I?v+"px":"",t[x]=C?A+"px":"",t.transform="",t))}function MLe(e){var t=e.state,n=e.options,r=n.gpuAcceleration,i=r===void 0?!0:r,o=n.adaptive,a=o===void 0?!0:o,s=n.roundOffsets,u=s===void 0?!0:s,c={placement:oo(t.placement),variation:Kl(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:i,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,Qk(Object.assign({},c,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:a,roundOffsets:u})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,Qk(Object.assign({},c,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:u})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const LLe={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:MLe,data:{}};var Zh={passive:!0};function jLe(e){var t=e.state,n=e.instance,r=e.options,i=r.scroll,o=i===void 0?!0:i,a=r.resize,s=a===void 0?!0:a,u=Lr(t.elements.popper),c=[].concat(t.scrollParents.reference,t.scrollParents.popper);return o&&c.forEach(function(l){l.addEventListener("scroll",n.update,Zh)}),s&&u.addEventListener("resize",n.update,Zh),function(){o&&c.forEach(function(l){l.removeEventListener("scroll",n.update,Zh)}),s&&u.removeEventListener("resize",n.update,Zh)}}const ULe={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:jLe,data:{}};var BLe={left:"right",right:"left",bottom:"top",top:"bottom"};function dm(e){return e.replace(/left|right|bottom|top/g,function(t){return BLe[t]})}var PLe={start:"end",end:"start"};function zk(e){return e.replace(/start|end/g,function(t){return PLe[t]})}function yO(e){var t=Lr(e),n=t.pageXOffset,r=t.pageYOffset;return{scrollLeft:n,scrollTop:r}}function bO(e){return Dl(Gs(e)).left+yO(e).scrollLeft}function WLe(e,t){var n=Lr(e),r=Gs(e),i=n.visualViewport,o=r.clientWidth,a=r.clientHeight,s=0,u=0;if(i){o=i.width,a=i.height;var c=MV();(c||!c&&t==="fixed")&&(s=i.offsetLeft,u=i.offsetTop)}return{width:o,height:a,x:s+bO(e),y:u}}function DLe(e){var t,n=Gs(e),r=yO(e),i=(t=e.ownerDocument)==null?void 0:t.body,o=yu(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),a=yu(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),s=-r.scrollLeft+bO(e),u=-r.scrollTop;return sa(i||n).direction==="rtl"&&(s+=yu(n.clientWidth,i?i.clientWidth:0)-o),{width:o,height:a,x:s,y:u}}function CO(e){var t=sa(e),n=t.overflow,r=t.overflowX,i=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}function PV(e){return["html","body","#document"].indexOf(mo(e))>=0?e.ownerDocument.body:ni(e)&&CO(e)?e:PV(tb(e))}function Ud(e,t){var n;t===void 0&&(t=[]);var r=PV(e),i=r===((n=e.ownerDocument)==null?void 0:n.body),o=Lr(r),a=i?[o].concat(o.visualViewport||[],CO(r)?r:[]):r,s=t.concat(a);return i?s:s.concat(Ud(tb(a)))}function FC(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function KLe(e,t){var n=Dl(e,!1,t==="fixed");return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}function Hk(e,t,n){return t===OV?FC(WLe(e,n)):Bu(t)?KLe(t,n):FC(DLe(Gs(e)))}function NLe(e){var t=Ud(tb(e)),n=["absolute","fixed"].indexOf(sa(e).position)>=0,r=n&&ni(e)?Oh(e):e;return Bu(r)?t.filter(function(i){return Bu(i)&&LV(i,r)&&mo(i)!=="body"}):[]}function qLe(e,t,n,r){var i=t==="clippingParents"?NLe(e):[].concat(t),o=[].concat(i,[n]),a=o[0],s=o.reduce(function(u,c){var l=Hk(e,c,r);return u.top=yu(l.top,u.top),u.right=ug(l.right,u.right),u.bottom=ug(l.bottom,u.bottom),u.left=yu(l.left,u.left),u},Hk(e,a,r));return s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}function WV(e){var t=e.reference,n=e.element,r=e.placement,i=r?oo(r):null,o=r?Kl(r):null,a=t.x+t.width/2-n.width/2,s=t.y+t.height/2-n.height/2,u;switch(i){case ur:u={x:a,y:t.y-n.height};break;case ri:u={x:a,y:t.y+t.height};break;case ii:u={x:t.x+t.width,y:s};break;case cr:u={x:t.x-n.width,y:s};break;default:u={x:t.x,y:t.y}}var c=i?vO(i):null;if(c!=null){var l=c==="y"?"height":"width";switch(o){case Pl:u[c]=u[c]-(t[l]/2-n[l]/2);break;case _p:u[c]=u[c]+(t[l]/2-n[l]/2);break}}return u}function Ip(e,t){t===void 0&&(t={});var n=t,r=n.placement,i=r===void 0?e.placement:r,o=n.strategy,a=o===void 0?e.strategy:o,s=n.boundary,u=s===void 0?fLe:s,c=n.rootBoundary,l=c===void 0?OV:c,d=n.elementContext,p=d===void 0?Cd:d,A=n.altBoundary,m=A===void 0?!1:A,v=n.padding,_=v===void 0?0:v,C=UV(typeof _!="number"?_:BV(_,Rh)),I=p===Cd?dLe:Cd,x=e.rects.popper,g=e.elements[m?I:p],S=qLe(Bu(g)?g:g.contextElement||Gs(e.elements.popper),u,l,a),y=Dl(e.elements.reference),T=WV({reference:y,element:x,strategy:"absolute",placement:i}),w=FC(Object.assign({},x,T)),O=p===Cd?w:y,E={top:S.top-O.top+C.top,bottom:O.bottom-S.bottom+C.bottom,left:S.left-O.left+C.left,right:O.right-S.right+C.right},F=e.modifiersData.offset;if(p===Cd&&F){var W=F[i];Object.keys(E).forEach(function(K){var J=[ii,ri].indexOf(K)>=0?1:-1,ee=[ur,ri].indexOf(K)>=0?"y":"x";E[K]+=W[ee]*J})}return E}function VLe(e,t){t===void 0&&(t={});var n=t,r=n.placement,i=n.boundary,o=n.rootBoundary,a=n.padding,s=n.flipVariations,u=n.allowedAutoPlacements,c=u===void 0?FV:u,l=Kl(r),d=l?s?qk:qk.filter(function(m){return Kl(m)===l}):Rh,p=d.filter(function(m){return c.indexOf(m)>=0});p.length===0&&(p=d);var A=p.reduce(function(m,v){return m[v]=Ip(e,{placement:v,boundary:i,rootBoundary:o,padding:a})[oo(v)],m},{});return Object.keys(A).sort(function(m,v){return A[m]-A[v]})}function QLe(e){if(oo(e)===hO)return[];var t=dm(e);return[zk(e),t,zk(t)]}function zLe(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var i=n.mainAxis,o=i===void 0?!0:i,a=n.altAxis,s=a===void 0?!0:a,u=n.fallbackPlacements,c=n.padding,l=n.boundary,d=n.rootBoundary,p=n.altBoundary,A=n.flipVariations,m=A===void 0?!0:A,v=n.allowedAutoPlacements,_=t.options.placement,C=oo(_),I=C===_,x=u||(I||!m?[dm(_)]:QLe(_)),g=[_].concat(x).reduce(function(Ie,rt){return Ie.concat(oo(rt)===hO?VLe(t,{placement:rt,boundary:l,rootBoundary:d,padding:c,flipVariations:m,allowedAutoPlacements:v}):rt)},[]),S=t.rects.reference,y=t.rects.popper,T=new Map,w=!0,O=g[0],E=0;E<g.length;E++){var F=g[E],W=oo(F),K=Kl(F)===Pl,J=[ur,ri].indexOf(W)>=0,ee=J?"width":"height",re=Ip(t,{placement:F,boundary:l,rootBoundary:d,altBoundary:p,padding:c}),P=J?K?ii:cr:K?ri:ur;S[ee]>y[ee]&&(P=dm(P));var Y=dm(P),M=[];if(o&&M.push(re[W]<=0),s&&M.push(re[P]<=0,re[Y]<=0),M.every(function(Ie){return Ie})){O=F,w=!1;break}T.set(F,M)}if(w)for(var k=m?3:1,q=function(rt){var at=g.find(function(fn){var Zt=T.get(fn);if(Zt)return Zt.slice(0,rt).every(function(rr){return rr})});if(at)return O=at,"break"},ue=k;ue>0;ue--){var ke=q(ue);if(ke==="break")break}t.placement!==O&&(t.modifiersData[r]._skip=!0,t.placement=O,t.reset=!0)}}const HLe={name:"flip",enabled:!0,phase:"main",fn:zLe,requiresIfExists:["offset"],data:{_skip:!1}};function Yk(e,t,n){return n===void 0&&(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 Gk(e){return[ur,ii,ri,cr].some(function(t){return e[t]>=0})}function YLe(e){var t=e.state,n=e.name,r=t.rects.reference,i=t.rects.popper,o=t.modifiersData.preventOverflow,a=Ip(t,{elementContext:"reference"}),s=Ip(t,{altBoundary:!0}),u=Yk(a,r),c=Yk(s,i,o),l=Gk(u),d=Gk(c);t.modifiersData[n]={referenceClippingOffsets:u,popperEscapeOffsets:c,isReferenceHidden:l,hasPopperEscaped:d},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":l,"data-popper-escaped":d})}const GLe={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:YLe};function JLe(e,t,n){var r=oo(e),i=[cr,ur].indexOf(r)>=0?-1:1,o=typeof n=="function"?n(Object.assign({},t,{placement:e})):n,a=o[0],s=o[1];return a=a||0,s=(s||0)*i,[cr,ii].indexOf(r)>=0?{x:s,y:a}:{x:a,y:s}}function ZLe(e){var t=e.state,n=e.options,r=e.name,i=n.offset,o=i===void 0?[0,0]:i,a=FV.reduce(function(l,d){return l[d]=JLe(d,t.rects,o),l},{}),s=a[t.placement],u=s.x,c=s.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=u,t.modifiersData.popperOffsets.y+=c),t.modifiersData[r]=a}const XLe={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:ZLe};function eje(e){var t=e.state,n=e.name;t.modifiersData[n]=WV({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})}const tje={name:"popperOffsets",enabled:!0,phase:"read",fn:eje,data:{}};function nje(e){return e==="x"?"y":"x"}function rje(e){var t=e.state,n=e.options,r=e.name,i=n.mainAxis,o=i===void 0?!0:i,a=n.altAxis,s=a===void 0?!1:a,u=n.boundary,c=n.rootBoundary,l=n.altBoundary,d=n.padding,p=n.tether,A=p===void 0?!0:p,m=n.tetherOffset,v=m===void 0?0:m,_=Ip(t,{boundary:u,rootBoundary:c,padding:d,altBoundary:l}),C=oo(t.placement),I=Kl(t.placement),x=!I,g=vO(C),S=nje(g),y=t.modifiersData.popperOffsets,T=t.rects.reference,w=t.rects.popper,O=typeof v=="function"?v(Object.assign({},t.rects,{placement:t.placement})):v,E=typeof O=="number"?{mainAxis:O,altAxis:O}:Object.assign({mainAxis:0,altAxis:0},O),F=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,W={x:0,y:0};if(y){if(o){var K,J=g==="y"?ur:cr,ee=g==="y"?ri:ii,re=g==="y"?"height":"width",P=y[g],Y=P+_[J],M=P-_[ee],k=A?-w[re]/2:0,q=I===Pl?T[re]:w[re],ue=I===Pl?-w[re]:-T[re],ke=t.elements.arrow,Ie=A&&ke?gO(ke):{width:0,height:0},rt=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:jV(),at=rt[J],fn=rt[ee],Zt=jd(0,T[re],Ie[re]),rr=x?T[re]/2-k-Zt-at-E.mainAxis:q-Zt-at-E.mainAxis,dn=x?-T[re]/2+k+Zt+fn+E.mainAxis:ue+Zt+fn+E.mainAxis,Hr=t.elements.arrow&&Oh(t.elements.arrow),Yr=Hr?g==="y"?Hr.clientTop||0:Hr.clientLeft||0:0,De=(K=F==null?void 0:F[g])!=null?K:0,dt=P+rr-De-Yr,St=P+dn-De,st=jd(A?ug(Y,dt):Y,P,A?yu(M,St):M);y[g]=st,W[g]=st-P}if(s){var Wt,gi=g==="x"?ur:cr,_r=g==="x"?ri:ii,ir=y[S],Gr=S==="y"?"height":"width",vi=ir+_[gi],yi=ir-_[_r],jo=[ur,cr].indexOf(C)!==-1,Uo=(Wt=F==null?void 0:F[S])!=null?Wt:0,Bo=jo?vi:ir-T[Gr]-w[Gr]-Uo+E.altAxis,Jr=jo?ir+T[Gr]+w[Gr]-Uo-E.altAxis:yi,za=A&&jo?wLe(Bo,ir,Jr):jd(A?Bo:vi,ir,A?Jr:yi);y[S]=za,W[S]=za-ir}t.modifiersData[r]=W}}const ije={name:"preventOverflow",enabled:!0,phase:"main",fn:rje,requiresIfExists:["offset"]};function oje(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function aje(e){return e===Lr(e)||!ni(e)?yO(e):oje(e)}function sje(e){var t=e.getBoundingClientRect(),n=Wl(t.width)/e.offsetWidth||1,r=Wl(t.height)/e.offsetHeight||1;return n!==1||r!==1}function uje(e,t,n){n===void 0&&(n=!1);var r=ni(t),i=ni(t)&&sje(t),o=Gs(t),a=Dl(e,i,n),s={scrollLeft:0,scrollTop:0},u={x:0,y:0};return(r||!r&&!n)&&((mo(t)!=="body"||CO(o))&&(s=aje(t)),ni(t)?(u=Dl(t,!0),u.x+=t.clientLeft,u.y+=t.clientTop):o&&(u.x=bO(o))),{x:a.left+s.scrollLeft-u.x,y:a.top+s.scrollTop-u.y,width:a.width,height:a.height}}function cje(e){var t=new Map,n=new Set,r=[];e.forEach(function(o){t.set(o.name,o)});function i(o){n.add(o.name);var a=[].concat(o.requires||[],o.requiresIfExists||[]);a.forEach(function(s){if(!n.has(s)){var u=t.get(s);u&&i(u)}}),r.push(o)}return e.forEach(function(o){n.has(o.name)||i(o)}),r}function lje(e){var t=cje(e);return SLe.reduce(function(n,r){return n.concat(t.filter(function(i){return i.phase===r}))},[])}function fje(e){var t;return function(){return t||(t=new Promise(function(n){Promise.resolve().then(function(){t=void 0,n(e())})})),t}}function dje(e){var t=e.reduce(function(n,r){var i=n[r.name];return n[r.name]=i?Object.assign({},i,r,{options:Object.assign({},i.options,r.options),data:Object.assign({},i.data,r.data)}):r,n},{});return Object.keys(t).map(function(n){return t[n]})}var Jk={placement:"bottom",modifiers:[],strategy:"absolute"};function Zk(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return!t.some(function(r){return!(r&&typeof r.getBoundingClientRect=="function")})}function pje(e){e===void 0&&(e={});var t=e,n=t.defaultModifiers,r=n===void 0?[]:n,i=t.defaultOptions,o=i===void 0?Jk:i;return function(s,u,c){c===void 0&&(c=o);var l={placement:"bottom",orderedModifiers:[],options:Object.assign({},Jk,o),modifiersData:{},elements:{reference:s,popper:u},attributes:{},styles:{}},d=[],p=!1,A={state:l,setOptions:function(C){var I=typeof C=="function"?C(l.options):C;v(),l.options=Object.assign({},o,l.options,I),l.scrollParents={reference:Bu(s)?Ud(s):s.contextElement?Ud(s.contextElement):[],popper:Ud(u)};var x=lje(dje([].concat(r,l.options.modifiers)));return l.orderedModifiers=x.filter(function(g){return g.enabled}),m(),A.update()},forceUpdate:function(){if(!p){var C=l.elements,I=C.reference,x=C.popper;if(Zk(I,x)){l.rects={reference:uje(I,Oh(x),l.options.strategy==="fixed"),popper:gO(x)},l.reset=!1,l.placement=l.options.placement,l.orderedModifiers.forEach(function(E){return l.modifiersData[E.name]=Object.assign({},E.data)});for(var g=0;g<l.orderedModifiers.length;g++){if(l.reset===!0){l.reset=!1,g=-1;continue}var S=l.orderedModifiers[g],y=S.fn,T=S.options,w=T===void 0?{}:T,O=S.name;typeof y=="function"&&(l=y({state:l,options:w,name:O,instance:A})||l)}}}},update:fje(function(){return new Promise(function(_){A.forceUpdate(),_(l)})}),destroy:function(){v(),p=!0}};if(!Zk(s,u))return A;A.setOptions(c).then(function(_){!p&&c.onFirstUpdate&&c.onFirstUpdate(_)});function m(){l.orderedModifiers.forEach(function(_){var C=_.name,I=_.options,x=I===void 0?{}:I,g=_.effect;if(typeof g=="function"){var S=g({state:l,name:C,instance:A,options:x}),y=function(){};d.push(S||y)}})}function v(){d.forEach(function(_){return _()}),d=[]}return A}}var Aje=[ULe,tje,LLe,kV,XLe,HLe,ije,OLe,GLe],hje=pje({defaultModifiers:Aje}),mje="tippy-box",DV="tippy-content",gje="tippy-backdrop",KV="tippy-arrow",NV="tippy-svg-arrow",nu={passive:!0,capture:!0},qV=function(){return document.body};function vje(e,t){return{}.hasOwnProperty.call(e,t)}function h1(e,t,n){if(Array.isArray(e)){var r=e[t];return r??(Array.isArray(n)?n[t]:n)}return e}function SO(e,t){var n={}.toString.call(e);return n.indexOf("[object")===0&&n.indexOf(t+"]")>-1}function VV(e,t){return typeof e=="function"?e.apply(void 0,t):e}function Xk(e,t){if(t===0)return e;var n;return function(r){clearTimeout(n),n=setTimeout(function(){e(r)},t)}}function yje(e,t){var n=Object.assign({},e);return t.forEach(function(r){delete n[r]}),n}function bje(e){return e.split(/\s+/).filter(Boolean)}function cl(e){return[].concat(e)}function eM(e,t){e.indexOf(t)===-1&&e.push(t)}function Cje(e){return e.filter(function(t,n){return e.indexOf(t)===n})}function Sje(e){return e.split("-")[0]}function cg(e){return[].slice.call(e)}function tM(e){return Object.keys(e).reduce(function(t,n){return e[n]!==void 0&&(t[n]=e[n]),t},{})}function Bd(){return document.createElement("div")}function Tp(e){return["Element","Fragment"].some(function(t){return SO(e,t)})}function _je(e){return SO(e,"NodeList")}function Ije(e){return SO(e,"MouseEvent")}function Tje(e){return!!(e&&e._tippy&&e._tippy.reference===e)}function xje(e){return Tp(e)?[e]:_je(e)?cg(e):Array.isArray(e)?e:cg(document.querySelectorAll(e))}function m1(e,t){e.forEach(function(n){n&&(n.style.transitionDuration=t+"ms")})}function nM(e,t){e.forEach(function(n){n&&n.setAttribute("data-state",t)})}function wje(e){var t,n=cl(e),r=n[0];return r!=null&&(t=r.ownerDocument)!=null&&t.body?r.ownerDocument:document}function Eje(e,t){var n=t.clientX,r=t.clientY;return e.every(function(i){var o=i.popperRect,a=i.popperState,s=i.props,u=s.interactiveBorder,c=Sje(a.placement),l=a.modifiersData.offset;if(!l)return!0;var d=c==="bottom"?l.top.y:0,p=c==="top"?l.bottom.y:0,A=c==="right"?l.left.x:0,m=c==="left"?l.right.x:0,v=o.top-r+d>u,_=r-o.bottom-p>u,C=o.left-n+A>u,I=n-o.right-m>u;return v||_||C||I})}function g1(e,t,n){var r=t+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(i){e[r](i,n)})}function rM(e,t){for(var n=t;n;){var r;if(e.contains(n))return!0;n=n.getRootNode==null||(r=n.getRootNode())==null?void 0:r.host}return!1}var ro={isTouch:!1},iM=0;function $je(){ro.isTouch||(ro.isTouch=!0,window.performance&&document.addEventListener("mousemove",QV))}function QV(){var e=performance.now();e-iM<20&&(ro.isTouch=!1,document.removeEventListener("mousemove",QV)),iM=e}function Rje(){var e=document.activeElement;if(Tje(e)){var t=e._tippy;e.blur&&!t.state.isVisible&&e.blur()}}function Oje(){document.addEventListener("touchstart",$je,nu),window.addEventListener("blur",Rje)}var Fje=typeof window<"u"&&typeof document<"u",kje=Fje?!!window.msCrypto:!1;function tl(e){var t=e==="destroy"?"n already-":" ";return[e+"() was called on a"+t+"destroyed instance. This is a no-op but","indicates a potential memory leak."].join(" ")}function oM(e){var t=/[ \t]{2,}/g,n=/^[ \t]*/gm;return e.replace(t," ").replace(n,"").trim()}function Mje(e){return oM(`
48
48
  %ctippy.js
49
49
 
50
50
  %c`+oM(e)+`
51
51
 
52
52
  %c👷‍ This is a development-only message. It will be removed in production.
53
- `)}function zV(e){return[Bje(e),"color: #00C584; font-size: 1.3em; font-weight: bold;","line-height: 1.5","color: #a6a095;"]}var xp;process.env.NODE_ENV!=="production"&&Pje();function Pje(){xp=new Set}function Qo(e,t){if(e&&!xp.has(t)){var n;xp.add(t),(n=console).warn.apply(n,zV(t))}}function kC(e,t){if(e&&!xp.has(t)){var n;xp.add(t),(n=console).error.apply(n,zV(t))}}function Wje(e){var t=!e,n=Object.prototype.toString.call(e)==="[object Object]"&&!e.addEventListener;kC(t,["tippy() was passed","`"+String(e)+"`","as its targets (first) argument. Valid types are: String, Element,","Element[], or NodeList."].join(" ")),kC(n,["tippy() was passed a plain object which is not supported as an argument","for virtual positioning. Use props.getReferenceClientRect instead."].join(" "))}var HV={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},Dje={allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999},Rr=Object.assign({appendTo:qV,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},HV,Dje),Kje=Object.keys(Rr),Nje=function(t){process.env.NODE_ENV!=="production"&&GV(t,[]);var n=Object.keys(t);n.forEach(function(r){Rr[r]=t[r]})};function YV(e){var t=e.plugins||[],n=t.reduce(function(r,i){var o=i.name,a=i.defaultValue;if(o){var s;r[o]=e[o]!==void 0?e[o]:(s=Rr[o])!=null?s:a}return r},{});return Object.assign({},e,n)}function qje(e,t){var n=t?Object.keys(YV(Object.assign({},Rr,{plugins:t}))):Kje,r=n.reduce(function(i,o){var a=(e.getAttribute("data-tippy-"+o)||"").trim();if(!a)return i;if(o==="content")i[o]=a;else try{i[o]=JSON.parse(a)}catch{i[o]=a}return i},{});return r}function aM(e,t){var n=Object.assign({},t,{content:VV(t.content,[e])},t.ignoreAttributes?{}:qje(e,t.plugins));return n.aria=Object.assign({},Rr.aria,n.aria),n.aria={expanded:n.aria.expanded==="auto"?t.interactive:n.aria.expanded,content:n.aria.content==="auto"?t.interactive?null:"describedby":n.aria.content},n}function GV(e,t){e===void 0&&(e={}),t===void 0&&(t=[]);var n=Object.keys(e);n.forEach(function(r){var i=_je(Rr,Object.keys(HV)),o=!Sje(i,r);o&&(o=t.filter(function(a){return a.name===r}).length===0),Qo(o,["`"+r+"`","is not a valid prop. You may have spelled it incorrectly, or if it's","a plugin, forgot to pass it in an array as props.plugins.",`
53
+ `)}function zV(e){return[Mje(e),"color: #00C584; font-size: 1.3em; font-weight: bold;","line-height: 1.5","color: #a6a095;"]}var xp;process.env.NODE_ENV!=="production"&&Lje();function Lje(){xp=new Set}function Qo(e,t){if(e&&!xp.has(t)){var n;xp.add(t),(n=console).warn.apply(n,zV(t))}}function kC(e,t){if(e&&!xp.has(t)){var n;xp.add(t),(n=console).error.apply(n,zV(t))}}function jje(e){var t=!e,n=Object.prototype.toString.call(e)==="[object Object]"&&!e.addEventListener;kC(t,["tippy() was passed","`"+String(e)+"`","as its targets (first) argument. Valid types are: String, Element,","Element[], or NodeList."].join(" ")),kC(n,["tippy() was passed a plain object which is not supported as an argument","for virtual positioning. Use props.getReferenceClientRect instead."].join(" "))}var HV={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},Uje={allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999},Rr=Object.assign({appendTo:qV,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},HV,Uje),Bje=Object.keys(Rr),Pje=function(t){process.env.NODE_ENV!=="production"&&GV(t,[]);var n=Object.keys(t);n.forEach(function(r){Rr[r]=t[r]})};function YV(e){var t=e.plugins||[],n=t.reduce(function(r,i){var o=i.name,a=i.defaultValue;if(o){var s;r[o]=e[o]!==void 0?e[o]:(s=Rr[o])!=null?s:a}return r},{});return Object.assign({},e,n)}function Wje(e,t){var n=t?Object.keys(YV(Object.assign({},Rr,{plugins:t}))):Bje,r=n.reduce(function(i,o){var a=(e.getAttribute("data-tippy-"+o)||"").trim();if(!a)return i;if(o==="content")i[o]=a;else try{i[o]=JSON.parse(a)}catch{i[o]=a}return i},{});return r}function aM(e,t){var n=Object.assign({},t,{content:VV(t.content,[e])},t.ignoreAttributes?{}:Wje(e,t.plugins));return n.aria=Object.assign({},Rr.aria,n.aria),n.aria={expanded:n.aria.expanded==="auto"?t.interactive:n.aria.expanded,content:n.aria.content==="auto"?t.interactive?null:"describedby":n.aria.content},n}function GV(e,t){e===void 0&&(e={}),t===void 0&&(t=[]);var n=Object.keys(e);n.forEach(function(r){var i=yje(Rr,Object.keys(HV)),o=!vje(i,r);o&&(o=t.filter(function(a){return a.name===r}).length===0),Qo(o,["`"+r+"`","is not a valid prop. You may have spelled it incorrectly, or if it's","a plugin, forgot to pass it in an array as props.plugins.",`
54
54
 
55
55
  `,`All props: https://atomiks.github.io/tippyjs/v6/all-props/
56
- `,"Plugins: https://atomiks.github.io/tippyjs/v6/plugins/"].join(" "))})}var Vje=function(){return"innerHTML"};function MC(e,t){e[Vje()]=t}function sM(e){var t=Bd();return e===!0?t.className=KV:(t.className=NV,Tp(e)?t.appendChild(e):MC(t,e)),t}function uM(e,t){Tp(t.content)?(MC(e,""),e.appendChild(t.content)):typeof t.content!="function"&&(t.allowHTML?MC(e,t.content):e.textContent=t.content)}function LC(e){var t=e.firstElementChild,n=cg(t.children);return{box:t,content:n.find(function(r){return r.classList.contains(DV)}),arrow:n.find(function(r){return r.classList.contains(KV)||r.classList.contains(NV)}),backdrop:n.find(function(r){return r.classList.contains(Cje)})}}function JV(e){var t=Bd(),n=Bd();n.className=bje,n.setAttribute("data-state","hidden"),n.setAttribute("tabindex","-1");var r=Bd();r.className=DV,r.setAttribute("data-state","hidden"),uM(r,e.props),t.appendChild(n),n.appendChild(r),i(e.props,e.props);function i(o,a){var s=LC(t),u=s.box,c=s.content,l=s.arrow;a.theme?u.setAttribute("data-theme",a.theme):u.removeAttribute("data-theme"),typeof a.animation=="string"?u.setAttribute("data-animation",a.animation):u.removeAttribute("data-animation"),a.inertia?u.setAttribute("data-inertia",""):u.removeAttribute("data-inertia"),u.style.maxWidth=typeof a.maxWidth=="number"?a.maxWidth+"px":a.maxWidth,a.role?u.setAttribute("role",a.role):u.removeAttribute("role"),(o.content!==a.content||o.allowHTML!==a.allowHTML)&&uM(c,e.props),a.arrow?l?o.arrow!==a.arrow&&(u.removeChild(l),u.appendChild(sM(a.arrow))):u.appendChild(sM(a.arrow)):l&&u.removeChild(l)}return{popper:t,onUpdate:i}}JV.$$tippy=!0;var Qje=1,Xh=[],v1=[];function zje(e,t){var n=aM(e,Object.assign({},Rr,YV(tM(t)))),r,i,o,a=!1,s=!1,u=!1,c=!1,l,d,p,A=[],m=Xk(dt,n.interactiveDebounce),v,_=Qje++,C=null,I=Tje(n.plugins),x={isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},g={id:_,reference:e,popper:Bd(),popperInstance:C,props:n,state:x,plugins:I,clearDelayTimeouts:Bo,setProps:Jr,setContent:za,show:Vc,hide:U,hideWithInteractivity:j,enable:jo,disable:Uo,unmount:D,destroy:Me};if(!n.render)return process.env.NODE_ENV!=="production"&&kC(!0,"render() function has not been supplied."),g;var S=n.render(g),y=S.popper,T=S.onUpdate;y.setAttribute("data-tippy-root",""),y.id="tippy-"+g.id,g.popper=y,e._tippy=g,y._tippy=g;var w=I.map(function(B){return B.fn(g)}),O=e.hasAttribute("aria-expanded");return Hr(),k(),P(),Y("onCreate",[g]),n.showOnCreate&&vi(),y.addEventListener("mouseenter",function(){g.props.interactive&&g.state.isVisible&&g.clearDelayTimeouts()}),y.addEventListener("mouseleave",function(){g.props.interactive&&g.props.trigger.indexOf("mouseenter")>=0&&J().addEventListener("mousemove",m)}),g;function E(){var B=g.props.touch;return Array.isArray(B)?B:[B,0]}function F(){return E()[0]==="hold"}function W(){var B;return!!((B=g.props.render)!=null&&B.$$tippy)}function K(){return v||e}function J(){var B=K().parentNode;return B?Oje(B):document}function ee(){return LC(y)}function re(B){return g.state.isMounted&&!g.state.isVisible||ro.isTouch||l&&l.type==="focus"?0:h1(g.props.delay,B?0:1,Rr.delay)}function P(B){B===void 0&&(B=!1),y.style.pointerEvents=g.props.interactive&&!B?"":"none",y.style.zIndex=""+g.props.zIndex}function Y(B,ie,ge){if(ge===void 0&&(ge=!0),w.forEach(function(we){we[B]&&we[B].apply(we,ie)}),ge){var he;(he=g.props)[B].apply(he,ie)}}function M(){var B=g.props.aria;if(B.content){var ie="aria-"+B.content,ge=y.id,he=cl(g.props.triggerTarget||e);he.forEach(function(we){var ut=we.getAttribute(ie);if(g.state.isVisible)we.setAttribute(ie,ut?ut+" "+ge:ge);else{var Dn=ut&&ut.replace(ge,"").trim();Dn?we.setAttribute(ie,Dn):we.removeAttribute(ie)}})}}function k(){if(!(O||!g.props.aria.expanded)){var B=cl(g.props.triggerTarget||e);B.forEach(function(ie){g.props.interactive?ie.setAttribute("aria-expanded",g.state.isVisible&&ie===K()?"true":"false"):ie.removeAttribute("aria-expanded")})}}function q(){J().removeEventListener("mousemove",m),Xh=Xh.filter(function(B){return B!==m})}function ue(B){if(!(ro.isTouch&&(u||B.type==="mousedown"))){var ie=B.composedPath&&B.composedPath()[0]||B.target;if(!(g.props.interactive&&rM(y,ie))){if(cl(g.props.triggerTarget||e).some(function(ge){return rM(ge,ie)})){if(ro.isTouch||g.state.isVisible&&g.props.trigger.indexOf("click")>=0)return}else Y("onClickOutside",[g,B]);g.props.hideOnClick===!0&&(g.clearDelayTimeouts(),g.hide(),s=!0,setTimeout(function(){s=!1}),g.state.isMounted||at())}}}function ke(){u=!0}function Ie(){u=!1}function rt(){var B=J();B.addEventListener("mousedown",ue,!0),B.addEventListener("touchend",ue,nu),B.addEventListener("touchstart",Ie,nu),B.addEventListener("touchmove",ke,nu)}function at(){var B=J();B.removeEventListener("mousedown",ue,!0),B.removeEventListener("touchend",ue,nu),B.removeEventListener("touchstart",Ie,nu),B.removeEventListener("touchmove",ke,nu)}function fn(B,ie){rr(B,function(){!g.state.isVisible&&y.parentNode&&y.parentNode.contains(y)&&ie()})}function Zt(B,ie){rr(B,ie)}function rr(B,ie){var ge=ee().box;function he(we){we.target===ge&&(g1(ge,"remove",he),ie())}if(B===0)return ie();g1(ge,"remove",d),g1(ge,"add",he),d=he}function dn(B,ie,ge){ge===void 0&&(ge=!1);var he=cl(g.props.triggerTarget||e);he.forEach(function(we){we.addEventListener(B,ie,ge),A.push({node:we,eventType:B,handler:ie,options:ge})})}function Hr(){F()&&(dn("touchstart",De,{passive:!0}),dn("touchend",St,{passive:!0})),Ije(g.props.trigger).forEach(function(B){if(B!=="manual")switch(dn(B,De),B){case"mouseenter":dn("mouseleave",St);break;case"focus":dn(Uje?"focusout":"blur",st);break;case"focusin":dn("focusout",st);break}})}function Yr(){A.forEach(function(B){var ie=B.node,ge=B.eventType,he=B.handler,we=B.options;ie.removeEventListener(ge,he,we)}),A=[]}function De(B){var ie,ge=!1;if(!(!g.state.isEnabled||Wt(B)||s)){var he=((ie=l)==null?void 0:ie.type)==="focus";l=B,v=B.currentTarget,k(),!g.state.isVisible&&Eje(B)&&Xh.forEach(function(we){return we(B)}),B.type==="click"&&(g.props.trigger.indexOf("mouseenter")<0||a)&&g.props.hideOnClick!==!1&&g.state.isVisible?ge=!0:vi(B),B.type==="click"&&(a=!ge),ge&&!he&&yi(B)}}function dt(B){var ie=B.target,ge=K().contains(ie)||y.contains(ie);if(!(B.type==="mousemove"&&ge)){var he=Gr().concat(y).map(function(we){var ut,Dn=we._tippy,Ir=(ut=Dn.popperInstance)==null?void 0:ut.state;return Ir?{popperRect:we.getBoundingClientRect(),popperState:Ir,props:n}:null}).filter(Boolean);Fje(he,B)&&(q(),yi(B))}}function St(B){var ie=Wt(B)||g.props.trigger.indexOf("click")>=0&&a;if(!ie){if(g.props.interactive){g.hideWithInteractivity(B);return}yi(B)}}function st(B){g.props.trigger.indexOf("focusin")<0&&B.target!==K()||g.props.interactive&&B.relatedTarget&&y.contains(B.relatedTarget)||yi(B)}function Wt(B){return ro.isTouch?F()!==B.type.indexOf("touch")>=0:!1}function gi(){_r();var B=g.props,ie=B.popperOptions,ge=B.placement,he=B.offset,we=B.getReferenceClientRect,ut=B.moveTransition,Dn=W()?LC(y).arrow:null,Ir=we?{getBoundingClientRect:we,contextElement:we.contextElement||K()}:e,Qc={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(Hc){var Po=Hc.state;if(W()){var lb=ee(),Yc=lb.box;["placement","reference-hidden","escaped"].forEach(function(Js){Js==="placement"?Yc.setAttribute("data-placement",Po.placement):Po.attributes.popper["data-popper-"+Js]?Yc.setAttribute("data-"+Js,""):Yc.removeAttribute("data-"+Js)}),Po.attributes.popper={}}}},bi=[{name:"offset",options:{offset:he}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!ut}},Qc];W()&&Dn&&bi.push({name:"arrow",options:{element:Dn,padding:3}}),bi.push.apply(bi,(ie==null?void 0:ie.modifiers)||[]),g.popperInstance=yje(Ir,y,Object.assign({},ie,{placement:ge,onFirstUpdate:p,modifiers:bi}))}function _r(){g.popperInstance&&(g.popperInstance.destroy(),g.popperInstance=null)}function ir(){var B=g.props.appendTo,ie,ge=K();g.props.interactive&&B===qV||B==="parent"?ie=ge.parentNode:ie=VV(B,[ge]),ie.contains(y)||ie.appendChild(y),g.state.isMounted=!0,gi(),process.env.NODE_ENV!=="production"&&Qo(g.props.interactive&&B===Rr.appendTo&&ge.nextElementSibling!==y,["Interactive tippy element may not be accessible via keyboard","navigation because it is not directly after the reference element","in the DOM source order.",`
56
+ `,"Plugins: https://atomiks.github.io/tippyjs/v6/plugins/"].join(" "))})}var Dje=function(){return"innerHTML"};function MC(e,t){e[Dje()]=t}function sM(e){var t=Bd();return e===!0?t.className=KV:(t.className=NV,Tp(e)?t.appendChild(e):MC(t,e)),t}function uM(e,t){Tp(t.content)?(MC(e,""),e.appendChild(t.content)):typeof t.content!="function"&&(t.allowHTML?MC(e,t.content):e.textContent=t.content)}function LC(e){var t=e.firstElementChild,n=cg(t.children);return{box:t,content:n.find(function(r){return r.classList.contains(DV)}),arrow:n.find(function(r){return r.classList.contains(KV)||r.classList.contains(NV)}),backdrop:n.find(function(r){return r.classList.contains(gje)})}}function JV(e){var t=Bd(),n=Bd();n.className=mje,n.setAttribute("data-state","hidden"),n.setAttribute("tabindex","-1");var r=Bd();r.className=DV,r.setAttribute("data-state","hidden"),uM(r,e.props),t.appendChild(n),n.appendChild(r),i(e.props,e.props);function i(o,a){var s=LC(t),u=s.box,c=s.content,l=s.arrow;a.theme?u.setAttribute("data-theme",a.theme):u.removeAttribute("data-theme"),typeof a.animation=="string"?u.setAttribute("data-animation",a.animation):u.removeAttribute("data-animation"),a.inertia?u.setAttribute("data-inertia",""):u.removeAttribute("data-inertia"),u.style.maxWidth=typeof a.maxWidth=="number"?a.maxWidth+"px":a.maxWidth,a.role?u.setAttribute("role",a.role):u.removeAttribute("role"),(o.content!==a.content||o.allowHTML!==a.allowHTML)&&uM(c,e.props),a.arrow?l?o.arrow!==a.arrow&&(u.removeChild(l),u.appendChild(sM(a.arrow))):u.appendChild(sM(a.arrow)):l&&u.removeChild(l)}return{popper:t,onUpdate:i}}JV.$$tippy=!0;var Kje=1,Xh=[],v1=[];function Nje(e,t){var n=aM(e,Object.assign({},Rr,YV(tM(t)))),r,i,o,a=!1,s=!1,u=!1,c=!1,l,d,p,A=[],m=Xk(dt,n.interactiveDebounce),v,_=Kje++,C=null,I=Cje(n.plugins),x={isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},g={id:_,reference:e,popper:Bd(),popperInstance:C,props:n,state:x,plugins:I,clearDelayTimeouts:Bo,setProps:Jr,setContent:za,show:Vc,hide:U,hideWithInteractivity:j,enable:jo,disable:Uo,unmount:D,destroy:Me};if(!n.render)return process.env.NODE_ENV!=="production"&&kC(!0,"render() function has not been supplied."),g;var S=n.render(g),y=S.popper,T=S.onUpdate;y.setAttribute("data-tippy-root",""),y.id="tippy-"+g.id,g.popper=y,e._tippy=g,y._tippy=g;var w=I.map(function(B){return B.fn(g)}),O=e.hasAttribute("aria-expanded");return Hr(),k(),P(),Y("onCreate",[g]),n.showOnCreate&&vi(),y.addEventListener("mouseenter",function(){g.props.interactive&&g.state.isVisible&&g.clearDelayTimeouts()}),y.addEventListener("mouseleave",function(){g.props.interactive&&g.props.trigger.indexOf("mouseenter")>=0&&J().addEventListener("mousemove",m)}),g;function E(){var B=g.props.touch;return Array.isArray(B)?B:[B,0]}function F(){return E()[0]==="hold"}function W(){var B;return!!((B=g.props.render)!=null&&B.$$tippy)}function K(){return v||e}function J(){var B=K().parentNode;return B?wje(B):document}function ee(){return LC(y)}function re(B){return g.state.isMounted&&!g.state.isVisible||ro.isTouch||l&&l.type==="focus"?0:h1(g.props.delay,B?0:1,Rr.delay)}function P(B){B===void 0&&(B=!1),y.style.pointerEvents=g.props.interactive&&!B?"":"none",y.style.zIndex=""+g.props.zIndex}function Y(B,ie,ge){if(ge===void 0&&(ge=!0),w.forEach(function(we){we[B]&&we[B].apply(we,ie)}),ge){var he;(he=g.props)[B].apply(he,ie)}}function M(){var B=g.props.aria;if(B.content){var ie="aria-"+B.content,ge=y.id,he=cl(g.props.triggerTarget||e);he.forEach(function(we){var ut=we.getAttribute(ie);if(g.state.isVisible)we.setAttribute(ie,ut?ut+" "+ge:ge);else{var Dn=ut&&ut.replace(ge,"").trim();Dn?we.setAttribute(ie,Dn):we.removeAttribute(ie)}})}}function k(){if(!(O||!g.props.aria.expanded)){var B=cl(g.props.triggerTarget||e);B.forEach(function(ie){g.props.interactive?ie.setAttribute("aria-expanded",g.state.isVisible&&ie===K()?"true":"false"):ie.removeAttribute("aria-expanded")})}}function q(){J().removeEventListener("mousemove",m),Xh=Xh.filter(function(B){return B!==m})}function ue(B){if(!(ro.isTouch&&(u||B.type==="mousedown"))){var ie=B.composedPath&&B.composedPath()[0]||B.target;if(!(g.props.interactive&&rM(y,ie))){if(cl(g.props.triggerTarget||e).some(function(ge){return rM(ge,ie)})){if(ro.isTouch||g.state.isVisible&&g.props.trigger.indexOf("click")>=0)return}else Y("onClickOutside",[g,B]);g.props.hideOnClick===!0&&(g.clearDelayTimeouts(),g.hide(),s=!0,setTimeout(function(){s=!1}),g.state.isMounted||at())}}}function ke(){u=!0}function Ie(){u=!1}function rt(){var B=J();B.addEventListener("mousedown",ue,!0),B.addEventListener("touchend",ue,nu),B.addEventListener("touchstart",Ie,nu),B.addEventListener("touchmove",ke,nu)}function at(){var B=J();B.removeEventListener("mousedown",ue,!0),B.removeEventListener("touchend",ue,nu),B.removeEventListener("touchstart",Ie,nu),B.removeEventListener("touchmove",ke,nu)}function fn(B,ie){rr(B,function(){!g.state.isVisible&&y.parentNode&&y.parentNode.contains(y)&&ie()})}function Zt(B,ie){rr(B,ie)}function rr(B,ie){var ge=ee().box;function he(we){we.target===ge&&(g1(ge,"remove",he),ie())}if(B===0)return ie();g1(ge,"remove",d),g1(ge,"add",he),d=he}function dn(B,ie,ge){ge===void 0&&(ge=!1);var he=cl(g.props.triggerTarget||e);he.forEach(function(we){we.addEventListener(B,ie,ge),A.push({node:we,eventType:B,handler:ie,options:ge})})}function Hr(){F()&&(dn("touchstart",De,{passive:!0}),dn("touchend",St,{passive:!0})),bje(g.props.trigger).forEach(function(B){if(B!=="manual")switch(dn(B,De),B){case"mouseenter":dn("mouseleave",St);break;case"focus":dn(kje?"focusout":"blur",st);break;case"focusin":dn("focusout",st);break}})}function Yr(){A.forEach(function(B){var ie=B.node,ge=B.eventType,he=B.handler,we=B.options;ie.removeEventListener(ge,he,we)}),A=[]}function De(B){var ie,ge=!1;if(!(!g.state.isEnabled||Wt(B)||s)){var he=((ie=l)==null?void 0:ie.type)==="focus";l=B,v=B.currentTarget,k(),!g.state.isVisible&&Ije(B)&&Xh.forEach(function(we){return we(B)}),B.type==="click"&&(g.props.trigger.indexOf("mouseenter")<0||a)&&g.props.hideOnClick!==!1&&g.state.isVisible?ge=!0:vi(B),B.type==="click"&&(a=!ge),ge&&!he&&yi(B)}}function dt(B){var ie=B.target,ge=K().contains(ie)||y.contains(ie);if(!(B.type==="mousemove"&&ge)){var he=Gr().concat(y).map(function(we){var ut,Dn=we._tippy,Ir=(ut=Dn.popperInstance)==null?void 0:ut.state;return Ir?{popperRect:we.getBoundingClientRect(),popperState:Ir,props:n}:null}).filter(Boolean);Eje(he,B)&&(q(),yi(B))}}function St(B){var ie=Wt(B)||g.props.trigger.indexOf("click")>=0&&a;if(!ie){if(g.props.interactive){g.hideWithInteractivity(B);return}yi(B)}}function st(B){g.props.trigger.indexOf("focusin")<0&&B.target!==K()||g.props.interactive&&B.relatedTarget&&y.contains(B.relatedTarget)||yi(B)}function Wt(B){return ro.isTouch?F()!==B.type.indexOf("touch")>=0:!1}function gi(){_r();var B=g.props,ie=B.popperOptions,ge=B.placement,he=B.offset,we=B.getReferenceClientRect,ut=B.moveTransition,Dn=W()?LC(y).arrow:null,Ir=we?{getBoundingClientRect:we,contextElement:we.contextElement||K()}:e,Qc={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(Hc){var Po=Hc.state;if(W()){var lb=ee(),Yc=lb.box;["placement","reference-hidden","escaped"].forEach(function(Js){Js==="placement"?Yc.setAttribute("data-placement",Po.placement):Po.attributes.popper["data-popper-"+Js]?Yc.setAttribute("data-"+Js,""):Yc.removeAttribute("data-"+Js)}),Po.attributes.popper={}}}},bi=[{name:"offset",options:{offset:he}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!ut}},Qc];W()&&Dn&&bi.push({name:"arrow",options:{element:Dn,padding:3}}),bi.push.apply(bi,(ie==null?void 0:ie.modifiers)||[]),g.popperInstance=hje(Ir,y,Object.assign({},ie,{placement:ge,onFirstUpdate:p,modifiers:bi}))}function _r(){g.popperInstance&&(g.popperInstance.destroy(),g.popperInstance=null)}function ir(){var B=g.props.appendTo,ie,ge=K();g.props.interactive&&B===qV||B==="parent"?ie=ge.parentNode:ie=VV(B,[ge]),ie.contains(y)||ie.appendChild(y),g.state.isMounted=!0,gi(),process.env.NODE_ENV!=="production"&&Qo(g.props.interactive&&B===Rr.appendTo&&ge.nextElementSibling!==y,["Interactive tippy element may not be accessible via keyboard","navigation because it is not directly after the reference element","in the DOM source order.",`
57
57
 
58
58
  `,"Using a wrapper <div> or <span> tag around the reference element","solves this by creating a new parentNode context.",`
59
59
 
60
60
  `,"Specifying `appendTo: document.body` silences this warning, but it","assumes you are using a focus management solution to handle","keyboard navigation.",`
61
61
 
62
- `,"See: https://atomiks.github.io/tippyjs/v6/accessibility/#interactivity"].join(" "))}function Gr(){return cg(y.querySelectorAll("[data-tippy-root]"))}function vi(B){g.clearDelayTimeouts(),B&&Y("onTrigger",[g,B]),rt();var ie=re(!0),ge=E(),he=ge[0],we=ge[1];ro.isTouch&&he==="hold"&&we&&(ie=we),ie?r=setTimeout(function(){g.show()},ie):g.show()}function yi(B){if(g.clearDelayTimeouts(),Y("onUntrigger",[g,B]),!g.state.isVisible){at();return}if(!(g.props.trigger.indexOf("mouseenter")>=0&&g.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(B.type)>=0&&a)){var ie=re(!1);ie?i=setTimeout(function(){g.state.isVisible&&g.hide()},ie):o=requestAnimationFrame(function(){g.hide()})}}function jo(){g.state.isEnabled=!0}function Uo(){g.hide(),g.state.isEnabled=!1}function Bo(){clearTimeout(r),clearTimeout(i),cancelAnimationFrame(o)}function Jr(B){if(process.env.NODE_ENV!=="production"&&Qo(g.state.isDestroyed,tl("setProps")),!g.state.isDestroyed){Y("onBeforeUpdate",[g,B]),Yr();var ie=g.props,ge=aM(e,Object.assign({},ie,tM(B),{ignoreAttributes:!0}));g.props=ge,Hr(),ie.interactiveDebounce!==ge.interactiveDebounce&&(q(),m=Xk(dt,ge.interactiveDebounce)),ie.triggerTarget&&!ge.triggerTarget?cl(ie.triggerTarget).forEach(function(he){he.removeAttribute("aria-expanded")}):ge.triggerTarget&&e.removeAttribute("aria-expanded"),k(),P(),T&&T(ie,ge),g.popperInstance&&(gi(),Gr().forEach(function(he){requestAnimationFrame(he._tippy.popperInstance.forceUpdate)})),Y("onAfterUpdate",[g,B])}}function za(B){g.setProps({content:B})}function Vc(){process.env.NODE_ENV!=="production"&&Qo(g.state.isDestroyed,tl("show"));var B=g.state.isVisible,ie=g.state.isDestroyed,ge=!g.state.isEnabled,he=ro.isTouch&&!g.props.touch,we=h1(g.props.duration,0,Rr.duration);if(!(B||ie||ge||he)&&!K().hasAttribute("disabled")&&(Y("onShow",[g],!1),g.props.onShow(g)!==!1)){if(g.state.isVisible=!0,W()&&(y.style.visibility="visible"),P(),rt(),g.state.isMounted||(y.style.transition="none"),W()){var ut=ee(),Dn=ut.box,Ir=ut.content;m1([Dn,Ir],0)}p=function(){var bi;if(!(!g.state.isVisible||c)){if(c=!0,y.offsetHeight,y.style.transition=g.props.moveTransition,W()&&g.props.animation){var zc=ee(),Hc=zc.box,Po=zc.content;m1([Hc,Po],we),nM([Hc,Po],"visible")}M(),k(),eM(v1,g),(bi=g.popperInstance)==null||bi.forceUpdate(),Y("onMount",[g]),g.props.animation&&W()&&Zt(we,function(){g.state.isShown=!0,Y("onShown",[g])})}},ir()}}function U(){process.env.NODE_ENV!=="production"&&Qo(g.state.isDestroyed,tl("hide"));var B=!g.state.isVisible,ie=g.state.isDestroyed,ge=!g.state.isEnabled,he=h1(g.props.duration,1,Rr.duration);if(!(B||ie||ge)&&(Y("onHide",[g],!1),g.props.onHide(g)!==!1)){if(g.state.isVisible=!1,g.state.isShown=!1,c=!1,a=!1,W()&&(y.style.visibility="hidden"),q(),at(),P(!0),W()){var we=ee(),ut=we.box,Dn=we.content;g.props.animation&&(m1([ut,Dn],he),nM([ut,Dn],"hidden"))}M(),k(),g.props.animation?W()&&fn(he,g.unmount):g.unmount()}}function j(B){process.env.NODE_ENV!=="production"&&Qo(g.state.isDestroyed,tl("hideWithInteractivity")),J().addEventListener("mousemove",m),eM(Xh,m),m(B)}function D(){process.env.NODE_ENV!=="production"&&Qo(g.state.isDestroyed,tl("unmount")),g.state.isVisible&&g.hide(),g.state.isMounted&&(_r(),Gr().forEach(function(B){B._tippy.unmount()}),y.parentNode&&y.parentNode.removeChild(y),v1=v1.filter(function(B){return B!==g}),g.state.isMounted=!1,Y("onHidden",[g]))}function Me(){process.env.NODE_ENV!=="production"&&Qo(g.state.isDestroyed,tl("destroy")),!g.state.isDestroyed&&(g.clearDelayTimeouts(),g.unmount(),Yr(),delete e._tippy,g.state.isDestroyed=!0,Y("onDestroy",[g]))}}function Fh(e,t){t===void 0&&(t={});var n=Rr.plugins.concat(t.plugins||[]);process.env.NODE_ENV!=="production"&&(Wje(e),GV(t,n)),Lje();var r=Object.assign({},t,{plugins:n}),i=Rje(e);if(process.env.NODE_ENV!=="production"){var o=Tp(r.content),a=i.length>1;Qo(o&&a,["tippy() was passed an Element as the `content` prop, but more than","one tippy instance was created by this invocation. This means the","content element will only be appended to the last tippy instance.",`
62
+ `,"See: https://atomiks.github.io/tippyjs/v6/accessibility/#interactivity"].join(" "))}function Gr(){return cg(y.querySelectorAll("[data-tippy-root]"))}function vi(B){g.clearDelayTimeouts(),B&&Y("onTrigger",[g,B]),rt();var ie=re(!0),ge=E(),he=ge[0],we=ge[1];ro.isTouch&&he==="hold"&&we&&(ie=we),ie?r=setTimeout(function(){g.show()},ie):g.show()}function yi(B){if(g.clearDelayTimeouts(),Y("onUntrigger",[g,B]),!g.state.isVisible){at();return}if(!(g.props.trigger.indexOf("mouseenter")>=0&&g.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(B.type)>=0&&a)){var ie=re(!1);ie?i=setTimeout(function(){g.state.isVisible&&g.hide()},ie):o=requestAnimationFrame(function(){g.hide()})}}function jo(){g.state.isEnabled=!0}function Uo(){g.hide(),g.state.isEnabled=!1}function Bo(){clearTimeout(r),clearTimeout(i),cancelAnimationFrame(o)}function Jr(B){if(process.env.NODE_ENV!=="production"&&Qo(g.state.isDestroyed,tl("setProps")),!g.state.isDestroyed){Y("onBeforeUpdate",[g,B]),Yr();var ie=g.props,ge=aM(e,Object.assign({},ie,tM(B),{ignoreAttributes:!0}));g.props=ge,Hr(),ie.interactiveDebounce!==ge.interactiveDebounce&&(q(),m=Xk(dt,ge.interactiveDebounce)),ie.triggerTarget&&!ge.triggerTarget?cl(ie.triggerTarget).forEach(function(he){he.removeAttribute("aria-expanded")}):ge.triggerTarget&&e.removeAttribute("aria-expanded"),k(),P(),T&&T(ie,ge),g.popperInstance&&(gi(),Gr().forEach(function(he){requestAnimationFrame(he._tippy.popperInstance.forceUpdate)})),Y("onAfterUpdate",[g,B])}}function za(B){g.setProps({content:B})}function Vc(){process.env.NODE_ENV!=="production"&&Qo(g.state.isDestroyed,tl("show"));var B=g.state.isVisible,ie=g.state.isDestroyed,ge=!g.state.isEnabled,he=ro.isTouch&&!g.props.touch,we=h1(g.props.duration,0,Rr.duration);if(!(B||ie||ge||he)&&!K().hasAttribute("disabled")&&(Y("onShow",[g],!1),g.props.onShow(g)!==!1)){if(g.state.isVisible=!0,W()&&(y.style.visibility="visible"),P(),rt(),g.state.isMounted||(y.style.transition="none"),W()){var ut=ee(),Dn=ut.box,Ir=ut.content;m1([Dn,Ir],0)}p=function(){var bi;if(!(!g.state.isVisible||c)){if(c=!0,y.offsetHeight,y.style.transition=g.props.moveTransition,W()&&g.props.animation){var zc=ee(),Hc=zc.box,Po=zc.content;m1([Hc,Po],we),nM([Hc,Po],"visible")}M(),k(),eM(v1,g),(bi=g.popperInstance)==null||bi.forceUpdate(),Y("onMount",[g]),g.props.animation&&W()&&Zt(we,function(){g.state.isShown=!0,Y("onShown",[g])})}},ir()}}function U(){process.env.NODE_ENV!=="production"&&Qo(g.state.isDestroyed,tl("hide"));var B=!g.state.isVisible,ie=g.state.isDestroyed,ge=!g.state.isEnabled,he=h1(g.props.duration,1,Rr.duration);if(!(B||ie||ge)&&(Y("onHide",[g],!1),g.props.onHide(g)!==!1)){if(g.state.isVisible=!1,g.state.isShown=!1,c=!1,a=!1,W()&&(y.style.visibility="hidden"),q(),at(),P(!0),W()){var we=ee(),ut=we.box,Dn=we.content;g.props.animation&&(m1([ut,Dn],he),nM([ut,Dn],"hidden"))}M(),k(),g.props.animation?W()&&fn(he,g.unmount):g.unmount()}}function j(B){process.env.NODE_ENV!=="production"&&Qo(g.state.isDestroyed,tl("hideWithInteractivity")),J().addEventListener("mousemove",m),eM(Xh,m),m(B)}function D(){process.env.NODE_ENV!=="production"&&Qo(g.state.isDestroyed,tl("unmount")),g.state.isVisible&&g.hide(),g.state.isMounted&&(_r(),Gr().forEach(function(B){B._tippy.unmount()}),y.parentNode&&y.parentNode.removeChild(y),v1=v1.filter(function(B){return B!==g}),g.state.isMounted=!1,Y("onHidden",[g]))}function Me(){process.env.NODE_ENV!=="production"&&Qo(g.state.isDestroyed,tl("destroy")),!g.state.isDestroyed&&(g.clearDelayTimeouts(),g.unmount(),Yr(),delete e._tippy,g.state.isDestroyed=!0,Y("onDestroy",[g]))}}function Fh(e,t){t===void 0&&(t={});var n=Rr.plugins.concat(t.plugins||[]);process.env.NODE_ENV!=="production"&&(jje(e),GV(t,n)),Oje();var r=Object.assign({},t,{plugins:n}),i=xje(e);if(process.env.NODE_ENV!=="production"){var o=Tp(r.content),a=i.length>1;Qo(o&&a,["tippy() was passed an Element as the `content` prop, but more than","one tippy instance was created by this invocation. This means the","content element will only be appended to the last tippy instance.",`
63
63
 
64
64
  `,"Instead, pass the .innerHTML of the element, or use a function that","returns a cloned version of the element instead.",`
65
65
 
66
66
  `,`1) content: element.innerHTML
67
- `,"2) content: () => element.cloneNode(true)"].join(" "))}var s=i.reduce(function(u,c){var l=c&&zje(c,r);return l&&u.push(l),u},[]);return Tp(e)?s[0]:s}Fh.defaultProps=Rr;Fh.setDefaultProps=Nje;Fh.currentInput=ro;Object.assign({},kV,{effect:function(t){var n=t.state,r={popper:{position:n.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(n.elements.popper.style,r.popper),n.styles=r,n.elements.arrow&&Object.assign(n.elements.arrow.style,r.arrow)}});Fh.setDefaultProps({render:JV});class Hje{constructor({editor:t,element:n,view:r,tippyOptions:i={},updateDelay:o=250,shouldShow:a}){this.preventHide=!1,this.shouldShow=({view:s,state:u,from:c,to:l})=>{const{doc:d,selection:p}=u,{empty:A}=p,m=!d.textBetween(c,l).length&&fO(u.selection),v=this.element.contains(document.activeElement);return!(!(s.hasFocus()||v)||A||m||!this.editor.isEditable)},this.mousedownHandler=()=>{this.preventHide=!0},this.dragstartHandler=()=>{this.hide()},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:s})=>{var u;if(this.preventHide){this.preventHide=!1;return}s!=null&&s.relatedTarget&&(!((u=this.element.parentNode)===null||u===void 0)&&u.contains(s.relatedTarget))||this.hide()},this.tippyBlurHandler=s=>{this.blurHandler({event:s})},this.handleDebouncedUpdate=(s,u)=>{const c=!(u!=null&&u.selection.eq(s.state.selection)),l=!(u!=null&&u.doc.eq(s.state.doc));!c&&!l||(this.updateDebounceTimer&&clearTimeout(this.updateDebounceTimer),this.updateDebounceTimer=window.setTimeout(()=>{this.updateHandler(s,c,l,u)},this.updateDelay))},this.updateHandler=(s,u,c,l)=>{var d,p,A;const{state:m,composing:v}=s,{selection:_}=m;if(v||!u&&!c)return;this.createTooltip();const{ranges:I}=_,x=Math.min(...I.map(y=>y.$from.pos)),g=Math.max(...I.map(y=>y.$to.pos));if(!((d=this.shouldShow)===null||d===void 0?void 0:d.call(this,{editor:this.editor,view:s,state:m,oldState:l,from:x,to:g}))){this.hide();return}(p=this.tippy)===null||p===void 0||p.setProps({getReferenceClientRect:((A=this.tippyOptions)===null||A===void 0?void 0:A.getReferenceClientRect)||(()=>{if(MMe(m.selection)){let y=s.nodeDOM(x);const T=y.dataset.nodeViewWrapper?y:y.querySelector("[data-node-view-wrapper]");if(T&&(y=T.firstChild),y)return y.getBoundingClientRect()}return LMe(s,x,g)})}),this.show()},this.editor=t,this.element=n,this.view=r,this.updateDelay=o,a&&(this.shouldShow=a),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.addEventListener("dragstart",this.dragstartHandler),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.tippyOptions=i,this.element.remove(),this.element.style.visibility="visible"}createTooltip(){const{element:t}=this.editor.options,n=!!t.parentElement;this.tippy||!n||(this.tippy=Fh(t,{duration:0,getReferenceClientRect:null,content:this.element,interactive:!0,trigger:"manual",placement:"top",hideOnClick:"toggle",...this.tippyOptions}),this.tippy.popper.firstChild&&this.tippy.popper.firstChild.addEventListener("blur",this.tippyBlurHandler))}update(t,n){const{state:r}=t,i=r.selection.from!==r.selection.to;if(this.updateDelay>0&&i){this.handleDebouncedUpdate(t,n);return}const o=!(n!=null&&n.selection.eq(t.state.selection)),a=!(n!=null&&n.doc.eq(t.state.doc));this.updateHandler(t,o,a,n)}show(){var t;(t=this.tippy)===null||t===void 0||t.show()}hide(){var t;(t=this.tippy)===null||t===void 0||t.hide()}destroy(){var t,n;!((t=this.tippy)===null||t===void 0)&&t.popper.firstChild&&this.tippy.popper.firstChild.removeEventListener("blur",this.tippyBlurHandler),(n=this.tippy)===null||n===void 0||n.destroy(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.removeEventListener("dragstart",this.dragstartHandler),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler)}}const ZV=e=>new zr({key:typeof e.pluginKey=="string"?new eo(e.pluginKey):e.pluginKey,view:t=>new Hje({view:t,...e})});dr.create({name:"bubbleMenu",addOptions(){return{element:null,tippyOptions:{},pluginKey:"bubbleMenu",updateDelay:void 0,shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[ZV({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,updateDelay:this.options.updateDelay,shouldShow:this.options.shouldShow})]:[]}});var jC={exports:{}},y1={};/**
67
+ `,"2) content: () => element.cloneNode(true)"].join(" "))}var s=i.reduce(function(u,c){var l=c&&Nje(c,r);return l&&u.push(l),u},[]);return Tp(e)?s[0]:s}Fh.defaultProps=Rr;Fh.setDefaultProps=Pje;Fh.currentInput=ro;Object.assign({},kV,{effect:function(t){var n=t.state,r={popper:{position:n.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(n.elements.popper.style,r.popper),n.styles=r,n.elements.arrow&&Object.assign(n.elements.arrow.style,r.arrow)}});Fh.setDefaultProps({render:JV});class qje{constructor({editor:t,element:n,view:r,tippyOptions:i={},updateDelay:o=250,shouldShow:a}){this.preventHide=!1,this.shouldShow=({view:s,state:u,from:c,to:l})=>{const{doc:d,selection:p}=u,{empty:A}=p,m=!d.textBetween(c,l).length&&fO(u.selection),v=this.element.contains(document.activeElement);return!(!(s.hasFocus()||v)||A||m||!this.editor.isEditable)},this.mousedownHandler=()=>{this.preventHide=!0},this.dragstartHandler=()=>{this.hide()},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:s})=>{var u;if(this.preventHide){this.preventHide=!1;return}s!=null&&s.relatedTarget&&(!((u=this.element.parentNode)===null||u===void 0)&&u.contains(s.relatedTarget))||this.hide()},this.tippyBlurHandler=s=>{this.blurHandler({event:s})},this.handleDebouncedUpdate=(s,u)=>{const c=!(u!=null&&u.selection.eq(s.state.selection)),l=!(u!=null&&u.doc.eq(s.state.doc));!c&&!l||(this.updateDebounceTimer&&clearTimeout(this.updateDebounceTimer),this.updateDebounceTimer=window.setTimeout(()=>{this.updateHandler(s,c,l,u)},this.updateDelay))},this.updateHandler=(s,u,c,l)=>{var d,p,A;const{state:m,composing:v}=s,{selection:_}=m;if(v||!u&&!c)return;this.createTooltip();const{ranges:I}=_,x=Math.min(...I.map(y=>y.$from.pos)),g=Math.max(...I.map(y=>y.$to.pos));if(!((d=this.shouldShow)===null||d===void 0?void 0:d.call(this,{editor:this.editor,view:s,state:m,oldState:l,from:x,to:g}))){this.hide();return}(p=this.tippy)===null||p===void 0||p.setProps({getReferenceClientRect:((A=this.tippyOptions)===null||A===void 0?void 0:A.getReferenceClientRect)||(()=>{if(RMe(m.selection)){let y=s.nodeDOM(x);const T=y.dataset.nodeViewWrapper?y:y.querySelector("[data-node-view-wrapper]");if(T&&(y=T.firstChild),y)return y.getBoundingClientRect()}return OMe(s,x,g)})}),this.show()},this.editor=t,this.element=n,this.view=r,this.updateDelay=o,a&&(this.shouldShow=a),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.addEventListener("dragstart",this.dragstartHandler),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.tippyOptions=i,this.element.remove(),this.element.style.visibility="visible"}createTooltip(){const{element:t}=this.editor.options,n=!!t.parentElement;this.tippy||!n||(this.tippy=Fh(t,{duration:0,getReferenceClientRect:null,content:this.element,interactive:!0,trigger:"manual",placement:"top",hideOnClick:"toggle",...this.tippyOptions}),this.tippy.popper.firstChild&&this.tippy.popper.firstChild.addEventListener("blur",this.tippyBlurHandler))}update(t,n){const{state:r}=t,i=r.selection.from!==r.selection.to;if(this.updateDelay>0&&i){this.handleDebouncedUpdate(t,n);return}const o=!(n!=null&&n.selection.eq(t.state.selection)),a=!(n!=null&&n.doc.eq(t.state.doc));this.updateHandler(t,o,a,n)}show(){var t;(t=this.tippy)===null||t===void 0||t.show()}hide(){var t;(t=this.tippy)===null||t===void 0||t.hide()}destroy(){var t,n;!((t=this.tippy)===null||t===void 0)&&t.popper.firstChild&&this.tippy.popper.firstChild.removeEventListener("blur",this.tippyBlurHandler),(n=this.tippy)===null||n===void 0||n.destroy(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.removeEventListener("dragstart",this.dragstartHandler),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler)}}const ZV=e=>new zr({key:typeof e.pluginKey=="string"?new eo(e.pluginKey):e.pluginKey,view:t=>new qje({view:t,...e})});dr.create({name:"bubbleMenu",addOptions(){return{element:null,tippyOptions:{},pluginKey:"bubbleMenu",updateDelay:void 0,shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[ZV({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,updateDelay:this.options.updateDelay,shouldShow:this.options.shouldShow})]:[]}});var jC={exports:{}},y1={};/**
68
68
  * @license React
69
69
  * use-sync-external-store-shim.production.min.js
70
70
  *
@@ -72,7 +72,7 @@ npx @slicemachine/init@latest --repository <my-project>`,language:"bash",title:"
72
72
  *
73
73
  * This source code is licensed under the MIT license found in the
74
74
  * LICENSE file in the root directory of this source tree.
75
- */var cM;function Yje(){if(cM)return y1;cM=1;var e=$;function t(d,p){return d===p&&(d!==0||1/d===1/p)||d!==d&&p!==p}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,i=e.useEffect,o=e.useLayoutEffect,a=e.useDebugValue;function s(d,p){var A=p(),m=r({inst:{value:A,getSnapshot:p}}),v=m[0].inst,_=m[1];return o(function(){v.value=A,v.getSnapshot=p,u(v)&&_({inst:v})},[d,A,p]),i(function(){return u(v)&&_({inst:v}),d(function(){u(v)&&_({inst:v})})},[d]),a(A),A}function u(d){var p=d.getSnapshot;d=d.value;try{var A=p();return!n(d,A)}catch{return!0}}function c(d,p){return p()}var l=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?c:s;return y1.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:l,y1}var b1={};/**
75
+ */var cM;function Vje(){if(cM)return y1;cM=1;var e=$;function t(d,p){return d===p&&(d!==0||1/d===1/p)||d!==d&&p!==p}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,i=e.useEffect,o=e.useLayoutEffect,a=e.useDebugValue;function s(d,p){var A=p(),m=r({inst:{value:A,getSnapshot:p}}),v=m[0].inst,_=m[1];return o(function(){v.value=A,v.getSnapshot=p,u(v)&&_({inst:v})},[d,A,p]),i(function(){return u(v)&&_({inst:v}),d(function(){u(v)&&_({inst:v})})},[d]),a(A),A}function u(d){var p=d.getSnapshot;d=d.value;try{var A=p();return!n(d,A)}catch{return!0}}function c(d,p){return p()}var l=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?c:s;return y1.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:l,y1}var b1={};/**
76
76
  * @license React
77
77
  * use-sync-external-store-shim.development.js
78
78
  *
@@ -80,7 +80,7 @@ npx @slicemachine/init@latest --repository <my-project>`,language:"bash",title:"
80
80
  *
81
81
  * This source code is licensed under the MIT license found in the
82
82
  * LICENSE file in the root directory of this source tree.
83
- */var lM;function Gje(){return lM||(lM=1,process.env.NODE_ENV!=="production"&&function(){typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var e=$,t=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function n(x){{for(var g=arguments.length,S=new Array(g>1?g-1:0),y=1;y<g;y++)S[y-1]=arguments[y];r("error",x,S)}}function r(x,g,S){{var y=t.ReactDebugCurrentFrame,T=y.getStackAddendum();T!==""&&(g+="%s",S=S.concat([T]));var w=S.map(function(O){return String(O)});w.unshift("Warning: "+g),Function.prototype.apply.call(console[x],console,w)}}function i(x,g){return x===g&&(x!==0||1/x===1/g)||x!==x&&g!==g}var o=typeof Object.is=="function"?Object.is:i,a=e.useState,s=e.useEffect,u=e.useLayoutEffect,c=e.useDebugValue,l=!1,d=!1;function p(x,g,S){l||e.startTransition!==void 0&&(l=!0,n("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var y=g();if(!d){var T=g();o(y,T)||(n("The result of getSnapshot should be cached to avoid an infinite loop"),d=!0)}var w=a({inst:{value:y,getSnapshot:g}}),O=w[0].inst,E=w[1];return u(function(){O.value=y,O.getSnapshot=g,A(O)&&E({inst:O})},[x,y,g]),s(function(){A(O)&&E({inst:O});var F=function(){A(O)&&E({inst:O})};return x(F)},[x]),c(y),y}function A(x){var g=x.getSnapshot,S=x.value;try{var y=g();return!o(S,y)}catch{return!0}}function m(x,g,S){return g()}var v=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",_=!v,C=_?m:p,I=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:C;b1.useSyncExternalStore=I,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),b1}process.env.NODE_ENV==="production"?jC.exports=Yje():jC.exports=Gje();var _O=jC.exports;const Jje=(...e)=>t=>{e.forEach(n=>{typeof n=="function"?n(t):n&&(n.current=t)})},Zje=({contentComponent:e})=>{const t=_O.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getServerSnapshot);return $.createElement($.Fragment,null,Object.values(t))};function Xje(){const e=new Set;let t={};return{subscribe(n){return e.add(n),()=>{e.delete(n)}},getSnapshot(){return t},getServerSnapshot(){return t},setRenderer(n,r){t={...t,[n]:XC.createPortal(r.reactElement,r.element,n)},e.forEach(i=>i())},removeRenderer(n){const r={...t};delete r[n],t=r,e.forEach(i=>i())}}}class eUe extends $.Component{constructor(t){var n;super(t),this.editorContentRef=$.createRef(),this.initialized=!1,this.state={hasContentComponentInitialized:!!(!((n=t.editor)===null||n===void 0)&&n.contentComponent)}}componentDidMount(){this.init()}componentDidUpdate(){this.init()}init(){const t=this.props.editor;if(t&&!t.isDestroyed&&t.options.element){if(t.contentComponent)return;const n=this.editorContentRef.current;n.append(...t.options.element.childNodes),t.setOptions({element:n}),t.contentComponent=Xje(),this.state.hasContentComponentInitialized||(this.unsubscribeToContentComponent=t.contentComponent.subscribe(()=>{this.setState(r=>r.hasContentComponentInitialized?r:{hasContentComponentInitialized:!0}),this.unsubscribeToContentComponent&&this.unsubscribeToContentComponent()})),t.createNodeViews(),this.initialized=!0}}componentWillUnmount(){const t=this.props.editor;if(!t||(this.initialized=!1,t.isDestroyed||t.view.setProps({nodeViews:{}}),this.unsubscribeToContentComponent&&this.unsubscribeToContentComponent(),t.contentComponent=null,!t.options.element.firstChild))return;const n=document.createElement("div");n.append(...t.options.element.childNodes),t.setOptions({element:n})}render(){const{editor:t,innerRef:n,...r}=this.props;return $.createElement($.Fragment,null,$.createElement("div",{ref:Jje(n,this.editorContentRef),...r}),(t==null?void 0:t.contentComponent)&&$.createElement(Zje,{contentComponent:t.contentComponent}))}}const tUe=$.forwardRef((e,t)=>{const n=$.useMemo(()=>Math.floor(Math.random()*4294967295).toString(),[e.editor]);return $.createElement(eUe,{key:n,innerRef:t,...e})}),nUe=$.memo(tUe);var C1={};/**
83
+ */var lM;function Qje(){return lM||(lM=1,process.env.NODE_ENV!=="production"&&function(){typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var e=$,t=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function n(x){{for(var g=arguments.length,S=new Array(g>1?g-1:0),y=1;y<g;y++)S[y-1]=arguments[y];r("error",x,S)}}function r(x,g,S){{var y=t.ReactDebugCurrentFrame,T=y.getStackAddendum();T!==""&&(g+="%s",S=S.concat([T]));var w=S.map(function(O){return String(O)});w.unshift("Warning: "+g),Function.prototype.apply.call(console[x],console,w)}}function i(x,g){return x===g&&(x!==0||1/x===1/g)||x!==x&&g!==g}var o=typeof Object.is=="function"?Object.is:i,a=e.useState,s=e.useEffect,u=e.useLayoutEffect,c=e.useDebugValue,l=!1,d=!1;function p(x,g,S){l||e.startTransition!==void 0&&(l=!0,n("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var y=g();if(!d){var T=g();o(y,T)||(n("The result of getSnapshot should be cached to avoid an infinite loop"),d=!0)}var w=a({inst:{value:y,getSnapshot:g}}),O=w[0].inst,E=w[1];return u(function(){O.value=y,O.getSnapshot=g,A(O)&&E({inst:O})},[x,y,g]),s(function(){A(O)&&E({inst:O});var F=function(){A(O)&&E({inst:O})};return x(F)},[x]),c(y),y}function A(x){var g=x.getSnapshot,S=x.value;try{var y=g();return!o(S,y)}catch{return!0}}function m(x,g,S){return g()}var v=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",_=!v,C=_?m:p,I=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:C;b1.useSyncExternalStore=I,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),b1}process.env.NODE_ENV==="production"?jC.exports=Vje():jC.exports=Qje();var _O=jC.exports;const zje=(...e)=>t=>{e.forEach(n=>{typeof n=="function"?n(t):n&&(n.current=t)})},Hje=({contentComponent:e})=>{const t=_O.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getServerSnapshot);return $.createElement($.Fragment,null,Object.values(t))};function Yje(){const e=new Set;let t={};return{subscribe(n){return e.add(n),()=>{e.delete(n)}},getSnapshot(){return t},getServerSnapshot(){return t},setRenderer(n,r){t={...t,[n]:XC.createPortal(r.reactElement,r.element,n)},e.forEach(i=>i())},removeRenderer(n){const r={...t};delete r[n],t=r,e.forEach(i=>i())}}}class Gje extends $.Component{constructor(t){var n;super(t),this.editorContentRef=$.createRef(),this.initialized=!1,this.state={hasContentComponentInitialized:!!(!((n=t.editor)===null||n===void 0)&&n.contentComponent)}}componentDidMount(){this.init()}componentDidUpdate(){this.init()}init(){const t=this.props.editor;if(t&&!t.isDestroyed&&t.options.element){if(t.contentComponent)return;const n=this.editorContentRef.current;n.append(...t.options.element.childNodes),t.setOptions({element:n}),t.contentComponent=Yje(),this.state.hasContentComponentInitialized||(this.unsubscribeToContentComponent=t.contentComponent.subscribe(()=>{this.setState(r=>r.hasContentComponentInitialized?r:{hasContentComponentInitialized:!0}),this.unsubscribeToContentComponent&&this.unsubscribeToContentComponent()})),t.createNodeViews(),this.initialized=!0}}componentWillUnmount(){const t=this.props.editor;if(!t||(this.initialized=!1,t.isDestroyed||t.view.setProps({nodeViews:{}}),this.unsubscribeToContentComponent&&this.unsubscribeToContentComponent(),t.contentComponent=null,!t.options.element.firstChild))return;const n=document.createElement("div");n.append(...t.options.element.childNodes),t.setOptions({element:n})}render(){const{editor:t,innerRef:n,...r}=this.props;return $.createElement($.Fragment,null,$.createElement("div",{ref:zje(n,this.editorContentRef),...r}),(t==null?void 0:t.contentComponent)&&$.createElement(Hje,{contentComponent:t.contentComponent}))}}const Jje=$.forwardRef((e,t)=>{const n=$.useMemo(()=>Math.floor(Math.random()*4294967295).toString(),[e.editor]);return $.createElement(Gje,{key:n,innerRef:t,...e})}),Zje=$.memo(Jje);var C1={};/**
84
84
  * @license React
85
85
  * use-sync-external-store-shim/with-selector.production.min.js
86
86
  *
@@ -88,7 +88,7 @@ npx @slicemachine/init@latest --repository <my-project>`,language:"bash",title:"
88
88
  *
89
89
  * This source code is licensed under the MIT license found in the
90
90
  * LICENSE file in the root directory of this source tree.
91
- */var fM;function rUe(){if(fM)return C1;fM=1;var e=$,t=_O;function n(c,l){return c===l&&(c!==0||1/c===1/l)||c!==c&&l!==l}var r=typeof Object.is=="function"?Object.is:n,i=t.useSyncExternalStore,o=e.useRef,a=e.useEffect,s=e.useMemo,u=e.useDebugValue;return C1.useSyncExternalStoreWithSelector=function(c,l,d,p,A){var m=o(null);if(m.current===null){var v={hasValue:!1,value:null};m.current=v}else v=m.current;m=s(function(){function C(y){if(!I){if(I=!0,x=y,y=p(y),A!==void 0&&v.hasValue){var T=v.value;if(A(T,y))return g=T}return g=y}if(T=g,r(x,y))return T;var w=p(y);return A!==void 0&&A(T,w)?T:(x=y,g=w)}var I=!1,x,g,S=d===void 0?null:d;return[function(){return C(l())},S===null?void 0:function(){return C(S())}]},[l,d,p,A]);var _=i(c,m[0],m[1]);return a(function(){v.hasValue=!0,v.value=_},[_]),u(_),_},C1}var S1={};/**
91
+ */var fM;function Xje(){if(fM)return C1;fM=1;var e=$,t=_O;function n(c,l){return c===l&&(c!==0||1/c===1/l)||c!==c&&l!==l}var r=typeof Object.is=="function"?Object.is:n,i=t.useSyncExternalStore,o=e.useRef,a=e.useEffect,s=e.useMemo,u=e.useDebugValue;return C1.useSyncExternalStoreWithSelector=function(c,l,d,p,A){var m=o(null);if(m.current===null){var v={hasValue:!1,value:null};m.current=v}else v=m.current;m=s(function(){function C(y){if(!I){if(I=!0,x=y,y=p(y),A!==void 0&&v.hasValue){var T=v.value;if(A(T,y))return g=T}return g=y}if(T=g,r(x,y))return T;var w=p(y);return A!==void 0&&A(T,w)?T:(x=y,g=w)}var I=!1,x,g,S=d===void 0?null:d;return[function(){return C(l())},S===null?void 0:function(){return C(S())}]},[l,d,p,A]);var _=i(c,m[0],m[1]);return a(function(){v.hasValue=!0,v.value=_},[_]),u(_),_},C1}var S1={};/**
92
92
  * @license React
93
93
  * use-sync-external-store-shim/with-selector.development.js
94
94
  *
@@ -96,9 +96,9 @@ npx @slicemachine/init@latest --repository <my-project>`,language:"bash",title:"
96
96
  *
97
97
  * This source code is licensed under the MIT license found in the
98
98
  * LICENSE file in the root directory of this source tree.
99
- */var dM;function iUe(){return dM||(dM=1,process.env.NODE_ENV!=="production"&&function(){typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var e=$,t=_O;function n(l,d){return l===d&&(l!==0||1/l===1/d)||l!==l&&d!==d}var r=typeof Object.is=="function"?Object.is:n,i=t.useSyncExternalStore,o=e.useRef,a=e.useEffect,s=e.useMemo,u=e.useDebugValue;function c(l,d,p,A,m){var v=o(null),_;v.current===null?(_={hasValue:!1,value:null},v.current=_):_=v.current;var C=s(function(){var S=!1,y,T,w=function(W){if(!S){S=!0,y=W;var K=A(W);if(m!==void 0&&_.hasValue){var J=_.value;if(m(J,K))return T=J,J}return T=K,K}var ee=y,re=T;if(r(ee,W))return re;var P=A(W);return m!==void 0&&m(re,P)?re:(y=W,T=P,P)},O=p===void 0?null:p,E=function(){return w(d())},F=O===null?void 0:function(){return w(O())};return[E,F]},[d,p,A,m]),I=C[0],x=C[1],g=i(l,I,x);return a(function(){_.hasValue=!0,_.value=g},[g]),u(g),g}S1.useSyncExternalStoreWithSelector=c,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),S1}process.env.NODE_ENV==="production"?rUe():iUe();process.env.NODE_ENV;const XV=$.createContext({editor:null});XV.Consumer;const oUe=()=>$.useContext(XV),_1=e=>{const[t,n]=$.useState(null),{editor:r}=oUe();return $.useEffect(()=>{var i;if(!t||!((i=e.editor)===null||i===void 0)&&i.isDestroyed||r!=null&&r.isDestroyed)return;const{pluginKey:o="bubbleMenu",editor:a,tippyOptions:s={},updateDelay:u,shouldShow:c=null}=e,l=a||r;if(!l){console.warn("BubbleMenu component is not rendered inside of an editor component or does not have editor prop.");return}const d=ZV({updateDelay:u,editor:l,element:t,pluginKey:o,shouldShow:c,tippyOptions:s});return l.registerPlugin(d),()=>l.unregisterPlugin(o)},[e.editor,r,t]),$.createElement("div",{ref:n,className:e.className,style:{visibility:"hidden"}},e.children)},eQ=$.createContext({onDragStart:void 0}),aUe=()=>$.useContext(eQ),tQ=$.forwardRef((e,t)=>{const{onDragStart:n}=aUe(),r=e.as||"div";return $.createElement(r,{...e,ref:t,"data-node-view-wrapper":"",onDragStart:n,style:{whiteSpace:"normal",...e.style}})});function sUe(e){return!!(typeof e=="function"&&e.prototype&&e.prototype.isReactComponent)}function uUe(e){var t;return typeof e=="object"&&((t=e.$$typeof)===null||t===void 0?void 0:t.toString())==="Symbol(react.forward_ref)"}class nQ{constructor(t,{editor:n,props:r={},as:i="div",className:o="",attrs:a}){this.ref=null,this.id=Math.floor(Math.random()*4294967295).toString(),this.component=t,this.editor=n,this.props=r,this.element=document.createElement(i),this.element.classList.add("react-renderer"),o&&this.element.classList.add(...o.split(" ")),a&&Object.keys(a).forEach(s=>{this.element.setAttribute(s,a[s])}),this.editor.isInitialized?XC.flushSync(()=>{this.render()}):this.render()}render(){var t;const n=this.component,r=this.props,i=this.editor;(sUe(n)||uUe(n))&&(r.ref=o=>{this.ref=o}),this.reactElement=$.createElement(n,r),(t=i==null?void 0:i.contentComponent)===null||t===void 0||t.setRenderer(this.id,this)}updateProps(t={}){this.props={...this.props,...t},this.render()}destroy(){var t;const n=this.editor;(t=n==null?void 0:n.contentComponent)===null||t===void 0||t.removeRenderer(this.id)}}class cUe extends rLe{mount(){const t={editor:this.editor,node:this.node,decorations:this.decorations,selected:!1,extension:this.extension,getPos:()=>this.getPos(),updateAttributes:(c={})=>this.updateAttributes(c),deleteNode:()=>this.deleteNode()};if(!this.component.displayName){const c=l=>l.charAt(0).toUpperCase()+l.substring(1);this.component.displayName=c(this.extension.name)}const i={onDragStart:this.onDragStart.bind(this),nodeViewContentRef:c=>{c&&this.contentDOMElement&&c.firstChild!==this.contentDOMElement&&c.appendChild(this.contentDOMElement)}},o=this.component,a=$.memo(c=>$.createElement(eQ.Provider,{value:i},$.createElement(o,c)));a.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 s=this.node.isInline?"span":"div";this.options.as&&(s=this.options.as);const{className:u=""}=this.options;this.handleSelectionUpdate=this.handleSelectionUpdate.bind(this),this.editor.on("selectionUpdate",this.handleSelectionUpdate),this.renderer=new nQ(a,{editor:this.editor,props:t,as:s,className:`node-${this.node.type.name} ${u}`.trim(),attrs:this.options.attrs})}get dom(){var t;if(this.renderer.element.firstElementChild&&!(!((t=this.renderer.element.firstElementChild)===null||t===void 0)&&t.hasAttribute("data-node-view-wrapper")))throw Error("Please use the NodeViewWrapper component for your node view.");return this.renderer.element}get contentDOM(){return this.node.isLeaf?null:this.contentDOMElement}handleSelectionUpdate(){const{from:t,to:n}=this.editor.state.selection;if(t<=this.getPos()&&n>=this.getPos()+this.node.nodeSize){if(this.renderer.props.selected)return;this.selectNode()}else{if(!this.renderer.props.selected)return;this.deselectNode()}}update(t,n){const r=i=>{this.renderer.updateProps(i)};if(t.type!==this.node.type)return!1;if(typeof this.options.update=="function"){const i=this.node,o=this.decorations;return this.node=t,this.decorations=n,this.options.update({oldNode:i,oldDecorations:o,newNode:t,newDecorations:n,updateProps:()=>r({node:t,decorations:n})})}return t===this.node&&this.decorations===n||(this.node=t,this.decorations=n,r({node:t,decorations:n})),!0}selectNode(){this.renderer.updateProps({selected:!0}),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 rQ(e,t){return n=>n.editor.contentComponent?new cUe(e,n,t):{}}const lUe=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,fUe=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,dUe=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,pUe=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,AUe=Nc.create({name:"bold",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:e=>e.style.fontWeight!=="normal"&&null},{style:"font-weight",getAttrs:e=>/^(bold(er)?|[5-9]\d{2,})$/.test(e)&&null}]},renderHTML({HTMLAttributes:e}){return["strong",Et(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[ig({find:lUe,type:this.type}),ig({find:dUe,type:this.type})]},addPasteRules(){return[ag({find:fUe,type:this.type}),ag({find:pUe,type:this.type})]}});var qc=(e=>(e.Document="document",e.Mark="mark",e.Node="node",e))(qc||{}),vl=(e=>(e.Text="text",e.Embed="embed",e.Image="image",e))(vl||{});class hUe{constructor(t,n,r){Rn(this,"extType","document");this.name=t,this.component=n,this.converter=r}}class kh{constructor(t,n,r,i,o,a=!1){Rn(this,"extType","node");Rn(this,"nodeType","text");this.richTextNodeTypes=t,this.name=n,this.component=r,this.converter=i,this.placeholder=o,this.lockedFormat=a}}function iQ(e){return e instanceof kh}class mUe{constructor(t,n,r,i){Rn(this,"extType","node");Rn(this,"nodeType","embed");this.richTextNodeTypes=t,this.name=n,this.component=r,this.converter=i}}class gUe{constructor(t,n,r,i){Rn(this,"extType","node");Rn(this,"nodeType","image");this.richTextNodeTypes=t,this.name=n,this.component=r,this.converter=i}}class vUe extends kh{constructor(t,n,r,i,o){super(t,"heading",n,i,o),this.levels=r}}class IO extends kh{constructor(t,n,r,i){super(t,n,r,i)}}function yUe(e){return e instanceof IO}const oQ=jn.create({name:"hardBreak",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:e}){return["br",Et(this.options.HTMLAttributes,e)]},renderText(){return`
100
- `},addCommands(){return{setHardBreak:()=>({commands:e,chain:t,state:n,editor:r})=>e.first([()=>e.exitCode(),()=>e.command(()=>{const{selection:i,storedMarks:o}=n;if(i.$from.parent.type.spec.isolating)return!1;const{keepMarks:a}=this.options,{splittableMarks:s}=r.extensionManager,u=o||i.$to.parentOffset&&i.$from.marks();return t().insertContent({type:this.name}).command(({tr:c,dispatch:l})=>{if(l&&u&&a){const d=u.filter(p=>s.includes(p.type.name));c.ensureMarks(d)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),Pu={isHardBreak(e){return e.type.name===oQ.name},children:{reduce(e,t,n){let r=n;return e.forEach((i,o,a)=>{r=t(r,i,a)}),r},map(e,t){return this.reduce(e,(n,r)=>[...n,t(r)],[])},exists(e,t){return this.reduce(e,(n,r)=>n||t(r),!1)},filter(e,t){return this.reduce(e,(n,r)=>[...n,...t(r)?[r]:[]],[])}},marks:{reduce(e,t,n){let r=n;return e.marks.forEach((i,o)=>{r=t(r,i,o)}),r},map(e,t){return this.reduce(e,(n,r)=>[...n,t(r)],[])},filter(e,t){return this.reduce(e,(n,r)=>[...n,...t(r)?[r]:[]],[])}}};function bUe(e){if(!e||!(e!=null&&e.single)&&!(e!=null&&e.multi))return pM();const t=CUe(e);if(!t.size)return pM();const n=SUe(t),r=_Ue(n,e);return{nodeTypes:t,extensions:r}}function CUe(e){const n=(e.single||e.multi||"").split(/\s*,\s*/).map(r=>{const i=fe.RichTextNodeTypeCodec.decode(r);return i._tag==="Right"?i.right:void 0}).filter(io.isDefined);return new Set(n)}function SUe(e){return qQ(e).filter(n=>Fn.some(e,r=>n.richTextNodeTypes.includes(r)))}function _Ue(e,t){var r;const n=new Set(e);return Fn.some(n,yUe)&&n.add(ao),Fn.some(n,iQ)||n.add(ao),(r=t==null?void 0:t.labels)!=null&&r.length&&n.add(FO),[...n]}function pM(){return{extensions:qQ(),nodeTypes:new Set(Vl.keys(fe.RichTextNodeTypeCodec.keys))}}class IUe{constructor(t,n,r){Rn(this,"extType",qc.Mark);Rn(this,"richTextNodeTypes",[fe.RichTextNodeType.strong]);this.name=t,this.component=n,this.converter=r}}const aQ="bold",sQ=AUe.extend({name:aQ}),TUe={fromPrismic(e){return function(){var t;return(t=e.marks[sQ.name])==null?void 0:t.create()}},toPrismic(){}},xUe=new IUe(aQ,sQ,TUe),TO=xUe,wUe=jn.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:e}){return["li",Et(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)}}}),AM=Nc.create({name:"textStyle",priority:101,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"span",getAttrs:e=>e.hasAttribute("style")?{}:!1}]},renderHTML({HTMLAttributes:e}){return["span",Et(this.options.HTMLAttributes,e),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:e,commands:t})=>{const n=pO(e,this.type);return Object.entries(n).some(([,i])=>!!i)?!0:t.unsetMark(this.name)}}}}),hM=/^\s*([-+*])\s$/,EUe=jn.create({name:"bulletList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:"ul"}]},renderHTML({HTMLAttributes:e}){return["ul",Et(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(wUe.name,this.editor.getAttributes(AM.name)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let e=og({find:hM,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(e=og({find:hM,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(AM.name),editor:this.editor})),[e]}}),$Ue=jn.create({name:"doc",topNode:!0,content:"block+"}),RUe=jn.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:e}){return["li",Et(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)}}}),uQ=RUe.extend({name:"listItem",content:"paragraph*",addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name)}}}),OUe={fromPrismic(e){return function(t){var r;const n=ao.converter.fromPrismic(e)(t);if(n)return(r=e.nodes[uQ.name])==null?void 0:r.create({},n)}},toPrismic(e,t){return Pu.children.reduce(e,(n,r)=>{const i=ao.converter.toPrismic(r),o=(()=>i instanceof Array?i.map(a=>({...a,type:t})):i?[{...i,type:t}]:[])();return[...n,...o]},[])}},Nl={component:uQ,converter:OUe,placeholder:"List"};function FUe(e,t){return e.copy(e.content.append(t.content))}const ll={heading1:"heading1",heading2:"heading2",heading3:"heading3",heading4:"heading4",heading5:"heading5",heading6:"heading6",paragraph:"paragraph",preformatted:"preformatted",strong:"strong",em:"em",listItem:"list-item",oListItem:"o-list-item",list:"group-list-item",oList:"group-o-list-item",image:"image",embed:"embed",hyperlink:"hyperlink",label:"label",span:"span"},nb=()=>(++nb.i).toString();nb.i=0;const kUe=e=>{const t=MUe(e),n=[];for(let r=0;r<t.length;r++)n.push(cQ(t[r]));return{key:nb(),children:n}},Pd=(e,t=[])=>({key:nb(),type:e.type,text:"text"in e?e.text:void 0,node:e,children:t}),I1=e=>Pd({type:ll.span,text:e,spans:[]}),MUe=e=>{const t=e.slice(0);for(let n=0;n<t.length;n++){const r=t[n];if(r.type===ll.listItem||r.type===ll.oListItem){const i=[r];for(;t[n+1]&&t[n+1].type===r.type;)i.push(t[n+1]),t.splice(n,1);r.type===ll.listItem?t[n]={type:ll.list,items:i}:t[n]={type:ll.oList,items:i}}}return t},cQ=e=>{if("text"in e)return Pd(e,lQ(e.spans,e));if("items"in e){const t=[];for(let n=0;n<e.items.length;n++)t.push(cQ(e.items[n]));return Pd(e,t)}return Pd(e)},lQ=(e,t,n)=>{if(!e.length)return[I1(t.text)];const r=e.slice(0);r.sort((o,a)=>o.start-a.start||a.end-o.end);const i=[];for(let o=0;o<r.length;o++){const a=r[o],s=n&&n.start||0,u=a.start-s,c=a.end-s,l=t.text.slice(u,c),d=[];for(let A=o;A<r.length;A++){const m=r[A];m!==a&&m.start>=a.start&&m.end<=a.end&&(d.push(m),r.splice(A,1),A--)}o===0&&u>0&&i.push(I1(t.text.slice(0,u)));const p={...a,text:l};i.push(Pd(p,lQ(d,{...t,text:l},a))),c<t.text.length&&i.push(I1(t.text.slice(c,r[o+1]?r[o+1].start-s:void 0)))}return i},LUe=(e,t)=>fQ(kUe(e).children,t),fQ=(e,t)=>{const n=[];for(let r=0;r<e.length;r++){const i=e[r],o=t(i.type,i.node,i.text,fQ(i.children,t),i.key);o!=null&&n.push(o)}return n},jUe=jn.create({name:"text",group:"inline"});function UUe(e){return e.reduce((t,n)=>{const r=(t[n.type]||[]).concat(n);return{...t,[n.type]:r}},{})}function mM(e){return e.sort((t,n)=>t.start-n.start)}function BUe(e){const t=UUe(e),n=Object.entries(t).map(([r,i])=>mM(i).reduce((a,s)=>{if(!a.length)return[s];const u=a.length-1,c=a[u];return c?c.end<s.start?[...a,s]:c.end>=s.end?a:[...a.slice(0,u),{...c,end:s.end}]:a},[])).flat();return mM(n)}const lg=oQ.extend({name:"hard_break"}),fg=`
101
- `,dQ={fromPrismic(e){return function(t){var n;if(t===fg)return(n=e.nodes[lg.name])==null?void 0:n.create({})}},toPrismic(e){if(e.type.name===lg.name)return fg}},T1={isEmptyLine(e){return e.length===0},isFirst(e){return e===0}};function PUe(e,t){return function(n){const r=dQ.fromPrismic(e)(fg);if(!r)return[n(t)];const i=t.split(fg);return i.length===1?t.length?[n(t)]:[r]:i.reduce((o,a,s)=>T1.isFirst(s)?T1.isEmptyLine(a)?o:[...o,n(a)]:T1.isEmptyLine(a)?[...o,r]:[...o,r,n(a)],[])}}const WUe={name:lg.name,component:lg,converter:dQ,splitTextToNodes:PUe},dg=WUe,pQ={fromPrismic(e){return t=>{switch(t.type){case"hyperlink":return DQ.converter.fromPrismic(e)(t);case"em":return OO.converter.fromPrismic(e)(t);case"strong":return TO.converter.fromPrismic(e)(t);case"label":return FO.converter.fromPrismic(e)(t);case"list-item":return}}},toPrismic(e,t,n){const r=NQ.find(i=>e.type.name===i.name);if(!r)throw new 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":return{type:r.name,start:t,end:n,data:r.converter.toPrismic(e)};case"label":return{type:r.name,start:t,end:n,data:r.converter.toPrismic(e)}}}},DUe={strong:"bold",label:"label",em:"em",hyperlink:"hyperlink","list-item":void 0},gM=jUe.extend({name:"text"}),KUe={fromPrismic(e){return function(t,n,r=!1){const i={type:t,text:n.content.text,spans:n.content.spans||[]};return LUe([i],NUe(e,r)).flat()}},toPrismic(e,t,n){const r=Pu.children.reduce(e,(i,o)=>{const a=(()=>o.type.name===dg.name?dg.converter.toPrismic(o):o.textContent)(),s=a?i.text+a:i.text,u=i.text.length,c=s.length,l=(()=>o.marks.length?Pu.marks.map(o,p=>pQ.toPrismic(p,u,c)):void 0)();return{...i,text:s,spans:l?[...i.spans,...l]:i.spans}},{text:"",spans:[]});return{type:t,content:{text:r.text,spans:[...BUe(r.spans)].sort((i,o)=>i.type.localeCompare(o.type))},...n}}};function NUe(e,t=!1){return(n,r,i,o)=>{if(n==="span"&&i&&i.length)return t?[e.text(i)]:dg.splitTextToNodes(e,i)(u=>e.text(u));const a=pQ.fromPrismic(e)(r);return a?qUe(a,o):o.flat()}}function qUe(e,t){return t.flat().map(r=>{const o=[...r.marks,e].sort((a,s)=>a.type.name.localeCompare(s.type.name));return r.mark(o)})}const VUe={name:gM.name,component:gM,converter:KUe},Wu=VUe,xO="document";function QUe(e){return $Ue.extend({name:xO,content:e?"block+":"block"})}function zUe(e){return{fromPrismic(t,n,r){var o;const i=r.value.reduce((a,s)=>{const{extension:u,block:c}=JUe(e,s,t,n),l=YUe({extension:u,block:c,schema:t}),d=a.slice(0,a.length-1),p=Qt.last(a),A=GUe({node:l,previousNode:p});return A.updatedNode?[...A.merged?d:a,A.updatedNode]:a},[]);return(o=t.nodes[xO])==null?void 0:o.create({},i)},toPrismic(t){return{__TYPE__:"StructuredTextContent",value:[...Pu.children.reduce(t,(r,i)=>{const o=Object.values(e).find(s=>i.type.name===s.name),a=o==null?void 0:o.converter.toPrismic(i);return a||console.warn(`Cannot convert node of type '${i.type.name}'.`),a?[...r,...a instanceof Array?a:[a]]:r},[])]}}}}const HUe=new hUe(xO,QUe,zUe),UC=HUe;function YUe(e){const{extension:t,block:n,schema:r}=e;if(t)switch(t.nodeType){case vl.Embed:return Ce.EmbedBlock.is(n)?t.converter.fromPrismic(r)(n):void 0;case vl.Text:return Ce.TextBlock.is(n)?t.converter.fromPrismic(r)(n):void 0;case vl.Image:return Ce.ImageBlock.is(n)?t.converter.fromPrismic(r)(n):void 0}}function GUe(e){const{node:t,previousNode:n}=e;return!t||!n?{merged:!1,updatedNode:t}:t.type.name===n.type.name&&(t.type.name===gg.name||t.type.name===yg.name)?{merged:!0,updatedNode:FUe(n,t)}:{merged:!1,updatedNode:t}}function JUe(e,t,n,r){var s;const i=e.find(u=>u.richTextNodeTypes.includes(t.type)&&r.has(t.type));if(i)return{extension:i,block:t};if(!Ce.TextBlock.is(t))return{extension:void 0,block:t};const o=e.find(u=>iQ(u)&&u.name in n.nodes),a=(s=t.content.spans)==null?void 0:s.filter(u=>{const c=DUe[u.type];return c&&c in n.marks});return{extension:o,block:{...t,content:{text:t.content.text,spans:a}}}}const ZUe=dr.create({name:"placeholder",addOptions(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){return[new zr({key:new eo("placeholder"),props:{decorations:({doc:e,selection:t})=>{const n=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:r}=t,i=[];if(!n)return null;const o=this.editor.isEmpty;return e.descendants((a,s)=>{const u=r>=s&&r<=s+a.nodeSize,c=!a.isLeaf&&xV(a);if((u||!this.options.showOnlyCurrent)&&c){const l=[this.options.emptyNodeClass];o&&l.push(this.options.emptyEditorClass);const d=wi.node(s,s+a.nodeSize,{class:l.join(" "),"data-placeholder":typeof this.options.placeholder=="function"?this.options.placeholder({editor:this.editor,node:a,pos:s,hasAnchor:u}):this.options.placeholder});i.push(d)}return this.options.includeChildren}),Ht.create(e,i)}}})]}}),XUe=jn.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:e}){return["p",Et(this.options.HTMLAttributes,e),0]},addCommands(){return{setParagraph:()=>({commands:e})=>e.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),pm="ltr",lu="rtl",Ho="dir",e2e=fe.RichTextNodeType.rtl,t2e=dr.create({name:"textDirection",addOptions(){return{supportedExtensionNames:[]}},addGlobalAttributes(){return[{types:this.options.supportedExtensionNames,attributes:{[Ho]:{default:pm,parseHTML:e=>e.getAttribute(Ho),renderHTML:e=>({[Ho]:BC(e[Ho])})}}}]},addCommands(){return{setDirection:e=>({commands:t})=>{switch(e){case pm:return t.setLeftToRight();case lu:return t.setRightToLeft()}},toggleDirection:e=>({commands:t})=>{const n=e===lu?pm:lu;return t.setDirection(n)},setRightToLeft:()=>({commands:e})=>this.options.supportedExtensionNames.every(t=>e.updateAttributes(t,{[Ho]:lu})),setLeftToRight:()=>({commands:e})=>this.options.supportedExtensionNames.every(t=>e.resetAttributes(t,Ho))}},addKeyboardShortcuts(){return{"Mod-Shift-r":()=>this.editor.commands.setRightToLeft(),"Mod-Shift-l":()=>this.editor.commands.setLeftToRight()}}}),ua={parseNodeAttrsDirection(e){return BC(e[Ho])},fromPrismic(e){return{[Ho]:BC(e.direction)}},toPrismic(e){return{direction:this.parseNodeAttrsDirection(e.attrs)}}};function BC(e){return e===lu?lu:pm}const pg=XUe.extend({name:"paragraph",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:e}){return["p",Et(this.options.HTMLAttributes,e),0]}}),n2e={fromPrismic(e){return function(t){var r;const n=Wu.converter.fromPrismic(e)(pg.name,t);return(r=e.nodes[pg.name])==null?void 0:r.create(ua.fromPrismic(t),n)}},toPrismic(e){return Wu.converter.toPrismic(e,fe.RichTextNodeType.paragraph,ua.toPrismic(e))}},r2e=new kh([fe.RichTextNodeType.paragraph],pg.name,pg,n2e,"Type '/' for commands"),ao=r2e,i2e=e=>ZUe.configure({includeChildren:!0,placeholder:t=>o2e(t,e),showOnlyCurrent:!1,showOnlyWhenEditable:!1});function o2e(e,t){const{editor:n,hasAnchor:r,pos:i,node:o}=e,{placeholderByNodeType:a,unfocusedPlaceholder:s,nodeExtensions:u}=t,c=!Pu.children.exists(n.state.doc,I=>I===o),l=n.isEditable;if(s&&!n.isFocused&&n.isEmpty&&i===0)return s;const d=o.type.name!==ao.name,p=n.isFocused&&r||d||c,A=u.filter(I=>I!==ao).length>1;function m(I){return I===ao.placeholder?l&&p&&A:l&&p}function v(){if(c)return Nl.placeholder;const I=a[o.type.name];return typeof I=="string"?I:I==null?void 0:I(o.attrs)}const _=v();return m(_)&&_||""}function rb(e){return e.split("-")[1]}function AQ(e){return e==="y"?"height":"width"}function as(e){return e.split("-")[0]}function Mh(e){return["top","bottom"].includes(as(e))?"x":"y"}function vM(e,t,n){let{reference:r,floating:i}=e;const o=r.x+r.width/2-i.width/2,a=r.y+r.height/2-i.height/2,s=Mh(t),u=AQ(s),c=r[u]/2-i[u]/2,l=s==="x";let d;switch(as(t)){case"top":d={x:o,y:r.y-i.height};break;case"bottom":d={x:o,y:r.y+r.height};break;case"right":d={x:r.x+r.width,y:a};break;case"left":d={x:r.x-i.width,y:a};break;default:d={x:r.x,y:r.y}}switch(rb(t)){case"start":d[s]-=c*(n&&l?-1:1);break;case"end":d[s]+=c*(n&&l?-1:1)}return d}const a2e=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:a}=n,s=o.filter(Boolean),u=await(a.isRTL==null?void 0:a.isRTL(t));let c=await a.getElementRects({reference:e,floating:t,strategy:i}),{x:l,y:d}=vM(c,r,u),p=r,A={},m=0;for(let v=0;v<s.length;v++){const{name:_,fn:C}=s[v],{x:I,y:x,data:g,reset:S}=await C({x:l,y:d,initialPlacement:r,placement:p,strategy:i,middlewareData:A,rects:c,platform:a,elements:{reference:e,floating:t}});l=I??l,d=x??d,A={...A,[_]:{...A[_],...g}},S&&m<=50&&(m++,typeof S=="object"&&(S.placement&&(p=S.placement),S.rects&&(c=S.rects===!0?await a.getElementRects({reference:e,floating:t,strategy:i}):S.rects),{x:l,y:d}=vM(c,p,u)),v=-1)}return{x:l,y:d,placement:p,strategy:i,middlewareData:A}};function s2e(e){return typeof e!="number"?function(t){return{top:0,right:0,bottom:0,left:0,...t}}(e):{top:e,right:e,bottom:e,left:e}}function PC(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}async function hQ(e,t){var n;t===void 0&&(t={});const{x:r,y:i,platform:o,rects:a,elements:s,strategy:u}=e,{boundary:c="clippingAncestors",rootBoundary:l="viewport",elementContext:d="floating",altBoundary:p=!1,padding:A=0}=t,m=s2e(A),v=s[p?d==="floating"?"reference":"floating":d],_=PC(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(v)))==null||n?v:v.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(s.floating)),boundary:c,rootBoundary:l,strategy:u})),C=d==="floating"?{...a.floating,x:r,y:i}:a.reference,I=await(o.getOffsetParent==null?void 0:o.getOffsetParent(s.floating)),x=await(o.isElement==null?void 0:o.isElement(I))&&await(o.getScale==null?void 0:o.getScale(I))||{x:1,y:1},g=PC(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({rect:C,offsetParent:I,strategy:u}):C);return{top:(_.top-g.top+m.top)/x.y,bottom:(g.bottom-_.bottom+m.bottom)/x.y,left:(_.left-g.left+m.left)/x.x,right:(g.right-_.right+m.right)/x.x}}const u2e=Math.min,c2e=Math.max;function yM(e,t,n){return c2e(e,u2e(t,n))}const l2e=["top","right","bottom","left"];l2e.reduce((e,t)=>e.concat(t,t+"-start",t+"-end"),[]);const f2e={left:"right",right:"left",bottom:"top",top:"bottom"};function Ag(e){return e.replace(/left|right|bottom|top/g,t=>f2e[t])}function d2e(e,t,n){n===void 0&&(n=!1);const r=rb(e),i=Mh(e),o=AQ(i);let a=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(a=Ag(a)),{main:a,cross:Ag(a)}}const p2e={start:"end",end:"start"};function x1(e){return e.replace(/start|end/g,t=>p2e[t])}const A2e=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n;const{placement:r,middlewareData:i,rects:o,initialPlacement:a,platform:s,elements:u}=t,{mainAxis:c=!0,crossAxis:l=!0,fallbackPlacements:d,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:A="none",flipAlignment:m=!0,...v}=e,_=as(r),C=as(a)===a,I=await(s.isRTL==null?void 0:s.isRTL(u.floating)),x=d||(C||!m?[Ag(a)]:function(F){const W=Ag(F);return[x1(F),W,x1(W)]}(a));d||A==="none"||x.push(...function(F,W,K,J){const ee=rb(F);let re=function(P,Y,M){const k=["left","right"],q=["right","left"],ue=["top","bottom"],ke=["bottom","top"];switch(P){case"top":case"bottom":return M?Y?q:k:Y?k:q;case"left":case"right":return Y?ue:ke;default:return[]}}(as(F),K==="start",J);return ee&&(re=re.map(P=>P+"-"+ee),W&&(re=re.concat(re.map(x1)))),re}(a,m,A,I));const g=[a,...x],S=await hQ(t,v),y=[];let T=((n=i.flip)==null?void 0:n.overflows)||[];if(c&&y.push(S[_]),l){const{main:F,cross:W}=d2e(r,o,I);y.push(S[F],S[W])}if(T=[...T,{placement:r,overflows:y}],!y.every(F=>F<=0)){var w,O;const F=(((w=i.flip)==null?void 0:w.index)||0)+1,W=g[F];if(W)return{data:{index:F,overflows:T},reset:{placement:W}};let K=(O=T.filter(J=>J.overflows[0]<=0).sort((J,ee)=>J.overflows[1]-ee.overflows[1])[0])==null?void 0:O.placement;if(!K)switch(p){case"bestFit":{var E;const J=(E=T.map(ee=>[ee.placement,ee.overflows.filter(re=>re>0).reduce((re,P)=>re+P,0)]).sort((ee,re)=>ee[1]-re[1])[0])==null?void 0:E[0];J&&(K=J);break}case"initialPlacement":K=a}if(r!==K)return{reset:{placement:K}}}return{}}}},h2e=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){const{x:n,y:r}=t,i=await async function(o,a){const{placement:s,platform:u,elements:c}=o,l=await(u.isRTL==null?void 0:u.isRTL(c.floating)),d=as(s),p=rb(s),A=Mh(s)==="x",m=["left","top"].includes(d)?-1:1,v=l&&A?-1:1,_=typeof a=="function"?a(o):a;let{mainAxis:C,crossAxis:I,alignmentAxis:x}=typeof _=="number"?{mainAxis:_,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,..._};return p&&typeof x=="number"&&(I=p==="end"?-1*x:x),A?{x:I*v,y:C*m}:{x:C*m,y:I*v}}(t,e);return{x:n+i.x,y:r+i.y,data:i}}}};function mQ(e){return e==="x"?"y":"x"}const m2e=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i}=t,{mainAxis:o=!0,crossAxis:a=!1,limiter:s={fn:_=>{let{x:C,y:I}=_;return{x:C,y:I}}},...u}=e,c={x:n,y:r},l=await hQ(t,u),d=Mh(as(i)),p=mQ(d);let A=c[d],m=c[p];if(o){const _=d==="y"?"bottom":"right";A=yM(A+l[d==="y"?"top":"left"],A,A-l[_])}if(a){const _=p==="y"?"bottom":"right";m=yM(m+l[p==="y"?"top":"left"],m,m-l[_])}const v=s.fn({...t,[d]:A,[p]:m});return{...v,data:{x:v.x-n,y:v.y-r}}}}},g2e=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:i,rects:o,middlewareData:a}=t,{offset:s=0,mainAxis:u=!0,crossAxis:c=!0}=e,l={x:n,y:r},d=Mh(i),p=mQ(d);let A=l[d],m=l[p];const v=typeof s=="function"?s(t):s,_=typeof v=="number"?{mainAxis:v,crossAxis:0}:{mainAxis:0,crossAxis:0,...v};if(u){const x=d==="y"?"height":"width",g=o.reference[d]-o.floating[x]+_.mainAxis,S=o.reference[d]+o.reference[x]-_.mainAxis;A<g?A=g:A>S&&(A=S)}if(c){var C,I;const x=d==="y"?"width":"height",g=["top","left"].includes(as(i)),S=o.reference[p]-o.floating[x]+(g&&((C=a.offset)==null?void 0:C[p])||0)+(g?0:_.crossAxis),y=o.reference[p]+o.reference[x]+(g?0:((I=a.offset)==null?void 0:I[p])||0)-(g?_.crossAxis:0);m<S?m=S:m>y&&(m=y)}return{[d]:A,[p]:m}}}};function Or(e){var t;return((t=e.ownerDocument)==null?void 0:t.defaultView)||window}function so(e){return Or(e).getComputedStyle(e)}const bM=Math.min,Wd=Math.max,hg=Math.round;function gQ(e){const t=so(e);let n=parseFloat(t.width),r=parseFloat(t.height);const i=e.offsetWidth,o=e.offsetHeight,a=hg(n)!==i||hg(r)!==o;return a&&(n=i,r=o),{width:n,height:r,fallback:a}}function hs(e){return yQ(e)?(e.nodeName||"").toLowerCase():""}let em;function vQ(){if(em)return em;const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?(em=e.brands.map(t=>t.brand+"/"+t.version).join(" "),em):navigator.userAgent}function uo(e){return e instanceof Or(e).HTMLElement}function Oi(e){return e instanceof Or(e).Element}function yQ(e){return e instanceof Or(e).Node}function CM(e){return typeof ShadowRoot>"u"?!1:e instanceof Or(e).ShadowRoot||e instanceof ShadowRoot}function ib(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=so(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(i)}function v2e(e){return["table","td","th"].includes(hs(e))}function WC(e){const t=/firefox/i.test(vQ()),n=so(e),r=n.backdropFilter||n.WebkitBackdropFilter;return n.transform!=="none"||n.perspective!=="none"||!!r&&r!=="none"||t&&n.willChange==="filter"||t&&!!n.filter&&n.filter!=="none"||["transform","perspective"].some(i=>n.willChange.includes(i))||["paint","layout","strict","content"].some(i=>{const o=n.contain;return o!=null&&o.includes(i)})}function DC(){return/^((?!chrome|android).)*safari/i.test(vQ())}function wO(e){return["html","body","#document"].includes(hs(e))}function bQ(e){return Oi(e)?e:e.contextElement}const CQ={x:1,y:1};function yl(e){const t=bQ(e);if(!uo(t))return CQ;const n=t.getBoundingClientRect(),{width:r,height:i,fallback:o}=gQ(t);let a=(o?hg(n.width):n.width)/r,s=(o?hg(n.height):n.height)/i;return a&&Number.isFinite(a)||(a=1),s&&Number.isFinite(s)||(s=1),{x:a,y:s}}function Du(e,t,n,r){var i,o;t===void 0&&(t=!1),n===void 0&&(n=!1);const a=e.getBoundingClientRect(),s=bQ(e);let u=CQ;t&&(r?Oi(r)&&(u=yl(r)):u=yl(e));const c=s?Or(s):window,l=DC()&&n;let d=(a.left+(l&&((i=c.visualViewport)==null?void 0:i.offsetLeft)||0))/u.x,p=(a.top+(l&&((o=c.visualViewport)==null?void 0:o.offsetTop)||0))/u.y,A=a.width/u.x,m=a.height/u.y;if(s){const v=Or(s),_=r&&Oi(r)?Or(r):r;let C=v.frameElement;for(;C&&r&&_!==v;){const I=yl(C),x=C.getBoundingClientRect(),g=getComputedStyle(C);x.x+=(C.clientLeft+parseFloat(g.paddingLeft))*I.x,x.y+=(C.clientTop+parseFloat(g.paddingTop))*I.y,d*=I.x,p*=I.y,A*=I.x,m*=I.y,d+=x.x,p+=x.y,C=Or(C).frameElement}}return{width:A,height:m,top:p,right:d+A,bottom:p+m,left:d,x:d,y:p}}function ss(e){return((yQ(e)?e.ownerDocument:e.document)||window.document).documentElement}function ob(e){return Oi(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function SQ(e){return Du(ss(e)).left+ob(e).scrollLeft}function wp(e){if(hs(e)==="html")return e;const t=e.assignedSlot||e.parentNode||CM(e)&&e.host||ss(e);return CM(t)?t.host:t}function _Q(e){const t=wp(e);return wO(t)?t.ownerDocument.body:uo(t)&&ib(t)?t:_Q(t)}function bu(e,t){var n;t===void 0&&(t=[]);const r=_Q(e),i=r===((n=e.ownerDocument)==null?void 0:n.body),o=Or(r);return i?t.concat(o,o.visualViewport||[],ib(r)?r:[]):t.concat(r,bu(r))}function SM(e,t,n){let r;if(t==="viewport")r=function(a,s){const u=Or(a),c=ss(a),l=u.visualViewport;let d=c.clientWidth,p=c.clientHeight,A=0,m=0;if(l){d=l.width,p=l.height;const v=DC();(!v||v&&s==="fixed")&&(A=l.offsetLeft,m=l.offsetTop)}return{width:d,height:p,x:A,y:m}}(e,n);else if(t==="document")r=function(a){const s=ss(a),u=ob(a),c=a.ownerDocument.body,l=Wd(s.scrollWidth,s.clientWidth,c.scrollWidth,c.clientWidth),d=Wd(s.scrollHeight,s.clientHeight,c.scrollHeight,c.clientHeight);let p=-u.scrollLeft+SQ(a);const A=-u.scrollTop;return so(c).direction==="rtl"&&(p+=Wd(s.clientWidth,c.clientWidth)-l),{width:l,height:d,x:p,y:A}}(ss(e));else if(Oi(t))r=function(a,s){const u=Du(a,!0,s==="fixed"),c=u.top+a.clientTop,l=u.left+a.clientLeft,d=uo(a)?yl(a):{x:1,y:1};return{width:a.clientWidth*d.x,height:a.clientHeight*d.y,x:l*d.x,y:c*d.y}}(t,n);else{const a={...t};if(DC()){var i,o;const s=Or(e);a.x-=((i=s.visualViewport)==null?void 0:i.offsetLeft)||0,a.y-=((o=s.visualViewport)==null?void 0:o.offsetTop)||0}r=a}return PC(r)}function _M(e,t){return uo(e)&&so(e).position!=="fixed"?t?t(e):e.offsetParent:null}function IM(e,t){const n=Or(e);let r=_M(e,t);for(;r&&v2e(r)&&so(r).position==="static";)r=_M(r,t);return r&&(hs(r)==="html"||hs(r)==="body"&&so(r).position==="static"&&!WC(r))?n:r||function(i){let o=wp(i);for(;uo(o)&&!wO(o);){if(WC(o))return o;o=wp(o)}return null}(e)||n}function y2e(e,t,n){const r=uo(t),i=ss(t),o=Du(e,!0,n==="fixed",t);let a={scrollLeft:0,scrollTop:0};const s={x:0,y:0};if(r||!r&&n!=="fixed")if((hs(t)!=="body"||ib(i))&&(a=ob(t)),uo(t)){const u=Du(t,!0);s.x=u.x+t.clientLeft,s.y=u.y+t.clientTop}else i&&(s.x=SQ(i));return{x:o.left+a.scrollLeft-s.x,y:o.top+a.scrollTop-s.y,width:o.width,height:o.height}}const b2e={getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const o=n==="clippingAncestors"?function(c,l){const d=l.get(c);if(d)return d;let p=bu(c).filter(_=>Oi(_)&&hs(_)!=="body"),A=null;const m=so(c).position==="fixed";let v=m?wp(c):c;for(;Oi(v)&&!wO(v);){const _=so(v),C=WC(v);_.position==="fixed"?A=null:(m?C||A:C||_.position!=="static"||!A||!["absolute","fixed"].includes(A.position))?A=_:p=p.filter(I=>I!==v),v=wp(v)}return l.set(c,p),p}(t,this._c):[].concat(n),a=[...o,r],s=a[0],u=a.reduce((c,l)=>{const d=SM(t,l,i);return c.top=Wd(d.top,c.top),c.right=bM(d.right,c.right),c.bottom=bM(d.bottom,c.bottom),c.left=Wd(d.left,c.left),c},SM(t,s,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;const i=uo(n),o=ss(n);if(n===o)return t;let a={scrollLeft:0,scrollTop:0},s={x:1,y:1};const u={x:0,y:0};if((i||!i&&r!=="fixed")&&((hs(n)!=="body"||ib(o))&&(a=ob(n)),uo(n))){const c=Du(n);s=yl(n),u.x=c.x+n.clientLeft,u.y=c.y+n.clientTop}return{width:t.width*s.x,height:t.height*s.y,x:t.x*s.x-a.scrollLeft*s.x+u.x,y:t.y*s.y-a.scrollTop*s.y+u.y}},isElement:Oi,getDimensions:function(e){return uo(e)?gQ(e):e.getBoundingClientRect()},getOffsetParent:IM,getDocumentElement:ss,getScale:yl,async getElementRects(e){let{reference:t,floating:n,strategy:r}=e;const i=this.getOffsetParent||IM,o=this.getDimensions;return{reference:y2e(t,await i(n),r),floating:{x:0,y:0,...await o(n)}}},getClientRects:e=>Array.from(e.getClientRects()),isRTL:e=>so(e).direction==="rtl"};function C2e(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:a=!0,animationFrame:s=!1}=r,u=i&&!s,c=u||o?[...Oi(e)?bu(e):e.contextElement?bu(e.contextElement):[],...bu(t)]:[];c.forEach(A=>{u&&A.addEventListener("scroll",n,{passive:!0}),o&&A.addEventListener("resize",n)});let l,d=null;if(a){let A=!0;d=new ResizeObserver(()=>{A||n(),A=!1}),Oi(e)&&!s&&d.observe(e),Oi(e)||!e.contextElement||s||d.observe(e.contextElement),d.observe(t)}let p=s?Du(e):null;return s&&function A(){const m=Du(e);!p||m.x===p.x&&m.y===p.y&&m.width===p.width&&m.height===p.height||n(),p=m,l=requestAnimationFrame(A)}(),n(),()=>{var A;c.forEach(m=>{u&&m.removeEventListener("scroll",n),o&&m.removeEventListener("resize",n)}),(A=d)==null||A.disconnect(),d=null,s&&cancelAnimationFrame(l)}}const S2e=(e,t,n)=>{const r=new Map,i={platform:b2e,...n},o={...i.platform,_c:r};return a2e(e,t,{...i,platform:o})};var Am=typeof document<"u"?$.useLayoutEffect:$.useEffect;function mg(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(!mg(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!Object.prototype.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){const o=i[r];if(!(o==="_owner"&&e.$$typeof)&&!mg(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function TM(e){const t=Te.useRef(e);return Am(()=>{t.current=e}),t}function _2e(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,whileElementsMounted:o,open:a}=e,[s,u]=Te.useState({x:null,y:null,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[c,l]=Te.useState(r);mg(c,r)||l(r);const d=Te.useRef(null),p=Te.useRef(null),A=Te.useRef(s),m=TM(o),v=TM(i),[_,C]=Te.useState(null),[I,x]=Te.useState(null),g=Te.useCallback(E=>{d.current!==E&&(d.current=E,C(E))},[]),S=Te.useCallback(E=>{p.current!==E&&(p.current=E,x(E))},[]),y=Te.useCallback(()=>{if(!d.current||!p.current)return;const E={placement:t,strategy:n,middleware:c};v.current&&(E.platform=v.current),S2e(d.current,p.current,E).then(F=>{const W={...F,isPositioned:!0};T.current&&!mg(A.current,W)&&(A.current=W,az.flushSync(()=>{u(W)}))})},[c,t,n,v]);Am(()=>{a===!1&&A.current.isPositioned&&(A.current.isPositioned=!1,u(E=>({...E,isPositioned:!1})))},[a]);const T=Te.useRef(!1);Am(()=>(T.current=!0,()=>{T.current=!1}),[]),Am(()=>{if(_&&I){if(m.current)return m.current(_,I,y);y()}},[_,I,y,m]);const w=Te.useMemo(()=>({reference:d,floating:p,setReference:g,setFloating:S}),[g,S]),O=Te.useMemo(()=>({reference:_,floating:I}),[_,I]);return Te.useMemo(()=>({...s,update:y,refs:w,elements:O,reference:g,floating:S}),[s,y,w,O,g,S])}var ns=typeof document<"u"?$.useLayoutEffect:$.useEffect;function I2e(){const e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(i=>i(n))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){e.set(t,(e.get(t)||[]).filter(r=>r!==n))}}}let w1=!1,T2e=0;const xM=()=>"floating-ui-"+T2e++;function x2e(){const[e,t]=Te.useState(()=>w1?xM():void 0);return ns(()=>{e==null&&t(xM())},[]),Te.useEffect(()=>{w1||(w1=!0)},[]),e}const wM=Te["useId".toString()],EM=wM??x2e,w2e=Te.createContext(null),E2e=Te.createContext(null),IQ=()=>{var e,t;return(e=(t=Te.useContext(w2e))==null?void 0:t.id)!=null?e:null},EO=()=>Te.useContext(E2e);function $O(e){var t;return(t=e==null?void 0:e.ownerDocument)!=null?t:document}function TQ(e){var t;return(t=$O(e).defaultView)!=null?t:window}function hm(e){return e?e instanceof TQ(e).Element:!1}function $2e(e){return e?e instanceof TQ(e).HTMLElement:!1}const $M=Te["useInsertionEffect".toString()];function KC(e){const t=Te.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return $M?$M(()=>{t.current=e}):t.current=e,Te.useCallback(function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return t.current==null?void 0:t.current(...r)},[])}function R2e(e){let{open:t=!1,onOpenChange:n,whileElementsMounted:r,placement:i,middleware:o,strategy:a,nodeId:s}=e===void 0?{}:e;const[u,c]=Te.useState(null),l=EO(),d=Te.useRef(null),p=Te.useRef({}),A=Te.useState(()=>I2e())[0],m=_2e({placement:i,middleware:o,strategy:a,whileElementsMounted:r}),v=KC(n),_=Te.useMemo(()=>({...m.refs,domReference:d}),[m.refs]),C=Te.useMemo(()=>({...m,refs:_,dataRef:p,nodeId:s,events:A,open:t,onOpenChange:v,_:{domReference:u}}),[m,s,A,t,v,_,u]);ns(()=>{const g=l==null?void 0:l.nodesRef.current.find(S=>S.id===s);g&&(g.context=C)});const{reference:I}=m,x=Te.useCallback(g=>{(hm(g)||g===null)&&(C.refs.domReference.current=g,c(g)),I(g)},[I,C.refs]);return Te.useMemo(()=>({...m,context:C,refs:_,reference:x}),[m,_,C,x])}function E1(e,t,n){const r=new Map;return{...n==="floating"&&{tabIndex:-1},...e,...t.map(i=>i?i[n]:null).concat(e).reduce((i,o)=>(o&&Object.entries(o).forEach(a=>{let[s,u]=a;if(s.indexOf("on")===0){if(r.has(s)||r.set(s,[]),typeof u=="function"){var c;(c=r.get(s))==null||c.push(u),i[s]=function(){for(var l,d=arguments.length,p=new Array(d),A=0;A<d;A++)p[A]=arguments[A];(l=r.get(s))==null||l.forEach(m=>m(...p))}}}else i[s]=u}),i),{})}}const O2e=function(e){return e===void 0&&(e=[]),{getReferenceProps:t=>E1(t,e,"reference"),getFloatingProps:t=>E1(t,e,"floating"),getItemProps:t=>E1(t,e,"item")}};function $1(e,t){var n;let r=(n=e.filter(a=>{var s;return a.parentId===t&&((s=a.context)==null?void 0:s.open)}))!=null?n:[],i=r;for(;i.length;){var o;i=(o=e.filter(a=>{var s;return(s=i)==null?void 0:s.some(u=>{var c;return a.parentId===u.id&&((c=a.context)==null?void 0:c.open)})}))!=null?o:[],r=r.concat(i)}return r}function RM(e){let t=e.activeElement;for(;((n=t)==null||(r=n.shadowRoot)==null?void 0:r.activeElement)!=null;){var n,r;t=t.shadowRoot.activeElement}return t}function F2e(e){return"composedPath"in e?e.composedPath()[0]:e.target}function Ha(e){e.preventDefault(),e.stopPropagation()}function k2e(e){const t=$.useRef(e);return ns(()=>{t.current=e}),t}function OM(e){const t=$.useRef();return ns(()=>{t.current=e},[e]),t.current}const M2e=function(e,t){let{open:n}=e,{enabled:r=!0,role:i="dialog"}=t===void 0?{}:t;const o=EM(),a=EM(),s={id:o,role:i};return r?i==="tooltip"?{reference:{"aria-describedby":n?o:void 0},floating:s}:{reference:{"aria-expanded":n?"true":"false","aria-haspopup":i==="alertdialog"?"dialog":i,"aria-controls":n?o:void 0,...i==="listbox"&&{role:"combobox"},...i==="menu"&&{id:a}},floating:{...s,...i==="menu"&&{"aria-labelledby":a}}}:{}};function R1(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}const L2e=function(e,t){let{open:n,onOpenChange:r,refs:i,events:o,nodeId:a}=e,{enabled:s=!0,escapeKey:u=!0,outsidePointerDown:c=!0,referencePointerDown:l=!1,ancestorScroll:d=!1,bubbles:p=!0}=t===void 0?{}:t;const A=EO(),m=IQ()!=null,v=Te.useRef(!1);return Te.useEffect(()=>{if(!n||!s)return;function _(S){if(S.key==="Escape"){if(!p&&A&&$1(A.nodesRef.current,a).length>0)return;o.emit("dismiss",{preventScroll:!1}),r(!1)}}function C(S){const y=v.current;if(v.current=!1,y)return;const T=F2e(S);if(hm(T)&&i.floating.current){var w;const E=(w=i.floating.current.ownerDocument.defaultView)!=null?w:window,F=T.scrollWidth>T.clientWidth,W=T.scrollHeight>T.clientHeight;let K=W&&S.offsetX>T.clientWidth;if(W&&E.getComputedStyle(T).direction==="rtl"&&(K=S.offsetX<=T.offsetWidth-T.clientWidth),K||F&&S.offsetY>T.clientHeight)return}const O=A&&$1(A.nodesRef.current,a).some(E=>{var F;return R1(S,(F=E.context)==null?void 0:F.refs.floating.current)});R1(S,i.floating.current)||R1(S,i.domReference.current)||O||!p&&A&&$1(A.nodesRef.current,a).length>0||(o.emit("dismiss",m?{preventScroll:!0}:!1),r(!1))}function I(){r(!1)}const x=$O(i.floating.current);u&&x.addEventListener("keydown",_),c&&x.addEventListener("pointerdown",C);const g=(d?[...hm(i.reference.current)?bu(i.reference.current):[],...hm(i.floating.current)?bu(i.floating.current):[]]:[]).filter(S=>{var y;return S!==((y=x.defaultView)==null?void 0:y.visualViewport)});return g.forEach(S=>S.addEventListener("scroll",I,{passive:!0})),()=>{u&&x.removeEventListener("keydown",_),c&&x.removeEventListener("pointerdown",C),g.forEach(S=>S.removeEventListener("scroll",I))}},[u,c,o,A,a,n,r,d,s,p,i,m]),s?{reference:{onPointerDown(){l&&(o.emit("dismiss"),r(!1))}},floating:{onPointerDownCapture(){v.current=!0}}}:{}},RO="ArrowUp",ab="ArrowDown",ql="ArrowLeft",Lh="ArrowRight";function tm(e,t,n){return Math.floor(e/t)!==n}function Sd(e,t){return t<0||t>=e.current.length}function On(e,t){let{startingIndex:n=-1,decrement:r=!1,disabledIndices:i,amount:o=1}=t===void 0?{}:t;const a=e.current;let s=n;do{var u,c;s=s+(r?-o:o)}while(s>=0&&s<=a.length-1&&(i?i.includes(s):a[s]==null||(u=a[s])!=null&&u.hasAttribute("disabled")||((c=a[s])==null?void 0:c.getAttribute("aria-disabled"))==="true"));return s}function sb(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function FM(e,t){return sb(t,e===RO||e===ab,e===ql||e===Lh)}function O1(e,t,n){return sb(t,e===ab,n?e===ql:e===Lh)||e==="Enter"||e==" "||e===""}function j2e(e,t,n){return sb(t,n?e===ql:e===Lh,e===ab)}function U2e(e,t,n){return sb(t,n?e===Lh:e===ql,e===RO)}function F1(e,t){return On(e,{disabledIndices:t})}function kM(e,t){return On(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}const B2e=function(e,t){let{open:n,onOpenChange:r,refs:i}=e,{listRef:o,activeIndex:a,onNavigate:s=()=>{},enabled:u=!0,selectedIndex:c=null,allowEscape:l=!1,loop:d=!1,nested:p=!1,rtl:A=!1,virtual:m=!1,focusItemOnOpen:v="auto",focusItemOnHover:_=!0,openOnArrowKeyDown:C=!0,disabledIndices:I=void 0,orientation:x="vertical",cols:g=1}=t===void 0?{listRef:{current:[]},activeIndex:null,onNavigate:()=>{}}:t;process.env.NODE_ENV!=="production"&&(l&&(d||console.warn(["Floating UI: `useListNavigation` looping must be enabled to allow","escaping."].join(" ")),m||console.warn(["Floating UI: `useListNavigation` must be virtual to allow","escaping."].join(" "))),x==="vertical"&&g>1&&console.warn(["Floating UI: In grid list navigation mode (`cols` > 1), the",'`orientation` should be either "horizontal" or "both".'].join(" ")));const S=IQ(),y=EO(),T=OM(n),w=KC(s),O=KC(OM(s)),E=Te.useRef(v),F=Te.useRef(c??-1),W=Te.useRef(null),K=k2e(I),J=Te.useRef(!1),ee=Te.useRef(-1),[re,P]=Te.useState(),Y=Te.useCallback((k,q)=>{ee.current=requestAnimationFrame(()=>{if(m){var ue;P((ue=k.current[q.current])==null?void 0:ue.id)}else{var ke;(ke=k.current[q.current])==null||ke.focus({preventScroll:!0})}})},[m]);ns(()=>{u&&(!T&&n&&E.current&&c!=null&&w(c),T&&!n&&(cancelAnimationFrame(ee.current),F.current=-1,O(null)))},[n,T,c,o,Y,u,w,O]),ns(()=>{if(u&&n)if(a==null){if(c!=null)return;T&&(F.current=-1,Y(o,F)),!T&&E.current&&(W.current!=null||E.current===!0&&W.current==null)&&(F.current=W.current==null||O1(W.current,x,A)||p?F1(o,K.current):kM(o,K.current),w(F.current),Y(o,F))}else Sd(o,a)||(F.current=a,Y(o,F))},[n,T,a,c,p,o,w,Y,u,l,x,A,m,K]),ns(()=>{if(u&&!n&&T){var k,q;const ue=y==null||(k=y.nodesRef.current.find(ke=>ke.id===S))==null||(q=k.context)==null?void 0:q.refs.floating.current;ue&&!ue.contains(RM($O(ue)))&&ue.focus({preventScroll:!0})}},[u,n,T,y,S]),ns(()=>{W.current=null});function M(k){if(J.current=!0,p&&U2e(k.key,x,A)){Ha(k),r(!1),$2e(i.domReference.current)&&i.domReference.current.focus();return}const q=F.current,ue=F1(o,I),ke=kM(o,I);if(k.key==="Home"&&(F.current=ue,w(F.current)),k.key==="End"&&(F.current=ke,w(F.current)),g>1){const Ie=F.current;if(k.key===RO){if(Ha(k),Ie===-1)F.current=ke;else if(F.current=On(o,{startingIndex:Ie,amount:g,decrement:!0,disabledIndices:I}),d&&(Ie-g<ue||F.current<0)){const rt=Ie%g,at=ke%g,fn=ke-(at-rt);at===rt?F.current=ke:F.current=at>rt?fn:fn-g}Sd(o,F.current)&&(F.current=Ie),w(F.current)}if(k.key===ab&&(Ha(k),Ie===-1?F.current=ue:(F.current=On(o,{startingIndex:Ie,amount:g,disabledIndices:I}),d&&Ie+g>ke&&(F.current=On(o,{startingIndex:Ie%g-g,amount:g,disabledIndices:I}))),Sd(o,F.current)&&(F.current=Ie),w(F.current)),x==="both"){const rt=Math.floor(Ie/g);k.key===Lh&&(Ha(k),Ie%g!==g-1?(F.current=On(o,{startingIndex:Ie,disabledIndices:I}),d&&tm(F.current,g,rt)&&(F.current=On(o,{startingIndex:Ie-Ie%g-1,disabledIndices:I}))):d&&(F.current=On(o,{startingIndex:Ie-Ie%g-1,disabledIndices:I})),tm(F.current,g,rt)&&(F.current=Ie)),k.key===ql&&(Ha(k),Ie%g!==0?(F.current=On(o,{startingIndex:Ie,disabledIndices:I,decrement:!0}),d&&tm(F.current,g,rt)&&(F.current=On(o,{startingIndex:Ie+(g-Ie%g),decrement:!0,disabledIndices:I}))):d&&(F.current=On(o,{startingIndex:Ie+(g-Ie%g),decrement:!0,disabledIndices:I})),tm(F.current,g,rt)&&(F.current=Ie));const at=Math.floor(ke/g)===rt;Sd(o,F.current)&&(d&&at?F.current=k.key===ql?ke:On(o,{startingIndex:Ie-Ie%g-1,disabledIndices:I}):F.current=Ie),w(F.current);return}}if(FM(k.key,x)){if(Ha(k),n&&!m&&RM(k.currentTarget.ownerDocument)===k.currentTarget){F.current=O1(k.key,x,A)?ue:ke,w(F.current);return}O1(k.key,x,A)?d?F.current=q>=ke?l&&q!==o.current.length?-1:ue:On(o,{startingIndex:q,disabledIndices:I}):F.current=Math.min(ke,On(o,{startingIndex:q,disabledIndices:I})):d?F.current=q<=ue?l&&q!==-1?o.current.length:ke:On(o,{startingIndex:q,decrement:!0,disabledIndices:I}):F.current=Math.max(ue,On(o,{startingIndex:q,decrement:!0,disabledIndices:I})),Sd(o,F.current)?w(null):w(F.current)}}return u?{reference:{...m&&n&&a!=null&&{"aria-activedescendant":re},onKeyDown(k){if(J.current=!0,m&&n)return M(k);if((k.key.indexOf("Arrow")===0||k.key==="Enter"||k.key===" "||k.key==="")&&(W.current=k.key),p){j2e(k.key,x,A)&&(Ha(k),n?(F.current=F1(o,I),w(F.current)):r(!0));return}FM(k.key,x)&&(c!=null&&(F.current=c),Ha(k),!n&&C?r(!0):M(k),n&&w(F.current))}},floating:{"aria-orientation":x==="both"?void 0:x,...m&&a!=null&&{"aria-activedescendant":re},onKeyDown:M,onPointerMove(){J.current=!1}},item:{onFocus(k){let{currentTarget:q}=k;const ue=o.current.indexOf(q);ue!==-1&&w(ue)},onClick:k=>{let{currentTarget:q}=k;return q.focus({preventScroll:!0})},..._&&{onMouseMove(k){let{currentTarget:q}=k;const ue=q;if(ue){const ke=o.current.indexOf(ue);ke!==-1&&w(ke)}},onPointerLeave(){if(!J.current&&(F.current=-1,Y(o,F),w(null),!m)){var k;(k=i.floating.current)==null||k.focus({preventScroll:!0})}}}}}:{}};function P2e(e){var t;const{char:n,allowSpaces:r,allowedPrefixes:i,startOfLine:o,$position:a}=e,s=iLe(n),u=new RegExp(`\\s${s}$`),c=o?"^":"",l=r?new RegExp(`${c}${s}.*?(?=\\s${s}|$)`,"gm"):new RegExp(`${c}(?:^)?${s}[^\\s${s}]*`,"gm"),d=((t=a.nodeBefore)===null||t===void 0?void 0:t.isText)&&a.nodeBefore.text;if(!d)return null;const p=a.pos-d.length,A=Array.from(d.matchAll(l)).pop();if(!A||A.input===void 0||A.index===void 0)return null;const m=A.input.slice(Math.max(0,A.index-1),A.index),v=new RegExp(`^[${i==null?void 0:i.join("")}\0]?$`).test(m);if(i!==null&&!v)return null;const _=p+A.index;let C=_+A[0].length;return r&&u.test(d.slice(C-1,C+1))&&(A[0]+=" ",C+=1),_<a.pos&&C>=a.pos?{range:{from:_,to:C},query:A[0].slice(n.length),text:A[0]}:null}const W2e=new eo("suggestion");function D2e({pluginKey:e=W2e,editor:t,char:n="@",allowSpaces:r=!1,allowedPrefixes:i=[" "],startOfLine:o=!1,decorationTag:a="span",decorationClass:s="suggestion",command:u=()=>null,items:c=()=>[],render:l=()=>({}),allow:d=()=>!0,findSuggestionMatch:p=P2e}){let A;const m=l==null?void 0:l(),v=new zr({key:e,view(){return{update:async(_,C)=>{var I,x,g,S,y,T,w;const O=(I=this.key)===null||I===void 0?void 0:I.getState(C),E=(x=this.key)===null||x===void 0?void 0:x.getState(_.state),F=O.active&&E.active&&O.range.from!==E.range.from,W=!O.active&&E.active,K=O.active&&!E.active,J=!W&&!K&&O.query!==E.query,ee=W||F&&J,re=J||F,P=K||F&&J;if(!ee&&!re&&!P)return;const Y=P&&!ee?O:E,M=_.dom.querySelector(`[data-decoration-id="${Y.decorationId}"]`);A={editor:t,range:Y.range,query:Y.query,text:Y.text,items:[],command:k=>u({editor:t,range:Y.range,props:k}),decorationNode:M,clientRect:M?()=>{var k;const{decorationId:q}=(k=this.key)===null||k===void 0?void 0:k.getState(t.state),ue=_.dom.querySelector(`[data-decoration-id="${q}"]`);return(ue==null?void 0:ue.getBoundingClientRect())||null}:null},ee&&((g=m==null?void 0:m.onBeforeStart)===null||g===void 0||g.call(m,A)),re&&((S=m==null?void 0:m.onBeforeUpdate)===null||S===void 0||S.call(m,A)),(re||ee)&&(A.items=await c({editor:t,query:Y.query})),P&&((y=m==null?void 0:m.onExit)===null||y===void 0||y.call(m,A)),re&&((T=m==null?void 0:m.onUpdate)===null||T===void 0||T.call(m,A)),ee&&((w=m==null?void 0:m.onStart)===null||w===void 0||w.call(m,A))},destroy:()=>{var _;A&&((_=m==null?void 0:m.onExit)===null||_===void 0||_.call(m,A))}}},state:{init(){return{active:!1,range:{from:0,to:0},query:null,text:null,composing:!1}},apply(_,C,I,x){const{isEditable:g}=t,{composing:S}=t.view,{selection:y}=_,{empty:T,from:w}=y,O={...C};if(O.composing=S,g&&(T||t.view.composing)){(w<C.range.from||w>C.range.to)&&!S&&!C.composing&&(O.active=!1);const E=p({char:n,allowSpaces:r,allowedPrefixes:i,startOfLine:o,$position:y.$from}),F=`id_${Math.floor(Math.random()*4294967295)}`;E&&d({editor:t,state:x,range:E.range,isActive:C.active})?(O.active=!0,O.decorationId=C.decorationId?C.decorationId:F,O.range=E.range,O.query=E.query,O.text=E.text):O.active=!1}else O.active=!1;return O.active||(O.decorationId=null,O.range={from:0,to:0},O.query=null,O.text=null),O}},props:{handleKeyDown(_,C){var I;const{active:x,range:g}=v.getState(_.state);return x&&((I=m==null?void 0:m.onKeyDown)===null||I===void 0?void 0:I.call(m,{view:_,event:C,range:g}))||!1},decorations(_){const{active:C,range:I,decorationId:x}=v.getState(_);return C?Ht.create(_.doc,[wi.inline(I.from,I.to,{nodeName:a,class:s,"data-decoration-id":x})]):null}}});return v}const xQ=["ArrowDown","ArrowUp","End","Home"],wQ=["Enter"],K2e=["Escape",...xQ,...wQ],N2e=dr.create({name:"slash-commands",addOptions(){return{nodeTypes:[]}},addProseMirrorPlugins(){const e=mm(VQ,this.options.nodeTypes);return e.length>1?[D2e({allowSpaces:!0,char:"/",editor:this.editor,startOfLine:!0,allow:({state:t})=>{const n=t.selection.$from;return n.parent.type.name===ao.name&&n.depth===1},command:({editor:t,props:n,range:r})=>{n.runCommands(t,{deleteRange:r})},items:({query:t})=>{const n=t.toLocaleLowerCase().trim();return e.filter(r=>{var i,o;return((i=r.shortText)==null?void 0:i.toLocaleLowerCase().includes(n))||((o=r.text)==null?void 0:o.toLocaleLowerCase().includes(n))})},render:()=>{let t;return{onStart:n=>{t=new nQ(q2e,{editor:n.editor,props:n}),document.body.appendChild(t.element)},onUpdate:n=>{t==null||t.updateProps(n)},onKeyDown:({event:n})=>{var r;return!!(K2e.includes(n.key)&&((r=t==null?void 0:t.ref)!=null&&r.handleKeyDown(n)))},onExit:()=>{t==null||t.destroy(),t==null||t.element.remove()}}}})]:[]}}),q2e=$.forwardRef(function(t,n){const{command:r,decorationNode:i,editor:o,items:a}=t,[s,u]=$.useState(!0),{context:c,floating:l,reference:d,x:p,y:A}=R2e({middleware:[h2e(0),A2e(),m2e({limiter:g2e()})],onOpenChange:u,open:s,placement:"top-start",strategy:"fixed",whileElementsMounted:C2e});$.useLayoutEffect(()=>{d(i)},[d,i]),$.useEffect(()=>{let T;const w=()=>{T=window.setTimeout(()=>{u(!0)})},O=()=>{u(!1)};return o.on("focus",w).on("blur",O),()=>{o.off("focus",w).off("blur",O),clearTimeout(T)}},[o]);const[m,v]=$.useState(0),_=$.useRef([]);Ne.useOnChange(a,()=>{v(0),_.current=[]});const{getFloatingProps:C,getItemProps:I,getReferenceProps:x}=O2e([L2e(c,{outsidePointerDown:!1}),B2e(c,{activeIndex:m,listRef:_,onNavigate:T=>{v(w=>T??w)},openOnArrowKeyDown:!1,virtual:!0}),M2e(c,{role:"menu"})]),S=x().onKeyDown;$.useImperativeHandle(n,()=>({handleKeyDown:T=>{if(s){if(xQ.includes(T.key)&&S(T),wQ.includes(T.key)){const w=a[m];w!==void 0&&r(w)}return!0}else return!1}}),[m,r,a,S,s]);const y=p!==null&&A!==null;return s?f.jsx(h.Box,{...C(),minWidth:256,backgroundColor:"grey1",border:!0,borderStyle:"solid",borderRadius:6,flexDirection:"column",ref:l,top:0,left:0,position:"fixed",transform:y?`translate3d(${Math.round(p)}px, ${Math.round(A)}px, 0)`:"translate3d(0, -200%, 0)",overflow:"hidden",children:f.jsxs("div",{style:{boxShadow:"0px 2px 10px 0px hsla(0, 0%, 0%, 0.1)"},children:[a.map((T,w)=>{const O=I({onClick:()=>{r(T)},onPointerDown:E=>{E.preventDefault()}});return $.createElement(MM,{...O,key:T.nodeType,ref:E=>{_.current[w]=E},active:w===m,isFirstItem:w===0,isLastItem:w===a.length-1,shortcut:`/${T.shortText??""}`},T.text)}),a.length===0&&f.jsx(MM,{...I({onPointerDown:T=>{T.preventDefault()}}),disabled:!0,ref:T=>{_.current[0]=T},children:"No results"})]})}):null}),MM=$.forwardRef(function(t,n){const{children:r,disabled:i=!1,shortcut:o,active:a=!1,isFirstItem:s=!1,isLastItem:u=!1,...c}=t;return f.jsx("div",{...c,role:"button",style:{cursor:i?"default":"pointer"},ref:n,children:f.jsxs(h.Box,{alignItems:"center",height:32,flexDirection:"row",gap:8,padding:8,backgroundColor:a?"grey4":"inherit",justifyContent:"space-between",opacity:i?.5:1,children:[f.jsx(h.Text,{color:"grey12",component:"span",children:r}),o&&f.jsx(h.Text,{color:"inherit",component:"span",variant:"small",children:o})]})})});function V2e(e,t){var s,u;const n=t.map(c=>c.richTextNodeTypes).flat(),i={placeholderByNodeType:Q2e(t),unfocusedPlaceholder:(s=e.config)==null?void 0:s.placeholder,nodeExtensions:t},o=n.includes(fe.RichTextNodeType.orderedList)||n.includes(fe.RichTextNodeType.list);return[UC.component(((u=e.config)==null?void 0:u.single)===void 0),Wu.component,dg.component,i2e(i),o?Nl.component:void 0,N2e.configure({nodeTypes:n})].filter(io.isDefined)}function Q2e(e){return e.reduce((t,n)=>(n.nodeType===vl.Text&&(t[n.name]=n.placeholder),t),{})}const NC=EUe.extend({name:"bulletList",parseHTML(){return[{tag:"ul"}]},renderHTML({HTMLAttributes:e}){return["ul",Et(this.options.HTMLAttributes,e),0]}}).configure({itemTypeName:"listItem"}),z2e={fromPrismic(e){return function(t){var r;const n=Nl.converter.fromPrismic(e)(t);if(n)return(r=e.nodes[NC.name])==null?void 0:r.create(ua.fromPrismic(t),n)}},toPrismic(e){return Pu.children.map(e,t=>Nl.converter.toPrismic(t,fe.RichTextNodeType.list).filter(io.isDefined)).flat()}},H2e=new IO([fe.RichTextNodeType.list],NC.name,NC,z2e),gg=H2e,Y2e=/^```([a-z]+)?[\s\n]$/,G2e=/^~~~([a-z]+)?[\s\n]$/,J2e=jn.create({name:"codeBlock",addOptions(){return{languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,HTMLAttributes:{}}},content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:this.options.defaultLanguage,parseHTML:e=>{var t;const{languageClassPrefix:n}=this.options,o=[...((t=e.firstElementChild)===null||t===void 0?void 0:t.classList)||[]].filter(a=>a.startsWith(n)).map(a=>a.replace(n,""))[0];return o||null},rendered:!1}}},parseHTML(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML({node:e,HTMLAttributes:t}){return["pre",Et(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:()=>{const{empty:e,$anchor:t}=this.editor.state.selection,n=t.pos===1;return!e||t.parent.type.name!==this.name?!1:n||!t.parent.textContent.length?this.editor.commands.clearNodes():!1},Enter:({editor:e})=>{if(!this.options.exitOnTripleEnter)return!1;const{state:t}=e,{selection:n}=t,{$from:r,empty:i}=n;if(!i||r.parent.type!==this.type)return!1;const o=r.parentOffset===r.parent.nodeSize-2,a=r.parent.textContent.endsWith(`
99
+ */var dM;function eUe(){return dM||(dM=1,process.env.NODE_ENV!=="production"&&function(){typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var e=$,t=_O;function n(l,d){return l===d&&(l!==0||1/l===1/d)||l!==l&&d!==d}var r=typeof Object.is=="function"?Object.is:n,i=t.useSyncExternalStore,o=e.useRef,a=e.useEffect,s=e.useMemo,u=e.useDebugValue;function c(l,d,p,A,m){var v=o(null),_;v.current===null?(_={hasValue:!1,value:null},v.current=_):_=v.current;var C=s(function(){var S=!1,y,T,w=function(W){if(!S){S=!0,y=W;var K=A(W);if(m!==void 0&&_.hasValue){var J=_.value;if(m(J,K))return T=J,J}return T=K,K}var ee=y,re=T;if(r(ee,W))return re;var P=A(W);return m!==void 0&&m(re,P)?re:(y=W,T=P,P)},O=p===void 0?null:p,E=function(){return w(d())},F=O===null?void 0:function(){return w(O())};return[E,F]},[d,p,A,m]),I=C[0],x=C[1],g=i(l,I,x);return a(function(){_.hasValue=!0,_.value=g},[g]),u(g),g}S1.useSyncExternalStoreWithSelector=c,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),S1}process.env.NODE_ENV==="production"?Xje():eUe();process.env.NODE_ENV;const XV=$.createContext({editor:null});XV.Consumer;const tUe=()=>$.useContext(XV),_1=e=>{const[t,n]=$.useState(null),{editor:r}=tUe();return $.useEffect(()=>{var i;if(!t||!((i=e.editor)===null||i===void 0)&&i.isDestroyed||r!=null&&r.isDestroyed)return;const{pluginKey:o="bubbleMenu",editor:a,tippyOptions:s={},updateDelay:u,shouldShow:c=null}=e,l=a||r;if(!l){console.warn("BubbleMenu component is not rendered inside of an editor component or does not have editor prop.");return}const d=ZV({updateDelay:u,editor:l,element:t,pluginKey:o,shouldShow:c,tippyOptions:s});return l.registerPlugin(d),()=>l.unregisterPlugin(o)},[e.editor,r,t]),$.createElement("div",{ref:n,className:e.className,style:{visibility:"hidden"}},e.children)},eQ=$.createContext({onDragStart:void 0}),nUe=()=>$.useContext(eQ),tQ=$.forwardRef((e,t)=>{const{onDragStart:n}=nUe(),r=e.as||"div";return $.createElement(r,{...e,ref:t,"data-node-view-wrapper":"",onDragStart:n,style:{whiteSpace:"normal",...e.style}})});function rUe(e){return!!(typeof e=="function"&&e.prototype&&e.prototype.isReactComponent)}function iUe(e){var t;return typeof e=="object"&&((t=e.$$typeof)===null||t===void 0?void 0:t.toString())==="Symbol(react.forward_ref)"}class nQ{constructor(t,{editor:n,props:r={},as:i="div",className:o="",attrs:a}){this.ref=null,this.id=Math.floor(Math.random()*4294967295).toString(),this.component=t,this.editor=n,this.props=r,this.element=document.createElement(i),this.element.classList.add("react-renderer"),o&&this.element.classList.add(...o.split(" ")),a&&Object.keys(a).forEach(s=>{this.element.setAttribute(s,a[s])}),this.editor.isInitialized?XC.flushSync(()=>{this.render()}):this.render()}render(){var t;const n=this.component,r=this.props,i=this.editor;(rUe(n)||iUe(n))&&(r.ref=o=>{this.ref=o}),this.reactElement=$.createElement(n,r),(t=i==null?void 0:i.contentComponent)===null||t===void 0||t.setRenderer(this.id,this)}updateProps(t={}){this.props={...this.props,...t},this.render()}destroy(){var t;const n=this.editor;(t=n==null?void 0:n.contentComponent)===null||t===void 0||t.removeRenderer(this.id)}}class oUe extends XMe{mount(){const t={editor:this.editor,node:this.node,decorations:this.decorations,selected:!1,extension:this.extension,getPos:()=>this.getPos(),updateAttributes:(c={})=>this.updateAttributes(c),deleteNode:()=>this.deleteNode()};if(!this.component.displayName){const c=l=>l.charAt(0).toUpperCase()+l.substring(1);this.component.displayName=c(this.extension.name)}const i={onDragStart:this.onDragStart.bind(this),nodeViewContentRef:c=>{c&&this.contentDOMElement&&c.firstChild!==this.contentDOMElement&&c.appendChild(this.contentDOMElement)}},o=this.component,a=$.memo(c=>$.createElement(eQ.Provider,{value:i},$.createElement(o,c)));a.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 s=this.node.isInline?"span":"div";this.options.as&&(s=this.options.as);const{className:u=""}=this.options;this.handleSelectionUpdate=this.handleSelectionUpdate.bind(this),this.editor.on("selectionUpdate",this.handleSelectionUpdate),this.renderer=new nQ(a,{editor:this.editor,props:t,as:s,className:`node-${this.node.type.name} ${u}`.trim(),attrs:this.options.attrs})}get dom(){var t;if(this.renderer.element.firstElementChild&&!(!((t=this.renderer.element.firstElementChild)===null||t===void 0)&&t.hasAttribute("data-node-view-wrapper")))throw Error("Please use the NodeViewWrapper component for your node view.");return this.renderer.element}get contentDOM(){return this.node.isLeaf?null:this.contentDOMElement}handleSelectionUpdate(){const{from:t,to:n}=this.editor.state.selection;if(t<=this.getPos()&&n>=this.getPos()+this.node.nodeSize){if(this.renderer.props.selected)return;this.selectNode()}else{if(!this.renderer.props.selected)return;this.deselectNode()}}update(t,n){const r=i=>{this.renderer.updateProps(i)};if(t.type!==this.node.type)return!1;if(typeof this.options.update=="function"){const i=this.node,o=this.decorations;return this.node=t,this.decorations=n,this.options.update({oldNode:i,oldDecorations:o,newNode:t,newDecorations:n,updateProps:()=>r({node:t,decorations:n})})}return t===this.node&&this.decorations===n||(this.node=t,this.decorations=n,r({node:t,decorations:n})),!0}selectNode(){this.renderer.updateProps({selected:!0}),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 rQ(e,t){return n=>n.editor.contentComponent?new oUe(e,n,t):{}}const aUe=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,sUe=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,uUe=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,cUe=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,lUe=Nc.create({name:"bold",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:e=>e.style.fontWeight!=="normal"&&null},{style:"font-weight",getAttrs:e=>/^(bold(er)?|[5-9]\d{2,})$/.test(e)&&null}]},renderHTML({HTMLAttributes:e}){return["strong",Et(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[ig({find:aUe,type:this.type}),ig({find:uUe,type:this.type})]},addPasteRules(){return[ag({find:sUe,type:this.type}),ag({find:cUe,type:this.type})]}});var qc=(e=>(e.Document="document",e.Mark="mark",e.Node="node",e))(qc||{}),vl=(e=>(e.Text="text",e.Embed="embed",e.Image="image",e))(vl||{});class fUe{constructor(t,n,r){Rn(this,"extType","document");this.name=t,this.component=n,this.converter=r}}class kh{constructor(t,n,r,i,o,a=!1){Rn(this,"extType","node");Rn(this,"nodeType","text");this.richTextNodeTypes=t,this.name=n,this.component=r,this.converter=i,this.placeholder=o,this.lockedFormat=a}}function iQ(e){return e instanceof kh}class dUe{constructor(t,n,r,i){Rn(this,"extType","node");Rn(this,"nodeType","embed");this.richTextNodeTypes=t,this.name=n,this.component=r,this.converter=i}}class pUe{constructor(t,n,r,i){Rn(this,"extType","node");Rn(this,"nodeType","image");this.richTextNodeTypes=t,this.name=n,this.component=r,this.converter=i}}class AUe extends kh{constructor(t,n,r,i,o){super(t,"heading",n,i,o),this.levels=r}}class IO extends kh{constructor(t,n,r,i){super(t,n,r,i)}}function hUe(e){return e instanceof IO}const oQ=jn.create({name:"hardBreak",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:e}){return["br",Et(this.options.HTMLAttributes,e)]},renderText(){return`
100
+ `},addCommands(){return{setHardBreak:()=>({commands:e,chain:t,state:n,editor:r})=>e.first([()=>e.exitCode(),()=>e.command(()=>{const{selection:i,storedMarks:o}=n;if(i.$from.parent.type.spec.isolating)return!1;const{keepMarks:a}=this.options,{splittableMarks:s}=r.extensionManager,u=o||i.$to.parentOffset&&i.$from.marks();return t().insertContent({type:this.name}).command(({tr:c,dispatch:l})=>{if(l&&u&&a){const d=u.filter(p=>s.includes(p.type.name));c.ensureMarks(d)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),Pu={isHardBreak(e){return e.type.name===oQ.name},children:{reduce(e,t,n){let r=n;return e.forEach((i,o,a)=>{r=t(r,i,a)}),r},map(e,t){return this.reduce(e,(n,r)=>[...n,t(r)],[])},exists(e,t){return this.reduce(e,(n,r)=>n||t(r),!1)},filter(e,t){return this.reduce(e,(n,r)=>[...n,...t(r)?[r]:[]],[])}},marks:{reduce(e,t,n){let r=n;return e.marks.forEach((i,o)=>{r=t(r,i,o)}),r},map(e,t){return this.reduce(e,(n,r)=>[...n,t(r)],[])},filter(e,t){return this.reduce(e,(n,r)=>[...n,...t(r)?[r]:[]],[])}}};function mUe(e){if(!e||!(e!=null&&e.single)&&!(e!=null&&e.multi))return pM();const t=gUe(e);if(!t.size)return pM();const n=vUe(t),r=yUe(n,e);return{nodeTypes:t,extensions:r}}function gUe(e){const n=(e.single||e.multi||"").split(/\s*,\s*/).map(r=>{const i=fe.RichTextNodeTypeCodec.decode(r);return i._tag==="Right"?i.right:void 0}).filter(io.isDefined);return new Set(n)}function vUe(e){return qQ(e).filter(n=>Fn.some(e,r=>n.richTextNodeTypes.includes(r)))}function yUe(e,t){var r;const n=new Set(e);return Fn.some(n,hUe)&&n.add(ao),Fn.some(n,iQ)||n.add(ao),(r=t==null?void 0:t.labels)!=null&&r.length&&n.add(FO),[...n]}function pM(){return{extensions:qQ(),nodeTypes:new Set(Vl.keys(fe.RichTextNodeTypeCodec.keys))}}class bUe{constructor(t,n,r){Rn(this,"extType",qc.Mark);Rn(this,"richTextNodeTypes",[fe.RichTextNodeType.strong]);this.name=t,this.component=n,this.converter=r}}const aQ="bold",sQ=lUe.extend({name:aQ}),CUe={fromPrismic(e){return function(){var t;return(t=e.marks[sQ.name])==null?void 0:t.create()}},toPrismic(){}},SUe=new bUe(aQ,sQ,CUe),TO=SUe,_Ue=jn.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:e}){return["li",Et(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)}}}),AM=Nc.create({name:"textStyle",priority:101,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"span",getAttrs:e=>e.hasAttribute("style")?{}:!1}]},renderHTML({HTMLAttributes:e}){return["span",Et(this.options.HTMLAttributes,e),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:e,commands:t})=>{const n=pO(e,this.type);return Object.entries(n).some(([,i])=>!!i)?!0:t.unsetMark(this.name)}}}}),hM=/^\s*([-+*])\s$/,IUe=jn.create({name:"bulletList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:"ul"}]},renderHTML({HTMLAttributes:e}){return["ul",Et(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(_Ue.name,this.editor.getAttributes(AM.name)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let e=og({find:hM,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(e=og({find:hM,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(AM.name),editor:this.editor})),[e]}}),TUe=jn.create({name:"doc",topNode:!0,content:"block+"}),xUe=jn.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:e}){return["li",Et(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)}}}),uQ=xUe.extend({name:"listItem",content:"paragraph*",addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name)}}}),wUe={fromPrismic(e){return function(t){var r;const n=ao.converter.fromPrismic(e)(t);if(n)return(r=e.nodes[uQ.name])==null?void 0:r.create({},n)}},toPrismic(e,t){return Pu.children.reduce(e,(n,r)=>{const i=ao.converter.toPrismic(r),o=(()=>i instanceof Array?i.map(a=>({...a,type:t})):i?[{...i,type:t}]:[])();return[...n,...o]},[])}},Nl={component:uQ,converter:wUe,placeholder:"List"};function EUe(e,t){return e.copy(e.content.append(t.content))}const ll={heading1:"heading1",heading2:"heading2",heading3:"heading3",heading4:"heading4",heading5:"heading5",heading6:"heading6",paragraph:"paragraph",preformatted:"preformatted",strong:"strong",em:"em",listItem:"list-item",oListItem:"o-list-item",list:"group-list-item",oList:"group-o-list-item",image:"image",embed:"embed",hyperlink:"hyperlink",label:"label",span:"span"},nb=()=>(++nb.i).toString();nb.i=0;const $Ue=e=>{const t=RUe(e),n=[];for(let r=0;r<t.length;r++)n.push(cQ(t[r]));return{key:nb(),children:n}},Pd=(e,t=[])=>({key:nb(),type:e.type,text:"text"in e?e.text:void 0,node:e,children:t}),I1=e=>Pd({type:ll.span,text:e,spans:[]}),RUe=e=>{const t=e.slice(0);for(let n=0;n<t.length;n++){const r=t[n];if(r.type===ll.listItem||r.type===ll.oListItem){const i=[r];for(;t[n+1]&&t[n+1].type===r.type;)i.push(t[n+1]),t.splice(n,1);r.type===ll.listItem?t[n]={type:ll.list,items:i}:t[n]={type:ll.oList,items:i}}}return t},cQ=e=>{if("text"in e)return Pd(e,lQ(e.spans,e));if("items"in e){const t=[];for(let n=0;n<e.items.length;n++)t.push(cQ(e.items[n]));return Pd(e,t)}return Pd(e)},lQ=(e,t,n)=>{if(!e.length)return[I1(t.text)];const r=e.slice(0);r.sort((o,a)=>o.start-a.start||a.end-o.end);const i=[];for(let o=0;o<r.length;o++){const a=r[o],s=n&&n.start||0,u=a.start-s,c=a.end-s,l=t.text.slice(u,c),d=[];for(let A=o;A<r.length;A++){const m=r[A];m!==a&&m.start>=a.start&&m.end<=a.end&&(d.push(m),r.splice(A,1),A--)}o===0&&u>0&&i.push(I1(t.text.slice(0,u)));const p={...a,text:l};i.push(Pd(p,lQ(d,{...t,text:l},a))),c<t.text.length&&i.push(I1(t.text.slice(c,r[o+1]?r[o+1].start-s:void 0)))}return i},OUe=(e,t)=>fQ($Ue(e).children,t),fQ=(e,t)=>{const n=[];for(let r=0;r<e.length;r++){const i=e[r],o=t(i.type,i.node,i.text,fQ(i.children,t),i.key);o!=null&&n.push(o)}return n},FUe=jn.create({name:"text",group:"inline"});function kUe(e){return e.reduce((t,n)=>{const r=(t[n.type]||[]).concat(n);return{...t,[n.type]:r}},{})}function mM(e){return e.sort((t,n)=>t.start-n.start)}function MUe(e){const t=kUe(e),n=Object.entries(t).map(([r,i])=>mM(i).reduce((a,s)=>{if(!a.length)return[s];const u=a.length-1,c=a[u];return c?c.end<s.start?[...a,s]:c.end>=s.end?a:[...a.slice(0,u),{...c,end:s.end}]:a},[])).flat();return mM(n)}const lg=oQ.extend({name:"hard_break"}),fg=`
101
+ `,dQ={fromPrismic(e){return function(t){var n;if(t===fg)return(n=e.nodes[lg.name])==null?void 0:n.create({})}},toPrismic(e){if(e.type.name===lg.name)return fg}},T1={isEmptyLine(e){return e.length===0},isFirst(e){return e===0}};function LUe(e,t){return function(n){const r=dQ.fromPrismic(e)(fg);if(!r)return[n(t)];const i=t.split(fg);return i.length===1?t.length?[n(t)]:[r]:i.reduce((o,a,s)=>T1.isFirst(s)?T1.isEmptyLine(a)?o:[...o,n(a)]:T1.isEmptyLine(a)?[...o,r]:[...o,r,n(a)],[])}}const jUe={name:lg.name,component:lg,converter:dQ,splitTextToNodes:LUe},dg=jUe,pQ={fromPrismic(e){return t=>{switch(t.type){case"hyperlink":return DQ.converter.fromPrismic(e)(t);case"em":return OO.converter.fromPrismic(e)(t);case"strong":return TO.converter.fromPrismic(e)(t);case"label":return FO.converter.fromPrismic(e)(t);case"list-item":return}}},toPrismic(e,t,n){const r=NQ.find(i=>e.type.name===i.name);if(!r)throw new 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":return{type:r.name,start:t,end:n,data:r.converter.toPrismic(e)};case"label":return{type:r.name,start:t,end:n,data:r.converter.toPrismic(e)}}}},UUe={strong:"bold",label:"label",em:"em",hyperlink:"hyperlink","list-item":void 0},gM=FUe.extend({name:"text"}),BUe={fromPrismic(e){return function(t,n,r=!1){const i={type:t,text:n.content.text,spans:n.content.spans||[]};return OUe([i],PUe(e,r)).flat()}},toPrismic(e,t,n){const r=Pu.children.reduce(e,(i,o)=>{const a=(()=>o.type.name===dg.name?dg.converter.toPrismic(o):o.textContent)(),s=a?i.text+a:i.text,u=i.text.length,c=s.length,l=(()=>o.marks.length?Pu.marks.map(o,p=>pQ.toPrismic(p,u,c)):void 0)();return{...i,text:s,spans:l?[...i.spans,...l]:i.spans}},{text:"",spans:[]});return{type:t,content:{text:r.text,spans:[...MUe(r.spans)].sort((i,o)=>i.type.localeCompare(o.type))},...n}}};function PUe(e,t=!1){return(n,r,i,o)=>{if(n==="span"&&i&&i.length)return t?[e.text(i)]:dg.splitTextToNodes(e,i)(u=>e.text(u));const a=pQ.fromPrismic(e)(r);return a?WUe(a,o):o.flat()}}function WUe(e,t){return t.flat().map(r=>{const o=[...r.marks,e].sort((a,s)=>a.type.name.localeCompare(s.type.name));return r.mark(o)})}const DUe={name:gM.name,component:gM,converter:BUe},Wu=DUe,xO="document";function KUe(e){return TUe.extend({name:xO,content:e?"block+":"block"})}function NUe(e){return{fromPrismic(t,n,r){var o;const i=r.value.reduce((a,s)=>{const{extension:u,block:c}=zUe(e,s,t,n),l=VUe({extension:u,block:c,schema:t}),d=a.slice(0,a.length-1),p=Qt.last(a),A=QUe({node:l,previousNode:p});return A.updatedNode?[...A.merged?d:a,A.updatedNode]:a},[]);return(o=t.nodes[xO])==null?void 0:o.create({},i)},toPrismic(t){return{__TYPE__:"StructuredTextContent",value:[...Pu.children.reduce(t,(r,i)=>{const o=Object.values(e).find(s=>i.type.name===s.name),a=o==null?void 0:o.converter.toPrismic(i);return a||console.warn(`Cannot convert node of type '${i.type.name}'.`),a?[...r,...a instanceof Array?a:[a]]:r},[])]}}}}const qUe=new fUe(xO,KUe,NUe),UC=qUe;function VUe(e){const{extension:t,block:n,schema:r}=e;if(t)switch(t.nodeType){case vl.Embed:return Ce.EmbedBlock.is(n)?t.converter.fromPrismic(r)(n):void 0;case vl.Text:return Ce.TextBlock.is(n)?t.converter.fromPrismic(r)(n):void 0;case vl.Image:return Ce.ImageBlock.is(n)?t.converter.fromPrismic(r)(n):void 0}}function QUe(e){const{node:t,previousNode:n}=e;return!t||!n?{merged:!1,updatedNode:t}:t.type.name===n.type.name&&(t.type.name===gg.name||t.type.name===yg.name)?{merged:!0,updatedNode:EUe(n,t)}:{merged:!1,updatedNode:t}}function zUe(e,t,n,r){var s;const i=e.find(u=>u.richTextNodeTypes.includes(t.type)&&r.has(t.type));if(i)return{extension:i,block:t};if(!Ce.TextBlock.is(t))return{extension:void 0,block:t};const o=e.find(u=>iQ(u)&&u.name in n.nodes),a=(s=t.content.spans)==null?void 0:s.filter(u=>{const c=UUe[u.type];return c&&c in n.marks});return{extension:o,block:{...t,content:{text:t.content.text,spans:a}}}}const HUe=dr.create({name:"placeholder",addOptions(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){return[new zr({key:new eo("placeholder"),props:{decorations:({doc:e,selection:t})=>{const n=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:r}=t,i=[];if(!n)return null;const o=this.editor.isEmpty;return e.descendants((a,s)=>{const u=r>=s&&r<=s+a.nodeSize,c=!a.isLeaf&&xV(a);if((u||!this.options.showOnlyCurrent)&&c){const l=[this.options.emptyNodeClass];o&&l.push(this.options.emptyEditorClass);const d=wi.node(s,s+a.nodeSize,{class:l.join(" "),"data-placeholder":typeof this.options.placeholder=="function"?this.options.placeholder({editor:this.editor,node:a,pos:s,hasAnchor:u}):this.options.placeholder});i.push(d)}return this.options.includeChildren}),Ht.create(e,i)}}})]}}),YUe=jn.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:e}){return["p",Et(this.options.HTMLAttributes,e),0]},addCommands(){return{setParagraph:()=>({commands:e})=>e.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),pm="ltr",lu="rtl",Ho="dir",GUe=fe.RichTextNodeType.rtl,JUe=dr.create({name:"textDirection",addOptions(){return{supportedExtensionNames:[]}},addGlobalAttributes(){return[{types:this.options.supportedExtensionNames,attributes:{[Ho]:{default:pm,parseHTML:e=>e.getAttribute(Ho),renderHTML:e=>({[Ho]:BC(e[Ho])})}}}]},addCommands(){return{setDirection:e=>({commands:t})=>{switch(e){case pm:return t.setLeftToRight();case lu:return t.setRightToLeft()}},toggleDirection:e=>({commands:t})=>{const n=e===lu?pm:lu;return t.setDirection(n)},setRightToLeft:()=>({commands:e})=>this.options.supportedExtensionNames.every(t=>e.updateAttributes(t,{[Ho]:lu})),setLeftToRight:()=>({commands:e})=>this.options.supportedExtensionNames.every(t=>e.resetAttributes(t,Ho))}},addKeyboardShortcuts(){return{"Mod-Shift-r":()=>this.editor.commands.setRightToLeft(),"Mod-Shift-l":()=>this.editor.commands.setLeftToRight()}}}),ua={parseNodeAttrsDirection(e){return BC(e[Ho])},fromPrismic(e){return{[Ho]:BC(e.direction)}},toPrismic(e){return{direction:this.parseNodeAttrsDirection(e.attrs)}}};function BC(e){return e===lu?lu:pm}const pg=YUe.extend({name:"paragraph",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:e}){return["p",Et(this.options.HTMLAttributes,e),0]}}),ZUe={fromPrismic(e){return function(t){var r;const n=Wu.converter.fromPrismic(e)(pg.name,t);return(r=e.nodes[pg.name])==null?void 0:r.create(ua.fromPrismic(t),n)}},toPrismic(e){return Wu.converter.toPrismic(e,fe.RichTextNodeType.paragraph,ua.toPrismic(e))}},XUe=new kh([fe.RichTextNodeType.paragraph],pg.name,pg,ZUe,"Type '/' for commands"),ao=XUe,e2e=e=>HUe.configure({includeChildren:!0,placeholder:t=>t2e(t,e),showOnlyCurrent:!1,showOnlyWhenEditable:!1});function t2e(e,t){const{editor:n,hasAnchor:r,pos:i,node:o}=e,{placeholderByNodeType:a,unfocusedPlaceholder:s,nodeExtensions:u}=t,c=!Pu.children.exists(n.state.doc,I=>I===o),l=n.isEditable;if(s&&!n.isFocused&&n.isEmpty&&i===0)return s;const d=o.type.name!==ao.name,p=n.isFocused&&r||d||c,A=u.filter(I=>I!==ao).length>1;function m(I){return I===ao.placeholder?l&&p&&A:l&&p}function v(){if(c)return Nl.placeholder;const I=a[o.type.name];return typeof I=="string"?I:I==null?void 0:I(o.attrs)}const _=v();return m(_)&&_||""}function rb(e){return e.split("-")[1]}function AQ(e){return e==="y"?"height":"width"}function as(e){return e.split("-")[0]}function Mh(e){return["top","bottom"].includes(as(e))?"x":"y"}function vM(e,t,n){let{reference:r,floating:i}=e;const o=r.x+r.width/2-i.width/2,a=r.y+r.height/2-i.height/2,s=Mh(t),u=AQ(s),c=r[u]/2-i[u]/2,l=s==="x";let d;switch(as(t)){case"top":d={x:o,y:r.y-i.height};break;case"bottom":d={x:o,y:r.y+r.height};break;case"right":d={x:r.x+r.width,y:a};break;case"left":d={x:r.x-i.width,y:a};break;default:d={x:r.x,y:r.y}}switch(rb(t)){case"start":d[s]-=c*(n&&l?-1:1);break;case"end":d[s]+=c*(n&&l?-1:1)}return d}const n2e=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:a}=n,s=o.filter(Boolean),u=await(a.isRTL==null?void 0:a.isRTL(t));let c=await a.getElementRects({reference:e,floating:t,strategy:i}),{x:l,y:d}=vM(c,r,u),p=r,A={},m=0;for(let v=0;v<s.length;v++){const{name:_,fn:C}=s[v],{x:I,y:x,data:g,reset:S}=await C({x:l,y:d,initialPlacement:r,placement:p,strategy:i,middlewareData:A,rects:c,platform:a,elements:{reference:e,floating:t}});l=I??l,d=x??d,A={...A,[_]:{...A[_],...g}},S&&m<=50&&(m++,typeof S=="object"&&(S.placement&&(p=S.placement),S.rects&&(c=S.rects===!0?await a.getElementRects({reference:e,floating:t,strategy:i}):S.rects),{x:l,y:d}=vM(c,p,u)),v=-1)}return{x:l,y:d,placement:p,strategy:i,middlewareData:A}};function r2e(e){return typeof e!="number"?function(t){return{top:0,right:0,bottom:0,left:0,...t}}(e):{top:e,right:e,bottom:e,left:e}}function PC(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}async function hQ(e,t){var n;t===void 0&&(t={});const{x:r,y:i,platform:o,rects:a,elements:s,strategy:u}=e,{boundary:c="clippingAncestors",rootBoundary:l="viewport",elementContext:d="floating",altBoundary:p=!1,padding:A=0}=t,m=r2e(A),v=s[p?d==="floating"?"reference":"floating":d],_=PC(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(v)))==null||n?v:v.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(s.floating)),boundary:c,rootBoundary:l,strategy:u})),C=d==="floating"?{...a.floating,x:r,y:i}:a.reference,I=await(o.getOffsetParent==null?void 0:o.getOffsetParent(s.floating)),x=await(o.isElement==null?void 0:o.isElement(I))&&await(o.getScale==null?void 0:o.getScale(I))||{x:1,y:1},g=PC(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({rect:C,offsetParent:I,strategy:u}):C);return{top:(_.top-g.top+m.top)/x.y,bottom:(g.bottom-_.bottom+m.bottom)/x.y,left:(_.left-g.left+m.left)/x.x,right:(g.right-_.right+m.right)/x.x}}const i2e=Math.min,o2e=Math.max;function yM(e,t,n){return o2e(e,i2e(t,n))}const a2e=["top","right","bottom","left"];a2e.reduce((e,t)=>e.concat(t,t+"-start",t+"-end"),[]);const s2e={left:"right",right:"left",bottom:"top",top:"bottom"};function Ag(e){return e.replace(/left|right|bottom|top/g,t=>s2e[t])}function u2e(e,t,n){n===void 0&&(n=!1);const r=rb(e),i=Mh(e),o=AQ(i);let a=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(a=Ag(a)),{main:a,cross:Ag(a)}}const c2e={start:"end",end:"start"};function x1(e){return e.replace(/start|end/g,t=>c2e[t])}const l2e=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n;const{placement:r,middlewareData:i,rects:o,initialPlacement:a,platform:s,elements:u}=t,{mainAxis:c=!0,crossAxis:l=!0,fallbackPlacements:d,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:A="none",flipAlignment:m=!0,...v}=e,_=as(r),C=as(a)===a,I=await(s.isRTL==null?void 0:s.isRTL(u.floating)),x=d||(C||!m?[Ag(a)]:function(F){const W=Ag(F);return[x1(F),W,x1(W)]}(a));d||A==="none"||x.push(...function(F,W,K,J){const ee=rb(F);let re=function(P,Y,M){const k=["left","right"],q=["right","left"],ue=["top","bottom"],ke=["bottom","top"];switch(P){case"top":case"bottom":return M?Y?q:k:Y?k:q;case"left":case"right":return Y?ue:ke;default:return[]}}(as(F),K==="start",J);return ee&&(re=re.map(P=>P+"-"+ee),W&&(re=re.concat(re.map(x1)))),re}(a,m,A,I));const g=[a,...x],S=await hQ(t,v),y=[];let T=((n=i.flip)==null?void 0:n.overflows)||[];if(c&&y.push(S[_]),l){const{main:F,cross:W}=u2e(r,o,I);y.push(S[F],S[W])}if(T=[...T,{placement:r,overflows:y}],!y.every(F=>F<=0)){var w,O;const F=(((w=i.flip)==null?void 0:w.index)||0)+1,W=g[F];if(W)return{data:{index:F,overflows:T},reset:{placement:W}};let K=(O=T.filter(J=>J.overflows[0]<=0).sort((J,ee)=>J.overflows[1]-ee.overflows[1])[0])==null?void 0:O.placement;if(!K)switch(p){case"bestFit":{var E;const J=(E=T.map(ee=>[ee.placement,ee.overflows.filter(re=>re>0).reduce((re,P)=>re+P,0)]).sort((ee,re)=>ee[1]-re[1])[0])==null?void 0:E[0];J&&(K=J);break}case"initialPlacement":K=a}if(r!==K)return{reset:{placement:K}}}return{}}}},f2e=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){const{x:n,y:r}=t,i=await async function(o,a){const{placement:s,platform:u,elements:c}=o,l=await(u.isRTL==null?void 0:u.isRTL(c.floating)),d=as(s),p=rb(s),A=Mh(s)==="x",m=["left","top"].includes(d)?-1:1,v=l&&A?-1:1,_=typeof a=="function"?a(o):a;let{mainAxis:C,crossAxis:I,alignmentAxis:x}=typeof _=="number"?{mainAxis:_,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,..._};return p&&typeof x=="number"&&(I=p==="end"?-1*x:x),A?{x:I*v,y:C*m}:{x:C*m,y:I*v}}(t,e);return{x:n+i.x,y:r+i.y,data:i}}}};function mQ(e){return e==="x"?"y":"x"}const d2e=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i}=t,{mainAxis:o=!0,crossAxis:a=!1,limiter:s={fn:_=>{let{x:C,y:I}=_;return{x:C,y:I}}},...u}=e,c={x:n,y:r},l=await hQ(t,u),d=Mh(as(i)),p=mQ(d);let A=c[d],m=c[p];if(o){const _=d==="y"?"bottom":"right";A=yM(A+l[d==="y"?"top":"left"],A,A-l[_])}if(a){const _=p==="y"?"bottom":"right";m=yM(m+l[p==="y"?"top":"left"],m,m-l[_])}const v=s.fn({...t,[d]:A,[p]:m});return{...v,data:{x:v.x-n,y:v.y-r}}}}},p2e=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:i,rects:o,middlewareData:a}=t,{offset:s=0,mainAxis:u=!0,crossAxis:c=!0}=e,l={x:n,y:r},d=Mh(i),p=mQ(d);let A=l[d],m=l[p];const v=typeof s=="function"?s(t):s,_=typeof v=="number"?{mainAxis:v,crossAxis:0}:{mainAxis:0,crossAxis:0,...v};if(u){const x=d==="y"?"height":"width",g=o.reference[d]-o.floating[x]+_.mainAxis,S=o.reference[d]+o.reference[x]-_.mainAxis;A<g?A=g:A>S&&(A=S)}if(c){var C,I;const x=d==="y"?"width":"height",g=["top","left"].includes(as(i)),S=o.reference[p]-o.floating[x]+(g&&((C=a.offset)==null?void 0:C[p])||0)+(g?0:_.crossAxis),y=o.reference[p]+o.reference[x]+(g?0:((I=a.offset)==null?void 0:I[p])||0)-(g?_.crossAxis:0);m<S?m=S:m>y&&(m=y)}return{[d]:A,[p]:m}}}};function Or(e){var t;return((t=e.ownerDocument)==null?void 0:t.defaultView)||window}function so(e){return Or(e).getComputedStyle(e)}const bM=Math.min,Wd=Math.max,hg=Math.round;function gQ(e){const t=so(e);let n=parseFloat(t.width),r=parseFloat(t.height);const i=e.offsetWidth,o=e.offsetHeight,a=hg(n)!==i||hg(r)!==o;return a&&(n=i,r=o),{width:n,height:r,fallback:a}}function hs(e){return yQ(e)?(e.nodeName||"").toLowerCase():""}let em;function vQ(){if(em)return em;const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?(em=e.brands.map(t=>t.brand+"/"+t.version).join(" "),em):navigator.userAgent}function uo(e){return e instanceof Or(e).HTMLElement}function Oi(e){return e instanceof Or(e).Element}function yQ(e){return e instanceof Or(e).Node}function CM(e){return typeof ShadowRoot>"u"?!1:e instanceof Or(e).ShadowRoot||e instanceof ShadowRoot}function ib(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=so(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(i)}function A2e(e){return["table","td","th"].includes(hs(e))}function WC(e){const t=/firefox/i.test(vQ()),n=so(e),r=n.backdropFilter||n.WebkitBackdropFilter;return n.transform!=="none"||n.perspective!=="none"||!!r&&r!=="none"||t&&n.willChange==="filter"||t&&!!n.filter&&n.filter!=="none"||["transform","perspective"].some(i=>n.willChange.includes(i))||["paint","layout","strict","content"].some(i=>{const o=n.contain;return o!=null&&o.includes(i)})}function DC(){return/^((?!chrome|android).)*safari/i.test(vQ())}function wO(e){return["html","body","#document"].includes(hs(e))}function bQ(e){return Oi(e)?e:e.contextElement}const CQ={x:1,y:1};function yl(e){const t=bQ(e);if(!uo(t))return CQ;const n=t.getBoundingClientRect(),{width:r,height:i,fallback:o}=gQ(t);let a=(o?hg(n.width):n.width)/r,s=(o?hg(n.height):n.height)/i;return a&&Number.isFinite(a)||(a=1),s&&Number.isFinite(s)||(s=1),{x:a,y:s}}function Du(e,t,n,r){var i,o;t===void 0&&(t=!1),n===void 0&&(n=!1);const a=e.getBoundingClientRect(),s=bQ(e);let u=CQ;t&&(r?Oi(r)&&(u=yl(r)):u=yl(e));const c=s?Or(s):window,l=DC()&&n;let d=(a.left+(l&&((i=c.visualViewport)==null?void 0:i.offsetLeft)||0))/u.x,p=(a.top+(l&&((o=c.visualViewport)==null?void 0:o.offsetTop)||0))/u.y,A=a.width/u.x,m=a.height/u.y;if(s){const v=Or(s),_=r&&Oi(r)?Or(r):r;let C=v.frameElement;for(;C&&r&&_!==v;){const I=yl(C),x=C.getBoundingClientRect(),g=getComputedStyle(C);x.x+=(C.clientLeft+parseFloat(g.paddingLeft))*I.x,x.y+=(C.clientTop+parseFloat(g.paddingTop))*I.y,d*=I.x,p*=I.y,A*=I.x,m*=I.y,d+=x.x,p+=x.y,C=Or(C).frameElement}}return{width:A,height:m,top:p,right:d+A,bottom:p+m,left:d,x:d,y:p}}function ss(e){return((yQ(e)?e.ownerDocument:e.document)||window.document).documentElement}function ob(e){return Oi(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function SQ(e){return Du(ss(e)).left+ob(e).scrollLeft}function wp(e){if(hs(e)==="html")return e;const t=e.assignedSlot||e.parentNode||CM(e)&&e.host||ss(e);return CM(t)?t.host:t}function _Q(e){const t=wp(e);return wO(t)?t.ownerDocument.body:uo(t)&&ib(t)?t:_Q(t)}function bu(e,t){var n;t===void 0&&(t=[]);const r=_Q(e),i=r===((n=e.ownerDocument)==null?void 0:n.body),o=Or(r);return i?t.concat(o,o.visualViewport||[],ib(r)?r:[]):t.concat(r,bu(r))}function SM(e,t,n){let r;if(t==="viewport")r=function(a,s){const u=Or(a),c=ss(a),l=u.visualViewport;let d=c.clientWidth,p=c.clientHeight,A=0,m=0;if(l){d=l.width,p=l.height;const v=DC();(!v||v&&s==="fixed")&&(A=l.offsetLeft,m=l.offsetTop)}return{width:d,height:p,x:A,y:m}}(e,n);else if(t==="document")r=function(a){const s=ss(a),u=ob(a),c=a.ownerDocument.body,l=Wd(s.scrollWidth,s.clientWidth,c.scrollWidth,c.clientWidth),d=Wd(s.scrollHeight,s.clientHeight,c.scrollHeight,c.clientHeight);let p=-u.scrollLeft+SQ(a);const A=-u.scrollTop;return so(c).direction==="rtl"&&(p+=Wd(s.clientWidth,c.clientWidth)-l),{width:l,height:d,x:p,y:A}}(ss(e));else if(Oi(t))r=function(a,s){const u=Du(a,!0,s==="fixed"),c=u.top+a.clientTop,l=u.left+a.clientLeft,d=uo(a)?yl(a):{x:1,y:1};return{width:a.clientWidth*d.x,height:a.clientHeight*d.y,x:l*d.x,y:c*d.y}}(t,n);else{const a={...t};if(DC()){var i,o;const s=Or(e);a.x-=((i=s.visualViewport)==null?void 0:i.offsetLeft)||0,a.y-=((o=s.visualViewport)==null?void 0:o.offsetTop)||0}r=a}return PC(r)}function _M(e,t){return uo(e)&&so(e).position!=="fixed"?t?t(e):e.offsetParent:null}function IM(e,t){const n=Or(e);let r=_M(e,t);for(;r&&A2e(r)&&so(r).position==="static";)r=_M(r,t);return r&&(hs(r)==="html"||hs(r)==="body"&&so(r).position==="static"&&!WC(r))?n:r||function(i){let o=wp(i);for(;uo(o)&&!wO(o);){if(WC(o))return o;o=wp(o)}return null}(e)||n}function h2e(e,t,n){const r=uo(t),i=ss(t),o=Du(e,!0,n==="fixed",t);let a={scrollLeft:0,scrollTop:0};const s={x:0,y:0};if(r||!r&&n!=="fixed")if((hs(t)!=="body"||ib(i))&&(a=ob(t)),uo(t)){const u=Du(t,!0);s.x=u.x+t.clientLeft,s.y=u.y+t.clientTop}else i&&(s.x=SQ(i));return{x:o.left+a.scrollLeft-s.x,y:o.top+a.scrollTop-s.y,width:o.width,height:o.height}}const m2e={getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const o=n==="clippingAncestors"?function(c,l){const d=l.get(c);if(d)return d;let p=bu(c).filter(_=>Oi(_)&&hs(_)!=="body"),A=null;const m=so(c).position==="fixed";let v=m?wp(c):c;for(;Oi(v)&&!wO(v);){const _=so(v),C=WC(v);_.position==="fixed"?A=null:(m?C||A:C||_.position!=="static"||!A||!["absolute","fixed"].includes(A.position))?A=_:p=p.filter(I=>I!==v),v=wp(v)}return l.set(c,p),p}(t,this._c):[].concat(n),a=[...o,r],s=a[0],u=a.reduce((c,l)=>{const d=SM(t,l,i);return c.top=Wd(d.top,c.top),c.right=bM(d.right,c.right),c.bottom=bM(d.bottom,c.bottom),c.left=Wd(d.left,c.left),c},SM(t,s,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;const i=uo(n),o=ss(n);if(n===o)return t;let a={scrollLeft:0,scrollTop:0},s={x:1,y:1};const u={x:0,y:0};if((i||!i&&r!=="fixed")&&((hs(n)!=="body"||ib(o))&&(a=ob(n)),uo(n))){const c=Du(n);s=yl(n),u.x=c.x+n.clientLeft,u.y=c.y+n.clientTop}return{width:t.width*s.x,height:t.height*s.y,x:t.x*s.x-a.scrollLeft*s.x+u.x,y:t.y*s.y-a.scrollTop*s.y+u.y}},isElement:Oi,getDimensions:function(e){return uo(e)?gQ(e):e.getBoundingClientRect()},getOffsetParent:IM,getDocumentElement:ss,getScale:yl,async getElementRects(e){let{reference:t,floating:n,strategy:r}=e;const i=this.getOffsetParent||IM,o=this.getDimensions;return{reference:h2e(t,await i(n),r),floating:{x:0,y:0,...await o(n)}}},getClientRects:e=>Array.from(e.getClientRects()),isRTL:e=>so(e).direction==="rtl"};function g2e(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:a=!0,animationFrame:s=!1}=r,u=i&&!s,c=u||o?[...Oi(e)?bu(e):e.contextElement?bu(e.contextElement):[],...bu(t)]:[];c.forEach(A=>{u&&A.addEventListener("scroll",n,{passive:!0}),o&&A.addEventListener("resize",n)});let l,d=null;if(a){let A=!0;d=new ResizeObserver(()=>{A||n(),A=!1}),Oi(e)&&!s&&d.observe(e),Oi(e)||!e.contextElement||s||d.observe(e.contextElement),d.observe(t)}let p=s?Du(e):null;return s&&function A(){const m=Du(e);!p||m.x===p.x&&m.y===p.y&&m.width===p.width&&m.height===p.height||n(),p=m,l=requestAnimationFrame(A)}(),n(),()=>{var A;c.forEach(m=>{u&&m.removeEventListener("scroll",n),o&&m.removeEventListener("resize",n)}),(A=d)==null||A.disconnect(),d=null,s&&cancelAnimationFrame(l)}}const v2e=(e,t,n)=>{const r=new Map,i={platform:m2e,...n},o={...i.platform,_c:r};return n2e(e,t,{...i,platform:o})};var Am=typeof document<"u"?$.useLayoutEffect:$.useEffect;function mg(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(!mg(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!Object.prototype.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){const o=i[r];if(!(o==="_owner"&&e.$$typeof)&&!mg(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function TM(e){const t=Te.useRef(e);return Am(()=>{t.current=e}),t}function y2e(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,whileElementsMounted:o,open:a}=e,[s,u]=Te.useState({x:null,y:null,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[c,l]=Te.useState(r);mg(c,r)||l(r);const d=Te.useRef(null),p=Te.useRef(null),A=Te.useRef(s),m=TM(o),v=TM(i),[_,C]=Te.useState(null),[I,x]=Te.useState(null),g=Te.useCallback(E=>{d.current!==E&&(d.current=E,C(E))},[]),S=Te.useCallback(E=>{p.current!==E&&(p.current=E,x(E))},[]),y=Te.useCallback(()=>{if(!d.current||!p.current)return;const E={placement:t,strategy:n,middleware:c};v.current&&(E.platform=v.current),v2e(d.current,p.current,E).then(F=>{const W={...F,isPositioned:!0};T.current&&!mg(A.current,W)&&(A.current=W,az.flushSync(()=>{u(W)}))})},[c,t,n,v]);Am(()=>{a===!1&&A.current.isPositioned&&(A.current.isPositioned=!1,u(E=>({...E,isPositioned:!1})))},[a]);const T=Te.useRef(!1);Am(()=>(T.current=!0,()=>{T.current=!1}),[]),Am(()=>{if(_&&I){if(m.current)return m.current(_,I,y);y()}},[_,I,y,m]);const w=Te.useMemo(()=>({reference:d,floating:p,setReference:g,setFloating:S}),[g,S]),O=Te.useMemo(()=>({reference:_,floating:I}),[_,I]);return Te.useMemo(()=>({...s,update:y,refs:w,elements:O,reference:g,floating:S}),[s,y,w,O,g,S])}var ns=typeof document<"u"?$.useLayoutEffect:$.useEffect;function b2e(){const e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(i=>i(n))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){e.set(t,(e.get(t)||[]).filter(r=>r!==n))}}}let w1=!1,C2e=0;const xM=()=>"floating-ui-"+C2e++;function S2e(){const[e,t]=Te.useState(()=>w1?xM():void 0);return ns(()=>{e==null&&t(xM())},[]),Te.useEffect(()=>{w1||(w1=!0)},[]),e}const wM=Te["useId".toString()],EM=wM??S2e,_2e=Te.createContext(null),I2e=Te.createContext(null),IQ=()=>{var e,t;return(e=(t=Te.useContext(_2e))==null?void 0:t.id)!=null?e:null},EO=()=>Te.useContext(I2e);function $O(e){var t;return(t=e==null?void 0:e.ownerDocument)!=null?t:document}function TQ(e){var t;return(t=$O(e).defaultView)!=null?t:window}function hm(e){return e?e instanceof TQ(e).Element:!1}function T2e(e){return e?e instanceof TQ(e).HTMLElement:!1}const $M=Te["useInsertionEffect".toString()];function KC(e){const t=Te.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return $M?$M(()=>{t.current=e}):t.current=e,Te.useCallback(function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return t.current==null?void 0:t.current(...r)},[])}function x2e(e){let{open:t=!1,onOpenChange:n,whileElementsMounted:r,placement:i,middleware:o,strategy:a,nodeId:s}=e===void 0?{}:e;const[u,c]=Te.useState(null),l=EO(),d=Te.useRef(null),p=Te.useRef({}),A=Te.useState(()=>b2e())[0],m=y2e({placement:i,middleware:o,strategy:a,whileElementsMounted:r}),v=KC(n),_=Te.useMemo(()=>({...m.refs,domReference:d}),[m.refs]),C=Te.useMemo(()=>({...m,refs:_,dataRef:p,nodeId:s,events:A,open:t,onOpenChange:v,_:{domReference:u}}),[m,s,A,t,v,_,u]);ns(()=>{const g=l==null?void 0:l.nodesRef.current.find(S=>S.id===s);g&&(g.context=C)});const{reference:I}=m,x=Te.useCallback(g=>{(hm(g)||g===null)&&(C.refs.domReference.current=g,c(g)),I(g)},[I,C.refs]);return Te.useMemo(()=>({...m,context:C,refs:_,reference:x}),[m,_,C,x])}function E1(e,t,n){const r=new Map;return{...n==="floating"&&{tabIndex:-1},...e,...t.map(i=>i?i[n]:null).concat(e).reduce((i,o)=>(o&&Object.entries(o).forEach(a=>{let[s,u]=a;if(s.indexOf("on")===0){if(r.has(s)||r.set(s,[]),typeof u=="function"){var c;(c=r.get(s))==null||c.push(u),i[s]=function(){for(var l,d=arguments.length,p=new Array(d),A=0;A<d;A++)p[A]=arguments[A];(l=r.get(s))==null||l.forEach(m=>m(...p))}}}else i[s]=u}),i),{})}}const w2e=function(e){return e===void 0&&(e=[]),{getReferenceProps:t=>E1(t,e,"reference"),getFloatingProps:t=>E1(t,e,"floating"),getItemProps:t=>E1(t,e,"item")}};function $1(e,t){var n;let r=(n=e.filter(a=>{var s;return a.parentId===t&&((s=a.context)==null?void 0:s.open)}))!=null?n:[],i=r;for(;i.length;){var o;i=(o=e.filter(a=>{var s;return(s=i)==null?void 0:s.some(u=>{var c;return a.parentId===u.id&&((c=a.context)==null?void 0:c.open)})}))!=null?o:[],r=r.concat(i)}return r}function RM(e){let t=e.activeElement;for(;((n=t)==null||(r=n.shadowRoot)==null?void 0:r.activeElement)!=null;){var n,r;t=t.shadowRoot.activeElement}return t}function E2e(e){return"composedPath"in e?e.composedPath()[0]:e.target}function Ha(e){e.preventDefault(),e.stopPropagation()}function $2e(e){const t=$.useRef(e);return ns(()=>{t.current=e}),t}function OM(e){const t=$.useRef();return ns(()=>{t.current=e},[e]),t.current}const R2e=function(e,t){let{open:n}=e,{enabled:r=!0,role:i="dialog"}=t===void 0?{}:t;const o=EM(),a=EM(),s={id:o,role:i};return r?i==="tooltip"?{reference:{"aria-describedby":n?o:void 0},floating:s}:{reference:{"aria-expanded":n?"true":"false","aria-haspopup":i==="alertdialog"?"dialog":i,"aria-controls":n?o:void 0,...i==="listbox"&&{role:"combobox"},...i==="menu"&&{id:a}},floating:{...s,...i==="menu"&&{"aria-labelledby":a}}}:{}};function R1(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}const O2e=function(e,t){let{open:n,onOpenChange:r,refs:i,events:o,nodeId:a}=e,{enabled:s=!0,escapeKey:u=!0,outsidePointerDown:c=!0,referencePointerDown:l=!1,ancestorScroll:d=!1,bubbles:p=!0}=t===void 0?{}:t;const A=EO(),m=IQ()!=null,v=Te.useRef(!1);return Te.useEffect(()=>{if(!n||!s)return;function _(S){if(S.key==="Escape"){if(!p&&A&&$1(A.nodesRef.current,a).length>0)return;o.emit("dismiss",{preventScroll:!1}),r(!1)}}function C(S){const y=v.current;if(v.current=!1,y)return;const T=E2e(S);if(hm(T)&&i.floating.current){var w;const E=(w=i.floating.current.ownerDocument.defaultView)!=null?w:window,F=T.scrollWidth>T.clientWidth,W=T.scrollHeight>T.clientHeight;let K=W&&S.offsetX>T.clientWidth;if(W&&E.getComputedStyle(T).direction==="rtl"&&(K=S.offsetX<=T.offsetWidth-T.clientWidth),K||F&&S.offsetY>T.clientHeight)return}const O=A&&$1(A.nodesRef.current,a).some(E=>{var F;return R1(S,(F=E.context)==null?void 0:F.refs.floating.current)});R1(S,i.floating.current)||R1(S,i.domReference.current)||O||!p&&A&&$1(A.nodesRef.current,a).length>0||(o.emit("dismiss",m?{preventScroll:!0}:!1),r(!1))}function I(){r(!1)}const x=$O(i.floating.current);u&&x.addEventListener("keydown",_),c&&x.addEventListener("pointerdown",C);const g=(d?[...hm(i.reference.current)?bu(i.reference.current):[],...hm(i.floating.current)?bu(i.floating.current):[]]:[]).filter(S=>{var y;return S!==((y=x.defaultView)==null?void 0:y.visualViewport)});return g.forEach(S=>S.addEventListener("scroll",I,{passive:!0})),()=>{u&&x.removeEventListener("keydown",_),c&&x.removeEventListener("pointerdown",C),g.forEach(S=>S.removeEventListener("scroll",I))}},[u,c,o,A,a,n,r,d,s,p,i,m]),s?{reference:{onPointerDown(){l&&(o.emit("dismiss"),r(!1))}},floating:{onPointerDownCapture(){v.current=!0}}}:{}},RO="ArrowUp",ab="ArrowDown",ql="ArrowLeft",Lh="ArrowRight";function tm(e,t,n){return Math.floor(e/t)!==n}function Sd(e,t){return t<0||t>=e.current.length}function On(e,t){let{startingIndex:n=-1,decrement:r=!1,disabledIndices:i,amount:o=1}=t===void 0?{}:t;const a=e.current;let s=n;do{var u,c;s=s+(r?-o:o)}while(s>=0&&s<=a.length-1&&(i?i.includes(s):a[s]==null||(u=a[s])!=null&&u.hasAttribute("disabled")||((c=a[s])==null?void 0:c.getAttribute("aria-disabled"))==="true"));return s}function sb(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function FM(e,t){return sb(t,e===RO||e===ab,e===ql||e===Lh)}function O1(e,t,n){return sb(t,e===ab,n?e===ql:e===Lh)||e==="Enter"||e==" "||e===""}function F2e(e,t,n){return sb(t,n?e===ql:e===Lh,e===ab)}function k2e(e,t,n){return sb(t,n?e===Lh:e===ql,e===RO)}function F1(e,t){return On(e,{disabledIndices:t})}function kM(e,t){return On(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}const M2e=function(e,t){let{open:n,onOpenChange:r,refs:i}=e,{listRef:o,activeIndex:a,onNavigate:s=()=>{},enabled:u=!0,selectedIndex:c=null,allowEscape:l=!1,loop:d=!1,nested:p=!1,rtl:A=!1,virtual:m=!1,focusItemOnOpen:v="auto",focusItemOnHover:_=!0,openOnArrowKeyDown:C=!0,disabledIndices:I=void 0,orientation:x="vertical",cols:g=1}=t===void 0?{listRef:{current:[]},activeIndex:null,onNavigate:()=>{}}:t;process.env.NODE_ENV!=="production"&&(l&&(d||console.warn(["Floating UI: `useListNavigation` looping must be enabled to allow","escaping."].join(" ")),m||console.warn(["Floating UI: `useListNavigation` must be virtual to allow","escaping."].join(" "))),x==="vertical"&&g>1&&console.warn(["Floating UI: In grid list navigation mode (`cols` > 1), the",'`orientation` should be either "horizontal" or "both".'].join(" ")));const S=IQ(),y=EO(),T=OM(n),w=KC(s),O=KC(OM(s)),E=Te.useRef(v),F=Te.useRef(c??-1),W=Te.useRef(null),K=$2e(I),J=Te.useRef(!1),ee=Te.useRef(-1),[re,P]=Te.useState(),Y=Te.useCallback((k,q)=>{ee.current=requestAnimationFrame(()=>{if(m){var ue;P((ue=k.current[q.current])==null?void 0:ue.id)}else{var ke;(ke=k.current[q.current])==null||ke.focus({preventScroll:!0})}})},[m]);ns(()=>{u&&(!T&&n&&E.current&&c!=null&&w(c),T&&!n&&(cancelAnimationFrame(ee.current),F.current=-1,O(null)))},[n,T,c,o,Y,u,w,O]),ns(()=>{if(u&&n)if(a==null){if(c!=null)return;T&&(F.current=-1,Y(o,F)),!T&&E.current&&(W.current!=null||E.current===!0&&W.current==null)&&(F.current=W.current==null||O1(W.current,x,A)||p?F1(o,K.current):kM(o,K.current),w(F.current),Y(o,F))}else Sd(o,a)||(F.current=a,Y(o,F))},[n,T,a,c,p,o,w,Y,u,l,x,A,m,K]),ns(()=>{if(u&&!n&&T){var k,q;const ue=y==null||(k=y.nodesRef.current.find(ke=>ke.id===S))==null||(q=k.context)==null?void 0:q.refs.floating.current;ue&&!ue.contains(RM($O(ue)))&&ue.focus({preventScroll:!0})}},[u,n,T,y,S]),ns(()=>{W.current=null});function M(k){if(J.current=!0,p&&k2e(k.key,x,A)){Ha(k),r(!1),T2e(i.domReference.current)&&i.domReference.current.focus();return}const q=F.current,ue=F1(o,I),ke=kM(o,I);if(k.key==="Home"&&(F.current=ue,w(F.current)),k.key==="End"&&(F.current=ke,w(F.current)),g>1){const Ie=F.current;if(k.key===RO){if(Ha(k),Ie===-1)F.current=ke;else if(F.current=On(o,{startingIndex:Ie,amount:g,decrement:!0,disabledIndices:I}),d&&(Ie-g<ue||F.current<0)){const rt=Ie%g,at=ke%g,fn=ke-(at-rt);at===rt?F.current=ke:F.current=at>rt?fn:fn-g}Sd(o,F.current)&&(F.current=Ie),w(F.current)}if(k.key===ab&&(Ha(k),Ie===-1?F.current=ue:(F.current=On(o,{startingIndex:Ie,amount:g,disabledIndices:I}),d&&Ie+g>ke&&(F.current=On(o,{startingIndex:Ie%g-g,amount:g,disabledIndices:I}))),Sd(o,F.current)&&(F.current=Ie),w(F.current)),x==="both"){const rt=Math.floor(Ie/g);k.key===Lh&&(Ha(k),Ie%g!==g-1?(F.current=On(o,{startingIndex:Ie,disabledIndices:I}),d&&tm(F.current,g,rt)&&(F.current=On(o,{startingIndex:Ie-Ie%g-1,disabledIndices:I}))):d&&(F.current=On(o,{startingIndex:Ie-Ie%g-1,disabledIndices:I})),tm(F.current,g,rt)&&(F.current=Ie)),k.key===ql&&(Ha(k),Ie%g!==0?(F.current=On(o,{startingIndex:Ie,disabledIndices:I,decrement:!0}),d&&tm(F.current,g,rt)&&(F.current=On(o,{startingIndex:Ie+(g-Ie%g),decrement:!0,disabledIndices:I}))):d&&(F.current=On(o,{startingIndex:Ie+(g-Ie%g),decrement:!0,disabledIndices:I})),tm(F.current,g,rt)&&(F.current=Ie));const at=Math.floor(ke/g)===rt;Sd(o,F.current)&&(d&&at?F.current=k.key===ql?ke:On(o,{startingIndex:Ie-Ie%g-1,disabledIndices:I}):F.current=Ie),w(F.current);return}}if(FM(k.key,x)){if(Ha(k),n&&!m&&RM(k.currentTarget.ownerDocument)===k.currentTarget){F.current=O1(k.key,x,A)?ue:ke,w(F.current);return}O1(k.key,x,A)?d?F.current=q>=ke?l&&q!==o.current.length?-1:ue:On(o,{startingIndex:q,disabledIndices:I}):F.current=Math.min(ke,On(o,{startingIndex:q,disabledIndices:I})):d?F.current=q<=ue?l&&q!==-1?o.current.length:ke:On(o,{startingIndex:q,decrement:!0,disabledIndices:I}):F.current=Math.max(ue,On(o,{startingIndex:q,decrement:!0,disabledIndices:I})),Sd(o,F.current)?w(null):w(F.current)}}return u?{reference:{...m&&n&&a!=null&&{"aria-activedescendant":re},onKeyDown(k){if(J.current=!0,m&&n)return M(k);if((k.key.indexOf("Arrow")===0||k.key==="Enter"||k.key===" "||k.key==="")&&(W.current=k.key),p){F2e(k.key,x,A)&&(Ha(k),n?(F.current=F1(o,I),w(F.current)):r(!0));return}FM(k.key,x)&&(c!=null&&(F.current=c),Ha(k),!n&&C?r(!0):M(k),n&&w(F.current))}},floating:{"aria-orientation":x==="both"?void 0:x,...m&&a!=null&&{"aria-activedescendant":re},onKeyDown:M,onPointerMove(){J.current=!1}},item:{onFocus(k){let{currentTarget:q}=k;const ue=o.current.indexOf(q);ue!==-1&&w(ue)},onClick:k=>{let{currentTarget:q}=k;return q.focus({preventScroll:!0})},..._&&{onMouseMove(k){let{currentTarget:q}=k;const ue=q;if(ue){const ke=o.current.indexOf(ue);ke!==-1&&w(ke)}},onPointerLeave(){if(!J.current&&(F.current=-1,Y(o,F),w(null),!m)){var k;(k=i.floating.current)==null||k.focus({preventScroll:!0})}}}}}:{}};function L2e(e){var t;const{char:n,allowSpaces:r,allowedPrefixes:i,startOfLine:o,$position:a}=e,s=eLe(n),u=new RegExp(`\\s${s}$`),c=o?"^":"",l=r?new RegExp(`${c}${s}.*?(?=\\s${s}|$)`,"gm"):new RegExp(`${c}(?:^)?${s}[^\\s${s}]*`,"gm"),d=((t=a.nodeBefore)===null||t===void 0?void 0:t.isText)&&a.nodeBefore.text;if(!d)return null;const p=a.pos-d.length,A=Array.from(d.matchAll(l)).pop();if(!A||A.input===void 0||A.index===void 0)return null;const m=A.input.slice(Math.max(0,A.index-1),A.index),v=new RegExp(`^[${i==null?void 0:i.join("")}\0]?$`).test(m);if(i!==null&&!v)return null;const _=p+A.index;let C=_+A[0].length;return r&&u.test(d.slice(C-1,C+1))&&(A[0]+=" ",C+=1),_<a.pos&&C>=a.pos?{range:{from:_,to:C},query:A[0].slice(n.length),text:A[0]}:null}const j2e=new eo("suggestion");function U2e({pluginKey:e=j2e,editor:t,char:n="@",allowSpaces:r=!1,allowedPrefixes:i=[" "],startOfLine:o=!1,decorationTag:a="span",decorationClass:s="suggestion",command:u=()=>null,items:c=()=>[],render:l=()=>({}),allow:d=()=>!0,findSuggestionMatch:p=L2e}){let A;const m=l==null?void 0:l(),v=new zr({key:e,view(){return{update:async(_,C)=>{var I,x,g,S,y,T,w;const O=(I=this.key)===null||I===void 0?void 0:I.getState(C),E=(x=this.key)===null||x===void 0?void 0:x.getState(_.state),F=O.active&&E.active&&O.range.from!==E.range.from,W=!O.active&&E.active,K=O.active&&!E.active,J=!W&&!K&&O.query!==E.query,ee=W||F&&J,re=J||F,P=K||F&&J;if(!ee&&!re&&!P)return;const Y=P&&!ee?O:E,M=_.dom.querySelector(`[data-decoration-id="${Y.decorationId}"]`);A={editor:t,range:Y.range,query:Y.query,text:Y.text,items:[],command:k=>u({editor:t,range:Y.range,props:k}),decorationNode:M,clientRect:M?()=>{var k;const{decorationId:q}=(k=this.key)===null||k===void 0?void 0:k.getState(t.state),ue=_.dom.querySelector(`[data-decoration-id="${q}"]`);return(ue==null?void 0:ue.getBoundingClientRect())||null}:null},ee&&((g=m==null?void 0:m.onBeforeStart)===null||g===void 0||g.call(m,A)),re&&((S=m==null?void 0:m.onBeforeUpdate)===null||S===void 0||S.call(m,A)),(re||ee)&&(A.items=await c({editor:t,query:Y.query})),P&&((y=m==null?void 0:m.onExit)===null||y===void 0||y.call(m,A)),re&&((T=m==null?void 0:m.onUpdate)===null||T===void 0||T.call(m,A)),ee&&((w=m==null?void 0:m.onStart)===null||w===void 0||w.call(m,A))},destroy:()=>{var _;A&&((_=m==null?void 0:m.onExit)===null||_===void 0||_.call(m,A))}}},state:{init(){return{active:!1,range:{from:0,to:0},query:null,text:null,composing:!1}},apply(_,C,I,x){const{isEditable:g}=t,{composing:S}=t.view,{selection:y}=_,{empty:T,from:w}=y,O={...C};if(O.composing=S,g&&(T||t.view.composing)){(w<C.range.from||w>C.range.to)&&!S&&!C.composing&&(O.active=!1);const E=p({char:n,allowSpaces:r,allowedPrefixes:i,startOfLine:o,$position:y.$from}),F=`id_${Math.floor(Math.random()*4294967295)}`;E&&d({editor:t,state:x,range:E.range,isActive:C.active})?(O.active=!0,O.decorationId=C.decorationId?C.decorationId:F,O.range=E.range,O.query=E.query,O.text=E.text):O.active=!1}else O.active=!1;return O.active||(O.decorationId=null,O.range={from:0,to:0},O.query=null,O.text=null),O}},props:{handleKeyDown(_,C){var I;const{active:x,range:g}=v.getState(_.state);return x&&((I=m==null?void 0:m.onKeyDown)===null||I===void 0?void 0:I.call(m,{view:_,event:C,range:g}))||!1},decorations(_){const{active:C,range:I,decorationId:x}=v.getState(_);return C?Ht.create(_.doc,[wi.inline(I.from,I.to,{nodeName:a,class:s,"data-decoration-id":x})]):null}}});return v}const xQ=["ArrowDown","ArrowUp","End","Home"],wQ=["Enter"],B2e=["Escape",...xQ,...wQ],P2e=dr.create({name:"slash-commands",addOptions(){return{nodeTypes:[]}},addProseMirrorPlugins(){const e=mm(VQ,this.options.nodeTypes);return e.length>1?[U2e({allowSpaces:!0,char:"/",editor:this.editor,startOfLine:!0,allow:({state:t})=>{const n=t.selection.$from;return n.parent.type.name===ao.name&&n.depth===1},command:({editor:t,props:n,range:r})=>{n.runCommands(t,{deleteRange:r})},items:({query:t})=>{const n=t.toLocaleLowerCase().trim();return e.filter(r=>{var i,o;return((i=r.shortText)==null?void 0:i.toLocaleLowerCase().includes(n))||((o=r.text)==null?void 0:o.toLocaleLowerCase().includes(n))})},render:()=>{let t;return{onStart:n=>{t=new nQ(W2e,{editor:n.editor,props:n}),document.body.appendChild(t.element)},onUpdate:n=>{t==null||t.updateProps(n)},onKeyDown:({event:n})=>{var r;return!!(B2e.includes(n.key)&&((r=t==null?void 0:t.ref)!=null&&r.handleKeyDown(n)))},onExit:()=>{t==null||t.destroy(),t==null||t.element.remove()}}}})]:[]}}),W2e=$.forwardRef(function(t,n){const{command:r,decorationNode:i,editor:o,items:a}=t,[s,u]=$.useState(!0),{context:c,floating:l,reference:d,x:p,y:A}=x2e({middleware:[f2e(0),l2e(),d2e({limiter:p2e()})],onOpenChange:u,open:s,placement:"top-start",strategy:"fixed",whileElementsMounted:g2e});$.useLayoutEffect(()=>{d(i)},[d,i]),$.useEffect(()=>{let T;const w=()=>{T=window.setTimeout(()=>{u(!0)})},O=()=>{u(!1)};return o.on("focus",w).on("blur",O),()=>{o.off("focus",w).off("blur",O),clearTimeout(T)}},[o]);const[m,v]=$.useState(0),_=$.useRef([]);Ne.useOnChange(a,()=>{v(0),_.current=[]});const{getFloatingProps:C,getItemProps:I,getReferenceProps:x}=w2e([O2e(c,{outsidePointerDown:!1}),M2e(c,{activeIndex:m,listRef:_,onNavigate:T=>{v(w=>T??w)},openOnArrowKeyDown:!1,virtual:!0}),R2e(c,{role:"menu"})]),S=x().onKeyDown;$.useImperativeHandle(n,()=>({handleKeyDown:T=>{if(s){if(xQ.includes(T.key)&&S(T),wQ.includes(T.key)){const w=a[m];w!==void 0&&r(w)}return!0}else return!1}}),[m,r,a,S,s]);const y=p!==null&&A!==null;return s?f.jsx(h.Box,{...C(),minWidth:256,backgroundColor:"grey1",border:!0,borderStyle:"solid",borderRadius:6,flexDirection:"column",ref:l,top:0,left:0,position:"fixed",transform:y?`translate3d(${Math.round(p)}px, ${Math.round(A)}px, 0)`:"translate3d(0, -200%, 0)",overflow:"hidden",children:f.jsxs("div",{style:{boxShadow:"0px 2px 10px 0px hsla(0, 0%, 0%, 0.1)"},children:[a.map((T,w)=>{const O=I({onClick:()=>{r(T)},onPointerDown:E=>{E.preventDefault()}});return $.createElement(MM,{...O,key:T.nodeType,ref:E=>{_.current[w]=E},active:w===m,isFirstItem:w===0,isLastItem:w===a.length-1,shortcut:`/${T.shortText??""}`},T.text)}),a.length===0&&f.jsx(MM,{...I({onPointerDown:T=>{T.preventDefault()}}),disabled:!0,ref:T=>{_.current[0]=T},children:"No results"})]})}):null}),MM=$.forwardRef(function(t,n){const{children:r,disabled:i=!1,shortcut:o,active:a=!1,isFirstItem:s=!1,isLastItem:u=!1,...c}=t;return f.jsx("div",{...c,role:"button",style:{cursor:i?"default":"pointer"},ref:n,children:f.jsxs(h.Box,{alignItems:"center",height:32,flexDirection:"row",gap:8,padding:8,backgroundColor:a?"grey4":"inherit",justifyContent:"space-between",opacity:i?.5:1,children:[f.jsx(h.Text,{color:"grey12",component:"span",children:r}),o&&f.jsx(h.Text,{color:"inherit",component:"span",variant:"small",children:o})]})})});function D2e(e,t){var s,u;const n=t.map(c=>c.richTextNodeTypes).flat(),i={placeholderByNodeType:K2e(t),unfocusedPlaceholder:(s=e.config)==null?void 0:s.placeholder,nodeExtensions:t},o=n.includes(fe.RichTextNodeType.orderedList)||n.includes(fe.RichTextNodeType.list);return[UC.component(((u=e.config)==null?void 0:u.single)===void 0),Wu.component,dg.component,e2e(i),o?Nl.component:void 0,P2e.configure({nodeTypes:n})].filter(io.isDefined)}function K2e(e){return e.reduce((t,n)=>(n.nodeType===vl.Text&&(t[n.name]=n.placeholder),t),{})}const NC=IUe.extend({name:"bulletList",parseHTML(){return[{tag:"ul"}]},renderHTML({HTMLAttributes:e}){return["ul",Et(this.options.HTMLAttributes,e),0]}}).configure({itemTypeName:"listItem"}),N2e={fromPrismic(e){return function(t){var r;const n=Nl.converter.fromPrismic(e)(t);if(n)return(r=e.nodes[NC.name])==null?void 0:r.create(ua.fromPrismic(t),n)}},toPrismic(e){return Pu.children.map(e,t=>Nl.converter.toPrismic(t,fe.RichTextNodeType.list).filter(io.isDefined)).flat()}},q2e=new IO([fe.RichTextNodeType.list],NC.name,NC,N2e),gg=q2e,V2e=/^```([a-z]+)?[\s\n]$/,Q2e=/^~~~([a-z]+)?[\s\n]$/,z2e=jn.create({name:"codeBlock",addOptions(){return{languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,HTMLAttributes:{}}},content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:this.options.defaultLanguage,parseHTML:e=>{var t;const{languageClassPrefix:n}=this.options,o=[...((t=e.firstElementChild)===null||t===void 0?void 0:t.classList)||[]].filter(a=>a.startsWith(n)).map(a=>a.replace(n,""))[0];return o||null},rendered:!1}}},parseHTML(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML({node:e,HTMLAttributes:t}){return["pre",Et(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:()=>{const{empty:e,$anchor:t}=this.editor.state.selection,n=t.pos===1;return!e||t.parent.type.name!==this.name?!1:n||!t.parent.textContent.length?this.editor.commands.clearNodes():!1},Enter:({editor:e})=>{if(!this.options.exitOnTripleEnter)return!1;const{state:t}=e,{selection:n}=t,{$from:r,empty:i}=n;if(!i||r.parent.type!==this.type)return!1;const o=r.parentOffset===r.parent.nodeSize-2,a=r.parent.textContent.endsWith(`
102
102
 
103
- `);return!o||!a?!1:e.chain().command(({tr:s})=>(s.delete(r.pos-2,r.pos),!0)).exitCode().run()},ArrowDown:({editor:e})=>{if(!this.options.exitOnArrowDown)return!1;const{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;const s=i.after();return s===void 0?!1:r.nodeAt(s)?e.commands.command(({tr:c})=>(c.setSelection(ze.near(r.resolve(s))),!0)):e.commands.exitCode()}}},addInputRules(){return[$C({find:Y2e,type:this.type,getAttributes:e=>({language:e[1]})}),$C({find:G2e,type:this.type,getAttributes:e=>({language:e[1]})})]},addProseMirrorPlugins(){return[new zr({key:new eo("codeBlockVSCodeHandler"),props:{handlePaste:(e,t)=>{if(!t.clipboardData||this.editor.isActive(this.type.name))return!1;const n=t.clipboardData.getData("text/plain"),r=t.clipboardData.getData("vscode-editor-data"),i=r?JSON.parse(r):void 0,o=i==null?void 0:i.mode;if(!n||!o)return!1;const{tr:a,schema:s}=e.state,u=s.text(n.replace(/\r\n?/g,`
104
- `));return a.replaceSelectionWith(this.type.create({language:o},u)),a.selection.$from.parent.type!==this.type&&a.setSelection(Be.near(a.doc.resolve(Math.max(0,a.selection.from-2)))),a.setMeta("paste",!0),e.dispatch(a),!0}}})]}}),vg=J2e.extend({name:"preformatted",addAttributes(){return{language:{default:null,parseHTML:e=>{var o;const{languageClassPrefix:t}=this.options,i=[...((o=e.firstElementChild)==null?void 0:o.classList)||[]].filter(a=>a.startsWith(t)).map(a=>a.replace(t,""))[0];return i||null},renderHTML:e=>e.language?{class:this.options.languageClassPrefix+e.language}:null}}},parseHTML(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML({HTMLAttributes:e}){return["pre",Et(this.options.HTMLAttributes),["code",e,0]]}}).configure({exitOnTripleEnter:!1}),Z2e={fromPrismic(e){return function(t){var r;const n=Wu.converter.fromPrismic(e)(vg.name,t,!0);return(r=e.nodes[vg.name])==null?void 0:r.create(ua.fromPrismic(t),n)}},toPrismic(e){return Wu.converter.toPrismic(e,fe.RichTextNodeType.preformatted,ua.toPrismic(e))}},X2e=new kh([fe.RichTextNodeType.preformatted],vg.name,vg,Z2e,"",!0),EQ=X2e;function $Q(e){const{editor:t,getPos:n,node:r}=e,[i,o]=$.useState(!1);return $.useEffect(()=>{function a(){const{from:u,to:c}=t.state.selection,l=n(),d=n()+r.nodeSize,p=u<=l&&c>=d;o(p)}function s(){o(!1)}return t.on("blur",s),t.on("selectionUpdate",a),()=>{t.off("blur",s),t.off("selectionUpdate",a)}},[t,n,r.nodeSize]),{selected:i}}function eBe(e,t,n){const{node:r}=e,i=r.attrs.content,o=Ne.useStableCallback(e.updateAttributes),a=Ne.useDebounceState({initialState:(i==null?void 0:i.embed_url)??"",startTransition:$.startTransition});function s(l){o({content:l})}function u(l){a.set(l),Fr.toURL(l)||s(void 0)}const{onKeyDown:c}=tBe(e,a.value,t,n);return{inputRef:t,containerRef:n,onKeyDown:c,url:a.value,urlChanged:u,onContentChange:s,debouncedUrl:a.debouncedValue,content:e.node.attrs.content}}function tBe(e,t,n,r){const{editor:i,getPos:o,node:a}=e,[s,u]=$.useState(!0);$.useEffect(()=>{!s||!e.editor.isFocused||h.handleEditorFlushSyncError(()=>{var l;return(l=n.current)==null?void 0:l.focus()})},[n,s,e.editor.isFocused]);function c(l){const d=o(),p=o()+a.nodeSize;l.code==="Enter"&&(u(!1),i.chain().insertContentAt(p,{type:"paragraph"}).focus(p+1).run()),l.code==="Backspace"&&t===""&&i.chain().deleteRange({from:d,to:p}).focus(p+1).run(),l.code==="ArrowUp"&&(u(!1),i.chain().focus(d-1).run()),l.code==="ArrowDown"&&(u(!1),i.chain().focus(p+1).run())}return{containerRef:r,inputRef:n,onKeyDown:c}}function nBe(e){const t=$.useRef(null),n=$.useRef(null),{onKeyDown:r,url:i,urlChanged:o,onContentChange:a,debouncedUrl:s,content:u}=eBe(e,t,n),{selected:c}=$Q(e);return f.jsx(tQ,{className:"custom-embed",children:f.jsxs("div",{contentEditable:"false",suppressContentEditableWarning:!0,children:[f.jsxs(h.Box,{flexGrow:1,alignItems:"center",children:[f.jsx(h.Icon,{size:"small",name:"cloud",color:"grey11"}),f.jsx(h.Box,{flexGrow:1,height:40,ref:n,children:f.jsx(Qs,{id:"id",ref:t,value:i,variant:Fr.toURL(i)?"link":"normal",placeholder:"Paste your link here",onValueChange:o,onKeyDown:r})})]}),Fr.toURL(i)&&f.jsx(L7,{selected:c,debouncedUrl:s,onContentChange:a,content:u})]})})}const qC=jn.create({name:"embed",group:"block",atom:!0,content:"block*",marks:"",addAttributes(){return{content:{default:void 0}}},addCommands(){return{setEmbed:()=>({tr:e,dispatch:t})=>{const n=this.type.create();return t&&e.replaceSelectionWith(n),!0}}},parseHTML(){return[{tag:"embed"}]},renderHTML(){return["embed"]},addNodeView(){return rQ(nBe)}}),rBe={fromPrismic(e){return function(t){var n;return(n=e.nodes[qC.name])==null?void 0:n.create({content:t.data})}},toPrismic(e){return e.attrs.content===void 0?{type:"embed",data:{type:"embed",embed_url:"",__TYPE__:"EmbedContent",all:[]}}:{type:"embed",data:{...e.attrs.content}}}},RQ=new mUe([fe.RichTextNodeType.embed],qC.name,qC,rBe),iBe=jn.create({name:"heading",addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:"inline*",group:"block",defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(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]}`,Et(this.options.HTMLAttributes,t),0]},addCommands(){return{setHeading:e=>({commands:t})=>this.options.levels.includes(e.level)?t.setNode(this.name,e):!1,toggleHeading:e=>({commands:t})=>this.options.levels.includes(e.level)?t.toggleNode(this.name,"paragraph",e):!1}},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=>$C({find:new RegExp(`^(#{1,${e}})\\s$`),type:this.type,getAttributes:{level:e}}))}}),VC="heading";function ub(e){switch(e){case 1:return fe.RichTextNodeType.heading1;case 2:return fe.RichTextNodeType.heading2;case 3:return fe.RichTextNodeType.heading3;case 4:return fe.RichTextNodeType.heading4;case 5:return fe.RichTextNodeType.heading5;case 6:return fe.RichTextNodeType.heading6}}function LM(e){return{fullName:ub(e),level:e}}const OQ=[1,2,3,4,5,6];function FQ(e,t=OQ){const n=new RegExp(`^heading([${t.join(",")}]){1}$`),r=e.match(n);if(!r||!r[1])return;const i=parseInt(r[1]);return{fullName:ub(i),level:i}}function kQ(e,t){const n=e.level;if(t.includes(n))return{fullName:ub(n),level:n}}const oBe=e=>{const t=e[0]??1;return{fromPrismic(n){return function(r){var a;const i=Wu.converter.fromPrismic(n)(VC,r),o=FQ(r.type,e)||LM(t);return(a=n.nodes[VC])==null?void 0:a.create({level:o.level,...ua.fromPrismic(r)},i)}},toPrismic(n){const{fullName:r}=kQ(n.attrs,e)||LM(t);return Wu.converter.toPrismic(n,r,ua.toPrismic(n))}}};function aBe(e){return e?e.size?Array.from(e.values()).reduce((n,r)=>{const i=FQ(r);return i?[...n,i.level]:n},[]).sort((n,r)=>n-r):[]:OQ}function sBe(e){return iBe.extend({name:"heading"}).configure({levels:e})}const ru={name:VC,build:e=>{const t=aBe(e);if(!t)return;const n=t.map(r=>ub(r));return new vUe(n,sBe(t),t,oBe(t),r=>{const i=kQ(r,t);return i&&`Heading ${i.level}`})}};function uBe(e){const{content:t,thumbnail:n,imageViewProps:{getPos:r,updateAttributes:i,editor:o,node:a}}=e,[s,u]=$.useTransition();function c(A){u(()=>i({content:A}))}function l(A){const m=rm(A),v=r()+a.nodeSize;c({...t,...m}),o.chain().focus(v+1).run()}function d({croppedImages:A}){if(!t)return;const m=A[n.name];if(!m)return;const v=N7({content:t,croppedImage:m});v!==t&&c(v)}function p(){const A=r(),m=r()+a.nodeSize;o.chain().deleteRange({from:A,to:m}).focus(m).run()}return{onMediaSelected:l,onCropperDialogClose:d,isUpdating:s,updateContent:c,onClear:p}}function cBe(e){const{node:t}=e,n=t.attrs.content,{selected:r}=$Q(e),i=$.useRef(null),o={width:void 0,height:void 0,name:md},{onMediaSelected:a,onCropperDialogClose:s,isUpdating:u,updateContent:c,onClear:l}=uBe({content:n,thumbnail:o,imageViewProps:e}),[d,p]=$.useState(!1),A="Feature image",m=(n==null?void 0:n.width)===0&&(n==null?void 0:n.height)===0,v=n&&!m?[`${n.width}×${n.height}px`]:[],_={thumbnail:o,contentView:n,labels:sC(o,n,n)};return $.useLayoutEffect(()=>{var I;const C=(I=i==null?void 0:i.current)==null?void 0:I.closest(`.${MQ}`);_d.isHTMLElement(C)&&C.style.removeProperty("height")},[]),f.jsx(tQ,{children:f.jsx(D7,{ref:i,isMediaDialogOpen:d,selected:r,onMediaSelected:a,onMediaDialogOpenChange:p,children:f.jsx($.Suspense,{fallback:dBe,children:n!=null&&n.url?f.jsx(e8,{allContentViews:[n],content:n,contentView:n,fieldLabel:A,imageLabel:v,initialImages:[_],isUpdating:u,readOnly:!1,thumbnailName:o.name,onClear:l,onContentChange:c,onCropperDialogClose:s,onMediaDialogOpenChange:p}):f.jsx(B7,{fieldLabel:A,isUpdating:u,readOnly:!1,onMediaDialogOpenChange:p})})})})}const MQ="imageViewNodeWrapper",LQ=144,lBe=94;function fBe(e){return(e?lBe:LQ)+12+12+1+1}const dBe=f.jsx("div",{style:{height:LQ}}),QC=jn.create({name:"image",group:"block",atom:!0,addAttributes(){return{content:{default:void 0}}},addCommands(){return{setImage:()=>e=>{const{dispatch:t,tr:n}=e,r=this.type.create();return t&&n.replaceSelectionWith(r),!0}}},parseHTML(){return[{tag:"image"}]},renderHTML({HTMLAttributes:e}){return["image",e]},addNodeView(){return function(t){const n=t.node.attrs.content===void 0;return rQ(cBe,{attrs:{style:`height: ${fBe(n)}px`,class:MQ}})(t)}}}),pBe={fromPrismic(e){return function(t){var n;return(n=e.nodes[QC.name])==null?void 0:n.create({content:t.data})}},toPrismic(e){if(e.attrs.content!==void 0)return{type:"image",data:{...e.attrs.content}}}},jQ=new gUe([fe.RichTextNodeType.image],QC.name,QC,pBe),ABe=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,hBe=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,mBe=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,gBe=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,vBe=Nc.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:e=>e.style.fontStyle!=="normal"&&null},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:e}){return["em",Et(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[ig({find:ABe,type:this.type}),ig({find:mBe,type:this.type})]},addPasteRules(){return[ag({find:hBe,type:this.type}),ag({find:gBe,type:this.type})]}});class yBe{constructor(t,n,r){Rn(this,"extType",qc.Mark);Rn(this,"richTextNodeTypes",[fe.RichTextNodeType.em]);this.name=t,this.component=n,this.converter=r}}const UQ="em",BQ=vBe.extend({name:UQ}),bBe={fromPrismic(e){return function(){var t;return(t=e.marks[BQ.name])==null?void 0:t.create()}},toPrismic(){}},CBe=new yBe(UQ,BQ,bBe),OO=CBe;class SBe{constructor(t,n,r){Rn(this,"extType",qc.Mark);Rn(this,"richTextNodeTypes",[]);this.name=t,this.component=n,this.converter=r}}const PQ="label",zC=Nc.create({name:PQ,priority:1e3,keepOnSplit:!1,inclusive:!1,addOptions(){return{htmlAttributes:{style:"background-color: hsl(251, 89%, 96%); border: 1px dashed rgba(68, 53, 146, 0.4); border-radius: 0px 2px 2px 2px"}}},addAttributes(){return{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",Et(this.options.htmlAttributes,e),0]}}),_Be={fromPrismic(e){return function(t){var i;const n=t.data,r={type:zC.name,label:n};return(i=e.marks[zC.name])==null?void 0:i.create(r)}},toPrismic(e){return e.attrs.label}},FO=new SBe(PQ,zC,_Be);class IBe{constructor(t,n,r){Rn(this,"extType",qc.Mark);Rn(this,"richTextNodeTypes",[fe.RichTextNodeType.hyperlink]);this.name=t,this.component=n,this.converter=r}}const WQ="hyperlink",Vo=Nc.create({name:WQ,priority:1e3,keepOnSplit:!1,inclusive:!1,addOptions(){return{openOnClick:!1,linkOnPaste:!0,autolink:!0,protocols:[],htmlAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null,id:""},validate:void 0}},addAttributes(){return{href:{default:""},id:{default:""},target:{default:"_blank"},rel:{default:"noopener noreferrer nofollow"},class:{default:null},media:{default:null}}},parseHTML(){return[{tag:'a[href]:not([href *= "javascript:" i])'}]},renderHTML({HTMLAttributes:e}){return["a",Et(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})=>{const n=HC(J7({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()}}}),TBe={fromPrismic(e){return function(t){var r,i,o,a;const n=t.data;if(n.__TYPE__==="DocumentLink"){const s={type:Vo.name,id:n.id};return(r=e.marks[Vo.name])==null?void 0:r.create(s)}if(n.__TYPE__==="ImageLink"){const s={type:Vo.name,media:HC(n)};return(i=e.marks[Vo.name])==null?void 0:i.create(s)}if(n.__TYPE__==="FileLink"){const s={type:Vo.name,media:HC(n)};return(o=e.marks[Vo.name])==null?void 0:o.create(s)}if(n.__TYPE__==="ExternalLink"){const s={type:Vo.name,url:n.url,href:n.url,target:n.target};return(a=e.marks[Vo.name])==null?void 0:a.create(s)}}},toPrismic(e){return e.attrs.media?KQ(e.attrs.media):e.attrs.id?{__TYPE__:"DocumentLink",id:e.attrs.id}:{__TYPE__:"ExternalLink",url:e.attrs.href,target:e.attrs.target}}},DQ=new IBe(WQ,Vo,TBe);function HC(e){return JSON.stringify(e)}function KQ(e){return JSON.parse(e)}const xBe=jn.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:e}){return["li",Et(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)}}}),jM=Nc.create({name:"textStyle",priority:101,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"span",getAttrs:e=>e.hasAttribute("style")?{}:!1}]},renderHTML({HTMLAttributes:e}){return["span",Et(this.options.HTMLAttributes,e),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:e,commands:t})=>{const n=pO(e,this.type);return Object.entries(n).some(([,i])=>!!i)?!0:t.unsetMark(this.name)}}}}),UM=/^(\d+)\.\s$/,wBe=jn.create({name:"orderedList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes(){return{start:{default:1,parseHTML:e=>e.hasAttribute("start")?parseInt(e.getAttribute("start")||"",10):1},type:{default:void 0,parseHTML:e=>e.getAttribute("type")}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:e}){const{start:t,...n}=e;return t===1?["ol",Et(this.options.HTMLAttributes,n),0]:["ol",Et(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(xBe.name,this.editor.getAttributes(jM.name)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let e=og({find:UM,type:this.type,getAttributes:t=>({start:+t[1]}),joinPredicate:(t,n)=>n.childCount+n.attrs.start===+t[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(e=og({find:UM,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:t=>({start:+t[1],...this.editor.getAttributes(jM.name)}),joinPredicate:(t,n)=>n.childCount+n.attrs.start===+t[1],editor:this.editor})),[e]}}),YC=wBe.extend({name:"orderedList",addAttributes(){return{start:{default:1,parseHTML:e=>e.hasAttribute("start")?parseInt(e.getAttribute("start")||"",10):1}}},renderHTML({HTMLAttributes:e}){const{start:t,...n}=e;return t===1?["ol",Et(this.options.HTMLAttributes,n),0]:["ol",Et(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"}),EBe={fromPrismic(e){return function(t){var r;const n=Nl.converter.fromPrismic(e)(t);if(n)return(r=e.nodes[YC.name])==null?void 0:r.create(ua.fromPrismic(t),n)}},toPrismic(e){return Pu.children.map(e,t=>Nl.converter.toPrismic(t,fe.RichTextNodeType.orderedList).filter(io.isDefined)).flat()}},$Be=new IO([fe.RichTextNodeType.orderedList],YC.name,YC,EBe),yg=$Be,NQ=[TO,OO,DQ,FO];function qQ(e){return[ao,gg,yg,ru.build(e),EQ,RQ,jQ,...NQ].filter(io.isDefined)}const VQ=[{nodeType:fe.RichTextNodeType.paragraph,icon:"textFields",isActive:e=>e.isActive(ao.name)&&!e.isActive(gg.name)&&!e.isActive(yg.name),runCommands:Ot((e,t)=>e.clearNodes().setDirection(Si(t))),shortText:"par",text:"Paragraph"},{nodeType:fe.RichTextNodeType.heading1,icon:"looks1",isActive:e=>e.isActive(ru.name,{level:1}),runCommands:Ot((e,t)=>e.setHeading({level:1}).setDirection(Si(t))),shortText:"h1",text:"Heading 1"},{nodeType:fe.RichTextNodeType.heading2,icon:"looks2",isActive:e=>e.isActive(ru.name,{level:2}),runCommands:Ot((e,t)=>e.setHeading({level:2}).setDirection(Si(t))),shortText:"h2",text:"Heading 2"},{nodeType:fe.RichTextNodeType.heading3,icon:"looks3",isActive:e=>e.isActive(ru.name,{level:3}),runCommands:Ot((e,t)=>e.setHeading({level:3}).setDirection(Si(t))),shortText:"h3",text:"Heading 3"},{nodeType:fe.RichTextNodeType.heading4,icon:"looks4",isActive:e=>e.isActive(ru.name,{level:4}),runCommands:Ot((e,t)=>e.setHeading({level:4}).setDirection(Si(t))),shortText:"h4",text:"Heading 4"},{nodeType:fe.RichTextNodeType.heading5,icon:"looks5",isActive:e=>e.isActive(ru.name,{level:5}),runCommands:Ot((e,t)=>e.setHeading({level:5}).setDirection(Si(t))),shortText:"h5",text:"Heading 5"},{nodeType:fe.RichTextNodeType.heading6,icon:"looks6",isActive:e=>e.isActive(ru.name,{level:6}),runCommands:Ot((e,t)=>e.setHeading({level:6}).setDirection(Si(t))),shortText:"h6",text:"Heading 6"},{nodeType:fe.RichTextNodeType.list,icon:"formatListBulleted",isActive:e=>e.isActive(gg.name),runCommands:Ot((e,t)=>e.toggleBulletList().setDirection(Si(t))),shortText:"bull",text:"Bulleted list"},{nodeType:fe.RichTextNodeType.orderedList,icon:"formatListNumbered",isActive:e=>e.isActive(yg.name),runCommands:Ot((e,t)=>e.toggleOrderedList().setDirection(Si(t))),shortText:"num",text:"Numbered list"},{nodeType:fe.RichTextNodeType.preformatted,icon:"dataObject",isActive:e=>e.isActive(EQ.name),runCommands:Ot((e,t)=>e.setCodeBlock().setDirection(Si(t))),shortText:"code",text:"Code"},{nodeType:fe.RichTextNodeType.embed,icon:"cloud",isActive:e=>e.isActive(RQ.name),runCommands:Ot(e=>e.setEmbed()),shortText:"emb",text:"Embed"},{nodeType:fe.RichTextNodeType.image,icon:"image",isActive:e=>e.isActive(jQ.name),runCommands:Ot(e=>e.setImage()),shortText:"img",text:"Image"}],RBe=[{nodeType:fe.RichTextNodeType.strong,icon:"formatBold",isActive:e=>e.isActive(TO.name),runCommands:Ot(e=>e.toggleBold())},{nodeType:fe.RichTextNodeType.em,icon:"formatItalic",isActive:e=>e.isActive(OO.name),runCommands:Ot(e=>e.toggleItalic())}],OBe=[{nodeType:fe.RichTextNodeType.rtl,icon:"formatTextDirectionRToL",isActive:e=>e.isActive({[Ho]:lu}),runCommands:Ot((e,t)=>e.toggleDirection(Si(t)))}];function Ot(e){return(t,n={})=>{let r=n.can===!0?t.can().chain():t.chain().focus();return n.deleteRange!==void 0&&(r=r.deleteRange(n.deleteRange)),n.can?FBe(t,r,e):e(r,t).run()}}function Si(e){const t=e.state.selection.$from.parent.attrs;return ua.parseNodeAttrsDirection(t)}function mm(e,t){return e.filter(n=>t.includes(n.nodeType))}function FBe(e,t,n){try{return n(t,e).run()}catch{return!1}}function kBe(e){const{items:t,editor:n}=e;return t.length===0?null:f.jsxs(f.Fragment,{children:[f.jsx(h.ToolbarSeparator,{}),t.map(r=>f.jsx(h.ToolbarToggleButton,{disabled:!r.runCommands(n,{can:!0}),onPressedChange:()=>{r.runCommands(n)},pressed:r.isActive(n),startIcon:r.icon},r.nodeType))]})}function MBe(e){const{labels:t,editor:n}=e,r=n.getAttributes("label").label;return f.jsxs(f.Fragment,{children:[f.jsx(h.ToolbarSeparator,{}),f.jsxs(h.DropdownMenu,{children:[f.jsx(h.DropdownMenuTrigger,{disabled:t.length===0,children:f.jsx(h.Button,{endIcon:"arrowDropDown",size:"small",color:"grey",children:BM(r??"Labels")})}),f.jsx(h.DropdownMenuContent,{align:"start",asPortal:!1,maxHeight:256,avoidCollisions:!1,children:t.map((i,o)=>{const a=r===i;return f.jsx(h.DropdownMenuItem,{onSelect:()=>a?n.commands.unsetLabel():LBe(n,i),endIcon:a&&f.jsx(h.Icon,{name:"check",size:"extraSmall"}),children:BM(i)},`${i}-${o}`)})})]})]})}function LBe(e,t){Ot(r=>r.setLabel({label:t}))(e)}function BM(e){return Ep.overflow(e,20)}function jBe(e){const{editor:t}=e,n=t.getAttributes("label");if(!n.label)return null;const r=n.label;return f.jsx(h.Box,{backgroundColor:"purple9",padding:{block:2,inline:4},alignItems:"center",borderRadius:{topLeft:2,topRight:2,bottomRight:2},maxWidth:125,children:f.jsx(h.Text,{color:"white",variant:"small",noWrap:!0,children:r})})}function UBe(e){const{disabled:t,showWebLinkModal:n,showDocumentsLinkModal:r,showMediaLinkModal:i}=BBe(e);return f.jsxs(f.Fragment,{children:[f.jsx(h.ToolbarSeparator,{}),f.jsxs(h.ToolbarButtonGroup,{density:"compact",children:[f.jsx(h.ToolbarButton,{disabled:t,startIcon:"link",onClick:n},fe.RichTextNodeType.hyperlink),f.jsxs(h.DropdownMenu,{children:[f.jsx(h.DropdownMenuTrigger,{children:f.jsx(h.ToolbarButton,{startIcon:"arrowDropDown"})}),f.jsxs(h.DropdownMenuContent,{align:"end",asPortal:!1,children:[f.jsx(h.DropdownMenuItem,{startIcon:f.jsx(h.Icon,{name:"public"}),onSelect:n,children:"Link to web page"}),f.jsx(h.DropdownMenuItem,{startIcon:f.jsx(h.Icon,{name:"description"}),onSelect:r,children:"Link to document"}),f.jsx(h.DropdownMenuItem,{startIcon:f.jsx(h.Icon,{name:"image"}),onSelect:i,children:"Link to media"})]})]})]})]})}function BBe(e){const{editor:t,setModal:n}=e;function r(){n("webLink")}function i(){n("documentLink")}function o(){n("mediaLink")}return{disabled:!Ot(s=>s.setWebLink({href:""}))(t,{can:!0}),showWebLinkModal:r,showDocumentsLinkModal:i,showMediaLinkModal:o}}function PBe(e){const{docId:t,onEdit:n,onUnlink:r}=e,i=WBe(t),o=Ee();if(!i)return null;const a=i.versions[0],s=MR({status:a==null?void 0:a.status,releaseId:(a==null?void 0:a.status)==="release"?a.release_id:void 0,documentId:i.id,versionId:a==null?void 0:a.version_id,baseUrl:o.baseUrl}),u=(a==null?void 0:a.preview_summary)??"",c=(a==null?void 0:a.custom_type_label)??"";return f.jsx(ju,{url:s,title:i.title,subTitle:c,description:u,onEdit:n,onUnlink:r,largeIconName:"description"})}function WBe(e){const t=Ee();t.searchDocuments||Jt("searchDocuments");const{coreApiBaseUrl:n,authStrategy:r}=t;return Ve.useRequest(Nq,[n,r,e])}function DBe(e){const{editor:t}=e,{searchDocuments:n}=Ee(),r=t.getAttributes(fe.RichTextNodeType.hyperlink);if(r.id&&n){const i=r.id;return f.jsx(KBe,{docId:i,...e})}if(r.href){const i=r.href;return f.jsx(NBe,{url:i,...e})}if(r.media){const i=KQ(r.media);return f.jsx(qBe,{media:i,...e})}return null}function KBe(e){const{editor:t,onEditDocumentLink:n,docId:r}=e;return f.jsx(h.ErrorBoundary,{renderError:()=>f.jsx(ju,{title:"Failed to Load Linked Document Data",error:!0,onEdit:n,onUnlink:()=>Cu(t)}),children:f.jsx($.Suspense,{fallback:f.jsx(ju,{loading:!0,onEdit:n,onUnlink:()=>Cu(t)}),children:f.jsx(PBe,{docId:r,onEdit:n,onUnlink:()=>Cu(t)})})})}function NBe(e){const{url:t,editor:n,onEditWebLink:r}=e,i=Fr.toURL(t);return i?f.jsx(ju,{url:t,title:Fr.getUrlTitle(i),subTitle:t,onEdit:r,onUnlink:()=>Cu(n)}):f.jsx(ju,{url:t,subTitle:t,onEdit:r,onUnlink:()=>Cu(n)})}function qBe(e){const{media:t,editor:n,onEditMediaLink:r}=e;return Ce.FilledImageLinkContent.is(t)?f.jsx(Y7,{url:t.url,title:t.name,subTitle:`${t.width} x ${t.height} pixels`,onEdit:r,onUnlink:()=>Cu(n)}):Ce.FilledFileLinkContent.is(t)?f.jsx(ju,{url:t.url,title:t.name,subTitle:VBe({filename:t.name}),largeIconName:"insertDriveFile",onEdit:r,onUnlink:()=>Cu(n)}):null}function Cu(e){Ot(n=>n.unsetLink())(e)}function VBe(e){const{filename:t}=e,n=t.split(".").pop();return n?n.toLowerCase():""}function QBe(e){const{open:t}=e,{onOpenChange:n,onSelectDocument:r}=zBe(e);return f.jsx(Q7,{open:t,onOpenChange:n,onSelectDocument:r})}function zBe(e){const{editor:t,setOpen:n}=e;function r(o){Ot(s=>s.extendMarkRange(fe.RichTextNodeType.hyperlink).setDocumentLink({id:o}))(t),n(!1)}function i(o){n(o)}return{onSelectDocument:r,onOpenChange:i}}function HBe(e){const{open:t}=e,{onOpenChange:n,onMediaSelected:r}=YBe(e);return f.jsx(qR,{open:t,onOpenChange:n,onMediaSelected:r,assetType:"all"})}function YBe(e){const{editor:t,setOpen:n}=e;function r(i){Ot(a=>a.extendMarkRange(fe.RichTextNodeType.hyperlink).setMediaLink({media:i}))(t),n(!1)}return{onMediaSelected:r,onOpenChange:n}}function GBe(e){const{open:t,setOpen:n}=e,{url:r,setUrl:i,openInNewTab:o,setOpenInNewTab:a,disabled:s,onUpdate:u}=JBe(e);return f.jsxs(h.Dialog,{open:t,onOpenChange:n,size:"small",children:[f.jsx(h.DialogHeader,{title:"Set Link URL"}),f.jsxs(h.DialogContent,{padding:16,children:[f.jsx(h.FormInput,{value:r,onValueChange:i,placeholder:"Paste URL",icon:"public"}),r&&f.jsx(h.InlineLabel,{value:"Open in new tab",children:f.jsx(h.Checkbox,{checked:o,onCheckedChange:a})})]}),f.jsxs(h.DialogActions,{children:[f.jsx(h.DialogCancelButton,{}),f.jsx(h.DialogActionButton,{onClick:u,disabled:s,children:"Update"})]})]})}function JBe(e){const{editor:t,open:n,setOpen:r}=e,i=ZBe(t),[o,a]=$.useState(i.url),[s,u]=$.useState(i.openInNewTab);Ne.useOnChange(n,()=>{n&&(a(i.url),u(i.openInNewTab))});const c=!o||o===i.url&&s===i.openInNewTab;function l(){const d=s?"_blank":"_self";Ot(p=>p.extendMarkRange(fe.RichTextNodeType.hyperlink).setWebLink({href:o,target:d}))(t),r(!1)}return{url:o,setUrl:a,openInNewTab:s,disabled:c,setOpenInNewTab:u,onUpdate:l}}function ZBe(e){const t=e.getAttributes(fe.RichTextNodeType.hyperlink);return{url:t.href??"",openInNewTab:t.target==="_blank"}}function XBe(e){const{items:t,editor:n}=e;return t.length===0?null:f.jsxs(f.Fragment,{children:[f.jsx(h.ToolbarSeparator,{}),f.jsx(h.ToolbarToggleButtonGroup,{onValueChange:r=>{t.forEach(i=>{(i.isActive(n)&&!r.includes(i.nodeType)||!i.isActive(n)&&r.includes(i.nodeType))&&i.runCommands(n)})},type:"multiple",value:t.filter(r=>r.isActive(n)).map(r=>r.nodeType),children:t.map(r=>f.jsx(h.ToolbarToggleButtonGroupItem,{disabled:!r.runCommands(n,{can:!0}),startIcon:r.icon,value:r.nodeType},r.nodeType))},"mark")]})}function ePe(e){var r;const{items:t,editor:n}=e;return t.length===0?null:f.jsxs(h.DropdownMenu,{children:[f.jsx(h.DropdownMenuTrigger,{disabled:t.length===1,children:f.jsx(h.Button,{endIcon:"arrowDropDown",size:"small",color:"grey",children:((r=t.find(i=>i.isActive(n)))==null?void 0:r.text)??""})}),f.jsx(h.DropdownMenuContent,{align:"start",asPortal:!1,maxHeight:256,avoidCollisions:!1,children:t.map(i=>f.jsx(h.DropdownMenuItem,{onSelect:()=>{i.runCommands(n)},children:i.text},i.nodeType))})]})}function k1(e){return{duration:100,hideOnClick:!0,offset:e,placement:"top-start",appendTo:document.querySelector("body > div")??"parent"}}function tPe(e){const{editor:t,nodeTypes:n,labels:r}=e,[i,o]=$.useState(),a=n.includes(fe.RichTextNodeType.hyperlink),s=!i,{shouldShowBubbleMenu:u,shouldshowPopover:c}=rPe({editor:t}),[l,d]=$.useState(!0);$.useEffect(()=>{d(!1)},[]);function p(v){o(v?"webLink":void 0)}function A(v){o(v?"documentLink":void 0)}function m(v){o(v?"mediaLink":void 0)}return l?null:f.jsxs(f.Fragment,{children:[f.jsx(_1,{editor:t,tippyOptions:k1([-48,0]),shouldShow:u,children:s&&f.jsx(nPe,{editor:t,nodeTypes:n,labels:r,setModal:o})}),f.jsx(_1,{editor:t,tippyOptions:k1([-48,0]),shouldShow:v=>c(v,"hyperlink"),children:s&&f.jsx(DBe,{editor:t,onEditWebLink:()=>o("webLink"),onEditDocumentLink:()=>o("documentLink"),onEditMediaLink:()=>o("mediaLink")})}),f.jsx(_1,{editor:t,tippyOptions:k1([0,0]),shouldShow:v=>c(v,"label"),children:f.jsx(jBe,{editor:t})}),a&&f.jsxs(f.Fragment,{children:[f.jsx(GBe,{open:i==="webLink",setOpen:p,editor:t}),f.jsx(QBe,{open:i==="documentLink",setOpen:A,editor:t}),f.jsx(HBe,{open:i==="mediaLink",setOpen:m,editor:t})]})]})}function nPe(e){const{editor:t,nodeTypes:n,labels:r,setModal:i}=e,o=n.includes("hyperlink"),a=r.length>0,s=mm(VQ,n),u=mm(RBe,n),c=mm(OBe,n),l=s.length+u.length+c.length+Number(o);return l===0?null:f.jsxs(h.Toolbar,{children:[f.jsx(ePe,{items:s,editor:t}),a&&f.jsx(MBe,{labels:r,editor:t}),f.jsx(XBe,{items:u,editor:t}),o&&f.jsx(UBe,{editor:t,setModal:i}),f.jsx(kBe,{items:c,editor:t}),l>1&&f.jsxs(f.Fragment,{children:[f.jsx(h.ToolbarSeparator,{}),f.jsx(h.ToolbarButton,{onClick:()=>{t.chain().focus().clearNodes().unsetAllMarks().run()},startIcon:"formatClear"},"clear")]})]})}function rPe(e){const{editor:t}=e;function n(i){const{view:o,state:a,from:s,to:u}=i;if(!o.hasFocus())return!1;const{doc:c,selection:l}=a;return!(t.isActive(fe.RichTextNodeType.preformatted)||l.empty||c.textBetween(s,u).length===0)}function r(i,o){const{view:a,state:s,from:u,to:c}=i,l=a.state.doc.nodeAt(u),{doc:d,selection:p}=s;return!p.empty||d.textBetween(u,c).length>0?!1:!!(l!=null&&l.marks.some(m=>m.type.name===o))}return{shouldShowBubbleMenu:n,shouldshowPopover:r}}function iPe(e){const{content:t,field:n,id:r,readOnly:i}=e,o=oPe(n),a=t&&UC.converter(o.nodeExtensions).fromPrismic(o.schema,o.nodeTypes,t),s=Ne.useStableCallback(e.onContentChange),u=h.useEditor({content:a==null?void 0:a.toJSON(),editable:!i,editorProps:{attributes:{class:`${h.contentEditableClass} ${h.contentEditableMultilinePlaceholderClass}`,id:r,tabIndex:"0"}},extensions:o.allComponents,injectCSS:!1,onUpdate({editor:c}){if(c.isEmpty)return s(void 0);const l=UC.converter(o.nodeExtensions).toPrismic(c.state.doc);s(l)}},[o,i]);return f.jsxs(h.Field,{children:[f.jsx(h.FieldLabel,{htmlFor:r,children:nr(n)}),f.jsxs(h.FieldControl,{children:[u.isEditable&&f.jsx(tPe,{editor:u,nodeTypes:o.names.concat(e2e),labels:o.labels}),f.jsx(nUe,{editor:u,style:{flexGrow:1}})]})]})}function oPe(e){var n,r;const t=`${((n=e.config)==null?void 0:n.multi)??""}-${((r=e.config)==null?void 0:r.single)??""}`;return $.useMemo(()=>{var m;const{extensions:i,nodeTypes:o}=bUe(e.config),a=i.filter(aPe),s=i.flatMap(v=>v.richTextNodeTypes),u=i.map(v=>v.component),c=i.filter(sPe).map(v=>v.name),l=[...u,...V2e(e,a),t2e.configure({supportedExtensionNames:c}),ALe],d=l.map(v=>v.name),p=FMe(l),A=uPe((m=e.config)==null?void 0:m.labels);return{allComponents:l,extensionNames:d,nodeTypes:o,nodeExtensions:a,names:s,schema:p,labels:A}},[t])}function aPe(e){return e.extType===qc.Node}function sPe(e){return!(e.extType!==qc.Node||e.nodeType!==vl.Text||e.lockedFormat)}function uPe(e){return Array.from(e??[])}function cPe(e){var p,A;const{content:t,field:n,id:r,readOnly:i,onContentChange:o}=e,{placeholder:a,options:s}=n.config??{},u=!!(s!=null&&s.includes("")),c=dPe(n),l=lPe({content:t,placeholder:a,defaultValue:c,canHaveEmptyValue:u}),d=a&&c===void 0;return f.jsxs(h.Field,{children:[f.jsx(h.FieldIcon,{name:"arrowDropDownCircle"}),f.jsx(h.FieldLabel,{htmlFor:r,children:nr(n)}),f.jsx(h.FieldControl,{children:f.jsxs(h.Select,{id:r,size:"large",color:"grey",value:l,disabled:i,renderTrigger:()=>f.jsx(h.SelectGhostTrigger,{id:r}),onValueChange:m=>{o(fPe({value:m,placeholder:a}))},children:[d&&f.jsx(h.SelectItem,{value:a,children:a}),(A=(p=n.config)==null?void 0:p.options)==null?void 0:A.map(m=>f.jsx(h.SelectItem,{value:m||kO,children:m},m))]})})]})}function lPe(e){const{content:t,placeholder:n,defaultValue:r,canHaveEmptyValue:i}=e;let{value:o}=t??{};return o===""&&i?kO:(o===""&&(o=void 0),o??r??n)}function fPe(e){const{placeholder:t}=e;let{value:n}=e;if(n!==t)return n===kO&&(n=""),{__TYPE__:"FieldContent",type:"Select",value:n}}function dPe(e){var t,n;return((t=e.config)==null?void 0:t.default_value)===void 0||(n=e.config.options)==null?void 0:n[0]}const kO=" ";function pPe(e){const{id:t,readOnly:n,field:r,content:i,onContentChange:o}=e,a=i!=null&&i.value?ZC.dateFromISOString(i.value):void 0;return f.jsxs(h.Field,{children:[f.jsx(h.FieldIcon,{name:"event"}),f.jsx(h.FieldLabel,{id:t,children:nr(r)}),f.jsx(h.FieldControl,{children:f.jsx(h.Box,{padding:{left:4,right:12},width:"100%",flexDirection:"column",justifyContent:"center",children:f.jsx(h.DateInput,{mode:"date-time","aria-labelledby":t,disabled:n,value:a,onValueChange:s=>o(APe(s))})})})]})}function APe(e){if(e)return{__TYPE__:"FieldContent",type:"Timestamp",value:hPe(e)}}function hPe(e){const 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`}function cb(e){const{id:t,readOnly:n,content:r,nestableWidget:i}=e,o=Ne.useStableCallback(e.onContentChange);return $.useMemo(()=>{const a={id:t,readOnly:n,onContentChange:o};return i.type==="Boolean"?f.jsx(M$e,{...a,field:i,content:Ce.isBooleanContent(r)?r:void 0}):i.type==="Date"?f.jsx(B$e,{...a,field:i,content:Ce.isDateContent(r)?r:void 0}):i.type==="Timestamp"?f.jsx(pPe,{...a,field:i,content:Ce.isTimestampContent(r)?r:void 0}):i.type==="Image"?f.jsx(tOe,{...a,field:i,content:Ce.isImageContent(r)?r:void 0}):i.type==="Link"?f.jsx(Z7,{...a,field:i,content:Ce.isLinkContent(r)?r:void 0}):i.type==="Number"?f.jsx(gOe,{...a,field:i,content:Ce.isNumberContent(r)?r:void 0}):i.type==="StructuredText"?f.jsx(iPe,{...a,field:i,content:Ce.isRichTextContent(r)?r:void 0}):i.type==="Select"?f.jsx(cPe,{...a,field:i,content:Ce.isSelectContent(r)?r:void 0}):i.type==="Text"?f.jsx(hOe,{...a,field:i,content:Ce.isTextContent(r)?r:void 0}):i.type==="Embed"?f.jsx(Y$e,{...a,field:i,content:Ce.isEmbedContent(r)?r:void 0}):i.type==="Color"?f.jsx(j$e,{...a,field:i,content:Ce.isColorContent(r)?r:void 0}):i.type==="GeoPoint"?f.jsx(G$e,{...a,field:i,content:Ce.isGeoPointContent(r)?r:void 0}):i.type==="IntegrationFields"?f.jsx(AOe,{...a,field:i,content:Ce.isIntegrationFieldContent(r)?r:void 0}):null},[r,t,i,o,n])}function mPe(e){const{content:t,id:n,nonRepeatableZone:r,onContentChange:i,readOnly:o}=e,a=$.useMemo(()=>Object.entries(r),[r]);return f.jsx(f.Fragment,{children:a.map(([s,u])=>{const c=t[s];return f.jsx(cb,{id:`${n}.${s}`,readOnly:o,nestableWidget:u,content:Ce.isNestableContent(c)?c:void 0,onContentChange:l=>{i(gPe(t,s,l))}},s)})})}function gPe(e,t,n){return n?{...e,[t]:n}:Vl.removeKey(e,t)}function MO(e){var o,a;const{group:t,content:n,onContentChange:r,...i}=e;return f.jsx(LO,{...i,title:GC(t),addItemButtonTitle:`Add item in "${GC(t)}"`,repeatable:((o=t.config)==null?void 0:o.repeat)!==!1,repeatableZone:((a=t.config)==null?void 0:a.fields)??{},content:n==null?void 0:n.value,onContentChange:s=>{r({__TYPE__:"GroupContentType",value:s})}})}function GC(e){var t;return((t=e.config)==null?void 0:t.label)??e.fieldset??e.type}function QQ(e){const{id:t,readOnly:n,content:r,widget:i}=e,o=Ne.useStableCallback(e.onContentChange);return $.useMemo(()=>{const a={id:t,readOnly:n,onContentChange:o};return i.type==="Group"?f.jsx(MO,{...a,group:i,content:Ce.isGroupContent(r)?r:void 0}):f.jsx(cb,{...a,nestableWidget:i,content:Ce.isNestableContent(r)?r:void 0})},[r,t,i,o,n])}function LO(e){const{id:t,title:n,addItemButtonTitle:r,content:i,onContentChange:o,readOnly:a,repeatable:s=!0,repeatableZone:u}=e,c=Object.entries(u);let l=i??[bPe];!s&&l.length>1&&(l=l.slice(0,1));const{scrollOffsetTop:d}=Ee(),p=$.useRef(new WeakMap);vPe(p.current,l);function A(x){return p.current.get(x)??"!bugged!"}function m(){o(l.concat(JC()))}function v(x){const{index:g,offset:S}=x;o(Qt.move(l,g,g+S))}function _(x){const{index:g}=x;o(Qt.removeIndex(l,g))}function C(x){o(x)}function I(x,g,S,y){const T=SPe(x,[S,y]),w=CPe(l,[g,T]);yPe(p.current,x,T),o(w)}return Object.keys(u).length===0?null:f.jsx(h.Group,{title:n??"Repeatable zone",addItemButtonTitle:r??"Add item in repeatable zone",items:l,maxItems:s?void 0:1,getItemKey:A,onAddItem:m,dnd:{scrollOffsetTop:d,onReorder:C,renderDragPreview:({index:x})=>f.jsx(_Pe,{title:n??"Repeatable zone",index:x}),renderDropIndicator:IPe},children:(x,g)=>{const S=new Map(x.value),y=A(x);return f.jsx(h.LazyRender,{keepLoaded:!0,loadWhenSearching:!0,children:f.jsx(h.GroupItem,{index:g,title:`${g+1} • Item`,onMove:v,onDelete:_,children:c.map(([T,w])=>f.jsx(QQ,{id:`${t}[${y}].${T}`,content:S.get(T),widget:w,onContentChange:O=>I(x,g,T,O),readOnly:a},T))})})}})}function vPe(e,t){t.forEach(n=>{e.has(n)||e.set(n,iz.uniqueNumber())})}function yPe(e,t,n){const r=e.get(t);r!==void 0&&e.set(n,r)}const bPe={__TYPE__:"GroupItemContent",value:[]};function CPe(e,t){const[n,r]=t;return r?e.map((i,o)=>o===n?r:i):e.filter((i,o)=>o!==n)}function SPe(e,t){const[n,r]=t;if(!r){const o=e.value.filter(([a])=>a!==n);return JC(o)}const i=Array.from(new Map(e.value).set(n,r));return JC(i)}function JC(e=[]){return{__TYPE__:"GroupItemContent",value:e}}function _Pe(e){const{title:t,index:n}=e;return f.jsxs(h.Box,{padding:{block:8,inline:12},backgroundColor:"grey3",border:!0,borderRadius:6,alignItems:"center",justifyContent:"space-between",width:"100%",children:[f.jsxs("div",{children:[f.jsx(h.Text,{variant:"smallBold",color:"grey11",children:t??"Repeatable zone"}),f.jsxs(h.Text,{variant:"small",color:"grey11",children:[n+1," • Item"]})]}),f.jsx(h.Icon,{name:"dragIndicator",size:"small",color:"grey8"})]})}function IPe(e){const{isDropTarget:t,itemIndex:n,position:r}=e,i=t?f.jsx(h.Line,{color:"purple",thickness:2,sx:{position:"absolute",left:0,right:0,bottom:n===0&&r==="before"?0:void 0}},"line"):void 0;return f.jsx(h.AnimatedElement,{enterDuration:150,children:i})}function TPe(e){const{compositeSlice:t,content:n,onContentChange:r,sliceKey:i,id:o,readOnly:a,header:s}=e,u=z0();function c(){i&&u.update({id:i,requestedFrom:"sliceFieldSet"})}return f.jsxs(h.FieldSet,{id:i&&Q0("sliceFieldSet",i),selected:i?u.isSelected(i):!1,onFocus:c,legend:xPe(t),header:s,children:[f.jsx(mPe,{id:o,readOnly:a,nonRepeatableZone:t["non-repeat"]??{},content:n.nonRepeat,onContentChange:l=>{r({...n,nonRepeat:l})}}),f.jsx(LO,{id:o,readOnly:a,repeatableZone:t.repeat??{},content:n.repeat,onContentChange:l=>{r({...n,repeat:l})}})]})}function xPe(e){var t;return((t=e.config)==null?void 0:t.label)??e.fieldset??e.type}const zQ={__TYPE__:"ImageContent",edit:{background:"",crop:{x:0,y:0},zoom:0},height:0,width:0,origin:{height:0,width:0,id:"",url:""},url:""};function wPe(e){const{field:t}=e;if(t.type==="Image")return zQ}function EPe(e){const{content:t,legacySlice:n,sliceKey:r,id:i,readOnly:o,onContentChange:a,header:s}=e,u=z0();function c(){r&&u.update({id:r,requestedFrom:"sliceFieldSet"})}const l=n.type==="Group"?GC(n):nr(n);return f.jsx(h.FieldSet,{id:r&&Q0("sliceFieldSet",r),selected:r?u.isSelected(r):!1,onFocus:c,legend:l,header:s,children:n.type==="Group"?f.jsx(MO,{id:i,readOnly:o,onContentChange:a,group:n,content:Ce.isGroupContent(t)?t:void 0}):f.jsx(cb,{id:i,readOnly:o,nestableWidget:n,content:Ce.isNestableContent(t)?t:void 0,onContentChange:d=>{const p=wPe({field:n});!d&&p&&a(p),d&&a(d)}})})}function $Pe(e){const{content:t,id:n,slicePrimaryZone:r,onContentChange:i,readOnly:o}=e,a=$.useMemo(()=>Object.entries(r),[r]);return f.jsx(f.Fragment,{children:a.map(([s,u])=>{const c=t[s];return f.jsx(QQ,{id:`${n}.${s}`,readOnly:o,widget:u,content:Ce.isSlicePrimaryContent(c)?c:void 0,onContentChange:l=>{i(RPe(t,s,l))}},s)})})}function RPe(e,t,n){return n?{...e,[t]:n}:Vl.removeKey(e,t)}function HQ(e){const{config:t,content:n,sliceKey:r,readOnly:i=!1,sharedSlice:o,onContentChange:a,...s}=e,u=OPe(o,n.variation),c=$.useId(),d={id:s.id??c,readOnly:i},p=z0();function A(){r&&p.update({id:r,requestedFrom:"sliceFieldSet"})}return u===void 0?null:f.jsx(D0.Provider,{value:t,children:f.jsxs(h.FieldSet,{id:r&&Q0("sliceFieldSet",r),selected:r?p.isSelected(r):!1,onFocus:A,legend:FPe(o,u),children:[f.jsx(h.LazyRender,{heightEstimate:400,gap:16,keepLoaded:!0,loadWhenSearching:!0,children:f.jsx($Pe,{...d,slicePrimaryZone:u.primary??{},content:n.primary,onContentChange:m=>{a({...n,primary:m})}})}),f.jsx(LO,{...d,repeatableZone:u.items??{},content:n.items,onContentChange:m=>{a({...n,items:m})}})]})})}function OPe(e,t){return $.useMemo(()=>e.variations.find(n=>n.id===t),[e,t])}function FPe(e,t){return[e.name,t.name].join(" • ")}function PM(e){var u,c;const{sliceZone:t,onChange:n,slices:r,sliceContent:i}=e,o=(c=(u=t.config)==null?void 0:u.labels)==null?void 0:c[i.name];if(!o)return null;const a=o.find(l=>l.name===i.maybeLabel);function s(l){const d=r.value.map(p=>p.key===i.key?{...p,maybeLabel:l}:p);n({...r,value:d})}return f.jsxs(f.Fragment,{children:[f.jsx(h.Text,{component:"span",variant:"smallBold",children:"•"}),f.jsxs(h.DropdownMenu,{children:[f.jsx(h.DropdownMenuTrigger,{children:f.jsx(h.Button,{color:"grey",size:"small",endIcon:"arrowDropDown",invisible:!0,children:(a==null?void 0:a.display)??"Slice variation"})}),f.jsxs(h.DropdownMenuContent,{align:"start",maxHeight:256,children:[f.jsx(h.DropdownMenuItem,{onSelect:()=>s(void 0),endIcon:i.maybeLabel===void 0?f.jsx(h.Icon,{name:"check"}):void 0,children:"..."}),o==null?void 0:o.map(l=>f.jsx(h.DropdownMenuItem,{onSelect:()=>s(l.name),endIcon:l.name===i.maybeLabel?f.jsx(h.Icon,{name:"check"}):void 0,children:l.display??"[Missing display value]"},l.name))]})]})]})}function kPe(e){const{content:t,id:n,onContentChange:r,readOnly:i,sliceZone:o}=e,a=Ee();return f.jsx(f.Fragment,{children:t==null?void 0:t.value.map((s,u)=>{var p,A;const c=(A=(p=o.config)==null?void 0:p.choices)==null?void 0:A[s.name];if(c===void 0)return null;const l=s.widget,d={id:`${n}[${s.key}]`,key:s.key,sliceKey:s.key,onContentChange:m=>{const v={...s,widget:m},_=MPe(t,[u,v]);r(_)},readOnly:i};return c.type==="SharedSlice"?Ce.isSharedSliceContent(l)?f.jsx(HQ,{...d,config:a,sharedSlice:c,content:l}):null:c.type==="Slice"?Ce.isCompositeSliceContent(l)?f.jsx(TPe,{...d,compositeSlice:c,content:l,header:f.jsx(PM,{sliceContent:s,sliceZone:o,slices:t,onChange:r})}):null:Ce.isSimpleSliceContent(l)?f.jsx(EPe,{...d,legacySlice:c,content:l,header:f.jsx(PM,{sliceContent:s,sliceZone:o,slices:t,onChange:r})}):null})})}function MPe(e,[t,n]){return{__TYPE__:"SliceContentType",value:e.value.map((r,i)=>i===t?n:r)}}function LPe(e){const{id:t,field:n,content:r,onContentChange:i}=e,o=Ne.useDebounceState({state:(r==null?void 0:r.value)??"",synchronize:!0}),{onEditUID:a}=$.useContext(R7);function s(c){a();const l=Ep.slugify(c);i(BPe(l)),o.set(l)}function u(c){s(c.clipboardData.getData("Text").trim()),c.preventDefault()}return f.jsxs(h.Field,{children:[f.jsx(h.FieldIcon,{name:"tag"}),f.jsx(h.FieldLabel,{htmlFor:t,children:nr(n)}),f.jsx(h.FieldControl,{children:f.jsx(Qs,{id:t,variant:"success",placeholder:Wc(n,"Enter a unique identifier"),value:o.value,onPaste:u,onValueChange:s,endAdornment:f.jsx(h.AnimatedElement,{enterDuration:150,children:f.jsx(jPe,{uid:o.debouncedValue})})})})]})}function jPe(e){const{uid:t}=e,n=Ee();return t?n.uidField?f.jsx(h.ErrorBoundary,{children:f.jsx($.Suspense,{children:f.jsx(UPe,{uid:t})})}):null:f.jsx(h.Badge,{color:"tomato",title:"Required",size:"medium"})}function UPe(e){const t=PPe(e),n=Ee();if(!t.documentId)return null;const r=MR({status:t.status,releaseId:t.releaseId,documentId:t.documentId,versionId:t.versionId,baseUrl:n.baseUrl});return f.jsx("a",{href:r.href,target:"_blank",rel:"noreferrer",children:f.jsx(h.Badge,{color:"tomato",size:"medium",title:f.jsxs(h.Text,{color:"tomato11",variant:"small",children:["Value already used in"," ",f.jsx(h.Text,{color:"tomato11",variant:"small",underline:!0,children:"another document"})]})})})}function BPe(e){return e===""?void 0:{__TYPE__:"UIDContent",value:e}}function PPe(e){var A,m,v,_;const{uid:t}=e,n=Ee();n.uidField||Jt("uidField");const{coreApiBaseUrl:r,authStrategy:i,customTypeId:o,localeId:a,documentId:s}=n,u=BR({uid:[t]}),l=Ve.useRequest(UR,[r,i,u]).results,p=F7({customTypeId:o,languageId:a,documentsWithUid:l,documentId:s,uid:t})[0];return p?{documentId:p.id,versionId:(A=p.versions[0])==null?void 0:A.version_id,status:(m=p.versions[0])==null?void 0:m.status,releaseId:((v=p.versions[0])==null?void 0:v.status)==="release"?(_=p.versions[0])==null?void 0:_.release_id:void 0}:{}}function WPe(e){const{id:t,readOnly:n,staticZone:r,content:i,onContentChange:o}=e,a=$.useMemo(()=>Object.entries(r),[r]);return a.length===0?null:f.jsx(h.FieldSet,{legend:"Page data",children:a.map(([s,u])=>{const c={id:`${t}.${s}`,onContentChange:d=>{const{[s]:p,...A}=i;o({...A,...d!==void 0&&{[s]:d}})},readOnly:n},l=i[s];return u.type==="UID"?$.createElement(LPe,{...c,content:Ce.isUIDContent(l)?l:void 0,key:s,field:u}):u.type==="Group"?$.createElement(MO,{...c,content:Ce.isGroupContent(l)?l:void 0,group:u,key:s}):$.createElement(cb,{...c,content:Ce.isNestableContent(l)?l:void 0,key:s,nestableWidget:u})})})}function DPe(e){const{id:t,readOnly:n,section:r,content:i,onContentChange:o}=e,[a,s]=NPe(r),[u,c]=qPe(i);return f.jsxs("div",{style:{display:"flex",flexDirection:"column",position:"relative",zIndex:0},children:[f.jsx(WPe,{id:t,readOnly:n,staticZone:a,content:u,onContentChange:l=>o({...c,...l})}),s.map(([l,d])=>{const p=c[l];return f.jsx(kPe,{id:`${t}.${l}`,readOnly:n,sliceZone:d,content:p,onContentChange:A=>o({...u,...c,[l]:A})},l)})]})}function KPe(e){return e.type==="Choice"||e.type==="Slices"}function NPe(e){return Object.entries(e).reduce(([t,n],[r,i])=>(KPe(i)?n.push([r,i]):Object.assign(t,{[r]:i}),[t,n]),[{},[]])}function qPe(e){return Object.entries(e).reduce(([t,n],[r,i])=>{const o={[r]:i};return Object.assign(Ce.isSlicesContent(i)?n:t,o),[t,n]},[{},{}])}function VPe(e){const{config:t,readOnly:n=!1,customType:r,sectionName:i,content:o,onContentChange:a}=e,s=$.useId();if(Vl.isEmpty(r.json))return null;const u=QPe(r,i),[c,l]=zPe(u,o);return f.jsx(D0.Provider,{value:t,children:f.jsx(DPe,{id:s,readOnly:n,section:u,content:c,onContentChange:d=>a({...l,...d})})})}function QPe(e,t){const n=e.json[t];if(n===void 0)throw new Error(`Cannot find a section with name '${t}'.`);return n}function zPe(e,t){return Object.entries(t).reduce(([n,r],[i,o])=>{const a=e[i]!==void 0,s={[i]:o};return[{...n,...a?s:{}},{...r,...a?{}:s}]},[{},{}])}exports.DeferredCodeBlock=KM;exports.DocumentEditor=VPe;exports.EditorConfigContext=D0;exports.EditorErrorBoundary=pxe;exports.MediaLibrary=$7;exports.NewMediaLibraryFeaturesBanner=Eq;exports.OnboardingGuide=E$e;exports.SelectionManagerProvider=Rq;exports.SharedSliceEditor=HQ;exports.SliceSelectionContext=k7;exports.UIDContext=R7;exports.createSearchParams=N0;exports.defaultGroupContentWithOneItem=Iq;exports.defaultImageContentWidget=zQ;exports.documentKeys=Jo;exports.documentMetaOkType=jR;exports.documentSchema=Swe;exports.documentStatus=Tq;exports.frameworkLabels=DM;exports.getConflictingUidDocuments=F7;exports.getDocumentByDocumentId=Nq;exports.getDocumentList=Wq;exports.getDocuments=UR;exports.getEnrichedSearchDocuments=qq;exports.getOnboarding=$we;exports.getProfile=Xq;exports.getRepository=q0;exports.getRepositoryCustomTypes=Bq;exports.getRepositoryTags=Gq;exports.getSliceSelectionDOMId=Q0;exports.hasUIDField=O7;exports.invalidateDocumentListData=Twe;exports.isMissingUID=R$e;exports.isValidSimulatorURL=Yq;exports.languageOkType=LR;exports.makeGetDocumentsQueryString=BR;exports.makeSearchFullTextDocumentsQueryString=Kq;exports.onboardingStateSchema=Vq;exports.onboardingStepIdSchema=PR;exports.onboardingToggleResultSchema=zq;exports.onboardingToggleStepResultSchema=Qq;exports.prepareDocumentForSave=uxe;exports.profileResponse=Zq;exports.roleMap=Dwe;exports.searchDocumentStatus=xq;exports.searchFullTextDocuments=Dq;exports.sliceItemContentSchema=_we;exports.suppressErrors=gxe;exports.throwConfigError=Jt;exports.toggleOnboarding=Owe;exports.toggleOnboardingStep=Rwe;exports.updateDocumentListData=Iwe;exports.useProfile=WR;exports.useSelectionManager=Vs;exports.useSliceSelection=z0;
103
+ `);return!o||!a?!1:e.chain().command(({tr:s})=>(s.delete(r.pos-2,r.pos),!0)).exitCode().run()},ArrowDown:({editor:e})=>{if(!this.options.exitOnArrowDown)return!1;const{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;const s=i.after();return s===void 0?!1:r.nodeAt(s)?e.commands.command(({tr:c})=>(c.setSelection(ze.near(r.resolve(s))),!0)):e.commands.exitCode()}}},addInputRules(){return[$C({find:V2e,type:this.type,getAttributes:e=>({language:e[1]})}),$C({find:Q2e,type:this.type,getAttributes:e=>({language:e[1]})})]},addProseMirrorPlugins(){return[new zr({key:new eo("codeBlockVSCodeHandler"),props:{handlePaste:(e,t)=>{if(!t.clipboardData||this.editor.isActive(this.type.name))return!1;const n=t.clipboardData.getData("text/plain"),r=t.clipboardData.getData("vscode-editor-data"),i=r?JSON.parse(r):void 0,o=i==null?void 0:i.mode;if(!n||!o)return!1;const{tr:a,schema:s}=e.state,u=s.text(n.replace(/\r\n?/g,`
104
+ `));return a.replaceSelectionWith(this.type.create({language:o},u)),a.selection.$from.parent.type!==this.type&&a.setSelection(Be.near(a.doc.resolve(Math.max(0,a.selection.from-2)))),a.setMeta("paste",!0),e.dispatch(a),!0}}})]}}),vg=z2e.extend({name:"preformatted",addAttributes(){return{language:{default:null,parseHTML:e=>{var o;const{languageClassPrefix:t}=this.options,i=[...((o=e.firstElementChild)==null?void 0:o.classList)||[]].filter(a=>a.startsWith(t)).map(a=>a.replace(t,""))[0];return i||null},renderHTML:e=>e.language?{class:this.options.languageClassPrefix+e.language}:null}}},parseHTML(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML({HTMLAttributes:e}){return["pre",Et(this.options.HTMLAttributes),["code",e,0]]}}).configure({exitOnTripleEnter:!1}),H2e={fromPrismic(e){return function(t){var r;const n=Wu.converter.fromPrismic(e)(vg.name,t,!0);return(r=e.nodes[vg.name])==null?void 0:r.create(ua.fromPrismic(t),n)}},toPrismic(e){return Wu.converter.toPrismic(e,fe.RichTextNodeType.preformatted,ua.toPrismic(e))}},Y2e=new kh([fe.RichTextNodeType.preformatted],vg.name,vg,H2e,"",!0),EQ=Y2e;function $Q(e){const{editor:t,getPos:n,node:r}=e,[i,o]=$.useState(!1);return $.useEffect(()=>{function a(){const{from:u,to:c}=t.state.selection,l=n(),d=n()+r.nodeSize,p=u<=l&&c>=d;o(p)}function s(){o(!1)}return t.on("blur",s),t.on("selectionUpdate",a),()=>{t.off("blur",s),t.off("selectionUpdate",a)}},[t,n,r.nodeSize]),{selected:i}}function G2e(e,t,n){const{node:r}=e,i=r.attrs.content,o=Ne.useStableCallback(e.updateAttributes),a=Ne.useDebounceState({initialState:(i==null?void 0:i.embed_url)??"",startTransition:$.startTransition});function s(l){o({content:l})}function u(l){a.set(l),Fr.toURL(l)||s(void 0)}const{onKeyDown:c}=J2e(e,a.value,t,n);return{inputRef:t,containerRef:n,onKeyDown:c,url:a.value,urlChanged:u,onContentChange:s,debouncedUrl:a.debouncedValue,content:e.node.attrs.content}}function J2e(e,t,n,r){const{editor:i,getPos:o,node:a}=e,[s,u]=$.useState(!0);$.useEffect(()=>{!s||!e.editor.isFocused||h.handleEditorFlushSyncError(()=>{var l;return(l=n.current)==null?void 0:l.focus()})},[n,s,e.editor.isFocused]);function c(l){const d=o(),p=o()+a.nodeSize;l.code==="Enter"&&(u(!1),i.chain().insertContentAt(p,{type:"paragraph"}).focus(p+1).run()),l.code==="Backspace"&&t===""&&i.chain().deleteRange({from:d,to:p}).focus(p+1).run(),l.code==="ArrowUp"&&(u(!1),i.chain().focus(d-1).run()),l.code==="ArrowDown"&&(u(!1),i.chain().focus(p+1).run())}return{containerRef:r,inputRef:n,onKeyDown:c}}function Z2e(e){const t=$.useRef(null),n=$.useRef(null),{onKeyDown:r,url:i,urlChanged:o,onContentChange:a,debouncedUrl:s,content:u}=G2e(e,t,n),{selected:c}=$Q(e);return f.jsx(tQ,{className:"custom-embed",children:f.jsxs("div",{contentEditable:"false",suppressContentEditableWarning:!0,children:[f.jsxs(h.Box,{flexGrow:1,alignItems:"center",children:[f.jsx(h.Icon,{size:"small",name:"cloud",color:"grey11"}),f.jsx(h.Box,{flexGrow:1,height:40,ref:n,children:f.jsx(Qs,{id:"id",ref:t,value:i,variant:Fr.toURL(i)?"link":"normal",placeholder:"Paste your link here",onValueChange:o,onKeyDown:r})})]}),Fr.toURL(i)&&f.jsx(L7,{selected:c,debouncedUrl:s,onContentChange:a,content:u})]})})}const qC=jn.create({name:"embed",group:"block",atom:!0,content:"block*",marks:"",addAttributes(){return{content:{default:void 0}}},addCommands(){return{setEmbed:()=>({tr:e,dispatch:t})=>{const n=this.type.create();return t&&e.replaceSelectionWith(n),!0}}},parseHTML(){return[{tag:"embed"}]},renderHTML(){return["embed"]},addNodeView(){return rQ(Z2e)}}),X2e={fromPrismic(e){return function(t){var n;return(n=e.nodes[qC.name])==null?void 0:n.create({content:t.data})}},toPrismic(e){return e.attrs.content===void 0?{type:"embed",data:{type:"embed",embed_url:"",__TYPE__:"EmbedContent",all:[]}}:{type:"embed",data:{...e.attrs.content}}}},RQ=new dUe([fe.RichTextNodeType.embed],qC.name,qC,X2e),eBe=jn.create({name:"heading",addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:"inline*",group:"block",defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(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]}`,Et(this.options.HTMLAttributes,t),0]},addCommands(){return{setHeading:e=>({commands:t})=>this.options.levels.includes(e.level)?t.setNode(this.name,e):!1,toggleHeading:e=>({commands:t})=>this.options.levels.includes(e.level)?t.toggleNode(this.name,"paragraph",e):!1}},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=>$C({find:new RegExp(`^(#{1,${e}})\\s$`),type:this.type,getAttributes:{level:e}}))}}),VC="heading";function ub(e){switch(e){case 1:return fe.RichTextNodeType.heading1;case 2:return fe.RichTextNodeType.heading2;case 3:return fe.RichTextNodeType.heading3;case 4:return fe.RichTextNodeType.heading4;case 5:return fe.RichTextNodeType.heading5;case 6:return fe.RichTextNodeType.heading6}}function LM(e){return{fullName:ub(e),level:e}}const OQ=[1,2,3,4,5,6];function FQ(e,t=OQ){const n=new RegExp(`^heading([${t.join(",")}]){1}$`),r=e.match(n);if(!r||!r[1])return;const i=parseInt(r[1]);return{fullName:ub(i),level:i}}function kQ(e,t){const n=e.level;if(t.includes(n))return{fullName:ub(n),level:n}}const tBe=e=>{const t=e[0]??1;return{fromPrismic(n){return function(r){var a;const i=Wu.converter.fromPrismic(n)(VC,r),o=FQ(r.type,e)||LM(t);return(a=n.nodes[VC])==null?void 0:a.create({level:o.level,...ua.fromPrismic(r)},i)}},toPrismic(n){const{fullName:r}=kQ(n.attrs,e)||LM(t);return Wu.converter.toPrismic(n,r,ua.toPrismic(n))}}};function nBe(e){return e?e.size?Array.from(e.values()).reduce((n,r)=>{const i=FQ(r);return i?[...n,i.level]:n},[]).sort((n,r)=>n-r):[]:OQ}function rBe(e){return eBe.extend({name:"heading"}).configure({levels:e})}const ru={name:VC,build:e=>{const t=nBe(e);if(!t)return;const n=t.map(r=>ub(r));return new AUe(n,rBe(t),t,tBe(t),r=>{const i=kQ(r,t);return i&&`Heading ${i.level}`})}};function iBe(e){const{content:t,thumbnail:n,imageViewProps:{getPos:r,updateAttributes:i,editor:o,node:a}}=e,[s,u]=$.useTransition();function c(A){u(()=>i({content:A}))}function l(A){const m=rm(A),v=r()+a.nodeSize;c({...t,...m}),o.chain().focus(v+1).run()}function d({croppedImages:A}){if(!t)return;const m=A[n.name];if(!m)return;const v=N7({content:t,croppedImage:m});v!==t&&c(v)}function p(){const A=r(),m=r()+a.nodeSize;o.chain().deleteRange({from:A,to:m}).focus(m).run()}return{onMediaSelected:l,onCropperDialogClose:d,isUpdating:s,updateContent:c,onClear:p}}function oBe(e){const{node:t}=e,n=t.attrs.content,{selected:r}=$Q(e),i=$.useRef(null),o={width:void 0,height:void 0,name:md},{onMediaSelected:a,onCropperDialogClose:s,isUpdating:u,updateContent:c,onClear:l}=iBe({content:n,thumbnail:o,imageViewProps:e}),[d,p]=$.useState(!1),A="Feature image",m=(n==null?void 0:n.width)===0&&(n==null?void 0:n.height)===0,v=n&&!m?[`${n.width}×${n.height}px`]:[],_={thumbnail:o,contentView:n,labels:sC(o,n,n)};return $.useLayoutEffect(()=>{var I;const C=(I=i==null?void 0:i.current)==null?void 0:I.closest(`.${MQ}`);_d.isHTMLElement(C)&&C.style.removeProperty("height")},[]),f.jsx(tQ,{children:f.jsx(D7,{ref:i,isMediaDialogOpen:d,selected:r,onMediaSelected:a,onMediaDialogOpenChange:p,children:f.jsx($.Suspense,{fallback:uBe,children:n!=null&&n.url?f.jsx(e8,{allContentViews:[n],content:n,contentView:n,fieldLabel:A,imageLabel:v,initialImages:[_],isUpdating:u,readOnly:!1,thumbnailName:o.name,onClear:l,onContentChange:c,onCropperDialogClose:s,onMediaDialogOpenChange:p}):f.jsx(B7,{fieldLabel:A,isUpdating:u,readOnly:!1,onMediaDialogOpenChange:p})})})})}const MQ="imageViewNodeWrapper",LQ=144,aBe=94;function sBe(e){return(e?aBe:LQ)+12+12+1+1}const uBe=f.jsx("div",{style:{height:LQ}}),QC=jn.create({name:"image",group:"block",atom:!0,addAttributes(){return{content:{default:void 0}}},addCommands(){return{setImage:()=>e=>{const{dispatch:t,tr:n}=e,r=this.type.create();return t&&n.replaceSelectionWith(r),!0}}},parseHTML(){return[{tag:"image"}]},renderHTML({HTMLAttributes:e}){return["image",e]},addNodeView(){return function(t){const n=t.node.attrs.content===void 0;return rQ(oBe,{attrs:{style:`height: ${sBe(n)}px`,class:MQ}})(t)}}}),cBe={fromPrismic(e){return function(t){var n;return(n=e.nodes[QC.name])==null?void 0:n.create({content:t.data})}},toPrismic(e){if(e.attrs.content!==void 0)return{type:"image",data:{...e.attrs.content}}}},jQ=new pUe([fe.RichTextNodeType.image],QC.name,QC,cBe),lBe=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,fBe=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,dBe=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,pBe=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,ABe=Nc.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:e=>e.style.fontStyle!=="normal"&&null},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:e}){return["em",Et(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[ig({find:lBe,type:this.type}),ig({find:dBe,type:this.type})]},addPasteRules(){return[ag({find:fBe,type:this.type}),ag({find:pBe,type:this.type})]}});class hBe{constructor(t,n,r){Rn(this,"extType",qc.Mark);Rn(this,"richTextNodeTypes",[fe.RichTextNodeType.em]);this.name=t,this.component=n,this.converter=r}}const UQ="em",BQ=ABe.extend({name:UQ}),mBe={fromPrismic(e){return function(){var t;return(t=e.marks[BQ.name])==null?void 0:t.create()}},toPrismic(){}},gBe=new hBe(UQ,BQ,mBe),OO=gBe;class vBe{constructor(t,n,r){Rn(this,"extType",qc.Mark);Rn(this,"richTextNodeTypes",[]);this.name=t,this.component=n,this.converter=r}}const PQ="label",zC=Nc.create({name:PQ,priority:1e3,keepOnSplit:!1,inclusive:!1,addOptions(){return{htmlAttributes:{style:"background-color: hsl(251, 89%, 96%); border: 1px dashed rgba(68, 53, 146, 0.4); border-radius: 0px 2px 2px 2px"}}},addAttributes(){return{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",Et(this.options.htmlAttributes,e),0]}}),yBe={fromPrismic(e){return function(t){var i;const n=t.data,r={type:zC.name,label:n};return(i=e.marks[zC.name])==null?void 0:i.create(r)}},toPrismic(e){return e.attrs.label}},FO=new vBe(PQ,zC,yBe);class bBe{constructor(t,n,r){Rn(this,"extType",qc.Mark);Rn(this,"richTextNodeTypes",[fe.RichTextNodeType.hyperlink]);this.name=t,this.component=n,this.converter=r}}const WQ="hyperlink",Vo=Nc.create({name:WQ,priority:1e3,keepOnSplit:!1,inclusive:!1,addOptions(){return{openOnClick:!1,linkOnPaste:!0,autolink:!0,protocols:[],htmlAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null,id:""},validate:void 0}},addAttributes(){return{href:{default:""},id:{default:""},target:{default:"_blank"},rel:{default:"noopener noreferrer nofollow"},class:{default:null},media:{default:null}}},parseHTML(){return[{tag:'a[href]:not([href *= "javascript:" i])'}]},renderHTML({HTMLAttributes:e}){return["a",Et(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})=>{const n=HC(J7({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()}}}),CBe={fromPrismic(e){return function(t){var r,i,o,a;const n=t.data;if(n.__TYPE__==="DocumentLink"){const s={type:Vo.name,id:n.id};return(r=e.marks[Vo.name])==null?void 0:r.create(s)}if(n.__TYPE__==="ImageLink"){const s={type:Vo.name,media:HC(n)};return(i=e.marks[Vo.name])==null?void 0:i.create(s)}if(n.__TYPE__==="FileLink"){const s={type:Vo.name,media:HC(n)};return(o=e.marks[Vo.name])==null?void 0:o.create(s)}if(n.__TYPE__==="ExternalLink"){const s={type:Vo.name,url:n.url,href:n.url,target:n.target};return(a=e.marks[Vo.name])==null?void 0:a.create(s)}}},toPrismic(e){return e.attrs.media?KQ(e.attrs.media):e.attrs.id?{__TYPE__:"DocumentLink",id:e.attrs.id}:{__TYPE__:"ExternalLink",url:e.attrs.href,target:e.attrs.target}}},DQ=new bBe(WQ,Vo,CBe);function HC(e){return JSON.stringify(e)}function KQ(e){return JSON.parse(e)}const SBe=jn.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:e}){return["li",Et(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)}}}),jM=Nc.create({name:"textStyle",priority:101,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"span",getAttrs:e=>e.hasAttribute("style")?{}:!1}]},renderHTML({HTMLAttributes:e}){return["span",Et(this.options.HTMLAttributes,e),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:e,commands:t})=>{const n=pO(e,this.type);return Object.entries(n).some(([,i])=>!!i)?!0:t.unsetMark(this.name)}}}}),UM=/^(\d+)\.\s$/,_Be=jn.create({name:"orderedList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes(){return{start:{default:1,parseHTML:e=>e.hasAttribute("start")?parseInt(e.getAttribute("start")||"",10):1},type:{default:void 0,parseHTML:e=>e.getAttribute("type")}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:e}){const{start:t,...n}=e;return t===1?["ol",Et(this.options.HTMLAttributes,n),0]:["ol",Et(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(SBe.name,this.editor.getAttributes(jM.name)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let e=og({find:UM,type:this.type,getAttributes:t=>({start:+t[1]}),joinPredicate:(t,n)=>n.childCount+n.attrs.start===+t[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(e=og({find:UM,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:t=>({start:+t[1],...this.editor.getAttributes(jM.name)}),joinPredicate:(t,n)=>n.childCount+n.attrs.start===+t[1],editor:this.editor})),[e]}}),YC=_Be.extend({name:"orderedList",addAttributes(){return{start:{default:1,parseHTML:e=>e.hasAttribute("start")?parseInt(e.getAttribute("start")||"",10):1}}},renderHTML({HTMLAttributes:e}){const{start:t,...n}=e;return t===1?["ol",Et(this.options.HTMLAttributes,n),0]:["ol",Et(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"}),IBe={fromPrismic(e){return function(t){var r;const n=Nl.converter.fromPrismic(e)(t);if(n)return(r=e.nodes[YC.name])==null?void 0:r.create(ua.fromPrismic(t),n)}},toPrismic(e){return Pu.children.map(e,t=>Nl.converter.toPrismic(t,fe.RichTextNodeType.orderedList).filter(io.isDefined)).flat()}},TBe=new IO([fe.RichTextNodeType.orderedList],YC.name,YC,IBe),yg=TBe,NQ=[TO,OO,DQ,FO];function qQ(e){return[ao,gg,yg,ru.build(e),EQ,RQ,jQ,...NQ].filter(io.isDefined)}const VQ=[{nodeType:fe.RichTextNodeType.paragraph,icon:"textFields",isActive:e=>e.isActive(ao.name)&&!e.isActive(gg.name)&&!e.isActive(yg.name),runCommands:Ot((e,t)=>e.clearNodes().setDirection(Si(t))),shortText:"par",text:"Paragraph"},{nodeType:fe.RichTextNodeType.heading1,icon:"looks1",isActive:e=>e.isActive(ru.name,{level:1}),runCommands:Ot((e,t)=>e.setHeading({level:1}).setDirection(Si(t))),shortText:"h1",text:"Heading 1"},{nodeType:fe.RichTextNodeType.heading2,icon:"looks2",isActive:e=>e.isActive(ru.name,{level:2}),runCommands:Ot((e,t)=>e.setHeading({level:2}).setDirection(Si(t))),shortText:"h2",text:"Heading 2"},{nodeType:fe.RichTextNodeType.heading3,icon:"looks3",isActive:e=>e.isActive(ru.name,{level:3}),runCommands:Ot((e,t)=>e.setHeading({level:3}).setDirection(Si(t))),shortText:"h3",text:"Heading 3"},{nodeType:fe.RichTextNodeType.heading4,icon:"looks4",isActive:e=>e.isActive(ru.name,{level:4}),runCommands:Ot((e,t)=>e.setHeading({level:4}).setDirection(Si(t))),shortText:"h4",text:"Heading 4"},{nodeType:fe.RichTextNodeType.heading5,icon:"looks5",isActive:e=>e.isActive(ru.name,{level:5}),runCommands:Ot((e,t)=>e.setHeading({level:5}).setDirection(Si(t))),shortText:"h5",text:"Heading 5"},{nodeType:fe.RichTextNodeType.heading6,icon:"looks6",isActive:e=>e.isActive(ru.name,{level:6}),runCommands:Ot((e,t)=>e.setHeading({level:6}).setDirection(Si(t))),shortText:"h6",text:"Heading 6"},{nodeType:fe.RichTextNodeType.list,icon:"formatListBulleted",isActive:e=>e.isActive(gg.name),runCommands:Ot((e,t)=>e.toggleBulletList().setDirection(Si(t))),shortText:"bull",text:"Bulleted list"},{nodeType:fe.RichTextNodeType.orderedList,icon:"formatListNumbered",isActive:e=>e.isActive(yg.name),runCommands:Ot((e,t)=>e.toggleOrderedList().setDirection(Si(t))),shortText:"num",text:"Numbered list"},{nodeType:fe.RichTextNodeType.preformatted,icon:"dataObject",isActive:e=>e.isActive(EQ.name),runCommands:Ot((e,t)=>e.setCodeBlock().setDirection(Si(t))),shortText:"code",text:"Code"},{nodeType:fe.RichTextNodeType.embed,icon:"cloud",isActive:e=>e.isActive(RQ.name),runCommands:Ot(e=>e.setEmbed()),shortText:"emb",text:"Embed"},{nodeType:fe.RichTextNodeType.image,icon:"image",isActive:e=>e.isActive(jQ.name),runCommands:Ot(e=>e.setImage()),shortText:"img",text:"Image"}],xBe=[{nodeType:fe.RichTextNodeType.strong,icon:"formatBold",isActive:e=>e.isActive(TO.name),runCommands:Ot(e=>e.toggleBold())},{nodeType:fe.RichTextNodeType.em,icon:"formatItalic",isActive:e=>e.isActive(OO.name),runCommands:Ot(e=>e.toggleItalic())}],wBe=[{nodeType:fe.RichTextNodeType.rtl,icon:"formatTextDirectionRToL",isActive:e=>e.isActive({[Ho]:lu}),runCommands:Ot((e,t)=>e.toggleDirection(Si(t)))}];function Ot(e){return(t,n={})=>{let r=n.can===!0?t.can().chain():t.chain().focus();return n.deleteRange!==void 0&&(r=r.deleteRange(n.deleteRange)),n.can?EBe(t,r,e):e(r,t).run()}}function Si(e){const t=e.state.selection.$from.parent.attrs;return ua.parseNodeAttrsDirection(t)}function mm(e,t){return e.filter(n=>t.includes(n.nodeType))}function EBe(e,t,n){try{return n(t,e).run()}catch{return!1}}function $Be(e){const{items:t,editor:n}=e;return t.length===0?null:f.jsxs(f.Fragment,{children:[f.jsx(h.ToolbarSeparator,{}),t.map(r=>f.jsx(h.ToolbarToggleButton,{disabled:!r.runCommands(n,{can:!0}),onPressedChange:()=>{r.runCommands(n)},pressed:r.isActive(n),startIcon:r.icon},r.nodeType))]})}function RBe(e){const{labels:t,editor:n}=e,r=n.getAttributes("label").label;return f.jsxs(f.Fragment,{children:[f.jsx(h.ToolbarSeparator,{}),f.jsxs(h.DropdownMenu,{children:[f.jsx(h.DropdownMenuTrigger,{disabled:t.length===0,children:f.jsx(h.Button,{endIcon:"arrowDropDown",size:"small",color:"grey",children:BM(r??"Labels")})}),f.jsx(h.DropdownMenuContent,{align:"start",asPortal:!1,maxHeight:256,avoidCollisions:!1,children:t.map((i,o)=>{const a=r===i;return f.jsx(h.DropdownMenuItem,{onSelect:()=>a?n.commands.unsetLabel():OBe(n,i),endIcon:a&&f.jsx(h.Icon,{name:"check",size:"extraSmall"}),children:BM(i)},`${i}-${o}`)})})]})]})}function OBe(e,t){Ot(r=>r.setLabel({label:t}))(e)}function BM(e){return Ep.overflow(e,20)}function FBe(e){const{editor:t}=e,n=t.getAttributes("label");if(!n.label)return null;const r=n.label;return f.jsx(h.Box,{backgroundColor:"purple9",padding:{block:2,inline:4},alignItems:"center",borderRadius:{topLeft:2,topRight:2,bottomRight:2},maxWidth:125,children:f.jsx(h.Text,{color:"white",variant:"small",noWrap:!0,children:r})})}function kBe(e){const{disabled:t,showWebLinkModal:n,showDocumentsLinkModal:r,showMediaLinkModal:i}=MBe(e);return f.jsxs(f.Fragment,{children:[f.jsx(h.ToolbarSeparator,{}),f.jsxs(h.ToolbarButtonGroup,{density:"compact",children:[f.jsx(h.ToolbarButton,{disabled:t,startIcon:"link",onClick:n},fe.RichTextNodeType.hyperlink),f.jsxs(h.DropdownMenu,{children:[f.jsx(h.DropdownMenuTrigger,{children:f.jsx(h.ToolbarButton,{startIcon:"arrowDropDown"})}),f.jsxs(h.DropdownMenuContent,{align:"end",asPortal:!1,children:[f.jsx(h.DropdownMenuItem,{startIcon:f.jsx(h.Icon,{name:"public"}),onSelect:n,children:"Link to web page"}),f.jsx(h.DropdownMenuItem,{startIcon:f.jsx(h.Icon,{name:"description"}),onSelect:r,children:"Link to document"}),f.jsx(h.DropdownMenuItem,{startIcon:f.jsx(h.Icon,{name:"image"}),onSelect:i,children:"Link to media"})]})]})]})]})}function MBe(e){const{editor:t,setModal:n}=e;function r(){n("webLink")}function i(){n("documentLink")}function o(){n("mediaLink")}return{disabled:!Ot(s=>s.setWebLink({href:""}))(t,{can:!0}),showWebLinkModal:r,showDocumentsLinkModal:i,showMediaLinkModal:o}}function LBe(e){const{docId:t,onEdit:n,onUnlink:r}=e,i=jBe(t),o=Ee();if(!i)return null;const a=i.versions[0],s=MR({status:a==null?void 0:a.status,releaseId:(a==null?void 0:a.status)==="release"?a.release_id:void 0,documentId:i.id,versionId:a==null?void 0:a.version_id,baseUrl:o.baseUrl}),u=(a==null?void 0:a.preview_summary)??"",c=(a==null?void 0:a.custom_type_label)??"";return f.jsx(ju,{url:s,title:i.title,subTitle:c,description:u,onEdit:n,onUnlink:r,largeIconName:"description"})}function jBe(e){const t=Ee();t.searchDocuments||Jt("searchDocuments");const{coreApiBaseUrl:n,authStrategy:r}=t;return Ve.useRequest(Nq,[n,r,e])}function UBe(e){const{editor:t}=e,{searchDocuments:n}=Ee(),r=t.getAttributes(fe.RichTextNodeType.hyperlink);if(r.id&&n){const i=r.id;return f.jsx(BBe,{docId:i,...e})}if(r.href){const i=r.href;return f.jsx(PBe,{url:i,...e})}if(r.media){const i=KQ(r.media);return f.jsx(WBe,{media:i,...e})}return null}function BBe(e){const{editor:t,onEditDocumentLink:n,docId:r}=e;return f.jsx(h.ErrorBoundary,{renderError:()=>f.jsx(ju,{title:"Failed to Load Linked Document Data",error:!0,onEdit:n,onUnlink:()=>Cu(t)}),children:f.jsx($.Suspense,{fallback:f.jsx(ju,{loading:!0,onEdit:n,onUnlink:()=>Cu(t)}),children:f.jsx(LBe,{docId:r,onEdit:n,onUnlink:()=>Cu(t)})})})}function PBe(e){const{url:t,editor:n,onEditWebLink:r}=e,i=Fr.toURL(t);return i?f.jsx(ju,{url:t,title:Fr.getUrlTitle(i),subTitle:t,onEdit:r,onUnlink:()=>Cu(n)}):f.jsx(ju,{url:t,subTitle:t,onEdit:r,onUnlink:()=>Cu(n)})}function WBe(e){const{media:t,editor:n,onEditMediaLink:r}=e;return Ce.FilledImageLinkContent.is(t)?f.jsx(Y7,{url:t.url,title:t.name,subTitle:`${t.width} x ${t.height} pixels`,onEdit:r,onUnlink:()=>Cu(n)}):Ce.FilledFileLinkContent.is(t)?f.jsx(ju,{url:t.url,title:t.name,subTitle:DBe({filename:t.name}),largeIconName:"insertDriveFile",onEdit:r,onUnlink:()=>Cu(n)}):null}function Cu(e){Ot(n=>n.unsetLink())(e)}function DBe(e){const{filename:t}=e,n=t.split(".").pop();return n?n.toLowerCase():""}function KBe(e){const{open:t}=e,{onOpenChange:n,onSelectDocument:r}=NBe(e);return f.jsx(Q7,{open:t,onOpenChange:n,onSelectDocument:r})}function NBe(e){const{editor:t,setOpen:n}=e;function r(o){Ot(s=>s.extendMarkRange(fe.RichTextNodeType.hyperlink).setDocumentLink({id:o}))(t),n(!1)}function i(o){n(o)}return{onSelectDocument:r,onOpenChange:i}}function qBe(e){const{open:t}=e,{onOpenChange:n,onMediaSelected:r}=VBe(e);return f.jsx(qR,{open:t,onOpenChange:n,onMediaSelected:r,assetType:"all"})}function VBe(e){const{editor:t,setOpen:n}=e;function r(i){Ot(a=>a.extendMarkRange(fe.RichTextNodeType.hyperlink).setMediaLink({media:i}))(t),n(!1)}return{onMediaSelected:r,onOpenChange:n}}function QBe(e){const{open:t,setOpen:n}=e,{url:r,setUrl:i,openInNewTab:o,setOpenInNewTab:a,disabled:s,onUpdate:u}=zBe(e);return f.jsxs(h.Dialog,{open:t,onOpenChange:n,size:"small",children:[f.jsx(h.DialogHeader,{title:"Set Link URL"}),f.jsxs(h.DialogContent,{padding:16,children:[f.jsx(h.FormInput,{value:r,onValueChange:i,placeholder:"Paste URL",icon:"public"}),r&&f.jsx(h.InlineLabel,{value:"Open in new tab",children:f.jsx(h.Checkbox,{checked:o,onCheckedChange:a})})]}),f.jsxs(h.DialogActions,{children:[f.jsx(h.DialogCancelButton,{}),f.jsx(h.DialogActionButton,{onClick:u,disabled:s,children:"Update"})]})]})}function zBe(e){const{editor:t,open:n,setOpen:r}=e,i=HBe(t),[o,a]=$.useState(i.url),[s,u]=$.useState(i.openInNewTab);Ne.useOnChange(n,()=>{n&&(a(i.url),u(i.openInNewTab))});const c=!o||o===i.url&&s===i.openInNewTab;function l(){const d=s?"_blank":"_self";Ot(p=>p.extendMarkRange(fe.RichTextNodeType.hyperlink).setWebLink({href:o,target:d}))(t),r(!1)}return{url:o,setUrl:a,openInNewTab:s,disabled:c,setOpenInNewTab:u,onUpdate:l}}function HBe(e){const t=e.getAttributes(fe.RichTextNodeType.hyperlink);return{url:t.href??"",openInNewTab:t.target==="_blank"}}function YBe(e){const{items:t,editor:n}=e;return t.length===0?null:f.jsxs(f.Fragment,{children:[f.jsx(h.ToolbarSeparator,{}),f.jsx(h.ToolbarToggleButtonGroup,{onValueChange:r=>{t.forEach(i=>{(i.isActive(n)&&!r.includes(i.nodeType)||!i.isActive(n)&&r.includes(i.nodeType))&&i.runCommands(n)})},type:"multiple",value:t.filter(r=>r.isActive(n)).map(r=>r.nodeType),children:t.map(r=>f.jsx(h.ToolbarToggleButtonGroupItem,{disabled:!r.runCommands(n,{can:!0}),startIcon:r.icon,value:r.nodeType},r.nodeType))},"mark")]})}function GBe(e){var r;const{items:t,editor:n}=e;return t.length===0?null:f.jsxs(h.DropdownMenu,{children:[f.jsx(h.DropdownMenuTrigger,{disabled:t.length===1,children:f.jsx(h.Button,{endIcon:"arrowDropDown",size:"small",color:"grey",children:((r=t.find(i=>i.isActive(n)))==null?void 0:r.text)??""})}),f.jsx(h.DropdownMenuContent,{align:"start",asPortal:!1,maxHeight:256,avoidCollisions:!1,children:t.map(i=>f.jsx(h.DropdownMenuItem,{onSelect:()=>{i.runCommands(n)},children:i.text},i.nodeType))})]})}function k1(e){return{duration:100,hideOnClick:!0,offset:e,placement:"top-start",appendTo:document.querySelector("body > div")??"parent"}}function JBe(e){const{editor:t,nodeTypes:n,labels:r}=e,[i,o]=$.useState(),a=n.includes(fe.RichTextNodeType.hyperlink),s=!i,{shouldShowBubbleMenu:u,shouldshowPopover:c}=XBe({editor:t}),[l,d]=$.useState(!0);$.useEffect(()=>{d(!1)},[]);function p(v){o(v?"webLink":void 0)}function A(v){o(v?"documentLink":void 0)}function m(v){o(v?"mediaLink":void 0)}return l?null:f.jsxs(f.Fragment,{children:[f.jsx(_1,{editor:t,tippyOptions:k1([-48,0]),shouldShow:u,children:s&&f.jsx(ZBe,{editor:t,nodeTypes:n,labels:r,setModal:o})}),f.jsx(_1,{editor:t,tippyOptions:k1([-48,0]),shouldShow:v=>c(v,"hyperlink"),children:s&&f.jsx(UBe,{editor:t,onEditWebLink:()=>o("webLink"),onEditDocumentLink:()=>o("documentLink"),onEditMediaLink:()=>o("mediaLink")})}),f.jsx(_1,{editor:t,tippyOptions:k1([0,0]),shouldShow:v=>c(v,"label"),children:f.jsx(FBe,{editor:t})}),a&&f.jsxs(f.Fragment,{children:[f.jsx(QBe,{open:i==="webLink",setOpen:p,editor:t}),f.jsx(KBe,{open:i==="documentLink",setOpen:A,editor:t}),f.jsx(qBe,{open:i==="mediaLink",setOpen:m,editor:t})]})]})}function ZBe(e){const{editor:t,nodeTypes:n,labels:r,setModal:i}=e,o=n.includes("hyperlink"),a=r.length>0,s=mm(VQ,n),u=mm(xBe,n),c=mm(wBe,n),l=s.length+u.length+c.length+Number(o);return l===0?null:f.jsxs(h.Toolbar,{children:[f.jsx(GBe,{items:s,editor:t}),a&&f.jsx(RBe,{labels:r,editor:t}),f.jsx(YBe,{items:u,editor:t}),o&&f.jsx(kBe,{editor:t,setModal:i}),f.jsx($Be,{items:c,editor:t}),l>1&&f.jsxs(f.Fragment,{children:[f.jsx(h.ToolbarSeparator,{}),f.jsx(h.ToolbarButton,{onClick:()=>{t.chain().focus().clearNodes().unsetAllMarks().run()},startIcon:"formatClear"},"clear")]})]})}function XBe(e){const{editor:t}=e;function n(i){const{view:o,state:a,from:s,to:u}=i;if(!o.hasFocus())return!1;const{doc:c,selection:l}=a;return!(t.isActive(fe.RichTextNodeType.preformatted)||l.empty||c.textBetween(s,u).length===0)}function r(i,o){const{view:a,state:s,from:u,to:c}=i,l=a.state.doc.nodeAt(u),{doc:d,selection:p}=s;return!p.empty||d.textBetween(u,c).length>0?!1:!!(l!=null&&l.marks.some(m=>m.type.name===o))}return{shouldShowBubbleMenu:n,shouldshowPopover:r}}function ePe(e){const{content:t,field:n,id:r,readOnly:i}=e,o=tPe(n),a=t&&UC.converter(o.nodeExtensions).fromPrismic(o.schema,o.nodeTypes,t),s=Ne.useStableCallback(e.onContentChange),u=h.useEditor({content:a==null?void 0:a.toJSON(),editable:!i,editorProps:{attributes:{class:`${h.contentEditableClass} ${h.contentEditableMultilinePlaceholderClass}`,id:r,tabIndex:"0"}},extensions:o.allComponents,injectCSS:!1,onUpdate({editor:c}){if(c.isEmpty)return s(void 0);const l=UC.converter(o.nodeExtensions).toPrismic(c.state.doc);s(l)}},[o,i]);return f.jsxs(h.Field,{children:[f.jsx(h.FieldLabel,{htmlFor:r,children:nr(n)}),f.jsxs(h.FieldControl,{children:[u.isEditable&&f.jsx(JBe,{editor:u,nodeTypes:o.names.concat(GUe),labels:o.labels}),f.jsx(Zje,{editor:u,style:{flexGrow:1}})]})]})}function tPe(e){var n,r;const t=`${((n=e.config)==null?void 0:n.multi)??""}-${((r=e.config)==null?void 0:r.single)??""}`;return $.useMemo(()=>{var m;const{extensions:i,nodeTypes:o}=mUe(e.config),a=i.filter(nPe),s=i.flatMap(v=>v.richTextNodeTypes),u=i.map(v=>v.component),c=i.filter(rPe).map(v=>v.name),l=[...u,...D2e(e,a),JUe.configure({supportedExtensionNames:c}),lLe],d=l.map(v=>v.name),p=EMe(l),A=iPe((m=e.config)==null?void 0:m.labels);return{allComponents:l,extensionNames:d,nodeTypes:o,nodeExtensions:a,names:s,schema:p,labels:A}},[t])}function nPe(e){return e.extType===qc.Node}function rPe(e){return!(e.extType!==qc.Node||e.nodeType!==vl.Text||e.lockedFormat)}function iPe(e){return Array.from(e??[])}function oPe(e){var p,A;const{content:t,field:n,id:r,readOnly:i,onContentChange:o}=e,{placeholder:a,options:s}=n.config??{},u=!!(s!=null&&s.includes("")),c=uPe(n),l=aPe({content:t,placeholder:a,defaultValue:c,canHaveEmptyValue:u}),d=a&&c===void 0;return f.jsxs(h.Field,{children:[f.jsx(h.FieldIcon,{name:"arrowDropDownCircle"}),f.jsx(h.FieldLabel,{htmlFor:r,children:nr(n)}),f.jsx(h.FieldControl,{children:f.jsxs(h.Select,{id:r,size:"large",color:"grey",value:l,disabled:i,renderTrigger:()=>f.jsx(h.SelectGhostTrigger,{id:r}),onValueChange:m=>{o(sPe({value:m,placeholder:a}))},children:[d&&f.jsx(h.SelectItem,{value:a,children:a}),(A=(p=n.config)==null?void 0:p.options)==null?void 0:A.map(m=>f.jsx(h.SelectItem,{value:m||kO,children:m},m))]})})]})}function aPe(e){const{content:t,placeholder:n,defaultValue:r,canHaveEmptyValue:i}=e;let{value:o}=t??{};return o===""&&i?kO:(o===""&&(o=void 0),o??r??n)}function sPe(e){const{placeholder:t}=e;let{value:n}=e;if(n!==t)return n===kO&&(n=""),{__TYPE__:"FieldContent",type:"Select",value:n}}function uPe(e){var t,n;return((t=e.config)==null?void 0:t.default_value)===void 0||(n=e.config.options)==null?void 0:n[0]}const kO=" ";function cPe(e){const{id:t,readOnly:n,field:r,content:i,onContentChange:o}=e,a=i!=null&&i.value?ZC.dateFromISOString(i.value):void 0;return f.jsxs(h.Field,{children:[f.jsx(h.FieldIcon,{name:"event"}),f.jsx(h.FieldLabel,{id:t,children:nr(r)}),f.jsx(h.FieldControl,{children:f.jsx(h.Box,{padding:{left:4,right:12},width:"100%",flexDirection:"column",justifyContent:"center",children:f.jsx(h.DateInput,{mode:"date-time","aria-labelledby":t,disabled:n,value:a,onValueChange:s=>o(lPe(s))})})})]})}function lPe(e){if(e)return{__TYPE__:"FieldContent",type:"Timestamp",value:fPe(e)}}function fPe(e){const 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`}function cb(e){const{id:t,readOnly:n,content:r,nestableWidget:i}=e,o=Ne.useStableCallback(e.onContentChange);return $.useMemo(()=>{const a={id:t,readOnly:n,onContentChange:o};return i.type==="Boolean"?f.jsx(R$e,{...a,field:i,content:Ce.isBooleanContent(r)?r:void 0}):i.type==="Date"?f.jsx(M$e,{...a,field:i,content:Ce.isDateContent(r)?r:void 0}):i.type==="Timestamp"?f.jsx(cPe,{...a,field:i,content:Ce.isTimestampContent(r)?r:void 0}):i.type==="Image"?f.jsx(JRe,{...a,field:i,content:Ce.isImageContent(r)?r:void 0}):i.type==="Link"?f.jsx(Z7,{...a,field:i,content:Ce.isLinkContent(r)?r:void 0}):i.type==="Number"?f.jsx(pOe,{...a,field:i,content:Ce.isNumberContent(r)?r:void 0}):i.type==="StructuredText"?f.jsx(ePe,{...a,field:i,content:Ce.isRichTextContent(r)?r:void 0}):i.type==="Select"?f.jsx(oPe,{...a,field:i,content:Ce.isSelectContent(r)?r:void 0}):i.type==="Text"?f.jsx(fOe,{...a,field:i,content:Ce.isTextContent(r)?r:void 0}):i.type==="Embed"?f.jsx(V$e,{...a,field:i,content:Ce.isEmbedContent(r)?r:void 0}):i.type==="Color"?f.jsx(F$e,{...a,field:i,content:Ce.isColorContent(r)?r:void 0}):i.type==="GeoPoint"?f.jsx(Q$e,{...a,field:i,content:Ce.isGeoPointContent(r)?r:void 0}):i.type==="IntegrationFields"?f.jsx(lOe,{...a,field:i,content:Ce.isIntegrationFieldContent(r)?r:void 0}):null},[r,t,i,o,n])}function dPe(e){const{content:t,id:n,nonRepeatableZone:r,onContentChange:i,readOnly:o}=e,a=$.useMemo(()=>Object.entries(r),[r]);return f.jsx(f.Fragment,{children:a.map(([s,u])=>{const c=t[s];return f.jsx(cb,{id:`${n}.${s}`,readOnly:o,nestableWidget:u,content:Ce.isNestableContent(c)?c:void 0,onContentChange:l=>{i(pPe(t,s,l))}},s)})})}function pPe(e,t,n){return n?{...e,[t]:n}:Vl.removeKey(e,t)}function MO(e){var o,a;const{group:t,content:n,onContentChange:r,...i}=e;return f.jsx(LO,{...i,title:GC(t),addItemButtonTitle:`Add item in "${GC(t)}"`,repeatable:((o=t.config)==null?void 0:o.repeat)!==!1,repeatableZone:((a=t.config)==null?void 0:a.fields)??{},content:n==null?void 0:n.value,onContentChange:s=>{r({__TYPE__:"GroupContentType",value:s})}})}function GC(e){var t;return((t=e.config)==null?void 0:t.label)??e.fieldset??e.type}function QQ(e){const{id:t,readOnly:n,content:r,widget:i}=e,o=Ne.useStableCallback(e.onContentChange);return $.useMemo(()=>{const a={id:t,readOnly:n,onContentChange:o};return i.type==="Group"?f.jsx(MO,{...a,group:i,content:Ce.isGroupContent(r)?r:void 0}):f.jsx(cb,{...a,nestableWidget:i,content:Ce.isNestableContent(r)?r:void 0})},[r,t,i,o,n])}function LO(e){const{id:t,title:n,addItemButtonTitle:r,content:i,onContentChange:o,readOnly:a,repeatable:s=!0,repeatableZone:u}=e,c=Object.entries(u);let l=i??[mPe];!s&&l.length>1&&(l=l.slice(0,1));const{scrollOffsetTop:d}=Ee(),p=$.useRef(new WeakMap);APe(p.current,l);function A(x){return p.current.get(x)??"!bugged!"}function m(){o(l.concat(JC()))}function v(x){const{index:g,offset:S}=x;o(Qt.move(l,g,g+S))}function _(x){const{index:g}=x;o(Qt.removeIndex(l,g))}function C(x){o(x)}function I(x,g,S,y){const T=vPe(x,[S,y]),w=gPe(l,[g,T]);hPe(p.current,x,T),o(w)}return Object.keys(u).length===0?null:f.jsx(h.Group,{title:n??"Repeatable zone",addItemButtonTitle:r??"Add item in repeatable zone",items:l,maxItems:s?void 0:1,getItemKey:A,onAddItem:m,dnd:{scrollOffsetTop:d,onReorder:C,renderDragPreview:({index:x})=>f.jsx(yPe,{title:n??"Repeatable zone",index:x}),renderDropIndicator:bPe},children:(x,g)=>{const S=new Map(x.value),y=A(x);return f.jsx(h.LazyRender,{keepLoaded:!0,loadWhenSearching:!0,children:f.jsx(h.GroupItem,{index:g,title:`${g+1} • Item`,onMove:v,onDelete:_,children:c.map(([T,w])=>f.jsx(QQ,{id:`${t}[${y}].${T}`,content:S.get(T),widget:w,onContentChange:O=>I(x,g,T,O),readOnly:a},T))})})}})}function APe(e,t){t.forEach(n=>{e.has(n)||e.set(n,iz.uniqueNumber())})}function hPe(e,t,n){const r=e.get(t);r!==void 0&&e.set(n,r)}const mPe={__TYPE__:"GroupItemContent",value:[]};function gPe(e,t){const[n,r]=t;return r?e.map((i,o)=>o===n?r:i):e.filter((i,o)=>o!==n)}function vPe(e,t){const[n,r]=t;if(!r){const o=e.value.filter(([a])=>a!==n);return JC(o)}const i=Array.from(new Map(e.value).set(n,r));return JC(i)}function JC(e=[]){return{__TYPE__:"GroupItemContent",value:e}}function yPe(e){const{title:t,index:n}=e;return f.jsxs(h.Box,{padding:{block:8,inline:12},backgroundColor:"grey3",border:!0,borderRadius:6,alignItems:"center",justifyContent:"space-between",width:"100%",children:[f.jsxs("div",{children:[f.jsx(h.Text,{variant:"smallBold",color:"grey11",children:t??"Repeatable zone"}),f.jsxs(h.Text,{variant:"small",color:"grey11",children:[n+1," • Item"]})]}),f.jsx(h.Icon,{name:"dragIndicator",size:"small",color:"grey8"})]})}function bPe(e){const{isDropTarget:t,itemIndex:n,position:r}=e,i=t?f.jsx(h.Line,{color:"purple",thickness:2,sx:{position:"absolute",left:0,right:0,bottom:n===0&&r==="before"?0:void 0}},"line"):void 0;return f.jsx(h.AnimatedElement,{enterDuration:150,children:i})}function CPe(e){const{compositeSlice:t,content:n,onContentChange:r,sliceKey:i,id:o,readOnly:a,header:s}=e,u=z0();function c(){i&&u.update({id:i,requestedFrom:"sliceFieldSet"})}return f.jsxs(h.FieldSet,{id:i&&Q0("sliceFieldSet",i),selected:i?u.isSelected(i):!1,onFocus:c,legend:SPe(t),header:s,children:[f.jsx(dPe,{id:o,readOnly:a,nonRepeatableZone:t["non-repeat"]??{},content:n.nonRepeat,onContentChange:l=>{r({...n,nonRepeat:l})}}),f.jsx(LO,{id:o,readOnly:a,repeatableZone:t.repeat??{},content:n.repeat,onContentChange:l=>{r({...n,repeat:l})}})]})}function SPe(e){var t;return((t=e.config)==null?void 0:t.label)??e.fieldset??e.type}const zQ={__TYPE__:"ImageContent",edit:{background:"",crop:{x:0,y:0},zoom:0},height:0,width:0,origin:{height:0,width:0,id:"",url:""},url:""};function _Pe(e){const{field:t}=e;if(t.type==="Image")return zQ}function IPe(e){const{content:t,legacySlice:n,sliceKey:r,id:i,readOnly:o,onContentChange:a,header:s}=e,u=z0();function c(){r&&u.update({id:r,requestedFrom:"sliceFieldSet"})}const l=n.type==="Group"?GC(n):nr(n);return f.jsx(h.FieldSet,{id:r&&Q0("sliceFieldSet",r),selected:r?u.isSelected(r):!1,onFocus:c,legend:l,header:s,children:n.type==="Group"?f.jsx(MO,{id:i,readOnly:o,onContentChange:a,group:n,content:Ce.isGroupContent(t)?t:void 0}):f.jsx(cb,{id:i,readOnly:o,nestableWidget:n,content:Ce.isNestableContent(t)?t:void 0,onContentChange:d=>{const p=_Pe({field:n});!d&&p&&a(p),d&&a(d)}})})}function TPe(e){const{content:t,id:n,slicePrimaryZone:r,onContentChange:i,readOnly:o}=e,a=$.useMemo(()=>Object.entries(r),[r]);return f.jsx(f.Fragment,{children:a.map(([s,u])=>{const c=t[s];return f.jsx(QQ,{id:`${n}.${s}`,readOnly:o,widget:u,content:Ce.isSlicePrimaryContent(c)?c:void 0,onContentChange:l=>{i(xPe(t,s,l))}},s)})})}function xPe(e,t,n){return n?{...e,[t]:n}:Vl.removeKey(e,t)}function HQ(e){const{config:t,content:n,sliceKey:r,readOnly:i=!1,sharedSlice:o,onContentChange:a,...s}=e,u=wPe(o,n.variation),c=$.useId(),d={id:s.id??c,readOnly:i},p=z0();function A(){r&&p.update({id:r,requestedFrom:"sliceFieldSet"})}return u===void 0?null:f.jsx(D0.Provider,{value:t,children:f.jsxs(h.FieldSet,{id:r&&Q0("sliceFieldSet",r),selected:r?p.isSelected(r):!1,onFocus:A,legend:EPe(o,u),children:[f.jsx(h.LazyRender,{heightEstimate:400,gap:16,keepLoaded:!0,loadWhenSearching:!0,children:f.jsx(TPe,{...d,slicePrimaryZone:u.primary??{},content:n.primary,onContentChange:m=>{a({...n,primary:m})}})}),f.jsx(LO,{...d,repeatableZone:u.items??{},content:n.items,onContentChange:m=>{a({...n,items:m})}})]})})}function wPe(e,t){return $.useMemo(()=>e.variations.find(n=>n.id===t),[e,t])}function EPe(e,t){return[e.name,t.name].join(" • ")}function PM(e){var u,c;const{sliceZone:t,onChange:n,slices:r,sliceContent:i}=e,o=(c=(u=t.config)==null?void 0:u.labels)==null?void 0:c[i.name];if(!o)return null;const a=o.find(l=>l.name===i.maybeLabel);function s(l){const d=r.value.map(p=>p.key===i.key?{...p,maybeLabel:l}:p);n({...r,value:d})}return f.jsxs(f.Fragment,{children:[f.jsx(h.Text,{component:"span",variant:"smallBold",children:"•"}),f.jsxs(h.DropdownMenu,{children:[f.jsx(h.DropdownMenuTrigger,{children:f.jsx(h.Button,{color:"grey",size:"small",endIcon:"arrowDropDown",invisible:!0,children:(a==null?void 0:a.display)??"Slice variation"})}),f.jsxs(h.DropdownMenuContent,{align:"start",maxHeight:256,children:[f.jsx(h.DropdownMenuItem,{onSelect:()=>s(void 0),endIcon:i.maybeLabel===void 0?f.jsx(h.Icon,{name:"check"}):void 0,children:"..."}),o==null?void 0:o.map(l=>f.jsx(h.DropdownMenuItem,{onSelect:()=>s(l.name),endIcon:l.name===i.maybeLabel?f.jsx(h.Icon,{name:"check"}):void 0,children:l.display??"[Missing display value]"},l.name))]})]})]})}function $Pe(e){const{content:t,id:n,onContentChange:r,readOnly:i,sliceZone:o}=e,a=Ee();return f.jsx(f.Fragment,{children:t==null?void 0:t.value.map((s,u)=>{var p,A;const c=(A=(p=o.config)==null?void 0:p.choices)==null?void 0:A[s.name];if(c===void 0)return null;const l=s.widget,d={id:`${n}[${s.key}]`,key:s.key,sliceKey:s.key,onContentChange:m=>{const v={...s,widget:m},_=RPe(t,[u,v]);r(_)},readOnly:i};return c.type==="SharedSlice"?Ce.isSharedSliceContent(l)?f.jsx(HQ,{...d,config:a,sharedSlice:c,content:l}):null:c.type==="Slice"?Ce.isCompositeSliceContent(l)?f.jsx(CPe,{...d,compositeSlice:c,content:l,header:f.jsx(PM,{sliceContent:s,sliceZone:o,slices:t,onChange:r})}):null:Ce.isSimpleSliceContent(l)?f.jsx(IPe,{...d,legacySlice:c,content:l,header:f.jsx(PM,{sliceContent:s,sliceZone:o,slices:t,onChange:r})}):null})})}function RPe(e,[t,n]){return{__TYPE__:"SliceContentType",value:e.value.map((r,i)=>i===t?n:r)}}function OPe(e){const{id:t,field:n,content:r,onContentChange:i}=e,o=Ne.useDebounceState({state:(r==null?void 0:r.value)??"",synchronize:!0}),{onEditUID:a}=$.useContext(R7);function s(c){a();const l=Ep.slugify(c);i(MPe(l)),o.set(l)}function u(c){s(c.clipboardData.getData("Text").trim()),c.preventDefault()}return f.jsxs(h.Field,{children:[f.jsx(h.FieldIcon,{name:"tag"}),f.jsx(h.FieldLabel,{htmlFor:t,children:nr(n)}),f.jsx(h.FieldControl,{children:f.jsx(Qs,{id:t,variant:"success",placeholder:Wc(n,"Enter a unique identifier"),value:o.value,onPaste:u,onValueChange:s,endAdornment:f.jsx(h.AnimatedElement,{enterDuration:150,children:f.jsx(FPe,{uid:o.debouncedValue})})})})]})}function FPe(e){const{uid:t}=e,n=Ee();return t?n.uidField?f.jsx(h.ErrorBoundary,{children:f.jsx($.Suspense,{children:f.jsx(kPe,{uid:t})})}):null:f.jsx(h.Badge,{color:"tomato",title:"Required",size:"medium"})}function kPe(e){const t=LPe(e),n=Ee();if(!t.documentId)return null;const r=MR({status:t.status,releaseId:t.releaseId,documentId:t.documentId,versionId:t.versionId,baseUrl:n.baseUrl});return f.jsx("a",{href:r.href,target:"_blank",rel:"noreferrer",children:f.jsx(h.Badge,{color:"tomato",size:"medium",title:f.jsxs(h.Text,{color:"tomato11",variant:"small",children:["Value already used in"," ",f.jsx(h.Text,{color:"tomato11",variant:"small",underline:!0,children:"another document"})]})})})}function MPe(e){return e===""?void 0:{__TYPE__:"UIDContent",value:e}}function LPe(e){var A,m,v,_;const{uid:t}=e,n=Ee();n.uidField||Jt("uidField");const{coreApiBaseUrl:r,authStrategy:i,customTypeId:o,localeId:a,documentId:s}=n,u=BR({uid:[t]}),l=Ve.useRequest(UR,[r,i,u]).results,p=F7({customTypeId:o,languageId:a,documentsWithUid:l,documentId:s,uid:t})[0];return p?{documentId:p.id,versionId:(A=p.versions[0])==null?void 0:A.version_id,status:(m=p.versions[0])==null?void 0:m.status,releaseId:((v=p.versions[0])==null?void 0:v.status)==="release"?(_=p.versions[0])==null?void 0:_.release_id:void 0}:{}}function jPe(e){const{id:t,readOnly:n,staticZone:r,content:i,onContentChange:o}=e,a=$.useMemo(()=>Object.entries(r),[r]);return a.length===0?null:f.jsx(h.FieldSet,{legend:"Page data",children:a.map(([s,u])=>{const c={id:`${t}.${s}`,onContentChange:d=>{const{[s]:p,...A}=i;o({...A,...d!==void 0&&{[s]:d}})},readOnly:n},l=i[s];return u.type==="UID"?$.createElement(OPe,{...c,content:Ce.isUIDContent(l)?l:void 0,key:s,field:u}):u.type==="Group"?$.createElement(MO,{...c,content:Ce.isGroupContent(l)?l:void 0,group:u,key:s}):$.createElement(cb,{...c,content:Ce.isNestableContent(l)?l:void 0,key:s,nestableWidget:u})})})}function UPe(e){const{id:t,readOnly:n,section:r,content:i,onContentChange:o}=e,[a,s]=PPe(r),[u,c]=WPe(i);return f.jsxs("div",{style:{display:"flex",flexDirection:"column",position:"relative",zIndex:0},children:[f.jsx(jPe,{id:t,readOnly:n,staticZone:a,content:u,onContentChange:l=>o({...c,...l})}),s.map(([l,d])=>{const p=c[l];return f.jsx($Pe,{id:`${t}.${l}`,readOnly:n,sliceZone:d,content:p,onContentChange:A=>o({...u,...c,[l]:A})},l)})]})}function BPe(e){return e.type==="Choice"||e.type==="Slices"}function PPe(e){return Object.entries(e).reduce(([t,n],[r,i])=>(BPe(i)?n.push([r,i]):Object.assign(t,{[r]:i}),[t,n]),[{},[]])}function WPe(e){return Object.entries(e).reduce(([t,n],[r,i])=>{const o={[r]:i};return Object.assign(Ce.isSlicesContent(i)?n:t,o),[t,n]},[{},{}])}function DPe(e){const{config:t,readOnly:n=!1,customType:r,sectionName:i,content:o,onContentChange:a}=e,s=$.useId();if(Vl.isEmpty(r.json))return null;const u=KPe(r,i),[c,l]=NPe(u,o);return f.jsx(D0.Provider,{value:t,children:f.jsx(UPe,{id:s,readOnly:n,section:u,content:c,onContentChange:d=>a({...l,...d})})})}function KPe(e,t){const n=e.json[t];if(n===void 0)throw new Error(`Cannot find a section with name '${t}'.`);return n}function NPe(e,t){return Object.entries(t).reduce(([n,r],[i,o])=>{const a=e[i]!==void 0,s={[i]:o};return[{...n,...a?s:{}},{...r,...a?{}:s}]},[{},{}])}exports.DeferredCodeBlock=KM;exports.DocumentEditor=DPe;exports.EditorConfigContext=D0;exports.EditorErrorBoundary=pxe;exports.MediaLibrary=$7;exports.NewMediaLibraryFeaturesBanner=Eq;exports.OnboardingGuide=I$e;exports.SelectionManagerProvider=Rq;exports.SharedSliceEditor=HQ;exports.SliceSelectionContext=k7;exports.UIDContext=R7;exports.createSearchParams=N0;exports.defaultGroupContentWithOneItem=Iq;exports.defaultImageContentWidget=zQ;exports.documentKeys=Jo;exports.documentMetaOkType=jR;exports.documentSchema=Swe;exports.documentStatus=Tq;exports.frameworkLabels=DM;exports.getConflictingUidDocuments=F7;exports.getDocumentByDocumentId=Nq;exports.getDocumentList=Wq;exports.getDocuments=UR;exports.getEnrichedSearchDocuments=qq;exports.getOnboarding=Fwe;exports.getProfile=Xq;exports.getRepository=q0;exports.getRepositoryCustomTypes=Bq;exports.getRepositoryTags=zq;exports.getSliceSelectionDOMId=Q0;exports.hasUIDField=O7;exports.invalidateDocumentListData=Twe;exports.isMissingUID=x$e;exports.isValidSimulatorURL=Qq;exports.languageOkType=LR;exports.makeGetDocumentsQueryString=BR;exports.makeSearchFullTextDocumentsQueryString=Kq;exports.onboardingStateSchema=Hq;exports.onboardingToggleResultSchema=Gq;exports.onboardingToggleStepResultSchema=Yq;exports.prepareDocumentForSave=uxe;exports.profileResponse=Zq;exports.repositoryFramework=PR;exports.roleMap=Uwe;exports.searchDocumentStatus=xq;exports.searchFullTextDocuments=Dq;exports.sliceItemContentSchema=_we;exports.suppressErrors=gxe;exports.throwConfigError=Jt;exports.toggleOnboarding=Mwe;exports.toggleOnboardingStep=kwe;exports.updateDocumentListData=Iwe;exports.useProfile=WR;exports.useSelectionManager=Vs;exports.useSliceSelection=z0;