[NIVEL 2 AVANCE] Issues #49-#53 - Componentes Principales Verificados

Todos los componentes del NIVEL 2 ya están implementados correctamente:
-  Notification Bar (#49)
-  Navbar (#50)
-  Hero Section (#51)
-  Sidebar (#52)
-  Footer (#53)

Solo se actualizó notification-bar.css para usar variables CSS.

Próximo paso: NIVEL 3 (Refinamientos visuales)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
FrankZamora
2025-11-04 20:01:07 -06:00
parent 6e4b786595
commit ea38a12055
1216 changed files with 195275 additions and 6 deletions

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1 @@
(function(){return {"error":true,"code":"wrongConfig-dataError"};})()

View File

@@ -0,0 +1,3 @@
<!-- saved from url=(0012)about:srcdoc -->
<html lang="en-US"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><script charset="utf-8" async="" defer="true" src="https://static.olark.com/jsclient/locale/en-US.js"></script><script src="https://static.olark.com/a/assets/v0/site/5504-466-10-1887.js?cb=2025-11-04" async="" defer="" data-cfasync="false"></script><script src="https://static.olark.com/jsclient-bucket3/application2.js?v=1761152824221" async="" defer="" data-cfasync="false"></script></head><body><script data-olark="true" aria-hidden="true" tabindex="-1" src="https://static.olark.com/jsclient/app.js" async="" defer=""></script><span style="display: none;"><iframe style="display: none !important;" id="_olark_framesocket36187" src="https://static.olark.com/jsclient-bucket3/storage.html?v=1761152824221#TK6806084988706768"></iframe></span></body></html>

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1 @@
!function(w,i,n,s,g,h,t){n[w]=n[w]||function(){(n[w].q=n[w].q||[]).push(arguments)};/*#code.optimize#*/n[w]("metadata",(function(){n[w]("set","_s","insights")}),!1,!0);n[w]("metadata",(function(){n[w]("set","_u","5213390")}),!1,!0);n[w]("metadata",(function(){n[w]("set","C_IS","1")}),!1,!0);if(n[w].v||n[w].t)return n[w]("event",w,"dup."+g.projectId);n[w].t=!0,(h=i.createElement(s)).async=!0,h.src="https://bat.bing.com/p/insights/s/0.8.38",(t=i.getElementsByTagName(s)[0]).parentNode.insertBefore(h,t),n[w]("start",g),n[w].q.unshift(n[w].q.pop()),n[w]("set","C_IS","1")}("webinsights",document,window,"script",{"projectId":"9m31kw9gdv","upload":"https://bat.bing.com/p/insights/c/b","expire":365,"cookies":["_uetmsclkid","_uetvid"],"track":true,"content":true,"dob":2134});

View File

@@ -0,0 +1,41 @@
(function(w,d,c,k,a,b,t,e,h,s) {
var cs = d.currentScript;
if (cs) {
var uo = cs.getAttribute('data-ueto');
if (uo && w[uo] && typeof w[uo].setUserSignals === 'function') {
w[uo].setUserSignals({'ea': c, 'kc': k, 'at': a, 'bi': b, 'pt': t, 'ec': e, 'ah': h, 'sb': s});
}
}
})(window, document, false, false, false, false, false, false, false, false);
(function(w,d,s,i) {
var c=d.currentScript;
if (c) {
var uo = c.getAttribute('data-ueto');
if (uo && w[uo] && w[uo].uetConfig && w[uo].uetConfig.deBlock === true)
return;
}
var f,j; f=d.getElementsByTagName(s)[0]; j=d.createElement(s); j.async=true;
j.src='https://bat.bing.com/p/insights/t/'+i;
j.onload = function () {
if (!c) return;
var co = function(u) { return u && typeof u === 'object' && !(u instanceof Array) && u.beaconParams && u.beaconParams.mid && w.webinsights; };
var r = 40;
var cl = function() {
if (r-- < 1) return;
var uo = c.getAttribute('data-ueto');
if (!uo) return;
var u = w[uo];
w.insightsuetq = w.mtagq || u;
if (!co(u)) { setTimeout(function () { cl(); }, 250); return; }
var m = u.beaconParams.mid;
w.webinsights('set', '_uetmid', m);
w.webinsights('metadata', (function () { w.webinsights('set', '_uetmid', m); }), false);
d.addEventListener('UetEvent', function(e) {
var nm = u.beaconParams.mid;
if (m !== nm) { m = nm; w.webinsights('set', '_uetmid', m); }
});
};
cl();
};
f.parentNode.insertBefore(j,f);
})(window, document, 'script', '5213390');

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

View File

@@ -0,0 +1,9 @@
<!-- saved from url=(0072)https://a24704070387.cdn.optimizely.com/client_storage/a24704070387.html -->
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><script>
var allowedOrigins = [["^https?://(.+\\.)?www\\.provationmedical\\.com$", ""], ["^https?://(.+\\.)?gatsbyjs\\.io$", ""], ["^https?://(.+\\.)?accruent\\.com$", ""], ["^https?://(.+\\.)?www\\.dynapar\\.com$", ""], ["^https?://(.+\\.)?tek\\.com$", ""], ["^https?://(.+\\.)?fluke\\.com$", ""], ["^https?://(.+\\.)?dovermotion\\.com$", ""], ["^https?://(.+\\.)?www\\.emaint\\.com$", ""], ["^https?://(.+\\.)?www\\.intelex\\.com$", ""], ["^https?://(.+\\.)?www\\.setra\\.com$", ""], ["^https?://(.+\\.)?localhost:8000$", ""], ["^https?://(.+\\.)?www\\.gemssensors\\.com$", ""], ["^https?://(.+\\.)?flukenetworks\\.com$", ""], ["^https?://(.+\\.)?pantheonsite\\.io$", ""], ["^https?://(.+\\.)?ilxstaging\\.wpengine\\.com$", ""], ["^https?://(.+\\.)?us\\.flukecal\\.com$", ""], ["^https?://(.+\\.)?www\\.flukenetworks\\.com\\.cn$", ""], ["^https?://(.+\\.)?forms\\.office\\.com$", ""], ["^https?://(.+\\.)?censis\\.com$", ""], ["^https?://(.+\\.)?www\\.specialtyproducttechnologies\\.com$", ""], ["^https?://(.+\\.)?hengstler\\.de$", ""], ["^https?://(.+\\.)?www\\.flukeprocessinstruments\\.com$", ""], ["^https?://(.+\\.)?www\\.flukereliability\\.com$", ""], ["^https?://(.+\\.)?www\\.flukebiomedical\\.com$", ""], ["^https?://(.+\\.)?www\\.fluke\\.com\\.cn$", ""], ["^https?://(.+\\.)?$", ""], ["^https?://(.+\\.)?www\\.tek\\.com\\.cn$", ""], ["^https?://(.+\\.)?www\\.solmetric\\.com$", ""], ["^https?://(.+\\.)?www\\.fortive\\.com$", ""], ["^https?://(.+\\.)?www\\.anderson\\-negele\\.com$", ""], ["^https?://(.+\\.)?pruftechnik\\.com$", ""], ["^https?://(.+\\.)?b2clogin\\.com$", ""], ["^https?://(.+\\.)?www\\.gordian\\.com$", ""], ["^https?://(.+\\.)?psemc\\.com$", ""], ["^https?://(.+\\.)?www\\.qualitrolcorp\\.com$", ""], ["^https?://(.+\\.)?www\\.redeye\\.co$", ""], ["^https?://(.+\\.)?www\\.landauer\\.com$", ""], ["^https?://(.+\\.)?www\\.rsmeans\\.com$", ""], ["^https?://(.+\\.)?asp\\.com$", ""], ["^https?://(.+\\.)?www\\.raysafe\\.com$", ""], ["^https?://(.+\\.)?website\\.maintenanceconnection\\.com$", ""], ["^https?://(.+\\.)?www\\.emssoftware\\.com$", ""]];
var blockedOrigins = [];
!function(){let k,m,t;try{k=window.localStorage}catch(b){m=b}let v;function O(e){return!v||0!==e.indexOf(v.origin)}function S(e,i){return new RegExp(i[0],i[1]).test(e)}function h(e,i){t||(e={id:"iframeerror",type:"ERROR",response:"Error accessing localStorage: "+(t=e?e.toString():"Localstorage is undefined")},i.source.postMessage(JSON.stringify(e),i.origin))}function w(e){e=e.split("$$");return 1===e.length?null:e[0].split("_")[1]}function*E(){var i=document.cookie.split(";");for(let e=0;e<i.length;e++){var[t,o]=i[e].trim().split("=");yield[t,o]}}window.addEventListener("message",function(e){let i,t,o,r=!1;for(o=0;o<allowedOrigins.length;o++)if(S(e.origin,allowedOrigins[o])){r=!0;break}if(r)for(o=0;o<blockedOrigins.length;o++)if(S(e.origin,blockedOrigins[o])){r=!1;break}if(r){v=e;try{i=JSON.parse(e.data)}catch(b){return}var n,s,a,f=e.origin+"_"+i.key;if(!k)return h(m,e);if("GET"===i.type){if(t=k.getItem(f),i.use_cookie)for(var[c,g]of E())if(c.startsWith(f)){t=g;break}}else if("PUT"===i.type)try{t=k.setItem(f,i.value),i.use_cookie&&(document.cookie=f+`=${i.value};max-age=15552000;Secure;SameSite=None;Path=/;`)}catch(b){return h(b,e)}else if("GETALL"===i.type){t={};for(const p in Object.keys(k))O(p)&&(t[p]=k.getItem(p));if(i.use_cookie)for(var[l,u]of E())O(l)&&(t[l]=u)}else{if("DELETE"!==i.type)return;for(const y in Object.keys(k))O(y)||(n=w(y))&&n!==i.visitorId&&k.removeItem(y);if(i.use_cookie)for(var[d]of E())O(d)||(s=w(d))&&s!==i.visitorId&&(document.cookie=d+"=; max-age=-42; path=/;")}"undefined"!=typeof i.id&&(a={id:i.id,response:t},e.source.postMessage(JSON.stringify(a),e.origin))}},!0),window.addEventListener("storage",function(e){v&&O(e.key)&&v.source.postMessage(JSON.stringify({type:"SYNC",response:{key:e.key,value:e.newValue}}),v.origin)},!0)}();
</script></head><body></body></html>

View File

@@ -0,0 +1,35 @@
/*!
* jQuery UI Accordion 1.13.2
* http://jqueryui.com
*
* Copyright jQuery Foundation and other contributors
* Released under the MIT license.
* http://jquery.org/license
*/
(function(factory){"use strict";if(typeof define==="function"&&define.amd){define(["jquery","../version","../keycode","../unique-id","../widget"],factory);}else{factory(jQuery);}})(function($){"use strict";return $.widget("ui.accordion",{version:"1.13.2",options:{active:0,animate:{},classes:{"ui-accordion-header":"ui-corner-top","ui-accordion-header-collapsed":"ui-corner-all","ui-accordion-content":"ui-corner-bottom"},collapsible:false,event:"click",header:function(elem){return elem.find("> li > :first-child").add(elem.find("> :not(li)").even());},heightStyle:"auto",icons:{activeHeader:"ui-icon-triangle-1-s",header:"ui-icon-triangle-1-e"},activate:null,beforeActivate:null},hideProps:{borderTopWidth:"hide",borderBottomWidth:"hide",paddingTop:"hide",paddingBottom:"hide",height:"hide"},showProps:{borderTopWidth:"show",borderBottomWidth:"show",paddingTop:"show",paddingBottom:"show",height:"show"},_create:function(){var options=this.options;this.prevShow=this.prevHide=$();this._addClass("ui-accordion","ui-widget ui-helper-reset");this.element.attr("role","tablist");if(!options.collapsible&&(options.active===false||options.active==null)){options.active=0;}
this._processPanels();if(options.active<0){options.active+=this.headers.length;}
this._refresh();},_getCreateEventData:function(){return{header:this.active,panel:!this.active.length?$():this.active.next()};},_createIcons:function(){var icon,children,icons=this.options.icons;if(icons){icon=$("<span>");this._addClass(icon,"ui-accordion-header-icon","ui-icon "+icons.header);icon.prependTo(this.headers);children=this.active.children(".ui-accordion-header-icon");this._removeClass(children,icons.header)._addClass(children,null,icons.activeHeader)._addClass(this.headers,"ui-accordion-icons");}},_destroyIcons:function(){this._removeClass(this.headers,"ui-accordion-icons");this.headers.children(".ui-accordion-header-icon").remove();},_destroy:function(){var contents;this.element.removeAttr("role");this.headers.removeAttr("role aria-expanded aria-selected aria-controls tabIndex").removeUniqueId();this._destroyIcons();contents=this.headers.next().css("display","").removeAttr("role aria-hidden aria-labelledby").removeUniqueId();if(this.options.heightStyle!=="content"){contents.css("height","");}},_setOption:function(key,value){if(key==="active"){this._activate(value);return;}
if(key==="event"){if(this.options.event){this._off(this.headers,this.options.event);}
this._setupEvents(value);}
this._super(key,value);if(key==="collapsible"&&!value&&this.options.active===false){this._activate(0);}
if(key==="icons"){this._destroyIcons();if(value){this._createIcons();}}},_setOptionDisabled:function(value){this._super(value);this.element.attr("aria-disabled",value);this._toggleClass(null,"ui-state-disabled",!!value);this._toggleClass(this.headers.add(this.headers.next()),null,"ui-state-disabled",!!value);},_keydown:function(event){if(event.altKey||event.ctrlKey){return;}
var keyCode=$.ui.keyCode,length=this.headers.length,currentIndex=this.headers.index(event.target),toFocus=false;switch(event.keyCode){case keyCode.RIGHT:case keyCode.DOWN:toFocus=this.headers[(currentIndex+1)%length];break;case keyCode.LEFT:case keyCode.UP:toFocus=this.headers[(currentIndex-1+length)%length];break;case keyCode.SPACE:case keyCode.ENTER:this._eventHandler(event);break;case keyCode.HOME:toFocus=this.headers[0];break;case keyCode.END:toFocus=this.headers[length-1];break;}
if(toFocus){$(event.target).attr("tabIndex",-1);$(toFocus).attr("tabIndex",0);$(toFocus).trigger("focus");event.preventDefault();}},_panelKeyDown:function(event){if(event.keyCode===$.ui.keyCode.UP&&event.ctrlKey){$(event.currentTarget).prev().trigger("focus");}},refresh:function(){var options=this.options;this._processPanels();if((options.active===false&&options.collapsible===true)||!this.headers.length){options.active=false;this.active=$();}else if(options.active===false){this._activate(0);}else if(this.active.length&&!$.contains(this.element[0],this.active[0])){if(this.headers.length===this.headers.find(".ui-state-disabled").length){options.active=false;this.active=$();}else{this._activate(Math.max(0,options.active-1));}}else{options.active=this.headers.index(this.active);}
this._destroyIcons();this._refresh();},_processPanels:function(){var prevHeaders=this.headers,prevPanels=this.panels;if(typeof this.options.header==="function"){this.headers=this.options.header(this.element);}else{this.headers=this.element.find(this.options.header);}
this._addClass(this.headers,"ui-accordion-header ui-accordion-header-collapsed","ui-state-default");this.panels=this.headers.next().filter(":not(.ui-accordion-content-active)").hide();this._addClass(this.panels,"ui-accordion-content","ui-helper-reset ui-widget-content");if(prevPanels){this._off(prevHeaders.not(this.headers));this._off(prevPanels.not(this.panels));}},_refresh:function(){var maxHeight,options=this.options,heightStyle=options.heightStyle,parent=this.element.parent();this.active=this._findActive(options.active);this._addClass(this.active,"ui-accordion-header-active","ui-state-active")._removeClass(this.active,"ui-accordion-header-collapsed");this._addClass(this.active.next(),"ui-accordion-content-active");this.active.next().show();this.headers.attr("role","tab").each(function(){var header=$(this),headerId=header.uniqueId().attr("id"),panel=header.next(),panelId=panel.uniqueId().attr("id");header.attr("aria-controls",panelId);panel.attr("aria-labelledby",headerId);}).next().attr("role","tabpanel");this.headers.not(this.active).attr({"aria-selected":"false","aria-expanded":"false",tabIndex:-1}).next().attr({"aria-hidden":"true"}).hide();if(!this.active.length){this.headers.eq(0).attr("tabIndex",0);}else{this.active.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0}).next().attr({"aria-hidden":"false"});}
this._createIcons();this._setupEvents(options.event);if(heightStyle==="fill"){maxHeight=parent.height();this.element.siblings(":visible").each(function(){var elem=$(this),position=elem.css("position");if(position==="absolute"||position==="fixed"){return;}
maxHeight-=elem.outerHeight(true);});this.headers.each(function(){maxHeight-=$(this).outerHeight(true);});this.headers.next().each(function(){$(this).height(Math.max(0,maxHeight-
$(this).innerHeight()+$(this).height()));}).css("overflow","auto");}else if(heightStyle==="auto"){maxHeight=0;this.headers.next().each(function(){var isVisible=$(this).is(":visible");if(!isVisible){$(this).show();}
maxHeight=Math.max(maxHeight,$(this).css("height","").height());if(!isVisible){$(this).hide();}}).height(maxHeight);}},_activate:function(index){var active=this._findActive(index)[0];if(active===this.active[0]){return;}
active=active||this.active[0];this._eventHandler({target:active,currentTarget:active,preventDefault:$.noop});},_findActive:function(selector){return typeof selector==="number"?this.headers.eq(selector):$();},_setupEvents:function(event){var events={keydown:"_keydown"};if(event){$.each(event.split(" "),function(index,eventName){events[eventName]="_eventHandler";});}
this._off(this.headers.add(this.headers.next()));this._on(this.headers,events);this._on(this.headers.next(),{keydown:"_panelKeyDown"});this._hoverable(this.headers);this._focusable(this.headers);},_eventHandler:function(event){var activeChildren,clickedChildren,options=this.options,active=this.active,clicked=$(event.currentTarget),clickedIsActive=clicked[0]===active[0],collapsing=clickedIsActive&&options.collapsible,toShow=collapsing?$():clicked.next(),toHide=active.next(),eventData={oldHeader:active,oldPanel:toHide,newHeader:collapsing?$():clicked,newPanel:toShow};event.preventDefault();if((clickedIsActive&&!options.collapsible)||(this._trigger("beforeActivate",event,eventData)===false)){return;}
options.active=collapsing?false:this.headers.index(clicked);this.active=clickedIsActive?$():clicked;this._toggle(eventData);this._removeClass(active,"ui-accordion-header-active","ui-state-active");if(options.icons){activeChildren=active.children(".ui-accordion-header-icon");this._removeClass(activeChildren,null,options.icons.activeHeader)._addClass(activeChildren,null,options.icons.header);}
if(!clickedIsActive){this._removeClass(clicked,"ui-accordion-header-collapsed")._addClass(clicked,"ui-accordion-header-active","ui-state-active");if(options.icons){clickedChildren=clicked.children(".ui-accordion-header-icon");this._removeClass(clickedChildren,null,options.icons.header)._addClass(clickedChildren,null,options.icons.activeHeader);}
this._addClass(clicked.next(),"ui-accordion-content-active");}},_toggle:function(data){var toShow=data.newPanel,toHide=this.prevShow.length?this.prevShow:data.oldPanel;this.prevShow.add(this.prevHide).stop(true,true);this.prevShow=toShow;this.prevHide=toHide;if(this.options.animate){this._animate(toShow,toHide,data);}else{toHide.hide();toShow.show();this._toggleComplete(data);}
toHide.attr({"aria-hidden":"true"});toHide.prev().attr({"aria-selected":"false","aria-expanded":"false"});if(toShow.length&&toHide.length){toHide.prev().attr({"tabIndex":-1,"aria-expanded":"false"});}else if(toShow.length){this.headers.filter(function(){return parseInt($(this).attr("tabIndex"),10)===0;}).attr("tabIndex",-1);}
toShow.attr("aria-hidden","false").prev().attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0});},_animate:function(toShow,toHide,data){var total,easing,duration,that=this,adjust=0,boxSizing=toShow.css("box-sizing"),down=toShow.length&&(!toHide.length||(toShow.index()<toHide.index())),animate=this.options.animate||{},options=down&&animate.down||animate,complete=function(){that._toggleComplete(data);};if(typeof options==="number"){duration=options;}
if(typeof options==="string"){easing=options;}
easing=easing||options.easing||animate.easing;duration=duration||options.duration||animate.duration;if(!toHide.length){return toShow.animate(this.showProps,duration,easing,complete);}
if(!toShow.length){return toHide.animate(this.hideProps,duration,easing,complete);}
total=toShow.show().outerHeight();toHide.animate(this.hideProps,{duration:duration,easing:easing,step:function(now,fx){fx.now=Math.round(now);}});toShow.hide().animate(this.showProps,{duration:duration,easing:easing,complete:complete,step:function(now,fx){fx.now=Math.round(now);if(fx.prop!=="height"){if(boxSizing==="content-box"){adjust+=fx.now;}}else if(that.options.heightStyle!=="content"){fx.now=Math.round(total-toHide.outerHeight()-adjust);adjust=0;}}});},_toggleComplete:function(data){var toHide=data.oldPanel,prev=toHide.prev();this._removeClass(toHide,"ui-accordion-content-active");this._removeClass(prev,"ui-accordion-header-active")._addClass(prev,"ui-accordion-header-collapsed");if(toHide.length){toHide.parent()[0].className=toHide.parent()[0].className;}
this._trigger("activate",null,data);}});});

View File

@@ -0,0 +1,5 @@
define(['jquery','mage/tabs'],function($,tabs){'use strict';$.widget('mage.accordion',tabs,{options:{active:[0],multipleCollapsible:false,openOnFocus:false},_callCollapsible:function(){var self=this,disabled=false,active=false;if(typeof this.options.active==='string'){this.options.active=this.options.active.split(' ').map(function(item){return parseInt(item,10);});}
$.each(this.collapsibles,function(i){disabled=active=false;if($.inArray(i,self.options.disabled)!==-1){disabled=true;}
if($.inArray(i,self.options.active)!==-1){active=true;}
self._instantiateCollapsible(this,i,active,disabled);});},_toggleActivate:function(action,index){var self=this;if(Array.isArray(index&&this.options.multipleCollapsible)){$.each(index,function(){self.collapsibles.eq(this).collapsible(action);});}else if(index===undefined&&this.options.multipleCollapsible){this.collapsibles.collapsible(action);}else{this._super(action,index);}},_handleDeepLinking:function(){if(!this.options.multipleCollapsible){this._super();}},_closeOthers:function(){var self=this;if(!this.options.multipleCollapsible){$.each(this.collapsibles,function(){$(this).on('beforeOpen',function(){self.collapsibles.not(this).collapsible('deactivate');});});}
$.each(this.collapsibles,function(){$(this).on('beforeOpen',function(){var section=$(this);section.addClass('allow').prevAll().addClass('allow');section.nextAll().removeClass('allow');});});}});return $.mage.accordion;});

View File

@@ -0,0 +1,7 @@
define(['jquery','underscore','Magento_Ui/js/form/adapter/buttons'],function($,_,buttons){'use strict';var selectorPrefix='',eventPrefix;function initListener(callback,action){var selector=selectorPrefix?selectorPrefix+' '+buttons[action]:buttons[action],elem=$(selector)[0];if(!elem){return;}
if(elem.onclick){elem.onclick=null;}
$(elem).on('click'+eventPrefix,callback);}
function destroyListener(action){var selector=selectorPrefix?selectorPrefix+' '+buttons[action]:buttons[action],elem=$(selector)[0];if(!elem){return;}
if(elem.onclick){elem.onclick=null;}
$(elem).off('click'+eventPrefix);}
return{on:function(handlers,selectorPref,eventPref){selectorPrefix=selectorPrefix||selectorPref;eventPrefix=eventPref;_.each(handlers,initListener);selectorPrefix='';},off:function(handlers,eventPref){eventPrefix=eventPref;_.each(handlers,destroyListener);}};});

View File

@@ -0,0 +1,14 @@
define(['jquery','jquery-ui-modules/widget'],function($){'use strict';$.widget('mage.addToWishlist',{options:{bundleInfo:'div.control [name^=bundle_option]',configurableInfo:'.super-attribute-select',groupedInfo:'#super-product-table input',downloadableInfo:'#downloadable-links-list input',customOptionsInfo:'.product-custom-option',qtyInfo:'#qty',actionElement:'[data-action="add-to-wishlist"]',productListWrapper:'.product-item-info',productPageWrapper:'.product-info-main'},_create:function(){this._bind();},_bind:function(){var options=this.options,dataUpdateFunc='_updateWishlistData',validateProductQty='_validateWishlistQty',changeCustomOption='change '+options.customOptionsInfo,changeQty='change '+options.qtyInfo,updateWishlist='click '+options.actionElement,events={},key;if('productType'in options){if(typeof options.productType==='string'){options.productType=[options.productType];}}else{options.productType=[];}
events[changeCustomOption]=dataUpdateFunc;events[changeQty]=dataUpdateFunc;events[updateWishlist]=validateProductQty;for(key in options.productType){if(options.productType.hasOwnProperty(key)&&options.productType[key]+'Info'in options){events['change '+options[options.productType[key]+'Info']]=dataUpdateFunc;}}
this._on(events);},_updateWishlistData:function(event){var dataToAdd={},isFileUploaded=false,handleObjSelector=null,self=this;if(event.handleObj.selector==this.options.qtyInfo){this._updateAddToWishlistButton({},event);event.stopPropagation();return;}
handleObjSelector=$(event.currentTarget).closest('form').find(event.handleObj.selector);handleObjSelector.each(function(index,element){if($(element).is('input[type=text]')||$(element).is('input[type=email]')||$(element).is('input[type=number]')||$(element).is('input[type=hidden]')||$(element).is('input[type=checkbox]:checked')||$(element).is('input[type=radio]:checked')||$(element).is('textarea')||$('#'+element.id+' option:selected').length){if($(element).data('selector')||$(element).attr('name')){dataToAdd=$.extend({},dataToAdd,self._getElementData(element));}
return;}
if($(element).is('input[type=file]')&&$(element).val()){isFileUploaded=true;}});if(isFileUploaded){this.bindFormSubmit();}
this._updateAddToWishlistButton(dataToAdd,event);event.stopPropagation();},_updateAddToWishlistButton:function(dataToAdd,event){var self=this,buttons=this._getAddToWishlistButton(event);buttons.each(function(index,element){var params=$(element).data('post'),currentTarget=event.currentTarget,targetElement,targetValue;if(!params){params={'data':{}};}else if($(currentTarget).data('selector')||$(currentTarget).attr('name')){targetElement=self._getElementData(currentTarget);targetValue=Object.keys(targetElement)[0];if(params.data.hasOwnProperty(targetValue)&&!dataToAdd.hasOwnProperty(targetValue)){delete params.data[targetValue];}}
params.data=$.extend({},params.data,dataToAdd,{'qty':$(self.options.qtyInfo).val()});$(element).data('post',params);});},_getAddToWishlistButton:function(event){var productListWrapper=$(event.currentTarget).closest(this.options.productListWrapper);if(productListWrapper.length){return productListWrapper.find(this.options.actionElement);}
return $(this.options.actionElement);},_arrayDiffByKeys:function(array1,array2){var result={};$.each(array1,function(key,value){if(key.indexOf('option')===-1){return;}
if(!array2[key]){result[key]=value;}});return result;},_getElementData:function(element){var data,elementName,elementValue;element=$(element);data={};elementName=element.data('selector')?element.data('selector'):element.attr('name');elementValue=element.val();if(element.is('select[multiple]')&&elementValue!==null){if(elementName.substr(elementName.length-2)=='[]'){elementName=elementName.substring(0,elementName.length-2);}
$.each(elementValue,function(key,option){data[elementName+'['+option+']']=option;});}else if(elementName.substr(elementName.length-2)=='[]'){elementName=elementName.substring(0,elementName.length-2);data[elementName+'['+elementValue+']']=elementValue;}else{data[elementName]=elementValue;}
return data;},_removeExcessiveData:function(params,dataToAdd){var dataToRemove=this._arrayDiffByKeys(params.data,dataToAdd);$.each(dataToRemove,function(key){delete params.data[key];});},bindFormSubmit:function(){var self=this;$('[data-action="add-to-wishlist"]').on('click',function(event){var element,params,form,action;event.stopPropagation();event.preventDefault();element=$('input[type=file]'+self.options.customOptionsInfo);params=$(event.currentTarget).data('post');form=$(element).closest('form');action=params.action;if(params.data.id){$('<input>',{type:'hidden',name:'id',value:params.data.id}).appendTo(form);}
if(params.data.uenc){action+='uenc/'+params.data.uenc;}
$(form).attr('action',action).trigger('submit');});},_validateWishlistQty:function(event){var element=$(this.options.qtyInfo);if(!(element.validation()&&element.validation('isValid'))){event.preventDefault();event.stopPropagation();return;}}});return $.mage.addToWishlist;});

View File

@@ -0,0 +1 @@
define(['ko','./customer-addresses'],function(ko,defaultProvider){'use strict';return ko.observableArray(defaultProvider.getAddressItems());});

View File

@@ -0,0 +1,2 @@
define(['underscore'],function(_){'use strict';return function(addressData){var regionId;if(addressData.region['region_id']&&addressData.region['region_id']!=='0'){regionId=addressData.region['region_id']+'';}
return{customerAddressId:addressData.id,email:addressData.email,countryId:addressData['country_id'],regionId:regionId,regionCode:addressData.region['region_code'],region:addressData.region.region,customerId:addressData['customer_id'],street:addressData.street,company:addressData.company,telephone:addressData.telephone,fax:addressData.fax,postcode:addressData.postcode,city:addressData.city,firstname:addressData.firstname,lastname:addressData.lastname,middlename:addressData.middlename,prefix:addressData.prefix,suffix:addressData.suffix,vatId:addressData['vat_id'],sameAsBilling:addressData['same_as_billing'],saveInAddressBook:addressData['save_in_address_book'],customAttributes:_.toArray(addressData['custom_attributes']).reverse(),isDefaultShipping:function(){return addressData['default_shipping'];},isDefaultBilling:function(){return addressData['default_billing'];},getAddressInline:function(){return addressData.inline;},getType:function(){return'customer-address';},getKey:function(){return this.getType()+this.customerAddressId;},getCacheKey:function(){return this.getKey();},isEditable:function(){return false;},canUseForBilling:function(){return true;}};};});

View File

@@ -0,0 +1 @@
define(['ko','../template/renderer'],function(ko,renderer){'use strict';ko.bindingHandlers.afterRender={init:function(element,valueAccessor,allBindings,viewModel){var callback=valueAccessor();if(typeof callback==='function'){callback.call(viewModel,element,viewModel);}}};renderer.addAttribute('afterRender');});

View File

@@ -0,0 +1 @@
define(['jquery','underscore','jquery-ui-modules/widget','Magento_Ui/js/modal/confirm','mage/translate'],function($,_){'use strict';$.widget('mage.alert',$.mage.confirm,{options:{modalClass:'confirm',title:$.mage.__('Attention'),actions:{always:function(){}},buttons:[{text:$.mage.__('OK'),class:'action-primary action-accept',click:function(){this.closeModal(true);}}]},closeModal:function(){this.options.actions.always();this.element.on('alertclosed',_.bind(this._remove,this));return this._super();}});return function(config){return $('<div></div>').html(config.content).alert(config);};});

View File

@@ -0,0 +1,22 @@
define(['jquery','underscore','amShopbyHelpers','Magento_Ui/js/modal/modal','jquery-ui-modules/slider','mage/tooltip','mage/validation','mage/translate','Amasty_Shopby/js/jquery.ui.touch-punch.min','Amasty_ShopbyBase/js/chosen/chosen.jquery','amShopbyFiltersSync'],function($,_,helpers){'use strict';$.widget('mage.amShopbyFilterAbstract',{filters:{},options:{isAjax:0,collectFilters:0,activeClass:'-active',clearUrl:null,delta:[],deltaFrom:0,deltaTo:0,curRate:'1',digitsAfterDot:2},selectors:{fromToWidget:'[data-am-js="fromto-widget"]',filterForm:'form[data-amshopby-filter]',filterFormAttr:'form[data-amshopby-filter={attr}]',filterItems:'[class*="am-filter-items"]',sidebar:'.sidebar',topNav:'.catalog-topnav',filterOptionsContent:'.filter-options-content',filterOptionsItem:'.filter-options-item',ajaxOptionsSelectors:'body.page-with-filter, body.catalogsearch-result-index, body.cms-index-index',filterRequestVar:'[data-amshopby-filter-request-var="cat"]',dFrom:'df=',dTo:'dt='},classes:{active:'-active',disabled:'-disabled',savedFilterValues:'amshopby-saved-values',selected:'amshopby-link-selected'},nodes:{ranges:$('[data-amshopby-js="price-ranges"]')},getFilter:function(){return{'code':this.element.attr('amshopby-filter-code'),'value':this.element.attr('amshopby-filter-value')};},apply:function(link,clearFilter){var linkParam;try{if($.mage.amShopbyAjax){$.mage.amShopbyAjax.prototype.response=null;}
this.options.isAjax=$.mage.amShopbyAjax!==undefined;linkParam=clearFilter?link:null;link=this.element?.parents('.price-ranges').length&&link.includes('?')?link+'&price-ranges=1':link;if(!this.options.collectFilters&&this.options.isAjax===true){this.prepareTriggerAjax(this.element,linkParam,clearFilter);}else{if(this.options.collectFilters===1){this.prepareTriggerAjax(this.element,linkParam);}else{window.location=link;}}}catch(e){window.location=link;}},prepareTriggerAjax:function(element,clearUrl,clearFilter,isSorting){var self=this,widgetInstance=$.mage.amShopbyFilterAbstract.prototype,selectors=this.selectors,forms=$(selectors.filterForm),attributeName,excludedFormSelector,existFields=[],savedFilters=[],$item,className,startPos,endPos,filterClass,isPriceType,serializeForms,isPriceExist,data,ajaxData;if(typeof this.element!=='undefined'&&clearFilter){attributeName=this.selectors.filterFormAttr.replace('{attr}',this.element.closest(selectors.filterOptionsContent).find('form').data('amshopby-filter'));excludedFormSelector=(this.element.closest(selectors.sidebar).length===0?selectors.topNav:selectors.sidebar)+' '+attributeName;forms=forms.not(excludedFormSelector);}
forms.each(function(index,item){$item=$(item);className='';if($item.closest(selectors.filterItems).length){className=$item.closest(selectors.filterItems)[0].className;}else if($item.find(selectors.filterItems).length){className=$item.find(selectors.filterItems)[0].className;}
startPos=className.indexOf('am-filter-items');endPos=className.indexOf(' ',startPos+1)===-1?100:className.indexOf(' ',startPos+1);filterClass=className.substring(startPos,endPos);isPriceType=$($item.closest(selectors.filterOptionsItem)).find(selectors.fromToWidget).length;if(filterClass&&existFields[filterClass]&&!isPriceType){forms[index]='';}else{existFields[filterClass]=true;}
if($item.hasClass(self.classes.savedFilterValues)){savedFilters.push(forms[index]);forms[index]='';}});serializeForms=forms.serializeArray();isPriceExist=false;_.each(serializeForms,function(index,item){if(item.name==='amshopby[price][]'){isPriceExist=true;return false;}});if(!isPriceExist&&savedFilters){savedFilters.forEach(function(element){serializeForms.push($(element).serializeArray()[0]);});}
data=this.normalizeData(serializeForms,isSorting,clearFilter);clearUrl=data.clearUrl?data.clearUrl:clearUrl;element=element||document;if(widgetInstance.options.delta.length){data=data.concat(widgetInstance.options.delta);}
if($(element).parents('.price-ranges').length){data.push({name:'price-ranges',value:1});}
data.clearUrl=clearUrl;if(this.options.collectFilters){ajaxData=_.clone(data);ajaxData.clearUrl=clearUrl;$.mage.amShopbyAjax.prototype.prevData={ajaxData:ajaxData,clearFilter,isSorting};if(!isSorting){data.isGetCounter=true;}}
$(element).trigger('amshopby:submit_filters',{data:data,clearFilter:clearFilter,isSorting:isSorting});return data;},normalizeData:function(data,isSorting,clearFilter){var self=this,normalizedData=[],ajaxOptions=$(this.selectors.ajaxOptionsSelectors).amShopbyAjax('option'),clearUrl;_.each(data,function(item){if(item&&item.value.trim()!==''&&item.value!=='-1'){var isNormalizeItem=_.find(normalizedData,function(normalizeItem){return normalizeItem.name===item.name&&normalizeItem.value===item.value||item.name==='amshopby[price][]'&&normalizeItem.name===item.name;});if(!isNormalizeItem){if(item.name==='amshopby[price][]'){item.value=self.normalizePrice(item.value);}
if(!ajaxOptions.isCategorySingleSelect&&item.name==='amshopby[cat][]'&&+item.value===+ajaxOptions.currentCategoryId){return;}
normalizedData.push(item);if(ajaxOptions.isCategorySingleSelect===1&&item.name==='amshopby[cat][]'&&+item.value!==+ajaxOptions.currentCategoryId&&!clearFilter&&!isSorting){clearUrl=$('*'+self.selectors.filterRequestVar+' *[value="'+item.value+'"]').parent().find('a').attr('href');}}}});normalizedData=this.groupDataByName(normalizedData);if(clearUrl){normalizedData.clearUrl=clearUrl;}
return normalizedData;},groupDataByName:function(formData){var hash=Object.create(null);return formData.reduce(function(result,currentValue){if(!hash[currentValue.name]){hash[currentValue.name]={};hash[currentValue.name].name=currentValue.name;result.push(hash[currentValue.name]);}
if(hash[currentValue.name].value){hash[currentValue.name].value+=','+currentValue.value;}else{hash[currentValue.name].value=currentValue.value;}
return result;},[]);},getHideDigitsAfterDot:function(){var value=+$('[name="amshopby[price][]"]').first().attr('data-digits-after-dot');return Number.isNaN(value)?0:value;},buildNumber:function(size){var str='1',i;for(i=1;i<=size;i++){str+='0';}
return str;},isPrice:function(){return typeof this.options.code!='undefined'&&this.options.code==='price';},renderShowButton:function(event,element){if($.mage.amShopbyApplyFilters){$.mage.amShopbyApplyFilters.prototype.renderShowButton(event,element);}},addListenerOnCheckbox:function(checkbox,parent){checkbox.bind('click',{},function(event){event.stopPropagation();event.currentTarget.checked=!event.currentTarget.checked;parent.trigger('click');});},markAsSelected:function(element){var self=this,$element=$(element);$element.closest('li').find('a').toggleClass(self.classes.selected,$element.prop('checked'));},normalizePrice:function(value){var result=value.split('-'),i;for(i=0;i<result.length;i++){if(typeof result[i]=='undefined'){result[i]=0;}
result[i]=this.processPrice(true,result[i]).amToFixed(2,this.getHideDigitsAfterDot());}
return result.join('-').replace(/[ \r\n]/g,'');},isBaseCurrency:function(){return Number(this.options.curRate)===1;},processPrice:function(toBasePrice,input,delta){var rate=Number(this.options.curRate),inputPrice=Number(input);delta=typeof delta!=='undefined'?Number(delta):0;return this.isBaseCurrency()?inputPrice:(toBasePrice?(inputPrice / rate):((inputPrice*rate)+delta));},calculateDelta:function(calculatedCurrency,baseCurrency){return(Number(calculatedCurrency)-(Number(baseCurrency).toFixed(2)*Number(this.options.curRate))).toFixed(3);},getUrlWithDelta:function(link,valueFrom,from,valueTo,to,deltaFrom,deltaTo){var dFrom=this.selectors.dFrom,dTo=this.selectors.dTo;if(this.isBaseCurrency()){return link;}
if(link.indexOf(dFrom)!==-1||link.indexOf(dTo)!==-1){link=link.replace(dFrom+parseFloat(deltaFrom).amToFixed(2,this.getHideDigitsAfterDot()),dFrom+this.calculateDelta(from,valueFrom)).replace(dTo+parseFloat(deltaTo).amToFixed(2,this.getHideDigitsAfterDot()),dTo+this.calculateDelta(to,valueTo));}else{link+=this.getDeltaParams(from,valueFrom,to,valueTo,true);}
return link;},getDeltaParams:function(from,valueFrom,to,valueTo,isUrl){var deltaFrom=this.calculateDelta(from,valueFrom),deltaTo=this.calculateDelta(to,valueTo),params='';$.mage.amShopbyFilterAbstract.prototype.options.deltaFrom=deltaFrom;$.mage.amShopbyFilterAbstract.prototype.options.deltaTo=deltaTo;if(isUrl){if(deltaFrom%1!==0){params+='&df='+deltaFrom;}
if(deltaTo%1!==0){params+='&dt='+deltaTo;}
return params;}
return[{name:'amshopby[df][]',value:deltaFrom},{name:'amshopby[dt][]',value:deltaTo}];},setDeltaParams:function(delta){$.mage.amShopbyFilterAbstract.prototype.options.delta=delta instanceof Array?delta:[];},setCurrency:function(curRate){this.options.curRate=curRate;},setCollectFilters:function(collectFilters){this.options.collectFilters=collectFilters;}});return $.mage.amShopbyFilterAbstract;});

View File

@@ -0,0 +1,3 @@
define(['jquery','amShopbyFilterAbstract','amShopbyFiltersSync'],function($,amShopbyFilterAbstract){'use strict';$.widget('mage.amShopbyFilterCategory',amShopbyFilterAbstract,{options:{type:null,collectFilters:null,clearUrl:null},selectors:{items:'.items',parent:'.item',radioButton:'input[type=radio]',checkboxButton:'input[type=checkbox]',checkbox:'input[type=checkbox], input[type=radio]'},_create:function(){var self=this,parent=$(self.element.parents(self.selectors.parent)[0]),checkbox=self.element.siblings(self.selectors.checkbox);this.initEventListeners();this.addListenerOnCheckbox(checkbox,parent);this.markAsSelected(checkbox);},initEventListeners:function(){var self=this,link=self.element,parent=$(link.parents(self.selectors.parent)[0]),checkbox=link.siblings(self.selectors.checkbox),params={parent:parent,checkbox:checkbox,link:link},element,href;parent.off('click').on('click',params,function(event){element=event.data.checkbox;href=event.data.link.prop('href');event.stopPropagation();event.preventDefault();if($(this).find(self.selectors.radioButton)[0]&&location.href.indexOf('find=')!==-1){location.href=href;return;}
element.prop('checked',!element.prop('checked'));self.triggerSync(element,!element.prop('checked'));self.renderShowButton(event,element);self.apply(href);self.togglingTree(event.data.parent,self.isTypeFolding()?false:element.prop('checked'));});checkbox.on('change',function(){self.markAsSelected($(this));});checkbox.on('amshopby:sync_change',function(){self.markAsSelected($(this));});},triggerSync:function(element,clearFilter){element.trigger('change');element.trigger('sync',[clearFilter]);},togglingTree:function(element,isChecked){if(this.isTypeFolding()){element.find(this.selectors.items+' '+this.selectors.checkboxButton).prop('checked',false);}
element.parents(this.selectors.parent).find('> a '+this.selectors.checkboxButton).prop('checked',isChecked);},isTypeFolding:function(){return this.options.type==='labelsFolding';}});return $.mage.amShopbyFilterCategory;});

View File

@@ -0,0 +1,3 @@
define(["underscore","jquery"],function(_,$){'use strict';return function(options){var beforeValue=[];$(document).on("sync","[data-amshopby-filter]",function(event,clearFilter){syncFilters(this,clearFilter);});function syncFilters(element,clearFilter){var currentForm=$(element);var attributeCode=currentForm.attr('data-amshopby-filter');$('[data-amshopby-filter="'+attributeCode+'"]').each(function(){if(this!==currentForm.get(0)||clearFilter){beforeValue=$(this).serializeArray();var data=normalizeData(currentForm.serializeArray());delete data['amshopby[attr_price_from][]'];delete data['amshopby[attr_price_to][]'];_(data).each(function(values,name){var element=$(this).find('[name="'+name+'"]');if(values[0]||clearFilter){element.val(values);element.trigger("amshopby:sync_change",[values]);element.trigger("chosen:updated");}}.bind(this));}});}
function normalizeData(data){_(beforeValue).each(function(beforeItem){var item=_.filter(data,function(item){return item.name===beforeItem.name;});if(item.length===0){data.push({name:beforeItem.name,value:''});}});var normalizedData={};_(data).each(function(item){if(!normalizedData[item.name]){normalizedData[item.name]=[];}
normalizedData[item.name].push(item.value);});return normalizedData;}}});

View File

@@ -0,0 +1 @@
define(['jquery','matchMedia','amShopbyTopFilters','mage/tabs','domReady!'],function($,mediaCheck,amShopbyTopFilters){'use strict';mediaCheck({media:'(max-width: 768px)',entry:function(){amShopbyTopFilters.moveTopFiltersToSidebar();},exit:function(){amShopbyTopFilters.removeTopFiltersFromSidebar();}});});

View File

@@ -0,0 +1,3 @@
define(['jquery'],function($){'use strict';$.widget('mage.amShopbySwatchesChoose',{options:{listSwatches:{},swatchWidgetName:'mageSwatchRenderer',newSwatchWidgetName:'mage-SwatchRenderer'},selectors:{swatchOption:'[data-role^="swatch-option"]'},observerConfig:{attributes:true,childList:false,subtree:true},observer:null,_create:function(){var self=this;if(!self.options.listSwatches.length){return;}
self.initObserver();self.element.find(self.selectors.swatchOption).each(function(index,element){self.observer.observe(element,self.observerConfig);});},initObserver:function(){this.observer=new MutationObserver(this.observerCallback.bind(this));},observerCallback:function(mutationsList){var self=this,swatchWidget;mutationsList.forEach(function(mutation){if(mutation.type==='attributes'&&mutation.attributeName==='data-rendered'){swatchWidget=$(mutation.target).data(self.options.swatchWidgetName)||$(mutation.target).data(self.options.newSwatchWidgetName);$(self.options.listSwatches).each(function(id,attribute){if(!swatchWidget||!swatchWidget._EmulateSelected){return;}
swatchWidget._EmulateSelected(attribute);});}});}});return $.mage.amShopbySwatchesChoose;});

View File

@@ -0,0 +1,8 @@
define(['jquery'],function($){'use strict';var options={widgets:{collapsible:'{"collapsible":{"openedState": "active", "collapsible": true, "active": false, '
+'"collateral": { "openedState": "filter-active", "element": "body" } }}',accordion:'{"accordion":{"openedState": "active", "collapsible": true, "active": false, '
+'"multipleCollapsible": %1}}'},selectors:{sidebar:'.sidebar.sidebar-main',sidebarList:'.sidebar.sidebar-main #narrow-by-list',list:'#narrow-by-list',topNav:'.catalog-topnav',topFilterActions:'.catalog-topnav .filter-actions',topNarrowList:'.catalog-topnav #narrow-by-list',layeredFilter:'#layered-filter-block',blockFilter:'.block.filter',optionsItem:'.filter-options-item',filterTitle:'.filter-title:before',filterActions:'.block-actions.filter-actions',swatches:'.items, .swatch-attribute'},classes:{allTop:'amshopby-all-top-filters-append-left',filterTop:'amshopby-filter-top'}};return{moveTopFiltersToSidebar:function(){if($(options.selectors.sidebarList).length===0){var blockClass=$(options.selectors.layeredFilter).length?options.selectors.layeredFilter:options.selectors.blockFilter,$element=$(options.selectors.topNav+' '+blockClass).clone(),$sidebar=$(options.selectors.sidebar).first();$(options.selectors.topFilterActions).hide();$element.find(options.selectors.filterTitle).css('display','none');$element.addClass(options.classes.allTop).attr('data-mage-init',options.widgets.collapsible);$element.find(options.selectors.list).attr('data-mage-init',options.widgets.accordion.replace('%1','false'));$element.find(options.selectors.filterActions).remove();$sidebar.append($element);$sidebar.trigger('contentUpdated');return;}
$(options.selectors.topNarrowList+' '+options.selectors.optionsItem).each(function(){var isPresent=false,classes=$(this).find(options.selectors.swatches).first().attr('class'),i;if(classes){var listClasses=classes.split(' '),currentClass='';for(i=0;i<listClasses.length;i++){if(listClasses[i].indexOf('am-filter-items-')!==-1){currentClass=listClasses[i];break;}}
if(currentClass!==''&&$(options.selectors.sidebarList+' .'+currentClass).length>0){isPresent=true;}}
if(isPresent){return;}
$(this).addClass(options.classes.filterTop).appendTo($(options.selectors.sidebarList).first());});$(options.selectors.sidebar+' '+options.selectors.blockFilter).first().trigger('contentUpdated');},removeTopFiltersFromSidebar:function(){if($(options.selectors.topNav).length===0){return;}
$(options.selectors.sidebarList+' .'+options.classes.filterTop).appendTo($(options.selectors.topNarrowList));$(options.selectors.sidebar+' .'+options.classes.allTop).remove();}};});

View File

@@ -0,0 +1,2 @@
define(['jquery'],function($){'use strict';var mixin={_keydown:function(event){if(!this.active){return;}
this._super(event);}};return function(targetWidget){$.widget('mage.menu',targetWidget.menu,mixin);return{menu:$.mage.menu,navigation:$.mage.navigation};};});

View File

@@ -0,0 +1 @@
.slick-dots li button:focus,.slick-dots li button:hover,.slick-list:focus{outline:0}.slick-list,.slick-slider,.slick-track{display:block;position:relative}.slick-loading .slick-slide,.slick-loading .slick-track{visibility:hidden}.slick-list{overflow:hidden;margin:0;padding:0}.slick-list.dragging{cursor:pointer;cursor:hand}.slick-slider .slick-list,.slick-slider .slick-track{-webkit-transform:translate3d(0,0,0);-moz-transform:translate3d(0,0,0);-ms-transform:translate3d(0,0,0);-o-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}.slick-track{top:0;left:0;margin:0 auto}.slick-track:after,.slick-track:before{display:table;content:''}.slick-slide,.slick-slide.slick-loading img{display:none}.slick-track:after{clear:both}.slick-slide{float:left;height:100%;min-height:1px;vertical-align:middle}[dir=rtl] .slick-slide{float:right}.slick-slide.dragging img{pointer-events:none}.slick-vertical .slick-slide{display:block;height:auto;border:1px solid transparent}.slick-arrow.slick-hidden{display:none}.slick-loading .slick-list{position:relative;background:0 0}.slick-loading .slick-list:before{position:absolute;top:50%;left:50%;display:block;content:'';border-radius:100%;border-style:solid;border-width:3px;height:25px;width:25px;border-color:rgba(0,0,0,.2);border-top-color:#5c5c5c;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%);animation:loading 1s infinite linear}@keyframes loading{0%{-webkit-transform:translate(-50%,-50%) rotate(0);transform:translate(-50%,-50%) rotate(0)}100%{-webkit-transform:translate(-50%,-50%) rotate(359.9deg);transform:translate(-50%,-50%) rotate(359.9deg)}}.slick-next.slick-disabled,.slick-prev.slick-disabled{opacity:.25}.slick-dotted.slick-slider{margin-bottom:30px}.slick-dots{position:absolute;left:0;display:block;width:100%;padding:0;margin:0;list-style:none;text-align:center}.slick-dots li{position:relative;display:inline-block;width:20px;height:20px;margin:0 5px;padding:0;cursor:pointer}.slick-dots li button,.slick-slider .slick-arrow{display:block;cursor:pointer;outline:0;box-shadow:none}.slick-dots li button{font-size:0;line-height:0;width:20px;height:20px;padding:5px;color:transparent;border:0;background:0 0}.slick-dots li button:focus:before,.slick-dots li button:hover:before{opacity:1}.slick-dots li button:before{font-size:16px;line-height:20px;position:absolute;top:0;left:0;width:20px;height:20px;content:'•';text-align:center;opacity:.25;color:#000;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.slick-dots li.slick-active button:before{opacity:.75;color:#000}.slick-slider{box-sizing:border-box;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-touch-callout:none;-khtml-user-select:none;-ms-touch-action:pan-y;touch-action:pan-y;-webkit-tap-highlight-color:transparent;padding:0 20px}.slick-slider .slick-arrow{position:absolute;top:50%;padding:0;width:15px;height:22px;font-size:0;line-height:0;-webkit-transform:translate(0,-50%);-moz-transform:translate(0,-50%);-ms-transform:translate(0,-50%);transform:translate(0,-50%);color:transparent;border:none;background:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTQiIGhlaWdodD0iMjIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0uMi40QTEgMSAwIDAgMSAxLjYuMmwxMiAxMGExIDEgMCAwIDEgMCAxLjZsLTEyIDEwYTEgMSAwIDAgMS0xLjItMS42TDExLjMzMyAxMSAuNCAxLjhBMSAxIDAgMCAxIC4yLjR6IiBmaWxsPSIjQzRDNEM0Ii8+PC9zdmc+) center no-repeat !important;-webkit-transition:background .3s ease;-moz-transition:background .3s ease;-ms-transition:background .3s ease;transition:background .3s ease}.slick-slider .slick-arrow:after,.slick-slider .slick-arrow:before{content:''}.slick-slider .slick-arrow:hover{background:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTQiIGhlaWdodD0iMjIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0uMi40QTEgMSAwIDAgMSAxLjYuMmwxMiAxMGExIDEgMCAwIDEgMCAxLjZsLTEyIDEwYTEgMSAwIDAgMS0xLjItMS42TDExLjMzMyAxMSAuNCAxLjhBMSAxIDAgMCAxIC4yLjR6IiBmaWxsPSIjMTYxNjE2Ii8+PC9zdmc+) center no-repeat}.slick-slider .slick-arrow.slick-next{right:0}.slick-slider .slick-arrow.slick-prev{left:0;-webkit-transform:rotate(180deg) translate(0,50%);-moz-transform:rotate(180deg) translate(0,50%);-ms-transform:rotate(180deg) translate(0,50%);transform:rotate(180deg) translate(0,50%)}.slick-initialized .slick-slide{float:none!important;display:inline-block!important;height:auto;}.product-items.slick-slider>.slick-list{padding:15px 0}.product-items.slick-slider .slick-slide .product-item{display:block!important;margin:auto!important;max-width:205px}.sidebar.sidebar-additional{width:100%}

View File

@@ -0,0 +1 @@
define(['./renderer/types','./renderer/layout','../lib/knockout/bootstrap'],function(types,layout){'use strict';return function(data,merge){types.set(data.types);layout(data.components,undefined,true,merge);};});

View File

@@ -0,0 +1,10 @@
define(['underscore','./strings'],function(_,utils){'use strict';function getIndex(item,container){var index=container.indexOf(item);if(~index){return index;}
return _.findIndex(container,function(value){return value&&value.name===item;});}
return{toggle:function(arr,value,add){return add?this.add(arr,value):this.remove(arr,value);},remove:function(arr,value){var index=arr.indexOf(value);if(~index){arr.splice(index,1);}
return this;},add:function(arr){var values=_.toArray(arguments).slice(1);values.forEach(function(value){if(!~arr.indexOf(value)){arr.push(value);}});return this;},insert:function(item,container,position){var currentIndex=getIndex(item,container),newIndex,target;if(typeof position==='undefined'){position=-1;}else if(typeof position==='string'){position=isNaN(+position)?position:+position;}
newIndex=position;if(~currentIndex){target=container.splice(currentIndex,1)[0];if(typeof item==='string'){item=target;}}
if(typeof position!=='number'){target=position.after||position.before||position;newIndex=getIndex(target,container);if(~newIndex&&(position.after||newIndex>=currentIndex)){newIndex++;}}
if(newIndex<0){newIndex+=container.length+1;}
container[newIndex]?container.splice(newIndex,0,item):container[newIndex]=item;return!~currentIndex?item:currentIndex!==newIndex;},formatOffset:function(elems,offset){if(utils.isEmpty(offset)){offset=-1;}
offset=+offset;if(offset<0){offset+=elems.length+1;}
return offset;}};});

View File

@@ -0,0 +1,13 @@
define(['ko','jquery','underscore','uiRegistry','./dom-observer','Magento_Ui/js/lib/knockout/extender/bound-nodes','./bindings'],function(ko,$,_,registry,domObserver,boundedNodes){'use strict';function isDomElement(node){return typeof node==='object'&&node.tagName&&node.nodeType;}
function parseSelector(str){var data=str.trim().split('->'),result={},componentData;if(data.length===1){if(!~data[0].indexOf(':')){result.selector=data[0];}else{componentData=data[0];}}else{componentData=data[0];result.selector=data[1];}
if(componentData){componentData=componentData.split(':');result.component=componentData[0];result.ctx=componentData[1];}
_.each(result,function(value,key){result[key]=value.trim();});return result;}
function parseData(selector,ctx){var data={};if(arguments.length===2){data.selector=selector;if(isDomElement(ctx)){data.ctx=ctx;}else{data.component=ctx;data.ctx='*';}}else{data=_.isString(selector)?parseSelector(selector):selector;}
return data;}
function waitComponent(name){var deffer=$.Deferred();if(_.isString(name)){registry.get(name,function(component){deffer.resolve(component);});}else{deffer.resolve(name);}
return deffer.promise();}
function setRootListener(data,component){boundedNodes.get(component,function(root){if(!$(root).is(data.ctx||'*')){return;}
data.selector?domObserver.get(data.selector,data.fn,root):data.fn(root);});}
$.async=function(selector,ctx,fn){var args=_.toArray(arguments),data=parseData.apply(null,_.initial(args));data.fn=_.last(args);if(data.component){waitComponent(data.component).then(setRootListener.bind(null,data));}else{domObserver.get(data.selector,data.fn,data.ctx);}};_.extend($.async,{get:function(selector,ctx){var data=parseData.apply(null,arguments),component=data.component,nodes;if(!component){return $(data.selector,data.ctx).toArray();}else if(_.isString(component)){component=registry.get(component);}
if(!component){return[];}
nodes=boundedNodes.get(component);nodes=$(nodes).filter(data.ctx).toArray();return data.selector?$(data.selector,nodes).toArray():nodes;},remove:function(nodes,fn){domObserver.remove(nodes,fn);},parseSelector:parseSelector});return $;});

View File

@@ -0,0 +1 @@
define(['jquery','Magento_Ui/js/modal/modal'],function($,modal){'use strict';return{modalWindow:null,createPopUp:function(element){var options={'type':'popup','modalClass':'popup-authentication','focus':'[name=username]','responsive':true,'innerScroll':true,'trigger':'.proceed-to-checkout, .trigger-auth-popup','buttons':[]};this.modalWindow=element;modal(options,$(this.modalWindow));},showModal:function(){$(this.modalWindow).modal('openModal').trigger('contentUpdated');}};});

View File

@@ -0,0 +1,5 @@
define(['jquery','ko','Magento_Ui/js/form/form','Magento_Customer/js/action/login','Magento_Customer/js/customer-data','Magento_Customer/js/model/authentication-popup','mage/translate','mage/url','Magento_Ui/js/modal/alert','mage/validation'],function($,ko,Component,loginAction,customerData,authenticationPopup,$t,url,alert){'use strict';return Component.extend({registerUrl:window.authenticationPopup.customerRegisterUrl,forgotPasswordUrl:window.authenticationPopup.customerForgotPasswordUrl,autocomplete:window.authenticationPopup.autocomplete,modalWindow:null,isLoading:ko.observable(false),checkoutNewCustomerMsg:window.authenticationPopup.checkoutNewCustomerMsg,checkoutLoginMsg:window.authenticationPopup.checkoutLoginMsg,ssologinUrl:window.authenticationPopup.baseUrl
+'mooauth/actions/sendAuthorizationRequest/?relayState='
+window.authenticationPopup.baseUrl+'customer/account/login&app_name='
+window.authenticationPopup.oAuthProviderName,defaults:{template:'Magento_Customer/authentication-popup'},initialize:function(){var self=this;this._super();url.setBaseUrl(window.authenticationPopup.baseUrl);loginAction.registerLoginCallback(function(){self.isLoading(false);});},setModalElement:function(element){if(authenticationPopup.modalWindow==null){authenticationPopup.createPopUp(element);}},isActive:function(){var customer=customerData.get('customer');return customer()==false;},showModal:function(){if(this.modalWindow){$(this.modalWindow).modal('openModal');}else{alert({content:$t('Guest checkout is disabled.')});}},login:function(formUiElement,event){var loginData={},formElement=$(event.currentTarget),formDataArray=formElement.serializeArray();event.stopPropagation();formDataArray.forEach(function(entry){loginData[entry.name]=entry.value;});if(formElement.validation()&&formElement.validation('isValid')){this.isLoading(true);loginAction(loginData);}
return false;}});});

View File

@@ -0,0 +1,42 @@
/*!
* jQuery UI Autocomplete 1.13.2
* http://jqueryui.com
*
* Copyright jQuery Foundation and other contributors
* Released under the MIT license.
* http://jquery.org/license
*/
(function(factory){"use strict";if(typeof define==="function"&&define.amd){define(["jquery","./menu","../keycode","../position","../safe-active-element","../version","../widget"],factory);}else{factory(jQuery);}})(function($){"use strict";$.widget("ui.autocomplete",{version:"1.13.2",defaultElement:"<input>",options:{appendTo:null,autoFocus:false,delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null,change:null,close:null,focus:null,open:null,response:null,search:null,select:null},requestIndex:0,pending:0,liveRegionTimer:null,_create:function(){var suppressKeyPress,suppressKeyPressRepeat,suppressInput,nodeName=this.element[0].nodeName.toLowerCase(),isTextarea=nodeName==="textarea",isInput=nodeName==="input";this.isMultiLine=isTextarea||!isInput&&this._isContentEditable(this.element);this.valueMethod=this.element[isTextarea||isInput?"val":"text"];this.isNewMenu=true;this._addClass("ui-autocomplete-input");this.element.attr("autocomplete","off");this._on(this.element,{keydown:function(event){if(this.element.prop("readOnly")){suppressKeyPress=true;suppressInput=true;suppressKeyPressRepeat=true;return;}
suppressKeyPress=false;suppressInput=false;suppressKeyPressRepeat=false;var keyCode=$.ui.keyCode;switch(event.keyCode){case keyCode.PAGE_UP:suppressKeyPress=true;this._move("previousPage",event);break;case keyCode.PAGE_DOWN:suppressKeyPress=true;this._move("nextPage",event);break;case keyCode.UP:suppressKeyPress=true;this._keyEvent("previous",event);break;case keyCode.DOWN:suppressKeyPress=true;this._keyEvent("next",event);break;case keyCode.ENTER:if(this.menu.active){suppressKeyPress=true;event.preventDefault();this.menu.select(event);}
break;case keyCode.TAB:if(this.menu.active){this.menu.select(event);}
break;case keyCode.ESCAPE:if(this.menu.element.is(":visible")){if(!this.isMultiLine){this._value(this.term);}
this.close(event);event.preventDefault();}
break;default:suppressKeyPressRepeat=true;this._searchTimeout(event);break;}},keypress:function(event){if(suppressKeyPress){suppressKeyPress=false;if(!this.isMultiLine||this.menu.element.is(":visible")){event.preventDefault();}
return;}
if(suppressKeyPressRepeat){return;}
var keyCode=$.ui.keyCode;switch(event.keyCode){case keyCode.PAGE_UP:this._move("previousPage",event);break;case keyCode.PAGE_DOWN:this._move("nextPage",event);break;case keyCode.UP:this._keyEvent("previous",event);break;case keyCode.DOWN:this._keyEvent("next",event);break;}},input:function(event){if(suppressInput){suppressInput=false;event.preventDefault();return;}
this._searchTimeout(event);},focus:function(){this.selectedItem=null;this.previous=this._value();},blur:function(event){clearTimeout(this.searching);this.close(event);this._change(event);}});this._initSource();this.menu=$("<ul>").appendTo(this._appendTo()).menu({role:null}).hide().attr({"unselectable":"on"}).menu("instance");this._addClass(this.menu.element,"ui-autocomplete","ui-front");this._on(this.menu.element,{mousedown:function(event){event.preventDefault();},menufocus:function(event,ui){var label,item;if(this.isNewMenu){this.isNewMenu=false;if(event.originalEvent&&/^mouse/.test(event.originalEvent.type)){this.menu.blur();this.document.one("mousemove",function(){$(event.target).trigger(event.originalEvent);});return;}}
item=ui.item.data("ui-autocomplete-item");if(false!==this._trigger("focus",event,{item:item})){if(event.originalEvent&&/^key/.test(event.originalEvent.type)){this._value(item.value);}}
label=ui.item.attr("aria-label")||item.value;if(label&&String.prototype.trim.call(label).length){clearTimeout(this.liveRegionTimer);this.liveRegionTimer=this._delay(function(){this.liveRegion.html($("<div>").text(label));},100);}},menuselect:function(event,ui){var item=ui.item.data("ui-autocomplete-item"),previous=this.previous;if(this.element[0]!==$.ui.safeActiveElement(this.document[0])){this.element.trigger("focus");this.previous=previous;this._delay(function(){this.previous=previous;this.selectedItem=item;});}
if(false!==this._trigger("select",event,{item:item})){this._value(item.value);}
this.term=this._value();this.close(event);this.selectedItem=item;}});this.liveRegion=$("<div>",{role:"status","aria-live":"assertive","aria-relevant":"additions"}).appendTo(this.document[0].body);this._addClass(this.liveRegion,null,"ui-helper-hidden-accessible");this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete");}});},_destroy:function(){clearTimeout(this.searching);this.element.removeAttr("autocomplete");this.menu.element.remove();this.liveRegion.remove();},_setOption:function(key,value){this._super(key,value);if(key==="source"){this._initSource();}
if(key==="appendTo"){this.menu.element.appendTo(this._appendTo());}
if(key==="disabled"&&value&&this.xhr){this.xhr.abort();}},_isEventTargetInWidget:function(event){var menuElement=this.menu.element[0];return event.target===this.element[0]||event.target===menuElement||$.contains(menuElement,event.target);},_closeOnClickOutside:function(event){if(!this._isEventTargetInWidget(event)){this.close();}},_appendTo:function(){var element=this.options.appendTo;if(element){element=element.jquery||element.nodeType?$(element):this.document.find(element).eq(0);}
if(!element||!element[0]){element=this.element.closest(".ui-front, dialog");}
if(!element.length){element=this.document[0].body;}
return element;},_initSource:function(){var array,url,that=this;if(Array.isArray(this.options.source)){array=this.options.source;this.source=function(request,response){response($.ui.autocomplete.filter(array,request.term));};}else if(typeof this.options.source==="string"){url=this.options.source;this.source=function(request,response){if(that.xhr){that.xhr.abort();}
that.xhr=$.ajax({url:url,data:request,dataType:"json",success:function(data){response(data);},error:function(){response([]);}});};}else{this.source=this.options.source;}},_searchTimeout:function(event){clearTimeout(this.searching);this.searching=this._delay(function(){var equalValues=this.term===this._value(),menuVisible=this.menu.element.is(":visible"),modifierKey=event.altKey||event.ctrlKey||event.metaKey||event.shiftKey;if(!equalValues||(equalValues&&!menuVisible&&!modifierKey)){this.selectedItem=null;this.search(null,event);}},this.options.delay);},search:function(value,event){value=value!=null?value:this._value();this.term=this._value();if(value.length<this.options.minLength){return this.close(event);}
if(this._trigger("search",event)===false){return;}
return this._search(value);},_search:function(value){this.pending++;this._addClass("ui-autocomplete-loading");this.cancelSearch=false;this.source({term:value},this._response());},_response:function(){var index=++this.requestIndex;return function(content){if(index===this.requestIndex){this.__response(content);}
this.pending--;if(!this.pending){this._removeClass("ui-autocomplete-loading");}}.bind(this);},__response:function(content){if(content){content=this._normalize(content);}
this._trigger("response",null,{content:content});if(!this.options.disabled&&content&&content.length&&!this.cancelSearch){this._suggest(content);this._trigger("open");}else{this._close();}},close:function(event){this.cancelSearch=true;this._close(event);},_close:function(event){this._off(this.document,"mousedown");if(this.menu.element.is(":visible")){this.menu.element.hide();this.menu.blur();this.isNewMenu=true;this._trigger("close",event);}},_change:function(event){if(this.previous!==this._value()){this._trigger("change",event,{item:this.selectedItem});}},_normalize:function(items){if(items.length&&items[0].label&&items[0].value){return items;}
return $.map(items,function(item){if(typeof item==="string"){return{label:item,value:item};}
return $.extend({},item,{label:item.label||item.value,value:item.value||item.label});});},_suggest:function(items){var ul=this.menu.element.empty();this._renderMenu(ul,items);this.isNewMenu=true;this.menu.refresh();ul.show();this._resizeMenu();ul.position($.extend({of:this.element},this.options.position));if(this.options.autoFocus){this.menu.next();}
this._on(this.document,{mousedown:"_closeOnClickOutside"});},_resizeMenu:function(){var ul=this.menu.element;ul.outerWidth(Math.max(ul.width("").outerWidth()+1,this.element.outerWidth()));},_renderMenu:function(ul,items){var that=this;$.each(items,function(index,item){that._renderItemData(ul,item);});},_renderItemData:function(ul,item){return this._renderItem(ul,item).data("ui-autocomplete-item",item);},_renderItem:function(ul,item){return $("<li>").append($("<div>").text(item.label)).appendTo(ul);},_move:function(direction,event){if(!this.menu.element.is(":visible")){this.search(null,event);return;}
if(this.menu.isFirstItem()&&/^previous/.test(direction)||this.menu.isLastItem()&&/^next/.test(direction)){if(!this.isMultiLine){this._value(this.term);}
this.menu.blur();return;}
this.menu[direction](event);},widget:function(){return this.menu.element;},_value:function(){return this.valueMethod.apply(this.element,arguments);},_keyEvent:function(keyEvent,event){if(!this.isMultiLine||this.menu.element.is(":visible")){this._move(keyEvent,event);event.preventDefault();}},_isContentEditable:function(element){if(!element.length){return false;}
var editable=element.prop("contentEditable");if(editable==="inherit"){return this._isContentEditable(element.parent());}
return editable==="true";}});$.extend($.ui.autocomplete,{escapeRegex:function(value){return value.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&");},filter:function(array,term){var matcher=new RegExp($.ui.autocomplete.escapeRegex(term),"i");return $.grep(array,function(value){return matcher.test(value.label||value.value||value);});}});$.widget("ui.autocomplete",$.ui.autocomplete,{options:{messages:{noResults:"No search results.",results:function(amount){return amount+(amount>1?" results are":" result is")+" available, use up and down arrow keys to navigate.";}}},__response:function(content){var message;this._superApply(arguments);if(this.options.disabled||this.cancelSearch){return;}
if(content&&content.length){message=this.options.messages.results(content.length);}else{message=this.options.messages.noResults;}
clearTimeout(this.liveRegionTimer);this.liveRegionTimer=this._delay(function(){this.liveRegion.html($("<div>").text(message));},100);}});return $.ui.autocomplete;});

View File

@@ -0,0 +1,2 @@
define(['ko','jquery','../template/renderer'],function(ko,$,renderer){'use strict';function onFocus(e){e.target.select();}
ko.bindingHandlers.autoselect={init:function(element,valueAccessor){var enabled=ko.unwrap(valueAccessor());if(enabled!==false){$(element).on('focus',onFocus);}}};renderer.addAttribute('autoselect');});

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,4 @@
define(['ko','underscore','mage/apply/main','../template/renderer'],function(ko,_,mage,renderer){'use strict';function setHtml(el,html){ko.utils.emptyDomNode(el);html=ko.utils.unwrapObservable(html);if(!_.isNull(html)&&!_.isUndefined(html)){if(!_.isString(html)){html=html.toString();}
el.innerHTML=html;}}
function applyComponents(el,ctx){ko.utils.arrayForEach(el.childNodes,ko.cleanNode);ko.applyBindingsToDescendants(ctx,el);mage.apply();}
ko.bindingHandlers.bindHtml={init:function(){return{controlsDescendantBindings:true};},update:function(el,valueAccessor,allBindings,viewModel,bindingContext){setHtml(el,valueAccessor());applyComponents(el,bindingContext);}};renderer.addAttribute('bindHtml');});

View File

@@ -0,0 +1,6 @@
define(['ko','jquery','underscore'],function(ko,$,_){'use strict';function isDomElement(node){return typeof node==='object'&&node.tagName&&node.nodeType;}
function normalize(nodes){var result;nodes=_.toArray(nodes);result=nodes.slice();nodes.forEach(function(node){if(node.nodeType===8){result=!ko.virtualElements.hasBindingValue(node)?_.without(result,node):_.difference(result,ko.virtualElements.childNodes(node));}});return result;}
$.fn.extendCtx=function(){var nodes=normalize(this),extenders=_.toArray(arguments);nodes.forEach(function(node){var ctx=ko.contextFor(node),data=[ctx].concat(extenders);_.extend.apply(_,data);});return this;};$.fn.applyBindings=function(ctx){var nodes=normalize(this),nodeCtx;if(isDomElement(ctx)){ctx=ko.contextFor(ctx);}
nodes.forEach(function(node){nodeCtx=ctx||ko.contextFor(node);ko.applyBindings(nodeCtx,node);});return this;};$.fn.bindings=function(data,ctx){var nodes=normalize(this),bindings=data,nodeCtx;if(isDomElement(ctx)){ctx=ko.contextFor(ctx);}
nodes.forEach(function(node){nodeCtx=ctx||ko.contextFor(node);if(_.isFunction(data)){bindings=data(nodeCtx,node);}
ko.applyBindingsToNode(node,bindings,nodeCtx);});return this;};});

View File

@@ -0,0 +1,7 @@
define(['ko','jquery','Magento_Ui/js/lib/knockout/template/loader','mage/template'],function(ko,$,templateLoader,template){'use strict';var blockLoaderTemplatePath='ui/block-loader',blockContentLoadingClass='_block-content-loading',blockLoader,blockLoaderClass,blockLoaderElement=$.Deferred(),loaderImageHref=$.Deferred();templateLoader.loadTemplate(blockLoaderTemplatePath).done(function(blockLoaderTemplate){loaderImageHref.done(function(loaderHref){blockLoader=template(blockLoaderTemplate.trim(),{loaderImageHref:loaderHref});blockLoader=$(blockLoader);blockLoaderClass='.'+blockLoader.attr('class');blockLoaderElement.resolve();});});function isLoadingClassRequired(element){var position=element.css('position');if(position==='absolute'||position==='fixed'){return false;}
return true;}
function addBlockLoader(element){element.find(':focus').trigger('blur');element.find('input:disabled, select:disabled').addClass('_disabled');element.find('input, select').prop('disabled',true);if(isLoadingClassRequired(element)){element.addClass(blockContentLoadingClass);}
element.append(blockLoader.clone());}
function removeBlockLoader(element){if(!element.has(blockLoaderClass).length){return;}
element.find(blockLoaderClass).remove();element.find('input:not("._disabled"), select:not("._disabled")').prop('disabled',false);element.find('input:disabled, select:disabled').removeClass('_disabled');element.removeClass(blockContentLoadingClass);}
return function(loaderHref){loaderImageHref.resolve(loaderHref);ko.bindingHandlers.blockLoader={update:function(element,displayBlockLoader){element=$(element);if(ko.unwrap(displayBlockLoader())){blockLoaderElement.done(addBlockLoader(element));}else{blockLoaderElement.done(removeBlockLoader(element));}}};};});

View File

@@ -0,0 +1 @@
define(['ko','./template/engine','knockoutjs/knockout-es5','./bindings/bootstrap','./extender/observable_array','./extender/bound-nodes','domReady!'],function(ko,templateEngine){'use strict';ko.uid=0;ko.setTemplateEngine(templateEngine);ko.applyBindings();});

View File

@@ -0,0 +1 @@
define(function(require){'use strict';var renderer=require('../template/renderer');renderer.addAttribute('repeat',renderer.handlers.wrapAttribute);renderer.addAttribute('outerfasteach',{binding:'fastForEach',handler:renderer.handlers.wrapAttribute});renderer.addNode('repeat').addNode('fastForEach');return{resizable:require('./resizable'),i18n:require('./i18n'),scope:require('./scope'),range:require('./range'),mageInit:require('./mage-init'),keyboard:require('./keyboard'),optgroup:require('./optgroup'),afterRender:require('./after-render'),autoselect:require('./autoselect'),datepicker:require('./datepicker'),outerClick:require('./outer_click'),fadeVisible:require('./fadeVisible'),collapsible:require('./collapsible'),staticChecked:require('./staticChecked'),simpleChecked:require('./simple-checked'),bindHtml:require('./bind-html'),tooltip:require('./tooltip'),repeat:require('knockoutjs/knockout-repeat'),fastForEach:require('knockoutjs/knockout-fast-foreach'),colorPicker:require('./color-picker')};});

View File

@@ -0,0 +1 @@
define(['jquery','mage/apply/main','Magento_Ui/js/lib/knockout/bootstrap'],function($,mage){'use strict';$.ajaxSetup({cache:false});setTimeout(mage.apply);});

View File

@@ -0,0 +1,15 @@
define(['ko','underscore','mage/utils/wrapper','uiEvents'],function(ko,_,wrapper,Events){'use strict';var nodesMap=new WeakMap();function getBounded(model){return nodesMap.get(model);}
function addBounded(model,node){var nodes=getBounded(model),isRoot;if(!nodes){nodesMap.set(model,[node]);Events.trigger.call(model,'addNode',node);return;}
isRoot=nodes.every(function(bounded){return!bounded.contains(node);});if(isRoot){nodes.push(node);Events.trigger.call(model,'addNode',node);}}
function removeBounded(model,node){var nodes=getBounded(model),index;if(!nodes){return;}
index=nodes.indexOf(node);if(~index){nodes.splice(index,0);Events.trigger.call(model,'removeNode',node);}
if(!nodes.length){nodesMap.delete(model);}}
function getElement(node,data){var elem;while(node.nextElementSibling){node=node.nextElementSibling;if(node.nodeType===1&&ko.dataFor(node)===data){elem=node;break;}}
return elem;}
wrapper.extend(ko,{applyBindings:function(orig,ctx,node){var result=orig(),data=ctx&&(ctx.$data||ctx);if(node&&node.nodeType===8){node=getElement(node,data);}
if(!node||node.nodeType!==1){return result;}
if(data&&data.registerNodes){addBounded(data,node);}
return result;},cleanNode:function(orig,node){var result=orig(),data;if(node.nodeType!==1){return result;}
data=ko.dataFor(node);if(data&&data.registerNodes){removeBounded(data,node);}
return result;}});return{get:function(model,callback){var nodes=getBounded(model)||[];if(!_.isFunction(callback)){return nodes;}
nodes.forEach(function(node){callback(node);});this.add.apply(this,arguments);},add:function(model){var args=_.toArray(arguments).slice(1);args.unshift('addNode');Events.on.apply(model,args);},remove:function(model){var args=_.toArray(arguments).slice(1);args.unshift('removeNode');Events.on.apply(model,args);},off:function(model){var args=_.toArray(arguments).slice(1);Events.off.apply(model,args);}};});

View File

@@ -0,0 +1,44 @@
/*!
* jQuery UI Button 1.13.2
* http://jqueryui.com
*
* Copyright jQuery Foundation and other contributors
* Released under the MIT license.
* http://jquery.org/license
*/
(function(factory){"use strict";if(typeof define==="function"&&define.amd){define(["jquery","./controlgroup","./checkboxradio","../keycode","../widget"],factory);}else{factory(jQuery);}})(function($){"use strict";$.widget("ui.button",{version:"1.13.2",defaultElement:"<button>",options:{classes:{"ui-button":"ui-corner-all"},disabled:null,icon:null,iconPosition:"beginning",label:null,showLabel:true},_getCreateOptions:function(){var disabled,options=this._super()||{};this.isInput=this.element.is("input");disabled=this.element[0].disabled;if(disabled!=null){options.disabled=disabled;}
this.originalLabel=this.isInput?this.element.val():this.element.html();if(this.originalLabel){options.label=this.originalLabel;}
return options;},_create:function(){if(!this.option.showLabel&!this.options.icon){this.options.showLabel=true;}
if(this.options.disabled==null){this.options.disabled=this.element[0].disabled||false;}
this.hasTitle=!!this.element.attr("title");if(this.options.label&&this.options.label!==this.originalLabel){if(this.isInput){this.element.val(this.options.label);}else{this.element.html(this.options.label);}}
this._addClass("ui-button","ui-widget");this._setOption("disabled",this.options.disabled);this._enhance();if(this.element.is("a")){this._on({"keyup":function(event){if(event.keyCode===$.ui.keyCode.SPACE){event.preventDefault();if(this.element[0].click){this.element[0].click();}else{this.element.trigger("click");}}}});}},_enhance:function(){if(!this.element.is("button")){this.element.attr("role","button");}
if(this.options.icon){this._updateIcon("icon",this.options.icon);this._updateTooltip();}},_updateTooltip:function(){this.title=this.element.attr("title");if(!this.options.showLabel&&!this.title){this.element.attr("title",this.options.label);}},_updateIcon:function(option,value){var icon=option!=="iconPosition",position=icon?this.options.iconPosition:value,displayBlock=position==="top"||position==="bottom";if(!this.icon){this.icon=$("<span>");this._addClass(this.icon,"ui-button-icon","ui-icon");if(!this.options.showLabel){this._addClass("ui-button-icon-only");}}else if(icon){this._removeClass(this.icon,null,this.options.icon);}
if(icon){this._addClass(this.icon,null,value);}
this._attachIcon(position);if(displayBlock){this._addClass(this.icon,null,"ui-widget-icon-block");if(this.iconSpace){this.iconSpace.remove();}}else{if(!this.iconSpace){this.iconSpace=$("<span> </span>");this._addClass(this.iconSpace,"ui-button-icon-space");}
this._removeClass(this.icon,null,"ui-wiget-icon-block");this._attachIconSpace(position);}},_destroy:function(){this.element.removeAttr("role");if(this.icon){this.icon.remove();}
if(this.iconSpace){this.iconSpace.remove();}
if(!this.hasTitle){this.element.removeAttr("title");}},_attachIconSpace:function(iconPosition){this.icon[/^(?:end|bottom)/.test(iconPosition)?"before":"after"](this.iconSpace);},_attachIcon:function(iconPosition){this.element[/^(?:end|bottom)/.test(iconPosition)?"append":"prepend"](this.icon);},_setOptions:function(options){var newShowLabel=options.showLabel===undefined?this.options.showLabel:options.showLabel,newIcon=options.icon===undefined?this.options.icon:options.icon;if(!newShowLabel&&!newIcon){options.showLabel=true;}
this._super(options);},_setOption:function(key,value){if(key==="icon"){if(value){this._updateIcon(key,value);}else if(this.icon){this.icon.remove();if(this.iconSpace){this.iconSpace.remove();}}}
if(key==="iconPosition"){this._updateIcon(key,value);}
if(key==="showLabel"){this._toggleClass("ui-button-icon-only",null,!value);this._updateTooltip();}
if(key==="label"){if(this.isInput){this.element.val(value);}else{this.element.html(value);if(this.icon){this._attachIcon(this.options.iconPosition);this._attachIconSpace(this.options.iconPosition);}}}
this._super(key,value);if(key==="disabled"){this._toggleClass(null,"ui-state-disabled",value);this.element[0].disabled=value;if(value){this.element.trigger("blur");}}},refresh:function(){var isDisabled=this.element.is("input, button")?this.element[0].disabled:this.element.hasClass("ui-button-disabled");if(isDisabled!==this.options.disabled){this._setOptions({disabled:isDisabled});}
this._updateTooltip();}});if($.uiBackCompat!==false){$.widget("ui.button",$.ui.button,{options:{text:true,icons:{primary:null,secondary:null}},_create:function(){if(this.options.showLabel&&!this.options.text){this.options.showLabel=this.options.text;}
if(!this.options.showLabel&&this.options.text){this.options.text=this.options.showLabel;}
if(!this.options.icon&&(this.options.icons.primary||this.options.icons.secondary)){if(this.options.icons.primary){this.options.icon=this.options.icons.primary;}else{this.options.icon=this.options.icons.secondary;this.options.iconPosition="end";}}else if(this.options.icon){this.options.icons.primary=this.options.icon;}
this._super();},_setOption:function(key,value){if(key==="text"){this._super("showLabel",value);return;}
if(key==="showLabel"){this.options.text=value;}
if(key==="icon"){this.options.icons.primary=value;}
if(key==="icons"){if(value.primary){this._super("icon",value.primary);this._super("iconPosition","beginning");}else if(value.secondary){this._super("icon",value.secondary);this._super("iconPosition","end");}}
this._superApply(arguments);}});$.fn.button=(function(orig){return function(options){var isMethodCall=typeof options==="string";var args=Array.prototype.slice.call(arguments,1);var returnValue=this;if(isMethodCall){if(!this.length&&options==="instance"){returnValue=undefined;}else{this.each(function(){var methodValue;var type=$(this).attr("type");var name=type!=="checkbox"&&type!=="radio"?"button":"checkboxradio";var instance=$.data(this,"ui-"+name);if(options==="instance"){returnValue=instance;return false;}
if(!instance){return $.error("cannot call methods on button"+" prior to initialization; "+"attempted to call method '"+options+"'");}
if(typeof instance[options]!=="function"||options.charAt(0)==="_"){return $.error("no such method '"+options+"' for button"+" widget instance");}
methodValue=instance[options].apply(instance,args);if(methodValue!==instance&&methodValue!==undefined){returnValue=methodValue&&methodValue.jquery?returnValue.pushStack(methodValue.get()):methodValue;return false;}});}}else{if(args.length){options=$.widget.extend.apply(null,[options].concat(args));}
this.each(function(){var type=$(this).attr("type");var name=type!=="checkbox"&&type!=="radio"?"button":"checkboxradio";var instance=$.data(this,"ui-"+name);if(instance){instance.option(options||{});if(instance._init){instance._init();}}else{if(name==="button"){orig.call($(this),options);return;}
$(this).checkboxradio($.extend({icon:false},options));}});}
return returnValue;};})($.fn.button);$.fn.buttonset=function(){if(!$.ui.controlgroup){$.error("Controlgroup widget missing");}
if(arguments[0]==="option"&&arguments[1]==="items"&&arguments[2]){return this.controlgroup.apply(this,[arguments[0],"items.button",arguments[2]]);}
if(arguments[0]==="option"&&arguments[1]==="items"){return this.controlgroup.apply(this,[arguments[0],"items.button"]);}
if(typeof arguments[0]==="object"&&arguments[0].items){arguments[0].items={button:arguments[0].items};}
return this.controlgroup.apply(this,arguments);};}
return $.ui.button;});

View File

@@ -0,0 +1 @@
define(function(){'use strict';return{'reset':'#reset','save':'#save','saveAndContinue':'#save_and_continue'};});

View File

@@ -0,0 +1 @@
.ui-datepicker{display:none;z-index:999999 !important}.ui-datepicker .ui-datepicker-header{position:relative;padding:.2em 0}.ui-datepicker .ui-datepicker-prev,.ui-datepicker .ui-datepicker-next{position:absolute;top:2px;width:1.8em;height:1.8em;cursor:pointer}.ui-datepicker .ui-datepicker-next-hover span,.ui-datepicker .ui-datepicker-prev-hover span{border-color:transparent #ff8400 transparent transparent}.ui-datepicker .ui-datepicker-prev{left:2px}.ui-datepicker .ui-datepicker-next{right:2px}.ui-datepicker .ui-datepicker-prev span,.ui-datepicker .ui-datepicker-next span{display:block;position:absolute;left:50%;margin-left:-8px;top:50%;margin-top:-5px;font-size:0px;width:0;height:0;border:solid;border-width:5px 8px 5px 0;border-color:transparent #ff9635 transparent transparent}.ui-datepicker .ui-datepicker-next span{margin-left:0;top:50%;margin-top:-5px;border-width:5px 0 5px 8px;border-color:transparent transparent transparent #ff9635}.ui-datepicker .ui-datepicker-title{margin:0 2.3em;line-height:1.8em;text-align:center}.ui-datepicker .ui-datepicker-title select{font-size:1em;margin:1px 0}.ui-datepicker select.ui-datepicker-month-year{width:100%}.ui-datepicker table{width:100%;font-size:.9em}.ui-datepicker td span,.ui-datepicker td a{display:block;padding:4px;text-align:right;text-decoration:none;color:#000}.ui-datepicker .ui-datepicker-buttonpane button{float:right}.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current{float:left}.ui-datepicker-rtl{direction:rtl}.ui-datepicker-rtl .ui-datepicker-prev{right:2px;left:auto}.ui-datepicker-rtl .ui-datepicker-next{left:2px;right:auto}.ui-datepicker-rtl .ui-datepicker-prev:hover{right:1px;left:auto}.ui-datepicker-rtl .ui-datepicker-next:hover{left:1px;right:auto}.ui-datepicker-rtl .ui-datepicker-buttonpane{clear:right}.ui-datepicker-rtl .ui-datepicker-buttonpane button{float:left}.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current{float:right}.ui-datepicker-rtl .ui-datepicker-group{float:right}.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header{border-right-width:0;border-left-width:1px}.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header{border-right-width:0;border-left-width:1px}.ui-timepicker-div .ui-widget-header{margin-bottom:8px}.ui-timepicker-div dl{text-align:left}.ui-timepicker-div dl dt{height:25px;margin-bottom:-22px}.ui-timepicker-div dl .ui_tpicker_time_label{margin-bottom:-25px}.ui-timepicker-div dl dd{margin:0 10px 10px 65px}.ui-timepicker-div td{font-size:90%}.ui-tpicker-grid-label{background:0 0;border:none;margin:0;padding:0}.ui-datepicker{padding:15px;border:#fff 4px solid;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;background:#efefef;-webkit-box-shadow:5px 5px 10px 0px rgba(0,0,0,.35);box-shadow:5px 5px 10px 0px rgba(0,0,0,.35)}.ui-datepicker .ui-datepicker-header{background:0 0;border:none;padding-bottom:10px}.ui-datepicker .ui-datepicker-title .ui-datepicker-month{width:47%;margin-right:6%}.ui-datepicker .ui-datepicker-title .ui-datepicker-year{width:47%}.ui-datepicker .ui-datepicker-calendar td{border:#cfcfcf 1px solid}.ui-datepicker .ui-datepicker-calendar td a{padding:4px;display:block}.ui-datepicker .ui-datepicker-calendar td .ui-state-hover{background:#f9eae7}.ui-datepicker .ui-datepicker-calendar{background:#fff;border:#cfcfcf 1px solid;border-collapse:collapse}.ui-datepicker .ui-datepicker-calendar th{background:#efefef;border:#cfcfcf 1px solid;padding:4px;text-transform:uppercase}.ui-datepicker .ui-datepicker-calendar .ui-datepicker-week-col{text-align:center;border:#cfcfcf 1px solid}.ui-datepicker{width:auto}.ui-datepicker .ui-datepicker-calendar .ui-datepicker-today{background:#f3d7d2}.ui-datepicker .ui-datepicker-calendar .ui-state-active{background:#ffdf66}.ui-timepicker-div .ui-widget-header{margin-bottom:8px}.ui-timepicker-div dl{text-align:left}.ui-timepicker-div dl dd{margin:0 0 10px 65px}.ui-timepicker-div td{font-size:90%}.ui-tpicker-grid-label{background:0 0;border:none;margin:0;padding:0}.ui-slider{position:relative;text-align:left}.ui-slider-horizontal .ui-slider-handle{margin-left:-5px}.ui-slider .ui-slider-handle{position:absolute;z-index:2;cursor:default}.ui-slider-horizontal{height:10px;-webkit-border-radius:10px;border-radius:10px;border:none;background:#dadada}.ui-slider-handle{height:10px;width:10px;-webkit-border-radius:10px;border-radius:10px;background:#f98b25;display:block;position:absolute}.ui-timepicker-div{padding:10px 0 5px}.ui-datepicker .ui-datepicker-buttonpane{overflow:hidden;padding-top:10px;border-top:#cfcfcf 1px solid}.ui-datepicker .ui-datepicker-calendar .ui-state-disabled{background:#f9f9f9}.ui-datepicker .ui-datepicker-calendar .ui-state-disabled span{color:#959595}.ui-datepicker-cover{position:absolute;z-index:-1;filter:mask();top:-4px;left:-4px;width:200px;height:200px}.ui-timepicker-div .ui_tpicker_unit_hide{display:none}

View File

@@ -0,0 +1 @@
define(['jquery','ko','Magento_Captcha/js/action/refresh'],function($,ko,refreshAction){'use strict';return function(captchaData){return{formId:captchaData.formId,imageSource:ko.observable(captchaData.imageSrc),visibility:ko.observable(false),captchaValue:ko.observable(null),isRequired:ko.observable(captchaData.isRequired),isCaseSensitive:captchaData.isCaseSensitive,imageHeight:captchaData.imageHeight,refreshUrl:captchaData.refreshUrl,isLoading:ko.observable(false),timestamp:null,getFormId:function(){return this.formId;},setFormId:function(formId){this.formId=formId;},getIsVisible:function(){return this.visibility();},setIsVisible:function(flag){this.visibility(flag);},getIsRequired:function(){return this.isRequired();},setIsRequired:function(flag){this.isRequired(flag);},getIsCaseSensitive:function(){return this.isCaseSensitive;},setIsCaseSensitive:function(flag){this.isCaseSensitive=flag;},getImageHeight:function(){return this.imageHeight;},setImageHeight:function(height){this.imageHeight=height;},getImageSource:function(){return this.imageSource;},setImageSource:function(imageSource){this.imageSource(imageSource);},getRefreshUrl:function(){return this.refreshUrl;},setRefreshUrl:function(url){this.refreshUrl=url;},getCaptchaValue:function(){return this.captchaValue;},setCaptchaValue:function(value){this.captchaValue(value);},refresh:function(){var refresh,self=this;this.isLoading(true);refresh=refreshAction(this.getRefreshUrl(),this.getFormId(),this.getImageSource());$.when(refresh).done(function(){self.isLoading(false);});}};};});

View File

@@ -0,0 +1 @@
define(['jquery'],function($){'use strict';var captchaList=[];return{add:function(captcha){captchaList.push(captcha);},getCaptchaByFormId:function(formId){var captcha=null;$.each(captchaList,function(key,item){if(formId===item.formId){captcha=item;return false;}});return captcha;},getCaptchaList:function(){return captchaList;}};});

View File

@@ -0,0 +1 @@
define(['uiComponent'],function(Component){'use strict';return Component.extend({getProductNameUnsanitizedHtml:function(productName){return productName;},getOptionValueUnsanitizedHtml:function(optionValue){return optionValue;}});});

View File

@@ -0,0 +1,2 @@
define(['underscore','jquery','Magento_ConfigurableProduct/js/product/view/product-info-resolver'],function(_,$,productInfoResolver){'use strict';return function(widget){$.widget('mage.catalogAddToCart',widget,{ajaxSubmit:function(form){var isConfigurable=!!_.find(form.serializeArray(),function(item){return item.name.indexOf('super_attribute')!==-1;});if(isConfigurable){this.options.productInfoResolver=productInfoResolver;}
return this._super(form);}});return $.mage.catalogAddToCart;};});

View File

@@ -0,0 +1,9 @@
define(['jquery','mage/translate','underscore','Magento_Catalog/js/product/view/product-ids-resolver','Magento_Catalog/js/product/view/product-info-resolver','jquery-ui-modules/widget'],function($,$t,_,idsResolver,productInfoResolver){'use strict';$.widget('mage.catalogAddToCart',{options:{processStart:null,processStop:null,bindSubmit:true,minicartSelector:'[data-block="minicart"]',messagesSelector:'[data-placeholder="messages"]',productStatusSelector:'.stock.available',addToCartButtonSelector:'.action.tocart',addToCartButtonDisabledClass:'disabled',addToCartButtonTextWhileAdding:'',addToCartButtonTextAdded:'',addToCartButtonTextDefault:'',productInfoResolver:productInfoResolver},_create:function(){if(this.options.bindSubmit){this._bindSubmit();}
$(this.options.addToCartButtonSelector).prop('disabled',false);},_bindSubmit:function(){var self=this;if(this.element.data('catalog-addtocart-initialized')){return;}
this.element.data('catalog-addtocart-initialized',1);this.element.on('submit',function(e){e.preventDefault();self.submitForm($(this));});},_redirect:function(url){var urlParts,locationParts,forceReload;urlParts=url.split('#');locationParts=window.location.href.split('#');forceReload=urlParts[0]===locationParts[0];window.location.assign(url);if(forceReload){window.location.reload();}},isLoaderEnabled:function(){return this.options.processStart&&this.options.processStop;},submitForm:function(form){this.ajaxSubmit(form);},ajaxSubmit:function(form){var self=this,productIds=idsResolver(form),productInfo=self.options.productInfoResolver(form),formData;$(self.options.minicartSelector).trigger('contentLoading');self.disableAddToCartButton(form);formData=new FormData(form[0]);$.ajax({url:form.prop('action'),data:formData,type:'post',dataType:'json',cache:false,contentType:false,processData:false,beforeSend:function(){if(self.isLoaderEnabled()){$('body').trigger(self.options.processStart);}},success:function(res){var eventData,parameters;$(document).trigger('ajax:addToCart',{'sku':form.data().productSku,'productIds':productIds,'productInfo':productInfo,'form':form,'response':res});if(self.isLoaderEnabled()){$('body').trigger(self.options.processStop);}
if(res.backUrl){eventData={'form':form,'redirectParameters':[]};$('body').trigger('catalogCategoryAddToCartRedirect',eventData);if(eventData.redirectParameters.length>0&&window.location.href.split(/[?#]/)[0]===res.backUrl){parameters=res.backUrl.split('#');parameters.push(eventData.redirectParameters.join('&'));res.backUrl=parameters.join('#');}
self._redirect(res.backUrl);return;}
if(res.messages){$(self.options.messagesSelector).html(res.messages);}
if(res.minicart){$(self.options.minicartSelector).replaceWith(res.minicart);$(self.options.minicartSelector).trigger('contentUpdated');}
if(res.product&&res.product.statusText){$(self.options.productStatusSelector).removeClass('available').addClass('unavailable').find('span').html(res.product.statusText);}
self.enableAddToCartButton(form);},error:function(res){$(document).trigger('ajax:addToCart:error',{'sku':form.data().productSku,'productIds':productIds,'productInfo':productInfo,'form':form,'response':res});},complete:function(res){if(res.state()==='rejected'){location.reload();}}});},disableAddToCartButton:function(form){var addToCartButtonTextWhileAdding=this.options.addToCartButtonTextWhileAdding||$t('Adding...'),addToCartButton=$(form).find(this.options.addToCartButtonSelector);addToCartButton.addClass(this.options.addToCartButtonDisabledClass);addToCartButton.find('span').text(addToCartButtonTextWhileAdding);addToCartButton.prop('title',addToCartButtonTextWhileAdding);},enableAddToCartButton:function(form){var addToCartButtonTextAdded=this.options.addToCartButtonTextAdded||$t('Added'),self=this,addToCartButton=$(form).find(this.options.addToCartButtonSelector);addToCartButton.find('span').text(addToCartButtonTextAdded);addToCartButton.prop('title',addToCartButtonTextAdded);setTimeout(function(){var addToCartButtonTextDefault=self.options.addToCartButtonTextDefault||$t('Add to Cart');addToCartButton.removeClass(self.options.addToCartButtonDisabledClass);addToCartButton.find('span').text(addToCartButtonTextDefault);addToCartButton.prop('title',addToCartButtonTextDefault);},1000);}});return $.mage.catalogAddToCart;});

View File

@@ -0,0 +1,28 @@
/*!
* jQuery UI Checkboxradio 1.13.2
* http://jqueryui.com
*
* Copyright jQuery Foundation and other contributors
* Released under the MIT license.
* http://jquery.org/license
*/
(function(factory){"use strict";if(typeof define==="function"&&define.amd){define(["jquery","../form-reset-mixin","../labels","../widget"],factory);}else{factory(jQuery);}})(function($){"use strict";$.widget("ui.checkboxradio",[$.ui.formResetMixin,{version:"1.13.2",options:{disabled:null,label:null,icon:true,classes:{"ui-checkboxradio-label":"ui-corner-all","ui-checkboxradio-icon":"ui-corner-all"}},_getCreateOptions:function(){var disabled,labels,labelContents;var options=this._super()||{};this._readType();labels=this.element.labels();this.label=$(labels[labels.length-1]);if(!this.label.length){$.error("No label found for checkboxradio widget");}
this.originalLabel="";labelContents=this.label.contents().not(this.element[0]);if(labelContents.length){this.originalLabel+=labelContents.clone().wrapAll("<div></div>").parent().html();}
if(this.originalLabel){options.label=this.originalLabel;}
disabled=this.element[0].disabled;if(disabled!=null){options.disabled=disabled;}
return options;},_create:function(){var checked=this.element[0].checked;this._bindFormResetHandler();if(this.options.disabled==null){this.options.disabled=this.element[0].disabled;}
this._setOption("disabled",this.options.disabled);this._addClass("ui-checkboxradio","ui-helper-hidden-accessible");this._addClass(this.label,"ui-checkboxradio-label","ui-button ui-widget");if(this.type==="radio"){this._addClass(this.label,"ui-checkboxradio-radio-label");}
if(this.options.label&&this.options.label!==this.originalLabel){this._updateLabel();}else if(this.originalLabel){this.options.label=this.originalLabel;}
this._enhance();if(checked){this._addClass(this.label,"ui-checkboxradio-checked","ui-state-active");}
this._on({change:"_toggleClasses",focus:function(){this._addClass(this.label,null,"ui-state-focus ui-visual-focus");},blur:function(){this._removeClass(this.label,null,"ui-state-focus ui-visual-focus");}});},_readType:function(){var nodeName=this.element[0].nodeName.toLowerCase();this.type=this.element[0].type;if(nodeName!=="input"||!/radio|checkbox/.test(this.type)){$.error("Can't create checkboxradio on element.nodeName="+nodeName+" and element.type="+this.type);}},_enhance:function(){this._updateIcon(this.element[0].checked);},widget:function(){return this.label;},_getRadioGroup:function(){var group;var name=this.element[0].name;var nameSelector="input[name='"+$.escapeSelector(name)+"']";if(!name){return $([]);}
if(this.form.length){group=$(this.form[0].elements).filter(nameSelector);}else{group=$(nameSelector).filter(function(){return $(this)._form().length===0;});}
return group.not(this.element);},_toggleClasses:function(){var checked=this.element[0].checked;this._toggleClass(this.label,"ui-checkboxradio-checked","ui-state-active",checked);if(this.options.icon&&this.type==="checkbox"){this._toggleClass(this.icon,null,"ui-icon-check ui-state-checked",checked)._toggleClass(this.icon,null,"ui-icon-blank",!checked);}
if(this.type==="radio"){this._getRadioGroup().each(function(){var instance=$(this).checkboxradio("instance");if(instance){instance._removeClass(instance.label,"ui-checkboxradio-checked","ui-state-active");}});}},_destroy:function(){this._unbindFormResetHandler();if(this.icon){this.icon.remove();this.iconSpace.remove();}},_setOption:function(key,value){if(key==="label"&&!value){return;}
this._super(key,value);if(key==="disabled"){this._toggleClass(this.label,null,"ui-state-disabled",value);this.element[0].disabled=value;return;}
this.refresh();},_updateIcon:function(checked){var toAdd="ui-icon ui-icon-background ";if(this.options.icon){if(!this.icon){this.icon=$("<span>");this.iconSpace=$("<span> </span>");this._addClass(this.iconSpace,"ui-checkboxradio-icon-space");}
if(this.type==="checkbox"){toAdd+=checked?"ui-icon-check ui-state-checked":"ui-icon-blank";this._removeClass(this.icon,null,checked?"ui-icon-blank":"ui-icon-check");}else{toAdd+="ui-icon-blank";}
this._addClass(this.icon,"ui-checkboxradio-icon",toAdd);if(!checked){this._removeClass(this.icon,null,"ui-icon-check ui-state-checked");}
this.icon.prependTo(this.label).after(this.iconSpace);}else if(this.icon!==undefined){this.icon.remove();this.iconSpace.remove();delete this.icon;}},_updateLabel:function(){var contents=this.label.contents().not(this.element[0]);if(this.icon){contents=contents.not(this.icon[0]);}
if(this.iconSpace){contents=contents.not(this.iconSpace[0]);}
contents.remove();this.label.append(this.options.label);},refresh:function(){var checked=this.element[0].checked,isDisabled=this.element[0].disabled;this._updateIcon(checked);this._toggleClass(this.label,"ui-checkboxradio-checked","ui-state-active",checked);if(this.options.label!==null){this._updateLabel();}
if(isDisabled!==this.options.disabled){this._setOptions({"disabled":isDisabled});}}}]);return $.ui.checkboxradio;});

View File

@@ -0,0 +1,106 @@
/*!
Chosen, a Select Box Enhancer for jQuery and Prototype
by Patrick Filler for Harvest, http://getharvest.com
Version 1.8.7
Full source at https://github.com/harvesthq/chosen
Copyright (c) 2011-2018 Harvest http://getharvest.com
MIT License, https://github.com/harvesthq/chosen/blob/master/LICENSE.md
This file is generated by `grunt build`, do not edit it by hand.
*/
define(["jquery"],function(jQuery){(function(){var $,AbstractChosen,Chosen,SelectParser,bind=function(fn,me){return function(){return fn.apply(me,arguments);};},extend=function(child,parent){for(var key in parent){if(hasProp.call(parent,key))child[key]=parent[key];}function ctor(){this.constructor=child;}ctor.prototype=parent.prototype;child.prototype=new ctor();child.__super__=parent.prototype;return child;},hasProp={}.hasOwnProperty;SelectParser=(function(){function SelectParser(){this.options_index=0;this.parsed=[];}
SelectParser.prototype.add_node=function(child){if(child.nodeName.toUpperCase()==="OPTGROUP"){return this.add_group(child);}else{return this.add_option(child);}};SelectParser.prototype.add_group=function(group){var group_position,i,len,option,ref,results1;group_position=this.parsed.length;this.parsed.push({array_index:group_position,group:true,label:group.label,title:group.title?group.title:void 0,children:0,disabled:group.disabled,classes:group.className});ref=group.childNodes;results1=[];for(i=0,len=ref.length;i<len;i++){option=ref[i];results1.push(this.add_option(option,group_position,group.disabled));}
return results1;};SelectParser.prototype.add_option=function(option,group_position,group_disabled){if(option.nodeName.toUpperCase()==="OPTION"){if(option.text!==""){if(group_position!=null){this.parsed[group_position].children+=1;}
this.parsed.push({array_index:this.parsed.length,options_index:this.options_index,value:option.value,text:option.text,html:option.innerHTML,title:option.title?option.title:void 0,selected:option.selected,disabled:group_disabled===true?group_disabled:option.disabled,group_array_index:group_position,group_label:group_position!=null?this.parsed[group_position].label:null,classes:option.className,style:option.style.cssText});}else{this.parsed.push({array_index:this.parsed.length,options_index:this.options_index,empty:true});}
return this.options_index+=1;}};return SelectParser;})();SelectParser.select_to_array=function(select){var child,i,len,parser,ref;parser=new SelectParser();ref=select.childNodes;for(i=0,len=ref.length;i<len;i++){child=ref[i];parser.add_node(child);}
return parser.parsed;};AbstractChosen=(function(){function AbstractChosen(form_field,options1){this.form_field=form_field;this.options=options1!=null?options1:{};this.label_click_handler=bind(this.label_click_handler,this);if(!AbstractChosen.browser_is_supported()){return;}
this.is_multiple=this.form_field.multiple;this.set_default_text();this.set_default_values();this.setup();this.set_up_html();this.register_observers();this.on_ready();}
AbstractChosen.prototype.set_default_values=function(){this.click_test_action=(function(_this){return function(evt){return _this.test_active_click(evt);};})(this);this.activate_action=(function(_this){return function(evt){return _this.activate_field(evt);};})(this);this.active_field=false;this.mouse_on_container=false;this.results_showing=false;this.result_highlighted=null;this.is_rtl=this.options.rtl||/\bchosen-rtl\b/.test(this.form_field.className);this.allow_single_deselect=(this.options.allow_single_deselect!=null)&&(this.form_field.options[0]!=null)&&this.form_field.options[0].text===""?this.options.allow_single_deselect:false;this.disable_search_threshold=this.options.disable_search_threshold||0;this.disable_search=this.options.disable_search||false;this.enable_split_word_search=this.options.enable_split_word_search!=null?this.options.enable_split_word_search:true;this.group_search=this.options.group_search!=null?this.options.group_search:true;this.search_contains=this.options.search_contains||false;this.single_backstroke_delete=this.options.single_backstroke_delete!=null?this.options.single_backstroke_delete:true;this.max_selected_options=this.options.max_selected_options||Infinity;this.inherit_select_classes=this.options.inherit_select_classes||false;this.display_selected_options=this.options.display_selected_options!=null?this.options.display_selected_options:true;this.display_disabled_options=this.options.display_disabled_options!=null?this.options.display_disabled_options:true;this.include_group_label_in_selected=this.options.include_group_label_in_selected||false;this.max_shown_results=this.options.max_shown_results||Number.POSITIVE_INFINITY;this.case_sensitive_search=this.options.case_sensitive_search||false;return this.hide_results_on_select=this.options.hide_results_on_select!=null?this.options.hide_results_on_select:true;};AbstractChosen.prototype.set_default_text=function(){if(this.form_field.getAttribute("data-placeholder")){this.default_text=this.form_field.getAttribute("data-placeholder");}else if(this.is_multiple){this.default_text=this.options.placeholder_text_multiple||this.options.placeholder_text||AbstractChosen.default_multiple_text;}else{this.default_text=this.options.placeholder_text_single||this.options.placeholder_text||AbstractChosen.default_single_text;}
this.default_text=this.escape_html(this.default_text);return this.results_none_found=this.form_field.getAttribute("data-no_results_text")||this.options.no_results_text||AbstractChosen.default_no_result_text;};AbstractChosen.prototype.choice_label=function(item){if(this.include_group_label_in_selected&&(item.group_label!=null)){return"<b class='group-name'>"+(this.escape_html(item.group_label))+"</b>"+item.html;}else{return item.html;}};AbstractChosen.prototype.mouse_enter=function(){return this.mouse_on_container=true;};AbstractChosen.prototype.mouse_leave=function(){return this.mouse_on_container=false;};AbstractChosen.prototype.input_focus=function(evt){if(this.is_multiple){if(!this.active_field){return setTimeout(((function(_this){return function(){return _this.container_mousedown();};})(this)),50);}}else{if(!this.active_field){return this.activate_field();}}};AbstractChosen.prototype.input_blur=function(evt){if(!this.mouse_on_container){this.active_field=false;return setTimeout(((function(_this){return function(){return _this.blur_test();};})(this)),100);}};AbstractChosen.prototype.label_click_handler=function(evt){if(this.is_multiple){return this.container_mousedown(evt);}else{return this.activate_field();}};AbstractChosen.prototype.results_option_build=function(options){var content,data,data_content,i,len,ref,shown_results;content='';shown_results=0;ref=this.results_data;for(i=0,len=ref.length;i<len;i++){data=ref[i];data_content='';if(data.group){data_content=this.result_add_group(data);}else{data_content=this.result_add_option(data);}
if(data_content!==''){shown_results++;content+=data_content;}
if(options!=null?options.first:void 0){if(data.selected&&this.is_multiple){this.choice_build(data);}else if(data.selected&&!this.is_multiple){this.single_set_selected_text(this.choice_label(data));}}
if(shown_results>=this.max_shown_results){break;}}
return content;};AbstractChosen.prototype.result_add_option=function(option){var classes,option_el;if(!option.search_match){return'';}
if(!this.include_option_in_results(option)){return'';}
classes=[];if(!option.disabled&&!(option.selected&&this.is_multiple)){classes.push("active-result");}
if(option.disabled&&!(option.selected&&this.is_multiple)){classes.push("disabled-result");}
if(option.selected){classes.push("result-selected");}
if(option.group_array_index!=null){classes.push("group-option");}
if(option.classes!==""){classes.push(option.classes);}
option_el=document.createElement("li");option_el.className=classes.join(" ");if(option.style){option_el.style.cssText=option.style;}
option_el.setAttribute("data-option-array-index",option.array_index);option_el.innerHTML=option.highlighted_html||option.html;if(option.title){option_el.title=option.title;}
return this.outerHTML(option_el);};AbstractChosen.prototype.result_add_group=function(group){var classes,group_el;if(!(group.search_match||group.group_match)){return'';}
if(!(group.active_options>0)){return'';}
classes=[];classes.push("group-result");if(group.classes){classes.push(group.classes);}
group_el=document.createElement("li");group_el.className=classes.join(" ");group_el.innerHTML=group.highlighted_html||this.escape_html(group.label);if(group.title){group_el.title=group.title;}
return this.outerHTML(group_el);};AbstractChosen.prototype.results_update_field=function(){this.set_default_text();if(!this.is_multiple){this.results_reset_cleanup();}
this.result_clear_highlight();this.results_build();if(this.results_showing){return this.winnow_results();}};AbstractChosen.prototype.reset_single_select_options=function(){var i,len,ref,result,results1;ref=this.results_data;results1=[];for(i=0,len=ref.length;i<len;i++){result=ref[i];if(result.selected){results1.push(result.selected=false);}else{results1.push(void 0);}}
return results1;};AbstractChosen.prototype.results_toggle=function(){if(this.results_showing){return this.results_hide();}else{return this.results_show();}};AbstractChosen.prototype.results_search=function(evt){if(this.results_showing){return this.winnow_results();}else{return this.results_show();}};AbstractChosen.prototype.winnow_results=function(options){var escapedQuery,fix,i,len,option,prefix,query,ref,regex,results,results_group,search_match,startpos,suffix,text;this.no_results_clear();results=0;query=this.get_search_text();escapedQuery=query.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&");regex=this.get_search_regex(escapedQuery);ref=this.results_data;for(i=0,len=ref.length;i<len;i++){option=ref[i];option.search_match=false;results_group=null;search_match=null;option.highlighted_html='';if(this.include_option_in_results(option)){if(option.group){option.group_match=false;option.active_options=0;}
if((option.group_array_index!=null)&&this.results_data[option.group_array_index]){results_group=this.results_data[option.group_array_index];if(results_group.active_options===0&&results_group.search_match){results+=1;}
results_group.active_options+=1;}
text=option.group?option.label:option.text;if(!(option.group&&!this.group_search)){search_match=this.search_string_match(text,regex);option.search_match=search_match!=null;if(option.search_match&&!option.group){results+=1;}
if(option.search_match){if(query.length){startpos=search_match.index;prefix=text.slice(0,startpos);fix=text.slice(startpos,startpos+query.length);suffix=text.slice(startpos+query.length);option.highlighted_html=(this.escape_html(prefix))+"<em>"+(this.escape_html(fix))+"</em>"+(this.escape_html(suffix));}
if(results_group!=null){results_group.group_match=true;}}else if((option.group_array_index!=null)&&this.results_data[option.group_array_index].search_match){option.search_match=true;}}}}
this.result_clear_highlight();if(results<1&&query.length){this.update_results_content("");return this.no_results(query);}else{this.update_results_content(this.results_option_build());if(!(options!=null?options.skip_highlight:void 0)){return this.winnow_results_set_highlight();}}};AbstractChosen.prototype.get_search_regex=function(escaped_search_string){var regex_flag,regex_string;regex_string=this.search_contains?escaped_search_string:"(^|\\s|\\b)"+escaped_search_string+"[^\\s]*";if(!(this.enable_split_word_search||this.search_contains)){regex_string="^"+regex_string;}
regex_flag=this.case_sensitive_search?"":"i";return new RegExp(regex_string,regex_flag);};AbstractChosen.prototype.search_string_match=function(search_string,regex){var match;match=regex.exec(search_string);if(!this.search_contains&&(match!=null?match[1]:void 0)){match.index+=1;}
return match;};AbstractChosen.prototype.choices_count=function(){var i,len,option,ref;if(this.selected_option_count!=null){return this.selected_option_count;}
this.selected_option_count=0;ref=this.form_field.options;for(i=0,len=ref.length;i<len;i++){option=ref[i];if(option.selected){this.selected_option_count+=1;}}
return this.selected_option_count;};AbstractChosen.prototype.choices_click=function(evt){evt.preventDefault();this.activate_field();if(!(this.results_showing||this.is_disabled)){return this.results_show();}};AbstractChosen.prototype.keydown_checker=function(evt){var ref,stroke;stroke=(ref=evt.which)!=null?ref:evt.keyCode;this.search_field_scale();if(stroke!==8&&this.pending_backstroke){this.clear_backstroke();}
switch(stroke){case 8:this.backstroke_length=this.get_search_field_value().length;break;case 9:if(this.results_showing&&!this.is_multiple){this.result_select(evt);}
this.mouse_on_container=false;break;case 13:if(this.results_showing){evt.preventDefault();}
break;case 27:if(this.results_showing){evt.preventDefault();}
break;case 32:if(this.disable_search){evt.preventDefault();}
break;case 38:evt.preventDefault();this.keyup_arrow();break;case 40:evt.preventDefault();this.keydown_arrow();break;}};AbstractChosen.prototype.keyup_checker=function(evt){var ref,stroke;stroke=(ref=evt.which)!=null?ref:evt.keyCode;this.search_field_scale();switch(stroke){case 8:if(this.is_multiple&&this.backstroke_length<1&&this.choices_count()>0){this.keydown_backstroke();}else if(!this.pending_backstroke){this.result_clear_highlight();this.results_search();}
break;case 13:evt.preventDefault();if(this.results_showing){this.result_select(evt);}
break;case 27:if(this.results_showing){this.results_hide();}
break;case 9:case 16:case 17:case 18:case 38:case 40:case 91:break;default:this.results_search();break;}};AbstractChosen.prototype.clipboard_event_checker=function(evt){if(this.is_disabled){return;}
return setTimeout(((function(_this){return function(){return _this.results_search();};})(this)),50);};AbstractChosen.prototype.container_width=function(){if(this.options.width!=null){return this.options.width;}else{return this.form_field.offsetWidth+"px";}};AbstractChosen.prototype.include_option_in_results=function(option){if(this.is_multiple&&(!this.display_selected_options&&option.selected)){return false;}
if(!this.display_disabled_options&&option.disabled){return false;}
if(option.empty){return false;}
return true;};AbstractChosen.prototype.search_results_touchstart=function(evt){this.touch_started=true;return this.search_results_mouseover(evt);};AbstractChosen.prototype.search_results_touchmove=function(evt){this.touch_started=false;return this.search_results_mouseout(evt);};AbstractChosen.prototype.search_results_touchend=function(evt){if(this.touch_started){return this.search_results_mouseup(evt);}};AbstractChosen.prototype.outerHTML=function(element){var tmp;if(element.outerHTML){return element.outerHTML;}
tmp=document.createElement("div");tmp.appendChild(element);return tmp.innerHTML;};AbstractChosen.prototype.get_single_html=function(){return"<a class=\"chosen-single chosen-default\">\n <span>"+this.default_text+"</span>\n <div><b></b></div>\n</a>\n<div class=\"chosen-drop\">\n <div class=\"chosen-search\">\n <input class=\"chosen-search-input\" type=\"text\" autocomplete=\"off\" />\n </div>\n <ul class=\"chosen-results\"></ul>\n</div>";};AbstractChosen.prototype.get_multi_html=function(){return"<ul class=\"chosen-choices\">\n <li class=\"search-field\">\n <input class=\"chosen-search-input\" type=\"text\" autocomplete=\"off\" value=\""+this.default_text+"\" />\n </li>\n</ul>\n<div class=\"chosen-drop\">\n <ul class=\"chosen-results\"></ul>\n</div>";};AbstractChosen.prototype.get_no_results_html=function(terms){return"<li class=\"no-results\">\n "+this.results_none_found+" <span>"+(this.escape_html(terms))+"</span>\n</li>";};AbstractChosen.browser_is_supported=function(){if("Microsoft Internet Explorer"===window.navigator.appName){return document.documentMode>=8;}
if(/iP(od|hone)/i.test(window.navigator.userAgent)||/IEMobile/i.test(window.navigator.userAgent)||/Windows Phone/i.test(window.navigator.userAgent)||/BlackBerry/i.test(window.navigator.userAgent)||/BB10/i.test(window.navigator.userAgent)||/Android.*Mobile/i.test(window.navigator.userAgent)){return false;}
return true;};AbstractChosen.default_multiple_text="Select Some Options";AbstractChosen.default_single_text="Select an Option";AbstractChosen.default_no_result_text="No results match";return AbstractChosen;})();$=jQuery;$.fn.extend({chosen:function(options){if(!AbstractChosen.browser_is_supported()){return this;}
return this.each(function(input_field){var $this,chosen;$this=$(this);chosen=$this.data('chosen');if(options==='destroy'){if(chosen instanceof Chosen){chosen.destroy();}
return;}
if(!(chosen instanceof Chosen)){$this.data('chosen',new Chosen(this,options));}});}});Chosen=(function(superClass){extend(Chosen,superClass);function Chosen(){return Chosen.__super__.constructor.apply(this,arguments);}
Chosen.prototype.setup=function(){this.form_field_jq=$(this.form_field);return this.current_selectedIndex=this.form_field.selectedIndex;};Chosen.prototype.set_up_html=function(){var container_classes,container_props;container_classes=["chosen-container"];container_classes.push("chosen-container-"+(this.is_multiple?"multi":"single"));if(this.inherit_select_classes&&this.form_field.className){container_classes.push(this.form_field.className);}
if(this.is_rtl){container_classes.push("chosen-rtl");}
container_props={'class':container_classes.join(' '),'title':this.form_field.title};if(this.form_field.id.length){container_props.id=this.form_field.id.replace(/[^\w]/g,'_')+"_chosen";}
this.container=$("<div>",container_props);this.container.width(this.container_width());if(this.is_multiple){this.container.html(this.get_multi_html());}else{this.container.html(this.get_single_html());}
this.form_field_jq.hide().after(this.container);this.dropdown=this.container.find('div.chosen-drop').first();this.search_field=this.container.find('input').first();this.search_results=this.container.find('ul.chosen-results').first();this.search_field_scale();this.search_no_results=this.container.find('li.no-results').first();if(this.is_multiple){this.search_choices=this.container.find('ul.chosen-choices').first();this.search_container=this.container.find('li.search-field').first();}else{this.search_container=this.container.find('div.chosen-search').first();this.selected_item=this.container.find('.chosen-single').first();}
this.results_build();this.set_tab_index();return this.set_label_behavior();};Chosen.prototype.on_ready=function(){return this.form_field_jq.trigger("chosen:ready",{chosen:this});};Chosen.prototype.register_observers=function(){this.container.on('touchstart.chosen',(function(_this){return function(evt){_this.container_mousedown(evt);};})(this));this.container.on('touchend.chosen',(function(_this){return function(evt){_this.container_mouseup(evt);};})(this));this.container.on('mousedown.chosen',(function(_this){return function(evt){_this.container_mousedown(evt);};})(this));this.container.on('mouseup.chosen',(function(_this){return function(evt){_this.container_mouseup(evt);};})(this));this.container.on('mouseenter.chosen',(function(_this){return function(evt){_this.mouse_enter(evt);};})(this));this.container.on('mouseleave.chosen',(function(_this){return function(evt){_this.mouse_leave(evt);};})(this));this.search_results.on('mouseup.chosen',(function(_this){return function(evt){_this.search_results_mouseup(evt);};})(this));this.search_results.on('mouseover.chosen',(function(_this){return function(evt){_this.search_results_mouseover(evt);};})(this));this.search_results.on('mouseout.chosen',(function(_this){return function(evt){_this.search_results_mouseout(evt);};})(this));this.search_results.on('mousewheel.chosen DOMMouseScroll.chosen',(function(_this){return function(evt){_this.search_results_mousewheel(evt);};})(this));this.search_results.on('touchstart.chosen',(function(_this){return function(evt){_this.search_results_touchstart(evt);};})(this));this.search_results.on('touchmove.chosen',(function(_this){return function(evt){_this.search_results_touchmove(evt);};})(this));this.search_results.on('touchend.chosen',(function(_this){return function(evt){_this.search_results_touchend(evt);};})(this));this.form_field_jq.on("chosen:updated.chosen",(function(_this){return function(evt){_this.results_update_field(evt);};})(this));this.form_field_jq.on("chosen:activate.chosen",(function(_this){return function(evt){_this.activate_field(evt);};})(this));this.form_field_jq.on("chosen:open.chosen",(function(_this){return function(evt){_this.container_mousedown(evt);};})(this));this.form_field_jq.on("chosen:close.chosen",(function(_this){return function(evt){_this.close_field(evt);};})(this));this.search_field.on('blur.chosen',(function(_this){return function(evt){_this.input_blur(evt);};})(this));this.search_field.on('keyup.chosen',(function(_this){return function(evt){_this.keyup_checker(evt);};})(this));this.search_field.on('keydown.chosen',(function(_this){return function(evt){_this.keydown_checker(evt);};})(this));this.search_field.on('focus.chosen',(function(_this){return function(evt){_this.input_focus(evt);};})(this));this.search_field.on('cut.chosen',(function(_this){return function(evt){_this.clipboard_event_checker(evt);};})(this));this.search_field.on('paste.chosen',(function(_this){return function(evt){_this.clipboard_event_checker(evt);};})(this));if(this.is_multiple){return this.search_choices.on('click.chosen',(function(_this){return function(evt){_this.choices_click(evt);};})(this));}else{return this.container.on('click.chosen',function(evt){evt.preventDefault();});}};Chosen.prototype.destroy=function(){$(this.container[0].ownerDocument).off('click.chosen',this.click_test_action);if(this.form_field_label.length>0){this.form_field_label.off('click.chosen');}
if(this.search_field[0].tabIndex){this.form_field_jq[0].tabIndex=this.search_field[0].tabIndex;}
this.container.remove();this.form_field_jq.removeData('chosen');return this.form_field_jq.show();};Chosen.prototype.search_field_disabled=function(){this.is_disabled=this.form_field.disabled||this.form_field_jq.parents('fieldset').is(':disabled');this.container.toggleClass('chosen-disabled',this.is_disabled);this.search_field[0].disabled=this.is_disabled;if(!this.is_multiple){this.selected_item.off('focus.chosen',this.activate_field);}
if(this.is_disabled){return this.close_field();}else if(!this.is_multiple){return this.selected_item.on('focus.chosen',this.activate_field);}};Chosen.prototype.container_mousedown=function(evt){var ref;if(this.is_disabled){return;}
if(evt&&((ref=evt.type)==='mousedown'||ref==='touchstart')&&!this.results_showing){evt.preventDefault();}
if(!((evt!=null)&&($(evt.target)).hasClass("search-choice-close"))){if(!this.active_field){if(this.is_multiple){this.search_field.val("");}
$(this.container[0].ownerDocument).on('click.chosen',this.click_test_action);this.results_show();}else if(!this.is_multiple&&evt&&(($(evt.target)[0]===this.selected_item[0])||$(evt.target).parents("a.chosen-single").length)){evt.preventDefault();this.results_toggle();}
return this.activate_field();}};Chosen.prototype.container_mouseup=function(evt){if(evt.target.nodeName==="ABBR"&&!this.is_disabled){return this.results_reset(evt);}};Chosen.prototype.search_results_mousewheel=function(evt){var delta;if(evt.originalEvent){delta=evt.originalEvent.deltaY||-evt.originalEvent.wheelDelta||evt.originalEvent.detail;}
if(delta!=null){evt.preventDefault();if(evt.type==='DOMMouseScroll'){delta=delta*40;}
return this.search_results.scrollTop(delta+this.search_results.scrollTop());}};Chosen.prototype.blur_test=function(evt){if(!this.active_field&&this.container.hasClass("chosen-container-active")){return this.close_field();}};Chosen.prototype.close_field=function(){$(this.container[0].ownerDocument).off("click.chosen",this.click_test_action);this.active_field=false;this.results_hide();this.container.removeClass("chosen-container-active");this.clear_backstroke();this.show_search_field_default();this.search_field_scale();return this.search_field.blur();};Chosen.prototype.activate_field=function(){if(this.is_disabled){return;}
this.container.addClass("chosen-container-active");this.active_field=true;this.search_field.val(this.search_field.val());return this.search_field.focus();};Chosen.prototype.test_active_click=function(evt){var active_container;active_container=$(evt.target).closest('.chosen-container');if(active_container.length&&this.container[0]===active_container[0]){return this.active_field=true;}else{return this.close_field();}};Chosen.prototype.results_build=function(){this.parsing=true;this.selected_option_count=null;this.results_data=SelectParser.select_to_array(this.form_field);if(this.is_multiple){this.search_choices.find("li.search-choice").remove();}else{this.single_set_selected_text();if(this.disable_search||this.form_field.options.length<=this.disable_search_threshold){this.search_field[0].readOnly=true;this.container.addClass("chosen-container-single-nosearch");}else{this.search_field[0].readOnly=false;this.container.removeClass("chosen-container-single-nosearch");}}
this.update_results_content(this.results_option_build({first:true}));this.search_field_disabled();this.show_search_field_default();this.search_field_scale();return this.parsing=false;};Chosen.prototype.result_do_highlight=function(el){var high_bottom,high_top,maxHeight,visible_bottom,visible_top;if(el.length){this.result_clear_highlight();this.result_highlight=el;this.result_highlight.addClass("highlighted");maxHeight=parseInt(this.search_results.css("maxHeight"),10);visible_top=this.search_results.scrollTop();visible_bottom=maxHeight+visible_top;high_top=this.result_highlight.position().top+this.search_results.scrollTop();high_bottom=high_top+this.result_highlight.outerHeight();if(high_bottom>=visible_bottom){return this.search_results.scrollTop((high_bottom-maxHeight)>0?high_bottom-maxHeight:0);}else if(high_top<visible_top){return this.search_results.scrollTop(high_top);}}};Chosen.prototype.result_clear_highlight=function(){if(this.result_highlight){this.result_highlight.removeClass("highlighted");}
return this.result_highlight=null;};Chosen.prototype.results_show=function(){if(this.is_multiple&&this.max_selected_options<=this.choices_count()){this.form_field_jq.trigger("chosen:maxselected",{chosen:this});return false;}
this.container.addClass("chosen-with-drop");this.results_showing=true;this.search_field.focus();this.search_field.val(this.get_search_field_value());this.winnow_results();return this.form_field_jq.trigger("chosen:showing_dropdown",{chosen:this});};Chosen.prototype.update_results_content=function(content){return this.search_results.html(content);};Chosen.prototype.results_hide=function(){if(this.results_showing){this.result_clear_highlight();this.container.removeClass("chosen-with-drop");this.form_field_jq.trigger("chosen:hiding_dropdown",{chosen:this});}
return this.results_showing=false;};Chosen.prototype.set_tab_index=function(el){var ti;if(this.form_field.tabIndex){ti=this.form_field.tabIndex;this.form_field.tabIndex=-1;return this.search_field[0].tabIndex=ti;}};Chosen.prototype.set_label_behavior=function(){this.form_field_label=this.form_field_jq.parents("label");if(!this.form_field_label.length&&this.form_field.id.length){this.form_field_label=$("label[for='"+this.form_field.id+"']");}
if(this.form_field_label.length>0){return this.form_field_label.on('click.chosen',this.label_click_handler);}};Chosen.prototype.show_search_field_default=function(){if(this.is_multiple&&this.choices_count()<1&&!this.active_field){this.search_field.val(this.default_text);return this.search_field.addClass("default");}else{this.search_field.val("");return this.search_field.removeClass("default");}};Chosen.prototype.search_results_mouseup=function(evt){var target;target=$(evt.target).hasClass("active-result")?$(evt.target):$(evt.target).parents(".active-result").first();if(target.length){this.result_highlight=target;this.result_select(evt);return this.search_field.focus();}};Chosen.prototype.search_results_mouseover=function(evt){var target;target=$(evt.target).hasClass("active-result")?$(evt.target):$(evt.target).parents(".active-result").first();if(target){return this.result_do_highlight(target);}};Chosen.prototype.search_results_mouseout=function(evt){if($(evt.target).hasClass("active-result")||$(evt.target).parents('.active-result').first()){return this.result_clear_highlight();}};Chosen.prototype.choice_build=function(item){var choice,close_link;choice=$('<li>',{"class":"search-choice"}).html("<span>"+(this.choice_label(item))+"</span>");if(item.disabled){choice.addClass('search-choice-disabled');}else{close_link=$('<a />',{"class":'search-choice-close','data-option-array-index':item.array_index});close_link.on('click.chosen',(function(_this){return function(evt){return _this.choice_destroy_link_click(evt);};})(this));choice.append(close_link);}
return this.search_container.before(choice);};Chosen.prototype.choice_destroy_link_click=function(evt){evt.preventDefault();evt.stopPropagation();if(!this.is_disabled){return this.choice_destroy($(evt.target));}};Chosen.prototype.choice_destroy=function(link){if(this.result_deselect(link[0].getAttribute("data-option-array-index"))){if(this.active_field){this.search_field.focus();}else{this.show_search_field_default();}
if(this.is_multiple&&this.choices_count()>0&&this.get_search_field_value().length<1){this.results_hide();}
link.parents('li').first().remove();return this.search_field_scale();}};Chosen.prototype.results_reset=function(){this.reset_single_select_options();this.form_field.options[0].selected=true;this.single_set_selected_text();this.show_search_field_default();this.results_reset_cleanup();this.trigger_form_field_change();if(this.active_field){return this.results_hide();}};Chosen.prototype.results_reset_cleanup=function(){this.current_selectedIndex=this.form_field.selectedIndex;return this.selected_item.find("abbr").remove();};Chosen.prototype.result_select=function(evt){var high,item;if(this.result_highlight){high=this.result_highlight;this.result_clear_highlight();if(this.is_multiple&&this.max_selected_options<=this.choices_count()){this.form_field_jq.trigger("chosen:maxselected",{chosen:this});return false;}
if(this.is_multiple){high.removeClass("active-result");}else{this.reset_single_select_options();}
high.addClass("result-selected");item=this.results_data[high[0].getAttribute("data-option-array-index")];item.selected=true;this.form_field.options[item.options_index].selected=true;this.selected_option_count=null;if(this.is_multiple){this.choice_build(item);}else{this.single_set_selected_text(this.choice_label(item));}
if(this.is_multiple&&(!this.hide_results_on_select||(evt.metaKey||evt.ctrlKey))){if(evt.metaKey||evt.ctrlKey){this.winnow_results({skip_highlight:true});}else{this.search_field.val("");this.winnow_results();}}else{this.results_hide();this.show_search_field_default();}
if(this.is_multiple||this.form_field.selectedIndex!==this.current_selectedIndex){this.trigger_form_field_change({selected:this.form_field.options[item.options_index].value});}
this.current_selectedIndex=this.form_field.selectedIndex;evt.preventDefault();return this.search_field_scale();}};Chosen.prototype.single_set_selected_text=function(text){if(text==null){text=this.default_text;}
if(text===this.default_text){this.selected_item.addClass("chosen-default");}else{this.single_deselect_control_build();this.selected_item.removeClass("chosen-default");}
return this.selected_item.find("span").html(text);};Chosen.prototype.result_deselect=function(pos){var result_data;result_data=this.results_data[pos];if(!this.form_field.options[result_data.options_index].disabled){result_data.selected=false;this.form_field.options[result_data.options_index].selected=false;this.selected_option_count=null;this.result_clear_highlight();if(this.results_showing){this.winnow_results();}
this.trigger_form_field_change({deselected:this.form_field.options[result_data.options_index].value});this.search_field_scale();return true;}else{return false;}};Chosen.prototype.single_deselect_control_build=function(){if(!this.allow_single_deselect){return;}
if(!this.selected_item.find("abbr").length){this.selected_item.find("span").first().after("<abbr class=\"search-choice-close\"></abbr>");}
return this.selected_item.addClass("chosen-single-with-deselect");};Chosen.prototype.get_search_field_value=function(){return this.search_field.val();};Chosen.prototype.get_search_text=function(){return $.trim(this.get_search_field_value());};Chosen.prototype.escape_html=function(text){return $('<div>').text(text).html();};Chosen.prototype.winnow_results_set_highlight=function(){var do_high,selected_results;selected_results=!this.is_multiple?this.search_results.find(".result-selected.active-result"):[];do_high=selected_results.length?selected_results.first():this.search_results.find(".active-result").first();if(do_high!=null){return this.result_do_highlight(do_high);}};Chosen.prototype.no_results=function(terms){var no_results_html;no_results_html=this.get_no_results_html(terms);this.search_results.append(no_results_html);return this.form_field_jq.trigger("chosen:no_results",{chosen:this});};Chosen.prototype.no_results_clear=function(){return this.search_results.find(".no-results").remove();};Chosen.prototype.keydown_arrow=function(){var next_sib;if(this.results_showing&&this.result_highlight){next_sib=this.result_highlight.nextAll("li.active-result").first();if(next_sib){return this.result_do_highlight(next_sib);}}else{return this.results_show();}};Chosen.prototype.keyup_arrow=function(){var prev_sibs;if(!this.results_showing&&!this.is_multiple){return this.results_show();}else if(this.result_highlight){prev_sibs=this.result_highlight.prevAll("li.active-result");if(prev_sibs.length){return this.result_do_highlight(prev_sibs.first());}else{if(this.choices_count()>0){this.results_hide();}
return this.result_clear_highlight();}}};Chosen.prototype.keydown_backstroke=function(){var next_available_destroy;if(this.pending_backstroke){this.choice_destroy(this.pending_backstroke.find("a").first());return this.clear_backstroke();}else{next_available_destroy=this.search_container.siblings("li.search-choice").last();if(next_available_destroy.length&&!next_available_destroy.hasClass("search-choice-disabled")){this.pending_backstroke=next_available_destroy;if(this.single_backstroke_delete){return this.keydown_backstroke();}else{return this.pending_backstroke.addClass("search-choice-focus");}}}};Chosen.prototype.clear_backstroke=function(){if(this.pending_backstroke){this.pending_backstroke.removeClass("search-choice-focus");}
return this.pending_backstroke=null;};Chosen.prototype.search_field_scale=function(){var div,i,len,style,style_block,styles,width;if(!this.is_multiple){return;}
style_block={position:'absolute',left:'-1000px',top:'-1000px',display:'none',whiteSpace:'pre'};styles=['fontSize','fontStyle','fontWeight','fontFamily','lineHeight','textTransform','letterSpacing'];for(i=0,len=styles.length;i<len;i++){style=styles[i];style_block[style]=this.search_field.css(style);}
div=$('<div>').css(style_block);div.text(this.get_search_field_value());$('body').append(div);width=div.width()+25;div.remove();if(this.container.is(':visible')){width=Math.min(this.container.outerWidth()-10,width);}
return this.search_field.width(width);};Chosen.prototype.trigger_form_field_change=function(extra){this.form_field_jq.trigger("input",extra);return this.form_field_jq.trigger("change",extra);};return Chosen;})(AbstractChosen);}).call(this);});

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,6 @@
define(['underscore','mageUtils','mage/utils/wrapper'],function(_,utils,wrapper){'use strict';var Class;function getOwn(obj,prop){return _.isObject(obj)&&obj.hasOwnProperty(prop)&&obj[prop];}
function createConstructor(protoProps,constructor){var UiClass=constructor;if(!UiClass){UiClass=function(){var obj=this;if(!_.isObject(obj)||Object.getPrototypeOf(obj)!==UiClass.prototype){obj=Object.create(UiClass.prototype);}
obj.initialize.apply(obj,arguments);return obj;};}
UiClass.prototype=protoProps;UiClass.prototype.constructor=UiClass;return UiClass;}
Class=createConstructor({initialize:function(options){this.initConfig(options);return this;},initConfig:function(options){var defaults=this.constructor.defaults,config=utils.extend({},defaults,options||{}),ignored=config.ignoreTmpls||{},cached=utils.omit(config,ignored);config=utils.template(config,this,false,true);_.each(cached,function(value,key){utils.nested(config,key,value);});return _.extend(this,config);}});_.extend(Class,{defaults:{ignoreTmpls:{templates:true}},extend:function(extender){var parent=this,parentProto=parent.prototype,childProto=Object.create(parentProto),child=createConstructor(childProto,getOwn(extender,'constructor')),defaults;extender=extender||{};defaults=extender.defaults;delete extender.defaults;_.each(extender,function(method,name){childProto[name]=wrapper.wrapSuper(parentProto[name],method);});child.defaults=utils.extend({},parent.defaults||{});if(defaults){utils.extend(child.defaults,defaults);extender.defaults=defaults;}
return _.extend(child,{__super__:parentProto,extend:parent.extend});}});return Class;});

View File

@@ -0,0 +1,40 @@
define(['jquery','jquery-ui-modules/widget','jquery-ui-modules/core','jquery/jquery-storageapi','mage/mage'],function($){'use strict';var hideProps={},showProps={};hideProps.height='hide';showProps.height='show';$.widget('mage.collapsible',{options:{active:false,disabled:false,collapsible:true,header:'[data-role=title]',content:'[data-role=content]',trigger:'[data-role=trigger]',closedState:null,openedState:null,disabledState:null,ajaxUrlElement:'[data-ajax=true]',ajaxContent:false,loadingClass:null,saveState:false,animate:false,icons:{activeHeader:null,header:null},collateral:{element:null,openedState:null}},_create:function(){this.storage=$.localStorage;this.icons=false;if(typeof this.options.icons==='string'){this.options.icons=JSON.parse(this.options.icons);}
this._processPanels();this._processState();this._refresh();if(this.options.icons.header&&this.options.icons.activeHeader){this._createIcons();this.icons=true;}
this.element.on('dimensionsChanged',function(e){if(e.target&&e.target.classList.contains('active')){this._scrollToTopIfNotVisible();}}.bind(this));this._bind('click');this._trigger('created');},_refresh:function(){this.trigger.attr('tabIndex',0);if(this.options.active&&!this.options.disabled){if(this.options.openedState){this.element.addClass(this.options.openedState);}
if(this.options.collateral.element&&this.options.collateral.openedState){$(this.options.collateral.element).addClass(this.options.collateral.openedState);}
if(this.options.ajaxContent){this._loadContent();}
this.header.attr({'aria-selected':false});}else if(this.options.disabled){this.disable();}else{this.content.hide();if(this.options.closedState){this.element.addClass(this.options.closedState);}}},_processState:function(){var anchor=window.location.hash,isValid=$.mage.isValidSelector(anchor),urlPath=window.location.pathname.replace(/\./g,''),state;this.stateKey=encodeURIComponent(urlPath+this.element.attr('id'));if(isValid&&($(this.content.find(anchor)).length>0||this.content.attr('id')===anchor.replace('#',''))){this.element.parents('[data-collapsible=true]').collapsible('forceActivate');if(!this.options.disabled){this.options.active=true;if(this.options.saveState){this.storage.set(this.stateKey,true);}}}else if(this.options.saveState&&!this.options.disabled){state=this.storage.get(this.stateKey);if(typeof state==='undefined'||state===null){this.storage.set(this.stateKey,this.options.active);}else if(state===true){this.options.active=true;}else if(state===false){this.options.active=false;}}},_createIcons:function(){var icons=this.options.icons;if(icons){$('<span>').addClass(icons.header).attr('data-role','icons').prependTo(this.header);if(this.options.active&&!this.options.disabled){this.header.children('[data-role=icons]').removeClass(icons.header).addClass(icons.activeHeader);}}},_destroyIcons:function(){this.header.children('[data-role=icons]').remove();},_destroy:function(){var options=this.options;this.element.removeAttr('data-collapsible');this.trigger.removeAttr('tabIndex');if(options.openedState){this.element.removeClass(options.openedState);}
if(this.options.collateral.element&&this.options.collateral.openedState){$(this.options.collateral.element).removeClass(this.options.collateral.openedState);}
if(options.closedState){this.element.removeClass(options.closedState);}
if(options.disabledState){this.element.removeClass(options.disabledState);}
if(this.icons){this._destroyIcons();}},_processPanels:function(){var headers,triggers;this.element.attr('data-collapsible','true');if(typeof this.options.header==='object'){this.header=this.options.header;}else{headers=this.element.find(this.options.header);if(headers.length>0){this.header=headers.eq(0);}else{this.header=this.element;}}
if(typeof this.options.content==='object'){this.content=this.options.content;}else{this.content=this.header.next(this.options.content).eq(0);}
if(this.header.attr('id')){this.content.attr('aria-labelledby',this.header.attr('id'));}
if(this.content.attr('id')){this.header.attr('aria-controls',this.content.attr('id'));}
this.header.attr({'role':'tab','aria-selected':this.options.active,'aria-expanded':this.options.active});if(this.header.parent().attr('role')!=='presentation'){this.header.parent().attr('role','tablist');}
this.content.attr({'role':'tabpanel','aria-hidden':!this.options.active});if(typeof this.options.trigger==='object'){this.trigger=this.options.trigger;}else{triggers=this.header.find(this.options.trigger);if(triggers.length>0){this.trigger=triggers.eq(0);}else{this.trigger=this.header;}}},_keydown:function(event){var keyCode;if(event.altKey||event.ctrlKey){return;}
keyCode=$.ui.keyCode;switch(event.keyCode){case keyCode.SPACE:case keyCode.ENTER:this._eventHandler(event);break;}},_bind:function(event){var self=this;this.events={keydown:'_keydown'};if(event){$.each(event.split(' '),function(index,eventName){self.events[eventName]='_eventHandler';});}
this._off(this.trigger);if(!this.options.disabled){this._on(this.trigger,this.events);}},disable:function(){this.options.disabled=true;this._off(this.trigger);this.forceDeactivate();if(this.options.disabledState){this.element.addClass(this.options.disabledState);}
this.trigger.attr('tabIndex',-1);},enable:function(){this.options.disabled=false;this._on(this.trigger,this.events);this.forceActivate();if(this.options.disabledState){this.element.removeClass(this.options.disabledState);}
this.trigger.attr('tabIndex',0);},_eventHandler:function(event){if(this.options.active&&this.options.collapsible){this.deactivate();}else{this.activate();}
event.preventDefault();},_animate:function(prop){var duration,easing,animate=this.options.animate;if(typeof animate==='number'){duration=animate;}
if(typeof animate==='string'){animate=JSON.parse(animate);}
duration=duration||animate.duration;easing=animate.easing;this.content.animate(prop,duration,easing);},deactivate:function(){if(this.options.animate){this._animate(hideProps);}else{this.content.hide();}
this._close();},forceDeactivate:function(){this.content.hide();this._close();},_close:function(){this.options.active=false;if(this.options.saveState){this.storage.set(this.stateKey,false);}
if(this.options.openedState){this.element.removeClass(this.options.openedState);}
if(this.options.collateral.element&&this.options.collateral.openedState){$(this.options.collateral.element).removeClass(this.options.collateral.openedState);}
if(this.options.closedState){this.element.addClass(this.options.closedState);}
if(this.icons){this.header.children('[data-role=icons]').removeClass(this.options.icons.activeHeader).addClass(this.options.icons.header);}
this.header.attr({'aria-selected':'false','aria-expanded':'false'});this.content.attr({'aria-hidden':'true'});this.element.trigger('dimensionsChanged',{opened:false});},activate:function(){if(this.options.disabled){return;}
if(this.options.animate){this._animate(showProps);}else{this.content.show();}
this._open();},forceActivate:function(){if(!this.options.disabled){this.content.show();this._open();}},_open:function(){this.element.trigger('beforeOpen');this.options.active=true;if(this.options.ajaxContent){this._loadContent();}
if(this.options.saveState){this.storage.set(this.stateKey,true);}
if(this.options.openedState){this.element.addClass(this.options.openedState);}
if(this.options.collateral.element&&this.options.collateral.openedState){$(this.options.collateral.element).addClass(this.options.collateral.openedState);}
if(this.options.closedState){this.element.removeClass(this.options.closedState);}
if(this.icons){this.header.children('[data-role=icons]').removeClass(this.options.icons.header).addClass(this.options.icons.activeHeader);}
this.header.attr({'aria-selected':'true','aria-expanded':'true'});this.content.attr({'aria-hidden':'false'});this.element.trigger('dimensionsChanged',{opened:true});},_loadContent:function(){var url=this.element.find(this.options.ajaxUrlElement).attr('href'),that=this;if(url){that.xhr=$.get({url:url,dataType:'html'},function(){});}
if(that.xhr&&that.xhr.statusText!=='canceled'){if(that.options.loadingClass){that.element.addClass(that.options.loadingClass);}
that.content.attr('aria-busy','true');that.xhr.done(function(response){setTimeout(function(){that.content.html(response);},1);});that.xhr.always(function(jqXHR,status){setTimeout(function(){if(status==='abort'){that.content.stop(false,true);}
if(that.options.loadingClass){that.element.removeClass(that.options.loadingClass);}
that.content.removeAttr('aria-busy');if(jqXHR===that.xhr){delete that.xhr;}},1);});}},_scrollToTopIfNotVisible:function(){if(this._isElementOutOfViewport()){this.header[0].scrollIntoView();}},_isElementOutOfViewport:function(){var headerRect=this.header[0].getBoundingClientRect(),contentRect=this.content.get().length?this.content[0].getBoundingClientRect():false,headerOut,contentOut;headerOut=headerRect.bottom-headerRect.height<0||headerRect.right-headerRect.width<0||headerRect.left+headerRect.width>window.innerWidth||headerRect.top+headerRect.height>window.innerHeight;contentOut=contentRect?contentRect.bottom-contentRect.height<0||contentRect.right-contentRect.width<0||contentRect.left+contentRect.width>window.innerWidth||contentRect.top+contentRect.height>window.innerHeight:false;return headerOut?headerOut:contentOut;}});return $.mage.collapsible;});

View File

@@ -0,0 +1,8 @@
define(['ko','jquery','underscore','../template/renderer'],function(ko,$,_,renderer){'use strict';var collapsible,defaults;defaults={closeOnOuter:true,onTarget:false,openClass:'_active',as:'$collapsible'};collapsible={open:function(){this.opened(true);},close:function(){this.opened(false);},toggle:function(){this.opened(!this.opened());}};function onOuterClick(container,model,e){var target=e.target;if(target!==container&&!container.contains(target)){model.close();}}
function getClassBinding(model,name){var binding={};binding[name]=model.opened;return{css:binding};}
function buildConfig(options){if(typeof options!=='object'){options={};}
return _.extend({},defaults,options);}
ko.bindingHandlers.collapsible={init:function(element,valueAccessor,allBindings,viewModel,bindingCtx){var $collapsible=Object.create(collapsible),config=buildConfig(valueAccessor()),outerClick,bindings;_.bindAll($collapsible,'open','close','toggle');$collapsible.opened=ko.observable(!!config.opened);bindingCtx[config.as]=$collapsible;if(config.closeOnOuter){outerClick=onOuterClick.bind(null,element,$collapsible);$(document).on('click',outerClick);ko.utils.domNodeDisposal.addDisposeCallback(element,function(){$(document).off('click',outerClick);});}
if(config.openClass){bindings=getClassBinding($collapsible,config.openClass);ko.applyBindingsToNode(element,bindings,bindingCtx);}
if(config.onTarget){$(element).on('click',$collapsible.toggle);}
if(viewModel&&_.isFunction(viewModel.on)){viewModel.on({close:$collapsible.close,open:$collapsible.open,toggleOpened:$collapsible.toggle});}}};ko.bindingHandlers.closeCollapsible={init:function(element,valueAccessor,allBindings,viewModel,bindingCtx){var name=valueAccessor()||defaults.as,$collapsible=bindingCtx[name];if($collapsible){$(element).on('click',$collapsible.close);}}};ko.bindingHandlers.openCollapsible={init:function(element,valueAccessor,allBindings,viewModel,bindingCtx){var name=valueAccessor()||defaults.as,$collapsible=bindingCtx[name];if($collapsible){$(element).on('click',$collapsible.open);}}};ko.bindingHandlers.toggleCollapsible={init:function(element,valueAccessor,allBindings,viewModel,bindingCtx){var name=valueAccessor()||defaults.as,$collapsible=bindingCtx[name];if($collapsible){$(element).on('click',$collapsible.toggle);}}};renderer.addAttribute('collapsible').addAttribute('openCollapsible').addAttribute('closeCollapsible').addAttribute('toggleCollapsible');});

View File

@@ -0,0 +1,16 @@
define(['underscore','mageUtils','uiRegistry','uiElement'],function(_,utils,registry,Element){'use strict';function compact(container){return _.values(container).filter(utils.isObject);}
function _findIndex(item,container){var index=_.findKey(container,function(value){return value===item;});if(typeof index==='undefined'){index=_.findKey(container,function(value){return value&&value.name===item;});}
return typeof index==='undefined'?-1:index;}
function _insertAt(item,container,position){var currentIndex=_findIndex(item,container),newIndex,target;if(typeof position==='undefined'){position=-1;}else if(typeof position==='string'){position=isNaN(+position)?position:+position;}
newIndex=position;if(~currentIndex){target=container.splice(currentIndex,1)[0];if(typeof item==='string'){item=target;}}
if(typeof position!=='number'){target=position.after||position.before||position;newIndex=_findIndex(target,container);if(~newIndex&&(position.after||newIndex>=currentIndex)){newIndex++;}}
if(newIndex<0){newIndex+=container.length+1;}
container[newIndex]?container.splice(newIndex,0,item):container[newIndex]=item;return!~currentIndex?item:currentIndex!==newIndex;}
return Element.extend({defaults:{template:'ui/collection',_elems:[],ignoreTmpls:{childDefaults:true}},initObservable:function(){this._super().observe({elems:[]});return this;},initElement:function(elem){elem.initContainer(this);return this;},getChild:function(index){return _.findWhere(this.elems(),{index:index});},insertChild:function(elems,position){var container=this._elems,insert=this._insert.bind(this),update;if(!Array.isArray(elems)){elems=[elems];}
elems.map(function(item){return item.elem?_insertAt(item.elem,container,item.position):_insertAt(item,container,position);}).forEach(function(item){if(item===true){update=true;}else if(_.isString(item)){registry.get(item,insert);}else if(utils.isObject(item)){insert(item);}});if(update){this._updateCollection();}
return this;},removeChild:function(elem,skipUpdate){if(_.isString(elem)){elem=this.getChild(elem);}
if(elem){utils.remove(this._elems,elem);if(!skipUpdate){this._updateCollection();}}
return this;},destroyChildren:function(){this.elems.each(function(elem){elem.destroy(true);});this._updateCollection();},clear:function(){var elems=this.elems();_.each(elems,function(elem){if(_.isFunction(elem.clear)){elem.clear();}},this);return this;},hasChild:function(index){return!!this.getChild(index);},requestChild:function(index){var name=this.formChildName(index);return this.requestModule(name);},formChildName:function(index){return this.name+'.'+index;},getRegion:function(name){var regions=this.regions=this.regions||{};if(!regions[name]){regions[name]=[];this.observe.call(regions,name);}
return regions[name];},regionHasElements:function(name){var region=this.getRegion(name);return region().length>0;},updateRegion:function(items,name){this.getRegion(name)(items);return this;},destroy:function(){this._super();this.elems.each('destroy');},_insert:function(elem){var index=_.findKey(this._elems,function(value){return value===elem.name;});if(typeof index!=='undefined'){this._elems[index]=elem;}
this._updateCollection().initElement(elem);},_updateCollection:function(){var _elems=compact(this._elems),grouped;grouped=_elems.filter(function(elem){return elem.displayArea&&_.isString(elem.displayArea);});grouped=_.groupBy(grouped,'displayArea');_.each(grouped,this.updateRegion,this);_.each(this.regions,function(items){var hasObsoleteComponents=items().length&&!_.intersection(_elems,items()).length;if(hasObsoleteComponents){items.removeAll();}});this.elems(_elems);return this;},delegate:function(target){var args=_.toArray(arguments);target=this[target];if(_.isFunction(target)){return target.apply(this,args.slice(1));}
return this._delegate(args);},_delegate:function(args){var result;result=this.elems.map(function(elem){var target;if(!_.isFunction(elem.delegate)){target=elem[args[0]];if(_.isFunction(target)){return target.apply(elem,args.slice(1));}}else{return elem.delegate.apply(elem,args);}});return _.flatten(result);}});});

View File

@@ -0,0 +1,6 @@
define(['ko','jquery','../template/renderer','spectrum','tinycolor'],function(ko,$,renderer,spectrum,tinycolor){'use strict';function changeColorPickerStateBasedOnViewModel(element,viewModel){$(element).spectrum(viewModel.disabled()?'disable':'enable');}
ko.bindingHandlers.colorPicker={init:function(element,valueAccessor,allBindings,viewModel){var config=valueAccessor(),changeValue=function(value){if(value==null){value='';}
config.value(value.toString());};config.change=changeValue;config.hide=changeValue;config.show=function(){if(!viewModel.focused()){viewModel.focused(true);}
return true;};$(element).spectrum(config);changeColorPickerStateBasedOnViewModel(element,viewModel);},update:function(element,valueAccessor,allBindings,viewModel){var config=valueAccessor();if(config.value()===undefined){config.value('');}
if(tinycolor(config.value()).isValid()||config.value()===''){$(element).spectrum('set',config.value());if(config.value()!==''){config.value($(element).spectrum('get').toString());}}
changeColorPickerStateBasedOnViewModel(element,viewModel);}};renderer.addAttribute('colorPicker');});

View File

@@ -0,0 +1,2 @@
define(['jquery','domReady!'],function($){'use strict';$('form[data-auto-submit="true"]').trigger('submit');$(document).on('submit','form',function(e){var formKeyElement,existingFormKeyElement,isKeyPresentInForm,isActionExternal,baseUrl=window.BASE_URL,form=$(e.target),formKey=$('input[name="form_key"]').val(),formMethod=form.prop('method'),formAction=form.prop('action');isActionExternal=formAction.indexOf(baseUrl)!==0;existingFormKeyElement=form.find('input[name="form_key"]');isKeyPresentInForm=existingFormKeyElement.length;if(isKeyPresentInForm&&existingFormKeyElement.attr('auto-added-form-key')==='1'){isKeyPresentInForm=form.find('> input[name="form_key"]').length;}
if(formKey&&!isKeyPresentInForm&&!isActionExternal&&formMethod!=='get'){formKeyElement=document.createElement('input');formKeyElement.setAttribute('type','hidden');formKeyElement.setAttribute('name','form_key');formKeyElement.setAttribute('value',formKey);formKeyElement.setAttribute('auto-added-form-key','1');form.get(0).appendChild(formKeyElement);}});});

View File

@@ -0,0 +1,3 @@
define(['uiComponent','Magento_Customer/js/customer-data','jquery','mage/mage','mage/decorate'],function(Component,customerData,$){'use strict';var sidebarInitialized=false;function initSidebar(){if(sidebarInitialized){return;}
sidebarInitialized=true;$('[data-role=compare-products-sidebar]').decorate('list',true);}
return Component.extend({initialize:function(){this._super();this.compareProducts=customerData.get('compare-products');initSidebar();}});});

View File

@@ -0,0 +1,18 @@
define(['underscore','mage/utils/objects'],function(_,utils){'use strict';var result=[];function equalArrays(keepOrder,target){var args=_.toArray(arguments),arrays;if(!Array.isArray(keepOrder)){arrays=args.slice(2);}else{target=keepOrder;keepOrder=false;arrays=args.slice(1);}
if(!arrays.length){return true;}
return arrays.every(function(array){if(array===target){return true;}else if(array.length!==target.length){return false;}else if(!keepOrder){return!_.difference(target,array).length;}
return array.every(function(value,index){return target[index]===value;});});}
function isDifferent(a,b){var oldIsPrimitive=utils.isPrimitive(a);if(Array.isArray(a)&&Array.isArray(b)){return!equalArrays(true,a,b);}
return oldIsPrimitive?a!==b:true;}
function getPath(prefix,part){return prefix?prefix+'.'+part:part;}
function hasOwn(obj,key){return Object.prototype.hasOwnProperty.call(obj,key);}
function getContainers(changes){var containers={},indexed=_.indexBy(changes,'path');_.each(indexed,function(change,name){var path;name.split('.').forEach(function(part){path=getPath(path,part);if(path in indexed){return;}
(containers[path]=containers[path]||[]).push(change);});});return containers;}
function addChange(path,name,type,newValue,oldValue){var data;data={path:path,name:name,type:type};if(type!=='remove'){data.value=newValue;data.oldValue=oldValue;}else{data.oldValue=newValue;}
result.push(data);}
function setAll(ns,name,type,iterator,placeholder){var key;if(arguments.length>4){type==='add'?addChange(ns,name,'update',iterator,placeholder):addChange(ns,name,'update',placeholder,iterator);}else{addChange(ns,name,type,iterator);}
if(!utils.isObject(iterator)){return;}
for(key in iterator){if(hasOwn(iterator,key)){setAll(getPath(ns,key),key,type,iterator[key]);}}}
function compare(old,current,ns,name){var key,oldIsObj=utils.isObject(old),newIsObj=utils.isObject(current);if(oldIsObj&&newIsObj){for(key in old){if(hasOwn(old,key)&&!hasOwn(current,key)){setAll(getPath(ns,key),key,'remove',old[key]);}}
for(key in current){if(hasOwn(current,key)){hasOwn(old,key)?compare(old[key],current[key],getPath(ns,key),key):setAll(getPath(ns,key),key,'add',current[key]);}}}else if(oldIsObj){setAll(ns,name,'remove',old,current);}else if(newIsObj){setAll(ns,name,'add',current,old);}else if(isDifferent(old,current)){addChange(ns,name,'update',current,old);}}
return{compare:function(){var changes;compare.apply(null,arguments);changes=result.splice(0);return{containers:getContainers(changes),changes:changes,equal:!changes.length};},equalArrays:equalArrays};});

View File

@@ -0,0 +1 @@
define(['jquery-ui-modules/core','jquery-ui-modules/accordion','jquery-ui-modules/autocomplete','jquery-ui-modules/button','jquery-ui-modules/datepicker','jquery-ui-modules/dialog','jquery-ui-modules/draggable','jquery-ui-modules/droppable','jquery-ui-modules/effect-blind','jquery-ui-modules/effect-bounce','jquery-ui-modules/effect-clip','jquery-ui-modules/effect-drop','jquery-ui-modules/effect-explode','jquery-ui-modules/effect-fade','jquery-ui-modules/effect-fold','jquery-ui-modules/effect-highlight','jquery-ui-modules/effect-scale','jquery-ui-modules/effect-pulsate','jquery-ui-modules/effect-shake','jquery-ui-modules/effect-slide','jquery-ui-modules/effect-transfer','jquery-ui-modules/effect','jquery-ui-modules/menu','jquery-ui-modules/mouse','jquery-ui-modules/position','jquery-ui-modules/progressbar','jquery-ui-modules/resizable','jquery-ui-modules/selectable','jquery-ui-modules/slider','jquery-ui-modules/sortable','jquery-ui-modules/spinner','jquery-ui-modules/tabs','jquery-ui-modules/timepicker','jquery-ui-modules/tooltip','jquery-ui-modules/widget'],function(){console.warn('Fallback to JQueryUI Compat activated. '+'Your store is missing a dependency for a '+'jQueryUI widget. Identifying and addressing the dependency '+'will drastically improve the performance of your site.');});

View File

@@ -0,0 +1,2 @@
define(['jquery','underscore','mage/translate','jquery-ui-modules/widget','Magento_Ui/js/modal/modal'],function($,_,$t){'use strict';$.widget('mage.confirm',$.mage.modal,{options:{modalClass:'confirm',title:'',focus:'.action-accept',actions:{always:function(){},confirm:function(){},cancel:function(){}},buttons:[{text:$t('Cancel'),class:'action-secondary action-dismiss',click:function(event){this.closeModal(event);}},{text:$t('OK'),class:'action-primary action-accept',click:function(event){this.closeModal(event,true);}}]},_create:function(){this._super();this.modal.find(this.options.modalCloseBtn).off().on('click',_.bind(this.closeModal,this));this.openModal();},_remove:function(){this.modal.remove();},openModal:function(){return this._super();},closeModal:function(event,result){result=result||false;if(result){this.options.actions.confirm(event);}else{this.options.actions.cancel(event);}
this.options.actions.always(event);this.element.on('confirmclosed',_.bind(this._remove,this));return this._super();}});return function(config){return $('<div></div>').html(config.content).confirm(config);};});

View File

@@ -0,0 +1,4 @@
define(['./logger','./entry-factory','./console-output-handler','./formatter','./message-pool','./levels-pool','Magento_Ui/js/lib/core/storage/local','underscore','./logger-utils'],function(Logger,entryFactory,ConsoleHandler,Formatter,messagePoll,levelsPoll,storage,_,LoggerUtils){'use strict';var STORAGE_NAMESPACE='CONSOLE_LOGGER';function ConsoleLogger(){var formatter=new Formatter(),consoleHandler=new ConsoleHandler(formatter),savedLevel=storage.get(STORAGE_NAMESPACE),utils=new LoggerUtils(this);Logger.call(this,consoleHandler,entryFactory);if(savedLevel){this.displayLevel_=savedLevel;}
this.utils=utils;this.messages=messagePoll;this.levels=levelsPoll.getLevels();}
_.extend(ConsoleLogger,Logger);ConsoleLogger.prototype=Object.create(Logger.prototype);ConsoleLogger.prototype.constructor=ConsoleLogger;ConsoleLogger.prototype.setDisplayLevel=function(level){Logger.prototype.setDisplayLevel.call(this,level);storage.set(STORAGE_NAMESPACE,level);};ConsoleLogger.prototype.createEntry_=function(message,level,data){var code;if(messagePoll.hasMessage(message)){data=data||{};code=message;message=messagePoll.getMessage(code);data.messageCode=code;}
return Logger.prototype.createEntry_.call(this,message,level,data);};return new ConsoleLogger();});

View File

@@ -0,0 +1,2 @@
define(['./levels-pool'],function(logLevels){'use strict';var levels=logLevels.getLevels();function ConsoleOutputHandler(formatter){this.formatter_=formatter;}
ConsoleOutputHandler.prototype.show=function(entry){var displayString=this.formatter_.process(entry);switch(entry.level){case levels.ERROR:console.error(displayString);break;case levels.WARN:console.warn(displayString);break;case levels.INFO:console.info(displayString);break;case levels.DEBUG:console.log(displayString);break;}};ConsoleOutputHandler.prototype.dump=function(entries){entries.forEach(this.show,this);};return ConsoleOutputHandler;});

View File

@@ -0,0 +1,21 @@
/*!
* jQuery UI Controlgroup 1.13.2
* http://jqueryui.com
*
* Copyright jQuery Foundation and other contributors
* Released under the MIT license.
* http://jquery.org/license
*/
(function(factory){"use strict";if(typeof define==="function"&&define.amd){define(["jquery","../widget"],factory);}else{factory(jQuery);}})(function($){"use strict";var controlgroupCornerRegex=/ui-corner-([a-z]){2,6}/g;return $.widget("ui.controlgroup",{version:"1.13.2",defaultElement:"<div>",options:{direction:"horizontal",disabled:null,onlyVisible:true,items:{"button":"input[type=button], input[type=submit], input[type=reset], button, a","controlgroupLabel":".ui-controlgroup-label","checkboxradio":"input[type='checkbox'], input[type='radio']","selectmenu":"select","spinner":".ui-spinner-input"}},_create:function(){this._enhance();},_enhance:function(){this.element.attr("role","toolbar");this.refresh();},_destroy:function(){this._callChildMethod("destroy");this.childWidgets.removeData("ui-controlgroup-data");this.element.removeAttr("role");if(this.options.items.controlgroupLabel){this.element.find(this.options.items.controlgroupLabel).find(".ui-controlgroup-label-contents").contents().unwrap();}},_initWidgets:function(){var that=this,childWidgets=[];$.each(this.options.items,function(widget,selector){var labels;var options={};if(!selector){return;}
if(widget==="controlgroupLabel"){labels=that.element.find(selector);labels.each(function(){var element=$(this);if(element.children(".ui-controlgroup-label-contents").length){return;}
element.contents().wrapAll("<span class='ui-controlgroup-label-contents'></span>");});that._addClass(labels,null,"ui-widget ui-widget-content ui-state-default");childWidgets=childWidgets.concat(labels.get());return;}
if(!$.fn[widget]){return;}
if(that["_"+widget+"Options"]){options=that["_"+widget+"Options"]("middle");}else{options={classes:{}};}
that.element.find(selector).each(function(){var element=$(this);var instance=element[widget]("instance");var instanceOptions=$.widget.extend({},options);if(widget==="button"&&element.parent(".ui-spinner").length){return;}
if(!instance){instance=element[widget]()[widget]("instance");}
if(instance){instanceOptions.classes=that._resolveClassesValues(instanceOptions.classes,instance);}
element[widget](instanceOptions);var widgetElement=element[widget]("widget");$.data(widgetElement[0],"ui-controlgroup-data",instance?instance:element[widget]("instance"));childWidgets.push(widgetElement[0]);});});this.childWidgets=$($.uniqueSort(childWidgets));this._addClass(this.childWidgets,"ui-controlgroup-item");},_callChildMethod:function(method){this.childWidgets.each(function(){var element=$(this),data=element.data("ui-controlgroup-data");if(data&&data[method]){data[method]();}});},_updateCornerClass:function(element,position){var remove="ui-corner-top ui-corner-bottom ui-corner-left ui-corner-right ui-corner-all";var add=this._buildSimpleOptions(position,"label").classes.label;this._removeClass(element,null,remove);this._addClass(element,null,add);},_buildSimpleOptions:function(position,key){var direction=this.options.direction==="vertical";var result={classes:{}};result.classes[key]={"middle":"","first":"ui-corner-"+(direction?"top":"left"),"last":"ui-corner-"+(direction?"bottom":"right"),"only":"ui-corner-all"}[position];return result;},_spinnerOptions:function(position){var options=this._buildSimpleOptions(position,"ui-spinner");options.classes["ui-spinner-up"]="";options.classes["ui-spinner-down"]="";return options;},_buttonOptions:function(position){return this._buildSimpleOptions(position,"ui-button");},_checkboxradioOptions:function(position){return this._buildSimpleOptions(position,"ui-checkboxradio-label");},_selectmenuOptions:function(position){var direction=this.options.direction==="vertical";return{width:direction?"auto":false,classes:{middle:{"ui-selectmenu-button-open":"","ui-selectmenu-button-closed":""},first:{"ui-selectmenu-button-open":"ui-corner-"+(direction?"top":"tl"),"ui-selectmenu-button-closed":"ui-corner-"+(direction?"top":"left")},last:{"ui-selectmenu-button-open":direction?"":"ui-corner-tr","ui-selectmenu-button-closed":"ui-corner-"+(direction?"bottom":"right")},only:{"ui-selectmenu-button-open":"ui-corner-top","ui-selectmenu-button-closed":"ui-corner-all"}}[position]};},_resolveClassesValues:function(classes,instance){var result={};$.each(classes,function(key){var current=instance.options.classes[key]||"";current=String.prototype.trim.call(current.replace(controlgroupCornerRegex,""));result[key]=(current+" "+classes[key]).replace(/\s+/g," ");});return result;},_setOption:function(key,value){if(key==="direction"){this._removeClass("ui-controlgroup-"+this.options.direction);}
this._super(key,value);if(key==="disabled"){this._callChildMethod(value?"disable":"enable");return;}
this.refresh();},refresh:function(){var children,that=this;this._addClass("ui-controlgroup ui-controlgroup-"+this.options.direction);if(this.options.direction==="horizontal"){this._addClass(null,"ui-helper-clearfix");}
this._initWidgets();children=this.childWidgets;if(this.options.onlyVisible){children=children.filter(":visible");}
if(children.length){$.each(["first","last"],function(index,value){var instance=children[value]().data("ui-controlgroup-data");if(instance&&that["_"+instance.widgetName+"Options"]){var options=that["_"+instance.widgetName+"Options"](children.length===1?"only":value);options.classes=that._resolveClassesValues(options.classes,instance);instance.element[instance.widgetName](options);}else{that._updateCornerClass(children[value](),value);}});this._callChildMethod("refresh");}}});});

View File

@@ -0,0 +1 @@
define(['jquery','Magento_Ui/js/modal/modal','mage/translate'],function($,modal){'use strict';$.widget('mage.cookieStatus',{options:{type:'popup',responsive:true,innerScroll:true,autoOpen:true,buttons:[{text:$.mage.__('Close'),class:'cookie-status',click:function(){this.closeModal();}}]},_init:function(){if(!navigator.cookieEnabled){modal(this.options,$('#cookie-status'));}}});return $.mage.cookieStatus;});

View File

@@ -0,0 +1,10 @@
define(['jquery','mage/mage','jquery/jquery.cookie'],function($){'use strict';var CookieHelper=function(){this.defaults={expires:null,path:'/',domain:null,secure:false,lifetime:null,samesite:'lax'};function lifetimeToExpires(options,defaults){var expires,lifetime;lifetime=options.lifetime||defaults.lifetime;if(lifetime&&lifetime>0){expires=options.expires||new Date();return new Date(expires.getTime()+lifetime*1000);}
return null;}
this.set=function(name,value,options){var expires,path,domain,secure,samesite;options=$.extend({},this.defaults,options||{});expires=lifetimeToExpires(options,this.defaults)||options.expires;path=options.path;domain=options.domain;secure=options.secure;samesite=options.samesite;document.cookie=name+'='+encodeURIComponent(value)+
(expires?'; expires='+expires.toUTCString():'')+
(path?'; path='+path:'')+
(domain?'; domain='+domain:'')+
(secure?'; secure':'')+'; samesite='+(samesite?samesite:'lax');};this.get=function(name){var arg=name+'=',aLength=arg.length,cookie=document.cookie,cLength=cookie.length,i=0,j=0;while(i<cLength){j=i+aLength;if(cookie.substring(i,j)===arg){return this.getCookieVal(j);}
i=cookie.indexOf(' ',i)+1;if(i===0){break;}}
return null;};this.clear=function(name){if(this.get(name)){this.set(name,'',{expires:new Date('Jan 01 1970 00:00:01 GMT')});}};this.getCookieVal=function(offset){var cookie=document.cookie,endstr=cookie.indexOf(';',offset);if(endstr===-1){endstr=cookie.length;}
return decodeURIComponent(cookie.substring(offset,endstr));};return this;};$.extend(true,$,{mage:{cookies:new CookieHelper()}});return function(pageOptions){$.extend($.mage.cookies.defaults,pageOptions);$.extend($.cookie.defaults,$.mage.cookies.defaults);};});

View File

@@ -0,0 +1 @@
(function(){"use strict";define(["jquery","./data","./disable-selection","./focusable","./form","./ie","./keycode","./labels","./jquery-patch","./plugin","./safe-active-element","./safe-blur","./scroll-parent","./tabbable","./unique-id","./version"]);})();

View File

@@ -0,0 +1,162 @@
/* cyrillic-ext */
@font-face {
font-family: 'Roboto';
font-style: normal;
font-weight: 400;
font-stretch: 100%;
src: url(https://fonts.gstatic.com/s/roboto/v49/KFO7CnqEu92Fr1ME7kSn66aGLdTylUAMa3GUBGEe.woff2) format('woff2');
unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
/* cyrillic */
@font-face {
font-family: 'Roboto';
font-style: normal;
font-weight: 400;
font-stretch: 100%;
src: url(https://fonts.gstatic.com/s/roboto/v49/KFO7CnqEu92Fr1ME7kSn66aGLdTylUAMa3iUBGEe.woff2) format('woff2');
unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
/* greek-ext */
@font-face {
font-family: 'Roboto';
font-style: normal;
font-weight: 400;
font-stretch: 100%;
src: url(https://fonts.gstatic.com/s/roboto/v49/KFO7CnqEu92Fr1ME7kSn66aGLdTylUAMa3CUBGEe.woff2) format('woff2');
unicode-range: U+1F00-1FFF;
}
/* greek */
@font-face {
font-family: 'Roboto';
font-style: normal;
font-weight: 400;
font-stretch: 100%;
src: url(https://fonts.gstatic.com/s/roboto/v49/KFO7CnqEu92Fr1ME7kSn66aGLdTylUAMa3-UBGEe.woff2) format('woff2');
unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF;
}
/* math */
@font-face {
font-family: 'Roboto';
font-style: normal;
font-weight: 400;
font-stretch: 100%;
src: url(https://fonts.gstatic.com/s/roboto/v49/KFO7CnqEu92Fr1ME7kSn66aGLdTylUAMawCUBGEe.woff2) format('woff2');
unicode-range: U+0302-0303, U+0305, U+0307-0308, U+0310, U+0312, U+0315, U+031A, U+0326-0327, U+032C, U+032F-0330, U+0332-0333, U+0338, U+033A, U+0346, U+034D, U+0391-03A1, U+03A3-03A9, U+03B1-03C9, U+03D1, U+03D5-03D6, U+03F0-03F1, U+03F4-03F5, U+2016-2017, U+2034-2038, U+203C, U+2040, U+2043, U+2047, U+2050, U+2057, U+205F, U+2070-2071, U+2074-208E, U+2090-209C, U+20D0-20DC, U+20E1, U+20E5-20EF, U+2100-2112, U+2114-2115, U+2117-2121, U+2123-214F, U+2190, U+2192, U+2194-21AE, U+21B0-21E5, U+21F1-21F2, U+21F4-2211, U+2213-2214, U+2216-22FF, U+2308-230B, U+2310, U+2319, U+231C-2321, U+2336-237A, U+237C, U+2395, U+239B-23B7, U+23D0, U+23DC-23E1, U+2474-2475, U+25AF, U+25B3, U+25B7, U+25BD, U+25C1, U+25CA, U+25CC, U+25FB, U+266D-266F, U+27C0-27FF, U+2900-2AFF, U+2B0E-2B11, U+2B30-2B4C, U+2BFE, U+3030, U+FF5B, U+FF5D, U+1D400-1D7FF, U+1EE00-1EEFF;
}
/* symbols */
@font-face {
font-family: 'Roboto';
font-style: normal;
font-weight: 400;
font-stretch: 100%;
src: url(https://fonts.gstatic.com/s/roboto/v49/KFO7CnqEu92Fr1ME7kSn66aGLdTylUAMaxKUBGEe.woff2) format('woff2');
unicode-range: U+0001-000C, U+000E-001F, U+007F-009F, U+20DD-20E0, U+20E2-20E4, U+2150-218F, U+2190, U+2192, U+2194-2199, U+21AF, U+21E6-21F0, U+21F3, U+2218-2219, U+2299, U+22C4-22C6, U+2300-243F, U+2440-244A, U+2460-24FF, U+25A0-27BF, U+2800-28FF, U+2921-2922, U+2981, U+29BF, U+29EB, U+2B00-2BFF, U+4DC0-4DFF, U+FFF9-FFFB, U+10140-1018E, U+10190-1019C, U+101A0, U+101D0-101FD, U+102E0-102FB, U+10E60-10E7E, U+1D2C0-1D2D3, U+1D2E0-1D37F, U+1F000-1F0FF, U+1F100-1F1AD, U+1F1E6-1F1FF, U+1F30D-1F30F, U+1F315, U+1F31C, U+1F31E, U+1F320-1F32C, U+1F336, U+1F378, U+1F37D, U+1F382, U+1F393-1F39F, U+1F3A7-1F3A8, U+1F3AC-1F3AF, U+1F3C2, U+1F3C4-1F3C6, U+1F3CA-1F3CE, U+1F3D4-1F3E0, U+1F3ED, U+1F3F1-1F3F3, U+1F3F5-1F3F7, U+1F408, U+1F415, U+1F41F, U+1F426, U+1F43F, U+1F441-1F442, U+1F444, U+1F446-1F449, U+1F44C-1F44E, U+1F453, U+1F46A, U+1F47D, U+1F4A3, U+1F4B0, U+1F4B3, U+1F4B9, U+1F4BB, U+1F4BF, U+1F4C8-1F4CB, U+1F4D6, U+1F4DA, U+1F4DF, U+1F4E3-1F4E6, U+1F4EA-1F4ED, U+1F4F7, U+1F4F9-1F4FB, U+1F4FD-1F4FE, U+1F503, U+1F507-1F50B, U+1F50D, U+1F512-1F513, U+1F53E-1F54A, U+1F54F-1F5FA, U+1F610, U+1F650-1F67F, U+1F687, U+1F68D, U+1F691, U+1F694, U+1F698, U+1F6AD, U+1F6B2, U+1F6B9-1F6BA, U+1F6BC, U+1F6C6-1F6CF, U+1F6D3-1F6D7, U+1F6E0-1F6EA, U+1F6F0-1F6F3, U+1F6F7-1F6FC, U+1F700-1F7FF, U+1F800-1F80B, U+1F810-1F847, U+1F850-1F859, U+1F860-1F887, U+1F890-1F8AD, U+1F8B0-1F8BB, U+1F8C0-1F8C1, U+1F900-1F90B, U+1F93B, U+1F946, U+1F984, U+1F996, U+1F9E9, U+1FA00-1FA6F, U+1FA70-1FA7C, U+1FA80-1FA89, U+1FA8F-1FAC6, U+1FACE-1FADC, U+1FADF-1FAE9, U+1FAF0-1FAF8, U+1FB00-1FBFF;
}
/* vietnamese */
@font-face {
font-family: 'Roboto';
font-style: normal;
font-weight: 400;
font-stretch: 100%;
src: url(https://fonts.gstatic.com/s/roboto/v49/KFO7CnqEu92Fr1ME7kSn66aGLdTylUAMa3OUBGEe.woff2) format('woff2');
unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
/* latin-ext */
@font-face {
font-family: 'Roboto';
font-style: normal;
font-weight: 400;
font-stretch: 100%;
src: url(https://fonts.gstatic.com/s/roboto/v49/KFO7CnqEu92Fr1ME7kSn66aGLdTylUAMa3KUBGEe.woff2) format('woff2');
unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
font-family: 'Roboto';
font-style: normal;
font-weight: 400;
font-stretch: 100%;
src: url(https://fonts.gstatic.com/s/roboto/v49/KFO7CnqEu92Fr1ME7kSn66aGLdTylUAMa3yUBA.woff2) format('woff2');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* cyrillic-ext */
@font-face {
font-family: 'Roboto';
font-style: normal;
font-weight: 700;
font-stretch: 100%;
src: url(https://fonts.gstatic.com/s/roboto/v49/KFO7CnqEu92Fr1ME7kSn66aGLdTylUAMa3GUBGEe.woff2) format('woff2');
unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
/* cyrillic */
@font-face {
font-family: 'Roboto';
font-style: normal;
font-weight: 700;
font-stretch: 100%;
src: url(https://fonts.gstatic.com/s/roboto/v49/KFO7CnqEu92Fr1ME7kSn66aGLdTylUAMa3iUBGEe.woff2) format('woff2');
unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
/* greek-ext */
@font-face {
font-family: 'Roboto';
font-style: normal;
font-weight: 700;
font-stretch: 100%;
src: url(https://fonts.gstatic.com/s/roboto/v49/KFO7CnqEu92Fr1ME7kSn66aGLdTylUAMa3CUBGEe.woff2) format('woff2');
unicode-range: U+1F00-1FFF;
}
/* greek */
@font-face {
font-family: 'Roboto';
font-style: normal;
font-weight: 700;
font-stretch: 100%;
src: url(https://fonts.gstatic.com/s/roboto/v49/KFO7CnqEu92Fr1ME7kSn66aGLdTylUAMa3-UBGEe.woff2) format('woff2');
unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF;
}
/* math */
@font-face {
font-family: 'Roboto';
font-style: normal;
font-weight: 700;
font-stretch: 100%;
src: url(https://fonts.gstatic.com/s/roboto/v49/KFO7CnqEu92Fr1ME7kSn66aGLdTylUAMawCUBGEe.woff2) format('woff2');
unicode-range: U+0302-0303, U+0305, U+0307-0308, U+0310, U+0312, U+0315, U+031A, U+0326-0327, U+032C, U+032F-0330, U+0332-0333, U+0338, U+033A, U+0346, U+034D, U+0391-03A1, U+03A3-03A9, U+03B1-03C9, U+03D1, U+03D5-03D6, U+03F0-03F1, U+03F4-03F5, U+2016-2017, U+2034-2038, U+203C, U+2040, U+2043, U+2047, U+2050, U+2057, U+205F, U+2070-2071, U+2074-208E, U+2090-209C, U+20D0-20DC, U+20E1, U+20E5-20EF, U+2100-2112, U+2114-2115, U+2117-2121, U+2123-214F, U+2190, U+2192, U+2194-21AE, U+21B0-21E5, U+21F1-21F2, U+21F4-2211, U+2213-2214, U+2216-22FF, U+2308-230B, U+2310, U+2319, U+231C-2321, U+2336-237A, U+237C, U+2395, U+239B-23B7, U+23D0, U+23DC-23E1, U+2474-2475, U+25AF, U+25B3, U+25B7, U+25BD, U+25C1, U+25CA, U+25CC, U+25FB, U+266D-266F, U+27C0-27FF, U+2900-2AFF, U+2B0E-2B11, U+2B30-2B4C, U+2BFE, U+3030, U+FF5B, U+FF5D, U+1D400-1D7FF, U+1EE00-1EEFF;
}
/* symbols */
@font-face {
font-family: 'Roboto';
font-style: normal;
font-weight: 700;
font-stretch: 100%;
src: url(https://fonts.gstatic.com/s/roboto/v49/KFO7CnqEu92Fr1ME7kSn66aGLdTylUAMaxKUBGEe.woff2) format('woff2');
unicode-range: U+0001-000C, U+000E-001F, U+007F-009F, U+20DD-20E0, U+20E2-20E4, U+2150-218F, U+2190, U+2192, U+2194-2199, U+21AF, U+21E6-21F0, U+21F3, U+2218-2219, U+2299, U+22C4-22C6, U+2300-243F, U+2440-244A, U+2460-24FF, U+25A0-27BF, U+2800-28FF, U+2921-2922, U+2981, U+29BF, U+29EB, U+2B00-2BFF, U+4DC0-4DFF, U+FFF9-FFFB, U+10140-1018E, U+10190-1019C, U+101A0, U+101D0-101FD, U+102E0-102FB, U+10E60-10E7E, U+1D2C0-1D2D3, U+1D2E0-1D37F, U+1F000-1F0FF, U+1F100-1F1AD, U+1F1E6-1F1FF, U+1F30D-1F30F, U+1F315, U+1F31C, U+1F31E, U+1F320-1F32C, U+1F336, U+1F378, U+1F37D, U+1F382, U+1F393-1F39F, U+1F3A7-1F3A8, U+1F3AC-1F3AF, U+1F3C2, U+1F3C4-1F3C6, U+1F3CA-1F3CE, U+1F3D4-1F3E0, U+1F3ED, U+1F3F1-1F3F3, U+1F3F5-1F3F7, U+1F408, U+1F415, U+1F41F, U+1F426, U+1F43F, U+1F441-1F442, U+1F444, U+1F446-1F449, U+1F44C-1F44E, U+1F453, U+1F46A, U+1F47D, U+1F4A3, U+1F4B0, U+1F4B3, U+1F4B9, U+1F4BB, U+1F4BF, U+1F4C8-1F4CB, U+1F4D6, U+1F4DA, U+1F4DF, U+1F4E3-1F4E6, U+1F4EA-1F4ED, U+1F4F7, U+1F4F9-1F4FB, U+1F4FD-1F4FE, U+1F503, U+1F507-1F50B, U+1F50D, U+1F512-1F513, U+1F53E-1F54A, U+1F54F-1F5FA, U+1F610, U+1F650-1F67F, U+1F687, U+1F68D, U+1F691, U+1F694, U+1F698, U+1F6AD, U+1F6B2, U+1F6B9-1F6BA, U+1F6BC, U+1F6C6-1F6CF, U+1F6D3-1F6D7, U+1F6E0-1F6EA, U+1F6F0-1F6F3, U+1F6F7-1F6FC, U+1F700-1F7FF, U+1F800-1F80B, U+1F810-1F847, U+1F850-1F859, U+1F860-1F887, U+1F890-1F8AD, U+1F8B0-1F8BB, U+1F8C0-1F8C1, U+1F900-1F90B, U+1F93B, U+1F946, U+1F984, U+1F996, U+1F9E9, U+1FA00-1FA6F, U+1FA70-1FA7C, U+1FA80-1FA89, U+1FA8F-1FAC6, U+1FACE-1FADC, U+1FADF-1FAE9, U+1FAF0-1FAF8, U+1FB00-1FBFF;
}
/* vietnamese */
@font-face {
font-family: 'Roboto';
font-style: normal;
font-weight: 700;
font-stretch: 100%;
src: url(https://fonts.gstatic.com/s/roboto/v49/KFO7CnqEu92Fr1ME7kSn66aGLdTylUAMa3OUBGEe.woff2) format('woff2');
unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
/* latin-ext */
@font-face {
font-family: 'Roboto';
font-style: normal;
font-weight: 700;
font-stretch: 100%;
src: url(https://fonts.gstatic.com/s/roboto/v49/KFO7CnqEu92Fr1ME7kSn66aGLdTylUAMa3KUBGEe.woff2) format('woff2');
unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
font-family: 'Roboto';
font-style: normal;
font-weight: 700;
font-stretch: 100%;
src: url(https://fonts.gstatic.com/s/roboto/v49/KFO7CnqEu92Fr1ME7kSn66aGLdTylUAMa3yUBA.woff2) format('woff2');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,2 @@
define(['jquery','ko','./customer/address'],function($,ko,Address){'use strict';var isLoggedIn=ko.observable(window.isCustomerLoggedIn);return{getAddressItems:function(){var items=[],customerData=window.customerData;if(isLoggedIn()){if(Object.keys(customerData).length){$.each(customerData.addresses,function(key,item){items.push(new Address(item));});}}
return items;}};});

View File

@@ -0,0 +1,3 @@
define(['jquery','mage/utils/wrapper'],function($,wrapper){'use strict';var mixin={getExpiredSectionNames:function(originFn){var expiredSections=originFn(),storage=$.initNamespaceStorage('mage-cache-storage').localStorage,currentTimestamp=Math.floor(Date.now()/ 1000),persistentIndex=expiredSections.indexOf('persistent'),persistentLifeTime=0,sectionData;if(window.persistent!==undefined&&window.persistent.expirationLifetime!==undefined){persistentLifeTime=window.persistent.expirationLifetime;}
if(persistentIndex!==-1){sectionData=storage.get('persistent');if(typeof sectionData==='object'&&sectionData['data_id']+persistentLifeTime>=currentTimestamp){expiredSections.splice(persistentIndex,1);}}
return expiredSections;}};return function(target){return wrapper.extend(target,mixin);};});

View File

@@ -0,0 +1,6 @@
define(['jquery','underscore','ko','Magento_Customer/js/section-config','mage/url','mage/storage','jquery/jquery-storageapi'],function($,_,ko,sectionConfig,url){'use strict';var options={},storage,storageInvalidation,invalidateCacheBySessionTimeOut,invalidateCacheByCloseCookieSession,dataProvider,buffer,customerData,deferred=$.Deferred();url.setBaseUrl(window.BASE_URL);options.sectionLoadUrl=url.build('customer/section/load');invalidateCacheBySessionTimeOut=function(invalidateOptions){var date;if(new Date($.localStorage.get('mage-cache-timeout'))<new Date()){storage.removeAll();}
date=new Date(Date.now()+parseInt(invalidateOptions.cookieLifeTime,10)*1000);$.localStorage.set('mage-cache-timeout',date);};invalidateCacheByCloseCookieSession=function(){if(!$.cookieStorage.isSet('mage-cache-sessid')){$.cookieStorage.set('mage-cache-sessid',true);storage.removeAll();}};dataProvider={getFromStorage:function(sectionNames){var result={};_.each(sectionNames,function(sectionName){result[sectionName]=storage.get(sectionName);});return result;},getFromServer:function(sectionNames,forceNewSectionTimestamp){var parameters;sectionNames=sectionConfig.filterClientSideSections(sectionNames);parameters=_.isArray(sectionNames)&&sectionNames.indexOf('*')<0?{sections:sectionNames.join(',')}:[];parameters['force_new_section_timestamp']=forceNewSectionTimestamp;return $.getJSON(options.sectionLoadUrl,parameters).fail(function(jqXHR){throw new Error(jqXHR);});}};ko.extenders.disposableCustomerData=function(target,sectionName){var sectionDataIds,newSectionDataIds={};target.subscribe(function(){setTimeout(function(){storage.remove(sectionName);sectionDataIds=$.cookieStorage.get('section_data_ids')||{};_.each(sectionDataIds,function(data,name){if(name!==sectionName){newSectionDataIds[name]=data;}});$.cookieStorage.set('section_data_ids',newSectionDataIds);},3000);});return target;};buffer={data:{},bind:function(sectionName){this.data[sectionName]=ko.observable({});},get:function(sectionName){if(!this.data[sectionName]){this.bind(sectionName);}
return this.data[sectionName];},keys:function(){return _.keys(this.data);},notify:function(sectionName,sectionData){if(!this.data[sectionName]){this.bind(sectionName);}
this.data[sectionName](sectionData);},update:function(sections){var sectionId=0,sectionDataIds=$.cookieStorage.get('section_data_ids')||{};_.each(sections,function(sectionData,sectionName){sectionId=sectionData['data_id'];sectionDataIds[sectionName]=sectionId;storage.set(sectionName,sectionData);storageInvalidation.remove(sectionName);buffer.notify(sectionName,sectionData);});$.cookieStorage.set('section_data_ids',sectionDataIds);},remove:function(sections){_.each(sections,function(sectionName){storage.remove(sectionName);if(!sectionConfig.isClientSideSection(sectionName)){storageInvalidation.set(sectionName,true);}});}};customerData={init:function(){var expiredSectionNames=this.getExpiredSectionNames();if(expiredSectionNames.length>0){_.each(dataProvider.getFromStorage(storage.keys()),function(sectionData,sectionName){buffer.notify(sectionName,sectionData);});this.reload(expiredSectionNames,false);}else{_.each(dataProvider.getFromStorage(storage.keys()),function(sectionData,sectionName){buffer.notify(sectionName,sectionData);});if(!_.isEmpty(storageInvalidation.keys())){this.reload(storageInvalidation.keys(),false);}}
if(!_.isEmpty($.cookieStorage.get('section_data_clean'))){this.reload(sectionConfig.getSectionNames(),true);$.cookieStorage.set('section_data_clean','');}},initStorage:function(){$.cookieStorage.setConf({path:'/',expires:new Date(Date.now()+parseInt(options.cookieLifeTime,10)*1000)});storage=$.initNamespaceStorage('mage-cache-storage').localStorage;storageInvalidation=$.initNamespaceStorage('mage-cache-storage-section-invalidation').localStorage;},getExpiredSectionNames:function(){var expiredSectionNames=[],cookieSectionTimestamps=$.cookieStorage.get('section_data_ids')||{},sectionLifetime=options.expirableSectionLifetime*60,currentTimestamp=Math.floor(Date.now()/ 1000),sectionData;_.each(options.expirableSectionNames,function(sectionName){sectionData=storage.get(sectionName);if(typeof sectionData==='object'&&sectionData['data_id']+sectionLifetime<=currentTimestamp){expiredSectionNames.push(sectionName);}});_.each(cookieSectionTimestamps,function(cookieSectionTimestamp,sectionName){sectionData=storage.get(sectionName);if(typeof sectionData==='undefined'||typeof sectionData==='object'&&cookieSectionTimestamp!==sectionData['data_id']){expiredSectionNames.push(sectionName);}});expiredSectionNames=_.intersection(expiredSectionNames,sectionConfig.getSectionNames());return _.uniq(expiredSectionNames);},needReload:function(){var expiredSectionNames=this.getExpiredSectionNames();return expiredSectionNames.length>0;},getExpiredKeys:function(){return this.getExpiredSectionNames();},get:function(sectionName){return buffer.get(sectionName);},set:function(sectionName,sectionData){var data={};data[sectionName]=sectionData;buffer.update(data);},reload:function(sectionNames,forceNewSectionTimestamp){return dataProvider.getFromServer(sectionNames,forceNewSectionTimestamp).done(function(sections){$(document).trigger('customer-data-reload',[sectionNames]);buffer.update(sections);});},invalidate:function(sectionNames){var sectionDataIds,sectionsNamesForInvalidation;sectionsNamesForInvalidation=_.contains(sectionNames,'*')?sectionConfig.getSectionNames():sectionNames;$(document).trigger('customer-data-invalidate',[sectionsNamesForInvalidation]);buffer.remove(sectionsNamesForInvalidation);sectionDataIds=$.cookieStorage.get('section_data_ids')||{};_.each(sectionsNamesForInvalidation,function(sectionName){if(!sectionConfig.isClientSideSection(sectionName)){sectionDataIds[sectionName]+=1000;}});$.cookieStorage.set('section_data_ids',sectionDataIds);},getInitCustomerData:function(){return deferred.promise();},onAjaxComplete:function(jsonResponse,settings){var sections,redirects;if(settings.type.match(/post|put|delete/i)){sections=sectionConfig.getAffectedSections(settings.url);if(sections&&sections.length){this.invalidate(sections);redirects=['redirect','backUrl'];if(_.isObject(jsonResponse)&&!_.isEmpty(_.pick(jsonResponse,redirects))){return;}
this.reload(sections,true);}}},'Magento_Customer/js/customer-data':function(settings){options=settings;customerData.initStorage();invalidateCacheBySessionTimeOut(settings);invalidateCacheByCloseCookieSession();customerData.init();deferred.resolve();}};$(document).on('ajaxComplete',function(event,xhr,settings){customerData.onAjaxComplete(xhr.responseJSON,settings);});$(document).on('submit',function(event){var sections;if(event.target.method.match(/post|put|delete/i)){sections=sectionConfig.getAffectedSections(event.target.action);if(sections){customerData.invalidate(sections);}}});return customerData;});

View File

@@ -0,0 +1 @@
define(['jquery'],function($){'use strict';return function(){$.validator.addMethod('validate-email-plus',function(value,element){var pattern=/^[_a-zA-Z0-9-]+(\.[_a-zA-Z0-9-]+)*@[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)*(\.[a-zA-Z]{2,12})$/;var result=pattern.test(value);return result;},$.mage.__('Invalid email'))}});

View File

@@ -0,0 +1,10 @@
define(['jquery','ko','underscore','./address-list'],function($,ko,_,addressList){'use strict';var isLoggedIn=ko.observable(window.isCustomerLoggedIn),customerData={};if(isLoggedIn()){customerData=window.customerData;}else{customerData={};}
return{customerData:customerData,customerDetails:{},isLoggedIn:isLoggedIn,setIsLoggedIn:function(flag){isLoggedIn(flag);},getBillingAddressList:function(){return addressList();},getShippingAddressList:function(){return addressList();},setDetails:function(fieldName,value){if(fieldName){this.customerDetails[fieldName]=value;}},getDetails:function(fieldName){if(fieldName){if(this.customerDetails.hasOwnProperty(fieldName)){return this.customerDetails[fieldName];}
return undefined;}
return this.customerDetails;},addCustomerAddress:function(address){var fields=['customer_id','country_id','street','company','telephone','fax','postcode','city','firstname','lastname','middlename','prefix','suffix','vat_id','default_billing','default_shipping'],customerAddress={},hasAddress=0,existingAddress;if(!this.customerData.addresses){this.customerData.addresses=[];}
customerAddress=_.pick(address,fields);if(address.hasOwnProperty('region_id')){customerAddress.region={'region_id':address['region_id'],region:address.region};}
for(existingAddress in this.customerData.addresses){if(this.customerData.addresses.hasOwnProperty(existingAddress)){if(_.isEqual(this.customerData.addresses[existingAddress],customerAddress)){hasAddress=existingAddress;break;}}}
if(hasAddress===0){return this.customerData.addresses.push(customerAddress)-1;}
return hasAddress;},setAddressAsDefaultBilling:function(addressId){if(this.customerData.addresses[addressId]){this.customerData.addresses[addressId]['default_billing']=1;return true;}
return false;},setAddressAsDefaultShipping:function(addressId){if(this.customerData.addresses[addressId]){this.customerData.addresses[addressId]['default_shipping']=1;return true;}
return false;}};});

View File

@@ -0,0 +1 @@
define(['uiComponent','Magento_Customer/js/customer-data'],function(Component,customerData){'use strict';return Component.extend({initialize:function(){this._super();this.customer=customerData.get('customer');}});});

View File

@@ -0,0 +1,8 @@
define(['jquery','underscore','ko','mageUtils','Magento_Catalog/js/product/query-builder','Magento_Customer/js/customer-data','jquery/jquery-storageapi'],function($,_,ko,utils,queryBuilder,customerData){'use strict';function getParsedDataFromServer(data){var result={};_.each(data.items,function(item){if(item.id){result[item.id]=item;}});return{items:result};}
function setLocalStorageItem(namespace,data){try{window.localStorage.setItem(namespace,JSON.stringify(data));}catch(e){console.warn('localStorage is unavailable - skipping local caching of product data');console.error(e);}}
return{name:'DataStorage',request:{},customerDataProvider:'product_data_storage',initialize:function(){if(!this.data){this.data=ko.observable({});}
this.initLocalStorage().initCustomerDataReloadListener().cachesDataFromLocalStorage().initDataListener().initProvideStorage().initProviderListener();return this;},initCustomerDataReloadListener:function(){$(document).on('customer-data-invalidate',this._flushProductStorage.bind(this));return this;},_flushProductStorage:function(event,sections){if(_.isEmpty(sections)||_.contains(sections,'product_data_storage')){this.localStorage.removeAll();}},initDataListener:function(){this.data.subscribe(this.dataHandler.bind(this));return this;},initProvideStorage:function(){this.providerHandler(customerData.get(this.customerDataProvider)());return this;},dataHandler:function(data){if(_.isEmpty(data)){this.localStorage.removeAll();}else{setLocalStorageItem(this.namespace,data);}},providerHandler:function(data){var currentData=utils.copy(this.data()),ids=_.keys(data.items);if(data.items&&ids.length){data=data.items;this.data(_.extend(data,currentData));}},setIds:function(currency,store,ids){if(!this.hasInCache(currency,store,ids)){this.loadDataFromServer(currency,store,ids);}else{this.data.valueHasMutated();}},getDataByIdentifiers:function(currency,store,productIdentifiers){var data={},dataCollection=this.data(),id;for(id in productIdentifiers){if(productIdentifiers.hasOwnProperty(id)){data[id]=dataCollection[id];}}
return data;},hasInCache:function(currency,store,ids){var data=this.data(),id;for(id in ids){if(!data.hasOwnProperty(id)||data[id]['currency_code']!==currency||~~data[id]['store_id']!==~~store){return false;}}
return true;},loadDataFromServer:function(currency,store,ids){var idsArray=_.keys(ids),prepareAjaxParams={'entity_id':idsArray.join(',')};if(this.request.sent&&this.hasIdsInSentRequest(ids)){return;}
this.request={sent:true,data:ids};this.updateRequestConfig.data=queryBuilder.buildQuery(prepareAjaxParams);this.updateRequestConfig.data['store_id']=store;this.updateRequestConfig.data['currency_code']=currency;$.ajax(this.updateRequestConfig).done(function(data){this.request={};this.providerHandler(getParsedDataFromServer(data));}.bind(this));},addDataFromPageCache:function(data){this.providerHandler(getParsedDataFromServer(data));},hasIdsInSentRequest:function(ids){var sentDataIds,currentDataIds;if(this.request.data){sentDataIds=_.keys(this.request.data);currentDataIds=_.keys(ids);_.each(currentDataIds,function(id){if(_.lastIndexOf(sentDataIds,id)===-1){return false;}});return true;}
return false;},initProviderListener:function(){customerData.get(this.customerDataProvider).subscribe(this.providerHandler.bind(this));return this;},cachesDataFromLocalStorage:function(){this.data(this.getDataFromLocalStorage());return this;},getDataFromLocalStorage:function(){return this.localStorage.get();},initLocalStorage:function(){this.localStorage=$.initNamespaceStorage(this.namespace).localStorage;return this;}};});

View File

@@ -0,0 +1,9 @@
/*!
* jQuery UI :data 1.13.2
* http://jqueryui.com
*
* Copyright jQuery Foundation and other contributors
* Released under the MIT license.
* http://jquery.org/license
*/
(function(factory){"use strict";if(typeof define==="function"&&define.amd){define(["jquery","./version"],factory);}else{factory(jQuery);}})(function($){"use strict";return $.extend($.expr.pseudos,{data:$.expr.createPseudo?$.expr.createPseudo(function(dataName){return function(elem){return!!$.data(elem,dataName);};}):function(elem,i,match){return!!$.data(elem,match[3]);}});});

View File

@@ -0,0 +1,3 @@
define(['jquery','mage/template','Magento_Ui/js/modal/confirm','jquery-ui-modules/widget'],function($,mageTemplate,uiConfirm){'use strict';$.widget('mage.dataPost',{options:{formTemplate:'<form action="<%- data.action %>" method="post">'+'<% _.each(data.data, function(value, index) { %>'+'<input name="<%- index %>" value="<%- value %>">'+'<% }) %></form>',postTrigger:['a[data-post]','button[data-post]','span[data-post]'],formKeyInputSelector:'input[name="form_key"]'},_create:function(){this._bind();},_bind:function(){var events={};$.each(this.options.postTrigger,function(index,value){events['click '+value]='_postDataAction';});this._on(events);},_postDataAction:function(e){var params=$(e.currentTarget).data('post');e.preventDefault();this.postData(params);},postData:function(params){var formKey=$(this.options.formKeyInputSelector).val(),$form,input;if(formKey){params.data['form_key']=formKey;}
$form=$(mageTemplate(this.options.formTemplate,{data:params}));if(params.files){$form[0].enctype='multipart/form-data';$.each(params.files,function(key,files){if(files instanceof FileList){input=document.createElement('input');input.type='file';input.name=key;input.files=files;$form[0].appendChild(input);}});}
if(params.data.confirmation){uiConfirm({content:params.data.confirmationMessage,actions:{confirm:function(){$form.appendTo('body').hide().trigger('submit');}}});}else{$form.appendTo('body').hide().trigger('submit');}}});$(document).dataPost();return $.mage.dataPost;});

View File

@@ -0,0 +1,172 @@
/*!
* jQuery UI Datepicker 1.13.2
* http://jqueryui.com
*
* Copyright jQuery Foundation and other contributors
* Released under the MIT license.
* http://jquery.org/license
*/
(function(factory){"use strict";if(typeof define==="function"&&define.amd){define(["jquery","../version","../keycode"],factory);}else{factory(jQuery);}})(function($){"use strict";$.extend($.ui,{datepicker:{version:"1.13.2"}});var datepicker_instActive;function datepicker_getZindex(elem){var position,value;while(elem.length&&elem[0]!==document){position=elem.css("position");if(position==="absolute"||position==="relative"||position==="fixed"){value=parseInt(elem.css("zIndex"),10);if(!isNaN(value)&&value!==0){return value;}}
elem=elem.parent();}
return 0;}
function Datepicker(){this._curInst=null;this._keyEvent=false;this._disabledInputs=[];this._datepickerShowing=false;this._inDialog=false;this._mainDivId="ui-datepicker-div";this._inlineClass="ui-datepicker-inline";this._appendClass="ui-datepicker-append";this._triggerClass="ui-datepicker-trigger";this._dialogClass="ui-datepicker-dialog";this._disableClass="ui-datepicker-disabled";this._unselectableClass="ui-datepicker-unselectable";this._currentClass="ui-datepicker-current-day";this._dayOverClass="ui-datepicker-days-cell-over";this.regional=[];this.regional[""]={closeText:"Done",prevText:"Prev",nextText:"Next",currentText:"Today",monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],weekHeader:"Wk",dateFormat:"mm/dd/yy",firstDay:0,isRTL:false,showMonthAfterYear:false,yearSuffix:"",selectMonthLabel:"Select month",selectYearLabel:"Select year"};this._defaults={showOn:"focus",showAnim:"fadeIn",showOptions:{},defaultDate:null,appendText:"",buttonText:"...",buttonImage:"",buttonImageOnly:false,hideIfNoPrevNext:false,navigationAsDateFormat:false,gotoCurrent:false,changeMonth:false,changeYear:false,yearRange:"c-10:c+10",showOtherMonths:false,selectOtherMonths:false,showWeek:false,calculateWeek:this.iso8601Week,shortYearCutoff:"+10",minDate:null,maxDate:null,duration:"fast",beforeShowDay:null,beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,onUpdateDatepicker:null,numberOfMonths:1,showCurrentAtPos:0,stepMonths:1,stepBigMonths:12,altField:"",altFormat:"",constrainInput:true,showButtonPanel:false,autoSize:false,disabled:false};$.extend(this._defaults,this.regional[""]);this.regional.en=$.extend(true,{},this.regional[""]);this.regional["en-US"]=$.extend(true,{},this.regional.en);this.dpDiv=datepicker_bindHover($("<div id='"+this._mainDivId+"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>"));}
$.extend(Datepicker.prototype,{markerClassName:"hasDatepicker",maxRows:4,_widgetDatepicker:function(){return this.dpDiv;},setDefaults:function(settings){datepicker_extendRemove(this._defaults,settings||{});return this;},_attachDatepicker:function(target,settings){var nodeName,inline,inst;nodeName=target.nodeName.toLowerCase();inline=(nodeName==="div"||nodeName==="span");if(!target.id){this.uuid+=1;target.id="dp"+this.uuid;}
inst=this._newInst($(target),inline);inst.settings=$.extend({},settings||{});if(nodeName==="input"){this._connectDatepicker(target,inst);}else if(inline){this._inlineDatepicker(target,inst);}},_newInst:function(target,inline){var id=target[0].id.replace(/([^A-Za-z0-9_\-])/g,"\\\\$1");return{id:id,input:target,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:inline,dpDiv:(!inline?this.dpDiv:datepicker_bindHover($("<div class='"+this._inlineClass+" ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>")))};},_connectDatepicker:function(target,inst){var input=$(target);inst.append=$([]);inst.trigger=$([]);if(input.hasClass(this.markerClassName)){return;}
this._attachments(input,inst);input.addClass(this.markerClassName).on("keydown",this._doKeyDown).on("keypress",this._doKeyPress).on("keyup",this._doKeyUp);this._autoSize(inst);$.data(target,"datepicker",inst);if(inst.settings.disabled){this._disableDatepicker(target);}},_attachments:function(input,inst){var showOn,buttonText,buttonImage,appendText=this._get(inst,"appendText"),isRTL=this._get(inst,"isRTL");if(inst.append){inst.append.remove();}
if(appendText){inst.append=$("<span>").addClass(this._appendClass).text(appendText);input[isRTL?"before":"after"](inst.append);}
input.off("focus",this._showDatepicker);if(inst.trigger){inst.trigger.remove();}
showOn=this._get(inst,"showOn");if(showOn==="focus"||showOn==="both"){input.on("focus",this._showDatepicker);}
if(showOn==="button"||showOn==="both"){buttonText=this._get(inst,"buttonText");buttonImage=this._get(inst,"buttonImage");if(this._get(inst,"buttonImageOnly")){inst.trigger=$("<img>").addClass(this._triggerClass).attr({src:buttonImage,alt:buttonText,title:buttonText});}else{inst.trigger=$("<button type='button'>").addClass(this._triggerClass);if(buttonImage){inst.trigger.html($("<img>").attr({src:buttonImage,alt:buttonText,title:buttonText}));}else{inst.trigger.text(buttonText);}}
input[isRTL?"before":"after"](inst.trigger);inst.trigger.on("click",function(){if($.datepicker._datepickerShowing&&$.datepicker._lastInput===input[0]){$.datepicker._hideDatepicker();}else if($.datepicker._datepickerShowing&&$.datepicker._lastInput!==input[0]){$.datepicker._hideDatepicker();$.datepicker._showDatepicker(input[0]);}else{$.datepicker._showDatepicker(input[0]);}
return false;});}},_autoSize:function(inst){if(this._get(inst,"autoSize")&&!inst.inline){var findMax,max,maxI,i,date=new Date(2009,12-1,20),dateFormat=this._get(inst,"dateFormat");if(dateFormat.match(/[DM]/)){findMax=function(names){max=0;maxI=0;for(i=0;i<names.length;i++){if(names[i].length>max){max=names[i].length;maxI=i;}}
return maxI;};date.setMonth(findMax(this._get(inst,(dateFormat.match(/MM/)?"monthNames":"monthNamesShort"))));date.setDate(findMax(this._get(inst,(dateFormat.match(/DD/)?"dayNames":"dayNamesShort")))+20-date.getDay());}
inst.input.attr("size",this._formatDate(inst,date).length);}},_inlineDatepicker:function(target,inst){var divSpan=$(target);if(divSpan.hasClass(this.markerClassName)){return;}
divSpan.addClass(this.markerClassName).append(inst.dpDiv);$.data(target,"datepicker",inst);this._setDate(inst,this._getDefaultDate(inst),true);this._updateDatepicker(inst);this._updateAlternate(inst);if(inst.settings.disabled){this._disableDatepicker(target);}
inst.dpDiv.css("display","block");},_dialogDatepicker:function(input,date,onSelect,settings,pos){var id,browserWidth,browserHeight,scrollX,scrollY,inst=this._dialogInst;if(!inst){this.uuid+=1;id="dp"+this.uuid;this._dialogInput=$("<input type='text' id='"+id+"' style='position: absolute; top: -100px; width: 0px;'/>");this._dialogInput.on("keydown",this._doKeyDown);$("body").append(this._dialogInput);inst=this._dialogInst=this._newInst(this._dialogInput,false);inst.settings={};$.data(this._dialogInput[0],"datepicker",inst);}
datepicker_extendRemove(inst.settings,settings||{});date=(date&&date.constructor===Date?this._formatDate(inst,date):date);this._dialogInput.val(date);this._pos=(pos?(pos.length?pos:[pos.pageX,pos.pageY]):null);if(!this._pos){browserWidth=document.documentElement.clientWidth;browserHeight=document.documentElement.clientHeight;scrollX=document.documentElement.scrollLeft||document.body.scrollLeft;scrollY=document.documentElement.scrollTop||document.body.scrollTop;this._pos=[(browserWidth / 2)-100+scrollX,(browserHeight / 2)-150+scrollY];}
this._dialogInput.css("left",(this._pos[0]+20)+"px").css("top",this._pos[1]+"px");inst.settings.onSelect=onSelect;this._inDialog=true;this.dpDiv.addClass(this._dialogClass);this._showDatepicker(this._dialogInput[0]);if($.blockUI){$.blockUI(this.dpDiv);}
$.data(this._dialogInput[0],"datepicker",inst);return this;},_destroyDatepicker:function(target){var nodeName,$target=$(target),inst=$.data(target,"datepicker");if(!$target.hasClass(this.markerClassName)){return;}
nodeName=target.nodeName.toLowerCase();$.removeData(target,"datepicker");if(nodeName==="input"){inst.append.remove();inst.trigger.remove();$target.removeClass(this.markerClassName).off("focus",this._showDatepicker).off("keydown",this._doKeyDown).off("keypress",this._doKeyPress).off("keyup",this._doKeyUp);}else if(nodeName==="div"||nodeName==="span"){$target.removeClass(this.markerClassName).empty();}
if(datepicker_instActive===inst){datepicker_instActive=null;this._curInst=null;}},_enableDatepicker:function(target){var nodeName,inline,$target=$(target),inst=$.data(target,"datepicker");if(!$target.hasClass(this.markerClassName)){return;}
nodeName=target.nodeName.toLowerCase();if(nodeName==="input"){target.disabled=false;inst.trigger.filter("button").each(function(){this.disabled=false;}).end().filter("img").css({opacity:"1.0",cursor:""});}else if(nodeName==="div"||nodeName==="span"){inline=$target.children("."+this._inlineClass);inline.children().removeClass("ui-state-disabled");inline.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",false);}
this._disabledInputs=$.map(this._disabledInputs,function(value){return(value===target?null:value);});},_disableDatepicker:function(target){var nodeName,inline,$target=$(target),inst=$.data(target,"datepicker");if(!$target.hasClass(this.markerClassName)){return;}
nodeName=target.nodeName.toLowerCase();if(nodeName==="input"){target.disabled=true;inst.trigger.filter("button").each(function(){this.disabled=true;}).end().filter("img").css({opacity:"0.5",cursor:"default"});}else if(nodeName==="div"||nodeName==="span"){inline=$target.children("."+this._inlineClass);inline.children().addClass("ui-state-disabled");inline.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",true);}
this._disabledInputs=$.map(this._disabledInputs,function(value){return(value===target?null:value);});this._disabledInputs[this._disabledInputs.length]=target;},_isDisabledDatepicker:function(target){if(!target){return false;}
for(var i=0;i<this._disabledInputs.length;i++){if(this._disabledInputs[i]===target){return true;}}
return false;},_getInst:function(target){try{return $.data(target,"datepicker");}catch(err){throw"Missing instance data for this datepicker";}},_optionDatepicker:function(target,name,value){var settings,date,minDate,maxDate,inst=this._getInst(target);if(arguments.length===2&&typeof name==="string"){return(name==="defaults"?$.extend({},$.datepicker._defaults):(inst?(name==="all"?$.extend({},inst.settings):this._get(inst,name)):null));}
settings=name||{};if(typeof name==="string"){settings={};settings[name]=value;}
if(inst){if(this._curInst===inst){this._hideDatepicker();}
date=this._getDateDatepicker(target,true);minDate=this._getMinMaxDate(inst,"min");maxDate=this._getMinMaxDate(inst,"max");datepicker_extendRemove(inst.settings,settings);if(minDate!==null&&settings.dateFormat!==undefined&&settings.minDate===undefined){inst.settings.minDate=this._formatDate(inst,minDate);}
if(maxDate!==null&&settings.dateFormat!==undefined&&settings.maxDate===undefined){inst.settings.maxDate=this._formatDate(inst,maxDate);}
if("disabled"in settings){if(settings.disabled){this._disableDatepicker(target);}else{this._enableDatepicker(target);}}
this._attachments($(target),inst);this._autoSize(inst);this._setDate(inst,date);this._updateAlternate(inst);this._updateDatepicker(inst);}},_changeDatepicker:function(target,name,value){this._optionDatepicker(target,name,value);},_refreshDatepicker:function(target){var inst=this._getInst(target);if(inst){this._updateDatepicker(inst);}},_setDateDatepicker:function(target,date){var inst=this._getInst(target);if(inst){this._setDate(inst,date);this._updateDatepicker(inst);this._updateAlternate(inst);}},_getDateDatepicker:function(target,noDefault){var inst=this._getInst(target);if(inst&&!inst.inline){this._setDateFromField(inst,noDefault);}
return(inst?this._getDate(inst):null);},_doKeyDown:function(event){var onSelect,dateStr,sel,inst=$.datepicker._getInst(event.target),handled=true,isRTL=inst.dpDiv.is(".ui-datepicker-rtl");inst._keyEvent=true;if($.datepicker._datepickerShowing){switch(event.keyCode){case 9:$.datepicker._hideDatepicker();handled=false;break;case 13:sel=$("td."+$.datepicker._dayOverClass+":not(."+
$.datepicker._currentClass+")",inst.dpDiv);if(sel[0]){$.datepicker._selectDay(event.target,inst.selectedMonth,inst.selectedYear,sel[0]);}
onSelect=$.datepicker._get(inst,"onSelect");if(onSelect){dateStr=$.datepicker._formatDate(inst);onSelect.apply((inst.input?inst.input[0]:null),[dateStr,inst]);}else{$.datepicker._hideDatepicker();}
return false;case 27:$.datepicker._hideDatepicker();break;case 33:$.datepicker._adjustDate(event.target,(event.ctrlKey?-$.datepicker._get(inst,"stepBigMonths"):-$.datepicker._get(inst,"stepMonths")),"M");break;case 34:$.datepicker._adjustDate(event.target,(event.ctrlKey?+$.datepicker._get(inst,"stepBigMonths"):+$.datepicker._get(inst,"stepMonths")),"M");break;case 35:if(event.ctrlKey||event.metaKey){$.datepicker._clearDate(event.target);}
handled=event.ctrlKey||event.metaKey;break;case 36:if(event.ctrlKey||event.metaKey){$.datepicker._gotoToday(event.target);}
handled=event.ctrlKey||event.metaKey;break;case 37:if(event.ctrlKey||event.metaKey){$.datepicker._adjustDate(event.target,(isRTL?+1:-1),"D");}
handled=event.ctrlKey||event.metaKey;if(event.originalEvent.altKey){$.datepicker._adjustDate(event.target,(event.ctrlKey?-$.datepicker._get(inst,"stepBigMonths"):-$.datepicker._get(inst,"stepMonths")),"M");}
break;case 38:if(event.ctrlKey||event.metaKey){$.datepicker._adjustDate(event.target,-7,"D");}
handled=event.ctrlKey||event.metaKey;break;case 39:if(event.ctrlKey||event.metaKey){$.datepicker._adjustDate(event.target,(isRTL?-1:+1),"D");}
handled=event.ctrlKey||event.metaKey;if(event.originalEvent.altKey){$.datepicker._adjustDate(event.target,(event.ctrlKey?+$.datepicker._get(inst,"stepBigMonths"):+$.datepicker._get(inst,"stepMonths")),"M");}
break;case 40:if(event.ctrlKey||event.metaKey){$.datepicker._adjustDate(event.target,+7,"D");}
handled=event.ctrlKey||event.metaKey;break;default:handled=false;}}else if(event.keyCode===36&&event.ctrlKey){$.datepicker._showDatepicker(this);}else{handled=false;}
if(handled){event.preventDefault();event.stopPropagation();}},_doKeyPress:function(event){var chars,chr,inst=$.datepicker._getInst(event.target);if($.datepicker._get(inst,"constrainInput")){chars=$.datepicker._possibleChars($.datepicker._get(inst,"dateFormat"));chr=String.fromCharCode(event.charCode==null?event.keyCode:event.charCode);return event.ctrlKey||event.metaKey||(chr<" "||!chars||chars.indexOf(chr)>-1);}},_doKeyUp:function(event){var date,inst=$.datepicker._getInst(event.target);if(inst.input.val()!==inst.lastVal){try{date=$.datepicker.parseDate($.datepicker._get(inst,"dateFormat"),(inst.input?inst.input.val():null),$.datepicker._getFormatConfig(inst));if(date){$.datepicker._setDateFromField(inst);$.datepicker._updateAlternate(inst);$.datepicker._updateDatepicker(inst);}}catch(err){}}
return true;},_showDatepicker:function(input){input=input.target||input;if(input.nodeName.toLowerCase()!=="input"){input=$("input",input.parentNode)[0];}
if($.datepicker._isDisabledDatepicker(input)||$.datepicker._lastInput===input){return;}
var inst,beforeShow,beforeShowSettings,isFixed,offset,showAnim,duration;inst=$.datepicker._getInst(input);if($.datepicker._curInst&&$.datepicker._curInst!==inst){$.datepicker._curInst.dpDiv.stop(true,true);if(inst&&$.datepicker._datepickerShowing){$.datepicker._hideDatepicker($.datepicker._curInst.input[0]);}}
beforeShow=$.datepicker._get(inst,"beforeShow");beforeShowSettings=beforeShow?beforeShow.apply(input,[input,inst]):{};if(beforeShowSettings===false){return;}
datepicker_extendRemove(inst.settings,beforeShowSettings);inst.lastVal=null;$.datepicker._lastInput=input;$.datepicker._setDateFromField(inst);if($.datepicker._inDialog){input.value="";}
if(!$.datepicker._pos){$.datepicker._pos=$.datepicker._findPos(input);$.datepicker._pos[1]+=input.offsetHeight;}
isFixed=false;$(input).parents().each(function(){isFixed|=$(this).css("position")==="fixed";return!isFixed;});offset={left:$.datepicker._pos[0],top:$.datepicker._pos[1]};$.datepicker._pos=null;inst.dpDiv.empty();inst.dpDiv.css({position:"absolute",display:"block",top:"-1000px"});$.datepicker._updateDatepicker(inst);offset=$.datepicker._checkOffset(inst,offset,isFixed);inst.dpDiv.css({position:($.datepicker._inDialog&&$.blockUI?"static":(isFixed?"fixed":"absolute")),display:"none",left:offset.left+"px",top:offset.top+"px"});if(!inst.inline){showAnim=$.datepicker._get(inst,"showAnim");duration=$.datepicker._get(inst,"duration");inst.dpDiv.css("z-index",datepicker_getZindex($(input))+1);$.datepicker._datepickerShowing=true;if($.effects&&$.effects.effect[showAnim]){inst.dpDiv.show(showAnim,$.datepicker._get(inst,"showOptions"),duration);}else{inst.dpDiv[showAnim||"show"](showAnim?duration:null);}
if($.datepicker._shouldFocusInput(inst)){inst.input.trigger("focus");}
$.datepicker._curInst=inst;}},_updateDatepicker:function(inst){this.maxRows=4;datepicker_instActive=inst;inst.dpDiv.empty().append(this._generateHTML(inst));this._attachHandlers(inst);var origyearshtml,numMonths=this._getNumberOfMonths(inst),cols=numMonths[1],width=17,activeCell=inst.dpDiv.find("."+this._dayOverClass+" a"),onUpdateDatepicker=$.datepicker._get(inst,"onUpdateDatepicker");if(activeCell.length>0){datepicker_handleMouseover.apply(activeCell.get(0));}
inst.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width("");if(cols>1){inst.dpDiv.addClass("ui-datepicker-multi-"+cols).css("width",(width*cols)+"em");}
inst.dpDiv[(numMonths[0]!==1||numMonths[1]!==1?"add":"remove")+"Class"]("ui-datepicker-multi");inst.dpDiv[(this._get(inst,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl");if(inst===$.datepicker._curInst&&$.datepicker._datepickerShowing&&$.datepicker._shouldFocusInput(inst)){inst.input.trigger("focus");}
if(inst.yearshtml){origyearshtml=inst.yearshtml;setTimeout(function(){if(origyearshtml===inst.yearshtml&&inst.yearshtml){inst.dpDiv.find("select.ui-datepicker-year").first().replaceWith(inst.yearshtml);}
origyearshtml=inst.yearshtml=null;},0);}
if(onUpdateDatepicker){onUpdateDatepicker.apply((inst.input?inst.input[0]:null),[inst]);}},_shouldFocusInput:function(inst){return inst.input&&inst.input.is(":visible")&&!inst.input.is(":disabled")&&!inst.input.is(":focus");},_checkOffset:function(inst,offset,isFixed){var dpWidth=inst.dpDiv.outerWidth(),dpHeight=inst.dpDiv.outerHeight(),inputWidth=inst.input?inst.input.outerWidth():0,inputHeight=inst.input?inst.input.outerHeight():0,viewWidth=document.documentElement.clientWidth+(isFixed?0:$(document).scrollLeft()),viewHeight=document.documentElement.clientHeight+(isFixed?0:$(document).scrollTop());offset.left-=(this._get(inst,"isRTL")?(dpWidth-inputWidth):0);offset.left-=(isFixed&&offset.left===inst.input.offset().left)?$(document).scrollLeft():0;offset.top-=(isFixed&&offset.top===(inst.input.offset().top+inputHeight))?$(document).scrollTop():0;offset.left-=Math.min(offset.left,(offset.left+dpWidth>viewWidth&&viewWidth>dpWidth)?Math.abs(offset.left+dpWidth-viewWidth):0);offset.top-=Math.min(offset.top,(offset.top+dpHeight>viewHeight&&viewHeight>dpHeight)?Math.abs(dpHeight+inputHeight):0);return offset;},_findPos:function(obj){var position,inst=this._getInst(obj),isRTL=this._get(inst,"isRTL");while(obj&&(obj.type==="hidden"||obj.nodeType!==1||$.expr.pseudos.hidden(obj))){obj=obj[isRTL?"previousSibling":"nextSibling"];}
position=$(obj).offset();return[position.left,position.top];},_hideDatepicker:function(input){var showAnim,duration,postProcess,onClose,inst=this._curInst;if(!inst||(input&&inst!==$.data(input,"datepicker"))){return;}
if(this._datepickerShowing){showAnim=this._get(inst,"showAnim");duration=this._get(inst,"duration");postProcess=function(){$.datepicker._tidyDialog(inst);};if($.effects&&($.effects.effect[showAnim]||$.effects[showAnim])){inst.dpDiv.hide(showAnim,$.datepicker._get(inst,"showOptions"),duration,postProcess);}else{inst.dpDiv[(showAnim==="slideDown"?"slideUp":(showAnim==="fadeIn"?"fadeOut":"hide"))]((showAnim?duration:null),postProcess);}
if(!showAnim){postProcess();}
this._datepickerShowing=false;onClose=this._get(inst,"onClose");if(onClose){onClose.apply((inst.input?inst.input[0]:null),[(inst.input?inst.input.val():""),inst]);}
this._lastInput=null;if(this._inDialog){this._dialogInput.css({position:"absolute",left:"0",top:"-100px"});if($.blockUI){$.unblockUI();$("body").append(this.dpDiv);}}
this._inDialog=false;}},_tidyDialog:function(inst){inst.dpDiv.removeClass(this._dialogClass).off(".ui-datepicker-calendar");},_checkExternalClick:function(event){if(!$.datepicker._curInst){return;}
var $target=$(event.target),inst=$.datepicker._getInst($target[0]);if((($target[0].id!==$.datepicker._mainDivId&&$target.parents("#"+$.datepicker._mainDivId).length===0&&!$target.hasClass($.datepicker.markerClassName)&&!$target.closest("."+$.datepicker._triggerClass).length&&$.datepicker._datepickerShowing&&!($.datepicker._inDialog&&$.blockUI)))||($target.hasClass($.datepicker.markerClassName)&&$.datepicker._curInst!==inst)){$.datepicker._hideDatepicker();}},_adjustDate:function(id,offset,period){var target=$(id),inst=this._getInst(target[0]);if(this._isDisabledDatepicker(target[0])){return;}
this._adjustInstDate(inst,offset,period);this._updateDatepicker(inst);},_gotoToday:function(id){var date,target=$(id),inst=this._getInst(target[0]);if(this._get(inst,"gotoCurrent")&&inst.currentDay){inst.selectedDay=inst.currentDay;inst.drawMonth=inst.selectedMonth=inst.currentMonth;inst.drawYear=inst.selectedYear=inst.currentYear;}else{date=new Date();inst.selectedDay=date.getDate();inst.drawMonth=inst.selectedMonth=date.getMonth();inst.drawYear=inst.selectedYear=date.getFullYear();}
this._notifyChange(inst);this._adjustDate(target);},_selectMonthYear:function(id,select,period){var target=$(id),inst=this._getInst(target[0]);inst["selected"+(period==="M"?"Month":"Year")]=inst["draw"+(period==="M"?"Month":"Year")]=parseInt(select.options[select.selectedIndex].value,10);this._notifyChange(inst);this._adjustDate(target);},_selectDay:function(id,month,year,td){var inst,target=$(id);if($(td).hasClass(this._unselectableClass)||this._isDisabledDatepicker(target[0])){return;}
inst=this._getInst(target[0]);inst.selectedDay=inst.currentDay=parseInt($("a",td).attr("data-date"));inst.selectedMonth=inst.currentMonth=month;inst.selectedYear=inst.currentYear=year;this._selectDate(id,this._formatDate(inst,inst.currentDay,inst.currentMonth,inst.currentYear));},_clearDate:function(id){var target=$(id);this._selectDate(target,"");},_selectDate:function(id,dateStr){var onSelect,target=$(id),inst=this._getInst(target[0]);dateStr=(dateStr!=null?dateStr:this._formatDate(inst));if(inst.input){inst.input.val(dateStr);}
this._updateAlternate(inst);onSelect=this._get(inst,"onSelect");if(onSelect){onSelect.apply((inst.input?inst.input[0]:null),[dateStr,inst]);}else if(inst.input){inst.input.trigger("change");}
if(inst.inline){this._updateDatepicker(inst);}else{this._hideDatepicker();this._lastInput=inst.input[0];if(typeof(inst.input[0])!=="object"){inst.input.trigger("focus");}
this._lastInput=null;}},_updateAlternate:function(inst){var altFormat,date,dateStr,altField=this._get(inst,"altField");if(altField){altFormat=this._get(inst,"altFormat")||this._get(inst,"dateFormat");date=this._getDate(inst);dateStr=this.formatDate(altFormat,date,this._getFormatConfig(inst));$(document).find(altField).val(dateStr);}},noWeekends:function(date){var day=date.getDay();return[(day>0&&day<6),""];},iso8601Week:function(date){var time,checkDate=new Date(date.getTime());checkDate.setDate(checkDate.getDate()+4-(checkDate.getDay()||7));time=checkDate.getTime();checkDate.setMonth(0);checkDate.setDate(1);return Math.floor(Math.round((time-checkDate)/ 86400000)/ 7)+1;},parseDate:function(format,value,settings){if(format==null||value==null){throw"Invalid arguments";}
value=(typeof value==="object"?value.toString():value+"");if(value===""){return null;}
var iFormat,dim,extra,iValue=0,shortYearCutoffTemp=(settings?settings.shortYearCutoff:null)||this._defaults.shortYearCutoff,shortYearCutoff=(typeof shortYearCutoffTemp!=="string"?shortYearCutoffTemp:new Date().getFullYear()%100+parseInt(shortYearCutoffTemp,10)),dayNamesShort=(settings?settings.dayNamesShort:null)||this._defaults.dayNamesShort,dayNames=(settings?settings.dayNames:null)||this._defaults.dayNames,monthNamesShort=(settings?settings.monthNamesShort:null)||this._defaults.monthNamesShort,monthNames=(settings?settings.monthNames:null)||this._defaults.monthNames,year=-1,month=-1,day=-1,doy=-1,literal=false,date,lookAhead=function(match){var matches=(iFormat+1<format.length&&format.charAt(iFormat+1)===match);if(matches){iFormat++;}
return matches;},getNumber=function(match){var isDoubled=lookAhead(match),size=(match==="@"?14:(match==="!"?20:(match==="y"&&isDoubled?4:(match==="o"?3:2)))),minSize=(match==="y"?size:1),digits=new RegExp("^\\d{"+minSize+","+size+"}"),num=value.substring(iValue).match(digits);if(!num){throw"Missing number at position "+iValue;}
iValue+=num[0].length;return parseInt(num[0],10);},getName=function(match,shortNames,longNames){var index=-1,names=$.map(lookAhead(match)?longNames:shortNames,function(v,k){return[[k,v]];}).sort(function(a,b){return-(a[1].length-b[1].length);});$.each(names,function(i,pair){var name=pair[1];if(value.substr(iValue,name.length).toLowerCase()===name.toLowerCase()){index=pair[0];iValue+=name.length;return false;}});if(index!==-1){return index+1;}else{throw"Unknown name at position "+iValue;}},checkLiteral=function(){if(value.charAt(iValue)!==format.charAt(iFormat)){throw"Unexpected literal at position "+iValue;}
iValue++;};for(iFormat=0;iFormat<format.length;iFormat++){if(literal){if(format.charAt(iFormat)==="'"&&!lookAhead("'")){literal=false;}else{checkLiteral();}}else{switch(format.charAt(iFormat)){case"d":day=getNumber("d");break;case"D":getName("D",dayNamesShort,dayNames);break;case"o":doy=getNumber("o");break;case"m":month=getNumber("m");break;case"M":month=getName("M",monthNamesShort,monthNames);break;case"y":year=getNumber("y");break;case"@":date=new Date(getNumber("@"));year=date.getFullYear();month=date.getMonth()+1;day=date.getDate();break;case"!":date=new Date((getNumber("!")-this._ticksTo1970)/ 10000);year=date.getFullYear();month=date.getMonth()+1;day=date.getDate();break;case"'":if(lookAhead("'")){checkLiteral();}else{literal=true;}
break;default:checkLiteral();}}}
if(iValue<value.length){extra=value.substr(iValue);if(!/^\s+/.test(extra)){throw"Extra/unparsed characters found in date: "+extra;}}
if(year===-1){year=new Date().getFullYear();}else if(year<100){year+=new Date().getFullYear()-new Date().getFullYear()%100+
(year<=shortYearCutoff?0:-100);}
if(doy>-1){month=1;day=doy;do{dim=this._getDaysInMonth(year,month-1);if(day<=dim){break;}
month++;day-=dim;}while(true);}
date=this._daylightSavingAdjust(new Date(year,month-1,day));if(date.getFullYear()!==year||date.getMonth()+1!==month||date.getDate()!==day){throw"Invalid date";}
return date;},ATOM:"yy-mm-dd",COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TICKS:"!",TIMESTAMP:"@",W3C:"yy-mm-dd",_ticksTo1970:(((1970-1)*365+Math.floor(1970 / 4)-Math.floor(1970 / 100)+
Math.floor(1970 / 400))*24*60*60*10000000),formatDate:function(format,date,settings){if(!date){return"";}
var iFormat,dayNamesShort=(settings?settings.dayNamesShort:null)||this._defaults.dayNamesShort,dayNames=(settings?settings.dayNames:null)||this._defaults.dayNames,monthNamesShort=(settings?settings.monthNamesShort:null)||this._defaults.monthNamesShort,monthNames=(settings?settings.monthNames:null)||this._defaults.monthNames,lookAhead=function(match){var matches=(iFormat+1<format.length&&format.charAt(iFormat+1)===match);if(matches){iFormat++;}
return matches;},formatNumber=function(match,value,len){var num=""+value;if(lookAhead(match)){while(num.length<len){num="0"+num;}}
return num;},formatName=function(match,value,shortNames,longNames){return(lookAhead(match)?longNames[value]:shortNames[value]);},output="",literal=false;if(date){for(iFormat=0;iFormat<format.length;iFormat++){if(literal){if(format.charAt(iFormat)==="'"&&!lookAhead("'")){literal=false;}else{output+=format.charAt(iFormat);}}else{switch(format.charAt(iFormat)){case"d":output+=formatNumber("d",date.getDate(),2);break;case"D":output+=formatName("D",date.getDay(),dayNamesShort,dayNames);break;case"o":output+=formatNumber("o",Math.round((new Date(date.getFullYear(),date.getMonth(),date.getDate()).getTime()-new Date(date.getFullYear(),0,0).getTime())/ 86400000),3);break;case"m":output+=formatNumber("m",date.getMonth()+1,2);break;case"M":output+=formatName("M",date.getMonth(),monthNamesShort,monthNames);break;case"y":output+=(lookAhead("y")?date.getFullYear():(date.getFullYear()%100<10?"0":"")+date.getFullYear()%100);break;case"@":output+=date.getTime();break;case"!":output+=date.getTime()*10000+this._ticksTo1970;break;case"'":if(lookAhead("'")){output+="'";}else{literal=true;}
break;default:output+=format.charAt(iFormat);}}}}
return output;},_possibleChars:function(format){var iFormat,chars="",literal=false,lookAhead=function(match){var matches=(iFormat+1<format.length&&format.charAt(iFormat+1)===match);if(matches){iFormat++;}
return matches;};for(iFormat=0;iFormat<format.length;iFormat++){if(literal){if(format.charAt(iFormat)==="'"&&!lookAhead("'")){literal=false;}else{chars+=format.charAt(iFormat);}}else{switch(format.charAt(iFormat)){case"d":case"m":case"y":case"@":chars+="0123456789";break;case"D":case"M":return null;case"'":if(lookAhead("'")){chars+="'";}else{literal=true;}
break;default:chars+=format.charAt(iFormat);}}}
return chars;},_get:function(inst,name){return inst.settings[name]!==undefined?inst.settings[name]:this._defaults[name];},_setDateFromField:function(inst,noDefault){if(inst.input.val()===inst.lastVal){return;}
var dateFormat=this._get(inst,"dateFormat"),dates=inst.lastVal=inst.input?inst.input.val():null,defaultDate=this._getDefaultDate(inst),date=defaultDate,settings=this._getFormatConfig(inst);try{date=this.parseDate(dateFormat,dates,settings)||defaultDate;}catch(event){dates=(noDefault?"":dates);}
inst.selectedDay=date.getDate();inst.drawMonth=inst.selectedMonth=date.getMonth();inst.drawYear=inst.selectedYear=date.getFullYear();inst.currentDay=(dates?date.getDate():0);inst.currentMonth=(dates?date.getMonth():0);inst.currentYear=(dates?date.getFullYear():0);this._adjustInstDate(inst);},_getDefaultDate:function(inst){return this._restrictMinMax(inst,this._determineDate(inst,this._get(inst,"defaultDate"),new Date()));},_determineDate:function(inst,date,defaultDate){var offsetNumeric=function(offset){var date=new Date();date.setDate(date.getDate()+offset);return date;},offsetString=function(offset){try{return $.datepicker.parseDate($.datepicker._get(inst,"dateFormat"),offset,$.datepicker._getFormatConfig(inst));}catch(e){}
var date=(offset.toLowerCase().match(/^c/)?$.datepicker._getDate(inst):null)||new Date(),year=date.getFullYear(),month=date.getMonth(),day=date.getDate(),pattern=/([+\-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,matches=pattern.exec(offset);while(matches){switch(matches[2]||"d"){case"d":case"D":day+=parseInt(matches[1],10);break;case"w":case"W":day+=parseInt(matches[1],10)*7;break;case"m":case"M":month+=parseInt(matches[1],10);day=Math.min(day,$.datepicker._getDaysInMonth(year,month));break;case"y":case"Y":year+=parseInt(matches[1],10);day=Math.min(day,$.datepicker._getDaysInMonth(year,month));break;}
matches=pattern.exec(offset);}
return new Date(year,month,day);},newDate=(date==null||date===""?defaultDate:(typeof date==="string"?offsetString(date):(typeof date==="number"?(isNaN(date)?defaultDate:offsetNumeric(date)):new Date(date.getTime()))));newDate=(newDate&&newDate.toString()==="Invalid Date"?defaultDate:newDate);if(newDate){newDate.setHours(0);newDate.setMinutes(0);newDate.setSeconds(0);newDate.setMilliseconds(0);}
return this._daylightSavingAdjust(newDate);},_daylightSavingAdjust:function(date){if(!date){return null;}
date.setHours(date.getHours()>12?date.getHours()+2:0);return date;},_setDate:function(inst,date,noChange){var clear=!date,origMonth=inst.selectedMonth,origYear=inst.selectedYear,newDate=this._restrictMinMax(inst,this._determineDate(inst,date,new Date()));inst.selectedDay=inst.currentDay=newDate.getDate();inst.drawMonth=inst.selectedMonth=inst.currentMonth=newDate.getMonth();inst.drawYear=inst.selectedYear=inst.currentYear=newDate.getFullYear();if((origMonth!==inst.selectedMonth||origYear!==inst.selectedYear)&&!noChange){this._notifyChange(inst);}
this._adjustInstDate(inst);if(inst.input){inst.input.val(clear?"":this._formatDate(inst));}},_getDate:function(inst){var startDate=(!inst.currentYear||(inst.input&&inst.input.val()==="")?null:this._daylightSavingAdjust(new Date(inst.currentYear,inst.currentMonth,inst.currentDay)));return startDate;},_attachHandlers:function(inst){var stepMonths=this._get(inst,"stepMonths"),id="#"+inst.id.replace(/\\\\/g,"\\");inst.dpDiv.find("[data-handler]").map(function(){var handler={prev:function(){$.datepicker._adjustDate(id,-stepMonths,"M");},next:function(){$.datepicker._adjustDate(id,+stepMonths,"M");},hide:function(){$.datepicker._hideDatepicker();},today:function(){$.datepicker._gotoToday(id);},selectDay:function(){$.datepicker._selectDay(id,+this.getAttribute("data-month"),+this.getAttribute("data-year"),this);return false;},selectMonth:function(){$.datepicker._selectMonthYear(id,this,"M");return false;},selectYear:function(){$.datepicker._selectMonthYear(id,this,"Y");return false;}};$(this).on(this.getAttribute("data-event"),handler[this.getAttribute("data-handler")]);});},_generateHTML:function(inst){var maxDraw,prevText,prev,nextText,next,currentText,gotoDate,controls,buttonPanel,firstDay,showWeek,dayNames,dayNamesMin,monthNames,monthNamesShort,beforeShowDay,showOtherMonths,selectOtherMonths,defaultDate,html,dow,row,group,col,selectedDate,cornerClass,calender,thead,day,daysInMonth,leadDays,curRows,numRows,printDate,dRow,tbody,daySettings,otherMonth,unselectable,tempDate=new Date(),today=this._daylightSavingAdjust(new Date(tempDate.getFullYear(),tempDate.getMonth(),tempDate.getDate())),isRTL=this._get(inst,"isRTL"),showButtonPanel=this._get(inst,"showButtonPanel"),hideIfNoPrevNext=this._get(inst,"hideIfNoPrevNext"),navigationAsDateFormat=this._get(inst,"navigationAsDateFormat"),numMonths=this._getNumberOfMonths(inst),showCurrentAtPos=this._get(inst,"showCurrentAtPos"),stepMonths=this._get(inst,"stepMonths"),isMultiMonth=(numMonths[0]!==1||numMonths[1]!==1),currentDate=this._daylightSavingAdjust((!inst.currentDay?new Date(9999,9,9):new Date(inst.currentYear,inst.currentMonth,inst.currentDay))),minDate=this._getMinMaxDate(inst,"min"),maxDate=this._getMinMaxDate(inst,"max"),drawMonth=inst.drawMonth-showCurrentAtPos,drawYear=inst.drawYear;if(drawMonth<0){drawMonth+=12;drawYear--;}
if(maxDate){maxDraw=this._daylightSavingAdjust(new Date(maxDate.getFullYear(),maxDate.getMonth()-(numMonths[0]*numMonths[1])+1,maxDate.getDate()));maxDraw=(minDate&&maxDraw<minDate?minDate:maxDraw);while(this._daylightSavingAdjust(new Date(drawYear,drawMonth,1))>maxDraw){drawMonth--;if(drawMonth<0){drawMonth=11;drawYear--;}}}
inst.drawMonth=drawMonth;inst.drawYear=drawYear;prevText=this._get(inst,"prevText");prevText=(!navigationAsDateFormat?prevText:this.formatDate(prevText,this._daylightSavingAdjust(new Date(drawYear,drawMonth-stepMonths,1)),this._getFormatConfig(inst)));if(this._canAdjustMonth(inst,-1,drawYear,drawMonth)){prev=$("<a>").attr({"class":"ui-datepicker-prev ui-corner-all","data-handler":"prev","data-event":"click",title:prevText}).append($("<span>").addClass("ui-icon ui-icon-circle-triangle-"+
(isRTL?"e":"w")).text(prevText))[0].outerHTML;}else if(hideIfNoPrevNext){prev="";}else{prev=$("<a>").attr({"class":"ui-datepicker-prev ui-corner-all ui-state-disabled",title:prevText}).append($("<span>").addClass("ui-icon ui-icon-circle-triangle-"+
(isRTL?"e":"w")).text(prevText))[0].outerHTML;}
nextText=this._get(inst,"nextText");nextText=(!navigationAsDateFormat?nextText:this.formatDate(nextText,this._daylightSavingAdjust(new Date(drawYear,drawMonth+stepMonths,1)),this._getFormatConfig(inst)));if(this._canAdjustMonth(inst,+1,drawYear,drawMonth)){next=$("<a>").attr({"class":"ui-datepicker-next ui-corner-all","data-handler":"next","data-event":"click",title:nextText}).append($("<span>").addClass("ui-icon ui-icon-circle-triangle-"+
(isRTL?"w":"e")).text(nextText))[0].outerHTML;}else if(hideIfNoPrevNext){next="";}else{next=$("<a>").attr({"class":"ui-datepicker-next ui-corner-all ui-state-disabled",title:nextText}).append($("<span>").attr("class","ui-icon ui-icon-circle-triangle-"+
(isRTL?"w":"e")).text(nextText))[0].outerHTML;}
currentText=this._get(inst,"currentText");gotoDate=(this._get(inst,"gotoCurrent")&&inst.currentDay?currentDate:today);currentText=(!navigationAsDateFormat?currentText:this.formatDate(currentText,gotoDate,this._getFormatConfig(inst)));controls="";if(!inst.inline){controls=$("<button>").attr({type:"button","class":"ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all","data-handler":"hide","data-event":"click"}).text(this._get(inst,"closeText"))[0].outerHTML;}
buttonPanel="";if(showButtonPanel){buttonPanel=$("<div class='ui-datepicker-buttonpane ui-widget-content'>").append(isRTL?controls:"").append(this._isInRange(inst,gotoDate)?$("<button>").attr({type:"button","class":"ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all","data-handler":"today","data-event":"click"}).text(currentText):"").append(isRTL?"":controls)[0].outerHTML;}
firstDay=parseInt(this._get(inst,"firstDay"),10);firstDay=(isNaN(firstDay)?0:firstDay);showWeek=this._get(inst,"showWeek");dayNames=this._get(inst,"dayNames");dayNamesMin=this._get(inst,"dayNamesMin");monthNames=this._get(inst,"monthNames");monthNamesShort=this._get(inst,"monthNamesShort");beforeShowDay=this._get(inst,"beforeShowDay");showOtherMonths=this._get(inst,"showOtherMonths");selectOtherMonths=this._get(inst,"selectOtherMonths");defaultDate=this._getDefaultDate(inst);html="";for(row=0;row<numMonths[0];row++){group="";this.maxRows=4;for(col=0;col<numMonths[1];col++){selectedDate=this._daylightSavingAdjust(new Date(drawYear,drawMonth,inst.selectedDay));cornerClass=" ui-corner-all";calender="";if(isMultiMonth){calender+="<div class='ui-datepicker-group";if(numMonths[1]>1){switch(col){case 0:calender+=" ui-datepicker-group-first";cornerClass=" ui-corner-"+(isRTL?"right":"left");break;case numMonths[1]-1:calender+=" ui-datepicker-group-last";cornerClass=" ui-corner-"+(isRTL?"left":"right");break;default:calender+=" ui-datepicker-group-middle";cornerClass="";break;}}
calender+="'>";}
calender+="<div class='ui-datepicker-header ui-widget-header ui-helper-clearfix"+cornerClass+"'>"+
(/all|left/.test(cornerClass)&&row===0?(isRTL?next:prev):"")+
(/all|right/.test(cornerClass)&&row===0?(isRTL?prev:next):"")+
this._generateMonthYearHeader(inst,drawMonth,drawYear,minDate,maxDate,row>0||col>0,monthNames,monthNamesShort)+"</div><table class='ui-datepicker-calendar'><thead>"+"<tr>";thead=(showWeek?"<th class='ui-datepicker-week-col'>"+this._get(inst,"weekHeader")+"</th>":"");for(dow=0;dow<7;dow++){day=(dow+firstDay)%7;thead+="<th scope='col'"+((dow+firstDay+6)%7>=5?" class='ui-datepicker-week-end'":"")+">"+"<span title='"+dayNames[day]+"'>"+dayNamesMin[day]+"</span></th>";}
calender+=thead+"</tr></thead><tbody>";daysInMonth=this._getDaysInMonth(drawYear,drawMonth);if(drawYear===inst.selectedYear&&drawMonth===inst.selectedMonth){inst.selectedDay=Math.min(inst.selectedDay,daysInMonth);}
leadDays=(this._getFirstDayOfMonth(drawYear,drawMonth)-firstDay+7)%7;curRows=Math.ceil((leadDays+daysInMonth)/ 7);numRows=(isMultiMonth?this.maxRows>curRows?this.maxRows:curRows:curRows);this.maxRows=numRows;printDate=this._daylightSavingAdjust(new Date(drawYear,drawMonth,1-leadDays));for(dRow=0;dRow<numRows;dRow++){calender+="<tr>";tbody=(!showWeek?"":"<td class='ui-datepicker-week-col'>"+
this._get(inst,"calculateWeek")(printDate)+"</td>");for(dow=0;dow<7;dow++){daySettings=(beforeShowDay?beforeShowDay.apply((inst.input?inst.input[0]:null),[printDate]):[true,""]);otherMonth=(printDate.getMonth()!==drawMonth);unselectable=(otherMonth&&!selectOtherMonths)||!daySettings[0]||(minDate&&printDate<minDate)||(maxDate&&printDate>maxDate);tbody+="<td class='"+
((dow+firstDay+6)%7>=5?" ui-datepicker-week-end":"")+
(otherMonth?" ui-datepicker-other-month":"")+
((printDate.getTime()===selectedDate.getTime()&&drawMonth===inst.selectedMonth&&inst._keyEvent)||(defaultDate.getTime()===printDate.getTime()&&defaultDate.getTime()===selectedDate.getTime())?" "+this._dayOverClass:"")+
(unselectable?" "+this._unselectableClass+" ui-state-disabled":"")+
(otherMonth&&!showOtherMonths?"":" "+daySettings[1]+
(printDate.getTime()===currentDate.getTime()?" "+this._currentClass:"")+
(printDate.getTime()===today.getTime()?" ui-datepicker-today":""))+"'"+
((!otherMonth||showOtherMonths)&&daySettings[2]?" title='"+daySettings[2].replace(/'/g,"&#39;")+"'":"")+
(unselectable?"":" data-handler='selectDay' data-event='click' data-month='"+printDate.getMonth()+"' data-year='"+printDate.getFullYear()+"'")+">"+
(otherMonth&&!showOtherMonths?"&#xa0;":(unselectable?"<span class='ui-state-default'>"+printDate.getDate()+"</span>":"<a class='ui-state-default"+
(printDate.getTime()===today.getTime()?" ui-state-highlight":"")+
(printDate.getTime()===currentDate.getTime()?" ui-state-active":"")+
(otherMonth?" ui-priority-secondary":"")+"' href='#' aria-current='"+(printDate.getTime()===currentDate.getTime()?"true":"false")+"' data-date='"+printDate.getDate()+"'>"+printDate.getDate()+"</a>"))+"</td>";printDate.setDate(printDate.getDate()+1);printDate=this._daylightSavingAdjust(printDate);}
calender+=tbody+"</tr>";}
drawMonth++;if(drawMonth>11){drawMonth=0;drawYear++;}
calender+="</tbody></table>"+(isMultiMonth?"</div>"+
((numMonths[0]>0&&col===numMonths[1]-1)?"<div class='ui-datepicker-row-break'></div>":""):"");group+=calender;}
html+=group;}
html+=buttonPanel;inst._keyEvent=false;return html;},_generateMonthYearHeader:function(inst,drawMonth,drawYear,minDate,maxDate,secondary,monthNames,monthNamesShort){var inMinYear,inMaxYear,month,years,thisYear,determineYear,year,endYear,changeMonth=this._get(inst,"changeMonth"),changeYear=this._get(inst,"changeYear"),showMonthAfterYear=this._get(inst,"showMonthAfterYear"),selectMonthLabel=this._get(inst,"selectMonthLabel"),selectYearLabel=this._get(inst,"selectYearLabel"),html="<div class='ui-datepicker-title'>",monthHtml="";if(secondary||!changeMonth){monthHtml+="<span class='ui-datepicker-month'>"+monthNames[drawMonth]+"</span>";}else{inMinYear=(minDate&&minDate.getFullYear()===drawYear);inMaxYear=(maxDate&&maxDate.getFullYear()===drawYear);monthHtml+="<select class='ui-datepicker-month' aria-label='"+selectMonthLabel+"' data-handler='selectMonth' data-event='change'>";for(month=0;month<12;month++){if((!inMinYear||month>=minDate.getMonth())&&(!inMaxYear||month<=maxDate.getMonth())){monthHtml+="<option value='"+month+"'"+
(month===drawMonth?" selected='selected'":"")+">"+monthNamesShort[month]+"</option>";}}
monthHtml+="</select>";}
if(!showMonthAfterYear){html+=monthHtml+(secondary||!(changeMonth&&changeYear)?"&#xa0;":"");}
if(!inst.yearshtml){inst.yearshtml="";if(secondary||!changeYear){html+="<span class='ui-datepicker-year'>"+drawYear+"</span>";}else{years=this._get(inst,"yearRange").split(":");thisYear=new Date().getFullYear();determineYear=function(value){var year=(value.match(/c[+\-].*/)?drawYear+parseInt(value.substring(1),10):(value.match(/[+\-].*/)?thisYear+parseInt(value,10):parseInt(value,10)));return(isNaN(year)?thisYear:year);};year=determineYear(years[0]);endYear=Math.max(year,determineYear(years[1]||""));year=(minDate?Math.max(year,minDate.getFullYear()):year);endYear=(maxDate?Math.min(endYear,maxDate.getFullYear()):endYear);inst.yearshtml+="<select class='ui-datepicker-year' aria-label='"+selectYearLabel+"' data-handler='selectYear' data-event='change'>";for(;year<=endYear;year++){inst.yearshtml+="<option value='"+year+"'"+
(year===drawYear?" selected='selected'":"")+">"+year+"</option>";}
inst.yearshtml+="</select>";html+=inst.yearshtml;inst.yearshtml=null;}}
html+=this._get(inst,"yearSuffix");if(showMonthAfterYear){html+=(secondary||!(changeMonth&&changeYear)?"&#xa0;":"")+monthHtml;}
html+="</div>";return html;},_adjustInstDate:function(inst,offset,period){var year=inst.selectedYear+(period==="Y"?offset:0),month=inst.selectedMonth+(period==="M"?offset:0),day=Math.min(inst.selectedDay,this._getDaysInMonth(year,month))+(period==="D"?offset:0),date=this._restrictMinMax(inst,this._daylightSavingAdjust(new Date(year,month,day)));inst.selectedDay=date.getDate();inst.drawMonth=inst.selectedMonth=date.getMonth();inst.drawYear=inst.selectedYear=date.getFullYear();if(period==="M"||period==="Y"){this._notifyChange(inst);}},_restrictMinMax:function(inst,date){var minDate=this._getMinMaxDate(inst,"min"),maxDate=this._getMinMaxDate(inst,"max"),newDate=(minDate&&date<minDate?minDate:date);return(maxDate&&newDate>maxDate?maxDate:newDate);},_notifyChange:function(inst){var onChange=this._get(inst,"onChangeMonthYear");if(onChange){onChange.apply((inst.input?inst.input[0]:null),[inst.selectedYear,inst.selectedMonth+1,inst]);}},_getNumberOfMonths:function(inst){var numMonths=this._get(inst,"numberOfMonths");return(numMonths==null?[1,1]:(typeof numMonths==="number"?[1,numMonths]:numMonths));},_getMinMaxDate:function(inst,minMax){return this._determineDate(inst,this._get(inst,minMax+"Date"),null);},_getDaysInMonth:function(year,month){return 32-this._daylightSavingAdjust(new Date(year,month,32)).getDate();},_getFirstDayOfMonth:function(year,month){return new Date(year,month,1).getDay();},_canAdjustMonth:function(inst,offset,curYear,curMonth){var numMonths=this._getNumberOfMonths(inst),date=this._daylightSavingAdjust(new Date(curYear,curMonth+(offset<0?offset:numMonths[0]*numMonths[1]),1));if(offset<0){date.setDate(this._getDaysInMonth(date.getFullYear(),date.getMonth()));}
return this._isInRange(inst,date);},_isInRange:function(inst,date){var yearSplit,currentYear,minDate=this._getMinMaxDate(inst,"min"),maxDate=this._getMinMaxDate(inst,"max"),minYear=null,maxYear=null,years=this._get(inst,"yearRange");if(years){yearSplit=years.split(":");currentYear=new Date().getFullYear();minYear=parseInt(yearSplit[0],10);maxYear=parseInt(yearSplit[1],10);if(yearSplit[0].match(/[+\-].*/)){minYear+=currentYear;}
if(yearSplit[1].match(/[+\-].*/)){maxYear+=currentYear;}}
return((!minDate||date.getTime()>=minDate.getTime())&&(!maxDate||date.getTime()<=maxDate.getTime())&&(!minYear||date.getFullYear()>=minYear)&&(!maxYear||date.getFullYear()<=maxYear));},_getFormatConfig:function(inst){var shortYearCutoff=this._get(inst,"shortYearCutoff");shortYearCutoff=(typeof shortYearCutoff!=="string"?shortYearCutoff:new Date().getFullYear()%100+parseInt(shortYearCutoff,10));return{shortYearCutoff:shortYearCutoff,dayNamesShort:this._get(inst,"dayNamesShort"),dayNames:this._get(inst,"dayNames"),monthNamesShort:this._get(inst,"monthNamesShort"),monthNames:this._get(inst,"monthNames")};},_formatDate:function(inst,day,month,year){if(!day){inst.currentDay=inst.selectedDay;inst.currentMonth=inst.selectedMonth;inst.currentYear=inst.selectedYear;}
var date=(day?(typeof day==="object"?day:this._daylightSavingAdjust(new Date(year,month,day))):this._daylightSavingAdjust(new Date(inst.currentYear,inst.currentMonth,inst.currentDay)));return this.formatDate(this._get(inst,"dateFormat"),date,this._getFormatConfig(inst));}});function datepicker_bindHover(dpDiv){var selector="button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a";return dpDiv.on("mouseout",selector,function(){$(this).removeClass("ui-state-hover");if(this.className.indexOf("ui-datepicker-prev")!==-1){$(this).removeClass("ui-datepicker-prev-hover");}
if(this.className.indexOf("ui-datepicker-next")!==-1){$(this).removeClass("ui-datepicker-next-hover");}}).on("mouseover",selector,datepicker_handleMouseover);}
function datepicker_handleMouseover(){if(!$.datepicker._isDisabledDatepicker(datepicker_instActive.inline?datepicker_instActive.dpDiv.parent()[0]:datepicker_instActive.input[0])){$(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover");$(this).addClass("ui-state-hover");if(this.className.indexOf("ui-datepicker-prev")!==-1){$(this).addClass("ui-datepicker-prev-hover");}
if(this.className.indexOf("ui-datepicker-next")!==-1){$(this).addClass("ui-datepicker-next-hover");}}}
function datepicker_extendRemove(target,props){$.extend(target,props);for(var name in props){if(props[name]==null){target[name]=props[name];}}
return target;}
$.fn.datepicker=function(options){if(!this.length){return this;}
if(!$.datepicker.initialized){$(document).on("mousedown",$.datepicker._checkExternalClick);$.datepicker.initialized=true;}
if($("#"+$.datepicker._mainDivId).length===0){$("body").append($.datepicker.dpDiv);}
var otherArgs=Array.prototype.slice.call(arguments,1);if(typeof options==="string"&&(options==="isDisabled"||options==="getDate"||options==="widget")){return $.datepicker["_"+options+"Datepicker"].apply($.datepicker,[this[0]].concat(otherArgs));}
if(options==="option"&&arguments.length===2&&typeof arguments[1]==="string"){return $.datepicker["_"+options+"Datepicker"].apply($.datepicker,[this[0]].concat(otherArgs));}
return this.each(function(){if(typeof options==="string"){$.datepicker["_"+options+"Datepicker"].apply($.datepicker,[this].concat(otherArgs));}else{$.datepicker._attachDatepicker(this,options);}});};$.datepicker=new Datepicker();$.datepicker.initialized=false;$.datepicker.uuid=new Date().getTime();$.datepicker.version="1.13.2";return $.datepicker;});

View File

@@ -0,0 +1,4 @@
define(['ko','underscore','jquery','mage/translate'],function(ko,_,$,$t){'use strict';var defaults={dateFormat:'mm\/dd\/yyyy',showsTime:false,timeFormat:null,buttonImage:null,buttonImageOnly:null,buttonText:$t('Select Date')};ko.bindingHandlers.datepicker={init:function(el,valueAccessor){var config=valueAccessor(),observable,options={};_.extend(options,defaults);if(typeof config==='object'){observable=config.storage;_.extend(options,config.options);}else{observable=config;}
require(['mage/calendar'],function(){$(el).calendar(options);ko.utils.registerEventHandler(el,'change',function(){observable(this.value);});});},update:function(element,valueAccessor){var config=valueAccessor(),$element=$(element),observable,options={},newVal;_.extend(options,defaults);if(typeof config==='object'){observable=config.storage;_.extend(options,config.options);}else{observable=config;}
require(['moment','mage/utils/misc','mage/calendar'],function(moment,utils){if(_.isEmpty(observable())){newVal=null;}else{newVal=moment(observable(),utils.convertToMomentFormat(options.dateFormat+(options.showsTime?' '+options.timeFormat:''))).toDate();}
if(!options.timeOnly){$element.datepicker('setDate',newVal);$element.trigger('blur');}});}};});

View File

@@ -0,0 +1,3 @@
define(['jquery','mage/translate'],function($){var methods={list:function(isRecursive){return this.each(function(){var list=$(this),items;if(list.length>0){items=typeof isRecursive==='undefined'||isRecursive?list.find('li'):list.children();items.decorate('generic',['odd','even','last']);}});},generic:function(decoratorParams){var elements=$(this),allSupportedParams;if(elements){allSupportedParams={even:'odd',odd:'even',last:'last',first:'first'};decoratorParams=decoratorParams||allSupportedParams;$.each(decoratorParams,function(index,param){if(param==='even'||param==='odd'){elements.filter(':'+param).removeClass('odd even').addClass(allSupportedParams[param]);}else{elements.filter(':'+param).addClass(allSupportedParams[param]);}});}
return this;},table:function(instanceOptions){return this.each(function(){var table=$(this),options;if(table.length>0){options={'tbody':false,'tbody tr':['odd','even','first','last'],'thead tr':['first','last'],'tfoot tr':['first','last'],'tr td':['last']};$.extend(options,instanceOptions||{});$.each(options,function(key,value){if(options[key]){if(key==='tr td'){$.each(table.find('tr'),function(){$(this).find('td').decorate('generic',options['tr td']);});}else{table.find(key).decorate('generic',value);}}});}});},dataList:function(){return this.each(function(){var list=$(this);if(list){list.find('dt').decorate('generic',['odd','even','last']);list.find('dd').decorate('generic',['odd','even','last']);}});}};$.fn.decorate=function(method){var message;if(methods[method]){return methods[method].apply(this,Array.prototype.slice.call(arguments,1));}else if(typeof method==='object'||!method){return methods.init.apply(this,arguments);}
message=$.mage.__('Method %s does not exist on jQuery.decorate');$.error(message.replace('%s',method));};});

View File

@@ -0,0 +1 @@
define(['Magento_PaypalCaptcha/js/model/skipRefreshCaptcha'],function(skipRefreshCaptcha){'use strict';var defaultCaptchaMixin={refresh:function(){if(!skipRefreshCaptcha.skip()){this._super();}else{skipRefreshCaptcha.skip(false);}}};return function(defaultCaptcha){return defaultCaptcha.extend(defaultCaptchaMixin);};});

View File

@@ -0,0 +1,2 @@
define(['jquery','uiComponent','Magento_Captcha/js/model/captcha','Magento_Captcha/js/model/captchaList','Magento_Customer/js/customer-data','underscore'],function($,Component,Captcha,captchaList,customerData,_){'use strict';var captchaConfig;return Component.extend({defaults:{template:'Magento_Captcha/checkout/captcha'},dataScope:'global',currentCaptcha:null,subscribedFormIds:[],captchaValue:function(){return this.currentCaptcha.getCaptchaValue();},initialize:function(){this._super();if(window[this.configSource]&&window[this.configSource].captcha){captchaConfig=window[this.configSource].captcha;$.each(captchaConfig,function(formId,captchaData){var captcha;captchaData.formId=formId;captcha=Captcha(captchaData);this.checkCustomerData(formId,customerData.get('captcha')(),captcha);this.subscribeCustomerData(formId,captcha);captchaList.add(captcha);}.bind(this));}},checkCustomerData:function(formId,captchaData,captcha){if(!_.isEmpty(captchaData)&&!_.isEmpty(captchaData[formId])&&captchaData[formId].timestamp>captcha.timestamp){if(!captcha.isRequired()&&captchaData[formId].isRequired){captcha.refresh();}
captcha.isRequired(captchaData[formId].isRequired);captcha.timestamp=captchaData[formId].timestamp;}},subscribeCustomerData:function(formId,captcha){if(this.subscribedFormIds.includes(formId)===false){this.subscribedFormIds.push(formId);customerData.get('captcha').subscribe(function(captchaData){this.checkCustomerData(formId,captchaData,captcha);}.bind(this));}},getIsLoading:function(){return this.currentCaptcha!==null?this.currentCaptcha.isLoading:false;},getCurrentCaptcha:function(){return this.currentCaptcha;},setCurrentCaptcha:function(captcha){this.currentCaptcha=captcha;},getFormId:function(){return this.currentCaptcha!==null?this.currentCaptcha.getFormId():null;},getIsVisible:function(){return this.currentCaptcha!==null?this.currentCaptcha.getIsVisible():false;},setIsVisible:function(flag){this.currentCaptcha.setIsVisible(flag);},isRequired:function(){return this.currentCaptcha!==null?this.currentCaptcha.getIsRequired():false;},setIsRequired:function(flag){this.currentCaptcha.setIsRequired(flag);},isCaseSensitive:function(){return this.currentCaptcha!==null?this.currentCaptcha.getIsCaseSensitive():false;},imageHeight:function(){return this.currentCaptcha!==null?this.currentCaptcha.getImageHeight():null;},getImageSource:function(){return this.currentCaptcha!==null?this.currentCaptcha.getImageSource():null;},refresh:function(){this.currentCaptcha.refresh();}});});

View File

@@ -0,0 +1,57 @@
/*!
* jQuery UI Dialog 1.13.2
* http://jqueryui.com
*
* Copyright jQuery Foundation and other contributors
* Released under the MIT license.
* http://jquery.org/license
*/
(function(factory){"use strict";if(typeof define==="function"&&define.amd){define(["jquery","./button","./draggable","./mouse","./resizable","../focusable","../keycode","../position","../safe-active-element","../safe-blur","../tabbable","../unique-id","../version","../widget"],factory);}else{factory(jQuery);}})(function($){"use strict";$.widget("ui.dialog",{version:"1.13.2",options:{appendTo:"body",autoOpen:true,buttons:[],classes:{"ui-dialog":"ui-corner-all","ui-dialog-titlebar":"ui-corner-all"},closeOnEscape:true,closeText:"Close",draggable:true,hide:null,height:"auto",maxHeight:null,maxWidth:null,minHeight:150,minWidth:150,modal:false,position:{my:"center",at:"center",of:window,collision:"fit",using:function(pos){var topOffset=$(this).css(pos).offset().top;if(topOffset<0){$(this).css("top",pos.top-topOffset);}}},resizable:true,show:null,title:null,width:300,beforeClose:null,close:null,drag:null,dragStart:null,dragStop:null,focus:null,open:null,resize:null,resizeStart:null,resizeStop:null},sizeRelatedOptions:{buttons:true,height:true,maxHeight:true,maxWidth:true,minHeight:true,minWidth:true,width:true},resizableRelatedOptions:{maxHeight:true,maxWidth:true,minHeight:true,minWidth:true},_create:function(){this.originalCss={display:this.element[0].style.display,width:this.element[0].style.width,minHeight:this.element[0].style.minHeight,maxHeight:this.element[0].style.maxHeight,height:this.element[0].style.height};this.originalPosition={parent:this.element.parent(),index:this.element.parent().children().index(this.element)};this.originalTitle=this.element.attr("title");if(this.options.title==null&&this.originalTitle!=null){this.options.title=this.originalTitle;}
if(this.options.disabled){this.options.disabled=false;}
this._createWrapper();this.element.show().removeAttr("title").appendTo(this.uiDialog);this._addClass("ui-dialog-content","ui-widget-content");this._createTitlebar();this._createButtonPane();if(this.options.draggable&&$.fn.draggable){this._makeDraggable();}
if(this.options.resizable&&$.fn.resizable){this._makeResizable();}
this._isOpen=false;this._trackFocus();},_init:function(){if(this.options.autoOpen){this.open();}},_appendTo:function(){var element=this.options.appendTo;if(element&&(element.jquery||element.nodeType)){return $(element);}
return this.document.find(element||"body").eq(0);},_destroy:function(){var next,originalPosition=this.originalPosition;this._untrackInstance();this._destroyOverlay();this.element.removeUniqueId().css(this.originalCss).detach();this.uiDialog.remove();if(this.originalTitle){this.element.attr("title",this.originalTitle);}
next=originalPosition.parent.children().eq(originalPosition.index);if(next.length&&next[0]!==this.element[0]){next.before(this.element);}else{originalPosition.parent.append(this.element);}},widget:function(){return this.uiDialog;},disable:$.noop,enable:$.noop,close:function(event){var that=this;if(!this._isOpen||this._trigger("beforeClose",event)===false){return;}
this._isOpen=false;this._focusedElement=null;this._destroyOverlay();this._untrackInstance();if(!this.opener.filter(":focusable").trigger("focus").length){$.ui.safeBlur($.ui.safeActiveElement(this.document[0]));}
this._hide(this.uiDialog,this.options.hide,function(){that._trigger("close",event);});},isOpen:function(){return this._isOpen;},moveToTop:function(){this._moveToTop();},_moveToTop:function(event,silent){var moved=false,zIndices=this.uiDialog.siblings(".ui-front:visible").map(function(){return+$(this).css("z-index");}).get(),zIndexMax=Math.max.apply(null,zIndices);if(zIndexMax>=+this.uiDialog.css("z-index")){this.uiDialog.css("z-index",zIndexMax+1);moved=true;}
if(moved&&!silent){this._trigger("focus",event);}
return moved;},open:function(){var that=this;if(this._isOpen){if(this._moveToTop()){this._focusTabbable();}
return;}
this._isOpen=true;this.opener=$($.ui.safeActiveElement(this.document[0]));this._size();this._position();this._createOverlay();this._moveToTop(null,true);if(this.overlay){this.overlay.css("z-index",this.uiDialog.css("z-index")-1);}
this._show(this.uiDialog,this.options.show,function(){that._focusTabbable();that._trigger("focus");});this._makeFocusTarget();this._trigger("open");},_focusTabbable:function(){var hasFocus=this._focusedElement;if(!hasFocus){hasFocus=this.element.find("[autofocus]");}
if(!hasFocus.length){hasFocus=this.element.find(":tabbable");}
if(!hasFocus.length){hasFocus=this.uiDialogButtonPane.find(":tabbable");}
if(!hasFocus.length){hasFocus=this.uiDialogTitlebarClose.filter(":tabbable");}
if(!hasFocus.length){hasFocus=this.uiDialog;}
hasFocus.eq(0).trigger("focus");},_restoreTabbableFocus:function(){var activeElement=$.ui.safeActiveElement(this.document[0]),isActive=this.uiDialog[0]===activeElement||$.contains(this.uiDialog[0],activeElement);if(!isActive){this._focusTabbable();}},_keepFocus:function(event){event.preventDefault();this._restoreTabbableFocus();this._delay(this._restoreTabbableFocus);},_createWrapper:function(){this.uiDialog=$("<div>").hide().attr({tabIndex:-1,role:"dialog"}).appendTo(this._appendTo());this._addClass(this.uiDialog,"ui-dialog","ui-widget ui-widget-content ui-front");this._on(this.uiDialog,{keydown:function(event){if(this.options.closeOnEscape&&!event.isDefaultPrevented()&&event.keyCode&&event.keyCode===$.ui.keyCode.ESCAPE){event.preventDefault();this.close(event);return;}
if(event.keyCode!==$.ui.keyCode.TAB||event.isDefaultPrevented()){return;}
var tabbables=this.uiDialog.find(":tabbable"),first=tabbables.first(),last=tabbables.last();if((event.target===last[0]||event.target===this.uiDialog[0])&&!event.shiftKey){this._delay(function(){first.trigger("focus");});event.preventDefault();}else if((event.target===first[0]||event.target===this.uiDialog[0])&&event.shiftKey){this._delay(function(){last.trigger("focus");});event.preventDefault();}},mousedown:function(event){if(this._moveToTop(event)){this._focusTabbable();}}});if(!this.element.find("[aria-describedby]").length){this.uiDialog.attr({"aria-describedby":this.element.uniqueId().attr("id")});}},_createTitlebar:function(){var uiDialogTitle;this.uiDialogTitlebar=$("<div>");this._addClass(this.uiDialogTitlebar,"ui-dialog-titlebar","ui-widget-header ui-helper-clearfix");this._on(this.uiDialogTitlebar,{mousedown:function(event){if(!$(event.target).closest(".ui-dialog-titlebar-close")){this.uiDialog.trigger("focus");}}});this.uiDialogTitlebarClose=$("<button type='button'></button>").button({label:$("<a>").text(this.options.closeText).html(),icon:"ui-icon-closethick",showLabel:false}).appendTo(this.uiDialogTitlebar);this._addClass(this.uiDialogTitlebarClose,"ui-dialog-titlebar-close");this._on(this.uiDialogTitlebarClose,{click:function(event){event.preventDefault();this.close(event);}});uiDialogTitle=$("<span>").uniqueId().prependTo(this.uiDialogTitlebar);this._addClass(uiDialogTitle,"ui-dialog-title");this._title(uiDialogTitle);this.uiDialogTitlebar.prependTo(this.uiDialog);this.uiDialog.attr({"aria-labelledby":uiDialogTitle.attr("id")});},_title:function(title){if(this.options.title){title.text(this.options.title);}else{title.html("&#160;");}},_createButtonPane:function(){this.uiDialogButtonPane=$("<div>");this._addClass(this.uiDialogButtonPane,"ui-dialog-buttonpane","ui-widget-content ui-helper-clearfix");this.uiButtonSet=$("<div>").appendTo(this.uiDialogButtonPane);this._addClass(this.uiButtonSet,"ui-dialog-buttonset");this._createButtons();},_createButtons:function(){var that=this,buttons=this.options.buttons;this.uiDialogButtonPane.remove();this.uiButtonSet.empty();if($.isEmptyObject(buttons)||(Array.isArray(buttons)&&!buttons.length)){this._removeClass(this.uiDialog,"ui-dialog-buttons");return;}
$.each(buttons,function(name,props){var click,buttonOptions;props=typeof props==="function"?{click:props,text:name}:props;props=$.extend({type:"button"},props);click=props.click;buttonOptions={icon:props.icon,iconPosition:props.iconPosition,showLabel:props.showLabel,icons:props.icons,text:props.text};delete props.click;delete props.icon;delete props.iconPosition;delete props.showLabel;delete props.icons;if(typeof props.text==="boolean"){delete props.text;}
$("<button></button>",props).button(buttonOptions).appendTo(that.uiButtonSet).on("click",function(){click.apply(that.element[0],arguments);});});this._addClass(this.uiDialog,"ui-dialog-buttons");this.uiDialogButtonPane.appendTo(this.uiDialog);},_makeDraggable:function(){var that=this,options=this.options;function filteredUi(ui){return{position:ui.position,offset:ui.offset};}
this.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",handle:".ui-dialog-titlebar",containment:"document",start:function(event,ui){that._addClass($(this),"ui-dialog-dragging");that._blockFrames();that._trigger("dragStart",event,filteredUi(ui));},drag:function(event,ui){that._trigger("drag",event,filteredUi(ui));},stop:function(event,ui){var left=ui.offset.left-that.document.scrollLeft(),top=ui.offset.top-that.document.scrollTop();options.position={my:"left top",at:"left"+(left>=0?"+":"")+left+" "+"top"+(top>=0?"+":"")+top,of:that.window};that._removeClass($(this),"ui-dialog-dragging");that._unblockFrames();that._trigger("dragStop",event,filteredUi(ui));}});},_makeResizable:function(){var that=this,options=this.options,handles=options.resizable,position=this.uiDialog.css("position"),resizeHandles=typeof handles==="string"?handles:"n,e,s,w,se,sw,ne,nw";function filteredUi(ui){return{originalPosition:ui.originalPosition,originalSize:ui.originalSize,position:ui.position,size:ui.size};}
this.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:this.element,maxWidth:options.maxWidth,maxHeight:options.maxHeight,minWidth:options.minWidth,minHeight:this._minHeight(),handles:resizeHandles,start:function(event,ui){that._addClass($(this),"ui-dialog-resizing");that._blockFrames();that._trigger("resizeStart",event,filteredUi(ui));},resize:function(event,ui){that._trigger("resize",event,filteredUi(ui));},stop:function(event,ui){var offset=that.uiDialog.offset(),left=offset.left-that.document.scrollLeft(),top=offset.top-that.document.scrollTop();options.height=that.uiDialog.height();options.width=that.uiDialog.width();options.position={my:"left top",at:"left"+(left>=0?"+":"")+left+" "+"top"+(top>=0?"+":"")+top,of:that.window};that._removeClass($(this),"ui-dialog-resizing");that._unblockFrames();that._trigger("resizeStop",event,filteredUi(ui));}}).css("position",position);},_trackFocus:function(){this._on(this.widget(),{focusin:function(event){this._makeFocusTarget();this._focusedElement=$(event.target);}});},_makeFocusTarget:function(){this._untrackInstance();this._trackingInstances().unshift(this);},_untrackInstance:function(){var instances=this._trackingInstances(),exists=$.inArray(this,instances);if(exists!==-1){instances.splice(exists,1);}},_trackingInstances:function(){var instances=this.document.data("ui-dialog-instances");if(!instances){instances=[];this.document.data("ui-dialog-instances",instances);}
return instances;},_minHeight:function(){var options=this.options;return options.height==="auto"?options.minHeight:Math.min(options.minHeight,options.height);},_position:function(){var isVisible=this.uiDialog.is(":visible");if(!isVisible){this.uiDialog.show();}
this.uiDialog.position(this.options.position);if(!isVisible){this.uiDialog.hide();}},_setOptions:function(options){var that=this,resize=false,resizableOptions={};$.each(options,function(key,value){that._setOption(key,value);if(key in that.sizeRelatedOptions){resize=true;}
if(key in that.resizableRelatedOptions){resizableOptions[key]=value;}});if(resize){this._size();this._position();}
if(this.uiDialog.is(":data(ui-resizable)")){this.uiDialog.resizable("option",resizableOptions);}},_setOption:function(key,value){var isDraggable,isResizable,uiDialog=this.uiDialog;if(key==="disabled"){return;}
this._super(key,value);if(key==="appendTo"){this.uiDialog.appendTo(this._appendTo());}
if(key==="buttons"){this._createButtons();}
if(key==="closeText"){this.uiDialogTitlebarClose.button({label:$("<a>").text(""+this.options.closeText).html()});}
if(key==="draggable"){isDraggable=uiDialog.is(":data(ui-draggable)");if(isDraggable&&!value){uiDialog.draggable("destroy");}
if(!isDraggable&&value){this._makeDraggable();}}
if(key==="position"){this._position();}
if(key==="resizable"){isResizable=uiDialog.is(":data(ui-resizable)");if(isResizable&&!value){uiDialog.resizable("destroy");}
if(isResizable&&typeof value==="string"){uiDialog.resizable("option","handles",value);}
if(!isResizable&&value!==false){this._makeResizable();}}
if(key==="title"){this._title(this.uiDialogTitlebar.find(".ui-dialog-title"));}},_size:function(){var nonContentHeight,minContentHeight,maxContentHeight,options=this.options;this.element.show().css({width:"auto",minHeight:0,maxHeight:"none",height:0});if(options.minWidth>options.width){options.width=options.minWidth;}
nonContentHeight=this.uiDialog.css({height:"auto",width:options.width}).outerHeight();minContentHeight=Math.max(0,options.minHeight-nonContentHeight);maxContentHeight=typeof options.maxHeight==="number"?Math.max(0,options.maxHeight-nonContentHeight):"none";if(options.height==="auto"){this.element.css({minHeight:minContentHeight,maxHeight:maxContentHeight,height:"auto"});}else{this.element.height(Math.max(0,options.height-nonContentHeight));}
if(this.uiDialog.is(":data(ui-resizable)")){this.uiDialog.resizable("option","minHeight",this._minHeight());}},_blockFrames:function(){this.iframeBlocks=this.document.find("iframe").map(function(){var iframe=$(this);return $("<div>").css({position:"absolute",width:iframe.outerWidth(),height:iframe.outerHeight()}).appendTo(iframe.parent()).offset(iframe.offset())[0];});},_unblockFrames:function(){if(this.iframeBlocks){this.iframeBlocks.remove();delete this.iframeBlocks;}},_allowInteraction:function(event){if($(event.target).closest(".ui-dialog").length){return true;}
return!!$(event.target).closest(".ui-datepicker").length;},_createOverlay:function(){if(!this.options.modal){return;}
var jqMinor=$.fn.jquery.substring(0,4);var isOpening=true;this._delay(function(){isOpening=false;});if(!this.document.data("ui-dialog-overlays")){this.document.on("focusin.ui-dialog",function(event){if(isOpening){return;}
var instance=this._trackingInstances()[0];if(!instance._allowInteraction(event)){event.preventDefault();instance._focusTabbable();if(jqMinor==="3.4."||jqMinor==="3.5."){instance._delay(instance._restoreTabbableFocus);}}}.bind(this));}
this.overlay=$("<div>").appendTo(this._appendTo());this._addClass(this.overlay,null,"ui-widget-overlay ui-front");this._on(this.overlay,{mousedown:"_keepFocus"});this.document.data("ui-dialog-overlays",(this.document.data("ui-dialog-overlays")||0)+1);},_destroyOverlay:function(){if(!this.options.modal){return;}
if(this.overlay){var overlays=this.document.data("ui-dialog-overlays")-1;if(!overlays){this.document.off("focusin.ui-dialog");this.document.removeData("ui-dialog-overlays");}else{this.document.data("ui-dialog-overlays",overlays);}
this.overlay.remove();this.overlay=null;}}});if($.uiBackCompat!==false){$.widget("ui.dialog",$.ui.dialog,{options:{dialogClass:""},_createWrapper:function(){this._super();this.uiDialog.addClass(this.options.dialogClass);},_setOption:function(key,value){if(key==="dialogClass"){this.uiDialog.removeClass(this.options.dialogClass).addClass(value);}
this._superApply(arguments);}});}
return $.ui.dialog;});

View File

@@ -0,0 +1,9 @@
/*!
* jQuery UI Disable Selection 1.13.2
* http://jqueryui.com
*
* Copyright jQuery Foundation and other contributors
* Released under the MIT license.
* http://jquery.org/license
*/
(function(factory){"use strict";if(typeof define==="function"&&define.amd){define(["jquery","./version"],factory);}else{factory(jQuery);}})(function($){"use strict";return $.fn.extend({disableSelection:(function(){var eventType="onselectstart"in document.createElement("div")?"selectstart":"mousedown";return function(){return this.on(eventType+".ui-disableSelection",function(event){event.preventDefault();});};})(),enableSelection:function(){return this.off(".ui-disableSelection");}});});

View File

@@ -0,0 +1,24 @@
define(['jquery','underscore','domReady!'],function($,_){'use strict';var counter=1,watchers,globalObserver,disabledNodes=[];watchers={selectors:{},nodes:{}};function isElementNode(node){return node.nodeType===1;}
function extractChildren(node){var children=node.querySelectorAll('*');return _.toArray(children);}
function getNodeId(node){var id=node._observeId;if(!id){id=node._observeId=counter++;}
return id;}
function trigger(node,data){var id=getNodeId(node),ids=data.invoked;if(_.contains(ids,id)){return;}
data.callback(node);data.invoked.push(id);}
function createNodeData(node){var nodes=watchers.nodes,id=getNodeId(node);nodes[id]=nodes[id]||{};return nodes[id];}
function getNodeData(node){var nodeId=node._observeId;return watchers.nodes[nodeId];}
function removeNodeData(node){var nodeId=node._observeId;delete watchers.nodes[nodeId];}
function addRemovalListener(node,data){var nodeData=createNodeData(node);(nodeData.remove=nodeData.remove||[]).push(data);}
function addSelectorListener(selector,data){var storage=watchers.selectors;(storage[selector]=storage[selector]||[]).push(data);}
function processAdded(node){_.each(watchers.selectors,function(listeners,selector){listeners.forEach(function(data){if(!data.ctx.contains(node)||!$(node,data.ctx).is(selector)){return;}
if(data.type==='add'){trigger(node,data);}else if(data.type==='remove'){addRemovalListener(node,data);}});});}
function processRemoved(node){var nodeData=getNodeData(node),listeners=nodeData&&nodeData.remove;if(!listeners){return;}
listeners.forEach(function(data){trigger(node,data);});removeNodeData(node);}
function formNodesList(nodes){var result=[],children;nodes=_.toArray(nodes).filter(isElementNode);nodes.forEach(function(node){result.push(node);children=extractChildren(node);result=result.concat(children);});return result;}
function formChangesLists(mutations){var removed=[],added=[];mutations.forEach(function(record){removed=removed.concat(_.toArray(record.removedNodes));added=added.concat(_.toArray(record.addedNodes));});removed=removed.filter(function(node){var addIndex=added.indexOf(node),wasAdded=!!~addIndex;if(wasAdded){added.splice(addIndex,1);}
return!wasAdded;});return{removed:formNodesList(removed),added:formNodesList(added)};}
function shouldObserveMutation(mutation){var isDisabled;if(disabledNodes.length>0){isDisabled=_.find(disabledNodes,function(node){return node===mutation.target||$.contains(node,mutation.target);});return!isDisabled;}
return true;}
function shouldObserveMutations(mutations){var firstMutation,lastMutation;if(mutations.length>0){firstMutation=mutations[0];lastMutation=mutations[mutations.length-1];return shouldObserveMutation(firstMutation)&&shouldObserveMutation(lastMutation);}
return true;}
globalObserver=new MutationObserver(function(mutations){var changes;if(shouldObserveMutations(mutations)){changes=formChangesLists(mutations);changes.removed.forEach(processRemoved);changes.added.forEach(processAdded);}});globalObserver.observe(document.body,{subtree:true,childList:true});return{disableNode:function(node){disabledNodes.push(node);},get:function(selector,callback,ctx){var data,nodes;data={ctx:ctx||document.body,type:'add',callback:callback,invoked:[]};nodes=$(selector,data.ctx).toArray();nodes.forEach(function(node){trigger(node,data);});addSelectorListener(selector,data);},remove:function(selector,callback,ctx){var nodes=[],data;data={ctx:ctx||document.body,type:'remove',callback:callback,invoked:[]};if(typeof selector==='object'){nodes=!_.isUndefined(selector.length)?_.toArray(selector):[selector];}else if(_.isString(selector)){nodes=$(selector,ctx).toArray();addSelectorListener(selector,data);}
nodes.forEach(function(node){addRemovalListener(node,data);});},off:function(selector,fn){var selectors=watchers.selectors,listeners=selectors[selector];if(selector&&!fn){delete selectors[selector];}else if(listeners&&fn){selectors[selector]=listeners.filter(function(data){return data.callback!==fn;});}}};});

Some files were not shown because too many files have changed in this diff Show More