Current Path : /var/www/www-root/data/www/www.monolith-realty.ru/bitrix/js/ui/vue/portal/dist/ |
Current File : /var/www/www-root/data/www/www.monolith-realty.ru/bitrix/js/ui/vue/portal/dist/portal.bundle.min.js |
(function(){if(typeof this.BX!=="undefined"&&typeof this.BX.Vue!=="undefined"&&typeof this.BX.Vue.PortalVue!=="undefined"){var t="2.1.7";if(this.BX.Vue.PortalVue.version!==t){console.warn("BX.Vuex already loaded. Loaded: "+this.BX.Vue.PortalVue.version+", Skipped: "+t+". Version differences may cause errors!")}return}this.BX=this.BX||{};(function(t,e){"use strict"; /*! * portal-vue (C) Thorsten Lunborg, 2019 * Version: 2.1.7 * LICENCE: MIT * https://github.com/linusborg/portal-vue * * @source: https://unpkg.com/portal-vue@2.1.7/dist/portal-vue.esm.js */function r(t){if(typeof Symbol==="function"&&babelHelpers["typeof"](Symbol.iterator)==="symbol"){r=function t(e){return babelHelpers["typeof"](e)}}else{r=function t(e){return e&&typeof Symbol==="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":babelHelpers["typeof"](e)}}return r(t)}function n(t){return o(t)||s(t)||i()}function o(t){if(Array.isArray(t)){for(var e=0,r=new Array(t.length);e<t.length;e++)r[e]=t[e];return r}}function s(t){if(Symbol.iterator in Object(t)||Object.prototype.toString.call(t)==="[object Arguments]")return Array.from(t)}function i(){throw new TypeError("Invalid attempt to spread non-iterable instance")}var a=typeof window!=="undefined";function u(t){if(Array.isArray(t)||r(t)==="object"){return Object.freeze(t)}return t}function l(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};return t.reduce((function(t,r){var n=r.passengers[0];var o=typeof n==="function"?n(e):r.passengers;return t.concat(o)}),[])}function f(t,e){return t.map((function(t,e){return[e,t]})).sort((function(t,r){return e(t[1],r[1])||t[0]-r[0]})).map((function(t){return t[1]}))}function c(t,e){return e.reduce((function(e,r){if(t.hasOwnProperty(r)){e[r]=t[r]}return e}),{})}var p={};var d={};var h={};var g=e.VueVendor.extend({data:function t(){return{transports:p,targets:d,sources:h,trackInstances:a}},methods:{open:function t(r){if(!a)return;var n=r.to,o=r.from,s=r.passengers,i=r.order,l=i===void 0?Infinity:i;if(!n||!o||!s)return;var c={to:n,from:o,passengers:u(s),order:l};var p=Object.keys(this.transports);if(p.indexOf(n)===-1){e.VueVendor.set(this.transports,n,[])}var d=this.$_getTransportIndex(c);var h=this.transports[n].slice(0);if(d===-1){h.push(c)}else{h[d]=c}this.transports[n]=f(h,(function(t,e){return t.order-e.order}))},close:function t(e){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;var n=e.to,o=e.from;if(!n||!o&&r===false)return;if(!this.transports[n]){return}if(r){this.transports[n]=[]}else{var s=this.$_getTransportIndex(e);if(s>=0){var i=this.transports[n].slice(0);i.splice(s,1);this.transports[n]=i}}},registerTarget:function t(e,r,n){if(!a)return;if(this.trackInstances&&!n&&this.targets[e]){console.warn("[portal-vue]: Target ".concat(e," already exists"))}this.$set(this.targets,e,Object.freeze([r]))},unregisterTarget:function t(e){this.$delete(this.targets,e)},registerSource:function t(e,r,n){if(!a)return;if(this.trackInstances&&!n&&this.sources[e]){console.warn("[portal-vue]: source ".concat(e," already exists"))}this.$set(this.sources,e,Object.freeze([r]))},unregisterSource:function t(e){this.$delete(this.sources,e)},hasTarget:function t(e){return!!(this.targets[e]&&this.targets[e][0])},hasSource:function t(e){return!!(this.sources[e]&&this.sources[e][0])},hasContentFor:function t(e){return!!this.transports[e]&&!!this.transports[e].length},$_getTransportIndex:function t(e){var r=e.to,n=e.from;for(var o in this.transports[r]){if(this.transports[r][o].from===n){return+o}}return-1}}});var m=new g(p);var y=1;var v=e.VueVendor.extend({name:"portal",props:{disabled:{type:Boolean},name:{type:String,default:function t(){return String(y++)}},order:{type:Number,default:0},slim:{type:Boolean},slotProps:{type:Object,default:function t(){return{}}},tag:{type:String,default:"DIV"},to:{type:String,default:function t(){return String(Math.round(Math.random()*1e7))}}},created:function t(){var e=this;this.$nextTick((function(){m.registerSource(e.name,e)}))},mounted:function t(){if(!this.disabled){this.sendUpdate()}},updated:function t(){if(this.disabled){this.clear()}else{this.sendUpdate()}},beforeDestroy:function t(){m.unregisterSource(this.name);this.clear()},watch:{to:function t(e,r){r&&r!==e&&this.clear(r);this.sendUpdate()}},methods:{clear:function t(e){var r={from:this.name,to:e||this.to};m.close(r)},normalizeSlots:function t(){return this.$scopedSlots["default"]?[this.$scopedSlots["default"]]:this.$slots["default"]},normalizeOwnChildren:function t(e){return typeof e==="function"?e(this.slotProps):e},sendUpdate:function t(){var e=this.normalizeSlots();if(e){var r={from:this.name,to:this.to,passengers:n(e),order:this.order};m.open(r)}else{this.clear()}}},render:function t(e){var r=this.$slots["default"]||this.$scopedSlots["default"]||[];var n=this.tag;if(r&&this.disabled){return r.length<=1&&this.slim?this.normalizeOwnChildren(r)[0]:e(n,[this.normalizeOwnChildren(r)])}else{return this.slim?e():e(n,{class:{"v-portal":true},style:{display:"none"},key:"v-portal-placeholder"})}}});var S=e.VueVendor.extend({name:"portalTarget",props:{multiple:{type:Boolean,default:false},name:{type:String,required:true},slim:{type:Boolean,default:false},slotProps:{type:Object,default:function t(){return{}}},tag:{type:String,default:"div"},transition:{type:[String,Object,Function]}},data:function t(){return{transports:m.transports,firstRender:true}},created:function t(){var e=this;this.$nextTick((function(){m.registerTarget(e.name,e)}))},watch:{ownTransports:function t(){this.$emit("change",this.children().length>0)},name:function t(e,r){m.unregisterTarget(r);m.registerTarget(e,this)}},mounted:function t(){var e=this;if(this.transition){this.$nextTick((function(){e.firstRender=false}))}},beforeDestroy:function t(){m.unregisterTarget(this.name)},computed:{ownTransports:function t(){var e=this.transports[this.name]||[];if(this.multiple){return e}return e.length===0?[]:[e[e.length-1]]},passengers:function t(){return l(this.ownTransports,this.slotProps)}},methods:{children:function t(){return this.passengers.length!==0?this.passengers:this.$scopedSlots["default"]?this.$scopedSlots["default"](this.slotProps):this.$slots["default"]||[]},noWrapper:function t(){var t=this.slim&&!this.transition;if(t&&this.children().length>1){console.warn("[portal-vue]: PortalTarget with `slim` option received more than one child element.")}return t}},render:function t(e){var r=this.noWrapper();var n=this.children();var o=this.transition||this.tag;return r?n[0]:this.slim&&!o?e():e(o,{props:{tag:this.transition&&this.tag?this.tag:undefined},class:{"vue-portal-target":true}},n)}});var b=0;var T=["disabled","name","order","slim","slotProps","tag","to"];var $=["multiple","transition"];var P=e.VueVendor.extend({name:"MountingPortal",inheritAttrs:false,props:{append:{type:[Boolean,String]},bail:{type:Boolean},mountTo:{type:String,required:true},disabled:{type:Boolean},name:{type:String,default:function t(){return"mounted_"+String(b++)}},order:{type:Number,default:0},slim:{type:Boolean},slotProps:{type:Object,default:function t(){return{}}},tag:{type:String,default:"DIV"},to:{type:String,default:function t(){return String(Math.round(Math.random()*1e7))}},multiple:{type:Boolean,default:false},targetSlim:{type:Boolean},targetSlotProps:{type:Object,default:function t(){return{}}},targetTag:{type:String,default:"div"},transition:{type:[String,Object,Function]}},created:function t(){if(typeof document==="undefined")return;var e=document.querySelector(this.mountTo);if(!e){console.error("[portal-vue]: Mount Point '".concat(this.mountTo,"' not found in document"));return}var r=this.$props;if(m.targets[r.name]){if(r.bail){console.warn("[portal-vue]: Target ".concat(r.name," is already mounted.\n Aborting because 'bail: true' is set"))}else{this.portalTarget=m.targets[r.name]}return}var n=r.append;if(n){var o=typeof n==="string"?n:"DIV";var s=document.createElement(o);e.appendChild(s);e=s}var i=c(this.$props,$);i.slim=this.targetSlim;i.tag=this.targetTag;i.slotProps=this.targetSlotProps;i.name=this.to;this.portalTarget=new S({el:e,parent:this.$parent||this,propsData:i})},beforeDestroy:function t(){var e=this.portalTarget;if(this.append){var r=e.$el;r.parentNode.removeChild(r)}e.$destroy()},render:function t(e){if(!this.portalTarget){console.warn("[portal-vue] Target wasn't mounted");return e()}if(!this.$scopedSlots.manual){var r=c(this.$props,T);return e(v,{props:r,attrs:this.$attrs,on:this.$listeners,scopedSlots:this.$scopedSlots},this.$slots["default"])}var n=this.$scopedSlots.manual({to:this.to});if(Array.isArray(n)){n=n[0]}if(!n)return e();return n}});function V(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};t.component(e.portalName||"Portal",v);t.component(e.portalTargetName||"PortalTarget",S);t.component(e.MountingPortalName||"MountingPortal",P)}var w={install:V};w.version="2.1.7";t.PortalVue=w;t.Portal=v;t.PortalTarget=S;t.MountingPortal=P;t.Wormhole=m})(this.BX.Vue=this.BX.Vue||{},BX)})(); //# sourceMappingURL=portal.bundle.map.js