WordPress/wp-includes/js/dist/dom.min.js

2 lines
12 KiB
JavaScript
Raw Normal View History

/*! This file is auto-generated */
!function(){"use strict";var t={d:function(e,n){for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r:function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.r(e),t.d(e,{__unstableStripHTML:function(){return Q},computeCaretRect:function(){return E},documentHasSelection:function(){return A},documentHasTextSelection:function(){return C},documentHasUncollapsedSelection:function(){return S},focus:function(){return at},getFilesFromDataTransfer:function(){return ct},getOffsetParent:function(){return x},getPhrasingContentSchema:function(){return nt},getRectangleFromRange:function(){return y},getScrollContainer:function(){return R},insertAfter:function(){return X},isEmpty:function(){return Z},isEntirelySelected:function(){return D},isFormElement:function(){return M},isHorizontalEdge:function(){return B},isNumberInput:function(){return v},isPhrasingContent:function(){return rt},isRTL:function(){return H},isTextContent:function(){return ot},isTextField:function(){return T},isVerticalEdge:function(){return j},placeCaretAtHorizontalEdge:function(){return q},placeCaretAtVerticalEdge:function(){return k},remove:function(){return W},removeInvalidHTML:function(){return ut},replace:function(){return G},replaceTag:function(){return $},safeHTML:function(){return K},unwrap:function(){return Y},wrap:function(){return J}});var n={};t.r(n),t.d(n,{find:function(){return c}});var r={};function o(t){return[t?'[tabindex]:not([tabindex^="-"])':"[tabindex]","a[href]","button:not([disabled])",'input:not([type="hidden"]):not([disabled])',"select:not([disabled])","textarea:not([disabled])",'iframe:not([tabindex^="-"])',"object","embed","area[href]","[contenteditable]:not([contenteditable=false])"].join(",")}function i(t){return t.offsetWidth>0||t.offsetHeight>0||t.getClientRects().length>0}function u(t){const e=t.closest("map[name]");if(!e)return!1;const n=t.ownerDocument.querySelector('img[usemap="#'+e.name+'"]');return!!n&&i(n)}function c(t){let{sequential:e=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=t.querySelectorAll(o(e));return Array.from(n).filter((t=>{if(!i(t))return!1;const{nodeName:e}=t;return"AREA"!==e||u(t)}))}t.r(r),t.d(r,{find:function(){return p},findNext:function(){return b},findPrevious:function(){return g},isTabbableIndex:function(){return l}});var a=window.lodash;function s(t){const e=t.getAttribute("tabindex");return null===e?0:parseInt(e,10)}function l(t){return-1!==s(t)}function f(t,e){return{element:t,index:e}}function d(t){return t.element}function m(t,e){const n=s(t.element),r=s(e.element);return n===r?t.index-e.index:n-r}function h(t){return t.filter(l).map(f).sort(m).map(d).reduce(function(){const t={};return function(e,n){const{nodeName:r,type:o,checked:i,name:u}=n;if("INPUT"!==r||"radio"!==o||!u)return e.concat(n);const c=t.hasOwnProperty(u);if(!i&&c)return e;if(c){const n=t[u];e=(0,a.without)(e,n)}return t[u]=n,e.concat(n)}}(),[])}function p(t){return h(c(t))}function g(t){const e=c(t.ownerDocument.body),n=e.indexOf(t);if(-1!==n)return e.length=n,(0,a.last)(h(e))}function b(t){const e=c(t.ownerDocument.body),n=e.indexOf(t),r=e.slice(n+1);return(0,a.first)(h(r))}function N(t,e){0}function y(t){if(!t.collapsed){const e=Array.from(t.getClientRects());if(1===e.length)return e[0];const n=e.filter((t=>{let{width:e}=t;return e>1}));if(0===n.length)return t.getBoundingClientRect();if(1===n.length)return n[0];let{top:r,bottom:o,left:i,right:u}=n[0];for(const{top:t,bottom:e,left:c,right:a}of n)t<r&&(r=t),e>o&&(o=e),c<i&&(i=c),a>u&&(u=a);return new window.DOMRect(i,r,u-i,o-r)}const{startContainer:e}=t,{ownerDocument:n}=e;if("BR"===e.nodeName){const{parentNode:r}=e;N();const o=Array.from(r.childNodes).indexOf(e);N(),(t=n.createRange()).setStart(r,o),t.setEnd(r,o)}let r=t.getClientRects()[0];if(!r){N();const e=n.createTextNode("");(t=t.cloneRange()).insertNode(e),r=t.getClientRects()