/
bundle.forms.pagesmartlinkwidget.min.js
1 lines (1 loc) · 6.38 KB
/
bundle.forms.pagesmartlinkwidget.min.js
1
!function(t){function e(n){if(o[n])return o[n].exports;var r=o[n]={i:n,l:!1,exports:{}};return t[n].call(r.exports,r,r.exports,e),r.l=!0,r.exports}(function(){var t=this,e=void 0;Function.prototype.bind||(Function.prototype.bind=function(t){if("function"!=typeof this)throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable");var e=Array.prototype.slice.call(arguments,1),n=this,o=function(){},r=function(){return n.apply(this instanceof o?this:t,e.concat(Array.prototype.slice.call(arguments)))};return this.prototype&&(o.prototype=this.prototype),r.prototype=new o,r}),Object.keys||(Object.keys=function(){"use strict";var t=Object.prototype.hasOwnProperty,e=!{toString:null}.propertyIsEnumerable("toString"),n=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],o=n.length;return function(r){if("object"!=typeof r&&("function"!=typeof r||null===r))throw new TypeError("Object.keys called on non-object");var i,c,u=[];for(i in r)t.call(r,i)&&u.push(i);if(e)for(c=0;c<o;c++)t.call(r,n[c])&&u.push(n[c]);return u}}()),t.Promise||function(t){function n(){}function o(t,e){return function(){t.apply(e,arguments)}}function r(t){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof t)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],l(t,this)}function i(t,e){for(;3===t._state;)t=t._value;if(0===t._state)return void t._deferreds.push(e);t._handled=!0,r._immediateFn(function(){var n=1===t._state?e.onFulfilled:e.onRejected;if(null===n)return void(1===t._state?c:u)(e.promise,t._value);var o;try{o=n(t._value)}catch(t){return void u(e.promise,t)}c(e.promise,o)})}function c(t,e){try{if(e===t)throw new TypeError("A promise cannot be resolved with itself.");if(e&&("object"==typeof e||"function"==typeof e)){var n=e.then;if(e instanceof r)return t._state=3,t._value=e,void f(t);if("function"==typeof n)return void l(o(n,e),t)}t._state=1,t._value=e,f(t)}catch(e){u(t,e)}}function u(t,e){t._state=2,t._value=e,f(t)}function f(t){2===t._state&&0===t._deferreds.length&&r._immediateFn(function(){t._handled||r._unhandledRejectionFn(t._value)});for(var e=0,n=t._deferreds.length;e<n;e++)i(t,t._deferreds[e]);t._deferreds=null}function a(t,e,n){this.onFulfilled="function"==typeof t?t:null,this.onRejected="function"==typeof e?e:null,this.promise=n}function l(t,e){var n=!1;try{t(function(t){n||(n=!0,c(e,t))},function(t){n||(n=!0,u(e,t))})}catch(t){if(n)return;n=!0,u(e,t)}}var s=setTimeout;r.prototype.catch=function(t){return this.then(null,t)},r.prototype.then=function(t,e){var o=new this.constructor(n);return i(this,new a(t,e,o)),o},r.all=function(t){var e=Array.prototype.slice.call(t);return new r(function(t,n){function o(i,c){try{if(c&&("object"==typeof c||"function"==typeof c)){var u=c.then;if("function"==typeof u)return void u.call(c,function(t){o(i,t)},n)}e[i]=c,0==--r&&t(e)}catch(t){n(t)}}if(0===e.length)return t([]);for(var r=e.length,i=0;i<e.length;i++)o(i,e[i])})},r.resolve=function(t){return t&&"object"==typeof t&&t.constructor===r?t:new r(function(e){e(t)})},r.reject=function(t){return new r(function(e,n){n(t)})},r.race=function(t){return new r(function(e,n){for(var o=0,r=t.length;o<r;o++)t[o].then(e,n)})},r._immediateFn="function"==typeof setImmediate&&function(t){setImmediate(t)}||function(t){s(t,0)},r._unhandledRejectionFn=function(t){"undefined"!=typeof console&&console},r._setImmediateFn=function(t){r._immediateFn=t},r._setUnhandledRejectionFn=function(t){r._unhandledRejectionFn=t},void 0!==e&&e.exports?e.exports=r:t.Promise||(t.Promise=r)}(this),function(){Object.defineProperty||"__defineGetter__"in{}&&(Object.defineProperty=function(t,e,n){n.get&&t.__defineGetter__(e,function(){return n.get.call(t)}),n.set&&t.__defineSetter__(e,function(e){return n.set.call(t,e)})})}()}).call(function(){return"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:void 0}());var n=window.cmsWebpackJsonp;window.cmsWebpackJsonp=function(e,o,i){for(var c,u,f=0,a=[];f<e.length;f++)u=e[f],r[u]&&a.push(r[u][0]),r[u]=0;for(c in o)Object.prototype.hasOwnProperty.call(o,c)&&(t[c]=o[c]);for(n&&n(e,o,i);a.length;)a.shift()()};var o={},r={6:0};e.e=function(t){function n(){u.onerror=u.onload=null,clearTimeout(f);var e=r[t];0!==e&&(e&&e[1](new Error("Loading chunk "+t+" failed.")),r[t]=void 0)}var o=r[t];if(0===o)return new Promise(function(t){t()});if(o)return o[2];var i=new Promise(function(e,n){o=r[t]=[e,n]});o[2]=i;var c=document.getElementsByTagName("head")[0],u=document.createElement("script");u.type="text/javascript",u.charset="utf-8",u.async=!0,u.timeout=12e4,e.nc&&u.setAttribute("nonce",e.nc),u.src=e.p+"bundle."+({0:"admin.widget"}[t]||t)+".min.js";var f=setTimeout(n,12e4);return u.onerror=u.onload=n,c.appendChild(u),i},e.m=t,e.c=o,e.d=function(t,n,o){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:o})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e.oe=function(t){throw t},e(e.s=350)}({350:function(t,e,n){n.p=n(53)("bundle.forms.pagesmartlinkwidget"),n.e(0).then(function(t){var e=n(0),o=n(11);n(352);var r=new o({initialize:function(t){this.options=e.extend(!0,{},this.options,t),this._setup(t)},_setup:function(t){e("#"+t.id).select2({placeholder:t.text,allowClear:!0,multiple:!1,ajax:{url:t.url,dataType:"json",data:function(e){return{q:e,language_code:t.lang}},results:function(t){return{more:!1,results:e.map(t,function(t){return{id:t.redirect_url,text:t.title+" (/"+t.path+")"}})}}},createSearchChoice:function(t,n){if(0===e(n).filter(function(){return 0===this.text.localeCompare(t)}).length)return{id:t,text:t}},initSelection:function(t,e){e({id:t.val(),text:t.val()})}})}});window.CMS=window.CMS||{},window.CMS.PageSmartLinkWidget=r,e(function(){window.CMS.Widgets._pageSmartLinkWidgets.forEach(function(t){new r(t)})})}.bind(null,n)).catch(n.oe)},53:function(t,e){var n=function(t){var e=new RegExp(t+".*$","gi");if(document.currentScript)return document.currentScript.src.replace(e,"");var n,o;return n=document.getElementsByTagName("script"),o=function(t,n){for(var o,r,i=0;i<t.length;i++)if(r=null,void 0!==t[i].getAttribute.length&&(r=t[i].getAttribute(n,2)),r&&(o=r,o=o.split("?")[0].split("/").pop(),o.match(e)))return r}(n,"src"),o?o.replace(e,""):""};t.exports=n}});