silverstripe-tagfield/client/dist/js/bundle.js

1 line
17 KiB
JavaScript

!function(t){function e(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,e),o.l=!0,o.exports}var n={};e.m=t,e.c=n,e.i=function(t){return t},e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:r})},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(e.s="./client/src/bundles/bundle.js")}({"./client/src/bundles/bundle.js":function(t,e,n){n("./client/src/legacy/entwine/TagField.js")},"./client/src/components/TagField.js":function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function s(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var a=n(0),i=n.n(a),h=n(3),u=n.n(h),l=n(1),c=n.n(l),p=n("./node_modules/url/url.js"),f=n.n(p),d=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},m=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),y=function(t){function e(t){r(this,e);var n=o(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));return n.state={value:t.value},n.onChange=n.onChange.bind(n),n.getOptions=n.getOptions.bind(n),n}return s(e,t),m(e,[{key:"onChange",value:function(t){this.setState({value:t}),"function"==typeof this.props.onChange&&this.props.onChange(t)}},{key:"getOptions",value:function(t){if(!this.props.lazyLoad)return Promise.resolve({options:this.props.options});if(!t)return Promise.resolve({options:[]});var e=f.a.parse(this.props.optionUrl,!0);return e.query.term=t,c()(f.a.format(e),{credentials:"same-origin"}).then(function(t){return t.json()}).then(function(t){return{options:t.items}})}},{key:"render",value:function(){var t=this.props.lazyLoad?{loadOptions:this.getOptions}:{options:this.props.options},e=u.a;return this.props.lazyLoad&&this.props.creatable?e=u.a.AsyncCreatable:this.props.lazyLoad?e=u.a.Async:this.props.creatable&&(e=u.a.Creatable),i.a.createElement(e,d({name:this.props.name,multi:this.props.multiple,value:this.state.value,onChange:this.onChange,onBlur:this.props.onBlur,valueKey:this.props.valueKey,labelKey:this.props.labelKey,inputProps:{className:"no-change-track"}},t))}}]),e}(a.Component);y.propTypes={name:a.PropTypes.string.required,labelKey:a.PropTypes.string.required,valueKey:a.PropTypes.string.required,lazyLoad:a.PropTypes.bool.required,creatable:a.PropTypes.bool.required,multiple:a.PropTypes.bool.required,disabled:a.PropTypes.bool,options:a.PropTypes.arrayOf(a.PropTypes.object),optionUrl:a.PropTypes.string,value:a.PropTypes.any,onChange:a.PropTypes.func,onBlur:a.PropTypes.func},y.defaultProps={labelKey:"Title",valueKey:"Value",disabled:!1},e.a=y},"./client/src/legacy/entwine/TagField.js":function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),o=n.n(r),s=n(2),a=n.n(s),i=n("./client/src/components/TagField.js"),h=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t};window.jQuery.entwine("ss",function(t){t(".js-injector-boot .ss-tag-field").entwine({onmatch:function(){var t=this,e=h({},this.data("schema"),{onBlur:function(){t.parents(".cms-edit-form:first").trigger("change")}});a.a.render(o.a.createElement(i.a,e),this[0])},onunmatch:function(){a.a.unmountComponentAtNode(this[0])}})})},"./node_modules/punycode/punycode.js":function(t,e,n){(function(t,r){var o;!function(r){function s(t){throw new RangeError(I[t])}function a(t,e){for(var n=t.length,r=[];n--;)r[n]=e(t[n]);return r}function i(t,e){var n=t.split("@"),r="";return n.length>1&&(r=n[0]+"@",t=n[1]),t=t.replace(T,"."),r+a(t.split("."),e).join(".")}function h(t){for(var e,n,r=[],o=0,s=t.length;o<s;)e=t.charCodeAt(o++),e>=55296&&e<=56319&&o<s?(n=t.charCodeAt(o++),56320==(64512&n)?r.push(((1023&e)<<10)+(1023&n)+65536):(r.push(e),o--)):r.push(e);return r}function u(t){return a(t,function(t){var e="";return t>65535&&(t-=65536,e+=R(t>>>10&1023|55296),t=56320|1023&t),e+=R(t)}).join("")}function l(t){return t-48<10?t-22:t-65<26?t-65:t-97<26?t-97:g}function c(t,e){return t+22+75*(t<26)-((0!=e)<<5)}function p(t,e,n){var r=0;for(t=n?U(t/x):t>>1,t+=U(t/e);t>k*O>>1;r+=g)t=U(t/k);return U(r+(k+1)*t/(t+w))}function f(t){var e,n,r,o,a,i,h,c,f,d,m=[],y=t.length,v=0,w=P,x=C;for(n=t.lastIndexOf(q),n<0&&(n=0),r=0;r<n;++r)t.charCodeAt(r)>=128&&s("not-basic"),m.push(t.charCodeAt(r));for(o=n>0?n+1:0;o<y;){for(a=v,i=1,h=g;o>=y&&s("invalid-input"),c=l(t.charCodeAt(o++)),(c>=g||c>U((b-v)/i))&&s("overflow"),v+=c*i,f=h<=x?j:h>=x+O?O:h-x,!(c<f);h+=g)d=g-f,i>U(b/d)&&s("overflow"),i*=d;e=m.length+1,x=p(v-a,e,0==a),U(v/e)>b-w&&s("overflow"),w+=U(v/e),v%=e,m.splice(v++,0,w)}return u(m)}function d(t){var e,n,r,o,a,i,u,l,f,d,m,y,v,w,x,_=[];for(t=h(t),y=t.length,e=P,n=0,a=C,i=0;i<y;++i)(m=t[i])<128&&_.push(R(m));for(r=o=_.length,o&&_.push(q);r<y;){for(u=b,i=0;i<y;++i)(m=t[i])>=e&&m<u&&(u=m);for(v=r+1,u-e>U((b-n)/v)&&s("overflow"),n+=(u-e)*v,e=u,i=0;i<y;++i)if(m=t[i],m<e&&++n>b&&s("overflow"),m==e){for(l=n,f=g;d=f<=a?j:f>=a+O?O:f-a,!(l<d);f+=g)x=l-d,w=g-d,_.push(R(c(d+x%w,0))),l=U(x/w);_.push(R(c(l,0))),a=p(n,v,r==o),n=0,++r}++n,++e}return _.join("")}function m(t){return i(t,function(t){return _.test(t)?f(t.slice(4).toLowerCase()):t})}function y(t){return i(t,function(t){return A.test(t)?"xn--"+d(t):t})}var v,b=("object"==typeof e&&e&&e.nodeType,"object"==typeof t&&t&&t.nodeType,2147483647),g=36,j=1,O=26,w=38,x=700,C=72,P=128,q="-",_=/^xn--/,A=/[^\x20-\x7E]/,T=/[\x2E\u3002\uFF0E\uFF61]/g,I={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},k=g-j,U=Math.floor,R=String.fromCharCode;v={version:"1.4.1",ucs2:{decode:h,encode:u},decode:f,encode:d,toASCII:y,toUnicode:m},void 0!==(o=function(){return v}.call(e,n,e,t))&&(t.exports=o)}()}).call(e,n("./node_modules/webpack/buildin/module.js")(t),n("./node_modules/webpack/buildin/global.js"))},"./node_modules/querystring-es3/decode.js":function(t,e,n){"use strict";function r(t,e){return Object.prototype.hasOwnProperty.call(t,e)}t.exports=function(t,e,n,s){e=e||"&",n=n||"=";var a={};if("string"!=typeof t||0===t.length)return a;var i=/\+/g;t=t.split(e);var h=1e3;s&&"number"==typeof s.maxKeys&&(h=s.maxKeys);var u=t.length;h>0&&u>h&&(u=h);for(var l=0;l<u;++l){var c,p,f,d,m=t[l].replace(i,"%20"),y=m.indexOf(n);y>=0?(c=m.substr(0,y),p=m.substr(y+1)):(c=m,p=""),f=decodeURIComponent(c),d=decodeURIComponent(p),r(a,f)?o(a[f])?a[f].push(d):a[f]=[a[f],d]:a[f]=d}return a};var o=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)}},"./node_modules/querystring-es3/encode.js":function(t,e,n){"use strict";function r(t,e){if(t.map)return t.map(e);for(var n=[],r=0;r<t.length;r++)n.push(e(t[r],r));return n}var o=function(t){switch(typeof t){case"string":return t;case"boolean":return t?"true":"false";case"number":return isFinite(t)?t:"";default:return""}};t.exports=function(t,e,n,i){return e=e||"&",n=n||"=",null===t&&(t=void 0),"object"==typeof t?r(a(t),function(a){var i=encodeURIComponent(o(a))+n;return s(t[a])?r(t[a],function(t){return i+encodeURIComponent(o(t))}).join(e):i+encodeURIComponent(o(t[a]))}).join(e):i?encodeURIComponent(o(i))+n+encodeURIComponent(o(t)):""};var s=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)},a=Object.keys||function(t){var e=[];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.push(n);return e}},"./node_modules/querystring-es3/index.js":function(t,e,n){"use strict";e.decode=e.parse=n("./node_modules/querystring-es3/decode.js"),e.encode=e.stringify=n("./node_modules/querystring-es3/encode.js")},"./node_modules/url/url.js":function(t,e,n){"use strict";function r(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}function o(t,e,n){if(t&&u.isObject(t)&&t instanceof r)return t;var o=new r;return o.parse(t,e,n),o}function s(t){return u.isString(t)&&(t=o(t)),t instanceof r?t.format():r.prototype.format.call(t)}function a(t,e){return o(t,!1,!0).resolve(e)}function i(t,e){return t?o(t,!1,!0).resolveObject(e):e}var h=n("./node_modules/punycode/punycode.js"),u=n("./node_modules/url/util.js");e.parse=o,e.resolve=a,e.resolveObject=i,e.format=s,e.Url=r;var l=/^([a-z0-9.+-]+:)/i,c=/:[0-9]*$/,p=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,f=["<",">",'"',"`"," ","\r","\n","\t"],d=["{","}","|","\\","^","`"].concat(f),m=["'"].concat(d),y=["%","/","?",";","#"].concat(m),v=["/","?","#"],b=/^[+a-z0-9A-Z_-]{0,63}$/,g=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,j={javascript:!0,"javascript:":!0},O={javascript:!0,"javascript:":!0},w={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},x=n("./node_modules/querystring-es3/index.js");r.prototype.parse=function(t,e,n){if(!u.isString(t))throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var r=t.indexOf("?"),o=-1!==r&&r<t.indexOf("#")?"?":"#",s=t.split(o),a=/\\/g;s[0]=s[0].replace(a,"/"),t=s.join(o);var i=t;if(i=i.trim(),!n&&1===t.split("#").length){var c=p.exec(i);if(c)return this.path=i,this.href=i,this.pathname=c[1],c[2]?(this.search=c[2],this.query=e?x.parse(this.search.substr(1)):this.search.substr(1)):e&&(this.search="",this.query={}),this}var f=l.exec(i);if(f){f=f[0];var d=f.toLowerCase();this.protocol=d,i=i.substr(f.length)}if(n||f||i.match(/^\/\/[^@\/]+@[^@\/]+/)){var C="//"===i.substr(0,2);!C||f&&O[f]||(i=i.substr(2),this.slashes=!0)}if(!O[f]&&(C||f&&!w[f])){for(var P=-1,q=0;q<v.length;q++){var _=i.indexOf(v[q]);-1!==_&&(-1===P||_<P)&&(P=_)}var A,T;T=-1===P?i.lastIndexOf("@"):i.lastIndexOf("@",P),-1!==T&&(A=i.slice(0,T),i=i.slice(T+1),this.auth=decodeURIComponent(A)),P=-1;for(var q=0;q<y.length;q++){var _=i.indexOf(y[q]);-1!==_&&(-1===P||_<P)&&(P=_)}-1===P&&(P=i.length),this.host=i.slice(0,P),i=i.slice(P),this.parseHost(),this.hostname=this.hostname||"";var I="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!I)for(var k=this.hostname.split(/\./),q=0,U=k.length;q<U;q++){var R=k[q];if(R&&!R.match(b)){for(var S="",F=0,E=R.length;F<E;F++)R.charCodeAt(F)>127?S+="x":S+=R[F];if(!S.match(b)){var K=k.slice(0,q),N=k.slice(q+1),z=R.match(g);z&&(K.push(z[1]),N.unshift(z[2])),N.length&&(i="/"+N.join(".")+i),this.hostname=K.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),I||(this.hostname=h.toASCII(this.hostname));var L=this.port?":"+this.port:"",B=this.hostname||"";this.host=B+L,this.href+=this.host,I&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==i[0]&&(i="/"+i))}if(!j[d])for(var q=0,U=m.length;q<U;q++){var $=m[q];if(-1!==i.indexOf($)){var M=encodeURIComponent($);M===$&&(M=escape($)),i=i.split($).join(M)}}var H=i.indexOf("#");-1!==H&&(this.hash=i.substr(H),i=i.slice(0,H));var Z=i.indexOf("?");if(-1!==Z?(this.search=i.substr(Z),this.query=i.substr(Z+1),e&&(this.query=x.parse(this.query)),i=i.slice(0,Z)):e&&(this.search="",this.query={}),i&&(this.pathname=i),w[d]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){var L=this.pathname||"",D=this.search||"";this.path=L+D}return this.href=this.format(),this},r.prototype.format=function(){var t=this.auth||"";t&&(t=encodeURIComponent(t),t=t.replace(/%3A/i,":"),t+="@");var e=this.protocol||"",n=this.pathname||"",r=this.hash||"",o=!1,s="";this.host?o=t+this.host:this.hostname&&(o=t+(-1===this.hostname.indexOf(":")?this.hostname:"["+this.hostname+"]"),this.port&&(o+=":"+this.port)),this.query&&u.isObject(this.query)&&Object.keys(this.query).length&&(s=x.stringify(this.query));var a=this.search||s&&"?"+s||"";return e&&":"!==e.substr(-1)&&(e+=":"),this.slashes||(!e||w[e])&&!1!==o?(o="//"+(o||""),n&&"/"!==n.charAt(0)&&(n="/"+n)):o||(o=""),r&&"#"!==r.charAt(0)&&(r="#"+r),a&&"?"!==a.charAt(0)&&(a="?"+a),n=n.replace(/[?#]/g,function(t){return encodeURIComponent(t)}),a=a.replace("#","%23"),e+o+n+a+r},r.prototype.resolve=function(t){return this.resolveObject(o(t,!1,!0)).format()},r.prototype.resolveObject=function(t){if(u.isString(t)){var e=new r;e.parse(t,!1,!0),t=e}for(var n=new r,o=Object.keys(this),s=0;s<o.length;s++){var a=o[s];n[a]=this[a]}if(n.hash=t.hash,""===t.href)return n.href=n.format(),n;if(t.slashes&&!t.protocol){for(var i=Object.keys(t),h=0;h<i.length;h++){var l=i[h];"protocol"!==l&&(n[l]=t[l])}return w[n.protocol]&&n.hostname&&!n.pathname&&(n.path=n.pathname="/"),n.href=n.format(),n}if(t.protocol&&t.protocol!==n.protocol){if(!w[t.protocol]){for(var c=Object.keys(t),p=0;p<c.length;p++){var f=c[p];n[f]=t[f]}return n.href=n.format(),n}if(n.protocol=t.protocol,t.host||O[t.protocol])n.pathname=t.pathname;else{for(var d=(t.pathname||"").split("/");d.length&&!(t.host=d.shift()););t.host||(t.host=""),t.hostname||(t.hostname=""),""!==d[0]&&d.unshift(""),d.length<2&&d.unshift(""),n.pathname=d.join("/")}if(n.search=t.search,n.query=t.query,n.host=t.host||"",n.auth=t.auth,n.hostname=t.hostname||t.host,n.port=t.port,n.pathname||n.search){var m=n.pathname||"",y=n.search||"";n.path=m+y}return n.slashes=n.slashes||t.slashes,n.href=n.format(),n}var v=n.pathname&&"/"===n.pathname.charAt(0),b=t.host||t.pathname&&"/"===t.pathname.charAt(0),g=b||v||n.host&&t.pathname,j=g,x=n.pathname&&n.pathname.split("/")||[],d=t.pathname&&t.pathname.split("/")||[],C=n.protocol&&!w[n.protocol];if(C&&(n.hostname="",n.port=null,n.host&&(""===x[0]?x[0]=n.host:x.unshift(n.host)),n.host="",t.protocol&&(t.hostname=null,t.port=null,t.host&&(""===d[0]?d[0]=t.host:d.unshift(t.host)),t.host=null),g=g&&(""===d[0]||""===x[0])),b)n.host=t.host||""===t.host?t.host:n.host,n.hostname=t.hostname||""===t.hostname?t.hostname:n.hostname,n.search=t.search,n.query=t.query,x=d;else if(d.length)x||(x=[]),x.pop(),x=x.concat(d),n.search=t.search,n.query=t.query;else if(!u.isNullOrUndefined(t.search)){if(C){n.hostname=n.host=x.shift();var P=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@");P&&(n.auth=P.shift(),n.host=n.hostname=P.shift())}return n.search=t.search,n.query=t.query,u.isNull(n.pathname)&&u.isNull(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.href=n.format(),n}if(!x.length)return n.pathname=null,n.search?n.path="/"+n.search:n.path=null,n.href=n.format(),n;for(var q=x.slice(-1)[0],_=(n.host||t.host||x.length>1)&&("."===q||".."===q)||""===q,A=0,T=x.length;T>=0;T--)q=x[T],"."===q?x.splice(T,1):".."===q?(x.splice(T,1),A++):A&&(x.splice(T,1),A--);if(!g&&!j)for(;A--;A)x.unshift("..");!g||""===x[0]||x[0]&&"/"===x[0].charAt(0)||x.unshift(""),_&&"/"!==x.join("/").substr(-1)&&x.push("");var I=""===x[0]||x[0]&&"/"===x[0].charAt(0);if(C){n.hostname=n.host=I?"":x.length?x.shift():"";var P=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@");P&&(n.auth=P.shift(),n.host=n.hostname=P.shift())}return g=g||n.host&&x.length,g&&!I&&x.unshift(""),x.length?n.pathname=x.join("/"):(n.pathname=null,n.path=null),u.isNull(n.pathname)&&u.isNull(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.auth=t.auth||n.auth,n.slashes=n.slashes||t.slashes,n.href=n.format(),n},r.prototype.parseHost=function(){var t=this.host,e=c.exec(t);e&&(e=e[0],":"!==e&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)}},"./node_modules/url/util.js":function(t,e,n){"use strict";t.exports={isString:function(t){return"string"==typeof t},isObject:function(t){return"object"==typeof t&&null!==t},isNull:function(t){return null===t},isNullOrUndefined:function(t){return null==t}}},"./node_modules/webpack/buildin/global.js":function(t,e){var n;n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(t){"object"==typeof window&&(n=window)}t.exports=n},"./node_modules/webpack/buildin/module.js":function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},0:function(t,e){t.exports=React},1:function(t,e){t.exports=IsomorphicFetch},2:function(t,e){t.exports=ReactDom},3:function(t,e){t.exports=ReactSelect}});