Blame view

webroot/js/popper.js 16.3 KB
4b529711   Etienne Pallier   6 gros bugfix de ...
1
2
3
4
5
6
/**
 * @popperjs/core v2.0.3 - MIT License
 */

"use strict";!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e=e||self).Popper={})}(this,(function(e){function t(e){return{width:(e=e.getBoundingClientRect()).width,height:e.height,top:e.top,right:e.right,bottom:e.bottom,left:e.left,x:e.left,y:e.top}}function r(e){return"[object Window]"!=={}.toString.call(e)?(e=e.ownerDocument)?e.defaultView:window:e}function n(e){return{scrollLeft:(e=r(e)).pageXOffset,scrollTop:e.pageYOffset}}function o(e){return e instanceof r(e).Element}function i(e){return e instanceof r(e).HTMLElement}function a(e){return e?(e.nodeName||"").toLowerCase():null}function s(e){return r(e).getComputedStyle(e)}function f(e){return e=i(e)?s(e):{},{top:parseFloat(e.borderTopWidth)||0,right:parseFloat(e.borderRightWidth)||0,bottom:parseFloat(e.borderBottomWidth)||0,left:parseFloat(e.borderLeftWidth)||0}}function p(e,o,s){void 0===s&&(s=!1),e=t(e);var p={scrollLeft:0,scrollTop:0},c=0,u=0;return s||("body"!==a(o)&&(p=o!==r(o)&&i(o)?{scrollLeft:o.scrollLeft,scrollTop:o.scrollTop}:n(o)),i(o)&&(s=t(o),o=f(o),c=s.x+o.left,u=s.y+o.top)),{x:e.left+p.scrollLeft-c,y:e.top+p.scrollTop-u,width:e.width,height:e.height}}function c(e){return{x:e.offsetLeft,y:e.offsetTop,width:e.offsetWidth,height:e.offsetHeight}}function u(e){return"html"===a(e)?e:e.parentNode||e.host||document.ownerDocument||document.documentElement}function d(e,t){void 0===t&&(t=[]);var n=function e(t){if(0<=["html","body","#document"].indexOf(a(t)))return t.ownerDocument.body;if(i(t)){var r=s(t);if(/auto|scroll|overlay|hidden/.test(r.overflow+r.overflowY+r.overflowX))return t}return e(u(t))}(e);return n=(e="body"===a(n))?r(n):n,t=t.concat(n),e?t:t.concat(d(u(n)))}function l(e){var t;return!i(e)||!(t=e.offsetParent)||void 0!==window.InstallTrigger&&"fixed"===s(t).position?null:t}function m(e){var t=r(e);for(e=l(e);e&&0<=["table","td","th"].indexOf(a(e));)e=l(e);return e&&"body"===a(e)&&"static"===s(e).position?t:e||t}function h(e){var t=new Map,r=new Set,n=[];return e.forEach((function(e){t.set(e.name,e)})),e.forEach((function(e){r.has(e.name)||function e(o){r.add(o.name),[].concat(o.requires||[],o.requiresIfExists||[]).forEach((function(n){r.has(n)||(n=t.get(n))&&e(n)})),n.push(o)}(e)})),n}function v(e){var t;return function(){return t||(t=new Promise((function(r){Promise.resolve().then((function(){t=void 0,r(e())}))}))),t}}function g(e){return e.split("-")[0]}function b(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return!t.some((function(e){return!(e&&"function"==typeof e.getBoundingClientRect)}))}function y(e){void 0===e&&(e={});var t=e.defaultModifiers,r=void 0===t?[]:t,n=void 0===(e=e.defaultOptions)?C:e;return function(e,t,i){function a(){f.forEach((function(e){return e()})),f=[]}void 0===i&&(i=n);var s={placement:"bottom",orderedModifiers:[],options:Object.assign({},C,{},n),modifiersData:{},elements:{reference:e,popper:t},attributes:{},styles:{}},f=[],u=!1,l={state:s,setOptions:function(i){return a(),s.options=Object.assign({},n,{},s.options,{},i),s.scrollParents={reference:o(e)?d(e):[],popper:d(t)},i=function(e){var t=h(e);return A.reduce((function(e,r){return e.concat(t.filter((function(e){return e.phase===r})))}),[])}([].concat(s.options.modifiers.filter((function(e){return!r.find((function(t){return t.name===e.name}))})),r.map((function(e){return Object.assign({},e,{},s.options.modifiers.find((function(t){return t.name===e.name})))})))),s.orderedModifiers=i.filter((function(e){return e.enabled})),s.orderedModifiers.forEach((function(e){var t=e.name,r=e.options;r=void 0===r?{}:r,"function"==typeof(e=e.effect)&&(t=e({state:s,name:t,instance:l,options:r}),f.push(t||function(){}))})),l.update()},forceUpdate:function(){if(!u){var e=s.elements,t=e.reference;if(b(t,e=e.popper))for(s.rects={reference:p(t,m(e),"fixed"===s.options.strategy),popper:c(e)},s.reset=!1,s.placement=s.options.placement,s.orderedModifiers.forEach((function(e){return s.modifiersData[e.name]=Object.assign({},e.data)})),t=0;t<s.orderedModifiers.length;t++)if(!0===s.reset)s.reset=!1,t=-1;else{var r=s.orderedModifiers[t];e=r.fn;var n=r.options;n=void 0===n?{}:n,r=r.name,"function"==typeof e&&(s=e({state:s,options:n,name:r,instance:l})||s)}}},update:v((function(){return new Promise((function(e){l.forceUpdate(),e(s)}))})),destroy:function(){a(),u=!0}};return b(e,t)?(l.setOptions(i).then((function(e){!u&&i.onFirstUpdate&&i.onFirstUpdate(e)})),l):l}}function w(e){return 0<=["top","bottom"].indexOf(e)?"x":"y"}function x(e){var t=e.reference,r=e.element,n=(e=e.placement)?g(e):null;e=e?e.split("-")[1]:null;var o=t.x+t.width/2-r.width/2,i=t.y+t.height/2-r.height/2;switch(n){case"top":o={x:o,y:t.y-r.height};break;case"bottom":o={x:o,y:t.y+t.height};break;case"right":o={x:t.x+t.width,y:i};break;case"left":o={x:t.x-r.width,y:i};break;default:o={x:t.x,y:t.y}}if(null!=(n=n?w(n):null))switch(i="y"===n?"height":"width",e){case"start":o[n]=Math.floor(o[n])-Math.floor(t[i]/2-r[i]/2);break;case"end":o[n]=Math.floor(o[n])+Math.ceil(t[i]/2-r[i]/2)}return o}function O(e){var t,n=e.popper,o=e.popperRect,i=e.placement,a=e.offsets,s=e.position,f=e.gpuAcceleration,p=e.adaptive,c=window.devicePixelRatio||1;e=Math.round(a.x*c)/c||0,c=Math.round(a.y*c)/c||0;var u=a.hasOwnProperty("x");a=a.hasOwnProperty("y");var d,l="left",h="top";if(p){var v=m(n);v===r(n)&&(v=n.ownerDocument.documentElement),"top"===i&&(h="bottom",c-=v.clientHeight-o.height,c*=f?1:-1),"left"===i&&(l="right",e-=v.clientWidth-o.width,e*=f?1:-1)}return n=Object.assign({position:s},p&&I),f?Object.assign({},n,((d={})[h]=a?"0":"",d[l]=u?"0":"",d.transform=2>(window.devicePixelRatio||1)?"translate("+e+"px, "+c+"px)":"translate3d("+e+"px, "+c+"px, 0)",d)):Object.assign({},n,((t={})[h]=a?c+"px":"",t[l]=u?e+"px":"",t.transform="",t))}function M(e){return e.replace(/left|right|bottom|top/g,(function(e){return N[e]}))}function D(e){return e.replace(/start|end/g,(function(e){return _[e]}))}function j(e,t){var r=!(!t.getRootNode||!t.getRootNode().host);if(e.contains(t))return!0;if(r)do{if(t&&e.isSameNode(t))return!0;t=t.parentNode||t.host}while(t);return!1}function E(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function k(e,o){if("viewport"===o)e=E({width:(e=r(e)).innerWidth,height:e.innerHeight,x:0,y:0});else if(i(o))e=t(o);else{var a=e.ownerDocument.documentElement;e=r(a),o=n(a),(a=p(a.ownerDocument.documentElement,e)).height=Math.max(a.height,e.innerHeight),a.width=Math.max(a.width,e.innerWidth),a.x=-o.scrollLeft,a.y=-o.scrollTop,e=E(a)}return e}function P(e,t,n){return t="clippingParents"===t?function(e){var t=d(e),r=0<=["absolute","fixed"].indexOf(s(e).position)&&i(e)?m(e):e;return o(r)?t.filter((function(e){return o(e)&&j(e,r)})):[]}(e):[].concat(t),(n=(n=[].concat(t,[n])).reduce((function(t,n){var o=k(e,n),s=i(n)?n:e.ownerDocument.documentElement,p=f(s),c=r(s);n=s.offsetWidth-s.clientWidth-p.right;var u=s.offsetHeight-s.clientHeight-p.bottom;return"html"===a(s)&&(n=c.innerWidth-s.clientWidth,u=c.innerHeight-s.clientHeight),s=p.top,p=p.left,t.top=Math.max(o.top+s,t.top),t.right=Math.min(o.right-n,t.right),t.bottom=Math.min(o.bottom-u,t.bottom),t.left=Math.max(o.left+p,t.left),t}),k(e,n[0]))).width=n.right-n.left,n.height=n.bottom-n.top,n.x=n.left,n.y=n.top,n}function W(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},{},e)}function L(e,t){return t.reduce((function(t,r){return t[r]=e,t}),{})}function B(e,r){void 0===r&&(r={});var n=r;r=void 0===(r=n.placement)?e.placement:r;var i=n.boundary,a=void 0===i?"clippingParents":i,s=void 0===(i=n.rootBoundary)?"viewport":i;i=void 0===(i=n.elementContext)?"popper":i;var f=n.altBoundary,p=void 0!==f&&f;n=W("number"!=typeof(n=void 0===(n=n.padding)?0:n)?n:L(n,H));var c=e.elements.reference;f=e.rects.popper,a=P(o(p=e.elements[p?"popper"===i?"reference":"popper":i])?p:e.elements.popper.ownerDocument.documentElement,a,s),p=x({reference:s=t(c),element:f,strategy:"absolute",placement:r}),f=E(Object.assign({},f,{},p)),s="popper"===i?f:s;var u={top:a.top-s.top+n.top,bottom:s.bottom-a.bottom+n.bottom,left:a.left-s.left+n.left,right:s.right-a.right+n.right};if(e=e.modifiersData.offset,"popper"===i&&e){var d=e[r];Object.keys(u).forEach((function(e){var t=0<=["right","bottom"].indexOf(e)?1:-1,r=0<=["top","bottom"].indexOf(e)?"y":"x";u[e]+=d[r]*t}))}return u}function R(e,t,r){return void 0===r&&(r={x:0,y:0}),{top:e.top-t.height-r.y,right:e.right-t.width+r.x,bottom:e.bottom-t.height+r.y,left:e.left-t.width-r.x}}function q(e){return["top","right","bottom","left"].some((function(t){return 0<=e[t]}))}var H=["top","bottom","right","left"],S=H.reduce((function(e,t){return e.concat([t+"-start",t+"-end"])}),[]),T=[].concat(H,["auto"]).reduce((function(e,t){return e.concat([t,t+"-start",t+"-end"])}),[]),A="beforeRead read afterRead beforeMain main afterMain beforeWrite write afterWrite".split(" "),C={placement:"bottom",modifiers:[],strategy:"absolute"},F={passive:!0},I={top:"auto",right:"auto",bottom:"auto",left:"auto"},N={left:"right",right:"left",bottom:"top",top:"bottom"},_={start:"end",end:"start"},U=[{name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(e){var t=e.state,n=e.instance,o=(e=e.options).scroll,i=void 0===o||o,a=void 0===(e=e.resize)||e,s=r(t.elements.popper),f=[].concat(t.scrollParents.reference,t.scrollParents.popper);return i&&f.forEach((function(e){e.addEventListener("scroll",n.update,F)})),a&&s.addEventListener("resize",n.update,F),function(){i&&f.forEach((function(e){e.removeEventListener("scroll",n.update,F)})),a&&s.removeEventListener("resize",n.update,F)}},data:{}},{name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state;t.modifiersData[e.name]=x({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})},data:{}},{name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(e){var t=e.state,r=e.options;e=void 0===(e=r.gpuAcceleration)||e,r=void 0===(r=r.adaptive)||r,e={placement:g(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:e},t.styles.popper=Object.assign({},t.styles.popper,{},O(Object.assign({},e,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:r}))),null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign({},t.styles.arrow,{},O(Object.assign({},e,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})},data:{}},{name:"applyStyles",enabled:!0,phase:"write",fn:function(e){var t=e.state;Object.keys(t.elements).forEach((function(e){var r=t.styles[e]||{},n=t.attributes[e]||{},o=t.elements[e];i(o)&&a(o)&&(Object.assign(o.style,r),Object.keys(n).forEach((function(e){var t=n[e];!1===t?o.removeAttribute(e):o.setAttribute(e,!0===t?"":t)})))}))},effect:function(e){var t=e.state,r={position:"absolute",left:"0",top:"0",margin:"0"};return Object.assign(t.elements.popper.style,r),function(){Object.keys(t.elements).forEach((function(e){var n=t.elements[e],o=Object.keys(t.styles.hasOwnProperty(e)?Object.assign({},t.styles[e]):r);e=t.attributes[e]||{},o=o.reduce((function(e,t){var r;return Object.assign({},e,((r={})[String(t)]="",r))}),{}),i(n)&&a(n)&&(Object.assign(n.style,o),Object.keys(e).forEach((function(e){return n.removeAttribute(e)})))}))}},requires:["computeStyles"]},{name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(e){var t=e.state,r=e.name,n=void 0===(e=e.options.offset)?[0,0]:e,o=(e=T.reduce((function(e,r){var o=t.rects,i=g(r),a=0<=["left","top"].indexOf(i)?-1:1,s="function"==typeof n?n(Object.assign({},o,{placement:r})):n;return o=(o=s[0])||0,s=((s=s[1])||0)*a,i=0<=["left","right"].indexOf(i)?{x:s,y:o}:{x:o,y:s},e[r]=i,e}),{}))[t.placement],i=o.y;t.modifiersData.popperOffsets.x+=o.x,t.modifiersData.popperOffsets.y+=i,t.modifiersData[r]=e}},{name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,r=e.options;if(e=e.name,!t.modifiersData[e]._skip){var n=r.fallbackPlacements,o=r.padding,i=r.boundary,a=r.rootBoundary,s=void 0===(r=r.flipVariations)||r,f=g(r=t.options.placement);n=n||(f===r?[M(r)]:function(e){if("auto"===g(e))return[];var t=M(e);return[D(e),t,D(t)]}(r));var p=function(e,t){var r=new Set;return e.filter((function(e){if(e=t(e),!r.has(e))return r.add(e),!0}))}([r].concat(n).reduce((function(e,r){return"auto"===g(r)?e.concat(function(e,t){void 0===t&&(t={});var r=t.boundary,n=t.rootBoundary,o=t.padding,i=t.flipVariations,a=t.placement.split("-")[1],s=(a?i?S:S.filter((function(e){return e.split("-")[1]===a})):H).reduce((function(t,i){return t[i]=B(e,{placement:i,boundary:r,rootBoundary:n,padding:o})[g(i)],t}),{});return Object.keys(s).sort((function(e,t){return s[e]-s[t]}))}(t,{placement:r,boundary:i,rootBoundary:a,padding:o,flipVariations:s})):e.concat(r)}),[]),(function(e){return e}));n=t.rects.reference,r=t.rects.popper;var c=new Map;f=!0;for(var u=p[0],d=0;d<p.length;d++){var l=p[d],m=g(l),h="start"===l.split("-")[1],v=0<=["top","bottom"].indexOf(m),b=v?"width":"height",y=B(t,{placement:l,boundary:i,rootBoundary:a,padding:o});if(h=v?h?"right":"left":h?"bottom":"top",n[b]>r[b]&&(h=M(h)),b=M(h),(m=[0>=y[m],0>=y[h],0>=y[b]]).every((function(e){return e}))){u=l,f=!1;break}c.set(l,m)}if(f)for(n=function(e){var t=p.find((function(t){if(t=c.get(t))return t.slice(0,e).every((function(e){return e}))}));if(t)return u=t,"break"},r=s?3:1;0<r&&"break"!==n(r);r--);t.placement!==u&&(t.modifiersData[e]._skip=!0,t.placement=u,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}},{name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,r=e.options;e=e.name;var n=r.mainAxis,o=void 0===n||n;n=void 0!==(n=r.altAxis)&&n;var i=r.tether;i=void 0===i||i;var a=r.tetherOffset,s=void 0===a?0:a;r=B(t,{boundary:r.boundary,rootBoundary:r.rootBoundary,padding:r.padding}),a=g(t.placement);var f=t.placement.split("-")[1],p=!f,u=w(a);a="x"===u?"y":"x";var d=t.modifiersData.popperOffsets,l=t.rects.reference,m=t.rects.popper,h="function"==typeof s?s(Object.assign({},t.rects,{placement:t.placement})):s;if(s={x:0,y:0},o){var v="y"===u?"top":"left",b="y"===u?"bottom":"right",y="y"===u?"height":"width";o=d[u];var x=d[u]+r[v],O=d[u]-r[b],M=i?-m[y]/2:0,D="start"===f?l[y]:m[y];f="start"===f?-m[y]:-l[y],m=t.elements.arrow,m=i&&m?c(m):{width:0,height:0};var j=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0};v=j[v],b=j[b],m=Math.max(0,Math.min(Math.abs(l[y]-m[y]),m[y])),j=t.modifiersData.offset?t.modifiersData.offset[t.placement][u]:0,D=t.modifiersData.popperOffsets[u]+(p?l[y]/2-M-m-v-h:D-m-v-h)-j,p=t.modifiersData.popperOffsets[u]+(p?-l[y]/2+M+m+b+h:f+m+b+h)-j,i=Math.max(i?Math.min(x,D):x,Math.min(o,i?Math.max(O,p):O)),t.modifiersData.popperOffsets[u]=i,s[u]=i-o}n&&(n=d[a],i=Math.max(n+r["x"===u?"top":"left"],Math.min(n,n-r["x"===u?"bottom":"right"])),t.modifiersData.popperOffsets[a]=i,s[a]=i-n),t.modifiersData[e]=s},requiresIfExists:["offset"]},{name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,r=e.state;e=e.name;var n=r.elements.arrow,o=r.modifiersData.popperOffsets,i=g(r.placement),a=w(i);if(i=0<=["left","right"].indexOf(i)?"height":"width",n){var s=r.modifiersData[e+"#persistent"].padding;n=c(n),o=Math.max(s["y"===a?"top":"left"],Math.min(r.rects.popper[i]/2-n[i]/2+((r.rects.reference[i]+r.rects.reference[a]-o[a]-r.rects.popper[i])/2-(o[a]-r.rects.reference[a])/2),r.rects.popper[i]-n[i]-s["y"===a?"bottom":"right"])),r.modifiersData[e]=((t={})[a]=o,t)}},effect:function(e){var t=e.state,r=e.options;e=e.name;var n=r.element;n=void 0===n?"[data-popper-arrow]":n,r=void 0===(r=r.padding)?0:r,("string"!=typeof n||(n=t.elements.popper.querySelector(n)))&&j(t.elements.popper,n)&&(t.elements.arrow=n,t.modifiersData[e+"#persistent"]={padding:W("number"!=typeof r?r:L(r,H))})},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]},{name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(e){var t=e.state;e=e.name;var r=t.rects.reference,n=t.rects.popper,o=t.modifiersData.preventOverflow,i=B(t,{elementContext:"reference"}),a=B(t,{altBoundary:!0});r=R(i,r),n=R(a,n,o),o=q(r),a=q(n),t.modifiersData[e]={referenceClippingOffsets:r,popperEscapeOffsets:n,isReferenceHidden:o,hasPopperEscaped:a},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":o,"data-popper-escaped":a})}}],V=y({defaultModifiers:U});e.createPopper=V,e.defaultModifiers=U,e.popperGenerator=y,Object.defineProperty(e,"__esModule",{value:!0})}));
//# sourceMappingURL=popper.min.js.map