1require.config({"config": { 2 "jsbuild":{"jquery/ui-modules/i18n/datepicker-ms.js":"/* Malaysian initialisation for the jQuery UI date picker plugin. */\n/* Written by Mohd Nawawi Mohamad Jamili ([email protected]). */\n( function( factory ) {\n\t\"use strict\";\n\n\tif ( typeof define === \"function\" && define.amd ) {\n\n\t\t// AMD. Register as an anonymous module.\n\t\tdefine( [ \"../widgets/datepicker\" ], factory );\n\t} else {\n\n\t\t// Browser globals\n\t\tfactory( jQuery.datepicker );\n\t}\n} )( function( datepicker ) {\n\"use strict\";\n\ndatepicker.regional.ms = {\n\tcloseText: \"Tutup\",\n\tprevText: \"<Sebelum\",\n\tnextText: \"Selepas>\",\n\tcurrentText: \"hari ini\",\n\tmonthNames: [ \"Januari\", \"Februari\", \"Mac\", \"April\", \"Mei\", \"Jun\",\n\t\"Julai\", \"Ogos\", \"September\", \"Oktober\", \"November\", \"Disember\" ],\n\tmonthNamesShort: [ \"Jan\", \"Feb\", \"Mac\", \"Apr\", \"Mei\", \"Jun\",\n\t\"Jul\", \"Ogo\", \"Sep\", \"Okt\", \"Nov\", \"Dis\" ],\n\tdayNames: [ \"Ahad\", \"Isnin\", \"Selasa\", \"Rabu\", \"Khamis\", \"Jumaat\", \"Sabtu\" ],\n\tdayNamesShort: [ \"Aha\", \"Isn\", \"Sel\", \"Rab\", \"kha\", \"Jum\", \"Sab\" ],\n\tdayNamesMin: [ \"Ah\", \"Is\", \"Se\", \"Ra\", \"Kh\", \"Ju\", \"Sa\" ],\n\tweekHeader: \"Mg\",\n\tdateFormat: \"dd/mm/yy\",\n\tfirstDay: 0,\n\tisRTL: false,\n\tshowMonthAfterYear: false,\n\tyearSuffix: \"\" };\ndatepicker.setDefaults( datepicker.regional.ms );\n\nreturn datepicker.regional.ms;\n\n} );\n","jquery/ui-modules/i18n/datepicker-ca.js":"/* Inicialitzaci\u00f3 en catal\u00e0 per a l'extensi\u00f3 'UI date picker' per jQuery. */\n/* Writers: ([email protected]). */\n( function( factory ) {\n\t\"use strict\";\n\n\tif ( typeof define === \"function\" && define.amd ) {\n\n\t\t// AMD. Register as an anonymous module.\n\t\tdefine( [ \"../widgets/datepicker\" ], factory );\n\t} else {\n\n\t\t// Browser globals\n\t\tfactory( jQuery.datepicker );\n\t}\n} )( function( datepicker ) {\n\"use strict\";\n\ndatepicker.regional.ca = {\n\tcloseText: \"Tanca\",\n\tprevText: \"Anterior\",\n\tnextText: \"Seg\u00fcent\",\n\tcurrentText: \"Avui\",\n\tmonthNames: [ \"gener\", \"febrer\", \"mar\u00e7\", \"abril\", \"maig\", \"juny\",\n\t\"juliol\", \"agost\", \"setembre\", \"octubre\", \"novembre\", \"desembre\" ],\n\tmonthNamesShort: [ \"gen\", \"feb\", \"mar\u00e7\", \"abr\", \"maig\", \"juny\",\n\t\"jul\", \"ag\", \"set\", \"oct\", \"nov\", \"des\" ],\n\tdayNames: [ \"diumenge\", \"dilluns\", \"dimarts\", \"dimecres\", \"dijous\", \"divendres\", \"dissabte\" ],\n\tdayNamesShort: [ \"dg\", \"dl\", \"dt\", \"dc\", \"dj\", \"dv\", \"ds\" ],\n\tdayNamesMin: [ \"dg\", \"dl\", \"dt\", \"dc\", \"dj\", \"dv\", \"ds\" ],\n\tweekHeader: \"Set\",\n\tdateFormat: \"dd/mm/yy\",\n\tfirstDay: 1,\n\tisRTL: false,\n\tshowMonthAfterYear: false,\n\tyearSuffix: \"\" };\ndatepicker.setDefaults( datepicker.regional.ca );\n\nreturn datepicker.regional.ca;\n\n} );\n","jquery/ui-modules/i18n/datepicker-et.js":"/* Estonian initialisation for the jQuery UI date picker plugin. */\n/* Written by Mart S\u00f5mermaa (mrts.pydev at gmail com). */\n( function( factory ) {\n\t\"use strict\";\n\n\tif ( typeof define === \"function\" && define.amd ) {\n\n\t\t// AMD. Register as an anonymous module.\n\t\tdefine( [ \"../widgets/datepicker\" ], factory );\n\t} else {\n\n\t\t// Browser globals\n\t\tfactory( jQuery.datepicker );\n\t}\n} )( function( datepicker ) {\n\"use strict\";\n\ndatepicker.regional.et = {\n\tcloseText: \"Sulge\",\n\tprevText: \"Eelnev\",\n\tnextText: \"J\u00e4rgnev\",\n\tcurrentText: \"T\u00e4na\",\n\tmonthNames: [ \"Jaanuar\", \"Veebruar\", \"M\u00e4rts\", \"Aprill\", \"Mai\", \"Juuni\",\n\t\"Juuli\", \"August\", \"September\", \"Oktoober\", \"November\", \"Detsember\" ],\n\tmonthNamesShort: [ \"Jaan\", \"Veebr\", \"M\u00e4rts\", \"Apr\", \"Mai\", \"Juuni\",\n\t\"Juuli\", \"Aug\", \"Sept\", \"Okt\", \"Nov\", \"Dets\" ],\n\tdayNames: [\n\t\t\"P\u00fchap\u00e4ev\",\n\t\t\"Esmasp\u00e4ev\",\n\t\t\"Teisip\u00e4ev\",\n\t\t\"Kolmap\u00e4ev\",\n\t\t\"Neljap\u00e4ev\",\n\t\t\"Reede\",\n\t\t\"Laup\u00e4ev\"\n\t],\n\tdayNamesShort: [ \"P\u00fchap\", \"Esmasp\", \"Teisip\", \"Kolmap\", \"Neljap\", \"Reede\", \"Laup\" ],\n\tdayNamesMin: [ \"P\", \"E\", \"T\", \"K\", \"N\", \"R\", \"L\" ],\n\tweekHeader: \"n\u00e4d\",\n\tdateFormat: \"dd.mm.yy\",\n\tfirstDay: 1,\n\tisRTL: false,\n\tshowMonthAfterYear: false,\n\tyearSuffix: \"\" };\ndatepicker.setDefaults( datepicker.regional.et );\n\nreturn datepicker.regional.et;\n\n} );\n","jquery/ui-modules/i18n/datepicker-fr-CA.js":"/* Canadian-French initialisation for the jQuery UI date picker plugin. */\n( function( factory ) {\n\t\"use strict\";\n\n\tif ( typeof define === \"function\" && define.amd ) {\n\n\t\t// AMD. Register as an anonymous module.\n\t\tdefine( [ \"../widgets/datepicker\" ], factory );\n\t} else {\n\n\t\t// Browser globals\n\t\tfactory( jQuery.datepicker );\n\t}\n} )( function( datepicker ) {\n\"use strict\";\n\ndatepicker.regional[ \"fr-CA\" ] = {\n\tcloseText: \"Fermer\",\n\tprevText: \"Pr\u00e9c\u00e9dent\",\n\tnextText: \"Suivant\",\n\tcurrentText: \"Aujourd'hui\",\n\tmonthNames: [ \"janvier\", \"f\u00e9vrier\", \"mars\", \"avril\", \"mai\", \"juin\",\n\t\t\"juillet\", \"ao\u00fbt\", \"septembre\", \"octobre\", \"novembre\", \"d\u00e9cembre\" ],\n\tmonthNamesShort: [ \"janv.\", \"f\u00e9vr.\", \"mars\", \"avril\", \"mai\", \"juin\",\n\t\t\"juil.\", \"ao\u00fbt\", \"sept.\", \"oct.\", \"nov.\", \"d\u00e9c.\" ],\n\tdayNames: [ \"dimanche\", \"lundi\", \"mardi\", \"mercredi\", \"jeudi\", \"vendredi\", \"samedi\" ],\n\tdayNamesShort: [ \"dim.\", \"lun.\", \"mar.\", \"mer.\", \"jeu.\", \"ven.\", \"sam.\" ],\n\tdayNamesMin: [ \"D\", \"L\", \"M\", \"M\", \"J\", \"V\", \"S\" ],\n\tweekHeader: \"Sem.\",\n\tdateFormat: \"yy-mm-dd\",\n\tfirstDay: 0,\n\tisRTL: false,\n\tshowMonthAfterYear: false,\n\tyearSuffix: \"\"\n};\ndatepicker.setDefaults( datepicker.regional[ \"fr-CA\" ] );\n\nreturn datepicker.regional[ \"fr-CA\" ];\n\n} );\n","jquery/ui-modules/i18n/datepicker-nl-BE.js":"/* Dutch (Belgium) initialisation for the jQuery UI date picker plugin. */\n/* David De Sloovere @DavidDeSloovere */\n( function( factory ) {\n\t\"use strict\";\n\n\tif ( typeof define === \"function\" && define.amd ) {\n\n\t\t// AMD. Register as an anonymous module.\n\t\tdefine( [ \"../widgets/datepicker\" ], factory );\n\t} else {\n\n\t\t// Browser globals\n\t\tfactory( jQuery.datepicker );\n\t}\n} )( function( datepicker ) {\n\"use strict\";\n\ndatepicker.regional[ \"nl-BE\" ] = {\n\tcloseText: \"Sluiten\",\n\tprevText: \"\u2190\",\n\tnextText: \"\u2192\",\n\tcurrentText: \"Vandaag\",\n\tmonthNames: [ \"januari\", \"februari\", \"maart\", \"april\", \"mei\", \"juni\",\n\t\"juli\", \"augustus\", \"september\", \"oktober\", \"november\", \"december\" ],\n\tmonthNamesShort: [ \"jan\", \"feb\", \"mrt\", \"apr\", \"mei\", \"jun\",\n\t\"jul\", \"aug\", \"sep\", \"okt\", \"nov\", \"dec\" ],\n\tdayNames: [ \"zondag\", \"maandag\", \"dinsdag\", \"woensdag\", \"donderdag\", \"vrijdag\", \"zaterdag\" ],\n\tdayNamesShort: [ \"zon\", \"maa\", \"din\", \"woe\", \"don\", \"vri\", \"zat\" ],\n\tdayNamesMin: [ \"zo\", \"ma\", \"di\", \"wo\", \"do\", \"vr\", \"za\" ],\n\tweekHeader: \"Wk\",\n\tdateFormat: \"dd/mm/yy\",\n\tfirstDay: 1,\n\tisRTL: false,\n\tshowMonthAfterYear: false,\n\tyearSuffix: \"\" };\ndatepicker.setDefaults( datepicker.regional[ \"nl-BE\" ] );\n\nreturn datepicker.regional[ \"nl-BE\" ];\n\n} );\n","jquery/ui-modules/i18n/datepicker-pl.js":"/* Polish initialisation for the jQuery UI date picker plugin. */\n/* Written by Jacek Wysocki ([email protected]). */\n( function( factory ) {\n\t\"use strict\";\n\n\tif ( typeof define === \"function\" && define.amd ) {\n\n\t\t// AMD. Register as an anonymous module.\n\t\tdefine( [ \"../widgets/datepicker\" ], factory );\n\t} else {\n\n\t\t// Browser globals\n\t\tfactory( jQuery.datepicker );\n\t}\n} )( function( datepicker ) {\n\"use strict\";\n\ndatepicker.regional.pl = {\n\tcloseText: \"Zamknij\",\n\tprevText: \"<Poprzedni\",\n\tnextText: \"Nast\u0119pny>\",\n\tcurrentText: \"Dzi\u015b\",\n\tmonthNames: [ \"Stycze\u0144\", \"Luty\", \"Marzec\", \"Kwiecie\u0144\", \"Maj\", \"Czerwiec\",\n\t\"Lipiec\", \"Sierpie\u0144\", \"Wrzesie\u0144\", \"Pa\u01
27adziernik\", \"Listopad\", \"Grudzie\u0144\" ],\n\tmonthNamesShort: [ \"Sty\", \"Lu\", \"Mar\", \"Kw\", \"Maj\", \"Cze\",\n\t\"Lip\", \"Sie\", \"Wrz\", \"Pa\", \"Lis\", \"Gru\" ],\n\tdayNames: [ \"Niedziela\", \"Poniedzia\u0142ek\", \"Wtorek\", \"\u015aroda\", \"Czwartek\", \"Pi\u0105tek\", \"Sobota\" ],\n\tdayNamesShort: [ \"Nie\", \"Pn\", \"Wt\", \"\u015ar\", \"Czw\", \"Pt\", \"So\" ],\n\tdayNamesMin: [ \"N\", \"Pn\", \"Wt\", \"\u015ar\", \"Cz\", \"Pt\", \"So\" ],\n\tweekHeader: \"Tydz\",\n\tdateFormat: \"dd.mm.yy\",\n\tfirstDay: 1,\n\tisRTL: false,\n\tshowMonthAfterYear: false,\n\tyearSuffix: \"\" };\ndatepicker.setDefaults( datepicker.regional.pl );\n\nreturn datepicker.regional.pl;\n\n} );\n","jquery/ui-modules/i18n/datepicker-hy.js":"/* Armenian(UTF-8) initialisation for the jQuery UI date picker plugin. */\n/* Written by Levon Zakaryan ([email protected])*/\n( function( factory ) {\n\t\"use strict\";\n\n\tif ( typeof define === \"function\" && define.amd ) {\n\n\t\t// AMD. Register as an anonymous module.\n\t\tdefine( [ \"../widgets/datepicker\" ], factory );\n\t} else {\n\n\t\t// Browser globals\n\t\tfactory( jQuery.datepicker );\n\t}\n} )( function( datepicker ) {\n\"use strict\";\n\ndatepicker.regional.hy = {\n\tcloseText: \"\u0553\u0561\u056f\u0565\u056c\",\n\tprevText: \"<\u0546\u0561\u056d.\",\n\tnextText: \"\u0540\u0561\u057b.>\",\n\tcurrentText: \"\u0531\u0575\u057d\u0585\u0580\",\n\tmonthNames: [ \"\u0540\u0578\u0582\u0576\u057e\u0561\u0580\", \"\u0553\u0565\u057f\u0580\u057e\u0561\u0580\", \"\u0544\u0561\u0580\u057f\", \"\u0531\u057a\u0580\u056b\u056c\", \"\u0544\u0561\u0575\u056b\u057d\", \"\u0540\u0578\u0582\u0576\u056b\u057d\",\n\t\"\u0540\u0578\u0582\u056c\u056b\u057d\", \"\u0555\u0563\u0578\u057d\u057f\u0578\u057d\", \"\u054d\u0565\u057a\u057f\u0565\u0574\u0562\u0565\u0580\", \"\u0540\u0578\u056f\u057f\u0565\u0574\u0562\u0565\u0580\", \"\u0546\u0578\u0575\u0565\u0574\u0562\u0565\u0580\", \"\u0534\u0565\u056f\u057f\u0565\u0574\u0562\u0565\u0580\" ],\n\tmonthNamesShort: [ \"\u0540\u0578\u0582\u0576\u057e\", \"\u0553\u0565\u057f\u0580\", \"\u0544\u0561\u0580\u057f\", \"\u0531\u057a\u0580\", \"\u0544\u0561\u0575\u056b\u057d\", \"\u0540\u0578\u0582\u0576\u056b\u057d\",\n\t\"\u0540\u0578\u0582\u056c\", \"\u0555\u0563\u057d\", \"\u054d\u0565\u057a\", \"\u0540\u0578\u056f\", \"\u0546\u0578\u0575\", \"\u0534\u0565\u056f\" ],\n\tdayNames: [ \"\u056f\u056b\u0580\u0561\u056f\u056b\", \"\u0565\u056f\u0578\u0582\u0577\u0561\u0562\u0569\u056b\", \"\u0565\u0580\u0565\u0584\u0577\u0561\u0562\u0569\u056b\", \"\u0579\u0578\u0580\u0565\u0584\u0577\u0561\u0562\u0569\u056b\", \"\u0570\u056b\u0576\u0563\u0577\u0561\u0562\u0569\u056b\", \"\u0578\u0582\u0580\u0562\u0561\u0569\", \"\u0577\u0561\u0562\u0561\u0569\" ],\n\tdayNamesShort: [ \"\u056f\u056b\u0580\", \"\u0565\u0580\u056f\", \"\u0565\u0580\u0584\", \"\u0579\u0580\u0584\", \"\u0570\u0576\u0563\", \"\u0578\u0582\u0580\u0562\", \"\u0577\u0562\u0569\" ],\n\tdayNamesMin: [ \"\u056f\u056b\u0580\", \"\u0565\u0580\u056f\", \"\u0565\u0580\u0584\", \"\u0579\u0580\u0584\", \"\u0570\u0576\u0563\", \"\u0578\u0582\u0580\u0562\", \"\u0577\u0562\u0569\" ],\n\tweekHeader: \"\u0547\u0532\u054f\",\n\tdateFormat: \"dd.mm.yy\",\n\tfirstDay: 1,\n\tisRTL: false,\n\tshowMonthAfterYear: false,\n\tyearSuffix: \"\" };\ndatepicker.setDefaults( datepicker.regional.hy );\n\nreturn datepicker.regional.hy;\n\n} );\n","jquery/ui-modules/i18n/datepicker-cy-GB.js":"/* Welsh/UK initialisation for the jQuery UI date picker plugin. */\n/* Written by William Griffiths. */\n( function( factory ) {\n\t\"use strict\";\n\n\tif ( typeof define === \"function\" && define.amd ) {\n\n\t\t// AMD. Register as an anonymous module.\n\t\tdefine( [ \"../widgets/datepicker\" ], factory );\n\t} else {\n\n\t\t// Browser globals\n\t\tfactory( jQuery.datepicker );\n\t}\n} )( function( datepicker ) {\n\"use strict\";\n\ndatepicker.regional[ \"cy-GB\" ] = {\n\tcloseText: \"Done\",\n\tprevText: \"Prev\",\n\tnextText: \"Next\",\n\tcurrentText: \"Today\",\n\tmonthNames: [ \"Ionawr\", \"Chwefror\", \"Mawrth\", \"Ebrill\", \"Mai\", \"Mehefin\",\n\t\"Gorffennaf\", \"Awst\", \"Medi\", \"Hydref\", \"Tachwedd\", \"Rhagfyr\" ],\n\tmonthNamesShort: [ \"Ion\", \"Chw\", \"Maw\", \"Ebr\", \"Mai\", \"Meh\",\n\t\"Gor\", \"Aws\", \"Med\", \"Hyd\", \"Tac\", \"Rha\" ],\n\tdayNames: [\n\t\t\"Dydd Sul\",\n\t\t\"Dydd Llun\",\n\t\t\"Dydd Mawrth\",\n\t\t\"Dydd Mercher\",\n\t\t\"Dydd Iau\",\n\t\t\"Dydd Gwener\",\n\t\t\"Dydd Sadwrn\"\n\t],\n\tdayNamesShort: [ \"Sul\", \"Llu\", \"Maw\", \"Mer\", \"Iau\", \"Gwe\", \"Sad\" ],\n\tdayNamesMin: [ \"Su\", \"Ll\", \"Ma\", \"Me\", \"Ia\", \"Gw\", \"Sa\" ],\n\tweekHeader: \"Wy\",\n\tdateFormat: \"dd/mm/yy\",\n\tfirstDay: 1,\n\tisRTL: false,\n\tshowMonthAfterYear: false,\n\tyearSuffix: \"\" };\ndatepicker.setDefaults( datepicker.regional[ \"cy-GB\" ] );\n\nreturn datepicker.regional[ \"cy-GB\" ];\n\n} );\n","jquery/ui-modules/i18n/datepicker-km.js":"/* Khmer initialisation for the jQuery calendar extension. */\n/* Written by Chandara Om ([email protected]). */\n( function( factory ) {\n\t\"use strict\";\n\n\tif ( typeof define === \"function\" && define.amd ) {\n\n\t\t// AMD. Register as an anonymous module.\n\t\tdefine( [ \"../widgets/datepicker\" ], factory );\n\t} else {\n\n\t\t// Browser globals\n\t\tfactory( jQuery.datepicker );\n\t}\n} )( function( datepicker ) {\n\"use strict\";\n\ndatepicker.regional.km = {\n\tcloseText: \"\u1792\u17d2\u179c\u17be\u200b\u179a\u17bd\u1785\",\n\tprevText: \"\u1798\u17bb\u1793\",\n\tnextText: \"\u1794\u1793\u17d2\u1791\u17b6\u1794\u17cb\",\n\tcurrentText: \"\u1790\u17d2\u1784\u17c3\u200b\u1793\u17c1\u17c7\",\n\tmonthNames: [ \"\u1798\u1780\u179a\u17b6\", \"\u1780\u17bb\u1798\u17d2\u1797\u17c8\", \"\u1798\u17b8\u1793\u17b6\", \"\u1798\u17c1\u179f\u17b6\", \"\u17a7\u179f\u1797\u17b6\", \"\u1798\u17b7\u1790\u17bb\u1793\u17b6\",\n\t\"\u1780\u1780\u17d2\u1780\u178a\u17b6\", \"\u179f\u17b8\u17a0\u17b6\", \"\u1780\u1789\u17d2\u1789\u17b6\", \"\u178f\u17bb\u179b\u17b6\", \"\u179c\u17b7\u1785\u17d2\u1786\u17b7\u1780\u17b6\", \"\u1792\u17d2\u1793\u17bc\" ],\n\tmonthNamesShort: [ \"\u1798\u1780\u179a\u17b6\", \"\u1780\u17bb\u1798\u17d2\u1797\u17c8\", \"\u1798\u17b8\u1793\u17b6\", \"\u1798\u17c1\u179f\u17b6\", \"\u17a7\u179f\u1797\u17b6\", \"\u1798\u17b7\u1790\u17bb\u1793\u17b6\",\n\t\"\u1780\u1780\u17d2\u1780\u178a\u17b6\", \"\u179f\u17b8\u17a0\u17b6\", \"\u1780\u1789\u17d2\u1789\u17b6\", \"\u178f\u17bb\u179b\u17b6\", \"\u179c\u17b7\u1785\u17d2\u1786\u17b7\u1780\u17b6\", \"\u1792\u17d2\u1793\u17bc\" ],\n\tdayNames: [ \"\u17a2\u17b6\u1791\u17b7\u178f\u17d2\u1799\", \"\u1785\u1793\u17d2\u1791\", \"\u17a2\u1784\u17d2\u1782\u17b6\u179a\", \"\u1796\u17bb\u1792\", \"\u1796\u17d2\u179a\u17a0\u179f\u17d2\u1794\u178f\u17b7\u17cd\", \"\u179f\u17bb\u1780\u17d2\u179a\", \"\u179f\u17c5\u179a\u17cd\" ],\n\tdayNamesShort: [ \"\u17a2\u17b6\", \"\u1785\", \"\u17a2\", \"\u1796\u17bb\", \"\u1796\u17d2\u179a\u17a0\", \"\u179f\u17bb\", \"\u179f\u17c5\" ],\n\tdayNamesMin: [ \"\u17a2\u17b6\", \"\u1785\", \"\u17a2\", \"\u1796\u17bb\", \"\u1796\u17d2\u179a\u17a0\", \"\u179f\u17bb\", \"\u179f\u17c5\" ],\n\tweekHeader: \"\u179f\u1794\u17d2\u178a\u17b6\u17a0\u17cd\",\n\tdateFormat: \"dd-mm-yy\",\n\tfirstDay: 1,\n\tisRTL: false,\n\tshowMonthAfterYear: false,\n\tyearSuffix: \"\" };\ndatepicker.setDefaults( datepicker.regional.km );\n\nreturn datepicker.regional.km;\n\n} );\n","jquery/ui-modules/i18n/datepicker-en-AU.js":"/* English/Australia initialisation for the jQuery UI date picker plugin. */\n/* Based on the en-GB initialisation. */\n( function( factory ) {\n\t\"use strict\";\n\n\tif ( typeof define === \"function\" && define.amd ) {\n\n\t\t// AMD. Register as an anonymous module.\n\t\tdefine( [ \"../widgets/datepicker\" ], factory );\n\t} else {\n\n\t\t// Browser globals\n\t\tfactory( jQuery.datepicker );\n\t}\n} )( function( datepicker ) {\n\"use strict\";\n\ndatepicker.regional[ \"en-AU\" ] = {\n\tcloseText: \"Done\",\n\tprevText: \"Prev\",\n\tnextText: \"Next\",\n\tcurrentText: \"Today\",\n\tmonthNames: [ \"January\", \"February\", \"March\", \"April\", \"May\", \"June\",\n\t\"July\", \"August\", \"September\", \"October\", \"November\", \"December\" ],\n\tmonthNamesShort: [ \"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\",\n\t\"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\" ],\n\tdayNames: [ \"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\" ],\n\tdayNamesShort: [ \"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\" ],\n\tdayNamesMin: [ \"Su\", \"Mo\", \"Tu\", \"We\", \"Th\", \"Fr\", \"Sa\" ],\n\tweekHeader: \"Wk\",\n\tdateFormat: \"dd/mm/yy\",\n\tfirstDay: 1,\n\tisRTL: false,\n\tshowMonthAfterYear: false,\n\tyearSuffix: \"\" };\ndatepicker.setDefaults( datepicker.regional[ \"en-AU\" ] );\n\nreturn datepicker.regional[ \"en-AU\" ];\n\n} );\n","jquery/ui-modules/i18n/datepicker-nb.js":"/* Norwegian Bokm\u00e5l initialisation for the jQuery UI date picker plugin. */\n/* Written by Bj\u00f8rn Johansen ([email protected]). */\n( function( factory ) {\n\t\"use strict\";\n\n\tif ( typeof define === \"function\" && define.amd ) {\n\n\t\t// AMD. Register as an anonymous module.\n\t\tdefine( [ \"../widgets/datepicker\" ], factory );\n\t} else {\n\n\t\t// Browser globals\n\t\tfactory( jQuery.datepicker );\n\t}\n} )( function( datepicker ) {\n\"use strict\";\n\ndatepicker.regional.nb = {\n\tcloseText: \"Lukk\",\n\tprevText: \"«Forrige\",\n\tnextText: \"Neste»\",\n\tcurrentText: \"I dag\",\n\tmonthNames: [\n\t\t\"januar\",\n\t\t\"februar\",\n\t\t\"mars\",\n\t\t\"april\",\n\t\t\"mai\",\n\t\t\"juni\",\n\t\t\"juli\",\n\t\t\"august\",\n\t\t\"september\",\n\t\t\"oktober\",\n\t\t\"november\",\n\t\t\"desember\"\n\t],\n\tmonthNamesShort: [ \"jan\", \"feb\", \"mar\", \"apr\", \"mai\", \"jun\", \"jul\", \"aug\", \"sep\", \"okt\", \"nov\", \"des\" ],\n\tdayNamesShort: [ \"s\u00f8n\", \"man\", \"tir\", \"ons\", \"tor\", \"fre\", \"l\u00f8r\" ],\n\tdayNames: [ \"s\u00f8ndag\", \"mandag\", \"tirsdag\", \"onsdag\", \"torsd
2ag\", \"fredag\", \"l\u00f8rdag\" ],\n\tdayNamesMin: [ \"s\u00f8\", \"ma\", \"ti\", \"on\", \"to\", \"fr\", \"l\u00f8\" ],\n\tweekHeader: \"Uke\",\n\tdateFormat: \"dd.mm.yy\",\n\tfirstDay: 1,\n\tisRTL: false,\n\tshowMonthAfterYear: false,\n\tyearSuffix: \"\"\n};\ndatepicker.setDefaults( datepicker.regional.nb );\n\nreturn datepicker.regional.nb;\n\n} );\n","jquery/ui-modules/i18n/datepicker-ro.js":"/* Romanian initialisation for the jQuery UI date picker plugin.\n *\n * Written by Edmond L. ([email protected])\n * and Ionut G. Stan ([email protected])\n */\n( function( factory ) {\n\t\"use strict\";\n\n\tif ( typeof define === \"function\" && define.amd ) {\n\n\t\t// AMD. Register as an anonymous module.\n\t\tdefine( [ \"../widgets/datepicker\" ], factory );\n\t} else {\n\n\t\t// Browser globals\n\t\tfactory( jQuery.datepicker );\n\t}\n} )( function( datepicker ) {\n\"use strict\";\n\ndatepicker.regional.ro = {\n\tcloseText: \"\u00cenchide\",\n\tprevText: \"« Luna precedent\u0103\",\n\tnextText: \"Luna urm\u0103toare »\",\n\tcurrentText: \"Azi\",\n\tmonthNames: [ \"Ianuarie\", \"Februarie\", \"Martie\", \"Aprilie\", \"Mai\", \"Iunie\",\n\t\"Iulie\", \"August\", \"Septembrie\", \"Octombrie\", \"Noiembrie\", \"Decembrie\" ],\n\tmonthNamesShort: [ \"Ian\", \"Feb\", \"Mar\", \"Apr\", \"Mai\", \"Iun\",\n\t\"Iul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\" ],\n\tdayNames: [ \"Duminic\u0103\", \"Luni\", \"Mar\u0163i\", \"Miercuri\", \"Joi\", \"Vineri\", \"S\u00e2mb\u0103t\u0103\" ],\n\tdayNamesShort: [ \"Dum\", \"Lun\", \"Mar\", \"Mie\", \"Joi\", \"Vin\", \"S\u00e2m\" ],\n\tdayNamesMin: [ \"Du\", \"Lu\", \"Ma\", \"Mi\", \"Jo\", \"Vi\", \"S\u00e2\" ],\n\tweekHeader: \"S\u0103pt\",\n\tdateFormat: \"dd.mm.yy\",\n\tfirstDay: 1,\n\tisRTL: false,\n\tshowMonthAfterYear: false,\n\tyearSuffix: \"\" };\ndatepicker.setDefaults( datepicker.regional.ro );\n\nreturn datepicker.regional.ro;\n\n} );\n","jquery/ui-modules/i18n/datepicker-uk.js":"/* Ukrainian (UTF-8) initialisation for the jQuery UI date picker plugin. */\n/* Written by Maxim Drogobitskiy ([email protected]). */\n/* Corrected by Igor Milla ([email protected]). */\n( function( factory ) {\n\t\"use strict\";\n\n\tif ( typeof define === \"function\" && define.amd ) {\n\n\t\t// AMD. Register as an anonymous module.\n\t\tdefine( [ \"../widgets/datepicker\" ], factory );\n\t} else {\n\n\t\t// Browser globals\n\t\tfactory( jQuery.datepicker );\n\t}\n} )( function( datepicker ) {\n\"use strict\";\n\ndatepicker.regional.uk = {\n\tcloseText: \"\u0417\u0430\u043a\u0440\u0438\u0442\u0438\",\n\tprevText: \"<\",\n\tnextText: \">\",\n\tcurrentText: \"\u0421\u044c\u043e\u0433\u043e\u0434\u043d\u0456\",\n\tmonthNames: [ \"\u0421\u0456\u0447\u0435\u043d\u044c\", \"\u041b\u044e\u0442\u0438\u0439\", \"\u0411\u0435\u0440\u0435\u0437\u0435\u043d\u044c\", \"\u041a\u0432\u0456\u0442\u0435\u043d\u044c\", \"\u0422\u0440\u0430\u0432\u0435\u043d\u044c\", \"\u0427\u0435\u0440\u0432\u0435\u043d\u044c\",\n\t\"\u041b\u0438\u043f\u0435\u043d\u044c\", \"\u0421\u0435\u0440\u043f\u0435\u043d\u044c\", \"\u0412\u0435\u0440\u0435\u0441\u0435\u043d\u044c\", \"\u0416\u043e\u0432\u0442\u0435\u043d\u044c\", \"\u041b\u0438\u0441\u0442\u043e\u043f\u0430\u0434\", \"\u0413\u0440\u0443\u0434\u0435\u043d\u044c\" ],\n\tmonthNamesShort: [ \"\u0421\u0456\u0447\", \"\u041b\u044e\u0442\", \"\u0411\u0435\u0440\", \"\u041a\u0432\u0456\", \"\u0422\u0440\u0430\", \"\u0427\u0435\u0440\",\n\t\"\u041b\u0438\u043f\", \"\u0421\u0435\u0440\", \"\u0412\u0435\u0440\", \"\u0416\u043e\u0432\", \"\u041b\u0438\u0441\", \"\u0413\u0440\u0443\" ],\n\tdayNames: [ \"\u043d\u0435\u0434\u0456\u043b\u044f\", \"\u043f\u043e\u043d\u0435\u0434\u0456\u043b\u043e\u043a\", \"\u0432\u0456\u0432\u0442\u043e\u0440\u043e\u043a\", \"\u0441\u0435\u0440\u0435\u0434\u0430\", \"\u0447\u0435\u0442\u0432\u0435\u0440\", \"\u043f\u2019\u044f\u0442\u043d\u0438\u0446\u044f\", \"\u0441\u0443\u0431\u043e\u0442\u0430\" ],\n\tdayNamesShort: [ \"\u043d\u0435\u0434\", \"\u043f\u043d\u0434\", \"\u0432\u0456\u0432\", \"\u0441\u0440\u0434\", \"\u0447\u0442\u0432\", \"\u043f\u0442\u043d\", \"\u0441\u0431\u0442\" ],\n\tdayNamesMin: [ \"\u041d\u0434\", \"\u041f\u043d\", \"\u0412\u0442\", \"\u0421\u0440\", \"\u0427\u0442\", \"\u041f\u0442\", \"\u0421\u0431\" ],\n\tweekHeader: \"\u0422\u0438\u0436\",\n\tdateFormat: \"dd.mm.yy\",\n\tfirstDay: 1,\n\tisRTL: false,\n\tshowMonthAfterYear: false,\n\tyearSuffix: \"\" };\ndatepicker.setDefaults( datepicker.regional.uk );\n\nreturn datepicker.regional.uk;\n\n} );\n","jquery/ui-modules/i18n/datepicker-gl.js":"/* Galician localization for 'UI date picker' jQuery extension. */\n/* Translated by Jorge Barreiro <[email protected]>. */\n( function( factory ) {\n\t\"use strict\";\n\n\tif ( typeof define === \"function\" && define.amd ) {\n\n\t\t// AMD. Register as an anonymous module.\n\t\tdefine( [ \"../widgets/datepicker\" ], factory );\n\t} else {\n\n\t\t// Browser globals\n\t\tfactory( jQuery.datepicker );\n\t}\n} )( function( datepicker ) {\n\"use strict\";\n\ndatepicker.regional.gl = {\n\tcloseText: \"Pechar\",\n\tprevText: \"<Ant\",\n\tnextText: \"Seg>\",\n\tcurrentText: \"Hoxe\",\n\tmonthNames: [ \"Xaneiro\", \"Febreiro\", \"Marzo\", \"Abril\", \"Maio\", \"Xu\u00f1o\",\n\t\"Xullo\", \"Agosto\", \"Setembro\", \"Outubro\", \"Novembro\", \"Decembro\" ],\n\tmonthNamesShort: [ \"Xan\", \"Feb\", \"Mar\", \"Abr\", \"Mai\", \"Xu\u00f1\",\n\t\"Xul\", \"Ago\", \"Set\", \"Out\", \"Nov\", \"Dec\" ],\n\tdayNames: [ \"Domingo\", \"Luns\", \"Martes\", \"M\u00e9rcores\", \"Xoves\", \"Venres\", \"S\u00e1bado\" ],\n\tdayNamesShort: [ \"Dom\", \"Lun\", \"Mar\", \"M\u00e9r\", \"Xov\", \"Ven\", \"S\u00e1b\" ],\n\tdayNamesMin: [ \"Do\", \"Lu\", \"Ma\", \"M\u00e9\", \"Xo\", \"Ve\", \"S\u00e1\" ],\n\tweekHeader: \"Sm\",\n\tdateFormat: \"dd/mm/yy\",\n\tfirstDay: 1,\n\tisRTL: false,\n\tshowMonthAfterYear: false,\n\tyearSuffix: \"\" };\ndatepicker.setDefaults( datepicker.regional.gl );\n\nreturn datepicker.regional.gl;\n\n} );\n","jquery/ui-modules/i18n/datepicker-it.js":"/* Italian initialisation for the jQuery UI date picker plugin. */\n/* Written by Antonello Pasella ([email protected]). */\n( function( factory ) {\n\t\"use strict\";\n\n\tif ( typeof define === \"function\" && define.amd ) {\n\n\t\t// AMD. Register as an anonymous module.\n\t\tdefine( [ \"../widgets/datepicker\" ], factory );\n\t} else {\n\n\t\t// Browser globals\n\t\tfactory( jQuery.datepicker );\n\t}\n} )( function( datepicker ) {\n\"use strict\";\n\ndatepicker.regional.it = {\n\tcloseText: \"Chiudi\",\n\tprevText: \"<Prec\",\n\tnextText: \"Succ>\",\n\tcurrentText: \"Oggi\",\n\tmonthNames: [ \"Gennaio\", \"Febbraio\", \"Marzo\", \"Aprile\", \"Maggio\", \"Giugno\",\n\t\t\"Luglio\", \"Agosto\", \"Settembre\", \"Ottobre\", \"Novembre\", \"Dicembre\" ],\n\tmonthNamesShort: [ \"Gen\", \"Feb\", \"Mar\", \"Apr\", \"Mag\", \"Giu\",\n\t\t\"Lug\", \"Ago\", \"Set\", \"Ott\", \"Nov\", \"Dic\" ],\n\tdayNames: [ \"Domenica\", \"Luned\u00ec\", \"Marted\u00ec\", \"Mercoled\u00ec\", \"Gioved\u00ec\", \"Venerd\u00ec\", \"Sabato\" ],\n\tdayNamesShort: [ \"Dom\", \"Lun\", \"Mar\", \"Mer\", \"Gio\", \"Ven\", \"Sab\" ],\n\tdayNamesMin: [ \"Do\", \"Lu\", \"Ma\", \"Me\", \"Gi\", \"Ve\", \"Sa\" ],\n\tweekHeader: \"Sm\",\n\tdateFormat: \"dd/mm/yy\",\n\tfirstDay: 1,\n\tisRTL: false,\n\tshowMonthAfterYear: false,\n\tyearSuffix: \"\" };\ndatepicker.setDefaults( datepicker.regional.it );\n\nreturn datepicker.regional.it;\n\n} );\n","jquery/ui-modules/i18n/datepicker-id.js":"/* Indonesian initialisation for the jQuery UI date picker plugin. */\n/* Written by Deden Fathurahman ([email protected]). */\n( function( factory ) {\n\t\"use strict\";\n\n\tif ( typeof define === \"function\" && define.amd ) {\n\n\t\t// AMD. Register as an anonymous module.\n\t\tdefine( [ \"../widgets/datepicker\" ], factory );\n\t} else {\n\n\t\t// Browser globals\n\t\tfactory( jQuery.datepicker );\n\t}\n} )( function( datepicker ) {\n\"use strict\";\n\ndatepicker.regional.id = {\n\tcloseText: \"Tutup\",\n\tprevText: \"<mundur\",\n\tnextText: \"maju>\",\n\tcurrentText: \"hari ini\",\n\tmonthNames: [ \"Januari\", \"Februari\", \"Maret\", \"April\", \"Mei\", \"Juni\",\n\t\"Juli\", \"Agustus\", \"September\", \"Oktober\", \"Nopember\", \"Desember\" ],\n\tmonthNamesShort: [ \"Jan\", \"Feb\", \"Mar\", \"Apr\", \"Mei\", \"Jun\",\n\t\"Jul\", \"Agus\", \"Sep\", \"Okt\", \"Nop\", \"Des\" ],\n\tdayNames: [ \"Minggu\", \"Senin\", \"Selasa\", \"Rabu\", \"Kamis\", \"Jumat\", \"Sabtu\" ],\n\tdayNamesShort: [ \"Min\", \"Sen\", \"Sel\", \"Rab\", \"kam\", \"Jum\", \"Sab\" ],\n\tdayNamesMin: [ \"Mg\", \"Sn\", \"Sl\", \"Rb\", \"Km\", \"jm\", \"Sb\" ],\n\tweekHeader: \"Mg\",\n\tdateFormat: \"dd/mm/yy\",\n\tfirstDay: 0,\n\tisRTL: false,\n\tshowMonthAfterYear: false,\n\tyearSuffix: \"\" };\ndatepicker.setDefaults( datepicker.regional.id );\n\nreturn datepicker.regional.id;\n\n} );\n","jquery/ui-modules/i18n/datepicker-tr.js":"/* Turkish initialisation for the jQuery UI date picker plugin. */\n/* Written by Izzet Emre Erkan ([email protected]). */\n( function( factory ) {\n\t\"use strict\";\n\n\tif ( typeof define === \"function\" && define.amd ) {\n\n\t\t// AMD. Register as an anonymous module.\n\t\tdefine( [ \"../widgets/datepicker\" ], factory );\n\t} else {\n\n\t\t// Browser globals\n\t\tfactory( jQuery.datepicker );\n\t}\n} )( function( datepicker ) {\n\"use strict\";\n\ndatepicker.regional.tr = {\n\tcloseText: \"kapat\",\n\tprevText: \"<geri\",\n\tnextText: \"ileri>\",\n\tcurrentText: \"bug\u00fcn\",\n\tmonthNames: [ \"Ocak\", \"\u015eubat\", \"Mart\", \"Nisan\", \"May\u0131s\", \"Haziran\",\n\t\"Temmuz\", \"A\u011fustos\", \"Eyl\u00fcl\", \"Ekim\", \"Kas\u0131m\", \"Aral\u0131k\" ],\n\tmonthNamesShort: [ \"Oca\", \"\u015eub\", \"Mar\", \"Nis\", \"May\", \"Haz\",\n\t\"Tem\", \"A\u011fu\", \"Eyl\", \"Eki\", \"Kas\", \"Ara\" ],\n\tdayNames: [ \"Pazar\", \"Pazartesi\", \"Sal\u0131\", \"\u00c7ar\u015famba\", \"Per\u015fembe\", \"Cuma\", \"Cumartesi\" ],\n\tdayNamesShort: [ \"Pz\", \"Pt\", \"Sa\", \"\u00c7a\", \"Pe\", \"Cu\", \"Ct\" ],\n\tdayNamesMin: [ \"Pz\", \"Pt\", \"Sa\", \"\u00c7a\", \"Pe\", \"Cu\", \"Ct\" ],\n\tweekHeader: \"Hf\",\n\tdateFormat: \"dd.mm.yy\",\n\tfirstDay: 1,\n\tisRTL: false,\n\tshowMonthAfterYear: false,\n\tyearSuffix: \"\" };\ndatepicker.setDefaults( datepicker.regional.tr );\n\nreturn datepicker.regional.tr;\n\n} );\n","jquery/ui-modules/i18n/datepicker-nl.js":"/* Dutch (UTF-8) initialisation for the jQuery UI date picker plugin. */\n/* Written by Mathias Bynens <http://mathiasbynens.be/> */\n( function( factory ) {\n\t\"use strict\";\n\n\tif ( typeof define === \"function\" && define.amd ) {\n\n\t\t// AMD. Register as an anonymous module.\n\t\tdefine( [ \"../widgets/datepicker\" ], factory );\n\t} else {\n\n\t\t// Browser globals\n\t\tfactory( jQuery.datepicker );\n\t}\n} )( function( datepicker ) {\n\"use strict\";\n\ndatepicker.regional.nl = {\n\tcloseText: \"Sluiten\",\n\tprevText: \"\u2190\",\n\tnextText: \"\u2192\",\n\tcurrentText: \"Vandaag\",\n\tmonthNames: [ \"januari\", \"februari\", \"maart\", \"april\", \"mei\", \"juni\",\n\t\"juli\", \"augustus\", \"september\", \"oktober\", \"november\", \"december\" ],\n\tmonthNamesShort: [ \"jan\", \"feb\", \"mrt\", \"apr\", \"mei\", \"jun\",\n\t\"jul\", \"aug\", \"sep\", \"okt\", \"nov\", \"dec\" ],\n\tdayNames: [ \"zondag\", \"maandag\", \"dinsdag\", \"woensdag\", \"donderdag\", \"vrijdag\", \"zaterdag\" ],\n\tdayNamesShort: [ \"zon\", \"maa\", \"din\", \"woe\", \"don\", \"vri\", \"zat\" ],\n\tdayNamesMin: [ \"zo\", \"ma\", \"di\", \"wo\", \"do\", \"vr\", \"za\" ],\n\tweekHeader: \"Wk\",\n\tdateFormat: \"dd-mm-yy\",\n\tfirstDay: 1,\n\tisRTL: false,\n\tshowMonthAfterYear: false,\n\tyearSuffix: \"\" };\ndatepicker.setDefaults( datepicker.regional.nl );\n\nreturn datepicker.regional.nl;\n\n} );\n","jquery/ui-modules/i18n/datepicker-de-AT.js":"/* German/Austrian initialisation for the jQuery UI date picker plugin. */\n/* Based on the de initialisation. */\n\n( function( factory ) {\n\t\"use strict\";\n\n\tif ( typeof define === \"function\" && define.amd ) {\n\n\t\t// AMD. Register as an anonymous module.\n\t\tdefine( [ \"../widgets/datepicker\" ], factory );\n\t} else {\n\n\t\t// Browser globals\n\t\tfactory( jQuery.datepicker );\n\t}\n} )( function( datepicker ) {\n\"use strict\";\n\ndatepicker.regional[ \"de-AT\" ] = {\n\tcloseText: \"Schlie\u00dfen\",\n\tprevText: \"<Zur\u00fcck\",\n\tnextText: \"Vor>\",\n\tcurrentText: \"Heute\",\n\tmonthNames: [ \"J\u00e4nner\", \"Februar\", \"M\u00e4rz\", \"April\", \"Mai\", \"Juni\",\n\t\"Juli\", \"August\", \"September\", \"Oktober\", \"November\", \"Dezember\" ],\n\tmonthNamesShort: [ \"J\u00e4n\", \"Feb\", \"M\u00e4r\", \"Apr\", \"Mai\", \"Jun\",\n\t\"Jul\", \"Aug\", \"Sep\", \"Okt\", \"Nov\", \"Dez\" ],\n\tdayNames: [ \"Sonntag\", \"Montag\", \"Dienstag\", \"Mittwoch\", \"Donnerstag\", \"Freitag\", \"Samstag\" ],\n\tdayNamesShort: [ \"So\", \"Mo\", \"Di\", \"Mi\", \"Do\", \"Fr\", \"Sa\" ],\n\tdayNamesMin: [ \"So\", \"Mo\", \"Di\", \"Mi\", \"Do\", \"Fr\", \"Sa\" ],\n\tweekHeader: \"KW\",\n\tdateFormat: \"dd.mm.yy\",\n\tfirstDay: 1,\n\tisRTL: false,\n\tshowMonthAfterYear: false,\n\tyearSuffix: \"\" };\ndatepicker.setDefaults( datepicker.regional[ \"de-AT\" ] );\n\nreturn datepicker.regional[ \"de-AT\" ];\n\n} );\n","jquery/ui-modules/i18n/datepicker-lb.js":"/* Luxembourgish initialisation for the jQuery UI date picker plugin. */\n/* Written by Michel Weimerskirch <[email protected]> */\n( function( factory ) {\n\t\"use strict\";\n\n\tif ( typeof define === \"function\" && define.amd ) {\n\n\t\t// AMD. Register as an anonymous module.\n\t\tdefine( [ \"../widgets/datepicker\" ], factory );\n\t} else {\n\n\t\t// Browser globals\n\t\tfactory( jQuery.datepicker );\n\t}\n} )( function( datepicker ) {\n\"use strict\";\n\ndatepicker.regional.lb = {\n\tcloseText: \"F\u00e4erdeg\",\n\tprevText: \"Zr\u00e9ck\",\n\tnextText: \"Weider\",\n\tcurrentText: \"Haut\",\n\tmonthNames: [ \"Januar\", \"Februar\", \"M\u00e4erz\", \"Abr\u00ebll\", \"Mee\", \"Juni\",\n\t\"Juli\", \"August\", \"September\", \"Oktober\", \"November\", \"Dezember\" ],\n\tmonthNamesShort: [ \"Jan\", \"Feb\", \"M\u00e4e\", \"Abr\", \"Mee\", \"Jun\",\n\t\"Jul\", \"Aug\", \"Sep\", \"Okt\", \"Nov\", \"Dez\" ],\n\tdayNames: [\n\t\t\"Sonndeg\",\n\t\t\"M\u00e9indeg\",\n\t\t\"D\u00ebnschdeg\",\n\t\t\"M\u00ebttwoch\",\n\t\t\"Donneschdeg\",\n\t\t\"Freideg\",\n\t\t\"Samschdeg\"\n\t],\n\tdayNamesShort: [ \"Son\", \"M\u00e9i\", \"D\u00ebn\", \"M\u00ebt\", \"Don\", \"Fre\", \"Sam\" ],\n\tdayNamesMin: [ \"So\", \"M\u00e9\", \"D\u00eb\", \"M\u00eb\", \"Do\", \"Fr\", \"Sa\" ],\n\tweekHeader: \"W\",\n\tdateFormat: \"dd.mm.yy\",\n\tfirstDay: 1,\n\tisRTL: false,\n\tshowMonthAfterYear: false,\n\tyearSuffix: \"\" };\ndatepicker.setDefaults( datepicker.regional.lb );\n\nreturn datepicker.regional.lb;\n\n} );\n","jquery/ui-modules/i18n/datepicker-sr-SR.js":"/* Serbian i18n for the jQuery UI date picker plugin. */\n/* Written by Dejan Dimi\u0107. */\n( function( factory ) {\n\t\"use strict\";\n\n\tif ( typeof define === \"function\" && define.amd ) {\n\n\t\t// AMD. Register as an anonymous module.\n\t\tdefine( [ \"../widgets/datepicker\" ], factory );\n\t} else {\n\n\t\t// Browser globals\n\t\tfactory( jQuery.datepicker );\n\t}\n} )( function( datepicker ) {\n\"use strict\";\n\ndatepicker.regional[ \"sr-SR\" ] = {\n\tcloseText: \"Zatvori\",\n\tprevText: \"<\",\n\tnextText: \">\",\n\tcurrentText: \"Danas\",\n\tmonthNames: [ \"Januar\", \"Februar\", \"Mart\", \"April\", \"Maj\", \"Jun\",\n\t\"Jul\", \"Avgust\", \"Septembar\", \"Oktobar\", \"Novembar\", \"Decembar\" ],\n\tmonthNamesShort: [ \"Jan\", \"Feb\", \"Mar\", \"Apr\", \"Maj\", \"Jun\",\n\t\"Jul\", \"Avg\", \"Sep\", \"Okt\", \"Nov\", \"Dec\" ],\n\tdayNames: [ \"Nedelja\", \"Ponedeljak\", \"Utorak\", \"Sreda\", \"\u010cetvrtak\", \"Petak\", \"Subota\" ],\n\tdayNamesShort: [ \"Ned\", \"Pon\", \"Uto\", \"Sre\", \"\u010cet\", \"Pet\", \"Sub\" ],\n\tdayNamesMin: [ \"Ne\", \"Po\", \"Ut\", \"Sr\", \"\u010ce\", \"Pe\", \"Su\" ],\n\tweekHeader: \"Sed\",\n\tdateFormat: \"dd.mm.yy\",\n\tfirstDay: 1,\n\tisRTL: false,\n\tshowMonthAfterYear: false,\n\tyearSuffix: \"\" };\ndatepicker.setDefaults( datepicker.regional[ \"sr-SR\"
2] );\n\nreturn datepicker.regional[ \"sr-SR\" ];\n\n} );\n","jquery/ui-modules/i18n/datepicker-eu.js":"/* Karrikas-ek itzulia ([email protected]) */\n( function( factory ) {\n\t\"use strict\";\n\n\tif ( typeof define === \"function\" && define.amd ) {\n\n\t\t// AMD. Register as an anonymous module.\n\t\tdefine( [ \"../widgets/datepicker\" ], factory );\n\t} else {\n\n\t\t// Browser globals\n\t\tfactory( jQuery.datepicker );\n\t}\n} )( function( datepicker ) {\n\"use strict\";\n\ndatepicker.regional.eu = {\n\tcloseText: \"Egina\",\n\tprevText: \"<Aur\",\n\tnextText: \"Hur>\",\n\tcurrentText: \"Gaur\",\n\tmonthNames: [ \"urtarrila\", \"otsaila\", \"martxoa\", \"apirila\", \"maiatza\", \"ekaina\",\n\t\t\"uztaila\", \"abuztua\", \"iraila\", \"urria\", \"azaroa\", \"abendua\" ],\n\tmonthNamesShort: [ \"urt.\", \"ots.\", \"mar.\", \"api.\", \"mai.\", \"eka.\",\n\t\t\"uzt.\", \"abu.\", \"ira.\", \"urr.\", \"aza.\", \"abe.\" ],\n\tdayNames: [ \"igandea\", \"astelehena\", \"asteartea\", \"asteazkena\", \"osteguna\", \"ostirala\", \"larunbata\" ],\n\tdayNamesShort: [ \"ig.\", \"al.\", \"ar.\", \"az.\", \"og.\", \"ol.\", \"lr.\" ],\n\tdayNamesMin: [ \"ig\", \"al\", \"ar\", \"az\", \"og\", \"ol\", \"lr\" ],\n\tweekHeader: \"As\",\n\tdateFormat: \"yy-mm-dd\",\n\tfirstDay: 1,\n\tisRTL: false,\n\tshowMonthAfterYear: false,\n\tyearSuffix: \"\" };\ndatepicker.setDefaults( datepicker.regional.eu );\n\nreturn datepicker.regional.eu;\n\n} );\n","jquery/ui-modules/i18n/datepicker-el.js":"/* Greek (el) initialisation for the jQuery UI date picker plugin. */\n/* Written by Alex Cicovic (http://www.alexcicovic.com) */\n( function( factory ) {\n\t\"use strict\";\n\n\tif ( typeof define === \"function\" && define.amd ) {\n\n\t\t// AMD. Register as an anonymous module.\n\t\tdefine( [ \"../widgets/datepicker\" ], factory );\n\t} else {\n\n\t\t// Browser globals\n\t\tfactory( jQuery.datepicker );\n\t}\n} )( function( datepicker ) {\n\"use strict\";\n\ndatepicker.regional.el = {\n\tcloseText: \"\u039a\u03bb\u03b5\u03af\u03c3\u03b9\u03bc\u03bf\",\n\tprevText: \"\u03a0\u03c1\u03bf\u03b7\u03b3\u03bf\u03cd\u03bc\u03b5\u03bd\u03bf\u03c2\",\n\tnextText: \"\u0395\u03c0\u03cc\u03bc\u03b5\u03bd\u03bf\u03c2\",\n\tcurrentText: \"\u03a3\u03ae\u03bc\u03b5\u03c1\u03b1\",\n\tmonthNames: [ \"\u0399\u03b1\u03bd\u03bf\u03c5\u03ac\u03c1\u03b9\u03bf\u03c2\", \"\u03a6\u03b5\u03b2\u03c1\u03bf\u03c5\u03ac\u03c1\u03b9\u03bf\u03c2\", \"\u039c\u03ac\u03c1\u03c4\u03b9\u03bf\u03c2\", \"\u0391\u03c0\u03c1\u03af\u03bb\u03b9\u03bf\u03c2\", \"\u039c\u03ac\u03b9\u03bf\u03c2\", \"\u0399\u03bf\u03cd\u03bd\u03b9\u03bf\u03c2\",\n\t\"\u0399\u03bf\u03cd\u03bb\u03b9\u03bf\u03c2\", \"\u0391\u03cd\u03b3\u03bf\u03c5\u03c3\u03c4\u03bf\u03c2\", \"\u03a3\u03b5\u03c0\u03c4\u03ad\u03bc\u03b2\u03c1\u03b9\u03bf\u03c2\", \"\u039f\u03ba\u03c4\u03ce\u03b2\u03c1\u03b9\u03bf\u03c2\", \"\u039d\u03bf\u03ad\u03bc\u03b2\u03c1\u03b9\u03bf\u03c2\", \"\u0394\u03b5\u03ba\u03ad\u03bc\u03b2\u03c1\u03b9\u03bf\u03c2\" ],\n\tmonthNamesShort: [ \"\u0399\u03b1\u03bd\", \"\u03a6\u03b5\u03b2\", \"\u039c\u03b1\u03c1\", \"\u0391\u03c0\u03c1\", \"\u039c\u03b1\u03b9\", \"\u0399\u03bf\u03c5\u03bd\",\n\t\"\u0399\u03bf\u03c5\u03bb\", \"\u0391\u03c5\u03b3\", \"\u03a3\u03b5\u03c0\", \"\u039f\u03ba\u03c4\", \"\u039d\u03bf\u03b5\", \"\u0394\u03b5\u03ba\" ],\n\tdayNames: [ \"\u039a\u03c5\u03c1\u03b9\u03b1\u03ba\u03ae\", \"\u0394\u03b5\u03c5\u03c4\u03ad\u03c1\u03b1\", \"\u03a4\u03c1\u03af\u03c4\u03b7\", \"\u03a4\u03b5\u03c4\u03ac\u03c1\u03c4\u03b7\", \"\u03a0\u03ad\u03bc\u03c0\u03c4\u03b7\", \"\u03a0\u03b1\u03c1\u03b1\u03c3\u03ba\u03b5\u03c5\u03ae\", \"\u03a3\u03ac\u03b2\u03b2\u03b1\u03c4\u03bf\" ],\n\tdayNamesShort: [ \"\u039a\u03c5\u03c1\", \"\u0394\u03b5\u03c5\", \"\u03a4\u03c1\u03b9\", \"\u03a4\u03b5\u03c4\", \"\u03a0\u03b5\u03bc\", \"\u03a0\u03b1\u03c1\", \"\u03a3\u03b1\u03b2\" ],\n\tdayNamesMin: [ \"\u039a\u03c5\", \"\u0394\u03b5\", \"\u03a4\u03c1\", \"\u03a4\u03b5\", \"\u03a0\u03b5\", \"\u03a0\u03b1\", \"\u03a3\u03b1\" ],\n\tweekHeader: \"\u0395\u03b2\u03b4\",\n\tdateFormat: \"dd/mm/yy\",\n\tfirstDay: 1,\n\tisRTL: false,\n\tshowMonthAfterYear: false,\n\tyearSuffix: \"\" };\ndatepicker.setDefaults( datepicker.regional.el );\n\nreturn datepicker.regional.el;\n\n} );\n","jquery/ui-modules/i18n/datepicker-no.js":"/* Norwegian initialisation for the jQuery UI date picker plugin. */\n/* Written by Naimdjon Takhirov ([email protected]). */\n\n( function( factory ) {\n\t\"use strict\";\n\n\tif ( typeof define === \"function\" && define.amd ) {\n\n\t\t// AMD. Register as an anonymous module.\n\t\tdefine( [ \"../widgets/datepicker\" ], factory );\n\t} else {\n\n\t\t// Browser globals\n\t\tfactory( jQuery.datepicker );\n\t}\n} )( function( datepicker ) {\n\"use strict\";\n\ndatepicker.regional.no = {\n\tcloseText: \"Lukk\",\n\tprevText: \"«Forrige\",\n\tnextText: \"Neste»\",\n\tcurrentText: \"I dag\",\n\tmonthNames: [\n\t\t\"januar\",\n\t\t\"februar\",\n\t\t\"mars\",\n\t\t\"april\",\n\t\t\"mai\",\n\t\t\"juni\",\n\t\t\"juli\",\n\t\t\"august\",\n\t\t\"september\",\n\t\t\"oktober\",\n\t\t\"november\",\n\t\t\"desember\"\n\t],\n\tmonthNamesShort: [ \"jan\", \"feb\", \"mar\", \"apr\", \"mai\", \"jun\", \"jul\", \"aug\", \"sep\", \"okt\", \"nov\", \"des\" ],\n\tdayNamesShort: [ \"s\u00f8n\", \"man\", \"tir\", \"ons\", \"tor\", \"fre\", \"l\u00f8r\" ],\n\tdayNames: [ \"s\u00f8ndag\", \"mandag\", \"tirsdag\", \"onsdag\", \"torsd
2ag\", \"fredag\", \"l\u00f8rdag\" ],\n\tdayNamesMin: [ \"s\u00f8\", \"ma\", \"ti\", \"on\", \"to\", \"fr\", \"l\u00f8\" ],\n\tweekHeader: \"Uke\",\n\tdateFormat: \"dd.mm.yy\",\n\tfirstDay: 1,\n\tisRTL: false,\n\tshowMonthAfterYear: false,\n\tyearSuffix: \"\"\n};\ndatepicker.setDefaults( datepicker.regional.no );\n\nreturn datepicker.regional.no;\n\n} );\n","jquery/ui-modules/i18n/datepicker-sq.js":"/* Albanian initialisation for the jQuery UI date picker plugin. */\n/* Written by Flakron Bytyqi ([email protected]). */\n( function( factory ) {\n\t\"use strict\";\n\n\tif ( typeof define === \"function\" && define.amd ) {\n\n\t\t// AMD. Register as an anonymous module.\n\t\tdefine( [ \"../widgets/datepicker\" ], factory );\n\t} else {\n\n\t\t// Browser globals\n\t\tfactory( jQuery.datepicker );\n\t}\n} )( function( datepicker ) {\n\"use strict\";\n\ndatepicker.regional.sq = {\n\tcloseText: \"mbylle\",\n\tprevText: \"<mbrapa\",\n\tnextText: \"P\u00ebrpara>\",\n\tcurrentText: \"sot\",\n\tmonthNames: [ \"Janar\", \"Shkurt\", \"Mars\", \"Prill\", \"Maj\", \"Qershor\",\n\t\"Korrik\", \"Gusht\", \"Shtator\", \"Tetor\", \"N\u00ebntor\", \"Dhjetor\" ],\n\tmonthNamesShort: [ \"Jan\", \"Shk\", \"Mar\", \"Pri\", \"Maj\", \"Qer\",\n\t\"Kor\", \"Gus\", \"Sht\", \"Tet\", \"N\u00ebn\", \"Dhj\" ],\n\tdayNames: [ \"E Diel\", \"E H\u00ebn\u00eb\", \"E Mart\u00eb\", \"E M\u00ebrkur\u00eb\", \"E Enjte\", \"E Premte\", \"E Shtune\" ],\n\tdayNamesShort: [ \"Di\", \"H\u00eb\", \"Ma\", \"M\u00eb\", \"En\", \"Pr\", \"Sh\" ],\n\tdayNamesMin: [ \"Di\", \"H\u00eb\", \"Ma\", \"M\u00eb\", \"En\", \"Pr\", \"Sh\" ],\n\tweekHeader: \"Ja\",\n\tdateFormat: \"dd.mm.yy\",\n\tfirstDay: 1,\n\tisRTL: false,\n\tshowMonthAfterYear: false,\n\tyearSuffix: \"\" };\ndatepicker.setDefaults( datepicker.regional.sq );\n\nreturn datepicker.regional.sq;\n\n} );\n","jquery/ui-modules/i18n/datepicker-nn.js":"/* Norwegian Nynorsk initialisation for the jQuery UI date picker plugin. */\n/* Written by Bj\u00f8rn Johansen ([email protected]). */\n( function( factory ) {\n\t\"use strict\";\n\n\tif ( typeof define === \"function\" && define.amd ) {\n\n\t\t// AMD. Register as an anonymous module.\n\t\tdefine( [ \"../widgets/datepicker\" ], factory );\n\t} else {\n\n\t\t// Browser globals\n\t\tfactory( jQuery.datepicker );\n\t}\n} )( function( datepicker ) {\n\"use strict\";\n\ndatepicker.regional.nn = {\n\tcloseText: \"Lukk\",\n\tprevText: \"«F\u00f8rre\",\n\tnextText: \"Neste»\",\n\tcurrentText: \"I dag\",\n\tmonthNames: [\n\t\t\"januar\",\n\t\t\"februar\",\n\t\t\"mars\",\n\t\t\"april\",\n\t\t\"mai\",\n\t\t\"juni\",\n\t\t\"juli\",\n\t\t\"august\",\n\t\t\"september\",\n\t\t\"oktober\",\n\t\t\"november\",\n\t\t\"desember\"\n\t],\n\tmonthNamesShort: [ \"jan\", \"feb\", \"mar\", \"apr\", \"mai\", \"jun\", \"jul\", \"aug\", \"sep\", \"okt\", \"nov\", \"des\" ],\n\tdayNamesShort: [ \"sun\", \"m\u00e5n\", \"tys\", \"ons\", \"tor\", \"fre\", \"lau\" ],\n\tdayNames: [ \"sundag\", \"m\u00e5ndag\", \"tysdag\", \"onsdag\", \"torsdag\", \"fredag\", \"laurdag\" ],\n\tdayNamesMin: [ \"su\", \"m\u00e5\", \"ty\", \"on\", \"to\", \"fr\", \"la\" ],\n\tweekHeader: \"Veke\",\n\tdateFormat: \"dd.mm.yy\",\n\tfirstDay: 1,\n\tisRTL: false,\n\tshowMonthAfterYear: false,\n\tyearSuffix: \"\"\n};\ndatepicker.setDefaults( datepicker.regional.nn );\n\nreturn datepicker.regional.nn;\n\n} );\n","jquery/ui-modules/i18n/datepicker-ka.js":"/* Georgian (UTF-8) initialisation for the jQuery UI date picker plugin. */\n/* Written by Lado Lomidze ([email protected]). */\n( function( factory ) {\n\t\"use strict\";\n\n\tif ( typeof define === \"function\" && define.amd ) {\n\n\t\t// AMD. Register as an anonymous module.\n\t\tdefine( [ \"../widgets/datepicker\" ], factory );\n\t} else {\n\n\t\t// Browser globals\n\t\tfactory( jQuery.datepicker );\n\t}\n} )( function( datepicker ) {\n\"use strict\";\n\ndatepicker.regional.ka = {\n\tcloseText: \"\u10d3\u10d0\u10ee\u10e3\u10e0\u10d5\u10d0\",\n\tprevText: \"< \u10ec\u10d8\u10dc\u10d0\",\n\tnextText: \"\u10e8\u10d4\u10db\u10d3\u10d4\u10d2\u10d8 >\",\n\tcurrentText: \"\u10d3\u10e6\u10d4\u10e1\",\n\tmonthNames: [\n\t\t\"\u10d8\u10d0\u10dc\u10d5\u10d0\u10e0\u10d8\",\n\t\t\"\u10d7\u10d4\u10d1\u10d4\u10e0\u10d5\u10d0\u10da\u10d8\",\n\t\t\"\u10db\u10d0\u10e0\u10e2\u10d8\",\n\t\t\"\u10d0\u10de\u10e0\u10d8\u10da\u10d8\",\n\t\t\"\u10db\u10d0\u10d8\u10e1\u10d8\",\n\t\t\"\u10d8\u10d5\u10dc\u10d8\u10e1\u10d8\",\n\t\t\"\u10d8\u10d5\u10da\u10d8\u10e1\u10d8\",\n\t\t\"\u10d0\u10d2\u10d5\u10d8\u10e1\u10e2\u10dd\",\n\t\t\"\u10e1\u10d4\u10e5\u10e2\u10d4\u10db\u10d1\u10d4\u10e0\u10d8\",\n\t\t\"\u10dd\u10e5\u10e2\u10dd\u10db\u10d1\u10d4\u10e0\u10d8\",\n\t\t\"\u10dc\u10dd\u10d4\u10db\u10d1\u10d4\u10e0\u10d8\",\n\t\t\"\u10d3\u10d4\u10d9\u10d4\u10db\u10d1\u10d4\u10e0\u10d8\"\n\t],\n\tmonthNamesShort: [ \"\u10d8\u10d0\u10dc\", \"\u10d7\u10d4\u10d1\", \"\u10db\u10d0\u10e0\", \"\u10d0\u10de\u10e0\", \"\u10db\u10d0\u10d8\", \"\u10d8\u10d5\u10dc\", \"\u10d8\u10d5\u10da\", \"\u10d0\u10d2\u10d5\", \"\u10e1\u10d4\u10e5\", \"\u10dd\u10e5\u10e2\", \"\u10dc\u10dd\u10d4\", \"\u10d3\u10d4\u10d9\" ],\n\tdayNames: [ \"\u10d9\u10d5\u10d8\u10e0\u10d0\", \"\u10dd\u10e0\u10e8\u10d0\u10d1\u10d0\u10d7\u10d8\", \"\u10e1\u10d0\u10db\u10e8\u10d0\u10d1\u10d0\u10d7\u10d8\", \"\u10dd\u10d7\u10ee\u10e8\u10d0\u10d1\u10d0\u10d7\u10d8\", \"\u10ee\u10e3\u10d7\u10e8\u10d0\u10d1\u10d0\u10d7\u10d8\", \"\u10de\u10d0\u10e0\u10d0\u10e1\u10d9\u10d4\u10d5\u10d8\", \"\u10e8\u10d0\u10d1\u10d0\u10d7\u10d8\" ],\n\tdayNamesShort: [ \"\u10d9\u10d5\", \"\u10dd\u10e0\u10e8\", \"\u10e1\u10d0\u10db\", \"\u10dd\u10d7\u10ee\", \"\u10ee\u10e3\u10d7\", \"\u10de\u10d0\u10e0\", \"\u10e8\u10d0\u10d1\" ],\n\tdayNamesMin: [ \"\u10d9\u10d5\", \"\u10dd\u10e0\u10e8\", \"\u10e1\u10d0\u10db\", \"\u10dd\u10d7\u10ee\", \"\u10ee\u10e3\u10d7\", \"\u10de\u10d0\u10e0\", \"\u10e8\u10d0\u10d1\" ],\n\tweekHeader: \"\u10d9\u10d5\u10d8\u10e0\u10d0\",\n\tdateFormat: \"dd-mm-yy\",\n\tfirstDay: 1,\n\tisRTL: false,\n\tshowMonthAfterYear: false,\n\tyearSuffix: \"\" };\ndatepicker.setDefaults( datepicker.regional.ka );\n\nreturn datepicker.regional.ka;\n\n} );\n","jquery/ui-modules/i18n/datepicker-zh-TW.js":"/* Chinese initialisation for the jQuery UI date picker plugin. */\n/* Written by Ressol ([email protected]). */\n( function( factory ) {\n\t\"use strict\";\n\n\tif ( typeof define === \"function\" && define.amd ) {\n\n\t\t// AMD. Register as an anonymous module.\n\t\tdefine( [ \"../widgets/datepicker\" ], factory );\n\t} else {\n\n\t\t// Browser globals\n\t\tfactory( jQuery.datepicker );\n\t}\n} )( function( datepicker ) {\n\"use strict\";\n\ndatepicker.regional[ \"zh-TW\" ] = {\n\tcloseText: \"\u95dc\u9589\",\n\tprevText: \"<\u4e0a\u500b\u6708\",\n\tnextText: \"\u4e0b\u500b\u6708>\",\n\tcurrentText: \"\u4eca\u5929\",\n\tmonthNames: [ \"\u4e00\u6708\", \"\u4e8c\u6708\", \"\u4e09\u6708\", \"\u56db\u6708\", \"\u4e94\u6708\", \"\u516d\u6708\",\n\t\"\u4e03\u6708\", \"\u516b\u6708\", \"\u4e5d\u6708\", \"\u5341\u6708\", \"\u5341\u4e00\u6708\", \"\u5341\u4e8c\u6708\" ],\n\tmonthNamesShort: [ \"\u4e00\u6708\", \"\u4e8c\u6708\", \"\u4e09\u6708\", \"\u56db\u6708\", \"\u4e94\u6708\", \"\u516d\u6708\",\n\t\"\u4e03\u6708\", \"\u516b\u6708\", \"\u4e5d\u6708\", \"\u5341\u6708\", \"\u5341\u4e00\u6708\", \"\u5341\u4e8c\u6708\" ],\n\tdayNames: [ \"\u
2661f\u671f\u65e5\", \"\u661f\u671f\u4e00\", \"\u661f\u671f\u4e8c\", \"\u661f\u671f\u4e09\", \"\u661f\u671f\u56db\", \"\u661f\u671f\u4e94\", \"\u661f\u671f\u516d\" ],\n\tdayNamesShort: [ \"\u9031\u65e5\", \"\u9031\u4e00\", \"\u9031\u4e8c\", \"\u9031\u4e09\", \"\u9031\u56db\", \"\u9031\u4e94\", \"\u9031\u516d\" ],\n\tdayNamesMin: [ \"\u65e5\", \"\u4e00\", \"\u4e8c\", \"\u4e09\", \"\u56db\", \"\u4e94\", \"\u516d\" ],\n\tweekHeader: \"\u9031\",\n\tdateFormat: \"yy/mm/dd\",\n\tfirstDay: 1,\n\tisRTL: false,\n\tshowMonthAfterYear: true,\n\tyearSuffix: \"\u5e74\" };\ndatepicker.setDefaults( datepicker.regional[ \"zh-TW\" ] );\n\nreturn datepicker.regional[ \"zh-TW\" ];\n\n} );\n","jquery/ui-modules/i18n/datepicker-ar-DZ.js":"/* Algerian Arabic Translation for jQuery UI date picker plugin.\n/* Used in most of Maghreb countries, primarily in Algeria, Tunisia, Morocco.\n/* Mohamed Cherif BOUCHELAGHEM -- [email protected] */\n/* Mohamed Amine HADDAD -- [email protected] */\n\n( function( factory ) {\n\t\"use strict\";\n\n\tif ( typeof define === \"function\" && define.amd ) {\n\n\t\t// AMD. Register as an anonymous module.\n\t\tdefine( [ \"../widgets/datepicker\" ], factory );\n\t} else {\n\n\t\t// Browser globals\n\t\tfactory( jQuery.datepicker );\n\t}\n} )( function( datepicker ) {\n\"use strict\";\n\ndatepicker.regional[ \"ar-DZ\" ] = {\n\tcloseText: \"\u0625\u063a\u0644\u0627\u0642\",\n\tprevText: \"<\u0627\u0644\u0633\u0627\u0628\u0642\",\n\tnextText: \"\u0627\u0644\u062a\u0627\u0644\u064a>\",\n\tcurrentText: \"\u0627\u0644\u064a\u0648\u0645\",\n\tmonthNames: [ \"\u062c\u0627\u0646\u0641\u064a\", \"\u0641\u064a\u0641\u0631\u064a\", \"\u0645\u0627\u0631\u0633\", \"\u0623\u0641\u0631\u064a\u0644\", \"\u0645\u0627\u064a\", \"\u062c\u0648\u0627\u0646\",\n\t\"\u062c\u0648\u064a\u0644\u064a\u0629\", \"\u0623\u0648\u062a\", \"\u0633\u0628\u062a\u0645\u0628\u0631\", \"\u0623\u0643\u062a\u0648\u0628\u0631\", \"\u0646\u0648\u0641\u0645\u0628\u0631\", \"\u062f\u064a\u0633\u0645\u0628\u0631\" ],\n\tmonthNamesShort: [ \"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\", \"8\", \"9\", \"10\", \"11\", \"12\" ],\n\tdayNames: [ \"\u0627\u0644\u0623\u062d\u062f\", \"\u0627\u0644\u0627\u062b\u0646\u064a\u0646\", \"\u0627\u0644\u062b\u0644\u0627\u062b\u0627\u0621\", \"\u0627\u0644\u0623\u0631\u0628\u0639\u0627\u0621\", \"\u0627\u0644\u062e\u0645\u064a\u0633\", \"\u0627\u0644\u062c\u0645\u0639\u0629\", \"\u0627\u0644\u0633\u0628\u062a\" ],\n\tdayNamesShort: [ \"\u0627\u0644\u0623\u062d\u062f\", \"\u0627\u0644\u0627\u062b\u0646\u064a\u0646\", \"\u0627\u0644\u062b\u0644\u0627\u062b\u0627\u0621\", \"\u0627\u0644\u0623\u0631\u0628\u0639\u0627\u0621\", \"\u0627\u0644\u062e\u0645\u064a\u0633\", \"\u0627\u0644\u062c\u0645\u0639\u0629\", \"\u0627\u0644\u0633\u0628\u062a\" ],\n\tdayNamesMin: [ \"\u062d\", \"\u0646\", \"\u062b\", \"\u0631\", \"\u062e\", \"\u062c\", \"\u0633\" ],\n\tweekHeader: \"\u0623\u0633\u0628\u0648\u0639\",\n\tdateFormat: \"dd/mm/yy\",\n\tfirstDay: 6,\n\t\tisRTL: true,\n\tshowMonthAfterYear: false,\n\tyearSuffix: \"\" };\ndatepicker.setDefaults( datepicker.regional[ \"ar-DZ\" ] );\n\nreturn datepicker.regional[ \"ar-DZ\" ];\n\n} );\n","jquery/ui-modules/i18n/datepicker-es.js":"/* Inicializaci\u00f3n en espa\u00f1ol para la extensi\u00f3n 'UI date picker' para jQuery. */\n/* Traducido por Vester ([email protected]). */\n( function( factory ) {\n\t\"use strict\";\n\n\tif ( typeof define === \"function\" && define.amd ) {\n\n\t\t// AMD. Register as an anonymous module.\n\t\tdefine( [ \"../widgets/datepicker\" ], factory );\n\t} else {\n\n\t\t// Browser globals\n\t\tfactory( jQuery.datepicker );\n\t}\n} )( function( datepicker ) {\n\"use strict\";\n\ndatepicker.regional.es = {\n\tcloseText: \"Cerrar\",\n\tprevText: \"<Ant\",\n\tnextText: \"Sig>\",\n\tcurrentText: \"Hoy\",\n\tmonthNames: [ \"enero\", \"febrero\", \"marzo\", \"abril\", \"mayo\", \"junio\",\n\t\"julio\", \"agosto\", \"septiembre\", \"octubre\", \"noviembre\", \"diciembre\" ],\n\tmonthNamesShort: [ \"ene\", \"feb\", \"mar\", \"abr\", \"may\", \"jun\",\n\t\"jul\", \"ago\", \"sep\", \"oct\", \"nov\", \"dic\" ],\n\tdayNames: [ \"domingo\", \"lunes\", \"martes\", \"mi\u00e9rcoles\", \"jueves\", \"viernes\", \"s\u00e1bado\" ],\n\tdayNamesShort: [ \"dom\", \"lun\", \"mar\", \"mi\u00e9\", \"jue\", \"vie\", \"s\u00e1b\" ],\n\tdayNamesMin: [ \"D\", \"L\", \"M\", \"X\", \"J\", \"V\", \"S\" ],\n\tweekHeader: \"Sm\",\n\tdateFormat: \"dd/mm/yy\",\n\tfirstDay: 1,\n\tisRTL: false,\n\tshowMonthAfterYear: false,\n\tyearSuffix: \"\" };\ndatepicker.setDefaults( datepicker.regional.es );\n\nreturn datepicker.regional.es;\n\n} );\n","Magento_Search/js/form-mini.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\n/**\n * @api\n */\ndefine([\n 'jquery',\n 'underscore',\n 'mage/template',\n 'matchMedia',\n 'jquery-ui-modules/widget',\n 'jquery-ui-modules/core',\n 'mage/translate'\n], function ($, _, mageTemplate, mediaCheck) {\n 'use strict';\n\n /**\n * Check whether the incoming string is not empty or if doesn't consist of space
2s.\n *\n * @param {String} value - Value to check.\n * @returns {Boolean}\n */\n function isEmpty(value) {\n return value.length === 0 || value == null || /^\\s+$/.test(value);\n }\n\n $.widget('mage.quickSearch', {\n options: {\n autocomplete: 'off',\n minSearchLength: 3,\n responseFieldElements: 'ul li',\n selectClass: 'selected',\n template:\n '<li class=\"<%- data.row_class %>\" id=\"qs-option-<%- data.index %>\" role=\"option\">' +\n '<span class=\"qs-option-name\">' +\n ' <%- data.title %>' +\n '</span>' +\n '<span aria-hidden=\"true\" class=\"amount\">' +\n '<%- data.num_results %>' +\n '</span>' +\n '</li>',\n submitBtn: 'button[type=\"submit\"]',\n searchLabel: '[data-role=minisearch-label]',\n isExpandable: null,\n suggestionDelay: 300\n },\
2n\n /** @inheritdoc */\n _create: function () {\n this.responseList = {\n indexList: null,\n selected: null\n };\n this.autoComplete = $(this.options.destinationSelector);\n this.searchForm = $(this.options.formSelector);\n this.submitBtn = this.searchForm.find(this.options.submitBtn)[0];\n this.searchLabel = this.searchForm.find(this.options.searchLabel);\n this.isExpandable = this.options.isExpandable;\n\n _.bindAll(this, '_onKeyDown', '_onPropertyChange', '_onSubmit');\n\n this.submitBtn.disabled = true;\n\n this.element.attr('autocomplete', this.options.autocomplete);\n\n mediaCheck({\n media: '(max-width: 768px)',\n entry: function () {\n this.isExpandable = true;\n }.bind(this),\n exit: function () {\n this.isExpandable = true;\n }.bind(this)\n });\n\n this.searchLabel.on('click', function (e) {\n // allow input to lose its' focus when clicking on label\n if (this.isExpandable && this.isActive()) {\n e.preventDefault();\n }\n }.bind(this));\n\n this.element.on('blur', $.proxy(function () {\n if (!this.searchLabel.hasClass('active')) {\n return;\n }\n\n setTimeout($.proxy(function () {\n if (this.autoComplete.is(':hidden')) {\n this.setActiveState(false);\n } else {\n this.element.trigger('focus');\n }\n this.autoComplete.hide();\n this._updateAriaHasPopup(false);\n }, this), 250);\n }, this));\n\n if (this.element.get(0) === document.activeElement) {\n this.setActiveState(true);\n }\n\n this.element.on('focus', this.setActiveState.bind(this, true));\n this.element.on('keydown', this._onKeyDown);\n // Prevent spamming the server with requests by waiting till the user has stopped typing for period of time\n this.element.on('input propertychange', _.debounce(this._onPropertyChange, this.options.suggestionDelay));\n\n this.searchForm.on('submit', $.proxy(function (e) {\n this._onSubmit(e);\n this._updateAriaHasPopup(false);\n }, this));\n },\n\n /**\n * Checks if search field is active.\n *\n * @returns {Boolean}\n */\n isActive: function () {\n return this.searchLabel.hasClass('active');\n },\n\n /**\n * Sets state of the search field to provided value.\n *\n * @param {Boolean} isActive\n */\n setActiveState: function (isActive) {\n var searchValue;\n\n this.searchForm.toggleClass('active', isActive);\n this.searchLabel.toggleClass('active', isActive);\n\n if (this.isExpandable) {\n this.element.attr('aria-expanded', isActive);\n searchValue = this.element.val();\n this.element.val('');\n this.element.val(searchValue);\n }\n },\n\n /**\n * @private\n * @return {Element} The first element in the suggestion list.\n */\n _getFirstVisibleElement: function () {\n return this.responseList.indexList ? this.responseList.indexList.first() : false;\n },\n\n /**\n * @private\n * @return {Element} The last element in the suggestion list.\n */\n _getLastElement: function () {\n return this.responseList.indexList ? this.responseList.indexList.last() : false;\n },\n\n /**\n * @private\n * @param {Boolean} show - Set attribute aria-haspopup to \"true/false\" for element.\n */\n _updateAriaHasPopup: function (show) {\n if (show) {\n this.element.attr('aria-haspopup', 'true');\n } else {\n this.element.attr('aria-haspopup', 'false');\n }\n },\n\n /**\n * Clears the item selected from the suggestion list and resets the suggestion list.\n * @private\n * @param {Boolean} all - Controls whether to clear the suggestion list.\n */\n _resetResponseList: function (all) {\n this.responseList.selected = null;\n\n if (all === true) {\n this.responseList.indexList = null;\n }\n },\n\n /**\n * Executes when the search box is submitted. Sets the search input field to the\n * value of the selected item.\n * @private\n * @param {Event} e - The submit event\n */\n _onSubmit: function (e) {\n var value = this.element.val();\n\n if (isEmpty(value)) {\n e.preventDefault();\n }\n\n if (this.responseList.selected) {\n this.element.val(this.responseList.selected.find('.qs-option-name').text());\n }\n },\n\n /**\n * Executes when keys are pressed in the search input field. Performs specific actions\n * depending on which keys are pressed.\n * @private\n * @param {Event} e - The key down event\n * @return {Boolean} Default return type for any unhandled keys\n */\n _onKeyDown: function (e) {\n var keyCode = e.keyCode || e.which;\n\n switch (keyCode) {\n case $.ui.keyCode.HOME:\n if (this._getFirstVisibleElement()) {\n this._getFirstVisibleElement().addClass(this.options.selectClass);\n this.responseList.selected = this._getFirstVisibleElement();\n }\n break;\n\n case $.ui.keyCode.END:\n if (this._getLastElement()) {\n this._getLastElement().addClass(this.options.selectClass);\n this.responseList.selected = this._getLastElement();\n }\n break;\n\n case $.ui.keyCode.ESCAPE:\n this._resetResponseList(true);\n this.autoComplete.hide();\n break;\n\n case $.ui.keyCode.ENTER:\n if (this.element.val().length >= parseInt(this.options.minSearchLength, 10)) {\n this.searchForm.trigger('submit');\n e.preventDefault();\n }\n break;\n\n case $.ui.keyCode.DOWN:\n if (this.responseList.indexList) {\n if (!this.responseList.selected) { //eslint-disable-line max-depth\n this._getFirstVisibleElement().addClass(this.options.selectClass);\n this.responseList.selected = this._getFirstVisibleElement();\n } else if (!this._getLastElement().hasClass(this.options.selectClass)) {\n this.responseList.selected = this.responseList.selected\n .removeClass(this.options.selectClass).next().addClass(this.options.selectClass);\n } else {\n this.responseList.selected.removeClass(this.options.selectClass);\n this._getFirstVisibleElement().addClass(this.options.selectClass);\n this.responseList.selected = this._getFirstVisibleElement();\n }\n this.element.val(this.responseList.selected.find('.qs-option-name').text());\n this.element.attr('aria-activedescendant', this.responseList.selected.attr('id'));\n this._updateAriaHasPopup(true);\n this.autoComplete.show();\n }\n break;\n\n case $.ui.keyCode.UP:\n if (this.responseList.indexList !== null) {\n if (!this._getFirstVisibleElement().hasClass(this.options.selectClass)) {\n this.responseList.selected = this.responseList.selected\n .removeClass(this.options.selectClass).prev().addClass(this.options.selectClass);\n\n } else {\n this.responseList.selected.removeClass(this.options.selectClass);\n this._getLastElement().addClass(this.options.selectClass);\n this.responseList.selected = this._getLastElement();\n }\n this.element.val(this.responseList.selected.find('.qs-option-name').text());\n this.element.attr('aria-activedescendant', this.responseList.selected.attr('id'));\n this._updateAriaHasPopup(true);\n this.autoComplete.show();\n }\n break;\n default:\n return true;\n }\n },\n\n /**\n * Executes when the value of the search input field changes. Executes a GET request\n * to populate a suggestion list based on entered text. Handles click (select), hover,\n * and mouseout events on the populated suggestion list dropdown.\n * @private\n */\n _onPropertyChange: function () {\n var searchField = this.element,\n clonePosition = {\n position: 'absolute',\n // Removed to fix display issues\n // left: searchField.offset().left,\n // top: searchField.offset().top + searchField.outerHeight(),\
2n width: searchField.outerWidth()\n },\n source = this.options.template,\n template = mageTemplate(source),\n dropdown = $('<ul role=\"listbox\"></ul>'),\n value = this.element.val();\n\n this.submitBtn.disabled = true;\n\n if (value.length >= parseInt(this.options.minSearchLength, 10)) {\n this.submitBtn.disabled = false;\n\n if (this.options.url !== '') { //eslint-disable-line eqeqeq\n $.getJSON(this.options.url, {\n q: value\n }, $.proxy(function (data) {\n if (data.length) {\n $.each(data, function (index, element) {\n var html;\n\n element.index = index;\n html = template({\n data: element\n });\n dropdown.append(html);\n });\n\n this._resetResponseList(true);\n\n this.responseList.indexList = this.autoComplete.html(dropdown)\n .css(clonePosition)\n .show()\n .find(this.options.responseFieldElements + ':visible');\n\n this.element.removeAttr('aria-activedescendant');\n\n if (this.responseList.indexList.length) {\n this._updateAriaHasPopup(true);\n } else {\n this._updateAriaHasPopup(false);\n }\n\n this.responseList.indexList\n .on('click', function (e) {\n this.responseList.selected = $(e.currentTarget);\n this.searchForm.trigger('submit');\n }.bind(this))\n .on('mouseenter mouseleave', function (e) {\n this.responseList.indexList.removeClass(this.options.selectClass);\n $(e.target).addClass(this.options.selectClass);\n this.responseList.selected = $(e.target);\n this.element.attr('aria-activedescendant', $(e.target).attr('id'));\n }.bind(this))\n .on('mouseout', function (e) {\n if (!this._getLastElement() &&\n this._getLastElement().hasClass(this.options.selectClass)) {\n $(e.target).removeClass(this.options.selectClass);\n this._resetResponseList(false);\n }\n }.bind(this));\n } else {\n this._resetResponseList(true);\n this.autoComplete.hide();\n this._updateAriaHasPopup(false);\n this.element.removeAttr('aria-activedescendant');\n }\n }, this));\n }\n } else {\n this._resetResponseList(true);\n this.autoComplete.hide();\n this._updateAriaHasPopup(false);\n this.element.removeAttr('aria-activedescendant');\n }\n }\n });\n\n return $.mage.quickSearch;\n});\n","Macs_App/js/login-status-poll.js":"define([\n 'jquery',\n 'loader' // Magento Loader-Widget\n], function ($) {\n 'use strict';\n\n return function (config) {\n var checkUrl = config.checkUrl || '/app/check/loginstatus';\n var interval = parseInt(config.interval, 10);\n var cacheParamName = config.cacheParamName || 'appLoginPoll';\n var enablePreloader = !!config.enablePreloader;\n var storageKey = config.storageKey || 'appLoginReloadDone';\n\n if (isNaN(interval) || interval < 2000) {\n interval = 2000; // Mindestintervall 2 Sekunden\n }\n\n var stopped = false;\n var requestInProgress = false;\n var reloadDone = false;
2\n\n // Flag aus sessionStorage laden\n (function initReloadFlag() {\n try {\n reloadDone = window.sessionStorage.getItem(storageKey) === '1';\n } catch (e) {\n reloadDone = false;\n }\n })();\n\n function markReloadDone() {\n reloadDone = true;\n try {\n window.sessionStorage.setItem(storageKey, '1');\n } catch (e) {}\n }\n\n function resetReloadFlag() {\n reloadDone = false;\n try {\n window.sessionStorage.removeItem(storageKey);\n } catch (e) {}\n }\n\n function showPreloader() {\n if (!enablePreloader) {\n return;\n }\n $('body').trigger('processStart'); // Magento Loading-Mask\n }\n\n function buildReloadUrl() {\n var current = window.location.href.split('#');\n var base = current[0];\n var hash = current[1] ? '#' + current[1] : '';\n\n var parts = base.split('?');\n var path = parts[0];\n var query = parts[1] || '';\n\n var params = [];\n\n if (query) {\n query.split('&').forEach(function (item) {\n if (!item) {\n return;\n }\n\n // Existierenden Cache-Buster-Param entfernen\n if (item.indexOf(cacheParamName + '=') === 0) {\n return;\n }\n\n params.push(item);\n });\n }\n\n // Neuer Cache-Buster\n params.push(cacheParamName + '=' + (new Date().getTime()));\n\n return path + '?' + params.join('&') + hash;\n }\n\n function triggerReload() {\n if (reloadDone) {\n return;\n }\n\n markReloadDone();\n stopped = true; // nach dem Reload auf dieser Seite nicht weiter pollen\n\n showPreloader();\n\n var reloadUrl = buildReloadUrl();\n\n window.setTimeout(function () {\n // replace: kein zus\u00e4tzlicher History-Eintrag\n window.location.replace(reloadUrl);\n }, 16);\n }\n\n function scheduleNext() {\n if (stopped) {\n return;\n }\n window.setTimeout(poll, interval);\n }\n\n function poll() {\n if (stopped || requestInProgress) {\n return;\n }\n\n requestInProgress = true;\n\n $.ajax({\n url: checkUrl,\n type: 'POST',\n dataType: 'json',\n cache: false\n }).done(function (response) {\n requestInProgress = false;\n\n if (!response || response.success === false) {\n // Fehler / unerwartete Antwort -> sp\u00e4ter nochmal probieren\n scheduleNext();\n return;\n }\n\n var logged = !!response.is_logged_in;\n\n // FALL 1: Nicht eingeloggt -> Reload-Flag freigeben, aber keinen Reload erzwingen\n if (!logged) {\n resetReloadFlag();\n scheduleNext();\n return;\n }\n\n // FALL 2: Eingeloggt\n if (!reloadDone) {\n // F\u00fcr diesen Login-Zyklus wurde noch kein Hard-Reload gemacht\n triggerReload();\n return;\n }\n\n // Eingeloggt und Hard-Reload bereits durchgef\u00fchrt\n stopped = true;\n }).fail(function () {\n requestInProgress = false;\n scheduleNext();\n });\n }\n\n // Direkt starten\n poll();\n };\n});\n","Macs_App/js/downloadBanner.js":"define([\n 'uiComponent',\n 'Magento_Customer/js/customer-data',\n 'jquery',\n 'ko'\n], function (Component, customerData, $, ko) {\n 'use strict';\n\n return Component.extend({\n initialize: function (config) {\n this._super();\n\n var self = this;\n this.config = config || {};\n this.sectionName = 'app_download_banner';\n this._guardKey = 'reload_once:' + this.sectionName;\n\n // public properties used by the template bindings\n this.title = this.config.title || '';\n this.subtitle = this.config.subtitle || '';\n this.closeBannerUrl = this.config.closeBannerUrl || '';\n this.daysBeforeDisplay = this.config.daysBeforeDisplay || 21;\n\n this.$wrapper = $('#app-download-banner-wrapper');\n this.section = customerData.get(this.sectionName);\n let _section = this.section();\n\n // ensure section is loaded if missing (once per tab)\n this._ensureSectionLoadedOnce();\n\n // properties from section data\n this.downloadUrl = ko.observable(_section.downloadUrl ? _section.downloadUrl : '');\n this.downloadLogoUrl = ko.observable(_section.downloadLogoUrl ? _section.downloadLogoUrl : '');\n this.closingDate = ko.observable(_section.closingDate ? _section.closingDate : '');\n this.visible = ko.observable(!!(_section && this._normalizeFlag(_section.visible)));\n\n // reload section if closing date has passed\n this.reloadSectionIfDaysBeforeDisplayPassedClosingDate();\n\n // apply initial visibility (if section already present)\n this._applyVisibility(this.visible());
2\n\n this.section.subscribe(function (data) {\n var isVisible = !!data && self._normalizeFlag(data.visible);\n self.visible(isVisible);\n self._applyVisibility(isVisible);\n\n self.downloadUrl(data.downloadUrl ? data.downloadUrl : '');\n self.downloadLogoUrl(data.downloadLogoUrl ? data.downloadLogoUrl : '');\n self.closingDate(data.closingDate ? data.closingDate : '');\n });\n\n return this;\n },\n\n /**\n * Check if closing date has passed the daysBeforeDisplay Days, and reload section if true\n * e.g. closing date 30.06.2025 with daysBeforeDisplay=21 means reload if today is 21.07.2025 or later\n * @returns {Boolean} true if the section was reloaded, false otherwise\n */\n reloadSectionIfDaysBeforeDisplayPassedClosingDate: function () {\n try {\n let closingDateStr = this.closingDate(); // closingDateStr is expected in DD.MM.YYYY format\n\n if (!closingDateStr) {\n return false;\n }\n\n let daysBeforeDisplay = parseInt(this.daysBeforeDisplay, 10);\n if (isNaN(daysBeforeDisplay) || daysBeforeDisplay < 0) {\n daysBeforeDisplay = 21; // default\n }\n\n let closingDate = this._parseDateString(closingDateStr);\n closingDate.setDate(closingDate.getDate() + daysBeforeDisplay);\n\n let now = new Date();\n if (now >= closingDate) {\n customerData.invalidate([this.sectionName]);\n customerData.reload([this.sectionName], true);\n return true;\n }\n } catch (e) {\n console.warn('downloadBanner: failed to check closing date', e);\n }\n return false;\n },\n\n /**\n * Parse DD.MM.YYYY format string to Date object\n * @param {String} dateStr - Date string in DD.MM.YYYY format\n * @returns {Date} Parsed date object\n */\n _parseDateString: function (dateStr) {\n let parts = dateStr.split('.');\n let day = parseInt(parts[0], 10);\n let month = parseInt(parts[1], 10);\n let year = parseInt(parts[2], 10);\n\n return new Date(year, month - 1, day); // month is 0-indexed\n },\n\n /**\n * Close handler called from template (data-bind=\"click: closeBanner\")\n */\n closeBanner: function () {\n var self = this;\n if (!this.closeBannerUrl) {\n this.visible(false);\n this._applyVisibility(false);\n return;\n }\n\n $.post(this.closeBannerUrl).done(function () {\n // invalidate and reload the specific section so customer-data is updated\n self.visible(false);\n self._applyVisibility(false);\n customerData.invalidate([self.sectionName]);\n customerData.reload([self.sectionName], true);\n }).fail(function (xhr) {\n console.error('Close banner failed', xhr && xhr.responseText);\n });\n },\n\n /**\n * Set wrapper display according to flag.\n * Use display:flex when visible, otherwise hide.\n *\n * @param {Boolean} flag\n */\n _applyVisibility: function (flag) {\n if (!this.$wrapper || !this.$wrapper.length) {\n this.$wrapper = $('#app-download-banner-wrapper');\n }\n\n if (flag) {\n this.$wrapper.css('display', 'flex');\n } else {\n this.$wrapper.css('display', 'none');\n }\n },\n\n /**\n * Normalize various representations of truthy values.\n * Accepts boolean, number, \"1\"/\"true\"/\"yes\"/\"on\" strings, etc.\n */\n _normalizeFlag: function (value) {\n if (typeof value === 'boolean') { return value; }\n if (typeof value === 'number') { return value !== 0; }\n if (typeof value === 'string') {\n var v = value.toLowerCase().trim();\n return v === '1' || v === 'true' || v === 'yes' || v === 'on';\n }\n return !!value;\n },\n\n /**\n * Check if customer-data section exists in localStorage mage-cache-storage\n * @param {String} name\n * @returns {Boolean}\n */\n _hasSectionInStorage: function (name) {\n try {\n var raw = localStorage.getItem('mage-cache-storage');\n if (!raw || raw === '{}') {\n return false;\n }\n var data = JSON.parse(raw);\n return !!data && Object.prototype.hasOwnProperty.call(data, name);\n } catch (e) {\n return false;\n }\n },\n\n /**\n * Invalidate and reload the customer-data section once per browser tab if missing\n */\n _ensureSectionLoadedOnce: function () {\n try {\n if (!this._hasSectionInStorage(this.sectionName) && !sessionStorage.getItem(this._guardKey)) {\n sessionStorage.setItem(this._guardKey, '1');\n customerData.invalidate([this.sectionName]);\n customerData.reload([this.sectionName], true);\n }\n } catch (e) {\n console.warn('downloadBanner: failed to ensure section loaded', e);\n }\n }\n });\n});","Macs_App/js/sim-toolbar.js":"define(['jquery', 'Magento_Customer/js/customer-data'], function ($, customerData) {\n 'use strict';\n\n var COOKIE_TOKEN = 'MACS_SIM_TOKEN';\n var COOKIE_APP = 'IS_APP_CALL';\n\n function getCookie(name) {\n var m = document.cookie.match(new RegExp('(?:^|; )' + name + '=([^;]*)'));\n return m ? decodeURIComponent(m[1]) : null;\n }\n\n function setCookie(name, value) {\n document.cookie = name + '=' + encodeURIComponent(value) + '; path=/; SameSite=Lax';\n }\n\n function deleteCookie(name) {\n document.cookie = name + '=; path=/; expires=Thu, 01 Jan 1970 00:00:00 GMT; SameSite=Lax';\n }\n\n function parseJwt(token) {\n try {\n var b64 = token.split('.')[1].replace(/-/g, '+').replace(/_/g, '/');\n while (b64.length % 4) { b64 += '='; }\n return JSON.parse(atob(b64));\n } catch (e) { return null; }\n }\n\n function fmtExp(exp) {\n if (!exp) { return '-'; }\n var diff = exp * 1000 - Date.now();\n if (diff < 0) { return 'ABGELAUFEN'; }\n var mins = Math.floor(diff / 60000);\n var hrs = Math.floor(mins / 60);\n return hrs > 0 ? 'in ' + hrs + 'h ' + (mins % 60) + 'min' : 'in ' + mins + 'min';\n }\n\n return function (config) {\n var authUrl = config.authUrl;\n var logoutUrl = config.logoutUrl;\n var storeCode = config.storeCode || '-';\n var storeName = config.storeName || '-';\n var varyValue = config.varyValue || '';\n var phpGroup = config.customerGroup || '';\n var homeUrl = config.homeUrl || '/';\n var accountUrl = config.accountUrl || '/customer/account';\n var cartUrl = config.cartUrl || '/checkout/cart';\n var checkoutUrl = config.checkoutUrl || '/checkout';\n\n var css = [\n '#macs-sim-tb{position:fixed;bottom:16px;left:16px;z-index:99999;',\n 'font-family:-apple-system,BlinkMacSystemFont,\"Segoe UI\",sans-serif;font-size:13px;line-height:1.4}',\n\n '#macs-sim-tb-toggle{background:#555;color:#ccc;border:2px solid #777;',\n 'border-radius:8px;padding:6px 14px;cursor:pointer;font-weight:700;font-size:12px;letter-spacing:.5px}',\n '#macs-sim-tb-toggle.active{background:#2e7d32;color:#fff;border-color:#4caf50}',\n\n '#macs-sim-tb-panel{background:#1a1a2e;color:#ddd;border:1px solid #444;',\n 'border-radius:10px;padding:14px;width:295px;margin-bottom:8px;display:none;',\n 'box-shadow:0 6px 28px rgba(0,0,0,.65)}',\n '#macs-sim-tb-panel.active{border-color:#4caf50}',\n\n '#macs-sim-tb-panel h4{margin:0 0 10px;color:#888;font-size:11px;',\n 'font-weight:700;text-transform:uppercase;letter-spacing:1.5px}',\n '#macs-sim-tb-panel.active h4{color:#4caf50}',\n\n '.stb-sec{margin-bottom:10px}',\n '.stb-sec-title{font-size:10px;color:#9b9b9b;text-transform:uppercase;letter-spacing:1px;',\n 'margin-bottom:5px;padding-bottom:3px;border-bottom:1px solid #4f4f6b}',\n\n '.stb-row{display:flex;justify-content:space-between;align-items:center;',\n 'margin-bottom:4px;font-size:12px;color:#eeeeee}',\n '.stb-val{color:#eeeeee;font-size:11px;max-width:170px;overflow:hidden;',\n 'text-overflow:ellipsis;white-space:nowrap;text-align:right}',\n\n '.stb-badge{padding:2px 8px;border-radius:10px;font-size:11px;font-weight:600}',\n '.stb-badge.on{background:#2e7d32;color:#fff}',\n '.stb-badge.off{background:#2a2a2a;color:#555}',\n '.stb-hr{border:none;border-top:1px solid #2a2a40;margin:10px 0}',\n '.stb-links{display:grid;grid-template-columns:1fr 1fr;gap:5px;margin-top:4px}',\n '.stb-link{display:block;padding:5px 0;background:#1e1e38;border:1px solid #3a3a50;',\n 'border-radius:4px;color:#aaa;font-size:11px;text-align:center;text-decoration:none}',\n '.stb-link:visited{color:#aaa}',\n '.stb-link:hover{background:#2a2a50;color:#ddd;border-color:#5a5a80}',\n\n '#macs-sim-tb-panel input,#macs-sim-tb-panel select{width:100%;box-sizing:border-box;',\n 'padding:6px 8px;margin-bottom:6px;background:#0f0f1a;border:1px solid #3a3a50;',\n 'color:#ddd;border-radius:4px;font-size:12px}',\n\n '.stb-btn{width:100%;padding:7px;border:none;border-radius:5px;',\n 'cursor:pointer;font-size:12px;font-weight:600;margin-top:4px}',\n '.stb-btn-primary{background:#2e7d32;color:#fff}',\n '.stb-btn-primary:hover{background:#1b5e20}',\n '.stb-btn-stop{background:#3a3a3a;color:#ccc}',\n '.stb-btn-stop:hover{background:#c62828;color:#fff}',\n '.stb-btn-warn{background:#4a3800;color:#ffe082}',\n '.stb-btn-warn:hover{background:#f57f17;color:#fff}',\n\n '.stb-msg{margin-top:8px;font-size:11px;padding:5px 8px;border-radius:4px;display:none}',\n '.stb-msg.err{background:#3a0a10;color:#f88;border:1px solid #c62828}',\n '.stb-msg.ok{background:#0a3a14;color:#8f8;border:1px solid #4caf50}'\n ].join('');\n\n $('<style>').text(css).appendTo('head');\n\n var html = '<div id=\"macs-sim-tb\">' +\n '<div id=\"macs-sim-tb-panel\">
2' +\n '<h4>App-Simulator</h4>' +\n\n '<div class=\"stb-sec\">' +\n '<div class=\"stb-sec-title\">Simulation</div>' +\n '<div class=\"stb-row\"><span>App-Call:</span>' +\n '<span id=\"stb-app\" class=\"stb-badge off\">-</span></div>' +\n '<div class=\"stb-row\"><span>Token:</span>' +\n '<span id=\"stb-tok\" class=\"stb-badge off\">-</span></div>' +\n '<div class=\"stb-row\"><span>Token-Ablauf:</span>' +\n '<span id=\"stb-exp\" class=\"stb-val\">-</span></div>' +\n '</div>' +\n\n '<div class=\"stb-sec\">' +\n '<div class=\"stb-sec-title\">Kunde</div>' +\n '<div class=\"stb-row\"><span>Status:</span>' +\n '<span id=\"stb-loggedin\" class=\"stb-badge off\">-</span></div>' +\n '<div class=\"stb-row\"><span>Kunden-ID:</span>' +\n '<span id=\"stb-uid\" class=\"stb-val\">-</span></div>' +\n '<div class=\"stb-row\"><span>Name:</span>' +\n '<span id=\"stb-custname\" class=\"stb-val\">-</span></div>' +\n '<div class=\"stb-row\"><span>Gruppe:</span>' +\n '<span id=\"stb-custgroup\" class=\"stb-val\">-</span></div>' +\n '</div>' +\n\n '<div class=\"stb-sec\">' +\n '<div class=\"stb-sec-title\">Session / Cache</div>' +\n '<div class=\"stb-row\"><span>X-Magento-Vary:</span>' +\n '<span id=\"stb-vary\" class=\"stb-val\">-</span></div>' +\n '<div class=\"stb-row\"><span>Store:</span>' +\n '<span class=\"stb-val\" title=\"' + storeName + ' (' + storeCode + ')\">' + storeName + ' (' + storeCode + ')</span></div>' +\n '</div>' +\n\n '<div class=\"stb-sec\">' +\n '<div class=\"stb-sec-title\">Quick Links</div>' +\n '<div class=\"stb-links\">' +\n '<a class=\"stb-link\" href=\"' + homeUrl + '\">Startseite</a>' +\n '<a class=\"stb-link\" href=\"' + accountUrl + '\">Mein Konto</a>' +\n '<a class=\"stb-link\" href=\"' + cartUrl + '\">Warenkorb</a>' +\n '<a class=\"stb-link\" href=\"' + checkoutUrl + '\">Kasse</a>' +\n '</div>' +\n '</div>' +\n\n '<hr class=\"stb-hr\">' +\n '<div id=\"stb-form-login\">' +\n '<input type=\"email\" id=\"stb-email\" placeholder=\"E-Mail\" autocomplete=\"username\">' +\n '<input type=\"password\" id=\"stb-pass\" placeholder=\"Passwort\" autocomplete=\"current-password\">' +\n '<select id=\"stb-plat\">' +\n '<option value=\"android\">Android</option>' +\n '<option value=\"ios\">iOS</option>' +\n '</select>' +\n '<button class=\"stb-btn stb-btn-primary\" id=\"stb-btn-login\">Login & Simulieren</button>' +\n '</div>' +\n '<div id=\"stb-form-active\" style=\"display:none\">' +\n '<button class=\"stb-btn stb-btn-warn\" id=\"stb-btn-clear-jwt\">JWT l\u00f6schen (Session bleibt)</button>' +\n '<button class=\"stb-btn stb-btn-warn\" id=\"stb-btn-kill-session\">Session ablaufen (JWT bleibt)</button>' +\n '<button class=\"stb-btn stb-btn-stop\" id=\"stb-btn-stop\">Simulation beenden</button>' +\n '</div>' +\n '<div class=\"stb-msg\" id=\"stb-msg\"></div>' +\n '</div>' +\n '<button id=\"macs-sim-tb-toggle\">APP SIM</button>' +\n '</div>';\n\n $('body').append(html);\n\n var custSection = customerData.get('customer');\n custSection.subscribe(updateCustomerDisplay);\n updateCustomerDisplay(custSection());\n\n refreshSimStatus();\n setInterval(refreshSimStatus, 30000);\n\n $('#macs-sim-tb-toggle').on('click', function () {\n $('#macs-sim-tb-panel').toggle();\n });\n\n $('#stb-form-login input').on('keydown', function (e) {\n if (e.key === 'Enter') { $('#stb-btn-login').trigger('click'); }\n });\n\n $('#stb-btn-login').on('click', function () {\n var email = $.trim($('#stb-email').val());\n var pass = $('#stb-pass').val();\n var platform = $('#stb-plat').val();\n\n if (!email || !pass) {\n showMsg('E-Mail und Passwort erforderlich.', 'err');\n return;\n }\n\n var $btn = $(this).prop('disabled', true).text('...');\n\n $.ajax({\n url: authUrl,\n type: 'POST',\n data: { email: email, password: pass },\n dataType: 'json'\n }).done(function (token) {\n if (typeof token !== 'string' || token.indexOf('.') < 0) {\n showMsg('Ung\u00fcltige Antwort: ' + JSON.stringify(token), 'err');\n $btn.prop('disabled', false).text('Login & Simulieren');\n return;\n }
2\n setCookie(COOKIE_TOKEN, token);\n setCookie(COOKIE_APP, platform);\n customerData.invalidate(['customer']);\n showMsg('OK! Seite wird neu geladen...', 'ok');\n setTimeout(function () { location.reload(); }, 800);\n }).fail(function (xhr) {\n var msg = xhr.responseJSON || xhr.responseText || 'Unbekannter Fehler';\n showMsg('Fehler: ' + msg, 'err');\n $btn.prop('disabled', false).text('Login & Simulieren');\n });\n });\n\n // JWT l\u00f6schen, Session bleibt: testet ob Session alleine die Authentifizierung tr\u00e4gt\n $('#stb-btn-clear-jwt').on('click', function () {\n deleteCookie(COOKIE_TOKEN);\n customerData.invalidate(['customer']);\n showMsg('JWT gel\u00f6scht \u2013 Session bleibt. Neu laden...', 'ok');\n setTimeout(function () { location.reload(); }, 800);\n });\n\n // Session ablaufen: Logout ohne JWT zu l\u00f6schen.\n // Testet ob EarlyAuth/ForceReload nach Session-Ablauf aus dem JWT neu einloggen kann.\n $('#stb-btn-kill-session').on('click', function () {\n location.href = logoutUrl;\n });\n\n // Simulation komplett beenden: JWT + IS_APP_CALL l\u00f6schen, dann ausloggen\n $('#stb-btn-stop').on('click', function () {\n deleteCookie(COOKIE_TOKEN);\n deleteCookie(COOKIE_APP);\n customerData.invalidate(['customer']);\n location.href = logoutUrl;\n });\n\n function updateCustomerDisplay(cust) {\n var loggedIn = !!(cust && (cust.is_logged_in || cust.fullname));\n $('#stb-loggedin')\n .text(loggedIn ? 'EINGELOGGT' : 'GAST')\n .toggleClass('on', loggedIn).toggleClass('off', !loggedIn);\n var fullname = cust && cust.fullname ? cust.fullname : '-';\n $('#stb-custname').text(fullname).attr('title', fullname);\n var groupLabel = (cust && cust.group_id !== undefined)\n ? (phpGroup || 'Group ' + cust.group_id)\n : (phpGroup || '-');\n $('#stb-custgroup').text(groupLabel).attr('title', groupLabel);\n }\n\n function refreshSimStatus() {\n var token = getCookie(COOKIE_TOKEN);\n var app = getCookie(COOKIE_APP);\n var jwt = token ? parseJwt(token) : null;\n var uid = jwt ? (jwt.uid || '-') : '-';\n var exp = jwt ? fmtExp(jwt.exp) : '-';\n var active = !!(token || app);\n\n $('#stb-app').text(app ? app.toUpperCase() : '-')\n .toggleClass('on', !!app).toggleClass('off', !app);\n $('#stb-tok').text(token ? 'SET' : '-')\n .toggleClass('on', !!token).toggleClass('off', !token);\n $('#stb-uid').text(uid);\n $('#stb-exp').text(exp)\n .css('color', exp === 'ABGELAUFEN' ? '#f88' : '');\n\n $('#stb-vary').text(varyValue ? varyValue.substring(0, 12) + '...' : 'NOT SET').attr('title', varyValue || '');\n\n $('#macs-sim-tb-toggle').toggleClass('active', active);\n $('#macs-sim-tb-panel').toggleClass('active', active);\n $('#stb-form-login').toggle(!active);\n $('#stb-form-active').toggle(active);\n }\n\n function showMsg(text, type) {\n $('#stb-msg').removeClass('err ok').addClass(type).text(text).show();\n }\n };\n});\n","Amasty_ShippingTableRates/js/model/shipping-rates-validation-rules.js":"/*global define*/\ndefine(\n [],\n function () {\n \"use strict\";\n return {\n getRules: function () {\n return {\n 'postcode': {\n 'required': true\n },\n 'country_id': {\n 'required': true\n }
2,\n 'region_id': {\n 'required': true\n },\n 'region_id_input': {\n 'required': true\n }\n };\n }\n };\n }\n);\n","Amasty_ShippingTableRates/js/model/shipping-rates-validation-rules-mixin.js":"define([\n 'jquery',\n 'mage/utils/wrapper',\n 'uiRegistry'\n], function ($, wrapper) {\n \"use strict\";\n\n return function (shippingRatesValidationRules) {\n shippingRatesValidationRules.getObservableFields = wrapper.wrap(\n shippingRatesValidationRules.getObservableFields,\n function (originalAction) {\n var fields = originalAction();\n fields.push('street');\n fields.push('city');\n\n return fields;\n }\n );\n\n return shippingRatesValidationRules;\n };\n});\n","Amasty_ShippingTableRates/js/model/shipping-rates-validator.js":"/*global define*/\ndefine(\n [\n 'jquery',\n 'mageUtils',\n './shipping-rates-validation-rules',\n 'mage/translate'\n ],\n function ($, utils, validationRules, $t) {\n 'use strict';\n return {\n validationErrors: [],\n validate: function (address) {\n var self = this;\n this.validationErrors = [];\n $.each(validationRules.getRules(), function (field, rule) {\n if (rule.required && utils.isEmpty(address[field])) {\n var message = $t('Field ') + field + $t(' is required.');\n var regionFields = ['region', 'region_id', 'region_id_input'];\n if (\n $.inArray(field, regionFields) === -1\n || utils.isEmpty(address['region']) && utils.isEmpty(address['region_id'])\n ) {\n self.validationErrors.push(message);\n }\n }\n });\n return !Boolean(this.validationErrors.length);\n }\n };\n }\n);\n","Amasty_ShippingTableRates/js/view/shipping-rates-validation.js":"/**\n * Copyright \u00a9 2016 Magento. All rights reserved.\n * See COPYING.txt for license details.\n */\n/*browser:true*/\n/*global define*/\ndefine(\n [\n 'uiComponent',\n 'Magento_Checkout/js/model/shipping-rates-validator',\n 'Magento_Checkout/js/model/shipping-rates-validation-rules',\n '../model/shipping-rates-validator',\n '../model/shipping-rates-validation-rules'\n ],\n function (\n Component,\n defaultShippingRatesValidator,\n defaultShippingRatesValidationRules,\n shippingRatesValidator,\n shippingRatesValidationRules\n ) {\n 'use strict';\n defaultShippingRatesValidator.registerValidator('amstrates', shippingRatesValidator);\n defaultShippingRatesValidationRules.registerRules('amstrates', shippingRatesValidationRules);\n return Component;\n }\n);\n","Magento_Review/js/process-reviews.js":"define([\n \"jquery\",\n \"tabs\",\n \"collapsible\"\n], function ($) {\n \"use strict\";\n\n var reviewsSelector = \"#product-review-container\",\n moduleConfig = {},\n urlParser = document.createElement(\"a\");\n\n function normalizeUrl(url) {\n var original = url || \"\";\n\n if (!original && moduleConfig.productReviewUrl) {\n return moduleConfig.productReviewUrl;\n }\n\n if (!moduleConfig.productReviewUrl || original.indexOf(\"review/product/listAjax\") !== -1) {\n return original;\n }\n\n urlParser.href = original;\n\n var finalUrl = moduleConfig.productReviewUrl;\n if (urlParser.search) {\n finalUrl += (finalUrl.indexOf(\"?\") === -1 ? \"?\" : \"&\") + urlParser.search.substring(1);\n }\n\n return finalUrl;\n }\n\n function updatePagerLinks(root) {\n var $root = root && root.jquery ? root : $(root || reviewsSelector);\n\n if (!$root.length) {\n return;\n }\n\n $root.find(\".pages a\").each(function () {\n var ajaxUrl = normalizeUrl(this.getAttribute(\"href\"));\n if (ajaxUrl) {\n this.setAttribute(\"href\", ajaxUrl);\n }\n });\n }\n\n function activateReviewsTab() {\n var tabsContainer = $(\".product.data.items\"),\n activated = false;\n\n if (!tabsContainer.length) {\n return activated;\n }\n\n tabsContainer.find('[data-role=\"content\"]').each(function (index) {\n if (this.id === \"reviews\") {\n tabsContainer.tabs(\"activate\", index);\n activated = true;\n return false;\n }\n\n return true;\n });\n\n return activated;\n }\n\n function shouldOpenReviews(hash) {\n return hash === \"#reviews\" || hash === \"#tab-label-reviews\";\n }\n\n function handleHashChange() {\n if (shouldOpenReviews(window.location.hash)) {\n activateReviewsTab();\n }\n }\n\n function processReviews(url) {\n var requestUrl = normalizeUrl(url),\n container = $(reviewsSelector);\n\n if (!requestUrl) {\n return;\n }\n\n $.ajax({\n url: requestUrl,\n cache: true,\n dataType: \"html\",\n showLoader: false,\n loaderContext: container\n }
2).done(function (data) {\n container.html(data).trigger(\"contentUpdated\");\n updatePagerLinks(container);\n document.getElementById(\"tab-label-reviews-title\").scrollIntoView();\n });\n }\n\n $(document).on(\"click\", reviewsSelector + \" .pages a\", function (event) {\n event.preventDefault();\n processReviews(this.getAttribute(\"href\"));\n });\n\n $(document).on(\"click\", \".product-info-main .reviews-actions a[href*='#reviews']\", function () {\n activateReviewsTab();\n });\n\n return function (config) {\n moduleConfig = $.extend({}, config);\n var reviewTab = $(config.reviewsTabSelector),\n requiredReviewTabRole = \"tab\",\n container = $(reviewsSelector);\n\n updatePagerLinks(container);\n\n if (reviewTab.attr(\"role\") === requiredReviewTabRole) {\n if (reviewTab.hasClass(\"active\") && !container.children().length) {\n processReviews(config.productReviewUrl);\n } else {\n reviewTab.one(\"beforeOpen\", function () {\n if (!container.children().length) {\n processReviews(config.productReviewUrl);\n }\n });\n }\n }\n\n $(function () {\n handleHashChange();\n $(window).on(\"hashchange\", handleHashChange);\n });\n };\n});\n","Magento_Review/js/submit-review.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\ndefine([\n 'jquery'\n], function ($) {\n 'use strict';\n\n return function (config, element) {\n $(element).on('submit', function () {\n if ($(this).val
2id()) {\n $(this).find('.submit').attr('disabled', true);\n }\n });\n };\n});\n","Magento_Review/js/validate-review.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\ndefine([\n 'jquery',\n 'jquery/validate',\n 'mage/translate'\n], function ($) {\n 'use strict';\n\n $.validator.addMethod(\n 'rating-required', function (value) {\n return value !== undefined;\n }, $.mage.__('Please select one of each of the ratings above.'));\n});\n","Magento_Review/js/error-placement.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\ndefine([\n 'jquery',\n 'mage/mage'\n], function ($) {\n 'use strict';\n\n return function (config, element) {\n $(element).mage('validation', {\n /** @inheritdoc */\n errorPlacement: function (error, el) {\n\n if (el.parents('#product-review-table').length) {\n $('#product-review-table').siblings(this.errorElement + '.' + this.errorClass).remove();\n $('#product-review-table').after(error);\n } else {\n el.after(error);\n }\n }\n });\n };\n});\n","Magento_Review/js/view/review.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\ndefine([\n 'uiComponent',\n 'Magento_Customer/js/customer-data',\n 'Magento_Customer/js/view/customer'\n], function (Component, customerData) {\n 'use strict';\n\n return Component.extend({\n /** @inheritdoc */\n initialize: function () {\n this._super();\n\n this.review = customerData.get('review').extend({\n disposableCustomerData: 'review'\n });\n },\n\n /**\n * @return {*}\n */\n nickname: function () {\n return this.review().nickname || customerData.get('customer')().firstname;\n }\n });\n});\n","Magento_GiftMessage/js/gift-options.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\ndefine([\n 'jquery',\n 'jquery-ui-modules/widget'\n], function ($) {\n 'use strict';\n\n $.widget('mage.giftOptions', {\n options: {\n mageError: 'mage-error',\n noDisplay: 'no-display',\n requiredEntry: 'required-entry'\n },\n\n /**\n * Initial toggle of the various gift options after widget instantiation.\n * @private\n */\n _init: function () {\n this._toggleVisibility();\n },\n\n /**\n * Bind a click handler to the widget's context element.\n * @private\n */\n _create: function () {\n this.element.on('click', $.proxy(this._toggleVisibility, this));\n $(this.element.data('selector').id).find('.giftmessage-area')\n .on('change', $.proxy(this._toggleRequired, this));\n },\n\n /**\n * Toggle the visibility of the widget's context element's selector(s).\n * @private\n * @param {jQuery.Event} event - Click event. Target is a checkbox.\n */\n _toggleVisibility: function (event) {\n var checkbox = event ? $(event.target) : this.element,\n container = $(checkbox.data('selector').id),\n _this;\n\n if (checkbox.is(':checked')) {\n container.show()\n .find('.giftmessage-area:not(:visible)').each(function (x, element) {\n if ($(element).val().length > 0) {\n $(element).trigger('change');\n container.find('a').trigger('click');\n }\n });\n } else {\n _this = this;\n container.hide()\n .find('.input-text:not(.giftmessage-area)').each(function (x, element) {\n $(element).val(element.defaultValue).removeClass(_this.options.mageError)\n .next('div.' + _this.options.mageError).remove();\n }).end()\n .find('.giftmessage-area').val('').change().end()\n .find('.select').val('').change().end()\n .find('.checkbox:checked').prop('checked', false).trigger('click').prop('checked', false).end()\n .find('.price-box').addClass(this.options.noDisplay).end();\n }\n },\n\n /**\n * Make the From and To input fields required if a gift message has been written.\n * @private\n * @param {jQuery.Event} event - Change event. Target is a textarea.\n */\n _toggleRequired: function (event) {\n var textArea = $(event.target),\n length = textArea.val().length;\n\n textArea.closest('li').prev('.fields')\n .find('.input-text').toggleClass(this.options.requiredEntry, length > 0);\n }\n });\n\n return $.mage.giftOptions;\n});
2\n","Magento_GiftMessage/js/model/gift-options.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\n/**\n * @api\n */\ndefine([\n 'underscore',\n 'ko'\n], function (_, ko) {\n 'use strict';\n\n return {\n options: ko.observableArray([]),\n\n /**\n * @param {Object} option\n */\n addOption: function (option) {\n if (!this.options().hasOwnProperty(option.itemId)) {\n this.options.push({\n id: option.itemId, value: option\n }\n );\n }\n },\n\n /**\n * @param {*} itemId\n * @return {*}\n */\n getOptionByItemId: function (itemId) {\n var option = null;\n\n _.each(this.options(), function (data) {\n if (data.id === itemId) {\n option = data.value;\n\n return false;\n }\n });\n\n return option;\n }\n };\n});\n","Magento_GiftMessage/js/model/url-builder.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\ndefine([\n 'jquery',\n 'Magento_Checkout/js/model/url-builder'\n], function ($, urlBuilder) {\n 'use strict';\n\n return $.extend(urlBuilder, {\n storeCode: window.giftOptionsConfig.storeCode\n });\n});\n","Magento_GiftMessage/js/model/gift-message.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\n/**\n * @api\n */\ndefine([\n 'uiElement',\n 'underscore',\n 'mage/url'\n], function (uiElement, _, url) {\n 'use strict';\n\n var provider = uiElement();\n\n return function (itemId) {\n var model = {\n id: 'message-' + itemId,\n itemId: itemId,\n observables: {},\n additionalOptions: [],\n submitParams: [\n 'recipient',\n 'sender',\n 'message'\n ],\n\n /**\n * Initialize.\n */\n initialize: function () {\n var message = false;\n\n this.getObservable('alreadyAdded')(false);\n\n if (this.itemId == 'orderLevel') { //eslint-disable-line eqeqeq\n message = window.giftOptionsConfig.giftMessage.hasOwnProperty(this.itemId) ?\n window.giftOptionsConfig.giftMessage[this.itemId] :\n null;\n } else {\n message =\n window.giftOptionsConfig.giftMessage.hasOwnProperty('itemLevel') &&\n window.giftOptionsConfig.giftMessage.itemLevel.hasOwnProperty(this.itemId) ?\n window.giftOptionsConfig.giftMessage.itemLevel[this.itemId].message :\n null;\n }\n\n if (_.isObject(message)) {\n this.getObservable('recipient')(message.recipient);\n this.getObservable('sender')(message.sender);\n this.getObservable('message')(message.message);\n this.getObservable('alreadyAdded')(true);\n }\n },\n\n /**\n * @param {String} key\n * @return {*}\n */\n getObservable: function (key) {\n this.initObservable(this.id, key);\n\n return provider[this.getUniqueKey(this.id, key)];\n },\n\n /**\n * @param {String} node\n * @param {String} key\n */\n initObservable: function (node, key) {\n if (node && !this.observables.hasOwnProperty(node)) {\n this.observables[node] = [];\n }\n\n if (key && this.observables[node].indexOf(key) === -1) {\n this.observables[node].push(key);\n provider.observe(this.getUniqueKey(node, key));\n }\n },\n\n /**\n * @param {String}
2 node\n * @param {String} key\n * @return {String}\n */\n getUniqueKey: function (node, key) {\n return node + '-' + key;\n },\n\n /**\n * @param {String} key\n * @return {null}\n */\n getConfigValue: function (key) {\n return window.giftOptionsConfig.hasOwnProperty(key) ?\n window.giftOptionsConfig[key]\n : null;\n },\n\n /**\n * Reset.\n */\n reset: function () {\n this.getObservable('isClear')(true);\n },\n\n /**\n * @return {Array}\n */\n getAfterSubmitCallbacks: function () {\n var callbacks = [];\n\n callbacks.push(this.afterSubmit);\n _.each(this.additionalOptions, function (option) {\n if (_.isFunction(option.afterSubmit)) {\n callbacks.push(option.afterSubmit);\n }\n });\n\n return callbacks;\n },\n\n /**\n * After submit.\n */\n afterSubmit: function () {\n window.location.href = url.build('checkout/cart/updatePost') +\n '?form_key=' + window.checkoutConfig.formKey +\n '&cart[]';\n },\n\n /**\n * @param {Boolean} remove\n * @return {Object}\n */\n getSubmitParams: function (remove) {\n var params = {},\n self = this;\n\n _.each(this.submitParams, function (key) {\n var observable = provider[self.getUniqueKey(self.id, key)];\n\n if (_.isFunction(observable)) {\n params[key] = remove ? null : observable();\n }\n });\n\n if (this.additionalOptions.length) {\n params['extension_attributes'] = {};\n }\n _.each(this.additionalOptions, function (option) {\n if (_.isFunction(option.getSubmitParams)) {\n params['extension_attributes'] = _.extend(\n params['extension_attributes'],\n option.getSubmitParams(remove)\n );\n }\n });\n\n return params;\n },\n\n /**\n * Check if gift message can be displayed\n *\n * @returns {Boolean}\n */\n isGiftMessageAvailable: function () {\n var isGloballyAvailable,\n giftMessageConfig,\n itemConfig;\n\n // itemId represent gift message level: 'orderLevel' constant or cart item ID\n if (this.itemId === 'orderLevel') {\n return this.getConfigValue('isOrderLevelGiftOptionsEnabled');\n }\n\n // gift message product configuration must override system configuration\n isGloballyAvailable = this.getConfigValue('isItemLevelGiftOptionsEnabled');\n giftMessageConfig = window.giftOptionsConfig.giftMessage;\n itemConfig = giftMessageConfig.hasOwnProperty('itemLevel') &&\n giftMessageConfig.itemLevel.hasOwnProperty(this.itemId) ?\n giftMessageConfig.itemLevel[this.itemId] :\n {};\n\n return itemConfig.hasOwnProperty('is_available') ? itemConfig['is_available'] : isGloballyAvailable;\n }\n };\n\n model.initialize();\n\n return model;\n };\n});\n","Magento_GiftMessage/js/action/gift-options.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\n/**\n * @api\n */\ndefine([\n 'Magento_GiftMessage/js/model/url-builder',\n 'mage/storage',\n 'Magento_Ui/js/model/messageList',\n 'Magento_Checkout/js/model/error-processor',\n 'mage/url',\n 'Magento_Checkout/js/model/quote',\n 'underscore'\n], function (urlBuilder, storage, messageList, errorProcessor, url, quote, _) {\n 'use strict';\n\n return function (giftMessage, remove) {\n var serviceUrl;\n\n url.setBaseUrl(giftMessage.getConfigValue('baseUrl'));\n\n if (giftMessage.getConfigValue('isCustomerLoggedIn')) {\n serviceUrl = urlBuilder.createUrl('/carts/mine/gift-message', {});\n\n if (giftMessage.itemId != 'orderLevel') { //eslint-disable-line eqeqeq\n serviceUrl = urlBuilder.createUrl('/carts/mine/gift-message/:itemId', {\n itemId: giftMessage.itemId\n });\n }\n } else {\n serviceUrl = urlBuilder.createUrl('/guest-carts/:cartId/gift-message', {\n cartId: quote.getQuoteId()\n });\n\n if (giftMessage.itemId != 'orderLevel') { //eslint-disable-line eqeqeq\n serviceUrl = urlBuilder.createUrl(\n '/guest-carts/:cartId/gift-message/:itemId',\n {\n cartId: quote.getQuoteId(), itemId: giftMessage.itemId\n }\n );\n }\n }\n messageList.clear();\n\n storage.post(\n serviceUrl,\n JSON.stringify({\n 'gift_message': giftMe
2ssage.getSubmitParams(remove)\n })\n ).done(function () {\n giftMessage.reset();\n _.each(giftMessage.getAfterSubmitCallbacks(), function (callback) {\n if (_.isFunction(callback)) {\n callback();\n }\n });\n }).fail(function (response) {\n errorProcessor.process(response);\n });\n };\n});\n","Magento_GiftMessage/js/view/gift-message.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\ndefine([\n 'uiComponent',\n 'Magento_GiftMessage/js/model/gift-message',\n 'Magento_GiftMessage/js/model/gift-options',\n 'Magento_GiftMessage/js/action/gift-options'\n], function (Component, GiftMessage, giftOptions, giftOptionsService) {\n 'use strict';\n\n return Component.extend({\n formBlockVisibility: null,\n resultBlockVisibility: null,\n model: {},\n\n /**\n * Component init\n */\n initialize: function () {\n var self = this,\n model;\n\n this._super()\n .observe('formBlockVisibility')\n .observe({\n 'resultBlockVisibility': false\n });\n\n this.itemId = this.itemId || 'orderLevel';\n model = new GiftMessage(this.itemId);\n this.model = model;\n this.isResultBlockVisible();\n giftOptions.addOption(model);\n\n this.model.getObservable('isClear').subscribe(function (value) {\n if (value == true) { //eslint-disable-line eqeqeq\n self.formBlockVisibility(false);\n self.model.getObservable('alreadyAdded')(true);\n }\n });\n },\n\n /**\n * Is reslt block visible\n */\n isResultBlockVisible: function () {\n var self = this;\n\n if (this.model.getObservable('alreadyAdded')()) {\n this.resultBlockVisibility(true);\n }\n this.model.getObservable('additionalOptionsApplied').subscribe(function (value) {\n if (value == true) { //eslint-disable-line eqeqeq\n self.resultBlockVisibility(true);\n }\n });\n },\n\n /**\n * @param {String} key\n * @return {*}\n */\n getObservable: function (key) {\n return this.model.getObservable(key);\n },\n\n /**\n * Hide\\Show form block\n */\n toggleFormBlockVisibility: function () {\n if (!this.model.getObservable('alreadyAdded')()) {\n this.formBlockVisibility(!this.formBlockVisibility());\n } else {\n this.resultBlockVisibility(!this.resultBlockVisibility());\n }\n },\n\n /**\n * Edit options\n */\n editOptions: function () {\n this.resultBlockVisibility(false);\n this.formBlockVisibility(true);\n },\n\n /**\n * Delete options\n */\n deleteOptions: function () {\n giftOptionsService(this.model, true);\n },\n\n /**\n * Hide form block\n */\n hideFormBlock: function () {\n this.formBlockVisibility(false);\n\n if (this.model.getObservable('alreadyAdded')()) {\n this.resultBlockVisibility(true);\n }\n },\n\n /**\n * @return {Boolean}\n */\n hasActiveOptions: function () {\n var regionData = this.getRegion('additionalOptions'),\n options = regionData(),\n i;\n\n for (i = 0; i < options.length; i++) {\n if (options[i].isActive()) {\n return true;\n }\n }\n\n return false;\n },\n\n /**\n * @return {Boolean}\n */\n isActive: function () {\n return this.model.isGiftMessageAvailable();\n },\n\n /**\n * Submit options\n */\n submitOptions: function () {\n giftOptionsService(this.model);\n }\n });\n});\n","Pixelmechanics_Quickorder/js/quickorderJSApp.js":"define([\n\t\"jquery\",\n\t'Magento_Customer/js/customer-data',\n \"jquery/ui\",\n], function ($,customerData) {\n 'use strict';\n return function quickorderJSApp()\n {\n\t\t// this should only be executed, when the table is there\n\t\tif (!$('#quickordertable')) {\n\t\t\tconsole.warn(\"No Quickorder-Table was found\");\n\t\t\treturn;\n\t\t}\n\t\tvar qo_startRows = 10; // how many rows to display on start?\t\n\t\tvar $qoContainer = $('#quickordertable');\n\t\tvar $row = null;\n\t\tvar $results_block = null;\n\t\tvar qo_numRows = 0; // $('#quickordertable tbody tr').length;\n\t\tvar numInBasket = 0; // will be increased or decresead by adding/remove a product and will be checked \"onSubmit\", see https://trello.com/c/s7KPjTtj/195-directorder-formular-de-ch-evolution-12-2018-quick-order-schnellkauf#comment-5d83b0b1da815d559b829a43\n\t\t\n\t\t//initQuickOrderApp()\n\t\t\n\t\tconsole.group(\"Starting Quickorder-Script\");\n\t\t// first get the HTML for the autocompleter-Box\n\t\t$results_block = $('#quickordertable tbody tr .as-results', $row).clone();\n\t\t$('#quickordertable tbody tr .as-results').remove();\n\t\t\n\t\t// Now get the HTML for a row (without havint the autocompleter-box\n\t\t$row = $('#quickordertable tbody tr').clone();\n\t\t$('#quickordertable tbody tr').remove();\n\t\t\n\t\t// click on \"New Product\" adds a row.\n\t\t$('#add_item').click(function() {\
2n\t\t\tqo_addRow();\n\t\t\treturn false;\n\t\t});\n\t\t/**\n * @author : KK\n * @description : Added functionality to display search result.\n * @Link : https://pixelmechanics.atlassian.net/browse/BLIZ-511\n * @date : 12 April 2023\n */\n\t\t$qoContainer.on(\"keyup\", \".searchfield.as-input\", function() {\n\t\t\tqo_autocomplete($(this));\n\t\t\treturn false;\n\t\t});\n\t\tfunction clearContents(searchfield) {\n\t\t\tsetTimeout(function () {\n\t\t\t\tif($(searchfield).next('div.as-results').find('ul.as-list').length <= 0) {\n\t\t\t\t\tvar visibleresult = $('div.as-results').is(\":visible\");\n \t\tif (visibleresult == true) {\n\t\t\t\t\t\t$(searchfield).val(\"\");\n\t\t\t\t\t\t$(searchfield).next('div.as-results').hide();\n\t\t\t\t\t\t$(searchfield).closest('tr').find('td.quickorderresult').find('.as-values.sku').val(\"\");\n\t\t\t\t\t\t$(searchfield).closest('tr').find('td.quickorderresult').find('span.as-values.sku').text(\"\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if($(searchfield).next('div.as-results').find('ul.as-list').length > 0){\n\t\t\t\t\tif($(searchfield).val()==\"\"){\n\t\t\t\t\t\t$(searchfield).next('div.as-results').hide();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}, 2000);\n\t\t}\n\t\t/**\n * @author : KK\n * @description : Added functionality to display search result for each row.\n * @date : 24 May 2023\n */\n\t\tfunction clearResult(searchfield) {\n\t\t\tsetTimeout(function () {\n\t\t\t\t$(searchfield).next('div.as-results').hide();\n\t\t\t}, 1000);\n\t\t\t\n\t\t}\n\t\t$qoContainer.on(\"change\", \".searchfield.as-input\", function() {\n\t\t\tif ($(this).next('div.as-results').find('ul.as-list').length <= 0) {\n\t\t\t\tclearContents($(this));\n\t\t\t}\n\t\t\treturn false;\n\t\t});\n\t\t$qoContainer.on(\"focusin\", \".searchfield.as-input\", function() {\n\t\t\tif ($(this).next('div.as-results').find('ul.as-list').length > 0) {\n\t\t\t\tqo_autocomplete($(this));\n\t\t\t}else if ($(this).val() != \"\") {\n\t\t\t\tif($(this).closest('tr').find('td.quickorderresult').find('.as-values.sku').val() == ''){\n\t\t\t\t\tqo_autocomplete($(this));\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t});\n\n\t\t$qoContainer.on(\"focusout\", \".searchfield.as-input\", function() {\n\t\t\tif ($(this).next('div.as-results').find('ul.as-list').length > 0) {\n\t\t\t\tclearResult($(this));\n\t\t\t}\n\t\treturn false;\n\t\t});\n\t\t\n\t\t$('#quickordertable .searchfield.as-input').click(function() {\n\t\t\tqo_autocomplete($(this));\n\t\t\treturn false;\n\t\t});\n\n\t\t$qoContainer.on(\"click\", \".btn-remove.remove\", function() {\n\t\t\tconsole.log(\"removeing the row.\");\n\t\t\tqo_removeRow($(this));\n\t\t\treturn false;\n\t\t});\n\t\t// Submit the form-data\n\t\n\t\t$(\"#quickorderFrm\").submit(function(event) {\n\t\t\tevent.preventDefault();\n\t\t\tconsole.log(\"Submitting the form\");\n\t\t\tqo_formSubmit();\n\t\t});\n\t\t\t\n\t\t// Add the first row by Code.\n\t\tvar i = 0;\n\t\tfor (i=0; i<qo_startRows; i++) {\n\t\t\t$('#add_item').click();\n\t\t}\n\t\tconsole.groupEnd();\n\t\t//} // initQuickOrderApp()\t\n\t\n\t\t/**\n\t\t* Submit the form\n\t\t**/\n\t\tfunction qo_formSubmit() {\n\t\t\t\n\t\t\tcountNumInBasket();\n\t\t\tif (numInBasket<=0) {\n\t\t\t\tconfirm($.mage.__(\"Please add items with quantity greater than 0 to the list.\"));\n\t\t\t\treturn false;\n\t\t\t};\n\t\t\tvar rowWithoutSelectedProduct = 0;\n\t\t\t$('.searchfield').each(function(){\n\t\t\t\tvar rowvalue = $(this).val();\n\t\t\t\tif(rowvalue.trim() != \"\"){\n\t\t\t\t\tif($(this).closest('tr').find('td.quickorderresult').find('.as-values.sku').val() == \"\"){\n\t\t\t\t\t\trowWithoutSelectedProduct++; \n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t\t\n\t\t\tvar finalMessage = \"\";\n\t\t\tif(rowWithoutSelectedProduct == 0){\n\t\t\t\tfinalMessage = $.mage.__(\"Do you want to add these item(s) to your shopping cart?\");\n\t\t\t}else{\n\t\t\t\tfinalMessage = $.mage.__(\"You haven't selected a product (from the dropdown with suggestions) in at least one row. Would you still like to continue adding the remaining items to your shopping cart?\");\n\t\t\t}\n\t\t\tvar data = $(\"#quickorderFrm\").serialize();\n\t\t\tvar url = $(\"#quickorderFrm\").attr(\"action\");\n\t\t\t\n\t\t\tif (!confirm(finalMessage)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t\n\t\t\t$.ajax({\n\t\t\t\ttype: \"POST\",\n\t\t\t\tshowLoader: true,\n\t\t\t\turl: url,\n\t\t\t\tdata: data,\n\t\t\t\tdataType: \"json\",\n\t\t\t\tsuccess: function(response){\n\t\t\t\t\tif(response.success){\n\t\t\t\t\t\tcustomerData.reload(['cart'], true);\n\t\t\t\t\t\twindow.location.href = window.BASE_URL + \"checkout/cart\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t})\n\t\t}\n\n\t\t/**\n\t\t * add a new Row to the Table.\n\t\t**/\n\t\tfunction qo_addRow() {\
2n\t\t\tvar numRows = $('#quickordertable tbody tr').length;\n\t\t\tvar newRow = $row.clone();\n\t\t\t// replace the variables in the HTML of the new row with the dynamic values.\n\t\t\tvar regex = new RegExp(\"_ROW_ID_\", \"g\");\n\t\t\tvar html = newRow.html().replace(regex, numRows);\n\t\t\tnewRow.html(html);\n\t\t\tnewRow.attr(\"id\", \"itemsku_\"+numRows);\n\t\t\t$(\"input\", newRow).click(function(){\n\t\t\t\tthis.select();\n\t\t\t});\n\t\t\t$(\"input.as-values.sku\", newRow).attr(\"type\", \"hidden\");\n\t\t\t$(\"td.quickorderresult\", newRow).append($('<span>').addClass(\"as-values sku\"));\n\t\t\t\n\t\t\t// Add the row and increase the counter\n\t\t\t$('#quickordertable tbody').append(newRow);\n\t\t\tqo_numRows++;\t\n\t\t}\n\t\t\t\n\t\t/**\n\t\t * remove a from the Table.\n\t\t**/\n\t\tfunction qo_removeRow($removeLinkElem) {\n\t\t\tvar $rowToRemove = $removeLinkElem.parent(\"td\").parent(\"tr\");\n\t\t\t$rowToRemove.remove();\n\t\t}\n\t\t/**\n\t\t * ajax-search for the SKU and then show the results-list.\n\t\t * Auto-Select the item, when there is only exactly 1 result.\n\t\t**/\n\t\tfunction qo_autocomplete($inputElem) {\n\t\t\tvar $thisColumn = $inputElem.parent(\"td\");\n\t\t\t$thisColumn.focusout(function(){\n\t\t\t\t// $('.as-results', $thisRow).remove();\n\t\t\t});\n\t\t\tvar query = $inputElem.val();\n\t\t\tqo_doSearch(query, $thisColumn);\n\t\t}\n\t\t \n\t\t/**\n\t\t * AJAX-Loading der Produktdaten \u00fcber Magento-API\n\t\t * Siehe https://magehit.com/blog/how-to-use-rest-api-in-magento-2/ und \n\t\t**/\n\t\tfunction qo_doSearch(query, $thisColumn) {\n\t\t\tvar url = \"/pixelmechanics/quickorder/searchproducts\";\n\t\t\tvar thisRow = '';\n\t\t\tif(query.length >= 4){\n\t\t\t\tjQuery.ajax({\n\t\t\t\t\turl: url,\n\t\t\t\t\tdata: {q: query},\n\t\t\t\t\ttype: \"POST\",\n\t\t\t\t\tcache: false,\n\t\t\t\t\tsuccess: function(data) {\n\t\t\t\t\t\t// convert the HTML-String to a jQuery Object.\n\t\t\t\t\t\tvar data = JSON.parse(data);\n\t\t\t\t\t\tvar message = data.message;\n\t\t\t\t\t\tvar html = data.html;\n\t\t\t\t\t\tvar thisRow = $thisColumn.parent();\t\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t* @author : KK\n\t\t\t\t\t\t* @description : removed code which used for When exactly 1 Result is there, select it.\n\t\t\t\t\t\t* @Link : https://pixelmechanics.atlassian.net/browse/BLIZ-511\n\t\t\t\t\t\t* @date : 3 April 2023\n\t\t\t\t\t\t*/\n\t\t\t\t\t\t// Show the results-block\n\t\t\t\t\t\tif (data.message) {\n\t\t\t\t\t\t\t$results_block.html(message);\n\t\t\t\t\t\t\t$results_block.show();\n\t\t\t\t\t\t\t$thisColumn.append($results_block);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t// Add click-Events to the results-list. clicking on a result adds the SKU to the form.\n\t\t\t\t\t\t\t$(document).on(\"click\",\"#\"+thisRow[0]['id']+\" .as-result-item\",function() {\n\t\t\t\t\t\t\t\tselectResult($(this), thisRow);\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t$results_block.html(html);\n\t\t\t\t\t\t\t$results_block.show();\n\t\t\t\t\t\t\t$thisColumn.append($results_block);\n\t\t\t\t\t\t\t$('#quickordertable').trigger('contentUpdated');\t\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\terror: function (err) {\n\t\t\t\t\t\tconsole.error('Ajax -> Error', err.status, err.responseText);\n\t\t\t\t\t},\n\t\t\t\t\tcomplete: function (jqXHR, data) { \n\t\t\t\t\t\tvar d = new Date();\n\t\t\t\t\t}\n\t\t\t\t}); // ajax()\n\t\t\t}\n\t\t} // doSearch()\n\t\t\t\n\t\t/**\n\t\t * Sets the SKU and NAME based on the selected Results of the results-dropdown.\n\t\t * Then focuses the QTY-Field, so the user can directly enter the qty he needs\n\t\t * Is called by qo_doSearch()\n\t\t * @param {type} $inputField the INPUT-Field which contains the data-attirubtes for sku and name.\n\t\t * @param {type} $row the Table-Row that contains the field.\n\t\t * @returns {undefined}\n\t\t */\n\t\tfunction selectResult($inputField, $row) {\n\t\t\tvar qtyIncrement = $inputField.attr(\"data-item-qty-increment\");\n\t\t\tvar yve1 = $inputField.attr(\"data-item-yve1\");\n\t\t\tvar yve1min = $inputField.attr(\"data-item-yve1min\");\n\t\t\tvar sku = $inputField.data(\"sku\");\n\t\t\tvar name = $inputField.data(\"name\");\n\t\t\tconsole.log(\"Klick auf Zeile\", sku, name,qtyIncrement);\n\t\t\t$('input.as-values.sku', $row).val(sku);\n\t\t\t$('span.as-values.sku', $row).text(sku);\n\t\t\t$('.input-text.searchfield', $row).val(name);\n\t\t\t$('.input-text.qty', $row).attr(\"data-item-qty-increment\", qtyIncrement);\n\t\t\t$('.input-text.qty', $row).attr(\"data-item-yve1min\", yve1min);\n\t\t\t$('.input-text.qty', $row).attr(\"data-item-yve1\", yve1);\n\t\t\t$('.input-text.qty', $row).attr(\"data-sku\", sku);\n\t\t\t$('.input-text.qty',$row).val(yve1);\n\t\t\t$('.as-results', $row).remove();\n\t\t\t// Remove qty autofocus. PM PS, 22.01.20, @link - https://trello.com/c/5jgC5aBY/176-direct-order-issue#comment-5e26f8a5d4d7e30de17f7db8\n\t\t\t//$('.input-text.qty', $row).focus().select();\n\t\t\t\n\t\t\t// Count the number of items in the list. \n\t\t\tcountNumInBasket();\n\t\t}\n\t\t\n\t\t/**\n\t\t * Submitting the form should only be allowed when at least 1 item is in the basket/List.\n\t\t * Therefore, this function is used to count the SKUs.\n\t\t * @link https://trello.com/c/s7KPjTtj/195-directorder-formular-de-ch-evolution-12-2018-quick-order-schnellkauf#comment-5d83b0b1da815d559b829a43\n\t\t **/\n\t\tfunction countNumInBasket() {\n\t\t\tvar debug=false;\n\t\t\tif (debug) console.group(\"Counting Items in List.\");\n\t\t\tnumInBasket = 0;\n\t\t\t$('#quickordertable .quickorder_row').each(function(){\n\t\t\t\tvar row = $(this);\n\t\t\t\tvar sku = $('input.as-values.sku', row).val();\n\t\t\t\tvar qty = parseInt($('input.input-text.qty', row).val());\n\t\t\t\tif (debug) console.log(\"SKU: \"+sku+\": \"+qty+\"x\");\n\t\t\t\t\n\t\t\t\tif (qty>0 && sku!==\"\") {\n\t\t\t\t\tnumInBasket++;\n\t\t\t\t}
2 else {\n\t\t\t\t\tif (debug) console.warn(\"Not valid\");\n\t\t\t\t}\n\t\t\t});\n\t\t\t\n\t\t\tif (debug) console.log(\"SKUs in Basket: \", numInBasket);\n\t\t\tif (debug) console.groupEnd();\n\t\t}\n\t}\t\n});\n","Geissweb_Euvat/js/queue.js":"/**\n * ||GEISSWEB| EU VAT Enhanced\n *\n * NOTICE OF LICENSE\n *\n * This source file is subject to the GEISSWEB End User License Agreement\n * that is available through the world-wide-web at this URL: https://www.geissweb.de/legal-information/eula\n *\n * DISCLAIMER\n *\n * Do not edit this file if you wish to update the extension in the future. If you wish to customize the extension\n * for your needs please refer to our support for more information.\n *\n * @copyright Copyright (c) 2015 GEISS Webl\u00f6sungen (https://www.geissweb.de)\n * @license https://www.geissweb.de/legal-information/eula GEISSWEB End User License Agreement\n */\n\n/**\n * Thanks to http://stackoverflow.com/users/561731/neal\n */\n\ndefine([\n 'jquery'\n], function ($) {\n 'use strict';\n\n return {\n\n running: false,\n queue: [],\n\n run: function () {\n if (!this.running) {\n this.next();\n }\n },\n\n addFunction: function (callback) {\n let self = this;\n\n this.queue.push(function () {\n $.when(callback()).done(function () {\n self.next();\n });\n });\n return this;\n },\n\n next: function () {\n this.running = false;\n let shift = this.queue.shift();\n\n if (shift) {\n this.running = true;\n shift();\n }\n }\n\n };\n\n});\n","Geissweb_Euvat/js/model/vat-id-required-validator.js":"/**\n * ||GEISSWEB| EU VAT Enhanced\n *\n * NOTICE OF LICENSE\n *\n * This source file is subject to the GEISSWEB End User License Agreement\n * that is available through the world-wide-web at this URL: https://www.geissweb.de/legal-information/eula\n *\n * DISCLAIMER\n *\n * Do not edit this file if you wish to update the extension in the future. If you wish to customize the extension\n * for your needs please refer to our support for more information.\n *\n * @copyright Copyright (c) 2015 GEISS Webl\u00f6sungen (https://www.geissweb.de)\n * @license https://www.geissweb.de/legal-information/eula GEISSWEB End User License Agreement\n */\n\ndefine([\n 'jquery',\n 'mage/translate',\n 'mage/url',\n 'Magento_Ui/js/model/messageList',\n 'Magento_Customer/js/model/customer',\n 'Magento_Checkout/js/model/quote',\n 'mageUtils',\n 'uiRegistry',\n 'euvatTools'\n], function (\n $,\n $t,\n url,\n messageList,\n CustomerModel,\n Quote,\n Utils,\n Registry,\n EuVatTools\n) {\n 'use strict';\n return {\n validate: function () {\n let isValid = true,\n address = null, vatField = null,\n checkoutConfig = window.checkoutConfig,\n paymentMethod = Quote.paymentMethod();\n\n if (CustomerModel.isLoggedIn()) {\n address = Quote.billingAddress();\n\n if (typeof checkoutConfig.displayBillingOnPaymentMethod !== 'undefined'\n && checkoutConfig.displayBillingOnPaymentMethod === true\n ) {\n let methodCode = paymentMethod.method,\n // eslint-disable-next-line max-len\n vatIdComponentPath = 'checkout.steps.billing-step.payment.payments-list.' + methodCode + '-form.form-fields.vat_id';\n\n vatField = Registry.get(vatIdComponentPath);\n } else {\n // eslint-disable-next-line max-len\n vatField = Registry.get('checkout.steps.billing-step.payment.afterMethods.billing-address-form.form-fields.vat_id');\n }\n\n if (typeof vatField !== 'object') {\n return isValid;\n }\n\n if (vatField.debug) {\n console.log('vat-number-required payment validator', vatField);\n }\n\n if (Utils.isEmpty(address.vatId)) {\n if (!Utils.isEmpty(address.countryId) && !Utils.isEmpty(vatField.euCountries)\n // eslint-disable-next-line max-len\n && !EuVatTools.isValidateable(address.countryId, vatField.euCountries, vatField.noValidateCountries, vatField.taxFreeTerritories, address.regionId, address.postcode)\n ) {\n isValid = true;\n } else {\n isValid = false;\n messageList.addErrorMessage({\n // eslint-disable-next-line max-len\n message: $t('A valid VAT number is required for checkout. Please edit your address to include your VAT number.')\n });\n }\n return isValid;\n }\n\n isValid = false;\n $.when($.ajax({\n type: 'GET',\n async: false,\n url: url.build('euvat/vatnumber/validation/'),\n data: {\n vat_number: address.vatId,\n form_key: $.cookie('form_key'),\n handle: 'checkout_additional_validator'\n }\n }
2)).done(function (data) {\n isValid = data.vat_is_valid;\n if (data.vat_is_valid === false) {\n messageList.addErrorMessage({\n // eslint-disable-next-line max-len\n message: $t('A valid VAT number is required for checkout. Please edit your address to include your VAT number.')\n });\n isValid = false;\n } else if (data.vat_is_valid === true) {\n isValid = true;\n }\n });\n\n\n return isValid;\n }\n }\n };\n});\n","Geissweb_Euvat/js/model/tools.js":"/**\n * ||GEISSWEB| EU VAT Enhanced\n *\n * NOTICE OF LICENSE\n *\n * This source file is subject to the GEISSWEB End User License Agreement\n * that is available through the world-wide-web at this URL: https://www.geissweb.de/legal-information/eula\n *\n * DISCLAIMER\n *\n * Do not edit this file if you wish to update the extension in the future. If you wish to customize the extension\n * for your needs please refer to our support for more information.\n *\n * @copyright Copyright (c) 2015 GEISS Webl\u00f6sungen (https://www.geissweb.de)\n * @license https://www.geissweb.de/legal-information/eula GEISSWEB End User License Agreement\n */\n\ndefine([\n 'jquery',\n 'mageUtils'\n], function (\n $,\n Utils\n) {\n 'use strict';\n\n return {\n\n /**\n * Helper to check if we have an uppercase string\n * @param str\n * @returns {boolean}\n */\n isUpperCase: function (str) {\n return str === str.toUpperCase();\n },\n\n /**\n * Convert \"COMPANY NAME LTD\" to \"Company Name Ltd\"\n * @param companyName\n * @returns {*}\n */\n normalizeCompanyName: function (companyName) {\n if (Utils.isEmpty(companyName) || !this.isUpperCase(companyName)) {\n return companyName;\n }\n companyName = companyName.replace(/\\w\\S*/g, function (txt) {\n return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();\n });\n return companyName;\n },\n\n /**\n * @param {string} countryCode\n * @param {string|number} regionId\n * @param {string} postcode\n * @param {object} taxFreeTerritories\n * @returns {boolean}\n */\n isTaxFreeTerritory: function (countryCode, regionId, postcode, taxFreeTerritories) {\n if (!taxFreeTerritories || typeof taxFreeTerritories !== 'object') {\n return false;\n }\n\n if (regionId && $.isArray(taxFreeTerritories.regionIds)) {\n var id = parseInt(regionId, 10);\n\n if (!isNaN(id) && $.inArray(id, taxFreeTerritories.regionIds) > -1) {\n return true;\n }\n }\n\n if (postcode && taxFreeTerritories.postcodes && taxFreeTerritories.postcodes[countryCode]) {\n var patterns = taxFreeTerritories.postcodes[countryCode];\n\n for (var i = 0; i < patterns.length; i++) {\n if (new RegExp(patterns[i]).test(postcode)) {\n return true;\n }\n }\n }\n\n return false;\n },\n\n /**\n * This method returns true when the numbers of the given country should be validated according to config\n * @param {string} countryCode\n * @param {array} euCountries\n * @param {array} noValidateCountries\n * @param {object} taxFreeTerritories\n * @param {string|number} regionId\n * @param {string} postcode\n * @returns {boolean}\n */\n isValidateable: function (countryCode, euCountries, noValidateCountries, taxFreeTerritories, regionId, postcode) {\n\n if (Utils.isEmpty(countryCode)\n || !$.isArray(euCountries)\n || !$.isArray(noValidateCountries)\n ) {\n return false;\n }\n\n if (countryCode === 'EL') {\n countryCode = 'GR';\n }\n\n if (countryCode === 'XI') {\n countryCode = 'GB';\n }\n\n // GB should still be in the EU countries list because of Northern Ireland\n if (countryCode !== 'GB'\n && $.inArray(countryCode, eu
2Countries) === -1\n ) {\n return false;\n }\n\n if ($.inArray(countryCode, noValidateCountries) > -1) {\n return false;\n }\n\n if (this.isTaxFreeTerritory(countryCode, regionId, postcode, taxFreeTerritories)) {\n return false;\n }\n\n return true;\n }\n\n };\n\n});\n","Geissweb_Euvat/js/model/local-storage-handler.js":"/**\n * ||GEISSWEB| EU VAT Enhanced\n *\n * NOTICE OF LICENSE\n *\n * This source file is subject to the GEISSWEB End User License Agreement\n * that is available through the world-wide-web at this URL: https://www.geissweb.de/legal-information/eula\n *\n * DISCLAIMER\n *\n * Do not edit this file if you wish to update the extension in the future. If you wish to customize the extension\n * for your needs please refer to our support for more information.\n *\n * @copyright Copyright (c) 2015 GEISS Webl\u00f6sungen (https://www.geissweb.de)\n * @license https://www.geissweb.de/legal-information/eula GEISSWEB End User License Agreement\n */\n\ndefine([], function () {\n 'use strict';\n\n return {\n\n storageKey: 'gw_euvat_results',\n\n /**\n * Initialize existing validation result from JSON\n */\n load: function (vatNumber) {\n if (!vatNumber) {\n return;\n }\n\n let storageData = localStorage.getItem(this.storageKey);\n if (!storageData) {\n return;\n }\n\n let validationResults = JSON.parse(storageData);\n let storedValidation = validationResults[vatNumber];\n\n if (storedValidation) {\n return storedValidation;\n }\n },\n\n save: function (validationResult) {\n if (!validationResult) {\n return;\n }\n\n let storageData = localStorage.getItem(this.storageKey);\n let validationResults = storageData ? JSON.parse(storageData) : {};\n\n validationResults[validationResult.vat_id] = {\n vat_id: validationResult.vat_id,\n vat_request_date: validationResult.vat_request_date,\n request_message: validationResult.request_message,\n vat_is_valid: validationResult.vat_is_valid,\n vat_request_success: validationResult.vat_request_success,\n vat_trader_name: validationResult.vat_trader_name,\n vat_trader_address: validationResult.vat_trader_address,\n vat_request_country_code: validationResult.vat_request_country_code\n };\n\n localStorage.setItem(this.storageKey, JSON.stringify(validationResults));\n },\n\n };\n});\n","Geissweb_Euvat/js/model/syntax-validation.js":"/**\n * ||GEISSWEB| EU VAT Enhanced\n *\n * NOTICE OF LICENSE\n *\n * This source file is subject to the GEISSWEB End User License Agreement\n * that is available through the world-wide-web at this URL: https://www.geissweb.de/legal-information/eula\n *\n * DISCLAIMER\n *\n * Do not edit this file if you wish to update the extension in the future. If you wish to customize the extension\n * for your needs please refer to our support for more information.\n *\n * @copyright Copyright (c) 2015 GEISS Webl\u00f6sungen (https://www.geissweb.de)\n * @license https://www.geissweb.de/legal-information/eula GEISSWEB End User License Agreement\n */\n\ndefine([\n 'jquery',\n 'mage/translate',\n 'mage/url',\n 'mageUtils'\n],function (\n $,\n $t,\n url,\n Utils\n) {\n 'use strict';\n\n return {\n\n countryCode: '',\n\n setCountryCode: function (countryCode) {\n this.countryCode = countryCode;\n },\n\n hasCountryPrefix: function (vatNumber) {\n return !!vatNumber.match(new RegExp('^[A-Z][A-Z]'));\n },\n\n addCountryPrefix: function (vatNumber) {\n if (!Utils.isEmpty(this.countryCode)) {\n return this.countryCode+vatNumber;\n }\n return vatNumber;\n },\n\n isValidSyntax: function (vatNumber) {\n if (!this.hasCountryPrefix(vatNumber)) {\n vatNumber = this.addCountryPrefix(vatNumber);\n }\n return new RegExp(this.patterns[this.countryCode]).test(vatNumber);\n },\n\n patterns: {\n 'AT': '(AT)U[0-9]{8}$',\n 'BE': '(BE)[01][0-9]{9}$',\n 'BG': '(BG)[0-9]{9,10}$',\n 'CY': '(CY)[0-9]{8}[A-Z]$',\n 'CZ': '(CZ)[0-9]{8,10}$',\n 'DE': '(DE)[0-9]{9}$',\n 'DK': '(DK)[0-9]{8}$',\n 'EE': '(EE)[0-9]{9}$',\n 'EL': '(EL|GR)[0-9]{9}$',\n 'ES': '(ES)[0-9A-Z][0-9]{7}
2[0-9A-Z]$',\n 'FI': '(FI)[0-9]{8}$',\n 'FR': '(FR)[0-9A-Z]{2}[0-9]{9}$',\n 'GB': '(GB)([0-9]{9}([0-9]{3})?|[A-Z]{2}[0-9]{3})$',\n 'GR': '(EL|GR)[0-9]{9}$',\n 'HR': '(HR)[0-9]{11}$',\n 'HU': '(HU)[0-9]{8}$',\n 'IE': '(IE)(([0-9]{7}WI|[0-9][0-9A-Z\\*\\+][0-9]{5}[A-Z]{1,2}))$',\n 'IT': '(IT)[0-9]{11}$',\n 'LT': '(LT)([0-9]{9}|[0-9]{12})$',\n 'LU': '(LU)[0-9]{8}$',\n 'LV': '(LV)[0-9]{11}$',\n 'MT': '(MT)[0-9]{8}$',\n 'NL': '(NL)[0-9]{9}B([0-9]{2}|O[0-9]{1})$',\n 'PL': '(PL)[0-9]{10}$',\n 'PT': '(PT)[0-9]{9}$',\n 'RO': '(RO)[0-9]{2,10}$',\n 'SE': '(SE)[0-9]{12}$',\n 'SI': '(SI)[0-9]{8}$',\n 'SK': '(SK)[0-9]{10}$',\n 'XI': '(XI)[0-9]{3}[0-9]{4}[0-9]{2}$'\n }\n };\n});\n","Geissweb_Euvat/js/action/place-order-mixin.js":"/**\n * ||GEISSWEB| EU VAT Enhanced\n *\n * NOTICE OF LICENSE\n *\n * This source file is subject to the GEISSWEB End User License Agreement\n * that is available through the world-wide-web at this URL: https://www.geissweb.de/legal-information/eula\n *\n * DISCLAIMER\n *\n * Do not edit this file if you wish to update the extension in the future. If you wish to customize the extension\n * for your needs please refer to our support for more information.\n *\n * @copyright Copyright (c) 2015 GEISS Webl\u00f6sungen (https://www.geissweb.de)\n * @license https://www.geissweb.de/legal-information/eula GEISSWEB End User License Agreement\n */\ndefine([\n 'mage/utils/wrapper',\n 'Geissweb_Euvat/js/model/local-storage-handler'\n], function (\n wrapper,\n Storage\n) {\n 'use strict';\n\n return function (placeOrderAction) {\n return wrapper.wrap(placeOrderAction, function (originalAction, paymentData, redirectOnSuccess) {\
2n localStorage.removeItem(Storage.storageKey);\n return originalAction(paymentData, redirectOnSuccess);\n });\n };\n});\n","Geissweb_Euvat/js/action/reload.js":"/**\n * ||GEISSWEB| EU VAT Enhanced\n *\n * NOTICE OF LICENSE\n *\n * This source file is subject to the GEISSWEB End User License Agreement\n * that is available through the world-wide-web at this URL: https://www.geissweb.de/legal-information/eula\n *\n * DISCLAIMER\n *\n * Do not edit this file if you wish to update the extension in the future. If you wish to customize the extension\n * for your needs please refer to our support for more information.\n *\n * @copyright Copyright (c) 2015 GEISS Webl\u00f6sungen (https://www.geissweb.de)\n * @license https://www.geissweb.de/legal-information/eula GEISSWEB End User License Agreement\n */\n\ndefine([\n 'Magento_Checkout/js/model/checkout-data-resolver',\n 'Magento_Checkout/js/action/set-shipping-information',\n './update-totals'\n], function (\n checkoutDataResolver,\n setShippingInformationAction,\n updateTotalsAction\n) {\n 'use strict';\n\n return {\n\n /**\n * Reload order summary on #shipping step\n * @returns {*}\n */\n setShippingInfo: function () {\n return setShippingInformationAction();\n },\n\n /**\n * Resolve estimation address\n */\n resolveEstimationAddress: function () {\n return checkoutDataResolver.resolveEstimationAddress();\n },\n\n /**\n * Reload after VAT validation\n * @returns {*}\n */\n reloadTotals: function (addressType) {\n updateTotalsAction(addressType);\n }\n };\n\n});\n","Geissweb_Euvat/js/action/update-totals.js":"/**\n * ||GEISSWEB| EU VAT Enhanced\n *\n * NOTICE OF LICENSE\n *\n * This source file is subject to the GEISSWEB End User License Agreement\n * that is available through the world-wide-web at this URL: https://www.geissweb.de/legal-information/eula\n *\n * DISCLAIMER\n *\n * Do not edit this file if you wish to update the extension in the future. If you wish to customize the extension\n * for your needs please refer to our support for more information.\n *\n * @copyright Copyright (c) 2015 GEISS Webl\u00f6sungen (https://www.geissweb.de)\n * @license https://www.geissweb.de/legal-information/eula GEISSWEB End User License Agreement\n */\n\ndefine([\n 'Magento_Checkout/js/model/quote',\n 'Magento_Checkout/js/action/get-payment-information',\n 'Magento_Checkout/js/model/checkout-data-resolver',\n 'Magento_Checkout/js/action/set-shipping-information'\n], function (\n quote,\n getPaymentInformationAction,\n checkoutDataResolver,\n setShippingInformationAction\n) {\n 'use strict';\n\n return function (addressType) {\n let isVirtual = quote.isVirtual();\n\n if (addressType === 'shipping' && !isVirtual) {\n checkoutDataResolver.resolveShippingAddress();\n checkoutDataResolver.resolveBillingAddress();\n\n if (quote.shippingMethod()) {\n setShippingInformationAction().done(function () {\n getPaymentInformationAction();\n });\n }\n }\n };\n});\n","Geissweb_Euvat/js/form/validation/valid-vat-required.js":"define([\n 'jquery',\n 'mage/translate',\n 'mageUtils',\n 'euvatTools'\n], function (\n $,\n $t,\n Utils,\n EuVatTools\n) {\n 'use strict';\n\n return function (value, component) {\n\n if (typeof component !== 'object' || !component.vatFieldFunctionalityEnabled) {\n return true;\n }\n\n if (component.debug) {\n console.log('valid-vat-required validation', component);\n }\n\n if (!component.visible()) {\n if (component.debug) {\n console.log('valid-vat-required not visible');\n }\n return true;\n }\n\n if (!Utils.isEmpty(value)\n && component.validatedNumber() !== value\
2n && typeof window.checkoutConfig === 'object'\n ) {\n let results = window.checkoutConfig.vatNumberValidationResults;\n\n if (typeof results[value] === 'object') {\n component.isChanging = false;\n component.validatedNumber(value);\n component.isValidated(results[value].vat_request_success);\n component.isValidVatNumber(results[value].vat_is_valid);\n }\n }\n\n // Determine the country to use for validation - prefer VAT prefix country over address country\n let countryForValidation = component.getVatNumberCountry() || component.getCountry();\n\n if (!EuVatTools.isValidateable(\n countryForValidation,\n component.euCountries,\n component.noValidateCountries,\n component.taxFreeTerritories,\n component.getRegionId(),\n component.getPostcode()\n )\n ) {\n if (component.debug) {\n console.log('valid-vat-required not isValidateable for country: ' + countryForValidation);\n }\n return true;\n }\n\n if (Utils.isEmpty(component.value())) {\n if (component.debug) {\n console.log('valid-vat-required is empty');\n }\n return false;\n }\n\n if (component.offlineValidationEnabled\n && component.response.vat_request_success === false\n && component.passedRegex()\n ) {\n if (component.debug) {\n console.log('valid-vat-required disabled AJAX but pass Regex');\n }\n return true;\n }\n\n let errMsg = component.error() || '';\n\n if (component.debug) {\n console.log('valid-vat-required conditions', [\n value,\n component.isValidated(),\n component.isValidVatNumber(),\n errMsg.length <= 0\n ]);\n }\n\n return component.isValidated() && component.isValidVatNumber() && errMsg.length <= 0;\n\n };\n});\n\n\n","Geissweb_Euvat/js/form/validation/valid-vat-if-specified.js":"define([\n 'euvatTools'\n], function (\n EuVatTools\n) {\n 'use strict';\n\n return function (value, component) {\n\n if (typeof component !== 'object' || !component.vatFieldFunctionalityEnabled) {\n return true;\n }\n\n if (component.debug) {\n console.log('valid-vat-if-specified validation', component);\n }\n\n //Not specified\n if (typeof component.value() === 'string'\n && component.value().length <= 0\n ) {\n if (component.debug) {\n console.log('valid-vat-if-specified isNotSpecified', component);\n }\n return true;\n }\n\n //Not visible (by country)\n if (!component.visible()) {\n if (component.debug) {\n console.log('valid-vat-if-specified isNotVisible', component);\n }\n return true;\n }\n\n // Determine the country to use for validation - prefer VAT prefix country over address country\n let countryForValidation = component.getVatNumberCountry() || component.getCountry();\n\n if (!EuVatTools.isValidateable(\n countryForValidation,\n component.euCountries,\n component.noValidateCountries,\n component.taxFreeTerritories,\n component.getRegionId(),\n component.getPostcode())\n ) {\n if (component.debug) {\n console.log('valid-vat-if-specified isNotValidateable for country: ' + countryForValidation, component);\n }\n return true;\n }\n\n\n return component.isValidated() && component.isValidVatNumber() && component.error().length <= 0;\n };\n\n});\n\n\n","Geissweb_Euvat/js/form/validation/valid-vat-if-company.js":"define([\n 'jquery',\n 'mage/translate',\n 'mageUtils',\n './valid-vat-required'\n], function (\n $,\n $t,\n Utils,\n validVatRequiredValidation\n) {\n 'use strict';\n\n return function (value, component) {\n\n if (typeof component !== 'object' || !component.vatFieldFunctionalityEnabled) {\n return true;\n }\n\n if (component.debug) {\n console.log('valid-vat-if-company validation', component);\n }\n\n //Not visible (by country)\n if (!component.visible()) {\n if (component.debug) {\n console.log('valid-vat-if-company isNotVisible', component);\n }\n return true;\n }\n\n let company = component.getCompany();\n\n if (!Utils.isEmpty(company)) {\n return validVatRequiredValidation(value, component);\n }\n\n return true;\n };\n\n});\n\n\n","Geissweb_Euvat/js/form/element/vat-number-mageplaza.js":"/**\n * ||GEISSWEB| EU VAT Enhanced\n *\n * NOTICE OF LICENSE\n *\n * This source file is subject to the GEISSWEB End User License Agreement\n * that is available through the world-wide-web at this URL: https://www.geissweb.de/legal-information/eula\n *\n * DISCLAIMER\n *\n * Do not edit this file if you wish to update the extension in the future. If you wish to customize the extension\n * for your needs please refer to our support for more information.\n *\n * @copyright Copyright (c) 2015 GEISS Webl\u00f6sungen (https://www.geissweb.de)\n * @license https://www.geissweb.de/legal-information/eula GEISSWEB End User License Agreement\n */\n\ndefine([\n 'jquery',\n 'Geissweb_Euvat/js/form/element/vat-number-co',\n 'Geissweb_Euvat/js/queue',\n 'mageUtils',\n 'Magento_Checkout/js/action/set-billing-address',\n 'Magento_Checkout/js/action/set-shipping-information',\n 'Magento_Checkout/js/model/quote',\n 'Mageplaza_Osc/js/model/shipping-rate-service',\n 'uiRegistry'\n], function (\n $,\n VatNumberCo,\n queue,\n Utils,\n setBillingAddress,\n setShippingInfo,\n Quote,\n ShippingRateService,\n registry\n) {\n 'use strict';\n\n return VatNumberCo.extend({\n\n defaults: {\n imports: {\n }\n },\n\n // eslint-disable-next-line no-unused-vars\n initialize: function (options) {\n this._super();\n this.inputName = 'vat_id';\n let self = this;\n\n registry.async('checkoutProvider')(function (checkoutProvider) {\n if (!Utils.isEmpty(self.customScope) && self.isBillingField) {\
2n checkoutProvider.on(self.customScope + '.country_id', function (billingCountryId) {\n self.setVisibility(billingCountryId);\n });\n } else if (!Utils.isEmpty(self.customScope) && self.customScope === 'shippingAddress') {\n checkoutProvider.on('shippingAddress.country_id', function (shippingCountryId) {\n self.setVisibility(shippingCountryId);\n });\n }\n });\n if (this.debug) {\n console.log('vatNumberMageplaza init ' + this.uid, this);\n }\n return this;\n },\n\n // eslint-disable-next-line no-unused-vars\n afterValidation: function (jqXHR) {\n this._super();\n\n if (this.customScope === 'billingAddress') {\n queue.addFunction(function () {\n $.when(setBillingAddress()).done(function () {\n });\n });\n }\n\n if (this.customScope === 'shippingAddress') {\n queue.addFunction(function () {\n return ShippingRateService.estimateShippingMethod();\n });\n queue.addFunction(function () {\n if (!Quote.isVirtual() && !Utils.isEmpty(Quote.shippingMethod())) {\n $.when(setShippingInfo()).done(function () {\n });\n }\n });\n }\n\n return queue.run();\n },\n\n /**\n * Get the company field value in UiComponent forms\n * @returns {string|*}\n */\n // Fix form validation for Mageplaza\n getCompany: function () {\n let company;\n\n if (this.parentScope === 'billingAddress') {\n company = registry.get('checkout.steps.shipping-step.billingAddress.billing-address-fieldset.company');\n if (typeof company !== 'object') {\n // eslint-disable-next-line max-len\n company = registry.get('checkout.steps.billing-step.payment.afterMethods.billing-address-form.form-fields.company');\n }\n } else {\n // eslint-disable-next-line max-len\n company = registry.get('checkout.steps.shipping-step.shippingAddress.shipping-address-fieldset.company');\n }\n if (typeof company !== 'object') {\n return '';\n }\n return company.value();\n },\n\n /**\n * @returns {string|number}\n */\n getRegionId: function () {\n var regionField = registry.get(this.parentName + '.region_id');\n\n if (typeof regionField === 'object' && typeof regionField.value === 'function') {\n return regionField.value();\n }\n\n return '';\n },\n\n /**\n * @returns {string}\n */\n getPostcode: function () {\n var postcodeField = registry.get(this.parentName + '.postcode');\n\n if (typeof postcodeField === 'object' && typeof postcodeField.value === 'function') {\n return postcodeField.value();\n }\n\n return '';\n },\n\n /**\n * Get the country field value in UiComponent forms\n * @returns {boolean|*}\n */\n getCountry: function () {\n let country = registry.get(this.parentName + '.' + 'country_id');\n\n if (typeof country !== 'object' || Utils.isEmpty(country.value(
2))) {\n return '';\n }\n return country.value();\n }\n\n });\n});\n","Geissweb_Euvat/js/form/element/vat-number-aheadworks.js":"/**\n * ||GEISSWEB| EU VAT Enhanced\n *\n * NOTICE OF LICENSE\n *\n * This source file is subject to the GEISSWEB End User License Agreement\n * that is available through the world-wide-web at this URL: https://www.geissweb.de/legal-information/eula\n *\n * DISCLAIMER\n *\n * Do not edit this file if you wish to update the extension in the future. If you wish to customize the extension\n * for your needs please refer to our support for more information.\n *\n * @copyright Copyright (c) 2015 GEISS Webl\u00f6sungen (https://www.geissweb.de)\n * @license https://www.geissweb.de/legal-information/eula GEISSWEB End User License Agreement\n */\n\n//Tested with Aheadworks Checkout V2.4, V2.5\ndefine([\n 'jquery',\n 'Geissweb_Euvat/js/form/element/vat-number-co',\n 'Magento_Checkout/js/model/quote',\n 'mageUtils',\n 'mage/translate'\n], function (\n $,\n VatNumberCo,\n Quote,\n Utils,\n $t\n) {\n 'use strict';\n\n return VatNumberCo.extend({\n\n defaults: {\n debug: false,\n modules: {\n // eslint-disable-next-line max-len\n shippingCountry: 'checkout.shippingAddress.shipping-address-fieldset.included-country-field-row.country_id',\n // eslint-disable-next-line max-len\n billingCountry: 'checkout.paymentMethod.billingAddress.billing-address-fieldset.included-country-field-row.country_id',\n shippingCompany: 'checkout.shippingAddress.shipping-address-fieldset.company'\n }\n },\n\n /**\n * @return {Abstract} Chainable\n */\n initialize: function (options) {\n this._super();\n this.initObservable().setCssClasses();\n\n if (options.visible) {\n this.setVisibility(this.getCountry());\n let self = this;\n\n if (this.customScope === 'billingAddress') {\n Quote.billingAddress.subscribe(function (address) {\n if (address.countryId !== undefined) {\n self.setVisibility(address.countryId);\n }\n });\n } else if (this.customScope === 'shippingAddress') {\n Quote.shippingAddress.subscribe(function (address) {\n if (address.countryId !== undefined) {\n self.setVisibility(address.countryId);\n }\n });\n }\n }\n\n if (this.debug) {\n console.log('VatNumberAheadworks.initialize@'+this.parentScope, this);\n }\n\n this.validationParams = this; // like in aheadworks vat-id.js\n return this;\n },\n\n getCompany: function () {\n if (this.customScope === 'billingAddress') {\n if (this.source && this.source.billingAddress.company !== undefined) {\n return this.source.billingAddress.company;\n }\n if (Quote.billingAddress.company !== undefined) {\n return Quote.billingAddress.company;\n }\n }\n if (this.customScope === 'shippingAddress') {\n if (this.source && this.source.shippingAddress.company !== undefined) {\n return this.source.shippingAddress.company;\n }\n if (Quote.shippingAddress.company !== undefined) {\n return Quote.shippingAddress.company;\n }\n }\n return '';\n },\n\n /**\n * Get the country field value in UiComponent forms\n * @returns {string}\n */\n getCountry: function () {\n if (this.customScope === 'billingAddress') {\n if (typeof this.billingCountry() === 'object') {\n return this.billingCountry().value(
2);\n }\n if (Quote.billingAddress.countryId !== undefined) {\n return Quote.billingAddress.countryId;\n }\n }\n if (this.customScope === 'shippingAddress') {\n if (typeof this.shippingCountry() === 'object') {\n return this.shippingCountry().value();\n }\n if (Quote.shippingAddress.countryId !== undefined) {\n return Quote.shippingAddress.countryId;\n }\n }\n\n // eslint-disable-next-line max-len\n let country = $('div[name=\"' + this.customScope + 'Address.country_id\"] select[name=\"country_id\"] option').filter(':selected').val();\n\n if (country !== undefined) {\n return country;\n }\n return '';\n },\n\n /**\n * @returns {string|number}\n */\n getRegionId: function () {\n if (this.customScope === 'billingAddress') {\n if (this.source && this.source.billingAddress && this.source.billingAddress.region_id !== undefined) {\n return this.source.billingAddress.region_id;\n }\n if (Quote.billingAddress() && Quote.billingAddress().regionId !== undefined) {\n return Quote.billingAddress().regionId;\n }\n }\n\n if (this.customScope === 'shippingAddress') {\n if (this.source && this.source.shippingAddress && this.source.shippingAddress.region_id !== undefined) {\n return this.source.shippingAddress.region_id;\n }\n if (Quote.shippingAddress() && Quote.shippingAddress().regionId !== undefined) {\n return Quote.shippingAddress().regionId;\n }\n }\n\n return '';\n },\n\n /**\n * @returns {string}\n */\n getPostcode: function () {\n if (this.customScope === 'billingAddress') {\n if (this.source && this.source.billingAddress && this.source.billingAddress.postcode !== undefined) {\n return this.source.billingAddress.postcode;\n }\n if (Quote.billingAddress() && Quote.billingAddress().postcode !== undefined) {\n return Quote.billingAddress().postcode;\n }\n }\n\n if (this.customScope === 'shippingAddress') {\n if (this.source && this.source.shippingAddress && this.source.shippingAddress.postcode !== undefined) {\n return this.source.shippingAddress.postcode;\n }\n if (Quote.shippingAddress() && Quote.shippingAddress().postcode !== undefined) {\n return Quote.shippingAddress().postcode;\n }\n }\n\n return '';\n },\n\n askForCountryCorrection: function () {\n let countrySelect;\n\n if (this.customScope === 'billingAddress') {\n countrySelect = this.billingCountry();\n }\n if (this.customScope === 'shippingAddress') {\n countrySelect = this.shippingCountry();\n }\n if (typeof countrySelect !== 'object') {\n return Promise.resolve();\n }\n\n let vatNumberCountry = this.getVatNumberCountry();\n if (vatNumberCountry === 'EL') {\n vatNumberCountry = 'GR';\n }\n\n if (!this.askCustomerCountryCorrection\n || Utils.isEmpty(this.value())\n || Utils.isEmpty(countrySelect.value())\n || Utils.isEmpty(vatNumberCountry)\n || $.inArray(this.getVatNumberCountry(), this.euCountries) === -1\n || $.inArray(countrySelect.value(), this.euCountries) === -1\n ) {\n return Promise.resolve();\n }\n\n return new Promise((resolve) => {\n if (countrySelect.value() !== vatNumberCountry) {\n // eslint-disable-next-line no-alert\n confirm({\n title: $t('VAT number validation result'),\n // eslint-disable-next-line max-len\n content: $t('The country prefix of your VAT Number does not match your address country. Shall we automatically set the country?'),\n actions: {\n confirm: function () {\n countrySelect.value(vatNumberCountry);\n resolve();\n },\n cancel: function () {\n resolve();\n },\n always: function () {\n // Do n
2othing\n }\n }\n });\n } else {\n resolve();\n }\n });\n }\n\n });\n});\n","Geissweb_Euvat/js/form/element/vat-number-co.js":"/**\n * ||GEISSWEB| EU VAT Enhanced\n *\n * NOTICE OF LICENSE\n *\n * This source file is subject to the GEISSWEB End User License Agreement\n * that is available through the world-wide-web at this URL: https://www.geissweb.de/legal-information/eula\n *\n * DISCLAIMER\n *\n * Do not edit this file if you wish to update the extension in the future. If you wish to customize the extension\n * for your needs please refer to our support for more information.\n *\n * @copyright Copyright (c) 2015 GEISS Webl\u00f6sungen (https://www.geissweb.de)\n * @license https://www.geissweb.de/legal-information/eula GEISSWEB End User License Agreement\n */\n\ndefine([\n 'jquery',\n 'underscore',\n 'Geissweb_Euvat/js/form/element/vat-number-base',\n 'Magento_Checkout/js/model/quote',\n 'Geissweb_Euvat/js/action/reload',\n 'Geissweb_Euvat/js/model/local-storage-handler',\n 'uiRegistry'\n], function (\n $,\n _,\n VatNumberBase,\n Quote,\n ReloadAction,\n Storage,\n registry\n) {\n 'use strict';\n return VatNumberBase.extend({\n\n defaults: {\n addressType: null,\n modules: {\n country: '${ $.parentName }.country_id',\n company: '${ $.parentName }.company',\n regionField: '${ $.parentName }.region_id',\n postcodeField: '${ $.parentName }.postcode'\n }\n },\n\n initialize: function (options) {\n this._super();\n this.setCssClasses();\n this.initAddressType();\n let self = this;\n\n for (let property in self.validation) {\n if (self.validation.hasOwnProperty(property) && property === 'valid-vat-required') {\n _.extend(self.additionalClasses, {\n _required: true\n });\n } else if (self.validation.hasOwnProperty(property) && property === 'required-entry') {\n //Required for Amasty checkout which adds required-entry:false\n let isRequired = self.validation['required-entry'];\n\n if (!isRequired) {\n delete self.validation['required-entry'];\n }\n _.extend(self.additionalClasses, {\n _required: isRequired\n });\n }\n }\n\n if (options.visible && this.vatFrontendVisibility) {\n self.setVisibility(self.getCountry());\n registry.async('checkoutProvider')(function (checkoutProvider) {\n checkoutProvider.on(self.parentScope + '.country_id', function (countryId) {\n self.setVisibility(countryId);\n });\n });\n }\n\n this.loadStoredResult();\n\n if (this.debug) {\n console.log('VatNumberCheckout.[' + this.uid + '].initialize@' + this.parentScope, this);\n }\n return self;\n },\n\n /**\n * Load validation result from local storage\n */\n loadStoredResult: function () {\n const validationResult = Storage.load(this.value());\n if (validationResult !== undefined) {\n if (this.debug) {\n console.log('VatNumberCheckout.[' + this.uid + '].loadStoredResult', validationResult);\n }\n this.validatedNumber(validationResult.vat_id);\n this.passedRegex(true);\n this.isValidated(validationResult.vat_request_success);\n this.isValidVatNumber(validationResult.vat_is_valid);\n }\n },\n\n initAddressType: function () {\n if (this.parentScope === 'shippingAddress' || this.customScope === 'shippingAddress') {\n this.addressType = 'shipping';\n if (this.delay === 'undefined') {\n this.delay = 0;\n }\n } else {\n this.addressType = 'billing';\n }\n },\n\n\n /**\n * Get the country field value in UiComponent forms\n * @returns {string}\n */\n getCountry: function () {\n if (typeof this.country() === 'object') {\n return this.country().value(
2);\n }\n return '';\n },\n\n /**\n * Get the company field value in UiComponent forms\n * @returns {string|*}\n */\n getCompany: function () {\n if (typeof this.company() === 'object') {\n return this.company().value();\n }\n return '';\n },\n\n /**\n * @returns {string|number}\n */\n getRegionId: function () {\n if (typeof this.regionField() === 'object') {\n return this.regionField().value();\n }\n return '';\n },\n\n /**\n * @returns {string}\n */\n getPostcode: function () {\n if (typeof this.postcodeField() === 'object') {\n return this.postcodeField().value();\n }\n return '';\n },\n\n resetStatus: function () {\n this._super();\n if (this.isDisableCompanyField && typeof this.company() === 'object') {\n this.company().disabled(false);\n }\n },\n\n /**\n * After the validation result is received, ask customer for country correction when its different\n * from the VAT number country prefix. When that is done, resolve the estimation address and reload the totals.\n */\n afterValidation: function (result) {\n this.handleResultData(result);\n let self = this;\n\n Storage.save(result);\n\n $.when(this.askForCountryCorrection()).done(function () {\n ReloadAction.reloadTotals(self.addressType);\n });\n },\n\n /**\n * Get company field for updates\n * @returns {*}\n */\n getCompanyFieldForUpdate: function () {\n return typeof this.company() === 'object' ? this.company() : null;\n },\n\n /**\n * Update company field value\n * @param {*} companyField\n * @param {string} value\n */\n updateCompanyField: function (companyField, value) {\n companyField.value(value);\n },\n\n /**\n * Set company field disabled state\n * @param {*} companyField\n * @param {boolean} disabled\n */\n setCompanyFieldDisabled: function (companyField, disabled) {\n companyField.disabled(disabled);\n }\n\n });\n});\n\n","Geissweb_Euvat/js/form/element/vat-number-front.js":"/**\n * ||GEISSWEB| EU VAT Enhanced\n *\n * NOTICE OF LICENSE\n *\n * This source file is subject to the GEISSWEB End User License Agreement\n * that is available through the world-wide-web at this URL: https://www.geissweb.de/legal-information/eula\n *\n * DISCLAIMER\n *\n * Do not edit this file if you wish to update the extension in the future. If you wish to customize the extension\n * for your needs please refer to our support for more information.\n *\n * @copyright Copyright (c) 2015 GEISS Webl\u00f6sungen (https://www.geissweb.de)\n * @license https://www.geissweb.de/legal-information/eula GEISSWEB End User License Agreement\n */\n\ndefine([\n 'jquery',\n 'underscore',\n 'Geissweb_Euvat/js/form/element/vat-number-base',\n 'mageUtils',\n 'mage/translate',\n 'Magento_Ui/js/modal/confirm',\n 'domReady!'\n], function (\n $,\n _,\n VatNumberBase,\n Utils,\n $t,\n confirm\n) {\n 'use strict';\n\n return VatNumberBase.extend({\n\n defaults: {\n validation_registration: {},\n validation_addressedit: {},\n countrySelect: null,\n companyField: null\n },\n\n // eslint-disable-next-line no-unused-vars\n initialize: function (options) {\n this.element = this._super();\n this.isOutOfUiScope = true;\n this.inputName = 'vat_id';\n let self = this;\n\n this.replaceFlatFieldWithUiComponent();\n\n for (let property in this.validation) {\n if (this.validation.hasOwnProperty(property)\n && property === 'valid-vat-required'\n ) {\n _.extend(this.additionalClasses, {\n _required: true\n });\n }\n }
2\n this.setCssClasses();\n\n // \"Link\" the company field\n this.companyField = $('#company');\n\n // Toggle visibility based on country selection\n this.countrySelect = $('#country');\n if (typeof this.countrySelect === 'object') {\n this.countrySelect.change(function () {\n self.setVisibility(self.getCountry());\n });\n }\n\n // Set initial visibility\n if (this.vatFrontendVisibility === false) {\n this.visible(false);\n } else {\n let country = this.getCountry();\n\n this.setVisibility(country);\n }\n\n if (this.debug) {\n console.log('vatNumberFront.initialize', this);\n }\n\n return this;\n },\n\n /**\n * Replace the flat field with the UI component\n */\n replaceFlatFieldWithUiComponent: function () {\n if (this.handle === 'customer_account_create'\n || this.handle === 'btwob_account_create'\n || this.handle === 'business_account_register_index'\n ) {\n this.validation = this.validation_registration;\n } else if (this.handle === 'customer_address_form') {\n this.validation = this.validation_addressedit;\n this.importValue($('div.taxvat input[name=\"vat_id\"]').val());\n }\n\n let regularField = $('div.field.taxvat');\n\n if (regularField !== null && regularField.length > 0) {\n regularField.remove();\n }\n\n // For BSS Registration page\n // eslint-disable-next-line one-var\n let bssField = $('div.field.vat_id');\n\n if (bssField !== null && bssField.length > 0) {\n bssField.remove();\n }\n\n $('#vat_number_container').insertAfter('div.field.country');\n },\n\n\n resetStatus: function () {\n this._super();\n if (this.isDisableCompanyField\n && _.isObject(this.companyField)\n && this.companyField.length > 0\n && _.isFunction(this.companyField.prop)\n ) {\n this.companyField.prop('readonly', false);\n }\n },\n\n afterValidation: function (result) {\n this.handleResultData(result);\n if (this.isValidated() && this.isValidVatNumber()) {\n $('#' + this.uid).removeClass('mage-error').attr('aria-invalid', false);\n $('#' + this.uid + '-error').remove();\n }\n return this.askForCountryCorrection();\n },\n\n /**\n * Get company field for updates\n * @returns {*}\n */\n getCompanyFieldForUpdate: function () {\n return (typeof this.companyField === 'object' && this.companyField.length > 0) ? this.companyField : null;\n },\n\n /**\n * Update company field value\n * @param {*} companyField\n * @param {string} value\n */\n updateCompanyField: function (companyField, value) {\n companyField.val(value);\n },\n\n /**\n * Set company field disabled state\n * @param {*} companyField\n * @param {boolean} disabled\n */\n setCompanyFieldDisabled: function (companyField, disabled) {\n companyField.prop('readonly', disabled);\n },\n\n /**\n * @returns {string|number}\n */\n getRegionId: function () {\n return $('#region_id').val() || '';\n },\n\n /**\n * @returns {string}\n */\n getPostcode: function () {\n return $('#zip').val() || '';\n },\n\n /**\n * Get country from flat field\n * @returns {string}\n */\n getCountry: function () {\n if (typeof this.countrySelect === 'object') {\n return this.countrySelect.val();\n }\n return '';\n }
2,\n\n /**\n * Ask for country correction\n * @returns {Promise<void>|Promise<unknown>}\n */\n askForCountryCorrection: function () {\n if (typeof this.countrySelect !== 'object'\n || !this.askCustomerCountryCorrection\n ) {\n return Promise.resolve();\n }\n\n let vatNumberCountry = this.getVatNumberCountry();\n\n if (vatNumberCountry === 'EL') {\n vatNumberCountry = 'GR';\n }\n\n if (Utils.isEmpty(this.value())\n || Utils.isEmpty(this.countrySelect.val())\n || Utils.isEmpty(vatNumberCountry)\n || $.inArray(vatNumberCountry, this.euCountries) === -1\n || $.inArray(this.countrySelect.val(), this.euCountries) === -1\n ) {\n return Promise.resolve();\n }\n\n let self = this;\n\n return new Promise((resolve) => {\n if (self.countrySelect.val() !== vatNumberCountry) {\n confirm({\n title: $t('VAT number validation result'),\n // eslint-disable-next-line max-len\n content: $t('The country prefix of your VAT Number does not match your address country. Shall we automatically set the country?'),\n actions: {\n confirm: function () {\n self.countrySelect.val(vatNumberCountry).change();\n resolve();\n },\n cancel: function () {\n resolve();\n },\n always: function () {\n // Do nothing\n }\n }\n });\n } else {\n resolve();\n }\n });\n },\n\n /**\n * Get company name from flat field\n * @returns {string}\n */\n getCompany: function () {\n let companyElement = $('#company');\n\n if (typeof companyElement !== 'object') {\n return '';\n }\n return companyElement.val();\n },\n\n /**\n * Import value from flat field\n * @param value\n */\n importValue: function (value) {\n if (!Utils.isEmpty(value)) {\n this.isImport = true;\n this.value(value);\n this.validateVatNumber(value);\n this.isImport = false;\n }\n },\n\n /**\n * Get country select field\n * @returns {{length}|*|jQuery|HTMLElement|null}\n */\n getCountrySelect: function () {\n const jQueryField = $('#country');\n if (jQueryField.length && typeof jQueryField.val === 'function') {\n return jQueryField;\n }\n const knockoutField = registry.get(this.parentName + '.' + 'country_id');\n if (knockoutField && typeof knockoutField.value === 'function') {\n return knockoutField;\n }\n return null;\n },\n\n /**\n * Get selected address country\n * @returns {*|string}\n */\n getAddressCountry: function () {\n const countrySelect = this.getCountrySelect();\n if (countrySelect instanceof $ && typeof countrySelect.val === 'function') {\n const val = countrySelect.val();\n if (!Utils.isEmpty(val)) {\n return val;\n }\n }\n if (typeof countrySelect === 'object' && typeof countrySelect.value === 'function') {\n const val = countrySelect.value();\n if (!Utils.isEmpty(val)) {\n return val;\n }\n }\n return '';\n }\n\n\n\n });\n\n});\n","Geissweb_Euvat/js/form/element/vat-number-base.js":"/**\n * ||GEISSWEB| EU VAT Enhanced\n *\n * NOTICE OF LICENSE\n *\n * This source file is subject to the GEISSWEB End User License Agreement\n * that is available through the world-wide-web at this URL: https://www.geissweb.de/legal-information/eula\n *\n * DISCLAIMER\n *\n * Do not edit this file if you wish to update the extension in the future. If you wish to customize the extension\n * for your needs please refer to our support for more information.\n *\n * @copyright Copyright (c) 2015 GEISS Webl\u00f6sungen (https://www.geissweb.de)\n * @license https://www.geissweb.de/legal-information/eula GEISSWEB End User License Agreement\n */\n\ndefine([\n 'jquery',\n 'Magento_Ui/js/form/element/abstract',\n 'ko',\n 'mageUtils',\n 'mage/translate',\n 'uiRegistry',\n 'Magento_Ui/js/modal/confirm',\n 'euvatTools'\n], function (\n $,\n Abstract,\n ko,\n Utils,\n $t,\n registry,\n confirm,\n EuVatTools\n) {\n 'use strict';\n\n return Abstract.extend({\n\n defaults: {\n askCustomerCountryCorrection: false,\n classes: null,\n containerClasses: null,\n countryCode: '',\n debug: false,\n delay: 3000,\n elementTmpl: 'Geissweb_Euvat/vat-input',\n euCountries: false,\n fieldVisibleCountries: false,\n isAdminhtml: false,\n isChanging: false,\n isImport: false,\n isOutOfUiScope: false,\n isValidVatNumber: ko.observable(false),\n isValidated: ko.observable(false),\n isOverwriteCompanyName: false,\n isDisableCompanyField: false,\n label: $t('VAT Number'),\n noValidateCountries: null,\n offlineValidationEnabled: false,\n passedRegex: ko.observable(false),\n placeholder: '',\n response: ko.observable(),\n retry: false,\n retryText: $t('Click here to try again.'),\n success: ko.observable(false),\n successForId: ko.observable(),\n template: 'Geissweb_Euvat/vatfield',\n timeout: null,\n validatedNumber: ko.observable(),\n taxFreeTerritories: {},\n vatFieldFunctionalityEnabled: false,\n vatFrontendVisibility: false\n },\n\n /**\n * Initializes instance\n * @returns {*}\n */\n initialize: function () {\n this._super();\n this.validationParams = this;\n this.successId = 'success-' + this.uid;\n this.initObservable();\n\n this.visible(this.vatFrontendVisibility);\n if (this.debug) {\n console.log('VatNumberBase.[' + this.uid + '].initialize@' + this.parentScope, this);\n }\n return this;\n },\n\n /**\n * Initializes observable properties of instance\n *\n * @returns {Abstract}
2 Chainable.\n */\n initObservable: function () {\n this._super();\n this.observe('isValidated isValidVatNumber success');\n return this;\n },\n\n /**\n * Sets initial visibility\n * @param countryValue\n */\n setVisibility: function (countryValue) {\n if (this.vatFrontendVisibility === true\n && $.isArray(this.fieldVisibleCountries)\n && $.inArray(countryValue, this.fieldVisibleCountries) !== -1\n ) {\n this.visible(true);\n } else {\n this.value('');\n this.visible(false);\n }\n },\n\n /**\n * Unset all messages and results\n */\n clearMessages: function () {\n this.success(false);\n this.warn('');\n this.error('');\n this.bubble('success');\n this.bubble('warn');\n this.bubble('error');\n $('#' + this.uid + '-error').remove();\n },\n\n /**\n * Sets current validation status\n * @param number\n * @param isValidVatNumber\n */\n setStatus: function (number, isValidVatNumber) {\n this.isValidated(true);\n this.isValidVatNumber(isValidVatNumber);\n this.validatedNumber(number);\n },\n\n /**\n * resets current validation status\n */\n resetStatus: function () {\n this.isValidated(false);\n this.isValidVatNumber(false);\n this.validatedNumber('');\n },\n\n /**\n * Control validation execution\n * @param value\n */\n onUpdate: function (value) {\n if (this.timeout !== null) {\n clearTimeout(this.timeout);\n }\n\n this.clearMessages();\n let deferred = $.Deferred(),\n self = this;\n\n if (!Utils.isEmpty(value)\n && value.length > 3\n && !this.isChanging\n && !this.isImport\n ) {\n this.timeout = setTimeout(function () {\n self.startValidation(value);\n }, this.delay);\n } else if (Utils.isEmpty(value) && !this.isChanging) {\n this.timeout = setTimeout(function () {\n self.resetStatus();\n self.isChanging = true;\n self.clear();\n self.bubble('update', self.hasChanged());\n self.isChanging = false;\n self.afterValidation(deferred);\n }, this.delay);\n }\n },\n\n /**\n * @param value\n */\n startValidation: function (value) {\n value = value.replace(/[\\W_]/g, '').toUpperCase().trim();\n this.isChanging = true;\n this.value(value);\n this.bubble('update', this.hasChanged());\n let result = this.validate();\n\n this.isChanging = false;\n this.isImport = false;\n return result;\n },\n\n /**\n * Check if a valid-vat-* validation rule is configured\n * @returns {boolean}\n */\n hasVatValidationRule: function () {\n let validationRules = ['valid-vat-required', 'valid-vat-if-specified', 'valid-vat-if-company-specified'];\n\n for (let i = 0; i < validationRules.length; i++) {\n if (this.validation.hasOwnProperty(validationRules[i]) && this.validation[validationRules[i]]) {\n return true;\n }\n }\n\n return false;\n },\n\n /**\n * Check if number can be validated and validate it, show messages accordingly\n * @returns {*}\n */\n validate: function () {\n if (this.isValidated() && this.validatedNumber() === this.value() && this.hasVatValidationRule()) {\n if (this.isValidVatNumber()) {\n return {\n valid: true,\n target: this\n };\n }\n }\n\n if (this.isChanging && !Utils.isEmpty(this.value())) {\n return this.validateChangingV
2alue();\n }\n\n return this._super();\n },\n\n /**\n * Handle validation when the field value is actively changing (AJAX validation path)\n * @returns {*}\n */\n validateChangingValue: function () {\n this.clearMessages();\n let value = this.value(),\n countryCode = this.getVatNumberCountry();\n\n if (!value.match(new RegExp('^[A-Z][A-Z]'))\n && !Utils.isEmpty(this.getAddressCountry())\n ) {\n countryCode = this.getAddressCountry();\n if (countryCode === 'GR') {\n value = 'EL' + value;\n } else {\n value = countryCode + value;\n }\n this.value(value);\n }\n\n if (!this.value().match(new RegExp('^[A-Z][A-Z]'))) {\n let message = $t('Please provide the country code prefix of the VAT number.');\n\n this.resetStatus();\n if (this.source) {\n this.source.set('params.invalid', true);\n }\n if (this.isAdminhtml) {\n this.error(message);\n this.bubble('error', message);\n } else {\n this.warn(message);\n this.bubble('warn', message);\n }\n return {\n valid: false,\n target: this\n };\n }\n\n if (!EuVatTools.isValidateable(\n this.getVatNumberCountry(),\n this.euCountries,\n this.noValidateCountries,\n this.taxFreeTerritories,\n this.getRegionId(),\n this.getPostcode()\n )) {\n return {\n valid: true,\n target: this\n };\n }\n\n return this.validateVatNumber(value);\n },\n\n /**\n * AJAX validation of the VAT number\n * @param vatNumber\n */\n validateVatNumber: function (vatNumber) {\n $('body').trigger('processStart');\n\n let self = this,\n valid = false,\n formKey;\n\n self.resetStatus();\n\n if (typeof window.FORM_KEY !== 'undefined' && window.FORM_KEY.length > 0) {\n formKey = window.FORM_KEY;\n } else if (!this.isAdminhtml\n && typeof $.cookie === 'function'\n && $.cookie('form_key') !== null\n && $.cookie('form_key').length > 0\n ) {\n formKey = $.cookie('form_key');\n }\n if (typeof formKey === 'undefined') {\n formKey = $('input:hidden[name=form_key]').val();\n }\n\n return $.ajax({\n type: 'GET',\n url: self.validationUrl,\n data: {\n vat_number: vatNumber,\n form_key: formKey,\n handle: self.handle\n },\n success: function (response) {\n self.clearMessages();\n self.response(response);\n if (response.vat_is_valid === true) {\n valid = true;\n self.setStatus(vatNumber, true);\n self.success($t(response.request_message));\n self.successForId(self.successId);\n } else {\n valid = false;\n self.setStatus(vatNumber, false);\n if (response.retry_available === true) {\n self.retry = true;\n }\n if (response.warning === true) {\n self.warn($t(response.request_message));\n } else {\n self.error($t(response.request_message));\n }\n }\n },\n error: function (response) {\n valid = false;\n self.resetStatus();\n self.response(response);\n self.retry = true;\n self.warn($t('Error during VAT number validation request.'));\n }\n\n }).then(function (result) {\n if (!result.vat_id) {\n result.vat_id = vatNumber;\n }\n self.afterValidation(result);\n }).always(function () {\n $('body').trigger('processStop');\n }).done(function () {\n return {\n valid: valid,\n target: self\n };\n });\n },\n\n /**\n * Is implemented in specific instances of this\n */\n // eslint-disable-next-line no-unused-vars\n afterValidation: function (result) {},\n\n /**\n * Get the VAT number prefix country, returns GR for EL numbers\n * @returns {string}\n */\n getVatNumberCountry: function () {\n if (!Utils.isEmpty(this.value())\n && this.value().match(new RegExp('^[A-Z][A-Z]'))\n ) {\n let cc = this.value().substr(0,2).toUpperCase();\n if(cc === 'EL') {\n return 'GR';\n }\n return cc;\n }\n return '';\n },\n\n /**\n * @returns {string|number}\n */\n getRegionId: function () {\n return '';\n },\n\n /**\n * @returns {string}\n */\n getPostcode: function () {\n return '';\n },\n\n getCountrySelect: function () {\n let countrySelect;\n if (typeof this.countrySelect === 'object') {\n return this.countrySelect;\n } else {\n countrySelect = registry.get(this.parentName + '.' + 'country_id');\n }\n return countrySelect;\n },\n\n getAddressCountry: function () {\n let countryValue = $('#countryId').val();\n\n if (!Utils.isEmpty(countryValue)) {\n return countryValue;\n }\n\n let countrySelect = this.getCountrySelect();\n if (typeof countrySelect === 'object') {\n return countrySelect.value();\n }\n\n return '';\n },\n\n askForCountryCorrection: function () {\n let countrySelect = this.getCountrySelect();\n if (typeof countrySelect !== 'object') {\n return Promise.resolve();\n }\n\n // eslint-disable-next-line one-var\n let vatNumberCountry = this.getVatNumberCountry();\n\n if (vatNumberCountry === 'EL') {\n vatNumberCountry = 'GR';\n }\n if (!this.askCustomerCountryCorrection\n || Utils.isEmpty(this.value())\n || Utils.isEmpty(countrySelect.value())\n || Utils.isEmpty(vatNumberCountry)\n || $.inArray(vatNumberCountry, this.euCountries) === -1\n || $.inArray(countrySelect.value(), this.euCountries) === -1\n ) {\n return Promise.resolve();\n }\n\n return new Promise((resolve) => {\n if (countrySelect.value() !== vatNumberCountry) {\n confirm({\n title: $t('VAT number validation result'),\n // eslint-disable-next-line max-len\n content: $t('The country prefix of your VAT Number does not match your address country. Shall we automatically set the country?'),\n actions: {\n confirm: function () {\n countrySelect.value(vatNumberCountry);\n resolve();\n },\n cancel: function () {\n resolve();\n },\n always: function () {\n // Do n
2othing\n }\n }\n });\n } else {\n resolve();\n }\n });\n },\n\n /**\n * Get the company field value in UiComponent forms\n * @returns {string|*}\n */\n getCompany: function () {\n let company = registry.get(this.parentName + '.' + 'company');\n\n if (typeof company !== 'object' || Utils.isEmpty(company.value())) {\n return '';\n }\n return company.value();\n },\n\n /**\n * Retry the validation\n */\n retryValidation: function () {\n return this.onUpdate(this.value());\n },\n\n /**\n * Sets field css classes\n */\n setCssClasses: function () {\n if (this.classes === null) {\n let classes = ['input-text'];\n\n for (let property in this.validation) {\n if (Object.prototype.hasOwnProperty.call(this.validation, property)) {\n classes.push(property);\n }\n }\n this.classes = '';\n classes.forEach(function (name) {\n this.classes += ' ' + name;\n }, this);\n }\n this.classes = this.classes.trim();\n },\n\n /**\n * Handle validation result data\n * @param {object} result\n */\n handleResultData: function (result) {\n if (typeof result !== 'object') {\n return;\n }\n if (this.isOverwriteCompanyName\n && result.hasOwnProperty('vat_trader_name')\n && _.isString(result.vat_trader_name)\n ) {\n let companyField = this.getCompanyFieldForUpdate();\n if (companyField) {\n this.updateCompanyField(companyField, result.vat_trader_name);\n if (this.isDisableCompanyField) {\n this.setCompanyFieldDisabled(companyField, true);\n }\n }\n }\n },\n\n /**\n * Get company field for updates (to be overridden by subclasses)\n * @returns {*}\n */\n getCompanyFieldForUpdate: function () {\n return null;\n },\n\n /**\n * Update company field value (to be overridden by subclasses)\n * @param {*} companyField\n * @param {string} value\n */\n updateCompanyField: function (companyField, value) {\n // Override in subclasses\n },\n\n /**\n * Set company field disabled state (to be overridden by subclasses)\n * @param {*} companyField\n * @param {boolean} disabled\n */\n setCompanyFieldDisabled: function (companyField, disabled) {\n // Override in subclasses\n }\n\n });\n});\n\n","Geissweb_Euvat/js/view/vat-validators.js":"/**\n * ||GEISSWEB| EU VAT Enhanced\n *\n * NOTICE OF LICENSE\n *\n * This source file is subject to the GEISSWEB End User License Agreement\n * that is available through the world-wide-web at this URL: https://www.geissweb.de/legal-information/eula\n *\n * DISCLAIMER\n *\n * Do not edit this file if you wish to update the extension in the future. If you wish to customize the extension\n * for your needs please refer to our support for more information.\n *\n * @copyright Copyright (c) 2015 GEISS Webl\u00f6sungen (https://www.geissweb.de)\n * @license https://www.geissweb.de/legal-information/eula GEISSWEB End User License Agreement\n */\n\ndefine([\n 'uiComponent',\n 'Magento_Checkout/js/model/payment/additional-validators',\n 'Geissweb_Euvat/js/model/vat-id-required-validator'\n],function (\n Component,\n additionalValidators,\n vatValidator\n) {\n 'use strict';\n additionalValidators.registerValidator(vatValidator);\n return Component.extend({});\n});\n","Geissweb_Euvat/js/mixin/shipping-rates-validation-rules.js":"/**\n * ||GEISSWEB| EU VAT Enhanced\n *\n * NOTICE OF LICENSE\n *\n * This source file is subject to the GEISSWEB End User License Agreement\n * that is available through the world-wide-web at this URL: https://www.geissweb.de/legal-information/eula\n *\n * DISCLAIMER\n *\n * Do not edit this file if you wish to update the extension in the future. If you wish to customize the extension\n * for your needs please refer to our support for more information.\n *\n * @copyright Copyright (c) 2015 GEISS Webl\u00f6sungen (https://www.geissweb.de)\n * @license https://www.geissweb.de/legal-information/eula GEISSWEB End User License Agreement\n */\n\ndefine([\n 'mage/utils/wrapper'\n],function (\n Wrapper\n) {\n 'use strict';\n\n return function (originalRules) {\n originalRules.getObservableFields = Wrapper.wrap(\n originalRules.getObservableFields,\n function (originalAction) {\n var fields = originalAction();\n\n fields.push('vatId');\n return fields;\n }\n );\n return originalRules;\n };\n});\n","Geissweb_Euvat/js/mixin/model-cart-cache-mixin.js":"/**\n * ||GEISSWEB| EU VAT Enhanced\n *\n * NOTICE OF LICENSE\n *\n * This source file is subject to the GEISSWEB End User License Agreement\n * that is available through the world-wide-web at this URL: https://www.geissweb.de/legal-information/eula\n *\n * DISCLAIMER\n *\n * Do not edit this file if you wish to update the extension in the future. If you wish to customize the extension\n * for your needs please refer to our support for more information.\n *\n * @copyright Copyright (c) 2015 GEISS Webl\u00f6sungen (https://www.geissweb.de)\n * @license https://www.geissweb.de/legal-information/eula GEISSWEB End User License Agreement\n */\n\ndefine([], function () {\n 'use strict';\n\n return function (cartCache) {\n cartCache.requiredFields.push('vatId'); //default ['countryId', 'region', 'regionId', 'postcode']\n return cartCache;\n };\n});\n","Geissweb_Euvat/js/mixin/vat-field-form-validation-ui.js":"define([\n 'jquery',\n 'mage/translate',\n 'mageUtils',\n 'Geissweb_Euvat/js/form/validation/valid-vat-required',\n 'Geissweb_Euvat/js/form/validation/valid-vat-if-company',\n 'Geissweb_Euvat/js/form/validation/valid-vat-if-specified'\n], function (\n $,\n $t,\n Utils,\n validVatRequiredValidation,\n validVatRequiredIfCompanyValidation,\n validVatRequiredIfSpecifiedValidation\n) {\n 'use strict';\n\n return function (validator) {\n\n /**\n * Checks if the VAT number is validated successfully\n */\n validator.addRule(\n 'valid-vat-required',\n function (value, param, component) {\n return validVatRequiredValidation(value, component); },\n $t('Please type a valid VAT number in this field. Example: CC123456789')\n );\n\n /**\n * Requires a validated VAT number when the company field is filled\n */\n validator.addRule(\n 'valid-vat-if-company-specified',\n function (value, param, component) {\n return validVatRequiredIfCompanyValidation(value, component); },\n $t('Please type a valid VAT number in this field, or leave the company field empty.')\n );\n\n /**\n * If there is a value in the VAT field, require the number to be valid\n */\n validator.addRule(\n 'valid-vat-if-specified',\n function (value, param, component) {\n return validVatRequiredIfSpecifiedValidation(value, component); },\n $t('Please type a valid VAT number in this field, or leave it empty.')\n );\n\n return validator;\n\n };\n});\n","Geissweb_Euvat/js/mixin/vat-field-form-validation.js":"define([\n 'jquery',\n 'mage/translate',\n 'mageUtils',\n 'uiRegistry',\n '../form/validation/valid-vat-required',\n '../form/validation/valid-vat-if-company',\n '../form/validation/valid-vat-if-specified'\n], function (\n $,\n $t,\n Utils,\n uiRegistry,\n validVatRequiredValidation,\n validVatRequiredIfCompanyValidation,\n validVatRequiredIfSpecifiedValidation\n) {\n 'use strict';\n\n return function (widget) {\n /**\n * Checks if the VAT number is validated successfully\n */\n $.validator.addMethod(\n 'valid-vat-required',\n function (value) {\n let component = uiRegistry.get('vat-id-input');\n\n return validVatRequiredValidation(value, component);\n },\n $t('Please type a valid VAT number in this field. Example: CC123456789'),\n true\n );\n\n /**\n * Requires a validated VAT number when the company field is filled\n */\n $.validator.addMethod(\n 'valid-vat-if-company-specified',\n function (value) {\n let component = uiRegistry.get('vat-id-input');\n\n return validVatRequiredIfCompanyValidation(value, component);\n },\n $t('Please type a valid VAT number in this field, or leave the company field empty.'),\n true\n );\n\n /**\n * If there is a value in the VAT field, require the number to be valid\n */\n $.validator.addMethod(\n 'valid-vat-if-specified',\n function (value) {\n let component = uiRegistry.get('vat-id-input');\n\n return validVatRequiredIfSpecifiedValidation(value, component);\n },\n $t('Please type a valid VAT number in this field, or leave it empty.'),\n true\n );\n\n return widget;\n };\n});\n","FME_Pricecalculator/js/price-box.js":"/**\n * Copyright \u00a9 2013-2017 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\ndefine([\n 'jquery',\n 'Magento_Catalog/js/price-utils',\n 'underscore',\n 'mage/template',\n 'jquery/ui'\n], function ($, utils, _, mageTemplate) {\n 'use strict';\n\n var globalOptions = {\n productId: null,\n priceConfig: null,\n prices: {},\n priceTemplate: '<span class=\"price\"><%- data.formatted %></span>'\n };\n\n $.widget('mage.priceBox', {\n options: globalOptions,\n cache: {},\n\n /**\n * Widget initialisation.\n * Every time when option changed prices also can be changed. So\n * changed o
2ptions.prices -> changed cached prices -> recalculation -> redraw price box\n */\n _init: function initPriceBox() {\n var box = this.element;\n\n box.trigger('updatePrice');\n this.cache.displayPrices = utils.deepClone(this.options.prices);\n },\n\n /**\n * Widget creating.\n */\n _create: function createPriceBox() {\n var box = this.element;\n\n this._setDefaultsFromPriceConfig();\n this._setDefaultsFromDataSet();\n\n box.on('reloadPrice', this.reloadPrice.bind(this));\n box.on('updatePrice', this.onUpdatePrice.bind(this));\n },\n\n /**\n * Call on event updatePrice. Proxy to updatePrice method.\n * @param {Event} event\n * @param {Object} prices\n */\n onUpdatePrice: function onUpdatePrice(event, prices) {\n return this.updatePrice(prices);\n },\n\n /**\n * Updates price via new (or additional values).\n * It expects object like this:\n * -----\n * \"option-hash\":\n * \"price-code\":\n * \"amount\": 999.99999,\n * ...\n * -----\n * Empty option-hash object or empty price-code object treats as zero amount.\n * @param {Object} newPrices\n */\n updatePrice: function updatePrice(newPrices) {\n var prices = this.cache.displayPrices,\n additionalPrice = {},\n pricesCode = [],\n priceValue, origin, finalPrice;\n\n this.cache.additionalPriceObject = this.cache.additionalPriceObject || {};\n\n if (newPrices) {\n $.extend(this.cache.additionalPriceObject, newPrices);\n }\n\n if (!_.isEmpty(additionalPrice)) {\n pricesCode = _.keys(additionalPrice);\n } else if (!_.isEmpty(prices)) {\n pricesCode = _.keys(prices);\n }\n\n _.each(this.cache.additionalPriceObject, function (additional) {\n if (additional && !_.isEmpty(additional)) {\n pricesCode = _.keys(additional);\n }\n _.each(pricesCode, function (priceCode) {\n priceValue = additional[priceCode] || {};\n priceValue.amount = +priceValue.amount || 0;\n priceValue.adjustments = priceValue.adjustments || {};\n\n additionalPrice[priceCode] = additionalPrice[priceCode] || {\n 'amount': 0,\n 'adjustments': {}\n };\n additionalPrice[priceCode].amount = 0 + (additionalPrice[priceCode].amount || 0) +\n priceValue.amount;\n _.each(priceValue.adjustments, function (adValue, adCode) {\n additionalPrice[priceCode].adjustments[adCode] = 0 +\n (additionalPrice[priceCode].adjustments[adCode] || 0) + adValue;\n });\n });\n });\n\n if (_.isEmpty(additionalPrice)) {\n this.cache.displayPrices = utils.deepClone(this.options.prices);\n } else {\n _.each(additionalPrice, function (option, priceCode) {\n origin = this.options.prices[priceCode] || {};\n finalPrice = prices[priceCode] || {};\n option.amount = option.amount || 0;\n origin.amount = origin.amount || 0;\n origin.adjustments = origin.adjustments || {};\n finalPrice.adjustments = finalPrice.adjustments || {};\n\n finalPrice.amount = 0 + origin.amount + option.amount;\n _.each(option.adjustments, function (pa, paCode) {\n finalPrice.adjustments[paCode] = 0 + (origin.adjustments[paCode] || 0) + pa;\n });\n }, this);\n }\n\n this.element.trigger('reloadPrice');\n },\n\n /*eslint-disable no-extra-parens*/\n /**\n * Re
2nder price unit block.\n */\n reloadPrice: function reDrawPrices() {\n var priceFormat = (this.options.priceConfig && this.options.priceConfig.priceFormat) || {},\n priceTemplate = mageTemplate(this.options.priceTemplate);\n\n _.each(this.cache.displayPrices, function (price, priceCode) {\n price.final = _.reduce(price.adjustments, function (memo, amount) {\n return memo + amount;\n }, price.amount);\n\n price.formatted = utils.formatPrice(price.final, priceFormat);\n\n $('[data-price-type=\"' + priceCode + '\"]', this.element).html(priceTemplate({\n data: price\n }));\n }, this);\n },\n\n /*eslint-enable no-extra-parens*/\n /**\n * Overwrites initial (default) prices object.\n * @param {Object} prices\n */\n setDefault: function setDefaultPrices(prices) {\n this.cache.displayPrices = utils.deepClone(prices);\n this.options.prices = utils.deepClone(prices);\n },\n\n /**\n * Custom behavior on getting options:\n * now widget able to deep merge of accepted configuration.\n * @param {Object} options\n * @return {mage.priceBox}\n */\n _setOptions: function setOptions(options) {\n $.extend(true, this.options, options);\n\n if ('disabled' in options) {\n this._setOption('disabled', options.disabled);\n }\n\n return this;\n },\n\n /**\n * setDefaultsFromDataSet\n */\n _setDefaultsFromDataSet: function _setDefaultsFromDataSet() {\n var box = this.element,\n priceHolders = $('[data-price-type]', box),\n prices = this.options.prices;\n\n this.options.productId = box.data('productId');\n\n if (_.isEmpty(prices)) {\n priceHolders.each(function (index, element) {\n var type = $(element).data('priceType'),\n amount = parseFloat($(element).data('priceAmount'));\n\n if (type && !_.isNaN(amount)) {\n prices[type] = {\n amount: amount\n };\n }\n });\n }\n },\n\n /**\n * setDefaultsFromPriceConfig\n */\n _setDefaultsFromPriceConfig: function _setDefaultsFromPriceConfig() {\n var config = this.options.priceConfig;\n\n if (config && config.prices) {\n this.options.prices = config.prices;\n }\n }\n });\n\n return $.mage.priceBox;\n});\n","Threepartment_Debitpayment/js/iban.js":"(function (root, factory) {\n if (typeof define === 'function' && define.amd) {\n // AMD. Register as an anonymous module.\n define(['exports'], factory);\n } else if (typeof exports === 'object' && typeof exports.nodeName !== 'string') {\n // CommonJS\n factory(exports);\n } else {\n // Browser globals\n factory(root.IBAN = {});\n }\n}(this, function(exports){\n\n // Array.prototype.map polyfill\n // code from https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Array/map\n if (!Array.prototype.map){\n Array.prototype.map = function(fun /*, thisArg */){\n \"use strict\";\n\n if (this === void 0 || this === null)\n throw new TypeError();\n\n var t = Object(this);\n var len = t.length >>> 0;\n if (typeof fun !== \"function\")\n throw new TypeError();\n\n var res = new Array(len);\n var thisArg = arguments.length >= 2 ? arguments[1] : void 0;\n for (var i = 0; i < len; i++)\n {\n // NOTE: Absolute correctness would demand Object.defineProperty\n // be used. But this method is fairly new, and failure is\n // possible only if Object.prototype or Array.prototype\n // has a property |i| (very unlikely), so use a less-correct\n // but more portable alternative.\n if (i in t)\n res[i] = fun.call(thisArg, t[i], i, t);\n }\n\n return res;\n };\n }\n\n var A = 'A'.charCodeAt(0),\n Z = 'Z'.charCodeAt(0);
2\n\n /**\n * Prepare an IBAN for mod 97 computation by moving the first 4 chars to the end and transforming the letters to\n * numbers (A = 10, B = 11, ..., Z = 35), as specified in ISO13616.\n *\n * @param {string} iban the IBAN\n * @returns {string} the prepared IBAN\n */\n function iso13616Prepare(iban) {\n iban = iban.toUpperCase();\n iban = iban.substr(4) + iban.substr(0,4);\n\n return iban.split('').map(function(n){\n var code = n.charCodeAt(0);\n if (code >= A && code <= Z){\n // A = 10, B = 11, ... Z = 35\n return code - A + 10;\n } else {\n return n;\n }\n }).join('');\n }\n\n /**\n * Calculates the MOD 97 10 of the passed IBAN as specified in ISO7064.\n *\n * @param iban\n * @returns {number}\n */\n function iso7064Mod97_10(iban) {\n var remainder = iban,\n block;\n\n while (remainder.length > 2){\n block = remainder.slice(0, 9);\n remainder = parseInt(block, 10) % 97 + remainder.slice(block.length);\n }\n\n return parseInt(remainder, 10) % 97;\n }\n\n /**\n * Parse the BBAN structure used to configure each IBAN Specification and returns a matching regular expression.\n * A structure is composed of blocks of 3 characters (one letter and 2 digits). Each block represents\n * a logical group in the typical representation of the BBAN. For each group, the letter indicates which characters\n * are allowed in this group and the following 2-digits number tells the length of the group.\n *\n * @param {string} structure the structure to parse\n * @returns {RegExp}\n */\n function parseStructure(structure){\n // split in blocks of 3 chars\n var regex = structure.match(/(.{3})/g).map(function(block){\n\n // parse each structure block (1-char + 2-digits)\n var format,\n pattern = block.slice(0, 1),\n repeats = parseInt(block.slice(1), 10);\n\n switch (pattern){\n case \"A\": format = \"0-9A-Za-z\"; break;\n case \"B\": format = \"0-9A-Z\"; break;\n case \"C\": format = \"A-Za-z\"; break;\n case \"F\": format = \"0-9\"; break;\n case \"L\": format = \"a-z\"; break;\n case \"U\": format = \"A-Z\"; break;\n case \"W\": format = \"0-9a-z\"; break;\n }\n\n return '([' + format + ']{' + repeats + '})';\n });\n\n return new RegExp('^' + regex.join('') + '$');\n }\n\n /**\n *\n * @param iban\n * @returns {string}\n */\n function electronicFormat(iban){\n return iban.replace(NON_ALPHANUM, '').toUpperCase();\n }\n\n\n /**\n * Create a new Specification for a valid IBAN number.\n *\n * @param countryCode the code of the country\n * @param length the length of the IBAN\n * @param structure the structure of the underlying BBAN (for validation and formatting)\n * @param example an example valid IBAN\n * @constructor\n */\n function Specification(countryCode, length, structure, example){\n\n this.countryCode = countryCode;\n this.length = length;\n this.structure = structure;\n this.example = example;\n }\n\n /**\n * Lazy-loaded regex (parse the structure and construct the regular expression the first time we need it for validation)\n */\n Specification.prototype._regex = function(){\n return this._cachedRegex || (this._cachedRegex = parseStructure(this.structure))\n };\n\n /**\n * Check if the passed iban is valid according to this specification.\n *\n * @param {String} iban the iban to validate\n * @returns {boolean} true if valid, false otherwise\n */\n Specification.prototype.isValid = function(iban){\n return this.length == iban.length\n && this.countryCode === iban.slice(0,2)\n && this._regex().test(iban.slice(4))\n && iso7064Mod97_10(iso13616Prepare(iban)) == 1;\n };\n\n /**\n * Convert the passed IBAN to a country-specific BBAN.\n *\n * @param iban the IBAN to convert\n * @param separator the separator to use between BBAN blocks\n * @returns {string} the BBAN\n */\n Specification.prototype.toBBAN = function(iban, separator) {\n return this._regex().exec(iban.slice(4)).slice(1).join(separator);\n };\n\n /**\n * Convert the passed BBAN to an IBAN for this country specification.\n * Please note that <i>\"generation of the IBAN shall be the exclusive responsibility of the bank/branch servicing the account\"</i>.\n * This method implements the preferred algorithm described
2in http://en.wikipedia.org/wiki/International_Bank_Account_Number#Generating_IBAN_check_digits\n *\n * @param bban the BBAN to convert to IBAN\n * @returns {string} the IBAN\n */\n Specification.prototype.fromBBAN = function(bban) {\n if (!this.isValidBBAN(bban)){\n throw new Error('Invalid BBAN');\n }\n\n var remainder = iso7064Mod97_10(iso13616Prepare(this.countryCode + '00' + bban)),\n checkDigit = ('0' + (98 - remainder)).slice(-2);\n\n return this.countryCode + checkDigit + bban;\n };\n\n /**\n * Check of the passed BBAN is valid.\n * This function only checks the format of the BBAN (length and matching the letetr/number specs) but does not\n * verify the check digit.\n *\n * @param bban the BBAN to validate\n * @returns {boolean} true if the passed bban is a valid BBAN according to this specification, false otherwise\n */\n Specification.prototype.isValidBBAN = function(bban) {\n return this.length - 4 == bban.length\n && this._regex().test(bban);\n };\n\n var countries = {};\n\n function addSpecification(IBAN){\n countries[IBAN.countryCode] = IBAN;\n }\n\n addSpecification(new Specification(\"AD\", 24, \"F04F04A12\", \"AD1200012030200359100100\"));\n addSpecification(new Specification(\"AE\", 23, \"F03F16\", \"AE070331234567890123456\"));\n addSpecification(new Specification(\"AL\", 28, \"F08A16\", \"AL47212110090000000235698741\"));\n addSpecification(new Specification(\"AT\", 20, \"F05F11\", \"AT611904300234573201\"));\n addSpecification(new Specification(\"AZ\", 28, \"U04A20\", \"AZ21NABZ00000000137010001944\"));\n addSpecification(new Specification(\"BA\", 20, \"F03F03F08F02\", \"BA391290079401028494\"));\n addSpecification(new Specification(\"BE\", 16, \"F03F07F02\", \"BE68539007547034\"));\n addSpecification(new Specification(\"BG\", 22, \"U04F04F02A08\", \"BG80BNBG96611020345678\"));\n addSpecification(new Specification(\"BH\", 22, \"U04A14\", \"BH67BMAG00001299123456\"));\n addSpecification(new Specification(\"BR\", 29, \"F08F05F10U01A01\", \"BR9700360305000010009795493P1\"));\n addSpecification(new Specification(\"CH\", 21, \"F05A12\", \"CH9300762011623852957\"));\n addSpecification(new Specification(\"CR\", 22, \"F04F14\", \"CR72012300000171549015\"));\n addSpecification(new Specification(\"CY\", 28, \"F03F05A16\", \"CY17002001280000001200527600\"));\n addSpecification(new Specification(\"CZ\", 24, \"F04F06F10\", \"CZ6508000000192000145399\"));\n addSpecification(new Specification(\"DE\", 22, \"F08F10\", \"DE89370400440532013000\"));\n addSpecification(new Specification(\"DK\", 18, \"F04F09F01\", \"DK5000400440116243\"));\n addSpecification(new Specification(\"DO\", 28, \"U04F20\", \"DO28BAGR00000001212453611324\"));\n addSpecification(new Specification(\"EE\", 20, \"F02F02F11F01\", \"EE382200221020145685\"));\n addSpecification(new Specification(\"ES\", 24, \"F04F04F01F01F10\", \"ES9121000418450200051332\"));\n addSpecification(new Specification(\"FI\", 18, \"F06F07F01\", \"FI2112345600000785\"));\n addSpecification(new Specification(\"FO\", 18, \"F04F09F01\", \"FO6264600001631634\"));\n addSpecification(new Specification(\"FR\", 27, \"F05F05A11F02\", \"FR1420041010050500013M02606\"));\n addSpecification(new Specification(\"GB\", 22, \"U04F06F08\", \"GB29NWBK60161331926819\"));\n addSpecification(new Specification(\"GE\", 22, \"U02F16\", \"GE29NB0000000101904917\"));\n addSpecification(new Specification(\"GI\", 23, \"U04A15\", \"GI75NWBK000000007099453\"));\n addSpecification(new Specification(\"GL\", 18, \"F04F09F01\", \"GL8964710001000206\"));\n addSpecification(new Specification(\"GR\", 27, \"F03F04A16\", \"GR1601101250000000012300695\"));\n addSpecification(new Specification(\"GT\", 28, \"A04A20\", \"GT82TRAJ01020000001210029690\"));\n addSpecification(new Specification(\"HR\", 21, \"F07F10\", \"HR1210010051863000160\"));\n addSpecification(new Specification(\"HU\", 28, \"F03F04F01F15F01\", \"HU42117730161111101800000000\"));\n addSpecification(new Specification(\"IE\", 22, \"U04F06F08\", \"IE29AIBK93115212345678\"));\n addSpecification(new Specification(\"IL\", 23, \"F03F03F13\", \"IL620108000000099999999\"));\n addSpecification(new Specification(\"IS\", 26, \"F04F02F06F10\", \"IS140159260076545510730339\"));\n addSpecification(new Specification(\"IT\", 27, \"U01F05F05A12\", \"IT60X0542811101000000123456\"));\n addSpecification(new Specification(\"KW\", 30, \"U04A22\", \"KW81CBKU0000000000001234560101\"));\n addSpecification(new Specification(\"KZ\", 20, \"F03A13\", \"KZ86125KZT5004100100\"));\n addSpecification(new Specification(\"LB\", 28, \"F04A20\", \"LB62099900000001001901229114\"));\n addSpecification(new Specification(\"LC\", 32, \"U04F24\", \"LC07HEMM000100010012001200013015\"));\n addSpecification(new Specification(\"LI\", 21, \"F05A12\", \"LI21088100002324013AA\"));\n addSpecification(new Specification(\"LT\", 20, \"F05F11\", \"LT121000011101001000\"));\n addSpecification(new Specification(\"LU\", 20, \"F03A13\", \"LU280019400644750000\"));\n addSpecification(new Specification(\"LV\", 21, \"U04A13\", \"LV80BANK0000435195001\"));\n addSpecification(new Specification(\"MC\", 27, \"F05F05A11F02\", \"MC5811222000010123456789030\"));\n addSpecification(new Specification(\"MD\", 24, \"U02A18\", \"MD24AG000225100013104168\"));\n addSpecification(new Specification(\"ME\", 22, \"F03F13F02\", \"ME25505000012345678951\"));\n addSpecification(new Specification(\"MK\", 19, \"F03A10F02\", \"MK07250120000058984\"));\n addSpecification(new Specification(\"MR\", 27, \"F05F05F11F02\", \"MR1300020001010000123456753\"));\n addSpecification(new Specification(\"MT\", 31, \"U04F05A18\", \"MT84MALT011000012345MTLCAST001S\"));\n addSpecification(new Specification(\"MU\", 30, \"U04F02F02F12F03U03\", \"MU17BOMM0101101030300200000MUR\"));\n addSpecification(new Specification(\"NL\", 18, \"U04F10\", \"NL91ABNA0417164300\"));
2\n addSpecification(new Specification(\"NO\", 15, \"F04F06F01\", \"NO9386011117947\"));\n addSpecification(new Specification(\"PK\", 24, \"U04A16\", \"PK36SCBL0000001123456702\"));\n addSpecification(new Specification(\"PL\", 28, \"F08F16\", \"PL61109010140000071219812874\"));\n addSpecification(new Specification(\"PS\", 29, \"U04A21\", \"PS92PALS000000000400123456702\"));\n addSpecification(new Specification(\"PT\", 25, \"F04F04F11F02\", \"PT50000201231234567890154\"));\n addSpecification(new Specification(\"RO\", 24, \"U04A16\", \"RO49AAAA1B31007593840000\"));\n addSpecification(new Specification(\"RS\", 22, \"F03F13F02\", \"RS35260005601001611379\"));\n addSpecification(new Specification(\"SA\", 24, \"F02A18\", \"SA0380000000608010167519\"));\n addSpecification(new Specification(\"SE\", 24, \"F03F16F01\", \"SE4550000000058398257466\"));\n addSpecification(new Specification(\"SI\", 19, \"F05F08F02\", \"SI56263300012039086\"));\n addSpecification(new Specification(\"SK\", 24, \"F04F06F10\", \"SK3112000000198742637541\"));\n addSpecification(new Specification(\"SM\", 27, \"U01F05F05A12\", \"SM86U0322509800000000270100\"));\n addSpecification(new Specification(\"ST\", 25, \"F08F11F02\", \"ST68000100010051845310112\"));\n addSpecification(new Specification(\"TL\", 23, \"F03F14F02\", \"TL380080012345678910157\"));\n addSpecification(new Specification(\"TN\", 24, \"F02F03F13F02\", \"TN5910006035183598478831\"));\n addSpecification(new Specification(\"TR\", 26, \"F05F01A16\", \"TR330006100519786457841326\"));\n addSpecification(new Specification(\"VG\", 24, \"U04F16\", \"VG96VPVG0000012345678901\"));\n addSpecification(new Specification(\"XK\", 20, \"F04F10F02\", \"XK051212012345678906\"));\n\n // Angola\n addSpecification(new Specification(\"AO\", 25, \"F21\", \"AO69123456789012345678901\"));\n // Burkina\n addSpecification(new Specification(\"BF\", 27, \"F23\", \"BF2312345678901234567890123\"));\n // Burundi\n addSpecification(new Specification(\"BI\", 16, \"F12\", \"BI41123456789012\"));\n // Benin\n addSpecification(new Specification(\"BJ\", 28, \"F24\", \"BJ39123456789012345678901234\"));\n // Ivory\n addSpecification(new Specification(\"CI\", 28, \"U01F23\", \"CI17A12345678901234567890123\"));\n // Cameron\n addSpecification(new Specification(\"CM\", 27, \"F23\", \"CM9012345678901234567890123\"));\n // Cape Verde\n addSpecification(new Specification(\"CV\", 25, \"F21\", \"CV30123456789012345678901\"));\n // Algeria\n addSpecification(new Specification(\"DZ\", 24, \"F20\", \"DZ8612345678901234567890\"));\n // Iran\n addSpecification(new Specification(\"IR\", 26, \"F22\", \"IR861234568790123456789012\"));\n // Jordan\n addSpecification(new Specification(\"JO\", 30, \"A04F22\", \"JO15AAAA1234567890123456789012\"));\n // Madagascar\n addSpecification(new Specification(\"MG\", 27, \"F23\", \"MG1812345678901234567890123\"));\n // Mali\n addSpecification(new Specification(\"ML\", 28, \"U01F23\", \"ML15A12345678901234567890123\"));\n // Mozambique\n addSpecification(new Specification(\"MZ\", 25, \"F21\", \"MZ25123456789012345678901\"));\n // Quatar\n addSpecification(new Specification(\"QA\", 29, \"U04A21\", \"QA30AAAA123456789012345678901\"));\n // Senegal\n addSpecification(new Specification(\"SN\", 28, \"U01F23\", \"SN52A12345678901234567890123\"));\n // Ukraine\n addSpecification(new Specification(\"UA\", 29, \"F25\", \"UA511234567890123456789012345\"));\n\n var NON_ALPHANUM = /[^a-zA-Z0-9]/g,\n EVERY_FOUR_CHARS =/(.{4})(?!$)/g;\n\n /**\n * Utility function to check if a variable is a String.\n *\n * @param v\n * @returns {boolean} true if the passed variable is a String, false otherwise.\n */\n function isString(v){\n return (typeof v == 'string' || v instanceof String);\n }
2\n\n /**\n * Check if an IBAN is valid.\n *\n * @param {String} iban the IBAN to validate.\n * @returns {boolean} true if the passed IBAN is valid, false otherwise\n */\n exports.isValid = function(iban){\n if (!isString(iban)){\n return false;\n }\n iban = electronicFormat(iban);\n var countryStructure = countries[iban.slice(0,2)];\n return !!countryStructure && countryStructure.isValid(iban);\n };\n\n /**\n * Convert an IBAN to a BBAN.\n *\n * @param iban\n * @param {String} [separator] the separator to use between the blocks of the BBAN, defaults to ' '\n * @returns {string|*}\n */\n exports.toBBAN = function(iban, separator){\n if (typeof separator == 'undefined'){\n separator = ' ';\n }\n iban = electronicFormat(iban);\n var countryStructure = countries[iban.slice(0,2)];\n if (!countryStructure) {\n throw new Error('No country with code ' + iban.slice(0,2));\n }\n return countryStructure.toBBAN(iban, separator);\n };\n\n /**\n * Convert the passed BBAN to an IBAN for this country specification.\n * Please note that <i>\"generation of the IBAN shall be the exclusive responsibility of the bank/branch servicing the account\"</i>.\n * This method implements the preferred algorithm described in http://en.wikipedia.org/wiki/International_Bank_Account_Number#Generating_IBAN_check_digits\n *\n * @param countryCode the country of the BBAN\n * @param bban the BBAN to convert to IBAN\n * @returns {string} the IBAN\n */\n exports.fromBBAN = function(countryCode, bban){\n var countryStructure = countries[countryCode];\n if (!countryStructure) {\n throw new Error('No country with code ' + countryCode);\n }\n return countryStructure.fromBBAN(electronicFormat(bban));\n };\n\n /**\n * Check the validity of the passed BBAN.\n *\n * @param countryCode the country of the BBAN\n * @param bban the BBAN to check the validity of\n */\n exports.isValidBBAN = function(countryCode, bban){\n if (!isString(bban)){\n return false;\n }\n var countryStructure = countries[countryCode];\n return countryStructure && countryStructure.isValidBBAN(electronicFormat(bban));\n };\n\n /**\n *\n * @param iban\n * @param separator\n * @returns {string}\n */\n exports.printFormat = function(iban, separator){\n if (typeof separator == 'undefined'){\n separator = ' ';\n }\n return electronicFormat(iban).replace(EVERY_FOUR_CHARS, \"$1\" + separator);\n };\n\n exports.electronicFormat = electronicFormat;\n /**\n * An object containing all the known IBAN specifications.\n */\n exports.countries = countries;\n\n}));\n","Threepartment_Debitpayment/js/view/payment/debitpayment-payments.js":"define(\n [\n 'uiComponent',\n 'Magento_Checkout/js/model/payment/renderer-list'\n ],\n function (\n Component,\n rendererList\n ) {\n 'use strict';\n rendererList.push(\n {\n type: 'debitpayment',\n component: 'Threepartment_Debitpayment/js/view/payment/method-renderer/debitpayment-method'\n }\n );\n return Component.extend({});\n }\n);","Threepartment_Debitpayment/js/view/payment/method-renderer/debitpayment-method.js":"define(\n [\n\t\t'ko',\n\t\t'iban',\n 'Magento_Checkout/js/view/payment/default',\n ],\n function (ko,IBAN,Component) {\n 'use strict';\n return Component.extend({\n defaults: {\n template: 'Threepartment_Debitpayment/payment/debitpayment',\n },\n\t\t\t\n\t\t\tgetInstructions: function () {\n return window.checkoutConfig.payment.instructions[this.item.method];\n },\n\t\t\tgetRemoteURL: function (){\n\t\t\t\treturn window.checkoutConfig.payment.remoteURL[this.item.method];\n\t\t\t},\n\t\t\tgetCheckbox: function (){\n\t\t\t\tif(window.checkoutConfig.payment.checkbox.debitpayment!=\"\"){\n\t\t\t\t\tif(window.checkoutConfig.payment.checkbox.debitpayment==\"1\"){\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}else{\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t}else return false;\n\t\t\t},\n\t\t\tgetMoreInfo: function (){\n\t\t\t\treturn window.checkoutConfig.payment.moreinfo[this.item.method];\n\t\t\t},\n\t\t\tgetCheckboxText: function (){\n\t\t\t\treturn window.checkoutConfig.payment.checkboxtext[this.item.method];\n\t\t\t},\n\t\t\tgetAutoPopulate: function (){\n\t\t\t\treturn window.checkoutConfig.payment.autopopulate[this.item.method];\n\t\t\t},\n\t\t\tgetCustomerAccountName: function (){\n\t\t\t \treturn window.checkoutConfig.payment.customerAccountName[this.item.method];\n\t\t\t},\n\t\t\tgetCustomerIban: function (){\n\t\t\t\treturn window.checkoutConfig.payment.customerIban[this.item.method];\n\t\t\t},\n\t\t\tgetCustomerBic: function (){\n\t\t\t\treturn window.checkoutConfig.payment.customerBic[this.item.method];\n\t\t\t},\n\t\t\tgetCustomerBankName: function (){\n\t\t\t\treturn window.checkoutConfig.payment.customerBankName[this.item.method];\n\t\t\t},\n\t\t\tidFieldDisable: function () {\n\t\t\t\tif(window.checkoutConfig.payment.customerIban[this.item.method] != ''){\n\t\t\t\t\treturn false;\n\t\t\t\t} else {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t},\t\t\t\n\t\t\tgetData: function () {\n return {\n\t\t\t\t\t'method': this.item.method,\n\t\t\t\t\t'additional_data': {\n\t\t\t\t\t\t'bank_account_owner': jQuery('#bankaccountowner').val(),\n\t\t\t\t\t\t'iban': jQuery('#iban').val(),\n\t\t\t\t\t\t'bic': jQuery('#bic').val(),\n\t\t\t\t\t\t'bank_company': jQuery('#bankcompany').val()\n\t\t\t\t\t}\n };\n\t\t\t},\n\t\t\tdisplayValidateButton:function(){\n\t\t\t\tif(window.checkoutConfig.payment.autopopulate.debitpayment!=\"\"){\n\t\t\t\t\tif(window.checkoutConfig.payment.autopopulate.debitpayment==\"1\"){\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}else{\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\t/**\n\t * Removed the form validation of bank details from the checkout page\
2n\t * Updated by PS, dated on 14th Sept 19, see Trello - https://trello.com/c/ZPFJSl9U/88-function-payment-prepayment-direct-debit-paypal#action-5d7b5f710a259c2e2619cf7a\n\t */\n\t\t\t// validate: function() {\n\t\t\t// \tvar erred = false;\n\t\t\t// \tjQuery('#'+this.item.method+'-form input').each(function(i,v){\n\t\t\t// \t\tif(jQuery(v).val()==''){\n\t\t\t// \t\t\tjQuery(this).parents('div.field').addClass('_error');\n\t\t\t// \t\t\terred = true;\n\t\t\t// \t\t\tjQuery(this).next('div').show();\n\t\t\t// \t\t}else{\n\t\t\t// \t\t\tjQuery(this).parents('div.field').removeClass('_error');\n\t\t\t// \t\t\tjQuery(this).next('div').hide();\n\t\t\t// \t\t}\n\t\t\t\t\t\n\t\t\t// \t\tif(!IBAN.isValid(jQuery('#iban').val())){\n\t\t\t// \t\t\terred=true;\t\n\t\t\t// \t\t\tjQuery('#iban').parents('div.field').addClass('_error');\n\t\t\t// \t\t\tjQuery('#iban-error').show();\n\t\t\t// \t\t}else{\n\t\t\t// \t\t\tjQuery('#iban').parents('div.field').removeClass('_error');\t\n\t\t\t// \t\t\tjQuery('#iban-error').hide();\n\t\t\t// \t\t}\n\t\t\t\t\t\n\t\t\t// \t});\n\t\t\t// \tif(window.checkoutConfig.payment.checkbox[this.item.method]=='1'){\n\t\t\t// \t\tif(!jQuery('#required-checkbox').is(':checked')){\n\t\t\t// \t\t\tjQuery('#required-checkbox').parents('div.field').addClass('_error');\n\t\t\t// \t\t\tjQuery('#required-checkbox-err').show();\n\t\t\t// \t\t\terred = true;\n\t\t\t// \t\t}else{\n\t\t\t// \t\t\tjQuery('#required-checkbox').parents('div.field').removeClass('_error');\n\t\t\t// \t\t\tjQuery('#required-checkbox-err').hide();\t\n\t\t\t// \t\t\terred = false;\n\t\t\t// \t\t}\n\t\t\t// \t}\n\t\t\t// \tif(erred){ return false }else {return true};\n // }\n });\t\n }\n);\n//Retrieve BIC and Bank Name from IBAN\njQuery(document).ready(function(){\n\tfunction showErrorMessage(){\n\t\tjQuery('#iban').parents('div.field').addClass('_error');\n\t\tjQuery('#iban-error').show();\n\t}\n\tjQuery('form').on('click','#validate-iban-btn', function(e){\n\t\te.preventDefault();\n\t\tjQuery('#iban-error').hide();\n\t\tvar url = jQuery(this).attr('data-remote-url');\n\t\tvar iban = jQuery('#iban').val();\n\t\tjQuery('#bic').val('');\n\t\tjQuery('#bankcompany').val('');\n\t\tif(url!=\"\" && iban!=\"\"){\n\t\t\turl+=iban+\"?getBIC=true&validateBankCode=true\";\n\t\t\tjQuery.getJSON( url, function( data ) {\n\t\t\t\tif(data.valid){\n\t\t\t\t\tjQuery('#bic').val(data.bankData.bic);\n\t\t\t\t\tjQuery('#bankcompany').val(data.bankData.name);\n\t\t\t\t}else{\n\t\t\t\t\tshowErrorMessage();\n\t\t\t\t}\n\t\t\t}).fail(function(){showErrorMessage();});\n\t\t}\n\n\t});\n\t\n\t\n});\n","Magento_Multishipping/js/payment.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\ndefine([\n 'jquery',\n 'mage/template',\n 'Magento_Ui/js/modal/alert',\n 'jquery-ui-modules/widget',\n 'mage/translate'\n], function ($, mageTemplate, alert) {\n 'use strict';\n\n $.widget('mage.payment', {\n options: {\n continueSelector: '#payment-continue',\n methodsContainer: '#payment-methods',\n minBalance: 0,\n tmpl: '<input id=\"hidden-free\" type=\"hidden\" name=\"payment[method]\" value=\"free\">'\n },\n\n /** @inheritdoc */\n _create: function () {\n this.element.find('dd [name^=\"payment[\"]').prop('disabled', true).end()\n .on('click', this.options.continueSelector, $.proxy(this._submitHandler, this))\n .on('updateCheckoutPrice', $.proxy(function (event, data) {\n //updating the checkoutPrice\n if (data.price) {\n this.options.checkoutPrice += data.price;\n }\n\n //updating total price\n if (data.totalPrice) {\n data.totalPrice = this.options.checkoutPrice;\n }\n\n if (this.options.checkoutPrice <= this.options.minBalance) {\n // Add free input field, hide and disable unchecked\n // checkbox payment method and all radio button payment methods\n this._disablePaymentMethods();\n } else {\n // Remove free input field, show all payment method\n this._enablePaymentMethods();\n }\n }, this))\n .on('click', 'dt input:radio', $.proxy(this._paymentMethodHandler, this));\n\n if (this.options.checkoutPrice < this.options.minBalance) {\n this._disablePaymentMethods();\n } else {\n this._enablePaymentMethods();\n }\n }
2,\n\n /**\n * Display payment details when payment method radio button is checked\n * @private\n * @param {EventObject} e\n */\n _paymentMethodHandler: function (e) {\n var element = $(e.target),\n parentsDl = element.closest('dl');\n\n parentsDl.find('dt input:radio').prop('checked', false);\n parentsDl.find('dd').addClass('no-display').end()\n .find('.items').hide()\n .find('[name^=\"payment[\"]').prop('disabled', true);\n element.prop('checked', true).parent()\n .next('dd').removeClass('no-display')\n .find('.items').show().find('[name^=\"payment[\"]').prop('disabled', false);\n },\n\n /**\n * make sure one payment method is selected\n * @private\n * @return {Boolean}\n */\n _validatePaymentMethod: function () {\n var methods = this.element.find('[name^=\"payment[\"]'),\n isValid = false;\n\n if (methods.length === 0) {\n alert({\n content: $.mage.__('We can\\'t complete your order because you don\\'t have a payment method set up.')\n });\n } else if (this.options.checkoutPrice <= this.options.minBalance) {\n isValid = true;\n } else if (methods.filter('input:radio:checked').length) {\n isValid = true;\n } else {\n alert({\n content: $.mage.__('Please choose a payment method.')\n });\n }\n\n return isValid;\n },\n\n /**\n * Disable and enable payment methods\n * @private\n */\n _disablePaymentMethods: function () {\n var tmpl = mageTemplate(this.options.tmpl, {\n data: {}\n });\n\n this.element.find('input[name=\"payment[method]\"]').prop('disabled', true).end()\n .find('input[id^=\"use\"][name^=\"payment[use\"]:not(:checked)').prop('disabled', true).parent().hide();\n this.element.find('[name=\"payment[method]\"][value=\"free\"]').parent('dt').remove();\n this.element.find(this.options.methodsContainer).hide().find('[name^=\"payment[\"]').prop('disabled', true);\n\n $(tmpl).appendTo(this.element);\n },\n\n /**\n * Enable and enable payment methods\n * @private\n */\n _enablePaymentMethods: function () {\n this.element.find('input[name=\"payment[method]\"]').prop('disabled', false).end()\n .find('dt input:radio:checked').trigger('click').end()\n .find('input[id^=\"use\"][name^=\"payment[use\"]:not(:checked)').prop('disabled', false).parent().show();\n this.element.find(this.options.methodsContainer).show();\n },\n\n /**\n * Returns checked payment method.\n *\n * @private\n */\n _getSelectedPaymentMethod: function () {\n return this.element.find('input[name=\\'payment[method]\\']:checked');\n },\n\n /**\n * Validate before form submit\n * @private\n * @param {EventObject} e\n */\n _submitHandler: function (e) {\n var currentMethod,\n submitButton;\n\n e.preventDefault();\n\n if (this._validatePaymentMethod()) {\n currentMethod = this._getSelectedPaymentMethod();\n submitButton = currentMethod.parent().next('dd').find('button[type=submit]');\n\n if (submitButton.length) {\n submitButton.first().trigger('click');\n } else {\n this.element.trigger('submit');\n }\n }\n }\n });\n\n return $.mage.payment;\n});\n","Magento_Multishipping/js/multi-shipping.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\ndefine([\n 'jquery',\n 'Magento_Customer/js/customer-data',\n 'jquery-ui-modules/widget'\n], function ($, customerData) {\n 'use strict';\n\n $.widget('mage.multiShipping', {\n options: {\n itemsQty: 0,\n addNewAddressBtn: 'button[data-role=\"add-new-address\"]', // Add a new multishipping address.\n addNewAddressFlag: '#add_new_address_flag', // Hidden input field with value 0 or 1.\n canContinueBtn: 'button[data-role=\"can-continue\"]', // Continue (update quantity or go to shipping).\n canContinueFlag: '#can_continue_flag' // Hidden input field with value 0 or 1.\n },\n\n /**\n * Bind event handlers to click events for corresponding buttons.\n * @private\n */\n _create: function () {\n this._prepareCartData();\n $(this.options.addNewAddressBtn).on('click', $.proxy(this._addNewAddress, this));\n $(this.options.canContinueBtn).on('click', $.proxy(this._canContinue, this));\n },\n\n /**\n * Takes cart items qty from current cart data and compare it with current items qty\n * Reloads cart data if cart items qty is wrong\n * @private\n */\n _prepareCartData: function () {\n var cartData = customerData.get('cart');\n\n if (cartData()['summary_count'] !== this.options.itemsQty) {\n customerData.reload(['cart'], false);\n }\n },\n\n /**\n * Add a new address. Set the hidden input field and submit the form. Then enter a new shipping address.\n * @private\n */\n _addNewAddress: function () {\n $(this.options.addNewAddressFlag).val(1);\n this.element.submit();\n },\n\n /**\n * Can the user continue to the next step? The data-flag attribute holds either 0 (no) or 1 (yes).\n * @private\n * @param {Event} event - Click event on the corresponding button.\n */\n _canContinue: function (event) {\n $(this.options.canContinueFlag).val(parseInt($(event.currentTarget).data('flag'), 10));\n }\n });\n\n return $.mage.multiShipping;\n});\n","Magento_Multishipping/js/overview.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\ndefine([\n 'jquery',\n 'jquery-ui-modules/widget',\n 'mage/translate'\n], function ($) {\n 'use strict';\n\n $.widget('mage.orderOverview', {\n options: {\n opacity: 0.5, // CSS opacity for the 'Place Order' button when it's clicked and then disabled.\n pleaseWaitLoader: 'span.please-wait', // 'Submitting order information...' Ajax loader.\n placeOrderSubmit: 'button[type=\"submit\"]', // The 'Place Order' button.\n agreements: '.checkout-agreements' // Container for all of the checkout agreements and terms/conditions\n },\n\n /**\n * Bind a submit handler to the form.\n * @private\n */\n _create: function () {\n this.element.on('submit', $.proxy(this._showLoader, this));\n },\n\n /**\n * Verify that all agreements and terms/conditions are checked. Show the Ajax loader. Disable\n * the submit button (i.e. Place Order).\n * @return {Boolean}\n * @private\n */\n _showLoader: function () {\n if ($(this.options.agreements).find('input[type=\"checkbox\"]:not(:checked)').length > 0) {\n return false;\n }\n this.element.find(this.options.pleaseWaitLoader).show().end()\n .find(this.options.placeOrderSubmit).prop('disabled', true).css('opacity', this.options.opacity);\n\n return true;\n }\n });\n\n return $.mage.orderOverview;\n});\n","Magento_Multishipping/js/multi-shipping-balance.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\ndefine([\n 'jquery',\n 'mage/dataPost',\n 'jquery-ui-modules/widget'\n], function ($, dataPost) {\n 'use strict';\n\n $.widget('mage.multiShippingBalance', {\n options: {\n changeUrl: ''\n },\n\n /**\n * Initialize balance checkbox events.\n *\n * @private\n */\n _create: function () {\n this.element.on('change', $.proxy(function (event) {\n dataPost(
2).postData({\n action: this.options.changeUrl,\n data: {\n useBalance: +$(event.target).is(':checked')\n }\n });\n }, this));\n }\n });\n\n return $.mage.multiShippingBalance;\n});\n","Wyomind_ElasticsearchAutocomplete/js/form-mini.js":"/**\n * Copyright \u00a9 2018 Wyomind. All rights reserved.\n */\n\nrequireDep = ['jquery', 'underscore', 'mage/template', 'jquery-ui-modules/widget', 'jquery-ui-modules/core', 'mage/translate'];\nif (!compareVersions(MAGE_VERSION, \"2.3.4\")) {\n requireDep = ['jquery', 'underscore', 'mage/template', 'jquery/ui', 'mage/translate'];\n}\n\n/*jshint browser:true jquery:true*/\ndefine(requireDep, function ($, _, mageTemplate) {\n 'use strict';\n\n\n $.widget('mage.wyoea', {\n options: {\n autocomplete: 'off',\n minSearchLength: 1,\n storeCode: '',\n responseFieldElements: 'ul li.qs-option',\n selectClass: 'selected',\n submitBtn: 'button[type=\"submit\"]',\n searchLabel: '[data-role=minisearch-label]',\n searchUrl: '',\n customerGroupId: 0,\n urlUpdateSearchTerm: '',\n debug: false,\n formSelector: ''\n },\n\n /**\n * Elasticsearch requesters cache (contains the results of the requests)\n */\n cache: [],\n\n lastRequestData: \"\",\n\n observersInitialized: false,\n\n /**\n * Are template hints enabled?\n */\n templateHintsEnabled: false,\n\n\n templateSelectors: {\n suggests: '#ea-suggests-template',\n categories: '#ea-category-template',\n cms: '#ea-cms-template',\n products: '#ea-products-template',\n allResults: '#ea-all-results-template'\n },\n contentSelectors: {\n suggests: '#ea-suggests',\n categories: '#ea-categories',\n cms: '#ea-cms',\n products: '#ea-products',\n others: '#ea-others',\n allResults: '#ea-all-results'\n },\n /**\n * Containers phtml references (only for template hints)\n */\n contentTemplateFiles: {\n suggests: \"view/frontend/templates/autocomplete/suggests.phtml\",\n categories: \"view/frontend/templates/autocomplete/categories.phtml\",\n cms: \"view/frontend/templates/autocomplete/cms.phtml\",\n products: \"view/frontend/templates/autocomplete/products.phtml\",\n allResults: \"view/frontend/templates/autocomplete/all-results.phtml\"\n },\n\n isIOS: function () {\n return navigator.userAgent.match(/iPhone|iPod/i);\n },\n\n _create: function () {\n this.initSearchFrom();\n },\n\n getCustomerGroupId: function () {\n let data = $.parseJSON(localStorage.getItem('mage-cache-storage'));\n if (!_.isEmpty(data) && typeof data.customer != \"undefined\" && typeof data.customer.cgi != \"undefined\") {\n return data.customer.cgi;\n } else {\n return 0;\n }\n },\n\n initSearchFrom: function () {\n this.responseList = {\n indexList: null,\n currentIndex: null\n };\n this.autoComplete = $(this.options.destinationSelector);\n this.overlay = $(\".ea-overlay\");\n this.searchForm = $(this.options.formSelector);\n this.submitBtn = this.searchForm.find(this.options.submitBtn)[0];\n this.searchLabel = $(this.options.searchLabel);\n\n _.bindAll(this, '_onKeyDown', '_onPropertyChange');\n\n this.submitBtn.disabled = true;\n\n this.element.attr('autocomplete', this.options.autocomplete);\n\n\n if (!this.observersInitialized) {\n\n this.element.on('blur', $.proxy(function () {\n if (this.doNotBlur) {\n return;\n }\n if (this.searchLabel.hasClass('active')) {\n setTimeout($.proxy(function () {\n this.searchLabel.removeClass('active');\n this._updateAriaHasPopup(false);\n }, this), 250);\n }\n }, this));\n\n this.element.trigger('blur');\n\n this.element.on('focus', $.proxy(function () {\n this.searchLabel.addClass('active');\n }, this));\n this.element.on('keydown', this._onKeyDown);\n this.element.on('input propertychange', this._onPropertyChange);\n\n this.searchForm.on('submit', $.proxy(function () {\n // if (/*'true' === this.element.attr('aria-haspopup') && */null !== this.responseList.currentIndex) {\n // return false;\n // }\n if (this.options.minSearchLength > this.element.val().length) { return false; }\n this._updateAriaHasPopupForceHide();\n }, this));\n\n $(document).on('touchstart', function (evt) {\n var target = $(evt.target);\n if (!target.parents('#ea_search_autocomplete').length) {\n this._updateAriaHasPopupForceHide();\n }\n }.bind(this));\n\n this.initObservers();\n this.observersInitialized = true;\n }\n $(document).trigger('ela-autocomplete-loaded');\n this.element.addClass('loaded');\n\n },\n\n /**\n * Initialize the debug popup observers\n */\n initDebugObservers: function () {\n $(document).on('click', '#ea-debug-enable-template-hints', function () {\n this.toggleTemplateHints(true);\n }.bind(this));\n $(document).on('click', '#ea-debug-disable-template-hints', function () {\n this.toggleTemplateHints(false);\n }.bind(this));\n $(document).on('click', '#ea-debug-show-last-request-data', function () {\n requireDep = ['jquery', 'jquery-ui-modules/dialog', \"elasticsearchcore_jsonview\"];\n if (!compareVersions(MAGE_VERSION, \"2.3.4\")) {\n requireDep = ['jquery', 'jquery/ui', \"elasticsearchcore_jsonview\"];\n }\n require(requireDep, function ($) {\n $(\"#ea-debug-show-last-request-data-modal\").modal({\n \"type\": \"slide\",\n \"title\": \"Last Request Data\",\n \"modalClass\": \"mage-new-category-dialog form-inline\",\n buttons: []\n });\n $(\"#ea-debug-show-last-request-data-modal\").html(\"\");\n $(\"#ea-debug-show-last-request-data-modal\").JSONView(JSON.stringify(this.lastRequestData));\n $(\"#ea-debug-show-last-request-data-modal\").modal(\"openModal\");\n }.bind(this));\n }.bind(this));\n },\n\n doNotBlur: false,\n\n /**\n * Add observers when the window is resized\n */\n initWindowResizeObservers: function () {\n $(window).resize(function () {\n this.doNotBlur = true;\n if (this.element.attr('aria-haspopup') == 'true') {\n this._onPropertyChange();\n }\n }.bind(this));\n\n },\n\n initAutocompleteDisabledObservers: function () {\n\n $(document).on('mouseover', '#ea_search_autocomplete', function () {\n if ($(\"#ea_search_autocomplete\").css(\"opacity\") == 0) {\n $(\"#ea_search_autocomplete\").css({height: \"0p
2x\"});\n }\n\n\n }.bind(this));\n },\n\n /**\n * Init the overlay observers (click on the overlay = hide the autocomplete)\n */\n initOverlayObservers: function () {\n $(document).on('click', \"#ea-overlay\", function () {\n this._updateAriaHasPopup(false);\n }.bind(this));\n },\n\n initObservers: function () {\n this.initDebugObservers();\n this.initAutocompleteDisabledObservers();\n this.initWindowResizeObservers();\n this.initOverlayObservers();\n\n $(document).on('wyo-search-term-updated-finish', function () {\n this.element.removeClass('in-progress');\n }.bind(this));\n\n },\n\n\n /**\n * @private\n * @return {Element} The current element in the suggestion list.\n */\n _current: function () {\n if (this.responseList.currentIndex == -1) {\n return null;\n } else {\n return this.responseList.indexList\n ? $(this.responseList.indexList[this.responseList.currentIndex])\n : null;\n }\n },\n /**\n * @private\n */\n _updateCurrent: function () {\n var selectClass = this.options.selectClass;\n this.responseList.indexList.removeClass(selectClass);\n var current = this._current();\n if (current) {\n current.addClass(selectClass);\n\n\n }\n },\n /**\n * @private\n */\n _previous: function () {\n if (this.responseList.indexList) {\n var currentIndex = this.responseList.currentIndex;\n var listLength = this.responseList.indexList.length;\n if (--currentIndex < 0) {\n currentIndex = listLength - 1;\n }\n this.responseList.currentIndex = currentIndex;\n this._updateCurrent();\n }\n },\n /**\n * @private\n */\n _next: function () {\n if (this.responseList.indexList) {\n var currentIndex = this.responseList.currentIndex;\n var listLength = this.responseList.indexList.length;\n if (null === currentIndex || ++currentIndex >= listLength) {\n currentIndex = 0;\n }\n this.responseList.currentIndex = currentIndex;\n this._updateCurrent();\n }\n },\n /**\n * @private\n */\n _first: function () {\n if (this.responseList.indexList) {\n this.responseList.currentIndex = 0;\n this._updateCurrent();\n }\n },\n /**\n * @private\n */\n _last: function () {\n if (this.responseList.indexList) {\n var listLength = this.responseList.indexList.length;\n this.responseList.currentIndex = listLength - 1;\n this._updateCurrent();\n }\n },\n /**\n * @private\n * @param {Boolean} show Set attribute aria-haspopup to \"true/false\" for element.\n */\n _updateAriaHasPopup: function (show, noResult) {\n if (show) {\n this.element.attr('aria-haspopup', 'true');\n if (typeof noResult != \"undefined\" && noResult === true) {\n $(\"body\").removeClass(\"ea-autocomplete\").addClass(\"ea-no-result\");\n }\n else {\n $(\"body\").removeClass(\"ea-no-result\").addClass(\"ea-autocomplete\");\n }\n } else {\n if (this.isIOS()) {\n this.searchForm.toggleClass('active', true);\n this.searchLabel.toggleClass('active', true);\n this.element.attr('aria-expanded', true);\n return;\n }\n this.element.attr('aria-haspopup', 'false');\n $(\"body\").removeClass(\"ea-autocomplete\").removeClass(\"ea-no-result\");\n\n\n }\n },\n _updateAriaHasPopupForceHide() {\n this.element.attr('aria-haspopup', 'false');\n $(\"body\").removeClass(\"ea-autocomplete\").removeClass(\"ea-no-result\");\n },\n\n /**\n * Clears the item selected from the suggestion list and resets the suggestion list.\n * @private\n */\n _resetResponseList: function () {\n this.responseList.indexList = null;\n this.responseList.currentIndex = null;\n },\n /**\n * Executes when keys are pressed in the search input field. Performs specific actions\n * depending on which keys are pressed.\n * @private\n * @param {Event} e - The key down event\n * @return {Boolean} Default return type for any unhandled keys\n */\n _onKeyDown: function (e) {\n var keyCode = e.keyCode || e.which;\n\n switch (keyCode) {\n case $.ui.keyCode.HOME:\n this._first();\n break;\n case $.ui.keyCode.END:\n this._last(
2);\n break;\n case $.ui.keyCode.ESCAPE:\n break;\n case $.ui.keyCode.ENTER:\n if (this.options.config.product.redirect != 0) {\n let items = this.searchForm.find('.ea-product')\n if (items.length === 1) {\n let link = items.find('a');\n location.href = link[0].href;\n return false;\n }\n }\n var current = this._current();\n if (current) {\n var links = current.find('a');\n if (links.length) {\n location.href = links[0].href;\n this.autoComplete.removeClass();\n }\n } else {\n $(\"body\").removeClass('ea-autocomplete');\n this.searchForm.find('input').attr('aria-haspopup', 'false');\n this.searchForm.trigger('submit');\n return true;\n }\n break;\n case $.ui.keyCode.DOWN:\n this._next();\n break;\n case $.ui.keyCode.UP:\n this._previous();\n break;\n default:\n return true;\n }\n },\n /**\n * Executes when the value of the search input field changes. Executes a GET request\n * to populate a suggestion list based on entered text. Handles click (select), hover,\n * and mouseout events on the populated suggestion list dropdown.\n * @private\n */\n _onPropertyChange: function () {\n\n this.element.addClass('in-progress');\n\n var fullStartTime = Date.now();\n\n var searchField = this.element,\n clonePosition = {\n position: 'absolute',\n // Removed to fix display issues\n // left: searchField.offset().left,\n // top: searchField.offset().top + searchField.outerHeight(),\n width: searchField.outerWidth()\n },\n value = this.element.val();\n\n this.submitBtn.disabled = ((value.length === 0) || (value == null) || /^\\s+$/.test(value));\n\n // if Elasticsearch Layered Navigation auto refresh in search page is enabled => no autocomplete\n if ($('body').hasClass('catalogsearch-result-index') && $('body').hasClass('eln-auto-refresh')) {\n $(document).trigger('wyo-search-term-updated', {'value': value, 'elt': this.element});\n return;\n }\n\n if (value.length >= parseInt(this.options.minSearchLength, 10)) {\n\n\n if (this.xhr != undefined) {\n this.xhr.abort();\n }\n var data = {\n searchTerm: value,\n store: this.options.storeCode,\n eaConfig: this.options.config,\n ea: true,\n customerGroupId: this.getCustomerGroupId(),\n debug: this.options.debug\n };\n\n this.element.parents('form').find('input[name!=q], select').each(function(i,q) {\n data[$(q).attr('name')] = $(q).val();\n });\n\n\n var hash = this.hash(JSON.stringify(data));\n var requestStartTime = Date.now();\n\n if (typeof this.cache[hash] !== \"undefined\") {\n this.updateContent(value, this.cache[hash], fullStartTime, requestStartTime, hash);\n this.element.removeClass('in-progress');\n } else {\n this.xhr = $.ajax({\n url: this.options.url,\n method: \"POST\",\n global: false,\n data: data,\n dataType: \"json\"\n }
2).done(function (data) {\n if (value === this.element.val()) {\n this.updateContent(value, data, fullStartTime, requestStartTime);\n this.cache[hash] = data;\n this.element.removeClass('in-progress');\n }\n }.bind(this));\n }\n } else {\n\n this._updateAriaHasPopup(false);\n this._updateAriaHasPopupForceHide();\n this.element.removeClass('in-progress');\n // this._resetResponseList();\n }\n },\n\n updateContent: function (value, data, fullStartTime, requestStartTime, hash) {\n\n\n var requestTime = Date.now() - requestStartTime;\n var renderingStartTime = Date.now();\n\n if (value == this.element.val()) {\n if (typeof data.suggest == \"undefined\") {\n data.suggest = {\"count\": 0, \"docs\": {}, \"time\": 0};\n }\n if (typeof data.product == \"undefined\") {\n data.product = {\"count\": 0, \"docs\": {}, \"time\": 0};\n }\n if (typeof data.category == \"undefined\") {\n data.category = {\"count\": 0, \"docs\": {}, \"time\": 0};\n }\n if (typeof data.cms == \"undefined\") {\n data.cms = {\"count\": 0, \"docs\": {}, \"time\": 0};\n }\n var globalCount = data.product.count + data.suggest.count + data.category.count + data.cms.count;\n\n let nbOthers = 0;\n _.each(this.options.config, function (info, key) {\n if (typeof data[key] !== \"undefined\"\n && key !== \"cms\" && key !== \"product\" && key !== \"category\" && key !== \"didyoumean\"\n && typeof this.options.config[key].enable_autocomplete !== \"undefined\") {\n if ($('#ea-' + key + '-template').length) {\n nbOthers += data[key].count;\n }\n }\n }.bind(this));\n\n var phpTime = data.product.time + data.suggest.time + data.category.time + data.cms.time;\n if (typeof hash != \"undefined\") {\n phpTime = 0;\n }\n\n if (this.options.config.general.update_search_term == 1) {\n $.ajax({\n url: this.options.urlUpdateSearchTerm,\n method: \"POST\",\n global: false,\n data: {\"term\": value, \"num_results\": data.product.count},\n dataType: \"json\"\n }
2).done(function (data) {\n }.bind(this));\n }\n\n\n // no result\n if (globalCount == 0 && nbOthers == 0) {\n var padding = parseInt($(this.options.formSelector + ' ' + \"#ea-search-autocomplete-no-result\").css(\"padding-left\").replace(\"px\", \"\")) + parseInt($(this.options.formSelector + ' ' + \"#ea-search-autocomplete-no-result\").css(\"padding-right\").replace(\"px\", \"\"));\n $(this.options.formSelector + ' ' + \"#ea-search-autocomplete-no-result\").css({\n width: ($(this.element).innerWidth() - padding) + 'px'\n });\n\n this._updateAriaHasPopup(true, true);\n } else {\n\n this._updateAriaHasPopup(true, false);\n\n var htmlSuggests = \"\";\n if ($(this.templateSelectors.suggests).length > 0) {\n htmlSuggests = mageTemplate(this.templateSelectors.suggests, {\n suggests: data.suggest.docs,\n count: data.suggest.count,\n enabled: this.options.config.didyoumean.enable_autocomplete != \"0\",\n title: this.options.config.general.labels.didyoumean\n });\n $(this.options.formSelector + ' ' + this.contentSelectors.suggests).html(htmlSuggests);\n }\n\n var htmlCategories = \"\";\n if ($(this.templateSelectors.categories).length > 0) {\n htmlCategories = mageTemplate(this.templateSelectors.categories, {\n categories: data.category.docs,\n count: data.category.count,\n enabled: this.options.config.category.enable_autocomplete != \"0\",\n title: this.options.config.general.labels.categories,\n displayEmpty: this.options.config.category.display_empty_autocomplete !== \"0\"\n });\n $(this.options.formSelector + ' ' + this.contentSelectors.categories).html(htmlCategories);\n }\n\n var htmlCms = \"\";\n if ($(this.templateSelectors.cms).length > 0) {\n htmlCms = mageTemplate(this.templateSelectors.cms, {\n cms: data.cms.docs,\n count: data.cms.count,\n enabled: this.options.config.cms.enable_autocomplete != \"0\",\n title: this.options.config.general.labels.cms,\n displayEmpty: this.options.config.cms.display_empty_autocomplete !== \"0\"\n });\n $(this.options.formSelector + ' ' + this.contentSelectors.cms).html(htmlCms);\n }\n _.each(this.options.config, function (info, key) {\n if (typeof data[key] !== \"undefined\"\n && key !== \"cms\" && key !== \"product\" && key !== \"category\" && key !== \"didyoumean\"\n && typeof this.options.config[key].enable_autocomplete !== \"undefined\") {\n if ($('#ea-' + key + '-template').length) {\n let html = mageTemplate('#ea-' + key + '-template', {\n docs: data[key].docs,\n count: data[key].count,\n enabled: this.options.config[key].enable_autocomplete != \"0\",\n title: this.options.config.general.labels[key],\n displayEmpty: this.options.config[key].display_empty_autocomplete !== \"0\"\n });\n $(this.options.formSelector + ' ' + this.contentSelectors.others).html(html);\n }\n }\n }.bind(this));\n\n var htmlProducts = \"\";\n if ($(this.templateSelectors.products).length > 0) {\n htmlProducts = mageTemplate(this.templateSelectors.products, {\n products: data.product.docs,\n count: data.product.count,\n enabled: this.options.config.product.enable_autocomplete != \"0\",\n title: this.options.config.general.labels.products,\n customerGroupId: this.getCustomerGroupId()\n });\n $(this.options.formSelector + ' ' + this.contentSelectors.products).html(htmlProducts);\n }\n\n var htmlAllResults = \"\";\n if ($(this.templateSelectors.allResults).length > 0) {\n htmlAllResults = mageTemplate(this.templateSelectors.allResults, {\n enabled: this.options.config.general.enable_all_results != \"0\",\n title: this.options.config.general.labels.all_results,\n href: this.options.searchUrl + \"?q=\" + value,\n term: value\n });\n $(this.options.formSelector + ' ' + this.contentSelectors.allResults).html(htmlAllResults);\n }\n\n\n if (data.product.count != 0) {\n $(this.options.formSelector + ' ' + '.ea-search-autocomplete').removeClass('no-product');\n }\n\n if (nbOthers === 0 && htmlSuggests == \"\" && htmlCategories == \"\" && htmlCms == \"\") {\n $(this.options.formSelector + ' ' + '.ea-search-autocomplete .left').addClass('hidden');\n } else {\n $(this.options.formSelector + ' ' + '.ea-search-autocomplete .left').removeClass('hidden');\n if (data.product.count == 0) {\n $(this.options.formSelector + ' ' + '.ea-search-autocomplete').addClass('no-product');\n }\n }\n\n\n }\n\n this.responseList.indexList = $('.ea-product');\n this.responseList.currentIndex = -1;\n\n if ($(\"#ea-debug-template\").length >= 1) {\n var fullEndTime = Date.now();\n var debug = mageTemplate(\"#ea-debug-template\", {\n \"phpTime\": phpTime,\n \"requestTime\": requestTime,\n \"renderingTime\": (fullEndTime - renderingStartTime),\n \"totalTime\": (fullEndTime - fullStartTime),\n \"fromCache\": typeof hash !== \"undefined\",\n \"cacheHash\": hash,\n \"templateHintsEnabled\": this.templateHintsEnabled\n });\n this.lastRequestData = data;\n $('#ea-debug').html(debug);\n this.toggleTemplateHints(this.templateHintsEnabled);\n }\n\n\n }\n\n },\n\n //######################################################################\n // GENERAL TOOLS\n //######################################################################\n /**\n * Get a unique hash of a string\n * @param string\n * @returns {number}\n */\n hash: function (string) {\n var hash = 0;\n if (string.length === 0) {\n return hash;\n }\n for (var i = 0; i < string.length;
2 i++) {\n var char = string.charCodeAt(i);\n hash = ((hash << 5) - hash) + char;\n hash = hash & hash; // Convert to 32bit integer\n }\n return hash;\n },\n\n //######################################################################\n // DEBUG TOOLS\n //######################################################################\n\n /**\n * Enable the template hints\n * @param on true => enable, false => disable\n */\n toggleTemplateHints: function (on) {\n // add a hint for all Underscore.js template\n _.each(this.templateSelectors, function (elt, id) {\n // remove all hints\n $(elt + \"-th\").remove();\n if (on) { // enabling\n var div = $(\"<div>\").addClass(\"ea-template-hint\").addClass(\"template-hint\").attr('id', elt.replace(\"#\", \"\") + \"-th\");\n div.html(\"<a name='\" + id.toUpperCase() + \"'>\" + id.toUpperCase() + \"</a><br/>elt: \" + elt + \"<br/>file: \" + this.contentTemplateFiles[id]);\n // the template dom elt is a script node => adding the hint before the node\n div.insertBefore($(elt));\n }\n }.bind(this));\n\n // add a hint for all blocks updated using uUnderscore.js template\n _.each(this.contentSelectors, function (elt, id) {\n // remove all hints\n elt = this.options.formSelector + ' ' + elt;\n $(elt + \" > .ea-template-hint\").remove();\n if (on) { // enabling template hints\n this.templateHintsEnabled = true;\n $('#ea-debug-disable-template-hints').show();\n $('#ea-debug-enable-template-hints').hide();\n var div = $(\"<div>\").addClass(\"ea-template-hint\");\n if (typeof this.templateSelectors[id] != \"undefined\") {\n // an underscore.js template exists => add an anchor link to the hint of the underscore.js template\n div.html(id.toUpperCase() + \"<br/>elt: \" + elt + \"<br/>_tpl: <a onClick='jQuery(\\\".template-hint.selected\\\").removeClass(\\\"selected\\\");jQuery(\\\"\" + this.templateSelectors[id] + \"-th\\\").addClass(\\\"selected\\\")' href='#\" + id.toUpperCase() + \"'>\" + this.templateSelectors[id] + \"</a>\");\n } else {\n div.html(id.toUpperCase() + \"<br/>elt: \" + elt + \"<br/>phtml: \" + this.contentTemplateFiles[id]);\n }\n $(elt).prepend(div);\n $(elt).addClass(\"ea-template-hint-container\");\n } else { // disabling templateh hints\n this.templateHintsEnabled = false;\n // remove hint class to the container\n $(elt).removeClass(\"ea-template-hint-container\");\n $('#ea-debug-disable-template-hints').hide();\n $('#ea-debug-enable-template-hints').show();\n }\n }.bind(this));\n }\n\n });\n\n return $.mage.wyoea;\n});\n","Magento_OfflinePayments/js/view/payment/offline-payments.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\n/* @api */\ndefine([\n 'uiComponent',\n 'Magento_Checkout/js/model/payment/renderer-list'\n], function (Component, rendererList) {\n 'use strict';\n\n rendererList.push(\n {\n type: 'checkmo',\n component: 'Magento_OfflinePayments/js/view/payment/method-renderer/checkmo-method'\n },\n {\n type: 'banktransfer',\n component: 'Magento_OfflinePayments/js/view/payment/method-renderer/banktransfer-method'\n },\n {\n type: 'cashondelivery',\n component: 'Magento_OfflinePayments/js/view/payment/method-renderer/cashondelivery-method'\n },\n {\n type: 'purchaseorder',\n component: 'Magento_OfflinePayments/js/view/payment/method-renderer/purchaseorder-method'\n }\n );\n\n /** Add view logic here if needed */\n return Component.extend({});\n});\n","Magento_OfflinePayments/js/view/payment/method-renderer/purchaseorder-method.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\n/* @api */\ndefine([\n 'Magento_Checkout/js/view/payment/default',\n 'jquery',\n 'mage/validation'\n], function (Component, $) {\n 'use strict';\n\n return Component.extend({\n defaults: {\n template: 'Magento_OfflinePayments/payment/purchaseorder-form',\n purchaseOrderNumber: ''\n }
2,\n\n /** @inheritdoc */\n initObservable: function () {\n this._super()\n .observe('purchaseOrderNumber');\n\n return this;\n },\n\n /**\n * @return {Object}\n */\n getData: function () {\n return {\n method: this.item.method,\n 'po_number': this.purchaseOrderNumber(),\n 'additional_data': null\n };\n },\n\n /**\n * @return {jQuery}\n */\n validate: function () {\n var form = 'form[data-role=purchaseorder-form]';\n\n return $(form).validation() && $(form).validation('isValid');\n }\n });\n});\n","Magento_OfflinePayments/js/view/payment/method-renderer/banktransfer-method.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\n/* @api */\ndefine([\n 'ko',\n 'Magento_Checkout/js/view/payment/default'\n], function (ko, Component) {\n 'use strict';\n\n return Component.extend({\n defaults: {\n template: 'Magento_OfflinePayments/payment/banktransfer'\n },\n\n /**\n * Get value of instruction field.\n * @returns {String}\n */\n getInstructions: function () {\n return window.checkoutConfig.payment.instructions[this.item.method];\n }\n });\n});\n","Magento_OfflinePayments/js/view/payment/method-renderer/cashondelivery-method.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\n/* @api */\ndefine([\n 'Magento_Checkout/js/view/payment/default'\n], function (Component) {\n 'use strict';\n\n return Component.extend({\n defaults: {\n template: 'Magento_OfflinePayments/payment/cashondelivery'\n },\n\n /**\n * Returns payment method instructions.\n *\n * @return {*}\n */\n getInstructions: function () {\n return window.checkoutConfig.payment.instructions[this.item.method];\n }\n });\n});\n","Magento_OfflinePayments/js/view/payment/method-renderer/checkmo-method.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\n/* @api */\ndefine([\n 'Magento_Checkout/js/view/payment/default'\n], function (Component) {\n 'use strict';\n\n return Component.extend({\n defaults: {\n template: 'Magento_OfflinePayments/payment/checkmo'\n },\n\n /**\n * Returns send check to info.\n *\n * @return {*}\n */\n getMailingAddress: function () {\n return window.checkoutConfig.payment.checkmo.mailingAddress;\n },\n\n /**\n * Returns payable to info.\n *\n * @return {*}\n */\n getPayableTo: function () {\n return window.checkoutConfig.payment.checkmo.payableTo;\n }\n });\n});\n","Magento_LoginAsCustomerAssistance/js/opt-in.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\ndefine([\n 'jquery'\n], function ($) {\n 'use strict';\n\n return function (config, element) {\n $(element).on('submit', function () {\n this.elements['assistance_allowed'].value =\n this.elements['assistance_allowed_checkbox'].checked ?\n config.allowAccess : config.denyAccess;\n });\n };\n});\n","Blizz_Checkout/js/model/shipping-save-processor-mixin.js":"/**\n * Mixin for Mageplaza_Osc/js/model/shipping-save-processor/checkout\n *\n * When the server signals a stale-shipping-rate error (triggered by an\n * admin-side customer group change while the customer was in checkout),\n * reload the checkout page so that fresh customer data and shipping rates\n * for the new group are presented to the customer.\n */\ndefine([\n 'Magento_Checkout/js/model/full-screen-loader'\n], function (\n fullScreenLoader\n) {\n 'use strict';\n\n function isStaleRateError(response) {\n try {\n var body = JSON.parse(response.responseText);\n return !!(body.parameters && body.parameters.error_code === 'stale_shipping_rate');\n } catch (e) {\n return false;\n }\n }\n\n return function (processor) {\n var originalSave = processor.saveShippingInformation.bind(processor);\n\n processor.saveShippingInformation = function () {\n return originalSave().fail(function (response) {\n if (!isStaleRateError(response)) {\n return;\n }\n fullScreenLoader.startLoader();\n window.location.reload();\n });\n };\n\n return processor;\n };\n});\n","Blizz_Checkout/js/view/summary/item/details/add-sku.js":"define([\n 'uiComponent',\n], function (Component) {\n \"use strict\";\n\n return Component.extend({\n defaults: {\n template: 'Blizz_Checkout/container/summary/item/add-sku',\n },\n displayArea: 'before_item_details',\n itemOptions: structuredClone(window.checkoutConfig.itemOptions),\n\n addSku: function (parents) { \n\n var parentComponent = parents[0];\n var item = parents[1];\n var itemSku = parentComponent.getSku(item);\n\n // Gift items have null item_id after C4B ResetGiftItems AJAX recalc,\n // so getSku() returns ''. Fall back to quoteItemData name-match.\n if (!itemSku && item && item.name) {\n var quoteItems = window.checkoutConfig.quoteItemData;\n if (quoteItems) {\n for (var i = 0; i < quoteItems.length;
2 i++) {\n if (quoteItems[i].name === item.name && quoteItems[i].sku) {\n itemSku = quoteItems[i].sku;\n break;\n }\n }\n }\n }\n\n if (this.itemOptions !== undefined\n && this.itemOptions[itemSku] \n && this.itemOptions[itemSku] !== undefined\n && this.itemOptions[itemSku].length > 0\n ) {\n var options = structuredClone(this.itemOptions[itemSku]);\n\n // convert array to string and remove commas\n var sku = options.shift();\n return sku;\n }\n return \"\";\n },\n });\n});\n","Blizz_Checkout/js/view/summary/item/details/add-item-options.js":"define([\n 'uiComponent',\n], function (Component) {\n \"use strict\";\n\n return Component.extend({\n defaults: {\n template: 'Blizz_Checkout/container/summary/item/add-item-options',\n },\n itemOptions: structuredClone(window.checkoutConfig.itemOptions),\n\n getItemOptions: function (parents) {\n\n var parentComponent = parents[0];\n var item = parents[1];\n var sku = parentComponent.getSku(item);\n\n // Gift items have null item_id after C4B ResetGiftItems AJAX recalc,\n // so getSku() returns ''. Fall back to quoteItemData name-match.\n if (!sku && item && item.name) {\n var quoteItems = window.checkoutConfig.quoteItemData;\n if (quoteItems) {\n for (var i = 0; i < quoteItems.length; i++) {\n if (quoteItems[i].name === item.name && quoteItems[i].sku) {\n sku = quoteItems[i].sku;\n break;\n }\n }\n }\n }\n\n if (this.itemOptions !== undefined\n && this.itemOptions[sku]\n && this.itemOptions[sku] !== undefined\n && this.itemOptions[sku].length > 0\n ) {\n // convert array to string and remove commas\n let options = structuredClone(this.itemOptions[sku]);\n options.shift(); // remove first item which is SKU\n\n return options.join(\"\");\n }\n return \"\";\n },\n });\n});\n","Blizz_Checkout/js/view/minicart/item/details/add-item-options.js":"define([\n 'uiComponent',\n], function (Component) {\n \"use strict\"; \n\n return Component.extend({\n defaults: {\n template: 'Blizz_Checkout/container/summary/item/add-item-options',\n },\n // window.checkoutConfig is only available on the checkout/cart page, not on all pages\n // where the minicart sidebar is rendered \u2014 guard against undefined.\n itemOptions: window.checkoutConfig && window.checkoutConfig.itemOptions\n ? structuredClone(window.checkoutConfig.itemOptions)\n : null,\n\n getItemOptions: function (parents) {\n\n var parentComponent = parents[0];\n var sku = parentComponent.product_sku;\n\n if (this.itemOptions\n && this.itemOptions[sku]\n && this.itemOptions[sku].length > 0\n ) {\n // convert array to string and remove commas\n let options = structuredClone(this.itemOptions[sku]);\n options.shift(); // remove first item which is SKU\n\n return options.join(\"\");\n }\n return \"\";\n },\n });\n});\n","Blizz_Checkout/js/mixin/checkout-data-resolver-mixin.js":"/**\n * Restores the addressList().some(isDefaultBilling()) check that Wyomind_PickupAtStore\n * removes from applyBillingAddress() by replacing the function entirely without it.\n * Registered after Wyomind via module.xml <sequence> so our assignment wins.\n * Wyomind's fallback conditions are preserved; we only prepend the addressList check.\n *\n * Core bug (unpatched for non-virtual checkout):\n * https://github.com/magento/magento2/issues/8777 \u2014 open since 2017, closed w/o fix\n * https://github.com/magento/magento2/pull/18095 \u2014 2018 partial fix, virtual only\n * No ACSD/QPatch covers this. Wyomind conflict not publicly documented.\n */\ndefine([\n 'Magento_Customer/js/model/address-list',\n 'Magento_Checkout/js/model/quote',\n 'Magento_Checkout/js/action/select-billing-address'\n], function (addressList, quote, selectBillingAddress) {\n 'use strict';\n\n return function (target) {\n target.applyBillingAddress = function () {\n var isBillingAddressInitialized, shippingAddress;\n\n if (quote.billingAddress()) {\n selectBillingAddress(quote.billingAddress());\n return;\n }\n\n // Restored from Core (removed by Wyomind): check address list for default billing.\n isBillingAddressInitialized = addressList().some(function (address) {\n if (address.isDefaultBilling()) {\n selectBillingAddress(address);\n return true;\n }\n return false;\n });\n\n if (!isBillingAddressInitialized) {\n shippingAddress = quote.shippingAddress();\n // Wyomind's original fallback conditions preserved exactly.\n if (!PickupAtStore.isPASSelected() && (shippingAddress &&\n shippingAddress.canUseForBilling() &&\n (shippingAddress.isDefaultShipping() || !quote.isVirtual()))\n ) {\n selectBillingAddress(shippingAddress);\n }\n }\n };\n\n return target;\n };\n});\n","Blizz_Checkout/js/mixin/error-processor-mixin.js":"/**\n * Mixin for Magento_Checkout/js/model/error-processor\n *\n * BZ-1480: the checkout page fires several independent, un-debounced requests off a single\n * shipping-method change (Amasty_Conditions totals-information, Mageplaza_Osc\n * shipping-information/payment-total-information, Wyomind_PickupAtStore's own calls). When two\n * of them race, the browser aborts the older one (response.status === 0, empty body) - this is\n * not a real error, just a superseded request. Without this guard, error-processor shows a\n * generic \"Something went wrong\" message for that abort even though the newer request succeeds\n * moments later. Only Amasty's own totals-information call already guards against this; this\n * mixin extends the same guard to every caller of the shared error-processor.\n */\ndefine([], function () {\n 'use strict';\n\n return function (errorProcessor) {\n var originalProcess = errorProcessor.process;\n\n errorProcessor.process = function (response, messageContainer) {\n if (response && response.status === 0) {\n return;\n }\n\n return originalProcess.apply(errorProcessor, arguments);\n };\n\n return errorProcessor;\n };\n});\n","Mageplaza_Osc/js/social-login-popup.js":"/**\n * Mageplaza\n *\n * NOTICE OF LICENSE\n *\n * This source file is subject to the Mageplaza.com license that is\n * available through the world-wide-web at this URL:\n * https://www.mageplaza.com/LICENSE.txt\n *\n * DISCLAIMER\n *\n * Do not edit or add to this file if you wish to upgrade this extension to newer\n * version in the future.\n *\n * @category Mageplaza\n * @package Mageplaza_SocialLoginPro\n * @copyright Copyright (c) Mageplaza (https://www.mageplaza.com/)\n * @license https://www.mageplaza.com/LICENSE.txt\n */\n\ndefine(\n [\n 'jquery',\n 'Mageplaza_SocialLogin/js/popup',\n 'Magento_Ui/js/modal/modal',\n 'mage/dropdown',\n 'mage/translate',\n 'Mageplaza_Core/js/jquery.magnific-popup.min'\n ], function ($, socialpopup, modal, dropdown, $t) {\n \"use strict\";\n $.widget(\n 'mageplaza.socialpopup', socialpopup, {\n options: {\n captchaForms: [],\n captchaClientKey: '',\n captchaInvisible: false,\n isGoogleCaptcha: false,\n btnPosition: ''\n },\n\n /**\n * @private\n */\n _create: function () {\n this._super();\n switch (this.options.popupLogin){\n case 'popup_login':\n this.changeSocialBtnPosition();\n break;\n case 'quick_login':\n this.initQuickLogin();\n this.hideQuickLogin();\n break;\n case 'popup_slide':\n this.initPopupSli
2de()\n break;\n default:\n break;\n }\n },\n\n /**\n * Change Social Button Position In Template\n */\n changeSocialBtnPosition: function () {\n var btnPosition = this.options.btnPosition,\n social = $('#social-login-popup .block.social-login-authentication-channel'),\n loginForm = $('#social-login-popup .block.social-login-customer-authentication'),\n socialBtn = $('#social-login-popup .actions-toolbar.social-btn');\n\n if (btnPosition !== '' && social.length > 0 && loginForm.length > 0) {\n switch (btnPosition){\n case 'left':\n social.after(loginForm);\n break;\n case 'top':\n social.after(loginForm);\n this.changeResponsive(social, loginForm, socialBtn);\n break;\n case 'bottom':\n this.changeResponsive(social, loginForm, socialBtn);\n break;\n default:\n break;\n }\n }\n },\n\n /**\n * Change Responsive\n * @param social\n * @param loginForm\n */\n changeResponsive: function (social, loginForm, socialBtn) {\n social.addClass('mp-12');\n social.removeClass('mp-6');\n loginForm.addClass('mp-12');\n loginForm.removeClass('mp-7');\n socialBtn.each(function () {\n $(this).addClass('col-mp');\n $(this).addClass('mp-6');\n ;\n });\n },\n\n /**\n * Init Quick Login Modal\n */\n initQuickLogin: function () {\n this.modalWindow = $('.quick-login-wrapper');\n var options = {\n 'type': 'popup',\n 'modalClass': 'popup-authentication',\n 'responsive': true,\n 'innerScroll': true,\n 'trigger': '.osc-authentication-toggle',\n 'buttons': [],\n };\n if (window.checkoutConfig.oscConfig.isDisplaySocialLogin){\n modal(options, $(this.modalWindow));\n }\n },\n\n /**\n * Init Popup Slide Modal\n */\n initPopupSlide: function () {\n var wrapper = $('.quick-login-wrapper'),\n options = {\n 'type': 'slide',\n 'responsive': true,\n 'innerScroll': true,\n 'trigger': '.social-login-btn',\n 'modalClass': 'social-popup-slide',\n 'buttons': [],\n 'parentModalClass': '_has-modal quick-login-wrapper-has-modal'\n };\n if (window.checkoutConfig.oscConfig.isDisplaySocialLogin) {\n modal(options, wrapper);\n wrapper.modal({\n opened: function () {\n $('.social-popup-slide').css('z-index', 102);\n }\n });\n }\n },\n\n /**\n * Open Modal\n */\n openModal: function () {\n var wrapper = $('.quick-login-wrapper');\n\n if (wrapper.length) {\n if (this.options.popupLogin === 'popup_slide') {\n wrapper.modal('openM
2odal');\n } else {\n wrapper.dropdownDialog('open');\n }\n }\n },\n\n /**\n * Hide Quick Login\n */\n hideQuickLogin: function () {\n var authWrapper = $('.quick-login-wrapper');\n $('.quick-login-wrapper .btn-close').on(\n 'click', function () {\n authWrapper.modal('closeModal');\n $('body._has-modal-custom .modal-custom-overlay').remove();\n }\n );\n },\n\n /**\n * Show Login page\n */\n showLogin: function () {\n if (this.options.popupLogin !== 'popup_login') {\n $('.quick-login-wrapper').show();\n this.loginFormContent = $('.social-login.authentication .block-content');\n }\n\n this._super();\n },\n\n /**\n * Show create page\n */\n showCreate: function () {\n if (this.options.popupLogin !== 'popup_login') {\n var title = $('.social-login.create .create-account-title');\n\n title.replaceWith($('<h3 class=\"create-account-title header-title\">' + title.text() + '</h3>'));\n title.css('margin-left', '10px');\n $('.quick-login-wrapper').show();\n }\n\n this._super();\n },\n\n\n /**\n * Show email page\n */\n showEmail: function () {\n if (this.options.popupLogin !== 'popup_login') {\n var title = $('.fake-email .social-login-title .forgot-pass-title');\n\n title.replaceWith($('<h3 class=\"forgot-pass-title header-title\">' + title.text() + '</h3>'));\n title.css('margin-left', '10px');\n }\n\n\n this._super();\n },\n\n /**\n * Show forgot password page\n */\n showForgot: function () {\n if (this.options.popupLogin !== 'popup_login') {\n var title = $('.social-login.forgot .forgot-pass-title');\n\n title.replaceWith($('<h3 class=\"forgot-pass-title header-title\">' + title.text() + '</h3>'));\n title.css('margin-left', '10px');\n }\n\n this._super();\n },\n\n /**\n * Init Trigger Button Login\n */\n initLoginObserve: function () {\n if (this.options.captchaInvisible && ($.inArray('user_login', this.options.captchaForms) !== -1)) {\n this.loginForm.find('input').keypress(\n function (event) {\n var code = event.keyCode || event.which;\n if (code === 13) {\n $('#bnt-social-login-authentication').trigger('click');\n }\n }\n );\n return;\n }\n\n this._super();\n },\n\n /**\n * Init Trigger Button Create\n */\n initCreateObserve: function () {\n if (this.options.captchaInvisible && ($.inArray('user_create', this.options.captchaForms) !== -1)) {\n this.createForm.find('input').keypress(\n function (event) {\n var code = event.keyCode || event.which;\n if (code === 13) {\n $('#button-create-social').trigger('click');\n }\n }\n );\n return;\n }\n\n this._super();\n },\n\n /**\n * Init Trigger Button Forgot\n */\n initForgotOb
2serve: function () {\n if (this.options.captchaInvisible && ($.inArray('user_forgotpassword', this.options.captchaForms) !== -1)) {\n this.forgotForm.find('input').keypress(\n function (event) {\n var code = event.keyCode || event.which;\n if (code === 13) {\n $('#bnt-social-login-forgot').trigger('click');\n }\n }\n );\n return;\n }\n\n this._super();\n },\n\n /**\n * Reload reCaptcha if enabled\n *\n * @param type\n * @param delay\n */\n reloadCaptcha: function (type, delay) {\n this.loadApi();\n this._super();\n },\n\n /**\n * Login Process\n */\n processLogin: function () {\n var self = this;\n if (this.validateCaptcha(this.loginForm, 'user_login')) {\n return;\n }\n var request = this._super();\n if (typeof request !== 'undefined') {\n request.done(\n function (response) {\n if (response.errors) {\n self.resetCaptcha('user_login');\n }\n }\n ).fail(\n function () {\n self.resetCaptcha('user_login');\n }\n );\n } else {\n self.resetCaptcha('user_login');\n }\n },\n\n /**\n * Create Process\n */\n processCreate: function () {\n var self = this;\n if (this.validateCaptcha(this.createForm, 'user_create')) {\n return;\n }\n var request = this._super();\n if (typeof request !== 'undefined') {\n request.done(\n function (response) {\n if (!response.success) {\n self.resetCaptcha('user_create');\n }\n }\n );\n } else {\n self.resetCaptcha('user_create');\n }\n },\n\n /**\n * Forgot Process\n */\n processForgot: function () {\n var self = this;\n if (this.validateCaptcha(this.forgotForm, 'user_forgotpassword')) {\n return;\n }\n var request = this._super();\n if (typeof request !== 'undefined') {\n request.done(\n function (response) {\n self.resetCaptcha('user_forgotpassword');\n }\n );\n } else {\n self.resetCaptcha('user_forgotpassword');\n }\n },\n\n /**\n * Reset reCaptcha\n */\n resetCaptcha: function (nameProcess) {\n $.each(\n this.options.captchaForms, function (form, value) {\n if (value === nameProcess) {\n grecaptcha.reset(form);\n }\n }\n );\n },\n\n /**\n * Validate reCaptcha\n */\n validateCaptcha: function (form, type) {\n var formDataArray = form.serializeArray();
2\n var validateCaptcha = false, id;\n formDataArray.forEach(\n function (entry) {\n if (entry.name.includes('g-recaptcha-response') && entry.value === \"\") {\n validateCaptcha = true;\n }\n }\n );\n if (validateCaptcha) {\n form.valid();\n id = '#mageplaza-g-recaptcha-' + type;\n $(id).after(\"<div for='captcha' generated='true' class='mage-error' id='captcha-error' style='display: block;'>\" + $t(\"This is a required field.\") + \"</div>\");\n return true;\n }\n return false;\n },\n\n /**\n * Create reCaptcha\n */\n loadApi: function () {\n if (!this.options.isGoogleCaptcha) {\n return;\n }\n\n var self = this,\n isInvisible = this.options.captchaInvisible;\n\n window.recaptchaOnload = function () {\n $.each(\n self.options.captchaForms, function (form, value) {\n var target = '',\n parameters = {\n 'sitekey': self.options.captchaClientKey,\n 'size': isInvisible ? 'invisible' : 'normal'\n };\n\n switch (value){\n case 'user_login':\n target = isInvisible ? 'bnt-social-login-authentication' : 'mageplaza-g-recaptcha-user_login';\n if (isInvisible) {\n parameters.callback = self.processLogin.bind(self);\n }\n break;\n case 'user_create':\n target = isInvisible ? 'button-create-social' : 'mageplaza-g-recaptcha-user_create';\n if (isInvisible) {\n parameters.callback = self.processCreate.bind(self);\n }\n break;\n case 'user_forgotpassword':\n target = isInvisible ? 'bnt-social-login-forgot' : 'mageplaza-g-recaptcha-user_forgotpassword';\n if (isInvisible) {\n parameters.callback = self.processForgot.bind(self);\n }\n break;\n }\n grecaptcha.render(target, parameters);\n }\n );\n };\n\n require(['mpReCaptcha']);\n\n this.options.isGoogleCaptcha = false;\n }\n }\n );\n\n return $.mageplaza.socialpopup;\n }\n);\n","Mageplaza_Osc/js/model/shipping-rate-service.js":"/**\r\n * Mageplaza\r\n *\r\n * NOTICE OF LICENSE\r\n *\r\n * This source file is subject to the Mageplaza.com license that is\r\n * available through the world-wide-web at this URL:\r\n * https://www.mageplaza.com/LICENSE.txt\r\n *\r\n * DISCLAIMER\r\n *\r\n * Do not edit or add to this file if you wish to upgrade this extension to newer\r\n * version in the future.\r\n *\r\n * @category Mageplaza\r\n * @package Mageplaza_Osc\r\n * @copyright Copyright (c) Mageplaza (https://www.mageplaza.com/)\r\n * @license https://www.mageplaza.com/LICENSE.txt\r\n */\r\n\r\ndefine(\r\n [\r\n 'Magento_Checkout/js/model/quote',\r\n 'Magento_Checkout/js/model/shipping-rate-processor/new-address',\r\n 'Magento_Checkout/js/model/shipping-rate-processor/customer-address'\r\n ],\r\n function (quote, defaultProcessor, customerAddressProcessor) {\r\n 'use strict';\r\n\r\n var processors = [];\r\n\r\n processors.default = defaultProcessor;
2\r\n processors['customer-address'] = customerAddressProcessor;\r\n\r\n return {\r\n isAddressChange: false,\r\n registerProcessor: function (type, processor) {\r\n processors[type] = processor;\r\n },\r\n estimateShippingMethod: function () {\r\n var type = quote.shippingAddress().getType();\r\n\r\n if (processors[type]) {\r\n processors[type].getRates(quote.shippingAddress());\r\n } else {\r\n processors.default.getRates(quote.shippingAddress());\r\n }\r\n }\r\n }\r\n }\r\n);\r\n","Mageplaza_Osc/js/model/checkout-data-resolver.js":"/**\r\n * Mageplaza\r\n *\r\n * NOTICE OF LICENSE\r\n *\r\n * This source file is subject to the Mageplaza.com license that is\r\n * available through the world-wide-web at this URL:\r\n * https://www.mageplaza.com/LICENSE.txt\r\n *\r\n * DISCLAIMER\r\n *\r\n * Do not edit or add to this file if you wish to upgrade this extension to newer\r\n * version in the future.\r\n *\r\n * @category Mageplaza\r\n * @package Mageplaza_Osc\r\n * @copyright Copyright (c) Mageplaza (https://www.mageplaza.com/)\r\n * @license https://www.mageplaza.com/LICENSE.txt\r\n */\r\n\r\ndefine(\r\n [\r\n 'Magento_Checkout/js/checkout-data'\r\n ],\r\n function (checkoutData) {\r\n 'use strict';\r\n\r\n return {\r\n\r\n /**\r\n * Set default shipping method to local storage\r\n */\r\n resolveDefaultShippingMethod: function () {\r\n if (!checkoutData.getSelectedShippingRate() && window.checkoutConfig.selectedShippingRate) {\r\n checkoutData.setSelectedShippingRate(window.checkoutConfig.selectedShippingRate);\r\n }\r\n },\r\n\r\n /**\r\n * Set default payment method to local storage\r\n */\r\n resolveDefaultPaymentMethod: function () {\r\n if (!checkoutData.getSelectedPaymentMethod() && window.checkoutConfig.selectedPaymentMethod) {\r\n checkoutData.setSelectedPaymentMethod(window.checkoutConfig.selectedPaymentMethod);\r\n }\r\n }\r\n }\r\n }\r\n);\r\n","Mageplaza_Osc/js/model/discount-payment-method.js":"/**\r\n * Mageplaza\r\n *\r\n * NOTICE OF LICENSE\r\n *\r\n * This source file is subject to the mageplaza.com license that is\r\n * available through the world-wide-web at this URL:\r\n * https://www.mageplaza.com/LICENSE.txt\r\n *\r\n * DISCLAIMER\r\n *\r\n * Do not edit or add to this file if you wish to upgrade this extension to newer\r\n * version in the future.\r\n *\r\n * @category Mageplaza\r\n * @package Mageplaza_Osc\r\n * @copyright Copyright (c) Mageplaza (https://www.mageplaza.com/)\r\n * @license https://www.mageplaza.com/LICENSE.txt\r\n */\r\n\r\ndefine(\r\n [\r\n 'mage/storage',\r\n 'Magento_Checkout/js/model/error-processor',\r\n 'Magento_Checkout/js/model/totals',\r\n 'Magento_Checkout/js/model/quote'\r\n ],\r\n function (storage, errorProcessor, totals, quote) {\r\n 'use strict';\r\n\r\n return function (serviceUrl, payload) {\r\n totals.isLoading(true);\r\n\r\n return storage.post(\r\n serviceUrl, JSON.stringify(payload)\r\n ).fail(\r\n function (response) {\r\n errorProcessor.process(response);\r\n }\r\n ).success(\r\n function (response) {\r\n quote.setTotals(response);\r\n }\r\n ).always(\r\n function () {\r\n totals.isLoading(false);\r\n }\r\n );\r\n };\r\n }\r\n);\r\n\r\n","Mageplaza_Osc/js/model/paypal_express_compatible.js":"/**\n * Mageplaza\n *\n * NOTICE OF LICENSE\n *\n * This source file is subject to the Mageplaza.com license that is\n * available through the world-wide-web at this URL:\n * https://www.mageplaza.com/LICENSE.txt\n *\n * DISCLAIMER\n *\n * Do not edit or add to this file if you wish to upgrade this extension to newer\n * version in the future.\n *\n * @category Mageplaza\n * @package Mageplaza_Osc\n * @copyright Copyright (c) Mageplaza (https://www.mageplaza.com/)\n * @license https://www.mageplaza.com/LICENSE.txt\n */\n\ndefine(['jquery'], function ($) {\n 'use strict';\n\n var config = window.checkoutConfig;\n\n return {\n togglePlaceOrderButton: function (payment) {\n var actionsToolbar = $('.osc-place-order-wrapper .actions-toolbar'),\n /*\n * @author: macs_rst \n * @date: on 23.01.2024\n * @de
2scription: anderes Element f\u00fcr actionsToolbarContent nutzen bei paypal-in-context\n */\n actionsToolbarContent = $('.osc-place-order-wrapper #paypal-express-in-context-button'),\n checkoutAgreementBlock = $('#co-place-order-area .osc-place-order-wrapper>.checkout-agreements-block')\n\n if (payment && config.oscConfig.paymentCustomBtn.includes(payment.method)) {\n actionsToolbar.hide();\n if (payment.method === 'paypal_express') {\n checkoutAgreementBlock.prependTo('#co-place-order-area .osc-place-order-wrapper');\n actionsToolbarContent.show();\n }\n } else {\n actionsToolbar.show();\n actionsToolbarContent.hide();\n }\n }\n };\n});\n","Mageplaza_Osc/js/model/gift-wrap.js":"/**\r\n * Mageplaza\r\n *\r\n * NOTICE OF LICENSE\r\n *\r\n * This source file is subject to the Mageplaza.com license that is\r\n * available through the world-wide-web at this URL:\r\n * https://www.mageplaza.com/LICENSE.txt\r\n *\r\n * DISCLAIMER\r\n *\r\n * Do not edit or add to this file if you wish to upgrade this extension to newer\r\n * version in the future.\r\n *\r\n * @category Mageplaza\r\n * @package Mageplaza_Osc\r\n * @copyright Copyright (c) Mageplaza (https://www.mageplaza.com/)\r\n * @license https://www.mageplaza.com/LICENSE.txt\r\n */\r\n\r\ndefine(['ko'], function (ko) {\r\n 'use strict';\r\n var hasWrap = ko.observable(window.checkoutConfig.oscConfig.giftWrap.hasWrap);\r\n return {\r\n hasWrap: hasWrap,\r\n getIsWrap: function () {\r\n return this.hasWrap();\r\n },\r\n setIsWrap: function (isWrap) {\r\n return this.hasWrap(isWrap);\r\n }\r\n };\r\n});","Mageplaza_Osc/js/model/gift-message.js":"/**\r\n * Mageplaza\r\n *\r\n * NOTICE OF LICENSE\r\n *\r\n * This source file is subject to the Mageplaza.com license that is\r\n * available through the world-wide-web at this URL:\r\n * https://www.mageplaza.com/LICENSE.txt\r\n *\r\n * DISCLAIMER\r\n *\r\n * Do not edit or add to this file if you wish to upgrade this extension to newer\r\n * version in the future.\r\n *\r\n * @category Mageplaza\r\n * @package Mageplaza_Osc\r\n * @copyright Copyright (c) Mageplaza (https://www.mageplaza.com/)\r\n * @license https://www.mageplaza.com/LICENSE.txt\r\n */\r\n\r\ndefine(['jquery', 'ko', 'uiElement', 'underscore', 'mage/translate'],\r\n function ($, ko, uiElement, _, $t) {\r\n 'use strict';\r\n\r\n var provider = uiElement();\r\n\r\n return function () {\r\n var model = {\r\n observables: {},\r\n initialize: function () {\r\n this.getObservable('alreadyAdded')(false);\r\n var message = window.checkoutConfig.oscConfig.giftMessageOptions.giftMessage.hasOwnProperty('orderLevel')\r\n ? window.checkoutConfig.oscConfig.giftMessageOptions.giftMessage['orderLevel']\r\n : null;\r\n if (_.isObject(message)) {\r\n this.getObservable('recipient')(message.recipient);\r\n this.getObservable('sender')(message.sender);\r\n this.getObservable('message')(message.message);\r\n this.getObservable('alreadyAdded')(true);\r\n }\r\n },\r\n getObservable: function (key) {\r\n this.initObservable('message-orderLevel', key);\r\n return provider[this.getUniqueKey('message-orderLevel', key)];\r\n },\r\n initObservable: function (node, key) {\r\n if (node && !this.observables.hasOwnProperty(node)) {\r\n this.observables[node] = [];\r\n }\r\n if (key && this.observables[node].indexOf(key) == -1) {\r\n this.observables[node].push(key);\r\n provider.observe(this.getUniqueKey(node, key));\r\n }\r\n },\r\n getUniqueKey: function (node, key) {\r\n return node + '-' + key;\r\n },\r\n getConfigValue: function (key) {\r\n return window.checkoutConfig.oscConfig.giftMessageOptions.hasOwnProperty(key) ?\r\n window.checkoutConfig.oscConfig.giftMessageOptions[key]\r\n : null;\r\n },\r\n\r\n /**\r\n * Check if gift message can be displayed\r\n *\r\n * @returns {Boolean}\r\n */\r\n isGiftMessageAvailable: function () {\r\n return this.getConfigValue('isOrderLevelGiftOptionsEnabled');\r\n },\r\n /**\r\n * show message below order summary\r\n * @param type\r\n * @param message\r\n */\r\n showMessage: function (type, message) {\r\n var classElement = 'message ' + type;\r\n $('#opc-sidebar .block.items-in-cart').before('<div class=\" ' + classElement + '\"> <span>' + $t(message) + '</span></div>');\r\n setTimeout(function () {\r\n $('#opc-sidebar .opc-block-summary .message.' + type).remove();\r\n }, 3000);\r\n }\r\n };\r\n model.initialize();\r\n return model;\r\n }\r\n }\r\n);\r\n","Mageplaza_Osc/js/model/agreement-validator.js":"/**\n * Mageplaza\n *\n * NOTICE OF LICENSE\n *\n * This source file is subject to the Mageplaza.com license that is\n * available through the world-wide-web at this URL:\n * https://www.mageplaza.com/LICENSE.txt\n *\n * DISCLAIMER\n *\n * Do not edit or add to this file if you wish to upgrade this extension to newer\n * version in the future.\n *\n * @category Mageplaza\n * @package Mageplaza_Osc\n * @copyright Copyright (c) Mageplaza (https://www.mageplaza.com/)\n * @license https://www.mageplaza.com/LICENSE.txt\n */\n\ndefine(\n [\n 'jquery',\n 'mage/validation'\n ],\n function ($) {\n 'use strict';\n var checkoutConfig = window.checkoutConfig,\n agreementsConfig = checkoutConfig ? checkoutConfig.checkoutAgreements : {};\n\n var agreementsInputPath = '#co-place-order-agreement input[type=\"checkbox\"]';\n\n return {\n /**\n * Validate checkout agreements\n *\n * @returns {boolean}\n */\n validate: function (hideError) {\n if (!agreementsConfig.isEnabled) {\n return true;\n }\n\n var $checkboxes = $(agreementsInputPath);\n if ($checkboxes.length === 0) {\n return true;\n }\n\n if (hideError) {\n return $checkboxes.filter(':checked').length === $checkboxes.length;\n }\n\n var form = $('#co-place-order-agreement');
2\n var validator = form.data('validator');\n\n if (!validator) {\n var errorPlacement = function (error, element) {\n var errorPlacementTarget = element;\n if (element.is(':checkbox') || element.is(':radio')) {\n errorPlacementTarget = element.siblings('label').last();\n }\n errorPlacementTarget.after(error);\n };\n\n form.validate({\n errorClass: 'mage-error',\n errorElement: 'div',\n meta: 'validate',\n errorPlacement: errorPlacement\n });\n }\n\n return form.valid();\n }\n }\n }\n);\n","Mageplaza_Osc/js/model/agreements-assigner.js":"/**\r\n * Mageplaza\r\n *\r\n * NOTICE OF LICENSE\r\n *\r\n * This source file is subject to the Mageplaza.com license that is\r\n * available through the world-wide-web at this URL:\r\n * https://www.mageplaza.com/LICENSE.txt\r\n *\r\n * DISCLAIMER\r\n *\r\n * Do not edit or add to this file if you wish to upgrade this extension to newer\r\n * version in the future.\r\n *\r\n * @category Mageplaza\r\n * @package Mageplaza_Osc\r\n * @copyright Copyright (c) Mageplaza (https://www.mageplaza.com/)\r\n * @license https://www.mageplaza.com/LICENSE.txt\r\n */\r\n\r\n/*jshint browser:true jquery:true*/\r\n/*global alert*/\r\ndefine([\r\n 'jquery'\r\n], function ($) {\r\n 'use strict';\r\n\r\n var agreementsConfig = window.checkoutConfig.checkoutAgreements;\r\n var show_toc = window.checkoutConfig.oscConfig.show_toc;\r\n var SHOW_IN_PAYMENT = '1';\r\n\r\n /** Override default place order action and add agreement_ids to request */\r\n return function (paymentData) {\r\n var agreementForm,\r\n agreementFormContainer,\r\n agreementData,\r\n agreementIds;\r\n\r\n if (!agreementsConfig.isEnabled) {\r\n return;\r\n }\r\n agreementFormContainer = (show_toc == SHOW_IN_PAYMENT) ? $('.payment-method._active') : $('#co-place-order-agreement');\r\n agreementForm = agreementFormContainer.find('div[data-role=checkout-agreements] input');\r\n\r\n agreementData = agreementForm.serializeArray();\r\n agreementIds = [];\r\n\r\n agreementData.forEach(function (item) {\r\n agreementIds.push(item.value);\r\n });\r\n\r\n if (paymentData['extension_attributes'] === undefined) {\r\n paymentData['extension_attributes'] = {};\r\n }\r\n\r\n paymentData['extension_attributes']['agreement_ids'] = agreementIds;\r\n };\r\n});\r\n","Mageplaza_Osc/js/model/shipping-rates-validator.js":"/**\r\n * Mageplaza\r\n *\r\n * NOTICE OF LICENSE\r\n *\r\n * This source file is subject to the Mageplaza.com license that is\r\n * available through the world-wide-web at this URL:\r\n * https://www.mageplaza.com/LICENSE.txt\r\n *\r\n * DISCLAIMER\r\n *\r\n * Do not edit or add to this file if you wish to upgrade this extension to newer\r\n * version in the future.\r\n *\r\n * @category Mageplaza\r\n * @package Mageplaza_Osc\r\n * @copyright Copyright (c) Mageplaza (https://www.mageplaza.com/)\r\n * @license https://www.mageplaza.com/LICENSE.txt\r\n */\r\n\r\ndefine(\r\n [\r\n 'underscore',\r\n 'jquery',\r\n 'mageUtils',\r\n 'Magento_Customer/js/model/address-list',\r\n 'Magento_Checkout/js/model/shipping-rates-validator',\r\n 'Magento_Checkout/js/model/shipping-rates-validation-rules',\r\n 'Magento_Checkout/js/model/address-converter',\r\n 'Magento_Checkout/js/action/select-shipping-address',\r\n 'Magento_Checkout/js/model/shipping-rate-service',\r\n 'Magento_Checkout/js/model/shipping-service',\r\n 'Magento_Checkout/js/model/postcode-validator',\r\n 'mage/translate',\r\n 'uiRegistry'\r\n ],\r\n function (_,\r\n $,\r\n utils,\r\n addressList,\r\n Validator,\r\n shippingRatesValidationRules,\r\n addressConverter,\r\n selectShippingAddress,\r\n shippingRateService,\r\n shippingService,\r\n postcodeValidator,\r\n $t,\r\n uiRegistry) {\r\n 'use strict';\r\n\r\n var countryElement = null,\r\n postcodeElement = null,\r\n postcodeElementName = 'postcode',\r\n observedElements = [],\r\n observableElements,\r\n defaultRules = {'rate': {'postcode': {'required': true}, 'country_id': {'required': true}}},\r\n addressFields = window.checkoutConfig.oscConfig.addressFields;\r\n\r\n return _.extend(Validator, {\r\n isFormInline: function () {\r\n return addressList().length === 0;\r\n },\r\n\r\n getValidationRules: function () {\r\n var rules = shippingRatesValidationRules.getRules();\r\n\r\n return _.isEmpty(rules) ? defaultRules : rules;\r\n },\r\n\r\n oscValidateAddressData: function (field, address) {\r\n var self = this,\r\n canLoad = false;\r\n\r\n $.each(self.getValidationRules(), function (carrier, fields) {\r\n if (fields.hasOwnProperty(field)) {\r\n var missingValue = false;\r\n $.each(fields, function (key, rule) {\r\n if (self.isFieldExisted(key) && address.hasOwnProperty(key) && rule.required && utils.isEmpty(address[key])) {\r\n var regionFields = ['regi
2on', 'region_id', 'region_id_input'];\r\n if ($.inArray(key, regionFields) === -1\r\n || utils.isEmpty(address['region']) && utils.isEmpty(address['region_id'])\r\n ) {\r\n missingValue = true;\r\n\r\n return false;\r\n }\r\n }\r\n });\r\n if (!missingValue) {\r\n canLoad = true;\r\n\r\n return false;\r\n }\r\n }\r\n });\r\n\r\n return canLoad;\r\n },\r\n\r\n isFieldExisted: function (field) {\r\n var result = false;\r\n $.each(observedElements, function (key, element) {\r\n if (field === element.index) {\r\n result = true;\r\n return false;\r\n }\r\n });\r\n\r\n return result;\r\n },\r\n\r\n /**\r\n * Perform postponed binding for fieldset elements\r\n *\r\n * @param {String} formPath\r\n */\r\n initFields: function (formPath) {\r\n var self = this;\r\n\r\n observableElements = shippingRatesValidationRules.getObservableFields();\r\n if (_.isEmpty(observableElements)) {\r\n observableElements.push('country_id');\r\n }\r\n\r\n if ($.inArray(postcodeElementName, observableElements) === -1) {\r\n // Add postcode field to observables if not exist for zip code validation support\r\n observableElements.push(postcodeElementName);\r\n }\r\n\r\n $.each(addressFields, function (index, field) {\r\n uiRegistry.async(formPath + '.' + field)(self.oscBindHandler.bind(self));\r\n });\r\n },\r\n\r\n oscBindHandler: function (element) {\r\n var self = this;\r\n\r\n if (element.component.indexOf('/group') !== -1) {\r\n $.each(element.elems(), function (index, elem) {\r\n uiRegistry.async(elem.name)(function () {\r\n self.oscBindHandler(elem);\r\n });\r\n });\r\n } else if (element && element.hasOwnProperty('value')) {\r\n element.on('value', function () {\r\n self.oscPostcodeValidation();\r\n\r\n if (self.isFormInline()) {\r\n var addressFlat = addressConverter.formDataProviderToFlatData(\r\n self.oscCollectObservedData(),\r\n 'shippingAddress'\r\n ),\r\n address;\r\n\r\n address = addressConverter.formAddressDataToQuoteAddress(addressFlat);\r\n selectShippingAddress(address);\r\n\r\n if ($.inArray(element.index, observableElements) !== -1 && self.oscValidateAddressData(element.index, addressFlat)) {\r\n shippingRateService.isAddressChange = true;\r\n\r\n clearTimeout(self.validateAddressTimeout);\r\n self.validateAddressTimeout = setTimeout(function () {\r\n shippingRateService.estimateShippingMethod();\r\n }, 200);\r\n }\r\n }\r\n });\r\n observedElements.push(element);\r\n if (element.index === postcodeElementName) {\r\n postcodeElement = element;\r\n }\r\n if (element.index === 'country_id') {\r\n countryElement = element;\r\n }\r\n }\r\n },\r\n\r\n /**\r\n * Collect observed fields data to object\r\n *\r\n * @returns {*}\r\n */\r\n oscCollectObservedData: function () {\r\n var observedValues = {};\r\n\r\n $.each(observedElements, function (index, field) {\r\n var value = field.value();\r\n if ($.type(value) === 'undefined') {\r\n value = '';\r\n }\r\n observedValues[field.dataScope] = value;\r\n });\r\n\r\n return observedValues;\r\n },\r\n\r\n oscPostcodeValidation: function () {\r\n var countryId = countryElement.value(),\r\n validationResult,\r\n warnMessage;\r\n\r\n if (postcodeElement === null || postcodeElement.value() === null) {\r\n return true;\r\n }\r\n\r\n postcodeElement.warn(null);\r\n validationResult = postcodeValidator.validate(postcodeElement.value(), countryId);\r\n\r\n if (!validationResult) {\r\n warnMessage = $t('Provided Zip/Postal Code seems to be invalid.');\r\n\r\n if (postcodeValidator.validatedPostCodeExample.length) {\r\n warnMessage += $t(' Example: ') + postcodeValidator.validatedPostCodeExample.join('; ') + '. ';\r\n }\r\n warnMessage += $t('If you believe it is the right one you can ignore this notice.');\r\n postcodeElement.warn(warnMessage);\r\n }\r\n\r\n return validationResult;\r\n }\r\n });\r\n }\r\n);\r\n","Mageplaza_Osc/js/model/braintree-paypal.js":"/**\r\n * Mageplaza\r\n *\r\n * NOTICE OF LICENSE\r\n *\r\n * This source file is subject to the Mageplaza.com license that is\r\n * available through the world-wide-web at this URL:\r\n * https://www.mageplaza.com/LICENSE.txt\r\n *\r\n * DISCLAIMER\r\n *\r\n * Do not edit or add to this file if you wish to upgrade this extension to newer\r\n * version in the future.\r\n *\r\n * @category Mageplaza\r\n * @package Mageplaza_Osc\r\n * @copyright Copyright (c) Mageplaza (https://www.mageplaza.com/)\r\n * @license https://www.mageplaza.com/LICENSE.txt\r\n */\r\n\r\ndefine(['ko'], function (ko) {\r\n 'use strict';\r\n return {\r\n isReviewRequired: ko.observable(false),\r\n customerEmail: ko.observable(null),\r\n active: ko.observable(false)\r\n }\r\n});","Mageplaza_Osc/js/model/payment-service.js":"/**\r\n * Mageplaza\r\n *\r\n * NOTICE OF LICENSE\r\n *\r\n * This source file is subject to the Mageplaza.com license that is\r\n * available through the world-wide-web at this URL:\r\n * https://www.mageplaza.com/LICENSE.txt\r\n *\r\n * DISCLAIMER\r\n *\r\n * Do not edit or add to this file if you wish to upgrade this extension to newer\r\n * version in the future.\r\n *\r\n * @category Mageplaza\r\n * @package Mageplaza_Osc\r\n * @copyright Copyright (c) Mageplaza (https://www.mageplaza.com/)\r\n * @license https://www.mageplaza.com/LICENSE.txt\r\n */\r\n\r\ndefine(\r\n [\r\n 'ko'\r\n ],\r\n function (ko) {\r\n 'use strict';\r\n\r\n return {\r\n isLoading: ko.observable(false)\r\n };\r\n }\r\n);\r\n","Mageplaza_Osc/js/model/osc-loader.js":"/**\r\n * Mageplaza\r\n *\r\n * NOTICE OF LICENSE\r\n *\r\n * This source file is subject to the Mageplaza.com license that is\r\n * available through the world-wide-web at this URL:\r\n * https://www.mageplaza.com/LICENSE.txt\r\n *\r\n * DISCLAIMER\r\n *\r\n * Do not edit or add to this file if you wish to upgrade this extension to newer\r\n * version in the future.\r\n *\r\n * @category Mageplaza\r\n * @package Mageplaza_Osc\r\n * @copyright Copyright (c) Mageplaza (https://www.mageplaza.com/)\r\n * @license https://www.mageplaza.com/LICENSE.txt\r\n */\r\n\r\ndefine(\r\n [\r\n 'jquery',\r\n 'Magento_Checkout/js/model/shipping-service',\r\n 'Magento_Checkout/js/model/totals',\r\n 'Mageplaza_Osc/js/model/payment-service'\r\n ],\r\n function ($, shippingService, totalService, paymentService) {\r\n 'use strict';\r\n\r\n var blockLoader = {\r\n shipping: {\r\n queue: 0,\r\n service: shippingService\r\n },\r\n payment: {\r\n queue: 0,\r\n service: paymentService\r\n },\r\n total: {\r\n queue: 0,\r\n service: totalService\r\n }\r\n };\r\n\r\n return {\r\n getServices: function (blocks) {\r\n var services = {\r\n payment: blockLoader.payment.service,\r\n total: blockLoader.total.service\r\n };\r\n\r\n if (typeof blocks !== 'undefined') {\r\n services = {};\r\n $.each(blocks, function (index, block) {\r\n if (blockLoader.hasOwnProperty(block)) {\r\n services[block] = blockLoader[block].service;\r\n }\r\n });\r\n }\r\n\r\n return services;\r\n },\r\n\r\n /**\r\n * Start full page loader action\r\n */\r\n startLoader: function (blocks) {\r\n var services = this.get
2Services(blocks);\r\n $.each(services, function (index, service) {\r\n blockLoader[index].queue += 1;\r\n service.isLoading(true);\r\n });\r\n },\r\n\r\n /**\r\n * Stop full page loader action\r\n */\r\n stopLoader: function (blocks) {\r\n var services = this.getServices(blocks);\r\n $.each(services, function (index, service) {\r\n blockLoader[index].queue -= 1;\r\n if (blockLoader[index].queue == 0) {\r\n service.isLoading(false);\r\n }\r\n });\r\n }\r\n };\r\n }\r\n);\r\n","Mageplaza_Osc/js/model/resource-url-manager.js":"/**\r\n * Mageplaza\r\n *\r\n * NOTICE OF LICENSE\r\n *\r\n * This source file is subject to the Mageplaza.com license that is\r\n * available through the world-wide-web at this URL:\r\n * https://www.mageplaza.com/LICENSE.txt\r\n *\r\n * DISCLAIMER\r\n *\r\n * Do not edit or add to this file if you wish to upgrade this extension to newer\r\n * version in the future.\r\n *\r\n * @category Mageplaza\r\n * @package Mageplaza_Osc\r\n * @copyright Copyright (c) Mageplaza (https://www.mageplaza.com/)\r\n * @license https://www.mageplaza.com/LICENSE.txt\r\n */\r\n\r\ndefine(\r\n [\r\n 'jquery',\r\n 'Magento_Checkout/js/model/resource-url-manager'\r\n ],\r\n function ($, resourceUrlManager) {\r\n \"use strict\";\r\n\r\n return $.extend({\r\n /** Get url for saving email to quote */\r\n getUrlForSaveEmailToQuote: function (quote) {\r\n var params = {cartId: quote.getQuoteId()};\r\n var urls = {\r\n 'guest': '/guest-carts/:cartId/save-email-to-quote'\r\n };\r\n\r\n return this.getUrl(urls, params);\r\n },\r\n\r\n /** Get url for checking email */\r\n getUrlForCheckIsEmailAvailable: function (quote) {\r\n var params = {cartId: quote.getQuoteId()};\r\n var urls = {\r\n 'guest': '/guest-carts/:cartId/isEmailAvailable'\r\n };\r\n\r\n return this.getUrl(urls, params);\r\n },\r\n\r\n /** Get url for update item qty and remove item */\r\n getUrlForUpdateItemInformation: function (quote, isRemove) {\r\n var params = this.getCheckoutMethod() === 'guest' ? {cartId: quote.getQuoteId()} : {};\r\n var urlPath = isRemove ? 'remove-item' : 'update-item';\r\n var urls = {\r\n 'guest': '/guest-carts/:cartId/' + urlPath,\r\n 'customer': '/carts/mine/' + urlPath\r\n };\r\n\r\n return this.getUrl(urls, params);\r\n },\r\n\r\n /** Get url for saving checkout information */\r\n getUrlForSetCheckoutInformation: function (quote) {\r\n var params = this.getCheckoutMethod() === 'guest' ? {cartId: quote.getQuoteId()} : {};\r\n var urls = {\r\n 'guest': '/guest-carts/:cartId/checkout-information',\r\n 'customer': '/carts/mine/checkout-information'\r\n };\r\n\r\n return this.getUrl(urls, params);\r\n },\r\n getUrlForGiftWrapInformation: function (quote) {\r\n var params = this.getCheckoutMethod() === 'guest' ? {cartId: quote.getQuoteId()} : {};\r\n var urls = {\r\n 'guest': '/guest-carts/:cartId/update-gift-wrap',\r\n 'customer': '/carts/mine/update-gift-wrap'\r\n };\r\n\r\n return this.getUrl(urls, params);\r\n },\r\n\r\n /** Get url for update item qty and remove item */\r\n getUrlForUpdatePaymentTotalInformation: function (quote) {\r\n var params = this.getCheckoutMethod() === 'guest' ? {cartId: quote.getQuoteId()} : {};\r\n var urls = {\r\n 'guest': '/guest-carts/:cartId/payment-total-information',\r\n 'customer': '/carts/mine/payment-total-information'\r\n };\r\n\r\n return this.getUrl(urls, params);\r\n },\r\n getUrlForGiftMessageItemInformation: function (quote, itemId) {\r\n var params = this.getCheckoutMethod() === 'guest' ? {cartId: quote.getQuoteId()} : {};\r\n var urls = {\r\n 'guest': '/guest-carts/:cartId/gift-message/' + itemId,\r\n 'customer': '/carts/mine/gift-message/' + itemId\r\n };\r\n\r\n return this.getUrl(urls, params);\r\n },\r\n\r\n /** Get url for discount payment method*/\r\n getUrlForDiscountPaymentMethod: function (quote) {\r\n var params = this.getCheckoutMethod() === 'guest' ? {cartId: quote.getQuoteId()} : {};\r\n var urls = {\r\n 'guest': '/guest-carts/:cartId/discount-payment-method',\r\n 'customer': '/carts/mine/discount-payment-method'\r\n };\r\n\r\n return this.getUrl(urls, params);\r\n }\r\n }, resourceUrlManager);\r\n }\r\n);\r\n","Mageplaza_Osc/js/model/osc-data.js":"/**\r\n * Mageplaza\r\n *\r\n * NOTICE OF LICENSE\r\n *\r\n * This source file is subject to the Mageplaza.com license that is\r\n * available through the world-wide-web at this URL:\r\n * https://www.mageplaza.com/LICENSE.txt\r\n *\r\n * DISCLAIMER\r\n *\r\n * Do not edit or add to this file if you wish to upgrade this extension to newer\r\n * version in the future.\r\n *\r\n * @category Mageplaza\r\n * @package Mageplaza_Osc\r\n * @copyright Copyright (c) Mageplaza (https://www.mageplaza.com/)\r\n * @license https://www.mageplaza.com/LICENSE.txt\r\n */\r\n\r\ndefine([\r\n 'jquery',\r\n 'Magento_Customer/js/customer-data'\r\n], function ($, storage) {\r\n 'use strict';\r\n\r\n var cacheKey = 'osc-data';\r\n\r\n var getData = function () {\r\n return storage.get(cacheKey)();\r\n };\r\n\r\n var saveData = function (checkoutData) {\r\n storage.set(cacheKey, checkoutData);\r\n };\r\n\r\n return {\r\n setData: function (key, data) {\r\n var obj = getData();\r\n obj[key] = data;\r\n saveData(obj);\r\n },\r\n\r\n getData: function (key) {\r\n if (typeof key === 'undefined') {\r\n return getData();\r\n }\r\n\r\n return getData()[key];\r\n }\r\n }\r\n});\r\n","Mageplaza_Osc/js/model/paypal/set-payment-method-mixin.js":"/**\r\n * Mageplaza\r\n *\r\n * NOTICE OF LICENSE\r\n *\r\n * This source file is subject to the Mageplaza.com license that is\r\n * available through the world-wide-web at this URL:\r\n * https://www.mageplaza.com/LICENSE.txt\r\n *\r\n * DISCLAIMER\r\n *\r\n * Do not edit or add to this file if you wish to upgrade this extension to newer\r\n * version in the future.\r\n *\r\n * @category Mageplaza\r\n * @package Mageplaza_Osc\r\n * @copyright Copyright (c) Mageplaza (https://www.mageplaza.com/)\r\n * @license https://www.mageplaza.com/LICENSE.txt\r\n */\r\n\r\n/*global alert*/\r\ndefine([\r\n 'jquery',\r\n 'mage/utils/wrapper',\r\n 'Mageplaza_Osc/js/action/set-payment-method'\r\n], function ($, wrapper, setPaymentMethodAction) {\r\n 'use strict';\r\n\r\n return function (originalSetPaymentMethodAction) {\r\n /** Override place-order-mixin for set-payment-information action as they differs only by method signature */\r\n return wrapper.wrap(originalSetPaymentMethodAction, function (originalAction, messageContainer) {\r\n return setPaymentMethodAction(messageContainer);\r\n });\r\n };\r\n});\r\n","Mageplaza_Osc/js/model/osc-loader/discount.js":"/**\r\n * Mageplaza\r\n *\r\n * NOTICE OF LICENSE\r\n *\r\n * This source file is subject to the Mageplaza.com license that is\r\n * available through the world-wide-web at this URL:\r\n * https://www.mageplaza.com/LICENSE.txt\r\n *\r\n * DISCLAIMER\r\n *\r\n * Do not edit or add to this file if you wish to upgrade this extension to newer\r\n * version in the future.\r\n *\r\n * @category Mageplaza\r\n * @package Mageplaza_Osc\r\n * @copyright Copyright (c) Mageplaza (https://www.mageplaza.com/)\r\n * @license https://www.mageplaza.com/LICENSE.txt\r\n */\r\n\r\ndefine(\r\n [\r\n 'ko'\r\n ],\r\n function (ko) {\r\n 'use strict';\r\n\r\n return {\r\n isLoading: ko.observable(false),\r\n\r\n /**\r\n * Start full page loader action\r\n */\r\n startLoader: function () {\r\n this.isLoading(true);\r\n },\r\n\r\n /**\r\n * Stop full page loader action\r\n */\r\n stopLoader: function () {\r\n this.isLoading(false);\r\n }\r\n };\r\n }\r\n);\r\n","Mageplaza_Osc/js/model/compatible/amazon-pay.js":"/**\r\n * Mageplaza\r\n *\r\n * NOTICE OF LICENSE\r\n *\r\n * This source file is subject to the Mageplaza.com license that is\r\n * available through the world-wide-web at this URL:\r\n * https://www.mageplaza.com/LICENSE.txt\r\n *\r\n * DISCLAIMER\r\n *\r\n * Do not edit or add to this file if you wish to upgrade this extension to newer\r\n * version in the future.\r\n *\r\n * @category Mageplaza\r\n * @package Mageplaza_Osc\r\n * @copyright Copyright (c) Mageplaza (https://www.mageplaza.com/)\r\n * @license https://www.mageplaza.com/LICENSE.txt\r\n */\r\n\r\ndefine(['ko'], function (ko) {\r\n 'use strict';\r\n var hasLogin = window.checkoutConfig.oscConfig.isAmazonAccountLoggedIn;\r\n return {\r\n isAmazonAccountLoggedIn: ko.observable(hasLogin),\r\n setLogin: function (value) {\r\n return this.isAmazonAccountLoggedIn(value);\r\n }\r\n };\r\n});","Mageplaza_Osc/js/model/shipping-save-processor/checkout.js":"/**\n * Mageplaza\n *\n * NOTICE OF LICENSE\n *\n * This source file is subject to the Mageplaza.com license that is\n * available through the world-wide-web at this URL:\n * https://www.mageplaza.com/LICENSE.txt\n *\n * DISCLAIMER\n *\n * Do not edit or add to this file if you wish to upgrade this extension to newer\n * version in the future.\n *\n * @category Mageplaza\n * @package Mageplaza_Osc\n * @copyright Copyright (c) Mageplaza (https://www.mageplaza.com/)\n * @license https://www.mageplaza.com/LICENSE.txt\n */\n\ndefine(\n [\n 'ko',\n 'jquery',\n 'underscore',\n 'Magento_Checkout/js/model/quote',\n 'Mageplaza_Osc/js/model/resource-url-manager',\n 'mage/storage',\n 'Mageplaza_Osc/js/model/osc-data',\n 'Magento_Checkout/js/model/payment-service',\n 'Magento_Checkout/js/model/payment/method-converter',\n 'Magento_Checkout/js/model/error-processor',\n 'Magento_Checkout/js/model/full-screen-loader',\n 'Magento_Checkout/js/action/select-billing-address'\n ],\n function (ko,\n $,\n _,\n quote,\n resourceUrlManager,\n storage,\n oscData,\n paymentService,\n methodConverter,\n errorProcessor,\n fullScreenLoader,\n selectBillingAddressAction) {\n 'use strict';\n\n return {\n saveShippingInformation: function () {\n var payload,\n addressInformation = {},\n additionInformation = oscData.getData();\n if (window.checkoutConfig.oscConfig.giftMessageOptions.isOrderLevelGiftOptionsEnabled) {\n additionInformation.giftMessage = this.saveGiftMessage();\n }\n if (!quote.billingAddress()) {\n selectBillingAddressAction(quote.shippingAddress());\n }\n\n if (!quote.isVirtual()) {\n addressInformation = {\n shipping_address: quote.shippingAddress(),\n billing_address: quote.billingAddress(),\n shipping_method_code: quote.shippingMethod().method_code,\n shipping_carrier_code: quote.shippingMethod().carrier_code\n };\n } else {\n if ($.isEmptyObject(additionInformation)) {\n return $.Deferred().resolve();\n }\n addressInformation = {\n billing_address: quote.billingAddress()\n };\n }\n\n var customAttributes = {};\n if (_.isObject(quote.billingAddress().customAttributes)) {\n _.each(quote.billingAddress().customAttributes, function (attribute, key) {\n if (_.isArray(attribute)) {\
2n customAttributes[key] = attribute.join(',')\n } else if (_.isString(attribute) || _.isNumber(attribute)) {\n customAttributes[key] = attribute\n } else if (_.isObject(attribute)) {\n customAttributes[attribute.attribute_code] = attribute.value\n }\n });\n }\n\n payload = {\n addressInformation: addressInformation,\n customerAttributes: customAttributes,\n additionInformation: additionInformation\n };\n\n this.payloadExtender(payload);\n\n fullScreenLoader.startLoader();\n\n return storage.post(\n resourceUrlManager.getUrlForSetCheckoutInformation(quote),\n JSON.stringify(payload)\n ).fail(\n function (response) {\n errorProcessor.process(response);\n }\n ).always(\n function () {\n fullScreenLoader.stopLoader();\n }\n );\n },\n\n saveGiftMessage: function () {\n var giftMessage = {};\n if (!$(\"#osc-gift-message\").is(\":checked\")) $('.gift-options-content').find('input:text,textarea').val('');\n giftMessage.sender = $(\"#gift-message-whole-from\").val();\n giftMessage.recipient = $(\"#gift-message-whole-to\").val();\n giftMessage.message = $(\"#gift-message-whole-message\").val();\n return JSON.stringify(giftMessage);\n },\n\n payloadExtender: function (payload) {\n if (!payload.addressInformation.hasOwnProperty('shipping_address')) {\n return payload;\n }\n\n var deliveryData = {\n mp_delivery_date: $('#mp-delivery-date').val(),\n mp_delivery_time: $('#mp-delivery-time').val(),\n mp_house_security_code: $('#mp-house-security-code').val(),\n mp_delivery_comment: $('#mp-delivery-comment').val()\n };\n\n if (!payload.addressInformation.shipping_address.hasOwnProperty('extension_attributes')) {\n payload.addressInformation.shipping_address.extension_attributes = {};\n }\n\n payload.addressInformation.shipping_address.extension_attributes = $.extend(\n payload.addressInformation.shipping_address.extension_attributes,\n deliveryData\n )\n }\n };\n }\n);\n","Mageplaza_Osc/js/model/address/auto-complete.js":"/**\r\n * Mageplaza\r\n *\r\n * NOTICE OF LICENSE\r\n *\r\n * This source file is subject to the Mageplaza.com license that is\r\n * available through the world-wide-web at this URL:\r\n * https://www.mageplaza.com/LICENSE.txt\r\n *\r\n * DISCLAIMER\r\n *\r\n * Do not edit or add to this file if you wish to upgrade this extension to newer\r\n * version in the future.\r\n *\r\n * @category Mageplaza\r\n * @package Mageplaza_Osc\r\n * @copyright Copyright (c) Mageplaza (https://www.mageplaza.com/)\r\n * @license https://www.mageplaza.com/LICENSE.txt\r\n */\r\n\r\ndefine([\r\n 'Mageplaza_Osc/js/model/address/type/google'\r\n], function (googleAutoComplete) {\r\n 'use strict';\r\n\r\n var addressType = {\r\n billing: 'checkout.steps.shipping-step.billingAddress.billing-address-fieldset',\r\n shipping: 'checkout.steps.shipping-step.shippingAddress.shipping-address-fieldset'\r\n };\r\n\r\n return {\r\n register: function (type) {\r\n if (addressType.hasOwnProperty(type)) {\r\n switch (window.checkoutConfig.oscConfig.autocomplete.type) {\r\n case 'google':\r\n new googleAutoComplete(addressType[type]);\r\n break;\r\n case 'pca':\r\n break;\r\n default :\r\n break;\r\n }\r\n }\r\n }\r\n };\r\n});\r\n\r\n\r\n","Mageplaza_Osc/js/model/address/type/google.js":"/**\n * Mageplaza\n *\n * NOTICE OF LICENSE\n *\n * This source file is subject to the Mageplaza.com license that is\n * available through the world-wide-web at this URL:\n * https://www.mageplaza.com/LICENSE.txt\n *\n * DISCLAIMER\n *\n * Do not edit or add to this file if you wish to upgrade this extension to newer\n * version in the future.\n *\n * @category Mageplaza\n * @package Mageplaza_Osc\n * @copyright Copyright (c) Mageplaza (https://www.mageplaza.com/)\n * @license https://www.mageplaza.com/LICENSE.txt\n */\n\ndefine([\n 'jquery',\n 'uiClass',\n 'uiRegistry'\n], function ($, Class, registry) {\n 'use strict';\n\n var specificCountry = window.checkoutConfig.oscConfig.autocomplete.google_default_country,\n elementFields = ['street', 'country_id', 'city', 'region', 'region_id', 'region_id_input', 'postcode'];\n var componentForm = {\n street_number: 'short_name',\n route: 'long_name',\n neighborhood: 'long_name',\n administrative_area_level_2: 'short_name',\n locality: 'long_name',\n administrative_area_level_1: 'long_name',\n country: 'short_name',\n postal_code: 'short_name'\n };\n var isUsedMaterialDesign = window.checkoutConfig.oscConfig.isUsedMaterialDesign;\n\n return Class.extend({\n initialize: function (fieldsetName) {\n this._super();\n\n this.initAddressElements(fieldsetName)\n .initAutoComplete();\n\n return this;\n },\n initAddressElements: function (fieldsetName) {\n var self = this;\n\n this.addressElements = {};\n\n $.each(elementFields, function (index, field) {\n registry.async(fieldsetName + '.' + field)(function (fieldElement) {\n if (field === 'street') {\n $.each(fieldElement.elems(), function (key, elem) {\n if (key === 0) {\n fieldElement = elem;\n self.inputSelector = document.getElementById(elem.uid);\n self.geolocateSelector = $('#' + elem.uid + '-geolocation');\n }\n });\n }\n if (typeof fieldElement !== 'undefined') {\n self.addressElements[field] = fieldElement;\n }\n });\n });\n\n return this;\n },\n initAutoComplete: function () {\n if (this.inputSelector) {\n var options = {\n types: ['geocode']\n };\n if (specificCountry) {\n options.componentRestrictions = {country: specificCountry};\n }\n\n this.autoComplete = new google.maps.places.Autocomplete(this.inputSelector, options);\n if (isUsedMaterialDesign) {\n $(this.inputSelector).attr('placeholder', '');\n }\n\n this.autoComplete.addListener('place_changed', this.placeChangedListener.bind(this));\n\n //if(!specificCountry) {\n // this.geolocate();\n //}\n\n if (this.geolocateSelector.length) {\n this.geolocateSelector.on('click', this.getCurrentLocation.bind(this));\n }\n }\n\n return this;\n },\n placeChangedListener: function () {\n var place = this.autoComplete.getPlace();\n\n this.unserializeAddress(place);\n },\n\n unserializeAddress: function (place) {\n var responseComponents = this.initResponseComponents();\n\n for (var i = 0; i < place.address_components.length;
2 i++) {\n var addressType = place.address_components[i].types[0];\n if (componentForm.hasOwnProperty(addressType)) {\n var addressValue = place.address_components[i][componentForm[addressType]];\n\n if ($.inArray(addressType, ['street_number', 'route', 'administrative_area_level_2']) !== -1) {\n if (responseComponents.street != '') {\n responseComponents.street += ', ';\n }\n responseComponents.street += addressValue;\n }\n if (addressType == 'locality') {\n responseComponents.city = addressValue;\n }\n if (addressType == 'administrative_area_level_1') {\n responseComponents.region = addressValue;\n responseComponents.region_id = addressValue;\n responseComponents.region_id_input = addressValue;\n }\n if (addressType == 'country') {\n responseComponents.country_id = addressValue;\n }\n if (addressType == 'postal_code') {\n responseComponents.postcode = addressValue;\n }\n }\n }\n if (place.hasOwnProperty('name')) {\n responseComponents.street = place.name;\n }\n\n this.fillInAddress(responseComponents);\n },\n\n fillInAddress: function (components) {\n var self = this;\n $.each(this.addressElements, function (index, element) {\n if (element.visible() && components.hasOwnProperty(index)) {\n if (index == 'region_id') {\n $.each(element.options(), function (key, option) {\n if (components[index] == option.label) {\n element.value(option.value);\n return false;\n }\n });\n } else {\n if (index == 'street') {\n self.inputSelector.value += components[index];\n }else {\n element.value(components[index]);\n }\n }\n }\n });\n },\n\n /**\n * Bias the autocomplete object to the user's geographical location\n */\n geolocate: function () {\n var self = this;\n\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(function (position) {\n var geolocation = {\n lat: position.coords.latitude,\n lng: position.coords.longitude\n };\n var circle = new google.maps.Circle({\n center: geolocation,\n radius: position.coords.accuracy\n });\n self.autoComplete.setBounds(circle.getBounds());\n });\n }\n },\n\n getCurrentLocation: function () {\n var self = this;\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(function (position) {\n var geocoder = new google.maps.Geocoder();\n var location = new google.maps.LatLng(position.coords.latitude, position.coords.longitude);\n geocoder.geocode({'latLng': location}, function (results, status) {\n if (status == google.maps.GeocoderStatus.OK) {\n self.unserializeAddress(results[0]);\n } else {\n return false;\n }\n });\n });\n }\n },\n\n initResponseComponents: function () {\n return {\n street: '',\n country_id: '',\n region: '',\n region_id: '',\n region_id_input: '',\n city: '',\n postcode: ''\n };\n }\n });\n});\n","Mageplaza_Osc/js/action/check-email-availability.js":"/**\r\n * Mageplaza\r\n *\r\n * NOTICE OF LICENSE\r\n *\r\n * This source file is subject to the Mageplaza.com license that is\r\n * available through the world-wide-web at this URL:\r\n * https://www.mageplaza.com/LICENSE.txt\r\n *\r\n * DISCLAIMER\r\n *\r\n * Do not edit or add to this file if you wish to upgrade this extension to newer\r\n * version in the future.\r\n *\r\n * @category Mageplaza\r\n * @package Mageplaza_Osc\r\n * @copyright Copyright (c) Mageplaza (https://www.mageplaza.com/)\r\n * @license https://www.mageplaza.com/LICENSE.txt\r\n */\r\n\r\ndefine([\r\n 'mage/storage',\r\n 'Mageplaza_Osc/js/model/resource-url-manager',\r\n 'Magento_Checkout/js/model/quote'\r\n], function (storage, resourceUrlManager, quote) {\r\n 'use strict';\r\n\r\n return function (email) {\r\n return storage.post(\r\n resourceUrlManager.getUrlForCheckIsEmailAvailable(quote),\r\n JSON.stringify({\r\n customerEmail: email\r\n }),\r\n false\r\n );\r\n };\r\n});\r\n","Mageplaza_Osc/js/action/discount-payment-method.js":"/**\n * Mageplaza\n *\n * NOTICE OF LICENSE\n *\n * This source file is subject to the mageplaza.com license that is\n * available through the world-wide-web at this URL:\n * https://www.mageplaza.com/LICENSE.txt\n *\n * DISCLAIMER\n *\n * Do not edit or add to this file if you wish to upgrade this extension to newer\n * version in the future.\n *\n * @category Mageplaza\n * @package Mageplaza_Osc\n * @copyright Copyright (c) Mageplaza (https://www.mageplaza.com/)\n * @license https://www.mageplaza.com/LICENSE.txt\n */\n \ndefine(\n [\n 'Magento_Checkout/js/model/totals',\n 'Magento_Checkout/js/model/quote',\n 'Mageplaza_Osc/js/model/resource-url-manager',\n 'Mageplaza_Osc/js/model/discount-payment-method',\n 'jquery'\n ],\n function (totals,\n quote,\n resourceUrlManager,\n discountPaymentMethod,\n $) {\n 'use strict';\n\n return function (paymentData) {\n totals.isLoading(true);\n\n if (paymentData && paymentData.hasOwnProperty('__disableTmpl')) {\n delete paymentData.__disableTmpl;\n }\n\n var payload;\n var paymentMethodName = null;\n \n if (paymentData.hasOwnProperty('title')) {\n paymentData = {\n additional_data: null,\n method: paymentData.method,\n po_number: null,\n }\n }\n /**\n * @author : KK\n * @de
2scription : Check payment method is selected or not.\n * @date : 23 Feb 2023\n */\n if($.isArray(paymentData.method)) {\n $.each(paymentData.method, function( index, value ) {\n if (value) {\n paymentMethodName = value;\n }\n });\n paymentData.method = paymentMethodName;\n }\n \n payload = {\n cartId: quote.getQuoteId(),\n paymentMethod: paymentData,\n billingAddress: quote.billingAddress()\n };\n return discountPaymentMethod(resourceUrlManager.getUrlForDiscountPaymentMethod(quote), payload);\n };\n }\n);\n","Mageplaza_Osc/js/action/gift-wrap.js":"/**\r\n * Mageplaza\r\n *\r\n * NOTICE OF LICENSE\r\n *\r\n * This source file is subject to the Mageplaza.com license that is\r\n * available through the world-wide-web at this URL:\r\n * https://www.mageplaza.com/LICENSE.txt\r\n *\r\n * DISCLAIMER\r\n *\r\n * Do not edit or add to this file if you wish to upgrade this extension to newer\r\n * version in the future.\r\n *\r\n * @category Mageplaza\r\n * @package Mageplaza_Osc\r\n * @copyright Copyright (c) Mageplaza (https://www.mageplaza.com/)\r\n * @license https://www.mageplaza.com/LICENSE.txt\r\n */\r\n\r\ndefine(\r\n [\r\n 'Magento_Checkout/js/model/quote',\r\n 'Mageplaza_Osc/js/model/resource-url-manager',\r\n 'mage/storage',\r\n 'Magento_Checkout/js/model/error-processor',\r\n 'Magento_Customer/js/model/customer',\r\n 'Magento_Checkout/js/model/payment/method-converter',\r\n 'Magento_Checkout/js/model/payment-service',\r\n 'Magento_Checkout/js/model/shipping-service',\r\n 'Mageplaza_Osc/js/model/osc-loader',\r\n 'Mageplaza_Osc/js/model/osc-data'\r\n ],\r\n function (quote,\r\n resourceUrlManager,\r\n storage,\r\n errorProcessor,\r\n customer,\r\n methodConverter,\r\n paymentService,\r\n shippingService,\r\n oscLoader,\r\n oscData) {\r\n 'use strict';\r\n\r\n var itemUpdateLoader = ['shipping', 'payment', 'total'];\r\n\r\n return function (payload) {\r\n if (!customer.isLoggedIn()) {\r\n payload.cart_id = quote.getQuoteId();\r\n }\r\n\r\n oscLoader.startLoader(itemUpdateLoader);\r\n\r\n return storage.post(\r\n resourceUrlManager.getUrlForGiftWrapInformation(quote),\r\n JSON.stringify(payload)\r\n ).done(\r\n function (response) {\r\n if (response.redirect_url) {\r\n window.location.href = response.redirect_url;\r\n return;\r\n }\r\n oscData.setData('is_use_gift_wrap', payload.is_use_gift_wrap);\r\n quote.setTotals(response.totals);\r\n paymentService.setPaymentMethods(methodConverter(response.payment_methods));\r\n if (response.shipping_methods && !quote.isVirtual()) {\r\n shippingService.setShippingRates(response.shipping_methods);\r\n }\r\n }\r\n ).fail(\r\n function (response) {\r\n errorProcessor.process(response);\r\n }\r\n ).always(\r\n function () {\r\n oscLoader.stopLoader(itemUpdateLoader);\r\n }\r\n );\r\n };\r\n }\r\n);\r\n","Mageplaza_Osc/js/action/select-payment-method-mixin.js":"/**\n * Mageplaza\n *\n * NOTICE OF LICENSE\n *\n * This source file is subject to the Mageplaza.com license that is\n * available through the world-wide-web at this URL:\n * https://www.mageplaza.com/LICENSE.txt\n *\n * DISCLAIMER\n *\n * Do not edit or add to this file if you wish to upgrade this extension to newer\n * version in the future.\n *\n * @category Mageplaza\n * @package Mageplaza_Osc\n * @copyright Copyright (c) Mageplaza (https://www.mageplaza.com/)\n * @license https://www.mageplaza.com/LICENSE.txt\n */\n\ndefine([\n 'jquery',\n 'mage/utils/wrapper',\n 'Magento_Checkout/js/model/quote',\n 'Magento_SalesRule/js/model/payment/discount-messages',\n 'Magento_Checkout/js/action/set-payment-information-extended',\n 'Magento_Checkout/js/action/get-totals',\n 'Magento_SalesRule/js/model/coupon'\n], function ($, wrapper, quote, messageContainer, setPaymentInformationExtended, getTotalsAction, coupon) {\n 'use strict';\n\n return function (selectPaymentMethodAction) {\n\n return wrapper.wrap(selectPaymentMethodAction, function (originalSelectPaymentMethodAction, paymentMethod) {\n\n originalSelectPaymentMethodAction(paymentMethod);\n\n if (paymentMethod === null || quote.guestEmail === null) {\n return;\n }\n\n $.when(\n setPaymentInformationExtended(\n messageContainer,\n {\n method: paymentMethod.method\n },\n true\n )\n ).done(\n function () {\n var deferred = $.Deferred(),\n\n /**\n * Update coupon form.\n */\n updateCouponCallback = function () {\n if (quote.totals() && !quote.totals()['coupon_code']) {\n coupon.setCouponCode('');\n coupon.setIsApplied(false);\n }\n };\n\n getTotalsAction([], deferred);\n $.when(deferred).done(updateCouponCallback);\n }\n );\n });\n };\n\n});\n","Mageplaza_Osc/js/action/gift-message-item.js":"/**\r\n * Mageplaza\r\n *\r\n * NOTICE OF LICENSE\r\n *\r\n * This source file is subject to the Mageplaza.com license that is\r\n * available through the world-wide-web at this URL:\r\n * https://www.mageplaza.com/LICENSE.txt\r\n *\r\n * DISCLAIMER\r\n *\r\n * Do not edit or add to this file if you wish to upgrade this extension to newer\r\n * version in the future.\r\n *\r\n * @category Mageplaza\r\n * @package Mageplaza_Osc\r\n * @copyright Copyright (c) Mageplaza (https://www.mageplaza.com/)\r\n * @license https://www.mageplaza.com/LICENSE.txt\r\n */\r\n\r\ndefine(\r\n [\r\n 'jquery',\r\n 'Magento_Checkout/js/model/quote',\r\n 'Mageplaza_Osc/js/model/resource-url-manager',\r\n 'Mageplaza_Osc/js/model/gift-message',\r\n 'mage/storage'\r\n ],\r\n function ($,\r\n quote,\r\n resourceUrlManager,\r\n giftMessageModel,\r\n storage) {\r\n 'use strict';\r\n\r\n var giftMessageItems = window.checkoutConfig.oscConfig.giftMessageOptions.giftMessage.itemLevel,\r\n giftMessageModel = new giftMe
2ssageModel();\r\n\r\n return function (data, itemId, remove) {\r\n return storage.post(\r\n resourceUrlManager.getUrlForGiftMessageItemInformation(quote, itemId),\r\n JSON.stringify(data)\r\n ).done(\r\n function (response) {\r\n if (response == true) {\r\n if (remove) {\r\n delete giftMessageItems[itemId].message;\r\n giftMessageModel.showMessage('success', 'Delete gift message item success.');\r\n return this;\r\n }\r\n giftMessageItems[itemId]['message'] = data.gift_message;\r\n giftMessageModel.showMessage('success', 'Update gift message item success.');\r\n }\r\n }\r\n ).fail(\r\n function () {\r\n if (remove) {\r\n giftMessageModel.showMessage('error', 'Can not delete gift message item. Please try again!');\r\n }\r\n giftMessageModel.showMessage('error', 'Can not update gift message item. Please try again!');\r\n }\r\n )\r\n };\r\n }\r\n);\r\n","Mageplaza_Osc/js/action/update-item.js":"/**\r\n * Override the Update qty JS file to keep the laoder visible till the page loads completely.\r\n * PM VK, 26.05.21, @link - https://trello.com/c/gXaTGkQY/386-menge-erh%C3%B6hen-reduzieren-im-checkout-funktioniert-nicht\r\n */\r\n\r\ndefine([\r\n 'jquery',\r\n 'Magento_Checkout/js/action/get-totals',\r\n 'Magento_Checkout/js/model/quote',\r\n 'Mageplaza_Osc/js/model/resource-url-manager',\r\n 'mage/storage',\r\n 'Magento_Checkout/js/model/error-processor',\r\n 'Magento_Customer/js/model/customer',\r\n 'Magento_Checkout/js/model/payment/method-converter',\r\n 'Magento_Checkout/js/model/payment-service',\r\n 'Magento_Checkout/js/model/shipping-service',\r\n 'Mageplaza_Osc/js/model/osc-loader',\r\n 'Magento_Customer/js/customer-data',\r\n 'uiRegistry',\r\n 'mage/url'\r\n], function ($,\r\n getTotalsAction,\r\n quote,\r\n resourceUrlManager,\r\n storage,\r\n errorProcessor,\r\n customer,\r\n methodConverter,\r\n paymentService,\r\n shippingService,\r\n oscLoader,\r\n customerData,\r\n registry,\r\n url) {\r\n 'use strict';\r\n\r\n var itemUpdateLoader = ['shipping', 'payment', 'total'];\r\n\r\n return function (payload) {\r\n var isRemove = !('item_qty' in payload);\r\n\r\n if (!customer.isLoggedIn()) {\r\n payload.cart_id = quote.getQuoteId();\r\n }\r\n\r\n\r\n\r\n oscLoader.startLoader(itemUpdateLoader);\r\n\r\n return storage.post(\r\n resourceUrlManager.getUrlForUpdateItemInformation(quote, isRemove),\r\n JSON.stringify(payload)\r\n ).done(\r\n function (response) {\r\n var options, paths;\r\n\r\n if (response.redirect_url) {\r\n window.location.href = response.redirect_url;\r\n return;\r\n }\r\n\r\n // remove downloadable options on cart item reload\r\n $('#downloadable-links-list').remove();\r\n $('#links-advice-container').remove();\r\n\r\n if (response.image_data) {\r\n registry.get('checkout.sidebar.summary.cart_items.details.thumbnail').imageData\r\n = JSON.parse(response.image_data);\r\n }\r\n\r\n if (response.options) {\r\n options = JSON.parse(response.options);\r\n\r\n response.totals.items.forEach(function (item) {\r\n item.mposc = options[item.item_id];\r\n });\r\n }\r\n\r\n if (response.request_path) {\r\n paths = JSON.parse(response.request_path);
2\r\n\r\n response.totals.items.forEach(function (item) {\r\n item.request_path = paths[item.item_id];\r\n });\r\n }\r\n\r\n quote.setTotals(response.totals);\r\n paymentService.setPaymentMethods(methodConverter(response.payment_methods));\r\n if (response.shipping_methods && !quote.isVirtual()) {\r\n shippingService.setShippingRates(response.shipping_methods);\r\n }\r\n customerData.reload(['cart'], true);\r\n // Reload the checkout page after selecting the input qty box. PM PS, 26.05.20, @link - https://trello.com/c/yu5wPD4C/\r\n //window.location.href = url.build('onestepcheckout');\r\n // Update the totals in the summary\r\n // The cart page totals summary block update\r\n var deferred = $.Deferred();\r\n getTotalsAction([], deferred);\r\n /**\r\n * @author : KK\r\n * @description : Enable Button after Ajax processing\r\n * @date : 10 August 2023\r\n */\r\n setTimeout(function () {\r\n $('.action.primary.checkout').removeAttr('disabled');\r\n }, 500);\r\n \r\n }\r\n ).fail(\r\n function (response) {\r\n errorProcessor.process(response);\r\n }\r\n ).always(\r\n function () {\r\n oscLoader.stopLoader(itemUpdateLoader);\r\n }\r\n );\r\n };\r\n});\r\n","Mageplaza_Osc/js/action/payment-total-information.js":"/**\r\n * Mageplaza\r\n *\r\n * NOTICE OF LICENSE\r\n *\r\n * This source file is subject to the Mageplaza.com license that is\r\n * available through the world-wide-web at this URL:\r\n * https://www.mageplaza.com/LICENSE.txt\r\n *\r\n * DISCLAIMER\r\n *\r\n * Do not edit or add to this file if you wish to upgrade this extension to newer\r\n * version in the future.\r\n *\r\n * @category Mageplaza\r\n * @package Mageplaza_Osc\r\n * @copyright Copyright (c) Mageplaza (https://www.mageplaza.com/)\r\n * @license https://www.mageplaza.com/LICENSE.txt\r\n */\r\n\r\ndefine(\r\n [\r\n 'jquery',\r\n 'Magento_Checkout/js/model/quote',\r\n 'Mageplaza_Osc/js/model/resource-url-manager',\r\n 'mage/storage',\r\n 'Magento_Checkout/js/model/error-processor',\r\n 'Magento_Customer/js/model/customer',\r\n 'Magento_Checkout/js/model/payment/method-converter',\r\n 'Magento_Checkout/js/model/payment-service',\r\n 'Magento_Checkout/js/model/shipping-service',\r\n 'Mageplaza_Osc/js/model/osc-loader',\r\n 'uiRegistry'\r\n ],\r\n function ($,\r\n quote,\r\n resourceUrlManager,\r\n storage,\r\n errorProcessor,\r\n customer,\r\n methodConverter,\r\n paymentService,\r\n shippingService,\r\n oscLoader,\r\n registry) {\r\n 'use strict';\r\n\r\n return function () {\r\n oscLoader.startLoader();\r\n\r\n return storage.post(\r\n resourceUrlManager.getUrlForUpdatePaymentTotalInformation(quote)\r\n ).done(\r\n function (response) {\r\n var options, paths ,\r\n thumbnailComponent = registry.get('checkout.sidebar.summary.cart_items.details.thumbnail');\r\n\r\n if (response.redirect_url) {\r\n window.location.href = response.redirect_url;\r\n return;\r\n }\r\n\r\n // remove downloadable options on cart item reload\r\n $('#downloadable-links-list').remove();\r\n $('#links-advice-container').remove();\r\n\r\n if (response.image_data && thumbnailComponent) {\r\n thumbnailComponent.imageData = JSON.parse(response.image_data);\r\n }\r\n\r\n if (response.options) {\r\n options = JSON.parse(response.options);
2\r\n\r\n response.totals.items.forEach(function (item) {\r\n item.mposc = options[item.item_id];\r\n });\r\n }\r\n\r\n if (response.request_path) {\r\n paths = JSON.parse(response.request_path);\r\n\r\n response.totals.items.forEach(function (item) {\r\n item.request_path = paths[item.item_id];\r\n });\r\n }\r\n\r\n quote.setTotals(response.totals);\r\n paymentService.setPaymentMethods(methodConverter(response.payment_methods));\r\n }\r\n ).fail(\r\n function (response) {\r\n errorProcessor.process(response);\r\n }\r\n ).always(\r\n function () {\r\n oscLoader.stopLoader();\r\n }\r\n );\r\n };\r\n }\r\n);\r\n","Mageplaza_Osc/js/action/set-payment-method.js":"/**\r\n * Mageplaza\r\n *\r\n * NOTICE OF LICENSE\r\n *\r\n * This source file is subject to the Mageplaza.com license that is\r\n * available through the world-wide-web at this URL:\r\n * https://www.mageplaza.com/LICENSE.txt\r\n *\r\n * DISCLAIMER\r\n *\r\n * Do not edit or add to this file if you wish to upgrade this extension to newer\r\n * version in the future.\r\n *\r\n * @category Mageplaza\r\n * @package Mageplaza_Osc\r\n * @copyright Copyright (c) Mageplaza (https://www.mageplaza.com/)\r\n * @license https://www.mageplaza.com/LICENSE.txt\r\n */\r\n\r\ndefine([\r\n 'underscore',\r\n 'jquery',\r\n 'Magento_Checkout/js/model/quote',\r\n 'Magento_Checkout/js/model/url-builder',\r\n 'mage/storage',\r\n 'Magento_Checkout/js/model/error-processor',\r\n 'Magento_Customer/js/model/customer',\r\n 'Magento_Checkout/js/model/full-screen-loader',\r\n 'Magento_CheckoutAgreements/js/model/agreements-assigner'\r\n], function ($, _, quote, urlBuilder, storage, errorProcessor, customer, fullScreenLoader, agreementsAssigner) {\r\n 'use strict';\r\n\r\n return function (messageContainer) {\r\n var serviceUrl,\r\n payload,\r\n paymentData = _.extend({}, quote.paymentMethod());\r\n\r\n agreementsAssigner(paymentData);\r\n\r\n if(paymentData.method === 'paypal_express'){\r\n delete paymentData.__disableTmpl;\r\n delete paymentData.title;\r\n }\r\n\r\n /**\r\n * Checkout for guest and registered customer.\r\n */\r\n if (!customer.isLoggedIn()) {\r\n serviceUrl = urlBuilder.createUrl('/guest-carts/:cartId/set-payment-information', {\r\n cartId: quote.getQuoteId()\r\n });\r\n payload = {\r\n cartId: quote.getQuoteId(),\r\n email: quote.guestEmail,\r\n paymentMethod: paymentData\r\n };\r\n } else {\r\n serviceUrl = urlBuilder.createUrl('/carts/mine/set-payment-information', {});\r\n payload = {\r\n cartId: quote.getQuoteId(),\r\n paymentMethod: paymentData\r\n };\r\n }\r\n fullScreenLoader.startLoader();\r\n\r\n return storage.post(\r\n serviceUrl, JSON.stringify(payload)\r\n ).fail(function (response) {\r\n errorProcessor.process(response, messageContainer);\r\n }).always(function () {\r\n fullScreenLoader.stopLoader();\r\n });\r\n };\r\n});\r\n","Mageplaza_Osc/js/action/place-order-mixins.js":"/**\r\n * Mageplaza\r\n *\r\n * NOTICE OF LICENSE\r\n *\r\n * This source file is subject to the Mageplaza.com license that is\r\n * available through the world-wide-web at this URL:\r\n * https://www.mageplaza.com/LICENSE.txt\r\n *\r\n * DISCLAIMER\r\n *\r\n * Do not edit or add to this file if you wish to upgrade this extension to newer\r\n * version in the future.\r\n *\r\n * @category Mageplaza\r\n * @package Mageplaza_Osc\r\n * @copyright Copyright (c) Mageplaza (https://www.mageplaza.com/)\r\n * @license https://www.mageplaza.com/LICENSE.txt\r\n */\r\n\r\ndefine([\r\n 'jquery',\r\n 'mage/utils/wrapper',\r\n 'Mageplaza_Osc/js/action/set-checkout-information',\r\n], function ($, wrapper, setCheckoutInformationAction) {\r\n 'use strict';\r\n\r\n return function (placeOrderAction) {\r\n return wrapper.wrap(placeOrderAction, function (originalAction, paymentData, messageContainer) {\r\n var deferred = $.Deferred();\r\n\r\n if (paymentData && paymentData.method === 'braintree_paypal') {\r\n setCheckoutInformationAction().done(function () {\r\n originalAction(paymentData, messageContainer).done(function (response) {\r\n deferred.resolve(response);\r\n }).fail(function (response) {\r\n deferred.reject(response);\r\n });\r\n }).fail(function (response) {\r\n deferred.reject(response);\r\n });\r\n } else {\r\n return originalAction(paymentData, messageContainer).fail(function (response) {\r\n if(paymentData && paymentData.method === 'stripe_payments'){\r\n deferred.reject(response);\r\n }else {\r\n if ($('.message-error').length) {\r\n $('html, body').scrollTop(\r\n $('.message-error:visible:first').closest('div').offset().top - $(window).height() / 2\r\n );\r\n }\r\n }\r\n });\r\n }\r\n\r\n return deferred;\r\n });\r\n };\r\n});\r\n","Mageplaza_Osc/js/action/set-checkout-information.js":"/**\r\n * Mageplaza\r\n *\r\n * NOTICE OF LICENSE\r\n *\r\n * This source file is subject to the Mageplaza.com license that is\r\n * available through the world-wide-web at this URL:\r\n * https://www.mageplaza.com/LICENSE.txt\r\n *\r\n * DISCLAIMER\r\n *\r\n * Do not edit or add to this file if you wish to upgrade this extension to newer\r\n * version in the future.\r\n *\r\n * @category Mageplaza\r\n * @package Mageplaza_Osc\r\n * @copyright Copyright (c) Mageplaza (https://www.mageplaza.com/)\r\n * @license https://www.mageplaza.com/LICENSE.txt\r\n */\r\n\r\ndefine(\r\n [\r\n 'Magento_Checkout/js/model/shipping-save-processor',\r\n 'Mageplaza_Osc/js/model/shipping-save-processor/checkout'\r\n ],\r\n function (shippingSaveProcessor, oscProcessor) {\r\n 'use strict';\r\n\r\n shippingSaveProcessor.registerProcessor('osc', oscProcessor);\r\n\r\n return function () {\r\n return shippingSaveProcessor.saveShippingInformation('osc');\r\n }\r\n }\r\n);\r\n","Mageplaza_Osc/js/view/payment.js":"/**\n * Mageplaza\n *\n * NOTICE OF LICENSE\n *\n * This source file is subject to the Mageplaza.com license that is\n * available through the world-wide-web at this URL:\n * https://www.mageplaza.com/LICENSE.txt\n *\n * DISCLAIMER\n *\n * Do not edit or add to this file if you wish to upgrade this extension to newer\n * version in the future.\n *\n * @category Mageplaza\n * @package Mageplaza_Osc\n * @copyright Copyright (c) Mageplaza (https://www.mageplaza.com/)\n * @license https://www.mageplaza.com/LICENSE.txt\n */\n\ndefine(\n [\n 'ko',\n 'jquery',\n 'Magento_Checkout/js/view/payment',\n 'Magento_Checkout/js/model/quote',\n 'Magento_Checkout/js/model/step-navigator',\n 'Magento_Checkout/js/model/payment/additional-validators',\n 'Mageplaza_Osc/js/model/checkout-data-resolver',\n 'Mageplaza_Osc/js/model/payment-service',\n 'Mageplaza_Osc/js/model/paypal_express_compatible',\n 'Magento_Customer/js/customer-data',\n 'Mageplaza_Osc/js/action/discount-payment-method',\n 'rjsResolver',\n 'mage/translate'\n ],\n function (ko,\n $,\n Component,\n quote,\n stepNavigator,\n additionalValidators,\n oscDataResolver,\n oscPaymentService,\n paypalExpressCompatible,\n customerData,\n discountPaymentMethodAction,\n resolver) {\n 'use strict';\n\n oscDataResolver.resolveDefaultPaymentMethod();\n var isReload = true;\n\n return Component.extend({\n defaults: {\n template: 'Mageplaza_Osc/container/payment'\n },\n isLoading: oscPaymentService.isLoading,\n errorValidationMessage: ko.observable(false),\n\n initialize: function () {\n var self = this;\n\n this._super();\n\n stepNavigator.steps.removeAll();\n\n additionalValidators.registerValidator(this);\n\n quote.paymentMethod.subscribe(function (value) {\n paypalExpressCompatible.togglePlaceOrderButton(quote.paymentMethod());\n self.errorValidationMessage(false);\n if($.type(value) === 'object') {\n discountPaymentMethodAction(value);\n }\n });\n\n if ($('.page.messages')) {\n setTimeout(function () {\n $('.page.messages').remove()\n }, 8000);\n }\n\n if (isReload) {\n customerData.reload(['cart'], false);\n isReload = false;\n }\n this.customer = customerData.get('cart');\n\n resolver(this.afterResolveDocument.bind(this));\n\n return this;\n },\n\n validate: function () {\n if (!quote.paymentMethod()) {\n this.errorValidationMessage($.mage.__('Please specify a payment method.'));\n\n return false;\n }\n\n return true;\n },\n\n afterResolveDocument: function () {\n if($.type(quote.paymentMethod()) === 'object'){\n paypalExpressCompatible.togglePlaceOrderButton(quote.paymentMethod());\n discountPaymentMethodAction(quote.paymentMethod());\n }\n },\n });\n }\n);\n","Mageplaza_Osc/js/view/shipping.js":"/**\n * Mageplaza\n *\n * NOTICE OF LICENSE\n *\n * This source file is subject to the Mageplaza.com license that is\n * available through the world-wide-web at this URL:\n * https://www.mageplaza.com/LICENSE.txt\n *\n * DISCLAIMER\n *\n * Do not edit or add to this file if you wish to upgrade this extension to newer\n * version in the future.\n *\n * @category Mageplaza\n * @package Mageplaza_Osc\n * @copyright Copyright (c) Mageplaza (https://www.mageplaza.com/)\n * @license https://www.mageplaza.com/LICENSE.txt\n */\n\ndefine(\n [\n 'jquery',\n 'underscore',\n 'Magento_Checkout/js/view/shipping',\n 'Magento_Checkout/js/model/quote',\n 'Magento_Customer/js/model/customer',\n 'Magento_Checkout/js/action/set-shipping-information',\n 'Mageplaza_Osc/js/action/payment-total-information',\n 'Magento_Checkout/js/model/step-navigator',\n 'Magento_Checkout/js/model/payment/additional-validators',\n 'Magento_Checkout/js/checkout-data',\n 'Magento_Checkout/js/action/select-billing-address',\n 'Magento_Checkout/js/action/select-shipping-address',\n 'Magento_Checkout/js/model/address-converter',\n 'Magento_Checkout/js/model/shipping-rate-service',\n 'Magento_Checkout/js/model/shipping-service',\n 'Mageplaza_Osc/js/model/checkout-data-resolver',\n 'Mageplaza_Osc/js/model/address/auto-complete',\n 'Mageplaza_Osc/js/model/compatible/amazon-pay',\n 'Magento_Customer/js/model/address-list',\n 'rjsResolver',\n 'mage/translate'\n ],\n function ($,\n _,\n Component,\n quote,\n customer,\n setShippingInformationAction,\n getPaymentTotalInformation,\n stepNavigator,\n additionalValidators,\n checkoutData,\n selectBillingAddress,\n selectShippingAddress,\n addressConverter,\n shippingRateService,\n shippingService,\n oscDataResolver,\n addressAutoComplete,\n amazonPay,\n addressList,\n resolver) {\n 'use strict';\n\n oscDataResolver.resolveDefaultShippingMethod();\n\n /** Set shipping methods to collection */\n shippingService.setShippingRates(window.checkoutConfig.shippingMethods);\n\n return Component.extend({\n defaults: {\n template: 'Mageplaza_Osc/container/shipping',\n shippingMethodItemTemplate: 'Mageplaza_Osc/shipping-address/shipping-method-item'\n },\n currentMethod: null,\n isAmazonAccountLoggedIn: amazonPay.isAmazonAccountLoggedIn,\n initialize: function () {\n this._super();\n\n if (window.checkoutConfig.hasOwnProperty('amazonLogin')) {\n this.isNewAddressAdded(this.isAmazonAccountLoggedIn());\n this.isAmazonAccountLoggedIn.subscribe(function (value) {\n this.isNewAddressAdded(value);\n }, this);\n }\n\n /**\n * Solve problem when customer has more than 1 addresses but no one is default shipping address\n * Shipping address will not auto select the first one, so billing address throw error when trying to\n * calculate isAddressSameAsShipping variable\n */\n if (!quote.shippingAddress() && addressList().length >= 1) {\n selectShippingAddress(addressList()[0]);\n }\n\n stepNavigator.steps.removeAll();\n\n //shippingRateService.estimateShippingMethod();\n additionalValidators.registerValidator(this);\n\n resolver(this.afterResolveDocument.bind(this));\n\n return this;\n }
2,\n\n initObservable: function () {\n this._super();\n\n quote.shippingMethod.subscribe(function (oldValue) {\n this.currentMethod = oldValue;\n }, this, 'beforeChange');\n\n quote.shippingMethod.subscribe(function (newValue) {\n var isMethodChange = $.type(this.currentMethod) !== 'object'\n ? true\n : this.currentMethod.carrier_code + \"_\" + this.currentMethod.method_code;\n\n if ($.type(newValue) === 'object' && isMethodChange !== newValue.carrier_code + \"_\" + newValue.method_code) {\n setShippingInformationAction();\n } else if (shippingRateService.isAddressChange) {\n shippingRateService.isAddressChange = false;\n getPaymentTotalInformation();\n }\n }, this);\n\n return this;\n },\n\n afterResolveDocument: function () {\n addressAutoComplete.register('shipping');\n\n if(!quote.isVirtual() && quote.shippingAddress() && quote.shippingAddress().countryId){\n shippingRateService.estimateShippingMethod();\n }\n },\n\n validate: function () {\n if (this.isAmazonAccountLoggedIn()) {\n return true;\n }\n\n if (quote.isVirtual()) {\n return true;\n }\n\n var shippingMethodValidationResult = true,\n shippingAddressValidationResult = true,\n loginFormSelector = 'form[data-role=email-with-possible-login]',\n emailValidationResult = customer.isLoggedIn();\n\n if (!quote.shippingMethod()) {\n this.errorValidationMessage($.mage.__('Please specify a shipping method.'));\n\n shippingMethodValidationResult = false;\n }\n\n if (!customer.isLoggedIn()) {\n $(loginFormSelector).validation();\n emailValidationResult = Boolean($(loginFormSelector + ' input[name=username]').valid());\n }\n\n if (this.isFormInline) {\n this.source.set('params.invalid', false);\n this.source.trigger('shippingAddress.data.validate');\n\n if (this.source.get('shippingAddress.custom_attributes')) {\n this.source.trigger('shippingAddress.custom_attributes.data.validate');\n }\n\n if (this.source.get('params.invalid')) {\n shippingAddressValidationResult = false;\n }\n\n this.saveShippingAddress();\n }\n\n return shippingMethodValidationResult && shippingAddressValidationResult && emailValidationResult;\n },\n saveShippingAddress: function () {\n var shippingAddress = quote.shippingAddress(),\n addressData = addressConverter.formAddressDataToQuoteAddress(\n this.source.get('shippingAddress')\n );\n\n //Copy form data to quote shipping address object\n for (var field in addressData) {\n if (addressData.hasOwnProperty(field) &&\n shippingAddress.hasOwnProperty(field) &&\n typeof addressData[field] != 'function' &&\n _.isEqual(shippingAddress[field], addressData[field])\n ) {\n shippingAddress[field] = addressData[field];\n } else if (typeof addressData[field] != 'function' && !_.isEqual(shippingAddress[field], addressData[field])) {\n shippingAddress = addressData;\n break;\n }\n }\n\n if (customer.isLoggedIn()) {\n shippingAddress.save_in_address_book = 1;\n }\n selectShippingAddress(shippingAddress);\n },\n\n saveNewAddress: function () {\n this._super();
2\n if (!this.source.get('params.invalid')) {\n shippingRateService.isAddressChange = true;\n shippingRateService.estimateShippingMethod();\n }\n },\n\n /**\n * Add class to New Address popup modal\n * @return {*}\n */\n getPopUp: function () {\n if (this.popUpForm.element === '#opc-new-shipping-address') {\n this.popUpForm.options.modalClass = 'osc-new-address-popup'\n }\n\n return this._super();\n },\n\n getAddressTemplate: function () {\n return 'Mageplaza_Osc/container/address/shipping-address';\n }\n });\n }\n);\n","Mageplaza_Osc/js/view/geoip.js":"/**\r\n * Mageplaza\r\n *\r\n * NOTICE OF LICENSE\r\n *\r\n * This source file is subject to the Mageplaza.com license that is\r\n * available through the world-wide-web at this URL:\r\n * https://www.mageplaza.com/LICENSE.txt\r\n *\r\n * DISCLAIMER\r\n *\r\n * Do not edit or add to this file if you wish to upgrade this extension to newer\r\n * version in the future.\r\n *\r\n * @category Mageplaza\r\n * @package Mageplaza_Osc\r\n * @copyright Copyright (c) Mageplaza (https://www.mageplaza.com/)\r\n * @license https://www.mageplaza.com/LICENSE.txt\r\n */\r\n\r\ndefine([\r\n 'jquery',\r\n 'underscore',\r\n 'uiComponent',\r\n 'Magento_Checkout/js/model/quote',\r\n 'Magento_Customer/js/model/customer',\r\n 'Magento_Checkout/js/checkout-data'\r\n ], function ($,\r\n _,\r\n Component,\r\n quote,\r\n customer,\r\n checkoutData) {\r\n 'use strict';\r\n\r\n var isEnableGeoIp = window.checkoutConfig.oscConfig.geoIpOptions.isEnableGeoIp,\r\n geoIpData = window.checkoutConfig.oscConfig.geoIpOptions.geoIpData;\r\n\r\n return Component.extend({\r\n initialize: function () {\r\n this.initGeoIp();\r\n this._super();\r\n return this;\r\n },\r\n initGeoIp: function () {\r\n if (isEnableGeoIp) {\r\n if (!quote.isVirtual()) { /** Set Geo Ip data to shippingAddress */\r\n if ((!customer.isLoggedIn() && checkoutData.getShippingAddressFromData() == null)\r\n || (customer.isLoggedIn() && checkoutData.getNewCustomerShippingAddress() == null)) {\r\n checkoutData.setShippingAddressFromData(geoIpData);\r\n }\r\n } else { /** Set Geo Ip data to billingAddress */\r\n if ((!customer.isLoggedIn() && checkoutData.getBillingAddressFromData() == null)\r\n || (customer.isLoggedIn() && checkoutData.getNewCustomerBillingAddress() == null)) {\r\n checkoutData.setBillingAddressFromData(geoIpData);\r\n }\r\n }\r\n }\r\n }\r\n });\r\n }\r\n);\r\n","Mageplaza_Osc/js/view/billing-address.js":"<!--\n/**\n*\n* @author : GMA\n* @date : 25.03.2024\n* @description : BZ-179, BZ-359\n*\n*/\n-->\n\ndefine(\n [\n 'jquery',\n 'ko',\n 'underscore',\n 'Magento_Checkout/js/view/billing-address',\n 'Magento_Checkout/js/model/quote',\n 'Magento_Checkout/js/checkout-data',\n 'Mageplaza_Osc/js/model/osc-data',\n 'Magento_Checkout/js/action/select-billing-address',\n 'Magento_Customer/js/model/customer',\n 'Magento_Checkout/js/action/set-billing-address',\n 'Magento_Checkout/js/model/payment/additional-validators',\n 'Magento_Checkout/js/model/checkout-data-resolver',\n 'Mageplaza_Osc/js/model/address/auto-complete',\n 'uiRegistry',\n 'mage/translate',\n 'rjsResolver',\n 'Mageplaza_Osc/js/model/paypal_express_compatible',\n 'Magento_Customer/js/model/address-list',\n 'Magento_Checkout/js/model/shipping-rates-validator'\n ],\n function ($,\n ko,\n _,\n Component,\n quote,\n checkoutData,\n oscData,\n selectBillingAddress,\n customer,\n setBillingAddressAction,\n additionalValidators,\n checkoutDataResolver,\n addressAutoComplete,\n registry,\n $t,\n resolver,\n paypalExpressCompatible,\n addressList) {\n 'use strict';\n\n function getDefaultBillingAddress(customerData) {\n const defaultBillingAddress = Object.values(customerData.addresses).find(address => address.default_billing === true);\n \n return [defaultBillingAddress];\n }\n \n const billingAddress = getDefaultBillingAddress(customerData)[0];\n\n const countryMappings = {\n \"DE\": \"Deutschland\",\n \"CH\": \"Schweiz\"\n };\n \n function formatCountry(countryCode) {\n return countryMappings[countryCode];\n }\n\n function formatBillingAddressToString(address) {\n const { prefix, firstname, lastname, suffix, street, city, postcode, country_id, telephone } = address;\n const addressKeyValues = [];\n\n if (prefix) addressKeyValues.push(prefix);\n if (firstname) addressKeyValues.push(firstname);\n if (lastname) addressKeyValues.push(lastname);\n if (suffix) addressKeyValues.push(suffix);\n if (street && street.length > 0) addressKeyValues.push(street[0]);\n if (city) addressKeyValues.push(city);\n if (postcode) addressKeyValues.push(postcode);\n if (country_id) addressKeyValues.push(formatCountry(country_id));\n if (telephone) addressKeyValues.push(telephone);\n\n return addressKeyValues.join('');\n }\n\n const formattedBillingAddress = formatBillingAddressToString(billingAddress);\n\n function normalizeAddress(address) {\n // Remove spaces, line breaks and commas.\n return address.replace(/\\s+/g, '').replace(/,/g, '');\n }\n\n function compareAddresses(billingAddress, shippingAddress) {\n const normalizedBillingAddress = normalizeAddress(billingAddress);\n const normalizedShippingAddress = normalizeAddress(shippingAddress);\n\n return normalizedBillingAddress === normalizedShippingAddress;\n }\n\n return Component.extend({\n defaults: {\n template: ''\n },\n isCustomerLoggedIn: customer.isLoggedIn,\n quoteIsVirtual: quote.isVirtual(),\n billingAddress: billingAddress,\n billingShippingAddressMatch: ko.observable(false),\n\n /**\n * @return {exports}\n */\n initialize: function () {\n this._super();\n this.initFields();\n additionalValidators.registerValidator(this);\n resolver(this.afterResolveDocument.bind(this));\n return this;\n },\n\n afterResolveDocument: function () {\n addressAutoComplete.register('billing');\n paypalExpressCompatible.togglePlaceOrderButton(quote.paymentMethod());\n \n const getBillingAddressFromAllAddresses = addressList().find(function(address) {\n return address.getType() === 'customer-address' && address.customerAddressId === billingAddress.id;\n });\n \n if (getBillingAddressFromAllAddresses) {\n selectBillingAddress(getBillingAddressFromAllAddresses);\n checkoutData.setSelectedBillingAddress(getBillingAddressFromAllAddresses.getKey());\n }\n }
2,\n\n matchShippingAddressWithBilling: function() {\n let matchFound = false;\n\n $('.shipping-address-item').each(function () {\n const shippingAddress = $(this).text();\n\n const isMatch = compareAddresses(formattedBillingAddress, shippingAddress);\n if (isMatch) {\n $(this).click();\n matchFound = true;\n return false;\n }\n });\n\n return matchFound;\n },\n\n validate: function () {\n this.source.set('params.invalid', false);\n this.source.trigger('billingAddress.data.validate');\n\n if (this.source.get('billingAddress.custom_attributes')) {\n this.source.trigger('billingAddress.custom_attributes.data.validate');\n }\n },\n \n getAddressTemplate: function () {\n return 'Mageplaza_Osc/container/address/billing-address';\n }\n });\n }\n);\n","Mageplaza_Osc/js/view/shipping-postnl.js":"/**\r\n * Mageplaza\r\n *\r\n * NOTICE OF LICENSE\r\n *\r\n * This source file is subject to the Mageplaza.com license that is\r\n * available through the world-wide-web at this URL:\r\n * https://www.mageplaza.com/LICENSE.txt\r\n *\r\n * DISCLAIMER\r\n *\r\n * Do not edit or add to this file if you wish to upgrade this extension to newer\r\n * version in the future.\r\n *\r\n * @category Mageplaza\r\n * @package Mageplaza_Osc\r\n * @copyright Copyright (c) Mageplaza (https://www.mageplaza.com/)\r\n * @license https://www.mageplaza.com/LICENSE.txt\r\n */\r\n\r\ndefine([\r\n 'jquery',\r\n 'TIG_PostNL/js/Helper/State',\r\n 'Magento_Checkout/js/model/quote',\r\n 'Magento_Catalog/js/price-utils',\r\n 'Mageplaza_Osc/js/action/payment-total-information'\r\n], function ($,\r\n State,\r\n quote,\r\n priceUtils,\r\n getPaymentTotalInformation) {\r\n return function (Shipping) {\r\n return Shipping.extend({\r\n initialize: function () {\r\n this._super();\r\n $(document).on('compatible_postnl_deliveryoptions_save_done', function (event, data) {\r\n getPaymentTotalInformation();\r\n });\r\n },\r\n PostNLFee: State.fee,\r\n isEnableModulePostNL: window.checkoutConfig.oscConfig.compatible.isEnableModulePostNL,\r\n canUseDeliveryOption: function () {\r\n var deliveryOptionsActive = window.checkoutConfig.shipping.postnl.shippingoptions_active == 1;\r\n var deliveryDaysActive = window.checkoutConfig.shipping.postnl.is_deliverydays_active;\r\n var pakjegemakActive = window.checkoutConfig.shipping.postnl.pakjegemak_active == '1';\r\n\r\n return deliveryOptionsActive && (deliveryDaysActive || pakjegemakActive);\r\n },\r\n\r\n isPostNLDeliveryMethod: function (method) {\r\n return method.carrier_code == 'tig_postnl';\r\n },\r\n\r\n canUsePostnlDeliveryOptions: function (method) {\r\n if (!this.canUseDeliveryOption()) {\r\n return false;\r\n }\r\n\r\n var result = this.isPostNLDeliveryMethod(method);\r\n\r\n if (result) {\r\n State.method(method
2);\r\n }\r\n\r\n return result;\r\n },\r\n\r\n formatPrice: function (price) {\r\n return priceUtils.formatPrice(price, quote.getPriceFormat());\r\n }\r\n });\r\n }\r\n});","Mageplaza_Osc/js/view/authentication.js":"/**\n * Mageplaza\n *\n * NOTICE OF LICENSE\n *\n * This source file is subject to the Mageplaza.com license that is\n * available through the world-wide-web at this URL:\n * https://www.mageplaza.com/LICENSE.txt\n *\n * DISCLAIMER\n *\n * Do not edit or add to this file if you wish to upgrade this extension to newer\n * version in the future.\n *\n * @category Mageplaza\n * @package Mageplaza_Osc\n * @copyright Copyright (c) Mageplaza (https://www.mageplaza.com/)\n * @license https://www.mageplaza.com/LICENSE.txt\n */\n\ndefine(\n [\n 'jquery',\n 'ko',\n 'uiComponent',\n 'Magento_Customer/js/action/login',\n 'Magento_Customer/js/model/customer',\n 'mage/translate',\n 'Magento_Ui/js/modal/modal',\n 'Magento_Checkout/js/model/authentication-messages',\n 'uiRegistry',\n 'mage/validation'\n ],\n function ($, ko, Component, loginAction, customer, $t, modal, messageContainer, uiRegistry) {\n 'use strict';\n\n var checkoutConfig = window.checkoutConfig;\n var emailElement = '.popup-authentication #login-email',\n passwordElement = '.popup-authentication #login-password',\n emailScope = \"checkout.steps.shipping-step.shippingAddress.customer-email\";\n\n return Component.extend({\n registerUrl: checkoutConfig.registerUrl,\n forgotPasswordUrl: checkoutConfig.forgotPasswordUrl,\n autocomplete: checkoutConfig.autocomplete,\n modalWindow: null,\n isLoading: ko.observable(false),\n\n defaults: {\n template: 'Mageplaza_Osc/container/authentication',\n email: ko.observable()\n },\n\n /**\n * Init\n */\n initialize: function () {\n var self = this;\n\n this._super();\n loginAction.registerLoginCallback(function () {\n self.isLoading(false);\n });\n },\n\n /** Init popup login window */\n setModalElement: function (element) {\n if (window.checkoutConfig.oscConfig.isPopupSlideSocialLogin || window.checkoutConfig.oscConfig.isPopupQuickLogin) {\n return;\n }\n\n this.modalWindow = element;\n var self = this,\n socialLoginPopup = $(\"#social-login-popup\"),\n options = {\n 'type': 'popup',\n 'title': $t('Sign In'),\n 'modalClass': 'popup-authentication',\n 'responsive': true,\n 'innerScroll': true,\n 'trigger': '.osc-authentication-toggle',\n 'buttons': [],\n 'opened': function () {\n self.email(\n uiRegistry.get(emailScope).email()\n );\n }\n };\n\n if (window.checkoutConfig.oscConfig.isDisplaySocialLogin && socialLoginPopup.length > 0) {\n this.modalWindow = socialLoginPopup;\n options.modalClass = 'osc-social-login-popup';\n }\n modal(options, $(this.modalWindow));\n },\n\n /** Is login form enabled for current customer */\n isActive: function () {\n return !customer.isLoggedIn();\n },\n\n /** Show login popup window */\n showModal: function () {\n $(this.modalWindow).modal('openModal');\n },\n\n /** Provide login action */\n login: function (loginForm) {\n var loginData = {},\n formDataArray = $(loginForm).serializeArray();\n\n formDataArray.forEach(function (entry) {\n loginData[entry.name] = entry.value;\n });\n\n if ($(loginForm).validation() &&\n $(loginForm).validation('isValid')\n ) {\n this.isLoading(true);\n loginAction(loginData, null, true, messageContainer)\n .done(function (response) {\n if (!response.errors) {\n messageContainer.addSuccessMessage({'message': $t('Login successfully. Please wait...')});\n }\n });\n }\n },\n\n /** Move label element when input has value */\n hasValue: function () {\n if (window.checkoutConfig.oscConfig.isUsedMaterialDesign) {\n $(emailElement).val() ? $(emailElement).addClass('active') : $(emailElement).removeClass('active');\n $(passwordElement).val() ? $(passwordElement).addClass('active') : $(passwordElement).removeClass('active');\n }\n }\n });\n }\n);\n","Mageplaza_Osc/js/view/amazon.js":"/**\r\n * Mageplaza\r\n *\r\n * NOTICE OF LICENSE\r\n *\r\n * This source file is subject to the Mageplaza.com license that is\r\n * available through the world-wide-web at this URL:\r\n * https://www.mageplaza.com/LICENSE.txt\r\n *\r\n * DISCLAIMER\r\n *\r\n * Do not edit or add to this file if you wish to upgrade this extension to newer\r\n * version in the future.\r\n *\r\n * @category Mageplaza\r\n * @package Mageplaza_Osc\r\n * @copyright Copyright (c) Mageplaza (https://www.mageplaza.com/)\r\n * @license https://www.mageplaza.com/LICENSE.txt\r\n */\r\n\r\ndefine([\r\n 'uiComponent',\r\n 'jquery',\r\n 'ko',\r\n 'Amazon_Payment/js/model/storage',\r\n 'Magento_Checkout/js/model/shipping-rate-service',\r\n 'Mageplaza_Osc/js/action/payment-total-information',\r\n 'Mageplaza_Osc/js/model/compatible/amazon-pay',\r\n 'Magento_Checkout/js/model/quote'\r\n], function (Component, $, ko, amazonStorage, shippingService, getPaymentTotalInformation, amazonPay, quote) {\r\n 'use strict';\r\n\r\n return Component.extend({\r\n defaults: {\r\n template: 'Amazon_Payment/shipping-address/inline-form',\r\n formSelector: 'co-shipping-form'\r\n },\r\n\r\n /**\r\n * Init inline form\r\n */\r\n initOb
2servable: function () {\r\n this._super();\r\n amazonStorage.isAmazonAccountLoggedIn.subscribe(function (value) {\r\n if (value == false) {\r\n window.checkoutConfig.oscConfig.isAmazonAccountLoggedIn = value;\r\n amazonPay.setLogin(value);\r\n if (!quote.isVirtual()) {\r\n shippingService.estimateShippingMethod();\r\n }\r\n getPaymentTotalInformation();\r\n }\r\n\r\n var elem = document.getElementById(this.formSelector);\r\n\r\n if (elem && value === false) {\r\n document.getElementById(this.formSelector).style.display = 'block';\r\n }\r\n }, this);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Show/hide inline form\r\n */\r\n manipulateInlineForm: function () {\r\n if (amazonStorage.isAmazonAccountLoggedIn()) {\r\n window.checkoutConfig.oscConfig.isAmazonAccountLoggedIn = true;\r\n amazonPay.setLogin(true);\r\n setTimeout(function () {\r\n if (!quote.isVirtual()) {\r\n shippingService.estimateShippingMethod();\r\n }\r\n getPaymentTotalInformation();\r\n }, 1000);\r\n\r\n var elem = document.getElementById(this.formSelector);\r\n\r\n if (elem) {\r\n document.getElementById(this.formSelector).style.display = 'none';\r\n }\r\n }\r\n }\r\n });\r\n});\r\n","Mageplaza_Osc/js/view/survey.js":"/**\r\n * Mageplaza\r\n *\r\n * NOTICE OF LICENSE\r\n *\r\n * This source file is subject to the Mageplaza.com license that is\r\n * available through the world-wide-web at this URL:\r\n * https://www.mageplaza.com/LICENSE.txt\r\n *\r\n * DISCLAIMER\r\n *\r\n * Do not edit or add to this file if you wish to upgrade this extension to newer\r\n * version in the future.\r\n *\r\n * @category Mageplaza\r\n * @package Mageplaza_Osc\r\n * @copyright Copyright (c) Mageplaza (https://www.mageplaza.com/)\r\n * @license https://www.mageplaza.com/LICENSE.txt\r\n */\r\n\r\ndefine([\r\n 'jquery'\r\n], function ($) {\r\n \"use strict\";\r\n\r\n $.widget('mageplaza.survey', {\r\n options: {\r\n url: ''\r\n },\r\n\r\n _create: function () {\r\n this.initObserve();\r\n },\r\n\r\n initObserve: function () {\r\n var self = this;\r\n\r\n $(\"#new-answer\").blur(function () {\r\n self.addNewAnswer();\r\n });\r\n\r\n $('#survey').on('click', '#remove-answer', function () {\r\n $(this).parent().remove();\r\n $('#new-answer').show();\r\n });\r\n\r\n $(\"#submit-answers\").click(function () {\r\n self.submitAnswers();\r\n });\r\n\r\n },\r\n\r\n submitAnswers: function () {\r\n var self = this;\r\n var answerChecked = [];\r\n $(\".list-answer input:checkbox:checked\").each(function () {\r\n answerChecked.push($(this).parent().next().children('span').text());\r\n });\r\n if (answerChecked.length > 0) {\r\n $.ajax({\r\n method: 'POST',\r\n url: this.options.url,\r\n data: {answerChecked: answerChecked}\r\n }).done(function (response) {\r\n if (response.status == 'success') $('.survey-content').hide();\r\n self.addSurveyMessage(response.status, response.message);\r\n });\r\n } else {\r\n self.addSurveyMessage('notice', 'You need to choose answer.')\r\n }\r\n },\r\n\r\n addNewAnswer: function () {\r\n var newAnswer = $('#new-answer').val();\r\n if (newAnswer.length > 0) {\r\n var d = new Date();\r\n $('<div class=\"survey-answer\"><div class=\"checkbox-survey\"><input type=\"checkbox\" value=\"_' + d.getTime() + ' \" checked/></div><div class=\"option-value\"><span id=\"other-answer\"></span></div><span id=\"remove-answer\">X</span></div>').insertBefore(\".option-survey-new\");\r\n $('#other-answer').text(newAnswer);\r\n $('#new-answer').val('').hide();\r\n }\r\n },\r\n\r\n addSurveyMessage: function (type, message) {\r\n $(\"#survey-message\").html('<div class=\"' + type + ' message\"><span>' + message + '</span></div>');\r\n }\r\n });\r\n\r\n return $.mageplaza.survey;\r\n});\r\n","Mageplaza_Osc/js/view/form/element/region.js":"/**\r\n * Mageplaza\r\n *\r\n * NOTICE OF LICENSE\r\n *\r\n * This source file is subject to the Mageplaza.com license that is\r\n * available through the world-wide-web at this URL:\r\n * https://www.mageplaza.com/LICENSE.txt\r\n *\r\n * DISCLAIMER\r\n *\r\n * Do not edit or add to this file if you wish to upgrade this extension to newer\r\n * version in the future.\r\n *\r\n * @category Mageplaza\r\n * @package Mageplaza_Osc\r\n * @copyright Copyright (c) Mageplaza (https://www.mageplaza.com/)\r\n * @license https://www.mageplaza.com/LICENSE.txt\r\n */\r\n\r\ndefine([\r\n 'underscore',\r\n 'Magento_Ui/js/form/element/region',\r\n 'mageUtils',\r\n 'uiLayout'\r\n], function (_, Component, utils, layout) {\r\n 'use strict';\r\n var template = window.checkoutConfig.oscConfig.isUsedMaterialDesign ? 'Mageplaza_Osc/container/form/field' : '${ $.$data.template }';\r\n var inputNode = {\r\n parent: '${ $.$data.parentName }',\r\n component: 'Magento_Ui/js/form/element/abstract',\r\n template: template,\r\n elementTmpl: 'Mageplaza_Osc/container/form/element/input',\r\n provider: '${ $.$data.provider }',\r\n name: '${ $.$data.index }
2_input',\r\n dataScope: '${ $.$data.customEntry }',\r\n customScope: '${ $.$data.customScope }',\r\n sortOrder: '${ $.$data.sortOrder }',\r\n displayArea: 'body',\r\n label: '${ $.$data.label }'\r\n };\r\n\r\n return Component.extend({\r\n initInput: function () {\r\n layout([utils.template(_.extend(inputNode, {additionalClasses: this.additionalClasses}), this)]);\r\n\r\n return this;\r\n }\r\n });\r\n});\r\n\r\n","Mageplaza_Osc/js/view/form/element/street.js":"/**\r\n * Mageplaza\r\n *\r\n * NOTICE OF LICENSE\r\n *\r\n * This source file is subject to the Mageplaza.com license that is\r\n * available through the world-wide-web at this URL:\r\n * https://www.mageplaza.com/LICENSE.txt\r\n *\r\n * DISCLAIMER\r\n *\r\n * Do not edit or add to this file if you wish to upgrade this extension to newer\r\n * version in the future.\r\n *\r\n * @category Mageplaza\r\n * @package Mageplaza_Osc\r\n * @copyright Copyright (c) Mageplaza (https://www.mageplaza.com/)\r\n * @license https://www.mageplaza.com/LICENSE.txt\r\n */\r\n\r\ndefine([\r\n 'Magento_Ui/js/form/element/abstract',\r\n 'Mageplaza_Osc/js/model/address/google-auto-complete'\r\n], function (Component, googleAutoComplete) {\r\n 'use strict';\r\n\r\n return Component.extend({\r\n\r\n googleAutocomplete: null,\r\n\r\n /**\r\n * Invokes initialize method of parent class,\r\n * contains initialization logic\r\n */\r\n initialize: function () {\r\n this._super()\r\n .initAutocomplete();\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Init google/pca autocomplete\r\n */\r\n initAutocomplete: function () {\r\n var fieldsetName = this.parentName.split('.').slice(0, -1).join('.');\r\n\r\n switch (window.checkoutConfig.oscConfig.autocomplete.type) {\r\n case 'google':\r\n this.googleAutocomplete = new googleAutoComplete(this.uid, fieldsetName);\r\n break;\r\n case 'pca':\r\n break;\r\n default :\r\n break;\r\n }\r\n\r\n return this;\r\n }\r\n });\r\n});\r\n","Mageplaza_Osc/js/view/form/element/email.js":"/**\n * Mageplaza\n *\n * NOTICE OF LICENSE\n *\n * This source file is subject to the Mageplaza.com license that is\n * available through the world-wide-web at this URL:\n * https://www.mageplaza.com/LICENSE.txt\n *\n * DISCLAIMER\n *\n * Do not edit or add to this file if you wish to upgrade this extension to newer\n * version in the future.\n *\n * @category Mageplaza\n * @package Mageplaza_Osc\n * @copyright Copyright (c) Mageplaza (https://www.mageplaza.com/)\n * @license https://www.mageplaza.com/LICENSE.txt\n */\n\ndefine([\n 'jquery',\n 'ko',\n 'Magento_Checkout/js/view/form/element/email',\n 'Magento_Customer/js/model/customer',\n 'Mageplaza_Osc/js/model/osc-data',\n 'Magento_Checkout/js/model/payment/additional-validators',\n 'Mageplaza_Osc/js/action/check-email-availability',\n 'Mageplaza_Osc/js/model/compatible/amazon-pay',\n 'Magento_Checkout/js/checkout-data',\n 'Magento_Checkout/js/model/quote',\n 'mage/url',\n 'rjsResolver',\n 'mage/validation'\n], function ($,\n ko,\n Component,\n customer,\n oscData,\n additionalValidators,\n checkEmailAvailability,\n amazonPay,\n checkoutData,\n quote,\n urlBuilder,\n resolver) {\n 'use strict';\n\n var cacheKey = 'form_register_chechbox',\n allowGuestCheckout = window.checkoutConfig.oscConfig.allowGuestCheckout,\n passwordMinLength = window.checkoutConfig.oscConfig.register.dataPasswordMinLength,\n passwordMinCharacter = window.checkoutConfig.oscConfig.register.dataPasswordMinCharacterSets,\n customerEmailElement = '.form-login #customer-email';\n\n if (!customer.isLoggedIn() && !allowGuestCheckout) {\n oscData.setData(cacheKey, true);\n }\n\n /**\n * Get Amazon customer email\n */\n function getAmazonCustomerEmail() {\n // jscs:disable requireCamelCaseOrUpperCaseIdentifiers\n if (window.checkoutConfig.hasOwnProperty('amazonLogin') &&\n typeof window.checkoutConfig.amazonLogin.amazon_customer_email === 'string'\n ) {\n return window.checkoutConfig.amazonLogin.amazon_customer_email;\n }\n // jscs:enable requireCamelCaseOrUpperCaseIdentifiers\n\n return '';\n }\n\n return Component.extend({\n defaults: {\n email: checkoutData.getInputFieldEmailValue() || getAmazonCustomerEmail(),\n template: 'Mageplaza_Osc/container/form/element/email',\n isLoginVisible: false,\n listens: {\n email: ''\n }\n },\n savingEmailRequest: null,\n dataPasswordMinLength: passwordMinLength,\n dataPasswordMinCharacterSets: passwordMinCharacter,\n\n initialize: function () {\n this._super();\n\n if (!customer.isLoggedIn()) {\n if (!!this.email()
2) {\n resolver(this.emailHasChanged.bind(this));\n }\n }\n\n additionalValidators.registerValidator(this);\n },\n\n initObservable: function () {\n this._super()\n .observe({\n isCheckboxRegisterVisible: allowGuestCheckout,\n isRegisterVisible: oscData.getData(cacheKey)\n });\n\n this.isRegisterVisible.subscribe(function (newValue) {\n oscData.setData(cacheKey, newValue);\n });\n\n if (window.checkoutConfig.hasOwnProperty('amazonLogin') && this.email()) {\n if ($.validator.methods['validate-email'].call(this, this.email())) {\n quote.guestEmail = this.email();\n checkoutData.setValidatedEmailValue(this.email());\n }\n\n checkoutData.setInputFieldEmailValue(this.email());\n }\n\n return this;\n },\n\n /**\n * Check email existing.\n */\n checkEmailAvailability: function () {\n var self = this;\n\n this.validateRequest();\n this.isLoading(true);\n this.checkRequest = checkEmailAvailability(this.email());\n this.checkRequest.done(function (isEmailAvailable) {\n self.isPasswordVisible(!isEmailAvailable);\n }).fail(function () {\n self.isPasswordVisible(false);\n }).always(function () {\n self.isLoading(false);\n });\n },\n\n triggerLogin: function () {\n if ($('.osc-authentication-wrapper a.action-auth-toggle').hasClass('osc-authentication-toggle')) {\n if(window.checkoutConfig.oscConfig.isPopupSlideSocialLogin){\n $('.social-login-btn').trigger('click');\n }else {\n $('.osc-authentication-toggle').trigger('click');\n }\n } else {\n window.location.href = urlBuilder.build(\"customer/account/login\");\n }\n },\n\n validateEmail: function (focused) {\n var loginFormSelector = 'form[data-role=email-with-possible-login]',\n usernameSelector = loginFormSelector + ' input[name=username]',\n loginForm = $(loginFormSelector),\n validator;\n\n if (!loginForm.length) {\n return false;\n }\n\n this.checkDelay = 0;\n\n loginForm.validation();\n\n if (focused === false) {\n return !!$(usernameSelector).valid();\n }\n\n validator = loginForm.validate();\n\n return validator.check(usernameSelector);\n },\n\n validate: function (type) {\n\n if (customer.isLoggedIn() || !this.isRegisterVisible() || this.isPasswordVisible()) {\n oscData.setData('register', false);\n return true;\n }\n\n if (typeof type !== 'undefined' && typeof type !== 'boolean') {\n var selector = $('#osc-' + type);\n\n selector.parents('form').validation();\n\n return !!selector.valid();\n }\n\n var passwordSelector = $('#osc-password');\n\n passwordSelector.parents('form').validation();\n var password = !!passwordSelector.valid(),\n confirm = !!$('#osc-password-confirmation').valid(),\n result = password && confirm;\n\n if (result) {\n oscData.setData('register', true);\n oscData.setData('password', passwordSelector.val());\n } else if (!password) {\n passwordSelector.focus();\n } else if (!confirm) {\n $('#osc-password-confirmation').focus();\n }\n\n return result;\n\n },\n\n /** Move label element when input has value */\n hasValue: function () {\n if (window.checkoutConfig.oscConfig.isUsedMaterialDesign) {\n $(customerEmailElement).val() ?\n $(customerEmailElement).addClass('active') :\n $(customerEmailElement).removeClass('active');\n }\n }\n });\n});\n","Mageplaza_Osc/js/view/form/element/date.js":"/**\r\n * Mageplaza\r\n *\r\n * NOTICE OF LICENSE\r\n *\r\n * This source file is subject to the Mageplaza.com license that is\r\n * available through the world-wide-web at this URL:\r\n * https://www.mageplaza.com/LICENSE.txt\r\n *\r\n * DISCLAIMER\r\n *\r\n * Do not edit or add to this file if you wish to upgrade this extension to newer\r\n * version in the future.\r\n *\r\n * @category Mageplaza\r\n * @package Mageplaza_Osc\r\n * @copyright Copyright (c) Mageplaza (https://www.mageplaza.com/)\r\n * @license https://www.mageplaza.com/LICENSE.txt\r\n */\r\n\r\ndefine(['Magento_Ui/js/form/element/date'], function (Component) {\r\n 'use strict';\r\n\r\n return Component.extend({\r\n defaults: {\r\n inputDateFormat: 'MM/dd
2/y'\r\n }\r\n });\r\n});\r\n","Mageplaza_Osc/js/view/review/comment.js":"/**\r\n * Mageplaza\r\n *\r\n * NOTICE OF LICENSE\r\n *\r\n * This source file is subject to the Mageplaza.com license that is\r\n * available through the world-wide-web at this URL:\r\n * https://www.mageplaza.com/LICENSE.txt\r\n *\r\n * DISCLAIMER\r\n *\r\n * Do not edit or add to this file if you wish to upgrade this extension to newer\r\n * version in the future.\r\n *\r\n * @category Mageplaza\r\n * @package Mageplaza_Osc\r\n * @copyright Copyright (c) Mageplaza (https://www.mageplaza.com/)\r\n * @license https://www.mageplaza.com/LICENSE.txt\r\n */\r\n\r\ndefine(\r\n [\r\n 'ko',\r\n 'uiComponent',\r\n 'Mageplaza_Osc/js/model/osc-data'\r\n ],\r\n function (ko, Component, oscData) {\r\n \"use strict\";\r\n\r\n var cacheKey = 'comment';\r\n\r\n return Component.extend({\r\n defaults: {\r\n template: 'Mageplaza_Osc/container/review/comment'\r\n },\r\n commentValue: ko.observable(),\r\n initialize: function () {\r\n this._super();\r\n\r\n this.commentValue(oscData.getData(cacheKey));\r\n\r\n this.commentValue.subscribe(function (newValue) {\r\n oscData.setData(cacheKey, newValue);\r\n });\r\n\r\n return this;\r\n }\r\n });\r\n }\r\n);\r\n","Mageplaza_Osc/js/view/review/checkout-agreements.js":"/**\r\n * Mageplaza\r\n *\r\n * NOTICE OF LICENSE\r\n *\r\n * This source file is subject to the Mageplaza.com license that is\r\n * available through the world-wide-web at this URL:\r\n * https://www.mageplaza.com/LICENSE.txt\r\n *\r\n * DISCLAIMER\r\n *\r\n * Do not edit or add to this file if you wish to upgrade this extension to newer\r\n * version in the future.\r\n *\r\n * @category Mageplaza\r\n * @package Mageplaza_Osc\r\n * @copyright Copyright (c) Mageplaza (https://www.mageplaza.com/)\r\n * @license https://www.mageplaza.com/LICENSE.txt\r\n */\r\n\r\ndefine(\r\n [\r\n 'Magento_CheckoutAgreements/js/view/checkout-agreements',\r\n 'Magento_Checkout/js/model/payment/additional-validators',\r\n 'Mageplaza_Osc/js/model/agreement-validator'\r\n ],\r\n function (Component, additionalValidators, agreementValidator) {\r\n 'use strict';\r\n\r\n additionalValidators.registerValidator(agreementValidator);\r\n return Component.extend({});\r\n }\r\n);\r\n","Mageplaza_Osc/js/view/review/placeOrder.js":"/**\n* @author : KK\n* @description : override this file to add validation.\n* @Link : https://pixelmechanics.atlassian.net/browse/BLIZ-449\n* @date : 10 March 2023\n*/\ndefine(\n [\n 'jquery',\n 'underscore',\n 'ko',\n 'uiComponent',\n 'uiRegistry',\n 'Magento_Checkout/js/model/quote',\n 'Magento_Checkout/js/model/payment/additional-validators',\n 'Magento_Customer/js/customer-data',\n 'Mageplaza_Osc/js/action/set-checkout-information',\n 'Mageplaza_Osc/js/model/braintree-paypal'\n ],\n function ($,\n _,\n ko,\n Component,\n registry,\n quote,\n additionalValidators,\n customerData,\n setCheckoutInformationAction,\n braintreePaypalModel) {\n \"use strict\";\n\n return Component.extend({\n defaults: {\n template: 'Mageplaza_Osc/container/review/place-order',\n visibleBraintreeButton: fal
2se,\n },\n braintreePaypalModel: braintreePaypalModel,\n selectors: {\n default: '#co-payment-form .payment-method._active button.action.primary.checkout'\n },\n isPaypalThroughBraintree: false,\n initialize: function () {\n this._super();\n var self = this;\n quote.paymentMethod.subscribe(function (value) {\n self.processVisiblePlaceOrderButton();\n });\n\n registry.async(this.getPaymentPath('braintree_paypal'))\n (this.asyncBraintreePaypal.bind(this));\n\n return this;\n },\n /**\n * Set list of observable attributes\n * @returns {exports.initObservable}\n */\n initObservable: function () {\n var self = this;\n\n this._super()\n .observe(['visibleBraintreeButton']);\n\n return this;\n },\n asyncBraintreePaypal: function () {\n this.processVisiblePlaceOrderButton();\n },\n isBraintreeNewVersion: function () {\n var component = this.getBraintreePaypalComponent();\n return component\n && typeof component.isReviewRequired == \"function\"\n && typeof component.getButtonTitle == \"function\";\n },\n processVisiblePlaceOrderButton: function () {\n this.visibleBraintreeButton(this.checkVisiblePlaceOrderButton());\n },\n checkVisiblePlaceOrderButton: function () {\n return this.getBraintreePaypalComponent()\n && this.isPaymentBraintreePaypal();\n },\n placeOrder: function () {\n var self = this;\n if (additionalValidators.validate()) {\n this.preparePlaceOrder().done(function () {\n self._placeOrder();\n });\n } else {\n var offsetHeight = $(window).height() / 2,\n errorMsgSelector = $('#maincontent .mage-error:visible:first').closest('.field');\n errorMsgSelector = errorMsgSelector.length ? errorMsgSelector : $('#maincontent .field-error:visible:first').closest('.field');\n /**\n * @author : KK\n * @description : Added else condition for validating terms and conditions checkbox and getting focused on it.\n * @date : 21 June 2023\n */\n if (errorMsgSelector.length) {\n \n if (errorMsgSelector.find('select').length) {\n $('html, body').scrollTop(\n errorMsgSelector.find('select').offset().top - offsetHeight\n );\n errorMsgSelector.find('select').focus();\n } else if (errorMsgSelector.find('input').length) {\n $('html, body').scrollTop(\n errorMsgSelector.find('input').offset().top - offsetHeight\n );\n errorMsgSelector.find('input').focus();\n }\n } else if($('input[type=\"checkbox\"]').length){\n $('html, body').scrollTop(\n $('.checkout-agreement').offset().top - offsetHeight\n );\n } else if ($('.message-error:visible').length) {\n $('html, body').scrollTop(\n $('.message-error:visible:first').closest('div').offset().top - offsetHeight\n );\n } \n }\n\n return this;\n },\n\n brainTreePaypalPlaceOrder: function () {\n var component = this.getBraintreePaypalComponent();\n if (component && additionalValidators.validate()) {\n component.placeOrder.apply(component, arguments);\n }\n\n return this;\n },\n\n brainTreePayWithPayPal: function () {\n var self = this;\n var component = this.getBraintreePaypalComponent();\n self.isPaypalThroughBraintree = true;\n if (component && additionalValidators.validate()) {\n component.payWithPayPal.apply(component, arguments);\n }\n\n return this;\n },\n preparePlaceOrder: function (scrollTop) {\n var scrollTop = scrollTop !== undefined ? scrollTop : true;\n var deferer = $.when(setCheckoutInformationAction());\n\n return scrollTop ? deferer.done(function () {\n $(\"body\").animate({scrollTop: 0}, \"slow\");\n }) : deferer;\n },\n\n getPaymentPath: function (paymentMethodCode) {\n return 'checkout.steps.billing-step.payment.payments-list.' + paymentMethodCode;\n },\n\n getPaymentMethodComponent: function (paymentMethodCode) {\n return registry.get(this.getPaymentPath(paymentMethodCode));\n },\n\n isPaymentBraintreePaypal: function () {\n return quote.paymentMethod() && quote.paymentMethod().method === 'braintree_paypal';\n },\n\n getBraintreePaypalComponent: function () {\n return this.getPaymentMethodComponent('braintree_paypal');\n },\n\n _placeOrder: function () {\n $(this.selectors.default).trigger('click');\n customerData.invalidate(['customer']);\n },\n\n isPlaceOrderActionAllowed: function () {\n return true;\n }\n });\n }\n);
2\n","Mageplaza_Osc/js/view/review/addition.js":"/**\r\n * Mageplaza\r\n *\r\n * NOTICE OF LICENSE\r\n *\r\n * This source file is subject to the Mageplaza.com license that is\r\n * available through the world-wide-web at this URL:\r\n * https://www.mageplaza.com/LICENSE.txt\r\n *\r\n * DISCLAIMER\r\n *\r\n * Do not edit or add to this file if you wish to upgrade this extension to newer\r\n * version in the future.\r\n *\r\n * @category Mageplaza\r\n * @package Mageplaza_Osc\r\n * @copyright Copyright (c) Mageplaza (https://www.mageplaza.com/)\r\n * @license https://www.mageplaza.com/LICENSE.txt\r\n */\r\n\r\ndefine(\r\n [\r\n 'ko',\r\n 'uiComponent'\r\n ],\r\n function (ko, Component) {\r\n \"use strict\";\r\n\r\n return Component.extend({\r\n defaults: {\r\n template: 'Mageplaza_Osc/container/review/addition'\r\n }\r\n });\r\n }\r\n);\r\n","Mageplaza_Osc/js/view/review/addition/gift-wrap.js":"/**\r\n * Mageplaza\r\n *\r\n * NOTICE OF LICENSE\r\n *\r\n * This source file is subject to the Mageplaza.com license that is\r\n * available through the world-wide-web at this URL:\r\n * https://www.mageplaza.com/LICENSE.txt\r\n *\r\n * DISCLAIMER\r\n *\r\n * Do not edit or add to this file if you wish to upgrade this extension to newer\r\n * version in the future.\r\n *\r\n * @category Mageplaza\r\n * @package Mageplaza_Osc\r\n * @copyright Copyright (c) Mageplaza (https://www.mageplaza.com/)\r\n * @license https://www.mageplaza.com/LICENSE.txt\r\n */\r\n\r\ndefine(\r\n [\r\n 'jquery',\r\n 'ko',\r\n 'uiComponent',\r\n 'Magento_Checkout/js/model/quote',\r\n 'Magento_Checkout/js/model/totals',\r\n 'Magento_Catalog/js/price-utils',\r\n 'Mageplaza_Osc/js/action/gift-wrap'\r\n ],\r\n function ($,\r\n ko,\r\n Component,\r\n quote,\r\n totals,\r\n priceUtils,\r\n giftWrapAction) {\r\n \"use strict\";\r\n\r\n return Component.extend({\r\n defaults: {\r\n template: 'Mageplaza_Osc/container/review/addition/gift-wrap'\r\n },\r\n quoteIsVirtual: quote.isVirtual(),\r\n initialAmount: ko.computed(function () {\r\n var gwAmount = 0;\r\n\r\n var gwSegment = totals.getSegment('osc_gift_wrap');\r\n if (gwSegment && gwSegment.extension_attributes) {\r\n gwAmount = gwSegment.extension_attributes.gift_wrap_amount;\r\n }\r\n\r\n if (gwAmount >= 0) {\r\n return priceUtils.formatPrice(gwAmount, quote.getPriceFormat());\r\n }\r\n\r\n return '';\r\n }),\r\n initObservable: function () {\r\n this._super()\r\n .observe({\r\n isUseGiftWrap: window.checkoutConfig.oscConfig.isUsedGiftWrap\r\n });\r\n\r\n this.isUseGiftWrap.subscribe(function (newValue) {\r\n var payload = {\r\n is_use_gift_wrap: newValue\r\n };\r\n\r\n giftWrapAction(payload);\r\n });\r\n\r\n return this;\r\n }\r\n });\r\n }\r\n);\r\n","Mageplaza_Osc/js/view/review/addition/gift-message.js":"/**\r\n * Mageplaza\r\n *\r\n * NOTICE OF LICENSE\r\n *\r\n * This source file is subject to the Mageplaza.com license that is\r\n * available through the world-wide-web at this URL:\r\n * https://www.mageplaza.com/LICENSE.txt\r\n *\r\n * DISCLAIMER\r\n *\r\n * Do not edit or add to this file if you wish to upgrade this extension to newer\r\n * version in the future.\r\n *\r\n * @category Mageplaza\r\n * @package Mageplaza_Osc\r\n * @copyright Copyright (c) Mageplaza (https://www.mageplaza.com/)\r\n * @license https://www.mageplaza.com/LICENSE.txt\r\n */\r\n\r\ndefine(\r\n [\r\n 'ko',\r\n 'jquery',\r\n 'uiComponent',\r\n 'Mageplaza_Osc/js/model/gift-message'\r\n ],\r\n function (ko, $, Component, giftMessageModel) {\r\n 'use strict';\r\n return Component.extend({\r\n\r\n defaults: {\r\n template: 'Mageplaza_Osc/container/review/a
2ddition/gift-message'\r\n },\r\n formBlockVisibility: null,\r\n resultBlockVisibility: null,\r\n model: {},\r\n\r\n /**\r\n * Component init\r\n */\r\n initialize: function () {\r\n this._super()\r\n .observe('formBlockVisibility')\r\n .observe({\r\n 'resultBlockVisibility': false\r\n });\r\n this.model = new giftMessageModel();\r\n this.isResultBlockVisible();\r\n this.isUseGiftMessage();\r\n },\r\n\r\n /**\r\n *\r\n * @returns {boolean}\r\n */\r\n isUseGiftMessage: function () {\r\n return !!window.checkoutConfig.oscConfig.giftMessageOptions.giftMessage.orderLevel.hasOwnProperty(\"gift_message_id\");\r\n },\r\n\r\n /**\r\n * Is reslt block visible\r\n */\r\n isResultBlockVisible: function () {\r\n var self = this;\r\n\r\n if (this.model.getObservable('alreadyAdded')()) {\r\n this.resultBlockVisibility(true);\r\n }\r\n this.model.getObservable('additionalOptionsApplied').subscribe(function (value) {\r\n if (value == true) {\r\n self.resultBlockVisibility(true);\r\n }\r\n });\r\n },\r\n\r\n /**\r\n * @param {String} key\r\n * @return {*}\r\n */\r\n getObservable: function (key) {\r\n return this.model.getObservable(key);\r\n },\r\n\r\n /**\r\n * Hide\\Show form block\r\n */\r\n toggleFormBlockVisibility: function () {\r\n if (!this.model.getObservable('alreadyAdded')()) {\r\n this.formBlockVisibility(!this.formBlockVisibility());\r\n } else {\r\n this.resultBlockVisibility(!this.resultBlockVisibility());\r\n }\r\n return true;\r\n },\r\n\r\n /**\r\n * @return {Boolean}\r\n */\r\n isActive: function () {\r\n return this.model.isGiftMessageAvailable();\r\n }\r\n });\r\n }\r\n);\r\n","Mageplaza_Osc/js/view/review/addition/newsletter.js":"/**\r\n * Mageplaza\r\n *\r\n * NOTICE OF LICENSE\r\n *\r\n * This source file is subject to the Mageplaza.com license that is\r\n * available through the world-wide-web at this URL:\r\n * https://www.mageplaza.com/LICENSE.txt\r\n *\r\n * DISCLAIMER\r\n *\r\n * Do not edit or add to this file if you wish to upgrade this extension to newer\r\n * version in the future.\r\n *\r\n * @category Mageplaza\r\n * @package Mageplaza_Osc\r\n * @copyright Copyright (c) Mageplaza (https://www.mageplaza.com/)\r\n * @license https://www.mageplaza.com/LICENSE.txt\r\n */\r\n\r\ndefine(\r\n [\r\n 'ko',\r\n 'uiComponent',\r\n 'Mageplaza_Osc/js/model/osc-data'\r\n ],\r\n function (ko, Component, oscData) {\r\n \"use strict\";\r\n\r\n var cacheKey = 'is_subscribed';\r\n\r\n return Component.extend({\r\n defaults: {\r\n template: 'Mageplaza_Osc/container/review/addition/newsletter'\r\n },\r\n initObservable: function () {\r\n this._super()\r\n .observe({\r\n isRegisterNewsletter: (typeof oscData.getData(cacheKey) === 'undefined') ? window.checkoutConfig.oscConfig.newsletterDefault : oscData.getData(cacheKey)\r\n });\r\n oscData.setData(cacheKey, this.isRegisterNewsletter());\r\n this.isRegisterNewsletter.subscribe(function (newValue) {\r\n oscData.setData(cacheKey, newValue);\r\n });\r\n\r\n return this;\r\n }\r\n });\r\n }\r\n);\r\n","Mageplaza_Osc/js/view/summary/cart-items.js":"/**\r\n * Mageplaza\r\n *\r\n * NOTICE OF LICENSE\r\n *\r\n * This source file is subject to the Mageplaza.com license that is\r\n * available through the world-wide-web at this URL:\r\n * https://www.mageplaza.com/LICENSE.txt\r\n *\r\n * DISCLAIMER\r\n *\r\n * Do not edit or add to this file if you wish to upgrade this extension to newer\r\n * version in the future.\r\n *\r\n * @category Mageplaza\r\n * @package Mageplaza_Osc\r\n * @copyright Copyright (c) Mageplaza (https://www.mageplaza.com/)\r\n * @license https://www.mageplaza.com/LICENSE.txt\r\n */\r\n\r\ndefine([\r\n 'ko',\r\n 'underscore',\r\n 'jquery',\r\n 'Magento_Checkout/js/view/summary/cart-items',\r\n 'Mageplaza_Osc/js/model/osc-data'\r\n], function (ko, _, $, Component, oscData) {\r\n \"use strict\";\r\n\r\n var cacheKey = 'is_cart_expanded';\r\n\r\n return Component.extend({\r\n toggleCart: function () {\r\n oscData.setData(cacheKey, !this.isCartExpanded());\r\n\r\n return true;\r\n },\r\n\r\n isCartExpanded: function () {\r\n var isExpanded = oscData.getData(cacheKey),\r\n isShowItemListToggle = window.checkoutConfig.oscConfig.isShowItemListToggle;\r\n\r\n return typeof isExpanded === 'undefined' || !isShowItemListToggle ? true : isExpanded;\r\n }\r\n });\r\n});\r\n","Mageplaza_Osc/js/view/summary/gift-wrap.js":"/**\r\n * Mageplaza\r\n *\r\n * NOTICE OF LICENSE\r\n *\r\n * This source file is subject to the Mageplaza.com license that is\r\n * available through the world-wide-web at this URL:\r\n * https://www.mageplaza.com/LICENSE.txt\r\n *\r\n * DISCLAIMER\r\n *\r\n * Do not edit or add to this file if you wish to upgrade this extension to newer\r\n * version in the future.\r\n *\r\n * @category Mageplaza\r\n * @package Mageplaza_Osc\r\n * @copyright Copyright (c) Mageplaza (https://www.mageplaza.com/)\r\n * @license https://www.mageplaza.com/LICENSE.txt\r\n */\r\n\r\n/*jshint browser:true jquery:true*/\r\n/*global alert*/\r\ndefine(\r\n [\r\n 'ko',\r\n 'Magento_Checkout/js/view/summary/abstract-total',\r\n 'Magento_Checkout/js/model/quote',\r\n 'Magento_Checkout/js/model/totals',\r\n 'Mageplaza_Osc/js/model/osc-data'\r\n ],\r\n function (ko, Component, quote, totals, oscData) {\r\n \"use strict\";\r\n\r\n return Component.extend({\r\n defaults: {\r\n template: 'Mageplaza_Osc/container/summary/gift-wrap'\r\n },\r\n totals: quote.getTotals(),\r\n isDisplay: function () {\r\n return this.getPureValue() >= 0 && oscData.getData('is_use_gift_wrap');\r\n },\r\n getPureValue: function () {\r\n var giftWrapAmount = 0;\r\n\r\n if (this.totals() && totals.getSegment('osc_gift_wrap')) {\r\n giftWrapAmount = parseFloat(totals.getSegment('osc_gift_wrap').value);\r\n }\r\n\r\n return giftWrapAmount;\r\n },\r\n getValue: function () {\r\n return this.getFormattedPrice(this.getPureValue());\r\n }\r\n });\r\n }\r\n);\r\n","Mageplaza_Osc/js/view/summary/item/details.js":"/** \r\n* Override the JS file and removed the is_virtual check of item from the checkout as it cause the issur of the free product in the order summary. \r\n* PM PS, 30.10.19, @link - https://trello.com/c/U2vjTGJN/90-check-out#comment-5db951c4f6755d83ea507638 \r\n*/\r\n\r\ndefine([\r\n 'ko',\r\n 'underscore',\r\n 'jquery',\r\n 'Magento_Checkout/js/view/summary/item/details',\r\n 'Magento_Checkout/js/model/quote',\r\n 'Magento_Catalog/js/price-utils',\r\n 'Mageplaza_Osc/js/action/update-item',\r\n 'Mageplaza_Osc/js/action/gift-message-item',\r\n 'mage/url',\r\n 'mage/translate',\r\n 'Magento_Ui/js/modal/modal',\r\n 'Mageplaza_Osc/js/action/payment-total-information',\r\n 'Mageplaza_Osc/js/options/configurable',\r\n 'priceOptions'\r\n], function (ko, _, $, Component, quote, priceUtils, updateItemAction, giftMessageItem, url, $t, modal, getPaymentTotalInformation) {\r\n \"use strict\";\r\n\r\n var giftMessageOptions = window.checkoutConfig.oscConfig.giftMessageOptions,\r\n qtyIncrements = window.checkoutConfig.oscConfig.qtyIncrements,\r\n ve = window.checkoutConfig.VE;\r\n var freegiftproduct = window.checkoutConfig.freegiftproduct;\r\n return Component.extend({\r\n defaults: {\r\n template: 'Mageplaza_Osc/container/summary/item/details'\r\n },\r\n giftMessageItemsTitleHover: $t('Gift message item'),\r\n updateQtyDelay: 500,\r\n updateQtyTimeout: 0,\r\n itemOptions: {},\r\n\r\n getSku: function(item) {\r\n var quoteItem = this.getQuoteItem(item.item_id, quote.getItems());\r\n return quoteItem && quoteItem.sku ? quoteItem.sku : '';\r\n },\r\n\r\n getQuoteItem: function (itemId, items) {\r\n var item = _.find(items, function (quoteItem) {\r\n return Number(quoteItem.item_id) === Number(itemId);\r\n });\r\n\r\n return item ? item : {};\r\n },\r\n\r\n /**\r\n * Get product url\r\n * @param item\r\n * @returns {*}\r\n */\r\n getProductUrl: function (item) {\r\n var quoteItem = this.getQuoteItem(item.item_id, quote.getItems());\r\n\r\n if (item.hasOwnProperty('request_path') && item.request_path) {\r\n return item.request_path;\r\n }\r\n\r\n if (quoteItem && quoteItem.hasOwnProperty('product') && quoteItem.product.request_path) {\r\n return url.build(quoteItem.product.request_path);\r\n }\r\n\r\n return false;\r\n },\r\n\r\n /**\r\n * @param item\r\n * @returns {*}\r\n */\r\n getFreeGiftProduct: function (item)\r\n {\r\n if(item['item_id'] == freegiftproduct['item_id'] \r\n || item['base_price'] == null || item['base_price'] == 0) {\r\n return true;\r\n }\r\n return false;\r\n },\r\n\r\n /**\r\n * Get product base price\r\n * @param parent\r\n * @returns {*}\r\n * @author: PS\r\n * @trello: https://trello.com/c/U2vjTGJN/\r\n */\r\n getProductBasePrice: function (parent) {\r\n // parent is the totals item from the foreach binding and already carries price directly.\r\n // The original _.find(quote.totals().items) caused a race condition: during AJAX totals\r\n // updates the new totals could be read while parent still held an old item_id \u2192 not found.\r\n if (parent && parent.hasOwnProperty('price')) {\r\n return priceUtils.formatPrice(parent.price);\r\n }\r\n\r\n return false;\r\n },\r\n\r\n /**\r\n * Init popup gift message item window\r\n * @param element\r\n * @param item_id\r\n */\r\n setModalElement: function (element, item_id) {\r\n var self = this,\r\n options = {\r\n 'type': 'popup',\r\n 'title': $t('Gift Message Item (' + element.title + ')'),\r\n 'modalClass': 'popup-gift-message-item',\r\n 'responsive': true,\r\n 'innerScroll': true,\r\n 'trigger': '#' + element.i
2d,\r\n 'buttons': [],\r\n 'opened': function () {\r\n self.loadGiftMessageItem(item_id);\r\n }\r\n };\r\n\r\n this.modalWindow = element;\r\n modal(options, $(this.modalWindow));\r\n },\r\n\r\n /**\r\n * Load exist gift message item from\r\n * @param itemId\r\n */\r\n loadGiftMessageItem: function (itemId) {\r\n var item;\r\n\r\n $('.popup-gift-message-item._show #item' + itemId).find('input:text,textarea').val('');\r\n if (giftMessageOptions.giftMessage.itemLevel[itemId].hasOwnProperty('message')\r\n && typeof giftMessageOptions.giftMessage.itemLevel[itemId]['message'] == 'object') {\r\n item = giftMessageOptions.giftMessage.itemLevel[itemId]['message'];\r\n\r\n $(this.createSelectorElement(itemId + ' #gift-message-whole-from')).val(item.sender);\r\n $(this.createSelectorElement(itemId + ' #gift-message-whole-to')).val(item.recipient);\r\n $(this.createSelectorElement(itemId + ' #gift-message-whole-message')).val(item.message);\r\n $(this.createSelectorElement(itemId + ' .action.delete')).show();\r\n\r\n return;\r\n }\r\n\r\n $(this.createSelectorElement(itemId + ' .action.delete')).hide();\r\n },\r\n\r\n /**\r\n * create selector element\r\n * @param selector\r\n * @returns {string}\r\n */\r\n createSelectorElement: function (selector) {\r\n return '.popup-gift-message-item._show #item' + selector;\r\n },\r\n\r\n /**\r\n * Update gift message item\r\n * @param itemId\r\n */\r\n updateGiftMessageItem: function (itemId) {\r\n var data = {\r\n gift_message: {\r\n sender: $(this.createSelectorElement(itemId + ' #gift-message-whole-from')).val(),\r\n recipient: $(this.createSelectorElement(itemId + ' #gift-message-whole-to')).val(),\r\n message: $(this.createSelectorElement(itemId + ' #gift-message-whole-message')).val()\r\n }\r\n };\r\n\r\n giftMessageItem(data, itemId, false);\r\n this.closePopup();\r\n },\r\n\r\n /**\r\n * Delete gift message item\r\n * @param itemId\r\n */\r\n deleteGiftMessageItem: function (itemId) {\r\n giftMessageItem({\r\n gift_message: {\r\n sender: '',\r\n recipient: '',\r\n message: ''\r\n }\r\n }, itemId, true);\r\n this.closePopup();\r\n },\r\n\r\n /**\r\n * Close popup gift message item\r\n */\r\n closePopup: function () {\r\n $('.action-close').trigger('click');\r\n },\r\n\r\n /**\r\n * Check item is available\r\n * @param itemId\r\n * @returns {boolean}\r\n */\r\n isItemAvailable: function (itemId) {\r\n var isGloballyAvailable,\r\n itemConfig,\r\n item = this.getQuoteItem(itemId, quote.getItems());\r\n\r\n if (Number(item.is_virtual) || !giftMessageOptions.isEnableOscGiftMessageItems) return false;\r\n\r\n // gift message product configuration must override system configuration\r\n isGloballyAvailable = this.getConfigValue('isItemLevelGiftOptionsEnabled');\r\n itemConfig = giftMessageOptions.giftMessage.hasOwnProperty('itemLevel')\r\n && giftMessageOptions.giftMessage.itemLevel.hasOwnProperty(itemId) ?\r\n giftMessageOptions.giftMessage.itemLevel[itemId] : {};\r\n\r\n return itemConfig.hasOwnProperty('is_available') ? itemConfig['is_available'] : isGloballyAvailable;\r\n },\r\n\r\n getConfigValue: function (key) {\r\n return giftMe
2ssageOptions.hasOwnProperty(key) ?\r\n giftMessageOptions[key]\r\n : false;\r\n },\r\n\r\n /**\r\n * Plus item qty\r\n *\r\n * @param item\r\n * @param event\r\n */\r\n plusQty: function (item, event) {\r\n var self = this,\r\n target = $(event.target).closest('td').find('.item_qty'),\r\n itemId = Number(target.attr(\"id\")),\r\n qty = Number(target.val()),\r\n veIncrement = Number(ve[itemId].veIncrement),\r\n subQty = qty % veIncrement;\r\n\r\n clearTimeout(this.updateQtyTimeout);\r\n /**\r\n * @author : KK\r\n * @description : Added code for not removing product when qty goes minus from set in backend.\r\n * @date : 11 September 2023\r\n */\r\n /*\r\n * @author: macs_rst \r\n * @date: on 29.11.2023\r\n * @description: Umbau auf VE-Logik\r\n */\r\n if (ve.hasOwnProperty(itemId) && subQty == 0) {\r\n qty = (Math.floor(qty / veIncrement) + 1) * veIncrement;\r\n } else {\r\n qty += veIncrement;\r\n }\r\n\r\n target.val(qty);\r\n\r\n this.updateQtyTimeout = setTimeout(function () {\r\n self.updateItem(itemId, qty, target);\r\n /**\r\n * @author : KK\r\n * @description : Disable Button during Ajax processing\r\n * @date : 10 August 2023\r\n */\r\n $('.action.primary.checkout').attr('disabled', 'disabled');\r\n }, this.updateQtyDelay);\r\n },\r\n\r\n /**\r\n * Minus item qty\r\n *\r\n * @param item\r\n * @param event\r\n */\r\n minusQty: function (item, event) {\r\n var self = this,\r\n target = $(event.target).closest('td').find('.item_qty'),\r\n itemId = Number(target.attr(\"id\")),\r\n qty = Number(target.val()),\r\n yve1 = (Number(ve[itemId].yve1) ?? 1),\r\n yve1min = ve[itemId].yve1min,\r\n veIncrement = Number(ve[itemId].veIncrement),\r\n newQty,\r\n subQty = qty % veIncrement;\r\n\r\n clearTimeout(this.updateQtyTimeout);\r\n\r\n if(yve1min && qty < yve1){ //Mindesbestellmenge unterschritten\r\n newQty = yve1;\r\n }else if(qty == yve1){ //Verpackungseinheit erreicht\r\n newQty = yve1;\r\n }else if (subQty != 0){\r\n newQty = qty - veIncrement;\r\n }else{\r\n newQty = (Math.floor(qty/veIncrement) -1) * veIncrement;\r\n }\r\n\r\n target.val(newQty);\r\n\r\n this.updateQtyTimeout = setTimeout(function () {\r\n self.updateItem(itemId, newQty, target);\r\n /**\r\n * @author : KK\r\n * @description : Disable Button during Ajax processing\r\n * @date : 10 August 2023\r\n */\r\n $('.action.primary.checkout').attr('disabled', 'disabled');\r\n }, this.updateQtyDelay);\r\n },\r\n\r\n /**\r\n * Change item qty in input box\r\n *\r\n * @param item\r\n * @param event\r\n */\r\n changeQty: function (item, event) {\r\n var target = $(event.target),\r\n itemId = Number(target.attr(\"id\")),\r\n qty = Number(target.val()),\r\n checkPassed = [];\r\n\r\n //returns [true/false,qty];\r\n checkPassed = this.checkVE(target);\r\n\r\n if(checkPassed[0]){\r\n qty = (checkPassed[1]?checkPassed[1]:qty);\r\n this.updateItem(itemId, qty, target);\r\n }\r\n },\r\n\r\n checkVE: function (item){\r\n var target = item,\r\n itemId = Number(target.attr(\"id\")),\r\n qty = Number(target.val()),\r\n sku = ve[itemId].sku,\r\n yve1 = Number(ve[itemId].yve1),\r\n yve1min = ve[itemId].yve1min,\r\n veIncrement = Number(ve[itemId].veIncrement),\r\n subQty = qty % veIncrement,\r\n newQty = Math.floor(qty/veIncrement) * veIncrement,\r\n checkoutBtn = $('button.primary.checkout');\r\n\r\n if(!$('#validation-message-box').length){\r\n $('#checkoutSteps').append(\"<div id='validation-message-box'></div>\");\r\n\r\n }\r\n $(document).on(\r\n {\r\n 'click': function(){\r\n $('#errorMod
2al').remove();\r\n checkoutBtn.attr('disabled',false);\r\n }\r\n\r\n },\r\n \"#errorModal .close\"\r\n );\r\n\r\n\r\n if(qty != 0){\r\n if(yve1min){\r\n if(qty < yve1){ //Mindestmenge wurde unterschritten \r\n $(\"#errorModal\").remove();\r\n $('#validation-message-box').after('<div id=\"errorModal\"><span class=\"close\">x</span><div><p>Die Mindestabnahmemenge f\u00fcr den Artikel '+sku+' betr\u00e4gt '+yve1+'.</p><p>Bitte \u00fcberpr\u00fcfen Sie Ihre Eingabe.</p></div></div>');\r\n target.val(yve1);\r\n checkoutBtn.attr('disabled',true);\r\n return [true,yve1];\r\n\r\n }else{\r\n //n\u00e4chstgelegene VE-Menge errechnen\r\n let x = yve1;\r\n while(x + veIncrement <= qty){\r\n x+=veIncrement;\r\n }\r\n\r\n if(qty != x){\r\n $(\"#errorModal\").remove();\r\n $('#validation-message-box').after('<div id=\"errorModal\"><span class=\"close\">x</span><div><p>Der Artikel '+sku+' kann nur in vollen Verpackungseinheiten bestellt werden.</p><p>Eine VE betr\u00e4gt '+yve1+'</p><p>Bitte \u00fcberpr\u00fcfen Sie Ihre Eingabe.</p></div></div>');\r\n checkoutBtn.attr('disabled',true);\r\n }\r\n qty = x;\r\n target.val(qty);\r\n \r\n return [true,qty];\r\n }\r\n\r\n }else{\r\n if(subQty == 0){ //eingegebene Menge muss einem vielfachen von yve1 entsprechen \r\n target.val(qty);\r\n return [true,qty]; \r\n }\r\n else{\r\n $(\"#errorModal\").remove();\r\n $('#validation-message-box').after('<div id=\"errorModal\"><span class=\"close\">x</span><div><p>Der Artikel '+sku+' kann nur in vollen Verpackungseinheiten bestellt werden.</p><p>Eine VE betr\u00e4gt '+yve1+'.</p><p>Bitte \u00fcberpr\u00fcfen Sie Ihre Eingabe.</p></div></div>');\r\n qty = (newQty<yve1?yve1:newQty);\r\n target.val(qty);\r\n checkoutBtn.attr('disabled',true);\r\n \r\n return [true,qty];\r\n }\r\n }\r\n }else{\r\n qty = (yve1min?yve1:veIncrement);\r\n target.val(qty);\r\n\r\n return[true,qty];\r\n }\r\n\r\n },\r\n\r\n /**\r\n * Remove item by id\r\n *\r\n * @param itemId\r\n */\r\n removeItem: function (itemId) {\r\n this.updateItem(itemId);\r\n },\r\n\r\n /**\r\n * Send request update item\r\n *\r\n * @param itemId\r\n * @param itemQty\r\n * @param target\r\n * @returns {*}\r\n */\r\n updateItem: function (itemId, itemQty, target) {\r\n var self = this,\r\n payload = {\r\n item_id: itemId\r\n };\r\n\r\n if (typeof itemQty !== 'undefined') {\r\n payload['item_qty'] = itemQty;\r\n }\r\n\r\n updateItemAction(payload).fail(function () {\r\n target.val(self.getProductQty(itemId));\r\n });\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Get product quantity\r\n * @param itemId\r\n * @returns {*}\r\n */\r\n getProductQty: function (itemId) {\r\n var item = this.getQuoteItem(itemId, quote.totals().items);\r\n\r\n if (item && item.hasOwnProperty('qty')) {\r\n return item.qty;\r\n }\r\n\r\n return 0;\r\n },\r\n\r\n setProductModal: function (element, item) {\r\n var self = this,\r\n options,\r\n selector = '#mposc-product-modal-' + item.item_id;\r\n\r\n $('.mposc-product-modal-' + item.item_id).remove();\r\n\r\n options = {\r\n 'type': 'popup',\r\n 'title': item.name,\r\n 'modalClass': 'mposc-product-modal mposc-product-modal-' + item.item_id,\r\n 'responsive': true,\r\n 'innerScroll': true,\r\n 'trigger': '#button-edit-item-' + item.item_id,\r\n 'buttons': [{\r\n text: $t('Update'),\r\n class: 'action primary',\r\n click: function () {\r\n if (!item.validation.valid()) {\r\n return;\r\n }\r\n\r\n if ($(selector + ' > form').serialize() === self.itemOptions[item.item_id]) {\r\n this.closeModal();\r\n } else {\r\n self.onUpdateCart(item);\r\n }\r\n }\r\n }, {\r\n text: $t('Cancel'),\r\n class: 'action',\r\n click: function () {\r\n this.closeModal();\r\n }\r\n }]\r\n };\r\n\r\n modal(options, $(selector));\r\n },\r\n\r\n showProductModal: function (item, data, event) {\r\n if (event.type !== 'click') {\r\n return;\r\n }\r\n\r\n $('#mposc-product-modal-' + item.item_id).modal('openM
2odal');\r\n },\r\n\r\n initOptions: function (item) {\r\n var itemConfig = this.getItemConfig(item),\r\n selector = '.mposc-product-modal-' + item.item_id + ' form',\r\n container = $(selector);\r\n\r\n if (itemConfig.hasOwnProperty('configurableAttributes') && itemConfig.configurableAttributes) {\r\n container.mposcConfigurable({\r\n spConfig: JSON.parse(itemConfig.configurableAttributes.spConfig),\r\n superSelector: selector + ' .super-attribute-select'\r\n });\r\n }\r\n\r\n if (itemConfig.hasOwnProperty('customOptions') && itemConfig.customOptions) {\r\n container.priceOptions({\r\n optionConfig: JSON.parse(itemConfig.customOptions.optionConfig)\r\n });\r\n }\r\n container.trigger('contentUpdated');\r\n\r\n item.form = container;\r\n item.validation = container.validation();\r\n\r\n this.setItemOptionsData(item, container);\r\n },\r\n\r\n getConfigurableOptions: function (item) {\r\n var itemConfig = this.getItemConfig(item);\r\n\r\n if (itemConfig.hasOwnProperty('configurableAttributes')) {\r\n return itemConfig.configurableAttributes.template;\r\n }\r\n\r\n return '';\r\n },\r\n\r\n getCustomOptions: function (item) {\r\n var itemConfig = this.getItemConfig(item);\r\n\r\n if (itemConfig.hasOwnProperty('customOptions')) {\r\n return itemConfig.customOptions.template;\r\n }\r\n\r\n return '';\r\n },\r\n\r\n /**\r\n * @param item\r\n * @return {*}\r\n */\r\n getItemConfig: function (item) {\r\n var key = 'mposc', quoteItem;\r\n\r\n if (item.hasOwnProperty(key) && item[key]) {\r\n return item[key];\r\n }\r\n\r\n quoteItem = this.getQuoteItem(item.item_id, quote.getItems());\r\n\r\n if (quoteItem.hasOwnProperty(key) && quoteItem[key]) {\r\n return quoteItem[key];\r\n }\r\n\r\n return {};\r\n },\r\n\r\n onUpdateCart: function (item) {\r\n var self = this,\r\n selector = '#mposc-product-modal-' + item.item_id,\r\n data = new FormData(item.form[0]),\r\n newItem;\r\n\r\n data.append('qty', $('#' + item.item_id).val());\r\n\r\n $.ajax({\r\n type: 'POST',\r\n url: window.checkoutConfig.oscConfig.updateCartUrl + 'id/' + item.item_id,\r\n data: data,\r\n processData: false,\r\n contentType: false,\r\n showLoader: true,\r\n success: function (response) {\r\n if (response.error) {\r\n $(selector + ' > .message').show();\r\n $(selector + ' > .message > span').text(response.error);\r\n\r\n return;\r\n }\r\n\r\n self.setItemOptionsData(item, $(selector + ' > form'));\r\n $(selector).modal('closeModal');\r\n\r\n getPaymentTotalInformation().done(function (totals) {\r\n newItem = self.getQuoteItem(item.item_id, totals.totals.items);\r\n\r\n if (!newItem.item_id) {\r\n $(selector).remove();\r\n }\r\n });\r\n }\r\n });\r\n },\r\n\r\n setItemOptionsData: function (item, form) {\r\n this.itemOptions[item.item_id] = form.serialize();\r\n }\r\n });\r\n});\r\n\r\n","Mageplaza_Osc/js/view/payment/braintree-adapter-mixin.js":"/**\n * Mageplaza\n *\n * NOTICE OF LICENSE\n *\n * This source file is subject to the Mageplaza.com license that is\n * available through the world-wide-web at this URL:\n * https://www.mageplaza.com/LICENSE.txt\n *\n * DISCLAIMER\n *\n * Do not edit or add to this file if you wish to upgrade this extension to newer\n * version in the future.\n *\n * @category Mageplaza\n * @package Mageplaza_Osc\n * @copyright Copyright (c) Mageplaza (https://www.mageplaza.com/)\n * @license https://www.mageplaza.com/LICENSE.txt\n */\n\ndefine([\n 'mage/utils/wrapper',\n 'jquery',\n 'Mageplaza_Osc/js/action/set-checkout-information',\n 'Magento_Checkout/js/model/payment/additional-validators',\n 'braintreePayPalCheckout'\n], function (wrapper,\n $,\n setCheckoutInformationAction,\n additionalValidators,\n paypalCheckout) {\n 'use strict';\n return function (BraintreeAdapter) {\n BraintreeAdapter.setupPaypal = wrapper.wrapSuper(BraintreeAdapter.setupPaypal, function () {\n var self = this;\n\n if (this.config.paypalInstance) {\n fullScreenLoader.stopLoader(true);\n return;\n }\n\n paypalCheckout.create({\n client: this.clientInstance\n }, function (createErr, paypalCheckoutInstance) {\n if (createErr) {\n self.showError($t(\"PayPal Checkout could not be initialized. Please contact the store owner.\"));\n console.error('paypalCheckout error', createErr);\n return;\n }\n\n var paypalPayment = this.config.paypal,\n onPaymentMethodReceived = this.config.onPaymentMethodReceived,\n style = {\n color: this.getColor(),\n shape: this.get
2Shape(),\n layout: this.getLayout(),\n size: this.getSize()\n },\n funding = {\n allowed: [],\n disallowed: []\n };\n\n if (this.getLabel()) {\n style.label = this.getLabel();\n }\n if (this.getBranding()) {\n style.branding = this.getBranding();\n }\n if (this.getFundingIcons()) {\n style.fundingicons = this.getFundingIcons();\n }\n\n if (this.config.offerCredit === true) {\n paypalPayment.offerCredit = true;\n style.label = \"credit\";\n style.color = \"darkblue\";\n style.layout = \"horizontal\";\n funding.allowed.push(paypal.FUNDING.CREDIT);\n } else {\n paypalPayment.offerCredit = false;\n funding.disallowed.push(paypal.FUNDING.CREDIT);\n }\n\n // Disabled function options\n var disabledFunding = this.getDisabledFunding();\n if (true === disabledFunding.card) {\n funding.disallowed.push(paypal.FUNDING.CARD);\n }\n if (true === disabledFunding.elv) {\n funding.disallowed.push(paypal.FUNDING.ELV);\n }\n\n // Render\n this.config.paypalInstance = paypalCheckoutInstance;\n var events = this.events;\n\n $('#' + this.config.buttonId).html('');\n paypal.Button.render({\n env: this.getEnvironment(),\n style: style,\n commit: true,\n funding: funding,\n locale: this.config.paypal.locale,\n\n payment: function () {\n return paypalCheckoutInstance.createPayment(paypalPayment);\n }
2,\n\n onCancel: function (data) {\n console.log('checkout.js payment cancelled', JSON.stringify(data, 0, 2));\n\n if (typeof events.onCancel === 'function') {\n events.onCancel();\n }\n },\n\n onError: function (err) {\n self.showError($t(\"PayPal Checkout could not be initialized. Please contact the store owner.\"));\n this.config.paypalInstance = null;\n console.error('Paypal checkout.js error', err);\n\n if (typeof events.onError === 'function') {\n events.onError(err);\n }\n }.bind(this),\n\n onClick: function (data) {\n if (additionalValidators.validate()) {\n setCheckoutInformationAction();\n\n if (typeof events.onClick === 'function') {\n events.onClick(data);\n }\n }\n },\n\n /**\n * Pass the payload (and payload.nonce) through to the implementation's onPaymentMethodReceived method\n * @param data\n * @param actions\n */\n onAuthorize: function (data, actions) {\n return paypalCheckoutInstance.tokenizePayment(data)\n .then(function (payload) {\n onPaymentMethodReceived(payload);\n });\n }\n }, '#' + this.config.buttonId).then(function () {\n this.enableButton();\n if (typeof this.config.onPaymentMethodError === 'function') {\n this.config.onPaymentMethodError();\n }\n }
2.bind(this)).then(function (data) {\n if (typeof events.onRender === 'function') {\n events.onRender(data);\n }\n });\n }.bind(this));\n });\n\n return BraintreeAdapter;\n };\n});\n","Mageplaza_Osc/js/view/payment/list.js":"/**\r\n * Mageplaza\r\n *\r\n * NOTICE OF LICENSE\r\n *\r\n * This source file is subject to the Mageplaza.com license that is\r\n * available through the world-wide-web at this URL:\r\n * https://www.mageplaza.com/LICENSE.txt\r\n *\r\n * DISCLAIMER\r\n *\r\n * Do not edit or add to this file if you wish to upgrade this extension to newer\r\n * version in the future.\r\n *\r\n * @category Mageplaza\r\n * @package Mageplaza_Osc\r\n * @copyright Copyright (c) Mageplaza (https://www.mageplaza.com/)\r\n * @license https://www.mageplaza.com/LICENSE.txt\r\n */\r\n\r\ndefine([\r\n 'underscore',\r\n 'ko',\r\n 'mageUtils',\r\n 'Magento_Checkout/js/view/payment/list',\r\n 'Magento_Checkout/js/model/payment/method-list',\r\n 'Magento_Checkout/js/model/payment/renderer-list',\r\n 'uiLayout',\r\n 'Magento_Checkout/js/model/checkout-data-resolver',\r\n 'mage/translate',\r\n 'uiRegistry'\r\n], function (_, ko, utils, Component, paymentMethods, rendererList, layout, checkoutDataResolver, $t, registry) {\r\n 'use strict';\r\n\r\n return Component.extend({\r\n defaults: {\r\n template: 'Mageplaza_Osc/payment-methods/list',\r\n },\r\n\r\n /**\r\n * Create renderer.\r\n *\r\n * @param {Object} paymentMethodData\r\n */\r\n createRenderer: function (paymentMethodData) {\r\n if (paymentMethodData.method === 'paypal_express') {\r\n var isRendererForMethod = false,\r\n currentGroup;\r\n var isContextCheckout = window.checkoutConfig.payment.paypalExpress.isContextCheckout;\r\n if(isContextCheckout) {\r\n var paypalExpress = 'Mageplaza_Osc/js/view/payment/method-renderer/in-context/checkout-express';\r\n }\r\n\r\n registry.get(this.configDefaultGroup.name, function (defaultGroup) {\r\n _.each(rendererList(), function (renderer) {\r\n\r\n if (renderer.hasOwnProperty('typeComparatorCallback') &&\r\n typeof renderer.typeComparatorCallback == 'function'\r\n ) {\r\n isRendererForMethod = renderer.typeComparatorCallback(renderer.type, paymentMethodData.method);\r\n } else {\r\n isRendererForMethod = renderer.type === paymentMethodData.method;\r\n }\r\n\r\n if (isRendererForMethod) {\r\n currentGroup = renderer.group ? renderer.group : defaultGroup;\r\n\r\n this.collectPaymentGroups(currentGroup);\r\n /**\r\n * Remove the payalExpress Component from the KO JS.\r\n * It cause the console error on the checkout page.\r\n * PM PS, 13.11.19\r\n * @link https://trello.com/c/ZPFJSl9U/88-function-payment-prepayment-direct-debit-paypal#comment-5dcbe19af823d670f5e1120e\r\n **/\r\n /*\r\n * @author: macs_rst \r\n * @date: on 26.01.2024\r\n * @description: PaypalExpress Component wieder rein nehmen bz-254\r\n */\r\n layout([\r\n this.createComponent(\r\n {\r\n config: renderer.config,\r\n component: paypalExpress,\r\n name: renderer.type,\r\n method: paymentMethodData.method,\r\n item: paymentMethodData,\r\n displayArea: currentGroup.displayArea\r\n }\r\n )]);\r\n }\r\n }.bind(this));\r\n }.bind(this));\r\n }\r\n },\r\n });\r\n});\r\n","Mageplaza_Osc/js/view/payment/discount.js":"/**\n * Mageplaza\n *\n * NOTICE OF LICENSE\n *\n * This source file is subject to the Mageplaza.com license that is\n * available through the world-wide-web at this URL:\n * https://www.mageplaza.com/LICENSE.txt\n *\n * DISCLAIMER\n *\n * Do not edit or add to this file if you wish to upgrade this extension to newer\n * version in the future.\n *\n * @category Mageplaza\n * @package Mageplaza_Osc\n * @copyright Copyright (c) Mageplaza (https://www.mageplaza.com/)\n * @license https://www.mageplaza.com/LICENSE.txt\n */\n\n/*jshint browser:true jquery:true*/\n/*global alert*/\ndefine(\n [\n 'ko',\n 'Magento_SalesRule/js/view/payment/discount',\n 'Mageplaza_Osc/js/model/osc-loader/discount',\n 'Magento_Checkout/js/model/shipping-rate-service',\n 'Magento_Checkout/js/model/quote',\n 'Magento_Checkout/js/model/shipping-rate-registry'\n ],\n function (ko, Component, discountLoader, shippingRateService, quote, rateRegistry) {\n 'use strict';\n\n return Component.extend({\n defaults: {\n template: 'Mageplaza_Osc/container/review/discount'\n },\n isBlockLoading: discountLoader.isLoading,\n\n initialize: function () {\n this._super();\n this.isApplied(window.checkoutConfig.quoteData.coupon_code);\n this.isApplied.subscribe(function () {\n\n if (!quote.shippingAddress() || quote.isVirtual()) {\n return this;\n }\n\n var shippingAddress = quote.shippingAddress();\n if (shippingAddress.getCacheKey()) {\n rateRegistry.set(shippingAddress.getCacheKey(), null);\n }\n if (shippingAddress.countryId) {\n shippingRateService.estimateShippingMethod();\n }\n });\n }\n });\n }\n);\n","Mageplaza_Osc/js/view/payment/method-renderer/braintree-paypal-mixins.js":"/**\r\n * Mageplaza\r\n *\r\n * NOTICE OF LICENSE\r\n *\r\n * This source file is subject to the Mageplaza.com license that is\r\n * available through the world-wide-web at this URL:\r\n * https://www.mageplaza.com/LICENSE.txt\r\n *\r\n * DISCLAIMER\r\n *\r\n * Do not edit or add to this file if you wish to upgrade this extension to newer\r\n * version in the future.\r\n *\r\n * @category Mageplaza\r\n * @package Mageplaza_Osc\r\n * @copyright Copyright (c) Mageplaza (https://www.mageplaza.com/)\r\n * @license https://www.mageplaza.com/LICENSE.txt\r\n */\r\n\r\ndefine([\r\n 'jquery',\r\n 'Mageplaza_Osc/js/action/set-checkout-information',\r\n 'Mageplaza_Osc/js/model/braintree-paypal',\r\n 'Magento_Checkout/js/model/payment/additional-validators',\r\n 'Magento_Checkout/js/model/quote',\r\n 'underscore',\r\n 'uiRegistry'\r\n], function ($, setCheckoutInformationAction, braintreePaypalModel, additionalValidators, quote, _, registry) {\r\n 'use strict';\r\n return function (BraintreePaypalComponent) {\r\n return BraintreePaypalComponent.extend({\r\n /**\r\n * Set list of observable attributes\r\n * @returns {exports.initOb
2servable}\r\n */\r\n initObservable: function () {\r\n var self = this;\r\n\r\n this._super();\r\n // For each component initialization need update property\r\n this.isReviewRequired = braintreePaypalModel.isReviewRequired;\r\n this.customerEmail = braintreePaypalModel.customerEmail;\r\n this.active = braintreePaypalModel.active;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Get shipping address\r\n * @returns {Object}\r\n */\r\n getShippingAddress: function () {\r\n var address = quote.shippingAddress();\r\n if (!address) {\r\n address = {};\r\n }\r\n if (!address.street) {\r\n address.street = ['', ''];\r\n }\r\n if (address.postcode === null) {\r\n return {};\r\n }\r\n\r\n return {\r\n recipientName: address.firstname + ' ' + address.lastname,\r\n streetAddress: address.street[0],\r\n locality: address.city,\r\n countryCodeAlpha2: address.countryId,\r\n postalCode: address.postcode,\r\n region: address.regionCode,\r\n phone: address.telephone,\r\n editable: this.isAllowOverrideShippingAddress()\r\n };\r\n },\r\n\r\n // Compatible with PayPal Through Braintree on M231\r\n reInitPayPal: function () {\r\n var placeOrder = registry.get('checkout.sidebar.place-order-information-right.place-order-button');\r\n if (!placeOrder.isPaypalThroughBraintree) {\r\n this._super();\r\n }\r\n }\r\n })\r\n }\r\n});","Mageplaza_Osc/js/view/payment/method-renderer/paypal-express.js":"/**\n * @author : PS\n * @description : Add the Paypal Express JS to remove the console error on the checkout page.\n * @date : 07.11.19\n * @link - https://trello.com/c/ZPFJSl9U/88-function-payment-prepayment-direct-debit-paypal#comment-5dcbe19af823d670f5e1120e\n */\ndefine([\n 'Magento_Paypal/js/view/payment/method-renderer/paypal-express-abstract'\n], function (Component) {\n 'use strict';\n\n return Component.extend({\n defaults: {\n template: 'Magento_Paypal/payment/paypal-express'\n }\n });\n});\n","Mageplaza_Osc/js/view/payment/method-renderer/in-context/checkout-express.js":"/**\r\n * Mageplaza\r\n *\r\n * NOTICE OF LICENSE\r\n *\r\n * This source file is subject to the Mageplaza.com license that is\r\n * available through the world-wide-web at this URL:\r\n * https://www.mageplaza.com/LICENSE.txt\r\n *\r\n * DISCLAIMER\r\n *\r\n * Do not edit or add to this file if you wish to upgrade this extension to newer\r\n * version in the future.\r\n *\r\n * @category Mageplaza\r\n * @package Mageplaza_Osc\r\n * @copyright Copyright (c) Mageplaza (https://www.mageplaza.com/)\r\n * @license https://www.mageplaza.com/LICENSE.txt\r\n */\r\ndefine([\r\n 'jquery',\r\n 'Magento_Paypal/js/view/payment/method-renderer/paypal-express-abstract',\r\n 'Magento_Paypal/js/in-context/express-checkout-wrapper',\r\n 'Magento_Paypal/js/action/set-payment-method',\r\n 'Magento_Checkout/js/model/payment/additional-validators',\r\n 'Magento_Ui/js/model/messageList',\r\n 'Magento_Ui/js/lib/view/utils/async'\r\n], function ($, Component, Wrapper, setPaymentMethod, additionalValidators, messageList) {\r\n 'use strict';\r\n\r\n return Component.extend(Wrapper).extend({\r\n defaults: {\r\n template: 'Mageplaza_Osc/payment/paypal-express-in-context',\r\n validationElements: 'input'\r\n },\r\n\r\n /**\r\n * Listens element on change and validate it.\r\n *\r\n * @param {HTMLElement} context\r\n */\r\n initListeners: function (context) {\r\n $.async(this.validationElements, context, function (element) {\r\n $(element).on('change', function () {\r\n this.validate();\r\n }.bind(this));\r\n }.bind(this));\r\n },\r\n\r\n /**\r\n * Validates Smart Buttons\r\n */\r\n validate: function () {\r\n this._super();\r\n\r\n if (this.actions) {\r\n additionalValidators.validate(true) ? this.actions.enable() : this.actions.disable();\r\n }\r\n },\r\n\r\n /** @inheritdoc */\r\n beforePayment: function (resolve, reject) {\r\n var promise = $.Deferred();\r\n\r\n setPaymentMethod(this.messageContainer).done(function () {\r\n return promise.resolve();\r\n }).fail(function (response) {\r\n var error;\r\n\r\n try {\r\n error = JSON.parse(response.responseText);\r\n } catch (exception) {\r\n error = this.paymentActionError;\r\n }\r\n\r\n this.addError(error);\r\n\r\n return reject(new Error(error));\r\n }.bind(this));\r\n\r\n return promise;\r\n },\r\n\r\n /**\r\n * Populate client config with all required data\r\n *\r\n * @return {Object}\r\n */\r\n prepareClientConfig: function () {\r\n this._super();\r\n this.clientConfig.quoteId = window.checkoutConfig.quoteData['entity_id'];\r\n this.clientConfig.customerId = window.customerData.id;\r\n this.clientConfig.button = 0;\r\n\r\n return this.clientConfig;\r\n },\r\n\r\n /**\r\n * Adding logic to be triggered onClick action for smart buttons component\r\n */\r\n onClick: function () {\r\n additionalValidators.validate();\r\n this.selectPaymentMethod();\r\n },\r\n\r\n /**\r\n * Adds error message\r\n *\r\n * @param {String} message\r\n */\r\n addError: function (message) {\r\n if ($.type(message) === \"object\") {\r\n messageList.addErrorMessage(message);\r\n } else {\r\n messageList.addErrorMessage({\r\n 'message': message\r\n });\r\n }\r\n },\r\n\r\n /**\r\n * After payment execute\r\n *\r\n * @param {Object} res\r\n * @param {Function} resolve\r\n * @param {Function} reject\r\n *\r\n * @return {*}\r\n */\r\n afterPayment: function (res, resolve, reject) {\r\n if (res.success) {\r\n return resolve(res.token);\r\n }\r\n\r\n this.addError(res['error_message']);\r\n\r\n return reject(new Error(res['error_message']));\r\n },\r\n\r\n /**\r\n * After onAuthorize execute\r\n *\r\n * @param {Object} res\r\n * @param {Function} resolve\r\n * @param {Function} reject\r\n * @param {Object} actions\r\n *\r\n * @return {*}\r\n */\r\n afterOnAuthorize: function (res, resolve, reject, actions) {\r\n if (res.success) {\r\n resolve();\r\n\r\n return actions.redirect(res.redirectUrl);\r\n }\r\n\r\n this.addError(res['error_message']);\r\n\r\n return reject(new Error(res['error_message']));\r\n }\r\n });\r\n});\r\n","Mageplaza_Osc/js/view/shipping-address/address-renderer/default.js":"<!--\n/**\n* @author : GMA\n* @date : 01.02.2024\n* @description : added attachAddressCl
2ickHandler function to handle checkmark\n*/\n-->\n\n\ndefine([\n 'Magento_Checkout/js/view/shipping-address/address-renderer/default',\n 'Magento_Checkout/js/model/shipping-rate-service',\n 'Magento_Checkout/js/model/shipping-rate-registry',\n 'Magento_Checkout/js/model/quote',\n 'jquery'\n], function (Component, shippingRateService, rateRegistry, quote, $) {\n 'use strict';\n\n return Component.extend({\n defaults: {\n template: 'Mageplaza_Osc/container/address/shipping/address-renderer/default'\n },\n\n /** Set selected customer shipping address */\n selectAddress: function () {\n if (!this.isSelected()) {\n this._super();\n\n if (quote.shippingAddress().getType == 'customer-address') {\n rateRegistry.set(quote.shippingAddress().getKey(), null);\n } else {\n rateRegistry.set(quote.shippingAddress().getCacheKey(), null);\n }\n\n shippingRateService.isAddressChange = true;\n shippingRateService.estimateShippingMethod();\n }\n },\n\n attachAddressClickHandler: function () {\n $(document).off('click', '.shipping-address-item'); // makes sure function is not called multiple times\n\n var checkboxIsChecked = $('#billing-address-same-as-shipping').prop(\"checked\");\n\n if (checkboxIsChecked) {\n $(document).on('mousedown', '.shipping-address-item', function (event) {\n if (event.which === 1) { // trigger only when clicked by real mouse and not simulated click\n $('#billing-address-same-as-shipping').prop(\"checked\", false);\n }\n });\n }\n }\n });\n});\n","Mageplaza_Osc/js/options/configurable.js":"/**\r\n * Mageplaza\r\n *\r\n * NOTICE OF LICENSE\r\n *\r\n * This source file is subject to the Mageplaza.com license that is\r\n * available through the world-wide-web at this URL:\r\n * https://www.mageplaza.com/LICENSE.txt\r\n *\r\n * DISCLAIMER\r\n *\r\n * Do not edit or add to this file if you wish to upgrade this extension to newer\r\n * version in the future.\r\n *\r\n * @category Mageplaza\r\n * @package Mageplaza_Osc\r\n * @copyright Copyright (c) Mageplaza (https://www.mageplaza.com/)\r\n * @license https://www.mageplaza.com/LICENSE.txt\r\n */\r\n\r\ndefine([\r\n 'jquery',\r\n 'Magento_ConfigurableProduct/js/configurable',\r\n 'jquery-ui-modules/widget'\r\n], function ($) {\r\n 'use strict';\r\n\r\n $.widget('mage.mposcConfigurable', $.mage.configurable, {\r\n _initializeOptions: function () {\r\n var element = $(this.options.priceHolderSelector);\r\n\r\n if (!element.data('magePriceBox')) {\r\n element.priceBox();\r\n }\r\n\r\n return this._super();\r\n },\r\n\r\n _calculatePrice: function (config) {\r\n var element = $(this.options.priceHolderSelector);\r\n\r\n if (!element.data('magePriceBox')) {\r\n element.priceBox();\r\n }\r\n\r\n return this._super(config);\r\n },\r\n });\r\n\r\n return $.mage.mposcConfigurable;\r\n});\r\n","Mageplaza_Osc/js/in-context/express-checkout-smart-buttons.js":"/**\r\n * Mageplaza\r\n *\r\n * NOTICE OF LICENSE\r\n *\r\n * This source file is subject to the Mageplaza.com license that is\r\n * available through the world-wide-web at this URL:\r\n * https://www.mageplaza.com/LICENSE.txt\r\n *\r\n * DISCLAIMER\r\n *\r\n * Do not edit or add to this file if you wish to upgrade this extension to newer\r\n * version in the future.\r\n *\r\n * @category Mageplaza\r\n * @package Mageplaza_Osc\r\n * @copyright Copyright (c) Mageplaza (https://www.mageplaza.com/)\r\n * @license https://www.mageplaza.com/LICENSE.txt\r\n */\r\ndefine([\r\n 'jquery',\r\n 'underscore',\r\n 'Magento_Paypal/js/in-context/paypal-sdk',\r\n 'Magento_Checkout/js/model/payment/additional-validators',\r\n 'Mageplaza_Osc/js/action/set-checkout-information',\r\n 'Magento_Checkout/js/action/select-payment-method',\r\n 'domReady!'\r\n], function ($, _, paypalSdk, additionalValidators, setCheckoutInformationAction, selectPaymentMethodAction) {\r\n 'use strict';\r\n\r\n /**\r\n * Triggers beforePayment action on PayPal buttons\r\n *\r\n * @param {Object} clientConfig\r\n * @returns {Object} jQuery promise\r\n */\r\n function performCreateOrder(clientConfig) {\r\n var params = {\r\n 'quote_id': clientConfig.quoteId,\r\n 'customer_id': clientConfig.customerId || '',\r\n 'form_key': clientConfig.formKey,\r\n button: clientConfig.button\r\n };\r\n\r\n return $.Deferred(function (deferred) {\r\n clientConfig.rendererComponent.beforePayment(deferred.resolve, deferred.reject).then(function () {\r\n $.post(clientConfig.getTokenUrl, params).done(function (res) {\r\n clientConfig.rendererComponent.afterPayment(res, deferred.resolve, deferred.reject);\r\n }).fail(function (jqXHR, textStatus, err) {\r\n clientConfig.rendererComponent.catchPayment(err, deferred.resolve, deferred.reject);\r\n });\r\n });\r\n }).promise();\r\n }\r\n\r\n /**\r\n * Triggers beforeOnAuthorize action on PayPal buttons\r\n * @param {Object} clientConfig\r\n * @param {Object} data\r\n * @param {Object} actions\r\n * @returns {Object} jQuery promise\r\n */\r\n function performOnApprove(clientConfig, data, actions) {\r\n var params = {\r\n paymentToken: data.orderID,\r\n payerId: data.payerID,\r\n quoteId: clientConfig.quoteId || '',\r\n customerId: clientConfig.customerId || '',\r\n 'form_key': clientConfig.formKey\r\n };\r\n\r\n return $.Deferred(function (deferred) {\r\n clientConfig.rendererComponent.beforeOnAuthorize(deferred.resolve, deferred.reject, actions)\r\n .then(function () {\r\n $.post(clientConfig.onAuthorizeUrl, params).done(function (res) {\r\n clientConfig.rendererComponent\r\n .afterOnAuthorize(res, deferred.resolve, deferred.reject, actions);\r\n }).fail(function (jqXHR, textStatus, err) {\r\n clientConfig.rendererComponent.catchOnAuthorize(err, deferred.resolve, deferred.reject);\r\n });\r\n });\r\n }).promise();\r\n }\r\n\r\n /**\r\n * @param scrollTop\r\n * @returns {*|jQuery}\r\n */\r\n function preparePlaceOrderPayPalExpress(scrollTop) {\r\n var scrollTop = (scrollTop !== undefined) ? scrollTop : true;\r\n var deferer = $.when(setCheckoutInformationAction());\r\n\r\n return scrollTop ? deferer.done(function () {\r\n $(\"body\").animate({scrollTop: 0}, \"slow\");\r\n }) : deferer;\r\n }\r\n\r\n function handleValidationErrors() {\r\n var offsetHeight = $(window).height() / 2,\r\n errorMsgSelector = $('#maincontent .mage-error:visible:first').closest('.field');\r\n errorMsgSelector = errorMsgSelector.length ? errorMsgSelector :\r\n $('#maincontent .field-error:visible:first').closest('.field');\r\n\r\n if (errorMsgSelector.length) {\r\n if (errorMsgSelector.find('select').length) {\r\n $('html, body').scrollTop(\r\n errorMsgSelector.find('select').offset().top - offsetHeight\r\n );\r\n errorMsgSelector.find('select').focus();\r\n } else if (errorMsgSelector.find('input').length) {\r\n $('html, body').scrollTop(\r\n errorMsgSelector.find('input').offset().top - offsetHeight\r\n );\r\n errorMsgSelector.find('input').focus();\r\n }\r\n } else if ($('#co-place-order-agreement input[type=\"checkbox\"]').length){\r\n $('html, body').scrollTop(\r\n $('.checkout-agreement').offset().top - offsetHeight\r\n );\r\n } else if ($('.message-error:visible').length) {\r\n $('html, body').scrollTop(\r\n $('.message-error:visible:first').closest('div').offset().top - offsetHeight\r\n );\r\n }\r\n }
2\r\n\r\n function areAgreementsChecked() {\r\n var $checkboxes = $('#co-place-order-agreement input[type=\"checkbox\"]');\r\n if ($checkboxes.length === 0) {\r\n return true;\r\n }\r\n return $checkboxes.filter(':checked').length === $checkboxes.length;\r\n }\r\n\r\n function createPayPalPlaceholder(element, clientConfig) {\r\n var $placeholder = $('<div class=\"paypal-placeholder-button\" style=\"' +\r\n 'background: linear-gradient(180deg, #FFD140 0%, #FFAB00 100%); ' +\r\n 'border: 1px solid #FFD140; border-radius: 4px; height: 45px; width: 100%; ' +\r\n 'display: flex; align-items: center; justify-content: center; cursor: pointer; ' +\r\n 'font-family: Helvetica Neue, Arial, sans-serif; transition: 0.2s ease-in-out;' +\r\n '\">' +\r\n '<img src=\"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAxcHgiIGhlaWdodD0iMzIiIHZpZXdCb3g9IjAgMCAxMDEgMzIiIHByZXNlcnZlQXNwZWN0UmF0aW89InhNaW5ZTWluIG1lZXQiIHhtbG5zPSJodHRwOiYjeDJGOyYjeDJGO3d3dy53My5vcmcmI3gyRjsyMDAwJiN4MkY7c3ZnIj48cGF0aCBmaWxsPSIjMDAzMDg3IiBkPSJNIDEyLjIzNyAyLjggTCA0LjQzNyAyLjggQyAzLjkzNyAyLjggMy40MzcgMy4yIDMuMzM3IDMuNyBMIDAuMjM3IDIzLjcgQyAwLjEzNyAyNC4xIDAuNDM3IDI0LjQgMC44MzcgMjQuNCBMIDQuNTM3IDI0LjQgQyA1LjAzNyAyNC40IDUuNTM3IDI0IDUuNjM3IDIzLjUgTCA2LjQzNyAxOC4xIEMgNi41MzcgMTcuNiA2LjkzNyAxNy4yIDcuNTM3IDE3LjIgTCAxMC4wMzcgMTcuMiBDIDE1LjEzNyAxNy4yIDE4LjEzNyAxNC43IDE4LjkzNyA5LjggQyAxOS4yMzcgNy43IDE4LjkzNyA2IDE3LjkzNyA0LjggQyAxNi44MzcgMy41IDE0LjgzNyAyLjggMTIuMjM3IDIuOCBaIE0gMTMuMTM3IDEwLjEgQyAxMi43MzcgMTIuOSAxMC41MzcgMTIuOSA4LjUzNyAxMi45IEwgNy4zMzcgMTIuOSBMIDguMTM3IDcuNyBDIDguMTM3IDcuNCA4LjQzNyA3LjIgOC43MzcgNy4yIEwgOS4yMzcgNy4yIEMgMTAuNjM3IDcuMiAxMS45MzcgNy4yIDEyLjYzNyA4IEMgMTMuMTM3IDguNCAxMy4zMzcgOS4xIDEzLjEzNyAxMC4xIFoiPjwvcGF0aD48cGF0aCBmaWxsPSIjMDAzMDg3IiBkPSJNIDM1LjQzNyAxMCBMIDMxLjczNyAxMCBDIDMxLjQzNyAxMCAzMS4xMzcgMTAuMiAzMS4xMzcgMTAuNSBMIDMwLjkzNyAxMS41IEwgMzAuNjM3IDExLjEgQyAyOS44MzcgOS45IDI4LjAzNyA5LjUgMjYuMjM3IDkuNSBDIDIyLjEzNyA5LjUgMTguNjM3IDEyLjYgMTcuOTM3IDE3IEMgMTcuNTM3IDE5LjIgMTguMDM3IDIxLjMgMTkuMzM3IDIyLjcgQyAyMC40MzcgMjQgMjIuMTM3IDI0LjYgMjQuMDM3IDI0LjYgQyAyNy4zMzcgMjQuNiAyOS4yMzcgMjIuNSAyOS4yMzcgMjIuNSBMIDI5LjAzNyAyMy41IEMgMjguOTM3IDIzLjkgMjkuMjM3IDI0LjMgMjkuNjM3IDI0LjMgTCAzMy4wMzcgMjQuMyBDIDMzLjUzNyAyNC4zIDM0LjAzNyAyMy45IDM0LjEzNyAyMy40IEwgMzYuMTM3IDEwLjYgQyAzNi4yMzcgMTAuNCAzNS44MzcgMTAgMzUuNDM3IDEwIFogTSAzMC4zMzcgMTcuMiBDIDI5LjkzNyAxOS4zIDI4LjMzNyAyMC44IDI2LjEzNyAyMC44IEMgMjUuMDM3IDIwLjggMjQuMjM3IDIwLjUgMjMuNjM3IDE5LjggQyAyMy4wMzcgMTkuMSAyMi44MzcgMTguMiAyMy4wMzcgMTcuMiBDIDIzLjMzNyAxNS4xIDI1LjEzNyAxMy42IDI3LjIzNyAxMy42IEMgMjguMzM3IDEzLjYgMjkuMTM3IDE0IDI5LjczNyAxNC42IEMgMzAuMjM3IDE1LjMgMzAuNDM3IDE2LjIgMzAuMzM3IDE3LjIgWiI+PC9wYXRoPjxwYXRoIGZpbGw9IiMwMDMwODciIGQ9Ik0gNTUuMzM3IDEwIEwgNTEuNjM3IDEwIEMgNTEuMjM3IDEwIDUwLjkzNyAxMC4yIDUwLjczNyAxMC41IEwgNDUuNTM3IDE4LjEgTCA0My4zMzcgMTAuOCBDIDQzLjIzNyAxMC4zIDQyLjczNyAxMCA0Mi4zMzcgMTAgTCAzOC42MzcgMTAgQyAzOC4yMzcgMTAgMzcuODM3IDEwLjQgMzguMDM3IDEwLjkgTCA0Mi4xMzcgMjMgTCAzOC4yMzcgMjguNCBDIDM3LjkzNyAyOC44IDM4LjIzNyAyOS40IDM4LjczNyAyOS40IEwgNDIuNDM3IDI5LjQgQyA0Mi44MzcgMjkuNCA0My4xMzcgMjkuMiA0My4zMzcgMjguOSBMIDU1LjgzNyAxMC45IEMgNTYuMTM3IDEwLjYgNTUuODM3IDEwIDU1LjMzNyAxMCBaIj48L3BhdGg+PHBhdGggZmlsbD0iIzAwOWNkZSIgZD0iTSA2Ny43MzcgMi44IEwgNTkuOTM3IDIuOCBDIDU5LjQzNyAyLjggNTguOTM3IDMuMiA1OC44MzcgMy43IEwgNTUuNzM3IDIzLjYgQyA1NS42MzcgMjQgNTUuOTM3IDI0LjMgNTYuMzM3IDI0LjMgTCA2MC4zMzcgMjQuMyBDIDYwLjczNyAyNC4zIDYxLjAzNyAyNCA2MS4wMzcgMjMuNyBMIDYxLjkzNyAxOCBDIDYyLjAzNyAxNy41IDYyLjQzNyAxNy4xIDYzLjAzNyAxNy4xIEwgNjUuNTM3IDE3LjEgQyA3MC42MzcgMTcuMSA3My42MzcgMTQuNiA3NC40MzcgOS43IEMgNzQuNzM3IDcuNiA3NC40MzcgNS45IDczLjQzNyA0LjcgQyA3Mi4yMzcgMy41IDcwLjMzNyAyLjggNjcuNzM3IDIuOCBaIE0gNjguNjM3IDEwLjEgQyA2OC4yMzcgMTIuOSA2Ni4wMzcgMTIuOSA2NC4wMzcgMTIuOSBMIDYyLjgzNyAxMi45IEwgNjMuNjM3IDcuNyBDIDYzLjYzNyA3LjQgNjMuOTM3IDcuMiA2NC4yMzcgNy4yIEwgNjQuNzM3IDcuMiBDIDY2LjEzNyA7LjIgNjcuNDM3IDcuMiA2OC4xMzcgOCBDIDY4LjYzNyA4LjQgNjguNzM3IDkuMSA2OC42MzcgMTAuMSBaIj48L3BhdGg+PHBhdGggZmlsbD0iIzAwOWNkZSIgZD0iTSA5MC45MzcgMTAgTCA4Ny4yMzcgMTAgQyA4Ni45MzcgMTAgODYuNjM3IDEwLjIgODYuNjM3IDEwLjUgTCA4Ni40MzcgMTEuNSBMIDg2LjEzNyAxMS4xIEMgODUuMzM3IDkuOSA4My41MzcgOS41IDgxLjczNyA5LjUgQyA3Ny42MzcgOS41IDc0LjEzNyAxMi42IDczLjQzNyAxNyBDIDczLjAzNyAxOS4yIDczLjUzNyAyMS4zIDc0LjgzNyAyMi43IEMgNzUuOTM3IDI0IDc3LjYzNyAyNC42IDc5LjUzNyAyNC42IEMgODIuODM3IDI0LjYgODQuNzM3IDIyLjUgODQuNzM3IDIyLjUgTCA4NC41MzcgMjMuNSBDIDg0LjQzNyAyMy45IDg0LjczNyAyNC4zIDg1LjEzNyAyNC4zIEwgODguNTM3IDI0LjMgQyA4OS4wMzcgMjQuMyA4OS41MzcgMjMuOSA4OS42MzcgMjMuNCBMIDkxLjYzNyAxMC42IEMgOTEuNjM3IDEwLjQgOTEuMzM3IDEwIDkwLjkzNyAxMCBaIE0gODUuNzM3IDE3LjIgQyA4NS4zMzcgMTkuMyA4My43MzcgMjAuOCA4MS41MzcgMjAuOCBDIDgwLjQzNyAyMC44IDc5LjYzNyAyMC41IDc5LjAzNyAxOS44IEMgNzguNDM3IDE5LjEgNzguMjM3IDE4LjIgNzguNDM3IDE3LjIgQyA3OC43MzcgMTUuMSA4MC41MzcgMTMuNiA4Mi42MzcgMTMuNiBDIDgzLjczNyAxMy42IDg0LjUzNyAxNCA4NS4xMzcgMTQuNiBDIDg1LjczNyAxNS4zIDg1LjkzNyAxNi4yIDg1LjczNyAxNy4yIFoiPjwvcGF0aD48cGF0aCBmaWxsPSIjMDA5Y2RlIiBkPSJNIDk1LjMzNyAzLjMgTCA5Mi4xMzcgMjMuNiBDIDkyLjAzNyAyNCA5Mi4zMzcgMjQuMyA5Mi43MzcgMjQuMyBMIDk1LjkzNyAyNC4zIEMgOTYuN
2DM3IDI0LjMgOTYuOTM3IDIzLjkgOTcuMDM3IDIzLjQgTCAxMDAuMjM3IDMuNSBDIDEwMC4zMzcgMy4xIDEwMC4wMzcgMi44IDk5LjYzNyAyLjggTCA5Ni4wMzcgMi44IEMgOTUuNjM3IDIuOCA5NS40MzcgMyA5NS4zMzcgMy4zIFoiPjwvcGF0aD48L3N2Zz4\" alt=\"PayPal\" style=\"height: 22px;\">' +\r\n '</div>');\r\n\r\n $placeholder.on('click', function() {\r\n if (additionalValidators.validate()) {\r\n switchToRealPayPalButton(element, clientConfig);\r\n } else {\r\n handleValidationErrors();\r\n }\r\n });\r\n\r\n $(element).append($placeholder);\r\n startValidationListener(element, clientConfig);\r\n }\r\n\r\n function switchToRealPayPalButton(element, clientConfig) {\r\n $(element).find('.paypal-placeholder-button').remove();\r\n renderRealPayPalButton(element, clientConfig);\r\n }\r\n\r\n function switchToPlaceholderButton(element, clientConfig) {\r\n $(element).empty();\r\n createPayPalPlaceholder(element, clientConfig);\r\n }\r\n\r\n function startValidationListener(element, clientConfig) {\r\n if ($(element).data('paypal-validation')) return;\r\n $(element).data('paypal-validation', true);\r\n\r\n $(document).on('change.paypalValidation', '#co-place-order-agreement input[type=\"checkbox\"]', function () {\r\n var agreementsValid = areAgreementsChecked();\r\n var hasPlaceholder = $(element).find('.paypal-placeholder-button').length > 0;\r\n var hasRealButton = $(element).find('.paypal-buttons').length > 0;\r\n\r\n if (agreementsValid && hasPlaceholder) {\r\n switchToRealPayPalButton(element, clientConfig);\r\n } else if (!agreementsValid && hasRealButton) {\r\n switchToPlaceholderButton(element, clientConfig);\r\n }\r\n });\r\n }\r\n\r\n function renderRealPayPalButton(element, clientConfig) {\r\n paypalSdk(clientConfig.sdkUrl).done(function (paypal) {\r\n paypal.Buttons({\r\n style: clientConfig.styles,\r\n\r\n /**\r\n * onInit is called when the button first renders\r\n * @param {Object} data\r\n * @param {Object} actions\r\n */\r\n onInit: function (data, actions) {\r\n // clientConfig.rendererComponent.validate(actions);\r\n },\r\n\r\n /**\r\n * Triggers beforePayment action on PayPal buttons\r\n * @returns {Object} jQuery promise\r\n */\r\n createOrder: function () {\r\n if (additionalValidators.validate()) {\r\n return performCreateOrder(clientConfig);\r\n }\r\n },\r\n\r\n /**\r\n * Triggers beforeOnAuthorize action on PayPal buttons\r\n * @param {Object} data\r\n * @param {Object} actions\r\n */\r\n onApprove: function (data, actions) {\r\n performOnApprove(clientConfig, data, actions);\r\n },\r\n\r\n /**\r\n * Execute logic on Paypal button click\r\n */\r\n onClick: function () {\r\n if (additionalValidators.validate()) {\r\n selectPaymentMethodAction(clientConfig.rendererComponent.getData());\r\n preparePlaceOrderPayPalExpress().done(function () {\r\n clientConfig.rendererComponent.onClick();\r\n });\r\n } else {\r\n handleValidationErrors();\r\n }\r\n },\r\n\r\n /**\r\n * Process cancel action\r\n * @param {Object} data\r\n * @param {Object} actions\r\n */\r\n onCancel: function (data, actions) {\r\n clientConfig.rendererComponent.onCancel(data, actions);\r\n },\r\n\r\n /**\r\n * Process errors\r\n *\r\n * @param {Error} err\r\n */\r\n onError: function (err) {\r\n clientConfig.rendererComponent.onError(err);\r\n }\r\n }).render(element);\r\n });\r\n }\r\n\r\n return function (clientConfig, element) {\r\n if (additionalValidators.validate(true)) {\r\n renderRealPayPalButton(element, clientConfig);\r\n } else {\r\n createPayPalPlaceholder(element, clientConfig);\r\n }\r\n }\r\n});\r\n","Aheadworks_RequisitionListsOverrides/js/grid/massactions-deleteall-mixin.js":"define([\n 'jquery',\n 'mage/cookies',\n 'Magento_Ui/js/modal/confirm',\n 'Magento_Ui/js/modal/alert',\n 'Magento_Customer/js/customer-data',\n 'mage/translate'\n], function ($, cookies, confirm, alert, customerData, $t) {\n 'use strict';\n\n return function (Component) {\n return Component.extend({\n set: function (path, value) {\n this._super(path, value);\n\n if (path === 'visible' && window.location.pathname.indexOf('/aw_rl/rlist/edit/') !== -1) {\n $('body').toggleClass('aw-requisition-list-empty', !value);\n }\n\n return this;\n },\n\n removeAllItems: function () {\n var self = this,\n deleteUrl = this._getDeleteListUrl();\n\n if (!deleteUrl) {\n alert({ content: $t('Delete list action is not available. List ID could not be determined.') });\n return;\n }\n\n confirm({\n content: $t('Are you sure that you want to delete this Requisition List with all items?'),\n actions: {\n confirm: function () {\n customerData.invalidate(['requisitionlist']);\n self._postDeleteList(deleteUrl);\n }\n }\n });\n },\n\n /**\n * Build the delete-list URL from the current page URL.\n * Current page is e.g. /aw_rl/rlist/edit/list_id/123/\n * Delete URL becomes /aw_rl/rlist/delete/list_id/123/\n */\n _getDeleteListUrl: function () {\n var href = window.location.href;\n\n // Replace /rlist/edit/ with /rlist/delete/ in the URL\n if (href.indexOf('/rlist/edit/') !== -1) {\n return href.replace('/rlist/edit/', '/rlist/delete/');\n }\n\n // Fallback: try to extract list_id and build URL manually\n var listId = this._extractListId();\n\n if (!listId) {\n return null;\n }\n\n // Build from origin + base path\n return window.location.origin + '/aw_rl/rlist/delete/list_id/' + listId;\n },\n\n _postDeleteList: function (deleteUrl) {\n var formKey = window.FORM_KEY || $.mage.cookies.get('form_key');\n\n $.ajax({\n url: deleteUrl,\n type: 'POST',\n data: { form_key: formKey },\n showLoader: true\n }).done(function () {\n window.location.href = window.location.origin + '/aw_rl/rlist/';\n }).fail(function () {\n alert($t('We can\\'t delete Requisition List right now.'));\n });\n },\n\n _extractListId: function () {\n var match = window.location.pathname.match(/\\/list_id\\/(\\d+)/);\n\n if (match && match[1]) {\n return match[1];\n }\n\n var searchParams = new URLSearchParams(window.location.search || '');\n\n return searchParams.get('list_id');\n }\n });\n };\n});\n","Aheadworks_RequisitionListsOverrides/js/grid/listing-mixin.js":"define([\n 'jquery',\n 'ko',\n 'Magento_Catalog/js/price-utils'\n], function ($, ko, priceUtils) {\n 'use strict';\n\n return function (Target) {\n return Target.extend({\n defaults: {\n unitPriceKey: 'unit_price_value'\n }
2,\n\n initObservable: function () {\n this._super();\n this.isLoaded = ko.observable(false);\n this.footerTotal = ko.observable(this.formatPrice(0));\n\n // Set up a subscription to recalculate footer when rows change\n if (this.rows && typeof this.rows === 'function') {\n this.rows.subscribe(function () {\n this.updateFooterTotal();\n }, this);\n }\n\n if (!this._footerQtyHandlerBound) {\n this._footerQtyHandlerBound = true;\n $(document).on('change.awRlFooter', '.aw-rl-qty-input', this.updateFooterTotal.bind(this));\n }\n\n return this;\n },\n\n onBeforeReload: function () {\n this.isLoaded(false);\n\n return this._super();\n },\n\n onDataReloaded: function () {\n var result = this._super();\n\n this.isLoaded(true);\n this.updateFooterTotal();\n\n return result;\n },\n\n updateFooterTotal: function () {\n var self = this,\n rows = [],\n total = 0;\n\n // Try to get rows from the data property\n if (this.rows && typeof this.rows === 'function') {\n rows = this.rows() || [];\n } else if (this.rows && Array.isArray(this.rows)) {\n rows = this.rows;\n } else if (this.source && this.source.data && this.source.data.items) {\n rows = this.source.data.items;\n }\n\n if (!rows || rows.length === 0) {\n this.footerTotal(this.formatPrice(0));\n return;\n }\n\n rows.forEach(function (item) {\n var qty = 0,\n unitPrice = 0,\n rowTotal = 0;\n\n // Get quantity from DOM if possible (for real-time updates)\n var $qtyInput = $('#qty' + item.item_id);\n if ($qtyInput.length) {\n qty = parseFloat($qtyInput.val()) || 0;\n } else if (item.product_qty !== undefined && item.product_qty !== null) {\n qty = typeof item.product_qty === 'function' ? parseFloat(item.product_qty()) : parseFloat(item.product_qty);\n }\n qty = Number.isNaN(qty) ? 0 : qty;\n\n // Get unit price\n if (item[self.unitPriceKey] !== undefined && item[self.unitPriceKey] !== null) {\n unitPrice = typeof item[self.unitPriceKey] === 'function' ? parseFloat(item[self.unitPriceKey]()) : parseFloat(item[self.unitPriceKey]);\n }\n unitPrice = Number.isNaN(unitPrice) ? 0 : unitPrice;\n\n rowTotal = qty * unitPrice;\n total += rowTotal;\n });\n\n this.footerTotal(this.formatPrice(total));\n },\n\n getFooterTotal: function () {\n return this.footerTotal();\n },\n\n formatPrice: function (amount) {\n var format = this.getPriceFormat();\n if (!format || !format.pattern) {\n return this.formatWithSymbol(amount);\n }\n\n return priceUtils.formatPrice(amount, format);\n },\n\n getPriceFormat: function () {\n return (this.source && typeof this.source.get === 'function' && this.source.get('priceFormat')) ||\n (this.source && this.source.data && this.source.data.priceFormat) ||\n window.priceFormat ||\n (window.checkoutConfig && window.checkoutConfig.priceFormat) ||\n {};\n },\n\n formatWithSymbol: function (amount) {\n var symbol = this.getCurrencySymbol();\n var fixed = Number.isFinite(amount) ? amount.toFixed(2) : '0.00';\n\n if (!symbol) {\n return fixed;\n }\n\n return symbol + ' ' + fixed;\n },\n\n getCurrencySymbol: function () {\n if (this.source && this.source.data && this.source.data.currency_symbol) {\n return this.source.data.currency_symbol;\n }\n\n if (this.rows && typeof this.rows === 'function') {\n var rows = this.rows() || [];\n if (rows.length && rows[0].currency_symbol) {\n return rows[0].currency_symbol;\n }\n }\n\n return window.currencySymbol || '';\n }\n });\n };\n});\n","Aheadworks_RequisitionListsOverrides/js/grid/footer.js":"define([\n 'jquery',\n 'Magento_Ui/js/lib/component',\n 'Magento_Catalog/js/price-utils'\n], function ($, Component, priceUtils) {\n 'use strict';\n\n return Component.extend({\n defaults: {\n unitPriceKey: 'unit_price_value'\n },\n\n initialize: function () {\n this._super();\n // Listen to data changes\n if (this.source) {\n this.source.on('change', this.onDataChanged.bind(this));\n }\n return this;\n },\n\n onDataChanged: function () {\n // Trigger footer recalculation\n },\n\n getFooterTotal: function () {\n var rows = this.rows ? this.rows() : [],\n total = 0;\n\n if (rows.length === 0) {\n return this.formatPrice(0);\n }\n\n rows.forEach(function (item) {\n var qty = parseFloat(item.product_qty) || 0,\n unitPrice = parseFloat(item.unit_price_value) || 0,\n rowTotal = qty * unitPrice;\n\n total += rowTotal;\n });\n\n return this.formatPrice(total);\n },\n\n formatPrice: function (amount) {\n var format = window.priceFormat || (window.checkoutConfig && window.checkoutConfig.priceFormat) || {};\n\n return priceUtils.formatPrice(amount, format);\n }\n });\n});\n\n","Aheadworks_RequisitionListsOverrides/js/grid/toolbar-mixin.js":"define([\n 'jquery',\n 'mage/cookies',\n 'uiRegistry',\n 'Magento_Ui/js/modal/confirm',\n 'Magento_Customer/js/customer-data',\n 'mage/translate'\n], function ($, cookies, registry, confirm, customerData, $t) {\n 'use strict';\n\n return function (Toolbar) {\n return Toolbar.extend({\n\n removeAllItems: function () {\n var self = this,\n deleteUrl = this._getDeleteListUrl();\n\n if (!deleteUrl) {\n return;\n }\n\n confirm({\n content: $t('Are you sure that you want to delete this Requisition List with all items?'),\n actions: {\n confirm: function () {\n customerData.invalidate(['requisitionlist']);\n self._postDeleteList(deleteUrl);\n }\n }\n });\n },\n\n /**\n * Druckt nur den Container .aw-rl__listing-products\n * Sichere New-Window-Methode (kein DOM-Zerst\u00f6rung!)\n */\n printProjectlist: function () {\n var $container = $(\".aw-rl__listing-products\");\n\n if ($container.length === 0) {\n alert($t('Print area not found.'));\n window.print(); // Fallback auf normale Druckfunktion\n return;\n }
2\n\n // Klonen, damit wir interaktive Elemente entfernen k\u00f6nnen\n var $clone = $container.clone(true);\n\n // Entferne Buttons, Checkboxen, Mass-Action etc. f\u00fcr sauberen Ausdruck\n $clone.find('button, .action-default, .massaction-select, input[type=\"checkbox\"], .actions, .aw-rl__actions, .data-grid-checkbox-cell, .data-grid-multicheck-cell, a.action.delete, a.action.edit')\n .remove();\n\n // Neues Druckfenster \u00f6ffnen\n var printWindow = window.open('', '_blank', 'width=800,height=1120,scrollbars=yes,resizable=yes'); // DIN A4 ungef\u00e4hr 800x1120px\n\n if (!printWindow) {\n alert($t('Popup blocker is preventing the print window. Please allow popups for this site.'));\n return;\n }\n\n var title = $t('Requisition List') + ' - ' + document.title;\n\n // Erstelle das Dokument im neuen Fenster ohne document.write (deprecated)\n var doc = printWindow.document;\n\n // F\u00fcge Doctype und HTML-Struktur hinzu\n try {\n var doctype = doc.implementation.createDocumentType('html', '', '');\n doc.appendChild(doctype);\n } catch (e) {\n // some environments may not allow createDocumentType; continue gracefully\n }\n\n var htmlEl = doc.createElement('html');\n htmlEl.lang = 'de';\n\n var headEl = doc.createElement('head');\n var metaEl = doc.createElement('meta');\n metaEl.setAttribute('charset', 'UTF-8');\n headEl.appendChild(metaEl);\n\n var titleEl = doc.createElement('title');\n titleEl.textContent = title;\n headEl.appendChild(titleEl);\n\n // Alle Stylesheets/Style-Tags der aktuellen Seite \u00fcbernehmen\n $('head link[rel=\"stylesheet\"], head style').each(function () {\n // insertAdjacentHTML ist einfacher und erh\u00e4lt CSS text/links\n headEl.insertAdjacentHTML('beforeend', this.outerHTML);\n });\n\n htmlEl.appendChild(headEl);\n\n var bodyEl = doc.createElement('body');\n bodyEl.className = 'print-requistion-list';\n\n // Importiere das geklonte Container-Element in das neuen Dokument\n var cloneNode = $clone.get(0);\n try {\n var imported = doc.importNode(cloneNode, true);\n bodyEl.appendChild(imported);\n } catch (e) {\n // Fallback: f\u00fcge als HTML-String ein\n bodyEl.insertAdjacentHTML('beforeend', $clone.prop('outerHTML'));\n }\n\n htmlEl.appendChild(bodyEl);\n\n // Anh\u00e4ngen an das Dokument\n // Falls doc.documentElement bereits existiert, ersetzen wir sie\n if (doc.documentElement) {\n doc.replaceChild(htmlEl, doc.documentElement);\n } else {\n doc.appendChild(htmlEl);\n }\n\n // Schlie\u00dfe das Dokument, Styles sollten geladen sein\n try { doc.close(); } catch (e) { /* ignore */ }\n\n // Kleiner Timeout, damit Styles vollst\u00e4ndig laden\n setTimeout(function () {\n printWindow.focus();\n printWindow.print();\n // Optional: printWindow.close(); // nach dem Druck schlie\u00dfen\n }, 800);\n },\n\n _getItemsMassaction: function () {\n var names = [\n 'aw_requisition_list_item_listing.aw_requisition_list_item_listing.listing_top.listing_massaction',\n 'aw_requisition_list_item_listing.listing_top.listing_massaction',\n 'listing_top.listing_massaction'\n ];\n var massaction = null;\n names.some(function (name) {\n massaction = registry.get(name);\n return !!massaction;\n });\n return massaction;\n },\n\n /**\n * Build the delete-list URL from the current page URL.\n */\n _getDeleteListUrl: function () {\n var href = window.location.href;\n\n if (href.indexOf('/rlist/edit/') !== -1) {\n return href.replace('/rlist/edit/', '/rlist/delete/');\n }\n\n var listId = this._extractListId();\n\n if (!listId) {\n return null;\n }\n\n return window.location.origin + '/aw_rl/rlist/delete/list_id/' + listId;\n },\n\n _postDeleteList: function (deleteUrl) {\n var formKey = window.FORM_KEY || $.mage.cookies.get('form_key');\n\n $.ajax({\n url: deleteUrl,\n type: 'POST',\n data: { form_key: formKey },\n showLoader: true\n }).done(function () {\n window.location.href = window.location.origin + '/aw_rl/rlist/';\n }).fail(function () {\n alert($t('We can\\'t delete Requisition List right now.'));\n });\n },\n\n _extractListId: function () {\n var match = window.location.pathname.match(/\\/list_id\\/(\\d+)/);\n\n if (match && match[1]) {\n return match[1];\n }\n\n var searchParams = new URLSearchParams(window.location.search || '');\n\n return searchParams.get('list_id');\n }\n });\n };\n});","Aheadworks_RequisitionListsOverrides/js/grid/massactions-tree.js":"define([\n 'jquery',\n 'underscore',\n 'Magento_Ui/js/grid/tree-massactions',\n 'ko',\n 'Magento_Ui/js/modal/alert',\n 'Magento_Ui/js/modal/confirm',\n 'Magento_Customer/js/customer-data'\n], function ($, _, TreeMassActions, ko, alert, confirm, customerData) {\n 'use strict';\n\n return TreeMassActions.extend({\n defaults: {\n imports: {\n visible: '${ $.provider }:data.totalRecords'\n },\n tracks: {\n visible: true\n },\n modules: {\n requisitionListModalForm: 'aw_requisition_list_modal_form.aw_requisition_list_modal_form'\n }\n },\n\n /**\n * @inheritdoc\n */\n initOb
2servable: function () {\n\n this._addFormKeyIfNotSet();\n this._bindToggleMassAction();\n\n return this._super();\n },\n\n /**\n * @inheritdoc\n */\n recursiveObserveActions: function (actions, prefix) {\n\n _.each(actions, function (action) {\n if (prefix) {\n action.type = prefix + '.' + action.type;\n }\n\n if (action.actions) {\n action.observableActions = ko.observableArray(action.actions.slice(0, action.resultLimit || this.resultLimit));\n action.visible = ko.observable(false);\n action.parent = actions;\n this.recursiveObserveActions(action.actions, action.type);\n }\n }, this);\n\n return this;\n },\n\n /**\n * Applies specified action.\n *\n * @param {String} actionIndex - Actions' identifier.\n * @returns {TreeMassActions} Chainable.\n */\n applyAction: function (actionIndex) {\n\n var action = this.getAction(actionIndex),\n data = this.getSelections();\n\n // Validate that items are selected before proceeding\n if (!data.total) {\n alert({\n content: this.noItemsMsg\n });\n\n return this;\n }\n\n if (action.click) {\n // Determine if this is a move or copy mass action\n var actionType = null;\n\n if (typeof actionIndex === 'string') {\n if (actionIndex.indexOf('move_to') === 0) {\n actionType = 'move';\n } else if (actionIndex.indexOf('copy_to') === 0) {\n actionType = 'copy';\n }\n }\n\n if (actionType) {\n var itemsType = data.excludeMode ? 'excluded' : 'selected',\n selections = {};\n\n selections[itemsType] = data[itemsType];\n\n if (!selections[itemsType].length) {\n selections[itemsType] = false;\n }\n\n _.extend(selections, data.params || {});\n\n var listIdMatch = window.location.href.match(/list_id\\/(\\d+)/);\n\n window.awRequisitionListPendingProduct = null;\n window.awRequisitionListPendingMassAction = {\n actionType: actionType,\n selections: selections,\n sourceListId: listIdMatch ? listIdMatch[1] : null\n };\n }\n\n eval(action.click);\n return this;\n }\n\n return this._super(actionIndex);\n },\n\n /**\n * Override defaultCallback to invalidate the requisitionlist\n * customer-data section before the programmatic form.submit().\n * Magento's customer-data.js only listens for DOM \"submit\" events,\n * but utils.submit() calls form.submit() which does NOT fire that\n * event, so sections.xml rules are never evaluated.\n */\n defaultCallback: function (action, data) {\n customerData.invalidate(['requisitionlist']);\n return this._super(action, data);\n },\n\n /**\n * Shows actions' confirmation window with dynamic count replacement\n *\n * @param {Object} action - Actions' data.\n * @param {Function} callback - Callback that will be\n * invoked if action is confirmed.\n */\n _confirm: function (action, callback) {\n\n var confirmData = action.confirm,\n data = this.getSelections(),\n total = data.total ? data.total : 0,\n confirmMessage = confirmData.message.replace('selected_count', total);\n\n confirm({\n title: confirmData.title,\n content: confirmMessage,\n actions: {\n confirm: callback\n }\n });\n },\n\n /**\n * Add form key to window object if form key is not added earlier\n */\n _addFormKeyIfNotSet: function () {\n if (!window.FORM_KEY) {\n window.FORM_KEY = $.mage.cookies.get('form_key');\n }\n },\n\n /**\n * Attach checkbox toggle event\n */\n _bindToggleMassAction: function () {\n $(document).on('change', '.admin__control-checkbox', function () {\n const anyChecked = $('.admin__control-checkbox:checked').length > 0;\n $('.toggle-mass-action').toggle(anyChecked);\n });\n }\n });\n});\n","Aheadworks_RequisitionListsOverrides/js/grid/column/name-mixin.js":"define(['underscore'], function (_) {\n 'use strict';\n\n return function (Target) {\n return Target.extend({\n defaults: {\n optionsRendererTemplates: {\n configurable: 'Aheadworks_RequisitionLists/ui/grid/column/renderer/configurable',\n bundle: 'Aheadworks_RequisitionLists/ui/grid/column/renderer/bundle',\n grouped: 'Aheadworks_RequisitionLists/ui/grid/column/renderer/grouped'\n },\n productAttributesIndex: 'product_attributes',\n productTypeIndex: 'product_type',\n productTypeOptionsIndex: 'product_options'\n },\n\n getProductAttributes: function (item) {\n var attributes = item[this.productAttributesIndex];
2\n\n return attributes ? (attributes[this.productTypeOptionsIndex] || []) : [];\n },\n\n getOptionsRendererTemplate: function (item) {\n return this.optionsRendererTemplates[item[this.productTypeIndex]];\n },\n\n isOptionsNeed: function (item) {\n return !_.isEmpty(this.optionsRendererTemplates[item[this.productTypeIndex]]);\n }\n });\n };\n});\n","Aheadworks_RequisitionListsOverrides/js/grid/column/qty-mixin.js":"define(['jquery', 'uiRegistry'], function ($, registry) {\n 'use strict';\n\n return function (Target) {\n return Target.extend({\n defaults: {\n rowTotalElement: 'aw_requisition_list_item_listing.' +\n 'aw_requisition_list_item_listing.' +\n 'aw_requisition_list_item_columns.' +\n 'row_total',\n listingElement: 'aw_requisition_list_item_listing.aw_requisition_list_item_listing'\n },\n\n onQtyChange: function (item, elem, event) {\n var qty = parseFloat($(event.target).val()),\n rowTotalColumn,\n listing;\n\n this._super(item, elem, event);\n\n if (Number.isNaN(qty)) {\n return;\n }\n\n // Update the item's product_qty property\n item.product_qty = qty;\n\n // Update row total\n rowTotalColumn = registry.get(this.rowTotalElement);\n if (rowTotalColumn && rowTotalColumn.updateRowTotal) {\n rowTotalColumn.updateRowTotal(item, qty);\n }\n\n // Update listing footer total\n listing = registry.get(this.listingElement);\n if (listing && typeof listing.updateFooterTotal === 'function') {\n listing.updateFooterTotal();\n }\n },\n\n changeQty: function (item, delta) {\n var itemId = this.getItemId(item),\n $input = $(this.getQtySelector(itemId)),\n current = parseFloat($input.val()),\n next;\n\n if (Number.isNaN(current)) {\n current = this.getProductQty(item) || 0;\n }\n\n next = Math.max(1, current + delta);\n\n $input.val(next);\n $input.trigger('change');\n }\n });\n };\n});\n\n","Aheadworks_RequisitionListsOverrides/js/grid/column/row-total.js":"define([\n 'jquery',\n 'Magento_Ui/js/grid/columns/column',\n 'Magento_Catalog/js/price-utils',\n 'Aheadworks_RequisitionLists/js/ui/requisition-list/item-listing/item-configurator',\n 'Aheadworks_RequisitionLists/js/ui/requisition-list/config'\n], function ($, Column, priceUtils, itemConfigurator, requisitionListConfig) {\n 'use strict';\n\n return Column.extend({\n defaults: {\n isEditable: 'is_editable',\n isSalableIndex: 'is_salable',\n isAvailableForSiteIndex: 'is_available',\n qtySelectorPrefix: '#qty',\n rowTotalSelector: '.aw-rl-row-total-value',\n unitPriceKey: 'unit_price_value',\n actionsTmpl: 'Aheadworks_RequisitionLists/ui/grid/column/actions'\n },\n\n getRowTotal: function (item) {\n var qty = this.getQtyValue(item),\n unitPrice = this.getUnitPrice(item),\n total;\n\n if (unitPrice === null || qty === null) {\n return '';\n }\n\n total = unitPrice * qty;\n\n return this.formatPrice(total);\n },\n\n updateRowTotal: function (item, qty) {\n var unitPrice = this.getUnitPrice(item),\n total,\n formatted,\n $cell;\n\n if (unitPrice === null) {\n return;\n }\n\n total = unitPrice * qty;\n formatted = this.formatPrice(total);\n $cell = $(this.rowTotalSelector + '[data-item-id=\"' + item.item_id + '\"]');\n\n if ($cell.length) {\n $cell.text(formatted);\n }\n },\n\n getQtyValue: function (item) {\n var $input = $(this.qtySelectorPrefix + item.item_id),\n qty = $input.length ? parseFloat($input.val()) : null;\n\n if (!$input.length && item && item.product_qty !== undefined) {\n qty = parseFloat(item.product_qty);\n }\n\n return Number.isNaN(qty) ? null : qty;\n },\n\n getUnitPrice: function (item) {\n var unitPrice = item[this.unitPriceKey];\n\n if (unitPrice === undefined || unitPrice === null) {\n return null;\n }\n\n unitPrice = parseFloat(unitPrice);\n\n return Number.isNaN(unitPrice) ? null : unitPrice;\n },\n\n formatPrice: function (amount) {\n var format = window.priceFormat || (window.checkoutConfig && window.checkoutConfig.priceFormat) || {};\n\n return priceUtils.formatPrice(amount, format);\n },\n\n /**\n * Is salable\n *\n * @return string\n */\n isSalable: function (item) {\n return item[this.isSalableIndex];\n },\n\n /**\n * Is visibility in site\n *\n * @return boolean\n */\n isAvailableForSite: function (item) {\n return item[this.isAvailableForSiteIndex];\n },\n\n /**\n * Get options renderer template\n *\n * @return string\n */\n configureItem:function (item) {\n itemConfigurator.configure(item);\n },\n\n /**\n * Is available\n *\n * @return string\n */\n isEditAvailable: function (item) {\n return this.isSalable(item) && item[this.isEditable] && this.isAvailableForSite(item);\n },\n\n /**\n * Get options renderer template\n *\n * @return string\n */\n removeItem:function (item) {\n $(\"body\").trigger('processStart');\n\n window.location.replace(requisitionListConfig.getRemoveItemUrl(item));\n }\n });\n});\n","Aheadworks_RequisitionListsOverrides/js/ui/grid/toolbar-bottom.js":"define([\n 'Magento_Ui/js/grid/toolbar'\n], function (Toolbar) {\n 'use strict';\n\n return Toolbar.extend({\n defaults: {\n backUrl: ''\n },\n\n /**\n * Navigate back to the requisition list page.\n *\n * @param {Object} data\n * @param {Event} event\n */\n backClick: function (data, event) {\n if (event) {\n event.preventDefault();\n event.stopPropagation();\n }\n\n if (this.backUrl) {\n window.location = this.backUrl;\n }\n }\n });\n});\n","Aheadworks_RequisitionListsOverrides/js/ui/components/requisition-list/cart-item-add-to-mixin.js":"define([\n 'jquery',\n], function ($) {\n 'use strict';\n\n return function (Component) {\n return Component.extend({\n\n /**\n * Open modal action - store cart item data for auto-add after list creation\n */\n openModal: function () {\n if (this.isLoggined) {\n this._storePendingCartItemData();\n this.requisitionListModalForm().openModal();\n } else {\n this.redirect(this.getUrlToRequisitionPage());\n }\n },\n\n /**\n * Store the current cart item (or full-cart) data as pendingProduct.\n * Sets formData so form-mixin.js uses the _saveAndAddProduct() path\n * instead of falling back to a full-page Save.php redirect.\n * @private\n */\n _storePendingCartItemData: function () {\n var formData = new FormData();\n\n formData.set('form_key', $.mage.cookies.get('form_key'));\n\n // productId is only set for per-item buttons; null means add all cart items.\n if (this.productId) {\n formData.set('product_id', this.productId);\n }\n\n window.awRequisitionListPendingProduct = {\n isCartItem: true,\n productId: this.productId || null,\n url: this.addToRequisitionListUrl,\n formData: formData\n };\n }\n });\n };\n});\n","Aheadworks_RequisitionListsOverrides/js/ui/components/requisition-list/add-to-mixin.js":"define([\n 'jquery',\n 'mage/translate',\n 'Magento_Customer/js/customer-data'\n], function ($, $t, customerData) {\n 'use strict';\n\n return function (Component) {\n return Component.extend({\n\n defaults: {\n template: 'Aheadworks_RequisitionListsOverrides/components/requisition-list/add-to',\n linkLabel: $t('Add to Requisition List'),\n pendingProductData: null\n },\n\n initialize: function () {\n this._super();\n\n return this;\n },\n\n /**\n * Open modal action - override to store product data for auto-add after list creation\n */\n openModal: function () {\n if (this.isLoggined) {\n // Store product data before opening modal\n this._storePendingProductData();\n this.requisitionListModalForm().openModal();\n } else {\n this.redirect(this.getUrlToRequisitionPage());\n }\n },\n\n /**\n * Store the current product data for later use\n * @private\n */\n _storePendingProductData: function () {\n var formObject = $(this.addToCartFormSelector),\n productData = null;
2\n\n if (formObject.length && this._isValidForm()) {\n productData = {\n formData: new FormData(formObject[0]),\n url: this.getAddToRequisitionListUrl()\n };\n } else if (this.productId) {\n var formData = new FormData();\n formData.set('product', this.productId);\n formData.set('form_key', $.mage.cookies.get('form_key'));\n productData = {\n formData: formData,\n url: this.addToRequisitionListUrl\n };\n } else if (this.orderId) {\n productData = {\n orderId: this.orderId,\n url: this.addToRequisitionListUrl\n };\n }\n\n // Store in window for the form to access after successful save\n window.awRequisitionListPendingProduct = productData;\n },\n\n /**\n * Clear pending product data\n */\n clearPendingProductData: function () {\n window.awRequisitionListPendingProduct = null;\n }\n });\n };\n});\n","Aheadworks_RequisitionListsOverrides/js/ui/form/form-mixin.js":"define([\n 'jquery',\n 'underscore',\n 'mage/url',\n 'uiRegistry',\n 'Magento_Customer/js/customer-data',\n 'mage/translate'\n], function ($, _, urlBuilder, registry, customerData, $t) {\n 'use strict';\n\n return function (Component) {\n return Component.extend({\n defaults: {\n saveAndAddProductUrl: 'aw_rl/rlist/saveAndAddProduct',\n modules: {\n requisitionListModalForm: 'aw_requisition_list_modal_form.aw_requisition_list_modal_form'\n }\n },\n\n /**\n * {@inheritdoc}\n */\n initialize: function () {\n this._super();\n return this;\n },\n\n /**\n * Override save to handle adding product or executing mass action after list creation\n */\n save: function (redirect, data) {\n var pendingMassAction = window.awRequisitionListPendingMassAction,\n pendingProduct = window.awRequisitionListPendingProduct;\n\n if (pendingMassAction && pendingMassAction.actionType) {\n this._saveAndExecuteMassAction(pendingMassAction);\n return;\n }\n\n if (pendingProduct && (pendingProduct.formData || pendingProduct.orderId || pendingProduct.isCartItem)) {\n this._saveAndAddProduct(pendingProduct);\n return;\n }\n\n // Use default save flow (includes validation)\n this._super(redirect, data);\n\n // Close modal after successful validation/save attempt\n if (!this.additionalInvalid && !this.source.get('params.invalid')) {\n this._closeModalSoon();\n }\n },\n\n /**\n * Save list first, then execute the pending move/copy mass action\n *\n * @param {Object} pendingMassAction\n * @private\n */\n _saveAndExecuteMassAction: function (pendingMassAction) {\n var self = this,\n formData = this.source.get('data'),\n saveUrl = urlBuilder.build(this.saveAndAddProductUrl);\n\n var submitData = new FormData();\n\n if (formData.name) {\n submitData.set('name', formData.name);\n }\n if (formData.description) {\n submitData.set('description', formData.description);\n }\n submitData.set('form_key', $.mage.cookies.get('form_key'));\n\n $('body').trigger('processStart');\n\n $.ajax({\n url: saveUrl,\n type: 'POST',\n data: submitData,\n processData: false,\n contentType: false,\n global: false,\n success: function (response) {\n if (response.success && response.list_id) {\n var route, paramName;\n\n if (pendingMassAction.actionType === 'move') {\n route = 'aw_rl/rlist/moveItem';\n paramName = 'move_to_list';\n } else {\n route = 'aw_rl/rlist/copyItem';\n paramName = 'copy_to_list';\n }\n\n var actionUrl = urlBuilder.build(\n route + '/list_id/' + pendingMassAction.sourceListId\n + '/' + paramName + '/' + response.list_id\n );\n\n customerData.invalidate(['requisitionlist']);\n window.awRequisitionListPendingMassAction = null;\n\n self._submitForm(actionUrl, pendingMassAction.selections);\n } else {\n $('body').trigger('processStop');\n window.awRequisitionListPendingMassAction = null;\n self.closeModal();\n }\n },\n error: function () {\n $('body').trigger('processStop');\n console.error('Error saving requisition list');\n window.awRequisitionListPendingMassAction = null;\n }\n });\n },\n\n /**\n * Submit a hidden form with the given URL and data\n *\n * @param {String} url\n * @param {Object} data\n * @private\n */\n _submitForm: function (url, data) {\n var form = document.createElement('form');\n\n form.method = 'POST';\n form.action = url;\n form.style.display = 'none';\n\n function addField(name, value) {\n var input = document.createElement('input');\n\n input.type = 'hidden';
2\n input.name = name;\n input.value = value;\n form.appendChild(input);\n }\n\n addField('form_key', $.mage.cookies.get('form_key'));\n\n _.each(data, function (value, key) {\n if (_.isArray(value)) {\n _.each(value, function (v) {\n addField(key + '[]', v);\n });\n } else if (value === false) {\n addField(key, 'false');\n } else {\n addField(key, value);\n }\n });\n\n document.body.appendChild(form);\n form.submit();\n },\n\n /**\n * Save list and add product in one request\n *\n * @param {Object} pendingProduct\n * @private\n */\n _saveAndAddProduct: function (pendingProduct) {\n // Order context: create list first, then add order items\n if (pendingProduct.orderId) {\n this._saveAndAddOrder(pendingProduct);\n return;\n }\n\n // Cart item context: create list, then use AddFromCart endpoint\n if (pendingProduct.isCartItem) {\n this._saveAndAddCartItem(pendingProduct);\n return;\n }\n\n var self = this,\n formData = this.source.get('data'),\n saveUrl = urlBuilder.build(this.saveAndAddProductUrl);\n\n // Merge form data with pending product data\n var submitData = new FormData();\n\n // Add requisition list form data\n if (formData.name) {\n submitData.set('name', formData.name);\n }\n if (formData.description) {\n submitData.set('description', formData.description);\n }\n\n // Add form key\n submitData.set('form_key', $.mage.cookies.get('form_key'));\n\n // Add product data from pending FormData\n if (pendingProduct.formData) {\n for (var pair of pendingProduct.formData.entries()) {\n // Don't override the list fields we already set\n if (pair[0] !== 'name' && pair[0] !== 'description' && pair[0] !== 'list_id') {\n submitData.set(pair[0], pair[1]);\n }\n }\n }\n\n // Invalidate customer data\n customerData.invalidate([this.sectionName]);\n\n // Send the combined request\n $.ajax({\n url: saveUrl,\n type: 'POST',\n data: submitData,\n processData: false,\n contentType: false,\n showLoader: true,\n success: function () {\n window.awRequisitionListPendingProduct = null;\n customerData.reload([self.sectionName], true);\n self.closeModal();\n },\n error: function () {\n console.error('Error saving requisition list');\n window.awRequisitionListPendingProduct = null;\n }\n });\n },\n\n /**\n * Save list first, then add cart item via AddFromCart endpoint\n *\n * @param {Object} pendingCartItem\n * @private\n */\n _saveAndAddCartItem: function (pendingCartItem) {\n var self = this,\n formData = this.source.get('data'),\n saveUrl = urlBuilder.build(this.saveAndAddProductUrl);\n\n var submitData = new FormData();\n\n if (formData.name) {\n submitData.set('name', formData.name);\n }\n if (formData.description) {\n submitData.set('description', formData.description);\n }\n submitData.set('form_key', $.mage.cookies.get('form_key'));\n // Signal to SaveAndAddProduct.php to skip the standalone session flash message\n // \u2013 AddFromCart will set its own success message in the next request.\n submitData.set('is_cart_add', '1');\n\n // Show the loader manually because global:false (see below)\n // prevents Magento's showLoader prefilter from working.\n $('body').trigger('processStart');\n\n // Step 1: Create the list.\n // global:false prevents jQuery's ajaxComplete from firing for\n // this request. Without it, Magento_Theme's wildcard\n // <action name=\"*\"><section name=\"messages\"/></action>\n // would trigger a premature messages-section reload that races\n // with Step 2's session message and clears it.\n $.ajax({\n url: saveUrl,\n type: 'POST',\n data: submitData,\n processData: false,\n contentType: false,\n global: false,\n success: function (response) {\n if (response.success && response.list_id) {\n // Step 2: Add cart item(s) to the new list via AddFromCart.\n // This call uses the default global:true so ajaxComplete\n // fires \u2192 sections.xml matches addfromcart \u2192 Magento\n // atomically reloads requisitionlist + messages.\n var addData = { list_id: response.list_id };\n\n if (pendingCartItem.productId) {\n addData.product_id = pendingCartItem.productId;\n }\n\n $.ajax({\n url: pendingCartItem.url,\n type: 'POST',\n data: addData,\n complete: function () {\n $('body').trigger('processStop');\n window.awRequisitionListPendingProduct = null;\n self.closeModal();\n }\n });\n } else {\n $('body').trigger('processStop');\n window.awRequisitionListPendingProduct = null;\n self.closeModal();\n }\n },\n error: function () {\n $('body').trigger('processStop');\n console.error('Error saving requisition list');\n window.awRequisitionListPendingProduct = null;\n }\n });\n },\n\n /**\n * Save list first, then add all order items to it\n *\n * @param {Object} pendingOrder\n * @private\n */\n _saveAndAddOrder: function (pendingOrder) {\n var self = this,\n formData = this.source.get('data'),\n saveUrl = urlBuilder.build(this.saveAndAddProductUrl);\n\n var submitData = new FormData();\n\n if (formData.name) {\n submitData.set('name', formData.name);\n }\n if (formData.description) {\n submitData.set('description', formData.description);\n }\n submitData.set('form_key', $.mage.cookies.get('form_key'));\n\n // Show the loader manually because global:false on Step 1\n // prevents Magento's showLoader prefilter from working.\n $('body').trigger('processStart');\n\n // Step 1: Create the list.\n // global:false prevents ajaxComplete from firing for this\n // request, avoiding a premature messages-section reload that\n // would race with Step 2's session message.\n $.ajax({\n url: saveUrl,\n type: 'POST',\n data: submitData,\n processData: false,\n contentType: false,\n global: false,\n success: function (response) {\n if (response.success && response.list_id) {\n // Step 2: Add order items to the new list.\n // Default global:true so ajaxComplete fires \u2192\n // sections.xml matches orderadd \u2192 Magento\n // atomically reloads requisitionlist + messages.\n $.ajax({\n url: pendingOrder.url,\n type: 'POST',\n data: {\n order_id: pendingOrder.orderId,\n list_id: response.list_id\n },\n complete: function () {\n $('body').trigger('processStop');\n window.awRequisitionListPendingProduct = null;\n self.closeModal();\n }\n });\n } else {\n $('body').trigger('processStop');\n window.awRequisitionListPendingProduct = null;\n self.closeModal();\n }\n },\n error: function () {\n $('body').trigger('processStop');\n console.error('Error saving requisition list');\n window.awRequisitionListPendingProduct = null;\n }\n });\n },\n\n /**\n * Show a success message directly in the page message container\n *\n * @param {String} message\n * @private\n */\n _showSuccessMessage: function (message) {\n var $container = $('.page.messages'),\n $msg = $('<div role=\"alert\" class=\"message message-success success\">' +\n '<div data-ui-id=\"message-success\">' + $('<span>').text(message).html() + '</div></div>');\n\n if (!$container.length) {\n $container = $('.page-wrapper').find('.messages').first();\n }\n\n if ($container.length) {\n $container.prepend($msg);\n $('html, body').animate({ scrollTop: $container.offset().top - 20 }, 300);\n }\n },\n\n /**\n * Add cart items to a (newly created) requisition list.\n * Fires a POST to the AddFromCart URL, then reloads sections so the\n * \"items added\" success message from AddFromCart is displayed cleanly.\n *\n * @param {Number} listId\n * @param {Object} pendingProduct\n * @private\n */\n _addCartItemsToList: function (listId, pendingProduct) {\n var self = this,\n addData = new FormData();\n\n addData.set('list_id', listId);\n addData.set('form_key', $.mage.cookies.get('form_key'));\n\n // product_id is only set for per-item cart buttons (not full-cart add).\n if (pendingProduct.productId) {\n addData.set('product_id', pendingProduct.productId);\n }\n\n $.ajax({\n url: pendingProduct.url,\n type: 'POST',\n data: addData,\n processData: false,\n contentType: false,\n showLoader: true,\n complete: function () {\n // sections.xml maps addfromcart \u2192 requisitionlist.\n // We also reload messages here so the AddFromCart success\n // message is shown without a page blink.\n customerData.reload([self.sectionName, 'messages'], true);\n self.closeModal();\n }\n });\n },\n\n /**\n * Close the modal\n */\n closeModal: function () {\n var modal = null;\n\n // Prefer modal module if available on the component\n if (typeof this.requisitionListModalForm === 'function') {\n try {\n modal = this.requisitionListModalForm();\n } catch (e) {\n modal = null;\n }\n }\n\n // Fallback to source (some components expose modal as source)\n if (!modal && this.source) {\n modal = this.source;\n }\n\n // Try uiRegistry by known component names\n if (!modal) {\n modal = registry.get('aw_requisition_list_modal_form') ||\n registry.get('aw_requisition_list_modal_form.aw_requisition_list_modal_form');\n }\n\n // Try to close if possible\n if (modal && typeof modal.closeModal === 'function') {\n modal.closeModal();\n return;\n }\n\n // Try async registry load for modal component\n registry.async('aw_requisition_list_modal_form')(function (asyncModal) {\n if (asyncModal && typeof asyncModal.closeModal === 'function') {\n asyncModal.closeModal();\n }\n });\n registry.async('aw_requisition_list_modal_form.aw_requisition_list_modal_form')(function (asyncModal) {\n if (asyncModal && typeof asyncModal.closeModal === 'function') {\n asyncModal.closeModal();\n }\n });\n\n // Last resort: try closing generic Magento modal popup instances\n if (window && window.jQuery) {\n try {\n window.jQuery('.modal
2-popup').modal('closeModal');\n } catch (e) {\n // ignore\n }\n }\n },\n\n /**\n * Close modal after a short delay to allow UI updates\n */\n _closeModalSoon: function () {\n var self = this;\n setTimeout(function () {\n self.closeModal();\n }, 150);\n }\n });\n };\n});\n","Aheadworks_RequisitionListsOverrides/js/ui/requisition-list/item-listing/item-configurator-mixin.js":"/**\n * Mixin for item-configurator to prevent modal popup from overriding\n * product image container styles in the listing.\n *\n * Root cause: image_with_borders.phtml generates a <script> that uses\n * document.querySelectorAll(\".product-image-container-{id}\") to set\n * inline styles on ALL matching elements. When the configure modal\n * loads with different image dimensions, it overwrites the listing's\n * image styles.\n *\n * Fix: Save existing product-image-container inline styles before\n * injecting popup content, then restore them afterwards.\n */\ndefine([\n 'jquery'\n], function ($) {\n 'use strict';\n\n return function (itemConfigurator) {\n var originalShowPopup = itemConfigurator._showPopup;\n\n itemConfigurator._showPopup = function (popupTitle, popupContent) {\n // Save current inline styles of all product-image-container elements\n var savedStyles = [];\n document.querySelectorAll('[class*=\"product-image-container-\"]').forEach(function (el) {\n savedStyles.push({\n element: el,\n width: el.style.width\n });\n });\n document.querySelectorAll('[class*=\"product-image-container-\"] span.product-image-wrapper').forEach(function (el) {\n savedStyles.push({\n element: el,\n paddingBottom: el.style.paddingBottom\n });\n });\n\n // Call original _showPopup which injects the HTML (and triggers the script)\n originalShowPopup.call(this, popupTitle, popupContent);\n\n // Restore saved inline styles that were overwritten by the modal's script\n savedStyles.forEach(function (saved) {\n if (saved.width !== undefined) {\n saved.element.style.width = saved.width;\n }\n if (saved.paddingBottom !== undefined) {\n saved.element.style.paddingBottom = saved.paddingBottom;\n }\n });\n };\n\n return itemConfigurator;\n };\n});\n","Aheadworks_RequisitionListsOverrides/js/view/requisition-list/management-mixin.js":"define([\n 'jquery'\n], function ($) {\n 'use strict';\n\n return function (Widget) {\n $.widget('awrl.requisitionListManagement', Widget, {\n _bind: function () {\n var selector = this.options.deleteButtonSelector;\n var handlers = {};\n\n if (!selector) {\n return;\n }\n\n handlers['click ' + selector] = this._deleteRequisitionList;\n this._on($(document), handlers);\n }\n });\n\n return $.awrl.requisitionListManagement;\n };\n});\n","Pixelmechanics_ProductOverview/js/productreviews.js":"/**\n * @package : Pixelmechanics_ProductOverview\n * @author : KK\n * @Trello : https://trello.com/c/iIbpqgP5/631-22-05-17-overview-page-product-reviews\n * @date : 25th May'2022\n */\ndefine(['jquery'], function($){\n \"use strict\";\n return function productreviews()\n {\t\n \tvar url = new URL(window.location.href);\n\t\t\tvar search_params = url.searchParams;\n\n\t\t\t// Set the selected value of the category in the filter dropdown\n\t\t\tvar currentSelectedId = search_params.get('cat');\n\t\t\tif(currentSelectedId != \"\"){\n\t\t\t\tjQuery('#category option[value='+currentSelectedId+']').attr('selected','selected');\n\t\t\t}\n\n\t\t\t// Set the selected value of the review in the filter dropdown\n\t\t\tvar reviewShort = search_params.get('review');\n\t\t\tif(reviewShort != \"\"){\n\t\t\t\tjQuery('#newest option[value='+reviewShort+']').attr('selected','selected');\n\t\t\t}
2\n\t\t\t\n\t\t\t// Add params of category filter in URL\n $('#category').on('change', function($) {\n\t\t\t\tvar catId = this.value;\n\t\t\t\tif(catId != \"\"){\n\t\t\t\t\tsearch_params.set('cat',catId);\n\t\t\t\t\turl.search = search_params.toString();\n\t\t\t\t\tvar new_url = url.toString();\n\t\t\t\t}else{\n\t\t\t\t\tsearch_params.delete('cat');\n\t\t\t\t\turl.search = search_params.toString();\n\t\t\t\t\tvar new_url = url.toString();\n\t\t\t\t}\n\t\t\t\tlocation.replace(new_url); \n\t\t\t});\n\n // Add params of review filter in URL\n\t\t\t$('#newest').on('change', function($) {\n\t\t\t\tvar reviewshort = this.value;\n\t\t\t\tif(reviewshort != \"\"){\n\t\t\t\t\tsearch_params.set('review',reviewshort);\n\t\t\t\t\turl.search = search_params.toString();\n\t\t\t\t\tvar new_url = url.toString();\n\t\t\t\t}else{\n\t\t\t\t\tsearch_params.delete('review');\n\t\t\t\t\turl.search = search_params.toString();\n\t\t\t\t\tvar new_url = url.toString();\n\t\t\t\t}\n\t\t\t\tlocation.replace(new_url);\n\t\t\t});\n }\n});","Magento_Vault/js/view/payment/vault-enabler.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n/*browser:true*/\n/*global define*/\n/* @api */\ndefine(\n [\n 'uiElement'\n ],\n function (\n Component\n ) {\n 'use strict';\n\n return Component.extend({\n defaults: {\n isActivePaymentTokenEnabler: true\n },\n\n /**\n * @param {String} paymentCode\n */\n setPaymentCode: function (paymentCode) {\n this.paymentCode = paymentCode;\n },\n\n /**\n * @returns {Object}\n */\n initObservable: function () {\n this._super()\n .observe([\n 'isActivePaymentTokenEnabler'\n ]);\n\n return this;\n },\n\n /**\n * @param {Object} data\n */\n visitAdditionalData: function (data) {\
2n if (!this.isVaultEnabled()) {\n return;\n }\n\n if (!('additional_data' in data)) {\n data['additional_data'] = {};\n }\n\n data['additional_data']['is_active_payment_token_enabler'] = this.isActivePaymentTokenEnabler();\n },\n\n /**\n * @returns {Boolean}\n */\n isVaultEnabled: function () {\n return typeof window.checkoutConfig.vault[this.paymentCode] !== 'undefined' &&\n window.checkoutConfig.vault[this.paymentCode]['is_enabled'] === true;\n }\n });\n }\n);\n","Magento_Vault/js/view/payment/vault.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n/*browser:true*/\n/*global define*/\n/* @api */\ndefine([\n 'underscore',\n 'uiComponent',\n 'Magento_Checkout/js/model/payment/renderer-list',\n 'uiLayout',\n 'uiRegistry'\n], function (_, Component, rendererList, layout, registry) {\n 'use strict';\n\n var vaultGroupName = 'vaultGroup';\n\n layout([{\n name: vaultGroupName,\n component: 'Magento_Checkout/js/model/payment/method-group',\n alias: 'vault',\n sortOrder: 10\n }]);\n\n registry.get(vaultGroupName, function (vaultGroup) {\n _.each(window.checkoutConfig.payment.vault, function (config, index) {\n rendererList.push(\n {\n type: index,\n config: config.config,\n component: config.component,\n group: vaultGroup,\n\n /**\n * Custom payment method types comparator\n * @param {String} typeA\n * @param {String} typeB\n * @return {Boolean}\n */\n typeComparatorCallback: function (typeA, typeB) {\n // vault token items have the same name as vault payment without index\n return typeA.substring(0, typeA.lastIndexOf('_')) === typeB;\n }\n }\n );\n });\n });\n\n /**\n * Add view logic here if needed\n */\n return Component.extend({});\n});\n","Magento_Vault/js/view/payment/method-renderer/vault.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n/*browser:true*/\n/*global define*/\ndefine(\n [\n 'Magento_Checkout/js/view/payment/default',\n 'Magento_Checkout/js/action/select-payment-method',\n 'Magento_Checkout/js/checkout-data'\n ],\n function (Component, selectPaymentMethod, checkoutData) {\n 'use strict';\n\n return Component.extend({\n defaults: {\n template: 'Magento_Vault/payment/form'\n },\n\n /**\n * @returns {exports.initObservable}\n */\n initObservable: function () {\n this._super()\n .observe([]);\n\n return this;\n },\n\n /**\n * @returns\n */\n selectPaymentMethod: function () {\n selectPaymentMethod(\n {\n method: this.getId()\n }\n );\n checkoutData.setSelectedPaymentMethod(this.getId());\n\n return true;\n },\n\n /**\n * @returns {String}\n */\n getTitle: function () {\n return '';\n },\n\n /**\n * @returns {String}\n */\n getToken: function () {\n return '';\n },\n\n /**\n * @returns {String}\n */\n getId: function () {\n return this.index;\n },\n\n /**\n * @returns {String}\n */\n getCode: function () {\n return this.co
2de;\n },\n\n /**\n * Get last 4 digits of card\n * @returns {String}\n */\n getMaskedCard: function () {\n return '';\n },\n\n /**\n * Get expiration date\n * @returns {String}\n */\n getExpirationDate: function () {\n return '';\n },\n\n /**\n * Get card type\n * @returns {String}\n */\n getCardType: function () {\n return '';\n },\n\n /**\n * @param {String} type\n * @returns {Boolean}\n */\n getIcons: function (type) {\n return window.checkoutConfig.payment.ccform.icons.hasOwnProperty(type) ?\n window.checkoutConfig.payment.ccform.icons[type]\n : false;\n },\n\n /**\n * Return state of place order button.\n *\n * @return {Boolean}\n */\n isButtonActive: function () {\n return this.isActive() && this.isPlaceOrderActionAllowed();\n },\n\n /**\n * Check if payment is active.\n *\n * @return {Boolean}\n */\n isActive: function () {\n return this.isChecked() === this.getId();\n },\n\n /**\n * @returns {*}\n */\n getData: function () {\n var data = {\n method: this.getCode()\n };\n\n data['additional_data'] = {};\n data['additional_data']['public_hash'] = this.getToken();\n\n return data;\n }\n });\n }\n);\n","Magento_Vault/js/customer_account/deleteWidget.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\ndefine([\n 'jquery',\n 'Magento_Ui/js/modal/modalToggle',\n 'mage/translate'\n], function ($, modalToggle) {\n 'use strict';\n\n return function (config, deleteButton) {\n config.buttons = [\n {\n text: $.mage.__('Cancel'),\n class: 'action secondary cancel'\n }, {\n text: $.mage.__('Delete'),\n class: 'action primary',\n\n /**\n * Default action on button click\n */\n click: function (event) { //eslint-disable-line no-unused-vars\n $(deleteButton.form).trigger('submit');\n }\n }\n ];\n\n modalToggle(config, deleteButton);\n };\n});\n","Magento_Cookie/js/notices.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\n/**\n * @api\n */\ndefine([\n 'jquery',\n 'jquery-ui-modules/widget',\n 'mage/cookies'\n], function ($) {\n 'use strict';\n\n $.widget('mage.cookieNotices', {\n /** @inheritdoc */\n _create: function () {\n if ($.mage.cookies.get(this.options.cookieName)) {\n this.element.hide();\n } else {\n this.element.show();\n }\n $(this.options.cookieAllowButtonSelector).on('click', $.proxy(function () {\n var cookieExpires = new Date(new Date().getTime() + this.options.cookieLifetime * 1000);\n\n $.mage.cookies.set(this.options.cookieName, JSON.stringify(this.options.cookieValue), {\n expires: cookieExpires\n });\n\n if ($.mage.cookies.get(this.options.cookieName)) {\n this.element.hide();\n $(document).trigger('user:allowed:save:cookie');\n } else {\n window.location.href = this.options.noCookiesUrl;\n }\n }, this));\n }\n });\n\n return $.mage.cookieNotices;\n});\n","Magento_Cookie/js/require-cookie.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\n/**\n * @api\n */\ndefine([\n 'jquery',\n 'Magento_Ui/js/modal/alert',\n 'jquery-ui-modules/widget',\n 'mage/mage',\n 'mage/translate'\n], function ($, alert) {\n 'use strict';\n\n $.widget('mage.requireCookie', {\n options: {\n event: 'click',\n noCookieUrl: 'enable-cookies',\n triggers: ['.action.login', '.action.submit'],\n isRedirectCmsPage: true\n },\n\n /**\n * Constructor\n * @private\n */\n _create: function () {\n this._bind();\n },\n\n /**\n * This method binds elements found in this widget.\n * @private\n */\n _bind: function () {\n var events = {};\n\n $.each(this.options.triggers, function (index, value) {\n events['click ' + value] = '_checkCookie';\n });\n this._on(events);\n },\n\n /**\n * This method set the url for the redirect.\n * @param {jQuery.Event} event\n * @private\n */\n _checkCookie: function (event) {\n if (navigator.cookieEnabled) {\n return;\n }\n\n event.preventDefault();\n\n if (this.options.isRedirectCmsPage) {\n window.location = this.options.noCookieUrl;\n } else {\n alert({\n content: $.mage.__('Cookies are disabled in your browser.')\n });\n }\n }\n });\n\n return $.mage.requireCookie;\n});\n","Magento_Cookie/js/jquery.storageapi.extended.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\ndefine([\n 'jquery',\n 'jquery/jquery.cookie',\n 'jquery/jquery.storageapi.min'\n], function ($) {\n 'use strict';\n\n /**\n *\n * @param {Object} storage\n * @private\n */\n function _extend(storage) {\n var cookiesConfig = window.cookiesConfig || {};\n\n $.extend(storage, {\n _secure: !!cookiesConfig.secure,\n _samesite: cookiesConfig.samesite ? cookiesConfig.samesite : 'lax',\n\n /**\n * Set value under name\n * @param {String} name\n * @param {String}
2 value\n * @param {Object} [options]\n */\n setItem: function (name, value, options) {\n var _default = {\n expires: this._expires,\n path: this._path,\n domain: this._domain,\n secure: this._secure,\n samesite: this._samesite\n };\n\n $.cookie(this._prefix + name, value, $.extend(_default, options || {}));\n },\n\n /**\n * Set default options\n * @param {Object} c\n * @returns {storage}\n */\n setConf: function (c) {\n if (c.path) {\n this._path = c.path;\n }\n\n if (c.domain) {\n this._domain = c.domain;\n }\n\n if (c.expires) {\n this._expires = c.expires;\n }\n\n if (typeof c.secure !== 'undefined') {\n this._secure = c.secure;\n }\n\n if (typeof c.samesite !== 'undefined') {\n this._samesite = c.samesite;\n }\n\n return this;\n }\n });\n }\n\n if (window.cookieStorage) {\n _extend(window.cookieStorage);\n }\n});\n","Magento_Security/js/escaper.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\n/**\n * A loose JavaScript version of Magento\\Framework\\Escaper\n *\n * Due to differences in how XML/HTML is processed in PHP vs JS there are a couple of minor differences in behavior\n * from the PHP counterpart.\n *\n * The first difference is that the default invocation of escapeHtml without allowedTags will double-escape existing\n * entities as the intention of such an invocation is that the input isn't supposed to contain any HTML.\n *\n * The second difference is that escapeHtml will not escape quotes. Since the input is actually being processed by the\n * DOM there is no chance of quotes being mixed with HTML syntax. And, since escapeHtml is not\n * intended to be used with raw injection into a HTML attribute, this is acceptable.\n *\n * @api\n */\ndefine([], function () {\n 'use strict';\n\n return {\n neverAllowedElements: ['script', 'img', 'embed', 'iframe', 'video', 'source', 'object', 'audio'],\n generallyAllowedAttributes: ['id', 'class', 'href', 'title', 'style'],\n forbiddenAttributesByElement: {\n a: ['style']\n },\n\n /**\n * Escape a string for safe injection into HTML\n *\n * @param {String} data\n * @param {Array|null} allowedTags\n * @returns {String}\n */\n escapeHtml: function (data, allowedTags) {\n var domParser = new DOMParser(),\n fragment = domParser.parseFromString('<div></div>', 'text/html');\n\n fragment = fragment.body.childNodes[0];\n allowedTags = typeof allowedTags === 'object' && allowedTags.length ? allowedTags : null;\n\n if (allowedTags) {\n fragment.innerHTML = data || '';\n allowedTags = this._filterProhibitedTags(allowedTags);\n\n this._removeComments(fragment);\n this._removeNotAllowedElements(fragment, allowedTags);\n this._removeNotAllowedAttributes(fragment);\n\n return fragment.innerHTML;\n }\n\n fragment.textContent = data || '';\n\n return fragment.innerHTML;\n },\n\n /**\n * Remove the always forbidden tags from a list of provided tags\n *\n * @param {Array} tags\n * @returns {Array}\n * @private\n */\n _filterProhibitedTags: function (tags) {\n return tags.filter(function (n) {\n return this.neverAllowedElements.indexOf(n) === -1;\n }.bind(this));\n }
2,\n\n /**\n * Remove comment nodes from the given node\n *\n * @param {Node} node\n * @private\n */\n _removeComments: function (node) {\n var treeWalker = node.ownerDocument.createTreeWalker(\n node,\n NodeFilter.SHOW_COMMENT,\n function () {\n return NodeFilter.FILTER_ACCEPT;\n },\n false\n ),\n nodesToRemove = [];\n\n while (treeWalker.nextNode()) {\n nodesToRemove.push(treeWalker.currentNode);\n }\n\n nodesToRemove.forEach(function (nodeToRemove) {\n nodeToRemove.parentNode.removeChild(nodeToRemove);\n });\n },\n\n /**\n * Strip the given node of all disallowed tags while permitting any nested text nodes\n *\n * @param {Node} node\n * @param {Array|null} allowedTags\n * @private\n */\n _removeNotAllowedElements: function (node, allowedTags) {\n var treeWalker = node.ownerDocument.createTreeWalker(\n node,\n NodeFilter.SHOW_ELEMENT,\n function (currentNode) {\n return allowedTags.indexOf(currentNode.nodeName.toLowerCase()) === -1 ?\n NodeFilter.FILTER_ACCEPT\n // SKIP instead of REJECT because REJECT also rejects child nodes\n : NodeFilter.FILTER_SKIP;\n },\n false\n ),\n nodesToRemove = [];\n\n while (treeWalker.nextNode()) {\n if (allowedTags.indexOf(treeWalker.currentNode.nodeName.toLowerCase()) === -1) {\n nodesToRemove.push(treeWalker.currentNode);\n }\n }\n\n nodesToRemove.forEach(function (nodeToRemove) {\n nodeToRemove.parentNode.replaceChild(\n node.ownerDocument.createTextNode(nodeToRemove.textContent),\n nodeToRemove\n );\n });\n },\n\n /**\n * Remove any invalid attributes from the given node\n *\n * @param {Node} node\n * @private\n */\n _removeNotAllowedAttributes: function (node) {\n var treeWalker = node.ownerDocument.createTreeWalker(\n node,\n NodeFilter.SHOW_ELEMENT,\n function () {\n return NodeFilter.FILTER_ACCEPT;\n },\n false\n ),\n i,\n attribute,\n nodeName,\n attributesToRemove = [];\n\n while (treeWalker.nextNode()) {\n for (i = 0; i < treeWalker.currentNode.attributes.length; i++) {\n attribute = treeWalker.currentNode.attributes[i];\n nodeName = treeWalker.currentNode.nodeName.toLowerCase();\n\n if (this.generallyAllowedAttributes.indexOf(attribute.name) === -1 || // eslint-disable-line max-depth,max-len\n this._checkHrefValue(attribute) ||\n this.forbiddenAttributesByElement[nodeName] &&\n this.forbiddenAttributesByElement[nodeName].indexOf(attribute.name) !== -1\n ) {\n attributesToRemove.push(attribute);\n }\n }\n }\n\n attributesToRemove.forEach(function (attributeToRemove) {\n attributeToRemove.ownerElement.removeAttribute(attributeToRemove.name);\n });\n },\n\n /**\n * Check that attribute contains script content\n *\n * @param {Object} attribute\n * @private\n */\n _checkHrefValue: function (attribute) {\n return attribute.nodeName === 'href' && attribute.no
2deValue.startsWith('javascript');\n }\n };\n});\n","CustomGento_Cookiebot/js/google-analytics-mixin.js":"define(['mage/utils/wrapper'], function (wrapper) {\n 'use strict';\n\n return function (gaFunction) {\n return wrapper.wrap(gaFunction, function (parentMethod, config) {\n if (typeof Cookiebot === 'undefined') {\n return;\n }\n if (!Cookiebot.hasResponse) {\n window.addEventListener('CookiebotOnAccept', function () {\n if (Cookiebot.consent.statistics) {\n parentMethod(config);\n }\n });\n } else if (Cookiebot.consent.statistics) {\n parentMethod(config);\n }\n })\n }\n});\n","CustomGento_Cookiebot/js/video-platform-validator.js":"define([], function () {\n 'use strict';\n\n return function isSupportedVideoPlatform(url) {\n if (!url) {\n return false;\n }\n\n const youtubePattern = /^https?:\\/\\/(www\\.)?(youtube\\.com|youtu\\.be)\\//i;\n const youtubeNocookiePattern = /^https?:\\/\\/(www\\.)?youtube-nocookie\\.com\\//i;\n const vimeoPattern = /^https?:\\/\\/(www\\.)?(vimeo\\.com|player\\.vimeo\\.com)\\//i;\n\n return youtubePattern.test(url) ||\n youtubeNocookiePattern.test(url) ||\n vimeoPattern.test(url);\n };\n});","CustomGento_Cookiebot/js/video-blocker-widget.js":"define([\n 'mage/translate'\n], function ($t) {\n 'use strict';\n\n return function (videoElement) {\n 'use strict';\n\n if (!videoElement) {\n return null;\n }\n\n const divElement = document.createElement('div');\n const paragraphElement = document.createElement('p');\n const iframeHeight = videoElement?.getBoundingClientRect().height || 300;\n const iframeWidth = videoElement?.getBoundingClientRect().width || 400;\n\n // Create the video blocker HTML\n divElement.innerHTML = `\n <div style=\"background-color:#CCC;display:inline-block;height:${iframeHeight}px;position:relative;width:${iframeWidth}px; z-index: 1000;\">\n <div style=\"background-color:#848484;border-radius:15px;height:50%;position:absolute;transform:translate(50%,50%);width:50%;\">\n <p style=\"color:#FFF;font-size:7.5em;position:relative;top:50%;left:50%;margin:0;text-align:center;transform:translate(-50%,-50%);\">⋯</p>\n </div>\n </div>\n `;\n\n // Add CSS classes and styling\n divElement.classList.add('cookieconsent-optout-marketing');\n paragraphElement.innerHTML = $t('Please <a href=\"javascript:Cookiebot.renew()\">accept marketing cookies</a> to view this content.');\n \n divElement.style.fontSize = '1.4rem';\n divElement.append(paragraphElement);\n paragraphElement.style.zIndex = '10001';\n paragraphElement.style.position = 'relative';\n\n // Insert the blocker before the video element\n if (videoElement?.parentNode) {\n videoElement.parentNode.insertBefore(divElement, videoElement);\n }\n\n return divElement;\n };\n});\n","CustomGento_Cookiebot/js/video-background-mixin.js":"define([\n 'jquery',\n 'CustomGento_Cookiebot/js/video-blocker-widget',\n 'CustomGento_Cookiebot/js/video-platform-validator'\n], function ($, createVideoBlocker, isSupportedVideoPlatform) {\n 'use strict';\n\n return function (originalWidget) {\n function getValidDimension(value, fallback) {\n if (!value || parseFloat(value) === 0) {\n return fallback;\n }\n return value;\n }\n\n return function (config, element) {\n const videoElementContainer = $(element);\n const videoElement = videoElementContainer[0];\n const videoElementStyles = window.getComputedStyle(element);\n const height = getValidDimension(videoElementStyles.minHeight, '300px');\n const width = getValidDimension(videoElementStyles.width, '400px');\n\n if (videoElementContainer.data('background-type') !== 'video') {\n originalWidget(config, element);\n return;\n }\n\n const blockVideoConsentConfig = window.cookiebotConfig && window.cookiebotConfig.blockVideosUntilConsent;\n const videoSrc = videoElement.getAttribute('data-video-src');\n const cookieblockSrc = videoElement.getAttribute('data-cookieblock-src');\n const src = videoSrc || cookieblockSrc;\n let previousStatus = '';\n let blockerElement = null;\n\n if (!blockVideoConsentConfig || !isSupportedVideoPlatform(src)) {\n originalWidget(config, element);\n return;\n }\n\n addEventListener('CookiebotOnLoad', videoBackgroun
2dBlocker);\n\n function videoBackgroundBlocker() {\n if (previousStatus === 'blocked' && (!window.Cookiebot?.consent?.marketing)) {\n return;\n }\n\n if (!window.Cookiebot?.consent?.marketing) {\n if (videoSrc) {\n videoElement.setAttribute('data-cookieblock-src', videoSrc);\n videoElement.removeAttribute('data-video-src');\n }\n videoElement.style.display = 'none';\n blockerElement = createVideoBlocker(videoElement);\n const blockerElementContent = blockerElement.querySelector('div');\n blockerElementContent.style.height = height;\n blockerElementContent.style.width = width;\n previousStatus = 'blocked';\n return;\n }\n\n if (!videoElement.getAttribute('data-video-src') && cookieblockSrc) {\n videoElement.setAttribute('data-video-src', cookieblockSrc);\n videoElement.removeAttribute('data-cookieblock-src');\n }\n videoElement.style.display = 'block';\n\n if (blockerElement) {\n blockerElement.remove();\n blockerElement = null;\n }\n\n originalWidget(config, element);\n previousStatus = 'unblocked';\n }\n\n videoBackgroundBlocker();\n };\n };\n});","CustomGento_Cookiebot/js/slide-widget-mixin.js":"define([\n 'jquery',\n 'underscore',\n 'CustomGento_Cookiebot/js/video-blocker-widget',\n 'CustomGento_Cookiebot/js/video-platform-validator',\n 'Magento_PageBuilder/js/widget/show-on-hover',\n 'Magento_PageBuilder/js/widget/video-background'\n], function ($, _, createVideoBlocker, isSupportedVideoPlatform, showOnHover, videoBackground) {\n 'use strict';\n\n return function (originalWidget) {\n return function (config, element) {\n const videoElement = element[0].querySelector('[data-background-type=video]');\n\n if (!videoElement) {\n originalWidget(config, element);\n return;\n }\n\n const blockVideoConsentConfig = window.cookiebotConfig && window.cookiebotConfig.blockVideosUntilConsent;\n const videoSrc = videoElement.getAttribute('data-video-src');\n const cookieblockSrc = videoElement.getAttribute('data-cookieblock-src');\n const src = videoSrc || cookieblockSrc;\n let previousStatus = '';\n \n if (!blockVideoConsentConfig || !isSupportedVideoPlatform(src)) {\n originalWidget(config, element);\n return;\n }\n\n const viewportElement = document.createElement('div');\n\n\n addEventListener('CookiebotOnLoad', sliderVideoBlocker);\n\n function sliderVideoBlocker() {\n if (previousStatus === 'blocked' && (!Cookiebot?.consent?.marketing)) {\n return;\n }\n\n if (!Cookiebot?.consent?.marketing) {\n videoElement.setAttribute('data-cookieblock-src', videoElement.getAttribute('data-video-src'));\n videoElement.removeAttribute('data-video-src');\n createVideoBlocker(videoElement);\n videoElement.style.display = 'none';\n previousStatus = 'blocked';\n return;\n }\n\n viewportElement.classList.add('jarallax-viewport-element');\n\n if (!videoElement) {\n return;\n }\n\n if (!videoElement.getAttribute('data-video-src')) {\n videoElement.setAttribute('data-video-src', videoElement.getAttribute('data-cookieblock-src'));\n videoElement.style.display = 'block';\n videoElement.removeAttribute('data-cookieblock-src');\n\n const customSlide = videoElement.closest('.slick-slide');\n if (customSlide) {\n const consentBlocker = customSlide.querySelector('.cookieconsent-optout-marketing');\n consentBlocker?.remove();\n }\n }\n videoElement.setAttribute('data-element-in-viewport', '.jarallax-viewport-element');\n videoElement.appendChild(viewportElement);
2\n videoBackground(config, videoElement);\n videoElement.style.display = 'block';\n previousStatus = 'unblocked';\n\n originalWidget(config, element);\n }\n\n sliderVideoBlocker();\n };\n };\n});","CustomGento_Cookiebot/js/fotorama-video-events-mixin.js":"define([\n 'jquery',\n 'CustomGento_Cookiebot/js/video-blocker-widget'\n], function ($, createVideoBlocker) {\n 'use strict';\n\n return function (widget) {\n $.widget('mage.AddFotoramaVideoEvents', widget, {\n _clickHandler: function (e) {\n const blockVideoConsentConfig = window.cookiebotConfig && window.cookiebotConfig.blockVideosUntilConsent;\n\n if (Cookiebot?.consent?.marketing || !blockVideoConsentConfig) {\n this._super(e);\n return;\n }\n\n createVideoBlocker(e.target.querySelector('.product-video'));\n },\n\n _initialize: function () {\n this._super();\n addEventListener('CookiebotOnAccept', () => {\n if (Cookiebot?.consent?.marketing) {\n const cookiebotOutput = document?.querySelector('.cookieconsent-optout-marketing');\n\n if (!cookiebotOutput) {\n return;\n }\n\n const videoElement = cookiebotOutput.closest('.video-unplayed[aria-hidden=\"false\"]');\n\n const event = new PointerEvent('click', {\n bubbles: true,\n cancelable: true,\n view: window\n });\n videoElement?.dispatchEvent(event);\n }\n });\n }\n });\n\n return $.mage.AddFotoramaVideoEvents;\n };\n});\n","Magento_ReCaptchaWebapiUi/js/jquery-mixin.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\n// jscs:disable requireDotNotation\n\ndefine([\n 'mage/utils/wrapper'\n], function (wrapper) {\n 'use strict';\n\n return function (jQuery) {\n jQuery.ajax = wrapper.wrapSuper(jQuery.ajax, function () {\n //Moving ReCaptcha value from payload to the header for requests to web API\n var settings,\n payload;\n\n if (arguments.length !== 0) {\n settings = arguments.length === 1 ? arguments[0] : arguments[1];\n }\n\n if (settings && settings.hasOwnProperty('data')) {\n //The request has a body, trying to parse JSON data\n try {\n payload = JSON.parse(settings.data);\n } catch (e) {\n //Not JSON\n }\n }\n\n if (payload && payload.hasOwnProperty('xReCaptchaValue')) {\n if (!settings.hasOwnProperty('headers')) {\
2n settings.headers = {};\n }\n settings.headers['X-ReCaptcha'] = payload.xReCaptchaValue;\n delete payload['xReCaptchaValue'];\n settings.data = JSON.stringify(payload);\n }\n\n return this._super.apply(this, arguments);\n });\n\n return jQuery;\n };\n});\n","Magento_ReCaptchaWebapiUi/js/webapiReCaptcha.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\n// jscs:disable jsDoc\n\n/* global grecaptcha */\ndefine(\n [\n 'Magento_ReCaptchaFrontendUi/js/reCaptcha',\n 'Magento_ReCaptchaWebapiUi/js/webapiReCaptchaRegistry'\n ],\n function (Component, registry) {\n 'use strict';\n\n return Component.extend({\n defaults: {\n autoTrigger: false\n },\n\n /**\n * Provide the token to the registry.\n *\n * @param {String} token\n */\n reCaptchaCallback: function (token) {\n //Make the token retrievable in other UI components.\n registry.tokens[this.getReCaptchaId()] = token;\n\n if (typeof registry._listeners[this.getReCaptchaId()] !== 'undefined') {\n registry._listeners[this.getReCaptchaId()](token);\n }\n },\n\n /**\n * Register this ReCaptcha.\n *\n * @param {Object} parentForm\n * @param {String} widgetId\n */\n initParentForm: function (parentForm, widgetId) {\n var self = this,\n trigger;\n\n if (this.getIsInvisibleRecaptcha()) {\n trigger = function () {\n grecaptcha.execute(widgetId);\n };\n } else {\n trigger = function () {\n self.reCaptchaCallback(grecaptcha.getResponse(widgetId));\n };\n }\n\n if (this.autoTrigger) {\n //Validate ReCaptcha when initiated\n trigger();\n registry.triggers[this.getReCaptchaId()] = new Function();\n } else {\n registry.triggers[this.getReCaptchaId()] = trigger;\n }\n this.tokenField = null;\n }\n });\n }\n);\n","Magento_ReCaptchaWebapiUi/js/webapiReCaptchaRegistry.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\ndefine([], function () {\n 'use strict';\n\n return {\n /**\n * recaptchaId: token map.\n *\n * Tokens for already verified recaptcha.\n */\n tokens: {},\n\n /**\n * recaptchaId: triggerFn map.\n *\n * Call a trigger to initiate a recaptcha verification.\n */\n triggers: {},\n\n /**\n * recaptchaId: callback map\n */\n _listeners: {},\n\n /**\n * Add a listener to when the ReCaptcha finishes verification\n * @param {String} id - ReCaptchaId\n * @param {Function} func - Will be called back with the token\n */\n addListener: function (id, func) {\n if (this.tokens.hasOwnProperty(id)) {\n func(this.tokens[id]);\n } else {\n this._listeners[id] = func;\n }\n }\n };\n});\n","Pixelmechanics_AccountManager/js/account-manager.js":"/**\n * BZ-1453: Knockout component for the account manager (Kundenbetreuer) box.\n *\n * Reads the personal manager data from the customer-data section \"account_manager\"\n * (loaded via AJAX after the FPC response) instead of server-rendered per-customer\n * HTML, so the full page cache no longer varies per customer.\n * Blueprint: Macs_App/js/downloadBanner.\n */\ndefine([\n 'uiComponent',\n 'Magento_Customer/js/customer-data',\n 'ko'\n], function (Component, customerData, ko) {\n 'use strict';\n\n return Component.extend({\n initialize: function (config) {\n this._super();\n\n var self = this;\n\n this.config = config || {};\n this.sectionName = 'account_manager';\n\n // Store-level defaults rendered by the block (identical for every customer, FPC-safe)\n this.defaultName = this.config.defaultName || '';\n this.defaultPhone = this.config.defaultPhone || '';\n this.defaultImageUrl = this.config.defaultImageUrl || '';\n\n this.section = customerData.get(this.sectionName);\n\n var _section = this.section();\n\n // NOTE: do not name these \"name\" \u2014 uiComponent uses this.name internally (registry key)\n this.managerName = ko.observable(_section.name ? _section.name : this.defaultName);\n this.managerPhone = ko.observable(_section.phone ? _section.phone : this.defaultPhone);\n this.imageUrl = ko.observable(_section.imageUrl ? _section.imageUrl : this.defaultImageUrl);\n\n // Box stays hidden (see .account-manager-section.is-ready in the LESS) until a\n // server response for THIS page load has actually confirmed the data \u2014 never based\n // on customer-data's synchronous localStorage value, which core (customer-data.js\n // init()) always delivers first even when it is about to reload the section as\n // expired (e.g. right after login/logout via the account_manager sections.xml\n // entry). That stale value has the same shape as a fresh one (imageUrl always set,\n // see AccountManagerSection::getSectionData()), so it cannot be told apart from a\n // real answer without waiting for the actual round trip \u2014 see BZ-1453 gotcha.\n this.isLoaded = ko.observable(false);\n\n // Safety net: if the section request never resolves (network error, blocked\n // request, no manager assigned at all), reveal the box anyway after a few seconds\n // instead of hiding it forever \u2014 a late default is better than a permanently\n // missing widget.\n this._readyTimeout = setTimeout(function () {\n self.isLoaded(true);\n }, 4000);
2\n\n this.section.subscribe(function (data) {\n self.managerName(data && data.name ? data.name : self.defaultName);\n self.managerPhone(data && data.phone ? data.phone : self.defaultPhone);\n self.imageUrl(data && data.imageUrl ? data.imageUrl : self.defaultImageUrl);\n clearTimeout(self._readyTimeout);\n self.isLoaded(true);\n });\n\n // Force a fresh, confirmed answer on every page load instead of only when the\n // section is missing from storage \u2014 core's own automatic reload-if-expired only\n // covers some staleness cases (see comment on isLoaded above) and never guarantees\n // a subscribe() fire when the stored value already looked \"current\".\n customerData.reload([this.sectionName], true);\n\n return this;\n }\n });\n});\n","CommerceExtensions_GroupedProductFilter/js/table.js":"define([\n 'jquery',\n 'domReady!'\n], function ($) {\n 'use strict';\n\n return function (config) {\n\n // === Responsive Table Labels ===\n var table = document.querySelector('table');\n if (table) {\n var headers = Array.from(table.querySelectorAll('thead th'))\n .map(th => th.textContent.trim().replace(/\\s+/g, ' '));\n\n table.querySelectorAll('tbody tr').forEach(function (tr) {\n Array.from(tr.children).forEach(function (td, i) {\n td.setAttribute('data-label', headers[i] || '');\n });\n });\n }\n\n\n };\n});","Pixelmechanics_Venedor/js/validation.js":"/**\n* @author : Pavan Shukla\n* @description : Add the Custom Validation Rules. The Rule name is Validate-Tel which validates the telephone number like xxx-xxx-xxxx or xxx/xxx/xxxx or xxx/xxx-xxxx . This validation was requested in Magento 1 by the client itself.\n* @date : 15th June'19\n* @trello link : https://trello.com/c/PcPbBAr8\n*/\n\n/**\n * @Todo: check if we really need to load all the code on each site.\n * We should rather only load it where needed.\n */\n\ndefine([\n 'jquery',\n 'mage/validation'\n], function($){ \n \n $.validator.addMethod(\n 'validate-tel', function (value, element) { \n // Updated validation, added \"space\" in validation\n // Updated validation message\n // Updated by AA on 19.09.2019\n // https://trello.com/c/PcPbBAr8/129-user-customer-validation-registration-address-fields-login-fields#comment-5d822ac96e6c6b3d6026c3e5\n return this.optional(element) || /^[+0-9/-\\s]*$/.test(value);\n // removed duplicate text from validation message\n //Updated by AA on 23.09.2019\n //https://trello.com/c/PcPbBAr8/129-user-customer-validation-registration-address-fields-login-fields#comment-5d888e4570f55c7c9f179e85 \n }, $.mage.__('Please enter a valid telephone number that only consists of numbers, spaces, + and / /. eg: \"0049 9123 456789\" or \"09123 456789\"'));\n \n /**\n * Add the custom validation class to restrict unwanted data in the form\n * PM PS, 05.02.20, @link - https://trello.com/c/RMZadpOW/\n */\n $.validator.addMethod(\n 'validate-string-escape-special-char', function (value, element) { \n // Updated validation, added \"space\" in validation\n // Updated validation message\n // Updated by AA on 19.09.2019\n // https://trello.com/c/PcPbBAr8/129-user-customer-validation-registration-address-fields-login-fields#comment-5d822ac96e6c6b3d6026c3e5\n return this.optional(element) || /^[a-zA-Z\u00c0-\u00ff\u0178\u0152\u01530-9-.\\s]*$/.test(value);\n // removed duplicate text from validation message\n //Updated by AA on 23.09.2019\n //https://trello.com/c/PcPbBAr8/129-user-customer-validation-registration-address-fields-login-fields#comment-5d888e4570f55c7c9f179e85 \n }, $.mage.__('Please enter valid text. No special characters allowed, except `.` and ` -` and spaces.'));\n\n});\n","Pixelmechanics_Venedor/js/jquery.selectBox.js":"define([\n \"jquery\",\n \"jquery/ui\"\n], \nfunction($) {\n \"use strict\";\n \n $(document).ready(function($){\n\n /**\n * SelectBox class.\n *\n * @param {HTMLElement|jQuery} select If it's a jQuery object, we use the first element.\n * @param {Object} options\n * @constructor\n */\n var SelectBox = window.SelectBox = function (select, options) {\n if (select instanceof jQuery) {\n if (select.length > 0) {\n select = select[0];\n } else {\n return;\n }\n }\n\n this.typeTimer = null;\n this.typeSearch = '';\n this.isMac = navigator.platform.match(/mac/i);\n options = 'object' === typeof options ? options : {};\n this.selectElement = select;\n\n // Disable for iOS devices (their native controls are more suitable for a touch device)\n if (!options.mobile && navigator.userAgent.match(/iPad|iPhone|Android|IEMobile|BlackBerry/i)) {\n return false;\n }\n\n // Element must be a select control\n if ('select' !== select.tagName.toLowerCase()) {\n return false;\n }\n\n this.init(options);\n };\n\n /**\n * @type {String}\n */\n SelectBox.prototype.version = '1.2.0';\n\n /**\n * @param {Object} options\n *\n * @returns {Boolean}\n */\n SelectBox.prototype.init = function (options) {\n var select = $(this.selectElement);\n if (select.data('selectBox-control')) {\n return false;\n }\n\n var control = $('<a class=\"selectBox\" />')\n , inline = select.attr('multiple') || parseInt(select.attr('size')) > 1\n , settings = options || {}\n , tabIndex = parseInt(select.prop('tabindex')) || 0\n , self = this;\n\n control\n .width(select.outerWidth())\n .addClass(select.attr('class'))\n .attr('title', select.attr('title') || '')\n .attr('tabindex', tabIndex)\n .css('display', 'inline-block')\n .bind('focus.selectBox', function () {\n if (this !== document.activeElement && document.body !== document.activeElement) {\n $(document.activeElement).blur();\n }\n if (control.hasClass('selectBox-active')) {\n return;\n }\n control.addClass('selectBox-active');\n select.trigger('focus');\n })\n .bind('blur.selectBox', function () {\n if (!control.hasClass('selectBox-active')) {\n return;\n }\n control.removeClass('selectBox-active');\n select.trigger('blur');\n });\n\n if (!$(window).data('selectBox-bindings')) {\n $(window)\n .data('selectBox-bindings', true)\n .bind('scroll.
2selectBox', (settings.hideOnWindowScroll) ? this.hideMenus : $.noop)\n .bind('resize.selectBox', this.hideMenus);\n }\n\n if (select.attr('disabled')) {\n control.addClass('selectBox-disabled');\n }\n\n // Focus on control when label is clicked\n select.bind('click.selectBox', function (event) {\n control.focus();\n event.preventDefault();\n });\n\n // Generate control\n if (inline) {\n // Inline controls\n options = this.getOptions('inline');\n\n control\n .append(options)\n .data('selectBox-options', options).addClass('selectBox-inline selectBox-menuShowing')\n .bind('keydown.selectBox', function (event) {\n self.handleKeyDown(event);\n })\n .bind('keypress.selectBox',function (event) {\n self.handleKeyPress(event);\n })\n .bind('mousedown.selectBox',function (event) {\n if (1 !== event.which) {\n return;\n }\n if ($(event.target).is('A.selectBox-inline')) {\n event.preventDefault();\n }\n if (!control.hasClass('selectBox-focus')) {\n control.focus();\n }\n })\n .insertAfter(select);\n\n // Auto-height based on size attribute\n if (!select[0].style.height) {\n var size = select.attr('size') ? parseInt(select.attr('size')) : 5;\n // Draw a dummy control off-screen, measure, and remove it\n var tmp = control\n .clone()\n .removeAttr('id')\n .css({\n position: 'absolute',\n top: '-9999em'\n })\n .show()\n .appendTo('body');\n tmp.find('.selectBox-options').html('<li><a>\\u00A0</a></li>');\n var optionHeight = parseInt(tmp.find('.selectBox-options A:first').html(' ').outerHeight());\n tmp.remove();\n control.height(optionHeight * size);\n }\n this.disableSelection(control);\n } else {\n // Dropdown controls\n var label = $('<span class=\"selectBox-label\" />'),\n arrow = $('<span class=\"selectBox-arrow\" />');\n\n // Update label\n label.attr('class', this.getLabelClass()).html(this.getLabelHtml());\n options = this.getOptions('dropdown');\n options.appendTo('BODY');\n\n control\n .data('selectBox-options', options)\n .addClass('selectBox-dropdown')\n .append(label)\n .append(arrow)\n .bind('mousedown.selectBox', function (event) {\n if (1 === event.which) {\n if (control.hasClass('selectBox-menuShowing')) {\n self.hideMenus();\n } else {\n event.stopPropagation();\n // Webkit fix to prevent premature selection of options\n options\n .data('selectBox-down-at-x', event.screenX)\n .data('selectBox-down-at-y', event.screenY);\n self.showMenu();\n }\n }\n })\n .bind('keydown.selectBox', function (event) {\n self.handleKeyDown(event);\n })\n .bind('keypress.selectBox', function (event) {\n self.handleKeyPress(event);\n })\n .bind('open.selectBox',function (event, triggerData) {\n if (triggerData && triggerData._selectBox === true) {\n return;\n }\n self.showMenu();\n })\n .bind('close.selectBox', function (event, triggerData) {\n if (triggerData && triggerData._selectBox === true) {\n return;\n }\n self.hideMenus();\n })\n .insertAfter(select);\n\n // Set label width\n var labelWidth =\n control.width()\n - arrow.outerWidth()\n - (parseInt(label.css('paddingLeft')) || 0)\n - (parseInt(label.css('paddingRight')) || 0);\n\n label.width(labelWidth);\n this.disableSelection(control);\n }\n // Store data for later use and show the control\n select\n .addClass('selectBox')\n .data('selectBox-control', control)\n .data('selectBox-settings', settings)\n .hide();\n };\n\n /**\n * @param {String} type 'inline'|'dropdown'\n * @returns {jQuery}\n */\n SelectBox.prototype.getOptions = function (type) {\n var options;\n var select = $(this.selectElement);\n var self = this;\n // Private function to handle recursion in the getOptions function.\n var _getOptions = function (select, options) {\n // Loop through the set in order of element children.\n select.children('OPTION, OPTGROUP').each(function () {\n // If the element is an option, add it to the list.\n if ($(this).is('OPTION')) {\n // Check for a value in the option found.\n if ($(this).length > 0) {\n // Create an option form the found element.\n self.generateOptions($(this), options);\n } else {\n // No option information found, so add an empty.\n options.append('<li>\\u00A0</li>');\n }\n } else {\n // If the element is an option group, add the group and call this function on it.\n var optgroup = $('<li class=\"selectBox-optgroup\" />');\n optgroup.text($(this).attr('label'));\n options.append(optgroup);\n options = _getOptions($(this), options);\n }\n });\n // Return the built strin\n return options;\n };\n\n switch (type) {\n case 'inline':\n options = $('<ul class=\"selectBox-options\" />');\n options = _getOptions(select, options);\n options\n .find('A')\n .bind('mouseover.selectBox', function (event) {\n self.addHover($(this).parent());\n })\n .bind('mouseout.selectBox',function (event) {\n self.removeHover($(this).parent());\n })\n .bind('mousedown.selectBox',function (event) {\n if (1 !== event.which) {\n return\n }\n event.preventDefault(); // Prevent options from being \"dragged\"\n if (!select.selectBox('control').hasClass('selectBox-active')) {\n select.selectBox('control').focus();\n }\n })\n .bind('mouseup.selectBox', function (event) {\n if (1 !== event.which) {\n return;\n }\n self.hideMenus();\n self.selectOption($(this).parent(), event);\n });\n\n this.disableSelection(options);\n return options;\n case 'dropdown':\n options = $('<ul class=\"selectBox-dropdown-menu selectBox-options\" />');\n options = _getOptions(select, options);\n\n options\n .data('selectBox-select', select)\n .css('display', 'none')\n .appendTo('BODY')\n .find('A')\n .bind('mousedown.selectBox', function (event) {\n if (event.which === 1) {\n event.preventDefault(); // Prevent options from being \"dragged\"\n if (event.screenX === options.data('selectBox-down-at-x') &&\n event.screenY === options.data('selectBox-down-at-y')) {\n options.removeData('selectBox-down-at-x').removeData('selectBox-down-at-y');\n if (/android/i.test(navigator.userAgent.toLowerCase()) &&\n /chrome/i.test(navigator.userAgent.toLowerCase())) {\n self.selectOption($(this).parent());\n }\n self.hideMenus();\n }\n }\n })\n .bind('mouseup.selectBox', function (event) {\n if (1 !== event.which) {\n return;\n }\n if (event.screenX === options.data('selectBox-down-at-x') &&\n event.screenY === options.data('selectBox-down-at-y')) {\n return;\n } else {\n options.removeData('selectBox-down-at-x').removeData('selectBox-down-at-y');\n }\n self.selectOption($(this).parent());\n self.hideMenus();\n })\n .bind('mouseover.selectBox', function (event) {\n self.addHover($(this).parent());\n })\n .bind('mouseout.selectBox', function (event) {\n self.removeHover($(this).parent());\n });\n\n // Inherit classes for dropdown menu\n var classes = select.attr('class') || '';\n if ('' !== classes) {\n classes = classes.split(' ');\n for (var i = 0; i < classes.length;
2 i++) {\n options.addClass(classes[i] + '-selectBox-dropdown-menu');\n }\n\n }\n this.disableSelection(options);\n return options;\n }\n };\n\n /**\n * Returns the current class of the selected option.\n *\n * @returns {String}\n */\n SelectBox.prototype.getLabelClass = function () {\n var selected = $(this.selectElement).find('OPTION:selected');\n return ('selectBox-label ' + (selected.attr('class') || '')).replace(/\\s+$/, '');\n };\n\n /**\n * Returns the current label of the selected option.\n *\n * @returns {String}\n */\n SelectBox.prototype.getLabelHtml = function () {\n var selected = $(this.selectElement).find('OPTION:selected');\n var labelHtml;\n if (selected.data('icon')) {\n labelHtml = '<i class=\"fa fa-'+selected.data('icon')+' fa-fw fa-lg\"></i> '+selected.text();\n } else {\n labelHtml = selected.text();\n }\n return labelHtml || '\\u00A0';\n };\n\n /**\n * Sets the label.\n * This method uses the getLabelClass() and getLabelHtml() methods.\n */\n SelectBox.prototype.setLabel = function () {\n var select = $(this.selectElement);\n var control = select.data('selectBox-control');\n if (!control) {\n return;\n }\n\n control\n .find('.selectBox-label')\n .attr('class', this.getLabelClass())\n .html(this.getLabelHtml());\n };\n\n /**\n * Destroys the SelectBox instance and shows the origin select element.\n *\n */\n SelectBox.prototype.destroy = function () {\n var select = $(this.selectElement);\n var control = select.data('selectBox-control');\n if (!control) {\n return;\n }\n\n var options = control.data('selectBox-options');\n options.remove();\n control.remove();\n select\n .removeClass('selectBox')\n .removeData('selectBox-control')\n .data('selectBox-control', null)\n .removeData('selectBox-settings')\n .data('selectBox-settings', null)\n .show();\n };\n\n /**\n * Refreshes the option elements.\n */\n SelectBox.prototype.refresh = function () {\n var select = $(this.selectElement)\n , control = select.data('selectBox-control')\n , type = control.hasClass('selectBox-dropdown') ? 'dropdown' : 'inline'\n , options;\n\n // Remove old options\n control.data('selectBox-options').remove();\n\n // Generate new options\n options = this.getOptions(type);\n control.data('selectBox-options', options);\n\n switch (type) {\n case 'inline':\n control.append(options);\n break;\n case 'dropdown':\n // Update label\n this.setLabel();\n $(\"BODY\").append(options);\n break;\n }\n\n // Restore opened dropdown state (original menu was trashed)\n if ('dropdown' === type && control.hasClass('selectBox-menuShowing')) {\n this.showMenu();\n }\n };\n\n /**\n * Shows the dropdown menu.\n */\n SelectBox.prototype.showMenu = function () {\n var self = this\n , select = $(this.selectElement)\n , control = select.data('selectBox-control')\n , settings = select.data('selectBox-settings')\n , options = control.data('selectBox-options');\n\n if (control.hasClass('selectBox-disabled')) {\n return false;\n }\n\n this.hideMenus();\n\n // Get top and bottom width of selectBox\n var borderBottomWidth = parseInt(control.css('borderBottomWidth')) || 0;\n var borderTopWidth = parseInt(control.css('borderTopWidth')) || 0;\n\n // Get proper variables for keeping options in viewport\n var pos = control.offset()\n , topPositionCorrelation = (settings.topPositionCorrelation) ? settings.topPositionCorrelation : 0\n , bottomPositionCorrelation = (settings.bottomPositionCorrelation) ? settings.bottomPositionCorrelation : 0\n , optionsHeight = options.outerHeight()\n , controlHeight = control.outerHeight()\n , maxHeight = parseInt(options.css('max-height'))\n , scrollPos = $(window).scrollTop()\n , heightToTop = pos.top - scrollPos\n , heightToBottom = $(window).height() - ( heightToTop + controlHeight )\n , posTop = (heightToTop >
2 heightToBottom) && (settings.keepInViewport == null ? true : settings.keepInViewport)\n , width = control.innerWidth() >= options.innerWidth() ? control.innerWidth() + 'px' : 'auto'\n , top = posTop\n ? pos.top - optionsHeight + borderTopWidth + topPositionCorrelation\n : pos.top + controlHeight - borderBottomWidth - bottomPositionCorrelation;\n\n\n // If the height to top and height to bottom are less than the max-height\n if(heightToTop < maxHeight&& heightToBottom < maxHeight){\n\n // Set max-height and top\n if(posTop){\n var maxHeightDiff = maxHeight - ( heightToTop - 5 );\n options.css({'max-height': maxHeight - maxHeightDiff + 'px'});\n top = top + maxHeightDiff;\n }else{\n var maxHeightDiff = maxHeight - ( heightToBottom - 5 );\n options.css({'max-height': maxHeight - maxHeightDiff + 'px'});\n }\n\n }\n\n // Save if position is top to options data\n options.data('posTop',posTop);\n\n\n // Menu position\n options\n .width(width)\n .css({\n top: top,\n left: control.offset().left\n })\n // Add Top and Bottom class based on position\n .addClass('selectBox-options selectBox-options-'+(posTop?'top':'bottom'));\n\n if (settings.styleClass) {\n options.addClass(settings.styleClass);\n }\n \n if (select.triggerHandler('beforeopen')) {\n return false;\n }\n\n var dispatchOpenEvent = function () {\n select.triggerHandler('open', {\n _selectBox: true\n });\n };\n\n // Show menu\n switch (settings.menuTransition) {\n case 'fade':\n options.fadeIn(settings.menuSpeed, dispatchOpenEvent);\n break;\n case 'slide':\n options.slideDown(settings.menuSpeed, dispatchOpenEvent);\n break;\n default:\n options.show(settings.menuSpeed, dispatchOpenEvent);\n break;\n }\n\n if (!settings.menuSpeed) {\n dispatchOpenEvent();\n }\n\n // Center on selected option\n var li = options.find('.selectBox-selected:first');\n this.keepOptionInView(li, true);\n this.addHover(li);\n control.addClass('selectBox-menuShowing selectBox-menuShowing-'+(posTop?'top':'bottom'));\n\n $(document).bind('mousedown.selectBox', function (event) {\n if (1 === event.which) {\n if ($(event.target).parents().andSelf().hasClass('selectBox-options')) {\n return;\n }\n self.hideMenus();\n }\n });\n };\n\n /**\n * Hides the menu of all instances.\n */\n SelectBox.prototype.hideMenus = function () {\n if ($(\".selectBox-dropdown-menu:visible\").length === 0) {\n return;\n }\n\n $(document).unbind('mousedown.selectBox');\n $(\".selectBox-dropdown-menu\").each(function () {\n var options = $(this)\n , select = options.data('selectBox-select')\n , control = select.data('selectBox-control')\n , settings = select.data('selectBox-settings')\n , posTop = options.data('posTop');\n\n if (select.triggerHandler('beforeclose')) {\n return false;\n }\n\n var dispatchCloseEvent = function () {\n select.triggerHandler('close', {\n _selectBox: true\n });\n };\n if (settings) {\n switch (settings.menuTransition) {\n case 'fade':\n options.fadeOut(settings.menuSpeed, dispatchCloseEvent);\n break;\n case 'slide':\n options.slideUp(settings.menuSpeed, dispatchCloseEvent);\n break;\n default:\n options.hide(settings.menuSpeed, dispatchCloseEvent);\n break;\n }\n if (!settings.menuSpeed) {\n dispatchCloseEvent();\n }\n control.removeClass('selectBox-menuShowing selectBox-menuShowing-'+(posTop?'top':'bottom'));\n } else {\n $(this).hide();\n $(this).triggerHandler('close', {\n _selectBox: true\n });\n $(this).removeClass('selectBox-menuShowing selectBox-menuShowing-'+(posTop?'top':'bottom'));\n }\n\n options.css('max-height','');\n //Remove Top or Bottom class based on position\n options.removeClass('selectBox-options-'+(posTop?'top':'bottom'));\n options.data('posTop' , false);\n });\n };\n\n /**\n * Selects an option.\n *\n * @param {HTMLElement} li\n * @param {DOMEvent} event\n * @returns {Boolean}\n */\n SelectBox.prototype.selectOption = function (li, event) {\n var select = $(this.selectElement);\n li = $(li);\n\n var control = select.data('selectBox-control')\n , settings = select.data('selectBox-settings');\n\n if (control.hasClass('selectBox-disabled')) {\n return false;\n }\n\n if (0 === li.length || li.hasClass('selectBox-disabled')) {\n return false;\n }\n\n if (select.attr('multiple')) {\n // If event.shiftKey is true, this will select all options between li and the last li selected\n if (event.shiftKey && control.data('selectBox-last-selected')) {\n li.toggleClass('selectBox-selected');\n var affectedOptions;\n if (li.index() > control.data('selectBox-last-selected').index()) {\n affectedOptions = li\n .siblings()\n .slice(control.data('selectBox-last-selected').index(), li.index());\n } else {\n affectedOptions = li\n .siblings()\n .slice(li.index(), control.data('selectBox-last-selected').index());\n }\n affectedOptions = affectedOptions.not('.selectBox-optgroup, .selectBox-disabled');\n if (li.hasClass('selectBox-selected')) {\n affectedOptions.addClass('selectBox-selected');\n } else {\n affectedOptions.removeClass('selectBox-selected');\n }\n } else if ((this.isMac && event.metaKey) || (!this.isMac && event.ctrlKey)) {\n li.toggleClass('selectBox-selected');\n } else {\n li.siblings().removeClass('selectBox-selected');\n li.addClass('selectBox-selected');\n }\n } else {\n li.siblings().removeClass('selectBox-selected');\n li.addClass('selectBox-selected');\n }\n\n if (control.hasClass('selectBox-dropdown')) {\n control.find('.selectBox-label').html(li.html());\n }\n\n // Update original control's value\n var i = 0, selection = [];\n if (select.attr('multiple')) {\n control.find('.selectBox-selected A').each(function () {\n selection[i++] = $(this).attr('rel');\n });\n } else {\n selection = li.find('A').attr('rel');\n }\n\n // Remember most recently selected item\n control.data('selectBox-last-selected', li);\n\n // Change callback\n if (select.val() !== selection) {\n select.val(selection);\n this.setLabel();\n select.trigger('change');\n }\n\n return true;\n };\n\n /**\n * Adds the hover class.\n *\n * @param {HTMLElement} li\n */\n SelectBox.prototype.addHover = function (li) {\n li = $(li);\n var select = $(this.selectElement)\n , control = select.data('selectBox-control')\n , options = control.data('selectBox-options');\n\n options.find('.selectBox-hover').removeClass('selectBox-hover');\n li.addClass('selectBox-hover');\n };
2\n\n /**\n * Returns the original HTML select element.\n *\n * @returns {HTMLElement}\n */\n SelectBox.prototype.getSelectElement = function () {\n return this.selectElement;\n };\n\n /**\n * Remove the hover class.\n *\n * @param {HTMLElement} li\n */\n SelectBox.prototype.removeHover = function (li) {\n li = $(li);\n var select = $(this.selectElement)\n , control = select.data('selectBox-control')\n , options = control.data('selectBox-options');\n\n options.find('.selectBox-hover').removeClass('selectBox-hover');\n };\n\n /**\n * Checks if the widget is in the view.\n *\n * @param {jQuery} li\n * @param {Boolean} center\n */\n SelectBox.prototype.keepOptionInView = function (li, center) {\n if (!li || li.length === 0) {\n return;\n }\n\n var select = $(this.selectElement)\n , control = select.data('selectBox-control')\n , options = control.data('selectBox-options')\n , scrollBox = control.hasClass('selectBox-dropdown') ? options : options.parent()\n , top = parseInt(li.offset().top -scrollBox.position().top)\n , bottom = parseInt(top + li.outerHeight());\n\n if (center) {\n scrollBox.scrollTop(li.offset().top - scrollBox.offset().top + scrollBox.scrollTop() -\n (scrollBox.height() / 2));\n } else {\n if (top < 0) {\n scrollBox.scrollTop(li.offset().top - scrollBox.offset().top + scrollBox.scrollTop());\n }\n if (bottom > scrollBox.height()) {\n scrollBox.scrollTop((li.offset().top + li.outerHeight()) - scrollBox.offset().top +\n scrollBox.scrollTop() - scrollBox.height());\n }\n }\n };\n\n /**\n * Handles the keyDown event.\n * Handles open/close and arrow key functionality\n *\n * @param {DOMEvent} event\n */\n SelectBox.prototype.handleKeyDown = function (event) {\n var select = $(this.selectElement)\n , control = select.data('selectBox-control')\n , options = control.data('selectBox-options')\n , settings = select.data('selectBox-settings')\n , totalOptions = 0, i = 0;\n\n if (control.hasClass('selectBox-disabled')) {\n return;\n }\n\n switch (event.keyCode) {\n case 8:\n // backspace\n event.preventDefault();\n this.typeSearch = '';\n break;\n case 9:\n // tab\n case 27:\n // esc\n this.hideMenus();\n this.removeHover();\n break;\n case 13:\n // enter\n if (control.hasClass('selectBox-menuShowing')) {\n this.selectOption(options.find('LI.selectBox-hover:first'), event);\n if (control.hasClass('selectBox-dropdown')) {\n this.hideMenus();\n }\n } else {\n this.showMenu();\n }\n break;\n case 38:\n // up\n case 37:\n // left\n event.preventDefault();\n if (control.hasClass('selectBox-menuShowing')) {\n var prev = options.find('.selectBox-hover').prev('LI');\n totalOptions = options.find('LI:not(.selectBox-optgroup)').length;\n i = 0;\n while (prev.length === 0 || prev.hasClass('selectBox-disabled') ||\n prev.hasClass('selectBox-optgroup')) {\n prev = prev.prev('LI');\n if (prev.length === 0) {\n if (settings.loopOptions) {\n prev = options.find('LI:last');\n } else {\n prev = options.find('LI:first');\n }\n }\n if (++i >= totalOptions) {\n break;\n }\n }\n this.addHover(prev);\n this.selectOption(prev, event);\n this.keepOptionInView(prev);\n } else {\n this.showMenu();\n }\n break;\n case 40:\n // down\n case 39:\n // right\n event.preventDefault();\n if (control.hasClass('selectBox-menuShowing')) {\n var next = options.find('.selectBox-hover').next('LI');\n totalOptions = options.find('LI:not(.selectBox-optgroup)').length;\n i = 0;\n while (0 === next.length || next.hasClass('selectBox-disabled') ||\n next.hasClass('selectBox-optgroup')) {\n next = next.next('LI');\n if (next.length === 0) {\n if (settings.loopOptions) {\n next = options.find('LI:first');\n } else {\n next = options.find('LI:last');\n }\n }\n if (++i >= totalOptions) {\n break;\n }\n }\n this.addHover(next);\n this.selectOption(next, event);\n this.keepOptionInView(next);\n } else {\n this.showMenu();\n }\n break;\n }\n };\n\n /**\n * Handles the keyPress event.\n * Handles type-to-find functionality\n *\n * @param {DOMEvent} event\n */\n SelectBox.prototype.handleKeyPress = function (event) {\n var select = $(this.selectElement)\n , control = select.data('selectBox-control')\n , options = control.data('selectBox-options')\n , self = this;\n\n if (control.hasClass('selectBox-disabled')) {\n return;\n }\n\n switch (event.keyCode) {\n case 9:\n // tab\n case 27:\n // esc\n case 13:\n // enter\n case 38:\n // up\n case 37:\n // left\n case 40:\n // down\n case 39:\n // right\n // Don't interfere with the keydown event!\n break;\n default:\n // Type to find\n if (!control.hasClass('selectBox-menuShowing')) {\n this.showMenu();\n }\n event.preventDefault();\n clearTimeout(this.typeTimer);\n this.typeSearch += String.fromCharCode(event.charCode || event.keyCode);\n options.find('A').each(function () {\n if ($(this).text().substr(0, self.typeSearch.length).toLowerCase() === self.typeSearch.toLowerCase()) {\n self.addHover($(this).parent());\n self.selectOption($(this).parent(), event);\n self.keepOptionInView($(this).parent());\n return false;\n }\n });\n // Clear after a brief pause\n this.typeTimer = setTimeout(function () {\n self.typeSearch = '';\n }, 1000);\n break;\n }\n };\n\n /**\n * Enables the selectBox.\n */\n SelectBox.prototype.enable = function () {\n var select = $(this.selectElement);\n select.prop('disabled', false);\n var control = select.data('selectBox-control');\n if (!control) {\n return;\n }\n control.removeClass('selectBox-disabled');\n };\n\n /**\n * Disables the selectBox.\n */\n SelectBox.prototype.disable = function () {\n var select = $(this.selectElement);\n select.prop('disabled', true);\n var control = select.data('selectBox-control');\n if (!control) {\n return;\n }\n control.addClass('selectBox-disabled');\n };\n\n /**\n * Sets the current value.\n *\n * @param {String} value\n */\n SelectBox.prototype.setValue = function (value) {\n var select = $(this.selectElement);\n select.val(value);\n value = select.val(); // IE9's select would be null if it was set with a non-exist options value\
2n\n if (null === value) { // So check it here and set it with the first option's value if possible\n value = select.children().first().val();\n select.val(value);\n }\n\n var control = select.data('selectBox-control');\n if (!control) {\n return;\n }\n\n var settings = select.data('selectBox-settings')\n , options = control.data('selectBox-options');\n\n // Update label\n this.setLabel();\n\n // Update control values\n options.find('.selectBox-selected').removeClass('selectBox-selected');\n options.find('A').each(function () {\n if (typeof(value) === 'object') {\n for (var i = 0; i < value.length; i++) {\n if ($(this).attr('rel') == value[i]) {\n $(this).parent().addClass('selectBox-selected');\n }\n }\n } else {\n if ($(this).attr('rel') == value) {\n $(this).parent().addClass('selectBox-selected');\n }\n }\n });\n\n if (settings.change) {\n settings.change.call(select);\n }\n };\n\n\n\n /**\n * Disables the selection.\n *\n * @param {*} selector\n */\n SelectBox.prototype.disableSelection = function (selector) {\n $(selector).css('MozUserSelect', 'none').bind('selectstart', function (event) {\n event.preventDefault();\n });\n };\n\n /**\n * Generates the options.\n *\n * @param {jQuery} self\n * @param {jQuery} options\n */\n SelectBox.prototype.generateOptions = function (self, options) {\n var li = $('<li />'), a = $('<a />');\n li.addClass(self.attr('class'));\n li.data(self.data());\n if (self.data('icon')) {\n a.attr('rel', self.val()).html('<i class=\"fa fa-'+self.data('icon')+' fa-fw fa-lg\"></i> '+self.text());\n } else {\n a.attr('rel', self.val()).text(self.text());\n }\n li.append(a);\n if (self.attr('disabled')) {\n li.addClass('selectBox-disabled');\n }\n if (self.attr('selected')) {\n li.addClass('selectBox-selected');\n }\n options.append(li);\n };\n\n /**\n * Extends the jQuery.fn object.\n */\n $.extend($.fn, {\n\n /**\n * Sets the option elements.\n *\n * @param {String|Object} options\n */\n setOptions : function (options) {\n var select = $(this)\n , control = select.data('selectBox-control');\n \n \n switch (typeof(options)) {\n case 'string':\n select.html(options);\n break;\n case 'object':\n select.html('');\n for (var i in options) {\n if (options[i] === null) {\n continue;\n }\n if (typeof(options[i]) === 'object') {\n var optgroup = $('<optgroup label=\"' + i + '\" />');\n for (var j in options[i]) {\n optgroup.append('<option value=\"' + j + '\">' + options[i][j] + '</option>');\n }\n select.append(optgroup);\n } else {\n var option = $('<option value=\"' + i + '\">' + options[i] + '</option>');\n select.append(option);\n }\n }\n break;\n }\n\n if (control) {\n // Refresh the control\n $(this).selectBox('refresh');\n // Remove old options\n \n }\n },\n \n \n \n selectBox: function (method, options) {\n var selectBox;\n\n switch (method) {\n case 'control':\n return $(this).data('selectBox-control');\n case 'settings':\n if (!options) {\n return $(this).data('selectBox-settings');\n }\n $(this).each(function () {\n $(this).data('selectBox-settings', $.extend(true, $(this).data('selectBox-settings'), options));\n });\n break;\n case 'options':\n // Getter\n \n if (undefined === options) {\n return $(this).data('selectBox-control').data('selectBox-options');\n }\n \n // Setter\n $(this).each(function () {\n $(this).setOptions(options);\n });\n break;\n case 'value':\n // Empty string is a valid value\n if (undefined === options) {\n return $(this).val();\n }\n $(this).each(function () {\n if (selectBox = $(this).data('selectBox')) {\
2n selectBox.setValue(options);\n }\n });\n break;\n case 'refresh':\n $(this).each(function () {\n if (selectBox = $(this).data('selectBox')) {\n selectBox.refresh();\n }\n });\n break;\n case 'enable':\n $(this).each(function () {\n if (selectBox = $(this).data('selectBox')) {\n selectBox.enable(this);\n }\n });\n break;\n case 'disable':\n $(this).each(function () {\n if (selectBox = $(this).data('selectBox')) {\n selectBox.disable();\n }\n });\n break;\n case 'destroy':\n $(this).each(function () {\n if (selectBox = $(this).data('selectBox')) {\n selectBox.destroy();\n $(this).data('selectBox', null);\n }\n });\n break;\n case 'instance':\n return $(this).data('selectBox');\n default:\n $(this).each(function (idx, select) {\n if (!$(select).data('selectBox')) {\n $(select).data('selectBox', new SelectBox(select, method));\n }\n });\n break;\n }\n return $(this);\n }\n });\n //console.log(\"DID IT! jQuery log complete.\");\n });\n \n});","Pixelmechanics_Venedor/js/pmcustom.js":"/**\n* @author : Pavan Shukla\n* @description : Custom JS loaded to handle custom events trigger in Magento 2\n* @date : 23rd April'19\n* @trello link : https://trello.com/c/EwDU62uQ \n*/\n\n/**\n * @Todo: check if we really need to load all the code on each site.\n * We should rather only load it where needed.\n */\n\ndefine([\n 'jquery',\n \"jquery/ui\",\n \"slick\",\n // Add the SelectBox JQuery to pmcustom js file becuase the selectbox funnction exists in the file.Sometimes the selectbox fucntion didn't load properly and that's why other jQuery functions also stopped working. PM PS, 24.10.19, @link https://trello.com/c/s7KPjTtj/195-directorder#comment-5db18587483a4e784e7268e7 /\n 'selectboxjs'\n \n], function($){\n 'use strict';\n\n // Here your custom code...\n //console.log('Hola');\n \n $(document).ready(function () {\n /**\n * @author : KK\n * @description : Added slick slider.\n * @Link : https://pixelmechanics.atlassian.net/browse/BLIZ-73\n * @date : 19 January 2023\n */\n $(\".slick-slider\").slick({\n slidesToShow: 5,\n slidesToScroll: 5,\n dots: true,\n responsive: [\n {\n breakpoint: 1025,\n settings: {\n slidesToShow: 4,\n slidesToScroll: 4,\n },\n },\n {\n breakpoint: 769,\n settings: {\n slidesToShow: 3,\n slidesToScroll: 3,\n },\n },\n {\n breakpoint: 640,\n settings: {\n slidesToShow: 2,\n slidesToScroll: 2,\n },\n },\n ],\n });\n\n // Slick initializes with width:0 on hidden tabs \u2014 recalculate on tab open\n $(document).on('click', '.product.data.items [data-toggle=\"trigger\"]', function() {\n var targetId = $(this).attr('href');\n setTimeout(function() {\n $(targetId).find('.slick-initialized').slick('setPosition');\n }, 50);\n });\n\n /* Mini login on click show form event */\n $(\".link_login\").on( \"click\", function(e) {\n $('.mini_login_sec').toggle();\n });\n\n /*\n * By AA on 18.8.2022\n * https://trello.com/c/rIO5Sm0P/\n * close the popup when clicking on close button\n */\n $(\"#projectList-validation-message-box .close\").on( \"click\", function(e) {\n $('#projectList-validation-message-box').hide();\n });\n \n /*\n * By AA on 14.8.2023\n * jump into konfiguration section in PDP\n */\n $('.konfigurator-text-button').on( \"click\", function(e) {\n $('html, body').animate({\n \t\tscrollTop: $(\"#macs-configurator-title\").offset().top -110\n \t }, 2000);\n });\n\n /*\n * @author: macs_rst \n * @date: on 04.04.2023\n * @de
2scription: close the popup when clicking on close button new PDS\n */\n $(\".validation-message-box .close\").on( \"click\", function(e) {\n $('#projectList-newPDS-validation-message-box').hide();\n });\n\n /* Style selectbox */\n $('#cat').selectBox();\n\n /* ScrollTop Event*/\n $(window).scroll(function () {\n if ($(this).scrollTop() > 100) {\n $('.scrollup').fadeIn();\n } else {\n $('.scrollup').fadeOut();\n }\n });\n\n /* Scroll the window to the top on click of the element*/\n $('.scrollup').click(function () {\n $(\"html, body\").animate({\n scrollTop: 0\n }, 600);\n return false;\n });\n\n \n \n /*Add the js function fire event on the increment/decrement button for the items in the cart.*/\n /**\n * @author : KK\n * @description : added functionality to plus/minus qty as per requirement.\n * @date : 24 August 2023\n */\n $(document).on('click','.button-up', function() {\n var qtyField = $(this).parent().find('.qty');\n var qty= parseInt(qtyField.val());\n var qtyIncrement = parseInt(qtyField.data('item-qty-increment'));\n var yve1 = qtyField.data('item-yve1');\n var newQty = '';\n if(qty != 0){\n if(qty == 1){\n if(qtyIncrement == 1){\n newQty = qty + qtyIncrement\n }
2else{\n newQty = qtyIncrement;\n }\n }else{\n var subQty = qty % qtyIncrement;\n var finalQty = qty - subQty;\n newQty = finalQty + qtyIncrement;\n }\n }else{\n if(yve1 && qty < yve1){\n newQty = yve1;\n }else{\n newQty = qty + qtyIncrement;\n }\n }\n qtyField.val(newQty).trigger('change');\n });\n $(document).on('click','.button-down', function() {\n var qtyField = $(this).parent().find('.qty');\n var qty = parseInt(qtyField.val());\n var qtyIncrement = parseInt(qtyField.data('item-qty-increment'));\n var yve1min = qtyField.data('item-yve1min');\n var yve1 = qtyField.data('item-yve1');\n var newQty = '';\n if(qty != 0){\n if(qty == 1){\n newQty = 0;\n }else if( yve1 && (qty == yve1) ){\n newQty = 0;\n }
2else{\n var subQty = qty % qtyIncrement;\n var finalQty = qty - subQty;\n if(subQty == 0 && (!yve1min || (qty > yve1)) ){\n newQty = finalQty - qtyIncrement;\n }else{\n newQty = finalQty;\n }\n }\n }else{\n newQty = 0;\n }\n if (newQty < 0)\n newQty = 0;\n qtyField.val(newQty).trigger('change');\n });\n\n /** \n * Fire the click event on the success/error message close button \n * Updated by PS, dated on 05th Jul 19, See Trello : https://trello.com/c/Be6VQBlo\n */\n $(document).on('click', '.close', function(event) {\n $(this).parent('.message').fadeOut();\n });\n\n\n /**\n * Show the minicart wrapper when click on the minicart icon in the mobile view\n * Updated by PS, dated on 12th Aug 19, See Trello : https://trello.com/c/qFNzYc7C/\n */\n $('.mini-cart-mobile').click(function () {\n $(this).toggleClass('active');\n $('.header.content .minicart-wrapper').toggleClass('active');\n });\n\n /**\n * @author : KK\n * @description : Make row clickable of product list.\n * @Link : https://trello.com/c/8ig1tSbs/654-22-05-30-projectlist-14-make-entire-row-clickable\n * @date : 09 June'2022\n */\n $(document).on('click', '.data-grid.table .data-row', function(event) {\n $(this).find('td a').get(0).click();\n });\n\n /**\n * Fixed Navigation and cart\n * Menu is folded in the \n * PM AS, https://trello.com/c/WUpAhLHY\n */\n $(window).scroll(function () {\n var scrollHeight = $(document).height();\n var scrollPosition = $(window).height() + $(window).scrollTop();\n\n if ($(this).scrollTop() > 100) {\n $('.minicart-wrapper').addClass('fixed');\n $('.nav-sections').addClass('fixed');\n } else {\n $('.minicart-wrapper').removeClass('fixed');\n $('.nav-sections').removeClass('fixed');\n }\n\n if (scrollHeight-scrollPosition <= 722) {\n $('.nav-sections').addClass('hiddenmenu');\n } else {\n $('.nav-sections').removeClass('hiddenmenu');\n }\n });\n /**\n * @author : KK\n * @description : Add Class in Add to cart button and hide hint.\n * @Link : https://trello.com/c/1nAvErx4/659-22-05-30-projectlist-15-hint-if-no-item-selected\n * @date : 14 June'2022\n */\n $('.input-checkbox').change(function() {\n if($(\"#form-requisition-list input:checkbox:checked\").length > 0){\n $(\".hint-if-no-item-selected\").css('display','none');\n $(\"#btn_wk_pjl\").removeClass(\"btn-disable\");\n }
2else{\n $(\"#btn_wk_pjl\").addClass(\"btn-disable\");\n }\n });\n \n /*\n * By AA on 2.8.2023\n * resolved menu closing issue on mobile\n */ \n $('.cms_menu .ui-menu-item a.level-top').on(\"click\", function(e) { \n $('.product_menu .ui-menu-item .dropdown-submenu').addClass(\"mobile-close-menu\").removeClass(\"mobile-open-menu\");\n \t let ulMenu = $(this).parent().siblings('.ui-menu.level0');\n \n if(ulMenu.hasClass(\"mobile-open-menu\")){\n \t\t ulMenu.removeClass(\"mobile-open-menu\").addClass(\"mobile-close-menu\").hide();\n \t }\n \t else{\n \t\t$('.ui-menu.level0').removeClass(\"mobile-open-menu\").addClass(\"mobile-close-menu\");\n \t\tulMenu.removeClass(\"mobile-close-menu\").addClass(\"mobile-open-menu\").show();\n \t } \n\t });\n\t \n $('.product_menu .dropdown-submenu .submenu-header').on(\"click\", function(e) { \n $('.cms_menu .ui-menu-item .dropdown-menu').addClass(\"mobile-close-menu\").removeClass(\"mobile-open-menu\");\n $('.product_menu .parent').children('.dropdown-menu').removeClass(\"mobile-close-menu\").addClass(\"mobile-open-menu\"); \n\t if($(this).parents('.subproduct-menu.mobile-open-menu').length){//mobile menu clicked at 3rd level\n $(this).parents('.subproduct-menu').find('.mobile-open-menu').removeClass('mobile-open-menu').addClass('mobile-close-menu')\n\t\t\t\t$(this).parent().siblings('.ui-menu.level0').removeClass(\"mobile-close-menu\").addClass(\"mobile-open-menu\");\n\t\t\t}\n\t\t\telse if($(this).parent().siblings('.ui-menu.level0').hasClass(\"mobile-open-menu\")){\n\t \t$(this).parent().siblings('.ui-menu.level0').removeClass(\"mobile-open-menu\").addClass(\"mobile-close-menu\");\n\t }\n \t else{\n \t\t$('.level1 .ui-menu.level0').removeClass(\"mobile-open-menu\").addClass(\"mobile-close-menu\");\n \t\t$(this).parent().siblings('.ui-menu.level0').removeClass(\"mobile-close-menu\").addClass(\"mobile-open-menu\");\n \t } \n\t });\n\t\n \t$('.product_menu .parent').children('a.level-top').on(\"click\", function(e) { \n \t $('.cms_menu .ui-menu-item .dropdown-menu').addClass(\"mobile-close-menu\").removeClass(\"mobile-open-menu\");\n \t $('ul.subproduct-menu').removeClass(\"mobile-open-menu\").addClass(\"mobile-close-menu\");\n \t if($('.product_menu .parent').children('.dropdown-menu').hasClass(\"mobile-open-menu\")){\n \t\t $('.product_menu .parent').children('.dropdown-menu').removeClass(\"mobile-open-menu\").addClass(\"mobile-close-menu\");\n \t }\n \t else{\n \t\t $('.product_menu .parent').children('.dropdown-menu').removeClass(\"mobile-close-menu\").addClass(\"mobile-open-menu\");\n \t }\n \t});\n\n /**\n * @author : KK\n * @description : scroll page top after reload.\n * @date : 24 July 2023\n */\n setTimeout(function() {\n if (window.location.href.indexOf(\"onestepcheckout\") > -1) {\n window.scrollTo(0, 0);\n }\n }, 2000);\n \n });\n\n /* load function is deprecated and don't require to trigger captcha. By AA on 9.5.2023 */ \n /*$(window).load(function() {*/\n\n /**\n * Trigger the click event on the reload captcha button to refresh captcha session\n * Updated by PS, dated on 16th Aug 19, See Trello - https://trello.com/c/sa9OJpZH/121-customer-registration-and-double-opt-in-incl-captcha#comment-5d56b10cdf8cea33f49e74b2\n */\n /* setTimeout(function() {\n $('.action.captcha-reload').trigger('click');\n }, 1000);\n });*/\n\n});\n\n \n\n\n/*\n*\n*Sticky Nav JS - Marius Dabrowski https://trello.com/c/42S9dvMI 11.06.19\n*\n*/\n/* Commented the sticky nav as showing issue and unable to complete the checkout\n * By AA on 13.09.2021\n * https://trello.com/c/HWcDZMnt/466-21-09-10-check-out-issue-on-live-nonbillable\n * Sticky nav still working on live website\n */\n \n\n // When the user scrolls the page, function controlls sticky nav\n // window.onscroll = function() {stickyNavControl()};\n\n // get the nav\n // var navList = document.getElementsByClassName('bss-megamenu navigation');\n // var nav = navList[0];\n\n // get the offset position of navbar\n // var sticky = nav.offsetTop;\n\n // Add the sticky-nav class to the nav when you reach its scroll position. Remove \"sticky-nav\" when you leave the scroll position\n function stickyNavControl() {\n \n if (window.pageYOffset > sticky) {\n nav.classList.add(\"sticky-nav\");\n } else {\n nav.classList.remove(\"sticky-nav\"); \n }\n\n }\n","PayPal_Braintree/js/validator.js":"/**\n * Copyright \u00a9 2013-2017 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n/*browser:true*/\n/*global define*/\ndefine([\n 'underscore'\n], function (_) {\n 'use strict';\n\n return {\n config: {},\n\n /**\n * Set configuration\n * @param {Object} config\n */\n setConfig: function (config) {\n this.config = config;\n },\n\n /**\n * Get List of available card types\n * @returns {*|exports.defaults.availableCardTypes|{}}\n */\n getAvailableCardTypes: function () {\n return this.config.availableCardTypes;\n },\n\n /**\n * Get list of card types\n * @returns {Object}\n */\n getCcTypesMapper: function () {\n return this.config.ccTypesMapper;\n },\n\n /**\n * Find mage card type by Braintree type\n * @param {String} type\n * @param {Object} availableTypes\n * @returns {*}\n */\n getMageCardType: function (type, availableTypes) {\n var storedCardType = null,\n mapper = this.getCcTypesMapper();\n\n if (type && typeof mapper[type] !== 'undefined') {\n storedCardType = mapper[type];\n\n if (_.indexOf(availableTypes, storedCardType) !== -1) {\n return storedCardType;\n }\n }\n\n return null;\n },\n\n /**\n * Filter list of available card types\n * @param {Object} availableTypes\n * @param {Object} countrySpecificCardTypes\n * @returns {Object}\n */\n collectTypes: function (availableTypes, countrySpecificCardTypes) {\n var key,\n filteredTypes = [];\n\n for (key in availableTypes) {\n if (_.indexOf(countrySpecificCardTypes, availableTypes[key]) !== -1) {\n filteredTypes.push(availableTypes[key]);\n }\n }\n\n return filteredTypes;\n },\n\n /**\n * Get list of card types for country\n * @param {String} countryId\n * @returns {*}\n */\n getCountrySpecificCardTypes: function (countryId) {\n if (typeof this.config.countrySpecificCardTypes[countryId] !== 'undefined') {\n return this.config.countrySpecificCardTypes[countryId];\n }\n\n return false;\n }\n };\n});\n","PayPal_Braintree/js/form-builder.js":"/**\n * Copyright \u00a9 2013-2017 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\ndefine(\n [\n 'jquery',\n 'underscore',\n 'mage/template'\n ],\n function ($, _, mageTemplate) {\n 'use strict';\n\n return {\n\n /**\n * @param {Object} formData\n * @returns {*|jQuery}\n */\n build: function (formData) {\n var formTmpl = mageTemplate('<form action=\"<%= data.action %>\"' +\n ' method=\"POST\" hidden enctype=\"application/x-www-form-urlencoded\">' +\n '<% _.each(data.fields, function(val, key){ %>' +\n '<input value=\\'<%= val %>\\' name=\"<%= key %>\" type=\"hidden\">' +\n '<% }); %>' +\n '</form>');\n\n return $(formTmpl({\n data: {\n action: formData.action,\n fields: formData.fields\n }\n })).appendTo($('[data-container=\"body\"]'));\n }\n };\n }\n);\n","PayPal_Braintree/js/paypal/button.js":"/**\n * Copyright \u00a9 2013-2017 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\ndefine(\n [\n 'rjsResolver',\n 'uiRegistry',\n 'uiComponent',\n 'underscore',\n 'jquery',\n 'Magento_Customer/js/customer-data',\n 'mage/translate',\n 'braintree',\n 'braintreeDataCollector',\n 'braintreePayPalCheckout',\n 'PayPal_Braintree/js/form-builder',\n 'domReady!'\n ],\n function (\n resolver,\n registry,\n Component,\n _,\n $,\n customerData,\n $t,\n braintree,\n dataCollector,\n paypalCheckout,\n formBuilder\n ) {\n 'use strict';\n let buttonIds = [];\n\n return {\n events: {\n onClick: null,\n onCancel: null,\n onError: null\n },\n\n /**\n * @param token\n * @param currency\n */\n init: function (token, currency, env, local) {\n if ($('.action-braintree-paypal-message').length) {\n $('.product-add-form form').on('keyup change paste', 'input, select, textarea', function () {\n var currentPrice, currencySymbol;\n currentPrice = $(\".product-info-main span\").find(\"[data-
2price-type='finalPrice']\").text();\n currencySymbol = $('.action-braintree-paypal-message[data-pp-type=\"product\"]').data('currency-symbol');\n $('.action-braintree-paypal-message[data-pp-type=\"product\"]').attr('data-pp-amount', currentPrice.replace(currencySymbol,''));\n });\n }\n\n buttonIds = [];\n $('.action-braintree-paypal-logo').each(function () {\n if (!$(this).hasClass(\"button-loaded\")) {\n $(this).addClass('button-loaded');\n buttonIds.push($(this).attr('id'));\n }\n });\n\n if (buttonIds.length > 0) {\n this.loadSDK(token, currency, env, local);\n }\n },\n\n /**\n * Load Braintree PayPal SDK\n * @param token\n * @param currency\n */\n loadSDK: function (token, currency, env, local) {\n braintree.create({\n authorization: token\n }, function (clientErr, clientInstance) {\n if (clientErr) {\n console.error('paypalCheckout error', clientErr);\n return this.showError(\"PayPal Checkout could not be initialized. Please contact the store owner.\");\n }\n dataCollector.create({\n client: clientInstance,\n paypal: true\n }, function (err, dataCollectorInstance) {\n if (err) {\n return console.log(err);\n }\n });\n paypalCheckout.create({\n client: clientInstance\n }, function (err, paypalCheckoutInstance) {\n if (typeof paypal !== 'undefined' ) {\n this.renderPayPalButtons(buttonIds, paypalCheckoutInstance);\n this.renderPayPalMessages();\n } else {\n var configSDK = {\n components: 'buttons,messages,funding-eligibility',\n \"enable-funding\": \"paylater\",\n currency: currency\n };\n if (env == 'sandbox' && local != '') {\n configSDK[\"buyer-country\"] = local;\n }\n paypalCheckoutInstance.loadPayPalSDK(configSDK, function () {\n this.renderPayPalButtons(buttonIds, paypalCheckoutInstance);\n this.renderPayPalMessages();\n }.bind(this));\n }\n }.bind(this));\n }.bind(this));\n },\n\n /**\n * Render PayPal buttons\n *\n * @param ids\n * @param paypalCheckoutInstance\n */\n renderPayPalButtons: function (ids, paypalCheckoutInstance) {\n _.each(ids, function (id) {\n this.payPalButton(id, paypalCheckoutInstance);\n }.bind(this));\n },\n\n /**\n * Render PayPal messages\n */\n renderPayPalMessages: function () {\n $('.action-braintree-paypal-message').each(function () {\n paypal.Messages({\n amount: $(this).data('pp-amount'),\n pageType: $(this).data('pp-type'),\n style: {\n layout: 'text',\n }\n }).render('#' + $(this).attr('id'));\n\n\n });\n },\n\n /**\n * @param id\n * @param paypalCheckoutInstance\n */\n payPalButton: function (id, paypalCheckoutInstance) {\n let data = $('#' + id);\n let style = {\n color: data.data('color'),\n shape: data.data('shape'),\n size: data.data('size'),\n };\n\n if (data.data('fundingicons')) {\n style.fundingicons = data.data('fundingicons');\n }\n\n // Render\n var paypalActions;\n var button = paypal.Buttons({\n fundingSource: data.data('funding'),\n style: style,\n createOrder: function () {\n return paypalCheckoutInstance.createPayment({\n amount: data.data('amount'),\n locale: data.data('locale'),\n currency: data.data('currency'),\n flow: 'checkout',\n enableShippingAddress: true,\n displayName: data.data('displayname')\n });\n },\n validate: function (actions) {\n var cart = customerData.get('cart'),\n customer = customerData.get('customer'),\n declinePayment = false,\n isGuestCheckoutAllowed;\n isGuestCheckoutAllowed = cart().isGuestCheckoutAllowed;\n declinePayment = !customer().firstname && !isGuestCheckoutAllowed;\n if (declinePayment) {\n actions.disable();\n }\n paypalActions = actions;\n }
2,\n\n onCancel: function (data) {\n jQuery(\"#maincontent\").trigger('processStop');\n },\n\n onError: function (err) {\n console.error('paypalCheckout button render error', err);\n jQuery(\"#maincontent\").trigger('processStop');\n },\n\n onClick: function (data) {\n var cart = customerData.get('cart'),\n customer = customerData.get('customer'),\n declinePayment = false,\n isGuestCheckoutAllowed;\n\n isGuestCheckoutAllowed = cart().isGuestCheckoutAllowed;\n declinePayment = !customer().firstname && !isGuestCheckoutAllowed && (typeof isGuestCheckoutAllowed !== 'undefined');\n if (declinePayment) {\n alert($t('To check out, please sign in with your email address.'));\n }\n },\n\n onApprove: function (data1) {\n return paypalCheckoutInstance.tokenizePayment(data1, function (err, payload) {\n jQuery(\"#maincontent\").trigger('processStart');\n\n // Map the shipping address correctly\n var address = payload.details.shippingAddress;\n var recipientFirstName, recipientLastName;\n if (typeof address.recipientName !== 'undefined') {\n var recipientName = address.recipientName.split(\" \");\n recipientFirstName = recipientName[0].replace(/'/g, \"'\");\n recipientLastName = recipientName[1].replace(/'/g, \"'\");\n } else {\n recipientFirstName = payload.details.firstName.replace(/'/g, \"'\");\n recipientLastName = payload.details.lastName.replace(/'/g, \"'\");\n }\n payload.details.shippingAddress = {\n streetAddress: typeof address.line2 !== 'undefined' ? address.line1.replace(/'/g, \"'\") + \" \" + address.line2.replace(/'/g, \"'\") : address.line1.replace(/'/g, \"'\"),\n locality: address.city.replace(/'/g, \"'\"),\n postalCode: address.postalCode,\n countryCodeAlpha2: address.countryCode,\n email: payload.details.email.replace(/'/g, \"'\"),\n recipientFirstName: recipientFirstName,\n recipientLastName: recipientLastName,\n telephone: typeof payload.details.phone !== 'undefined' ? payload.details.phone : '',\n region: typeof address.state !== 'undefined' ? address.state.replace(/'/g, \"'\") : ''\n };\n\n payload.details.email = payload.details.email.replace(/'/g, \"'\");\n payload.details.firstName = payload.details.firstName.replace(/'/g, \"'\");\n payload.details.lastName = payload.details.lastName.replace(/'/g, \"'\");\n if (typeof payload.details.businessName !== 'undefined') {\n payload.details.businessName = payload.details.businessName.replace(/'/g, \"'\");\n }\n\n // Map the billing address correctly\n let isRequiredBillingAddress = data.data('requiredbillingaddress');\n if ((isRequiredBillingAddress === 1) && (typeof payload.details.billingAddress !== 'undefined')) {\n var billingAddress = payload.details.billingAddress;\n payload.details.billingAddress = {\n streetAddress: typeof billingAddress.line2 !== 'undefined' ? billingAddress.line1.replace(/'/g, \"'\") + \" \" + billingAddress.line2.replace(/'/g, \"'\") : billingAddress.line1.replace(/'/g, \"'\"),\n locality: billingAddress.city.replace(/'/g, \"'\"),\n postalCode: billingAddress.postalCode,\n countryCodeAlpha2: billingAddress.countryCode,\n telephone: typeof payload.details.phone !== 'undefined' ? payload.details.phone : '',\n region: typeof billingAddress.state !== 'undefined' ? billingAddress.state.replace(/'/g, \"'\") : ''\n };\n }\n\n if (data.data('location') == 'productpage') {\n var form = $(\"#product_addtocart_form\");\n if (!(form.validation() && form.validation('isValid'))) {\n return false;\n }\n payload.additionalData = form.serialize();\n }\n\n var actionSuccess = data.data('actionsuccess');\n formBuilder.build(\n {\n action: actionSuccess,\n fields: {\n result: JSON.stringify(payload)\n }\n }\n ).submit();\n });\n }\n });\n if (!button.isEligible()) {\n console.log('PayPal button is not elligible')\n data.parent().remove();\n return;\n }\n if ($('#' + data.attr('id')).length) {\n button.render('#' + data.attr('id'));\n }\n },\n }\n }\n);","PayPal_Braintree/js/paypal/product-page.js":"define(\n ['PayPal_Braintree/js/paypal/button', 'jquery'],\n function (button, $) {\n 'use strict';\n\n return button.extend({\n\n defaults: {\n label: 'buynow',\n branding: true,\n },\n\n /**\n * The validation on the add-to-cart form is done after the PayPal window has opened.\n * This is because the validate method exposed by the PP Button requires an event to disable/enable the button.\n * We can't fire an event due to the way the mage.validation widget works and we can't do something gross like\n * an interval because the validation() method shows the error messages and focuses the user's input on the\n * first erroring input field.\n * @param payload\n * @returns {*}\n */\n beforeSubmit: function (payload) {\n var form = $(\"#product_addtocart_form\");\n\n if (!(form.validation() && form.validation('isValid'))) {\n return false;\n }\n\n payload.additionalData = form.serialize();\n\n return payload;\n }\n });\n }\n);","PayPal_Braintree/js/paypal/form-builder.js":"/**\n * Copyright \u00a9 2013-2017 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\ndefine(\n [\n 'jquery',\n 'underscore',\n 'mage/template'\n ],\n function ($, _, mageTemplate) {\n 'use strict';\n\n return {\n\n /**\n * @param {Object} formData\n * @returns {*|jQuery}\n */\n build: function (formData) {\n var formTmpl = mageTemplate('<form action=\"<%= data.action %>\"' +\n ' method=\"POST\" hidden enctype=\"application/x-www-form-urlencoded\">' +\n '<% _.each(data.fields, function(val, key){ %>' +\n '<input value=\\'<%= val %>\\' name=\"<%= key %>\" type=\"hidden\">' +\n '<% }); %>' +\n '</form>');\n\n return $(formTmpl({\n data: {\n action: formData.action,\n fields: formData.fields\n }\n })).appendTo($('[data-container=\"body\"]'));\n }\n };\n }\n);\n","PayPal_Braintree/js/paypal/credit/calculator.js":"define([\n 'underscore',\n 'uiComponent',\n 'jquery'\n], function (_, Component, $) {\n 'use strict';\n\n return Component.extend({\n defaults: {\n template: \"PayPal_Braintree/credit/calculator\",\n displaySummary: true, // \"From X per month\"\n displayInterestDetails: false, // Display the more in-depth summary of interest rates\n instalmentsFrom: 0,\n currentInstalment: {\n term: 0,\n monthlyPayment: 0,\n apr: 0,\n cost: 0,\n costIncInterest: 0\n },\n endpoint: null,\n instalments: [],\n visible: false,\n merchantName: ''\n }
2,\n\n initObservable: function () {\n this._super();\n if (this.instalments.length > 0) {\n this.currentInstalment = this.instalments[0];\n this.instalmentsFrom = this.instalments[this.instalments.length-1].monthlyPayment;\n this.visible = true;\n } else {\n this.loadInstalments();\n }\n\n this.observe(['instalments', 'currentInstalment', 'instalmentsFrom', 'visible']);\n return this;\n },\n\n isCurrentInstalment: function (term) {\n return (this.currentInstalment().term === term);\n },\n\n setCurrentInstalment: function (instalment) {\n this.currentInstalment(instalment);\n },\n\n loadInstalments: function () {\n if (!this.endpoint) {\n return false;\n }\n\n var self = this;\n require(['Magento_Checkout/js/model/quote', 'jquery'], function (quote, $) {\n if (typeof quote.totals().base_grand_total === 'undefined') {\n return false;\n }\n\n $.getJSON(self.endpoint, {amount: quote.totals().base_grand_total}, function (response) {\n self.instalments(response);\n self.setCurrentInstalment(response[0]);\n self.visible(true);\n });\n });\n }\n });\n});\n","PayPal_Braintree/js/model/step-navigator-mixin.js":"define([\n 'mage/utils/wrapper',\n 'jquery'\n], function (wrapper, $) {\n 'use strict';\n\n let mixin = {\n handleHash: function (originalFn) {\n var hashString = window.location.hash.replace('#', '');\n if (hashString.indexOf('venmo') > -1) {\n return false;\n }\n\n return originalFn();\n }\n };\n\n return function (target) {\n return wrapper.extend(target, mixin);\n };\n});\n","PayPal_Braintree/js/applepay/button.js":"/**\n * Braintree Apple Pay button\n **/\ndefine(\n [\n 'uiComponent',\n \"knockout\",\n \"jquery\",\n 'braintree',\n 'braintreeApplePay',\n 'mage/translate',\n 'Magento_Checkout/js/model/payment/additional-validators',\n ],\n function (\n Component,\n ko,\n jQuery,\n braintree,\n applePay,\n $t,\n additionalValidators\n ) {\n 'use strict';\n\n var that;\n\n return {\n init: function (element, context) {\n // No element or context\n if (!element || !context) {\n return;\n }\n\n // Context must implement these methods\n if (typeof context.getClientToken !== 'function') {\n console.error(\"Braintree ApplePay Context passed does not provide a getClientToken method\", context);\n return;\n }\n if (typeof context.getPaymentRequest !== 'function') {\n console.error(\"Braintree ApplePay Context passed does not provide a getPaymentRequest method\", context);\n return;\n }\n if (typeof context.startPlaceOrder !== 'function') {\n console.error(\"Braintree ApplePay Context passed does not provide a startPlaceOrder method\", context);\n return;\n }\n\n if (this.deviceSupported() === false) {\n return;\n }\n\n // init braintree api\n braintree.create({\n authorization: context.getClientToken()\n }, function (clientErr, clientInstance) {\n if (clientErr) {\n console.error('Error creating client:', clientErr);\n return;\n }\n\n applePay.create({\n client: clientInstance\n }, function (applePayErr, applePayInstance) {\n // No instance\n if (applePayErr) {\n console.error('Braintree ApplePay Error creating applePayInstance:', applePayErr);\n return;\n }\n\n // Create a button within the KO element, as apple pay can only be instantiated through\n // a valid on click event (ko onclick bind interferes with this).\n var el = document.createElement('div');\n el.className = \"braintree-apple-pay-button\";
2\n el.title = $t(\"Pay with Apple Pay\");\n el.alt = $t(\"Pay with Apple Pay\");\n el.addEventListener('click', function (e) {\n e.preventDefault();\n\n if (!additionalValidators.validate()) {\n return false;\n }\n // Payment request object\n var paymentRequest = applePayInstance.createPaymentRequest(context.getPaymentRequest());\n if (!paymentRequest) {\n alert($t(\"We're unable to take payments through Apple Pay at the moment. Please try an alternative payment method.\"));\n console.error('Braintree ApplePay Unable to create paymentRequest', paymentRequest);\n return;\n }\n\n // Show the loader\n jQuery(\"body\").loader('show');\n\n // Init apple pay session\n try {\n var session = new ApplePaySession(1, paymentRequest);\n } catch (err) {\n jQuery(\"body\").loader('hide');\n console.error('Braintree ApplePay Unable to create ApplePaySession', err);\n alert($t(\"We're unable to take payments through Apple Pay at the moment. Please try an alternative payment method.\"));\n return false;\n }\n\n // Handle invalid merchant\n session.onvalidatemerchant = function (event) {\n applePayInstance.performValidation({\n validationURL: event.validationURL,\n displayName: context.getDisplayName()\n }, function (validationErr, merchantSession) {\n if (validationErr) {\n session.abort();\n console.error('Braintree ApplePay Error validating merchant:', validationErr);\n alert($t(\"We're unable to take payments through Apple Pay at the moment. Please try an alternative payment method.\"));\n return;\n }\n\n session.completeMerchantValidation(merchantSession);\n });\n };\n\n // Attach payment auth event\n session.onpaymentauthorized = function (event) {\n applePayInstance.tokenize({\n token: event.payment.token\n }, function (tokenizeErr, payload) {\n if (tokenizeErr) {\n console.error('Error tokenizing Apple Pay:', tokenizeErr);\n session.completePayment(ApplePaySession.STATUS_FAILURE);\n return;\n }\n\n // Pass the nonce back to the payment method\n context.startPlaceOrder(payload.nonce, event, session);\n });\n };\n\n // Attach onShippingContactSelect method\n if (typeof context.onShippingContactSelect === 'function') {\n session.onshippingcontactselected = function (event) {\n return context.onShippingContactSelect(event, session);\n };\n }\n\n // Attach onShippingMethodSelect method\n if (typeof context.onShippingMethodSelect === 'function') {\n session.onshippingmethodselected = function (event) {\n return context.onShippingMethodSelect(event, session);\n };\n }\n\n // Hook\n if (typeof context.onButtonClick === 'function') {\n context.onButtonClick(session, this, e);\n } else {\n jQuery(\"body\").loader('hide');\n session.begin();\n }\n });\n element.appendChild(el);\n });\n });\n },\n\n /**\n * Check the site is using HTTPS & apple pay is supported on this device.\n * @return boolean\n */\n deviceSupported: function () {\n if (location.protocol != 'https:') {\n console.warn(\"Braintree Apple Pay requires your checkout be served over HTTPS\");\n return false;\n }\n\n if ((window.ApplePaySession && ApplePaySession.canMakePayments()) !== true) {\n console.warn(\"Braintree Apple Pay is not supported on this device/browser\");\n return false;\n }\n\n return true;\n }\n };\n }\n);\n","PayPal_Braintree/js/applepay/api.js":"/**\n * Braintree Apple Pay button API\n *\n **/\ndefine(\n [\n 'jquery',\n 'underscore',\n 'uiComponent',\n 'mage/translate',\n 'mage/storage',\n 'Magento_Customer/js/customer-data'\n ],\n function (\n $,\n _,\n Component,\n $t,\n storage,\n customerData\n ) {\n 'use strict';\n\n return Component.extend({\n defaults: {\n clientToken: null,\n quoteId: 0,\n displayName: null,\n actionSuccess: null,\n grandTotalAmount: 0,\n isLoggedIn: false,\n storeCode: \"default\",\n shippingAddress: {},\n countryDirectory: null,\n shippingMethods: {}\n },\n\n initialize: function () {\n this._super();\n if (!this.countryDirectory) {\n storage.get(\"rest/V1/directory/countries\").done(function (result) {\n this.countryDirectory = {};\n let i, data, x, region;\n for (i = 0; i < result.length; ++i) {\n data = result[i];\n this.countryDirectory[data.two_letter_abbreviation] = {};\n if (typeof data.available_regions !== 'undefined') {\n for (x = 0; x < data.available_regions.length; ++x) {\n region = data.available_regions[x];\n this.countryDirectory[data.two_letter_abbreviation][region.name.toLowerCase().replace(/[^A-Z0-9]/ig, '')] = region.id;\n }\n }\n }\n }.bind(this));\n }\n },\n\n /**\n * Get region ID\n */\n getRegionId: function (countryCode, regionName) {\n if (typeof regionName !== 'string') {\n return null;\n }\n\n regionName = regionName.toLowerCase().replace(/[^A-Z0-9]/ig, '');\n\n if (typeof this.countryDirectory[countryCode] !== 'undefined' && typeof this.countryDirectory[countryCode][regionName] !== 'undefined') {\n return this.countryDirectory[countryCode][regionName];\n }\n\n return 0;\n },\n\n /**\n * Set & get api token\n */\n setClientToken: function (value) {\n this.clientToken = value;\n },\n getClientToken: function () {\n return this.clientToken;\n },\n\n /**\n * Set and get quote id\n */\n setQuoteId: function (value) {\n this.quoteId = value;\n },\n getQuoteId: function () {\n return this.quoteId;\n },\n\n /**\n * Set and get display name\n */\n setDisplayName: function (value) {\n this.displayName = value;\n },\n getDisplayName: function () {\n return this.displayName;
2\n },\n\n /**\n * Set and get success redirection url\n */\n setActionSuccess: function (value) {\n this.actionSuccess = value;\n },\n getActionSuccess: function () {\n return this.actionSuccess;\n },\n\n /**\n * Set and get grand total\n */\n setGrandTotalAmount: function (value) {\n this.grandTotalAmount = parseFloat(value).toFixed(2);\n },\n getGrandTotalAmount: function () {\n return parseFloat(this.grandTotalAmount);\n },\n\n /**\n * Set and get is logged in\n */\n setIsLoggedIn: function (value) {\n this.isLoggedIn = value;\n },\n getIsLoggedIn: function () {\n return this.isLoggedIn;\n },\n\n /**\n * Set and get store code\n */\n setStoreCode: function (value) {\n this.storeCode = value;\n },\n getStoreCode: function () {\n return this.storeCode;\n },\n\n /**\n * API Urls for logged in / guest\n */\n getApiUrl: function (uri) {\n if (this.getIsLoggedIn() === true) {\n return \"rest/\" + this.getStoreCode() + \"/V1/carts/mine/\" + uri;\n } else {\n return \"rest/\" + this.getStoreCode() + \"/V1/guest-carts/\" + this.getQuoteId() + \"/\" + uri;\n }\n },\n\n /**\n * Payment request info\n */\n getPaymentRequest: function () {\n return {\n total: {\n label: this.getDisplayName(),\n amount: this.getGrandTotalAmount()\n },\n requiredShippingContactFields: ['postalAddress', 'name', 'email', 'phone'],\n requiredBillingContactFields: ['postalAddress', 'name']\n };\n },\n\n /**\n * Retrieve shipping methods based on address\n */\n onShippingContactSelect: function (event, session) {\n // Get the address.\n let address = event.shippingContact;\n\n // Create a payload.\n let payload = {\n address: {\n city: address.locality,\n region: address.administrativeArea,\n country_id: address.countryCode.toUpperCase(),\n postcode: address.postalCode,\n save_in_address_book: 0\n }\n };\n\n this.shippingAddress = payload.address;\n\n // POST to endpoint for shipping methods.\n storage.post(\n this.getApiUrl(\"estimate-shipping-methods\"),\n JSON.stringify(payload)\n ).done(function (result) {\n // Stop if no shipping methods.\n let virtualFlag = false;\n if (result.length === 0) {\n let productItems = customerData.get('cart')().items;\n _.each(productItems,\n function (item) {\n if (item.is_virtual) {\n virtualFlag = true;\n } else {\n virtualFlag = false;\n }\n }\n );\n if (!virtualFlag) {\n session.abort();\n alert($t(\"There are no shipping methods available for you right now. Please try again or use an alternative payment method.\"));\n return false;\n }\n }\n\n let shippingMethods = [];\n this.shippingMethods = {};\n\n // Format shipping methods array.\n for (let i = 0; i < result.length;
2 i++) {\n if (typeof result[i].method_code !== 'string') {\n continue;\n }\n\n let method = {\n identifier: result[i].method_code,\n label: result[i].method_title,\n detail: result[i].carrier_title ? result[i].carrier_title : \"\",\n amount: parseFloat(result[i].amount).toFixed(2)\n };\n\n // Add method object to array.\n shippingMethods.push(method);\n\n this.shippingMethods[result[i].method_code] = result[i];\n\n if (!this.shippingMethod) {\n this.shippingMethod = result[i].method_code;\n }\n }\n\n // Create payload to get totals\n let totalsPayload = {\n \"addressInformation\": {\n \"address\": {\n \"countryId\": this.shippingAddress.country_id,\n \"region\": this.shippingAddress.region,\n \"regionId\": this.getRegionId(this.shippingAddress.country_id, this.shippingAddress.region),\n \"postcode\": this.shippingAddress.postcode\n },\n \"shipping_method_code\": virtualFlag ? null : this.shippingMethods[shippingMethods[0].identifier].method_code,\n \"shipping_carrier_code\": virtualFlag ? null : this.shippingMethods[shippingMethods[0].identifier].carrier_code\n }\n };\n\n // POST to endpoint to get totals, using 1st shipping method\n storage.post(\n this.getApiUrl(\"totals-information\"),\n JSON.stringify(totalsPayload)\n ).done(function (result) {\n // Set total\n this.setGrandTotalAmount(result.base_grand_total);\n\n // Pass shipping methods back\n session.completeShippingContactSelection(\n ApplePaySession.STATUS_SUCCESS,\n shippingMethods,\n {\n label: this.getDisplayName(),\n amount: this.getGrandTotalAmount()\n },\n [{\n type: 'final',\n label: $t('Shipping'),\n amount: virtualFlag ? 0 : shippingMethods[0].amount\n }]\n );\n }.bind(this)).fail(function (result) {\n session.abort();\n alert($t(\"We're unable to fetch the cart totals for you. Please try an alternative payment method.\"));\n console.error(\"Braintree ApplePay: Unable to get totals\", result);\n return false;\n });\n\n }.bind(this)).fail(function (result) {\n session.abort();\n alert($t(\"We're unable to find any shipping methods for you. Please try an alternative payment method.\"));\n console.error(\"Braintree ApplePay: Unable to find shipping methods for estimate-shipping-methods\", result);\n return false;\n });\n },\n\n /**\n * Record which shipping method has been selected & Updated totals\n */\n onShippingMethodSelect: function (event, session) {\n let shippingMethod = event.shippingMethod;\n this.shippingMethod = shippingMethod.identifier;\n\n let payload = {\n \"addressInformation\": {\n \"address\": {\n \"countryId\": this.shippingAddress.country_id,\n \"region\": this.shippingAddress.region,\n \"regionId\": this.getRegionId(this.shippingAddress.country_id, this.shippingAddress.region),\n \"postcode\": this.shippingAddress.postcode\n },\n \"shipping_method_code\": this.shippingMethods[this.shippingMethod].method_code,\n \"shipping_carrier_code\": this.shippingMethods[this.shippingMethod].carrier_code\n }\n };\n\n storage.post(\n this.getApiUrl(\"totals-information\"),\n JSON.stringify(payload)\n ).done(function (r) {\n this.setGrandTotalAmount(r.base_grand_total);\n\n session.completeShippingMethodSelection(\n ApplePaySession.STATUS_SUCCESS,\n {\n label: this.getDisplayName(),\n amount: this.getGrandTotalAmount()\n },\n [{\n type: 'final',\n label: $t('Shipping'),\n amount: shippingMethod.amount\n }]\n );\n }.bind(this));\n },\n\n /**\n * Place the order\n */\n startPlaceOrder: function (nonce, event, session) {\n let shippingContact = event.payment.shippingContact,\n billingContact = event.payment.billingContact,\n payload = {\n \"addressInformation\": {\n \"shipping_address\": {\n \"email\": shippingContact.emailAddress,\n \"telephone\": shippingContact.phoneNumber,\n \"firstname\": shippingContact.givenName,\n \"lastname\": shippingContact.familyName,\n \"street\": shippingContact.addressLines,\
2n \"city\": shippingContact.locality,\n \"region\": shippingContact.administrativeArea,\n \"region_id\": this.getRegionId(shippingContact.countryCode.toUpperCase(), shippingContact.administrativeArea),\n \"region_code\": null,\n \"country_id\": shippingContact.countryCode.toUpperCase(),\n \"postcode\": shippingContact.postalCode,\n \"same_as_billing\": 0,\n \"customer_address_id\": 0,\n \"save_in_address_book\": 0\n },\n \"billing_address\": {\n \"email\": shippingContact.emailAddress,\n \"telephone\": shippingContact.phoneNumber,\n \"firstname\": billingContact.givenName,\n \"lastname\": billingContact.familyName,\n \"street\": billingContact.addressLines,\n \"city\": billingContact.locality,\n \"region\": billingContact.administrativeArea,\n \"region_id\": this.getRegionId(billingContact.countryCode.toUpperCase(), billingContact.administrativeArea),\n \"region_code\": null,\n \"country_id\": billingContact.countryCode.toUpperCase(),\n \"postcode\": billingContact.postalCode,\n \"same_as_billing\": 0,\n \"customer_address_id\": 0,\n \"save_in_address_book\": 0\n },\n \"shipping_method_code\": this.shippingMethod ? this.shippingMethods[this.shippingMethod].method_code : '' ,\n \"shipping_carrier_code\": this.shippingMethod ? this.shippingMethods[this.shippingMethod].carrier_code : ''\n }\n };\n\n // Set addresses\n storage.post(\n this.getApiUrl(\"shipping-information\"),\n JSON.stringify(payload)\n ).done(function () {\n // Submit payment information\n let paymentInformation = {\n \"email\": shippingContact.emailAddress,\n \"paymentMethod\": {\n \"method\": \"braintree_applepay\",\n \"additional_data\": {\n \"payment_method_nonce\": nonce\n }\n }\n };\n if (window.checkout && window.checkout.agreementIds) {\n paymentInformation.paymentMethod.extension_attributes = {\n \"agreement_ids\": window.checkout.agreementIds\n };\n }\n storage.post(\n this.getApiUrl(\"payment-information\"),\n JSON.stringify(paymentInformation)\n ).done(function (r) {\n document.location = this.getActionSuccess();\n session.completePayment(ApplePaySession.STATUS_SUCCESS);\n }.bind(this)).fail(function (r) {\n session.completePayment(ApplePaySession.STATUS_FAILURE);\n session.abort();\n alert($t(\"We're unable to take your payment through Apple Pay. Please try an again or use an alternative payment method.\"));\n console.error(\"Braintree ApplePay Unable to take payment\", r);\n return false;\n });\n\n }.bind(this)).fail(function (r) {\n console.error(\"Braintree ApplePay Unable to set shipping information\", r);\n session.completePayment(ApplePaySession.STATUS_INVALID_BILLING_POSTAL_ADDRESS);\n });\n }\n });\n });\n","PayPal_Braintree/js/applepay/implementations/shortcut.js":"/**\n * Braintree Apple Pay mini cart payment method integration.\n **/\ndefine(\n [\n 'uiComponent',\n 'PayPal_Braintree/js/applepay/button',\n 'PayPal_Braintree/js/applepay/api',\n 'mage/translate',\n 'domReady!'\n ],\n function (\n Component,\n button,\n buttonApi,\n $t\n ) {\n 'use strict';\n\n return Component.extend({\n\n defaults: {\n id: null,\n clientToken: null,\n quoteId: 0,\n displayName: null,\n actionSuccess: null,\n grandTotalAmount: 0,\n isLoggedIn: false,\n storeCode: \"default\"\n },\n\n /**\n * @returns {Object}\n */\n initialize: function () {\n this._super();\n if (!this.displayName) {\n this.displayName = $t('Store');\n }\n\n var api = new buttonApi();\n api.setGrandTotalAmount(parseFloat(this.grandTotalAmount).toFixed(2));\n api.setClientToken(this.clientToken);\n api.setDisplayName(this.displayName);\n api.setQuoteId(this.quoteId);\n api.setActionSuccess(this.actionSuccess);\n api.setIsLoggedIn(this.isLoggedIn);\n api.setStoreCode(this.storeCode);\n\n // Attach the button\n button.init(\n document.getElementById(this.id),\
2n api\n );\n\n return this;\n }\n });\n }\n);\n","PayPal_Braintree/js/applepay/implementations/core-checkout/method-applepay.js":"define([\n 'uiComponent',\n 'Magento_Checkout/js/model/payment/renderer-list'\n], function (Component, rendererList) {\n 'use strict';\n\n let config = window.checkoutConfig.payment;\n\n if (config['braintree_applepay'].clientToken) {\n rendererList.push({\n type: 'braintree_applepay',\n component: 'PayPal_Braintree/js/applepay/implementations/core-checkout/method-renderer/applepay'\n });\n }\n\n return Component.extend({});\n});\n","PayPal_Braintree/js/applepay/implementations/core-checkout/method-renderer/applepay.js":"/**\n * Braintree Apple Pay payment method integration.\n **/\ndefine([\n 'Magento_Checkout/js/view/payment/default',\n 'Magento_Checkout/js/model/quote',\n 'PayPal_Braintree/js/applepay/button'\n], function (\n Component,\n quote,\n button\n) {\n 'use strict';\n\n return Component.extend({\n defaults: {\n template: 'PayPal_Braintree/applepay/core-checkout',\n paymentMethodNonce: null,\n grandTotalAmount: 0,\n deviceSupported: button.deviceSupported()\n },\n\n /**\n * Inject the apple pay button into the target element\n */\n getApplePayBtn: function (id) {\n button.init(\n document.getElementById(id),\n this\n );\n },\n\n /**\n * Subscribe to grand totals\n */\n initObservable: function () {\n this._super();\n this.grandTotalAmount = parseFloat(quote.totals()['base_grand_total']).toFixed(2);\n\n quote.totals.subscribe(function () {\n if (this.grandTotalAmount !== quote.totals()['base_grand_total']) {\n this.grandTotalAmount = parseFloat(quote.totals()['base_grand_total']).toFixed(2);\n }\n }.bind(this));\n\n return this;\n },\n\n /**\n * Apple pay place order method\n */\n startPlaceOrder: function (nonce, event, session) {\n this.setPaymentMethodNonce(nonce);\n this.placeOrder();\n\n session.completePayment(ApplePaySession.STATUS_SUCCESS);\n },\n\n /**\n * Save nonce\n */\n setPaymentMethodNonce: function (nonce) {\n this.paymentMethodNonce = nonce;\n },\n\n /**\n * Retrieve the client token\n * @returns null|string\n */\n getClientToken: function () {\n return window.checkoutConfig.payment[this.getCode()].clientToken;\n },\n\n /**\n * Payment request data\n */\n getPaymentRequest: function () {\n return {\n total: {\n label: this.getDisplayName(),\n amount: this.grandTotalAmount\n }\n };\n },\n\n /**\n * Merchant display name\n */\n getDisplayName: function () {\n return window.checkoutConfig.payment[this.getCode()].merchantName;\n },\n\n /**\n * Get data\n * @returns {Object}\n */\n getData: function () {\n var data = {\n 'method': this.getCode(),\n 'additional_data': {\n 'payment_method_nonce': this.paymentMethodNonce\n }\n };\n return data;\n },\n\n /**\n * Return image url for the apple pay mark\n */\n getPaymentMarkSrc: function () {\n return window.checkoutConfig.payment[this.getCode()].paymentMarkSrc;\n }\n });\n});","PayPal_Braintree/js/googlepay/button.js":"/**\n * Braintree Google Pay button\n **/\ndefine(\n [\n 'uiComponent',\n \"knockout\",\n \"jquery\",\n 'Magento_Checkout/js/model/payment/additional-validators',\n 'Magento_CheckoutAgreements/js/view/checkout-agreements',\n 'braintree',\n 'braintreeDataCollector',\n 'braintreeGooglePay',\n 'mage/translate',\n 'googlePayLibrary'\n ],\n function (\n Component,\n ko,\n jQuery,\n additionalValidators,\n checkoutAgreements,\n braintree,\n dataCollector,\n googlePay,\n $t\n ) {\n 'use strict';\n\n return {\n init: function (element, context) {\n\n // No element or context\n if (!element || !context ) {\n return;\n }\n\n // Context must implement these methods\n if (typeof context.getClientToken !== 'function') {\n console.error(\"Braintree GooglePay Context passed does not provide a getClientToken method\", context);\n return;\n }\n if (typeof context.getPaymentRequest !== 'function') {\n console.error(\"Braintree GooglePay Context passed does not provide a getPaymentRequest method\", context);\n return;\n }\n if (typeof context.startPlaceOrder !== 'function') {\n console.error(\"Braintree GooglePay Context passed does not provide a startPlaceOrder method\", context);\n return;\n }\n\n // init google pay object\n var paymentsClient = new google.payments.api.PaymentsClient({\n environment: context.getEnvironment()\n });\n\n // Create a button within the KO element, as google pay can only be instantiated through\n // a valid on click event (ko onclick bind interferes with this).\n var deviceData;\n var button = document.createElement('button');\n button.className = \"braintree-googlepay-button long \" + (context.getBtnColor() == 1 ? 'black' : 'white');\n button.title = $t(\"Buy with Google Pay\");\n\n // init braintree api\n braintree.create({\n authorization: context.getClientToken()\n }, function (clientErr, clientInstance) {\n if (clientErr) {\n console.error('Error creating client:', clientErr);\n return;\n }\n dataCollector.create({\n client: clientInstance\n }, function (dataCollectorErr, dataCollectorInstance) {\n if (dataCollectorErr) {\n return;\n }\n googlePay.create({\n client: clientInstance,\n googlePayVersion: 2\n }, function (googlePayErr, googlePaymentInstance) {\n // No instance\n if (googlePayErr) {\n console.error('Braintree GooglePay Error creating googlePayInstance:', googlePayErr);\n return;\n }\n\n paymentsClient.isReadyToPay({\n apiVersion: 2,\n apiVersionMinor: 0,\n allowedPaymentMethods: googlePaymentInstance.createPaymentDataRequest().allowedPaymentMethods\n }).then(function(response) {\n if (response.result) {\n button.addEventListener('click', function (event) {\n\n var agreements = checkoutAgreements().agreements,\n shouldDisableActions = false;\n\n\n _.each(agreements, function (item, index) {\n if (checkoutAgreements().isAgreementRequired(item)) {\n var inputId = '#agreement_braintree_googlepay_' + item.agreementId,\n inputEl = document.querySelector(inputId);\n\n if (inputEl !== null && !inputEl.checked) {\n shouldDisableActions = true;\n }\n\n }\n });\n\n if (!additionalValidators.validate()) {\n event.preventDefault();\n return false;\n }\n\n if (!shouldDisableActions) {\n event.preventDefault();\n jQuery(\"body\").loader('show');\n var responseData;\n\n var paymentDataRequest = googlePaymentInstance.createPaymentDataRequest(context.getPaymentRequest());\n paymentsClient.loadPaymentData(paymentDataRequest).then(function (paymentData) {\n // Persist the paymentData (shipping address etc)\n responseData = paymentData;\n // Return the braintree nonce promise\n return googlePaymentInstance.parseResponse(paymentData);\n }).then(function (result) {\n context.startPlaceOrder(result.nonce, responseData, dataCollectorInstance.deviceData);\n }).catch(function (err) {\n // Handle errors\n // err = {statusCode: \"CANCELED\"}\n console.error(err);\n jQuery(\"body\").loader('hide');\n });\n }\n });\n\n element.appendChild(button);\n }\n }).catch(function (err) {\n console.error(err);\n jQuery(\"body\").loader('hide');\n });\n });\n });\n });\n }\n };\n }\n);\n","PayPal_Braintree/js/googlepay/api.js":"/**\n * Braintree Google Pay button api\n **/\ndefine([\n 'uiComponent',\n 'mage/translate',\n 'mage/storage',\n 'jquery',\n 'PayPal_Braintree/js/form-builder'\n], function (Component, $t, storage, jQuery, formBuilder) {\n 'use strict';\n\n return Component.extend({\n defaults: {\n clientToken: null,\n merchantId: null,\n currencyCode: null,\n actionSuccess: null,\n amount: null,\n cardTypes: [],\n btnColor: 0\n },\n\n /**\n * Set & get environment\n * \"PRODUCTION\" or \"TEST\"\n */\n setEnvironment: function (value) {\n this.environment = value;\n },\n getEnvironment: function () {\n return this.environment;\n },\n\n /**\n * Set & get api token\n */\n setClientToken: function (value) {\n this.clientToken = value;\n },\n getClientToken: function () {\n return this.clientToken;\n },\n\n /**\n * Set and get display name\n */\n setMerchantId: function (value) {\n this.merchantId = value;\n },\n getMerchantId: function () {\n return this.merchantId;\n },\n\n /**\n * Set and get currency code\n */\n setAmount: function (value) {\n this.amount = parseFloat(value).toFixed(2);\n },\n getAmount: function () {\n return this.amount;
2\n },\n\n /**\n * Set and get currency code\n */\n setCurrencyCode: function (value) {\n this.currencyCode = value;\n },\n getCurrencyCode: function () {\n return this.currencyCode;\n },\n\n /**\n * Set and get success redirection url\n */\n setActionSuccess: function (value) {\n this.actionSuccess = value;\n },\n getActionSuccess: function () {\n return this.actionSuccess;\n },\n\n /**\n * Set and get success redirection url\n */\n setCardTypes: function (value) {\n this.cardTypes = value;\n },\n getCardTypes: function () {\n return this.cardTypes;\n },\n\n /**\n * BTN Color\n */\n setBtnColor: function (value) {\n this.btnColor = value;\n },\n getBtnColor: function () {\n return this.btnColor;\n },\n\n /**\n * Payment request info\n */\n getPaymentRequest: function () {\n var result = {\n transactionInfo: {\n totalPriceStatus: 'ESTIMATED',\n totalPrice: this.getAmount(),\n currencyCode: this.getCurrencyCode()\n },\n allowedPaymentMethods: [\n {\n \"type\": \"CARD\",\n \"parameters\": {\n \"allowedCardNetworks\": this.getCardTypes(),\n \"billingAddressRequired\": true,\n \"billingAddressParameters\": {\n format: 'FULL',\n phoneNumberRequired: true\n },\n },\n\n }\n ],\n shippingAddressRequired: true,\n emailRequired: true,\n };\n\n if (this.getEnvironment() !== \"TEST\") {\n result['merchantId'] = this.getMerchantId();\n }\n\n return result;\n },\n\n /**\n * Place the order\n */\n startPlaceOrder: function (nonce, paymentData, deviceData) {\n var payload = {\n details: {\n shippingAddress: {\n streetAddress: paymentData.shippingAddress.address1 + \"\\n\"\n + paymentData.shippingAddress.address2,\n locality: paymentData.shippingAddress.locality,\n postalCode: paymentData.shippingAddress.postalCode,\n countryCodeAlpha2: paymentData.shippingAddress.countryCode,\n email: paymentData.email,\n name: paymentData.shippingAddress.name,\n telephone: typeof paymentData.shippingAddress.phoneNumber !== 'undefined' ? paymentData.shippingAddress.phoneNumber : '',\n region: typeof paymentData.shippingAddress.administrativeArea !== 'undefined' ? paymentData.shippingAddress.administrativeArea : ''\n },\n billingAddress: {\n streetAddress: paymentData.paymentMethodData.info.billingAddress.address1 + \"\\n\"\n + paymentData.paymentMethodData.info.billingAddress.address2,\n locality: paymentData.paymentMethodData.info.billingAddress.locality,\n postalCode: paymentData.paymentMethodData.info.billingAddress.postalCode,\n countryCodeAlpha2: paymentData.paymentMethodData.info.billingAddress.countryCode,\n email: paymentData.email,\n name: paymentData.paymentMethodData.info.billingAddress.name,\n telephone: typeof paymentData.paymentMethodData.info.billingAddress.phoneNumber !== 'undefined' ? paymentData.paymentMethodData.info.billingAddress.phoneNumber : '',\n region: typeof paymentData.paymentMethodData.info.billingAddress.administrativeArea !== 'undefined' ? paymentData.paymentMethodData.info.billingAddress.administrativeArea : ''\n }\n },\n nonce: nonce,\n deviceData: deviceData,\n };\n\n formBuilder.build({\n action: this.getActionSuccess(),\n fields: {\n result: JSON.stringify(payload)\n }\n }).submit();\n }\n });\n});\n","PayPal_Braintree/js/googlepay/implementations/shortcut.js":"/**\n * Braintree Google Pay mini cart payment method integration.\n **/\ndefine(\n [\n 'uiComponent',\n 'PayPal_Braintree/js/googlepay/button',\n 'PayPal_Braintree/js/googlepay/api',\n 'mage/translate',\n 'domReady!'\n ],\n function (\n Component,\n button,\n buttonApi,\n $t\n ) {\n 'use strict';\n\n return Component.extend({\n\n defaults: {\n id: null,\n clientToken: null,\n merchantId: null,\n currencyCode: null,\n actionSuccess: null,\n amount: null,\n environment: \"TEST\",\n cardType: [],\n btnColor: 0\n },\n\n /**\n * @returns {Object}\n */\n initialize: function () {\n this._super();\n\n var api = new buttonApi();\n api.setEnvironment(this.environment);\n api.setCurrencyCode(this.currencyCode);\n api.setClientToken(this.clientToken);\n api.setMerchantId(this.merchantId);\n api.setActionSuccess(this.actionSuccess);\n api.setAmount(this.amount);\n api.setCardTypes(this.cardTypes)\n api.setBtnColor(this.btnColor);\n\n // Attach the button\n button.init(\n document.getElementById(this.id),\
2n api\n );\n\n return this;\n }\n });\n }\n);\n","PayPal_Braintree/js/googlepay/implementations/core-checkout/method-googlepay.js":"define([\n 'uiComponent',\n 'Magento_Checkout/js/model/payment/renderer-list'\n], function (Component, rendererList) {\n 'use strict';\n\n let config = window.checkoutConfig.payment;\n\n if (config['braintree_googlepay'].clientToken) {\n rendererList.push({\n type: 'braintree_googlepay',\n component: 'PayPal_Braintree/js/googlepay/implementations/core-checkout/method-renderer/googlepay'\n });\n }\n\n return Component.extend({});\n});\n","PayPal_Braintree/js/googlepay/implementations/core-checkout/method-renderer/googlepay.js":"/**\n * Braintree Google Pay payment method integration.\n **/\ndefine([\n 'Magento_Checkout/js/view/payment/default',\n 'Magento_Checkout/js/model/quote',\n 'PayPal_Braintree/js/googlepay/button'\n], function (\n Component,\n quote,\n button\n) {\n 'use strict';\n\n return Component.extend({\n defaults: {\n template: 'PayPal_Braintree/googlepay/core-checkout',\n paymentMethodNonce: null,\n deviceData: null,\n grandTotalAmount: 0\n },\n\n /**\n * Inject the google pay button into the target element\n */\n getGooglePayBtn: function (id) {\n button.init(\n document.getElementById(id),\n this\n );\n },\n\n /**\n * Subscribe to grand totals\n */\n initObservable: function () {\n this._super();\n this.grandTotalAmount = parseFloat(quote.totals()['base_grand_total']).toFixed(2);\n this.currencyCode = quote.totals()['base_currency_code'];\n\n quote.totals.subscribe(function () {\n if (this.grandTotalAmount !== quote.totals()['base_grand_total']) {\n this.grandTotalAmount = parseFloat(quote.totals()['base_grand_total']).toFixed(2);\n }\n }.bind(this));\n\n return this;\n },\n\n /**\n * Google pay place order method\n */\n startPlaceOrder: function (nonce, paymentData, device_data) {\n this.setPaymentMethodNonce(nonce);\n this.setDeviceData(device_data);\n this.placeOrder();\n },\n\n /**\n * Save nonce\n */\n setPaymentMethodNonce: function (nonce) {\n this.paymentMethodNonce = nonce;\n },\n\n /**\n * Save device_data\n */\n setDeviceData: function (device_data) {\n this.deviceData = device_data;\n },\n\n /**\n * Retrieve the client token\n * @returns null|string\n */\n getClientToken: function () {\n return window.checkoutConfig.payment[this.getCode()].clientToken;\n },\n\n /**\n * Payment request info\n */\n getPaymentRequest: function () {\n var result = {\n transactionInfo: {\n totalPriceStatus: 'FINAL',\n totalPrice: this.grandTotalAmount,\n currencyCode: this.currencyCode\n },\n allowedPaymentMethods: [\n {\n \"type\": \"CARD\",\n \"parameters\": {\n \"allowedCardNetworks\": this.getCardTypes(),\n \"billingAddressRequired\": false,\n },\n\n }\n ],\n shippingAddressRequired: false,\n emailRequired: false,\n };\n\n if (this.getEnvironment() !== \"TEST\") {\n result['merchantId'] = this.getMerchantId();\n }\n\n return result;\n },\n\n /**\n * Merchant display name\n */\n getMerchantId: function () {\n return window.checkoutConfig.payment[this.getCode()].merchantId;\n },\n\n /**\n * Environment\n */\n getEnvironment: function () {\n return window.checkoutConfig.payment[this.getCode()].environment;\n },\n\n /**\n * Card Types\n */\n getCardTypes: function () {\n return window.checkoutConfig.payment[this.getCode()].cardTypes;\n },\n\n /**\n * BTN Color\n */\n getBtnColor: function () {\n return window.checkoutConfig.payment[this.getCode()].bt
2nColor;\n },\n\n /**\n * Get data\n * @returns {Object}\n */\n getData: function () {\n return {\n 'method': this.getCode(),\n 'additional_data': {\n 'payment_method_nonce': this.paymentMethodNonce,\n 'device_data': this.deviceData\n }\n };\n },\n\n /**\n * Return image url for the google pay mark\n */\n getPaymentMarkSrc: function () {\n return window.checkoutConfig.payment[this.getCode()].paymentMarkSrc;\n }\n });\n});\n","PayPal_Braintree/js/view/product-page.js":"define(\n ['uiComponent'],\n function (Component) {\n 'use strict';\n\n return Component.extend({\n\n });\n }\n);","PayPal_Braintree/js/view/payment/lpm.js":"define(\n [\n 'uiComponent',\n 'Magento_Checkout/js/model/payment/renderer-list'\n ],\n function (\n Component,\n rendererList\n ) {\n 'use strict';\n\n rendererList.push(\n {\n type: 'braintree_local_payment',\n component: 'PayPal_Braintree/js/view/payment/method-renderer/lpm'\n }\n );\n\n return Component.extend({});\n }\n);\n","PayPal_Braintree/js/view/payment/3d-secure.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n/*browser:true*/\n/*global define*/\n\ndefine([\n 'jquery',\n 'PayPal_Braintree/js/view/payment/adapter',\n 'Magento_Checkout/js/model/quote',\n 'mage/translate',\n 'braintreeThreeDSecure',\n 'Magento_Checkout/js/model/full-screen-loader',\n 'PayPal_Braintree/js/helper/remove-non-digit-characters'\n], function (\n $,\n braintree,\n quote,\n $t,\n threeDSecure,\n fullScreenLoader,\n removeNonDigitCharacters\n) {\n 'use strict';\n\n return {\n config: null,\n\n /**\n * Set 3d secure config\n * @param {Object} config\n */\n setConfig: function (config) {\n this.config = config;\n this.config.thresholdAmount = parseFloat(config.thresholdAmount);\n },\n\n /**\n * Get code\n * @returns {String}\n */\n getCode: function () {\n return 'three_d_secure';\n },\n\n /**\n * Check billing/shipping address line lengths\n *\n * @param errorMessage\n * @param billingAddress\n * @param shippingAddress\n * @returns {*}\n */\n checkBillingLineLengths: function (errorMessage, billingAddress, shippingAddress) {\n let lineError = null;\n\n if (billingAddress.street[0].length > 50 ||\n (shippingAddress.street !== undefined && shippingAddress.street[0].length > 50)) {\n lineError = 'line1';\n } else if (billingAddress.street[1].length > 50 ||\n (shippingAddress.street !== undefined && shippingAddress.street[1].length > 50)) {\n lineError = 'line2';\n }\n\n if (lineError) {\n let error = `Billing/Shipping ${lineError} must be string and less than 50 characters.`;\n\n return $t(`${error} Please update the address and try again.`);\n }\n },\n\n /**\n * Validate Braintree payment nonce\n *\n * @param {Object} context\n * @returns {Object}\n */\n validate: function (context) {\n let self = this,\n clientInstance = braintree.getApiClient(),\n state = $.Deferred(),\n totalAmount = parseFloat(quote.totals()['base_grand_total']).toFixed(2),\n billingAddress = quote.billingAddress(),\n shippingAddress = quote.shippingAddress(),\n setup3d;\n\n // Handle billing address region code\n if (billingAddress.regionCode == null) {\n billingAddress.regionCode = undefined;\n }\n if (billingAddress.regionCode !== undefined && billingAddress.regionCode.length > 2) {\n billingAddress.regionCode = undefined;\n }
2\n\n // Handle shipping address region code\n if (!quote.isVirtual() && shippingAddress !== null) {\n if (shippingAddress.regionCode == null) {\n shippingAddress.regionCode = undefined;\n }\n if (shippingAddress.regionCode !== undefined && shippingAddress.regionCode.length > 2) {\n shippingAddress.regionCode = undefined;\n }\n }\n\n // No 3d secure if using CVV verification on vaulted cards\n if (quote.paymentMethod().method.indexOf('braintree_cc_vault_') !== -1) {\n if (this.config.useCvvVault === true) {\n state.resolve();\n return state.promise();\n }\n }\n\n if (!this.isAmountAvailable(totalAmount) || !this.isCountryAvailable(billingAddress.countryId)) {\n state.resolve();\n return state.promise();\n }\n\n fullScreenLoader.startLoader();\n\n setup3d = function(clientInstance) {\n threeDSecure.create({\n version: 2,\n client: clientInstance\n }, function (threeDSecureErr, threeDSecureInstance) {\n if (threeDSecureErr) {\n fullScreenLoader.stopLoader();\n return state.reject($t('Please try again with another form of payment.'));\n }\n\n let threeDSContainer = document.createElement('div'),\n tdMask = document.createElement('div'),\n tdFrame = document.createElement('div'),\n tdBody = document.createElement('div'),\n threeDSecureParameters;\n\n threeDSContainer.id = 'braintree-three-d-modal';\n tdMask.className =\"bt-mask\";\n tdFrame.className =\"bt-modal-frame\";\n tdBody.className =\"bt-modal-body\";\n\n tdFrame.appendChild(tdBody);\n threeDSContainer.appendChild(tdMask);\n threeDSContainer.appendChild(tdFrame);\n\n threeDSecureParameters = {\n amount: totalAmount,\n nonce: context.paymentMethodNonce,\n bin: context.creditCardBin,\n collectDeviceData: true,\n challengeRequested: self.getChallengeRequested(),\n billingAddress: {\n givenName: b
2illingAddress.firstname,\n surname: billingAddress.lastname,\n phoneNumber: billingAddress.telephone !== null\n ? removeNonDigitCharacters(billingAddress.telephone)\n : billingAddress.telephone,\n streetAddress: billingAddress.street[0],\n extendedAddress: billingAddress.street[1],\n locality: billingAddress.city,\n region: billingAddress.regionCode,\n postalCode: billingAddress.postcode,\n countryCodeAlpha2: billingAddress.countryId\n },\n additionalInformation: {\n ipAddress: self.getIpAddress()\n },\n onLookupComplete: function (data, next) {\n next();\n },\n addFrame: function (err, iframe) {\n fullScreenLoader.stopLoader();\n\n if (err) {\n console.log(\"Unable to verify card over 3D Secure\", err);\n return state.reject($t('Please try again with another form of payment.'));\n }\n\n tdBody.appendChild(iframe);\n document.body.appendChild(threeDSContainer);\n },\n removeFrame: function () {\n fullScreenLoader.startLoader();\n document.body.removeChild(threeDSContainer);\n }\n };\n\n if (context.hasOwnProperty('email') && context.email !== null) {\n threeDSecureParameters.email = context.email;\n }\n\n if (!quote.isVirtual() && shippingAddress !== null) {\n threeDSecureParameters.additionalInformation = {\n shippingGivenName: shippingAddress.firstname,\n shippingSurname: shippingAddress.lastname,\n shippingAddress: {\n streetAddress: shippingAddress.street[0],\n extendedAddress: shippingAddress.street[1],\n locality: shippingAddress.city,\n region: shippingAddress.regionCode,\n postalCode: shippingAddress.postcode,\n countryCodeAlpha2: shippingAddress.countryId\n },\n shippingPhone: shippingAddress.telep
2hone !== null\n ? removeNonDigitCharacters(shippingAddress.telephone)\n : shippingAddress.telephone,\n ipAddress: threeDSecureParameters.additionalInformation.ipAddress\n }\n }\n\n threeDSecureInstance.verifyCard(threeDSecureParameters, function (err, response) {\n fullScreenLoader.stopLoader();\n\n if (err) {\n console.error('3DSecure validation failed', err);\n if (err.code === 'THREEDS_LOOKUP_VALIDATION_ERROR') {\n let errorMessage = err.details.originalError.details.originalError.error.message,\n error = self.checkBillingLineLengths(errorMessage, billingAddress, shippingAddress);\n\n return error ? state.reject(error) : state.reject($t(errorMessage));\n }\n\n return state.reject($t('Please try again with another form of payment.'));\n }\n\n let liability = {\n shifted: response.liabilityShifted,\n shiftPossible: response.liabilityShiftPossible\n };\n\n if (liability.shifted || !liability.shifted && !liability.shiftPossible) {\n context.paymentMethodNonce = response.nonce;\n state.resolve();\n } else {\n state.reject($t('Please try again with another form of payment.'));\n }\n });\n\n // When customer cancel 3d secure popup, invalidate the re-captcha v2.\n let isReCaptchaEnabled = window.checkoutConfig.recaptcha_braintree;\n if (isReCaptchaEnabled) {\n let recaptchaCheckBox = $(\"#recaptcha-checkout-braintree-wrapper input[name='recaptcha-validate-']\");\n\n threeDSecureInstance.on('customer-canceled', function () {\n if (recaptchaCheckBox.prop('checked') === true) {\n recaptchaCheckBox.prop('checked', false);\n }\n });\n }\n });\n };\n\n if (!clientInstance) {\n require(['PayPal_Braintree/js/view/payment/method-renderer/cc-form'], function (c) {\n let config = c.extend({\n defaults: {\n clientConfig: {\n onReady: function () {}\n }\n }\n });\n braintree.setConfig(config.defaults.clientConfig);\n braintree.setup(setup3d);\n });\n } else {\n setup3d(clientInstance);\n }\n\n return state.promise();\n },\n\n /**\n * Check minimal amount for 3d secure activation\n * @param {Number} amount\n * @returns {Boolean}\n */\n isAmountAvailable: function (amount) {\n amount = parseFloat(amount.toString());\n\n return amount >= this.config.thresholdAmount;\n },\n\n /**\n * Check if current country is available for 3d secure\n * @param {String} countryId\n * @returns {Boolean}\n */\n isCountryAvailable: function (countryId) {\n let key,\n specificCountries = this.config.specificCountries;\n\n // all countries are available\n if (!specificCountries.length) {\n return true;\n }\n\n for (key in specificCountries) {\n if (countryId === specificCountries[key]) {\n return true;\n }\n }\n\n return false;\n },\n\n /**\n * @returns {Boolean}\n */\n getChallengeRequested: function () {\n return this.config.challengeRequested;\n },\n\n /**\n * Get the Customer's IP Address\n *\n * @returns {*}\n */\n getIpAddress: function () {\n return this.config.ipAddress;\n }\n };\n});\n","PayPal_Braintree/js/view/payment/venmo.js":"define(\n [\n 'uiComponent',\n 'Magento_Checkout/js/model/payment/renderer-list'\n ],\n function (\n Component,\n rendererList\n ) {\n 'use strict';\n\n rendererList.push(\n {\n type: 'braintree_venmo',\n component: 'PayPal_Braintree/js/view/payment/method-renderer/venmo'\n }\n );\n\n return Component.extend({});\n }\n);\n","PayPal_Braintree/js/view/payment/adapter.js":"/**\n * Copyright 2013-2017 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n/*browser:true*/\n/*global define*/\ndefine([\n 'jquery',\n 'braintree',\n 'braintreeDataCollector',\n 'braintreeHostedFields',\n 'Magento_Checkout/js/model/full-screen-loader',\n 'Magento_Ui/js/model/messageList',\n 'mage/translate'\n], function ($, client, dataCollector, hostedFields, fullScreenLoader, globalMessageList, $t) {\n 'use strict';\n\n return {\n apiClient: null,\n config: {},\n checkout: null,\n deviceData: null,\n clientInstance: null,\n hostedFieldsInstance: null,\n paypalInstance: null,\n code: 'braintree',\n\n /**\n * {Object}\n */\n events: {\n onClick: null,\n onCancel: null,\n onError: null\n },\n\n /**\n * Get Braintree api client\n * @returns {Object}\n */\n getApiClient: function () {\n return this.clientInstance;\n },\n\n /**\n * Set configuration\n * @param {Object} config\n */\n setConfig: function (config) {\n this.config = config;\n },\n\n /**\n * Get payment name\n * @returns {String}\n */\n getCode: function () {\n return this.co
2de;\n },\n\n /**\n * Get client token\n * @returns {String|*}\n */\n getClientToken: function () {\n return window.checkoutConfig.payment[this.getCode()].clientToken;\n },\n\n /**\n * @returns {String}\n */\n getEnvironment: function () {\n return window.checkoutConfig.payment[this.getCode()].environment;\n },\n\n /**\n * @returns {String}\n */\n getColor: function () {\n return window.checkoutConfig.payment[this.getCode()].style.color;\n },\n\n /**\n * @returns {String}\n */\n getShape: function () {\n return window.checkoutConfig.payment[this.getCode()].style.shape;\n },\n\n /**\n * @returns {String}\n */\n getLayout: function () {\n return window.checkoutConfig.payment[this.getCode()].style.layout;\n },\n\n /**\n * @returns {String}\n */\n getSize: function () {\n return window.checkoutConfig.payment[this.getCode()].style.size;\n },\n\n /**\n * @returns {String}\n */\n getLabel: function () {\n return null;\n },\n\n /**\n * @returns {String}\n */\n getBranding: function () {\n return null;\n },\n\n /**\n * @returns {String}\n */\n getFundingIcons: function () {\n return null;\n },\n\n /**\n * @returns {String}\n */\n getDisabledFunding: function () {\n return window.checkoutConfig.payment[this.getCode()].disabledFunding;\n },\n\n /**\n * Show error message\n *\n * @param {String} errorMessage\n */\n showError: function (errorMessage) {\n globalMessageList.addErrorMessage({\n message: errorMessage\n });\n fullScreenLoader.stopLoader(true);\n },\n\n /**\n * Disable submit button\n */\n disableButton: function () {\n // stop any previous shown loaders\n fullScreenLoader.stopLoader(true);\n fullScreenLoader.startLoader();\n $('[data-button=\"place\"]').attr('disabled', 'disabled');\n },\n\n /**\n * Enable submit button\n */\n enableButton: function () {\n $('[data-button=\"place\"]').removeAttr('disabled');\n fullScreenLoader.stopLoader();\n },\n\n /**\n * Has PayPal been init'd already\n */\n getPayPalInstance: function() {\n if (typeof this.config.paypalInstance !== 'undefined' && this.config.paypalInstance) {\n return this.config.paypalInstance;\n }\n\n return null;\n },\n\n setPayPalInstance: function(val) {\n this.config.paypalInstance = val;\n },\n\n /**\n * Setup Braintree SDK\n */\n setup: function (callback) {\n if (!this.getClientToken()) {\n this.showError($t('Sorry, but something went wrong.'));\n return;\n }\n\n if (this.clientInstance) {\n if (typeof this.config.onReady === 'function') {\n this.config.onReady(this);\n }\n\n if (typeof callback === \"function\") {\n callback(this.clientInstance);\n }\n return;\n }\n\n client.create({\n authorization: this.getClientToken()\n }, function (clientErr, clientInstance) {\n if (clientErr) {\n console.error('Braintree Setup Error', clientErr);\n return this.showError(\"Sorry, but something went wrong. Please contact the store owner.\");\n }\n\n var options = {\n client: clientInstance\n };\n\n if (typeof this.config.dataCollector === 'object' && typeof this.config.dataCollector.paypal === 'boolean') {\n options.paypal = true;\n }
2 else {\n options.kount = true;\n }\n\n dataCollector.create(options, function (err, dataCollectorInstance) {\n if (err) {\n return console.log(err);\n }\n\n this.deviceData = dataCollectorInstance.deviceData;\n this.config.onDeviceDataReceived(this.deviceData);\n }.bind(this));\n\n this.clientInstance = clientInstance;\n\n if (typeof this.config.onReady === 'function') {\n this.config.onReady(this);\n }\n\n if (typeof callback === \"function\") {\n callback(this.clientInstance);\n }\n }.bind(this));\n },\n\n /**\n * Setup hosted fields instance\n */\n setupHostedFields: function () {\n var self = this;\n\n if (this.hostedFieldsInstance) {\n this.hostedFieldsInstance.teardown(function () {\n this.hostedFieldsInstance = null;\n this.setupHostedFields();\n }.bind(this));\n return;\n }\n\n hostedFields.create({\n client: this.clientInstance,\n fields: this.config.hostedFields,\n styles: {\n \"input\": {\n \"font-size\": \"14pt\",\n \"color\": \"#3A3A3A\"\n },\n \":focus\": {\n \"color\": \"black\"\n },\n \".valid\": {\n \"color\": \"green\"\n },\n \".invalid\": {\n \"color\": \"red\"\n }\n }\n }, function (createErr, hostedFieldsInstance) {\n if (createErr) {\n self.showError($t(\"Braintree hosted fields could not be initialized. Please contact the store owner.\"));\n console.error('Braintree hosted fields error', createErr);\n return;\n }\n\n this.config.onInstanceReady(hostedFieldsInstance);\n this.hostedFieldsInstance = hostedFieldsInstance;\n }.bind(this));\n },\n\n tokenizeHostedFields: function () {\n this.hostedFieldsInstance.tokenize({}, function (tokenizeErr, payload) {\n if (tokenizeErr) {\n switch (tokenizeErr.code) {\n case 'HOSTED_FIELDS_FIELDS_EMPTY':\n // occurs when none of the fields are filled in\n console.error('All fields are empty! Please fill out the form.');\n break;\n case 'HOSTED_FIELDS_FIELDS_INVALID':\n // occurs when certain fields do not pass client side validation\n console.error('Some fields are invalid:', tokenizeErr.details.invalidFieldKeys);\n break;\n case 'HOSTED_FIELDS_TOKENIZATION_FAIL_ON_DUPLICATE':\n // occurs when:\n // * the client token used for client authorization was generated\n // with a customer ID and the fail on duplicate payment method\n // option is set to true\n // * the card being tokenized has previously been vaulted (with any customer)\n // See: https://developers.braintreepayments.com/reference/request/client-token/generate/#options.fail_on_duplicate_payment_method\n console.error('This payment method already exists in your vault.');\n break;\n case 'HOSTED_FIELDS_TOKENIZATION_CVV_VERIFICATION_FAILED':\n // occurs when:\n // * the client token used for client authorization was generated\n // with a customer ID and the verify card option is set to true\n // and you have credit card verification turned on in the Braintree\n // control panel\n // * the cvv does not pass verfication (https://developers.braintreepayments.com/reference/general/testing/#avs-and-cvv/cid-responses)\n // See: https://developers.braintreepayments.com/reference/request/client-token/generate/#options.verify_card\n console.error('CVV did not pass verification');\n break;\n case 'HOSTED_FIELDS_FAILED_TOKENIZATION':\n // occurs for any other tokenization error on the server\n console.error('Tokenization failed server side. Is the card valid?');\n break;\n case 'HOSTED_FIELDS_TOKENIZATION_NETWORK_E
2RROR':\n // occurs when the Braintree gateway cannot be contacted\n console.error('Network error occurred when tokenizing.');\n break;\n default:\n console.error('Something bad happened!', tokenizeErr);\n }\n } else {\n this.config.onPaymentMethodReceived(payload);\n }\n }.bind(this));\n }\n };\n});\n\n","PayPal_Braintree/js/view/payment/ach.js":"define(\n [\n 'uiComponent',\n 'Magento_Checkout/js/model/payment/renderer-list'\n ],\n function (\n Component,\n rendererList\n ) {\n 'use strict';\n\n rendererList.push(\n {\n type: 'braintree_ach_direct_debit',\n component: 'PayPal_Braintree/js/view/payment/method-renderer/ach'\n }\n );\n\n return Component.extend({});\n }\n);\n","PayPal_Braintree/js/view/payment/braintree.js":"/**\n * Copyright \u00a9 2013-2017 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n/*browser:true*/\n/*global define*/\ndefine([\n 'uiComponent',\n 'Magento_Checkout/js/model/payment/renderer-list'\n], function (Component, rendererList) {\n 'use strict';\n\n let config = window.checkoutConfig.payment,\n braintreeType = 'braintree',\n payPalType = 'braintree_paypal',\n braintreeAchDirectDebit = 'braintree_ach_direct_debit',\n braintreeVenmo = 'braintree_venmo',\n braintreeLocalPayment = 'braintree_local_payment';\n\n if (config[braintreeType] && config[braintreeType].isActive && config[braintreeType].clientToken) {\n rendererList.push({\n type: braintreeType,\n component: 'PayPal_Braintree/js/view/payment/method-renderer/hosted-fields'\n });\n }\n\n if (config[payPalType] && config[payPalType].isActive) {\n rendererList.push({\n type: payPalType,\n component: 'PayPal_Braintree/js/view/payment/method-renderer/paypal'\n });\n }\n\n if (config[braintreeVenmo] && config[braintreeVenmo].isAllowed && config[braintreeVenmo].clientToken) {\n rendererList.push({\n type: braintreeVenmo,\n component: 'PayPal_Braintree/js/view/payment/method-renderer/venmo'\n });\n }\n\n if (config[braintreeAchDirectDebit] && config[braintreeAchDirectDebit].isActive && config[braintreeAchDirectDebit].clientToken) {\n rendererList.push({\n type: braintreeAchDirectDebit,\n component: 'PayPal_Braintree/js/view/payment/method-renderer/ach'\n });\n }\n\n if (config[braintreeLocalPayment] && config[braintreeLocalPayment].clientToken) {\n rendererList.push({\n type: braintreeLocalPayment,\n component: 'PayPal_Braintree/js/view/payment/method-renderer/lpm'\n });\n }\n\n /** Add view logic here if needed */\n return Component.extend({});\n});\n","PayPal_Braintree/js/view/payment/validator-handler.js":"/**\n * Copyright 2013-2017 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n/*browser:true*/\n/*global define*/\n\ndefine([\n 'jquery',\n 'Magento_Ui/js/model/messageList',\n 'PayPal_Braintree/js/view/payment/3d-secure',\n 'Magento_Checkout/js/model/full-screen-loader'\n], function ($, globalMessageList, verify3DSecure, fullScreenLoader) {\n 'use strict';\n\n return {\n validators: [],\n\n /**\n * Get payment config\n * @returns {Object}\n */\n getConfig: function () {\n return window.checkoutConfig.payment;\n },\n\n /**\n * Init list of validators\n */\n initialize: function () {\n var config = this.getConfig();\n\n if (config[verify3DSecure.getCode()].enabled) {\n verify3DSecure.setConfig(config[verify3DSecure.getCode()]);
2\n this.add(verify3DSecure);\n }\n },\n\n /**\n * Add new validator\n * @param {Object} validator\n */\n add: function (validator) {\n this.validators.push(validator);\n },\n\n /**\n * Run pull of validators\n * @param {Object} context\n * @param {Function} callback\n */\n validate: function (context, callback, errorCallback) {\n var self = this,\n deferred;\n\n // no available validators\n if (!self.validators.length) {\n callback();\n\n return;\n }\n\n // get list of deferred validators\n deferred = $.map(self.validators, function (current) {\n return current.validate(context);\n });\n\n $.when.apply($, deferred)\n .done(function () {\n callback();\n }).fail(function (error) {\n errorCallback();\n self.showError(error);\n });\n },\n\n /**\n * Show error message\n * @param {String} errorMessage\n */\n showError: function (errorMessage) {\n globalMessageList.addErrorMessage({\n message: errorMessage\n });\n fullScreenLoader.stopLoader(true);\n }\n };\n});\n","PayPal_Braintree/js/view/payment/method-renderer/lpm.js":"define(\n [\n 'Magento_Checkout/js/view/payment/default',\n 'ko',\n 'jquery',\n 'braintree',\n 'braintreeLpm',\n 'PayPal_Braintree/js/form-builder',\n 'Magento_Ui/js/model/messageList',\n 'Magento_Checkout/js/action/select-billing-address',\n 'Magento_Checkout/js/model/full-screen-loader',\n 'Magento_Checkout/js/model/quote',\n 'Magento_Checkout/js/model/payment/additional-validators',\n 'mage/url',\n 'mage/translate'\n ],\n function (\n Component,\n ko,\n $,\n braintree,\n lpm,\n formBuilder,\n messageList,\n selectBillingAddress,\n fullScreenLoader,\n quote,\n additionalValidators,\n url,\n $t\n ) {\n 'use strict';\n\n return Component.extend({\n defaults: {\n code: 'braintree_local_payment',\n paymentMethodsAvailable: ko.observable(false),\n paymentMethodNonce: null,\n template: 'PayPal_Braintree/payment/lpm'\n },\n\n clickPaymentBtn: function (method) {\n var self = this;\n\n if (additionalValidators.validate()) {\n fullScreenLoader.startLoader();\n\n braintree.create({\n authorization: self.getClientToken()\n }, function (clientError, clientInstance) {\n if (clientError) {\n self.setErrorMsg($t('Unable to initialize Braintree Client.'));\n fullScreenLoader.stopLoader();\n return;\n }\n\n lpm.create({\n client: clientInstance,\n merchantAccountId: self.getMerchantAccountId()\n }, function (lpmError, lpmInstance) {\n if (lpmError) {\n self.setErrorMsg(lpmError);\n fullScreenLoader.stopLoader();\n return;\n }\n\n lpmInstance.startPayment({\n amount: self.getAmount(),\n currencyCode: self.getCurrencyCode(),\n email: self.getCustomerDetails().email,\n phone: self.getCustomerDetails().phone,\n givenName: self.getCustomerDetails().firstName,\n surname: self.getCustomerDetails().lastName,\n shippingAddressRequired: !quote.isVirtual(),\n address: self.getAddress(),\n paymentType: method,\n onPaymentStart: function (data, start) {\n start();\n },\n // This is a required option, however it will apparently never be used in the current payment flow.\n // Therefore, both values are set to allow the payment flow to continute, rather than erroring out.\n fallback: {\n url: 'N/A',\n buttonText: 'N/A'\n }\n }, function (startPaymentError, payload) {\n fullScreenLoader.stopLoader();\n if (startPaymentError) {\n switch (startPaymentError.code) {\n case 'LOCAL_PAYMENT_POPUP_CLOSED':\n self.setErrorMsg($t('Local Payment popup was closed unexpectedly.'));\n break;\n case 'LOCAL_PAYMENT_WINDOW_OPEN_FAILED':\n self.setErrorMsg($t('Local Payment popup failed to open.'));\n break;\n case 'LOCAL_PAYMENT_WINDOW_CLOSED':\n self.setErrorMsg($t('Local Payment popup was closed. Payment cancelled.'));\n break;\n default:\n self.setErrorMsg('Error! ' + startPaymentError);\n break;\n }\n } else {\n // Send the nonce to your server to create a transaction\n self.setPaymentMethodNonce(payload.nonce);\n self.placeOrder();\n }\n });\n });\n });\n }\n },\n\n getAddress: function () {\n var shippingAddress = quote.shippingAddress();\n\n if (quote.isVirtual()) {\n return {\n countryCode: shippingAddress.countryId\n }\n }\n\n return {\n streetAddress: shippingAddress.street[0],\n extendedAddress: shippingAddress.street[1],\n locality: shippingAddress.city,\n postalCode: shippingAddress.postcode,\n region: shippingAddress.region,\n countryCode: shippingAddress.countryId\n }\n },\n\n getAmount: function () {\n return quote.totals()['base_grand_total'].toString();\n },\n\n getBillingAddress: function () {\n return quote.billingAddress();\n },\n\n getClientToken: function () {\n return window.checkoutConfig.payment[this.getCode()].clientToken;\n },\n\n getCode: function () {\n return this.co
2de;\n },\n\n getCurrencyCode: function () {\n return quote.totals()['base_currency_code'];\n },\n\n getCustomerDetails: function () {\n var billingAddress = quote.billingAddress();\n return {\n firstName: billingAddress.firstname,\n lastName: billingAddress.lastname,\n phone: billingAddress.telephone,\n email: typeof quote.guestEmail === 'string' ? quote.guestEmail : window.checkoutConfig.customerData.email\n }\n },\n\n getData: function () {\n let data = {\n 'method': this.getCode(),\n 'additional_data': {\n 'payment_method_nonce': this.paymentMethodNonce,\n }\n };\n\n data['additional_data'] = _.extend(data['additional_data'], this.additionalData);\n\n return data;\n },\n\n getMerchantAccountId: function () {\n return window.checkoutConfig.payment[this.getCode()].merchantAccountId;\n },\n\n getPaymentMethod: function (method) {\n var methods = this.getPaymentMethods();\n\n for (var i = 0; i < methods.length; i++) {\n if (methods[i].method === method) {\n return methods[i]\n }\n }\n },\n\n getPaymentMethods: function () {\n return window.checkoutConfig.payment[this.getCode()].allowedMethods;\n },\n\n getPaymentMarkSrc: function () {\n return window.checkoutConfig.payment[this.getCode()].paymentIcons;\n },\n\n getTitle: function () {\n return window.checkoutConfig.payment[this.getCode()].title;\n },\n\n initialize: function () {\n this._super();\n return this;\n },\n\n isActive: function () {\n var address = quote.billingAddress() || quote.shippingAddress();\n var methods = this.getPaymentMethods();\n\n for (var i = 0; i < methods.length; i++) {\n if (methods[i].countries.includes(address.countryId)) {\n return true;\n }\n }\n\n return false;\n },\n\n isValidCountryAndCurrency: function (method) {\n var address = quote.billingAddress();\n\n if (!address) {\n this.paymentMethodsAvailable(false);\n return false;\n }\n\n var countryId = address.countryId;\n var quoteCurrency = quote.totals()['base_currency_code'];\n var paymentMethodDetails = this.getPaymentMethod(method);\n\n if ((countryId !== 'GB' && paymentMethodDetails.countries.includes(countryId) && (quoteCurrency === 'EUR' || quoteCurrency === 'PLN')) || (countryId === 'GB' && paymentMethodDetails.countries.includes(countryId) && quoteCurrency === 'GBP')) {\n this.paymentMethodsAvailable(true);\n return true;\n }\n\n return false;\n },\n\n setErrorMsg: function (message) {\n messageList.addErrorMessage({\n message: message\n });\n },\n\n setPaymentMethodNonce: function (nonce) {\n this.paymentMethodNonce = nonce;\n },\n\n validateForm: function (form) {\n return $(form).validation() && $(form).validation('isValid');\n }\n });\n }\n);\n","PayPal_Braintree/js/view/payment/method-renderer/venmo.js":"define(\n [\n 'Magento_Checkout/js/view/payment/default',\n 'braintree',\n 'braintreeDataCollector',\n 'braintreeVenmo',\n 'PayPal_Braintree/js/form-builder',\n 'Magento_Ui/js/model/messageList',\n 'Magento_Checkout/js/model/full-screen-loader',\n 'Magento_Checkout/js/model/payment/additional-validators',\n 'mage/translate'\n ],\n function (\n Component,\n braintree,\n dataCollector,\n venmo,\n formBuilder,\n messageList,\n fullScreenLoader,\n additionalValidators,\n $t\n ) {\n 'use strict';\n\n return Component.extend({\n defaults: {\n deviceData: null,\n paymentMethodNonce: null,\n template: 'PayPal_Braintree/payment/venmo',\n venmoInstance: null\n },\n\n clickVenmoBtn: function () {\n let self = this;\n\n if (!additionalValidators.validate()) {\n return false;\n }\n\n if (!this.venmoInstance) {\n this.setErrorMsg($t('Venmo not initialized, please try reloading.'));\n return;\n }\n\n this.venmoInstance.tokenize(function (tokenizeErr, payload) {\n if (tokenizeErr) {\n if (tokenizeErr.code === 'VENMO_CANCELED') {\n self.setErrorMsg($t('Venmo app is not available or the payment flow was cancelled.'));\n } else if (tokenizeErr.code === 'VENMO_APP_CANCELED') {\n self.setErrorMsg($t('Venmo payment flow cancelled.'));\n } else {\n self.setErrorMsg(tokenizeErr.message);\n }\n } else {\n self.handleVenmoSuccess(payload);\n }\n });\n },\n\n collectDeviceData: function (clientInstance, callback) {\n let self = this;\n dataCollector.create({\n client: clientInstance,\n paypal: true\n }, function (dataCollectorErr, dataCollectorInstance) {\n if (dataCollectorErr) {\n return;\n }\n self.deviceData = dataCollectorInstance.deviceData;\n callback();\n });\n },\n\n getClientToken: function () {\n return window.checkoutConfig.payment[this.getCode()].clientToken;\n }
2,\n\n getCode: function() {\n return 'braintree_venmo';\n },\n\n getData: function () {\n let data = {\n 'method': this.getCode(),\n 'additional_data': {\n 'payment_method_nonce': this.paymentMethodNonce,\n 'device_data': this.deviceData\n }\n };\n\n data['additional_data'] = _.extend(data['additional_data'], this.additionalData);\n\n return data;\n },\n\n getPaymentMarkSrc: function () {\n return window.checkoutConfig.payment[this.getCode()].paymentMarkSrc;\n },\n\n getTitle: function() {\n return 'Venmo';\n },\n\n handleVenmoSuccess: function (payload) {\n this.setPaymentMethodNonce(payload.nonce);\n this.placeOrder();\n },\n\n initialize: function () {\n this._super();\n\n let self = this;\n\n braintree.create({\n authorization: self.getClientToken()\n }, function (clientError, clientInstance) {\n if (clientError) {\n this.setErrorMsg($t('Unable to initialize Braintree Client.'));\n return;\n }\n\n // Collect device data\n self.collectDeviceData(clientInstance, function () {\n // callback from collectDeviceData\n venmo.create({\n client: clientInstance,\n allowDesktop: true,\n allowDesktopWebLogin: true,\n mobileWebFallBack: true,\n paymentMethodUsage: 'single_use',\n allowNewBrowserTab: false\n }, function (venmoErr, venmoInstance) {\n if (venmoErr) {\n self.setErrorMsg($t('Error initializing Venmo: %1').replace('%1', venmoErr));\n return;\n }\n\n if (!venmoInstance.isBrowserSupported()) {\n console.log('Browser does not support Venmo');\n return;\n }\n\n self.setVenmoInstance(venmoInstance);\n });\n });\n });\n\n return this;\n },\n\n isAllowed: function () {\n return window.checkoutConfig.payment[this.getCode()].isAllowed;\n },\n\n setErrorMsg: function (message) {\n messageList.addErrorMessage({\n message: message\n });\n },\n\n setPaymentMethodNonce: function (nonce) {\n this.paymentMethodNonce = nonce;\n },\n\n setVenmoInstance: function (instance) {\n this.venmoInstance = instance;\n }\n });\n }\n);\n","PayPal_Braintree/js/view/payment/method-renderer/paypal.js":"/**\n * Copyright \u00a9 2013-2017 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n/*browser:true*/\n/*global define*/\ndefine([\n 'jquery',\n 'underscore',\n 'Magento_Checkout/js/view/payment/default',\n 'braintree',\n 'braintreeCheckoutPayPalAdapter',\n 'braintreePayPalCheckout',\n 'Magento_Checkout/js/model/quote',\n 'Magento_Checkout/js/model/full-screen-loader',\n 'Magento_Checkout/js/model/payment/additional-validators',\n 'Magento_Checkout/js/model/step-navigator',\n 'Magento_Vault/js/view/payment/vault-enabler',\n 'Magento_Checkout/js/action/create-billing-address',\n 'Magento_Checkout/js/action/select-billing-address',\n 'Magento_CheckoutAgreements/js/view/checkout-agreements',\n 'mage/translate'\n], function (\n $,\n _,\n Component,\n braintree,\n Braintree,\n paypalCheckout,\n quote,\n fullScreenLoader,\n additionalValidators,\n stepNavigator,\n VaultEnabler,\n createBillingAddress,\n selectBillingAddress,\n checkoutAgreements,\n $t\n) {\n 'use strict';\n\n return Component.extend({\n defaults: {\n template: 'PayPal_Braintree/payment/paypal',\n code: 'braintree_paypal',\n active: false,\n paypalInstance: null,\n paymentMethodNonce: null,\n grandTotalAmount: null,\n isReviewRequired: false,\n customerEmail: null,\n\n /**\n * Additional payment data\n *\n * {Object}\n */\n additionalData: {},\n\n /**\n * PayPal client configuration\n * {Object}
2\n */\n clientConfig: {\n offerCredit: false,\n offerCreditOnly: false,\n dataCollector: {\n paypal: true\n },\n\n buttonPayPalId: 'braintree_paypal_placeholder',\n buttonCreditId: 'braintree_paypal_credit_placeholder',\n buttonPaylaterId: 'braintree_paypal_paylater_placeholder',\n\n onDeviceDataReceived: function (deviceData) {\n this.additionalData['device_data'] = deviceData;\n },\n\n /**\n * Triggers when widget is loaded\n * @param {Object} context\n */\n onReady: function (context) {\n this.setupPayPal();\n },\n\n /**\n * Triggers on payment nonce receive\n * @param {Object} response\n */\n onPaymentMethodReceived: function (response) {\n this.beforePlaceOrder(response);\n }\n },\n imports: {\n onActiveChange: 'active'\n }\n },\n\n /**\n * Set list of observable attributes\n * @returns {exports.initObservable}\n */\n initObservable: function () {\n var self = this;\n\n this._super()\n .observe(['active', 'isReviewRequired', 'customerEmail']);\n\n window.addEventListener('hashchange', function (e) {\n var methodCode = quote.paymentMethod();\n\n if (methodCode === 'braintree_paypal' || methodCode === 'braintree_paypal_vault') {\n if (e.newURL.indexOf('payment') > 0 && self.grandTotalAmount !== null) {\n self.reInitPayPal();\n }\n }\n });\n\n quote.paymentMethod.subscribe(function (value) {\n var methodCode = value;\n\n if (methodCode === 'braintree_paypal' || methodCode === 'braintree_paypal_vault') {\n self.reInitPayPal();\n }\n });\n\n this.vaultEnabler = new VaultEnabler();\n this.vaultEnabler.setPaymentCode(this.getVaultCode());\n this.vaultEnabler.isActivePaymentTokenEnabler.subscribe(function () {\n self.onVaultPaymentTokenEnablerChange();\n });\n\n this.grandTotalAmount = quote.totals()['base_grand_total'];\n\n quote.totals.subscribe(function () {\n if (self.grandTotalAmount !== quote.totals()['base_grand_total']) {\n self.grandTotalAmount = quote.totals()['base_grand_total'];\n var methodCode = quote.paymentMethod();\n\n if (methodCode && (methodCode.method === 'braintree_paypal' || methodCode.method === 'braintree_paypal_vault')) {\n self.reInitPayPal();\n }\n }\n });\n\n // for each component initialization need update property\n this.isReviewRequired(false);\n this.initClientConfig();\n\n return this;\n },\n\n /**\n * Get payment name\n *\n * @returns {String}\n */\n getCode: function () {\n return this.code;\n },\n\n /**\n * Get payment title\n *\n * @returns {String}\n */\n getTitle: function () {\n return window.checkoutConfig.payment[this.getCode()].title;\n },\n\n /**\n * Check if payment is active\n *\n * @returns {Boolean}\n */\n isActive: function () {\n var active = this.getCode() === this.isChecked();\n\n this.active(active);\n\n return active;\n },\n\n /**\n * Triggers when payment method change\n * @param {Boolean} isActive\n */\n onActiveChange: function (isActive) {\n if (!isActive) {\n return;\n }\n\n // need always re-init Braintree with PayPal configuration\n this.reInitPayPal();\n },\n\n /**\n * Init config\n */\n initClientConfig: function () {\n this.clientConfig = _.extend(this.clientConfig, this.getPayPalConfig());\n\n _.each(this.clientConfig, function (fn, name) {\n if (typeof fn === 'function') {\n this.clientConfig[name] = fn.bind(this);\n }\n }, this);\n },\n\n /**\n * Set payment nonce\n * @param {String} paymentMethodNonce\n */\n setPaymentMethodNonce: function (paymentMethodNonce) {\n this.paymentMethodNonce = paymentMethodNonce;\n },\n\n /**\n * Update quote billing address\n * @param {Object}
2customer\n * @param {Object}address\n */\n setBillingAddress: function (customer, address) {\n var billingAddress = {\n street: [address.line1],\n city: address.city,\n postcode: address.postalCode,\n countryId: address.countryCode,\n email: customer.email,\n firstname: customer.firstName,\n lastname: customer.lastName,\n telephone: typeof customer.phone !== 'undefined' ? customer.phone : '00000000000'\n };\n\n billingAddress['region_code'] = typeof address.state === 'string' ? address.state : '';\n billingAddress = createBillingAddress(billingAddress);\n quote.billingAddress(billingAddress);\n },\n\n /**\n * Prepare data to place order\n * @param {Object} data\n */\n beforePlaceOrder: function (data) {\n this.setPaymentMethodNonce(data.nonce);\n this.customerEmail(data.details.email);\n if (quote.isVirtual()) {\n this.isReviewRequired(true);\n } else {\n if (this.isRequiredBillingAddress() === '1' || quote.billingAddress() === null) {\n if (typeof data.details.billingAddress !== 'undefined') {\n this.setBillingAddress(data.details, data.details.billingAddress);\n } else {\n this.setBillingAddress(data.details, data.details.shippingAddress);\n }\n } else {\n if (quote.shippingAddress() === quote.billingAddress()) {\n selectBillingAddress(quote.shippingAddress());\n } else {\n selectBillingAddress(quote.billingAddress());\n }\n }\n\n this.placeOrder();\n }\n },\n\n /**\n * Re-init PayPal Auth Flow\n */\n reInitPayPal: function () {\n this.disableButton();\n this.clientConfig.paypal.amount = parseFloat(this.grandTotalAmount).toFixed(2);\n\n if (!quote.isVirtual()) {\n this.clientConfig.paypal.enableShippingAddress = true;\n this.clientConfig.paypal.shippingAddressEditable = false;\n this.clientConfig.paypal.shippingAddressOverride = this.getShippingAddress();\n }\n\n Braintree.setConfig(this.clientConfig);\n\n if (Braintree.getPayPalInstance()) {\n Braintree.getPayPalInstance().teardown(function () {\n Braintree.setup();\n }.bind(this));\n Braintree.setPayPalInstance(null);\n } else {\n Braintree.setup();\n this.enableButton();\n }\n },\n\n /**\n * Setup PayPal instance\n */\n setupPayPal: function () {\n var self = this;\n\n if (Braintree.config.paypalInstance) {\n fullScreenLoader.stopLoader(true);\n return;\n }\n\n paypalCheckout.create({\n client: Braintree.clientInstance\n }, function (createErr, paypalCheckoutInstance) {\n if (createErr) {\n Braintree.showError($t(\"PayPal Checkout could not be initialized. Please contact the store owner.\"));\n console.error('paypalCheckout error', createErr);\n return;\n }\n let quoteObj = quote.totals();\n\n var configSDK = {\n components: 'buttons,messages,funding-eligibility',\n \"enable-funding\": \"paylater\",\n currency: quoteObj['base_currency_code']\n };\n var merchantCountry = window.checkoutConfig.payment['braintree_paypal'].merchantCountry;\n if (Braintree.getEnvironment() == 'sandbox' && merchantCountry != null) {\n configSDK[\"buyer-country\"] = merchantCountry;\n }\n paypalCheckoutInstance.loadPayPalSDK(configSDK, function () {\n this.loadPayPalButton(paypalCheckoutInstance, 'paypal');\n if (this.isCreditEnabled()) {\n this.loadPayPalButton(paypalCheckoutInstance, 'credit');\n }\n if (this.isPaylaterEnabled()) {\n this.loadPayPalButton(paypalCheckoutInstance, 'paylater');\n }\n\n }.bind(this));\n }.bind(this));\n },\n\n loadPayPalButton: function (paypalCheckoutInstance, funding) {\n var paypalPayment = Braintree.config.paypal,\n onPaymentMethodReceived = Braintree.config.onPaymentMethodReceived;\n var style = {\n color: Braintree.getColor(),\n shape: Braintree.getShape(),\n layout: Braintree.getLayout(),\n size: Braintree.getSize()\n };\n\n if (Braintree.getBranding()) {\n style.branding = Braintree.getBranding();\n }\n if (Braintree.getFundingIcons()) {\n style.fundingicons = Braintree.getFundingIcons();\n }\n\n if (funding === 'credit') {\n style.layout = \"horizontal\";\n style.color = \"darkblue\";\n Braintree.config.buttonId = this.clientConfig.buttonCreditId;\n } else if (funding === 'paylater') {\n style.layout = \"horizontal\";\n style.color = \"white\";\n Braintree.config.buttonId = this.clientConfig.buttonPaylaterId;\n } else {\n Braintree.config.buttonId = this.clientConfig.buttonPayPalId;\n }\n // Render\n Braintree.config.paypalInstance = paypalCheckoutInstance;\n var events = Braintree.events;\n $('#' + Braintree.config.buttonId).html('');\n\n var button = paypal.Buttons({\n fundingSource: funding,\n env: Braintree.getEnvironment(),\n style: style,\n commit: true,\n locale: Braintree.config.paypal.locale,\n\n onInit: function (data, actions) {\n var agreements = checkoutAgreements().agreements,\n shouldDisableActions = false;\n\n actions.disable();\n\n _.each(agreements, function (item, index) {\n if (checkoutAgreements().isAgreementRequired(item)) {\n var paymentMethodCode = quote.paymentMethod().method,\n inputId = '#agreement_' + paymentMethodCode + '_' + item.agreementId,\n inputEl = document.querySelector(inputId);\n\n\n if (!inputEl.checked) {\n shouldDisableActions = true;\n }\n\n inputEl.addEventListener('change', function (event) {\n if (additionalValidators.validate()) {\n actions.enable();\n } else {\n actions.disable();\n }\n });\n }\n });\n\n if (!shouldDisableActions) {\n actions.enable();\n }\n },\n\n createOrder: function () {\n return paypalCheckoutInstance.createPayment(paypalPayment).catch(function (err) {\n throw err.details.originalError.details.originalError.paymentResource;\n });\n }
2,\n\n onCancel: function (data) {\n console.log('checkout.js payment cancelled', JSON.stringify(data, 0, 2));\n\n if (typeof events.onCancel === 'function') {\n events.onCancel();\n }\n },\n\n onError: function (err) {\n if (err.errorName === 'VALIDATION_ERROR' && err.errorMessage.indexOf('Value is invalid') !== -1) {\n Braintree.showError($t('Address failed validation. Please check and confirm your City, State, and Postal Code'));\n } else {\n Braintree.showError($t(\"PayPal Checkout could not be initialized. Please contact the store owner.\"));\n }\n Braintree.config.paypalInstance = null;\n console.error('Paypal checkout.js error', err);\n\n if (typeof events.onError === 'function') {\n events.onError(err);\n }\n }
2.bind(this),\n\n onClick: function (data) {\n if (!quote.isVirtual()) {\n this.clientConfig.paypal.enableShippingAddress = true;\n this.clientConfig.paypal.shippingAddressEditable = false;\n this.clientConfig.paypal.shippingAddressOverride = this.getShippingAddress();\n }\n\n // To check term & conditions input checked - validate additional validators.\n if (!additionalValidators.validate()) {\n return false;\n }\n\n if (typeof events.onClick === 'function') {\n events.onClick(data);\n }\n }.bind(this),\n\n onApprove: function (data, actions) {\n return paypalCheckoutInstance.tokenizePayment(data)\n .then(function (payload) {\n onPaymentMethodReceived(payload);\n });\n }\n\n });\n if (button.isEligible() && $('#' + Braintree.config.buttonId).length) {\n button.render('#' + Braintree.config.buttonId).then(function () {\n Braintree.enableButton();\n if (typeof Braintree.config.onPaymentMethodError === 'function') {\n Braintree.config.onPaymentMethodError();\n }\n }
2.bind(this)).then(function (data) {\n if (typeof events.onRender === 'function') {\n events.onRender(data);\n }\n });\n }\n },\n\n /**\n * Get locale\n * @returns {String}\n */\n getLocale: function () {\n return window.checkoutConfig.payment[this.getCode()].locale;\n },\n\n /**\n * Is Billing Address required from PayPal side\n * @returns {exports.isRequiredBillingAddress|(function())|boolean}\n */\n isRequiredBillingAddress: function () {\n return window.checkoutConfig.payment[this.getCode()].isRequiredBillingAddress;\n },\n\n /**\n * Get configuration for PayPal\n * @returns {Object}\n */\n getPayPalConfig: function () {\n var totals = quote.totals(),\n config = {},\n isActiveVaultEnabler = this.isActiveVault();\n\n config.paypal = {\n flow: 'checkout',\n amount: parseFloat(this.grandTotalAmount).toFixed(2),\n currency: totals['base_currency_code'],\n locale: this.getLocale(),\n\n /**\n * Triggers on any Braintree error\n */\n onError: function () {\n this.paymentMethodNonce = null;\n },\n\n /**\n * Triggers if browser doesn't support PayPal Checkout\n */\n onUnsupported: function () {\n this.paymentMethodNonce = null;\n }\n };\n\n if (isActiveVaultEnabler) {\n config.paypal.requestBillingAgreement = true;\n }\n\n if (!quote.isVirtual()) {\n config.paypal.enableShippingAddress = true;\n config.paypal.shippingAddressEditable = false;\n config.paypal.shippingAddressOverride = this.getShippingAddress();\n }\n\n if (this.getMerchantName()) {\n config.paypal.displayName = this.getMerchantName();\n }\n\n return config;\n },\n\n /**\n * Get shipping address\n * @returns {Object}\n */\n getShippingAddress: function () {\n var address = quote.shippingAddress();\n\n return {\n recipientName: address.firstname + ' ' + address.lastname,\n line1: address.street[0],\n line2: typeof address.street[2] === 'undefined' ? address.street[1] : address.street[1] + ' ' + address.street[2],\n city: address.city,\n countryCode: address.countryId,\n postalCode: address.postcode,\n state: address.regionCode\n };\n },\n\n /**\n * Get merchant name\n * @returns {String}\n */\n getMerchantName: function () {\n return window.checkoutConfig.payment[this.getCode()].merchantName;\n },\n\n /**\n * Get data\n * @returns {Object}\n */\n getData: function () {\n var data = {\n 'method': this.getCode(),\n 'additional_data': {\n 'payment_method_nonce': this.paymentMethodNonce\n }\n };\n\n data['additional_data'] = _.extend(data['additional_data'], this.additionalData);\n\n this.vaultEnabler.visitAdditionalData(data);\n\n return data;\n },\n\n /**\n * Returns payment acceptance mark image path\n * @returns {String}\n */\n getPaymentAcceptanceMarkSrc: function () {\n return window.checkoutConfig.payment[this.getCode()].paymentAcceptanceMarkSrc;\n },\n\n /**\n * @returns {String}\n */\n getVaultCode: function () {\n return window.checkoutConfig.payment[this.getCode()].vaultCode;\n },\n\n /**\n * Check if need to skip order review\n * @returns {Boolean}\n */\n isSkipOrderReview: function () {\n return window.checkoutConfig.payment[this.getCode()].skipOrderReview;\n },\n\n /**\n * Checks if vault is active\n * @returns {Boolean}\n */\n isActiveVault: function () {\n return this.vaultEnabler.isVaultEnabled() && this.vaultEnabler.isActivePaymentTokenEnabler();\n },\n\n /**\n * Re-init PayPal Auth flow to use Vault\n */\n onVaultPaymentTokenEnablerChange: function () {\n this.clientConfig.paypal.singleUse = !this.isActiveVault();\n this.reInitPayPal();\n },\n\n /**\n * Disable submit button\n */\n disableButton: function () {\n // stop any previous shown loaders\n fullScreenLoader.stopLoader(true);\n fullScreenLoader.startLoader();\n $('[data-button=\"place\"]').attr('disabled', 'disabled');\n },\n\n /**\n * Enable submit button\n */\n enableButton: function () {\n $('[data-button=\"place\"]').removeAttr('disabled');\n fullScreenLoader.stopLoader(true);\n },\n\n /**\n * Triggers when customer click \"Continue to PayPal\" button\n */\n payWithPayPal: function () {\n if (additionalValidators.validate()) {\n Braintree.checkout.payp
2al.initAuthFlow();\n }\n },\n\n /**\n * Get button id\n * @returns {String}\n */\n getPayPalButtonId: function () {\n return this.clientConfig.buttonPayPalId;\n },\n\n /**\n * Get button id\n * @returns {String}\n */\n getCreditButtonId: function () {\n return this.clientConfig.buttonCreditId;\n },\n\n /**\n * Get button id\n * @returns {String}\n */\n getPaylaterButtonId: function () {\n return this.clientConfig.buttonPaylaterId;\n },\n\n isPaylaterEnabled: function () {\n return window.checkoutConfig.payment['braintree_paypal_paylater']['isActive'];\n },\n\n isPaylaterMessageEnabled: function () {\n return window.checkoutConfig.payment['braintree_paypal_paylater']['isMessageActive'];\n },\n\n getGrandTotalAmount: function () {\n return parseFloat(this.grandTotalAmount).toFixed(2);\n },\n\n isCreditEnabled: function () {\n return window.checkoutConfig.payment['braintree_paypal_credit']['isActive'];\n },\n\n });\n});\n","PayPal_Braintree/js/view/payment/method-renderer/ach.js":"define(\n [\n 'Magento_Checkout/js/view/payment/default',\n 'ko',\n 'jquery',\n 'braintree',\n 'braintreeDataCollector',\n 'braintreeAch',\n 'PayPal_Braintree/js/form-builder',\n 'Magento_Ui/js/model/messageList',\n 'Magento_Checkout/js/action/select-billing-address',\n 'Magento_Checkout/js/model/full-screen-loader',\n 'Magento_Checkout/js/model/quote',\n 'mage/translate'\n ],\n function (\n Component,\n ko,\n $,\n braintree,\n dataCollector,\n ach,\n formBuilder,\n messageList,\n selectBillingAddress,\n fullScreenLoader,\n quote,\n $t\n ) {\n 'use strict';\n\n return Component.extend({\n defaults: {\n deviceData: null,\n paymentMethodNonce: null,\n template: 'PayPal_Braintree/payment/ach',\n achInstance: null,\n routingNumber: ko.observable(\"\"),\n accountNumber: ko.observable(\"\"),\n accountType: ko.observable(\"checking\"),\n ownershipType: ko.observable(\"personal\"),\n firstName: ko.observable(\"\"),\n lastName: ko.observable(\"\"),\n businessName: ko.observable(\"\"),\n hasAuthorization: ko.observable(false),\n business: ko.observable(false), // for ownership type\n personal: ko.observable(true) // for ownership type\n },\n\n clickAchBtn: function () {\n if (!this.validateForm('#' + this.getCode() + '-form')) {\n return;\n }\n\n fullScreenLoader.startLoader();\n\n var self = this;\n\n var billingAddress = quote.billingAddress();\n\n let regionCode;\n\n let bankDetails = {\n routingNumber: self.routingNumber(),\n accountNumber: self.accountNumber(),\n accountType: self.accountType(),\n ownershipType: self.ownershipType(),\n billingAddress: {\n streetAddress: billingAddress.street[0],\n extendedAddress: billingAddress.street[1],\n locality: billingAddress.city,\n region: billingAddress.regionCode,\n postalCode: billingAddress.postcode,\n }\n };\n\n if (bankDetails.ownershipType === 'personal') {\n bankDetails.firstName = self.firstName();\n bankDetails.lastName = self.lastName();\n }
2 else {\n bankDetails.businessName = self.businessName();\n }\n\n var mandateText = document.getElementById('braintree-ach-mandate').textContent;\n\n // if no region code is available, lets find one!\n if (typeof billingAddress.regionCode === 'undefined') {\n $.get('/rest/V1/directory/countries/' + billingAddress.countryId).done(function (data) {\n if (typeof data.available_regions !== 'undefined') {\n for (var i = 0; i < data.available_regions.length; ++i) {\n if (data.available_regions[i].id === billingAddress.regionId) {\n regionCode = data.available_regions[i].code;\n bankDetails.billingAddress.region = regionCode;\n self.tokenizeAch(bankDetails, mandateText);\n }\n }\n }\n }).fail(function() {\n fullScreenLoader.stopLoader();\n });\n } else {\n self.tokenizeAch(bankDetails, mandateText);\n }\n },\n\n tokenizeAch: function (bankDetails, mandateText) {\n var self = this;\n this.achInstance.tokenize({\n bankDetails: bankDetail
2s,\n mandateText: mandateText\n }, function (tokenizeErr, tokenizedPayload) {\n if (tokenizeErr) {\n self.setErrorMsg($t('There was an error with the provided bank details. Please check and try again.'));\n self.hasAuthorization(false);\n } else {\n fullScreenLoader.stopLoader();\n self.handleAchSuccess(tokenizedPayload);\n }\n });\n },\n\n getClientToken: function () {\n return window.checkoutConfig.payment[this.getCode()].clientToken;\n },\n\n getCode: function () {\n return 'braintree_ach_direct_debit';\n },\n\n getStoreName: function () {\n return window.checkoutConfig.payment[this.getCode()].storeName;\n },\n\n getData: function () {\n let data = {\n 'method': this.getCode(),\n 'additional_data': {\n 'payment_method_nonce': this.paymentMethodNonce,\n }\n };\n\n data['additional_data'] = _.extend(data['additional_data'], this.additionalData);\n\n return data;\n },\n\n getTitle: function() {\n return 'ACH Direct Debit';\n },\n\n handleAchSuccess: function (payload) {\n this.setPaymentMethodNonce(payload.nonce);\n this.placeOrder();\n },\n\n initialize: function () {\n this._super();\n\n var self = this;\n\n braintree.create({\n authorization: self.getClientToken()\n }, function (clientError, clientInstance) {\n if (clientError) {\n this.setErrorMsg($t('Unable to initialize Braintree Client.'));\n return;\n }\n\n ach.create({\n client: clientInstance\n }, function (achErr, achInstance) {\n if (achErr) {\n self.setErrorMsg($t('Error initializing ACH: %1').replace('%1', achErr));\n return;\n }\n\n self.setAchInstance(achInstance);\n });\n });\n\n return this;\n },\n\n isAllowed: function () {\n return window.checkoutConfig.payment[this.getCode()].isAllowed;\n },\n\n changeOwnershipType: function (data, event) {\n var self = this;\n if (event.currentTarget.value === 'business') {\n self.business(true);\n self.personal(false);\n } else {\n self.business(false);\n self.personal(true);\n }\n },\n\n isBusiness: function () {\n return this.business;\n },\n\n isPersonal: function () {\n return this.personal;\n },\n\n setErrorMsg: function (message) {\n messageList.addErrorMessage({\n message: message\n });\n },\n\n setPaymentMethodNonce: function (nonce) {\n this.paymentMethodNonce = nonce;\n }
2,\n\n setAchInstance: function (instance) {\n this.achInstance = instance;\n },\n\n validateForm: function (form) {\n return $(form).validation() && $(form).validation('isValid');\n }\n });\n }\n);\n","PayPal_Braintree/js/view/payment/method-renderer/paypal-vault.js":"/**\n * Copyright \u00a9 2013-2017 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n/*browser:true*/\n/*global define*/\ndefine([\n 'jquery',\n 'underscore',\n 'Magento_Vault/js/view/payment/method-renderer/vault',\n 'Magento_Ui/js/model/messageList',\n 'Magento_Checkout/js/model/full-screen-loader'\n], function ($, _, VaultComponent, globalMessageList, fullScreenLoader) {\n 'use strict';\n\n return VaultComponent.extend({\n defaults: {\n template: 'PayPal_Braintree/payment/paypal/vault',\n additionalData: {}\n },\n\n /**\n * Get PayPal payer email\n * @returns {String}\n */\n getPayerEmail: function () {\n return this.details.payerEmail;\n },\n\n /**\n * Get type of payment\n * @returns {String}\n */\n getPaymentIcon: function () {\n return window.checkoutConfig.payment['braintree_paypal'].paymentIcon;\n },\n\n /**\n * Place order\n */\n beforePlaceOrder: function () {\n this.getPaymentMethodNonce();\n },\n\n /**\n * Send request to get payment method nonce\n */\n getPaymentMethodNonce: function () {\n var self = this;\n\n fullScreenLoader.startLoader();\n $.getJSON(self.nonceUrl, {\n 'public_hash': self.publicHash\n })\n .done(function (response) {\n fullScreenLoader.stopLoader();\n self.additionalData['payment_method_nonce'] = response.paymentMethodNonce;\n self.placeOrder();\n })\n .fail(function (response) {\n var error = JSON.parse(response.responseText);\n\n fullScreenLoader.stopLoader();\n globalMessageList.addErrorMessage({\n message: error.message\n });\n });\n },\n\n /**\n * Get payment method data\n * @returns {Object}\n */\n getData: function () {\n var data = {\n 'method': this.code,\n 'additional_data': {\n 'public_hash': this.publicHash\n }\n };\n\n data['additional_data'] = _.extend(data['additional_data'], this.additionalData);\n\n return data;\n }\n });\n});\n","PayPal_Braintree/js/view/payment/method-renderer/hosted-fields.js":"/**\n * Copyright 2013-2017 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n/*browser:true*/\n/*global define*/\n\ndefine([\n 'jquery',\n 'PayPal_Braintree/js/view/payment/method-renderer/cc-form',\n 'PayPal_Braintree/js/validator',\n 'Magento_Vault/js/view/payment/vault-enabler',\n 'Magento_Checkout/js/model/payment/additional-validators',\n 'mage/translate'\n], function ($, Component, validator, VaultEnabler, additionalValidators, $t) {\n 'use strict';\n\n return Component.extend({\n\n defaults: {\n template: 'PayPal_Braintree/payment/form',\n clientConfig: {\n\n /**\n * {String}\n */\n id: 'co-transparent-form-braintree'\n },\n isValidCardNumber: false,\n isValidExpirationDate: false,\n isValidCvvNumber: false,\n\n onInstanceReady: function (instance) {\n instance.on('validityChange', this.onValidityChange.bind(this));\n instance.on('cardTypeChange', this.onCardTypeChange.bind(this));\n }\n },\n\n /**\n * @returns {exports.initialize}\n */\n initialize: function () {\n this._super();\n this.vaultEnabler = new VaultEnabler();\n this.vaultEnabler.setPaymentCode(this.getVaultCode());\n\n return this;\n },\n\n /**\n * Init config\n */\n initClientConfig: function () {\n this._super();\n\n this.clientConfig.hostedFields = this.getHostedFields();\n this.clientConfig.onInstanceReady = this.onInstanceReady.bind(this);\n },\n\n /**\n * @returns {Object}\n */\n getData: function () {\n var data = this._super();\n\n this.vaultEnabler.visitAdditionalData(data);\n\n return data;\n },\n\n /**\n * @returns {Bool}\n */\n isVaultEnabled: function () {\n return this.vaultEnabler.isVaultEnabled();\n },\n\n /**\n * Get Braintree Hosted Fields\n * @returns {Object}\n */\n getHostedFields: function () {\n var self = this,\n fields = {\n number: {\n selector: self.getSelector('cc_number'),\n placeholder: $t('4111 1111 1111 1111')\n },\n expirationDate: {\n selector: self.getSelector('expirationDate'),\n placeholder: $t('MM/YYYY')\n }\n };\n\n if (self.hasVerification()) {\n fields.cvv = {\n selector: self.getSelector('cc_cid'),\n placeholder: $t('123')\n };\n }\n\n return fields;\n },\n\n /**\n * Triggers on Hosted Field changes\n * @param {Object} event\n * @returns {Boolean}\n */\n onValidityChange: function (event) {\n // Handle a change in validation or card type\n if (event.emittedBy === 'number') {\n this.selectedCardType(null);\n\n if (event.cards.length === 1) {\n this.isValidCardNumber = event.fields.number.isValid;\n this.selectedCardType(\n validator.getMageCardType(event.cards[0].type, this.getCcAvailableTypes())\n );\n this.validateCardType();\n } else {\n this.isValidCardNumber = event.fields.number.isValid;\n this.validateCardType();\n }\n }\n\n // Other field validations\n if (event.emittedBy === 'expirationDate') {\n this.isValidExpirationDate = event.fields.expirationDate.isValid;\n }\n if (event.emittedBy === 'cvv') {\n this.isValidCvvNumber = event.fields.cvv.isValid;\n }\n },\n\n /**\n * Triggers on Hosted Field card type changes\n * @param {Object} event\n * @returns {Boolean}\n */\n onCardTypeChange: function (event) {\n if (event.cards.length === 1) {\n this.selectedCardType(\n validator.getMageCardType(event.cards[0].type, this.getCcAvailableTypes())\n );\n } else {\n this.selectedCardType(null);\n }\n },\n\n /**\n * Toggle invalid class on selector\n * @param selector\n * @param state\n * @returns {boolean}\n */\n validateField: function (selector, state) {\n var $selector = $(this.getSelector(selector)),\n invalidClass = 'braintree-hosted-fields-invalid';\n\n if (state === true) {\n $selector.removeClass(invalidClass);\n return true;\n }\n\n $selector.addClass(invalidClass);\n return false;\n },\n\n /**\n * Validate current credit card type\n * @returns {Boolean}\n */\n validateCardType: function () {\n return this.validateField(\n 'cc_number',\n (this.isValidCardNumber)\n );\n },\n\n /**\n * Validate current expiry date\n * @returns {boolean}\n */\n validateExpirationDate: function () {\n return this.validateField(\n 'expirationDate',\n (this.isValidExpirationDate === true)\n );\n },\n\n /**\n * Validate current CVV field\n * @returns {boolean}\n */\n validateCvvNumber: function () {\n var self = this;\n \n if (self.hasVerification() === false) {\n return true;\n }\n \n return this.validateField(\n 'cc_cid',\n (this.isValidCvvNumber === true)\n );\n },\n\n /**\n * Validate all fields\n * @returns {boolean}\n */\n validateFormFields: function () {\n return (this.validateCardType() && this.validateExpirationDate() && this.validateCvvNumber()) === true;\n },\n\n /**\n * Trigger order placing\n */\n placeOrderClick: function () {\n if (this.validateFormFields() && additionalValidators.validate()) {\n var isReCaptchaEnabled = window.checkoutConfig.recaptcha_braintree;\n if (isReCaptchaEnabled) {\n var recaptchaCheckBox = jQuery(\"#recaptcha-checkout-braintree-wrapper input[name='recaptcha-validate-']\");\n\n if (recaptchaCheckBox.length && recaptchaCheckBox.prop('checked') === false) {\n alert($t('Please indicate google recaptcha'));\n } else {\n this.placeOrder();\n }\n } else {\n this.placeOrder();\n }\n }\n },\n /**\n * @returns {String}\n */\n getVaultCode: function () {\n return window.checkoutConfig.payment[this.getCode()].ccVaultCode;\n }\n });\n});\n","PayPal_Braintree/js/view/payment/method-renderer/cc-form.js":"/**\n * Copyright 2013-2017 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n/*browser:true*/\n/*global define*/\ndefine(\n [\n 'underscore',\n 'jquery',\n 'Magento_Payment/js/view/payment/cc-form',\n 'Magento_Checkout/js/model/quote',\n 'PayPal_Braintree/js/view/payment/adapter',\n 'mage/translate',\n 'PayPal_Braintree/js/validator',\n 'PayPal_Braintree/js/view/payment/vali
2dator-handler',\n 'Magento_Checkout/js/model/full-screen-loader'\n ],\n function (\n _,\n $,\n Component,\n quote,\n braintree,\n $t,\n validator,\n validatorManager,\n fullScreenLoader\n ) {\n 'use strict';\n\n return Component.extend({\n defaults: {\n active: false,\n braintreeClient: null,\n braintreeDeviceData: null,\n paymentMethodNonce: null,\n lastBillingAddress: null,\n validatorManager: validatorManager,\n code: 'braintree',\n isProcessing: false,\n\n /**\n * Additional payment data\n *\n * {Object}\n */\n additionalData: {},\n\n /**\n * Braintree client configuration\n *\n * {Object}\n */\n clientConfig: {\n dataCollector: {\n kount: true\n },\n\n onReady: function (context) {\n context.setupHostedFields();\n },\n\n /**\n * Triggers on payment nonce receive\n * @param {Object} response\n */\n onPaymentMethodReceived: function (response) {\n this.handleNonce(response);\n this.isProcessing = false;\n },\n\n /**\n * Allow a new nonce to be generated\n */\n onPaymentMethodError: function() {\n this.isProcessing = false;\n },\n\n /**\n * Device data initialization\n * @param {String} deviceData\n */\n onDeviceDataReceived: function (deviceData) {\n this.additionalData['device_data'] = deviceData;\n },\n\n /**\n * After Braintree instance initialization\n */\n onInstanceReady: function () {},\n\n /**\n * Triggers on any Braintree error\n * @param {Object} response\n */\n onError: function (response) {\n this.isProcessing = false;\n braintree.showError($t('Payment ' + this.getTitle() + ' can\\'t be initialized'));\n throw response.message;\n },\n\n /**\n * Triggers when customer click \"Cancel\"\n */\n onCancelled: function () {\n this.paymentMethodNonce = null;\n this.isProcessing = false;\n }\n },\n imports: {\n onActiveChange: 'active'\n }\n },\n\n /**\n * Set list of observable attributes\n *\n * @returns {exports.initObservable}\n */\n initObservable: function () {\n validator.setConfig(window.checkoutConfig.payment[this.getCode()]);\n this._super()\n .observe(['active']);\n this.validatorManager.initialize();\n this.initClientConfig();\n\n return this;\n },\n\n /**\n * Get payment name\n *\n * @returns {String}\n */\n getCode: function () {\n return this.code;\n },\n\n /**\n * Check if payment is active\n *\n * @returns {Boolean}\n */\n isActive: function () {\n let active = this.getCode() === this.isChecked();\n\n this.active(active);\n\n return active;\n },\n\n /**\n * Triggers when payment method change\n * @param {Boolean} isActive\n */\n onActiveChange: function (isActive) {\n if (!isActive) {\n return;\n }\n\n this.initBraintree();\n },\n\n /**\n * Init config\n */\n initClientConfig: function () {\n // Advanced fraud tools settings\n if (this.hasFraudProtection()) {\n this.clientConfig = _.extend(this.clientConfig, this.kountConfig());\n }\n\n _.each(this.clientConfig, function (fn, name) {\n if (typeof fn === 'function') {\n this.clientConfig[name] = fn.bind(this);\n }\n }, this);\n },\n\n /**\n * Init Braintree configuration\n */\n initBraintree: function () {\n let intervalId = setInterval(function () {\n // stop loader when frame will be loaded\n if ($('#braintree-hosted-field-number').length) {\n clearInterval(intervalId);\n fullScreenLoader.stopLoader(true);\n }\n }, 500);\n\n if (braintree.checkout) {\n braintree.checkout.teardown(function () {\n braintree.checkout = null;\n });\n }\n\n fullScreenLoader.startLoader();\n braintree.setConfig(this.clientConfig);\n braintree.setup();\n },\n\n /**\n * @returns {Object}\n */\n kountConfig: function () {\n let config = {\n dataCollector: {\
2n kount: {\n environment: this.getEnvironment()\n }\n },\n\n /**\n * Device data initialization\n *\n * @param {Object} checkout\n */\n onReady: function (context) {\n this.additionalData['device_data'] = context.deviceData;\n context.setupHostedFields();\n }\n };\n\n if (this.getKountMerchantId()) {\n config.dataCollector.kount.merchantId = this.getKountMerchantId();\n }\n\n return config;\n },\n\n /**\n * Get full selector name\n *\n * @param {String} field\n * @returns {String}\n */\n getSelector: function (field) {\n return '#' + this.getCode() + '_' + field;\n },\n\n /**\n * Get list of available CC types\n *\n * @returns {Object}\n */\n getCcAvailableTypes: function () {\n let availableTypes = validator.getAvailableCardTypes(),\n billingAddress = quote.billingAddress(),\n billingCountryId;\n\n this.lastBillingAddress = quote.shippingAddress();\n\n if (!billingAddress) {\n billingAddress = this.lastBillingAddress;\n }\n\n billingCountryId = billingAddress.countryId;\n\n if (billingCountryId && validator.getCountrySpecificCardTypes(billingCountryId)) {\n return validator.collectTypes(\n availableTypes,\n validator.getCountrySpecificCardTypes(billingCountryId)\n );\n }\n\n return availableTypes;\n },\n\n /**\n * @returns {Boolean}\n */\n hasFraudProtection: function () {\n return window.checkoutConfig.payment[this.getCode()].hasFraudProtection;\n },\n\n /**\n * @returns {String}\n */\n getEnvironment: function () {\n return window.checkoutConfig.payment[this.getCode()].environment;\n },\n\n /**\n * @returns {String}\n */\n getKountMerchantId: function () {\n return window.checkoutConfig.payment[this.getCode()].kountMerchantId;\n },\n\n /**\n * Get data\n *\n * @returns {Object}\n */\n getData: function () {\n let data = {\n 'method': this.getCode(),\n 'additional_data': {\n 'payment_method_nonce': this.paymentMethodNonce,\n 'g-recaptcha-response' : $(\"#token-grecaptcha-braintree\").val()\n }\n };\n\n data['additional_data'] = _.extend(data['additional_data'], this.additionalData);\n\n return data;\n },\n\n /**\n * Set payment nonce\n * @param {String} paymentMethodNonce\n */\n setPaymentMethodNonce: function (paymentMethodNonce) {\n this.paymentMethodNonce = paymentMethodNonce;\n },\n\n /**\n * Set credit card bin\n * @param creditCardBin\n */\n setCreditCardBin: function (creditCardBin) {\n this.creditCardBin = creditCardBin;\n },\n\n /**\n * Prepare payload to place order\n * @param {Object} payload\n */\n handleNonce: function (payload) {\n let self = this;\n\n this.setPaymentMethodNonce(payload.nonce);\n this.setCreditCardBin(payload.details.bin);\n\n // place order on success validation\n self.validatorManager.validate(self, function () {\n return self.placeOrder('parent');\n }
2, function() {\n self.isProcessing = false;\n self.paymentMethodNonce = null;\n self.creditCardBin = null;\n });\n },\n\n /**\n * Action to place order\n * @param {String} key\n */\n placeOrder: function (key) {\n if (key) {\n return this._super();\n }\n\n if (this.isProcessing) {\n return false;\n } else {\n this.isProcessing = true;\n }\n\n braintree.tokenizeHostedFields();\n return false;\n },\n\n /**\n * Get payment icons\n * @param {String} type\n * @returns {Boolean}\n */\n getIcons: function (type) {\n return window.checkoutConfig.payment.braintree.icons.hasOwnProperty(type) ?\n window.checkoutConfig.payment.braintree.icons[type]\n : false;\n },\n });\n }\n);\n","PayPal_Braintree/js/view/payment/method-renderer/vault.js":"/**\n * Copyright \u00a9 2013-2017 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n/*browser:true*/\n/*global define*/\ndefine([\n 'ko',\n 'jquery',\n 'Magento_Vault/js/view/payment/method-renderer/vault',\n 'PayPal_Braintree/js/view/payment/adapter',\n 'Magento_Ui/js/model/messageList',\n 'PayPal_Braintree/js/view/payment/validator-handler',\n 'Magento_Checkout/js/model/payment/additional-validators',\n 'Magento_Checkout/js/model/full-screen-loader',\n 'braintree',\n 'braintreeHostedFields',\n 'mage/url'\n], function (\n ko,\n $,\n VaultComponent,\n Braintree,\n globalMessageList,\n validatorManager,\n additionalValidators,\n fullScreenLoader,\n client,\n hostedFields,\n url\n) {\n 'use strict';\n\n return VaultComponent.extend({\n defaults: {\n active: false,\n hostedFieldsInstance: null,\n imports: {\n onActiveChange: 'active'\n },\n modules: {\n hostedFields: '${ $.parentName }.braintree'\n },\n template: 'PayPal_Braintree/payment/cc/vault',\n updatePaymentUrl: url.build('braintree/payment/updatepaymentmethod'),\n vaultedCVV: ko.observable(\"\"),\n validatorManager: validatorManager,\n isValidCvv: false,\n onInstanceReady: function (instance) {\n instance.on('validityChange', this.onValidityChange.bind(this));\n }\n },\n\n /**\n * Event fired by Braintree SDK whenever input value length matches the validation length.\n * In the case of a CVV, this is 3, or 4 for AMEX.\n * @param event\n */\n onValidityChange: function (event) {\n if (event.emittedBy === 'cvv') {\n this.isValidCvv = event.fields.cvv.isValid;\n }\n },\n\n /**\n * @returns {exports}\n */\n initObservable: function () {\n this._super().observe(['active']);\n this.validatorManager.initialize();\n return this;\n },\n\n /**\n * Is payment option active?\n * @returns {boolean}\n */\n isActive: function () {\n let active = this.getId() === this.isChecked();\n this.active(active);\n return active;\n },\n\n /**\n * Fired whenever a payment option is changed.\n * @param isActive\n */\n onActiveChange: function (isActive) {\n let self = this;\n\n if (!isActive) {\n return;\n }\n\n if (self.showCvvVerify()) {\n if (self.hostedFieldsInstance) {\n self.hostedFieldsInstance.teardown(function (teardownError) {\n if (teardownError) {\n globalMessageList.addErrorMessage({\n message: teardownError.message\n });\n }\n self.hostedFieldsInstance = null;\n self.initHostedCvvField();\n });\n return;\n }\n self.initHostedCvvField();\n }\n },\n\n /**\n * Initialize the CVV input field with the Braintree Hosted Fields SDK.\n */\n initHostedCvvField: function () {\n let self = this;\n client.create({\n authorization: Braintree.getClientToken()\n }, function (clientError, clientInstance) {\n if (clientError) {\n globalMessageList.addErrorMessage({\n message: clientError.message\n });\n }\n hostedFields.create({\n client: clientInstance,\n fields: {\n cvv: {\n selector: '#' + self.getId() + '_cid',\n placeholder: '123'\n }\n }\n }, function (hostedError, hostedFieldsInstance) {\n if (hostedError) {\n globalMessageList.addErrorMessage({\n message: hostedError.message\n });\n return;\n }\n\n self.hostedFieldsInstance = hostedFieldsInstance;\n self.onInstanceReady(self.hostedFieldsInstance);\n });\n });\n },\n\n /**\n * Return the payment method code.\n * @returns {string}\n */\n getCode: function () {\n return 'braintree_cc_vault';\n },\n\n /**\n * Get last 4 digits of card\n * @returns {String}\n */\n getMaskedCard: function () {\n return this.details.maskedCC;\n },\n\n /**\n * Get expiration date\n * @returns {String}\n */\n getExpirationDate: function () {\n return this.details.expirationDate;\n },\n\n /**\n * Get card type\n * @returns {String}\n */\n getCardType: function () {\n return this.details.type;\n },\n\n /**\n * Get show CVV Field\n * @returns {Boolean}\n */\n showCvvVerify: function () {\n return window.checkoutConfig.payment[this.co
2de].cvvVerify;\n },\n\n /**\n * Show or hide the error message.\n * @param selector\n * @param state\n * @returns {boolean}\n */\n validateCvv: function (selector, state) {\n let $selector = $(selector),\n invalidClass = 'braintree-hosted-fields-invalid';\n\n if (state === true) {\n $selector.removeClass(invalidClass);\n return true;\n }\n\n $selector.addClass(invalidClass);\n return false;\n },\n\n /**\n * Place order\n */\n placeOrder: function () {\n let self = this;\n\n if (self.showCvvVerify()) {\n if (!self.validateCvv('#' + self.getId() + '_cid', self.isValidCvv) || !additionalValidators.validate()) {\n return;\n }\n } else {\n if (!additionalValidators.validate()) {\n return;\n }\n }\n\n fullScreenLoader.startLoader();\n\n if (self.showCvvVerify() && typeof self.hostedFieldsInstance !== 'undefined') {\n self.hostedFieldsInstance.tokenize({}, function (error, payload) {\n if (error) {\n fullScreenLoader.stopLoader();\n globalMessageList.addErrorMessage({\n message: error.message\n });\n return;\n }\n $.getJSON(self.updatePaymentUrl, {\n 'nonce': payload.nonce,\n 'public_hash': self.publicHash\n }).done(function (response) {\n if (response.success === false) {\n fullScreenLoader.stopLoader();\n globalMessageList.addErrorMessage({\n message: 'CVV verification failed.'\n });\n return;\n }\n self.getPaymentMethodNonce();\n })\n });\n } else {\n self.getPaymentMethodNonce();\n }\n },\n\n /**\n * Send request to get payment method nonce\n */\n getPaymentMethodNonce: function () {\n let self = this;\n\n fullScreenLoader.startLoader();\n $.getJSON(self.nonceUrl, {\n 'public_hash': self.publicHash,\n 'cvv': self.vaultedCVV()\n }).done(function (response) {\n fullScreenLoader.stopLoader();\n self.hostedFields(function (formComponent) {\n formComponent.setPaymentMethodNonce(response.paymentMethodNonce);\n formComponent.setCreditCardBin(response.details.bin);\n formComponent.additionalData['public_hash'] = self.publicHash;\n formComponent.code = self.code;\n if (self.vaultedCVV()) {\n formComponent.additionalData['cvv'] = self.vaultedCVV();\n }\n\n self.validatorManager.validate(formComponent, function () {\n fullScreenLoader.stopLoader();\n return formComponent.placeOrder('parent');\n }, function() {\n // No teardown actions required.\n fullScreenLoader.stopLoader();\n formComponent.setPaymentMethodNonce(null);\n formComponent.setCreditCardBin(null);\n });\n\n });\n }).fail(function (response) {\n let error = JSON.parse(response.responseText);\n\n fullScreenLoader.stopLoader();\n globalMessageList.addErrorMessage({\n message: error.message\n });\n });\n }\n });\n});\n","PayPal_Braintree/js/view/payment/method-renderer/multishipping/paypal.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n/*browser:true*/\n/*global define*/\ndefine([\n 'jquery',\n 'underscore',\n 'braintreeCheckoutPayPalAdapter',\n 'Magento_Checkout/js/model/quote',\n 'PayPal_Braintree/js/view/payment/method-renderer/paypal',\n 'Magento_Checkout/js/action/set-payment-information',\n 'Magento_Checkout/js/model/payment/additional-validators',\n 'Magento_Checkout/js/model/full-screen-loader',\n 'mage/translate'\n], function (\n $,\n _,\n Braintree,\n quote,\n Component,\n setPaymentInformationAction,\n additionalValidators,\n fullScreenLoader,\n $t\n) {\n 'use strict';\n\n return Component.extend({\n defaults: {\n template: 'PayPal_Braintree/payment/multishipping/paypal',\n submitButtonSelector: '[id=\"parent-payment-continue\"]',\n reviewButtonHtml: ''\n },\n\n /**\n * @override\n */\n initOb
2servable: function () {\n this.reviewButtonHtml = $(this.submitButtonSelector).html();\n return this._super();\n },\n\n initClientConfig: function () {\n this.clientConfig = _.extend(this.clientConfig, this.getPayPalConfig());\n this.clientConfig.paypal.enableShippingAddress = false;\n\n _.each(this.clientConfig, function (fn, name) {\n if (typeof fn === 'function') {\n this.clientConfig[name] = fn.bind(this);\n }\n }, this);\n this.clientConfig.buttonPayPalId = 'parent-payment-continue';\n\n },\n\n /**\n * @override\n */\n onActiveChange: function (isActive) {\n this.updateSubmitButtonHtml(isActive);\n this._super(isActive);\n },\n\n /**\n * @override\n */\n beforePlaceOrder: function (data) {\n this._super(data);\n },\n\n /**\n * Re-init PayPal Auth Flow\n */\n reInitPayPal: function () {\n this.disableButton();\n this.clientConfig.paypal.amount = parseFloat(this.grandTotalAmount).toFixed(2);\n\n if (!quote.isVirtual()) {\n this.clientConfig.paypal.enableShippingAddress = false;\n this.clientConfig.paypal.shippingAddressEditable = false;\n }\n\n Braintree.setConfig(this.clientConfig);\n\n if (Braintree.getPayPalInstance()) {\n Braintree.getPayPalInstance().teardown(function () {\n Braintree.setup();\n }.bind(this));\n Braintree.setPayPalInstance(null);\n } else {\n Braintree.setup();\n this.enableButton();\n }\n },\n\n loadPayPalButton: function (paypalCheckoutInstance, funding) {\n var paypalPayment = Braintree.config.paypal,\n onPaymentMethodReceived = Braintree.config.onPaymentMethodReceived;\n var style = {\n color: Braintree.getColor(),\n shape: Braintree.getShape(),\n layout: Braintree.getLayout(),\n size: Braintree.getSize()\n };\n\n if (Braintree.getBranding()) {\n style.branding = Braintree.getBranding();\n }\n if (Braintree.getFundingIcons()) {\n style.fundingicons = Braintree.getFundingIcons();\n }\n\n if (funding === 'credit') {\n style.layout = \"horizontal\";\n style.color = \"darkblue\";\n Braintree.config.buttonId = this.clientConfig.buttonCreditId;\n } else if (funding === 'paylater') {\n style.layout = \"horizontal\";\n style.color = \"white\";\n Braintree.config.buttonId = this.clientConfig.buttonPaylaterId;\n } else {\n Braintree.config.buttonId = this.clientConfig.buttonPayPalId;\n }\n // Render\n Braintree.config.paypalInstance = paypalCheckoutInstance;\n var events = Braintree.events;\n $('#' + Braintree.config.buttonId).html('');\n\n var button = paypal.Buttons({\n fundingSource: funding,\n env: Braintree.getEnvironment(),\n style: style,\n commit: true,\n locale: Braintree.config.paypal.locale,\n\n createOrder: function () {\n return paypalCheckoutInstance.createPayment(paypalPayment);\n }
2,\n\n onCancel: function (data) {\n console.log('checkout.js payment cancelled', JSON.stringify(data, 0, 2));\n\n if (typeof events.onCancel === 'function') {\n events.onCancel();\n }\n },\n\n onError: function (err) {\n Braintree.showError($t(\"PayPal Checkout could not be initialized. Please contact the store owner.\"));\n Braintree.config.paypalInstance = null;\n console.error('Paypal checkout.js error', err);\n\n if (typeof events.onError === 'function') {\n events.onError(err);\n }\n }.bind(this),\n\n onClick: function (data) {\n // To check term & conditions input checked - validate additional validators.\n if (!additionalValidators.validate()) {\n return false;\n }\n\n if (typeof events.onClick === 'function') {\n events.onClick(data);\n }\n }.bind(this),\n\n onApprove: function (data, actions) {\n return paypalCheckoutInstance.tokenizePayment(data)\n .then(function (payload) {\n onPaymentMethodReceived(payload);\n });\n }\n\n });\n if (button.isEligible() && $('#' + Braintree.config.buttonId).length) {\n\n button.render('#' + Braintree.config.buttonId).then(function () {\n Braintree.enableButton();\n if (typeof Braintree.config.onPaymentMethodError === 'function') {\n Braintree.config.onPaymentMethodError();\n }\n }
2.bind(this)).then(function (data) {\n if (typeof events.onRender === 'function') {\n events.onRender(data);\n }\n });\n }\n },\n\n /**\n * Get configuration for PayPal\n * @returns {Object}\n */\n getPayPalConfig: function () {\n var totals = quote.totals(),\n config = {},\n isActiveVaultEnabler = this.isActiveVault();\n\n config.paypal = {\n flow: 'checkout',\n amount: parseFloat(this.grandTotalAmount).toFixed(2),\n currency: totals['base_currency_code'],\n locale: this.getLocale(),\n requestBillingAgreement: true,\n /**\n * Triggers on any Braintree error\n */\n onError: function () {\n this.paymentMethodNonce = null;\n },\n\n /**\n * Triggers if browser doesn't support PayPal Checkout\n */\n onUnsupported: function () {\n this.paymentMethodNonce = null;\n }\n };\n\n if (!quote.isVirtual()) {\n config.paypal.enableShippingAddress = false;\n config.paypal.shippingAddressEditable = false;\n }\n\n if (this.getMerchantName()) {\n config.paypal.displayName = this.getMerchantName();\n }\n\n return config;\n },\n\n getShippingAddress: function () {\n\n return {};\n },\n\n /**\n * @override\n */\n getData: function () {\n var data = this._super();\n\n data['additional_data']['is_active_payment_token_enabler'] = true;\n\n return data;\n },\n\n /**\n * @override\n */\n isActiveVault: function () {\n return true;\n },\n\n /**\n * Skipping order review step on checkout with multiple addresses is not allowed.\n *\n * @returns {Boolean}\n */\n isSkipOrderReview: function () {\n return false;\n },\n\n /**\n * Checks if payment method nonce is already received.\n *\n * @returns {Boolean}\n */\n isPaymentMethodNonceReceived: function () {\n return this.paymentMethodNonce !== null;\n },\n\n /**\n * Update submit button on multi-addresses checkout billing form.\n *\n * @param {Boolean} isActive\n */\n updateSubmitButtonHtml: function (isActive) {\n $(this.submitButtonSelector).removeClass(\"primary\");\n if (this.isPaymentMethodNonceReceived() || !isActive) {\n $(this.submitButtonSelector).addClass(\"primary\");\n $(this.submitButtonSelector).html(this.reviewButtonHtml);\n }\n },\n\n /**\n * @override\n */\n placeOrder: function () {\n if (!this.isPaymentMethodNonceReceived()) {\n this.payWithPayPal();\n } else {\n fullScreenLoader.startLoader();\n\n $.when(\n setPaymentInformationAction(\n this.messageContainer,\n this.getData()\n )\n ).done(this.done.bind(this))\n .fail(this.fail.bind(this));\n }\n },\n\n /**\n * {Function}\n */\n fail: function () {\n fullScreenLoader.stopLoader();\n\n return this;\n },\n\n /**\n * {Function}\n */\n done: function () {\n fullScreenLoader.stopLoader();\n $('#multishipping-billing-form').submit();\n\n return this;\n }\n });\n});","PayPal_Braintree/js/view/payment/method-renderer/multishipping/hosted-fields.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n/*browser:true*/\n/*global define*/\n\ndefine([\n 'jquery',\n 'PayPal_Braintree/js/view/payment/method-renderer/hosted-fields',\n 'PayPal_Braintree/js/validator',\n 'Magento_Ui/js/model/messageList',\n 'mage/translate',\n 'Magento_Checkout/js/model/full-screen-loader',\n 'Magento_Checkout/js/action/set-payment-information',\n 'Magento_Checkout/js/model/payment/additional-validators',\n 'PayPal_Braintree/js/view/payment/adapter'\n], function (\n $,\n Component,\n validator,\n messageList,\n $t,\n fullScreenLoader,\n setPaymentInformationAction,\n additionalValidators,\n braintree\n) {\n 'use strict';\n\n return Component.extend({\n defaults: {\n template: 'PayPal_Braintree/payment/multishipping/form'\n },\n\n /**\n * Get list of available CC types\n *\n * @returns {Object}\n */\n getCcAvailableTypes: function () {\n let availableTypes = validator.getAvailableCardTypes(),\n billingCountryId;\n\n billingCountryId = $('#multishipping_billing_country_id').val();\n\n if (billingCountryId && validator.getCountrySpecificCardTypes(billingCountryId)) {\n return validator.collectTypes(\n availableTypes, validator.getCountrySpecificCardTypes(billingCountryId)\n );\n }\n\n return availableTypes;\n },\n\n /**\n * @override\n */\n handleNonce: function (payload) {\n let self = this;\n this.setPaymentMethodNonce(payload.nonce);\n this.setCreditCardBin(payload.details.bin);\n\n // place order on success validation\n self.validatorManager.validate(self, function () {\n return self.setPaymentInformation();\n }
2, function() {\n self.isProcessing = false;\n self.paymentMethodNonce = null;\n self.creditCardBin = null;\n });\n },\n\n /**\n * @override\n */\n placeOrder: function () {\n if (this.isProcessing) {\n return false;\n } else {\n this.isProcessing = true;\n }\n\n braintree.tokenizeHostedFields();\n return false;\n },\n\n /**\n * @override\n */\n setPaymentInformation: function () {\n if (additionalValidators.validate()) {\n fullScreenLoader.startLoader();\n $.when(\n setPaymentInformationAction(\n this.messageContainer,\n this.getData()\n )\n ).done(this.done.bind(this))\n .fail(this.fail.bind(this));\n }\n },\n\n /**\n * {Function}\n */\n fail: function () {\n fullScreenLoader.stopLoader();\n\n return this;\n },\n\n /**\n * {Function}\n */\n done: function () {\n fullScreenLoader.stopLoader();\n $('#multishipping-billing-form').submit();\n\n return this;\n }\n });\n});\n","PayPal_Braintree/js/reCaptcha/reCaptcha.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\ndefine(\n [\n 'Magento_ReCaptchaFrontendUi/js/reCaptcha',\n 'jquery'\n ],\n function (Component, $) {\n 'use strict';\n\n return Component.extend({\n\n /**\n * Recaptcha callback\n * @param {String} token\n */\n reCaptchaCallback: function (token) {\n this.tokenField.value = token;\n this.$parentForm.trigger('captcha:endExecute');\n },\n\n /**\n * Initialize parent form.\n *\n * @param {Object} parentForm\n * @param {String} widgetId\n */\n initParentForm: function (parentForm, widgetId) {\n var me = this;\n\n parentForm.on('captcha:startExecute', function (event) {\n if (!me.tokenField.value && me.getIsInvisibleRecaptcha()) {\n // eslint-disable-next-line no-undef\n grecaptcha.execute(widgetId);\n event.preventDefault(event);\n event.stopImmediatePropagation();\n } else {\n me.$parentForm.trigger('captcha:endExecute');\n }\n });\n // Create a virtual token field\n this.tokenField = $('<input type=\"text\" id=\"token-grecaptcha-braintree\" name=\"token-grecaptcha-braintree\" style=\"display: none\" />')[0];\n this.$parentForm = parentForm;\n parentForm.append(this.tokenField);\n }\n });\n }\n);\n","PayPal_Braintree/js/reCaptcha/braintree-cc-method-mixin.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\ndefine([\n 'jquery',\n 'Magento_Checkout/js/model/payment/additional-validators',\n 'mage/translate'\n], function ($, additionalValidators, $t) {\n 'use strict';\n\n return function (originalComponent) {\n return originalComponent.extend({\n /**\n * Initializes reCaptcha\n */\n placeOrder: function () {\n var original = this._super.bind(this),\n // jscs:disable requireCamelCaseOrUpperCaseIdentifiers\n isEnabled = window.checkoutConfig.recaptcha_braintree,\n // jscs:enable requireCamelCaseOrUpperCaseIdentifiers\n paymentFormSelector = $('#co-payment-form'),\n startEvent = 'captcha:startExecute',\n endEvent = 'captcha:endExecute';\n\n if (!additionalValidators.validate() || !isEnabled || this.getCode() !== 'braintree') {\n return original();\n }\n\n paymentFormSelector.off(endEvent).on(endEvent, function () {\n var recaptchaCheckBox = jQuery(\"#recaptcha-checkout-braintree-wrapper input[name='recaptcha-validate-']\");\n\n if (recaptchaCheckBox.length && recaptchaCheckBox.prop('checked') === false) {\n alert($t('Please indicate google recaptcha'));\n } else {\n original();\n paymentFormSelector.off(endEvent);\n }\n });\n\n paymentFormSelector.trigger(startEvent);\n }\n });\n };\n});\n","PayPal_Braintree/js/helper/remove-non-digit-characters.js":"define(function () {\n 'use strict';\n\n /**\n * Remove any non-digit characters from string.\n *\n * @param {string}
2 value\n * @return {string}\n */\n return function (value) {\n return value.replace(/\\D/g, '');\n };\n});","Magento_Dhl/js/model/shipping-rates-validation-rules.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\ndefine([], function () {\n 'use strict';\n\n return {\n /**\n * @return {Object}\n */\n getRules: function () {\n return {\n 'postcode': {\n 'required': true\n },\n 'country_id': {\n 'required': true\n },\n 'city': {\n 'required': true\n }\n };\n }\n };\n});\n","Magento_Dhl/js/model/shipping-rates-validator.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\ndefine([\n 'jquery',\n 'mageUtils',\n 'Magento_Dhl/js/model/shipping-rates-validation-rules',\n 'mage/translate'\n], function ($, utils, validationRules, $t) {\n 'use strict';\n\n return {\n validationErrors: [],\n\n /**\n * @param {Object} address\n * @return {Boolean}\n */\n validate: function (address) {\n var self = this;\n\n this.validationErrors = [];\n $.each(validationRules.getRules(), function (field, rule) {\n var message;\n\n if (rule.required && utils.isEmpty(address[field])) {\n message = $t('Field ') + field + $t(' is required.');\n\n self.validationErrors.push(message);\n }\n });\n\n return !this.validationErrors.length;\n }\n };\n});\n","Magento_Dhl/js/view/shipping-rates-validation.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\ndefine([\n 'uiComponent',\n 'Magento_Checkout/js/model/shipping-rates-validator',\n 'Magento_Checkout/js/model/shipping-rates-validation-rules',\n 'Magento_Dhl/js/model/shipping-rates-validator',\n 'Magento_Dhl/js/model/shipping-rates-validation-rules'\n], function (\n Component,\n defaultShippingRatesValidator,\n defaultShippingRatesValidationRules,\n dhlShippingRatesValidator,\n dhlShippingRatesValidationRules\n) {\n 'use strict';\n\n defaultShippingRatesValidator.registerValidator('dhl', dhlShippingRatesValidator);\n defaultShippingRatesValidationRules.registerRules('dhl', dhlShippingRatesValidationRules);\n\n return Component;\n});\n","Magento_CardinalCommerce/js/cardinal-client.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\ndefine([\n 'jquery',\n 'uiClass',\n 'Magento_CardinalCommerce/js/cardinal-factory',\n 'Magento_Checkout/js/model/quote',\n 'mage/translate'\n], function ($, Class, cardinalFactory, quote, $t) {\n 'use strict';\n\n return {\n /**\n * Starts Cardinal Consumer Authentication\n *\n * @param {Object} cardData\n * @return {jQuery.Deferred}\n */\n startAuthentication: function (cardData) {\n var deferred = $.Deferred();\n\n if (this.cardinalClient) {\n this._startAuthentication(deferred, cardData);\n } else {\n cardinalFactory(this.getEnvironment())\n .done(function (client) {\n this.cardinalClient = client;\n this._startAuthentication(deferred, cardData);\n }.bind(this));\n }\n\n return deferred.promise();\n },\n\n /**\n * Cardinal Consumer Authentication\n *\n * @param {jQuery.Deferred} deferred\n * @param {Object} cardData\n */\n _startAuthentication: function (deferred, cardData) {\n //this.cardinalClient.configure({ logging: { level: 'verbose' } });\n this.cardinalClient.on('payments.validated', function (data, jwt) {\n if (data.ErrorNumber !== 0) {\n deferred.reject(data.ErrorDescription);\n } else if ($.inArray(data.ActionCode, ['FAILURE', 'ERROR']) !== -1) {\n deferred.reject($t('Authentication Failed. Please try again with another form of payment.'));\n } else {\n deferred.resolve(jwt);\n }\n this.cardinalClient.off('payments.validated');\n }.bind(this));\n\n this.cardinalClient.on('payments.setupComplete', function () {\n this.cardinalClient.start('cca', this.getRequestOrderObject(cardData));\n this.cardinalClient.off('payments.setupComplete');\n }.bind(this));\n\n this.cardinalClient.setup('init', {\n jwt: this.getRequestJWT()\n });\n },\n\n /**\n * Returns request order object.\n *\n * The request order object is structured object that is used to pass data\n * to Cardinal that describes an order you'd like to process.\n *\n * If you pass a request object in both the JWT and the browser,\n * Cardinal will merge the objects together where the browser overwrites\n * the JWT object as it is considered the most recently captured data.\n *\n * @param {Object} cardData\n * @returns {Object}\n */\n getRequestOrderObject: function (cardData) {\
2n var totalAmount = quote.totals()['base_grand_total'],\n currencyCode = quote.totals()['base_currency_code'],\n billingAddress = quote.billingAddress(),\n requestObject;\n\n requestObject = {\n OrderDetails: {\n Amount: totalAmount * 100,\n CurrencyCode: currencyCode\n },\n Consumer: {\n Account: {\n AccountNumber: cardData.accountNumber,\n ExpirationMonth: cardData.expMonth,\n ExpirationYear: cardData.expYear,\n CardCode: cardData.cardCode\n },\n BillingAddress: {\n FirstName: billingAddress.firstname,\n LastName: billingAddress.lastname,\n Address1: billingAddress.street[0],\n Address2: billingAddress.street[1],\n City: billingAddress.city,\n State: billingAddress.region,\n PostalCode: billingAddress.postcode,\n CountryCode: billingAddress.countryId,\n Phone1: billingAddress.telep
2hone\n }\n }\n };\n\n return requestObject;\n },\n\n /**\n * Returns request JWT\n * @returns {String}\n */\n getRequestJWT: function () {\n return window.checkoutConfig.cardinal.requestJWT;\n },\n\n /**\n * Returns type of environment\n * @returns {String}\n */\n getEnvironment: function () {\n return window.checkoutConfig.cardinal.environment;\n }\n };\n});\n","Magento_CardinalCommerce/js/cardinal-factory.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\ndefine([\n 'jquery'\n], function ($) {\n 'use strict';\n\n return function (environment) {\n var deferred = $.Deferred(),\n dependency = 'cardinaljs';\n\n if (environment === 'sandbox') {\n dependency = 'cardinaljsSandbox';\n }\n\n require(\n [dependency],\n function (Cardinal) {\n deferred.resolve(Cardinal);\n },\n deferred.reject\n );\n\n return deferred.promise();\n };\n});\n","knockoutjs/knockout-fast-foreach.js":"/*!\n Knockout Fast Foreach v0.4.1 (2015-07-17T14:06:15.974Z)\n By: Brian M Hunt (C) 2015\n License: MIT\n\n Adds `fastForEach` to `ko.bindingHandlers`.\n*/\n(function (root, factory) {\n if (typeof define === 'function' && define.amd) {\n define(['knockout'], factory);\n } else if (typeof exports === 'object') {\n module.exports = factory(require('knockout'));\n } else {\n root.KnockoutFastForeach = factory(root.ko);\n }\n}(this, function (ko) {\n \"use strict\";\n// index.js\n// --------\n// Fast For Each\n//\n// Employing sound techniques to make a faster Knockout foreach binding.\n// --------\n\n// Utilities\n\n// from https://github.com/jonschlinkert/is-plain-object\nfunction isPlainObject(o) {\n return !!o && typeof o === 'object' && o.constructor === Object;\n}\n\n// From knockout/src/virtualElements.js\nvar commentNodesHaveTextProperty = document && document.createComment(\"test\").text === \"<!--test-->\";\nvar startCommentRegex = commentNodesHaveTextProperty ? /^<!--\\s*ko(?:\\s+([\\s\\S]+))?\\s*-->$/ : /^\\s*ko(?:\\s+([\\s\\S]+))?\\s*$/;\nvar supportsDocumentFragment = document && typeof document.createDocumentFragment === \"function\";\nfunction isVirtualNode(node) {\n return (node.nodeType === 8) && startCommentRegex.test(commentNodesHaveTextProperty ? node.text : node.nodeValue);\n}\n\n\n// Get a copy of the (possibly virtual) child nodes of the given element,\n// put them into a container, then empty the given node.\nfunction makeTemplateNode(sourceNode) {\n var container = document.createElement(\"div\");\n var parentNode;\n if (sourceNode.content) {\n // For e.g. <template> tags\n parentNode = sourceNode.content;\n } else if (sourceNode.tagName === 'SCRIPT') {\n parentNode = document.createElement(\"div\");\n parentNode.innerHTML = sourceNode.text;\n } else {\n // Anything else e.g. <div>\n parentNode = sourceNode;\n }\n ko.utils.arrayForEach(ko.virtualElements.childNodes(parentNode), function (child) {\n // FIXME - This cloneNode could be expensive; we may prefer to iterate over the\n // parentNode children in reverse (so as not to foul the indexes as childNodes are\n // removed from parentNode when inserted into the container)\n if (child) {\n container.insertBefore(child.cloneNode(true), null);\n }\n });\n return container;\n}\n\nfunction insertAllAfter(containerNode, nodeOrNodeArrayToInsert, insertAfterNode) {\n var frag, len, i;\n // poor man's node and array check, should be enough for this\n if (typeof nodeOrNodeArrayToInsert.nodeType !== \"undefined\" && typeof nodeOrNodeArrayToInsert.length === \"undefined\") {\n throw new Error(\"Expected a single node or a node array\");\n }\n\n if (typeof nodeOrNodeArrayToInsert.nodeType !== \"undefined\") {\n ko.virtualElements.insertAfter(containerNode, nodeOrNodeArrayToInsert, insertAfterNode);\n return;\n }\n\n if (nodeOrNodeArrayToInsert.length === 1) {\n ko.virtualElements.insertAfter(containerNode, nodeOrNodeArrayToInsert[0], insertAfterNode);\n return;\n }\n\n if (supportsDocumentFragment) {\n frag = document.createDocumentFragment();\n\n for (i = 0, len = nodeOrNodeArrayToInsert.length; i !== len; ++i) {\n frag.appendChild(nodeOrNodeArrayToInsert[i]);\n }\n ko.virtualElements.insertAfter(containerNode, frag, insertAfterNode);\n } else {\n // Nodes are inserted in reverse order - pushed down immediately after\n // the last node for the previous item or as the first node of element.\n for (i = nodeOrNodeArrayToInsert.length - 1; i >= 0; --i) {\n var child = nodeOrNodeArrayToInsert[i];\n if (!child) {\n return;\n }\n ko.virtualElements.insertAfter(containerNode, child, insertAfterNode);\n }\n }\n}\n\n// Mimic a KO change item 'add'\nfunction valueToChangeAddItem(value, index) {\n return {\n status: 'added',\n value: value,\n index: index\n };\n}\n\nfunction isAdditionAdjacentToLast(changeIndex, arrayChanges) {\n return changeIndex > 0 &&\n changeIndex < arrayChanges.length &&\n arrayChanges[changeIndex].status === \"added\" &&\n arrayChanges[changeIndex - 1].status === \"added\" &&\n arrayChanges[changeIndex - 1].index === arrayChanges[changeIndex].index - 1;\n}\n\nfunction FastForEach(spec) {\n this.element = spec.element;\n this.container = isVirtualNode(this.element) ?\n this.element.parentNode : this.element;\n this.$context = spec.$context;\n this.data = spec.data;\n this.as = spec.as;\n this.noContext = spec.noContext;\n this.templateNode = makeTemplateNode(\n spec.name ? document.getElementById(spec.name).cloneNode(true) : spec.element\n );\n this.afterQueueFlush = spec.afterQueueFlush;\n this.beforeQueueFlush = spec.beforeQueueFlush;\n this.changeQueue = [];\n this.lastNodesList = [];\n this.indexesToDelete = [];\n this.rendering_queued = false;\n\n // Remove existing content.\n ko.virtualElements.emptyNode(this.element);\n\n // Prime content\n var primeData = ko.unwrap(this.data);\n if (primeData.map) {\n this.onArrayChange(primeData.map(valueToChangeAddItem));\n }\n\n // Watch for changes\n if (ko.isObservable(this.data)) {\n if (!this.data.indexOf) {\n // Make sure the observable is trackable.\n this.data = this.data.extend({trackArrayChanges: true});\n }\n this.changeSubs = this.data.subscribe(this.onArrayChange, this, 'arrayChange');\n }\n}\n\n\nFastForEach.animateFrame = window.requestAnimationFrame || window.webkitRequestAnimationFrame ||\
2n window.mozRequestAnimationFrame || window.msRequestAnimationFrame ||\n function(cb) { return window.setTimeout(cb, 1000 / 60); };\n\n\nFastForEach.prototype.dispose = function () {\n if (this.changeSubs) {\n this.changeSubs.dispose();\n }\n};\n\n\n// If the array changes we register the change.\nFastForEach.prototype.onArrayChange = function (changeSet) {\n var self = this;\n var changeMap = {\n added: [],\n deleted: []\n };\n for (var i = 0, len = changeSet.length; i < len; i++) {\n // the change is appended to a last change info object when both are 'added' and have indexes next to each other\n // here I presume that ko is sending changes in monotonic order (in index variable) which happens to be true, tested with push and splice with multiple pushed values\n if (isAdditionAdjacentToLast(i, changeSet)) {\n var batchValues = changeMap.added[changeMap.added.length - 1].values;\n if (!batchValues) {\n // transform the last addition into a batch addition object\n var lastAddition = changeMap.added.pop();\n var batchAddition = {\n isBatch: true,\n status: 'added',\n index: lastAddition.index,\n values: [lastAddition.value]\n };\n batchValues = batchAddition.values;\n changeMap.added.push(batchAddition);\n }\n batchValues.push(changeSet[i].value);\n } else {\n changeMap[changeSet[i].status].push(changeSet[i]);\n }\n }\n if (changeMap.deleted.length > 0) {\n this.changeQueue.push.apply(this.changeQueue, changeMap.deleted);\n this.changeQueue.push({status: 'clearDeletedIndexes'});\n }\n this.changeQueue.push.apply(this.changeQueue, changeMap.added);\n // Once a change is registered, the ticking count-down starts for the processQueue.\n if (this.changeQueue.length > 0 && !this.rendering_queued) {\n this.rendering_queued = true;\n FastForEach.animateFrame.call(window, function () { self.processQueue(); });\n }\n};\n\n\n// Reflect all the changes in the queue in the DOM, then wipe the queue.\nFastForEach.prototype.processQueue = function () {\n var self = this;\n\n // Callback so folks can do things before the queue flush.\n if (typeof this.beforeQueueFlush === 'function') {\n this.beforeQueueFlush(this.changeQueue);\n }\n\n ko.utils.arrayForEach(this.changeQueue, function (changeItem) {\n // console.log(self.data(), \"CI\", JSON.stringify(changeItem, null, 2), JSON.stringify($(self.element).text()))\n self[changeItem.status](changeItem);\n // console.log(\" ==> \", JSON.stringify($(self.element).text()))\n });\n this.rendering_queued = false;\n // Callback so folks can do things.\n if (typeof this.afterQueueFlush === 'function') {\n this.afterQueueFlush(this.changeQueue);\n }\n this.changeQueue = [];\n};\n\n\n// Process a changeItem with {status: 'added', ...}\nFastForEach.prototype.added = function (changeItem) {\n var index = changeItem.index;\n var valuesToAdd = changeItem.isBatch ? changeItem.values : [changeItem.value];\n var referenceElement = this.lastNodesList[index - 1] || null;\n // gather all childnodes for a possible batch insertion\n var allChildNodes = [];\n\n for (var i = 0, len = valuesToAdd.length; i < len; ++i) {\n var templateClone = this.templateNode.cloneNode(true);\n var childContext;\n\n if (this.noContext) {\n childContext = this.$context.extend({\n '$item': valuesToAdd[i]\n });\n } else {\n childContext = this.$context.createChildContext(valuesToAdd[i], this.as || null);\n }\n\n // apply bindings first, and then process child nodes, because bindings can add childnodes\n ko.applyBindingsToDescendants(childContext, templateClone);\n\n var childNodes = ko.virtualElements.childNodes(templateClone);\n // Note discussion at https://github.com/angular/angular.js/issues/7851\n allChildNodes.push.apply(allChildNodes, Array.prototype.slice.call(childNodes));\n this.lastNodesList.splice(index + i, 0, childNodes[childNodes.length - 1]);\n }\n\n insertAllAfter(this.element, allChildNodes, referenceElement);\n};\n\n\n// Process a changeItem with {status: 'deleted', ...}\nFastForEach.prototype.deleted = function (changeItem) {\n var index = changeItem.index;\n var ptr = this.lastNodesList[index],\n // We use this.element because that will be the last previous node\n // for virtual element lists.\n lastNode = this.lastNodesList[index - 1] || this.element;
2\n do {\n ptr = ptr.previousSibling;\n ko.removeNode((ptr && ptr.nextSibling) || ko.virtualElements.firstChild(this.element));\n } while (ptr && ptr !== lastNode);\n // The \"last node\" in the DOM from which we begin our delets of the next adjacent node is\n // now the sibling that preceded the first node of this item.\n this.lastNodesList[index] = this.lastNodesList[index - 1];\n this.indexesToDelete.push(index);\n};\n\n\n// We batch our deletion of item indexes in our parallel array.\n// See brianmhunt/knockout-fast-foreach#6/#8\nFastForEach.prototype.clearDeletedIndexes = function () {\n // We iterate in reverse on the presumption (following the unit tests) that KO's diff engine\n // processes diffs (esp. deletes) monotonically ascending i.e. from index 0 -> N.\n for (var i = this.indexesToDelete.length - 1; i >= 0; --i) {\n this.lastNodesList.splice(this.indexesToDelete[i], 1);\n }\n this.indexesToDelete = [];\n};\n\n\nko.bindingHandlers.fastForEach = {\n // Valid valueAccessors:\n // []\n // ko.observable([])\n // ko.observableArray([])\n // ko.computed\n // {data: array, name: string, as: string}\n init: function init(element, valueAccessor, bindings, vm, context) {\n var value = valueAccessor(),\n ffe;\n if (isPlainObject(value)) {\n value.element = value.element || element;\n value.$context = context;\n ffe = new FastForEach(value);\n } else {\n ffe = new FastForEach({\n element: element,\n data: ko.unwrap(context.$rawData) === value ? context.$rawData : value,\n $context: context\n });\n }\n ko.utils.domNodeDisposal.addDisposeCallback(element, function () {\n ffe.dispose();\n });\n return {controlsDescendantBindings: true};\n },\n\n // Export for testing, debugging, and overloading.\n FastForEach: FastForEach\n};\n\nko.virtualElements.allowedBindings.fastForEach = true;\n}));","knockoutjs/knockout-repeat.js":"// REPEAT binding for Knockout http://knockoutjs.com/\n// (c) Michael Best\n// License: MIT (http://www.opensource.org/licenses/mit-license.php)\n// Version 2.1.0\n\n(function(factory) {\n if (typeof define === 'function' && define.amd) {\n // [1] AMD anonymous module\n define(['knockout'], factory);\n } else if (typeof exports === 'object') {\n // [2] commonJS\n factory(require('knockout'));\n } else {\n // [3] No module loader (plain <script> tag) - put directly in global namespace\n factory(window.ko);\n }\n})(function(ko) {\n\nif (!ko.virtualElements)\n throw Error('Repeat requires at least Knockout 2.1');\n\nvar ko_bindingFlags = ko.bindingFlags || {};\nvar ko_unwrap = ko.utils.unwrapObservable;\n\nvar koProtoName = '__ko_proto__';\n\nif (ko.version >= \"3.0.0\") {\n // In Knockout 3.0.0, use the node preprocessor to replace a node with a repeat binding with a virtual element\n var provider = ko.bindingProvider.instance, previousPreprocessFn = provider.preprocessNode;\n provider.preprocessNode = function(node) {\n var newNodes, nodeBinding;\n if (!previousPreprocessFn || !(newNodes = previousPreprocessFn.call(this, node))) {\n if (node.nodeType === 1 && (nodeBinding = node.getAttribute('data-bind'))) {\n if (/^\\s*repeat\\s*:/.test(nodeBinding)) {\n var leadingComment = node.ownerDocument.createComment('ko ' + nodeBinding),\n trailingComment = node.ownerDocument.createComment('/ko');\n node.parentNode.insertBefore(leadingComment, node);\n node.parentNode.insertBefore(trailingComment, node.nextSibling);\n node.removeAttribute('data-bind');\n newNodes = [leadingComment, node, trailingComment];\n }\n }\n }\n return newNodes;\n };\n}\n\nko.virtualElements.allowedBindings.repeat = true;\nko.bindingHandlers.repeat = {\n flags: ko_bindingFlags.contentBind | ko_bindingFlags.canUseVirtual,\n init: function(element, valueAccessor, allBindingsAccessor, xxx, bindingContext) {\n\n // Read and set fixed options--these options cannot be changed\n var repeatParam = ko_unwrap(valueAccessor());\n if (repeatParam && typeof repeatParam == 'object' && !('length' in repeatParam)) {\n var repeatIndex = repeatParam.index,\n repeatData = repeatParam.item,\n repeatStep = repeatParam.step,\n repeatRever
2sed = repeatParam.reverse,\n repeatBind = repeatParam.bind,\n repeatInit = repeatParam.init,\n repeatUpdate = repeatParam.update;\n }\n // Set default values for options that need it\n repeatIndex = repeatIndex || '$index';\n repeatData = repeatData || ko.bindingHandlers.repeat.itemName || '$item';\n repeatStep = repeatStep || 1;\n repeatReversed = repeatReversed || false;\n\n var parent = element.parentNode, placeholder;\n if (element.nodeType == 8) { // virtual element\n // Extract the \"children\" and find the single element node\n var childNodes = ko.utils.arrayFilter(ko.virtualElements.childNodes(element), function(node) { return node.nodeType == 1;});\n if (childNodes.length !== 1) {\n throw Error(\"Repeat binding requires a single element to repeat\");\n }\n ko.virtualElements.emptyNode(element);\n\n // The placeholder is the closing comment normally, or the opening comment if reversed\n placeholder = repeatReversed ? element : element.nextSibling;\n // The element to repeat is the contained element\n element = childNodes[0];\n } else { // regular element\n // First clean the element node and remove node's binding\n var origBindString = element.getAttribute('data-bind');\n ko.cleanNode(element);\n element.removeAttribute('data-bind');\n\n // Original element is no longer needed: delete it and create a placeholder comment\n placeholder = element.ownerDocument.createComment('ko_repeatplaceholder ' + origBindString);\n parent.replaceChild(placeholder, element);\n }\n\n // extract and remove a data-repeat-bind attribute, if present\n if (!repeatBind) {\n repeatBind = element.getAttribute('data-repeat-bind');\n if (repeatBind) {\n element.removeAttribute('data-repeat-bind');\n }\n }\n\n // Make a copy of the element node to be copied for each repetition\n var cleanNode = element.cloneNode(true);\n if (typeof repeatBind == \"string\") {\n cleanNode.setAttribute('data-bind', repeatBind);\n repeatBind = null;\n }\n\n // Set up persistent data\n var lastRepeatCount = 0,\n notificationObservable = ko.observable(),\n repeatArray, arrayObservable;\n\n if (repeatInit) {\n repeatInit(parent);\n }\n\n var subscribable = ko.computed(function() {\n function makeArrayItemAccessor(index) {\n var f = function(newValue) {\n var item = repeatArray[index];\n // Reading the value of the item\n if (!arguments.length) {\n notificationObservable(); // for dependency tracking\n return ko_unwrap(item);\n }\n // Writing a value to the item\n if (ko.isObservable(item)) {\n item(newValue);\n } else if (arrayObservable && arrayObservable.splice) {\n arrayObservable.splice(index, 1, newValue);\n } else {\n repeatArray[index] = newValue;\n }\n return this;\n };\n // Pretend that our accessor function is an observable\n f[koProtoName] = ko.observable;\n return f;\n }\n\n function makeBinding(item, index, context) {\n return repeatArray\n ? function() { return repeatBind.call(bindingContext.$data, item, index, context); }\n : function() { return repeatBind.call(bindingContext.$data, index, context); }\n }\n\n // Read and set up variable options--these options can change and will update the binding\n var paramObservable = valueAccessor(), repeatParam = ko_unwrap(paramObservable), repeatCount = 0;\n if (repeatParam && typeof repeatParam == 'object') {\n if ('length' in repeatParam) {\n repeatArray = repeatParam;\n repeatCount = repeatArray.length;\n } else {\n if ('foreach' in repeatParam) {\n repeatArray = ko_unwrap(paramObservable = repeatParam.foreach);\n if (repeatArray && typeof repeatArray == 'object' && 'length' in repeatArray) {\n repeatCount = repeatArray.length || 0;\n } else {\n repeatCount = repeatArray || 0;\n repeatArray = null;\n }\n }\n // If a count value is provided (>0), always output that number of items\n if ('
2count' in repeatParam)\n repeatCount = ko_unwrap(repeatParam.count) || repeatCount;\n // If a limit is provided, don't output more than the limit\n if ('limit' in repeatParam)\n repeatCount = Math.min(repeatCount, ko_unwrap(repeatParam.limit)) || repeatCount;\n }\n arrayObservable = repeatArray && ko.isObservable(paramObservable) ? paramObservable : null;\n } else {\n repeatCount = repeatParam || 0;\n }\n\n // Remove nodes from end if array is shorter\n for (; lastRepeatCount > repeatCount; lastRepeatCount-=repeatStep) {\n ko.removeNode(repeatReversed ? placeholder.nextSibling : placeholder.previousSibling);\n }\n\n // Notify existing nodes of change\n notificationObservable.notifySubscribers();\n\n // Add nodes to end if array is longer (also initially populates nodes)\n for (; lastRepeatCount < repeatCount; lastRepeatCount+=repeatStep) {\n // Clone node and add to document\n var newNode = cleanNode.cloneNode(true);\n parent.insertBefore(newNode, repeatReversed ? placeholder.nextSibling : placeholder);\n newNode.setAttribute('data-repeat-index', lastRepeatCount);\n\n // Apply bindings to inserted node\n if (repeatArray && repeatData == '$data') {\n var newContext = bindingContext.createChildContext(makeArrayItemAccessor(lastRepeatCount));\n } else {\n var newContext = bindingContext.extend();\n if (repeatArray)\n newContext[repeatData] = makeArrayItemAccessor(lastRepeatCount);\n }\n newContext[repeatIndex] = lastRepeatCount;\n if (repeatBind) {\n var result = ko.applyBindingsToNode(newNode, makeBinding(newContext[repeatData], lastRepeatCount, newContext), newContext, true),\n shouldBindDescendants = result && result.shouldBindDescendants;\n }\n if (!repeatBind || (result && shouldBindDescendants !== false)) {\n ko.applyBindings(newContext, newNode);\n }\n }\n if (repeatUpdate) {\n repeatUpdate(parent);\n }\n }, null, {disposeWhenNodeIsRemoved: placeholder});\n\n return { controlsDescendantBindings: true, subscribable: subscribable };\n }\n};\n});","knockoutjs/knockout-es5.js":"/*!\n * Knockout ES5 plugin - https://github.com/SteveSanderson/knockout-es5\n * Copyright (c) Steve Sanderson\n * MIT license\n */\n\n(function(global, undefined) {\n 'use strict';\n\n var ko;\n\n // Model tracking\n // --------------\n //\n // This is the central feature of Knockout-ES5. We augment model objects by converting properties\n // into ES5 getter/setter pairs that read/write an underlying Knockout observable. This means you can\n // use plain JavaScript syntax to read/write the property while still getting the full benefits of\n // Knockout's automatic dependency detection and notification triggering.\n //\n // For comparison, here's Knockout ES3-compatible syntax:\n //\n // var firstNameLength = myModel.user().firstName().length; // Read\n // myModel.user().firstName('Bert'); // Write\n //\n // ... versus Knockout-ES5 syntax:\n //\n // var firstNameLength = myModel.user.firstName.length; // Read\n // myModel.user.firstName = 'Bert'; // Write\n\n // `ko.track(model)` converts each property on the given model object into a getter/setter pair that\n // wraps a Knockout observable. Optionally specify an array of property names to wrap; otherwise we\n // wrap all properties. If any of the properties are already observables, we replace them with\n // ES5 getter/setter pairs that wrap your original observable instances. In the case of readonly\n // ko.computed properties, we simply do not define a setter (so attempted writes will be ignored,\n // which is how ES5 readonly properties normally behave).\n //\n // By design, this does *not* recursively walk child object properties, because making literally\n // everything everywhere independently observable is usually unhelpful. When you do want to track\n // child object properties independently, define your own class for those child objects and put\n // a separate ko.track call into
2its constructor --- this gives you far more control.\n /**\n * @param {object} obj\n * @param {object|array.<string>} propertyNamesOrSettings\n * @param {boolean} propertyNamesOrSettings.deep Use deep track.\n * @param {array.<string>} propertyNamesOrSettings.fields Array of property names to wrap.\n * todo: @param {array.<string>} propertyNamesOrSettings.exclude Array of exclude property names to wrap.\n * todo: @param {function(string, *):boolean} propertyNamesOrSettings.filter Function to filter property \n * names to wrap. A function that takes ... params\n * @return {object}\n */\n function track(obj, propertyNamesOrSettings) {\n if (!obj || typeof obj !== 'object') {\n throw new Error('When calling ko.track, you must pass an object as the first parameter.');\n }\n\n var propertyNames;\n\n if ( isPlainObject(propertyNamesOrSettings) ) {\n // defaults\n propertyNamesOrSettings.deep = propertyNamesOrSettings.deep || false;\n propertyNamesOrSettings.fields = propertyNamesOrSettings.fields || Object.getOwnPropertyNames(obj);\n propertyNamesOrSettings.lazy = propertyNamesOrSettings.lazy || false;\n\n wrap(obj, propertyNamesOrSettings.fields, propertyNamesOrSettings);\n } else {\n propertyNames = propertyNamesOrSettings || Object.getOwnPropertyNames(obj);\n wrap(obj, propertyNames, {});\n }\n\n return obj;\n }\n\n // fix for ie\n var rFunctionName = /^function\\s*([^\\s(]+)/;\n function getFunctionName( ctor ){\n if (ctor.name) {\n return ctor.name;\n }\n return (ctor.toString().trim().match( rFunctionName ) || [])[1];\n }\n\n function canTrack(obj) {\n return obj && typeof obj === 'object' && getFunctionName(obj.constructor) === 'Object';\n }\n\n function createPropertyDescriptor(originalValue, prop, map) {\n var isObservable = ko.isObservable(originalValue);\n var isArray = !isObservable && Array.isArray(originalValue);\n var observable = isObservable ? originalValue\n : isArray ? ko.observableArray(originalValue)\n : ko.observable(originalValue);\n\n map[prop] = function () { return observable; };\n\n // add check in case the object is already an observable array\n if (isArray || (isObservable && 'push' in observable)) {\n notifyWhenPresentOrFutureArrayValuesMutate(ko, observable);\n }\n\n return {\n configurable: true,\n enumerable: true,\n get: observable,\n set: ko.isWriteableObservable(observable) ? observable : undefined\n };\n }\n\n function createLazyPropertyDescriptor(originalValue, prop, map) {\n if (ko.isObservable(originalValue)) {\n // no need to be lazy if we already have an observable\n return createPropertyDescriptor(originalValue, prop, map);\n }\n\n var observable;\n\n function getOrCreateObservable(value, writing) {\n if (observable) {\n return writing ? observable(value) : observable;\n }\n\n if (Array.isArray(value)) {\n observable = ko.observableArray(value);\n notifyWhenPresentOrFutureArrayValuesMutate(ko, observable);\n return observable;\n }\n\n return (observable = ko.observable(value));\n }\n\n map[prop] = function () { return getOrCreateObservable(originalValue); };\n return {\n configurable: true,\n enumerable: true,\n get: function () { return getOrCreateObservable(originalValue)(); },\n set: function (value) { getOrCreateObservable(value, true); }\n };\n }\n\n function wrap(obj, props, options) {\n if (!props.length) {\n return;\n }\n\n var allObservablesForObject = getAllObservablesForObject(obj, true);\n var descriptors = {};\n\n props.forEach(function (prop) {\n // Skip properties that are already tracked\n if (prop in allObservablesForObject) {\n return;\n }\n\n // Skip properties where descriptor can't be redefined\n if (Object.getOwnPropertyDescriptor(obj, prop).configurable === false){\n return;\n }\n\n var originalValue = obj[prop];
2\n descriptors[prop] = (options.lazy ? createLazyPropertyDescriptor : createPropertyDescriptor)\n (originalValue, prop, allObservablesForObject);\n\n if (options.deep && canTrack(originalValue)) {\n wrap(originalValue, Object.keys(originalValue), options);\n }\n });\n\n Object.defineProperties(obj, descriptors);\n }\n\n function isPlainObject( obj ){\n return !!obj && typeof obj === 'object' && obj.constructor === Object;\n }\n\n // Lazily created by `getAllObservablesForObject` below. Has to be created lazily because the\n // WeakMap factory isn't available until the module has finished loading (may be async).\n var objectToObservableMap;\n\n // Gets or creates the hidden internal key-value collection of observables corresponding to\n // properties on the model object.\n function getAllObservablesForObject(obj, createIfNotDefined) {\n if (!objectToObservableMap) {\n objectToObservableMap = weakMapFactory();\n }\n\n var result = objectToObservableMap.get(obj);\n if (!result && createIfNotDefined) {\n result = {};\n objectToObservableMap.set(obj, result);\n }\n return result;\n }\n\n // Removes the internal references to observables mapped to the specified properties\n // or the entire object reference if no properties are passed in. This allows the\n // observables to be replaced and tracked again.\n function untrack(obj, propertyNames) {\n if (!objectToObservableMap) {\n return;\n }\n\n if (arguments.length === 1) {\n objectToObservableMap['delete'](obj);\n } else {\n var allObservablesForObject = getAllObservablesForObject(obj, false);\n if (allObservablesForObject) {\n propertyNames.forEach(function(propertyName) {\n delete allObservablesForObject[propertyName];\n });\n }\n }\n }\n\n // Computed properties\n // -------------------\n //\n // The preceding code is already sufficient to upgrade ko.computed model properties to ES5\n // getter/setter pairs (or in the case of readonly ko.computed properties, just a getter).\n // These then behave like a regular property with a getter function, except they are smarter:\n // your evaluator is only invoked when one of its dependencies changes. The result is cached\n // and used for all evaluations until the next time a dependency changes).\n //\n // However, instead of forcing developers to declare a ko.computed property explicitly, it's\n // nice to offer a utility function that declares a computed getter directly.\n\n // Implements `ko.defineProperty`\n function defineComputedProperty(obj, propertyName, evaluatorOrOptions) {\n var ko = this,\n computedOptions = { owner: obj, deferEvaluation: true };\n\n if (typeof evaluatorOrOptions === 'function') {\n computedOptions.read = evaluatorOrOptions;\n } else {\n if ('value' in evaluatorOrOptions) {\n throw new Error('For ko.defineProperty, you must not specify a \"value\" for the property. ' +\n 'You must provide a \"get\" function.');\n }\n\n if (typeof evaluatorOrOptions.get !== 'function') {\n throw new Error('For ko.defineProperty, the third parameter must be either an evaluator function, ' +\n 'or an options object containing a function called \"get\".');\n }\n\n computedOptions.read = evaluatorOrOptions.get;\n computedOptions.write = evaluatorOrOptions.set;\n }\n\n obj[propertyName] = ko.computed(computedOptions);\n track.call(ko, obj, [propertyName]);\n return obj;\n }\n\n // Array handling\n // --------------\n //\n // Arrays are special, because unlike other property types, they have standard mutator functions\n // (`push`/`pop`/`splice`/etc.) and it's desirable to trigger a change notification whenever one of\n // those mutator functions is invoked.\n //\n // Traditionally, Knockout handles this by putting special versions of `push`/`pop`/etc. on observable\n // arrays that mutate the underlying array and then trigger a notification. That approach doesn't\n // work for Knockout-ES5 because properties now return the underlying arrays, so the mutator runs\n // in the context of the underlying array, not any particular observable:\n //\n // // Operates on the underlying array value\
2n // myModel.someCollection.push('New value');\n //\n // To solve this, Knockout-ES5 detects array values, and modifies them as follows:\n // 1. Associates a hidden subscribable with each array instance that it encounters\n // 2. Intercepts standard mutators (`push`/`pop`/etc.) and makes them trigger the subscribable\n // Then, for model properties whose values are arrays, the property's underlying observable\n // subscribes to the array subscribable, so it can trigger a change notification after mutation.\n\n // Given an observable that underlies a model property, watch for any array value that might\n // be assigned as the property value, and hook into its change events\n function notifyWhenPresentOrFutureArrayValuesMutate(ko, observable) {\n var watchingArraySubscription = null;\n ko.computed(function () {\n // Unsubscribe to any earlier array instance\n if (watchingArraySubscription) {\n watchingArraySubscription.dispose();\n watchingArraySubscription = null;\n }\n\n // Subscribe to the new array instance\n var newArrayInstance = observable();\n if (newArrayInstance instanceof Array) {\n watchingArraySubscription = startWatchingArrayInstance(ko, observable, newArrayInstance);\n }\n });\n }\n\n // Listens for array mutations, and when they happen, cause the observable to fire notifications.\n // This is used to make model properties of type array fire notifications when the array changes.\n // Returns a subscribable that can later be disposed.\n function startWatchingArrayInstance(ko, observable, arrayInstance) {\n var subscribable = getSubscribableForArray(ko, arrayInstance);\n return subscribable.subscribe(observable);\n }\n\n // Lazily created by `getSubscribableForArray` below. Has to be created lazily because the\n // WeakMap factory isn't available until the module has finished loading (may be async).\n var arraySubscribablesMap;\n\n // Gets or creates a subscribable that fires after each array mutation\n function getSubscribableForArray(ko, arrayInstance) {\n if (!arraySubscribablesMap) {\n arraySubscribablesMap = weakMapFactory();\n }\n\n var subscribable = arraySubscribablesMap.get(arrayInstance);\n if (!subscribable) {\n subscribable = new ko.subscribable();\n arraySubscribablesMap.set(arrayInstance, subscribable);\n\n var notificationPauseSignal = {};\n wrapStandardArrayMutators(arrayInstance, subscribable, notificationPauseSignal);\n addKnockoutArrayMutators(ko, arrayInstance, subscribable, notificationPauseSignal);\n }\n\n return subscribable;\n }\n\n // After each array mutation, fires a notification on the given subscribable\n function wrapStandardArrayMutators(arrayInstance, subscribable, notificationPauseSignal) {\n ['pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift'].forEach(function(fnName) {\n var origMutator = arrayInstance[fnName];\n arrayInstance[fnName] = function() {\n var result = origMutator.apply(this, arguments);\n if (notificationPauseSignal.pause !== true) {\n subscribable.notifySubscribers(this);\n }\n return result;\n };\n });\n }\n\n // Adds Knockout's additional array mutation functions to the array\n function addKnockoutArrayMutators(ko, arrayInstance, subscribable, notificationPauseSignal) {\n ['remove', 'removeAll', 'destroy', 'destroyAll', 'replace'].forEach(function(fnName) {\n // Make it a non-enumerable property for consistency with standard Array functions\n Object.defineProperty(arrayInstance, fnName, {\n enumerable: false,\n value: function() {\n var result;\n\n // These additional array mutators are built using the underlying push/pop/etc.\n // mutators, which are wrapped to trigger notifications. But we don't want to\n // trigger multiple notifications, so pause the push/pop/etc. wrappers and\n // delivery only one notification at the end of the process.\n notificationPauseSignal.pause = true;\n try {\n // Creates a temporary observableArray that can perform the operation.\n result = ko.observableArray.fn[fnName].apply(ko.observableArray(arrayInstance), arguments);\n }\n finally {\n notificationPauseSignal.pause = false;\n }\n subscribable.notifySubscribers(arrayInstance);\n return result;\n }\n });\n });\n }\n\n // Static utility functions\n // ------------------------\n //\n // Since Knockout-ES5 sets up properties that return values, not observables, you can't\n // trivially subscribe to the underlying observables (e.g., `someProperty.subscribe(...)`),\n // or tell them that object values have mutated, etc. To handle this, we set up some\n // extra utility functions that can return or work with the underlying observables.\n\n // Returns the underlying observable associated with a model property (or `null` if the\n // model or property doesn't exist, or isn't associated with an observable). This means\n // you can subscribe to the property, e.g.:\n //\n // ko.getObservable(model, 'propertyName')\n // .subscribe(function(newValue) { ... });
2\n function getObservable(obj, propertyName) {\n if (!obj || typeof obj !== 'object') {\n return null;\n }\n\n var allObservablesForObject = getAllObservablesForObject(obj, false);\n if (allObservablesForObject && propertyName in allObservablesForObject) {\n return allObservablesForObject[propertyName]();\n }\n\n return null;\n }\n \n // Returns a boolean indicating whether the property on the object has an underlying\n // observables. This does the check in a way not to create an observable if the\n // object was created with lazily created observables\n function isTracked(obj, propertyName) {\n if (!obj || typeof obj !== 'object') {\n return false;\n }\n \n var allObservablesForObject = getAllObservablesForObject(obj, false);\n return !!allObservablesForObject && propertyName in allObservablesForObject;\n }\n\n // Causes a property's associated observable to fire a change notification. Useful when\n // the property value is a complex object and you've modified a child property.\n function valueHasMutated(obj, propertyName) {\n var observable = getObservable(obj, propertyName);\n\n if (observable) {\n observable.valueHasMutated();\n }\n }\n\n // Module initialisation\n // ---------------------\n //\n // When this script is first evaluated, it works out what kind of module loading scenario\n // it is in (Node.js or a browser `<script>` tag), stashes a reference to its dependencies\n // (currently that's just the WeakMap shim), and then finally attaches itself to whichever\n // instance of Knockout.js it can find.\n\n // A function that returns a new ES6-compatible WeakMap instance (using ES5 shim if needed).\n // Instantiated by prepareExports, accounting for which module loader is being used.\n var weakMapFactory;\n\n // Extends a Knockout instance with Knockout-ES5 functionality\n function attachToKo(ko) {\n ko.track = track;\n ko.untrack = untrack;\n ko.getObservable = getObservable;\n ko.valueHasMutated = valueHasMutated;\n ko.defineProperty = defineComputedProperty;\n\n // todo: test it, maybe added it to ko. directly\n ko.es5 = {\n getAllObservablesForObject: getAllObservablesForObject,\n notifyWhenPresentOrFutureArrayValuesMutate: notifyWhenPresentOrFutureArrayValuesMutate,\n isTracked: isTracked\n };\n }\n\n // Determines which module loading scenario we're in, grabs dependencies, and attaches to KO\n function prepareExports() {\n if (typeof exports === 'object' && typeof module === 'object') {\n // Node.js case - load KO and WeakMap modules synchronously\n ko = require('knockout');\n var WM = require('../lib/weakmap');\n attachToKo(ko);\n weakMapFactory = function() { return new WM(); };\n module.exports = ko;\n } else if (typeof define === 'function' && define.amd) {\n define(['knockout'], function(koModule) {\n ko = koModule;\n attachToKo(koModule);\n weakMapFactory = function() { return new global.WeakMap(); };\n return koModule;\n });\n } else if ('ko' in global) {\n // Non-module case - attach to the global instance, and assume a global WeakMap constructor\n ko = global.ko;\n attachToKo(global.ko);\n weakMapFactory = function() { return new global.WeakMap(); };\n }\n }\n\n prepareExports();\n\n})(this);"} 3}});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.