Current File : /var/www/prestashop/admin796dakgxg59vuzqtfdi/themes/new-theme/public/specific_price_form.bundle.js
(()=>{var t={3943:function(t,e,n){var i,s,r;
/*!
 * typeahead.js 0.11.1
 * https://github.com/twitter/typeahead.js
 * Copyright 2013-2015 Twitter, Inc. and other contributors; Licensed MIT
 */
r=this,i=[n(9567)],s=function(t){return r.Bloodhound=(e=t,n=function(){"use strict";return{isMsie:function(){return!!/(msie|trident)/i.test(navigator.userAgent)&&navigator.userAgent.match(/(msie |rv:)(\d+(.\d+)?)/i)[2]},isBlankString:function(t){return!t||/^\s*$/.test(t)},escapeRegExChars:function(t){return t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")},isString:function(t){return"string"==typeof t},isNumber:function(t){return"number"==typeof t},isArray:e.isArray,isFunction:e.isFunction,isObject:e.isPlainObject,isUndefined:function(t){return void 0===t},isElement:function(t){return!(!t||1!==t.nodeType)},isJQuery:function(t){return t instanceof e},toStr:function(t){return n.isUndefined(t)||null===t?"":t+""},bind:e.proxy,each:function(t,n){function i(t,e){return n(e,t)}e.each(t,i)},map:e.map,filter:e.grep,every:function(t,n){var i=!0;return t?(e.each(t,(function(e,s){if(!(i=n.call(null,s,e,t)))return!1})),!!i):i},some:function(t,n){var i=!1;return t?(e.each(t,(function(e,s){if(i=n.call(null,s,e,t))return!1})),!!i):i},mixin:e.extend,identity:function(t){return t},clone:function(t){return e.extend(!0,{},t)},getIdGenerator:function(){var t=0;return function(){return t++}},templatify:function(t){return e.isFunction(t)?t:n;function n(){return String(t)}},defer:function(t){setTimeout(t,0)},debounce:function(t,e,n){var i,s;return function(){var r,o,a=this,c=arguments;return r=function(){i=null,n||(s=t.apply(a,c))},o=n&&!i,clearTimeout(i),i=setTimeout(r,e),o&&(s=t.apply(a,c)),s}},throttle:function(t,e){var n,i,s,r,o,a;return o=0,a=function(){o=new Date,s=null,r=t.apply(n,i)},function(){var c=new Date,u=e-(c-o);return n=this,i=arguments,u<=0?(clearTimeout(s),s=null,o=c,r=t.apply(n,i)):s||(s=setTimeout(a,u)),r}},stringify:function(t){return n.isString(t)?t:JSON.stringify(t)},noop:function(){}}}(),i="0.11.1",s=function(){"use strict";return{nonword:e,whitespace:t,obj:{nonword:i(e),whitespace:i(t)}};function t(t){return(t=n.toStr(t))?t.split(/\s+/):[]}function e(t){return(t=n.toStr(t))?t.split(/\W+/):[]}function i(t){return function(e){return e=n.isArray(e)?e:[].slice.call(arguments,0),function(i){var s=[];return n.each(e,(function(e){s=s.concat(t(n.toStr(i[e])))})),s}}}}(),o=function(){"use strict";function t(t){this.maxSize=n.isNumber(t)?t:100,this.reset(),this.maxSize<=0&&(this.set=this.get=e.noop)}function i(){this.head=this.tail=null}function s(t,e){this.key=t,this.val=e,this.prev=this.next=null}return n.mixin(t.prototype,{set:function(t,e){var n,i=this.list.tail;this.size>=this.maxSize&&(this.list.remove(i),delete this.hash[i.key],this.size--),(n=this.hash[t])?(n.val=e,this.list.moveToFront(n)):(n=new s(t,e),this.list.add(n),this.hash[t]=n,this.size++)},get:function(t){var e=this.hash[t];if(e)return this.list.moveToFront(e),e.val},reset:function(){this.size=0,this.hash={},this.list=new i}}),n.mixin(i.prototype,{add:function(t){this.head&&(t.next=this.head,this.head.prev=t),this.head=t,this.tail=this.tail||t},remove:function(t){t.prev?t.prev.next=t.next:this.head=t.next,t.next?t.next.prev=t.prev:this.tail=t.prev},moveToFront:function(t){this.remove(t),this.add(t)}}),t}(),a=function(){"use strict";var t;try{(t=window.localStorage).setItem("~~~","!"),t.removeItem("~~~")}catch(e){t=null}function i(e,i){this.prefix=["__",e,"__"].join(""),this.ttlKey="__ttl__",this.keyMatcher=new RegExp("^"+n.escapeRegExChars(this.prefix)),this.ls=i||t,!this.ls&&this._noop()}return n.mixin(i.prototype,{_prefix:function(t){return this.prefix+t},_ttlKey:function(t){return this._prefix(t)+this.ttlKey},_noop:function(){this.get=this.set=this.remove=this.clear=this.isExpired=n.noop},_safeSet:function(t,e){try{this.ls.setItem(t,e)}catch(t){"QuotaExceededError"===t.name&&(this.clear(),this._noop())}},get:function(t){return this.isExpired(t)&&this.remove(t),o(this.ls.getItem(this._prefix(t)))},set:function(t,e,i){return n.isNumber(i)?this._safeSet(this._ttlKey(t),r(s()+i)):this.ls.removeItem(this._ttlKey(t)),this._safeSet(this._prefix(t),r(e))},remove:function(t){return this.ls.removeItem(this._ttlKey(t)),this.ls.removeItem(this._prefix(t)),this},clear:function(){var t,e=a(this.keyMatcher);for(t=e.length;t--;)this.remove(e[t]);return this},isExpired:function(t){var e=o(this.ls.getItem(this._ttlKey(t)));return!!(n.isNumber(e)&&s()>e)}}),i;function s(){return(new Date).getTime()}function r(t){return JSON.stringify(n.isUndefined(t)?null:t)}function o(t){return e.parseJSON(t)}function a(e){var n,i,s=[],r=t.length;for(n=0;n<r;n++)(i=t.key(n)).match(e)&&s.push(i.replace(e,""));return s}}(),c=function(){"use strict";var t=0,i={},s=6,r=new o(10);function a(t){t=t||{},this.cancelled=!1,this.lastReq=null,this._send=t.transport,this._get=t.limiter?t.limiter(this._get):this._get,this._cache=!1===t.cache?new o(0):r}return a.setMaxPendingRequests=function(t){s=t},a.resetCache=function(){r.reset()},n.mixin(a.prototype,{_fingerprint:function(t){return(t=t||{}).url+t.type+e.param(t.data||{})},_get:function(e,n){var r,o,a=this;function c(t){n(null,t),a._cache.set(r,t)}function u(){n(!0)}function l(){t--,delete i[r],a.onDeckRequestArgs&&(a._get.apply(a,a.onDeckRequestArgs),a.onDeckRequestArgs=null)}r=this._fingerprint(e),this.cancelled||r!==this.lastReq||((o=i[r])?o.done(c).fail(u):t<s?(t++,i[r]=this._send(e).done(c).fail(u).always(l)):this.onDeckRequestArgs=[].slice.call(arguments,0))},get:function(t,i){var s,r;i=i||e.noop,t=n.isString(t)?{url:t}:t||{},r=this._fingerprint(t),this.cancelled=!1,this.lastReq=r,(s=this._cache.get(r))?i(null,s):this._get(t,i)},cancel:function(){this.cancelled=!0}}),a}(),u=window.SearchIndex=function(){"use strict";var t="c",i="i";function s(t){(t=t||{}).datumTokenizer&&t.queryTokenizer||e.error("datumTokenizer and queryTokenizer are both required"),this.identify=t.identify||n.stringify,this.datumTokenizer=t.datumTokenizer,this.queryTokenizer=t.queryTokenizer,this.reset()}return n.mixin(s.prototype,{bootstrap:function(t){this.datums=t.datums,this.trie=t.trie},add:function(e){var s=this;e=n.isArray(e)?e:[e],n.each(e,(function(e){var a,c;s.datums[a=s.identify(e)]=e,c=r(s.datumTokenizer(e)),n.each(c,(function(e){var n,r,c;for(n=s.trie,r=e.split("");c=r.shift();)(n=n[t][c]||(n[t][c]=o()))[i].push(a)}))}))},get:function(t){var e=this;return n.map(t,(function(t){return e.datums[t]}))},search:function(e){var s,o,u=this;return s=r(this.queryTokenizer(e)),n.each(s,(function(e){var n,s,r,a;if(o&&0===o.length)return!1;for(n=u.trie,s=e.split("");n&&(r=s.shift());)n=n[t][r];if(!n||0!==s.length)return o=[],!1;a=n[i].slice(0),o=o?c(o,a):a})),o?n.map(a(o),(function(t){return u.datums[t]})):[]},all:function(){var t=[];for(var e in this.datums)t.push(this.datums[e]);return t},reset:function(){this.datums={},this.trie=o()},serialize:function(){return{datums:this.datums,trie:this.trie}}}),s;function r(t){return t=n.filter(t,(function(t){return!!t})),t=n.map(t,(function(t){return t.toLowerCase()}))}function o(){var e={};return e[i]=[],e[t]={},e}function a(t){for(var e={},n=[],i=0,s=t.length;i<s;i++)e[t[i]]||(e[t[i]]=!0,n.push(t[i]));return n}function c(t,e){var n=0,i=0,s=[];t=t.sort(),e=e.sort();for(var r=t.length,o=e.length;n<r&&i<o;)t[n]<e[i]?n++:(t[n]>e[i]||(s.push(t[n]),n++),i++);return s}}(),l=function(){"use strict";var t;function e(t){this.url=t.url,this.ttl=t.ttl,this.cache=t.cache,this.prepare=t.prepare,this.transform=t.transform,this.transport=t.transport,this.thumbprint=t.thumbprint,this.storage=new a(t.cacheKey)}return t={data:"data",protocol:"protocol",thumbprint:"thumbprint"},n.mixin(e.prototype,{_settings:function(){return{url:this.url,type:"GET",dataType:"json"}},store:function(e){this.cache&&(this.storage.set(t.data,e,this.ttl),this.storage.set(t.protocol,location.protocol,this.ttl),this.storage.set(t.thumbprint,this.thumbprint,this.ttl))},fromCache:function(){var e,n={};return this.cache?(n.data=this.storage.get(t.data),n.protocol=this.storage.get(t.protocol),n.thumbprint=this.storage.get(t.thumbprint),e=n.thumbprint!==this.thumbprint||n.protocol!==location.protocol,n.data&&!e?n.data:null):null},fromNetwork:function(t){var e,n=this;function i(){t(!0)}function s(e){t(null,n.transform(e))}t&&(e=this.prepare(this._settings()),this.transport(e).fail(i).done(s))},clear:function(){return this.storage.clear(),this}}),e}(),h=function(){"use strict";function t(t){this.url=t.url,this.prepare=t.prepare,this.transform=t.transform,this.transport=new c({cache:t.cache,limiter:t.limiter,transport:t.transport})}return n.mixin(t.prototype,{_settings:function(){return{url:this.url,type:"GET",dataType:"json"}},get:function(t,e){var n,i=this;if(e)return t=t||"",n=this.prepare(t,this._settings()),this.transport.get(n,s);function s(t,n){e(t?[]:i.transform(n))}},cancelLastRequest:function(){this.transport.cancel()}}),t}(),d=function(){"use strict";return function(i){var r,o;return r={initialize:!0,identify:n.stringify,datumTokenizer:null,queryTokenizer:null,sufficient:5,sorter:null,local:[],prefetch:null,remote:null},!(i=n.mixin(r,i||{})).datumTokenizer&&e.error("datumTokenizer is required"),!i.queryTokenizer&&e.error("queryTokenizer is required"),o=i.sorter,i.sorter=o?function(t){return t.sort(o)}:n.identity,i.local=n.isFunction(i.local)?i.local():i.local,i.prefetch=t(i.prefetch),i.remote=s(i.remote),i};function t(t){var s;return t?(s={url:null,ttl:864e5,cache:!0,cacheKey:null,thumbprint:"",prepare:n.identity,transform:n.identity,transport:null},t=n.isString(t)?{url:t}:t,!(t=n.mixin(s,t)).url&&e.error("prefetch requires url to be set"),t.transform=t.filter||t.transform,t.cacheKey=t.cacheKey||t.url,t.thumbprint=i+t.thumbprint,t.transport=t.transport?a(t.transport):e.ajax,t):null}function s(t){var i;if(t)return i={url:null,cache:!0,prepare:null,replace:null,wildcard:null,limiter:null,rateLimitBy:"debounce",rateLimitWait:300,transform:n.identity,transport:null},t=n.isString(t)?{url:t}:t,!(t=n.mixin(i,t)).url&&e.error("remote requires url to be set"),t.transform=t.filter||t.transform,t.prepare=r(t),t.limiter=o(t),t.transport=t.transport?a(t.transport):e.ajax,delete t.replace,delete t.wildcard,delete t.rateLimitBy,delete t.rateLimitWait,t}function r(t){var e,n,i;return e=t.prepare,n=t.replace,i=t.wildcard,e||(e=n?s:t.wildcard?r:o);function s(t,e){return e.url=n(e.url,t),e}function r(t,e){return e.url=e.url.replace(i,encodeURIComponent(t)),e}function o(t,e){return e}}function o(t){var e,i,s;return e=t.limiter,i=t.rateLimitBy,s=t.rateLimitWait,e||(e=/^throttle$/i.test(i)?o(s):r(s)),e;function r(t){return function(e){return n.debounce(e,t)}}function o(t){return function(e){return n.throttle(e,t)}}}function a(t){return function(i){var s=e.Deferred();return t(i,r,o),s;function r(t){n.defer((function(){s.resolve(t)}))}function o(t){n.defer((function(){s.reject(t)}))}}}}(),p=function(){"use strict";var t;function i(t){t=d(t),this.sorter=t.sorter,this.identify=t.identify,this.sufficient=t.sufficient,this.local=t.local,this.remote=t.remote?new h(t.remote):null,this.prefetch=t.prefetch?new l(t.prefetch):null,this.index=new u({identify:this.identify,datumTokenizer:t.datumTokenizer,queryTokenizer:t.queryTokenizer}),!1!==t.initialize&&this.initialize()}return t=window&&window.Bloodhound,i.noConflict=function(){return window&&(window.Bloodhound=t),i},i.tokenizers=s,n.mixin(i.prototype,{__ttAdapter:function(){var t=this;return this.remote?e:n;function e(e,n,i){return t.search(e,n,i)}function n(e,n){return t.search(e,n)}},_loadPrefetch:function(){var t,n,i=this;return t=e.Deferred(),this.prefetch?(n=this.prefetch.fromCache())?(this.index.bootstrap(n),t.resolve()):this.prefetch.fromNetwork(s):t.resolve(),t.promise();function s(e,n){if(e)return t.reject();i.add(n),i.prefetch.store(i.index.serialize()),t.resolve()}},_initialize:function(){var t=this;return this.clear(),(this.initPromise=this._loadPrefetch()).done(e),this.initPromise;function e(){t.add(t.local)}},initialize:function(t){return!this.initPromise||t?this._initialize():this.initPromise},add:function(t){return this.index.add(t),this},get:function(t){return t=n.isArray(t)?t:[].slice.call(arguments),this.index.get(t)},search:function(t,e,i){var s,r=this;return s=this.sorter(this.index.search(t)),e(this.remote?s.slice():s),this.remote&&s.length<this.sufficient?this.remote.get(t,o):this.remote&&this.remote.cancelLastRequest(),this;function o(t){var e=[];n.each(t,(function(t){!n.some(s,(function(e){return r.identify(t)===r.identify(e)}))&&e.push(t)})),i&&i(e)}},all:function(){return this.index.all()},clear:function(){return this.index.reset(),this},clearPrefetchCache:function(){return this.prefetch&&this.prefetch.clear(),this},clearRemoteCache:function(){return c.resetCache(),this},ttAdapter:function(){return this.__ttAdapter()}}),i}(),p);var e,n,i,s,o,a,c,u,l,h,d,p}.apply(e,i),void 0===s||(t.exports=s),i=[n(9567)],s=function(t){return e=t,n=function(){"use strict";return{isMsie:function(){return!!/(msie|trident)/i.test(navigator.userAgent)&&navigator.userAgent.match(/(msie |rv:)(\d+(.\d+)?)/i)[2]},isBlankString:function(t){return!t||/^\s*$/.test(t)},escapeRegExChars:function(t){return t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")},isString:function(t){return"string"==typeof t},isNumber:function(t){return"number"==typeof t},isArray:e.isArray,isFunction:e.isFunction,isObject:e.isPlainObject,isUndefined:function(t){return void 0===t},isElement:function(t){return!(!t||1!==t.nodeType)},isJQuery:function(t){return t instanceof e},toStr:function(t){return n.isUndefined(t)||null===t?"":t+""},bind:e.proxy,each:function(t,n){function i(t,e){return n(e,t)}e.each(t,i)},map:e.map,filter:e.grep,every:function(t,n){var i=!0;return t?(e.each(t,(function(e,s){if(!(i=n.call(null,s,e,t)))return!1})),!!i):i},some:function(t,n){var i=!1;return t?(e.each(t,(function(e,s){if(i=n.call(null,s,e,t))return!1})),!!i):i},mixin:e.extend,identity:function(t){return t},clone:function(t){return e.extend(!0,{},t)},getIdGenerator:function(){var t=0;return function(){return t++}},templatify:function(t){return e.isFunction(t)?t:n;function n(){return String(t)}},defer:function(t){setTimeout(t,0)},debounce:function(t,e,n){var i,s;return function(){var r,o,a=this,c=arguments;return r=function(){i=null,n||(s=t.apply(a,c))},o=n&&!i,clearTimeout(i),i=setTimeout(r,e),o&&(s=t.apply(a,c)),s}},throttle:function(t,e){var n,i,s,r,o,a;return o=0,a=function(){o=new Date,s=null,r=t.apply(n,i)},function(){var c=new Date,u=e-(c-o);return n=this,i=arguments,u<=0?(clearTimeout(s),s=null,o=c,r=t.apply(n,i)):s||(s=setTimeout(a,u)),r}},stringify:function(t){return n.isString(t)?t:JSON.stringify(t)},noop:function(){}}}(),i=function(){"use strict";var t={wrapper:"twitter-typeahead",input:"tt-input",hint:"tt-hint",menu:"tt-menu",dataset:"tt-dataset",suggestion:"tt-suggestion",selectable:"tt-selectable",empty:"tt-empty",open:"tt-open",cursor:"tt-cursor",highlight:"tt-highlight"};return e;function e(e){var o,a;return a=n.mixin({},t,e),{css:(o={css:r(),classes:a,html:i(a),selectors:s(a)}).css,html:o.html,classes:o.classes,selectors:o.selectors,mixin:function(t){n.mixin(t,o)}}}function i(t){return{wrapper:'<span class="'+t.wrapper+'"></span>',menu:'<div class="'+t.menu+'"></div>'}}function s(t){var e={};return n.each(t,(function(t,n){e[n]="."+t})),e}function r(){var t={wrapper:{position:"relative",display:"inline-block"},hint:{position:"absolute",top:"0",left:"0",borderColor:"transparent",boxShadow:"none",opacity:"1"},input:{position:"relative",verticalAlign:"top",backgroundColor:"transparent"},inputWithNoHint:{position:"relative",verticalAlign:"top"},menu:{position:"absolute",top:"100%",left:"0",zIndex:"100",display:"none"},ltr:{left:"0",right:"auto"},rtl:{left:"auto",right:" 0"}};return n.isMsie()&&n.mixin(t.input,{backgroundImage:"url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)"}),t}}(),s=function(){"use strict";var t,i;function s(t){t&&t.el||e.error("EventBus initialized without el"),this.$el=e(t.el)}return t="typeahead:",i={render:"rendered",cursorchange:"cursorchanged",select:"selected",autocomplete:"autocompleted"},n.mixin(s.prototype,{_trigger:function(n,i){var s;return s=e.Event(t+n),(i=i||[]).unshift(s),this.$el.trigger.apply(this.$el,i),s},before:function(t){var e;return e=[].slice.call(arguments,1),this._trigger("before"+t,e).isDefaultPrevented()},trigger:function(t){var e;this._trigger(t,[].slice.call(arguments,1)),(e=i[t])&&this._trigger(e,[].slice.call(arguments,1))}}),s}(),r=function(){"use strict";var t=/\s+/,e=c();return{onSync:s,onAsync:i,off:r,trigger:o};function n(e,n,i,s){var r;if(!i)return this;for(n=n.split(t),i=s?u(i,s):i,this._callbacks=this._callbacks||{};r=n.shift();)this._callbacks[r]=this._callbacks[r]||{sync:[],async:[]},this._callbacks[r][e].push(i);return this}function i(t,e,i){return n.call(this,"async",t,e,i)}function s(t,e,i){return n.call(this,"sync",t,e,i)}function r(e){var n;if(!this._callbacks)return this;for(e=e.split(t);n=e.shift();)delete this._callbacks[n];return this}function o(n){var i,s,r,o,c;if(!this._callbacks)return this;for(n=n.split(t),r=[].slice.call(arguments,1);(i=n.shift())&&(s=this._callbacks[i]);)o=a(s.sync,this,[i].concat(r)),c=a(s.async,this,[i].concat(r)),o()&&e(c);return this}function a(t,e,n){return i;function i(){for(var i,s=0,r=t.length;!i&&s<r;s+=1)i=!1===t[s].apply(e,n);return!i}}function c(){return window.setImmediate?function(t){setImmediate((function(){t()}))}:function(t){setTimeout((function(){t()}),0)}}function u(t,e){return t.bind?t.bind(e):function(){t.apply(e,[].slice.call(arguments,0))}}}(),o=function(t){"use strict";var e={node:null,pattern:null,tagName:"strong",className:null,wordsOnly:!1,caseSensitive:!1};return function(s){var r;function o(e){var n,i,o;return(n=r.exec(e.data))&&(o=t.createElement(s.tagName),s.className&&(o.className=s.className),(i=e.splitText(n.index)).splitText(n[0].length),o.appendChild(i.cloneNode(!0)),e.parentNode.replaceChild(o,i)),!!n}function a(t,e){for(var n,i=3,s=0;s<t.childNodes.length;s++)(n=t.childNodes[s]).nodeType===i?s+=e(n)?1:0:a(n,e)}(s=n.mixin({},e,s)).node&&s.pattern&&(s.pattern=n.isArray(s.pattern)?s.pattern:[s.pattern],r=i(s.pattern,s.caseSensitive,s.wordsOnly),a(s.node,o))};function i(t,e,i){for(var s,r=[],o=0,a=t.length;o<a;o++)r.push(n.escapeRegExChars(t[o]));return s=i?"\\b("+r.join("|")+")\\b":"("+r.join("|")+")",e?new RegExp(s):new RegExp(s,"i")}}(window.document),a=function(){"use strict";var t;function i(t,i){(t=t||{}).input||e.error("input is missing"),i.mixin(this),this.$hint=e(t.hint),this.$input=e(t.input),this.query=this.$input.val(),this.queryWhenFocused=this.hasFocus()?this.query:null,this.$overflowHelper=s(this.$input),this._checkLanguageDirection(),0===this.$hint.length&&(this.setHint=this.getHint=this.clearHint=this.clearHintIfInvalid=n.noop)}return t={9:"tab",27:"esc",37:"left",39:"right",13:"enter",38:"up",40:"down"},i.normalizeQuery=function(t){return n.toStr(t).replace(/^\s*/g,"").replace(/\s{2,}/g," ")},n.mixin(i.prototype,r,{_onBlur:function(){this.resetInputValue(),this.trigger("blurred")},_onFocus:function(){this.queryWhenFocused=this.query,this.trigger("focused")},_onKeydown:function(e){var n=t[e.which||e.keyCode];this._managePreventDefault(n,e),n&&this._shouldTrigger(n,e)&&this.trigger(n+"Keyed",e)},_onInput:function(){this._setQuery(this.getInputValue()),this.clearHintIfInvalid(),this._checkLanguageDirection()},_managePreventDefault:function(t,e){var n;switch(t){case"up":case"down":n=!a(e);break;default:n=!1}n&&e.preventDefault()},_shouldTrigger:function(t,e){return"tab"!==t||!a(e)},_checkLanguageDirection:function(){var t=(this.$input.css("direction")||"ltr").toLowerCase();this.dir!==t&&(this.dir=t,this.$hint.attr("dir",t),this.trigger("langDirChanged",t))},_setQuery:function(t,e){var n,i;i=!!(n=o(t,this.query))&&this.query.length!==t.length,this.query=t,e||n?!e&&i&&this.trigger("whitespaceChanged",this.query):this.trigger("queryChanged",this.query)},bind:function(){var e,i,s,r,o=this;return e=n.bind(this._onBlur,this),i=n.bind(this._onFocus,this),s=n.bind(this._onKeydown,this),r=n.bind(this._onInput,this),this.$input.on("blur.tt",e).on("focus.tt",i).on("keydown.tt",s),!n.isMsie()||n.isMsie()>9?this.$input.on("input.tt",r):this.$input.on("keydown.tt keypress.tt cut.tt paste.tt",(function(e){t[e.which||e.keyCode]||n.defer(n.bind(o._onInput,o,e))})),this},focus:function(){this.$input.focus()},blur:function(){this.$input.blur()},getLangDir:function(){return this.dir},getQuery:function(){return this.query||""},setQuery:function(t,e){this.setInputValue(t),this._setQuery(t,e)},hasQueryChangedSinceLastFocus:function(){return this.query!==this.queryWhenFocused},getInputValue:function(){return this.$input.val()},setInputValue:function(t){this.$input.val(t),this.clearHintIfInvalid(),this._checkLanguageDirection()},resetInputValue:function(){this.setInputValue(this.query)},getHint:function(){return this.$hint.val()},setHint:function(t){this.$hint.val(t)},clearHint:function(){this.setHint("")},clearHintIfInvalid:function(){var t,e,n;n=(t=this.getInputValue())!==(e=this.getHint())&&0===e.indexOf(t),(""===t||!n||this.hasOverflow())&&this.clearHint()},hasFocus:function(){return this.$input.is(":focus")},hasOverflow:function(){var t=this.$input.width()-2;return this.$overflowHelper.text(this.getInputValue()),this.$overflowHelper.width()>=t},isCursorAtEnd:function(){var t,e,i;return t=this.$input.val().length,e=this.$input[0].selectionStart,n.isNumber(e)?e===t:!document.selection||((i=document.selection.createRange()).moveStart("character",-t),t===i.text.length)},destroy:function(){this.$hint.off(".tt"),this.$input.off(".tt"),this.$overflowHelper.remove(),this.$hint=this.$input=this.$overflowHelper=e("<div>")}}),i;function s(t){return e('<pre aria-hidden="true"></pre>').css({position:"absolute",visibility:"hidden",whiteSpace:"pre",fontFamily:t.css("font-family"),fontSize:t.css("font-size"),fontStyle:t.css("font-style"),fontVariant:t.css("font-variant"),fontWeight:t.css("font-weight"),wordSpacing:t.css("word-spacing"),letterSpacing:t.css("letter-spacing"),textIndent:t.css("text-indent"),textRendering:t.css("text-rendering"),textTransform:t.css("text-transform")}).insertAfter(t)}function o(t,e){return i.normalizeQuery(t)===i.normalizeQuery(e)}function a(t){return t.altKey||t.ctrlKey||t.metaKey||t.shiftKey}}(),c=function(){"use strict";var t,i;function s(t,s){(t=t||{}).templates=t.templates||{},t.templates.notFound=t.templates.notFound||t.templates.empty,t.source||e.error("missing source"),t.node||e.error("missing node"),t.name&&!u(t.name)&&e.error("invalid dataset name: "+t.name),s.mixin(this),this.highlight=!!t.highlight,this.name=t.name||i(),this.limit=t.limit||5,this.displayFn=a(t.display||t.displayKey),this.templates=c(t.templates,this.displayFn),this.source=t.source.__ttAdapter?t.source.__ttAdapter():t.source,this.async=n.isUndefined(t.async)?this.source.length>2:!!t.async,this._resetLastSuggestion(),this.$el=e(t.node).addClass(this.classes.dataset).addClass(this.classes.dataset+"-"+this.name)}return t={val:"tt-selectable-display",obj:"tt-selectable-object"},i=n.getIdGenerator(),s.extractData=function(n){var i=e(n);return i.data(t.obj)?{val:i.data(t.val)||"",obj:i.data(t.obj)||null}:null},n.mixin(s.prototype,r,{_overwrite:function(t,e){(e=e||[]).length?this._renderSuggestions(t,e):this.async&&this.templates.pending?this._renderPending(t):!this.async&&this.templates.notFound?this._renderNotFound(t):this._empty(),this.trigger("rendered",this.name,e,!1)},_append:function(t,e){(e=e||[]).length&&this.$lastSuggestion.length?this._appendSuggestions(t,e):e.length?this._renderSuggestions(t,e):!this.$lastSuggestion.length&&this.templates.notFound&&this._renderNotFound(t),this.trigger("rendered",this.name,e,!0)},_renderSuggestions:function(t,e){var n;n=this._getSuggestionsFragment(t,e),this.$lastSuggestion=n.children().last(),this.$el.html(n).prepend(this._getHeader(t,e)).append(this._getFooter(t,e))},_appendSuggestions:function(t,e){var n,i;i=(n=this._getSuggestionsFragment(t,e)).children().last(),this.$lastSuggestion.after(n),this.$lastSuggestion=i},_renderPending:function(t){var e=this.templates.pending;this._resetLastSuggestion(),e&&this.$el.html(e({query:t,dataset:this.name}))},_renderNotFound:function(t){var e=this.templates.notFound;this._resetLastSuggestion(),e&&this.$el.html(e({query:t,dataset:this.name}))},_empty:function(){this.$el.empty(),this._resetLastSuggestion()},_getSuggestionsFragment:function(i,s){var r,a=this;return r=document.createDocumentFragment(),n.each(s,(function(n){var s,o;o=a._injectQuery(i,n),s=e(a.templates.suggestion(o)).data(t.obj,n).data(t.val,a.displayFn(n)).addClass(a.classes.suggestion+" "+a.classes.selectable),r.appendChild(s[0])})),this.highlight&&o({className:this.classes.highlight,node:r,pattern:i}),e(r)},_getFooter:function(t,e){return this.templates.footer?this.templates.footer({query:t,suggestions:e,dataset:this.name}):null},_getHeader:function(t,e){return this.templates.header?this.templates.header({query:t,suggestions:e,dataset:this.name}):null},_resetLastSuggestion:function(){this.$lastSuggestion=e()},_injectQuery:function(t,e){return n.isObject(e)?n.mixin({_query:t},e):e},update:function(t){var n=this,i=!1,s=!1,r=0;function o(e){s||(s=!0,e=(e||[]).slice(0,n.limit),r=e.length,n._overwrite(t,e),r<n.limit&&n.async&&n.trigger("asyncRequested",t))}function a(s){s=s||[],!i&&r<n.limit&&(n.cancel=e.noop,r+=s.length,n._append(t,s.slice(0,n.limit-r)),n.async&&n.trigger("asyncReceived",t))}this.cancel(),this.cancel=function(){i=!0,n.cancel=e.noop,n.async&&n.trigger("asyncCanceled",t)},this.source(t,o,a),!s&&o([])},cancel:e.noop,clear:function(){this._empty(),this.cancel(),this.trigger("cleared")},isEmpty:function(){return this.$el.is(":empty")},destroy:function(){this.$el=e("<div>")}}),s;function a(t){return t=t||n.stringify,n.isFunction(t)?t:e;function e(e){return e[t]}}function c(t,i){return{notFound:t.notFound&&n.templatify(t.notFound),pending:t.pending&&n.templatify(t.pending),header:t.header&&n.templatify(t.header),footer:t.footer&&n.templatify(t.footer),suggestion:t.suggestion||s};function s(t){return e("<div>").text(i(t))}}function u(t){return/^[_a-zA-Z0-9-]+$/.test(t)}}(),u=function(){"use strict";function t(t,i){var s=this;function r(t){var n=s.$node.find(t.node).first();return t.node=n.length?n:e("<div>").appendTo(s.$node),new c(t,i)}(t=t||{}).node||e.error("node is required"),i.mixin(this),this.$node=e(t.node),this.query=null,this.datasets=n.map(t.datasets,r)}return n.mixin(t.prototype,r,{_onSelectableClick:function(t){this.trigger("selectableClicked",e(t.currentTarget))},_onRendered:function(t,e,n,i){this.$node.toggleClass(this.classes.empty,this._allDatasetsEmpty()),this.trigger("datasetRendered",e,n,i)},_onCleared:function(){this.$node.toggleClass(this.classes.empty,this._allDatasetsEmpty()),this.trigger("datasetCleared")},_propagate:function(){this.trigger.apply(this,arguments)},_allDatasetsEmpty:function(){return n.every(this.datasets,t);function t(t){return t.isEmpty()}},_getSelectables:function(){return this.$node.find(this.selectors.selectable)},_removeCursor:function(){var t=this.getActiveSelectable();t&&t.removeClass(this.classes.cursor)},_ensureVisible:function(t){var e,n,i,s;n=(e=t.position().top)+t.outerHeight(!0),i=this.$node.scrollTop(),s=this.$node.height()+parseInt(this.$node.css("paddingTop"),10)+parseInt(this.$node.css("paddingBottom"),10),e<0?this.$node.scrollTop(i+e):s<n&&this.$node.scrollTop(i+(n-s))},bind:function(){var t,e=this;return t=n.bind(this._onSelectableClick,this),this.$node.on("click.tt",this.selectors.selectable,t),n.each(this.datasets,(function(t){t.onSync("asyncRequested",e._propagate,e).onSync("asyncCanceled",e._propagate,e).onSync("asyncReceived",e._propagate,e).onSync("rendered",e._onRendered,e).onSync("cleared",e._onCleared,e)})),this},isOpen:function(){return this.$node.hasClass(this.classes.open)},open:function(){this.$node.addClass(this.classes.open)},close:function(){this.$node.removeClass(this.classes.open),this._removeCursor()},setLanguageDirection:function(t){this.$node.attr("dir",t)},selectableRelativeToCursor:function(t){var e,n,i;return n=this.getActiveSelectable(),e=this._getSelectables(),-1===(i=(i=((i=(n?e.index(n):-1)+t)+1)%(e.length+1)-1)<-1?e.length-1:i)?null:e.eq(i)},setCursor:function(t){this._removeCursor(),(t=t&&t.first())&&(t.addClass(this.classes.cursor),this._ensureVisible(t))},getSelectableData:function(t){return t&&t.length?c.extractData(t):null},getActiveSelectable:function(){var t=this._getSelectables().filter(this.selectors.cursor).first();return t.length?t:null},getTopSelectable:function(){var t=this._getSelectables().first();return t.length?t:null},update:function(t){var e=t!==this.query;return e&&(this.query=t,n.each(this.datasets,i)),e;function i(e){e.update(t)}},empty:function(){function t(t){t.clear()}n.each(this.datasets,t),this.query=null,this.$node.addClass(this.classes.empty)},destroy:function(){function t(t){t.destroy()}this.$node.off(".tt"),this.$node=e("<div>"),n.each(this.datasets,t)}}),t}(),l=function(){"use strict";var t=u.prototype;function e(){u.apply(this,[].slice.call(arguments,0))}return n.mixin(e.prototype,u.prototype,{open:function(){return!this._allDatasetsEmpty()&&this._show(),t.open.apply(this,[].slice.call(arguments,0))},close:function(){return this._hide(),t.close.apply(this,[].slice.call(arguments,0))},_onRendered:function(){return this._allDatasetsEmpty()?this._hide():this.isOpen()&&this._show(),t._onRendered.apply(this,[].slice.call(arguments,0))},_onCleared:function(){return this._allDatasetsEmpty()?this._hide():this.isOpen()&&this._show(),t._onCleared.apply(this,[].slice.call(arguments,0))},setLanguageDirection:function(e){return this.$node.css("ltr"===e?this.css.ltr:this.css.rtl),t.setLanguageDirection.apply(this,[].slice.call(arguments,0))},_hide:function(){this.$node.hide()},_show:function(){this.$node.css("display","block")}}),e}(),h=function(){"use strict";function t(t,s){var r,o,a,c,u,l,h,d,p,f,m;(t=t||{}).input||e.error("missing input"),t.menu||e.error("missing menu"),t.eventBus||e.error("missing event bus"),s.mixin(this),this.eventBus=t.eventBus,this.minLength=n.isNumber(t.minLength)?t.minLength:1,this.input=t.input,this.menu=t.menu,this.enabled=!0,this.active=!1,this.input.hasFocus()&&this.activate(),this.dir=this.input.getLangDir(),this._hacks(),this.menu.bind().onSync("selectableClicked",this._onSelectableClicked,this).onSync("asyncRequested",this._onAsyncRequested,this).onSync("asyncCanceled",this._onAsyncCanceled,this).onSync("asyncReceived",this._onAsyncReceived,this).onSync("datasetRendered",this._onDatasetRendered,this).onSync("datasetCleared",this._onDatasetCleared,this),r=i(this,"activate","open","_onFocused"),o=i(this,"deactivate","_onBlurred"),a=i(this,"isActive","isOpen","_onEnterKeyed"),c=i(this,"isActive","isOpen","_onTabKeyed"),u=i(this,"isActive","_onEscKeyed"),l=i(this,"isActive","open","_onUpKeyed"),h=i(this,"isActive","open","_onDownKeyed"),d=i(this,"isActive","isOpen","_onLeftKeyed"),p=i(this,"isActive","isOpen","_onRightKeyed"),f=i(this,"_openIfActive","_onQueryChanged"),m=i(this,"_openIfActive","_onWhitespaceChanged"),this.input.bind().onSync("focused",r,this).onSync("blurred",o,this).onSync("enterKeyed",a,this).onSync("tabKeyed",c,this).onSync("escKeyed",u,this).onSync("upKeyed",l,this).onSync("downKeyed",h,this).onSync("leftKeyed",d,this).onSync("rightKeyed",p,this).onSync("queryChanged",f,this).onSync("whitespaceChanged",m,this).onSync("langDirChanged",this._onLangDirChanged,this)}return n.mixin(t.prototype,{_hacks:function(){var t,i;t=this.input.$input||e("<div>"),i=this.menu.$node||e("<div>"),t.on("blur.tt",(function(e){var s,r,o;s=document.activeElement,r=i.is(s),o=i.has(s).length>0,n.isMsie()&&(r||o)&&(e.preventDefault(),e.stopImmediatePropagation(),n.defer((function(){t.focus()})))})),i.on("mousedown.tt",(function(t){t.preventDefault()}))},_onSelectableClicked:function(t,e){this.select(e)},_onDatasetCleared:function(){this._updateHint()},_onDatasetRendered:function(t,e,n,i){this._updateHint(),this.eventBus.trigger("render",n,i,e)},_onAsyncRequested:function(t,e,n){this.eventBus.trigger("asyncrequest",n,e)},_onAsyncCanceled:function(t,e,n){this.eventBus.trigger("asynccancel",n,e)},_onAsyncReceived:function(t,e,n){this.eventBus.trigger("asyncreceive",n,e)},_onFocused:function(){this._minLengthMet()&&this.menu.update(this.input.getQuery())},_onBlurred:function(){this.input.hasQueryChangedSinceLastFocus()&&this.eventBus.trigger("change",this.input.getQuery())},_onEnterKeyed:function(t,e){var n;(n=this.menu.getActiveSelectable())&&this.select(n)&&e.preventDefault()},_onTabKeyed:function(t,e){var n;(n=this.menu.getActiveSelectable())?this.select(n)&&e.preventDefault():(n=this.menu.getTopSelectable())&&this.autocomplete(n)&&e.preventDefault()},_onEscKeyed:function(){this.close()},_onUpKeyed:function(){this.moveCursor(-1)},_onDownKeyed:function(){this.moveCursor(1)},_onLeftKeyed:function(){"rtl"===this.dir&&this.input.isCursorAtEnd()&&this.autocomplete(this.menu.getTopSelectable())},_onRightKeyed:function(){"ltr"===this.dir&&this.input.isCursorAtEnd()&&this.autocomplete(this.menu.getTopSelectable())},_onQueryChanged:function(t,e){this._minLengthMet(e)?this.menu.update(e):this.menu.empty()},_onWhitespaceChanged:function(){this._updateHint()},_onLangDirChanged:function(t,e){this.dir!==e&&(this.dir=e,this.menu.setLanguageDirection(e))},_openIfActive:function(){this.isActive()&&this.open()},_minLengthMet:function(t){return(t=n.isString(t)?t:this.input.getQuery()||"").length>=this.minLength},_updateHint:function(){var t,e,i,s,r,o;t=this.menu.getTopSelectable(),e=this.menu.getSelectableData(t),i=this.input.getInputValue(),!e||n.isBlankString(i)||this.input.hasOverflow()?this.input.clearHint():(s=a.normalizeQuery(i),r=n.escapeRegExChars(s),(o=new RegExp("^(?:"+r+")(.+$)","i").exec(e.val))&&this.input.setHint(i+o[1]))},isEnabled:function(){return this.enabled},enable:function(){this.enabled=!0},disable:function(){this.enabled=!1},isActive:function(){return this.active},activate:function(){return!!this.isActive()||!(!this.isEnabled()||this.eventBus.before("active"))&&(this.active=!0,this.eventBus.trigger("active"),!0)},deactivate:function(){return!this.isActive()||!this.eventBus.before("idle")&&(this.active=!1,this.close(),this.eventBus.trigger("idle"),!0)},isOpen:function(){return this.menu.isOpen()},open:function(){return this.isOpen()||this.eventBus.before("open")||(this.menu.open(),this._updateHint(),this.eventBus.trigger("open")),this.isOpen()},close:function(){return this.isOpen()&&!this.eventBus.before("close")&&(this.menu.close(),this.input.clearHint(),this.input.resetInputValue(),this.eventBus.trigger("close")),!this.isOpen()},setVal:function(t){this.input.setQuery(n.toStr(t))},getVal:function(){return this.input.getQuery()},select:function(t){var e=this.menu.getSelectableData(t);return!(!e||this.eventBus.before("select",e.obj)||(this.input.setQuery(e.val,!0),this.eventBus.trigger("select",e.obj),this.close(),0))},autocomplete:function(t){var e,n;return e=this.input.getQuery(),!(!(n=this.menu.getSelectableData(t))||e===n.val||this.eventBus.before("autocomplete",n.obj)||(this.input.setQuery(n.val),this.eventBus.trigger("autocomplete",n.obj),0))},moveCursor:function(t){var e,n,i,s;return e=this.input.getQuery(),n=this.menu.selectableRelativeToCursor(t),s=(i=this.menu.getSelectableData(n))?i.obj:null,!(this._minLengthMet()&&this.menu.update(e)||this.eventBus.before("cursorchange",s)||(this.menu.setCursor(n),i?this.input.setInputValue(i.val):(this.input.resetInputValue(),this._updateHint()),this.eventBus.trigger("cursorchange",s),0))},destroy:function(){this.input.destroy(),this.menu.destroy()}}),t;function i(t){var e=[].slice.call(arguments,1);return function(){var i=[].slice.call(arguments);n.each(e,(function(e){return t[e].apply(t,i)}))}}}(),void function(){"use strict";var t,r,o;function c(t,n){t.each((function(){var t,i=e(this);(t=i.data(r.typeahead))&&n(t,i)}))}function d(t,e){return t.clone().addClass(e.classes.hint).removeData().css(e.css.hint).css(f(t)).prop("readonly",!0).removeAttr("id name placeholder required").attr({autocomplete:"off",spellcheck:"false",tabindex:-1})}function p(t,e){t.data(r.attrs,{dir:t.attr("dir"),autocomplete:t.attr("autocomplete"),spellcheck:t.attr("spellcheck"),style:t.attr("style")}),t.addClass(e.classes.input).attr({autocomplete:"off",spellcheck:!1});try{!t.attr("dir")&&t.attr("dir","auto")}catch(t){}return t}function f(t){return{backgroundAttachment:t.css("background-attachment"),backgroundClip:t.css("background-clip"),backgroundColor:t.css("background-color"),backgroundImage:t.css("background-image"),backgroundOrigin:t.css("background-origin"),backgroundPosition:t.css("background-position"),backgroundRepeat:t.css("background-repeat"),backgroundSize:t.css("background-size")}}function m(t){var e,i;e=t.data(r.www),i=t.parent().filter(e.selectors.wrapper),n.each(t.data(r.attrs),(function(e,i){n.isUndefined(e)?t.removeAttr(i):t.attr(i,e)})),t.removeData(r.typeahead).removeData(r.www).removeData(r.attr).removeClass(e.classes.input),i.length&&(t.detach().insertAfter(i),i.remove())}function g(t){var i;return(i=n.isJQuery(t)||n.isElement(t)?e(t).first():[]).length?i:null}t=e.fn.typeahead,r={www:"tt-www",attrs:"tt-attrs",typeahead:"tt-typeahead"},o={initialize:function(t,o){var c;return o=n.isArray(o)?o:[].slice.call(arguments,1),c=i((t=t||{}).classNames),this.each(f);function f(){var i,f,m,y,v,b,_,S,w,C,x;n.each(o,(function(e){e.highlight=!!t.highlight})),i=e(this),f=e(c.html.wrapper),m=g(t.hint),y=g(t.menu),v=!1!==t.hint&&!m,b=!1!==t.menu&&!y,v&&(m=d(i,c)),b&&(y=e(c.html.menu).css(c.css.menu)),m&&m.val(""),i=p(i,c),(v||b)&&(f.css(c.css.wrapper),i.css(v?c.css.input:c.css.inputWithNoHint),i.wrap(f).parent().prepend(v?m:null).append(b?y:null)),x=b?l:u,_=new s({el:i}),S=new a({hint:m,input:i},c),w=new x({node:y,datasets:o},c),C=new h({input:S,menu:w,eventBus:_,minLength:t.minLength},c),i.data(r.www,c),i.data(r.typeahead,C)}},isEnabled:function(){var t;return c(this.first(),(function(e){t=e.isEnabled()})),t},enable:function(){return c(this,(function(t){t.enable()})),this},disable:function(){return c(this,(function(t){t.disable()})),this},isActive:function(){var t;return c(this.first(),(function(e){t=e.isActive()})),t},activate:function(){return c(this,(function(t){t.activate()})),this},deactivate:function(){return c(this,(function(t){t.deactivate()})),this},isOpen:function(){var t;return c(this.first(),(function(e){t=e.isOpen()})),t},open:function(){return c(this,(function(t){t.open()})),this},close:function(){return c(this,(function(t){t.close()})),this},select:function(t){var n=!1,i=e(t);return c(this.first(),(function(t){n=t.select(i)})),n},autocomplete:function(t){var n=!1,i=e(t);return c(this.first(),(function(t){n=t.autocomplete(i)})),n},moveCursor:function(t){var e=!1;return c(this.first(),(function(n){e=n.moveCursor(t)})),e},val:function(t){var e;return arguments.length?(c(this,(function(e){e.setVal(t)})),this):(c(this.first(),(function(t){e=t.getVal()})),e)},destroy:function(){return c(this,(function(t,e){m(e),t.destroy()})),this}},e.fn.typeahead=function(t){return o[t]?o[t].apply(this,[].slice.call(arguments,1)):o.initialize.apply(this,arguments)},e.fn.typeahead.noConflict=function(){return e.fn.typeahead=t,this}}();var e,n,i,s,r,o,a,c,u,l,h}.apply(e,i),void 0===s||(t.exports=s)},9567:t=>{"use strict";t.exports=window.jQuery}},e={};function n(i){var s=e[i];if(void 0!==s)return s.exports;var r=e[i]={exports:{}};return t[i].call(r.exports,r,r.exports,n),r.exports}n.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.d=(t,e)=>{for(var i in e)n.o(e,i)&&!n.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var i={};(()=>{"use strict";n.r(i);var t=Object.defineProperty,e=Object.getOwnPropertySymbols,s=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable,o=(e,n,i)=>n in e?t(e,n,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[n]=i,a=(t,n)=>{for(var i in n||(n={}))s.call(n,i)&&o(t,i,n[i]);if(e)for(var i of e(n))r.call(n,i)&&o(t,i,n[i]);return t};
/**
 * Copyright since 2007 PrestaShop SA and Contributors
 * PrestaShop is an International Registered Trademark & Property of PrestaShop SA
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Open Software License (OSL 3.0)
 * that is bundled with this package in the file LICENSE.md.
 * It is also available through the world-wide-web at this URL:
 * https://opensource.org/licenses/OSL-3.0
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@prestashop.com so we can send you a copy immediately.
 *
 * DISCLAIMER
 *
 * Do not edit or add to this file if you wish to upgrade PrestaShop to newer
 * versions in the future. If you wish to customize PrestaShop for your
 * needs please refer to https://devdocs.prestashop.com/ for more information.
 *
 * @author    PrestaShop SA and Contributors <contact@prestashop.com>
 * @copyright Since 2007 PrestaShop SA and Contributors
 * @license   https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
 */
class c{constructor(t,e){this.$searchInput=t,this.searchInputId=this.$searchInput.prop("id");const n={suggestion:t=>{let e=t;return"function"==typeof this.config.display?e=this.config.display(t):Object.prototype.hasOwnProperty.call(t,this.config.display)&&(e=t[this.config.display]),`<div class="px-2">${e}</div>`},pending:t=>`<div class="px-2">Searching for "${t.query}"</div>`,notFound:t=>`<div class="px-2">No results found for "${t.query}"</div>`};this.config=a({minLength:2,highlight:!0,hint:!1,onSelect:(t,e,n)=>(n.typeahead("val",t[this.config.value]),!0),onClose:(t,e)=>(e.typeahead("val",""),!0),suggestionLimit:30,dataLimit:0,display:"name",value:"id",templates:n},e),Object.prototype.hasOwnProperty.call(e,"templates")&&(this.config.templates=a(a({},n),e.templates)),this.buildTypeahead()}buildTypeahead(){const t={minLength:this.config.minLength,highlight:this.config.highlight,hint:this.config.hint,onSelect:this.config.onSelect,onClose:this.config.onClose},e={source:this.config.source,display:this.config.display,value:this.config.value,limit:this.config.suggestionLimit,dataLimit:this.config.dataLimit,templates:this.config.templates};this.$searchInput.typeahead(t,e).bind("typeahead:select",((t,e)=>this.config.onSelect(e,t,this.$searchInput))).bind("typeahead:close",(t=>{this.config.onClose(t,this.$searchInput)}))}}var u=n(9567),l=Object.defineProperty,h=Object.getOwnPropertySymbols,d=Object.prototype.hasOwnProperty,p=Object.prototype.propertyIsEnumerable,f=(t,e,n)=>e in t?l(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,m=(t,e)=>{for(var n in e||(e={}))d.call(e,n)&&f(t,n,e[n]);if(h)for(var n of h(e))p.call(e,n)&&f(t,n,e[n]);return t};
/**
 * Copyright since 2007 PrestaShop SA and Contributors
 * PrestaShop is an International Registered Trademark & Property of PrestaShop SA
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Open Software License (OSL 3.0)
 * that is bundled with this package in the file LICENSE.md.
 * It is also available through the world-wide-web at this URL:
 * https://opensource.org/licenses/OSL-3.0
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@prestashop.com so we can send you a copy immediately.
 *
 * DISCLAIMER
 *
 * Do not edit or add to this file if you wish to upgrade PrestaShop to newer
 * versions in the future. If you wish to customize PrestaShop for your
 * needs please refer to https://devdocs.prestashop.com/ for more information.
 *
 * @author    PrestaShop SA and Contributors <contact@prestashop.com>
 * @copyright Since 2007 PrestaShop SA and Contributors
 * @license   https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
 */
class g{constructor(t){const e=m({id:"confirm-modal",closable:!1},t);this.buildModalContainer(e)}buildModalContainer(t){this.container=document.createElement("div"),this.container.classList.add("modal","fade"),this.container.id=t.id,this.dialog=document.createElement("div"),this.dialog.classList.add("modal-dialog"),t.dialogStyle&&Object.keys(t.dialogStyle).forEach((e=>{this.dialog.style[e]=t.dialogStyle[e]})),this.content=document.createElement("div"),this.content.classList.add("modal-content"),this.message=document.createElement("p"),this.message.classList.add("modal-message"),this.header=document.createElement("div"),this.header.classList.add("modal-header"),t.modalTitle&&(this.title=document.createElement("h4"),this.title.classList.add("modal-title"),this.title.innerHTML=t.modalTitle),this.closeIcon=document.createElement("button"),this.closeIcon.classList.add("close"),this.closeIcon.setAttribute("type","button"),this.closeIcon.dataset.dismiss="modal",this.closeIcon.innerHTML="×",this.body=document.createElement("div"),this.body.classList.add("modal-body","text-left","font-weight-normal"),this.title&&this.header.appendChild(this.title),this.header.appendChild(this.closeIcon),this.content.append(this.header,this.body),this.body.appendChild(this.message),this.dialog.appendChild(this.content),this.container.appendChild(this.dialog)}}class y{constructor(t){const e=m({id:"confirm-modal",closable:!1,dialogStyle:{}},t);this.initContainer(e)}initContainer(t){this.modal||(this.modal=new g(t)),this.$modal=u(this.modal.container);const{id:e,closable:n}=t;this.$modal.modal({backdrop:!!n||"static",keyboard:void 0===n||n,show:!1}),this.$modal.on("hidden.bs.modal",(()=>{const n=document.querySelector(`#${e}`);n&&n.remove(),t.closeCallback&&t.closeCallback()})),document.body.appendChild(this.modal.container)}setTitle(t){this.modal.title||(this.modal.title=document.createElement("h4"),this.modal.title.classList.add("modal-title"),this.modal.closeIcon?this.modal.header.insertBefore(this.modal.title,this.modal.closeIcon):this.modal.header.appendChild(this.modal.title)),this.modal.title.innerHTML=t}render(t){this.modal.message.innerHTML=t}show(){this.$modal.modal("show")}hide(){this.$modal.modal("hide"),this.$modal.on("shown.bs.modal",(()=>{this.$modal.modal("hide"),this.$modal.off("shown.bs.modal")}))}}
/**
 * Copyright since 2007 PrestaShop SA and Contributors
 * PrestaShop is an International Registered Trademark & Property of PrestaShop SA
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Open Software License (OSL 3.0)
 * that is bundled with this package in the file LICENSE.md.
 * It is also available through the world-wide-web at this URL:
 * https://opensource.org/licenses/OSL-3.0
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@prestashop.com so we can send you a copy immediately.
 *
 * DISCLAIMER
 *
 * Do not edit or add to this file if you wish to upgrade PrestaShop to newer
 * versions in the future. If you wish to customize PrestaShop for your
 * needs please refer to https://devdocs.prestashop.com/ for more information.
 *
 * @author    PrestaShop SA and Contributors <contact@prestashop.com>
 * @copyright Since 2007 PrestaShop SA and Contributors
 * @license   https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
 */
function v(t){return void 0===t}var b=Object.defineProperty,_=Object.getOwnPropertySymbols,S=Object.prototype.hasOwnProperty,w=Object.prototype.propertyIsEnumerable,C=(t,e,n)=>e in t?b(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;
/**
 * Copyright since 2007 PrestaShop SA and Contributors
 * PrestaShop is an International Registered Trademark & Property of PrestaShop SA
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Open Software License (OSL 3.0)
 * that is bundled with this package in the file LICENSE.md.
 * It is also available through the world-wide-web at this URL:
 * https://opensource.org/licenses/OSL-3.0
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@prestashop.com so we can send you a copy immediately.
 *
 * DISCLAIMER
 *
 * Do not edit or add to this file if you wish to upgrade PrestaShop to newer
 * versions in the future. If you wish to customize PrestaShop for your
 * needs please refer to https://devdocs.prestashop.com/ for more information.
 *
 * @author    PrestaShop SA and Contributors <contact@prestashop.com>
 * @copyright Since 2007 PrestaShop SA and Contributors
 * @license   https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
 */
class x extends g{constructor(t){super(t)}buildModalContainer(t){super.buildModalContainer(t),this.message.classList.add("confirm-message"),this.message.innerHTML=t.confirmMessage,this.footer=document.createElement("div"),this.footer.classList.add("modal-footer"),this.closeButton=document.createElement("button"),this.closeButton.setAttribute("type","button"),this.closeButton.classList.add("btn","btn-outline-secondary","btn-lg"),this.closeButton.dataset.dismiss="modal",this.closeButton.innerHTML=t.closeButtonLabel,this.confirmButton=document.createElement("button"),this.confirmButton.setAttribute("type","button"),this.confirmButton.classList.add("btn",t.confirmButtonClass,"btn-lg","btn-confirm-submit"),this.confirmButton.dataset.dismiss="modal",this.confirmButton.innerHTML=t.confirmButtonLabel,this.footer.append(this.closeButton,...t.customButtons,this.confirmButton),this.content.append(this.footer)}}class $ extends y{constructor(t,e,n){var i;let s;s=v(t.confirmCallback)?v(e)?()=>{console.error("No confirm callback provided for ConfirmModal component.")}:e:t.confirmCallback;super(((t,e)=>{for(var n in e||(e={}))S.call(e,n)&&C(t,n,e[n]);if(_)for(var n of _(e))w.call(e,n)&&C(t,n,e[n]);return t})({id:"confirm-modal",confirmMessage:"Are you sure?",closeButtonLabel:"Close",confirmButtonLabel:"Accept",confirmButtonClass:"btn-primary",customButtons:[],closable:!1,modalTitle:t.confirmTitle,dialogStyle:{},confirmCallback:s,closeCallback:null!=(i=t.closeCallback)?i:n},t))}initContainer(t){this.modal=new x(t),this.modal.confirmButton.addEventListener("click",t.confirmCallback),super.initContainer(t)}}var I=function(){if("undefined"!=typeof Map)return Map;function t(t,e){var n=-1;return t.some((function(t,i){return t[0]===e&&(n=i,!0)})),n}return function(){function e(){this.__entries__=[]}return Object.defineProperty(e.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),e.prototype.get=function(e){var n=t(this.__entries__,e),i=this.__entries__[n];return i&&i[1]},e.prototype.set=function(e,n){var i=t(this.__entries__,e);~i?this.__entries__[i][1]=n:this.__entries__.push([e,n])},e.prototype.delete=function(e){var n=this.__entries__,i=t(n,e);~i&&n.splice(i,1)},e.prototype.has=function(e){return!!~t(this.__entries__,e)},e.prototype.clear=function(){this.__entries__.splice(0)},e.prototype.forEach=function(t,e){void 0===e&&(e=null);for(var n=0,i=this.__entries__;n<i.length;n++){var s=i[n];t.call(e,s[1],s[0])}},e}()}(),A="undefined"!=typeof window&&"undefined"!=typeof document&&window.document===document,E=void 0!==n.g&&n.g.Math===Math?n.g:"undefined"!=typeof self&&self.Math===Math?self:"undefined"!=typeof window&&window.Math===Math?window:Function("return this")(),O="function"==typeof requestAnimationFrame?requestAnimationFrame.bind(E):function(t){return setTimeout((function(){return t(Date.now())}),1e3/60)};var k=["top","right","bottom","left","width","height","size","weight"],T="undefined"!=typeof MutationObserver,L=function(){function t(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=function(t,e){var n=!1,i=!1,s=0;function r(){n&&(n=!1,t()),i&&a()}function o(){O(r)}function a(){var t=Date.now();if(n){if(t-s<2)return;i=!0}else n=!0,i=!1,setTimeout(o,e);s=t}return a}(this.refresh.bind(this),20)}return t.prototype.addObserver=function(t){~this.observers_.indexOf(t)||this.observers_.push(t),this.connected_||this.connect_()},t.prototype.removeObserver=function(t){var e=this.observers_,n=e.indexOf(t);~n&&e.splice(n,1),!e.length&&this.connected_&&this.disconnect_()},t.prototype.refresh=function(){this.updateObservers_()&&this.refresh()},t.prototype.updateObservers_=function(){var t=this.observers_.filter((function(t){return t.gatherActive(),t.hasActive()}));return t.forEach((function(t){return t.broadcastActive()})),t.length>0},t.prototype.connect_=function(){A&&!this.connected_&&(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),T?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},t.prototype.disconnect_=function(){A&&this.connected_&&(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},t.prototype.onTransitionEnd_=function(t){var e=t.propertyName,n=void 0===e?"":e;k.some((function(t){return!!~n.indexOf(t)}))&&this.refresh()},t.getInstance=function(){return this.instance_||(this.instance_=new t),this.instance_},t.instance_=null,t}(),D=function(t,e){for(var n=0,i=Object.keys(e);n<i.length;n++){var s=i[n];Object.defineProperty(t,s,{value:e[s],enumerable:!1,writable:!1,configurable:!0})}return t},q=function(t){return t&&t.ownerDocument&&t.ownerDocument.defaultView||E},j=H(0,0,0,0);function R(t){return parseFloat(t)||0}function B(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return e.reduce((function(e,n){return e+R(t["border-"+n+"-width"])}),0)}function M(t){var e=t.clientWidth,n=t.clientHeight;if(!e&&!n)return j;var i=q(t).getComputedStyle(t),s=function(t){for(var e={},n=0,i=["top","right","bottom","left"];n<i.length;n++){var s=i[n],r=t["padding-"+s];e[s]=R(r)}return e}(i),r=s.left+s.right,o=s.top+s.bottom,a=R(i.width),c=R(i.height);if("border-box"===i.boxSizing&&(Math.round(a+r)!==e&&(a-=B(i,"left","right")+r),Math.round(c+o)!==n&&(c-=B(i,"top","bottom")+o)),!function(t){return t===q(t).document.documentElement}(t)){var u=Math.round(a+r)-e,l=Math.round(c+o)-n;1!==Math.abs(u)&&(a-=u),1!==Math.abs(l)&&(c-=l)}return H(s.left,s.top,a,c)}var z="undefined"!=typeof SVGGraphicsElement?function(t){return t instanceof q(t).SVGGraphicsElement}:function(t){return t instanceof q(t).SVGElement&&"function"==typeof t.getBBox};function F(t){return A?z(t)?function(t){var e=t.getBBox();return H(0,0,e.width,e.height)}(t):M(t):j}function H(t,e,n,i){return{x:t,y:e,width:n,height:i}}var P=function(){function t(t){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=H(0,0,0,0),this.target=t}return t.prototype.isActive=function(){var t=F(this.target);return this.contentRect_=t,t.width!==this.broadcastWidth||t.height!==this.broadcastHeight},t.prototype.broadcastRect=function(){var t=this.contentRect_;return this.broadcastWidth=t.width,this.broadcastHeight=t.height,t},t}(),K=function(t,e){var n,i,s,r,o,a,c,u=(i=(n=e).x,s=n.y,r=n.width,o=n.height,a="undefined"!=typeof DOMRectReadOnly?DOMRectReadOnly:Object,c=Object.create(a.prototype),D(c,{x:i,y:s,width:r,height:o,top:s,right:i+r,bottom:o+s,left:i}),c);D(this,{target:t,contentRect:u})},N=function(){function t(t,e,n){if(this.activeObservations_=[],this.observations_=new I,"function"!=typeof t)throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=t,this.controller_=e,this.callbackCtx_=n}return t.prototype.observe=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if("undefined"!=typeof Element&&Element instanceof Object){if(!(t instanceof q(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var e=this.observations_;e.has(t)||(e.set(t,new P(t)),this.controller_.addObserver(this),this.controller_.refresh())}},t.prototype.unobserve=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if("undefined"!=typeof Element&&Element instanceof Object){if(!(t instanceof q(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var e=this.observations_;e.has(t)&&(e.delete(t),e.size||this.controller_.removeObserver(this))}},t.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},t.prototype.gatherActive=function(){var t=this;this.clearActive(),this.observations_.forEach((function(e){e.isActive()&&t.activeObservations_.push(e)}))},t.prototype.broadcastActive=function(){if(this.hasActive()){var t=this.callbackCtx_,e=this.activeObservations_.map((function(t){return new K(t.target,t.broadcastRect())}));this.callback_.call(t,e,t),this.clearActive()}},t.prototype.clearActive=function(){this.activeObservations_.splice(0)},t.prototype.hasActive=function(){return this.activeObservations_.length>0},t}(),Q="undefined"!=typeof WeakMap?new WeakMap:new I,V=function t(e){if(!(this instanceof t))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var n=L.getInstance(),i=new N(e,n,this);Q.set(this,i)};["observe","unobserve","disconnect"].forEach((function(t){V.prototype[t]=function(){var e;return(e=Q.get(this))[t].apply(e,arguments)}}));void 0!==E.ResizeObserver&&E.ResizeObserver;const W=class extends Event{constructor(t,e={}){super(W.parentWindowEvent),this.eventName=t,this.eventParameters=e}get name(){return this.eventName}get parameters(){return this.eventParameters}};W.parentWindowEvent="IframeClientEvent";Object.defineProperty,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;Object.defineProperty,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;
/**
 * Copyright since 2007 PrestaShop SA and Contributors
 * PrestaShop is an International Registered Trademark & Property of PrestaShop SA
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Open Software License (OSL 3.0)
 * that is bundled with this package in the file LICENSE.md.
 * It is also available through the world-wide-web at this URL:
 * https://opensource.org/licenses/OSL-3.0
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@prestashop.com so we can send you a copy immediately.
 *
 * DISCLAIMER
 *
 * Do not edit or add to this file if you wish to upgrade PrestaShop to newer
 * versions in the future. If you wish to customize PrestaShop for your
 * needs please refer to https://devdocs.prestashop.com/ for more information.
 *
 * @author    PrestaShop SA and Contributors <contact@prestashop.com>
 * @copyright Since 2007 PrestaShop SA and Contributors
 * @license   https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
 */const U=$;var G=n(3943),J=n.n(G),Y=n(9567);
/**
 * Copyright since 2007 PrestaShop SA and Contributors
 * PrestaShop is an International Registered Trademark & Property of PrestaShop SA
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Open Software License (OSL 3.0)
 * that is bundled with this package in the file LICENSE.md.
 * It is also available through the world-wide-web at this URL:
 * https://opensource.org/licenses/OSL-3.0
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@prestashop.com so we can send you a copy immediately.
 *
 * DISCLAIMER
 *
 * Do not edit or add to this file if you wish to upgrade PrestaShop to newer
 * versions in the future. If you wish to customize PrestaShop for your
 * needs please refer to https://devdocs.prestashop.com/ for more information.
 *
 * @author    PrestaShop SA and Contributors <contact@prestashop.com>
 * @copyright Since 2007 PrestaShop SA and Contributors
 * @license   https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
 */
const Z={searchInputSelector:".entity-search-input",entitiesContainerSelector:".entities-list",listContainerSelector:".entities-list-container",entityItemSelector:".entity-item",entityDeleteSelector:".entity-item-delete",emptyStateSelector:".empty-entity-list"};class X{constructor(t,e){this.$entitySearchInputContainer=t,this.options={},this.buildOptions(e),this.$entitySearchInput=Y(this.options.searchInputSelector,this.$entitySearchInputContainer),this.$entitiesContainer=Y(this.options.entitiesContainerSelector,this.$entitySearchInputContainer),this.$listContainer=Y(this.options.listContainerSelector,this.$entitySearchInputContainer),this.$emptyState=Y(this.options.emptyStateSelector,this.$entitySearchInputContainer),this.buildRemoteSource(),this.buildAutoCompleteSearch(),this.buildActions(),this.updateEmptyState()}setValues(t){this.clearSelectedItems(),!t||t.length<=0||t.forEach(((t,e)=>{this.appendSelectedItem(e)}))}addItem(t){return this.appendSelectedItem(t)}getOption(t){return this.options[t]}setOption(t,e){this.options[t]=e,"remoteUrl"===t&&this.entityRemoteSource&&(this.entityRemoteSource.remote.url=this.options.remoteUrl)}buildOptions(t){const e=t||{},n={suggestionField:"name",prototypeTemplate:void 0,prototypeIndex:"__index__",prototypeMapping:{id:"__id__",name:"__name__",image:"__image__"},identifierField:"id",allowDelete:!0,dataLimit:0,minLength:2,remoteUrl:void 0,filterSelected:!0,filteredIdentities:[],removeModal:{id:"modal-confirm-remove-entity",title:"Delete item",message:"Are you sure you want to delete this item?",apply:"Delete",cancel:"Cancel",buttonClass:"btn-danger"},searchInputSelector:Z.searchInputSelector,entitiesContainerSelector:Z.entitiesContainerSelector,listContainerSelector:Z.listContainerSelector,entityItemSelector:Z.entityItemSelector,entityDeleteSelector:Z.entityDeleteSelector,emptyStateSelector:Z.emptyStateSelector,queryWildcard:"__QUERY__",onRemovedContent:void 0,onSelectedContent:void 0,responseTransformer:t=>t||[],suggestionTemplate:void 0};Object.keys(n).forEach((t=>{this.initOption(t,e,n[t])})),this.options.filteredIdentities=this.options.filteredIdentities.map(String)}initOption(t,e,n){Object.prototype.hasOwnProperty.call(e,t)?this.options[t]=e[t]:void 0!==this.$entitySearchInputContainer.data(t)?this.options[t]=this.$entitySearchInputContainer.data(t):this.options[t]=n}buildActions(){Y(this.$entitiesContainer).on("click",this.options.entityDeleteSelector,(t=>{if(!this.options.allowDelete)return;const e=Y(t.target).closest(this.options.entityItemSelector);new U({id:this.options.removeModal.id,confirmTitle:this.options.removeModal.title,confirmMessage:this.options.removeModal.message,closeButtonLabel:this.options.removeModal.cancel,confirmButtonLabel:this.options.removeModal.apply,confirmButtonClass:this.options.removeModal.buttonClass,closable:!0},(()=>{e.remove(),this.updateEmptyState(),void 0!==this.options.onRemovedContent&&this.options.onRemovedContent(e)})).show()}));Y(this.options.entityDeleteSelector,this.$entitiesContainer).toggle(!!this.options.allowDelete)}buildAutoCompleteSearch(){const t={source:this.entityRemoteSource,dataLimit:this.options.dataLimit,value:this.options.identifierField,minLength:this.options.minLength,templates:{suggestion:t=>this.showSuggestion(t)},onSelect:t=>1===this.options.dataLimit?this.replaceSelectedItem(t):this.appendSelectedItem(t)};this.$entitySearchInput.length&&(this.autoSearch=new c(this.$entitySearchInput,t))}showSuggestion(t){if(!v(this.options.suggestionTemplate))return this.options.suggestionTemplate(t);let e="";return Object.prototype.hasOwnProperty.call(t,"image")&&(e=`<img src="${t.image}" /> `),`<div class="search-suggestion">${e}${t[this.options.suggestionField]}</div>`}buildRemoteSource(){this.entityRemoteSource=new(J())({datumTokenizer:J().tokenizers.whitespace,queryTokenizer:J().tokenizers.whitespace,identify(t){return t[this.options.identifierField]},remote:{url:this.options.remoteUrl,cache:!1,wildcard:this.options.queryWildcard,transform:t=>{if(!t)return[];const e=this.options.responseTransformer(t),n=this.getSelectedIds(),i=[];return e.forEach((t=>{const e=String(t[this.options.identifierField]),s=this.options.filterSelected&&n.includes(e),r=this.options.filteredIdentities.includes(e);s||r||i.push(t)})),i}}})}clearSelectedItems(){this.$entitiesContainer.empty(),this.updateEmptyState()}replaceSelectedItem(t){return this.clearSelectedItems(),this.addSelectedContentToContainer(t),!0}appendSelectedItem(t){const e=Y(this.options.entityItemSelector,this.$entitiesContainer);return!(0!==this.options.dataLimit&&e.length>=this.options.dataLimit)&&(this.addSelectedContentToContainer(t),!0)}updateEmptyState(){const t=Y(this.options.entityItemSelector,this.$entitiesContainer);this.$emptyState.toggle(0===t.length),this.$listContainer.toggle(0!==t.length)}addSelectedContentToContainer(t){const e=Y(this.options.entityItemSelector,this.$entitiesContainer),n=e.length?this.getIndexFromItem(e.last())+1:0,i=this.renderSelected(t,n),s=Y(i);Y(this.options.entityDeleteSelector,s).toggle(!!this.options.allowDelete),this.$entitiesContainer.append(s),void 0!==this.options.onSelectedContent&&this.options.onSelectedContent(s,t),this.updateEmptyState()}getIndexFromItem(t){let e=t.index();const n=`\\[(\\d+)\\]\\[${this.options.identifierField}\\]`;return t.find("input").each(((t,i)=>{const s=i.name.match(n);if(s&&s.length>0){const t=parseInt(s[1],10);Number.isNaN(t)||(e=t)}})),e}renderSelected(t,e){let n=this.options.prototypeTemplate.replace(new RegExp(this.options.prototypeIndex,"g"),String(e));return Object.keys(this.options.prototypeMapping).forEach((e=>{const i=t[e]||"";n=n.replace(new RegExp(this.options.prototypeMapping[e],"g"),i)})),n}getSelectedIds(){const t=[];return Y(this.options.entityItemSelector,this.$entitiesContainer).each(((e,n)=>{const i=`\\[${this.options.identifierField}\\]`;Y(n).find("input").each(((e,n)=>{n.name.match(i)&&t.push(n.value)}))})),t}}
/**
 * Copyright since 2007 PrestaShop SA and Contributors
 * PrestaShop is an International Registered Trademark & Property of PrestaShop SA
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Open Software License (OSL 3.0)
 * that is bundled with this package in the file LICENSE.md.
 * It is also available through the world-wide-web at this URL:
 * https://opensource.org/licenses/OSL-3.0
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@prestashop.com so we can send you a copy immediately.
 *
 * DISCLAIMER
 *
 * Do not edit or add to this file if you wish to upgrade PrestaShop to newer
 * versions in the future. If you wish to customize PrestaShop for your
 * needs please refer to https://devdocs.prestashop.com/ for more information.
 *
 * @author    PrestaShop SA and Contributors <contact@prestashop.com>
 * @copyright Since 2007 PrestaShop SA and Contributors
 * @license   https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
 */
class tt{constructor(t,e){this.currencySymbolSelect=t,this.callbackChange=e,this.init()}init(){const t=document.querySelector(this.currencySymbolSelect);t&&(this.callbackChange(this.getSymbol(t)),t.addEventListener("change",(()=>this.callbackChange(this.getSymbol(t)))))}getSymbol(t){var e,n;const i=null!=(e=t.dataset.defaultCurrencySymbol)?e:"",s=t.item(t.selectedIndex);return s&&null!=(n=s.getAttribute("symbol"))?n:i}}
/**
 * Copyright since 2007 PrestaShop SA and Contributors
 * PrestaShop is an International Registered Trademark & Property of PrestaShop SA
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Open Software License (OSL 3.0)
 * that is bundled with this package in the file LICENSE.md.
 * It is also available through the world-wide-web at this URL:
 * https://opensource.org/licenses/OSL-3.0
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@prestashop.com so we can send you a copy immediately.
 *
 * DISCLAIMER
 *
 * Do not edit or add to this file if you wish to upgrade PrestaShop to newer
 * versions in the future. If you wish to customize PrestaShop for your
 * needs please refer to https://devdocs.prestashop.com/ for more information.
 *
 * @author    PrestaShop SA and Contributors <contact@prestashop.com>
 * @copyright Since 2007 PrestaShop SA and Contributors
 * @license   https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
 */const et="#specific_price_groups_currency_id",nt="#specific_price_customer",it=".js-fixed-price-row .input-group.money-type .input-group-append .input-group-text, .js-fixed-price-row .input-group.money-type .input-group-prepend .input-group-text",st="#specific_price_impact_reduction_type",rt=".price-reduction-value .input-group .input-group-append .input-group-text, .price-reduction-value .input-group .input-group-prepend .input-group-text",ot=".js-include-tax-row",at="#specific_price_customer_list .entity-item",ct="switchSpecificPriceCustomer",{$:ut}=window;class lt{constructor(t,e,n,i){this.$reductionTypeSelector=ut(t),this.$taxInclusionInputs=ut(e),this.currencySymbolSelect=n,this.reductionAmountSymbolSelector=i,this.handle(),this.$reductionTypeSelector.on("change",(()=>this.handle()))}handle(){const t="percentage"===this.$reductionTypeSelector.val();if(t?this.$taxInclusionInputs.fadeOut():this.$taxInclusionInputs.fadeIn(),""!==this.reductionAmountSymbolSelector){const e=document.querySelectorAll(this.reductionAmountSymbolSelector);e.length&&e.forEach((e=>{e.innerHTML=t?"%":this.getSymbol(e.innerHTML)}))}}getSymbol(t){var e,n;const i=document.querySelector(this.currencySymbolSelect);if(!i)return t;const s=null!=(e=i.dataset.defaultCurrencySymbol)?e:"",r=i.item(i.selectedIndex);return r&&null!=(n=r.getAttribute("symbol"))?n:s}}
/**
 * Copyright since 2007 PrestaShop SA and Contributors
 * PrestaShop is an International Registered Trademark & Property of PrestaShop SA
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Open Software License (OSL 3.0)
 * that is bundled with this package in the file LICENSE.md.
 * It is also available through the world-wide-web at this URL:
 * https://opensource.org/licenses/OSL-3.0
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@prestashop.com so we can send you a copy immediately.
 *
 * DISCLAIMER
 *
 * Do not edit or add to this file if you wish to upgrade PrestaShop to newer
 * versions in the future. If you wish to customize PrestaShop for your
 * needs please refer to https://devdocs.prestashop.com/ for more information.
 *
 * @author    PrestaShop SA and Contributors <contact@prestashop.com>
 * @copyright Since 2007 PrestaShop SA and Contributors
 * @license   https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
 */
const{$:ht}=window;ht((()=>{window.prestashop.component.initComponents(["EventEmitter","DisablingSwitch","DateRange"]);const{eventEmitter:t}=window.prestashop.instance;new tt(et,(t=>{if(""===t)return;const e=document.querySelectorAll(it);e.length&&e.forEach((e=>{e.innerHTML=t}));const n=document.querySelector(st);if(n){for(let e=0;e<n.options.length;e+=1){const i=n.options[e];"amount"===i.value&&(i.innerHTML=t)}if("amount"===n.options[n.selectedIndex].value){const e=document.querySelectorAll(rt);e.length&&e.forEach((e=>{e.innerHTML=t}))}}})),new lt(st,ot,et,rt),new X(ht(nt),{responseTransformer:t=>t&&0!==t.customers.length?Object.values(t.customers):[]}),t.on(ct,(t=>{ht(at).toggleClass("disabled",t.disable)}))}))})(),window.specific_price_form=i})();