File: /home/salamatk/takarzan.ir/wp-content/themes/xts-luman/js/vimeo-player.min.js
((e,t)=>{"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):((e=e||self).Vimeo=e.Vimeo||{},e.Vimeo.Player=t())})(this,function(){function r(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}var e="undefined"!=typeof global&&"[object global]"==={}.toString.call(global);function i(e,t){return 0===e.indexOf(t.toLowerCase())?e:"".concat(t.toLowerCase()).concat(e.substr(0,1).toUpperCase()).concat(e.substr(1))}function c(e){return/^(https?:)?\/\/((player|www)\.)?vimeo\.com(?=$|\/)/.test(e)}function s(e){var t,e=0<arguments.length&&void 0!==e?e:{},n=e.id,e=n||e.url;if(!e)throw new Error("An id or url must be passed, either in an options object or as a data-vimeo-id or data-vimeo-url attribute.");if(t=e,!isNaN(parseFloat(t))&&isFinite(t)&&Math.floor(t)==t)return"https://vimeo.com/".concat(e);if(c(e))return e.replace("http:","https:");if(n)throw new TypeError("“".concat(n,"” is not a valid video id."));throw new TypeError("“".concat(e,"” is not a vimeo.com url."))}var t=void 0!==Array.prototype.indexOf,n="undefined"!=typeof window&&void 0!==window.postMessage;if(!(e||t&&n))throw new Error("Sorry, the Vimeo Player API is not available in this browser.");var o,a,u="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function l(){if(void 0===this)throw new TypeError("Constructor WeakMap requires 'new'");if(a(this,"_id","_WeakMap_"+d()+"."+d()),0<arguments.length)throw new TypeError("WeakMap iterable is not supported")}function f(e,t){if(!h(e)||!o.call(e,"_id"))throw new TypeError(t+" method called on incompatible receiver "+typeof e)}function d(){return Math.random().toString().substring(2)}function h(e){return Object(e)===e}(t="undefined"!=typeof self?self:"undefined"!=typeof window?window:u).WeakMap||(o=Object.prototype.hasOwnProperty,t.WeakMap=((a=function(e,t,n){Object.defineProperty?Object.defineProperty(e,t,{configurable:!0,writable:!0,value:n}):e[t]=n})(l.prototype,"delete",function(e){var t;return f(this,"delete"),!!h(e)&&!(!(t=e[this._id])||t[0]!==e||(delete e[this._id],0))}),a(l.prototype,"get",function(e){var t;return f(this,"get"),h(e)&&(t=e[this._id])&&t[0]===e?t[1]:void 0}),a(l.prototype,"has",function(e){var t;return f(this,"has"),!!h(e)&&!(!(t=e[this._id])||t[0]!==e)}),a(l.prototype,"set",function(e,t){var n;if(f(this,"set"),h(e))return(n=e[this._id])&&n[0]===e?n[1]=t:a(e,this._id,[e,t]),this;throw new TypeError("Invalid value used as weak map key")}),a(l,"_polyfill",!0),l));(function(e){var t,n,o;o=function(){var t,n,o,r,i,e=Object.prototype.toString,a="undefined"!=typeof setImmediate?function(e){return setImmediate(e)}:setTimeout;try{Object.defineProperty({},"x",{}),t=function(e,t,n,o){return Object.defineProperty(e,t,{value:n,writable:!0,configurable:!1!==o})}}catch(e){t=function(e,t,n){return e[t]=n,e}}function u(e,t){this.fn=e,this.self=t,this.next=void 0}function c(e,t){m.add(e,t),n=n||a(m.drain)}function s(e){var t,n=typeof e;return"function"==typeof(t=null==e||"object"!=n&&"function"!=n?t:e.then)&&t}function l(){for(var e=0;e<this.chain.length;e++){n=t=i=r=o=void 0;var t,n,o=this,r=1===this.state?this.chain[e].success:this.chain[e].failure,i=this.chain[e];try{!1===r?i.reject(o.msg):(t=!0===r?o.msg:r.call(void 0,o.msg))===i.promise?i.reject(TypeError("Promise-chain cycle")):(n=s(t))?n.call(t,i.resolve,i.reject):i.resolve(t)}catch(e){i.reject(e)}}this.chain.length=0}function f(e){var n,o=this;if(!o.triggered){o.triggered=!0,o.def&&(o=o.def);try{(n=s(e))?c(function(){var t=new v(o);try{n.call(e,function(){f.apply(t,arguments)},function(){d.apply(t,arguments)})}catch(e){d.call(t,e)}}):(o.msg=e,o.state=1,0<o.chain.length&&c(l,o))}catch(e){d.call(new v(o),e)}}}function d(e){var t=this;t.triggered||(t.triggered=!0,(t=t.def?t.def:t).msg=e,t.state=2,0<t.chain.length&&c(l,t))}function h(e,n,o,r){for(var t=0;t<n.length;t++)(t=>{e.resolve(n[t]).then(function(e){o(t,e)},r)})(t)}function v(e){this.def=e,this.triggered=!1}function p(e){this.promise=e,this.state=0,this.triggered=!1,this.chain=[],this.msg=void 0}function y(e){if("function"!=typeof e)throw TypeError("Not a function");if(0!==this.__NPO__)throw TypeError("Not a promise");this.__NPO__=1;var o=new p(this);this.then=function(e,t){var n={success:"function"!=typeof e||e,failure:"function"==typeof t&&t};return n.promise=new this.constructor(function(e,t){if("function"!=typeof e||"function"!=typeof t)throw TypeError("Not a function");n.resolve=e,n.reject=t}),o.chain.push(n),0!==o.state&&c(l,o),n.promise},this.catch=function(e){return this.then(void 0,e)};try{e.call(void 0,function(e){f.call(o,e)},function(e){d.call(o,e)})}catch(e){d.call(o,e)}}var m={add:function(e,t){i=new u(e,t),r?r.next=i:o=i,r=i},drain:function(){var e=o;for(o=r=n=void 0;e;)e.fn.call(e.self),e=e.next}},g=t({},"constructor",y,!1);return t(y.prototype=g,"__NPO__",0,!1),t(y,"resolve",function(n){return n&&"object"==typeof n&&1===n.__NPO__?n:new this(function(e,t){if("function"!=typeof e||"function"!=typeof t)throw TypeError("Not a function");e(n)})}),t(y,"reject",function(n){return new this(function(e,t){if("function"!=typeof e||"function"!=typeof t)throw TypeError("Not a function");t(n)})}),t(y,"all",function(t){var a=this;return"[object Array]"!=e.call(t)?a.reject(TypeError("Not an array")):0===t.length?a.resolve([]):new a(function(n,e){if("function"!=typeof n||"function"!=typeof e)throw TypeError("Not a function");var o=t.length,r=Array(o),i=0;h(a,t,function(e,t){r[e]=t,++i===o&&n(r)},e)})}),t(y,"race",function(t){var o=this;return"[object Array]"!=e.call(t)?o.reject(TypeError("Not an array")):new o(function(n,e){if("function"!=typeof n||"function"!=typeof e)throw TypeError("Not a function");h(o,t,function(e,t){n(t)},e)})}),y},(n=u)[t="Promise"]=n[t]||o(),e.exports&&(e.exports=n[t])})(n={exports:{}});var v=n.exports,p=new WeakMap;function y(e,t,n){var o=p.get(e.element)||{};t in o||(o[t]=[]),o[t].push(n),p.set(e.element,o)}function m(e,t){return(p.get(e.element)||{})[t]||[]}function g(e,t,n){var o=p.get(e.element)||{};return!o[t]||(n?(-1!==(n=o[t].indexOf(n))&&o[t].splice(n,1),p.set(e.element,o),o[t]&&0===o[t].length):(o[t]=[],p.set(e.element,o),!0))}var w=["autopause","autoplay","background","byline","color","controls","dnt","height","id","loop","maxheight","maxwidth","muted","playsinline","portrait","responsive","speed","texttrack","title","transparent","url","width"];function b(o,e){return w.reduce(function(e,t){var n=o.getAttribute("data-vimeo-".concat(t));return!n&&""!==n||(e[t]=""===n?1:n),e},1<arguments.length&&void 0!==e?e:{})}function k(e,t){var n,e=e.html;if(t)return null===t.getAttribute("data-vimeo-initialized")&&((n=document.createElement("div")).innerHTML=e,t.appendChild(n.firstChild),t.setAttribute("data-vimeo-initialized","true")),t.querySelector("iframe");throw new TypeError("An element must be provided")}function E(i,e,t){var a=1<arguments.length&&void 0!==e?e:{},u=2<arguments.length?t:void 0;return new Promise(function(t,n){if(!c(i))throw new TypeError("“".concat(i,"” is not a vimeo.com url."));var e,o="https://vimeo.com/api/oembed.json?url=".concat(encodeURIComponent(i));for(e in a)a.hasOwnProperty(e)&&(o+="&".concat(e,"=").concat(encodeURIComponent(a[e])));var r=new("XDomainRequest"in window?XDomainRequest:XMLHttpRequest);r.open("GET",o,!0),r.onload=function(){if(404===r.status)n(new Error("“".concat(i,"” was not found.")));else if(403===r.status)n(new Error("“".concat(i,"” is not embeddable.")));else try{var e=JSON.parse(r.responseText);403===e.domain_status_code?(k(e,u),n(new Error("“".concat(i,"” is not embeddable.")))):t(e)}catch(e){n(e)}},r.onerror=function(){var e=r.status?" (".concat(r.status,")"):"";n(new Error("There was an error fetching the embed code from Vimeo".concat(e,".")))},r.send()})}function T(e){function n(e){"console"in window&&console.error&&console.error("There was an error creating an embed: ".concat(e))}e=0<arguments.length&&void 0!==e?e:document,e=[].slice.call(e.querySelectorAll("[data-vimeo-id], [data-vimeo-url]"));e.forEach(function(t){try{var e;null===t.getAttribute("data-vimeo-defer")&&E(s(e=b(t)),e,t).then(function(e){return k(e,t)}).catch(n)}catch(e){n(e)}})}function _(e){if("string"==typeof e)try{e=JSON.parse(e)}catch(e){return console.warn(e),{}}return e}function M(e,t,n){e.element.contentWindow&&e.element.contentWindow.postMessage&&(t={method:t},void 0!==n&&(t.value=n),8<=(n=parseFloat(navigator.userAgent.toLowerCase().replace(/^.*msie (\d+).*$/,"$1")))&&n<10&&(t=JSON.stringify(t)),e.element.contentWindow.postMessage(t,e.origin))}function j(n,o){var t,e,r,i,a=[];(o=_(o)).event?("error"===o.event&&m(n,o.data.method).forEach(function(e){var t=new Error(o.data.message);t.name=o.data.name,e.reject(t),g(n,o.data.method,e)}),a=m(n,"event:".concat(o.event)),t=o.data):o.method&&(e=n,r=o.method,r=!((i=m(e,r)).length<1)&&(g(e,r,e=i.shift()),e))&&(a.push(r),t=o.value),a.forEach(function(e){try{"function"==typeof e?e.call(n,t):e.resolve(t)}catch(e){}})}var P=new WeakMap,N=new WeakMap,t=(()=>{function o(i){var a=this,n=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},e=this,t=o;if(!(e instanceof t))throw new TypeError("Cannot call a class as a function");if(window.jQuery&&i instanceof jQuery&&(1<i.length&&window.console&&console.warn&&console.warn("A jQuery object with multiple elements was passed, using the first element."),i=i[0]),"undefined"!=typeof document&&"string"==typeof i&&(i=document.getElementById(i)),e=i,!Boolean(e&&1===e.nodeType&&"nodeName"in e&&e.ownerDocument&&e.ownerDocument.defaultView))throw new TypeError("You must pass either a valid element or a valid id.");var u=i.ownerDocument.defaultView;if("IFRAME"===(i="IFRAME"!==i.nodeName&&(t=i.querySelector("iframe"))?t:i).nodeName&&!c(i.getAttribute("src")||""))throw new Error("The player element passed isn’t a Vimeo embed.");if(P.has(i))return P.get(i);this.element=i,this.origin="*";e=new v(function(o,r){function e(e){var t,n;c(e.origin)&&a.element.contentWindow===e.source&&("*"===a.origin&&(a.origin=e.origin),(e=_(e.data))&&"error"===e.event&&e.data&&"ready"===e.data.method?((t=new Error(e.data.message)).name=e.data.name,r(t)):(t=e&&"ready"===e.event,n=e&&"ping"===e.method,t||n?(a.element.setAttribute("data-ready","true"),o()):j(a,e)))}var t;u.addEventListener?u.addEventListener("message",e,!1):u.attachEvent&&u.attachEvent("onmessage",e),"IFRAME"!==a.element.nodeName&&E(s(t=b(i,n)),t,i).then(function(e){var t,n,o=k(e,i);return a.element=o,a._originalElement=i,t=i,o=o,n=p.get(t),p.set(o,n),p.delete(t),P.set(a.element,a),e}).catch(r)});return N.set(this,e),P.set(this.element,this),"IFRAME"===this.element.nodeName&&M(this,"ping"),this}var e,t,n;return e=o,(t=[{key:"callMethod",value:function(n){var o=this,r=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};return new v(function(e,t){return o.ready().then(function(){y(o,n,{resolve:e,reject:t}),M(o,n,r)}).catch(t)})}},{key:"get",value:function(n){var o=this;return new v(function(e,t){return n=i(n,"get"),o.ready().then(function(){y(o,n,{resolve:e,reject:t}),M(o,n)}).catch(t)})}},{key:"set",value:function(n,o){var r=this;return new v(function(e,t){if(n=i(n,"set"),null==o)throw new TypeError("There must be a value to set.");return r.ready().then(function(){y(r,n,{resolve:e,reject:t}),M(r,n,o)}).catch(t)})}},{key:"on",value:function(e,t){if(!e)throw new TypeError("You must pass an event name.");if(!t)throw new TypeError("You must pass a callback function.");if("function"!=typeof t)throw new TypeError("The callback must be a function.");0===m(this,"event:".concat(e)).length&&this.callMethod("addEventListener",e).catch(function(){}),y(this,"event:".concat(e),t)}},{key:"off",value:function(e,t){if(!e)throw new TypeError("You must pass an event name.");if(t&&"function"!=typeof t)throw new TypeError("The callback must be a function.");g(this,"event:".concat(e),t)&&this.callMethod("removeEventListener",e).catch(function(e){})}},{key:"loadVideo",value:function(e){return this.callMethod("loadVideo",e)}},{key:"ready",value:function(){var e=N.get(this)||new v(function(e,t){t(new Error("Unknown player. Probably unloaded."))});return v.resolve(e)}},{key:"addCuePoint",value:function(e){return this.callMethod("addCuePoint",{time:e,data:1<arguments.length&&void 0!==arguments[1]?arguments[1]:{}})}},{key:"removeCuePoint",value:function(e){return this.callMethod("removeCuePoint",e)}},{key:"enableTextTrack",value:function(e,t){if(e)return this.callMethod("enableTextTrack",{language:e,kind:t});throw new TypeError("You must pass a language.")}},{key:"disableTextTrack",value:function(){return this.callMethod("disableTextTrack")}},{key:"pause",value:function(){return this.callMethod("pause")}},{key:"play",value:function(){return this.callMethod("play")}},{key:"unload",value:function(){return this.callMethod("unload")}},{key:"destroy",value:function(){var t=this;return new v(function(e){N.delete(t),P.delete(t.element),t._originalElement&&(P.delete(t._originalElement),t._originalElement.removeAttribute("data-vimeo-initialized")),t.element&&"IFRAME"===t.element.nodeName&&t.element.parentNode&&t.element.parentNode.removeChild(t.element),e()})}},{key:"getAutopause",value:function(){return this.get("autopause")}},{key:"setAutopause",value:function(e){return this.set("autopause",e)}},{key:"getBuffered",value:function(){return this.get("buffered")}},{key:"getColor",value:function(){return this.get("color")}},{key:"setColor",value:function(e){return this.set("color",e)}},{key:"getCuePoints",value:function(){return this.get("cuePoints")}},{key:"getCurrentTime",value:function(){return this.get("currentTime")}},{key:"setCurrentTime",value:function(e){return this.set("currentTime",e)}},{key:"getDuration",value:function(){return this.get("duration")}},{key:"getEnded",value:function(){return this.get("ended")}},{key:"getLoop",value:function(){return this.get("loop")}},{key:"setLoop",value:function(e){return this.set("loop",e)}},{key:"setMuted",value:function(e){return this.set("muted",e)}},{key:"getMuted",value:function(){return this.get("muted")}},{key:"getPaused",value:function(){return this.get("paused")}},{key:"getPlaybackRate",value:function(){return this.get("playbackRate")}},{key:"setPlaybackRate",value:function(e){return this.set("playbackRate",e)}},{key:"getPlayed",value:function(){return this.get("played")}},{key:"getSeekable",value:function(){return this.get("seekable")}},{key:"getSeeking",value:function(){return this.get("seeking")}},{key:"getTextTracks",value:function(){return this.get("textTracks")}},{key:"getVideoEmbedCode",value:function(){return this.get("videoEmbedCode")}},{key:"getVideoId",value:function(){return this.get("videoId")}},{key:"getVideoTitle",value:function(){return this.get("videoTitle")}},{key:"getVideoWidth",value:function(){return this.get("videoWidth")}},{key:"getVideoHeight",value:function(){return this.get("videoHeight")}},{key:"getVideoUrl",value:function(){return this.get("videoUrl")}},{key:"getVolume",value:function(){return this.get("volume")}},{key:"setVolume",value:function(e){return this.set("volume",e)}}])&&r(e.prototype,t),n&&r(e,n),o})();return e||(T(),function(e){var o=0<arguments.length&&void 0!==e?e:document;window.VimeoPlayerResizeEmbeds_||(window.VimeoPlayerResizeEmbeds_=!0,e=function(e){if(c(e.origin)&&e.data&&"spacechange"===e.data.event)for(var t=o.querySelectorAll("iframe"),n=0;n<t.length;n++)if(t[n].contentWindow===e.source){t[n].parentElement.style.paddingBottom="".concat(e.data.data[0].bottom,"px");break}},window.addEventListener?window.addEventListener("message",e,!1):window.attachEvent&&window.attachEvent("onmessage",e))}()),t});