"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});function g(t,n){if(!t)return[];const{from:f,to:i}=t.selection;let r;if(typeof n=="string")r=Object.entries(t.schema.nodes).filter(([e,s])=>s.groups.includes(n)).map(([e,s])=>({type:s}));else{r=n;for(const e of r)e.type=e.type?h(e.type,t.schema):null}let l=null,u=null;const d=new Set,a=new Set(r);return t.doc.nodesBetween(f,i,(e,s,y)=>{if(a.size===0)return!1;if(!e.isText){const c=r.filter(o=>o.type?typeof o.type=="string"?!1:e.type.name===o.type.name:!0).find(o=>o.attributes?p(e.attrs,o.attributes):!0);c&&(u&&l&&l!==y&&(a.delete(u),d.add(u)),u=c),l=e}}),u&&d.add(u),[...d.values()].map(e=>{var s;return e.key?e.key:typeof e.type=="string"?e.type:(s=e.type)!=null&&s.name?e.type.name:""})}function h(t,n){if(typeof t=="string"){if(!n.nodes[t])throw Error(`There is no node type named '${t}'. Maybe you forgot to add the extension?`);return n.nodes[t]}return t}function p(t,n,f){const i=Object.keys(n);return i.length?i.every(r=>f.strict?n[r]===t[r]:Object.prototype.toString.call(n[r])==="[object RegExp]"?n[r].test(t[r]):n[r]===t[r]):!0}exports.default=g;exports.objectIncludes=p;
//# sourceMappingURL=last-active-nodes.cjs.map
