CoreFiles by mySites.guru
css-vars-ponyfill.min.js9 lines, 17,183 bytes, from Joomla_4.0.0-alpha5-Alpha-Full_Package.zip
Raw History Compare with 4.0.0-alpha3
md5
448b596c2e0b3759b123ddc27b30066d
sha1
2cf3585ec0d46726d414e45e3aef1e4fbefcdd49
sha256
79ab17681f9b0e0a318b8f999c0aa2a85fdc410a0c8c901a9018fff998a8ff60
/*!
 * css-vars-ponyfill
 * v1.10.0
 * https://github.com/jhildenbiddle/css-vars-ponyfill
 * (c) 2018 John Hildenbiddle <http://hildenbiddle.com>
 * MIT license
 */
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.cssVars=t()}(this,function(){"use strict";function e(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={mimeType:t.mimeType||null,onBeforeSend:t.onBeforeSend||Function.prototype,onSuccess:t.onSuccess||Function.prototype,onError:t.onError||Function.prototype,onComplete:t.onComplete||Function.prototype},r=Array.isArray(e)?e:[e],o=Array.apply(null,Array(r.length)).map(function(e){return null});function s(e,t){n.onError(e,r[t],t)}function a(e,t){var s=n.onSuccess(e,r[t],t);e=!1===s?"":s||e,o[t]=e,-1===o.indexOf(null)&&n.onComplete(o)}r.forEach(function(e,t){var r=document.createElement("a");r.setAttribute("href",e),r.href=String(r.href);var o=r.host!==location.host,i=r.protocol===location.protocol;if(o&&"undefined"!=typeof XDomainRequest)if(i){var u=new XDomainRequest;u.open("GET",e),u.timeout=0,u.onprogress=Function.prototype,u.ontimeout=Function.prototype,u.onload=function(){a(u.responseText,t)},u.onerror=function(e){s(u,t)},setTimeout(function(){u.send()},0)}else console.log("Internet Explorer 9 Cross-Origin (CORS) requests must use the same protocol"),s(null,t);else{var c=new XMLHttpRequest;c.open("GET",e),n.mimeType&&c.overrideMimeType&&c.overrideMimeType(n.mimeType),n.onBeforeSend(c,e,t),c.onreadystatechange=function(){4===c.readyState&&(200===c.status?a(c.responseText,t):s(c,t))},c.send()}})}function t(t){var r={cssComments:/\/\*[\s\S]+?\*\//g,cssImports:/(?:@import\s*)(?:url\(\s*)?(?:['"])([^'"]*)(?:['"])(?:\s*\))?(?:[^;]*;)/g},o={rootElement:t.rootElement||document,include:t.include||'style,link[rel="stylesheet"]',exclude:t.exclude||null,filter:t.filter||null,useCSSOM:t.useCSSOM||!1,onBeforeSend:t.onBeforeSend||Function.prototype,onSuccess:t.onSuccess||Function.prototype,onError:t.onError||Function.prototype,onComplete:t.onComplete||Function.prototype},s=Array.apply(null,o.rootElement.querySelectorAll(o.include)).filter(function(e){return t=e,n=o.exclude,!(t.matches||t.matchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector||t.msMatchesSelector||t.oMatchesSelector).call(t,n);var t,n}),a=Array.apply(null,Array(s.length)).map(function(e){return null});function i(){if(-1===a.indexOf(null)){var e=a.join("");o.onComplete(e,a,s)}}function u(t,n,r,s){var u=o.onSuccess(t,r,s);(function t(n,r,s,a){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[];var u=arguments.length>5&&void 0!==arguments[5]?arguments[5]:[];var l=c(n,s,u);l.rules.length?e(l.absoluteUrls,{onBeforeSend:function(e,t,n){o.onBeforeSend(e,r,t)},onSuccess:function(e,t,n){var s=o.onSuccess(e,r,t),a=c(e=!1===s?"":s||e,t,u);return a.rules.forEach(function(t,n){e=e.replace(t,a.absoluteRules[n])}),e},onError:function(e,o,c){i.push({xhr:e,url:o}),u.push(l.rules[c]),t(n,r,s,a,i,u)},onComplete:function(e){e.forEach(function(e,t){n=n.replace(l.rules[t],e)}),t(n,r,s,a,i,u)}}):a(n,i)})(t=!1===u?"":u||t,r,s,function(e,t){null===a[n]&&(t.forEach(function(e){return o.onError(e.xhr,r,e.url)}),!o.filter||o.filter.test(e)?a[n]=e:a[n]="",i())})}function c(e,t){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],s={};return s.rules=(e.replace(r.cssComments,"").match(r.cssImports)||[]).filter(function(e){return-1===o.indexOf(e)}),s.urls=s.rules.map(function(e){return e.replace(r.cssImports,"$1")}),s.absoluteUrls=s.urls.map(function(e){return n(e,t)}),s.absoluteRules=s.rules.map(function(e,r){var o=s.urls[r],a=n(s.absoluteUrls[r],t);return e.replace(o,a)}),s}s.length?s.forEach(function(t,r){var s=t.getAttribute("href"),c=t.getAttribute("rel"),l="LINK"===t.nodeName&&s&&c&&"stylesheet"===c.toLowerCase(),f="STYLE"===t.nodeName;if(l)e(s,{mimeType:"text/css",onBeforeSend:function(e,n,r){o.onBeforeSend(e,t,n)},onSuccess:function(e,o,a){var i=n(s,location.href);u(e,r,t,i)},onError:function(e,n,s){a[r]="",o.onError(e,t,n),i()}});else if(f){var p=t.textContent;o.useCSSOM&&(p=Array.apply(null,t.sheet.cssRules).map(function(e){return e.cssText}).join("")),u(p,r,t,location.href)}else a[r]="",i()}):o.onComplete("",[])}function n(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:location.href,n=document.implementation.createHTMLDocument(""),r=n.createElement("base"),o=n.createElement("a");return n.head.appendChild(r),n.body.appendChild(o),r.href=t,o.href=e,o.href}function r(){for(var e=function(e){return e instanceof Object&&e.constructor===Object},t=arguments.length,n=Array(t),o=0;o<t;o++)n[o]=arguments[o];return n.reduce(function(t,n){return Object.keys(n).forEach(function(o){var s=t[o],a=n[o];e(s)&&e(a)?t[o]=r(s,a):t[o]=a}),t},{})}var o=s;function s(e,t,n){e instanceof RegExp&&(e=a(e,n)),t instanceof RegExp&&(t=a(t,n));var r=i(e,t,n);return r&&{start:r[0],end:r[1],pre:n.slice(0,r[0]),body:n.slice(r[0]+e.length,r[1]),post:n.slice(r[1]+t.length)}}function a(e,t){var n=t.match(e);return n?n[0]:null}function i(e,t,n){var r,o,s,a,i,u=n.indexOf(e),c=n.indexOf(t,u+1),l=u;if(u>=0&&c>0){for(r=[],s=n.length;l>=0&&!i;)l==u?(r.push(l),u=n.indexOf(e,l+1)):1==r.length?i=[r.pop(),c]:((o=r.pop())<s&&(s=o,a=c),c=n.indexOf(t,l+1)),l=u<c&&u>=0?u:c;r.length&&(i=[s,a])}return i}function u(e){function t(e){throw new Error("CSS parse error: "+e)}function n(t){var n=t.exec(e);if(n)return e=e.slice(n[0].length),n}function r(){n(/^\s*/)}function o(){return n(/^{\s*/)}function s(){return n(/^}/)}function a(){if(r(),"/"===e[0]&&"*"===e[1]){for(var n=2;e[n]&&("*"!==e[n]||"/"!==e[n+1]);)n++;if(!e[n])return t("end of comment is missing");var o=e.slice(2,n);return e=e.slice(n+2),{type:"comment",comment:o}}}function i(){for(var e=[],t=void 0;t=a();)e.push(t);return e}function u(){for(r();"}"===e[0];)t("extra closing bracket");var o=n(/^(("(?:\\"|[^"])*"|'(?:\\'|[^'])*'|[^{])+)/);if(o)return o[0].trim().replace(/\/\*([^*]|[\r\n]|(\*+([^*\/]|[\r\n])))*\*\/+/g,"").replace(/"(?:\\"|[^"])*"|'(?:\\'|[^'])*'/g,function(e){return e.replace(/,/g,"‌")}).split(/\s*(?![^(]*\)),\s*/).map(function(e){return e.replace(/\u200C/g,",")})}function c(){n(/^([;\s]*)+/);var e=/\/\*[^*]*\*+([^\/*][^*]*\*+)*\//g,r=n(/^(\*?[-#\/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);if(r){if(r=r[0].trim(),!n(/^:\s*/))return t("property missing ':'");var o=n(/^((?:\/\*.*?\*\/|'(?:\\'|.)*?'|"(?:\\"|.)*?"|\((\s*'(?:\\'|.)*?'|"(?:\\"|.)*?"|[^)]*?)\s*\)|[^};])+)/),s={type:"declaration",property:r.replace(e,""),value:o?o[0].replace(e,"").trim():""};return n(/^[;\s]*/),s}}function l(){if(!o())return t("missing '{'");for(var e=void 0,n=i();e=c();)n.push(e),n=n.concat(i());return s()?n:t("missing '}'")}function f(){r();for(var e=[],t=void 0;t=n(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/);)e.push(t[1]),n(/^,\s*/);if(e.length)return{type:"keyframe",values:e,declarations:l()}}function p(){if(r(),"@"===e[0])return function(){var e=n(/^@([-\w]+)?keyframes\s*/);if(e){var r=e[1];if(!(e=n(/^([-\w]+)\s*/)))return t("@keyframes missing name");var a=e[1];if(!o())return t("@keyframes missing '{'");for(var u=void 0,c=i();u=f();)c.push(u),c=c.concat(i());return s()?{type:"keyframes",name:a,vendor:r,keyframes:c}:t("@keyframes missing '}'")}}()||function(){var e=n(/^@supports *([^{]+)/);if(e)return{type:"supports",supports:e[1].trim(),rules:d()}}()||function(){if(n(/^@host\s*/))return{type:"host",rules:d()}}()||function(){var e=n(/^@media *([^{]+)/);if(e)return{type:"media",media:e[1].trim(),rules:d()}}()||function(){var e=n(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);if(e)return{type:"custom-media",name:e[1].trim(),media:e[2].trim()}}()||function(){if(n(/^@page */))return{type:"page",selectors:u()||[],declarations:l()}}()||function(){var e=n(/^@([-\w]+)?document *([^{]+)/);if(e)return{type:"document",document:e[2].trim(),vendor:e[1]?e[1].trim():null,rules:d()}}()||function(){if(n(/^@font-face\s*/))return{type:"font-face",declarations:l()}}()||function(){var e=n(/^@(import|charset|namespace)\s*([^;]+);/);if(e)return{type:e[1],name:e[2].trim()}}()}function d(n){if(!n&&!o())return t("missing '{'");for(var r,a=void 0,c=i();e.length&&(n||"}"!==e[0])&&(a=p()||(void 0,(r=u()||[]).length||t("selector missing"),{type:"rule",selectors:r,declarations:l()}));)c.push(a),c=c.concat(i());return n||s()?c:t("missing '}'")}return{type:"stylesheet",stylesheet:{rules:d(!0),errors:[]}}}s.range=i;var c="--",l="var",f={root:{},user:{}};function p(e){var t,n,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a={},i=r({fixNestedCalc:!0,onlyVars:!0,persist:!1,preserve:!1,variables:{},onWarning:function(){}},s),p=i.persist?f.user:i.variables,m=u(e);if(i.onlyVars&&(m.stylesheet.rules=function e(t){return t.filter(function(t){if(t.declarations){var n=t.declarations.filter(function(e){var t=e.property&&0===e.property.indexOf(c),n=e.value&&e.value.indexOf(l+"(")>-1;return t||n});return"font-face"!==t.type&&(t.declarations=n),Boolean(n.length)}return t.keyframes?Boolean(t.keyframes.filter(function(e){return Boolean(e.declarations.filter(function(e){var t=e.property&&0===e.property.indexOf(c),n=e.value&&e.value.indexOf(l+"(")>-1;return t||n}).length)}).length):!t.rules||(t.rules=e(t.rules).filter(function(e){return e.declarations&&e.declarations.length}),Boolean(t.rules.length))})}(m.stylesheet.rules)),m.stylesheet.rules.forEach(function(e){var t=[];if("rule"===e.type&&1===e.selectors.length&&":root"===e.selectors[0]&&(e.declarations.forEach(function(e,n){var r=e.property,o=e.value;r&&0===r.indexOf(c)&&(a[r]=o,t.push(n))}),!i.preserve))for(var n=t.length-1;n>=0;n--)e.declarations.splice(t[n],1)}),Object.keys(i.variables).forEach(function(e){var t="--"+e.replace(/^-+/,""),n=i.variables[e];e!==t&&(i.variables[t]=n,delete i.variables[e]),i.persist&&(f.user[t]=n)}),Object.keys(p).length){var v={declarations:[],selectors:[":root"],type:"rule"};Object.keys(p).forEach(function(e){a[e]=p[e],v.declarations.push({type:"declaration",property:e,value:p[e]}),i.persist&&(f.user[e]=p[e])}),i.preserve&&m.stylesheet.rules.push(v)}return f.root=a,function e(t,n){t.rules.forEach(function(r){r.rules?e(r,n):r.keyframes?r.keyframes.forEach(function(e){"keyframe"===e.type&&n(e.declarations,r)}):r.declarations&&n(r.declarations,t)})}(m.stylesheet,function(e,t){for(var n=void 0,r=void 0,o=void 0,s=0;s<e.length;s++)o=(n=e[s]).value,"declaration"===n.type&&o&&-1!==o.indexOf(l+"(")&&(r=d(o,a,i))!==n.value&&(i.preserve?(e.splice(s,0,{type:n.type,property:n.property,value:r}),s++):n.value=r)}),i.fixNestedCalc&&(t=m.stylesheet.rules,n=/(-[a-z]+-)?calc\(/,t.forEach(function(e){e.declarations&&e.declarations.forEach(function(e){for(var t=e.value,r="";n.test(t);){var s=o("calc(",")",t||"");for(t=t.slice(s.end);n.test(s.body);){var a=o(n,")",s.body);s.body=a.pre+"("+a.body+")"+a.post}r+=s.pre+"calc("+s.body,r+=n.test(t)?"":")"+s.post}e.value=r||e.value})})),function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments[2],r={charset:function(e){return"@charset "+e.name+";"},comment:function(e){return 0===e.comment.indexOf("__CSSVARSPONYFILL")?"/*"+e.comment+"*/":""},"custom-media":function(e){return"@custom-media "+e.name+" "+e.media+";"},declaration:function(e){return e.property+":"+e.value+";"},document:function(e){return"@"+(e.vendor||"")+"document "+e.document+"{"+o(e.rules)+"}"},"font-face":function(e){return"@font-face{"+o(e.declarations)+"}"},host:function(e){return"@host{"+o(e.rules)+"}"},import:function(e){return"@import "+e.name+";"},keyframe:function(e){return e.values.join(",")+"{"+o(e.declarations)+"}"},keyframes:function(e){return"@"+(e.vendor||"")+"keyframes "+e.name+"{"+o(e.keyframes)+"}"},media:function(e){return"@media "+e.media+"{"+o(e.rules)+"}"},namespace:function(e){return"@namespace "+e.name+";"},page:function(e){return"@page "+(e.selectors.length?e.selectors.join(", "):"")+"{"+o(e.declarations)+"}"},rule:function(e){var t=e.declarations;if(t.length)return e.selectors.join(",")+"{"+o(t)+"}"},supports:function(e){return"@supports "+e.supports+"{"+o(e.rules)+"}"}};function o(e){for(var o="",s=0;s<e.length;s++){var a=e[s];n&&n(a);var i=r[a.type](a);i&&(o+=i,i.length&&a.selectors&&(o+=t))}return o}return o(e.stylesheet.rules)}(m)}function d(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments[3],s=o("var(",")",e),a="CSS transform warning:";return s?0===s.body.trim().length?(n.onWarning(a+" var() must contain a non-whitespace string"),e):s.pre+function(e){var o=e.split(",")[0],s=(e.match(/(?:\s*,\s*){1}(.*)?/)||[])[1],i=t.hasOwnProperty(o)?String(t[o]):void 0,u=i||(s?String(s):void 0),c=r||e;return i||n.onWarning(a+' variable "'+o+'" is undefined'),u&&"undefined"!==u&&u.length>0?d(u,t,n,c):"var("+c+")"}(s.body)+d(s.post,t,n):(-1!==e.indexOf("var(")&&n.onWarning(a+' missing closing ")" in the value "'+e+'"'),e)}var m="css-vars-ponyfill",v={rootElement:document,include:"style,link[rel=stylesheet]",exclude:"",fixNestedCalc:!0,onlyLegacy:!0,onlyVars:!1,preserve:!1,shadowDOM:!1,silent:!1,updateDOM:!0,updateURLs:!0,variables:{},watch:!1,onBeforeSend:function(){},onSuccess:function(){},onWarning:function(){},onError:function(){},onComplete:function(){}},y="undefined"!=typeof window,h=y&&window.CSS&&window.CSS.supports&&window.CSS.supports("(--a: 0)"),g={cssComments:/\/\*[\s\S]+?\*\//g,cssKeyframes:/@(?:-\w*-)?keyframes/,cssUrls:/url\((?!['"]?(?:data|http|\/\/):)['"]?([^'")]*)['"]?\)/g,cssVars:/(?:(?::root\s*{\s*[^;]*;*\s*)|(?:var\(\s*))(--[^:)]+)(?:\s*[:)])/},S=null;function E(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=r(v,e);function o(e,t,r,o){n.silent||console.error(e+"\n",t),n.onError(e,t,r,o)}function s(e){n.silent||console.warn(e),n.onWarning(e)}if(y)if("loading"!==document.readyState)if(h&&n.onlyLegacy)h&&n.updateDOM&&Object.keys(n.variables).forEach(function(e){var t="--"+e.replace(/^-+/,""),r=n.variables[e];document.documentElement.style.setProperty(t,r)});else{var a=m;n.watch&&function(e,t){if(window.MutationObserver&&!S){var n=function(e){return"LINK"===e.tagName&&-1!==(e.getAttribute("rel")||"").indexOf("stylesheet")},r=function(e){return"STYLE"===e.tagName&&(!t||e.id!==t)},o=null;(S=new MutationObserver(function(t){var s=!1;t.forEach(function(t){if("attributes"===t.type)s=n(t.target)||r(t.target);else if("childList"===t.type){var a=Array.apply(null,t.addedNodes),i=Array.apply(null,t.removedNodes);s=[].concat(a,i).some(function(e){var t=n(e)&&!e.disabled,o=r(e)&&!e.disabled&&g.cssVars.test(e.textContent);return t||o})}s&&(clearTimeout(o),o=setTimeout(function(){E(e)},1))})})).observe(document.documentElement,{attributes:!0,attributeFilter:["disabled","href"],childList:!0,subtree:!0})}}(n,a),t({include:n.include,exclude:"#"+a+(n.exclude?","+n.exclude:""),filter:n.onlyVars?g.cssVars:null,rootElement:n.rootElement,onBeforeSend:n.onBeforeSend,onSuccess:function(e,t,r){var o=n.onSuccess(e,t,r);(e=!1===o?"":o||e,n.updateURLs)&&(e.replace(g.cssComments,"").match(g.cssUrls)||[]).forEach(function(t){var n=t.replace(g.cssUrls,"$1"),o=b(n,r);e=e.replace(t,t.replace(n,o))});return e},onError:function(e,t,n){var r=e.responseURL||b(n,location.href),s=e.statusText?"("+e.statusText+")":"Unspecified Error"+(0===e.status?" (possibly CORS related)":"");o("CSS XHR Error: "+r+" "+e.status+" "+s,t,e,r)},onComplete:function(e,t,i){var u=null;e=t.map(function(e,t){return g.cssVars.test(e)?e:"/*__CSSVARSPONYFILL-"+t+"__*/"}).join("");try{e=p(e,{fixNestedCalc:n.fixNestedCalc,onlyVars:n.onlyVars,persist:n.updateDOM,preserve:n.preserve,variables:n.variables,onWarning:s});var c=g.cssKeyframes.test(e);if(e=e.replace(/\/\*__CSSVARSPONYFILL-(\d+)__\*\//g,function(e,n){return t[n]}),n.updateDOM&&i&&i.length){var l=i[i.length-1];(u=n.rootElement.querySelector("#"+a)||document.createElement("style")).setAttribute("id",a),u.textContent!==e&&(u.textContent=e),l.nextSibling!==u&&l.parentNode&&l.parentNode.insertBefore(u,l.nextSibling),c&&function(e){var t=["animation-name","-moz-animation-name","-webkit-animation-name"].filter(function(e){return getComputedStyle(document.body)[e]})[0];if(t){for(var n=e.getElementsByTagName("*"),r=[],o=0,s=n.length;o<s;o++){var a=n[o],i=getComputedStyle(a)[t];"none"!==i&&(a.style[t]+="__CSSVARSPONYFILL-KEYFRAMES__",r.push(a))}document.body.offsetHeight;for(var u=0,c=r.length;u<c;u++){var l=r[u].style;l[t]=l[t].replace("__CSSVARSPONYFILL-KEYFRAMES__","")}}}(n.rootElement)}}catch(e){var d=!1;t.forEach(function(e,t){try{e=p(e,n)}catch(e){var r=i[t-0];d=!0,o(e.message,r)}}),d||o(e.message||e)}if(n.shadowDOM)for(var m,v=n.rootElement.querySelectorAll("*"),y=0;m=v[y];++y){if(m.shadowRoot&&m.shadowRoot.querySelector("style"))E(r(n,{rootElement:m.shadowRoot,variables:f.root}))}n.onComplete(e,u,f.root)}})}else document.addEventListener("DOMContentLoaded",function t(n){E(e),document.removeEventListener("DOMContentLoaded",t)})}function b(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:location.href,n=document.implementation.createHTMLDocument(""),r=n.createElement("base"),o=n.createElement("a");return n.head.appendChild(r),n.body.appendChild(o),r.href=t,o.href=e,o.href}return E});
//# sourceMappingURL=css-vars-ponyfill.min.js.map

No other release has this exact content. See every version of this file.