define(["exports"],function(_exports){function _createForOfIteratorHelper(r,e){var o,a,u,n,t="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(t)return u=!(a=!0),{s:function(){t=t.call(r)},n:function(){var r=t.next();return a=r.done,r},e:function(r){u=!0,o=r},f:function(){try{a||null==t.return||t.return()}finally{if(u)throw o}}};if(Array.isArray(r)||(t=function(r,a){{var t;if(r)return"string"==typeof r?_arrayLikeToArray(r,a):"Map"===(t="Object"===(t={}.toString.call(r).slice(8,-1))&&r.constructor?r.constructor.name:t)||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0}}(r))||e&&r&&"number"==typeof r.length)return t&&(r=t),n=0,{s:e=function(){},n:function(){return n>=r.length?{done:!0}:{done:!1,value:r[n++]}},e:function(r){throw r},f:e};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n}Object.defineProperty(_exports,"__esModule",{value:!0}),_exports.textWalker=void 0;function walkRange(range,walker){for(var nodes=[],node=walker.currentNode;node;node=walker.nextNode()){var compare=range.comparePoint(node,0);if(0===compare)nodes.push(node);else if(0<compare)break}return nodes}function walkDocument(_,walker){for(var nodes=[],node=walker.nextNode();node;node=walker.nextNode())nodes.push(node);return nodes}function acceptNode(node){return 1===node.nodeType?"script"===(node=node.tagName.toLowerCase())||"style"===node?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT}var filter=NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_TEXT|NodeFilter.SHOW_CDATA_SECTION;_exports.textWalker=function*(x,func){var _step,_x$commonAncestorCont=null!=(_x$commonAncestorCont=null!=(_x$commonAncestorCont=x.commonAncestorContainer)?_x$commonAncestorCont:x.body)?_x$commonAncestorCont:x,_x$commonAncestorCont=document.createTreeWalker(_x$commonAncestorCont,filter,{acceptNode:acceptNode}),nodes=(x.commonAncestorContainer?walkRange:walkDocument)(x,_x$commonAncestorCont),_iterator=_createForOfIteratorHelper(func(nodes.map(function(node){return node.nodeValue}),function(startIndex,startOffset,endIndex,endOffset){var range=document.createRange();return range.setStart(nodes[startIndex],startOffset),range.setEnd(nodes[endIndex],endOffset),range}));try{for(_iterator.s();!(_step=_iterator.n()).done;)yield _step.value}catch(err){_iterator.e(err)}finally{_iterator.f()}}});