PageSourceSearch

https://pariseventicket.com/pub/static/version1786020772/frontend/…/fr_FR/js/bundle/bundle11.js

js pariseventicket.com collected 2026-10-04 23:22:44 UTC 801,295 bytes, 3 lines download raw bytes

1require.config({"config": {
2        "jsbuild":{"Potato_Zendesk/js/tiny_mce/plugins/table/editor_plugin.js":"(function(d){var e=d.each;function c(g,h){var j=h.ownerDocument,f=j.createRange(),k;f.setStartBefore(h);f.setEnd(g.endContainer,g.endOffset);k=j.createElement(\"body\");k.appendChild(f.cloneContents());return k.innerHTML.replace(/<(br|img|object|embed|input|textarea)[^>]*>/gi,\"-\").replace(/<[^>]+>/g,\"\").length==0}function a(g,f){return parseInt(g.getAttribute(f)||1)}function b(H,G,K){var g,L,D,o;t();o=G.getParent(K.getStart(),\"th,td\");if(o){L=F(o);D=I();o=z(L.x,L.y)}function A(N,M){N=N.cloneNode(M);N.removeAttribute(\"id\");return N}function t(){var M=0;g=[];e([\"thead\",\"tbody\",\"tfoot\"],function(N){var O=G.select(\"> \"+N+\" tr\",H);e(O,function(P,Q){Q+=M;e(G.select(\"> td, > th\",P),function(W,R){var S,T,U,V;if(g[Q]){while(g[Q][R]){R++}}U=a(W,\"rowspan\");V=a(W,\"colspan\");for(T=Q;T<Q+U;T++){if(!g[T]){g[T]=[]}for(S=R;S<R+V;S++){g[T][S]={part:N,real:T==Q&&S==R,elm:W,rowspan:U,colspan:V}}}})});M+=O.length})}function z(M,O){var N;N=g[O];if(N){return N[M]}}function s(O,M,N){if(O){N=parseInt(N);if(N===1){O.removeAttribute(M,1)}else{O.setAttribute(M,N,1)}}}function j(M){return M&&(G.hasClass(M.elm,\"mceSelected\")||M==o)}function k(){var M=[];e(H.rows,function(N){e(N.cells,function(O){if(G.hasClass(O,\"mceSelected\")||O==o.elm){M.push(N);return false}})});return M}function r(){var M=G.createRng();M.setStartAfter(H);M.setEndAfter(H);K.setRng(M);G.remove(H)}function f(M){var N;d.walk(M,function(P){var O;if(P.nodeType==3){e(G.getParents(P.parentNode,null,M).reverse(),function(Q){Q=A(Q,false);if(!N){N=O=Q}else{if(O){O.appendChild(Q)}}O=Q});if(O){O.innerHTML=d.isIE?\"&nbsp;\":'<br data-mce-bogus=\"1\" />'}return false}},\"childNodes\");M=A(M,false);s(M,\"rowSpan\",1);s(M,\"colSpan\",1);if(N){M.appendChild(N)}else{if(!d.isIE){M.innerHTML='<br data-mce-bogus=\"1\" />'}}return M}function q(){var M=G.createRng();e(G.select(\"tr\",H),function(N){if(N.cells.length==0){G.remove(N)}});if(G.select(\"tr\",H).length==0){M.setStartAfter(H);M.setEndAfter(H);K.setRng(M);G.remove(H);return}e(G.select(\"thead,tbody,tfoot\",H),function(N){if(N.rows.length==0){G.remove(N)}});t();row=g[Math.min(g.length-1,L.y)];if(row){K.select(row[Math.min(row.length-1,L.x)].elm,true);K.collapse(true)}}function u(S,Q,U,R){var P,N,M,O,T;P=g[Q][S].elm.parentNode;for(M=1;M<=U;M++){P=G.getNext(P,\"tr\");if(P){for(N=S;N>=0;N--){T=g[Q+M][N].elm;if(T.parentNode==P){for(O=1;O<=R;O++){G.insertAfter(f(T),T)}break}}if(N==-1){for(O=1;O<=R;O++){P.insertBefore(f(P.cells[0]),P.cells[0])}}}}}function C(){e(g,function(M,N){e(M,function(P,O){var S,R,T,Q;if(j(P)){P=P.elm;S=a(P,\"colspan\");R=a(P,\"rowspan\");if(S>1||R>1){s(P,\"rowSpan\",1);s(P,\"colSpan\",1);for(Q=0;Q<S-1;Q++){G.insertAfter(f(P),P)}u(O,N,R-1,S)}}})})}function p(V,S,Y){var P,O,X,W,U,R,T,M,V,N,Q;if(V){pos=F(V);P=pos.x;O=pos.y;X=P+(S-1);W=O+(Y-1)}else{P=L.x;O=L.y;X=D.x;W=D.y}T=z(P,O);M=z(X,W);if(T&&M&&T.part==M.part){C();t();T=z(P,O).elm;s(T,\"colSpan\",(X-P)+1);s(T,\"rowSpan\",(W-O)+1);for(R=O;R<=W;R++){for(U=P;U<=X;U++){if(!g[R]||!g[R][U]){continue}V=g[R][U].elm;if(V!=T){N=d.grep(V.childNodes);e(N,function(Z){T.appendChild(Z)});if(N.length){N=d.grep(T.childNodes);Q=0;e(N,function(Z){if(Z.nodeName==\"BR\"&&G.getAttrib(Z,\"data-mce-bogus\")&&Q++<N.length-1){T.removeChild(Z)}})}G.remove(V)}}}q()}}function l(Q){var M,S,P,R,T,U,N,V,O;e(g,function(W,X){e(W,function(Z,Y){if(j(Z)){Z=Z.elm;T=Z.parentNode;U=A(T,false);M=X;if(Q){return false}}});if(Q){return !M}});for(R=0;R<g[0].length;R++){if(!g[M][R]){continue}S=g[M][R].elm;if(S!=P){if(!Q){O=a(S,\"rowspan\");if(O>1){s(S,\"rowSpan\",O+1);continue}}else{if(M>0&&g[M-1][R]){V=g[M-1][R].elm;O=a(V,\"rowSpan\");if(O>1){s(V,\"rowSpan\",O+1);continue}}}N=f(S);
2s(N,\"colSpan\",S.colSpan);U.appendChild(N);P=S}}if(U.hasChildNodes()){if(!Q){G.insertAfter(U,T)}else{T.parentNode.insertBefore(U,T)}}}function h(N){var O,M;e(g,function(P,Q){e(P,function(S,R){if(j(S)){O=R;if(N){return false}}});if(N){return !O}});e(g,function(S,T){var P,Q,R;if(!S[O]){return}P=S[O].elm;if(P!=M){R=a(P,\"colspan\");Q=a(P,\"rowspan\");if(R==1){if(!N){G.insertAfter(f(P),P);u(O,T,Q-1,R)}else{P.parentNode.insertBefore(f(P),P);u(O,T,Q-1,R)}}else{s(P,\"colSpan\",P.colSpan+1)}M=P}})}function n(){var M=[];e(g,function(N,O){e(N,function(Q,P){if(j(Q)&&d.inArray(M,P)===-1){e(g,function(T){var R=T[P].elm,S;S=a(R,\"colSpan\");if(S>1){s(R,\"colSpan\",S-1)}else{G.remove(R)}});M.push(P)}})});q()}function m(){var N;function M(Q){var P,R,O;P=G.getNext(Q,\"tr\");e(Q.cells,function(S){var T=a(S,\"rowSpan\");if(T>1){s(S,\"rowSpan\",T-1);R=F(S);u(R.x,R.y,1,1)}});R=F(Q.cells[0]);e(g[R.y],function(S){var T;S=S.elm;if(S!=O){T=a(S,\"rowSpan\");if(T<=1){G.remove(S)}else{s(S,\"rowSpan\",T-1)}O=S}})}N=k();e(N.reverse(),function(O){M(O)});q()}function E(){var M=k();G.remove(M);q();return M}function J(){var M=k();e(M,function(O,N){M[N]=A(O,true)});return M}function B(O,N){var P=k(),M=P[N?0:P.length-1],Q=M.cells.length;e(g,function(S){var R;Q=0;e(S,function(U,T){if(U.real){Q+=U.colspan}if(U.elm.parentNode==M){R=1}});if(R){return false}});if(!N){O.reverse()}e(O,function(T){var S=T.cells.length,R;for(i=0;i<S;i++){R=T.cells[i];s(R,\"colSpan\",1);s(R,\"rowSpan\",1)}for(i=S;i<Q;i++){T.appendChild(f(T.cells[S-1]))}for(i=Q;i<S;i++){G.remove(T.cells[i])}if(N){M.parentNode.insertBefore(T,M)}else{G.insertAfter(T,M)}})}function F(M){var N;e(g,function(O,P){e(O,function(R,Q){if(R.elm==M){N={x:Q,y:P};return false}});return !N});return N}function w(M){L=F(M)}function I(){var O,N,M;N=M=0;e(g,function(P,Q){e(P,function(S,R){var U,T;if(j(S)){S=g[Q][R];if(R>N){N=R}if(Q>M){M=Q}if(S.real){U=S.colspan-1;T=S.rowspan-1;if(U){if(R+U>N){N=R+U}}if(T){if(Q+T>M){M=Q+T}}}}})});return{x:N,y:M}}function v(S){var P,O,U,T,N,M,Q,R;D=F(S);if(L&&D){P=Math.min(L.x,D.x);O=Math.min(L.y,D.y);U=Math.max(L.x,D.x);T=Math.max(L.y,D.y);N=U;M=T;for(y=O;y<=M;y++){S=g[y][P];if(!S.real){if(P-(S.colspan-1)<P){P-=S.colspan-1}}}for(x=P;x<=N;x++){S=g[O][x];if(!S.real){if(O-(S.rowspan-1)<O){O-=S.rowspan-1}}}for(y=O;y<=T;y++){for(x=P;x<=U;x++){S=g[y][x];if(S.real){Q=S.colspan-1;R=S.rowspan-1;if(Q){if(x+Q>N){N=x+Q}}if(R){if(y+R>M){M=y+R}}}}}G.removeClass(G.select(\"td.mceSelected,th.mceSelected\"),\"mceSelected\");for(y=O;y<=M;y++){for(x=P;x<=N;x++){if(g[y][x]){G.addClass(g[y][x].elm,\"mceSelected\")}}}}}d.extend(this,{deleteTable:r,split:C,merge:p,insertRow:l,insertCol:h,deleteCols:n,deleteRows:m,cutRows:E,copyRows:J,pasteRows:B,getPos:F,setStartCell:w,setEndCell:v})}d.create(\"tinymce.plugins.TablePlugin\",{init:function(g,h){var f,m,j=true;function l(p){var o=g.selection,n=g.dom.getParent(p||o.getNode(),\"table\");if(n){return new b(n,g.dom,o)}}function k(){g.getBody().style.webkitUserSelect=\"\";if(j){g.dom.removeClass(g.dom.select(\"td.mceSelected,th.mceSelected\"),\"mceSelected\");j=false}}e([[\"table\",\"table.desc\",\"mceInsertTable\",true],[\"delete_table\",\"table.del\",\"mceTableDelete\"],[\"delete_col\",\"table.delete_col_desc\",\"mceTableDeleteCol\"],[\"delete_row\",\"table.delete_row_desc\",\"mceTableDeleteRow\"],[\"col_after\",\"table.col_after_desc\",\"mceTableInsertColAfter\"],[\"col_before\",\"table.col_before_desc\",\"mceTableInsertColBefore\"],[\"row_after\",\"table.row_after_desc\",\"mceTableInsertRowAfter\"],[\"row_before\",\"table.row_before_desc\",\"mceTableInsertRowBefore\"],[\"row_props\",\"table.row_desc\",\"mceTableRowProps\",true],[\"cell_props\",\"table.cell_desc\",\"mceTableCellProps\",true],[\"split_cells\",\"table.split_cells_desc\",\"mceTableSplitCells\",true],[\"merge_cells\",\"table.merge_cells_desc\",\"mceTableMergeCells\",true]],function(n){g.addButton(n[0],{title:n[1],cmd:n[2],ui:n[3]})});if(!d.isIE){g.onClick.add(function(n,o){o=o.target;if(o.nodeName===\"TABLE\"){n.selection.select(o);n.nodeChanged()}})}g.onPreProcess.add(function(o,p){var n,q,r,t=o.dom,s;n=t.select(\"table\",p.node);q=n.length;while(q--){r=n[q];t.setAttrib(r,\"data-mce-style\",\"\");if((s=t.getAttrib(r,\"width\"))){t.setStyle(r,\"width\",s);t.setAttrib(r,\"width\",\"\")}
2if((s=t.getAttrib(r,\"height\"))){t.setStyle(r,\"height\",s);t.setAttrib(r,\"height\",\"\")}}});g.onNodeChange.add(function(q,o,s){var r;s=q.selection.getStart();r=q.dom.getParent(s,\"td,th,caption\");o.setActive(\"table\",s.nodeName===\"TABLE\"||!!r);if(r&&r.nodeName===\"CAPTION\"){r=0}o.setDisabled(\"delete_table\",!r);o.setDisabled(\"delete_col\",!r);o.setDisabled(\"delete_table\",!r);o.setDisabled(\"delete_row\",!r);o.setDisabled(\"col_after\",!r);o.setDisabled(\"col_before\",!r);o.setDisabled(\"row_after\",!r);o.setDisabled(\"row_before\",!r);o.setDisabled(\"row_props\",!r);o.setDisabled(\"cell_props\",!r);o.setDisabled(\"split_cells\",!r);o.setDisabled(\"merge_cells\",!r)});g.onInit.add(function(r){var p,t,q=r.dom,u;f=r.windowManager;r.onMouseDown.add(function(w,z){if(z.button!=2){k();t=q.getParent(z.target,\"td,th\");p=q.getParent(t,\"table\")}});q.bind(r.getDoc(),\"mouseover\",function(C){var A,z,B=C.target;if(t&&(u||B!=t)&&(B.nodeName==\"TD\"||B.nodeName==\"TH\")){z=q.getParent(B,\"table\");if(z==p){if(!u){u=l(z);u.setStartCell(t);r.getBody().style.webkitUserSelect=\"none\"}u.setEndCell(B);j=true}A=r.selection.getSel();try{if(A.removeAllRanges){A.removeAllRanges()}else{A.empty()}}catch(w){}C.preventDefault()}});r.onMouseUp.add(function(F,G){var z,B=F.selection,H,I=B.getSel(),w,C,A,E;if(t){if(u){F.getBody().style.webkitUserSelect=\"\"}function D(J,L){var K=new d.dom.TreeWalker(J,J);do{if(J.nodeType==3&&d.trim(J.nodeValue).length!=0){if(L){z.setStart(J,0)}else{z.setEnd(J,J.nodeValue.length)}return}if(J.nodeName==\"BR\"){if(L){z.setStartBefore(J)}else{z.setEndBefore(J)}return}}while(J=(L?K.next():K.prev()))}H=q.select(\"td.mceSelected,th.mceSelected\");if(H.length>0){z=q.createRng();C=H[0];E=H[H.length-1];z.setStartBefore(C);z.setEndAfter(C);D(C,1);w=new d.dom.TreeWalker(C,q.getParent(H[0],\"table\"));do{if(C.nodeName==\"TD\"||C.nodeName==\"TH\"){if(!q.hasClass(C,\"mceSelected\")){break}A=C}}while(C=w.next());D(A);B.setRng(z)}F.nodeChanged();t=u=p=null}});r.onKeyUp.add(function(w,z){k()});r.onKeyDown.add(function(w,z){n(w)});r.onMouseDown.add(function(w,z){if(z.button!=2){n(w)}});function o(D,z,A,F){var B=3,G=D.dom.getParent(z.startContainer,\"TABLE\"),C,w,E;if(G){C=G.parentNode}w=z.startContainer.nodeType==B&&z.startOffset==0&&z.endOffset==0&&F&&(A.nodeName==\"TR\"||A==C);E=(A.nodeName==\"TD\"||A.nodeName==\"TH\")&&!F;return w||E}function n(A){if(!d.isWebKit){return}var z=A.selection.getRng();var C=A.selection.getNode();var B=A.dom.getParent(z.startContainer,\"TD,TH\");if(!o(A,z,C,B)){return}if(!B){B=C}var w=B.lastChild;while(w.lastChild){w=w.lastChild}z.setEnd(w,w.nodeValue.length);A.selection.setRng(z)}r.plugins.table.fixTableCellSelection=n;if(r&&r.plugins.contextmenu){r.plugins.contextmenu.onContextMenu.add(function(A,w,C){var D,B=r.selection,z=B.getNode()||r.getBody();if(r.dom.getParent(C,\"td\")||r.dom.getParent(C,\"th\")||r.dom.select(\"td.mceSelected,th.mceSelected\").length){w.removeAll();if(z.nodeName==\"A\"&&!r.dom.getAttrib(z,\"name\")){w.add({title:\"advanced.link_desc\",icon:\"link\",cmd:r.plugins.advlink?\"mceAdvLink\":\"mceLink\",ui:true});w.add({title:\"advanced.unlink_desc\",icon:\"unlink\",cmd:\"UnLink\"});w.addSeparator()}if(z.nodeName==\"IMG\"&&z.className.indexOf(\"mceItem\")==-1){w.add({title:\"advanced.image_desc\",icon:\"image\",cmd:r.plugins.advimage?\"mceAdvImage\":\"mceImage\",ui:true});w.addSeparator()}w.add({title:\"table.desc\",icon:\"table\",cmd:\"mceInsertTable\",value:{action:\"insert\"}});w.add({title:\"table.props_desc\",icon:\"table_props\",cmd:\"mceInsertTable\"});w.add({title:\"table.del\",icon:\"delete_table\",cmd:\"mceTableDelete\"});w.addSeparator();D=w.addMenu({title:\"table.cell\"});D.add({title:\"table.cell_desc\",icon:\"cell_props\",cmd:\"mceTableCellProps\"});D.add({title:\"table.split_cells_desc\",icon:\"split_cells\",cmd:\"mceTableSplitCells\"});D.add({title:\"table.merge_cells_desc\",icon:\"merge_cells\",cmd:\"mceTableMergeCells\"});D=w.addMenu({title:\"table.row\"});D.add({title:\"table.row_desc\",icon:\"row_props\",cmd:\"mceTableRowProps\"});D.add({title:\"table.row_before_desc\",icon:\"row_before\",cmd:\"mceTableInsertRowBefore\"});D.add({title:\"table.row_after_desc\",icon:\"row_after\",cmd:\"mceTableInsertRowAfter\"});D.add({title:\"table.delete_row_desc\",icon:\"delete_row\",cmd:\"mceTableDeleteRow\"});D.addSeparator();D.add({title:\"table.cut_row_desc\",icon:\"cut\",cmd:\"mceTableCutRow\"});D.add({title:\"table.copy_row_desc\",icon:\"copy\",cmd:\"mceTableCopyRow\"});D.add({title:\"table.paste_row_before_desc\",icon:\"paste\",cmd:\"mceTablePasteRowBefore\"}).setDisabled(!m);D.add({title:\"table.paste_row_after_desc\",icon:\"paste\",cmd:\"mceTablePasteRowAfter\"}).setDisabled(!m);D=w.addMenu({title:\"table.col\"});D.add({title:\"table.col_before_desc\",icon:\"col_before\",cmd:\"mceTableInsertColBefore\"});D.add({title:\"table.col_after_desc\",icon:\"col_after\",cmd:\"mceTableInsertColAfter\"});D.add({title:\"table.delete_col_desc\",icon:\"delete_col\",cmd:\"mceTableDeleteCol\"})}else{w.add({title:\"table.desc\",icon:\"table\",cmd:\"mceInsertTable\"})}})}if(d.isWebKit){function v(C,N){var L=d.VK;var Q=N.keyCode;function O(Y,U,S){var T=Y?\"previousSibling\":\"nextSibling\";var Z=C.dom.getParent(U,\"tr\");var X=Z[T];if(X){z(C,U,X,Y);d.dom.Event.cancel(S);return true}else{var aa=C.dom.getParent(Z,\"table\");var W=Z.parentNode;var R=W.nodeName.toLowerCase();if(R===\"tbody\"||R===(Y?\"tfoot\":\"thead\")){var V=w(Y,aa,W,\"tbody\");if(V!==null){return K(Y,V,U,S)}}return M(Y,Z,T,aa,S)}}function w(V,T,U,X){var S=C.dom.select(\">\"+X,T);var R=S.indexOf(U);if(V&&R===0||!V&&R===S.length-1){return B(V,T)}else{if(R===-1){var W=U.tagName.toLowerCase()===\"thead\"?0:S.length-1;return S[W]}else{return S[R+(V?-1:1)]}}}function B(U,T){var S=U?\"thead\":\"tfoot\";var R=C.dom.select(\">\"+S,T);return R.length!==0?R[0]:null}function K(V,T,S,U){var R=J(T,V);R&&z(C,S,R,V);d.dom.Event.cancel(U);return true}function M(Y,U,R,X,W){var S=X[R];if(S){F(S);return true}else{var V=C.dom.getParent(X,\"td,th\");if(V){return O(Y,V,W)}else{var T=J(U,!Y);F(T);return d.dom.Event.cancel(W)}}}function J(S,R){return S&&S[R?\"lastChild\":\"firstChild\"]}function F(R){C.selection.setCursorLocation(R,0)}function A(){return Q==L.UP||Q==L.DOWN}function D(R){var T=R.selection.getNode();var S=R.dom.getParent(T,\"tr\");return S!==null}function P(S){var R=0;var T=S;while(T.previousSibling){T=T.previousSibling;R=R+a(T,\"colspan\")}return R}function E(T,R){var U=0;var S=0;e(T.children,function(V,W){U=U+a(V,\"colspan\");S=W;if(U>R){return false}});return S}function z(T,W,Y,V){var X=P(T.dom.getParent(W,\"td,th\"));var S=E(Y,X);var R=Y.childNodes[S];var U=J(R,V);F(U||R)}function H(R){var T=C.selection.getNode();var U=C.dom.getParent(T,\"td,th\");var S=C.dom.getParent(R,\"td,th\");return U&&U!==S&&I(U,S)}function I(S,R){return C.dom.getParent(S,\"TABLE\")===C.dom.getParent(R,\"TABLE\")}if(A()&&D(C)){var G=C.selection.getNode();setTimeout(function(){if(H(G)){O(!N.shiftKey&&Q===L.UP,G,N)}},0)}}r.onKeyDown.add(v)}if(!d.isIE){function s(){var w;for(w=r.getBody().lastChild;w&&w.nodeType==3&&!w.nodeValue.length;w=w.previousSibling){}if(w&&w.nodeName==\"TABLE\"){r.dom.add(r.getBody(),\"p\",null,'<br mce_bogus=\"1\" />')}}if(d.isGecko){r.onKeyDown.add(function(z,B){var w,A,C=z.dom;if(B.keyCode==37||B.keyCode==38){w=z.selection.getRng();A=C.getParent(w.startContainer,\"table\");if(A&&z.getBody().firstChild==A){if(c(w,A)){w=C.createRng();w.setStartBefore(A);w.setEndBefore(A);z.selection.setRng(w);B.preventDefault()}}}})}r.onKeyUp.add(s);r.onSetContent.add(s);r.onVisualAid.add(s);r.onPreProcess.add(function(w,A){var z=A.node.lastChild;if(z&&z.childNodes.length==1&&z.firstChild.nodeName==\"BR\"){w.dom.remove(z)}});s();r.startContent=r.getContent({format:\"raw\"})}});e({mceTableSplitCells:function(n){n.split()},mceTableMergeCells:function(o){var p,q,n;n=g.dom.getParent(g.selection.getNode(),\"th,td\");
2if(n){p=n.rowSpan;q=n.colSpan}if(!g.dom.select(\"td.mceSelected,th.mceSelected\").length){f.open({url:h+\"/merge_cells.htm\",width:240+parseInt(g.getLang(\"table.merge_cells_delta_width\",0)),height:110+parseInt(g.getLang(\"table.merge_cells_delta_height\",0)),inline:1},{rows:p,cols:q,onaction:function(r){o.merge(n,r.cols,r.rows)},plugin_url:h})}else{o.merge()}},mceTableInsertRowBefore:function(n){n.insertRow(true)},mceTableInsertRowAfter:function(n){n.insertRow()},mceTableInsertColBefore:function(n){n.insertCol(true)},mceTableInsertColAfter:function(n){n.insertCol()},mceTableDeleteCol:function(n){n.deleteCols()},mceTableDeleteRow:function(n){n.deleteRows()},mceTableCutRow:function(n){m=n.cutRows()},mceTableCopyRow:function(n){m=n.copyRows()},mceTablePasteRowBefore:function(n){n.pasteRows(m,true)},mceTablePasteRowAfter:function(n){n.pasteRows(m)},mceTableDelete:function(n){n.deleteTable()}},function(o,n){g.addCommand(n,function(){var p=l();if(p){o(p);g.execCommand(\"mceRepaint\");k()}})});e({mceInsertTable:function(n){f.open({url:h+\"/table.htm\",width:400+parseInt(g.getLang(\"table.table_delta_width\",0)),height:320+parseInt(g.getLang(\"table.table_delta_height\",0)),inline:1},{plugin_url:h,action:n?n.action:0})},mceTableRowProps:function(){f.open({url:h+\"/row.htm\",width:400+parseInt(g.getLang(\"table.rowprops_delta_width\",0)),height:295+parseInt(g.getLang(\"table.rowprops_delta_height\",0)),inline:1},{plugin_url:h})},mceTableCellProps:function(){f.open({url:h+\"/cell.htm\",width:400+parseInt(g.getLang(\"table.cellprops_delta_width\",0)),height:295+parseInt(g.getLang(\"table.cellprops_delta_height\",0)),inline:1},{plugin_url:h})}},function(o,n){g.addCommand(n,function(p,q){o(q)})})}});d.PluginManager.add(\"table\",d.plugins.TablePlugin)})(tinymce);","Potato_Zendesk/js/tiny_mce/plugins/table/editor_plugin_src.js":"/**\n * editor_plugin_src.js\n *\n * Copyright 2009, Moxiecode Systems AB\n * Released under LGPL License.\n *\n * License: http://tinymce.moxiecode.com/license\n * Contributing: http://tinymce.moxiecode.com/contributing\n */\n\n(function(tinymce) {\n\tvar each = tinymce.each;\n\n\t// Checks if the selection/caret is at the start of the specified block element\n\tfunction isAtStart(rng, par) {\n\t\tvar doc = par.ownerDocument, rng2 = doc.createRange(), elm;\n\n\t\trng2.setStartBefore(par);\n\t\trng2.setEnd(rng.endContainer, rng.endOffset);\n\n\t\telm = doc.createElement('body');\n\t\telm.appendChild(rng2.cloneContents());\n\n\t\t// Check for text characters of other elements that should be treated as content\n\t\treturn elm.innerHTML.replace(/<(br|img|object|embed|input|textarea)[^>]*>/gi, '-').replace(/<[^>]+>/g, '').length == 0;\n\t};\n\n\tfunction getSpanVal(td, name) {\n\t\treturn parseInt(td.getAttribute(name) || 1);\n\t}\n\n\t/**\n\t * Table Grid class.\n\t */\n\tfunction TableGrid(table, dom, selection) {\n\t\tvar grid, startPos, endPos, selectedCell;\n\n\t\tbuildGrid();\n\t\tselectedCell = dom.getParent(selection.getStart(), 'th,td');\n\t\tif (selectedCell) {\n\t\t\tstartPos = getPos(selectedCell);\n\t\t\tendPos = findEndPos();\n\t\t\tselectedCell = getCell(startPos.x, startPos.y);\n\t\t}\n\n\t\tfunction cloneNode(node, children) {\n\t\t\tnode = node.cloneNode(children);\n\t\t\tnode.removeAttribute('id');\n\n\t\t\treturn node;\n\t\t}\n\n\t\tfunction buildGrid() {\n\t\t\tvar startY = 0;\n\n\t\t\tgrid = [];\n\n\t\t\teach(['thead', 'tbody', 'tfoot'], function(part) {\n\t\t\t\tvar rows = dom.select('> ' + part + ' tr', table);\n\n\t\t\t\teach(rows, function(tr, y) {\n\t\t\t\t\ty += startY;\n\n\t\t\t\t\teach(dom.select('> td, > th', tr), function(td, x) {\n\t\t\t\t\t\tvar x2, y2, rowspan, colspan;\n\n\t\t\t\t\t\t// Skip over existing cells produced by rowspan\n\t\t\t\t\t\tif (grid[y]) {\n\t\t\t\t\t\t\twhile (grid[y][x])\n\t\t\t\t\t\t\t\tx++;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Get col/rowspan from cell\n\t\t\t\t\t\trowspan = getSpanVal(td, 'rowspan');\n\t\t\t\t\t\tcolspan = getSpanVal(td, 'colspan');\n\n\t\t\t\t\t\t// Fill out rowspan/colspan right and down\n\t\t\t\t\t\tfor (y2 = y; y2 < y + rowspan; y2++) {\n\t\t\t\t\t\t\tif (!grid[y2])\n\t\t\t\t\t\t\t\tgrid[y2] = [];\n\n\t\t\t\t\t\t\tfor (x2 = x; x2 < x + colspan; x2++) {\n\t\t\t\t\t\t\t\tgrid[y2][x2] = {\n\t\t\t\t\t\t\t\t\tpart : part,\n\t\t\t\t\t\t\t\t\treal : y2 == y && x2 == x,\n\t\t\t\t\t\t\t\t\telm : td,\n\t\t\t\t\t\t\t\t\trowspan : rowspan,\n\t\t\t\t\t\t\t\t\tcolspan : colspan\n\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t});\n\n\t\t\t\tstartY += rows.length;\n\t\t\t});\n\t\t};\n\n\t\tfunction getCell(x, y) {\n\t\t\tvar row;\n\n\t\t\trow = grid[y];\n\t\t\tif (row)\n\t\t\t\treturn row[x];\n\t\t};\n\n\t\tfunction setSpanVal(td, name, val) {\n\t\t\tif (td) {\n\t\t\t\tval = parseInt(val);\n\n\t\t\t\tif (val === 1)\n\t\t\t\t\ttd.removeAttribute(name, 1);\n\t\t\t\telse\n\t\t\t\t\ttd.setAttribute(name, val, 1);\n\t\t\t}\n\t\t}\n\n\t\tfunction isCellSelected(cell) {\n\t\t\treturn cell && (dom.hasClass(cell.elm, 'mceSelected') || cell == selectedCell);\n\t\t};\n\n\t\tfunction getSelectedRows() {\n\t\t\tvar rows = [];\n\n\t\t\teach(table.rows, function(row) {\n\t\t\t\teach(row.cells, function(cell) {\n\t\t\t\t\tif (dom.hasClass(cell, 'mceSelected') || cell == selectedCell.elm) {\n\t\t\t\t\t\trows.push(row);\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t});\n\n\t\t\treturn rows;\n\t\t};\n\n\t\tfunction deleteTable() {\n\t\t\tvar rng = dom.createRng();\n\n\t\t\trng.setStartAfter(table);\n\t\t\trng.setEndAfter(table);\n\n\t\t\tselection.setRng(rng);\n\n\t\t\tdom.remove(table);\n\t\t};\n\n\t\tfunction cloneCell(cell) {\n\t\t\tvar formatNode;\n\n\t\t\t// Clone formats\n\t\t\ttinymce.walk(cell, function(node) {\n\t\t\t\tvar curNode;\n\n\t\t\t\tif (node.nodeType == 3) {\n\t\t\t\t\teach(dom.getParents(node.parentNode, null, cell).reverse(), function(node) {\n\t\t\t\t\t\tno
2de = cloneNode(node, false);\n\n\t\t\t\t\t\tif (!formatNode)\n\t\t\t\t\t\t\tformatNode = curNode = node;\n\t\t\t\t\t\telse if (curNode)\n\t\t\t\t\t\t\tcurNode.appendChild(node);\n\n\t\t\t\t\t\tcurNode = node;\n\t\t\t\t\t});\n\n\t\t\t\t\t// Add something to the inner node\n\t\t\t\t\tif (curNode)\n\t\t\t\t\t\tcurNode.innerHTML = tinymce.isIE ? '&nbsp;' : '<br data-mce-bogus=\"1\" />';\n\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}, 'childNodes');\n\n\t\t\tcell = cloneNode(cell, false);\n\t\t\tsetSpanVal(cell, 'rowSpan', 1);\n\t\t\tsetSpanVal(cell, 'colSpan', 1);\n\n\t\t\tif (formatNode) {\n\t\t\t\tcell.appendChild(formatNode);\n\t\t\t} else {\n\t\t\t\tif (!tinymce.isIE)\n\t\t\t\t\tcell.innerHTML = '<br data-mce-bogus=\"1\" />';\n\t\t\t}\n\n\t\t\treturn cell;\n\t\t};\n\n\t\tfunction cleanup() {\n\t\t\tvar rng = dom.createRng();\n\n\t\t\t// Empty rows\n\t\t\teach(dom.select('tr', table), function(tr) {\n\t\t\t\tif (tr.cells.length == 0)\n\t\t\t\t\tdom.remove(tr);\n\t\t\t});\n\n\t\t\t// Empty table\n\t\t\tif (dom.select('tr', table).length == 0) {\n\t\t\t\trng.setStartAfter(table);\n\t\t\t\trng.setEndAfter(table);\n\t\t\t\tselection.setRng(rng);\n\t\t\t\tdom.remove(table);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Empty header/body/footer\n\t\t\teach(dom.select('thead,tbody,tfoot', table), function(part) {\n\t\t\t\tif (part.rows.length == 0)\n\t\t\t\t\tdom.remove(part);\n\t\t\t});\n\n\t\t\t// Restore selection to start position if it still exists\n\t\t\tbuildGrid();\n\n\t\t\t// Restore the selection to the closest table position\n\t\t\trow = grid[Math.min(grid.length - 1, startPos.y)];\n\t\t\tif (row) {\n\t\t\t\tselection.select(row[Math.min(row.length - 1, startPos.x)].elm, true);\n\t\t\t\tselection.collapse(true);\n\t\t\t}\n\t\t};\n\n\t\tfunction fillLeftDown(x, y, rows, cols) {\n\t\t\tvar tr, x2, r, c, cell;\n\n\t\t\ttr = grid[y][x].elm.parentNode;\n\t\t\tfor (r = 1; r <= rows; r++) {\n\t\t\t\ttr = dom.getNext(tr, 'tr');
2\n\n\t\t\t\tif (tr) {\n\t\t\t\t\t// Loop left to find real cell\n\t\t\t\t\tfor (x2 = x; x2 >= 0; x2--) {\n\t\t\t\t\t\tcell = grid[y + r][x2].elm;\n\n\t\t\t\t\t\tif (cell.parentNode == tr) {\n\t\t\t\t\t\t\t// Append clones after\n\t\t\t\t\t\t\tfor (c = 1; c <= cols; c++)\n\t\t\t\t\t\t\t\tdom.insertAfter(cloneCell(cell), cell);\n\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (x2 == -1) {\n\t\t\t\t\t\t// Insert nodes before first cell\n\t\t\t\t\t\tfor (c = 1; c <= cols; c++)\n\t\t\t\t\t\t\ttr.insertBefore(cloneCell(tr.cells[0]), tr.cells[0]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t\tfunction split() {\n\t\t\teach(grid, function(row, y) {\n\t\t\t\teach(row, function(cell, x) {\n\t\t\t\t\tvar colSpan, rowSpan, newCell, i;\n\n\t\t\t\t\tif (isCellSelected(cell)) {\n\t\t\t\t\t\tcell = cell.elm;\n\t\t\t\t\t\tcolSpan = getSpanVal(cell, 'colspan');\n\t\t\t\t\t\trowSpan = getSpanVal(cell, 'rowspan');\n\n\t\t\t\t\t\tif (colSpan > 1 || rowSpan > 1) {\n\t\t\t\t\t\t\tsetSpanVal(cell, 'rowSpan', 1);\n\t\t\t\t\t\t\tsetSpanVal(cell, 'colSpan', 1);\n\n\t\t\t\t\t\t\t// Insert cells right\n\t\t\t\t\t\t\tfor (i = 0; i < colSpan - 1; i++)\n\t\t\t\t\t\t\t\tdom.insertAfter(cloneCell(cell), cell);\n\n\t\t\t\t\t\t\tfillLeftDown(x, y, rowSpan - 1, colSpan);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t});\n\t\t};\n\n\t\tfunction merge(cell, cols, rows) {\n\t\t\tvar startX, startY, endX, endY, x, y, startCell, endCell, cell, children, count;\n\n\t\t\t// Use specified cell and cols/rows\n\t\t\tif (cell) {\n\t\t\t\tpos = getPos(cell);\n\t\t\t\tstartX = pos.x;\n\t\t\t\tstartY = pos.y;\n\t\t\t\tendX = startX + (cols - 1);\n\t\t\t\tendY = startY + (rows - 1);\n\t\t\t} else {\n\t\t\t\t// Use selection\n\t\t\t\tstartX = startPos.x;\n\t\t\t\tstartY = startPos.y;\n\t\t\t\tendX = endPos.x;\n\t\t\t\tendY = endPos.y;\n\t\t\t}\n\n\t\t\t// Find start/end cells\n\t\t\tstartCell = getCell(startX, startY);\n\t\t\tendCell = getCell(endX, endY);\n\n\t\t\t// Check if the cells exists and if they are of the same part for example tbody = tbody\n\t\t\tif (startCell && endCell && startCell.part == endCell.part) {\n\t\t\t\t// Split and rebuild grid\n\t\t\t\tsplit();\n\t\t\t\tbuildGrid();
2\n\n\t\t\t\t// Set row/col span to start cell\n\t\t\t\tstartCell = getCell(startX, startY).elm;\n\t\t\t\tsetSpanVal(startCell, 'colSpan', (endX - startX) + 1);\n\t\t\t\tsetSpanVal(startCell, 'rowSpan', (endY - startY) + 1);\n\n\t\t\t\t// Remove other cells and add it's contents to the start cell\n\t\t\t\tfor (y = startY; y <= endY; y++) {\n\t\t\t\t\tfor (x = startX; x <= endX; x++) {\n\t\t\t\t\t\tif (!grid[y] || !grid[y][x])\n\t\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\t\tcell = grid[y][x].elm;\n\n\t\t\t\t\t\tif (cell != startCell) {\n\t\t\t\t\t\t\t// Move children to startCell\n\t\t\t\t\t\t\tchildren = tinymce.grep(cell.childNodes);\n\t\t\t\t\t\t\teach(children, function(node) {\n\t\t\t\t\t\t\t\tstartCell.appendChild(node);\n\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t\t// Remove bogus nodes if there is children in the target cell\n\t\t\t\t\t\t\tif (children.length) {\n\t\t\t\t\t\t\t\tchildren = tinymce.grep(startCell.childNodes);\n\t\t\t\t\t\t\t\tcount = 0;\n\t\t\t\t\t\t\t\teach(children, function(node) {\n\t\t\t\t\t\t\t\t\tif (node.nodeName == 'BR' && dom.getAttrib(node, 'data-mce-bogus') && count++ < children.length - 1)\n\t\t\t\t\t\t\t\t\t\tstartCell.removeChild(node);\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Remove cell\n\t\t\t\t\t\t\tdom.remove(cell);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Remove empty rows etc and restore caret location\n\t\t\t\tcleanup();\n\t\t\t}\n\t\t};\n\n\t\tfunction insertRow(before) {\n\t\t\tvar posY, cell, lastCell, x, rowElm, newRow, newCell, otherCell, rowSpan;\n\n\t\t\t// Find first/last row\n\t\t\teach(grid, function(row, y) {\n\t\t\t\teach(row, function(cell, x) {\n\t\t\t\t\tif (isCellSelected(cell)) {\n\t\t\t\t\t\tcell = cell.elm;\n\t\t\t\t\t\trowElm = cell.parentNode;\n\t\t\t\t\t\tnewRow = cloneNode(rowElm, false);\n\t\t\t\t\t\tposY = y;\n\n\t\t\t\t\t\tif (before)\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\tif (before)\n\t\t\t\t\treturn !posY;\n\t\t\t});\n\n\t\t\tfor (x = 0; x < grid[0].length; x++) {\n\t\t\t\t// Cell not found could be because of an invalid table structure\n\t\t\t\tif (!grid[posY][x])\n\t\t\t\t\tcontinue;\n\n\t\t\t\tcell = grid[posY][x].elm;\n\n\t\t\t\tif (cell != lastCell) {\n\t\t\t\t\tif (!before) {\n\t\t\t\t\t\trowSpan = getSpanVal(cell, 'rowspan');\n\t\t\t\t\t\tif (rowSpan > 1) {\n\t\t\t\t\t\t\tsetSpanVal(cell, 'rowSpan', rowSpan + 1);\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Check if cell above can be expanded\n\t\t\t\t\t\tif (posY > 0 && grid[posY - 1][x]) {\n\t\t\t\t\t\t\totherCell = grid[posY - 1][x].elm;\n\t\t\t\t\t\t\trowSpan = getSpanVal(otherCell, 'rowSpan');\n\t\t\t\t\t\t\tif (rowSpan > 1) {\n\t\t\t\t\t\t\t\tsetSpanVal(otherCell, 'rowSpan', rowSpan + 1);\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// Insert new cell into new row\n\t\t\t\t\tnewCell = cloneCell(cell);\n\t\t\t\t\tsetSpanVal(newCell, 'colSpan', cell.colSpan);\n\n\t\t\t\t\tnewRow.appendChild(newCell);\n\n\t\t\t\t\tlastCell = cell;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (newRow.hasChildNodes()) {\n\t\t\t\tif (!before)\n\t\t\t\t\tdom.insertAfter(newRow, rowElm);\n\t\t\t\telse\n\t\t\t\t\trowElm.parentNode.insertBefore(newRow, rowElm);\n\t\t\t}\n\t\t};\n\n\t\tfunction insertCol(before) {\n\t\t\tvar posX, lastCell;\n\n\t\t\t// Find first/last column\n\t\t\teach(grid, function(row, y) {\n\t\t\t\teach(row, function(cell, x) {\n\t\t\t\t\tif (isCellSelected(cell)) {\n\t\t\t\t\t\tposX = x;\n\n\t\t\t\t\t\tif (before)\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\tif (before)\n\t\t\t\t\treturn !posX;\n\t\t\t});\n\n\t\t\teach(grid, function(row, y) {\n\t\t\t\tvar cell, rowSpan, colSpan;\n\n\t\t\t\tif (!row[posX])\n\t\t\t\t\treturn;\n\n\t\t\t\tcell = row[posX].elm;\n\t\t\t\tif (cell != lastCell) {\n\t\t\t\t\tcolSpan = getSpanVal(cell, 'colspan');\n\t\t\t\t\trowSpan = getSpanVal(cell, 'rowspan');\n\n\t\t\t\t\tif (colSpan == 1) {\n\t\t\t\t\t\tif (!before) {\n\t\t\t\t\t\t\tdom.insertAfter(cloneCell(cell), cell);\n\t\t\t\t\t\t\tfillLeftDown(posX, y, rowSpan - 1, colSpan);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tcell.parentNode.insertBefore(cloneCell(cell), cell);\n\t\t\t\t\t\t\tfillLeftDown(posX, y, rowSpan - 1, colSpan);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else\n\t\t\t\t\t\tsetSpanVal(cell, 'colSpan', cell.colSpan + 1);\n\n\t\t\t\t\tlastCell = cell;\n\t\t\t\t}\n\t\t\t});\n\t\t};\n\n\t\tfunction deleteCols() {\n\t\t\tvar cols = [];\n\n\t\t\t// Get selected column indexes\n\t\t\teach(grid, function(row, y) {\n\t\t\t\teach(row, function(cell, x) {\n\t\t\t\t\tif (isCellSelected(cell) && tinymce.inArray(cols, x) === -1) {\n\t\t\t\t\t\teach(grid, function(row) {\n\t\t\t\t\t\t\tvar cell = row[x].elm, colSpan;\n\n\t\t\t\t\t\t\tcolSpan = getSpanVal(cell, 'colSpan');\n\n\t\t\t\t\t\t\tif (colSpan > 1)\n\t\t\t\t\t\t\t\tsetSpanVal(cell, 'colSpan', colSpan - 1);\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\tdom.remove(cell);\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\tcols.push(x);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t});\n\n\t\t\tcleanup();\n\t\t};\n\n\t\tfunction deleteRows() {\n\t\t\tvar rows;\n\n\t\t\tfunction deleteRow(tr) {\n\t\t\t\tvar nextTr, pos, lastCell;\n\n\t\t\t\tnextTr = dom.getNext(tr, 'tr');\n\n\t\t\t\t// Move down row spanned cells\n\t\t\t\teach(tr.cells, function(cell) {\n\t\t\t\t\tvar rowSpan = getSpanVal(cell, 'rowSpan');\n\n\t\t\t\t\tif (rowSpan > 1) {\n\t\t\t\t\t\tsetSpanVal(cell, 'rowSpan', rowSpan - 1);\n\t\t\t\t\t\tpos = getPos(cell);\n\t\t\t\t\t\tfillLeftDown(pos.x, pos.y, 1, 1);\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\t// Delete cells\n\t\t\t\tpos = getPos(tr.cells[0]);\n\t\t\t\teach(grid[pos.y], function(cell) {\n\t\t\t\t\tvar rowSpan;\n\n\t\t\t\t\tcell = cell.elm;\n\n\t\t\t\t\tif (cell != lastCell) {\n\t\t\t\t\t\trowSpan = getSpanVal(cell, 'rowSpan');\n\n\t\t\t\t\t\tif (rowSpan <= 1)\n\t\t\t\t\t\t\tdom.remove(cell);\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tsetSpanVal(cell, 'rowSpan', rowSpan - 1);\n\n\t\t\t\t\t\tlastCell = cell;\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t};\n\n\t\t\t// Get selected rows and move selection out of scope\n\t\t\trows = getSelectedRows();\n\n\t\t\t// Delete all selected rows\n\t\t\teach(rows.reverse(), function(tr) {\n\t\t\t\tdeleteRow(tr);\n\t\t\t});\n\n\t\t\tcleanup();\n\t\t};\n\n\t\tfunction cutRows() {\n\t\t\tvar rows = getSelectedRows();\n\n\t\t\tdom.remove(rows);\n\t\t\tcleanup();\n\n\t\t\treturn rows;\n\t\t};\n\n\t\tfunction copyRows() {\n\t\t\tvar rows = getSelectedRows();\n\n\t\t\teach(rows, function(row, i) {\n\t\t\t\trows[i] = cloneNode(row, true);\n\t\t\t});\n\n\t\t\treturn rows;\n\t\t};\n\n\t\tfunction pasteRows(rows, before) {\n\t\t\tvar selectedRows = getSelectedRows(),\n\t\t\t\ttargetRow = selectedRows[before ? 0 : selectedRows.length - 1],\n\t\t\t\ttargetCellCount = targetRow.cells.length;\n\n\t\t\t// Calc target cell count\n\t\t\teach(grid, function(row) {\n\t\t\t\tvar match;\n\n\t\t\t\ttargetCellCount = 0;\n\t\t\t\teach(row, function(cell, x) {\n\t\t\t\t\tif (cell.real)\n\t\t\t\t\t\ttargetCellCount += cell.colspan;\n\n\t\t\t\t\tif (cell.elm.parentNode == targetRow)\n\t\t\t\t\t\tmatch = 1;\n\t\t\t\t});\n\n\t\t\t\tif (match)\n\t\t\t\t\treturn false;\n\t\t\t});\n\n\t\t\tif (!before)\n\t\t\t\trows.reverse();\n\n\t\t\teach(rows, function(row) {\n\t\t\t\tvar cellCount = row.cells.length, cell;
2\n\n\t\t\t\t// Remove col/rowspans\n\t\t\t\tfor (i = 0; i < cellCount; i++) {\n\t\t\t\t\tcell = row.cells[i];\n\t\t\t\t\tsetSpanVal(cell, 'colSpan', 1);\n\t\t\t\t\tsetSpanVal(cell, 'rowSpan', 1);\n\t\t\t\t}\n\n\t\t\t\t// Needs more cells\n\t\t\t\tfor (i = cellCount; i < targetCellCount; i++)\n\t\t\t\t\trow.appendChild(cloneCell(row.cells[cellCount - 1]));\n\n\t\t\t\t// Needs less cells\n\t\t\t\tfor (i = targetCellCount; i < cellCount; i++)\n\t\t\t\t\tdom.remove(row.cells[i]);\n\n\t\t\t\t// Add before/after\n\t\t\t\tif (before)\n\t\t\t\t\ttargetRow.parentNode.insertBefore(row, targetRow);\n\t\t\t\telse\n\t\t\t\t\tdom.insertAfter(row, targetRow);\n\t\t\t});\n\t\t};\n\n\t\tfunction getPos(target) {\n\t\t\tvar pos;\n\n\t\t\teach(grid, function(row, y) {\n\t\t\t\teach(row, function(cell, x) {\n\t\t\t\t\tif (cell.elm == target) {\n\t\t\t\t\t\tpos = {x : x, y : y};\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\treturn !pos;\n\t\t\t});\n\n\t\t\treturn pos;\n\t\t};\n\n\t\tfunction setStartCell(cell) {\n\t\t\tstartPos = getPos(cell);\n\t\t};\n\n\t\tfunction findEndPos() {\n\t\t\tvar pos, maxX, maxY;\n\n\t\t\tmaxX = maxY = 0;\n\n\t\t\teach(grid, function(row, y) {\n\t\t\t\teach(row, function(cell, x) {\n\t\t\t\t\tvar colSpan, rowSpan;\n\n\t\t\t\t\tif (isCellSelected(cell)) {\n\t\t\t\t\t\tcell = grid[y][x];\n\n\t\t\t\t\t\tif (x > maxX)\n\t\t\t\t\t\t\tmaxX = x;\n\n\t\t\t\t\t\tif (y > maxY)\n\t\t\t\t\t\t\tmaxY = y;\n\n\t\t\t\t\t\tif (cell.real) {\n\t\t\t\t\t\t\tcolSpan = cell.colspan - 1;\n\t\t\t\t\t\t\trowSpan = cell.rowspan - 1;\n\n\t\t\t\t\t\t\tif (colSpan) {\n\t\t\t\t\t\t\t\tif (x + colSpan > maxX)\n\t\t\t\t\t\t\t\t\tmaxX = x + colSpan;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif (rowSpan) {\n\t\t\t\t\t\t\t\tif (y + rowSpan > maxY)\n\t\t\t\t\t\t\t\t\tmaxY = y + rowSpan;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t});\n\n\t\t\treturn {x : maxX, y : maxY};\n\t\t};\n\n\t\tfunction setEndCell(cell) {\n\t\t\tvar startX, startY, endX, endY, maxX, maxY, colSpan, rowSpan;\n\n\t\t\tendPos = getPos(cell);\n\n\t\t\tif (startPos && endPos) {\n\t\t\t\t// Get start/end positions\n\t\t\t\tstartX = Math.min(startPos.x, endPos.x);\n\t\t\t\tstartY = Math.min(startPos.y, endPos.y);\n\t\t\t\tendX = Math.max(startPos.x, endPos.x);\n\t\t\t\tendY = Math.max(startPos.y, endPos.y);\n\n\t\t\t\t// Expand end positon to include spans\n\t\t\t\tmaxX = endX;\n\t\t\t\tmaxY = endY;\n\n\t\t\t\t// Expand startX\n\t\t\t\tfor (y = startY; y <= maxY; y++) {\n\t\t\t\t\tcell = grid[y][startX];\n\n\t\t\t\t\tif (!cell.real) {\n\t\t\t\t\t\tif (startX - (cell.colspan - 1) < startX)\n\t\t\t\t\t\t\tstartX -= cell.colspan - 1;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Expand startY\n\t\t\t\tfor (x = startX; x <= maxX; x++) {\n\t\t\t\t\tcell = grid[startY][x];\n\n\t\t\t\t\tif (!cell.real) {\n\t\t\t\t\t\tif (startY - (cell.rowspan - 1) < startY)\n\t\t\t\t\t\t\tstartY -= cell.rowspan - 1;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Find max X, Y\n\t\t\t\tfor (y = startY; y <= endY; y++) {\n\t\t\t\t\tfor (x = startX; x <= endX; x++) {\n\t\t\t\t\t\tcell = grid[y][x];\n\n\t\t\t\t\t\tif (cell.real) {\n\t\t\t\t\t\t\tcolSpan = cell.colspan - 1;\n\t\t\t\t\t\t\trowSpan = cell.rowspan - 1;\n\n\t\t\t\t\t\t\tif (colSpan) {\n\t\t\t\t\t\t\t\tif (x + colSpan > maxX)\n\t\t\t\t\t\t\t\t\tmaxX = x + colSpan;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif (rowSpan) {\n\t\t\t\t\t\t\t\tif (y + rowSpan > maxY)\n\t\t\t\t\t\t\t\t\tmaxY = y + rowSpan;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Remove current selection\n\t\t\t\tdom.removeClass(dom.select('td.mceSelected,th.mceSelected'), 'mceSelected');\n\n\t\t\t\t// Add new selection\n\t\t\t\tfor (y = startY; y <= maxY; y++) {\n\t\t\t\t\tfor (x = startX; x <= maxX; x++) {\n\t\t\t\t\t\tif (grid[y][x])\n\t\t\t\t\t\t\tdom.addClass(grid[y][x].elm, 'mceSelected');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t\t// Expose to public\n\t\ttinymce.extend(this, {\n\t\t\tdeleteTable : deleteTable,\n\t\t\tsplit : split,\n\t\t\tmerge : merge,\n\t\t\tinsertRow : insertRow,\n\t\t\tinsertCol : insertCol,\n\t\t\tdeleteCols : deleteCols,\n\t\t\tdeleteRows : deleteRows,\n\t\t\tcutRows : cutRows,\n\t\t\tcopyRows : copyRows,\n\t\t\tpasteRows : pasteRows,\n\t\t\tgetPos : getPos,\n\t\t\tsetStartCell : setStartCell,\n\t\t\tsetEndCell : setEndCell\n\t\t});\n\t};\n\n\ttinymce.create('tinymce.plugins.TablePlugin', {\n\t\tinit : function(ed, url) {\n\t\t\tvar winMan, clipboardRows, hasCellSelection = true; // Might be selected cells on reload\n\n\t\t\tfunction createTableGrid(node) {\n\t\t\t\tvar selection = ed.selection, tblElm = ed.dom.getParent(node || selection.getNode(), 'table');\n\n\t\t\t\tif (tblElm)\n\t\t\t\t\treturn new TableGrid(tblElm, ed.dom, selection);\n\t\t\t};
2\n\n\t\t\tfunction cleanup() {\n\t\t\t\t// Restore selection possibilities\n\t\t\t\ted.getBody().style.webkitUserSelect = '';\n\n\t\t\t\tif (hasCellSelection) {\n\t\t\t\t\ted.dom.removeClass(ed.dom.select('td.mceSelected,th.mceSelected'), 'mceSelected');\n\t\t\t\t\thasCellSelection = false;\n\t\t\t\t}\n\t\t\t};\n\n\t\t\t// Register buttons\n\t\t\teach([\n\t\t\t\t['table', 'table.desc', 'mceInsertTable', true],\n\t\t\t\t['delete_table', 'table.del', 'mceTableDelete'],\n\t\t\t\t['delete_col', 'table.delete_col_desc', 'mceTableDeleteCol'],\n\t\t\t\t['delete_row', 'table.delete_row_desc', 'mceTableDeleteRow'],\n\t\t\t\t['col_after', 'table.col_after_desc', 'mceTableInsertColAfter'],\n\t\t\t\t['col_before', 'table.col_before_desc', 'mceTableInsertColBefore'],\n\t\t\t\t['row_after', 'table.row_after_desc', 'mceTableInsertRowAfter'],\n\t\t\t\t['row_before', 'table.row_before_desc', 'mceTableInsertRowBefore'],\n\t\t\t\t['row_props', 'table.row_desc', 'mceTableRowProps', true],\n\t\t\t\t['cell_props', 'table.cell_desc', 'mceTableCellProps', true],\n\t\t\t\t['split_cells', 'table.split_cells_desc', 'mceTableSplitCells', true],\n\t\t\t\t['merge_cells', 'table.merge_cells_desc', 'mceTableMergeCells', true]\n\t\t\t], function(c) {\n\t\t\t\ted.addButton(c[0], {title : c[1], cmd : c[2], ui : c[3]});\n\t\t\t});\n\n\t\t\t// Select whole table is a table border is clicked\n\t\t\tif (!tinymce.isIE) {\n\t\t\t\ted.onClick.add(function(ed, e) {\n\t\t\t\t\te = e.target;\n\n\t\t\t\t\tif (e.nodeName === 'TABLE') {\n\t\t\t\t\t\ted.selection.select(e);\n\t\t\t\t\t\ted.nodeChanged();\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\n\t\t\ted.onPreProcess.add(function(ed, args) {\n\t\t\t\tvar nodes, i, node, dom = ed.dom, value;\n\n\t\t\t\tnodes = dom.select('table', args.node);\n\t\t\t\ti = nodes.length;\n\t\t\t\twhile (i--) {\n\t\t\t\t\tnode = nodes[i];\n\t\t\t\t\tdom.setAttrib(node, 'data-mce-style', '');\n\n\t\t\t\t\tif ((value = dom.getAttrib(node, 'width'))) {\n\t\t\t\t\t\tdom.setStyle(node, 'width', value);\n\t\t\t\t\t\tdom.setAttrib(node, 'width', '');\n\t\t\t\t\t}\n\n\t\t\t\t\tif ((value = dom.getAttrib(node, 'height'))) {\n\t\t\t\t\t\tdom.setStyle(node, 'height', value);\n\t\t\t\t\t\tdom.setAttrib(node, 'height', '');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\n\t\t\t// Handle node change updates\n\t\t\ted.onNodeChange.add(function(ed, cm, n) {\n\t\t\t\tvar p;\n\n\t\t\t\tn = ed.selection.getStart();\n\t\t\t\tp = ed.dom.getParent(n, 'td,th,caption');\n\t\t\t\tcm.setActive('table', n.nodeName === 'TABLE' || !!p);\n\n\t\t\t\t// Disable table tools if we are in caption\n\t\t\t\tif (p && p.nodeName === 'CAPTION')\n\t\t\t\t\tp = 0;\n\n\t\t\t\tcm.setDisabled('delete_table', !p);\n\t\t\t\tcm.setDisabled('delete_col', !p);\n\t\t\t\tcm.setDisabled('delete_table', !p);\n\t\t\t\tcm.setDisabled('delete_row', !p);\n\t\t\t\tcm.setDisabled('col_after', !p);\n\t\t\t\tcm.setDisabled('col_before', !p);\n\t\t\t\tcm.setDisabled('row_after', !p);\n\t\t\t\tcm.setDisabled('row_before', !p);\n\t\t\t\tcm.setDisabled('row_props', !p);\n\t\t\t\tcm.setDisabled('cell_props', !p);\n\t\t\t\tcm.setDisabled('split_cells', !p);\n\t\t\t\tcm.setDisabled('merge_cells', !p);\n\t\t\t});\n\n\t\t\ted.onInit.add(function(ed) {\n\t\t\t\tvar startTable, startCell, dom = ed.dom, tableGrid;\n\n\t\t\t\twinMan = ed.windowManager;\n\n\t\t\t\t// Add cell selection logic\n\t\t\t\ted.onMouseDown.add(function(ed, e) {\n\t\t\t\t\tif (e.button != 2) {\n\t\t\t\t\t\tcleanup();\n\n\t\t\t\t\t\tstartCell = dom.getParent(e.target, 'td,th');\n\t\t\t\t\t\tstartTable = dom.getParent(startCell, 'table');\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\tdom.bind(ed.getDoc(), 'mouseover', function(e) {\n\t\t\t\t\tvar sel, table, target = e.target;\n\n\t\t\t\t\tif (startCell && (tableGrid || target != startCell) && (target.nodeName == 'TD' || target.nodeName == 'TH')) {\n\t\t\t\t\t\ttable = dom.getParent(target, 'table');\n\t\t\t\t\t\tif (table == startTable) {\n\t\t\t\t\t\t\tif (!tableGrid) {\n\t\t\t\t\t\t\t\ttableGrid = createTableGrid(table);\n\t\t\t\t\t\t\t\ttableGrid.setStartCell(startCell);\n\n\t\t\t\t\t\t\t\ted.getBody().style.webkitUserSelect = 'none';\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\ttableGrid.setEndCell(target);\n\t\t\t\t\t\t\thasCellSelection = true;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Remove current selection\n\t\t\t\t\t\tsel = ed.selection.getSel();\n\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tif (sel.removeAllRanges)\n\t\t\t\t\t\t\t\tsel.removeAllRanges();\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\tsel.empty();\n\t\t\t\t\t\t} catch (ex) {\n\t\t\t\t\t\t\t// IE9 might throw errors here\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\ted.onMouseUp.add(function(ed, e) {\n\t\t\t\t\tvar rng, sel = ed.selection, selectedCells, nativeSel = sel.getSel(), walker, node, lastNode, endNode;\n\n\t\t\t\t\t// Move selection to startCell\n\t\t\t\t\tif (startCell) {\n\t\t\t\t\t\tif (tableGrid)\n\t\t\t\t\t\t\ted.getBody().style.webkitUserSelect = '';\n\n\t\t\t\t\t\tfunction setPoint(node, start) {\n\t\t\t\t\t\t\tvar walker = new tinymce.dom.TreeWalker(node, node);\n\n\t\t\t\t\t\t\tdo {\n\t\t\t\t\t\t\t\t// Text node\n\t\t\t\t\t\t\t\tif (node.nodeType == 3 && tinymce.trim(node.nodeValue).length != 0) {\n\t\t\t\t\t\t\t\t\tif (start)\n\t\t\t\t\t\t\t\t\t\trng.setStart(node, 
20);\n\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t\trng.setEnd(node, node.nodeValue.length);\n\n\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t// BR element\n\t\t\t\t\t\t\t\tif (node.nodeName == 'BR') {\n\t\t\t\t\t\t\t\t\tif (start)\n\t\t\t\t\t\t\t\t\t\trng.setStartBefore(node);\n\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t\trng.setEndBefore(node);\n\n\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} while (node = (start ? walker.next() : walker.prev()));\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Try to expand text selection as much as we can only Gecko supports cell selection\n\t\t\t\t\t\tselectedCells = dom.select('td.mceSelected,th.mceSelected');\n\t\t\t\t\t\tif (selectedCells.length > 0) {\n\t\t\t\t\t\t\trng = dom.createRng();\n\t\t\t\t\t\t\tnode = selectedCells[0];\n\t\t\t\t\t\t\tendNode = selectedCells[selectedCells.length - 1];\n\t\t\t\t\t\t\trng.setStartBefore(node);\n\t\t\t\t\t\t\trng.setEndAfter(node);\n\n\t\t\t\t\t\t\tsetPoint(node, 1);\n\t\t\t\t\t\t\twalker = new tinymce.dom.TreeWalker(node, dom.getParent(selectedCells[0], 'table'));\n\n\t\t\t\t\t\t\tdo {\n\t\t\t\t\t\t\t\tif (node.nodeName == 'TD' || node.nodeName == 'TH') {\n\t\t\t\t\t\t\t\t\tif (!dom.hasClass(node, 'mceSelected'))\n\t\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\t\tlastNode = node;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} while (node = walker.next());\n\n\t\t\t\t\t\t\tsetPoint(lastNode);\n\n\t\t\t\t\t\t\tsel.setRng(rng);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\ted.nodeChanged();\n\t\t\t\t\t\tstartCell = tableGrid = startTable = null;\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\ted.onKeyUp.add(function(ed, e) {\n\t\t\t\t\tcleanup();\n\t\t\t\t});\n\n\t\t\t\ted.onKeyDown.add(function (ed, e) {\n\t\t\t\t\tfixTableCellSelection(ed);\n\t\t\t\t});\n\n\t\t\t\ted.onMouseDown.add(function (ed, e) {\n\t\t\t\t\tif (e.button != 2) {\n\t\t\t\t\t\tfixTableCellSelection(ed);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\tfunction tableCellSelected(ed, rng, n, currentCell) {\n\t\t\t\t\t// The decision of when a table cell is selected is somewhat involved.  The fact that this code is\n\t\t\t\t\t// required is actually a pointer to the root cause of this bug. A cell is selected when the start \n\t\t\t\t\t// and end offsets are 0, the start container is a text, and the selection node is either a TR (most cases)\n\t\t\t\t\t// or the parent of the table (in the case of the selection containing the last cell of a table).\n\t\t\t\t\tvar TEXT_NODE = 3, table = ed.dom.getParent(rng.startContainer, 'TABLE'), \n\t\t\t\t\ttableParent, allOfCellSelected, tableCellSelection;\n\t\t\t\t\tif (table) \n\t\t\t\t\ttableParent = table.parentNode;\n\t\t\t\t\tallOfCellSelected =rng.startContainer.nodeType == TEXT_NODE && \n\t\t\t\t\t\trng.startOffset == 0 && \n\t\t\t\t\t\trng.endOffset == 0 && \n\t\t\t\t\t\tcurrentCell && \n\t\t\t\t\t\t(n.nodeName==\"TR\" || n==tableParent);\n\t\t\t\t\ttableCellSelection = (n.nodeName==\"TD\"||n.nodeName==\"TH\")&& !currentCell;\t   \n\t\t\t\t\treturn  allOfCellSelected || tableCellSelection;\n\t\t\t\t\t// return false;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// this nasty hack is here to work around some WebKit selection bugs.\n\t\t\t\tfunction fixTableCellSelection(ed) {\n\t\t\t\t\tif (!tinymce.isWebKit)\n\t\t\t\t\t\treturn;\n\n\t\t\t\t\tvar rng = ed.selection.getRng();\n\t\t\t\t\tvar n = ed.selection.getNode();\n\t\t\t\t\tvar currentCell = ed.dom.getParent(rng.startContainer, 'TD,TH');\n\t\t\t\t\n\t\t\t\t\tif (!tableCellSelected(ed, rng, n, currentCell))\n\t\t\t\t\t\treturn;\n\t\t\t\t\t\tif (!currentCell) {\n\t\t\t\t\t\t\tcurrentCell=n;\n\t\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// Get the very last node inside the table cell\n\t\t\t\t\tvar end = currentCell.lastChild;\n\t\t\t\t\twhile (end.lastChild)\n\t\t\t\t\t\tend = end.lastChild;\n\t\t\t\t\t\n\t\t\t\t\t// Select the entire table cell. Nothing outside of the table cell should be selected.\n\t\t\t\t\trng.setEnd(end, end.nodeValue.length);\n\t\t\t\t\ted.selection.setRng(rng);\n\t\t\t\t}\n\t\t\t\ted.plugins.table.fixTableCellSelection=fixTableCellSelection;\n\n\t\t\t\t// Add context menu\n\t\t\t\tif (ed && ed.plugins.contextmenu) {\n\t\t\t\t\ted.plugins.contextmenu.onContextMenu.add(function(th, m, e) {\n\t\t\t\t\t\tvar sm, se = ed.selection, el = se.getNode() || ed.getBody();\n\n\t\t\t\t\t\tif (ed.dom.getParent(e, 'td') || ed.dom.getParent(e, 'th') || ed.dom.select('td.mceSelected,th.mceSelected').length) {\n\t\t\t\t\t\t\tm.removeAll();
2\n\n\t\t\t\t\t\t\tif (el.nodeName == 'A' && !ed.dom.getAttrib(el, 'name')) {\n\t\t\t\t\t\t\t\tm.add({title : 'advanced.link_desc', icon : 'link', cmd : ed.plugins.advlink ? 'mceAdvLink' : 'mceLink', ui : true});\n\t\t\t\t\t\t\t\tm.add({title : 'advanced.unlink_desc', icon : 'unlink', cmd : 'UnLink'});\n\t\t\t\t\t\t\t\tm.addSeparator();\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif (el.nodeName == 'IMG' && el.className.indexOf('mceItem') == -1) {\n\t\t\t\t\t\t\t\tm.add({title : 'advanced.image_desc', icon : 'image', cmd : ed.plugins.advimage ? 'mceAdvImage' : 'mceImage', ui : true});\n\t\t\t\t\t\t\t\tm.addSeparator();\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tm.add({title : 'table.desc', icon : 'table', cmd : 'mceInsertTable', value : {action : 'insert'}});\n\t\t\t\t\t\t\tm.add({title : 'table.props_desc', icon : 'table_props', cmd : 'mceInsertTable'});\n\t\t\t\t\t\t\tm.add({title : 'table.del', icon : 'delete_table', cmd : 'mceTableDelete'});\n\t\t\t\t\t\t\tm.addSeparator();\n\n\t\t\t\t\t\t\t// Cell menu\n\t\t\t\t\t\t\tsm = m.addMenu({title : 'table.cell'});\n\t\t\t\t\t\t\tsm.add({title : 'table.cell_desc', icon : 'cell_props', cmd : 'mceTableCellProps'});\n\t\t\t\t\t\t\tsm.add({title : 'table.split_cells_desc', icon : 'split_cells', cmd : 'mceTableSplitCells'});\n\t\t\t\t\t\t\tsm.add({title : 'table.merge_cells_desc', icon : 'merge_cells', cmd : 'mceTableMergeCells'});\n\n\t\t\t\t\t\t\t// Row menu\n\t\t\t\t\t\t\tsm = m.addMenu({title : 'table.row'});\n\t\t\t\t\t\t\tsm.add({title : 'table.row_desc', icon : 'row_props', cmd : 'mceTableRowProps'});\n\t\t\t\t\t\t\tsm.add({title : 'table.row_before_desc', icon : 'row_before', cmd : 'mceTableInsertRowBefore'});\n\t\t\t\t\t\t\tsm.add({title : 'table.row_after_desc', icon : 'row_after', cmd : 'mceTableInsertRowAfter'});\n\t\t\t\t\t\t\tsm.add({title : 'table.delete_row_desc', icon : 'delete_row', cmd : 'mceTableDeleteRow'});\n\t\t\t\t\t\t\tsm.addSeparator();\n\t\t\t\t\t\t\tsm.add({title : 'table.cut_row_desc', icon : 'cut', cmd : 'mceTableCutRow'});\n\t\t\t\t\t\t\tsm.add({title : 'table.copy_row_desc', icon : 'copy', cmd : 'mceTableCopyRow'});\n\t\t\t\t\t\t\tsm.add({title : 'table.paste_row_before_desc', icon : 'paste', cmd : 'mceTablePasteRowBefore'}).setDisabled(!clipboardRows);\n\t\t\t\t\t\t\tsm.add({title : 'table.paste_row_after_desc', icon : 'paste', cmd : 'mceTablePasteRowAfter'}).setDisabled(!clipboardRows);\n\n\t\t\t\t\t\t\t// Column menu\n\t\t\t\t\t\t\tsm = m.addMenu({title : 'table.col'});\n\t\t\t\t\t\t\tsm.add({title : 'table.col_before_desc', icon : 'col_before', cmd : 'mceTableInsertColBefore'});\n\t\t\t\t\t\t\tsm.add({title : 'table.col_after_desc', icon : 'col_after', cmd : 'mceTableInsertColAfter'});\n\t\t\t\t\t\t\tsm.add({title : 'table.delete_col_desc', icon : 'delete_col', cmd : 'mceTableDeleteCol'});\n\t\t\t\t\t\t} else\n\t\t\t\t\t\t\tm.add({title : 'table.desc', icon : 'table', cmd : 'mceInsertTable'});\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\t// Fix to allow navigating up and down in a table in WebKit browsers.\n\t\t\t\tif (tinymce.isWebKit) {\n\t\t\t\t\tfunction moveSelection(ed, e) {\n\t\t\t\t\t\tvar VK = tinymce.VK;\n\t\t\t\t\t\tvar key = e.keyCode;\n\n\t\t\t\t\t\tfunction handle(upBool, sourceNode, event) {\n\t\t\t\t\t\t\tvar siblingDirection = upBool ? 'previousSibling' : 'nextSibling';\n\t\t\t\t\t\t\tvar currentRow = ed.dom.getParent(sourceNode, 'tr');\n\t\t\t\t\t\t\tvar siblingRow = currentRow[siblingDirection];\n\n\t\t\t\t\t\t\tif (siblingRow) {\n\t\t\t\t\t\t\t\tmoveCursorToRow(ed, sourceNode, siblingRow, upBool);\n\t\t\t\t\t\t\t\ttinymce.dom.Event.cancel(event);\n\t\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tvar tableNode = ed.dom.getParent(currentRow, 'table');\n\t\t\t\t\t\t\t\tvar middleNode = currentRow.parentNode;\n\t\t\t\t\t\t\t\tvar parentNodeName = middleNode.nodeName.toLowerCase();\n\t\t\t\t\t\t\t\tif (parentNodeName === 'tbody' || parentNodeName === (upBool ? 'tfoot' : 'thead')) {\n\t\t\t\t\t\t\t\t\tvar targetParent = getTargetParent(upBool, tableNode, middleNode, 'tbody');\n\t\t\t\t\t\t\t\t\tif (targetParent !== null) {\n\t\t\t\t\t\t\t\t\t\treturn moveToRowInTarget(upBool, targetParent, sourceNode, event);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\treturn escapeTable(upBool, currentRow, siblingDirection, tableNode, event);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tfunction getTargetParent(upBool, topNode, secondNode, nodeName) {\n\t\t\t\t\t\t\tvar tbodies = ed.dom.select('>' + nodeName, topNode);\n\t\t\t\t\t\t\tvar position = tbodies.indexOf(secondNode);\n\t\t\t\t\t\t\tif (upBool && position === 0 || !upBool && position === tbodies.length - 1) {\n\t\t\t\t\t\t\t\treturn getFirstHeadOrFoot(upBool, topNode);\n\t\t\t\t\t\t\t} else if (position === -1) {\n\t\t\t\t\t\t\t\tvar topOrBottom = secondNode.tagName.toLowerCase() === 'thead' ? 0 : tbodies.length - 1;\n\t\t\t\t\t\t\t\treturn tbodies[topOrBottom];\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\treturn tbodies[position + (upBool ? -1 : 1)];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tfunction getFirstHeadOrFoot(upBool, parent) {\n\t\t\t\t\t\t\tvar tagName = upBool ? 'thead' : 'tfoot';\n\t\t\t\t\t\t\tvar headOrFoot = ed.dom.select('>' + tagName, parent);\n\t\t\t\t\t\t\treturn headOrFoot.length !== 0 ? headOrFoot[0] : null;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tfunction moveToRowInTarget(upBool, targetParent, sourceNode, event) {\n\t\t\t\t\t\t\tvar targetRow = getChildForDirection(targetParent, upBool);\n\t\t\t\t\t\t\ttargetRow && moveCursorToRow(ed, sourceNode, targetRow, upBool);\n\t\t\t\t\t\t\ttinymce.dom.Event.cancel(event);\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tfunction escapeTable(upBool, currentRow, siblingDirection, table, event) {\n\t\t\t\t\t\t\tvar tableSibling = table[siblingDirection];\n\t\t\t\t\t\t\tif (tableSibling) {\n\t\t\t\t\t\t\t\tmoveCursorToStartOfElement(tableSibling);\n\t\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tvar parentCell = ed.dom.getParent(table, 'td,th');\n\t\t\t\t\t\t\t\tif (parentCell) {\n\t\t\t\t\t\t\t\t\treturn handle(upBool, parentCell, event);\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tvar backUpSibling = getChildForDirection(currentRow, !upBool);\n\t\t\t\t\t\t\t\t\tmoveCursorToStartOfElement(backUpSibling);\n\t\t\t\t\t\t\t\t\treturn tinymce.dom.Event.cancel(event);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tfunction getChildForDirection(parent, up) {\n\t\t\t\t\t\t\treturn parent && parent[up ? 'lastChild' : 'firstChild'];\n\t\t\t\t\t\t}
2\n\n\t\t\t\t\t\tfunction moveCursorToStartOfElement(n) {\n\t\t\t\t\t\t\ted.selection.setCursorLocation(n, 0);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tfunction isVerticalMovement() {\n\t\t\t\t\t\t\treturn key == VK.UP || key == VK.DOWN;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tfunction isInTable(ed) {\n\t\t\t\t\t\t\tvar node = ed.selection.getNode();\n\t\t\t\t\t\t\tvar currentRow = ed.dom.getParent(node, 'tr');\n\t\t\t\t\t\t\treturn currentRow !== null;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tfunction columnIndex(column) {\n\t\t\t\t\t\t\tvar colIndex = 0;\n\t\t\t\t\t\t\tvar c = column;\n\t\t\t\t\t\t\twhile (c.previousSibling) {\n\t\t\t\t\t\t\t\tc = c.previousSibling;\n\t\t\t\t\t\t\t\tcolIndex = colIndex + getSpanVal(c, \"colspan\");\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn colIndex;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tfunction findColumn(rowElement, columnIndex) {\n\t\t\t\t\t\t\tvar c = 0;\n\t\t\t\t\t\t\tvar r = 0;\n\t\t\t\t\t\t\teach(rowElement.children, function(cell, i) {\n\t\t\t\t\t\t\t\tc = c + getSpanVal(cell, \"colspan\");\n\t\t\t\t\t\t\t\tr = i;\n\t\t\t\t\t\t\t\tif (c > columnIndex)\n\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\treturn r;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tfunction moveCursorToRow(ed, node, row, upBool) {\n\t\t\t\t\t\t\tvar srcColumnIndex = columnIndex(ed.dom.getParent(node, 'td,th'));\n\t\t\t\t\t\t\tvar tgtColumnIndex = findColumn(row, srcColumnIndex);\n\t\t\t\t\t\t\tvar tgtNode = row.childNodes[tgtColumnIndex];\n\t\t\t\t\t\t\tvar rowCellTarget = getChildForDirection(tgtNode, upBool);\n\t\t\t\t\t\t\tmoveCursorToStartOfElement(rowCellTarget || tgtNode);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tfunction shouldFixCaret(preBrowserNode) {\n\t\t\t\t\t\t\tvar newNode = ed.selection.getNode();\n\t\t\t\t\t\t\tvar newParent = ed.dom.getParent(newNode, 'td,th');\n\t\t\t\t\t\t\tvar oldParent = ed.dom.getParent(preBrowserNode, 'td,th');\n\t\t\t\t\t\t\treturn newParent && newParent !== oldParent && checkSameParentTable(newParent, oldParent)\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tfunction checkSameParentTable(nodeOne, NodeTwo) {\n\t\t\t\t\t\t\treturn ed.dom.getParent(nodeOne, 'TABLE') === ed.dom.getParent(NodeTwo, 'TABLE');\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (isVerticalMovement() && isInTable(ed)) {\n\t\t\t\t\t\t\tvar preBrowserNode = ed.selection.getNode();\n\t\t\t\t\t\t\tsetTimeout(function() {\n\t\t\t\t\t\t\t\tif (shouldFixCaret(preBrowserNode)) {\n\t\t\t\t\t\t\t\t\thandle(!e.shiftKey && key === VK.UP, preBrowserNode, e);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}, 0);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\ted.onKeyDown.add(moveSelection);\n\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t\t\t// Fixes an issue on Gecko where it's impossible to place the caret behind a table\n\t\t\t\t// This fix will force a paragraph element after the table but only when the forced_root_block setting is enabled\n\t\t\t\tif (!tinymce.isIE) {\n\t\t\t\t\tfunction fixTableCaretPos() {\n\t\t\t\t\t\tvar last;\n\n\t\t\t\t\t\t// Skip empty text nodes form the end\n\t\t\t\t\t\tfor (last = ed.getBody().lastChild; last && last.nodeType == 3 && !last.nodeValue.length; last = last.previousSibling) ;\n\n\t\t\t\t\t\tif (last && last.nodeName == 'TABLE')\n\t\t\t\t\t\t\ted.dom.add(ed.getBody(), 'p', null, '<br mce_bogus=\"1\" />');\n\t\t\t\t\t};\n\n\t\t\t\t\t// Fixes an bug where it's impossible to place the caret before a table in Gecko\n\t\t\t\t\t// this fix solves it by detecting when the caret is at the beginning of such a table\n\t\t\t\t\t// and then manually moves the caret infront of the table\n\t\t\t\t\tif (tinymce.isGecko) {\n\t\t\t\t\t\ted.onKeyDown.add(function(ed, e) {\n\t\t\t\t\t\t\tvar rng, table, dom = ed.dom;\n\n\t\t\t\t\t\t\t// On gecko it's not possible to place the caret before a table\n\t\t\t\t\t\t\tif (e.keyCode == 37 || e.keyCode == 38) {\n\t\t\t\t\t\t\t\trng = ed.selection.getRng();\n\t\t\t\t\t\t\t\ttable = dom.getParent(rng.startContainer, 'table');\n\n\t\t\t\t\t\t\t\tif (table && ed.getBody().firstChild == table) {\n\t\t\t\t\t\t\t\t\tif (isAtStart(rng, table)) {\n\t\t\t\t\t\t\t\t\t\trng = dom.createRng();\n\n\t\t\t\t\t\t\t\t\t\trng.setStartBefore(table);\n\t\t\t\t\t\t\t\t\t\trng.setEndBefore(table);\n\n\t\t\t\t\t\t\t\t\t\ted.selection.setRng(rng);\n\n\t\t\t\t\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\n\t\t\t\t\ted.onKeyUp.add(fixTableCaretPos);\n\t\t\t\t\ted.onSetContent.add(fixTableCaretPos);\n\t\t\t\t\ted.onVisualAid.add(fixTableCaretPos);\n\n\t\t\t\t\ted.onPreProcess.add(function(ed, o) {\n\t\t\t\t\t\tvar last = o.node.lastChild;\n\n\t\t\t\t\t\tif (last && last.childNodes.length == 1 && last.firstChild.nodeName == 'BR')\n\t\t\t\t\t\t\ted.dom.remove(last);\n\t\t\t\t\t});\n\n\t\t\t\t\tfixTableCaretPos();\n\t\t\t\t\ted.startContent = ed.getContent({format : 'raw'});\n\t\t\t\t}\n\t\t\t});\n\n\t\t\t// Register action commands\n\t\t\teach({\n\t\t\t\tmceTableSplitCells : function(grid) {\n\t\t\t\t\tgrid.split();\n\t\t\t\t},\n\n\t\t\t\tmceTableMergeCells : function(grid) {\n\t\t\t\t\tvar rowSpan, colSpan, cell;\n\n\t\t\t\t\tcell = ed.dom.getParent(ed.selection.getNode(), 'th,td');\n\t\t\t\t\tif (cell) {\n\t\t\t\t\t\trowSpan = cell.rowSpan;\n\t\t\t\t\t\tcolSpan = cell.colSpan;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (!ed.dom.select('td.mceSelected,th.mceSelected').length) {\n\t\t\t\t\t\twinMan.open({\n\t\t\t\t\t\t\turl : url + '/merge_cells.htm',\n\t\t\t\t\t\t\twidth : 240 + parseInt(ed.getLang('table.merge_cells_delta_width', 0)),\n\t\t\t\t\t\t\theight : 110 + parseInt(ed.getLang('table.merge_cells_delta_height', 0)),\n\t\t\t\t\t\t\tinline : 1\n\t\t\t\t\t\t}, {\n\t\t\t\t\t\t\trows : rowSpan,\n\t\t\t\t\t\t\tcols : colSpan,\n\t\t\t\t\t\t\tonaction : function(data) {\
2n\t\t\t\t\t\t\t\tgrid.merge(cell, data.cols, data.rows);\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tplugin_url : url\n\t\t\t\t\t\t});\n\t\t\t\t\t} else\n\t\t\t\t\t\tgrid.merge();\n\t\t\t\t},\n\n\t\t\t\tmceTableInsertRowBefore : function(grid) {\n\t\t\t\t\tgrid.insertRow(true);\n\t\t\t\t},\n\n\t\t\t\tmceTableInsertRowAfter : function(grid) {\n\t\t\t\t\tgrid.insertRow();\n\t\t\t\t},\n\n\t\t\t\tmceTableInsertColBefore : function(grid) {\n\t\t\t\t\tgrid.insertCol(true);\n\t\t\t\t},\n\n\t\t\t\tmceTableInsertColAfter : function(grid) {\n\t\t\t\t\tgrid.insertCol();\n\t\t\t\t},\n\n\t\t\t\tmceTableDeleteCol : function(grid) {\n\t\t\t\t\tgrid.deleteCols();\n\t\t\t\t},\n\n\t\t\t\tmceTableDeleteRow : function(grid) {\n\t\t\t\t\tgrid.deleteRows();\n\t\t\t\t},\n\n\t\t\t\tmceTableCutRow : function(grid) {\n\t\t\t\t\tclipboardRows = grid.cutRows();\n\t\t\t\t},\n\n\t\t\t\tmceTableCopyRow : function(grid) {\n\t\t\t\t\tclipboardRows = grid.copyRows();\n\t\t\t\t},\n\n\t\t\t\tmceTablePasteRowBefore : function(grid) {\n\t\t\t\t\tgrid.pasteRows(clipboardRows, true);\n\t\t\t\t},\n\n\t\t\t\tmceTablePasteRowAfter : function(grid) {\n\t\t\t\t\tgrid.pasteRows(clipboardRows);\n\t\t\t\t},\n\n\t\t\t\tmceTableDelete : function(grid) {\n\t\t\t\t\tgrid.deleteTable();\n\t\t\t\t}\n\t\t\t}, function(func, name) {\n\t\t\t\ted.addCommand(name, function() {\n\t\t\t\t\tvar grid = createTableGrid();\n\n\t\t\t\t\tif (grid) {\n\t\t\t\t\t\tfunc(grid);\n\t\t\t\t\t\ted.execCommand('mceRepaint');\n\t\t\t\t\t\tcleanup();\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t});\n\n\t\t\t// Register dialog commands\n\t\t\teach({\n\t\t\t\tmceInsertTable : function(val) {\n\t\t\t\t\twinMan.open({\n\t\t\t\t\t\turl : url + '/table.htm',\n\t\t\t\t\t\twidth : 400 + parseInt(ed.getLang('table.table_delta_width', 0)),\n\t\t\t\t\t\theight : 320 + parseInt(ed.getLang('table.table_delta_height', 0)),\n\t\t\t\t\t\tinline : 1\n\t\t\t\t\t}, {\n\t\t\t\t\t\tplugin_url : url,\n\t\t\t\t\t\taction : val ? val.action : 0\n\t\t\t\t\t});\n\t\t\t\t},\n\n\t\t\t\tmceTableRowProps : function() {\n\t\t\t\t\twinMan.open({\n\t\t\t\t\t\turl : url + '/row.htm',\n\t\t\t\t\t\twidth : 400 + parseInt(ed.getLang('table.rowprops_delta_width', 0)),\n\t\t\t\t\t\theight : 295 + parseInt(ed.getLang('table.rowprops_delta_height', 0)),\n\t\t\t\t\t\tinline : 1\n\t\t\t\t\t}, {\n\t\t\t\t\t\tplugin_url : url\n\t\t\t\t\t});\n\t\t\t\t},\n\n\t\t\t\tmceTableCellProps : function() {\n\t\t\t\t\twinMan.open({\n\t\t\t\t\t\turl : url + '/cell.htm',\n\t\t\t\t\t\twidth : 400 + parseInt(ed.getLang('table.cellprops_delta_width', 0)),\n\t\t\t\t\t\theight : 295 + parseInt(ed.getLang('table.cellprops_delta_height', 0)),\n\t\t\t\t\t\tinline : 1\n\t\t\t\t\t}, {\n\t\t\t\t\t\tplugin_url : url\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}, function(func, name) {\n\t\t\t\ted.addCommand(name, function(ui, val) {\n\t\t\t\t\tfunc(val);\n\t\t\t\t});\n\t\t\t});\n\t\t}\n\t});\n\n\t// Register plugin\n\ttinymce.PluginManager.add('table', tinymce.plugins.TablePlugin);\n})(tinymce);\n","Potato_Zendesk/js/tiny_mce/plugins/table/js/cell.js":"tinyMCEPopup.requireLangPack();\n\nvar ed;\n\nfunction init() {\n\ted = tinyMCEPopup.editor;\n\ttinyMCEPopup.resizeToInnerSize();\n\n\tdocument.getElementById('backgroundimagebrowsercontainer').innerHTML = getBrowserHTML('backgroundimagebrowser','backgroundimage','image','table');\n\tdocument.getElementById('bordercolor_pickcontainer').innerHTML = getColorPickerHTML('bordercolor_pick','bordercolor');\n\tdocument.getElementById('bgcolor_pickcontainer').innerHTML = getColorPickerHTML('bgcolor_pick','bgcolor')\n\n\tvar inst = ed;\n\tvar tdElm = ed.dom.getParent(ed.selection.getStart(), \"td,th\");\n\tvar formObj = document.forms[0];\n\tvar st = ed.dom.parseStyle(ed.dom.getAttrib(tdElm, \"style\"));\n\n\t// Get table cell data\n\tvar celltype = tdElm.nodeName.toLowerCase();\n\tvar align = ed.dom.getAttrib(tdElm, 'align');\n\tvar valign = ed.dom.getAttrib(tdElm, 'valign');\n\tvar width = trimSize(getStyle(tdElm, 'width', 'width'));\n\tvar height = trimSize(getStyle(tdElm, 'height', 'height'));\n\tvar bordercolor = convertRGBToHex(getStyle(tdElm, 'bordercolor', 'borderLeftColor'));\n\tvar bgcolor = convertRGBToHex(getStyle(tdElm, 'bgcolor', 'backgroundColor'));\n\tvar className = ed.dom.getAttrib(tdElm, 'class');\n\tvar backgroundimage = getStyle(tdElm, 'background', 'backgroundImage').replace(new RegExp(\"url\\\\(['\\\"]?([^'\\\"]*)['\\\"]?\\\\)\", 'gi'), \"$1\");\n\tvar id = ed.dom.getAttrib(tdElm, 'id');\n\tvar lang = ed.dom.getAttrib(tdElm, 'lang');\n\tvar dir = ed.dom.getAttrib(tdElm, 'dir');\n\tvar scope = ed.dom.getAttrib(tdElm, 'scope');\n\n\t// Setup form\n\taddClassesToList('class', 'table_cell_styles');\n\tTinyMCE_EditableSelects.init();\n\n\tif (!ed.dom.hasClass(tdElm, 'mceSelected')) {\n\t\tformObj.bordercolor.value = bordercolor;\n\t\tformObj.bgcolor.value = bgcolor;\n\t\tformObj.backgroundimage.value = backgroundimage;\n\t\tformObj.width.value = width;\n\t\tformObj.height.value = height;\n\t\tformObj.id.value = id;\n\t\tformObj.lang.value = lang;\n\t\tformObj.style.value = ed.dom.serializeStyle(st);
2\n\t\tselectByValue(formObj, 'align', align);\n\t\tselectByValue(formObj, 'valign', valign);\n\t\tselectByValue(formObj, 'class', className, true, true);\n\t\tselectByValue(formObj, 'celltype', celltype);\n\t\tselectByValue(formObj, 'dir', dir);\n\t\tselectByValue(formObj, 'scope', scope);\n\n\t\t// Resize some elements\n\t\tif (isVisible('backgroundimagebrowser'))\n\t\t\tdocument.getElementById('backgroundimage').style.width = '180px';\n\n\t\tupdateColor('bordercolor_pick', 'bordercolor');\n\t\tupdateColor('bgcolor_pick', 'bgcolor');\n\t} else\n\t\ttinyMCEPopup.dom.hide('action');\n}\n\nfunction updateAction() {\n\tvar el, inst = ed, tdElm, trElm, tableElm, formObj = document.forms[0];\n\n\tif (!AutoValidator.validate(formObj)) {\n\t\ttinyMCEPopup.alert(AutoValidator.getErrorMessages(formObj).join('. ') + '.');\n\t\treturn false;\n\t}\n\n\ttinyMCEPopup.restoreSelection();\n\tel = ed.selection.getStart();\n\ttdElm = ed.dom.getParent(el, \"td,th\");\n\ttrElm = ed.dom.getParent(el, \"tr\");\n\ttableElm = ed.dom.getParent(el, \"table\");\n\n\t// Cell is selected\n\tif (ed.dom.hasClass(tdElm, 'mceSelected')) {\n\t\t// Update all selected sells\n\t\ttinymce.each(ed.dom.select('td.mceSelected,th.mceSelected'), function(td) {\n\t\t\tupdateCell(td);\n\t\t});\n\n\t\ted.addVisual();\n\t\ted.nodeChanged();\n\t\tinst.execCommand('mceEndUndoLevel');\n\t\ttinyMCEPopup.close();\n\t\treturn;\n\t}\n\n\tswitch (getSelectValue(formObj, 'action')) {\n\t\tcase \"cell\":\n\t\t\tvar celltype = getSelectValue(formObj, 'celltype');\n\t\t\tvar scope = getSelectValue(formObj, 'scope');\n\n\t\t\tfunction doUpdate(s) {\n\t\t\t\tif (s) {\n\t\t\t\t\tupdateCell(tdElm);\n\n\t\t\t\t\ted.addVisual();\n\t\t\t\t\ted.nodeChanged();\n\t\t\t\t\tinst.execCommand('mceEndUndoLevel');\n\t\t\t\t\ttinyMCEPopup.close();\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tif (ed.getParam(\"accessibility_warnings\", 1)) {\n\t\t\t\tif (celltype == \"th\" && scope == \"\")\n\t\t\t\t\ttinyMCEPopup.confirm(ed.getLang('table_dlg.missing_scope', '', true), doUpdate);\n\t\t\t\telse\n\t\t\t\t\tdoUpdate(1);\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tupdateCell(tdElm);\n\t\t\tbreak;\n\n\t\tcase \"row\":\n\t\t\tvar cell = trElm.firstChild;\n\n\t\t\tif (cell.nodeName != \"TD\" && cell.nodeName != \"TH\")\n\t\t\t\tcell = nextCell(cell);\n\n\t\t\tdo {\n\t\t\t\tcell = updateCell(cell, true);\n\t\t\t} while ((cell = nextCell(cell)) != null);\n\n\t\t\tbreak;\n\n\t\tcase \"col\":\n\t\t\tvar curr, col = 0, cell = trElm.firstChild, rows = tableElm.getElementsByTagName(\"tr\");\n\n\t\t\tif (cell.nodeName != \"TD\" && cell.nodeName != \"TH\")\n\t\t\t\tcell = nextCell(cell);\n\n\t\t\tdo {\n\t\t\t\tif (cell == tdElm)\n\t\t\t\t\tbreak;\n\t\t\t\tcol += cell.getAttribute(\"colspan\");\n\t\t\t} while ((cell = nextCell(cell)) != null);\n\n\t\t\tfor (var i=0; i<rows.length; i++) {\n\t\t\t\tcell = rows[i].firstChild;\n\n\t\t\t\tif (cell.nodeName != \"TD\" && cell.nodeName != \"TH\")\n\t\t\t\t\tcell = nextCell(cell);\n\n\t\t\t\tcurr = 0;\n\t\t\t\tdo {\n\t\t\t\t\tif (curr == col) {\n\t\t\t\t\t\tcell = updateCell(cell, true);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tcurr += cell.getAttribute(\"colspan\");\n\t\t\t\t} while ((cell = nextCell(cell)) != null);\n\t\t\t}\n\n\t\t\tbreak;\n\n\t\tcase \"all\":\n\t\t\tvar rows = tableElm.getElementsByTagName(\"tr\");\n\n\t\t\tfor (var i=0; i<rows.length; i++) {\n\t\t\t\tvar cell = rows[i].firstChild;\n\n\t\t\t\tif (cell.nodeName != \"TD\" && cell.nodeName != \"TH\")\n\t\t\t\t\tcell = nextCell(cell);\n\n\t\t\t\tdo {\n\t\t\t\t\tcell = updateCell(cell, true);\n\t\t\t\t} while ((cell = nextCell(cell)) != null);\n\t\t\t}\n\n\t\t\tbreak;\n\t}\n\n\ted.addVisual();\n\ted.nodeChanged();\n\tinst.execCommand('mceEndUndoLevel');\n\ttinyMCEPopup.close();\n}\n\nfunction nextCell(elm) {\n\twhile ((elm = elm.nextSibling) != null) {\n\t\tif (elm.nodeName == \"TD\" || elm.nodeName == \"TH\")\n\t\t\treturn elm;\n\t}\n\n\treturn null;\n}\n\nfunction updateCell(td, skip_id) {\n\tvar inst = ed;\n\tvar formObj = document.forms[0];\n\tvar curCellType = td.nodeName.toLowerCase();
2\n\tvar celltype = getSelectValue(formObj, 'celltype');\n\tvar doc = inst.getDoc();\n\tvar dom = ed.dom;\n\n\tif (!skip_id)\n\t\tdom.setAttrib(td, 'id', formObj.id.value);\n\n\tdom.setAttrib(td, 'align', formObj.align.value);\n\tdom.setAttrib(td, 'vAlign', formObj.valign.value);\n\tdom.setAttrib(td, 'lang', formObj.lang.value);\n\tdom.setAttrib(td, 'dir', getSelectValue(formObj, 'dir'));\n\tdom.setAttrib(td, 'style', ed.dom.serializeStyle(ed.dom.parseStyle(formObj.style.value)));\n\tdom.setAttrib(td, 'scope', formObj.scope.value);\n\tdom.setAttrib(td, 'class', getSelectValue(formObj, 'class'));\n\n\t// Clear deprecated attributes\n\ted.dom.setAttrib(td, 'width', '');\n\ted.dom.setAttrib(td, 'height', '');\n\ted.dom.setAttrib(td, 'bgColor', '');\n\ted.dom.setAttrib(td, 'borderColor', '');\n\ted.dom.setAttrib(td, 'background', '');\n\n\t// Set styles\n\ttd.style.width = getCSSSize(formObj.width.value);\n\ttd.style.height = getCSSSize(formObj.height.value);\n\tif (formObj.bordercolor.value != \"\") {\n\t\ttd.style.borderColor = formObj.bordercolor.value;\n\t\ttd.style.borderStyle = td.style.borderStyle == \"\" ? \"solid\" : td.style.borderStyle;\n\t\ttd.style.borderWidth = td.style.borderWidth == \"\" ? \"1px\" : td.style.borderWidth;\n\t} else\n\t\ttd.style.borderColor = '';\n\n\ttd.style.backgroundColor = formObj.bgcolor.value;\n\n\tif (formObj.backgroundimage.value != \"\")\n\t\ttd.style.backgroundImage = \"url('\" + formObj.backgroundimage.value + \"')\";\n\telse\n\t\ttd.style.backgroundImage = '';\n\n\tif (curCellType != celltype) {\n\t\t// changing to a different node type\n\t\tvar newCell = doc.createElement(celltype);\n\n\t\tfor (var c=0; c<td.childNodes.length; c++)\n\t\t\tnewCell.appendChild(td.childNodes[c].cloneNode(1));\n\n\t\tfor (var a=0; a<td.attributes.length; a++)\n\t\t\ted.dom.setAttrib(newCell, td.attributes[a].name, ed.dom.getAttrib(td, td.attributes[a].name));\n\n\t\ttd.parentNode.replaceChild(newCell, td);\n\t\ttd = newCell;\n\t}\n\n\tdom.setAttrib(td, 'style', dom.serializeStyle(dom.parseStyle(td.style.cssText)));\n\n\treturn td;\n}\n\nfunction changedBackgroundImage() {\n\tvar formObj = document.forms[0];\n\tvar st = ed.dom.parseStyle(formObj.style.value);\n\n\tst['background-image'] = \"url('\" + formObj.backgroundimage.value + \"')\";\n\n\tformObj.style.value = ed.dom.serializeStyle(st);\n}\n\nfunction changedSize() {\n\tvar formObj = document.forms[0];\n\tvar st = ed.dom.parseStyle(formObj.style.value);\n\n\tvar width = formObj.width.value;\n\tif (width != \"\")\n\t\tst['width'] = getCSSSize(width);\n\telse\n\t\tst['width'] = \"\";\n\n\tvar height = formObj.height.value;\n\tif (height != \"\")\n\t\tst['height'] = getCSSSize(height);\n\telse\n\t\tst['height'] = \"\";\n\n\tformObj.style.value = ed.dom.serializeStyle(st);\n}\n\nfunction changedColor() {\n\tvar formObj = document.forms[0];\n\tvar st = ed.dom.parseStyle(formObj.style.value);\n\n\tst['background-color'] = formObj.bgcolor.value;\n\tst['border-color'] = formObj.bordercolor.value;\n\n\tformObj.style.value = ed.dom.serializeStyle(st);\n}\n\nfunction changedStyle() {\n\tvar formObj = document.forms[0];\n\tvar st = ed.dom.parseStyle(formObj.style.value);\n\n\tif (st['background-image'])\n\t\tformObj.backgroundimage.value = st['background-image'].replace(new RegExp(\"url\\\\('?([^']*)'?\\\\)\", 'gi'), \"$1\");\n\telse\n\t\tformObj.backgroundimage.value = '';\n\n\tif (st['width'])\n\t\tformObj.width.value = trimSize(st['width']);\n\n\tif (st['height'])\n\t\tformObj.height.value = trimSize(st['height']);\n\n\tif (st['background-color']) {\n\t\tformObj.bgcolor.value = st['background-color'];\n\t\tupdateColor('bgcolor_pick','bgcolor');\n\t}\n\n\tif (st['border-color']) {\n\t\tformObj.bordercolor.value = st['border-color'];\n\t\tupdateColor('bordercolor_pick','bordercolor');\n\t}\n}\n\ntinyMCEPopup.onInit.add(init);\n","Potato_Zendesk/js/tiny_mce/plugins/table/js/merge_cells.js":"tinyMCEPopup.requireLangPack();\n\nvar MergeCellsDialog = {\n\tinit : function() {\n\t\tvar f = document.forms[0];\n\n\t\tf.numcols.value = tinyMCEPopup.getWindowArg('cols', 1);\n\t\tf.numrows.value = tinyMCEPopup.getWindowArg('rows', 1);\n\t}
2,\n\n\tmerge : function() {\n\t\tvar func, f = document.forms[0];\n\n\t\ttinyMCEPopup.restoreSelection();\n\n\t\tfunc = tinyMCEPopup.getWindowArg('onaction');\n\n\t\tfunc({\n\t\t\tcols : f.numcols.value,\n\t\t\trows : f.numrows.value\n\t\t});\n\n\t\ttinyMCEPopup.close();\n\t}\n};\n\ntinyMCEPopup.onInit.add(MergeCellsDialog.init, MergeCellsDialog);\n","Potato_Zendesk/js/tiny_mce/plugins/table/js/row.js":"tinyMCEPopup.requireLangPack();\n\nfunction init() {\n\ttinyMCEPopup.resizeToInnerSize();\n\n\tdocument.getElementById('backgroundimagebrowsercontainer').innerHTML = getBrowserHTML('backgroundimagebrowser','backgroundimage','image','table');\n\tdocument.getElementById('bgcolor_pickcontainer').innerHTML = getColorPickerHTML('bgcolor_pick','bgcolor');\n\n\tvar inst = tinyMCEPopup.editor;\n\tvar dom = inst.dom;\n\tvar trElm = dom.getParent(inst.selection.getStart(), \"tr\");\n\tvar formObj = document.forms[0];\n\tvar st = dom.parseStyle(dom.getAttrib(trElm, \"style\"));\n\n\t// Get table row data\n\tvar rowtype = trElm.parentNode.nodeName.toLowerCase();\n\tvar align = dom.getAttrib(trElm, 'align');\n\tvar valign = dom.getAttrib(trElm, 'valign');\n\tvar height = trimSize(getStyle(trElm, 'height', 'height'));\n\tvar className = dom.getAttrib(trElm, 'class');\n\tvar bgcolor = convertRGBToHex(getStyle(trElm, 'bgcolor', 'backgroundColor'));\n\tvar backgroundimage = getStyle(trElm, 'background', 'backgroundImage').replace(new RegExp(\"url\\\\(['\\\"]?([^'\\\"]*)['\\\"]?\\\\)\", 'gi'), \"$1\");\n\tvar id = dom.getAttrib(trElm, 'id');\n\tvar lang = dom.getAttrib(trElm, 'lang');\n\tvar dir = dom.getAttrib(trElm, 'dir');\n\n\tselectByValue(formObj, 'rowtype', rowtype);\n\n\t// Any cells selected\n\tif (dom.select('td.mceSelected,th.mceSelected', trElm).length == 0) {\n\t\t// Setup form\n\t\taddClassesToList('class', 'table_row_styles');\n\t\tTinyMCE_EditableSelects.init();\n\n\t\tformObj.bgcolor.value = bgcolor;\n\t\tformObj.backgroundimage.value = backgroundimage;\n\t\tformObj.height.value = height;\n\t\tformObj.id.value = id;\n\t\tformObj.lang.value = lang;\n\t\tformObj.style.value = dom.serializeStyle(st);\n\t\tselectByValue(formObj, 'align', align);\n\t\tselectByValue(formObj, 'valign', valign);\n\t\tselectByValue(formObj, 'class', className, true, true);\n\t\tselectByValue(formObj, 'dir', dir);\n\n\t\t// Resize some elements\n\t\tif (isVisible('backgroundimagebrowser'))\n\t\t\tdocument.getElementById('backgroundimage').style.width = '180px';\n\n\t\tupdateColor('bgcolor_pick', 'bgcolor');\n\t} else\n\t\ttinyMCEPopup.dom.hide('action');\n}\n\nfunction updateAction() {\n\tvar inst = tinyMCEPopup.editor, dom = inst.dom, trElm, tableElm, formObj = document.forms[0];\n\tvar action = getSelectValue(formObj, 'action');\n\n\tif (!AutoValidator.validate(formObj)) {\n\t\ttinyMCEPopup.alert(AutoValidator.getErrorMessages(formObj).join('. ') + '.');\n\t\treturn false;\n\t}\n\n\ttinyMCEPopup.restoreSelection();\n\ttrElm = dom.getParent(inst.selection.getStart(), \"tr\");\n\ttableElm = dom.getParent(inst.selection.getStart(), \"table\");\n\n\t// Update all selected rows\n\tif (dom.select('td.mceSelected,th.mceSelected', trElm).length > 0) {\n\t\ttinymce.each(tableElm.rows, function(tr) {\n\t\t\tvar i;\n\n\t\t\tfor (i = 0; i < tr.cells.length; i++) {\n\t\t\t\tif (dom.hasClass(tr.cells[i], 'mceSelected')) {\n\t\t\t\t\tupdateRow(tr, true);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\tinst.addVisual();\n\t\tinst.nodeChanged();\n\t\tinst.execCommand('mceEndUndoLevel');\n\t\ttinyMCEPopup.close();\n\t\treturn;\n\t}\n\n\tswitch (action) {\n\t\tcase \"row\":\n\t\t\tupdateRow(trElm);\n\t\t\tbreak;\n\n\t\tcase \"all\":\n\t\t\tvar rows = tableElm.getElementsByTagName(\"tr\");\n\n\t\t\tfor (var i=0; i<rows.length; i++)\n\t\t\t\tupdateRow(rows[i], true);\n\n\t\t\tbreak;\n\n\t\tcase \"odd\":\n\t\tcase \"even\":\n\t\t\tvar rows = tableElm.getElementsByTagName(\"tr\");\n\n\t\t\tfor (var i=0; i<rows.length; i++) {\n\t\t\t\tif ((i % 2 == 0 && action == \"odd\") || (i % 2 != 0 && action == \"even\"))\n\t\t\t\t\tupdateRow(rows[i], true, true);\n\t\t\t}\n\n\t\t\tbreak;\n\t}\n\n\tinst.addVisual();\n\tinst.nodeChanged();\n\tinst.execCommand('mceEndUndoLevel');\n\ttinyMCEPopup.close();\n}\n\nfunction updateRow(tr_elm, skip_id, skip_parent) {\n\tvar inst = tinyMCEPopup.editor;
2\n\tvar formObj = document.forms[0];\n\tvar dom = inst.dom;\n\tvar curRowType = tr_elm.parentNode.nodeName.toLowerCase();\n\tvar rowtype = getSelectValue(formObj, 'rowtype');\n\tvar doc = inst.getDoc();\n\n\t// Update row element\n\tif (!skip_id)\n\t\tdom.setAttrib(tr_elm, 'id', formObj.id.value);\n\n\tdom.setAttrib(tr_elm, 'align', getSelectValue(formObj, 'align'));\n\tdom.setAttrib(tr_elm, 'vAlign', getSelectValue(formObj, 'valign'));\n\tdom.setAttrib(tr_elm, 'lang', formObj.lang.value);\n\tdom.setAttrib(tr_elm, 'dir', getSelectValue(formObj, 'dir'));\n\tdom.setAttrib(tr_elm, 'style', dom.serializeStyle(dom.parseStyle(formObj.style.value)));\n\tdom.setAttrib(tr_elm, 'class', getSelectValue(formObj, 'class'));\n\n\t// Clear deprecated attributes\n\tdom.setAttrib(tr_elm, 'background', '');\n\tdom.setAttrib(tr_elm, 'bgColor', '');\n\tdom.setAttrib(tr_elm, 'height', '');\n\n\t// Set styles\n\ttr_elm.style.height = getCSSSize(formObj.height.value);\n\ttr_elm.style.backgroundColor = formObj.bgcolor.value;\n\n\tif (formObj.backgroundimage.value != \"\")\n\t\ttr_elm.style.backgroundImage = \"url('\" + formObj.backgroundimage.value + \"')\";\n\telse\n\t\ttr_elm.style.backgroundImage = '';\n\n\t// Setup new rowtype\n\tif (curRowType != rowtype && !skip_parent) {\n\t\t// first, clone the node we are working on\n\t\tvar newRow = tr_elm.cloneNode(1);\n\n\t\t// next, find the parent of its new destination (creating it if necessary)\n\t\tvar theTable = dom.getParent(tr_elm, \"table\");\n\t\tvar dest = rowtype;\n\t\tvar newParent = null;\n\t\tfor (var i = 0; i < theTable.childNodes.length; i++) {\n\t\t\tif (theTable.childNodes[i].nodeName.toLowerCase() == dest)\n\t\t\t\tnewParent = theTable.childNodes[i];\n\t\t}\n\n\t\tif (newParent == null) {\n\t\t\tnewParent = doc.createElement(dest);\n\n\t\t\tif (theTable.firstChild.nodeName == 'CAPTION')\n\t\t\t\tinst.dom.insertAfter(newParent, theTable.firstChild);\n\t\t\telse\n\t\t\t\ttheTable.insertBefore(newParent, theTable.firstChild);\n\t\t}\n\n\t\t// append the row to the new parent\n\t\tnewParent.appendChild(newRow);\n\n\t\t// remove the original\n\t\ttr_elm.parentNode.removeChild(tr_elm);\n\n\t\t// set tr_elm to the new node\n\t\ttr_elm = newRow;\n\t}\n\n\tdom.setAttrib(tr_elm, 'style', dom.serializeStyle(dom.parseStyle(tr_elm.style.cssText)));\n}\n\nfunction changedBackgroundImage() {\n\tvar formObj = document.forms[0], dom = tinyMCEPopup.editor.dom;\n\tvar st = dom.parseStyle(formObj.style.value);\n\n\tst['background-image'] = \"url('\" + formObj.backgroundimage.value + \"')\";\n\n\tformObj.style.value = dom.serializeStyle(st);\n}\n\nfunction changedStyle() {\n\tvar formObj = document.forms[0], dom = tinyMCEPopup.editor.dom;\n\tvar st = dom.parseStyle(formObj.style.value);\n\n\tif (st['background-image'])\n\t\tformObj.backgroundimage.value = st['background-image'].replace(new RegExp(\"url\\\\('?([^']*)'?\\\\)\", 'gi'), \"$1\");\n\telse\n\t\tformObj.backgroundimage.value = '';\n\n\tif (st['height'])\n\t\tformObj.height.value = trimSize(st['height']);\n\n\tif (st['background-color']) {\n\t\tformObj.bgcolor.value = st['background-color'];\n\t\tupdateColor('bgcolor_pick','bgcolor');\n\t}\n}\n\nfunction changedSize() {\n\tvar formObj = document.forms[0], dom = tinyMCEPopup.editor.dom;\n\tvar st = dom.parseStyle(formObj.style.value);\n\n\tvar height = formObj.height.value;\n\tif (height != \"\")\n\t\tst['height'] = getCSSSize(height);\n\telse\n\t\tst['height'] = \"\";\n\n\tformObj.style.value = dom.serializeStyle(st);\n}\n\nfunction changedColor() {\n\tvar formObj = document.forms[0], dom = tinyMCEPopup.editor.dom;\n\tvar st = dom.parseStyle(formObj.style.value);\n\n\tst['background-color'] = formObj.bgcolor.value;\n\n\tformObj.style.value = dom.serializeStyle(st);\n}\n\ntinyMCEPopup.onInit.add(init);\n","Potato_Zendesk/js/tiny_mce/plugins/table/js/table.js":"tinyMCEPopup.requireLangPack();\n\nvar action, orgTableWidth, orgTableHeight, dom = tinyMCEPopup.editor.dom;\n\nfunction insertTable() {\n\tvar formObj = document.forms[0];\n\tvar inst = tinyMCEPopup.editor, dom = inst.dom;\n\tvar cols = 2, rows = 2, border = 0, cellpadding = -1, cellspacing = -1, align, width, height, className, caption, frame, rules;\n\tvar html = '', capEl, elm;\n\tvar cellLimit, rowLimit, colLimit;
2\n\n\ttinyMCEPopup.restoreSelection();\n\n\tif (!AutoValidator.validate(formObj)) {\n\t\ttinyMCEPopup.alert(AutoValidator.getErrorMessages(formObj).join('. ') + '.');\n\t\treturn false;\n\t}\n\n\telm = dom.getParent(inst.selection.getNode(), 'table');\n\n\t// Get form data\n\tcols = formObj.elements['cols'].value;\n\trows = formObj.elements['rows'].value;\n\tborder = formObj.elements['border'].value != \"\" ? formObj.elements['border'].value : 0;\n\tcellpadding = formObj.elements['cellpadding'].value != \"\" ? formObj.elements['cellpadding'].value : \"\";\n\tcellspacing = formObj.elements['cellspacing'].value != \"\" ? formObj.elements['cellspacing'].value : \"\";\n\talign = getSelectValue(formObj, \"align\");\n\tframe = getSelectValue(formObj, \"tframe\");\n\trules = getSelectValue(formObj, \"rules\");\n\twidth = formObj.elements['width'].value;\n\theight = formObj.elements['height'].value;\n\tbordercolor = formObj.elements['bordercolor'].value;\n\tbgcolor = formObj.elements['bgcolor'].value;\n\tclassName = getSelectValue(formObj, \"class\");\n\tid = formObj.elements['id'].value;\n\tsummary = formObj.elements['summary'].value;\n\tstyle = formObj.elements['style'].value;\n\tdir = formObj.elements['dir'].value;\n\tlang = formObj.elements['lang'].value;\n\tbackground = formObj.elements['backgroundimage'].value;\n\tcaption = formObj.elements['caption'].checked;\n\n\tcellLimit = tinyMCEPopup.getParam('table_cell_limit', false);\n\trowLimit = tinyMCEPopup.getParam('table_row_limit', false);\n\tcolLimit = tinyMCEPopup.getParam('table_col_limit', false);\n\n\t// Validate table size\n\tif (colLimit && cols > colLimit) {\n\t\ttinyMCEPopup.alert(inst.getLang('table_dlg.col_limit').replace(/\\{\\$cols\\}/g, colLimit));\n\t\treturn false;\n\t} else if (rowLimit && rows > rowLimit) {\n\t\ttinyMCEPopup.alert(inst.getLang('table_dlg.row_limit').replace(/\\{\\$rows\\}/g, rowLimit));\n\t\treturn false;\n\t} else if (cellLimit && cols * rows > cellLimit) {\n\t\ttinyMCEPopup.alert(inst.getLang('table_dlg.cell_limit').replace(/\\{\\$cells\\}/g, cellLimit));\n\t\treturn false;\n\t}\n\n\t// Update table\n\tif (action == \"update\") {\n\t\tdom.setAttrib(elm, 'cellPadding', cellpadding, true);\n\t\tdom.setAttrib(elm, 'cellSpacing', cellspacing, true);\n\n\t\tif (!isCssSize(border)) {\n\t\t\tdom.setAttrib(elm, 'border', border);\n\t\t} else {\n\t\t\tdom.setAttrib(elm, 'border', '');\n\t\t}\n\n\t\tif (border == '') {\n\t\t\tdom.setStyle(elm, 'border-width', '');\n\t\t\tdom.setStyle(elm, 'border', '');\n\t\t\tdom.setAttrib(elm, 'border', '');\n\t\t}\n\n\t\tdom.setAttrib(elm, 'align', align);\n\t\tdom.setAttrib(elm, 'frame', frame);\n\t\tdom.setAttrib(elm, 'rules', rules);\n\t\tdom.setAttrib(elm, 'class', className);\n\t\tdom.setAttrib(elm, 'style', style);\n\t\tdom.setAttrib(elm, 'id', id);\n\t\tdom.setAttrib(elm, 'summary', summary);\n\t\tdom.setAttrib(elm, 'dir', dir);\n\t\tdom.setAttrib(elm, 'lang', lang);\n\n\t\tcapEl = inst.dom.select('caption', elm)[0];\n\n\t\tif (capEl && !caption)\n\t\t\tcapEl.parentNode.removeChild(capEl);\n\n\t\tif (!capEl && caption) {\n\t\t\tcapEl = elm.ownerDocument.createElement('caption');\n\n\t\t\tif (!tinymce.isIE)\n\t\t\t\tcapEl.innerHTML = '<br data-mce-bogus=\"1\"/>';\n\n\t\t\telm.insertBefore(capEl, elm.firstChild);\n\t\t}\n\n\t\tif (width && inst.settings.inline_styles) {\n\t\t\tdom.setStyle(elm, 'width', width);\n\t\t\tdom.setAttrib(elm, 'width', '');\n\t\t} else {\n\t\t\tdom.setAttrib(elm, 'width', width, true);\n\t\t\tdom.setStyle(elm, 'width', '');\n\t\t}\n\n\t\t// Remove these since they are not valid XHTML\n\t\tdom.setAttrib(elm, 'borderColor', '');\n\t\tdom.setAttrib(elm, 'bgColor', '');\n\t\tdom.setAttrib(elm, 'background', '');\n\n\t\tif (height && inst.settings.inline_styles) {\n\t\t\tdom.setStyle(elm, 'height', height);\n\t\t\tdom.setAttrib(elm, 'height', '');\n\t\t} else {\n\t\t\tdom.setAttrib(elm, 'height', height, true);\n\t\t\tdom.setStyle(elm, 'height', '');\n \t\t}\n\n\t\tif (background != '')\n\t\t\telm.style.backgroundImage = \"url('\" + background + \"')\";\n\t\telse\n\t\t\telm.style.backgroundImage = '';\n\n/*\t\tif (tinyMCEPopup.getParam(\"inline_styles\")) {\n\t\t\tif (width != '')\n\t\t\t\telm.style.width = getCSSSize(width);\n\t\t}*/\n\n\t\tif (bordercolor != \"\") {\n\t\t\telm.style.borderColor = bordercolor;\n\t\t\telm.style.borderStyle = elm.style.borderStyle == \"\" ? \"solid\" : elm.style.borderStyle;\n\t\t\telm.style.borderWidth = cssSize(border);\n\t\t} else\n\t\t\telm.style.borderColor = '';\n\n\t\telm.style.backgroundColor = bgcolor;\n\t\telm.style.height = getCSSSize(height);\n\n\t\tinst.addVisual();\n\n\t\t// Fix for stange MSIE align bug\n\t\t//elm.outerHTML = elm.outerHTML;\n\n\t\tinst.nodeChanged();\n\t\tinst.execCommand('mceEndUndoLevel');
2\n\n\t\t// Repaint if dimensions changed\n\t\tif (formObj.width.value != orgTableWidth || formObj.height.value != orgTableHeight)\n\t\t\tinst.execCommand('mceRepaint');\n\n\t\ttinyMCEPopup.close();\n\t\treturn true;\n\t}\n\n\t// Create new table\n\thtml += '<table';\n\n\thtml += makeAttrib('id', id);\n\tif (!isCssSize(border)) {\n\t\thtml += makeAttrib('border', border);\n\t}\n\n\thtml += makeAttrib('cellpadding', cellpadding);\n\thtml += makeAttrib('cellspacing', cellspacing);\n\thtml += makeAttrib('data-mce-new', '1');\n\n\tif (width && inst.settings.inline_styles) {\n\t\tif (style)\n\t\t\tstyle += '; ';\n\n\t\t// Force px\n\t\tif (/^[0-9\\.]+$/.test(width))\n\t\t\twidth += 'px';\n\n\t\tstyle += 'width: ' + width;\n\t} else\n\t\thtml += makeAttrib('width', width);\n\n/*\tif (height) {\n\t\tif (style)\n\t\t\tstyle += '; ';\n\n\t\tstyle += 'height: ' + height;\n\t}*/\n\n\t//html += makeAttrib('height', height);\n\t//html += makeAttrib('bordercolor', bordercolor);\n\t//html += makeAttrib('bgcolor', bgcolor);\n\thtml += makeAttrib('align', align);\n\thtml += makeAttrib('frame', frame);\n\thtml += makeAttrib('rules', rules);\n\thtml += makeAttrib('class', className);\n\thtml += makeAttrib('style', style);\n\thtml += makeAttrib('summary', summary);\n\thtml += makeAttrib('dir', dir);\n\thtml += makeAttrib('lang', lang);\n\thtml += '>';\n\n\tif (caption) {\n\t\tif (!tinymce.isIE)\n\t\t\thtml += '<caption><br data-mce-bogus=\"1\"/></caption>';\n\t\telse\n\t\t\thtml += '<caption></caption>';\n\t}\n\n\tfor (var y=0; y<rows; y++) {\n\t\thtml += \"<tr>\";\n\n\t\tfor (var x=0; x<cols; x++) {\n\t\t\tif (!tinymce.isIE)\n\t\t\t\thtml += '<td><br data-mce-bogus=\"1\"/></td>';\n\t\t\telse\n\t\t\t\thtml += '<td></td>';\n\t\t}\n\n\t\thtml += \"</tr>\";\n\t}\n\n\thtml += \"</table>\";\n\n\t// Move table\n\tif (inst.settings.fix_table_elements) {\n\t\tvar patt = '';\n\n\t\tinst.focus();\n\t\tinst.selection.setContent('<br class=\"_mce_marker\" />');\n\n\t\ttinymce.each('h1,h2,h3,h4,h5,h6,p'.split(','), function(n) {\n\t\t\tif (patt)\n\t\t\t\tpatt += ',';\n\n\t\t\tpatt += n + ' ._mce_marker';\n\t\t});\n\n\t\ttinymce.each(inst.dom.select(patt), function(n) {\n\t\t\tinst.dom.split(inst.dom.getParent(n, 'h1,h2,h3,h4,h5,h6,p'), n);\n\t\t});\n\n\t\tdom.setOuterHTML(dom.select('br._mce_marker')[0], html);\n\t} else\n\t\tinst.execCommand('mceInsertContent', false, html);\n\n\ttinymce.each(dom.select('table[data-mce-new]'), function(node) {\n\t\tvar tdorth = dom.select('td,th', node);\n\n\t\ttry {\n\t\t\t// IE9 might fail to do this selection \n\t\t\tinst.selection.setCursorLocation(tdorth[0], 0);\n\t\t} catch (ex) {\n\t\t\t// Ignore\n\t\t}\n\n\t\tdom.setAttrib(node, 'data-mce-new', '');\n\t});\n\n\tinst.addVisual();\n\tinst.execCommand('mceEndUndoLevel');\n\n\ttinyMCEPopup.close();\n}\n\nfunction makeAttrib(attrib, value) {\n\tvar formObj = document.forms[0];\n\tvar valueElm = formObj.elements[attrib];\n\n\tif (typeof(value) == \"undefined\" || value == null) {\n\t\tvalue = \"\";\n\n\t\tif (valueElm)\n\t\t\tvalue = valueElm.value;\n\t}\n\n\tif (value == \"\")\n\t\treturn \"\";\n\n\t// XML encode it\n\tvalue = value.replace(/&/g, '&amp;');\n\tvalue = value.replace(/\\\"/g, '&quot;');\n\tvalue = value.replace(/</g, '&lt;');\n\tvalue = value.replace(/>/g, '&gt;');\n\n\treturn ' ' + attrib + '=\"' + value + '\"';\n}\n\nfunction init() {\n\ttinyMCEPopup.resizeToInnerSize();\n\n\tdocument.getElementById('backgroundimagebrowsercontainer').innerHTML = getBrowserHTML('backgroundimagebrowser','backgroundimage','image','table');\n\tdocument.getElementById('backgroundimagebrowsercontainer').innerHTML = getBrowserHTML('backgroundimagebrowser','backgroundimage','image','table');\n\tdocument.getElementById('bordercolor_pickcontainer').innerHTML = getColorPickerHTML('bordercolor_pick','bordercolor');\n\tdocument.getElementById('bgcolor_pickcontainer').innerHTML = getColorPickerHTML('bgcolor_pick','bgcolor');\n\n\tvar cols = 2, rows = 2, border = tinyMCEPopup.getParam('table_default_border', '0'), cellpadding = tinyMCEPopup.getParam('table_default_cellpadding', ''), cellspacing = tinyMCEPopup.getParam('table_default_cellspacing', '');\n\tvar align = \"\", width = \"\", height = \"\", bordercolor = \"\", bgcolor = \"\", 
2className = \"\";\n\tvar id = \"\", summary = \"\", style = \"\", dir = \"\", lang = \"\", background = \"\", bgcolor = \"\", bordercolor = \"\", rules = \"\", frame = \"\";\n\tvar inst = tinyMCEPopup.editor, dom = inst.dom;\n\tvar formObj = document.forms[0];\n\tvar elm = dom.getParent(inst.selection.getNode(), \"table\");\n\n\taction = tinyMCEPopup.getWindowArg('action');\n\n\tif (!action)\n\t\taction = elm ? \"update\" : \"insert\";\n\n\tif (elm && action != \"insert\") {\n\t\tvar rowsAr = elm.rows;\n\t\tvar cols = 0;\n\t\tfor (var i=0; i<rowsAr.length; i++)\n\t\t\tif (rowsAr[i].cells.length > cols)\n\t\t\t\tcols = rowsAr[i].cells.length;\n\n\t\tcols = cols;\n\t\trows = rowsAr.length;\n\n\t\tst = dom.parseStyle(dom.getAttrib(elm, \"style\"));\n\t\tborder = trimSize(getStyle(elm, 'border', 'borderWidth'));\n\t\tcellpadding = dom.getAttrib(elm, 'cellpadding', \"\");\n\t\tcellspacing = dom.getAttrib(elm, 'cellspacing', \"\");\n\t\twidth = trimSize(getStyle(elm, 'width', 'width'));\n\t\theight = trimSize(getStyle(elm, 'height', 'height'));\n\t\tbordercolor = convertRGBToHex(getStyle(elm, 'bordercolor', 'borderLeftColor'));\n\t\tbgcolor = convertRGBToHex(getStyle(elm, 'bgcolor', 'backgroundColor'));\n\t\talign = dom.getAttrib(elm, 'align', align);\n\t\tframe = dom.getAttrib(elm, 'frame');\n\t\trules = dom.getAttrib(elm, 'rules');\n\t\tclassName = tinymce.trim(dom.getAttrib(elm, 'class').replace(/mceItem.+/g, ''));\n\t\tid = dom.getAttrib(elm, 'id');\n\t\tsummary = dom.getAttrib(elm, 'summary');\n\t\tstyle = dom.serializeStyle(st);\n\t\tdir = dom.getAttrib(elm, 'dir');\n\t\tlang = dom.getAttrib(elm, 'lang');\n\t\tbackground = getStyle(elm, 'background', 'backgroundImage').replace(new RegExp(\"url\\\\(['\\\"]?([^'\\\"]*)['\\\"]?\\\\)\", 'gi'), \"$1\");\n\t\tformObj.caption.checked = elm.getElementsByTagName('caption').length > 0;\n\n\t\torgTableWidth = width;\n\t\torgTableHeight = height;\n\n\t\taction = \"update\";\n\t\tformObj.insert.value = inst.getLang('update');\n\t}\n\n\taddClassesToList('class', \"table_styles\");\n\tTinyMCE_EditableSelects.init();\n\n\t// Update form\n\tselectByValue(formObj, 'align', align);\n\tselectByValue(formObj, 'tframe', frame);\n\tselectByValue(formObj, 'rules', rules);\n\tselectByValue(formObj, 'class', className, true, true);\n\tformObj.cols.value = cols;\n\tformObj.rows.value = rows;\n\tformObj.border.value = border;\n\tformObj.cellpadding.value = cellpadding;\n\tformObj.cellspacing.value = cellspacing;\n\tformObj.width.value = width;\n\tformObj.height.value = height;\n\tformObj.bordercolor.value = bordercolor;\n\tformObj.bgcolor.value = bgcolor;\n\tformObj.id.value = id;\n\tformObj.summary.value = summary;\n\tformObj.style.value = style;\n\tformObj.dir.value = dir;\n\tformObj.lang.value = lang;\n\tformObj.backgroundimage.value = background;\n\n\tupdateColor('bordercolor_pick', 'bordercolor');\n\tupdateColor('bgcolor_pick', 'bgcolor');\n\n\t// Resize some elements\n\tif (isVisible('backgroundimagebrowser'))\n\t\tdocument.getElementById('backgroundimage').style.width = '180px';\n\n\t// Disable some fields in update mode\n\tif (action == \"update\") {\n\t\tformObj.cols.disabled = true;\n\t\tformObj.rows.disabled = true;\n\t}\n}\n\nfunction changedSize() {\n\tvar formObj = document.forms[0];\n\tvar st = dom.parseStyle(formObj.style.value);\n\n/*\tvar width = formObj.width.value;\n\tif (width != \"\")\n\t\tst['width'] = tinyMCEPopup.getParam(\"inline_styles\") ? getCSSSize(width) : \"\";\n\telse\n\t\tst['width'] = \"\";*/\n\n\tvar height = formObj.height.value;\n\tif (height != \"\")\n\t\tst['height'] = getCSSSize(height);\n\telse\n\t\tst['height'] = \"\";\n\n\tformObj.style.value = dom.serializeStyle(st);\n}\n\nfunction isCssSize(value) {\n\treturn /^[0-9.]+(%|in|cm|mm|em|ex|pt|pc|px)$/.test(value);\n}\n\nfunction cssSize(value, def) {\n\tvalue = tinymce.trim(value || def);\n\n\tif (!isCssSize(value)) {\n\t\treturn parseInt(value, 10) + 'px';\n\t}\n\n\treturn value;\n}\n\nfunction changedBackgroundImage() {\n\tvar formObj = document.forms[0];\n\tvar st = dom.parseStyle(formObj.style.value);\n\n\tst['background-image'] = \"url('\" + formObj.backgroundimage.value + \"')\";\n\n\tformObj.style.value = dom.serializeStyle(st);\n}\n\nfunction changedBorder() {\n\tvar formObj = document.forms[0];
2\n\tvar st = dom.parseStyle(formObj.style.value);\n\n\t// Update border width if the element has a color\n\tif (formObj.border.value != \"\" && (isCssSize(formObj.border.value) || formObj.bordercolor.value != \"\"))\n\t\tst['border-width'] = cssSize(formObj.border.value);\n\telse {\n\t\tif (!formObj.border.value) {\n\t\t\tst['border'] = '';\n\t\t\tst['border-width'] = '';\n\t\t}\n\t}\n\n\tformObj.style.value = dom.serializeStyle(st);\n}\n\nfunction changedColor() {\n\tvar formObj = document.forms[0];\n\tvar st = dom.parseStyle(formObj.style.value);\n\n\tst['background-color'] = formObj.bgcolor.value;\n\n\tif (formObj.bordercolor.value != \"\") {\n\t\tst['border-color'] = formObj.bordercolor.value;\n\n\t\t// Add border-width if it's missing\n\t\tif (!st['border-width'])\n\t\t\tst['border-width'] = cssSize(formObj.border.value, 1);\n\t}\n\n\tformObj.style.value = dom.serializeStyle(st);\n}\n\nfunction changedStyle() {\n\tvar formObj = document.forms[0];\n\tvar st = dom.parseStyle(formObj.style.value);\n\n\tif (st['background-image'])\n\t\tformObj.backgroundimage.value = st['background-image'].replace(new RegExp(\"url\\\\(['\\\"]?([^'\\\"]*)['\\\"]?\\\\)\", 'gi'), \"$1\");\n\telse\n\t\tformObj.backgroundimage.value = '';\n\n\tif (st['width'])\n\t\tformObj.width.value = trimSize(st['width']);\n\n\tif (st['height'])\n\t\tformObj.height.value = trimSize(st['height']);\n\n\tif (st['background-color']) {\n\t\tformObj.bgcolor.value = st['background-color'];\n\t\tupdateColor('bgcolor_pick','bgcolor');\n\t}\n\n\tif (st['border-color']) {\n\t\tformObj.bordercolor.value = st['border-color'];\n\t\tupdateColor('bordercolor_pick','bordercolor');\n\t}\n}\n\ntinyMCEPopup.onInit.add(init);\n","Potato_Zendesk/js/tiny_mce/plugins/table/langs/en_dlg.js":"tinyMCE.addI18n('en.table_dlg',{\"rules_border\":\"border\",\"rules_box\":\"box\",\"rules_vsides\":\"vsides\",\"rules_rhs\":\"rhs\",\"rules_lhs\":\"lhs\",\"rules_hsides\":\"hsides\",\"rules_below\":\"below\",\"rules_above\":\"above\",\"rules_void\":\"void\",rules:\"Rules\",\"frame_all\":\"all\",\"frame_cols\":\"cols\",\"frame_rows\":\"rows\",\"frame_groups\":\"groups\",\"frame_none\":\"none\",frame:\"Frame\",caption:\"Table Caption\",\"missing_scope\":\"Are you sure you want to continue without specifying a scope for this table header cell. Without it, it may be difficult for some users with disabilities to understand the content or data displayed of the table.\",\"cell_limit\":\"You\\'ve exceeded the maximum number of cells of {$cells}.\",\"row_limit\":\"You\\'ve exceeded the maximum number of rows of {$rows}.\",\"col_limit\":\"You\\'ve exceeded the maximum number of columns of {$cols}.\",colgroup:\"Col Group\",rowgroup:\"Row Group\",scope:\"Scope\",tfoot:\"Footer\",tbody:\"Body\",thead:\"Header\",\"row_all\":\"Update All Rows in Table\",\"row_even\":\"Update Even Rows in Table\",\"row_odd\":\"Update Odd Rows in Table\",\"row_row\":\"Update Current Row\",\"cell_all\":\"Update All Cells in Table\",\"cell_row\":\"Update All Cells in Row\",\"cell_cell\":\"Update Current Cell\",th:\"Header\",td:\"Data\",summary:\"Summary\",bgimage:\"Background Image\",rtl:\"Right to Left\",ltr:\"Left to Right\",mime:\"Target MIME Type\",langcode:\"Language Code\",langdir:\"Language Direction\",style:\"Style\",id:\"ID\",\"merge_cells_title\":\"Merge Table Cells\",bgcolor:\"Background Color\",bordercolor:\"Border Color\",\"align_bottom\":\"Bottom\",\"align_top\":\"Top\",valign:\"Vertical Alignment\",\"cell_type\":\"Cell Type\",\"cell_title\":\"Table Cell Properties\",\"row_title\":\"Table Row Properties\",\"align_middle\":\"Center\",\"align_right\":\"Right\",\"align_left\":\"Left\",\"align_default\":\"Default\",align:\"Alignment\",border:\"Border\",cellpadding:\"Cell Padding\",cellspacing:\"Cell Spacing\",rows:\"Rows\",cols:\"Columns\",height:\"Height\",width:\"Width\",title:\"Insert/Edit Table\",rowtype:\"Row Type\",\"advanced_props\":\"Advanced Properties\",\"general_props\":\"General Properties\",\"advanced_tab\":\"Advanced\",\"general_tab\":\"General\",\"cell_col\":\"Update all cells in column\"});","Potato_Zendesk/js/tiny_mce/plugins/template/editor_plugin.js":"(function(){var a=tinymce.each;tinymce.create(\"tinymce.plugins.TemplatePlugin\",{init:function(b,c){var d=this;d.editor=b;b.addCommand(\"mceTemplate\",function(e){b.windowManager.open({file:c+\"/template.htm\",width:b.getParam(\"template_popup_width\",750),height:b.getParam(\"template_popup_height\",600),inline:1},{plugin_url:c})});b.addCommand(\"mceInsertTemplate\",d._insertTemplate,d);b.addButton(\"template\",{title:\"template.desc\",cmd:\"mceTemplate\"});b.onPreProcess.add(function(e,g){var f=e.dom;a(f.select(\"div\",g.node),function(h){if(f.hasClass(h,\"mceTmpl\")){a(f.select(\"*\",h),function(i){if(f.hasClass(i,e.getParam(\"template_mdate_classes\",\"mdate\").replace(/\\s+/g,\"|\"))){i.innerHTML=d._getDateTime(new Date(),e.getParam(\"template_mdate_format\",e.getLang(\"template.mdate_format\")))}});d._replaceVals(h)}})})},getInfo:function(){return{longname:\"Template plugin\",author:\"Moxiecode Systems AB\",authorurl:\"http://www.moxiecode.com\",infourl:\"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/template\",version:tinymce.majorVersion+\".\"+tinymce.minorVersion}},_insertTemplate:function(i,j){var k=this,g=k.editor,f,c,d=g.dom,b=g.selection.getContent();f=j.content;a(k.editor.getParam(\"template_replace_values\"),function(l,h){if(typeof(l)!=\"function\"){f=f.replace(new RegExp(\"\\\\{\\\\$\"+h+\"\\\\}\",\"g\"),l)}});c=d.create(\"div\",null,f);n=d.select(\".mceTmpl\",c);if(n&&n.length>0){c=d.create(\"div\",null);c.appendChild(n[0].cloneNode(true))}function e(l,h){return new RegExp(\"\\\\b\"+h+\"\\\\b\",\"g\").test(l.className)}a(d.select(\"*\",c),function(h){if(e(h,g.getParam(\"template_cdate_classes\",\"cdate\").replace(/\\s+/g,\"|\"))){h.innerHTML=k._getDateTime(new Date(),g.getParam(\"template_cdate_format\",g.getLang(\"template.cdate_format\")))}if(e(h,g.getParam(\"template_mdate_classes\",\"mdate\").replace(/\\s+/g,\"|\"))){h.innerHTML=k._getDateTime(new Date(),g.getParam(\"template_mdate_format\",g.getLang(\"template.mdate_format\")))}if(e(h,g.getParam(\"template_selected_content_classes\",\"selcontent\").replace(/\\s+/g,\"|\"))){h.innerHTML=b}});k._replaceVals(c);g.execCommand(\"mceInsertContent\",false,c.innerHTML);g.addVisual()},_replaceVals:function(c){var d=this.editor.dom,b=this.editor.getParam(\"template_replace_values\");a(d.select(\"*\",c),function(f){a(b,function(g,e){if(d.hasClass(f,e)){if(typeof(b[e])==\"function\"){b[e](f)}}})})},_getDateTime:function(e,b){if(!b){return\"\"}function c(g,d){var f;g=\"\"+g;if(g.length<d){for(f=0;f<(d-g.length);f++){g=\"0\"+g}}return g}b=b.replace(\"%D\",\"%m/%d/%y\");b=b.replace(\"%r\",\"%I:%M:%S %p\");b=b.replace(\"%Y\",\"\"+e.getFullYear());b=b.replace(\"%y\",\"\"+e.getYear());b=b.replace(\"%m\",c(e.getMonth()+1,2));b=b.replace(\"%d\",c(e.getDate(),2));b=b.replace(\"%H\",\"\"+c(e.getHours(),2));b=b.replace(\"%M\",\"\"+c(e.getMinutes(),2));b=b.replace(\"%S\",\"\"+c(e.getSeconds(),2));b=b.replace(\"%I\",\"\"+((e.getHours()+11)%12+1));b=b.replace(\"%p\",\"\"+(e.getHours()<12?\"AM\":\"PM\"));b=b.replace(\"%B\",\"\"+this.editor.getLang(\"template_months_long\").split(\",\")[e.getMonth()]);b=b.replace(\"%b\",\"\"+this.editor.getLang(\"template_months_short\").split(\",\")[e.getMonth()]);b=b.replace(\"%A\",\"\"+this.editor.getLang(\"template_day_long\").split(\",\")[e.getDay()]);b=b.replace(\"%a\",\"\"+this.editor.getLang(\"template_day_short\").split(\",\")[e.getDay()]);b=b.replace(\"%%\",\"%\");return b}});tinymce.PluginManager.add(\"template\",tinymce.plugins.TemplatePlugin)})();","Potato_Zendesk/js/tiny_mce/plugins/template/editor_plugin_src.js":"/**\n * editor_plugin_src.js\n *\n * Copyright 2009, Moxiecode Systems AB\n * Released under LGPL License.\n *\n * 
2License: http://tinymce.moxiecode.com/license\n * Contributing: http://tinymce.moxiecode.com/contributing\n */\n\n(function() {\n\tvar each = tinymce.each;\n\n\ttinymce.create('tinymce.plugins.TemplatePlugin', {\n\t\tinit : function(ed, url) {\n\t\t\tvar t = this;\n\n\t\t\tt.editor = ed;\n\n\t\t\t// Register commands\n\t\t\ted.addCommand('mceTemplate', function(ui) {\n\t\t\t\ted.windowManager.open({\n\t\t\t\t\tfile : url + '/template.htm',\n\t\t\t\t\twidth : ed.getParam('template_popup_width', 750),\n\t\t\t\t\theight : ed.getParam('template_popup_height', 600),\n\t\t\t\t\tinline : 1\n\t\t\t\t}, {\n\t\t\t\t\tplugin_url : url\n\t\t\t\t});\n\t\t\t});\n\n\t\t\ted.addCommand('mceInsertTemplate', t._insertTemplate, t);\n\n\t\t\t// Register buttons\n\t\t\ted.addButton('template', {title : 'template.desc', cmd : 'mceTemplate'});\n\n\t\t\ted.onPreProcess.add(function(ed, o) {\n\t\t\t\tvar dom = ed.dom;\n\n\t\t\t\teach(dom.select('div', o.node), function(e) {\n\t\t\t\t\tif (dom.hasClass(e, 'mceTmpl')) {\n\t\t\t\t\t\teach(dom.select('*', e), function(e) {\n\t\t\t\t\t\t\tif (dom.hasClass(e, ed.getParam('template_mdate_classes', 'mdate').replace(/\\s+/g, '|')))\n\t\t\t\t\t\t\t\te.innerHTML = t._getDateTime(new Date(), ed.getParam(\"template_mdate_format\", ed.getLang(\"template.mdate_format\")));\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\tt._replaceVals(e);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t});\n\t\t},\n\n\t\tgetInfo : function() {\n\t\t\treturn {\n\t\t\t\tlongname : 'Template plugin',\n\t\t\t\tauthor : 'Moxiecode Systems AB',\n\t\t\t\tauthorurl : 'http://www.moxiecode.com',\n\t\t\t\tinfourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/template',\n\t\t\t\tversion : tinymce.majorVersion + \".\" + tinymce.minorVersion\n\t\t\t};\n\t\t},\n\n\t\t_insertTemplate : function(ui, v) {\n\t\t\tvar t = this, ed = t.editor, h, el, dom = ed.dom, sel = ed.selection.getContent();\n\n\t\t\th = v.content;\n\n\t\t\teach(t.editor.getParam('template_replace_values'), function(v, k) {\n\t\t\t\tif (typeof(v) != 'function')\n\t\t\t\t\th = h.replace(new RegExp('\\\\{\\\\$' + k + '\\\\}', 'g'), v);\n\t\t\t});\n\n\t\t\tel = dom.create('div', null, h);\n\n\t\t\t// Find template element within div\n\t\t\tn = dom.select('.mceTmpl', el);\n\t\t\tif (n && n.length > 0) {\n\t\t\t\tel = dom.create('div', null);\n\t\t\t\tel.appendChild(n[0].cloneNode(true));\n\t\t\t}\n\n\t\t\tfunction hasClass(n, c) {\n\t\t\t\treturn new RegExp('\\\\b' + c + '\\\\b', 'g').test(n.className);\n\t\t\t};\n\n\t\t\teach(dom.select('*', el), function(n) {\n\t\t\t\t// Replace cdate\n\t\t\t\tif (hasClass(n, ed.getParam('template_cdate_classes', 'cdate').replace(/\\s+/g, '|')))\n\t\t\t\t\tn.innerHTML = t._getDateTime(new Date(), ed.getParam(\"template_cdate_format\", ed.getLang(\"template.cdate_format\")));\n\n\t\t\t\t// Replace mdate\n\t\t\t\tif (hasClass(n, ed.getParam('template_mdate_classes', 'mdate').replace(/\\s+/g, '|')))\n\t\t\t\t\tn.innerHTML = t._getDateTime(new Date(), ed.getParam(\"template_mdate_format\", ed.getLang(\"template.mdate_format\")));\n\n\t\t\t\t// Replace selection\n\t\t\t\tif (hasClass(n, ed.getParam('template_selected_content_classes', 'selcontent').replace(/\\s+/g, '|')))\n\t\t\t\t\tn.innerHTML = sel;\n\t\t\t});\n\n\t\t\tt._replaceVals(el);\n\n\t\t\ted.execCommand('mceInsertContent', false, el.innerHTML);\n\t\t\ted.addVisual();\n\t\t},\n\n\t\t_replaceVals : function(e) {\n\t\t\tvar dom = this.editor.dom, vl = this.editor.getParam('template_replace_values');\n\n\t\t\teach(dom.select('*', e), function(e) {\n\t\t\t\teach(vl, function(v, k) {\n\t\t\t\t\tif (dom.hasClass(e, k)) {\n\t\t\t\t\t\tif (typeof(vl[k]) == 'function')\n\t\t\t\t\t\t\tvl[k](e);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t});\n\t\t},\n\n\t\t_getDateTime : function(d, fmt) {\n\t\t\t\tif (!fmt)\n\t\t\t\t\treturn \"\";\n\n\t\t\t\tfunction addZeros(value, len) {\n\t\t\t\t\tvar i;\n\n\t\t\t\t\tvalue = \"\" + value;\n\n\t\t\t\t\tif (value.length < len) {\n\t\t\t\t\t\tfor (i=0; i<(len-value.length); i++)\n\t\t\t\t\t\t\tvalue = \"0\" + value;\n\t\t\t\t\t}\n\n\t\t\t\t\treturn value;\n\t\t\t\t}\n\n\t\t\t\tfmt = fmt.replace(\"%D\", \"%m/%d/%y\");\n\t\t\t\tfmt = fmt.replace(\"%r\", \"%I:%M:%S %p\");\n\t\t\t\tfmt = fmt.replace(\"%Y\", \"\" + d.getFullYear());\n\t\t\t\tfmt = fmt.replace(\"%y\", \"\" + d.getYear());\n\t\t\t\tfmt = fmt.replace(\"%m\", addZeros(d.getMonth()+1, 2));\n\t\t\t\tfmt = fmt.replace(\"%d\", addZeros(d.getDate(), 2));\n\t\t\t\tfmt = fmt.replace(\"%H\", \"\" + addZeros(d.getHours(), 2));\n\t\t\t\tfmt = fmt.replace(\"%M\", \"\" + addZeros(d.getMinutes(), 2));\n\t\t\t\tfmt = fmt.replace(\"%S\", \"\" + addZeros(d.getSeconds(), 2));\n\t\t\t\tfmt = fmt.replace(\"%I\", \"\" + ((d.getHours() + 11) % 12 + 1));\n\t\t\t\tfmt = fmt.replace(\"%p\", \"\" + (d.getHours() < 12 ? \"AM\" : \"PM\"));\n\t\t\t\tfmt = fmt.replace(\"%B\", \"\" + this.editor.getLang(\"template_months_long\").split(',')[d.getMonth()]);\n\t\t\t\tfmt = fmt.replace(\"%b\", \"\" + this.editor.getLang(\"template_months_short\").split(',')[d.getMonth()]);\n\t\t\t\tfmt = fmt.replace(\"%A\", \"\" + this.editor.getLang(\"template_day_long\").split(',')[d.getDay()]);\n\t\t\t\tfmt = fmt.replace(\"%a\", \"\" + this.editor.getLang(\"template_day_short\").split(',')[d.getDay()]);\n\t\t\t\tfmt = fmt.replace(\"%%\", \"%\");\n\n\t\t\t\treturn fmt;\n\t\t}\n\t});\n\n\t// Register plugin\n\ttinymce.PluginManager.add('template', tinymce.plugins.TemplatePlugin);\n})();","Potato_Zendesk/js/tiny_mce/plugins/template/js/template.js":"tinyMCEPopup.requireLangPack();
2\n\nvar TemplateDialog = {\n\tpreInit : function() {\n\t\tvar url = tinyMCEPopup.getParam(\"template_external_list_url\");\n\n\t\tif (url != null)\n\t\t\tdocument.write('<sc'+'ript language=\"javascript\" type=\"text/javascript\" src=\"' + tinyMCEPopup.editor.documentBaseURI.toAbsolute(url) + '\"></sc'+'ript>');\n\t},\n\n\tinit : function() {\n\t\tvar ed = tinyMCEPopup.editor, tsrc, sel, x, u;\n\n \t\ttsrc = ed.getParam(\"template_templates\", false);\n \t\tsel = document.getElementById('tpath');\n\n\t\t// Setup external template list\n\t\tif (!tsrc && typeof(tinyMCETemplateList) != 'undefined') {\n\t\t\tfor (x=0, tsrc = []; x<tinyMCETemplateList.length; x++)\n\t\t\t\ttsrc.push({title : tinyMCETemplateList[x][0], src : tinyMCETemplateList[x][1], description : tinyMCETemplateList[x][2]});\n\t\t}\n\n\t\tfor (x=0; x<tsrc.length; x++)\n\t\t\tsel.options[sel.options.length] = new Option(tsrc[x].title, tinyMCEPopup.editor.documentBaseURI.toAbsolute(tsrc[x].src));\n\n\t\tthis.resize();\n\t\tthis.tsrc = tsrc;\n\t},\n\n\tresize : function() {\n\t\tvar w, h, e;\n\n\t\tif (!self.innerWidth) {\n\t\t\tw = document.body.clientWidth - 50;\n\t\t\th = document.body.clientHeight - 160;\n\t\t} else {\n\t\t\tw = self.innerWidth - 50;\n\t\t\th = self.innerHeight - 170;\n\t\t}\n\n\t\te = document.getElementById('templatesrc');\n\n\t\tif (e) {\n\t\t\te.style.height = Math.abs(h) + 'px';\n\t\t\te.style.width = Math.abs(w - 5) + 'px';\n\t\t}\n\t},\n\n\tloadCSSFiles : function(d) {\n\t\tvar ed = tinyMCEPopup.editor;\n\n\t\ttinymce.each(ed.getParam(\"content_css\", '').split(','), function(u) {\n\t\t\td.write('<link href=\"' + ed.documentBaseURI.toAbsolute(u) + '\" rel=\"stylesheet\" type=\"text/css\" />');\n\t\t});\n\t},\n\n\tselectTemplate : function(u, ti) {\n\t\tvar d = window.frames['templatesrc'].document, x, tsrc = this.tsrc;\n\n\t\tif (!u)\n\t\t\treturn;\n\n\t\td.body.innerHTML = this.templateHTML = this.getFileContents(u);\n\n\t\tfor (x=0; x<tsrc.length; x++) {\n\t\t\tif (tsrc[x].title == ti)\n\t\t\t\tdocument.getElementById('tmpldesc').innerHTML = tsrc[x].description || '';\n\t\t}\n\t},\n\n \tinsert : function() {\n\t\ttinyMCEPopup.execCommand('mceInsertTemplate', false, {\n\t\t\tcontent : this.templateHTML,\n\t\t\tselection : tinyMCEPopup.editor.selection.getContent()\n\t\t});\n\n\t\ttinyMCEPopup.close();\n\t},\n\n\tgetFileContents : function(u) {\n\t\tvar x, d, t = 'text/plain';\n\n\t\tfunction g(s) {\n\t\t\tx = 0;\n\n\t\t\ttry {\n\t\t\t\tx = new ActiveXObject(s);\n\t\t\t} catch (s) {\n\t\t\t}\n\n\t\t\treturn x;\n\t\t};\n\n\t\tx = window.ActiveXObject ? g('Msxml2.XMLHTTP') || g('Microsoft.XMLHTTP') : new XMLHttpRequest();\n\n\t\t// Synchronous AJAX load file\n\t\tx.overrideMimeType && x.overrideMimeType(t);\n\t\tx.open(\"GET\", u, false);\n\t\tx.send(null);\n\n\t\treturn x.responseText;\n\t}\n};\n\nTemplateDialog.preInit();\ntinyMCEPopup.onInit.add(TemplateDialog.init, TemplateDialog);\n","Potato_Zendesk/js/tiny_mce/plugins/template/langs/en_dlg.js":"tinyMCE.addI18n('en.template_dlg',{title:\"Templates\",label:\"Template\",\"desc_label\":\"Description\",desc:\"Insert Predefined Template Content\",select:\"Select a Template\",preview:\"Preview\",warning:\"Warning: Updating a template with a different one may cause data loss.\",\"mdate_format\":\"%Y-%m-%d %H:%M:%S\",\"cdate_format\":\"%Y-%m-%d %H:%M:%S\",\"months_long\":\"January,February,March,April,May,June,July,August,September,October,November,December\",\"months_short\":\"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec\",\"day_long\":\"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday,Sunday\",\"day_short\":\"Sun,Mon,Tue,Wed,Thu,Fri,Sat,Sun\"});","Potato_Zendesk/js/tiny_mce/plugins/visualchars/editor_plugin.js":"(function(){tinymce.create(\"tinymce.plugins.VisualChars\",{init:function(a,b){var c=this;c.editor=a;a.addCommand(\"mceVisualChars\",c._toggleVisualChars,c);a.addButton(\"visualchars\",{title:\"visualchars.desc\",cmd:\"mceVisualChars\"});a.onBeforeGetContent.add(function(d,e){if(c.state&&e.format!=\"raw\"&&!e.draft){c.state=true;c._toggleVisualChars(false)}})},getInfo:function(){return{longname:\"Visual characters\",author:\"Moxiecode Systems AB\",authorurl:\"http://tinymce.moxiecode.com\",infourl:\"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/visualchars\",version:tinymce.majorVersion+\".\"+tinymce.minorVersion}},_toggleVisualChars:function(m){var p=this,k=p.editor,a,g,j,n=k.getDoc(),o=k.getBody(),l,q=k.selection,e,c,f;p.state=!p.state;k.controlManager.setActive(\"visualchars\",p.state);if(m){f=q.getBookmark()}if(p.state){a=[];tinymce.walk(o,function(b){if(b.nodeType==3&&b.nodeValue&&b.nodeValue.indexOf(\"\\u00a0\")!=-1){a.push(b)}},\"childNodes\");for(g=0;g<a.length;g++){l=a[g].nodeValue;l=l.replace(/(\\u00a0)/g,'<span data-mce-bogus=\"1\" class=\"mceItemHidden mceItemNbsp\">$1</span>');c=k.dom.create(\"div\",null,l);while(node=c.lastChild){k.dom.insertAfter(node,a[g])}k.dom.remove(a[g])}}else{a=k.dom.select(\"span.mceItemNbsp\",o);for(g=a.length-1;g>=0;g--){k.dom.remove(a[g],1)}}q.moveToBookmark(f)}});tinymce.PluginManager.add(\"visualchars\",tinymce.plugins.VisualChars)})();","Potato_Zendesk/js/tiny_mce/plugins/visualchars/editor_plugin_src.js":"/**\n * editor_plugin_src.js\n *\n * Copyright 2009, Moxiecode Systems AB\n * Released under LGPL License.\n *\n * 
2License: http://tinymce.moxiecode.com/license\n * Contributing: http://tinymce.moxiecode.com/contributing\n */\n\n(function() {\n\ttinymce.create('tinymce.plugins.VisualChars', {\n\t\tinit : function(ed, url) {\n\t\t\tvar t = this;\n\n\t\t\tt.editor = ed;\n\n\t\t\t// Register commands\n\t\t\ted.addCommand('mceVisualChars', t._toggleVisualChars, t);\n\n\t\t\t// Register buttons\n\t\t\ted.addButton('visualchars', {title : 'visualchars.desc', cmd : 'mceVisualChars'});\n\n\t\t\ted.onBeforeGetContent.add(function(ed, o) {\n\t\t\t\tif (t.state && o.format != 'raw' && !o.draft) {\n\t\t\t\t\tt.state = true;\n\t\t\t\t\tt._toggleVisualChars(false);\n\t\t\t\t}\n\t\t\t});\n\t\t},\n\n\t\tgetInfo : function() {\n\t\t\treturn {\n\t\t\t\tlongname : 'Visual characters',\n\t\t\t\tauthor : 'Moxiecode Systems AB',\n\t\t\t\tauthorurl : 'http://tinymce.moxiecode.com',\n\t\t\t\tinfourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/visualchars',\n\t\t\t\tversion : tinymce.majorVersion + \".\" + tinymce.minorVersion\n\t\t\t};\n\t\t},\n\n\t\t// Private methods\n\n\t\t_toggleVisualChars : function(bookmark) {\n\t\t\tvar t = this, ed = t.editor, nl, i, h, d = ed.getDoc(), b = ed.getBody(), nv, s = ed.selection, bo, div, bm;\n\n\t\t\tt.state = !t.state;\n\t\t\ted.controlManager.setActive('visualchars', t.state);\n\n\t\t\tif (bookmark)\n\t\t\t\tbm = s.getBookmark();\n\n\t\t\tif (t.state) {\n\t\t\t\tnl = [];\n\t\t\t\ttinymce.walk(b, function(n) {\n\t\t\t\t\tif (n.nodeType == 3 && n.nodeValue && n.nodeValue.indexOf('\\u00a0') != -1)\n\t\t\t\t\t\tnl.push(n);\n\t\t\t\t}, 'childNodes');\n\n\t\t\t\tfor (i = 0; i < nl.length; i++) {\n\t\t\t\t\tnv = nl[i].nodeValue;\n\t\t\t\t\tnv = nv.replace(/(\\u00a0)/g, '<span data-mce-bogus=\"1\" class=\"mceItemHidden mceItemNbsp\">$1</span>');\n\n\t\t\t\t\tdiv = ed.dom.create('div', null, nv);\n\t\t\t\t\twhile (node = div.lastChild)\n\t\t\t\t\t\ted.dom.insertAfter(node, nl[i]);\n\n\t\t\t\t\ted.dom.remove(nl[i]);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tnl = ed.dom.select('span.mceItemNbsp', b);\n\n\t\t\t\tfor (i = nl.length - 1; i >= 0; i--)\n\t\t\t\t\ted.dom.remove(nl[i], 1);\n\t\t\t}\n\n\t\t\ts.moveToBookmark(bm);\n\t\t}\n\t});\n\n\t// Register plugin\n\ttinymce.PluginManager.add('visualchars', tinymce.plugins.VisualChars);\n})();","Potato_Zendesk/js/tiny_mce/plugins/wordcount/editor_plugin.js":"(function(){tinymce.create(\"tinymce.plugins.WordCount\",{block:0,id:null,countre:null,cleanre:null,init:function(a,b){var c=this,d=0;c.countre=a.getParam(\"wordcount_countregex\",/[\\w\\u2019\\'-]+/g);c.cleanre=a.getParam(\"wordcount_cleanregex\",/[0-9.(),;:!?%#$?\\'\\\"_+=\\\\\\/-]*/g);c.id=a.id+\"-word-count\";a.onPostRender.add(function(f,e){var g,h;h=f.getParam(\"wordcount_target_id\");if(!h){g=tinymce.DOM.get(f.id+\"_path_row\");if(g){tinymce.DOM.add(g.parentNode,\"div\",{style:\"float: right\"},f.getLang(\"wordcount.words\",\"Words: \")+'<span id=\"'+c.id+'\">0</span>')}}else{tinymce.DOM.add(h,\"span\",{},'<span id=\"'+c.id+'\">0</span>')}});a.onInit.add(function(e){e.selection.onSetContent.add(function(){c._count(e)});c._count(e)});a.onSetContent.add(function(e){c._count(e)});a.onKeyUp.add(function(f,g){if(g.keyCode==d){return}if(13==g.keyCode||8==d||46==d){c._count(f)}d=g.keyCode})},_getCount:function(c){var a=0;var b=c.getContent({format:\"raw\"});if(b){b=b.replace(/\\.\\.\\./g,\" \");b=b.replace(/<.[^<>]*?>/g,\" \").replace(/&nbsp;|&#160;/gi,\" \");b=b.replace(/(\\w+)(&.+?;)+(\\w+)/,\"$1$3\").replace(/&.+?;/g,\" \");b=b.replace(this.cleanre,\"\");var d=b.match(this.countre);if(d){a=d.length}}return a},_count:function(a){var b=this;if(b.block){return}b.block=1;setTimeout(function(){if(!a.destroyed){var c=b._getCount(a);tinymce.DOM.setHTML(b.id,c.toString());setTimeout(function(){b.block=0},2000)}},1)},getInfo:function(){return{longname:\"Word Count plugin\",author:\"Moxiecode Systems AB\",authorurl:\"http://tinymce.moxiecode.com\",infourl:\"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/wordcount\",version:tinymce.majorVersion+\".\"+tinymce.minorVersion}}});tinymce.PluginManager.add(\"wordcount\",tinymce.plugins.WordCount)})();","Potato_Zendesk/js/tiny_mce/plugins/wordcount/editor_plugin_src.js":"/**\n * editor_plugin_src.js\n *\n * Copyright 2009, Moxiecode Systems AB\n * Released under LGPL License.\n *\n * 
2License: http://tinymce.moxiecode.com/license\n * Contributing: http://tinymce.moxiecode.com/contributing\n */\n\n(function() {\n\ttinymce.create('tinymce.plugins.WordCount', {\n\t\tblock : 0,\n\t\tid : null,\n\t\tcountre : null,\n\t\tcleanre : null,\n\n\t\tinit : function(ed, url) {\n\t\t\tvar t = this, last = 0;\n\n\t\t\tt.countre = ed.getParam('wordcount_countregex', /[\\w\\u2019\\'-]+/g); // u2019 == &rsquo;\n\t\t\tt.cleanre = ed.getParam('wordcount_cleanregex', /[0-9.(),;:!?%#$?\\'\\\"_+=\\\\\\/-]*/g);\n\t\t\tt.id = ed.id + '-word-count';\n\n\t\t\ted.onPostRender.add(function(ed, cm) {\n\t\t\t\tvar row, id;\n\n\t\t\t\t// Add it to the specified id or the theme advanced path\n\t\t\t\tid = ed.getParam('wordcount_target_id');\n\t\t\t\tif (!id) {\n\t\t\t\t\trow = tinymce.DOM.get(ed.id + '_path_row');\n\n\t\t\t\t\tif (row)\n\t\t\t\t\t\ttinymce.DOM.add(row.parentNode, 'div', {'style': 'float: right'}, ed.getLang('wordcount.words', 'Words: ') + '<span id=\"' + t.id + '\">0</span>');\n\t\t\t\t} else {\n\t\t\t\t\ttinymce.DOM.add(id, 'span', {}, '<span id=\"' + t.id + '\">0</span>');\n\t\t\t\t}\n\t\t\t});\n\n\t\t\ted.onInit.add(function(ed) {\n\t\t\t\ted.selection.onSetContent.add(function() {\n\t\t\t\t\tt._count(ed);\n\t\t\t\t});\n\n\t\t\t\tt._count(ed);\n\t\t\t});\n\n\t\t\ted.onSetContent.add(function(ed) {\n\t\t\t\tt._count(ed);\n\t\t\t});\n\n\t\t\ted.onKeyUp.add(function(ed, e) {\n\t\t\t\tif (e.keyCode == last)\n\t\t\t\t\treturn;\n\n\t\t\t\tif (13 == e.keyCode || 8 == last || 46 == last)\n\t\t\t\t\tt._count(ed);\n\n\t\t\t\tlast = e.keyCode;\n\t\t\t});\n\t\t},\n\n\t\t_getCount : function(ed) {\n\t\t\tvar tc = 0;\n\t\t\tvar tx = ed.getContent({ format: 'raw' });\n\n\t\t\tif (tx) {\n\t\t\t\t\ttx = tx.replace(/\\.\\.\\./g, ' '); // convert ellipses to spaces\n\t\t\t\t\ttx = tx.replace(/<.[^<>]*?>/g, ' ').replace(/&nbsp;|&#160;/gi, ' '); // remove html tags and space chars\n\n\t\t\t\t\t// deal with html entities\n\t\t\t\t\ttx = tx.replace(/(\\w+)(&.+?;)+(\\w+)/, \"$1$3\").replace(/&.+?;/g, ' ');\n\t\t\t\t\ttx = tx.replace(this.cleanre, ''); // remove numbers and punctuation\n\n\t\t\t\t\tvar wordArray = tx.match(this.countre);\n\t\t\t\t\tif (wordArray) {\n\t\t\t\t\t\t\ttc = wordArray.length;\n\t\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn tc;\n\t\t},\n\n\t\t_count : function(ed) {\n\t\t\tvar t = this;\n\n\t\t\t// Keep multiple calls from happening at the same time\n\t\t\tif (t.block)\n\t\t\t\treturn;\n\n\t\t\tt.block = 1;\n\n\t\t\tsetTimeout(function() {\n\t\t\t\tif (!ed.destroyed) {\n\t\t\t\t\tvar tc = t._getCount(ed);\n\t\t\t\t\ttinymce.DOM.setHTML(t.id, tc.toString());\n\t\t\t\t\tsetTimeout(function() {t.block = 0;}, 2000);\n\t\t\t\t}\n\t\t\t}, 1);\n\t\t},\n\n\t\tgetInfo: function() {\n\t\t\treturn {\n\t\t\t\tlongname : 'Word Count plugin',\n\t\t\t\tauthor : 'Moxiecode Systems AB',\n\t\t\t\tauthorurl : 'http://tinymce.moxiecode.com',\n\t\t\t\tinfourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/wordcount',\n\t\t\t\tversion : tinymce.majorVersion + \".\" + tinymce.minorVersion\n\t\t\t};\n\t\t}\n\t});\n\n\ttinymce.PluginManager.add('wordcount', tinymce.plugins.WordCount);\n})();\n","Potato_Zendesk/js/tiny_mce/plugins/xhtmlxtras/editor_plugin.js":"(function(){tinymce.create(\"tinymce.plugins.XHTMLXtrasPlugin\",{init:function(a,b){a.addCommand(\"mceCite\",function(){a.windowManager.open({file:b+\"/cite.htm\",width:350+parseInt(a.getLang(\"xhtmlxtras.cite_delta_width\",0)),height:250+parseInt(a.getLang(\"xhtmlxtras.cite_delta_height\",0)),inline:1},{plugin_url:b})});a.addCommand(\"mceAcronym\",function(){a.windowManager.open({file:b+\"/acronym.htm\",width:350+parseInt(a.getLang(\"xhtmlxtras.acronym_delta_width\",0)),height:250+parseInt(a.getLang(\"xhtmlxtras.acronym_delta_height\",0)),inline:1},{plugin_url:b})});a.addCommand(\"mceAbbr\",function(){a.windowManager.open({file:b+\"/abbr.htm\",width:350+parseInt(a.getLang(\"xhtmlxtras.abbr_delta_width\",0)),height:250+parseInt(a.getLang(\"xhtmlxtras.abbr_delta_height\",0)),inline:1},{plugin_url:b})});a.addCommand(\"mceDel\",function(){a.windowManager.open({file:b+\"/del.htm\",width:340+parseInt(a.getLang(\"xhtmlxtras.del_delta_width\",0)),height:310+parseInt(a.getLang(\"xhtmlxtras.del_delta_height\",0)),inline:1},{plugin_url:b})});a.addCommand(\"mceIns\",function(){a.windowManager.open({file:b+\"/ins.htm\",width:340+parseInt(a.getLang(\"xhtmlxtras.ins_delta_width\",0)),height:310+parseInt(a.getLang(\"xhtmlxtras.ins_delta_height\",0)),inline:1},{plugin_url:b})});a.addCommand(\"mceAttributes\",function(){a.windowManager.open({file:b+\"/attributes.htm\",width:380+parseInt(a.getLang(\"xhtmlxtras.attr_delta_width\",0)),height:370+parseInt(a.getLang(\"xhtmlxtras.attr_delta_height\",0)),inline:1},{plugin_url:b})});a.addButton(\"cite\",{title:\"xhtmlxtras.cite_desc\",cmd:\"mceCite\"});a.addButton(\"acronym\",{title:\"xhtmlxtras.acronym_desc\",cmd:\"mceAcronym\"});a.addButton(\"abbr\",{title:\"xhtmlxtras.abbr_desc\",cmd:\"mceAbbr\"});a.addButton(\"del\",{title:\"xhtmlxtras.del_desc\",cmd:\"mceDel\"});a.addButton(\"ins\",{title:\"xhtmlxtras.ins_desc\",cmd:\"mceIns\"});a.addButton(\"attribs\",{title:\"xhtmlxtras.attribs_desc\",cmd:\"mceAttributes\"});a.onNodeChange.add(function(d,c,f,e){f=d.dom.getParent(f,\"CITE,ACRONYM,ABBR,DEL,INS\");c.setDisabled(\"cite\",e);c.setDisabled(\"acronym\",e);c.setDisabled(\"abbr\",e);c.setDisabled(\"del\",e);c.setDisabled(\"ins\",e);c.setDisabled(\"attribs\",f&&f.nodeName==\"BODY\");c.setActive(\"cite\",0);c.setActive(\"acronym\",0);c.setActive(\"abbr\",0);c.setActive(\"del\",0);c.setActive(\"ins\",0);if(f){do{c.setDisabled(f.nodeName.toLowerCase(),0);c.setActive(f.nodeName.toLowerCase(),1)}while(f=f.parentNode)}});a.onPreInit.add(function(){a.dom.create(\"abbr\")})},getInfo:function(){return{longname:\"XHTML Xtras Plugin\",author:\"Moxiecode Systems AB\",authorurl:\"http://tinymce.moxiecode.com\",infourl:\"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/xhtmlxtras\",version:tinymce.majorVersion+\".\"+tinymce.minorVersion}}});tinymce.PluginManager.add(\"xhtmlxtras\",tinymce.plugins.XHTMLXtrasPlugin)})();","Potato_Zendesk/js/tiny_mce/plugins/xhtmlxtras/editor_plugin_src.js":"/**\n * editor_plugin_src.js\n *\n * Copyright 2009, Moxiecode Systems AB\n * Released under LGPL License.\n *\n * 
2License: http://tinymce.moxiecode.com/license\n * Contributing: http://tinymce.moxiecode.com/contributing\n */\n\n(function() {\n\ttinymce.create('tinymce.plugins.XHTMLXtrasPlugin', {\n\t\tinit : function(ed, url) {\n\t\t\t// Register commands\n\t\t\ted.addCommand('mceCite', function() {\n\t\t\t\ted.windowManager.open({\n\t\t\t\t\tfile : url + '/cite.htm',\n\t\t\t\t\twidth : 350 + parseInt(ed.getLang('xhtmlxtras.cite_delta_width', 0)),\n\t\t\t\t\theight : 250 + parseInt(ed.getLang('xhtmlxtras.cite_delta_height', 0)),\n\t\t\t\t\tinline : 1\n\t\t\t\t}, {\n\t\t\t\t\tplugin_url : url\n\t\t\t\t});\n\t\t\t});\n\n\t\t\ted.addCommand('mceAcronym', function() {\n\t\t\t\ted.windowManager.open({\n\t\t\t\t\tfile : url + '/acronym.htm',\n\t\t\t\t\twidth : 350 + parseInt(ed.getLang('xhtmlxtras.acronym_delta_width', 0)),\n\t\t\t\t\theight : 250 + parseInt(ed.getLang('xhtmlxtras.acronym_delta_height', 0)),\n\t\t\t\t\tinline : 1\n\t\t\t\t}, {\n\t\t\t\t\tplugin_url : url\n\t\t\t\t});\n\t\t\t});\n\n\t\t\ted.addCommand('mceAbbr', function() {\n\t\t\t\ted.windowManager.open({\n\t\t\t\t\tfile : url + '/abbr.htm',\n\t\t\t\t\twidth : 350 + parseInt(ed.getLang('xhtmlxtras.abbr_delta_width', 0)),\n\t\t\t\t\theight : 250 + parseInt(ed.getLang('xhtmlxtras.abbr_delta_height', 0)),\n\t\t\t\t\tinline : 1\n\t\t\t\t}, {\n\t\t\t\t\tplugin_url : url\n\t\t\t\t});\n\t\t\t});\n\n\t\t\ted.addCommand('mceDel', function() {\n\t\t\t\ted.windowManager.open({\n\t\t\t\t\tfile : url + '/del.htm',\n\t\t\t\t\twidth : 340 + parseInt(ed.getLang('xhtmlxtras.del_delta_width', 0)),\n\t\t\t\t\theight : 310 + parseInt(ed.getLang('xhtmlxtras.del_delta_height', 0)),\n\t\t\t\t\tinline : 1\n\t\t\t\t}, {\n\t\t\t\t\tplugin_url : url\n\t\t\t\t});\n\t\t\t});\n\n\t\t\ted.addCommand('mceIns', function() {\n\t\t\t\ted.windowManager.open({\n\t\t\t\t\tfile : url + '/ins.htm',\n\t\t\t\t\twidth : 340 + parseInt(ed.getLang('xhtmlxtras.ins_delta_width', 0)),\n\t\t\t\t\theight : 310 + parseInt(ed.getLang('xhtmlxtras.ins_delta_height', 0)),\n\t\t\t\t\tinline : 1\n\t\t\t\t}, {\n\t\t\t\t\tplugin_url : url\n\t\t\t\t});\n\t\t\t});\n\n\t\t\ted.addCommand('mceAttributes', function() {\n\t\t\t\ted.windowManager.open({\n\t\t\t\t\tfile : url + '/attributes.htm',\n\t\t\t\t\twidth : 380 + parseInt(ed.getLang('xhtmlxtras.attr_delta_width', 0)),\n\t\t\t\t\theight : 370 + parseInt(ed.getLang('xhtmlxtras.attr_delta_height', 0)),\n\t\t\t\t\tinline : 1\n\t\t\t\t}, {\n\t\t\t\t\tplugin_url : url\n\t\t\t\t});\n\t\t\t});\n\n\t\t\t// Register buttons\n\t\t\ted.addButton('cite', {title : 'xhtmlxtras.cite_desc', cmd : 'mceCite'});\n\t\t\ted.addButton('acronym', {title : 'xhtmlxtras.acronym_desc', cmd : 'mceAcronym'});\n\t\t\ted.addButton('abbr', {title : 'xhtmlxtras.abbr_desc', cmd : 'mceAbbr'});\n\t\t\ted.addButton('del', {title : 'xhtmlxtras.del_desc', cmd : 'mceDel'});\n\t\t\ted.addButton('ins', {title : 'xhtmlxtras.ins_desc', cmd : 'mceIns'});\n\t\t\ted.addButton('attribs', {title : 'xhtmlxtras.attribs_desc', cmd : 'mceAttributes'});\n\n\t\t\ted.onNodeChange.add(function(ed, cm, n, co) {\n\t\t\t\tn = ed.dom.getParent(n, 'CITE,ACRONYM,ABBR,DEL,INS');\n\n\t\t\t\tcm.setDisabled('cite', co);\n\t\t\t\tcm.setDisabled('acronym', co);\n\t\t\t\tcm.setDisabled('abbr', co);\n\t\t\t\tcm.setDisabled('del', co);\n\t\t\t\tcm.setDisabled('ins', co);\n\t\t\t\tcm.setDisabled('attribs', n && n.nodeName == 'BODY');\n\t\t\t\tcm.setActive('cite', 0);\n\t\t\t\tcm.setActive('acronym', 0);\n\t\t\t\tcm.setActive('abbr', 0);\n\t\t\t\tcm.setActive('del', 0);\n\t\t\t\tcm.setActive('ins', 0);\n\n\t\t\t\t// Activate all\n\t\t\t\tif (n) {\n\t\t\t\t\tdo {\n\t\t\t\t\t\tcm.setDisabled(n.nodeName.toLowerCase(), 0);\n\t\t\t\t\t\tcm.setActive(n.nodeName.toLowerCase(), 1);\n\t\t\t\t\t} while (n = n.parentNode);\n\t\t\t\t}\n\t\t\t});\n\n\t\t\ted.onPreInit.add(function() {\n\t\t\t\t// Fixed IE issue where it can't handle these elements correctly\n\t\t\t\ted.dom.create('abbr');\n\t\t\t});\n\t\t},\n\n\t\tgetInfo : function() {\n\t\t\treturn {\n\t\t\t\tlongname : 'XHTML Xtras Plugin',\n\t\t\t\tauthor : 'Moxiecode Systems AB',\n\t\t\t\tauthorurl : 'http://tinymce.moxiecode.com',\n\t\t\t\tinfourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/xhtmlxtras',\n\t\t\t\tversion : tinymce.majorVersion + \".\" + tinymce.minorVersion\n\t\t\t};\n\t\t}\n\t});\n\n\t// Register plugin\n\ttinymce.PluginManager.add('xhtmlxtras', tinymce.plugins.XHTMLXtrasPlugin);\n})();","Potato_Zendesk/js/tiny_mce/plugins/xhtmlxtras/js/abbr.js":"/**\n * abbr.js\n *\n * Copyright 2009, Moxiecode Systems AB\n * Released under LGPL License.\n *\n * 
2License: http://tinymce.moxiecode.com/license\n * Contributing: http://tinymce.moxiecode.com/contributing\n */\n\nfunction init() {\n\tSXE.initElementDialog('abbr');\n\tif (SXE.currentAction == \"update\") {\n\t\tSXE.showRemoveButton();\n\t}\n}\n\nfunction insertAbbr() {\n\tSXE.insertElement('abbr');\n\ttinyMCEPopup.close();\n}\n\nfunction removeAbbr() {\n\tSXE.removeElement('abbr');\n\ttinyMCEPopup.close();\n}\n\ntinyMCEPopup.onInit.add(init);\n","Potato_Zendesk/js/tiny_mce/plugins/xhtmlxtras/js/acronym.js":"/**\n * acronym.js\n *\n * Copyright 2009, Moxiecode Systems AB\n * Released under LGPL License.\n *\n * License: http://tinymce.moxiecode.com/license\n * Contributing: http://tinymce.moxiecode.com/contributing\n */\n\nfunction init() {\n\tSXE.initElementDialog('acronym');\n\tif (SXE.currentAction == \"update\") {\n\t\tSXE.showRemoveButton();\n\t}\n}\n\nfunction insertAcronym() {\n\tSXE.insertElement('acronym');\n\ttinyMCEPopup.close();\n}\n\nfunction removeAcronym() {\n\tSXE.removeElement('acronym');\n\ttinyMCEPopup.close();\n}\n\ntinyMCEPopup.onInit.add(init);\n","Potato_Zendesk/js/tiny_mce/plugins/xhtmlxtras/js/attributes.js":"/**\n * attributes.js\n *\n * Copyright 2009, Moxiecode Systems AB\n * Released under LGPL License.\n *\n * License: http://tinymce.moxiecode.com/license\n * Contributing: http://tinymce.moxiecode.com/contributing\n */\n\nfunction init() {\n\ttinyMCEPopup.resizeToInnerSize();\n\tvar inst = tinyMCEPopup.editor;\n\tvar dom = inst.dom;\n\tvar elm = inst.selection.getNode();\n\tvar f = document.forms[0];\n\tvar onclick = dom.getAttrib(elm, 'onclick');\n\n\tsetFormValue('title', dom.getAttrib(elm, 'title'));\n\tsetFormValue('id', dom.getAttrib(elm, 'id'));\n\tsetFormValue('style', dom.getAttrib(elm, \"style\"));\n\tsetFormValue('dir', dom.getAttrib(elm, 'dir'));\n\tsetFormValue('lang', dom.getAttrib(elm, 'lang'));\n\tsetFormValue('tabindex', dom.getAttrib(elm, 'tabindex', typeof(elm.tabindex) != \"undefined\" ? elm.tabindex : \"\"));\n\tsetFormValue('accesskey', dom.getAttrib(elm, 'accesskey', typeof(elm.accesskey) != \"undefined\" ? elm.accesskey : \"\"));\n\tsetFormValue('onfocus', dom.getAttrib(elm, 'onfocus'));\n\tsetFormValue('onblur', dom.getAttrib(elm, 'onblur'));\n\tsetFormValue('onclick', onclick);\n\tsetFormValue('ondblclick', dom.getAttrib(elm, 'ondblclick'));\n\tsetFormValue('onmousedown', dom.getAttrib(elm, 'onmousedown'));\n\tsetFormValue('onmouseup', dom.getAttrib(elm, 'onmouseup'));\n\tsetFormValue('onmouseover', dom.getAttrib(elm, 'onmouseover'));\n\tsetFormValue('onmousemove', dom.getAttrib(elm, 'onmousemove'));\n\tsetFormValue('onmouseout', dom.getAttrib(elm, 'onmouseout'));\n\tsetFormValue('onkeypress', dom.getAttrib(elm, 'onkeypress'));\n\tsetFormValue('onkeydown', dom.getAttrib(elm, 'onkeydown'));\n\tsetFormValue('onkeyup', dom.getAttrib(elm, 'onkeyup'));\n\tclassName = dom.getAttrib(elm, 'class');\n\n\taddClassesToList('classlist', 'advlink_styles');\n\tselectByValue(f, 'classlist', className, true);\n\n\tTinyMCE_EditableSelects.init();\n}\n\nfunction setFormValue(name, value) {\n\tif(value && document.forms[0].elements[name]){\n\t\tdocument.forms[0].elements[name].value = value;\n\t}\n}\n\nfunction insertAction() {\n\tvar inst = tinyMCEPopup.editor;\n\tvar elm = inst.selection.getNode();\n\n\tsetAllAttribs(elm);\n\ttinyMCEPopup.execCommand(\"mceEndUndoLevel\");\n\ttinyMCEPopup.close();\n}\n\nfunction setAttrib(elm, attrib, value) {\n\tvar formObj = document.forms[0];\n\tvar valueElm = formObj.elements[attrib.toLowerCase()];\n\tvar inst = tinyMCEPopup.editor;\n\tvar dom = inst.dom;\n\n\tif (typeof(value) == \"undefined\" || value == null) {\n\t\tvalue = \"\";\n\n\t\tif (valueElm)\n\t\t\tvalue = valueElm.value;\n\t}\n\n\tdom.setAttrib(elm, attrib.toLowerCase(), value);\n}\n\nfunction setAllAttribs(elm) {\n\tvar f = document.forms[0];\n\n\tsetAttrib(elm, 'title');\n\tsetAttrib(elm, 'id');\n\tsetAttrib(elm, 'style');\n\tsetAttrib(elm, 'class', getSelectValue(f, 'classlist'));\n\tsetAttrib(elm, 'dir');\n\tsetAttrib(elm, 'lang');\n\tsetAttrib(elm, 'tabindex');\n\tsetAttrib(elm, 'accesskey');\n\tsetAttrib(elm, 'onfocus');\n\tsetAttrib(elm, 'onblur');\n\tsetAttrib(elm, 'onclick');\n\tsetAttrib(elm, 'ondblclick');\n\tsetAttrib(elm, 'onmousedown');\n\tsetAttrib(elm, 'onmouseup');\n\tsetAttrib(elm, 'onmouseover');\n\tsetAttrib(elm, 'onmousemove');\n\tsetAttrib(elm, 'onmouseout');\n\tsetAttrib(elm, 'onkeypress');\n\tsetAttrib(elm, 'onkeydown');\n\tsetAttrib(elm, 'onkeyup');\n\n\t// Refresh in old MSIE\n//\tif (tinyMCE.isMSIE5)\n//\t\telm.outerHTML = elm.outerHTML;\n}\n\nfunction insertAttribute() {\n\ttinyMCEPopup.close();\n}\n\ntinyMCEPopup.onInit.add(init);\ntinyMCEPopup.requireLangPack();\n","Potato_Zendesk/js/tiny_mce/plugins/xhtmlxtras/js/cite.js":"/**\n * cite.js\n *\n * Copyright 2009, Moxiecode Systems AB\n * Released under LGPL License.\n *\n * 
2License: http://tinymce.moxiecode.com/license\n * Contributing: http://tinymce.moxiecode.com/contributing\n */\n\nfunction init() {\n\tSXE.initElementDialog('cite');\n\tif (SXE.currentAction == \"update\") {\n\t\tSXE.showRemoveButton();\n\t}\n}\n\nfunction insertCite() {\n\tSXE.insertElement('cite');\n\ttinyMCEPopup.close();\n}\n\nfunction removeCite() {\n\tSXE.removeElement('cite');\n\ttinyMCEPopup.close();\n}\n\ntinyMCEPopup.onInit.add(init);\n","Potato_Zendesk/js/tiny_mce/plugins/xhtmlxtras/js/del.js":"/**\n * del.js\n *\n * Copyright 2009, Moxiecode Systems AB\n * Released under LGPL License.\n *\n * License: http://tinymce.moxiecode.com/license\n * Contributing: http://tinymce.moxiecode.com/contributing\n */\n\nfunction init() {\n\tSXE.initElementDialog('del');\n\tif (SXE.currentAction == \"update\") {\n\t\tsetFormValue('datetime', tinyMCEPopup.editor.dom.getAttrib(SXE.updateElement, 'datetime'));\n\t\tsetFormValue('cite', tinyMCEPopup.editor.dom.getAttrib(SXE.updateElement, 'cite'));\n\t\tSXE.showRemoveButton();\n\t}\n}\n\nfunction setElementAttribs(elm) {\n\tsetAllCommonAttribs(elm);\n\tsetAttrib(elm, 'datetime');\n\tsetAttrib(elm, 'cite');\n\telm.removeAttribute('data-mce-new');\n}\n\nfunction insertDel() {\n\tvar elm = tinyMCEPopup.editor.dom.getParent(SXE.focusElement, 'DEL');\n\n\tif (elm == null) {\n\t\tvar s = SXE.inst.selection.getContent();\n\t\tif(s.length > 0) {\n\t\t\tinsertInlineElement('del');\n\t\t\tvar elementArray = SXE.inst.dom.select('del[data-mce-new]');\n\t\t\tfor (var i=0; i<elementArray.length; i++) {\n\t\t\t\tvar elm = elementArray[i];\n\t\t\t\tsetElementAttribs(elm);\n\t\t\t}\n\t\t}\n\t} else {\n\t\tsetElementAttribs(elm);\n\t}\n\ttinyMCEPopup.editor.nodeChanged();\n\ttinyMCEPopup.execCommand('mceEndUndoLevel');\n\ttinyMCEPopup.close();\n}\n\nfunction removeDel() {\n\tSXE.removeElement('del');\n\ttinyMCEPopup.close();\n}\n\ntinyMCEPopup.onInit.add(init);\n","Potato_Zendesk/js/tiny_mce/plugins/xhtmlxtras/js/element_common.js":"/**\n * element_common.js\n *\n * Copyright 2009, Moxiecode Systems AB\n * Released under LGPL License.\n *\n * License: http://tinymce.moxiecode.com/license\n * Contributing: http://tinymce.moxiecode.com/contributing\n */\n\ntinyMCEPopup.requireLangPack();\n\nfunction initCommonAttributes(elm) {\n\tvar formObj = document.forms[0], dom = tinyMCEPopup.editor.dom;\n\n\t// Setup form data for common element attributes\n\tsetFormValue('title', dom.getAttrib(elm, 'title'));\n\tsetFormValue('id', dom.getAttrib(elm, 'id'));\n\tselectByValue(formObj, 'class', dom.getAttrib(elm, 'class'), true);\n\tsetFormValue('style', dom.getAttrib(elm, 'style'));\n\tselectByValue(formObj, 'dir', dom.getAttrib(elm, 'dir'));\n\tsetFormValue('lang', dom.getAttrib(elm, 'lang'));\n\tsetFormValue('onfocus', dom.getAttrib(elm, 'onfocus'));\n\tsetFormValue('onblur', dom.getAttrib(elm, 'onblur'));\n\tsetFormValue('onclick', dom.getAttrib(elm, 'onclick'));\n\tsetFormValue('ondblclick', dom.getAttrib(elm, 'ondblclick'));\n\tsetFormValue('onmousedown', dom.getAttrib(elm, 'onmousedown'));\n\tsetFormValue('onmouseup', dom.getAttrib(elm, 'onmouseup'));\n\tsetFormValue('onmouseover', dom.getAttrib(elm, 'onmouseover'));\n\tsetFormValue('onmousemove', dom.getAttrib(elm, 'onmousemove'));\n\tsetFormValue('onmouseout', dom.getAttrib(elm, 'onmouseout'));\n\tsetFormValue('onkeypress', dom.getAttrib(elm, 'onkeypress'));\n\tsetFormValue('onkeydown', dom.getAttrib(elm, 'onkeydown'));\n\tsetFormValue('onkeyup', dom.getAttrib(elm, 'onkeyup'));\n}\n\nfunction setFormValue(name, value) {\n\tif(document.forms[0].elements[name]) document.forms[0].elements[name].value = value;\n}\n\nfunction insertDateTime(id) {\n\tdocument.getElementById(id).value = getDateTime(new Date(), \"%Y-%m-%dT%H:%M:%S\");\n}\n\nfunction getDateTime(d, fmt) {\n\tfmt = fmt.replace(\"%D\", \"%m/%d/%y\");\n\tfmt = fmt.replace(\"%r\", \"%I:%M:%S %p\");\n\tfmt = fmt.replace(\"%Y\", \"\" + d.getFullYear());\n\tfmt = fmt.replace(\"%y\", \"\" + d.getYear());\n\tfmt = fmt.replace(\"%m\", addZeros(d.getMonth()+1, 2));\n\tfmt = fmt.replace(\"%d\", addZeros(d.getDate(), 2));\n\tfmt = fmt.replace(\"%H\", \"\" + addZeros(d.getHours(), 2));\n\tfmt = fmt.replace(\"%M\", \"\" + addZeros(d.getMinutes(), 2));\n\tfmt = fmt.replace(\"%S\", \"\" + addZeros(d.getSeconds(), 2));\n\tfmt = fmt.replace(\"%I\", \"\" + ((d.getHours() + 11) % 12 + 1));\n\tfmt = fmt.replace(\"%p\", \"\" + (d.getHours() < 12 ? \"AM\" : \"PM\"));\n\tfmt = fmt.replace(\"%%\", \"%\");\n\n\treturn fmt;\n}\n\nfunction addZeros(value, len) {\n\tvar i;\n\n\tvalue = \"\" + value;\n\n\tif (value.length < len) {\n\t\tfor (i=0; i<(len-value.length); i++)\n\t\t\tvalue = \"0\" + value;\n\t}\n\n\treturn value;\n}\n\nfunction selectByValue(form_obj, field_name, value, add_custom, ignore_case) {\n\tif (!form_obj || !form_obj.elements[field_name])\n\t\treturn;\n\n\tvar sel = form_obj.elements[field_name];\n\n\tvar found = false;\n\tfor (var i=0; i<sel.options.length;
2 i++) {\n\t\tvar option = sel.options[i];\n\n\t\tif (option.value == value || (ignore_case && option.value.toLowerCase() == value.toLowerCase())) {\n\t\t\toption.selected = true;\n\t\t\tfound = true;\n\t\t} else\n\t\t\toption.selected = false;\n\t}\n\n\tif (!found && add_custom && value != '') {\n\t\tvar option = new Option('Value: ' + value, value);\n\t\toption.selected = true;\n\t\tsel.options[sel.options.length] = option;\n\t}\n\n\treturn found;\n}\n\nfunction setAttrib(elm, attrib, value) {\n\tvar formObj = document.forms[0];\n\tvar valueElm = formObj.elements[attrib.toLowerCase()];\n\ttinyMCEPopup.editor.dom.setAttrib(elm, attrib, value || valueElm.value);\n}\n\nfunction setAllCommonAttribs(elm) {\n\tsetAttrib(elm, 'title');\n\tsetAttrib(elm, 'id');\n\tsetAttrib(elm, 'class');\n\tsetAttrib(elm, 'style');\n\tsetAttrib(elm, 'dir');\n\tsetAttrib(elm, 'lang');\n\t/*setAttrib(elm, 'onfocus');\n\tsetAttrib(elm, 'onblur');\n\tsetAttrib(elm, 'onclick');\n\tsetAttrib(elm, 'ondblclick');\n\tsetAttrib(elm, 'onmousedown');\n\tsetAttrib(elm, 'onmouseup');\n\tsetAttrib(elm, 'onmouseover');\n\tsetAttrib(elm, 'onmousemove');\n\tsetAttrib(elm, 'onmouseout');\n\tsetAttrib(elm, 'onkeypress');\n\tsetAttrib(elm, 'onkeydown');\n\tsetAttrib(elm, 'onkeyup');*/\n}\n\nSXE = {\n\tcurrentAction : \"insert\",\n\tinst : tinyMCEPopup.editor,\n\tupdateElement : null\n}\n\nSXE.focusElement = SXE.inst.selection.getNode();\n\nSXE.initElementDialog = function(element_name) {\n\taddClassesToList('class', 'xhtmlxtras_styles');\n\tTinyMCE_EditableSelects.init();\n\n\telement_name = element_name.toLowerCase();\n\tvar elm = SXE.inst.dom.getParent(SXE.focusElement, element_name.toUpperCase());\n\tif (elm != null && elm.nodeName.toUpperCase() == element_name.toUpperCase()) {\n\t\tSXE.currentAction = \"update\";\n\t}\n\n\tif (SXE.currentAction == \"update\") {\n\t\tinitCommonAttributes(elm);\n\t\tSXE.updateElement = elm;\n\t}\n\n\tdocument.forms[0].insert.value = tinyMCEPopup.getLang(SXE.currentAction, 'Insert', true); \n}\n\nSXE.insertElement = function(element_name) {\n\tvar elm = SXE.inst.dom.getParent(SXE.focusElement, element_name.toUpperCase()), h, tagName;\n\n\tif (elm == null) {\n\t\tvar s = SXE.inst.selection.getContent();\n\t\tif(s.length > 0) {\n\t\t\ttagName = element_name;\n\n\t\t\tinsertInlineElement(element_name);\n\t\t\tvar elementArray = tinymce.grep(SXE.inst.dom.select(element_name));\n\t\t\tfor (var i=0; i<elementArray.length; i++) {\n\t\t\t\tvar elm = elementArray[i];\n\n\t\t\t\tif (SXE.inst.dom.getAttrib(elm, 'data-mce-new')) {\n\t\t\t\t\telm.id = '';\n\t\t\t\t\telm.setAttribute('id', '');\n\t\t\t\t\telm.removeAttribute('id');\n\t\t\t\t\telm.removeAttribute('data-mce-new');\n\n\t\t\t\t\tsetAllCommonAttribs(elm);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t} else {\n\t\tsetAllCommonAttribs(elm);\n\t}\n\tSXE.inst.nodeChanged();\n\ttinyMCEPopup.execCommand('mceEndUndoLevel');\n}\n\nSXE.removeElement = function(element_name){\n\telement_name = element_name.toLowerCase();\n\telm = SXE.inst.dom.getParent(SXE.focusElement, element_name.toUpperCase());\n\tif(elm && elm.nodeName.toUpperCase() == element_name.toUpperCase()){\n\t\ttinyMCE.execCommand('mceRemoveNode', false, elm);\n\t\tSXE.inst.nodeChanged();\n\t\ttinyMCEPopup.execCommand('mceEndUndoLevel');\n\t}\n}\n\nSXE.showRemoveButton = function() {\n\t\tdocument.getElementById(\"remove\").style.display = '';\n}\n\nSXE.containsClass = function(elm,cl) {\n\treturn (elm.className.indexOf(cl) > -1) ? true : false;\n}\n\nSXE.removeClass = function(elm,cl) {\n\tif(elm.className == null || elm.className == \"\" || !SXE.containsClass(elm,cl)) {\n\t\treturn true;\n\t}\n\tvar classNames = elm.className.split(\" \");\n\tvar newClassNames = \"\";\n\tfor (var x = 0, cnl = classNames.length; x < cnl; x++) {\n\t\tif (classNames[x] != cl) {\n\t\t\tnewClassNames += (classNames[x] + \" \");\n\t\t}\n\t}\n\telm.className = newClassNames.substring(0,newClassNames.length-1); //removes extra space at the end\n}\n\nSXE.addClass = function(elm,cl) {\n\tif(!SXE.containsClass(elm,cl)) elm.className ? elm.className += \" \" + cl : elm.className = cl;\n\treturn true;\n}\n\nfunction insertInlineElement(en) {\n\tvar ed = tinyMCEPopup.editor, dom = ed.dom;\n\n\ted.getDoc().execCommand('FontName', false, 'mceinline');\n\ttinymce.each(dom.select('span,font'), function(n) {\n\t\tif (n.style.fontFamily == 'mceinline' || n.face == 'mceinline')\n\t\t\tdom.replace(dom.create(en, {'data-mce-new' : 1}), n, 1);\n\t});\n}\n","Potato_Zendesk/js/tiny_mce/plugins/xhtmlxtras/js/ins.js":"/**\n * ins.js\n *\n * Copyright 2009, Moxiecode Systems AB\n * Released under LGPL License.\n *\n * 
2License: http://tinymce.moxiecode.com/license\n * Contributing: http://tinymce.moxiecode.com/contributing\n */\n\nfunction init() {\n\tSXE.initElementDialog('ins');\n\tif (SXE.currentAction == \"update\") {\n\t\tsetFormValue('datetime', tinyMCEPopup.editor.dom.getAttrib(SXE.updateElement, 'datetime'));\n\t\tsetFormValue('cite', tinyMCEPopup.editor.dom.getAttrib(SXE.updateElement, 'cite'));\n\t\tSXE.showRemoveButton();\n\t}\n}\n\nfunction setElementAttribs(elm) {\n\tsetAllCommonAttribs(elm);\n\tsetAttrib(elm, 'datetime');\n\tsetAttrib(elm, 'cite');\n\telm.removeAttribute('data-mce-new');\n}\n\nfunction insertIns() {\n\tvar elm = tinyMCEPopup.editor.dom.getParent(SXE.focusElement, 'INS');\n\n\tif (elm == null) {\n\t\tvar s = SXE.inst.selection.getContent();\n\t\tif(s.length > 0) {\n\t\t\tinsertInlineElement('ins');\n\t\t\tvar elementArray = SXE.inst.dom.select('ins[data-mce-new]');\n\t\t\tfor (var i=0; i<elementArray.length; i++) {\n\t\t\t\tvar elm = elementArray[i];\n\t\t\t\tsetElementAttribs(elm);\n\t\t\t}\n\t\t}\n\t} else {\n\t\tsetElementAttribs(elm);\n\t}\n\ttinyMCEPopup.editor.nodeChanged();\n\ttinyMCEPopup.execCommand('mceEndUndoLevel');\n\ttinyMCEPopup.close();\n}\n\nfunction removeIns() {\n\tSXE.removeElement('ins');\n\ttinyMCEPopup.close();\n}\n\ntinyMCEPopup.onInit.add(init);\n","Potato_Zendesk/js/tiny_mce/plugins/xhtmlxtras/langs/en_dlg.js":"tinyMCE.addI18n('en.xhtmlxtras_dlg',{\"attribs_title\":\"Insert/Edit Attributes\",\"option_rtl\":\"Right to Left\",\"option_ltr\":\"Left to Right\",\"
2insert_date\":\"Insert Current Date/Time\",remove:\"Remove\",\"title_cite_element\":\"Citation Element\",\"title_abbr_element\":\"Abbreviation Element\",\"title_acronym_element\":\"Acronym Element\",\"title_del_element\":\"Deletion Element\",\"title_ins_element\":\"Insertion Element\",\"fieldset_events_tab\":\"Element Events\",\"fieldset_attrib_tab\":\"Element Attributes\",\"fieldset_general_tab\":\"General Settings\",\"events_tab\":\"Events\",\"attrib_tab\":\"Attributes\",\"general_tab\":\"General\",\"attribute_attrib_tab\":\"Attributes\",\"attribute_events_tab\":\"Events\",\"attribute_label_accesskey\":\"AccessKey\",\"attribute_label_tabindex\":\"TabIndex\",\"attribute_label_langcode\":\"Language\",\"attribute_option_rtl\":\"Right to Left\",\"attribute_option_ltr\":\"Left to Right\",\"attribute_label_langdir\":\"Text Direction\",\"attribute_label_datetime\":\"Date/Time\",\"attribute_label_cite\":\"Cite\",\"attribute_label_style\":\"Style\",\"attribute_label_class\":\"Class\",\"attribute_label_id\":\"ID\",\"attribute_label_title\":\"Title\"});","Potato_Zendesk/js/tiny_mce/themes/advanced/editor_template.js":"(function(e){var d=e.DOM,b=e.dom.Event,h=e.extend,f=e.each,a=e.util.Cookie,g,c=e.explode;e.ThemeManager.requireLangPack(\"advanced\");e.create(\"tinymce.themes.AdvancedTheme\",{sizes:[8,10,12,14,18,24,36],controls:{bold:[\"bold_desc\",\"Bold\"],italic:[\"italic_desc\",\"Italic\"],underline:[\"underline_desc\",\"Underline\"],strikethrough:[\"striketrough_desc\",\"Strikethrough\"],justifyleft:[\"justifyleft_desc\",\"JustifyLeft\"],justifycenter:[\"justifycenter_desc\",\"JustifyCenter\"],justifyright:[\"justifyright_desc\",\"JustifyRight\"],justifyfull:[\"justifyfull_desc\",\"JustifyFull\"],bullist:[\"bullist_desc\",\"InsertUnorderedList\"],numlist:[\"numlist_desc\",\"InsertOrderedList\"],outdent:[\"outdent_desc\",\"Outdent\"],indent:[\"indent_desc\",\"Indent\"],cut:[\"cut_desc\",\"Cut\"],copy:[\"copy_desc\",\"Copy\"],paste:[\"paste_desc\",\"Paste\"],undo:[\"undo_desc\",\"Undo\"],redo:[\"redo_desc\",\"Redo\"],link:[\"link_desc\",\"mceLink\"],unlink:[\"unlink_desc\",\"unlink\"],image:[\"image_desc\",\"mceImage\"],cleanup:[\"cleanup_desc\",\"mceCleanup\"],help:[\"help_desc\",\"mceHelp\"],code:[\"code_desc\",\"mceCodeEditor\"],hr:[\"hr_desc\",\"InsertHorizontalRule\"],removeformat:[\"removeformat_desc\",\"RemoveFormat\"],sub:[\"sub_desc\",\"subscript\"],sup:[\"sup_desc\",\"superscript\"],forecolor:[\"forecolor_desc\",\"ForeColor\"],forecolorpicker:[\"forecolor_desc\",\"mceForeColor\"],backcolor:[\"backcolor_desc\",\"HiliteColor\"],backcolorpicker:[\"backcolor_desc\",\"mceBackColor\"],charmap:[\"charmap_desc\",\"mceCharMap\"],visualaid:[\"visualaid_desc\",\"mceToggleVisualAid\"],anchor:[\"anchor_desc\",\"mceInsertAnchor\"],newdocument:[\"newdocument_desc\",\"mceNewDocument\"],blockquote:[\"blockquote_desc\",\"mceBlockQuote\"]},stateControls:[\"bold\",\"italic\",\"underline\",\"strikethrough\",\"bullist\",\"numlist\",\"justifyleft\",\"justifycenter\",\"justifyright\",\"justifyfull\",\"sub\",\"sup\",\"blockquote\"],init:function(j,k){var l=this,m,i,n;l.editor=j;l.url=k;l.onResolveName=new e.util.Dispatcher(this);j.forcedHighContrastMode=j.settings.detect_highcontrast&&l._isHighContrast();j.settings.skin=j.forcedHighContrastMode?\"highcontrast\":j.settings.skin;l.settings=m=h({theme_advanced_path:true,theme_advanced_toolbar_location:\"bottom\",theme_advanced_buttons1:\"bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect\",theme_advanced_buttons2:\"bullist,numlist,|,outdent,indent,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code\",theme_advanced_buttons3:\"hr,removeformat,visualaid,|,sub,sup,|,charmap\",theme_advanced_blockformats:\"p,address,pre,h1,h2,h3,h4,h5,h6\",theme_advanced_toolbar_align:\"center\",theme_advanced_fonts:\"Andale Mono=andale mono,times;Arial=arial,helvetica,sans-serif;Arial Black=arial black,avant garde;Book Antiqua=book antiqua,palatino;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier;Georgia=georgia,palatino;Helvetica=helvetica;Impact=impact,chicago;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco;Times New Roman=times new roman,times;Trebuchet MS=trebuchet ms,geneva;Verdana=verdana,geneva;Webdings=webdings;Wingdings=wingdings,zapf dingbats\",theme_advanced_more_colors:1,theme_advanced_row_height:23,theme_advanced_resize_horizontal:1,theme_advanced_resizing_use_cookie
2:1,theme_advanced_font_sizes:\"1,2,3,4,5,6,7\",theme_advanced_font_selector:\"span\",theme_advanced_show_current_color:0,readonly:j.settings.readonly},j.settings);if(!m.font_size_style_values){m.font_size_style_values=\"8pt,10pt,12pt,14pt,18pt,24pt,36pt\"}if(e.is(m.theme_advanced_font_sizes,\"string\")){m.font_size_style_values=e.explode(m.font_size_style_values);m.font_size_classes=e.explode(m.font_size_classes||\"\");n={};j.settings.theme_advanced_font_sizes=m.theme_advanced_font_sizes;f(j.getParam(\"theme_advanced_font_sizes\",\"\",\"hash\"),function(q,p){var o;if(p==q&&q>=1&&q<=7){p=q+\" (\"+l.sizes[q-1]+\"pt)\";o=m.font_size_classes[q-1];q=m.font_size_style_values[q-1]||(l.sizes[q-1]+\"pt\")}if(/^\\s*\\./.test(q)){o=q.replace(/\\./g,\"\")}n[p]=o?{\"class\":o}:{fontSize:q}});m.theme_advanced_font_sizes=n}if((i=m.theme_advanced_path_location)&&i!=\"none\"){m.theme_advanced_statusbar_location=m.theme_advanced_path_location}if(m.theme_advanced_statusbar_location==\"none\"){m.theme_advanced_statusbar_location=0}if(j.settings.content_css!==false){j.contentCSS.push(j.baseURI.toAbsolute(k+\"/skins/\"+j.settings.skin+\"/content.css\"))}j.onInit.add(function(){if(!j.settings.readonly){j.onNodeChange.add(l._nodeChanged,l);j.onKeyUp.add(l._updateUndoStatus,l);j.onMouseUp.add(l._updateUndoStatus,l);j.dom.bind(j.dom.getRoot(),\"dragend\",function(){l._updateUndoStatus(j)})}});j.onSetProgressState.add(function(q,o,r){var s,t=q.id,p;if(o){l.progressTimer=setTimeout(function(){s=q.getContainer();s=s.insertBefore(d.create(\"DIV\",{style:\"position:relative\"}),s.firstChild);p=d.get(q.id+\"_tbl\");d.add(s,\"div\",{id:t+\"_blocker\",\"class\":\"mceBlocker\",style:{width:p.clientWidth+2,height:p.clientHeight+2}});d.add(s,\"div\",{id:t+\"_progress\",\"class\":\"mceProgress\",style:{left:p.clientWidth/2,top:p.clientHeight/2}})},r||0)}else{d.remove(t+\"_blocker\");d.remove(t+\"_progress\");clearTimeout(l.progressTimer)}});d.loadCSS(m.editor_css?j.documentBaseURI.toAbsolute(m.editor_css):k+\"/skins/\"+j.settings.skin+\"/ui.css\");if(m.skin_variant){d.loadCSS(k+\"/skins/\"+j.settings.skin+\"/ui_\"+m.skin_variant+\".css\")}},_isHighContrast:function(){var i,j=d.add(d.getRoot(),\"div\",{style:\"background-color: rgb(171,239,86);\"});i=(d.getStyle(j,\"background-color\",true)+\"\").toLowerCase().replace(/ /g,\"\");d.remove(j);return i!=\"rgb(171,239,86)\"&&i!=\"#abef56\"},createControl:function(l,i){var j,k;if(k=i.createControl(l)){return k}switch(l){case\"styleselect\":return this._createStyleSelect();case\"formatselect\":return this._createBlockFormats();case\"fontselect\":return this._createFontSelect();case\"fontsizeselect\":return this._createFontSizeSelect();case\"forecolor\":return this._createForeColorMenu();case\"backcolor\":return this._createBackColorMenu()}if((j=this.controls[l])){return i.createButton(l,{title:\"advanced.\"+j[0],cmd:j[1],ui:j[2],value:j[3]})}},execCommand:function(k,j,l){var i=this[\"_\"+k];if(i){i.call(this,j,l);return true}return false},_importClasses:function(k){var i=this.editor,j=i.controlManager.get(\"styleselect\");if(j.getLength()==0){f(i.dom.getClasses(),function(n,l){var m=\"style_\"+l;i.formatter.register(m,{inline:\"span\",attributes:{\"class\":n[\"class\"]},selector:\"*\"});j.add(n[\"class\"],m)})}},_createStyleSelect:function(m){var k=this,i=k.editor,j=i.controlManager,l;l=j.createListBox(\"styleselect\",{title:\"advanced.style_select\",onselect:function(o){var p,n=[];f(l.items,function(q){n.push(q.value)});i.focus();i.undoManager.add();p=i.formatter.matchAll(n);if(!o||p[0]==o){if(p[0]){i.formatter.remove(p[0])}}else{i.formatter.apply(o)}i.undoManager.add();i.nodeChanged();return false}});i.onInit.add(function(){var o=0,n=i.getParam(\"style_formats\");if(n){f(n,function(p){var q,r=0;f(p,function(){r++});if(r>1){q=p.name=p.name||\"style_\"+(o++);i.formatter.register(q,p);l.add(p.title,q)}else{l.add(p.title)}})}else{f(i.getParam(\"theme_advanced_styles\",\"\",\"hash\"),function(r,q){var p;if(r){p=\"style_\"+(o++);i.formatter.register(p,{inline:\"span\",classes:r,selector:\"*\"});l.add(k.editor.translate(q),p)}})}});if(l.getLength()==0){l.onPostRender.add(function(o,p){if(!l.NativeListBox){b.add(p.id+\"_text\",\"focus\",k._importClasses,k);b.add(p.id+\"_text\",\"mousedown\",k._importClasses,k);b.add(p.id+\"_open\",\"focus\",k._importClasses,k);b.add(p.id+\"_open\",\"mousedown\",k._importClasses,k)}else{b.add(p.id,\"focus\",k._importClasses,k)}})}return l},_createFontSelect:function(){var k,j=this,i=j.editor;k=i.controlManager.createListBox(\"fontselect\",{title:\"advanced.fontdefault\",onselect:function(l){var m=k.items[k.selectedIndex];if(!l&&m){i.execCommand(\"FontName\",false,m.value);return}i.execCommand(\"FontName\",false,l);k.select(function(n){return l==n}
2);if(m&&m.value==l){k.select(null)}return false}});if(k){f(i.getParam(\"theme_advanced_fonts\",j.settings.theme_advanced_fonts,\"hash\"),function(m,l){k.add(i.translate(l),m,{style:m.indexOf(\"dings\")==-1?\"font-family:\"+m:\"\"})})}return k},_createFontSizeSelect:function(){var m=this,k=m.editor,n,l=0,j=[];n=k.controlManager.createListBox(\"fontsizeselect\",{title:\"advanced.font_size\",onselect:function(i){var o=n.items[n.selectedIndex];if(!i&&o){o=o.value;if(o[\"class\"]){k.formatter.toggle(\"fontsize_class\",{value:o[\"class\"]});k.undoManager.add();k.nodeChanged()}else{k.execCommand(\"FontSize\",false,o.fontSize)}return}if(i[\"class\"]){k.focus();k.undoManager.add();k.formatter.toggle(\"fontsize_class\",{value:i[\"class\"]});k.undoManager.add();k.nodeChanged()}else{k.execCommand(\"FontSize\",false,i.fontSize)}n.select(function(p){return i==p});if(o&&(o.value.fontSize==i.fontSize||o.value[\"class\"]==i[\"class\"])){n.select(null)}return false}});if(n){f(m.settings.theme_advanced_font_sizes,function(o,i){var p=o.fontSize;if(p>=1&&p<=7){p=m.sizes[parseInt(p)-1]+\"pt\"}n.add(i,o,{style:\"font-size:\"+p,\"class\":\"mceFontSize\"+(l++)+(\" \"+(o[\"class\"]||\"\"))})})}return n},_createBlockFormats:function(){var k,i={p:\"advanced.paragraph\",address:\"advanced.address\",pre:\"advanced.pre\",h1:\"advanced.h1\",h2:\"advanced.h2\",h3:\"advanced.h3\",h4:\"advanced.h4\",h5:\"advanced.h5\",h6:\"advanced.h6\",div:\"advanced.div\",blockquote:\"advanced.blockquote\",code:\"advanced.code\",dt:\"advanced.dt\",dd:\"advanced.dd\",samp:\"advanced.samp\"},j=this;k=j.editor.controlManager.createListBox(\"formatselect\",{title:\"advanced.block\",onselect:function(l){j.editor.execCommand(\"FormatBlock\",false,l);return false}});if(k){f(j.editor.getParam(\"theme_advanced_blockformats\",j.settings.theme_advanced_blockformats,\"hash\"),function(m,l){k.add(j.editor.translate(l!=m?l:i[m]),m,{\"class\":\"mce_formatPreview mce_\"+m})})}return k},_createForeColorMenu:function(){var m,j=this,k=j.settings,l={},i;if(k.theme_advanced_more_colors){l.more_colors_func=function(){j._mceColorPicker(0,{color:m.value,func:function(n){m.setColor(n)}})}}if(i=k.theme_advanced_text_colors){l.colors=i}if(k.theme_advanced_default_foreground_color){l.default_color=k.theme_advanced_default_foreground_color}l.title=\"advanced.forecolor_desc\";l.cmd=\"ForeColor\";l.scope=this;m=j.editor.controlManager.createColorSplitButton(\"forecolor\",l);return m},_createBackColorMenu:function(){var m,j=this,k=j.settings,l={},i;if(k.theme_advanced_more_colors){l.more_colors_func=function(){j._mceColorPicker(0,{color:m.value,func:function(n){m.setColor(n)}})}}if(i=k.theme_advanced_background_colors){l.colors=i}if(k.theme_advanced_default_background_color){l.default_color=k.theme_advanced_default_background_color}l.title=\"advanced.backcolor_desc\";l.cmd=\"HiliteColor\";l.scope=this;m=j.editor.controlManager.createColorSplitButton(\"backcolor\",l);return m},renderUI:function(k){var m,l,q,v=this,r=v.editor,w=v.settings,u,j,i;if(r.settings){r.settings.aria_label=w.aria_label+r.getLang(\"advanced.help_shortcut\")}m=j=d.create(\"span\",{role:\"application\",\"aria-labelledby\":r.id+\"_voice\",id:r.id+\"_parent\",\"class\":\"mceEditor \"+r.settings.skin+\"Skin\"+(w.skin_variant?\" \"+r.settings.skin+\"Skin\"+v._ufirst(w.skin_variant):\"\")});d.add(m,\"span\",{\"class\":\"mceVoiceLabel\",style:\"display:none;\",id:r.id+\"_voice\"},w.aria_label);if(!d.boxModel){m=d.add(m,\"div\",{\"class\":\"mceOldBoxModel\"})}m=u=d.add(m,\"table\",{role:\"presentation\",id:r.id+\"_tbl\",\"class\":\"mceLayout\",cellSpacing:0,cellPadding:0});m=q=d.add(m,\"tbody\");switch((w.theme_advanced_layout_manager||\"\").toLowerCase()){case\"rowlayout\":l=v._rowLayout(w,q,k);break;case\"customlayout\":l=r.execCallback(\"theme_advanced_custom_layout\",w,q,k,j);break;default:l=v._simpleLayout(w,q,k,j)}m=k.targetNode;i=u.rows;d.addClass(i[0],\"mceFirst\");d.addClass(i[i.length-1],\"mceLast\");f(d.select(\"tr\",q),function(o){d.addClass(o.firstChild,\"mceFirst\");d.addClass(o.childNodes[o.childNodes.length-1],\"mceLast\")});if(d.get(w.theme_advanced_toolbar_container)){d.get(w.theme_advanced_toolbar_container).appendChild(j)}else{d.insertAfter(j,m)}b.add(r.id+\"_path_row\",\"click\",function(n){n=n.target;if(n.nodeName==\"A\"){v._sel(n.className.replace(/^.*mcePath_([0-9]+).*$/,\"$1\"));return b.cancel(n)}});if(!r.getParam(\"accessibility_focus\")){b.add(d.add(j,\"a\",{href:\"#\"},\"<!-- IE -->\"),\"focus\",function(){tinyMCE.get(r.id).focus()})}if(w.theme_advanced_toolbar_location==\"external\"){k.deltaHeight=0}v.deltaHeight=k.deltaHeight;
2k.targetNode=null;r.onKeyDown.add(function(p,n){var s=121,o=122;if(n.altKey){if(n.keyCode===s){if(e.isWebKit){window.focus()}v.toolbarGroup.focus();return b.cancel(n)}else{if(n.keyCode===o){d.get(p.id+\"_path_row\").focus();return b.cancel(n)}}}});r.addShortcut(\"alt+0\",\"\",\"mceShortcuts\",v);return{iframeContainer:l,editorContainer:r.id+\"_parent\",sizeContainer:u,deltaHeight:k.deltaHeight}},getInfo:function(){return{longname:\"Advanced theme\",author:\"Moxiecode Systems AB\",authorurl:\"http://tinymce.moxiecode.com\",version:e.majorVersion+\".\"+e.minorVersion}},resizeBy:function(i,j){var k=d.get(this.editor.id+\"_ifr\");this.resizeTo(k.clientWidth+i,k.clientHeight+j)},resizeTo:function(i,m,k){var j=this.editor,l=this.settings,n=d.get(j.id+\"_tbl\"),o=d.get(j.id+\"_ifr\");i=Math.max(l.theme_advanced_resizing_min_width||100,i);m=Math.max(l.theme_advanced_resizing_min_height||100,m);i=Math.min(l.theme_advanced_resizing_max_width||65535,i);m=Math.min(l.theme_advanced_resizing_max_height||65535,m);d.setStyle(n,\"height\",\"\");d.setStyle(o,\"height\",m);if(l.theme_advanced_resize_horizontal){d.setStyle(n,\"width\",\"\");d.setStyle(o,\"width\",i);if(i<n.clientWidth){i=n.clientWidth;d.setStyle(o,\"width\",n.clientWidth)}}if(k&&l.theme_advanced_resizing_use_cookie){a.setHash(\"TinyMCE_\"+j.id+\"_size\",{cw:i,ch:m})}},destroy:function(){var i=this.editor.id;b.clear(i+\"_resize\");b.clear(i+\"_path_row\");b.clear(i+\"_external_close\")},_simpleLayout:function(y,r,k,i){var x=this,u=x.editor,v=y.theme_advanced_toolbar_location,m=y.theme_advanced_statusbar_location,l,j,q,w;if(y.readonly){l=d.add(r,\"tr\");l=j=d.add(l,\"td\",{\"class\":\"mceIframeContainer\"});return j}if(v==\"top\"){x._addToolbars(r,k)}if(v==\"external\"){l=w=d.create(\"div\",{style:\"position:relative\"});l=d.add(l,\"div\",{id:u.id+\"_external\",\"class\":\"mceExternalToolbar\"});d.add(l,\"a\",{id:u.id+\"_external_close\",href:\"javascript:;\",\"class\":\"mceExternalClose\"});l=d.add(l,\"table\",{id:u.id+\"_tblext\",cellSpacing:0,cellPadding:0});q=d.add(l,\"tbody\");if(i.firstChild.className==\"mceOldBoxModel\"){i.firstChild.appendChild(w)}else{i.insertBefore(w,i.firstChild)}x._addToolbars(q,k);u.onMouseUp.add(function(){var o=d.get(u.id+\"_external\");d.show(o);d.hide(g);var n=b.add(u.id+\"_external_close\",\"click\",function(){d.hide(u.id+\"_external\");b.remove(u.id+\"_external_close\",\"click\",n)});d.show(o);d.setStyle(o,\"top\",0-d.getRect(u.id+\"_tblext\").h-1);d.hide(o);d.show(o);o.style.filter=\"\";g=u.id+\"_external\";o=null})}if(m==\"top\"){x._addStatusBar(r,k)}if(!y.theme_advanced_toolbar_container){l=d.add(r,\"tr\");l=j=d.add(l,\"td\",{\"class\":\"mceIframeContainer\"})}if(v==\"bottom\"){x._addToolbars(r,k)}if(m==\"bottom\"){x._addStatusBar(r,k)}return j},_rowLayout:function(w,m,k){var v=this,p=v.editor,u,x,i=p.controlManager,l,j,r,q;u=w.theme_advanced_containers_default_class||\"\";x=w.theme_advanced_containers_default_align||\"center\";f(c(w.theme_advanced_containers||\"\"),function(s,o){var n=w[\"theme_advanced_container_\"+s]||\"\";switch(s.toLowerCase()){case\"mceeditor\":l=d.add(m,\"tr\");l=j=d.add(l,\"td\",{\"class\":\"mceIframeContainer\"});break;case\"mceelementpath\":v._addStatusBar(m,k);break;default:q=(w[\"theme_advanced_container_\"+s+\"_align\"]||x).toLowerCase();q=\"mce\"+v._ufirst(q);l=d.add(d.add(m,\"tr\"),\"td\",{\"class\":\"mceToolbar \"+(w[\"theme_advanced_container_\"+s+\"_class\"]||u)+\" \"+q||x});r=i.createToolbar(\"toolbar\"+o);v._addControls(n,r);d.setHTML(l,r.renderHTML());k.deltaHeight-=w.theme_advanced_row_height}});return j},_addControls:function(j,i){var k=this,l=k.settings,m,n=k.editor.controlManager;if(l.theme_advanced_disable&&!k._disabled){m={};f(c(l.theme_advanced_disable),function(o){m[o]=1});k._disabled=m}else{m=k._disabled}f(c(j),function(p){var o;if(m&&m[p]){return}if(p==\"tablecontrols\"){f([\"table\",\"|\",\"row_props\",\"cell_props\",\"|\",\"row_before\",\"row_after\",\"delete_row\",\"|\",\"col_before\",\"col_after\",\"delete_col\",\"|\",\"split_cells\",\"merge_cells\"],function(q){q=k.createControl(q,n);if(q){i.add(q)}});return}o=k.createControl(p,n);if(o){i.add(o)}})},_addToolbars:function(x,k){var A=this,p,m,r=A.editor,B=A.settings,z,j=r.controlManager,u,l,q=[],y,w;w=j.createToolbarGroup(\"toolbargroup\",{name:r.getLang(\"advanced.toolbar\"),tab_focus_toolbar:r.getParam(\"theme_advanced_tab_focus_toolbar\")});A.toolbarGroup=w;y=B.theme_advanced_toolbar_align.toLowerCase();y=\"mce\"+A._ufirst(y);l=d.add(d.add(x,\"tr\",{role:\"presentation\"}),\"td\",{\"class\":\"mceToolbar \"+y,role:\"presentation\"});for(p=1;(z=B[\"theme_advanced_buttons\"+p]);p++){m=j.createToolbar(\"toolbar\"+p,{\"class\":\"mceToolbarRow\"+p});if(B[\"theme_advanced_buttons\"+p+\"_add\"]){z+=\",\"+B[\"theme_advanced_buttons\"+p+\"_add\"]}if(B[\"theme_advanced_buttons\"+p+\"_add_before\"]){z=B[\"theme_advanced_buttons\"+p+\"_add_before\"]+\",\"+z}
2A._addControls(z,m);w.add(m);k.deltaHeight-=B.theme_advanced_row_height}q.push(w.renderHTML());q.push(d.createHTML(\"a\",{href:\"#\",accesskey:\"z\",title:r.getLang(\"advanced.toolbar_focus\"),onfocus:\"tinyMCE.getInstanceById('\"+r.id+\"').focus();\"},\"<!-- IE -->\"));d.setHTML(l,q.join(\"\"))},_addStatusBar:function(m,j){var k,v=this,p=v.editor,w=v.settings,i,q,u,l;k=d.add(m,\"tr\");k=l=d.add(k,\"td\",{\"class\":\"mceStatusbar\"});k=d.add(k,\"div\",{id:p.id+\"_path_row\",role:\"group\",\"aria-labelledby\":p.id+\"_path_voice\"});if(w.theme_advanced_path){d.add(k,\"span\",{id:p.id+\"_path_voice\"},p.translate(\"advanced.path\"));d.add(k,\"span\",{},\": \")}else{d.add(k,\"span\",{},\"&#160;\")}if(w.theme_advanced_resizing){d.add(l,\"a\",{id:p.id+\"_resize\",href:\"javascript:;\",onclick:\"return false;\",\"class\":\"mceResize\",tabIndex:\"-1\"});if(w.theme_advanced_resizing_use_cookie){p.onPostRender.add(function(){var n=a.getHash(\"TinyMCE_\"+p.id+\"_size\"),r=d.get(p.id+\"_tbl\");if(!n){return}v.resizeTo(n.cw,n.ch)})}p.onPostRender.add(function(){b.add(p.id+\"_resize\",\"click\",function(n){n.preventDefault()});b.add(p.id+\"_resize\",\"mousedown\",function(D){var t,r,s,o,C,z,A,F,n,E,x;function y(G){G.preventDefault();n=A+(G.screenX-C);E=F+(G.screenY-z);v.resizeTo(n,E)}function B(G){b.remove(d.doc,\"mousemove\",t);b.remove(p.getDoc(),\"mousemove\",r);b.remove(d.doc,\"mouseup\",s);b.remove(p.getDoc(),\"mouseup\",o);n=A+(G.screenX-C);E=F+(G.screenY-z);v.resizeTo(n,E,true)}D.preventDefault();C=D.screenX;z=D.screenY;x=d.get(v.editor.id+\"_ifr\");A=n=x.clientWidth;F=E=x.clientHeight;t=b.add(d.doc,\"mousemove\",y);r=b.add(p.getDoc(),\"mousemove\",y);s=b.add(d.doc,\"mouseup\",B);o=b.add(p.getDoc(),\"mouseup\",B)})})}j.deltaHeight-=21;k=m=null},_updateUndoStatus:function(j){var i=j.controlManager,k=j.undoManager;i.setDisabled(\"undo\",!k.hasUndo()&&!k.typing);i.setDisabled(\"redo\",!k.hasRedo())},_nodeChanged:function(m,r,D,q,E){var y=this,C,F=0,x,G,z=y.settings,w,k,u,B,l,j,i;e.each(y.stateControls,function(n){r.setActive(n,m.queryCommandState(y.controls[n][1]))});function o(p){var s,n=E.parents,t=p;if(typeof(p)==\"string\"){t=function(v){return v.nodeName==p}}for(s=0;s<n.length;s++){if(t(n[s])){return n[s]}}}r.setActive(\"visualaid\",m.hasVisual);y._updateUndoStatus(m);r.setDisabled(\"outdent\",!m.queryCommandState(\"Outdent\"));C=o(\"A\");if(G=r.get(\"link\")){if(!C||!C.name){G.setDisabled(!C&&q);G.setActive(!!C)}}if(G=r.get(\"unlink\")){G.setDisabled(!C&&q);G.setActive(!!C&&!C.name)}if(G=r.get(\"anchor\")){G.setActive(!q&&!!C&&C.name)}C=o(\"IMG\");if(G=r.get(\"image\")){G.setActive(!q&&!!C&&D.className.indexOf(\"mceItem\")==-1)}if(G=r.get(\"styleselect\")){y._importClasses();j=[];f(G.items,function(n){j.push(n.value)});i=m.formatter.matchAll(j);G.select(i[0])}if(G=r.get(\"formatselect\")){C=o(d.isBlock);if(C){G.select(C.nodeName.toLowerCase())}}o(function(p){if(p.nodeName===\"SPAN\"){if(!w&&p.className){w=p.className}}if(m.dom.is(p,z.theme_advanced_font_selector)){if(!k&&p.style.fontSize){k=p.style.fontSize}if(!u&&p.style.fontFamily){u=p.style.fontFamily.replace(/[\\\"\\']+/g,\"\").replace(/^([^,]+).*/,\"$1\").toLowerCase()}if(!B&&p.style.color){B=p.style.color}if(!l&&p.style.backgroundColor){l=p.style.backgroundColor}}return false});if(G=r.get(\"fontselect\")){G.select(function(n){return n.replace(/^([^,]+).*/,\"$1\").toLowerCase()==u})}if(G=r.get(\"fontsizeselect\")){if(z.theme_advanced_runtime_fontsize&&!k&&!w){k=m.dom.getStyle(D,\"fontSize\",true)}G.select(function(n){if(n.fontSize&&n.fontSize===k){return true}if(n[\"class\"]&&n[\"class\"]===w){return true}})}if(z.theme_advanced_show_current_color){function A(p,n){if(G=r.get(p)){if(!n){n=G.settings.default_color}if(n!==G.value){G.displayColor(n)}}}A(\"forecolor\",B);A(\"backcolor\",l)}if(z.theme_advanced_show_current_color){function A(p,n){if(G=r.get(p)){if(!n){n=G.settings.default_color}if(n!==G.value){G.displayColor(n)}}}A(\"forecolor\",B);A(\"backcolor\",l)}if(z.theme_advanced_path&&z.theme_advanced_statusbar_location){C=d.get(m.id+\"_path\")||d.add(m.id+\"_path_row\",\"span\",{id:m.id+\"_path\"});if(y.statusKeyboardNavigation){y.statusKeyboardNavigation.destroy();y.statusKeyboardNavigation=null}d.setHTML(C,\"\");o(function(H){var p=H.nodeName.toLowerCase(),s,v,t=\"\";if(H.nodeType!=1||p===\"br\"||H.getAttribute(\"data-mce-bogus\")||d.hasClass(H,\"mceItemHidden\")||d.hasClass(H,\"mceItemRemoved\")){return}if(e.isIE&&H.scopeName!==\"HTML\"){p=H.scopeName+\":\"+p}p=p.replace(/mce\\:/g,\"\");switch(p){case\"b\":p=\"strong\";break;case\"i\":p=\"em\";break;case\"img\":if(x=d.getAttrib(H,\"src\")){t+=\"src: \"+x+\" \"}break;case\"a\":if(x=d.getAttrib(H,\"name\")){t+=\"name: \"+x+\" \";p+=\"#\"+x}if(x=d.getAttrib(H,\"href\")){t+=\"href: \"+x+\" \"}break;case\"font\":if(x=d.getAttrib(H,\"face\")){t+=\"font: \"+x+\" \"}if(x=d.getAttrib(H,\"size\")){t+=\"size: \"+x+\" \"}if(x=d.getAttrib(H,\"color\")){t+=\"color: \"+x+\" \"}break;case\"span\":if(x=d.getAttrib(H,\"style\")){t+=\"style: \"+x+\" \"}break}if(x=d.getAttrib(H,\"id\")){t+=\"id: \"+x+\" \"}if(x=H.className){x=x.replace(/\\b\\s*(webkit|mce|Apple-)\\w+\\s*\\b/g,\"\");if(x){t+=\"class: \"+x+\" \";if(d.isBlock(H)||p==\"img\"||p==\"span\"){p+=\".\"+x}}}p=p.replace(/(html:)/g,\"\");p={name:p,node:H,title:t};y.onResolveName.dispatch(y,p);t=p.title;p=p.name;v=d.create(\"a\",{href:\"javascript:;\",role:\"button\",onmousedown:\"return false;\",title:t,\"class\":\"mcePath_\"+(F++)},p);if(C.hasChildNodes()){C.insertBefore(d.create(\"span\",{\"aria-hidden\":\"true\"},\"\\u00a0\\u00bb \"),C.firstChild);C.insertBefore(v,C.firstChild)}else{C.appendChild(v)}},m.getBody());if(d.select(\"a\",C).length>0){y.statusKeyboardNavigation=new e.ui.KeyboardNavigation({root:m.id+\"_path_row\",items:d.select(\"a\",C),excludeFromTabOrder:true,onCancel:function(){m.focus()}},d)}}},_sel:function(i){this.editor.execCommand(\"mceSelectNodeDepth\",false,i)},_mceInsertAnchor:function(k,j){var i=this.editor;i.windowManager.open({url:this.url+\"/anchor.htm\",width:320+parseInt(i.getLang(\"advanced.anchor_delta_width\",0)),height:90+parseInt(i.getLang(\"advanced.anchor_delta_height\",0)),inline:true},{theme_url:this.url})},_mceCharMap:function(){var i=this.editor;i.windowManager.open({url:this.url+\"/charmap.htm\",width:550+parseInt(i.getLang(\"advanced.charmap_delta_width\",0)),height:260+parseInt(i.getLang(\"advanced.charmap_delta_height\",0)),inline:true},{theme_url:this.url})},_mceHelp:function(){var i=this.editor;i.windowManager.open({url:this.url+\"/about.htm\",width:480,height:380,inline:true},{theme_url:this.url})},_mceShortcuts:function(){var i=this.editor;i.windowManager.open({url:this.url+\"/shortcuts.htm\",width:480,height:380,inline:true},{theme_url:this.url})},_mceColorPicker:function(k,j){var i=this.editor;j=j||{};i.windowManager.open({url:this.url+\"/color_picker.htm\",width:375+parseInt(i.getLang(\"advanced.colorpicker_delta_width\",0)),height:250+parseInt(i.getLang(\"advanced.colorpicker_delta_height\",0)),close_previous:false,inline:true},{input_color:j.color,func:j.func,theme_url:this.url})},_mceCodeEditor:function(j,k){var i=this.editor;i.windowManager.open({url:this.url+\"/source_editor.htm\",width:parseInt(i.getParam(\"theme_advanced_source_editor_width\",720
2)),height:parseInt(i.getParam(\"theme_advanced_source_editor_height\",580)),inline:true,resizable:true,maximizable:true},{theme_url:this.url})},_mceImage:function(j,k){var i=this.editor;if(i.dom.getAttrib(i.selection.getNode(),\"class\").indexOf(\"mceItem\")!=-1){return}i.windowManager.open({url:this.url+\"/image.htm\",width:355+parseInt(i.getLang(\"advanced.image_delta_width\",0)),height:275+parseInt(i.getLang(\"advanced.image_delta_height\",0)),inline:true},{theme_url:this.url})},_mceLink:function(j,k){var i=this.editor;i.windowManager.open({url:this.url+\"/link.htm\",width:310+parseInt(i.getLang(\"advanced.link_delta_width\",0)),height:200+parseInt(i.getLang(\"advanced.link_delta_height\",0)),inline:true},{theme_url:this.url})},_mceNewDocument:function(){var i=this.editor;i.windowManager.confirm(\"advanced.newdocument\",function(j){if(j){i.execCommand(\"mceSetContent\",false,\"\")}})},_mceForeColor:function(){var i=this;this._mceColorPicker(0,{color:i.fgColor,func:function(j){i.fgColor=j;i.editor.execCommand(\"ForeColor\",false,j)}})},_mceBackColor:function(){var i=this;this._mceColorPicker(0,{color:i.bgColor,func:function(j){i.bgColor=j;i.editor.execCommand(\"HiliteColor\",false,j)}})},_ufirst:function(i){return i.substring(0,1).toUpperCase()+i.substring(1)}});e.ThemeManager.add(\"advanced\",e.themes.AdvancedTheme)}(tinymce));","Potato_Zendesk/js/tiny_mce/themes/advanced/editor_template_src.js":"/**\n * editor_template_src.js\n *\n * Copyright 2009, Moxiecode Systems AB\n * Released under LGPL License.\n *\n * License: http://tinymce.moxiecode.com/license\n * Contributing: http://tinymce.moxiecode.com/contributing\n */\n\n(function(tinymce) {\n\tvar DOM = tinymce.DOM, Event = tinymce.dom.Event, extend = tinymce.extend, each = tinymce.each, Cookie = tinymce.util.Cookie, lastExtID, explode = tinymce.explode;\n\n\t// Tell it to load theme specific language pack(s)\n\ttinymce.ThemeManager.requireLangPack('advanced');\n\n\ttinymce.create('tinymce.themes.AdvancedTheme', {\n\t\tsizes : [8, 10, 12, 14, 18, 24, 36],\n\n\t\t// Control name lookup, format: title, command\n\t\tcontrols : {\n\t\t\tbold : ['bold_desc', 'Bold'],\n\t\t\titalic : ['italic_desc', 'Italic'],\n\t\t\tunderline : ['underline_desc', 'Underline'],\n\t\t\tstrikethrough : ['striketrough_desc', 'Strikethrough'],\n\t\t\tjustifyleft : ['justifyleft_desc', 'JustifyLeft'],\n\t\t\tjustifycenter : ['justifycenter_desc', 'JustifyCenter'],\n\t\t\tjustifyright : ['justifyright_desc', 'JustifyRight'],\n\t\t\tjustifyfull : ['justifyfull_desc', 'JustifyFull'],\n\t\t\tbullist : ['bullist_desc', 'InsertUnorderedList'],\n\t\t\tnumlist : ['numlist_desc', 'InsertOrderedList'],\n\t\t\toutdent : ['outdent_desc', 'Outdent'],\n\t\t\tindent : ['indent_desc', 'Indent'],\n\t\t\tcut : ['cut_desc', 'Cut'],\n\t\t\tcopy : ['copy_desc', 'Copy'],\n\t\t\tpaste : ['paste_desc', 'Paste'],\n\t\t\tundo : ['undo_desc', 'Undo'],\n\t\t\tredo : ['redo_desc', 'Redo'],\n\t\t\tlink : ['link_desc', 'mceLink'],\n\t\t\tunlink : ['unlink_desc', 'unlink'],\n\t\t\timage : ['image_desc', 'mceImage'],\n\t\t\tcleanup : ['cleanup_desc', 'mceCleanup'],\n\t\t\thelp : ['help_desc', 'mceHelp'],\n\t\t\tcode : ['code_desc', 'mceCodeEditor'],\n\t\t\thr : ['hr_desc', 'InsertHorizontalRule'],\n\t\t\tremoveformat : ['removeformat_desc', 'RemoveFormat'],\n\t\t\tsub : ['sub_desc', 'subscript'],\n\t\t\tsup : ['sup_desc', 'superscript'],\n\t\t\tforecolor : ['forecolor_desc', 'ForeColor'],\n\t\t\tforecolorpicker : ['forecolor_desc', 'mceForeColor'],\n\t\t\tbackcolor : ['backcolor_desc', 'HiliteColor'],\n\t\t\tbackcolorpicker : ['backcolor_desc', 'mceBackColor'],\n\t\t\tcharmap : ['charmap_desc', 'mceCharMap'],\n\t\t\tvisualaid : ['visualaid_desc', 'mceToggleVisualAid'],\n\t\t\tanchor : ['anchor_desc', 'mceInsertAnchor'],\n\t\t\tnewdocument : ['newdocument_desc', 'mceNewDocument'],\n\t\t\tblockquote : ['blockquote_desc', 'mceBlockQuote']\n\t\t},\n\n\t\tstateControls : ['bold', 'italic', 'underline', 'strikethrough', 'bullist', 'numlist', 'justifyleft', 'justifycenter', 'justifyright', 'justifyfull', 'sub', 'sup', 'blockquote'],\n\n\t\tinit : function(ed, url) {\n\t\t\tvar t = this, s, v, o;\n\t\n\t\t\tt.editor = ed;\n\t\t\tt.url = url;\n\t\t\tt.onResolveName = new tinymce.util.Dispatcher(this);\n\n\t\t\ted.forcedHighContrastMode = ed.settings.detect_highcontrast && t._isHighContrast();\n\t\t\ted.settings.skin = ed.forcedHighContrastMode ? 'highcontrast' : ed.settings.skin;\n\n\t\t\t// Default settings\n\t\t\tt.settings = s = extend({\n\t\t\t\ttheme_advanced_path : true,\n\t\t\t\ttheme_advanced_toolbar_location : 'bottom',\n\t\t\t\ttheme_advanced_buttons1 : \"bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect\",\n\t\t\t\ttheme_advanced_buttons2 : \"bullist,numlist,|,outdent,indent,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code\",\n\t\t\t\ttheme_advanced_buttons3 : \"hr,removeformat,visualaid,|,sub,sup,|,charmap\",\n\t\t\t\ttheme_advanced_blockformats : \"p,address,pre,h1,h2,h3,h4,h5,h6\",\n\t\t\t\ttheme_advanced_toolbar_align : \"center\",\n\t\t\t\ttheme_advanced_fonts : \"Andale Mono=andale mono,times;Arial=arial,helvetica,sans-serif;Arial Black=arial black,avant garde;Book Antiqua=book antiqua,palatino;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier;Georgia=georgia,palatino;Helvetica=helvetica;Impact=impact,chicago;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco;Times New Roman=times new roman,times;Trebuchet MS=trebuchet ms,geneva;Verdana=verdana,geneva;Webdings=webdings;Wingdings=wingdings,zapf dingbats\",\n\t\t\t\ttheme_advanced_more_colors : 1,\n\t\t\t\ttheme_advanced_row_height : 23,\n\t\t\t\ttheme_advanced_resize_horizontal : 1,\n\t\t\t\ttheme_advanced_resizing_use_cookie : 1,\n\t\t\t\ttheme_advanced_font_sizes : \"1,2,3,4,5,6,7\",\n\t\t\t\ttheme_advanced_font_selector : \"span\",\n\t\t\t\ttheme_advanced_show_current_color: 0,\n\t\t\t\treadonly : ed.settings.readonly\n\t\t\t}, ed.settings);\n\n\t\t\t// Setup default font_size_style_values\n\t\t\tif (!s.font_size_style_values)\n\t\t\t\ts.font_size_style_values = \"8pt,10pt,12pt,14pt,18pt,24pt,36pt\";\n\n\t\t\tif (tinymce.is(s.theme_advanced_font_sizes, 'string')) {\n\t\t\t\ts.font_size_style_values = tinymce.explode(s.font_size_style_values);\n\t\t\t\ts.font_size_classes = tinymce.explode(s.font_size_classes || '');\n\n\t\t\t\t// Parse string value\n\t\t\t\to = {};\n\t\t\t\ted.settings.theme_advanced_font_sizes = s.theme_advanced_font_sizes;\n\t\t\t\teach(ed.getParam('theme_advanced_font_sizes', '', 'hash'), function(v, k) {\n\t\t\t\t\tvar cl;\n\n\t\t\t\t\tif (k == v && v >= 1 && v <= 7) {\n\t\t\t\t\t\tk = v + ' (' + t.sizes[v - 1] + 'pt)';\n\t\t\t\t\t\tcl = s.font_size_classes[v - 1];\n\t\t\t\t\t\tv = s.font_size_style_values[v - 1] || (t.sizes[v - 1] + 'pt');\n\t\t\t\t\t}\n\n\t\t\t\t\tif (/^\\s*\\./.test(v))\n\t\t\t\t\t\tcl = v.replace(/\\./g, '');\n\n\t\t\t\t\to[k] = cl ? {'class' : cl} : {fontSize : v};\n\t\t\t\t});\n\n\t\t\t\ts.theme_advanced_font_sizes = o;\n\t\t\t}\n\n\t\t\tif ((v = s.theme_advanced_path_location) && v != 'none')\n\t\t\t\ts.theme_advanced_statusbar_location = s.theme_advanced_path_location;\n\n\t\t\tif (s.theme_advanced_statusbar_location == 'none')\n\t\t\t\ts.theme_advanced_statusbar_location = 0;\n\n\t\t\tif (ed.settings.content_css !== false)\n\t\t\t\ted.contentCSS.push(ed.baseURI.toAbsolute(url + \"/skins/\" + ed.settings.skin + \"/content.css\"));
2\n\n\t\t\t// Init editor\n\t\t\ted.onInit.add(function() {\n\t\t\t\tif (!ed.settings.readonly) {\n\t\t\t\t\ted.onNodeChange.add(t._nodeChanged, t);\n\t\t\t\t\ted.onKeyUp.add(t._updateUndoStatus, t);\n\t\t\t\t\ted.onMouseUp.add(t._updateUndoStatus, t);\n\t\t\t\t\ted.dom.bind(ed.dom.getRoot(), 'dragend', function() {\n\t\t\t\t\t\tt._updateUndoStatus(ed);\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t});\n\n\t\t\ted.onSetProgressState.add(function(ed, b, ti) {\n\t\t\t\tvar co, id = ed.id, tb;\n\n\t\t\t\tif (b) {\n\t\t\t\t\tt.progressTimer = setTimeout(function() {\n\t\t\t\t\t\tco = ed.getContainer();\n\t\t\t\t\t\tco = co.insertBefore(DOM.create('DIV', {style : 'position:relative'}), co.firstChild);\n\t\t\t\t\t\ttb = DOM.get(ed.id + '_tbl');\n\n\t\t\t\t\t\tDOM.add(co, 'div', {id : id + '_blocker', 'class' : 'mceBlocker', style : {width : tb.clientWidth + 2, height : tb.clientHeight + 2}});\n\t\t\t\t\t\tDOM.add(co, 'div', {id : id + '_progress', 'class' : 'mceProgress', style : {left : tb.clientWidth / 2, top : tb.clientHeight / 2}});\n\t\t\t\t\t}, ti || 0);\n\t\t\t\t} else {\n\t\t\t\t\tDOM.remove(id + '_blocker');\n\t\t\t\t\tDOM.remove(id + '_progress');\n\t\t\t\t\tclearTimeout(t.progressTimer);\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tDOM.loadCSS(s.editor_css ? ed.documentBaseURI.toAbsolute(s.editor_css) : url + \"/skins/\" + ed.settings.skin + \"/ui.css\");\n\n\t\t\tif (s.skin_variant)\n\t\t\t\tDOM.loadCSS(url + \"/skins/\" + ed.settings.skin + \"/ui_\" + s.skin_variant + \".css\");\n\t\t},\n\n\t\t_isHighContrast : function() {\n\t\t\tvar actualColor, div = DOM.add(DOM.getRoot(), 'div', {'style': 'background-color: rgb(171,239,86);'});\n\n\t\t\tactualColor = (DOM.getStyle(div, 'background-color', true) + '').toLowerCase().replace(/ /g, '');\n\t\t\tDOM.remove(div);\n\n\t\t\treturn actualColor != 'rgb(171,239,86)' && actualColor != '#abef56';\n\t\t},\n\n\t\tcreateControl : function(n, cf) {\n\t\t\tvar cd, c;\n\n\t\t\tif (c = cf.createControl(n))\n\t\t\t\treturn c;\n\n\t\t\tswitch (n) {\n\t\t\t\tcase \"styleselect\":\n\t\t\t\t\treturn this._createStyleSelect();\n\n\t\t\t\tcase \"formatselect\":\n\t\t\t\t\treturn this._createBlockFormats();\n\n\t\t\t\tcase \"fontselect\":\n\t\t\t\t\treturn this._createFontSelect();\n\n\t\t\t\tcase \"fontsizeselect\":\n\t\t\t\t\treturn this._createFontSizeSelect();\n\n\t\t\t\tcase \"forecolor\":\n\t\t\t\t\treturn this._createForeColorMenu();\n\n\t\t\t\tcase \"backcolor\":\n\t\t\t\t\treturn this._createBackColorMenu();\n\t\t\t}\n\n\t\t\tif ((cd = this.controls[n]))\n\t\t\t\treturn cf.createButton(n, {title : \"advanced.\" + cd[0], cmd : cd[1], ui : cd[2], value : cd[3]});\n\t\t},\n\n\t\texecCommand : function(cmd, ui, val) {\n\t\t\tvar f = this['_' + cmd];\n\n\t\t\tif (f) {\n\t\t\t\tf.call(this, ui, val);\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\treturn false;\n\t\t},\n\n\t\t_importClasses : function(e) {\n\t\t\tvar ed = this.editor, ctrl = ed.controlManager.get('styleselect');\n\n\t\t\tif (ctrl.getLength() == 0) {\n\t\t\t\teach(ed.dom.getClasses(), function(o, idx) {\n\t\t\t\t\tvar name = 'style_' + idx;\n\n\t\t\t\t\ted.formatter.register(name, {\n\t\t\t\t\t\tinline : 'span',\n\t\t\t\t\t\tattributes : {'class' : o['class']},\n\t\t\t\t\t\tselector : '*'\n\t\t\t\t\t});\n\n\t\t\t\t\tctrl.add(o['class'], name);\n\t\t\t\t});\n\t\t\t}\n\t\t},\n\n\t\t_createStyleSelect : function(n) {\n\t\t\tvar t = this, ed = t.editor, ctrlMan = ed.controlManager, ctrl;\n\n\t\t\t// Setup style select box\n\t\t\tctrl = ctrlMan.createListBox('styleselect', {\n\t\t\t\ttitle : 'advanced.style_select',\n\t\t\t\tonselect : function(name) {\n\t\t\t\t\tvar matches, formatNames = [];\n\n\t\t\t\t\teach(ctrl.items, function(item) {\n\t\t\t\t\t\tformatNames.push(item.value);\n\t\t\t\t\t});\n\n\t\t\t\t\ted.focus();\n\t\t\t\t\ted.undoManager.add();\n\n\t\t\t\t\t// Toggle off the current format\n\t\t\t\t\tmatches = ed.formatter.matchAll(formatNames);\n\t\t\t\t\tif (!name || matches[0] == name) {\n\t\t\t\t\t\tif (matches[0]) \n\t\t\t\t\t\t\ted.formatter.remove(matches[0]);\n\t\t\t\t\t} else\n\t\t\t\t\t\ted.formatter.apply(name);\n\n\t\t\t\t\ted.undoManager.add();\n\t\t\t\t\ted.nodeChanged();\n\n\t\t\t\t\treturn false; // No auto select\n\t\t\t\t}\n\t\t\t});\n\n\t\t\t// Handle specified format\n\t\t\ted.onInit.add(function() {\
2n\t\t\t\tvar counter = 0, formats = ed.getParam('style_formats');\n\n\t\t\t\tif (formats) {\n\t\t\t\t\teach(formats, function(fmt) {\n\t\t\t\t\t\tvar name, keys = 0;\n\n\t\t\t\t\t\teach(fmt, function() {keys++;});\n\n\t\t\t\t\t\tif (keys > 1) {\n\t\t\t\t\t\t\tname = fmt.name = fmt.name || 'style_' + (counter++);\n\t\t\t\t\t\t\ted.formatter.register(name, fmt);\n\t\t\t\t\t\t\tctrl.add(fmt.title, name);\n\t\t\t\t\t\t} else\n\t\t\t\t\t\t\tctrl.add(fmt.title);\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\teach(ed.getParam('theme_advanced_styles', '', 'hash'), function(val, key) {\n\t\t\t\t\t\tvar name;\n\n\t\t\t\t\t\tif (val) {\n\t\t\t\t\t\t\tname = 'style_' + (counter++);\n\n\t\t\t\t\t\t\ted.formatter.register(name, {\n\t\t\t\t\t\t\t\tinline : 'span',\n\t\t\t\t\t\t\t\tclasses : val,\n\t\t\t\t\t\t\t\tselector : '*'\n\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t\tctrl.add(t.editor.translate(key), name);\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t});\n\n\t\t\t// Auto import classes if the ctrl box is empty\n\t\t\tif (ctrl.getLength() == 0) {\n\t\t\t\tctrl.onPostRender.add(function(ed, n) {\n\t\t\t\t\tif (!ctrl.NativeListBox) {\n\t\t\t\t\t\tEvent.add(n.id + '_text', 'focus', t._importClasses, t);\n\t\t\t\t\t\tEvent.add(n.id + '_text', 'mousedown', t._importClasses, t);\n\t\t\t\t\t\tEvent.add(n.id + '_open', 'focus', t._importClasses, t);\n\t\t\t\t\t\tEvent.add(n.id + '_open', 'mousedown', t._importClasses, t);\n\t\t\t\t\t} else\n\t\t\t\t\t\tEvent.add(n.id, 'focus', t._importClasses, t);\n\t\t\t\t});\n\t\t\t}\n\n\t\t\treturn ctrl;\n\t\t},\n\n\t\t_createFontSelect : function() {\n\t\t\tvar c, t = this, ed = t.editor;\n\n\t\t\tc = ed.controlManager.createListBox('fontselect', {\n\t\t\t\ttitle : 'advanced.fontdefault',\n\t\t\t\tonselect : function(v) {\n\t\t\t\t\tvar cur = c.items[c.selectedIndex];\n\n\t\t\t\t\tif (!v && cur) {\n\t\t\t\t\t\ted.execCommand('FontName', false, cur.value);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\ted.execCommand('FontName', false, v);\n\n\t\t\t\t\t// Fake selection, execCommand will fire a nodeChange and update the selection\n\t\t\t\t\tc.select(function(sv) {\n\t\t\t\t\t\treturn v == sv;\n\t\t\t\t\t});\n\n\t\t\t\t\tif (cur && cur.value == v) {\n\t\t\t\t\t\tc.select(null);\n\t\t\t\t\t}\n\n\t\t\t\t\treturn false; // No auto select\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tif (c) {\n\t\t\t\teach(ed.getParam('theme_advanced_fonts', t.settings.theme_advanced_fonts, 'hash'), function(v, k) {\n\t\t\t\t\tc.add(ed.translate(k), v, {style : v.indexOf('dings') == -1 ? 'font-family:' + v : ''});\n\t\t\t\t});\n\t\t\t}\n\n\t\t\treturn c;\n\t\t},\n\n\t\t_createFontSizeSelect : function() {\n\t\t\tvar t = this, ed = t.editor, c, i = 0, cl = [];\n\n\t\t\tc = ed.controlManager.createListBox('fontsizeselect', {title : 'advanced.font_size', onselect : function(v) {\n\t\t\t\tvar cur = c.items[c.selectedIndex];\n\n\t\t\t\tif (!v && cur) {\n\t\t\t\t\tcur = cur.value;\n\n\t\t\t\t\tif (cur['class']) {\n\t\t\t\t\t\ted.formatter.toggle('fontsize_class', {value : cur['class']});\n\t\t\t\t\t\ted.undoManager.add();\n\t\t\t\t\t\ted.nodeChanged();\n\t\t\t\t\t} else {\n\t\t\t\t\t\ted.execCommand('FontSize', false, cur.fontSize);\n\t\t\t\t\t}\n\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (v['class']) {\n\t\t\t\t\ted.focus();\n\t\t\t\t\ted.undoManager.add();\n\t\t\t\t\ted.formatter.toggle('fontsize_class', {value : v['class']});\n\t\t\t\t\ted.undoManager.add();\n\t\t\t\t\ted.nodeChanged();\n\t\t\t\t} else\n\t\t\t\t\ted.execCommand('FontSize', false, v.fontSize);\n\n\t\t\t\t// Fake selection, execCommand will fire a nodeChange and update the selection\n\t\t\t\tc.select(function(sv) {\n\t\t\t\t\treturn v == sv;\n\t\t\t\t});\n\n\t\t\t\tif (cur && (cur.value.fontSize == v.fontSize || cur.value['class'] == v['class'])) {\n\t\t\t\t\tc.select(null);\n\t\t\t\t}\n\n\t\t\t\treturn false; // No auto select\n\t\t\t}});\n\n\t\t\tif (c) {\n\t\t\t\teach(t.settings.theme_advanced_font_sizes, function(v, k) {\n\t\t\t\t\tvar fz = v.fontSize;\n\n\t\t\t\t\tif (fz >= 1 && fz <= 7)\n\t\t\t\t\t\tfz = t.sizes[parseInt(fz) - 1] + 'pt';\n\n\t\t\t\t\tc.add(k, v, {'style' : 'font-size:' + fz, 'class' : 'mceFontSize' + (i++) + (' ' + (v['class'] || ''))});\n\t\t\t\t});\n\t\t\t}\n\n\t\t\treturn c;\n\t\t}
2,\n\n\t\t_createBlockFormats : function() {\n\t\t\tvar c, fmts = {\n\t\t\t\tp : 'advanced.paragraph',\n\t\t\t\taddress : 'advanced.address',\n\t\t\t\tpre : 'advanced.pre',\n\t\t\t\th1 : 'advanced.h1',\n\t\t\t\th2 : 'advanced.h2',\n\t\t\t\th3 : 'advanced.h3',\n\t\t\t\th4 : 'advanced.h4',\n\t\t\t\th5 : 'advanced.h5',\n\t\t\t\th6 : 'advanced.h6',\n\t\t\t\tdiv : 'advanced.div',\n\t\t\t\tblockquote : 'advanced.blockquote',\n\t\t\t\tcode : 'advanced.code',\n\t\t\t\tdt : 'advanced.dt',\n\t\t\t\tdd : 'advanced.dd',\n\t\t\t\tsamp : 'advanced.samp'\n\t\t\t}, t = this;\n\n\t\t\tc = t.editor.controlManager.createListBox('formatselect', {title : 'advanced.block', onselect : function(v) {\n\t\t\t\tt.editor.execCommand('FormatBlock', false, v);\n\t\t\t\treturn false;\n\t\t\t}});\n\n\t\t\tif (c) {\n\t\t\t\teach(t.editor.getParam('theme_advanced_blockformats', t.settings.theme_advanced_blockformats, 'hash'), function(v, k) {\n\t\t\t\t\tc.add(t.editor.translate(k != v ? k : fmts[v]), v, {'class' : 'mce_formatPreview mce_' + v});\n\t\t\t\t});\n\t\t\t}\n\n\t\t\treturn c;\n\t\t},\n\n\t\t_createForeColorMenu : function() {\n\t\t\tvar c, t = this, s = t.settings, o = {}, v;\n\n\t\t\tif (s.theme_advanced_more_colors) {\n\t\t\t\to.more_colors_func = function() {\n\t\t\t\t\tt._mceColorPicker(0, {\n\t\t\t\t\t\tcolor : c.value,\n\t\t\t\t\t\tfunc : function(co) {\n\t\t\t\t\t\t\tc.setColor(co);\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tif (v = s.theme_advanced_text_colors)\n\t\t\t\to.colors = v;\n\n\t\t\tif (s.theme_advanced_default_foreground_color)\n\t\t\t\to.default_color = s.theme_advanced_default_foreground_color;\n\n\t\t\to.title = 'advanced.forecolor_desc';\n\t\t\to.cmd = 'ForeColor';\n\t\t\to.scope = this;\n\n\t\t\tc = t.editor.controlManager.createColorSplitButton('forecolor', o);\n\n\t\t\treturn c;\n\t\t},\n\n\t\t_createBackColorMenu : function() {\n\t\t\tvar c, t = this, s = t.settings, o = {}, v;\n\n\t\t\tif (s.theme_advanced_more_colors) {\n\t\t\t\to.more_colors_func = function() {\n\t\t\t\t\tt._mceColorPicker(0, {\n\t\t\t\t\t\tcolor : c.value,\n\t\t\t\t\t\tfunc : function(co) {\n\t\t\t\t\t\t\tc.setColor(co);\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tif (v = s.theme_advanced_background_colors)\n\t\t\t\to.colors = v;\n\n\t\t\tif (s.theme_advanced_default_background_color)\n\t\t\t\to.default_color = s.theme_advanced_default_background_color;\n\n\t\t\to.title = 'advanced.backcolor_desc';\n\t\t\to.cmd = 'HiliteColor';\n\t\t\to.scope = this;\n\n\t\t\tc = t.editor.controlManager.createColorSplitButton('backcolor', o);\n\n\t\t\treturn c;\n\t\t},\n\n\t\trenderUI : function(o) {\n\t\t\tvar n, ic, tb, t = this, ed = t.editor, s = t.settings, sc, p, nl;\n\n\t\t\tif (ed.settings) {\n\t\t\t\ted.settings.aria_label = s.aria_label + ed.getLang('advanced.help_shortcut');\n\t\t\t}\n\n\t\t\t// TODO: ACC Should have an aria-describedby attribute which is user-configurable to describe what this field is actually for.\n\t\t\t// Maybe actually inherit it from the original textara?\n\t\t\tn = p = DOM.create('span', {role : 'application', 'aria-labelledby' : ed.id + '_voice', id : ed.id + '_parent', 'class' : 'mceEditor ' + ed.settings.skin + 'Skin' + (s.skin_variant ? ' ' + ed.settings.skin + 'Skin' + t._ufirst(s.skin_variant) : '')});\n\t\t\tDOM.add(n, 'span', {'class': 'mceVoiceLabel', 'style': 'display:none;', id: ed.id + '_voice'}, s.aria_label);\n\n\t\t\tif (!DOM.boxModel)\n\t\t\t\tn = DOM.add(n, 'div', {'class' : 'mceOldBoxModel'});\n\n\t\t\tn = sc = DOM.add(n, 'table', {role : \"presentation\", id : ed.id + '_tbl', 'class' : 'mceLayout', cellSpacing : 0, cellPadding : 0});\n\t\t\tn = tb = DOM.add(n, 'tbody');\n\n\t\t\tswitch ((s.theme_advanced_layout_manager || '').toLowerCase()) {\n\t\t\t\tcase \"rowlayout\":\n\t\t\t\t\tic = t._rowLayout(s, tb, o);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase \"customlayout\":\n\t\t\t\t\tic = ed.execCallback(\"theme_advanced_custom_layout\", s, tb, o, p);\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\t\t\t\t\tic = t._simpleLayout(s, tb, o, p);\n\t\t\t}\n\n\t\t\tn = o.targetNode;\n\n\t\t\t// Add classes to first and last TRs\n\t\t\tnl = sc.rows;\n\t\t\tDOM.addClass(nl[0], 'mceFirst');\n\t\t\tDOM.addClass(nl[nl.length - 1], 'mceLast');\n\n\t\t\t// Add classes to first and last TDs\n\t\t\teach(DOM.select('tr', tb), function(n) {\n\t\t\t\tDOM.addClass(n.firstChild, 'mceFirst');\n\t\t\t\tDOM.addClass(n.childNodes[n.childNodes.length - 1], 'mceLast');\n\t\t\t});\n\n\t\t\tif (DOM.get(s.theme_advanced_toolbar_container))\n\t\t\t\tDOM.get(s.theme_advanced_toolbar_container).appendChild(p);\n\t\t\telse\n\t\t\t\tDOM.insertAfter(p, n);\n\n\t\t\tEvent.add(ed.id + '_path_row', 'click', function(e) {\n\t\t\t\te = e.target;\n\n\t\t\t\tif (e.nodeName == 'A') {\n\t\t\t\t\tt._sel(e.className.replace(/^.*mcePath_([0-9]+).*$/, '$1'));\n\n\t\t\t\t\treturn Event.cancel(e);\n\t\t\t\t}\n\t\t\t});\n/*\n\t\t\tif (DOM.get(ed.id + '_path_row')) {\n\t\t\t\tEvent.add(ed.id + '_tbl', 'mouseover', function(e) {\n\t\t\t\t\tvar re;\n\t\n\t\t\t\t\te = e.target;\n\n\t\t\t\t\tif (e.nodeName == 'SPAN' && DOM.hasClass(e.parentNode, 'mceButton')) {\n\t\t\t\t\t\tre = DOM.get(ed.id + '_path_row');
2\n\t\t\t\t\t\tt.lastPath = re.innerHTML;\n\t\t\t\t\t\tDOM.setHTML(re, e.parentNode.title);\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\tEvent.add(ed.id + '_tbl', 'mouseout', function(e) {\n\t\t\t\t\tif (t.lastPath) {\n\t\t\t\t\t\tDOM.setHTML(ed.id + '_path_row', t.lastPath);\n\t\t\t\t\t\tt.lastPath = 0;\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n*/\n\n\t\t\tif (!ed.getParam('accessibility_focus'))\n\t\t\t\tEvent.add(DOM.add(p, 'a', {href : '#'}, '<!-- IE -->'), 'focus', function() {tinyMCE.get(ed.id).focus();});\n\n\t\t\tif (s.theme_advanced_toolbar_location == 'external')\n\t\t\t\to.deltaHeight = 0;\n\n\t\t\tt.deltaHeight = o.deltaHeight;\n\t\t\to.targetNode = null;\n\n\t\t\ted.onKeyDown.add(function(ed, evt) {\n\t\t\t\tvar DOM_VK_F10 = 121, DOM_VK_F11 = 122;\n\n\t\t\t\tif (evt.altKey) {\n\t\t \t\t\tif (evt.keyCode === DOM_VK_F10) {\n\t\t\t\t\t\t// Make sure focus is given to toolbar in Safari.\n\t\t\t\t\t\t// We can't do this in IE as it prevents giving focus to toolbar when editor is in a frame\n\t\t\t\t\t\tif (tinymce.isWebKit) {\n\t\t\t\t\t\t\twindow.focus();\n\t\t\t\t\t\t}\n\t\t\t\t\t\tt.toolbarGroup.focus();\n\t\t\t\t\t\treturn Event.cancel(evt);\n\t\t\t\t\t} else if (evt.keyCode === DOM_VK_F11) {\n\t\t\t\t\t\tDOM.get(ed.id + '_path_row').focus();\n\t\t\t\t\t\treturn Event.cancel(evt);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\n\t\t\t// alt+0 is the UK recommended shortcut for accessing the list of access controls.\n\t\t\ted.addShortcut('alt+0', '', 'mceShortcuts', t);\n\n\t\t\treturn {\n\t\t\t\tiframeContainer : ic,\n\t\t\t\teditorContainer : ed.id + '_parent',\n\t\t\t\tsizeContainer : sc,\n\t\t\t\tdeltaHeight : o.deltaHeight\n\t\t\t};\n\t\t},\n\n\t\tgetInfo : function() {\n\t\t\treturn {\n\t\t\t\tlongname : 'Advanced theme',\n\t\t\t\tauthor : 'Moxiecode Systems AB',\n\t\t\t\tauthorurl : 'http://tinymce.moxiecode.com',\n\t\t\t\tversion : tinymce.majorVersion + \".\" + tinymce.minorVersion\n\t\t\t}\n\t\t},\n\n\t\tresizeBy : function(dw, dh) {\n\t\t\tvar e = DOM.get(this.editor.id + '_ifr');\n\n\t\t\tthis.resizeTo(e.clientWidth + dw, e.clientHeight + dh);\n\t\t},\n\n\t\tresizeTo : function(w, h, store) {\n\t\t\tvar ed = this.editor, s = this.settings, e = DOM.get(ed.id + '_tbl'), ifr = DOM.get(ed.id + '_ifr');\n\n\t\t\t// Boundery fix box\n\t\t\tw = Math.max(s.theme_advanced_resizing_min_width || 100, w);\n\t\t\th = Math.max(s.theme_advanced_resizing_min_height || 100, h);\n\t\t\tw = Math.min(s.theme_advanced_resizing_max_width || 0xFFFF, w);\n\t\t\th = Math.min(s.theme_advanced_resizing_max_height || 0xFFFF, h);\n\n\t\t\t// Resize iframe and container\n\t\t\tDOM.setStyle(e, 'height', '');\n\t\t\tDOM.setStyle(ifr, 'height', h);\n\n\t\t\tif (s.theme_advanced_resize_horizontal) {\n\t\t\t\tDOM.setStyle(e, 'width', '');\n\t\t\t\tDOM.setStyle(ifr, 'width', w);\n\n\t\t\t\t// Make sure that the size is never smaller than the over all ui\n\t\t\t\tif (w < e.clientWidth) {\n\t\t\t\t\tw = e.clientWidth;\n\t\t\t\t\tDOM.setStyle(ifr, 'width', e.clientWidth);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Store away the size\n\t\t\tif (store && s.theme_advanced_resizing_use_cookie) {\n\t\t\t\tCookie.setHash(\"TinyMCE_\" + ed.id + \"_size\", {\n\t\t\t\t\tcw : w,\n\t\t\t\t\tch : h\n\t\t\t\t});\n\t\t\t}\n\t\t},\n\n\t\tdestroy : function() {\n\t\t\tvar id = this.editor.id;\n\n\t\t\tEvent.clear(id + '_resize');\n\t\t\tEvent.clear(id + '_path_row');\n\t\t\tEvent.clear(id + '_external_close');\n\t\t},\n\n\t\t// Internal functions\n\n\t\t_simpleLayout : function(s, tb, o, p) {\n\t\t\tvar t = this, ed = t.editor, lo = s.theme_advanced_toolbar_location, sl = s.theme_advanced_statusbar_location, n, ic, etb, c;\n\n\t\t\tif (s.readonly) {\n\t\t\t\tn = DOM.add(tb, 'tr');\n\t\t\t\tn = ic = DOM.add(n, 'td', {'class' : 'mceIframeContainer'});\n\t\t\t\treturn ic;\n\t\t\t}\n\n\t\t\t// Create toolbar container at top\n\t\t\tif (lo == 'top')\n\t\t\t\tt._addToolbars(tb, o);\n\n\t\t\t// Create external toolbar\n\t\t\tif (lo == 'external') {\n\t\t\t\tn = c = DOM.create('div', {style : 'position:relative'});\n\t\t\t\tn = DOM.add(n, 'div', {id : ed.id + '_external', 'class' : 'mceExternalToolbar'});\n\t\t\t\tDOM.add(n, 'a', {id : ed.id + '_external_close', href : 'javascript:;', 'class' : 'mceExternalClose'});\n\t\t\t\tn = DOM.add(n, 'table', {id : ed.id + '_tblext', cellSpacing : 0, cellPadding : 0});\n\t\t\t\tetb = DOM.add(n, 'tbody');
2\n\n\t\t\t\tif (p.firstChild.className == 'mceOldBoxModel')\n\t\t\t\t\tp.firstChild.appendChild(c);\n\t\t\t\telse\n\t\t\t\t\tp.insertBefore(c, p.firstChild);\n\n\t\t\t\tt._addToolbars(etb, o);\n\n\t\t\t\ted.onMouseUp.add(function() {\n\t\t\t\t\tvar e = DOM.get(ed.id + '_external');\n\t\t\t\t\tDOM.show(e);\n\n\t\t\t\t\tDOM.hide(lastExtID);\n\n\t\t\t\t\tvar f = Event.add(ed.id + '_external_close', 'click', function() {\n\t\t\t\t\t\tDOM.hide(ed.id + '_external');\n\t\t\t\t\t\tEvent.remove(ed.id + '_external_close', 'click', f);\n\t\t\t\t\t});\n\n\t\t\t\t\tDOM.show(e);\n\t\t\t\t\tDOM.setStyle(e, 'top', 0 - DOM.getRect(ed.id + '_tblext').h - 1);\n\n\t\t\t\t\t// Fixes IE rendering bug\n\t\t\t\t\tDOM.hide(e);\n\t\t\t\t\tDOM.show(e);\n\t\t\t\t\te.style.filter = '';\n\n\t\t\t\t\tlastExtID = ed.id + '_external';\n\n\t\t\t\t\te = null;\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tif (sl == 'top')\n\t\t\t\tt._addStatusBar(tb, o);\n\n\t\t\t// Create iframe container\n\t\t\tif (!s.theme_advanced_toolbar_container) {\n\t\t\t\tn = DOM.add(tb, 'tr');\n\t\t\t\tn = ic = DOM.add(n, 'td', {'class' : 'mceIframeContainer'});\n\t\t\t}\n\n\t\t\t// Create toolbar container at bottom\n\t\t\tif (lo == 'bottom')\n\t\t\t\tt._addToolbars(tb, o);\n\n\t\t\tif (sl == 'bottom')\n\t\t\t\tt._addStatusBar(tb, o);\n\n\t\t\treturn ic;\n\t\t},\n\n\t\t_rowLayout : function(s, tb, o) {\n\t\t\tvar t = this, ed = t.editor, dc, da, cf = ed.controlManager, n, ic, to, a;\n\n\t\t\tdc = s.theme_advanced_containers_default_class || '';\n\t\t\tda = s.theme_advanced_containers_default_align || 'center';\n\n\t\t\teach(explode(s.theme_advanced_containers || ''), function(c, i) {\n\t\t\t\tvar v = s['theme_advanced_container_' + c] || '';\n\n\t\t\t\tswitch (c.toLowerCase()) {\n\t\t\t\t\tcase 'mceeditor':\n\t\t\t\t\t\tn = DOM.add(tb, 'tr');\n\t\t\t\t\t\tn = ic = DOM.add(n, 'td', {'class' : 'mceIframeContainer'});\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'mceelementpath':\n\t\t\t\t\t\tt._addStatusBar(tb, o);\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tdefault:\n\t\t\t\t\t\ta = (s['theme_advanced_container_' + c + '_align'] || da).toLowerCase();\n\t\t\t\t\t\ta = 'mce' + t._ufirst(a);\n\n\t\t\t\t\t\tn = DOM.add(DOM.add(tb, 'tr'), 'td', {\n\t\t\t\t\t\t\t'class' : 'mceToolbar ' + (s['theme_advanced_container_' + c + '_class'] || dc) + ' ' + a || da\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\tto = cf.createToolbar(\"toolbar\" + i);\n\t\t\t\t\t\tt._addControls(v, to);\n\t\t\t\t\t\tDOM.setHTML(n, to.renderHTML());\n\t\t\t\t\t\to.deltaHeight -= s.theme_advanced_row_height;\n\t\t\t\t}\n\t\t\t});\n\n\t\t\treturn ic;\n\t\t},\n\n\t\t_addControls : function(v, tb) {\n\t\t\tvar t = this, s = t.settings, di, cf = t.editor.controlManager;\n\n\t\t\tif (s.theme_advanced_disable && !t._disabled) {\n\t\t\t\tdi = {};\n\n\t\t\t\teach(explode(s.theme_advanced_disable), function(v) {\n\t\t\t\t\tdi[v] = 1;\n\t\t\t\t});\n\n\t\t\t\tt._disabled = di;\n\t\t\t} else\n\t\t\t\tdi = t._disabled;\n\n\t\t\teach(explode(v), function(n) {\n\t\t\t\tvar c;\n\n\t\t\t\tif (di && di[n])\n\t\t\t\t\treturn;\n\n\t\t\t\t// Compatiblity with 2.x\n\t\t\t\tif (n == 'tablecontrols') {\n\t\t\t\t\teach([\"table\",\"|\",\"row_props\",\"cell_props\",\"|\",\"row_before\",\"row_after\",\"delete_row\",\"|\",\"col_before\",\"col_after\",\"delete_col\",\"|\",\"split_cells\",\"merge_cells\"], function(n) {\n\t\t\t\t\t\tn = t.createControl(n, cf);\n\n\t\t\t\t\t\tif (n)\n\t\t\t\t\t\t\ttb.add(n);\n\t\t\t\t\t});\n\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tc = t.createControl(n, cf);\n\n\t\t\t\tif (c)\n\t\t\t\t\ttb.add(c);\n\t\t\t});\n\t\t},\n\n\t\t_addToolbars : function(c, o) {\n\t\t\tvar t = this, i, tb, ed = t.editor, s = t.settings, v, cf = ed.controlManager, di, n, h = [], a, toolbarGroup;\n\n\t\t\ttoolbarGroup = cf.createToolbarGroup('toolbargroup', {\n\t\t\t\t'name': ed.getLang('advanced.toolbar'),\n\t\t\t\t'tab_focus_toolbar':ed.getParam('theme_advanced_tab_focus_toolbar')\n\t\t\t});\n\n\t\t\tt.toolbarGroup = toolbarGroup;\n\n\t\t\ta = s.theme_advanced_toolbar_align.toLowerCase();\n\t\t\ta = 'mce' + t._ufirst(a);\n\n\t\t\tn = DOM.add(DOM.add(c, 'tr', {role: 'presentation'}), 'td', {'class' : 'mceToolbar ' + a, \"role\":\"presentation\"});\n\n\t\t\t// Create toolbar and add the controls\n\t\t\tfor (i=1; (v = s['theme_advanced_buttons' + i]);
2 i++) {\n\t\t\t\ttb = cf.createToolbar(\"toolbar\" + i, {'class' : 'mceToolbarRow' + i});\n\n\t\t\t\tif (s['theme_advanced_buttons' + i + '_add'])\n\t\t\t\t\tv += ',' + s['theme_advanced_buttons' + i + '_add'];\n\n\t\t\t\tif (s['theme_advanced_buttons' + i + '_add_before'])\n\t\t\t\t\tv = s['theme_advanced_buttons' + i + '_add_before'] + ',' + v;\n\n\t\t\t\tt._addControls(v, tb);\n\t\t\t\ttoolbarGroup.add(tb);\n\n\t\t\t\to.deltaHeight -= s.theme_advanced_row_height;\n\t\t\t}\n\t\t\th.push(toolbarGroup.renderHTML());\n\t\t\th.push(DOM.createHTML('a', {href : '#', accesskey : 'z', title : ed.getLang(\"advanced.toolbar_focus\"), onfocus : 'tinyMCE.getInstanceById(\\'' + ed.id + '\\').focus();'}, '<!-- IE -->'));\n\t\t\tDOM.setHTML(n, h.join(''));\n\t\t},\n\n\t\t_addStatusBar : function(tb, o) {\n\t\t\tvar n, t = this, ed = t.editor, s = t.settings, r, mf, me, td;\n\n\t\t\tn = DOM.add(tb, 'tr');\n\t\t\tn = td = DOM.add(n, 'td', {'class' : 'mceStatusbar'}); \n\t\t\tn = DOM.add(n, 'div', {id : ed.id + '_path_row', 'role': 'group', 'aria-labelledby': ed.id + '_path_voice'});\n\t\t\tif (s.theme_advanced_path) {\n\t\t\t\tDOM.add(n, 'span', {id: ed.id + '_path_voice'}, ed.translate('advanced.path'));\n\t\t\t\tDOM.add(n, 'span', {}, ': ');\n\t\t\t} else {\n\t\t\t\tDOM.add(n, 'span', {}, '&#160;');\n\t\t\t}\n\t\t\t\n\n\t\t\tif (s.theme_advanced_resizing) {\n\t\t\t\tDOM.add(td, 'a', {id : ed.id + '_resize', href : 'javascript:;', onclick : \"return false;\", 'class' : 'mceResize', tabIndex:\"-1\"});\n\n\t\t\t\tif (s.theme_advanced_resizing_use_cookie) {\n\t\t\t\t\ted.onPostRender.add(function() {\n\t\t\t\t\t\tvar o = Cookie.getHash(\"TinyMCE_\" + ed.id + \"_size\"), c = DOM.get(ed.id + '_tbl');\n\n\t\t\t\t\t\tif (!o)\n\t\t\t\t\t\t\treturn;\n\n\t\t\t\t\t\tt.resizeTo(o.cw, o.ch);\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\ted.onPostRender.add(function() {\n\t\t\t\t\tEvent.add(ed.id + '_resize', 'click', function(e) {\n\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t});\n\n\t\t\t\t\tEvent.add(ed.id + '_resize', 'mousedown', function(e) {\n\t\t\t\t\t\tvar mouseMoveHandler1, mouseMoveHandler2,\n\t\t\t\t\t\t\tmouseUpHandler1, mouseUpHandler2,\n\t\t\t\t\t\t\tstartX, startY, startWidth, startHeight, width, height, ifrElm;\n\n\t\t\t\t\t\tfunction resizeOnMove(e) {\n\t\t\t\t\t\t\te.preventDefault();\n\n\t\t\t\t\t\t\twidth = startWidth + (e.screenX - startX);\n\t\t\t\t\t\t\theight = startHeight + (e.screenY - startY);\n\n\t\t\t\t\t\t\tt.resizeTo(width, height);\n\t\t\t\t\t\t};\n\n\t\t\t\t\t\tfunction endResize(e) {\n\t\t\t\t\t\t\t// Stop listening\n\t\t\t\t\t\t\tEvent.remove(DOM.doc, 'mousemove', mouseMoveHandler1);\n\t\t\t\t\t\t\tEvent.remove(ed.getDoc(), 'mousemove', mouseMoveHandler2);\n\t\t\t\t\t\t\tEvent.remove(DOM.doc, 'mouseup', mouseUpHandler1);\n\t\t\t\t\t\t\tEvent.remove(ed.getDoc(), 'mouseup', mouseUpHandler2);\n\n\t\t\t\t\t\t\twidth = startWidth + (e.screenX - startX);\n\t\t\t\t\t\t\theight = startHeight + (e.screenY - startY);\n\t\t\t\t\t\t\tt.resizeTo(width, height, true);\n\t\t\t\t\t\t};\n\n\t\t\t\t\t\te.preventDefault();\n\n\t\t\t\t\t\t// Get the current rect size\n\t\t\t\t\t\tstartX = e.screenX;\n\t\t\t\t\t\tstartY = e.screenY;\n\t\t\t\t\t\tifrElm = DOM.get(t.editor.id + '_ifr');\n\t\t\t\t\t\tstartWidth = width = ifrElm.clientWidth;\n\t\t\t\t\t\tstartHeight = height = ifrElm.clientHeight;\n\n\t\t\t\t\t\t// Register envent handlers\n\t\t\t\t\t\tmouseMoveHandler1 = Event.add(DOM.doc, 'mousemove', resizeOnMove);\n\t\t\t\t\t\tmouseMoveHandler2 = Event.add(ed.getDoc(), 'mousemove', resizeOnMove);\n\t\t\t\t\t\tmouseUpHandler1 = Event.add(DOM.doc, 'mouseup', endResize);\n\t\t\t\t\t\tmouseUpHandler2 = Event.add(ed.getDoc(), 'mouseup', endResize);\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t}\n\n\t\t\to.deltaHeight -= 21;\n\t\t\tn = tb = null;\n\t\t},\n\n\t\t_updateUndoStatus : function(ed) {\n\t\t\tvar cm = ed.controlManager, um = ed.undoManager;\n\n\t\t\tcm.setDisabled('undo', !um.hasUndo() && !um.typing);\n\t\t\tcm.setDisabled('redo', !um.hasRedo());\n\t\t},\n\n\t\t_nodeChanged : function(ed, cm, n, co, ob) {\n\t\t\tvar t = this, p, de = 0, v, c, s = t.settings, cl, fz, fn, fc, bc, formatNames, matches;\n\n\t\t\ttinymce.each(t.stateControls, function(c) {\n\t\t\t\tcm.setActive(c, ed.queryCommandState(t.controls[c][1]));\n\t\t\t});\n\n\t\t\tfunction getParent(name) {\n\t\t\t\tvar i, parents = ob.parents, func = name;\n\n\t\t\t\tif (typeof(name) == 'string') {\n\t\t\t\t\tfunc = function(node) {\n\t\t\t\t\t\treturn node.nodeName == name;\n\t\t\t\t\t};\n\t\t\t\t}\n\n\t\t\t\tfor (i = 0; i < parents.length;
2 i++) {\n\t\t\t\t\tif (func(parents[i]))\n\t\t\t\t\t\treturn parents[i];\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tcm.setActive('visualaid', ed.hasVisual);\n\t\t\tt._updateUndoStatus(ed);\n\t\t\tcm.setDisabled('outdent', !ed.queryCommandState('Outdent'));\n\n\t\t\tp = getParent('A');\n\t\t\tif (c = cm.get('link')) {\n\t\t\t\tif (!p || !p.name) {\n\t\t\t\t\tc.setDisabled(!p && co);\n\t\t\t\t\tc.setActive(!!p);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (c = cm.get('unlink')) {\n\t\t\t\tc.setDisabled(!p && co);\n\t\t\t\tc.setActive(!!p && !p.name);\n\t\t\t}\n\n\t\t\tif (c = cm.get('anchor')) {\n\t\t\t\tc.setActive(!co && !!p && p.name);\n\t\t\t}\n\n\t\t\tp = getParent('IMG');\n\t\t\tif (c = cm.get('image'))\n\t\t\t\tc.setActive(!co && !!p && n.className.indexOf('mceItem') == -1);\n\n\t\t\tif (c = cm.get('styleselect')) {\n\t\t\t\tt._importClasses();\n\n\t\t\t\tformatNames = [];\n\t\t\t\teach(c.items, function(item) {\n\t\t\t\t\tformatNames.push(item.value);\n\t\t\t\t});\n\n\t\t\t\tmatches = ed.formatter.matchAll(formatNames);\n\t\t\t\tc.select(matches[0]);\n\t\t\t}\n\n\t\t\tif (c = cm.get('formatselect')) {\n\t\t\t\tp = getParent(DOM.isBlock);\n\n\t\t\t\tif (p)\n\t\t\t\t\tc.select(p.nodeName.toLowerCase());\n\t\t\t}\n\n\t\t\t// Find out current fontSize, fontFamily and fontClass\n\t\t\tgetParent(function(n) {\n\t\t\t\tif (n.nodeName === 'SPAN') {\n\t\t\t\t\tif (!cl && n.className)\n\t\t\t\t\t\tcl = n.className;\n\t\t\t\t}\n\n\t\t\t\tif (ed.dom.is(n, s.theme_advanced_font_selector)) {\n\t\t\t\t\tif (!fz && n.style.fontSize)\n\t\t\t\t\t\tfz = n.style.fontSize;\n\n\t\t\t\t\tif (!fn && n.style.fontFamily)\n\t\t\t\t\t\tfn = n.style.fontFamily.replace(/[\\\"\\']+/g, '').replace(/^([^,]+).*/, '$1').toLowerCase();\n\t\t\t\t\t\n\t\t\t\t\tif (!fc && n.style.color)\n\t\t\t\t\t\tfc = n.style.color;\n\n\t\t\t\t\tif (!bc && n.style.backgroundColor)\n\t\t\t\t\t\tbc = n.style.backgroundColor;\n\t\t\t\t}\n\n\t\t\t\treturn false;\n\t\t\t});\n\n\t\t\tif (c = cm.get('fontselect')) {\n\t\t\t\tc.select(function(v) {\n\t\t\t\t\treturn v.replace(/^([^,]+).*/, '$1').toLowerCase() == fn;\n\t\t\t\t});\n\t\t\t}\n\n\t\t\t// Select font size\n\t\t\tif (c = cm.get('fontsizeselect')) {\n\t\t\t\t// Use computed style\n\t\t\t\tif (s.theme_advanced_runtime_fontsize && !fz && !cl)\n\t\t\t\t\tfz = ed.dom.getStyle(n, 'fontSize', true);\n\n\t\t\t\tc.select(function(v) {\n\t\t\t\t\tif (v.fontSize && v.fontSize === fz)\n\t\t\t\t\t\treturn true;\n\n\t\t\t\t\tif (v['class'] && v['class'] === cl)\n\t\t\t\t\t\treturn true;\n\t\t\t\t});\n\t\t\t}\n\t\t\t\n\t\t\tif (s.theme_advanced_show_current_color) {\n\t\t\t\tfunction updateColor(controlId, color) {\n\t\t\t\t\tif (c = cm.get(controlId)) {\n\t\t\t\t\t\tif (!color)\n\t\t\t\t\t\t\tcolor = c.settings.default_color;\n\t\t\t\t\t\tif (color !== c.value) {\n\t\t\t\t\t\t\tc.displayColor(color);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tupdateColor('forecolor', fc);\n\t\t\t\tupdateColor('backcolor', bc);\n\t\t\t}\n\n\t\t\tif (s.theme_advanced_show_current_color) {\n\t\t\t\tfunction updateColor(controlId, color) {\n\t\t\t\t\tif (c = cm.get(controlId)) {\n\t\t\t\t\t\tif (!color)\n\t\t\t\t\t\t\tcolor = c.settings.default_color;\n\t\t\t\t\t\tif (color !== c.value) {\n\t\t\t\t\t\t\tc.displayColor(color);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t};\n\n\t\t\t\tupdateColor('forecolor', fc);\n\t\t\t\tupdateColor('backcolor', bc);\n\t\t\t}\n\n\t\t\tif (s.theme_advanced_path && s.theme_advanced_statusbar_location) {\n\t\t\t\tp = DOM.get(ed.id + '_path') || DOM.add(ed.id + '_path_row', 'span', {id : ed.id + '_path'});\n\n\t\t\t\tif (t.statusKeyboardNavigation) {\n\t\t\t\t\tt.statusKeyboardNavigation.destroy();\n\t\t\t\t\tt.statusKeyboardNavigation = null;\n\t\t\t\t}\n\n\t\t\t\tDOM.setHTML(p, '');\n\n\t\t\t\tgetParent(function(n) {\n\t\t\t\t\tvar na = n.nodeName.toLowerCase(), u, pi, ti = '';\n\n\t\t\t\t\t// Ignore non element and bogus/hidden elements\n\t\t\t\t\tif (n.nodeType != 1 || na === 'br' || n.getAttribute('data-mce-bogus') || DOM.hasClass(n, 'mceItemHidden') || DOM.hasClass(n, 'mceItemRemoved'))\n\t\t\t\t\t\treturn;\n\n\t\t\t\t\t// Handle prefix\n\t\t\t\t\tif (tinymce.isIE && n.scopeName !== 'HTML')\n\t\t\t\t\t\tna = n.scopeName + ':' + na;\n\n\t\t\t\t\t// Remove internal prefix\n\t\t\t\t\tna = na.replace(/mce\\:/g, '');\n\n\t\t\t\t\t// Handle node name\n\t\t\t\t\tswitch (na) {\n\t\t\t\t\t\tcase 'b':\n\t\t\t\t\t\t\tna = 'strong';\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 'i':\n\t\t\t\t\t\t\tna = 'em';\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 'img':\n\t\t\t\t\t\t\tif (v = DOM.getAttrib(n, 'src'))\n\t\t\t\t\t\t\t\tti += 'src: ' + v + ' ';\n\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 'a':\n\t\t\t\t\t\t\tif (v = DOM.getAttrib(n, 'name')) {\n\t\t\t\t\t\t\t\tti += 'name: ' + v + ' ';\n\t\t\t\t\t\t\t\tna += '#' + v;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif (v = DOM.getAttrib(n, 'href'))\n\t\t\t\t\t\t\t\tti += 'href: ' + v + ' ';\n\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 'font':\n\t\t\t\t\t\t\tif (v = DOM.getAttrib(n, 'face'))\n\t\t\t\t\t\t\t\tti += 'font: ' + v + ' ';\n\n\t\t\t\t\t\t\tif (v = DOM.getAttrib(n, 'size'))\n\t\t\t\t\t\t\t\tti += 'size: ' + v + ' ';\n\n\t\t\t\t\t\t\tif (v = DOM.getAttrib(n, 'color'))\n\t\t\t\t\t\t\t\tti += 'color: ' + v + ' ';\n\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 'span':\n\t\t\t\t\t\t\tif (v = DOM.getAttrib(n, 'style'))\n\t\t\t\t\t\t\t\tti += 'style: ' + v + ' ';\n\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (v = DOM.getAttrib(n, 'id'))\n\t\t\t\t\t\tti += 'id: ' + v + ' ';\n\n\t\t\t\t\tif (v = n.className) {\n\t\t\t\t\t\tv = v.replace(/\\b\\s*(webkit|mce|Apple-)\\w+\\s*\\b/g, '')\n\n\t\t\t\t\t\tif (v) {\n\t\t\t\t\t\t\tti += 'class: ' + v + ' ';\n\n\t\t\t\t\t\t\tif (DOM.isBlock(n) || na == 'img' || na == 'span')\n\t\t\t\t\t\t\t\tna += '.' + v;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tna = na.replace(/(html:)/g, '');\n\t\t\t\t\tna = {name : na, node : n, title : ti};\n\t\t\t\t\tt.onResolveName.dispatch(t, na);\n\t\t\t\t\tti = na.title;\n\t\t\t\t\tna = na.name;\n\n\t\t\t\t\t//u = \"javascript:tinymce.EditorManager.get('\" + ed.id + \"').theme._sel('\" + (de++) + \"');\";\n\t\t\t\t\tpi = DOM.create('a', {'href' : \"javascript:;\", role: 'button', onmousedown : \"return false;\", title : ti, 'class' : 'mcePath_' + (de++)}, na);\n\n\t\t\t\t\tif (p.hasChildNodes()) {\n\t\t\t\t\t\tp.insertBefore(DOM.create('span', {'aria-hidden': 'true'}, '\\u00a0\\u00bb '), p.firstChild);\n\t\t\t\t\t\tp.insertBefore(pi, p.firstChild);\n\t\t\t\t\t} else\n\t\t\t\t\t\tp.appendChild(pi);\n\t\t\t\t}, ed.getBody());\n\n\t\t\t\tif (DOM.select('a', p).length > 0) {\n\t\t\t\t\tt.statusKeyboardNavigation = new tinymce.ui.KeyboardNavigation({\n\t\t\t\t\t\troot: ed.id + \"_path_row\",\n\t\t\t\t\t\titems: DOM.select('a', p),\n\t\t\t\t\t\texcludeFromTabOrder: true,\n\t\t\t\t\t\tonCancel: function() {\
2n\t\t\t\t\t\t\ted.focus();\n\t\t\t\t\t\t}\n\t\t\t\t\t}, DOM);\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\n\t\t// Commands gets called by execCommand\n\n\t\t_sel : function(v) {\n\t\t\tthis.editor.execCommand('mceSelectNodeDepth', false, v);\n\t\t},\n\n\t\t_mceInsertAnchor : function(ui, v) {\n\t\t\tvar ed = this.editor;\n\n\t\t\ted.windowManager.open({\n\t\t\t\turl : this.url + '/anchor.htm',\n\t\t\t\twidth : 320 + parseInt(ed.getLang('advanced.anchor_delta_width', 0)),\n\t\t\t\theight : 90 + parseInt(ed.getLang('advanced.anchor_delta_height', 0)),\n\t\t\t\tinline : true\n\t\t\t}, {\n\t\t\t\ttheme_url : this.url\n\t\t\t});\n\t\t},\n\n\t\t_mceCharMap : function() {\n\t\t\tvar ed = this.editor;\n\n\t\t\ted.windowManager.open({\n\t\t\t\turl : this.url + '/charmap.htm',\n\t\t\t\twidth : 550 + parseInt(ed.getLang('advanced.charmap_delta_width', 0)),\n\t\t\t\theight : 260 + parseInt(ed.getLang('advanced.charmap_delta_height', 0)),\n\t\t\t\tinline : true\n\t\t\t}, {\n\t\t\t\ttheme_url : this.url\n\t\t\t});\n\t\t},\n\n\t\t_mceHelp : function() {\n\t\t\tvar ed = this.editor;\n\n\t\t\ted.windowManager.open({\n\t\t\t\turl : this.url + '/about.htm',\n\t\t\t\twidth : 480,\n\t\t\t\theight : 380,\n\t\t\t\tinline : true\n\t\t\t}, {\n\t\t\t\ttheme_url : this.url\n\t\t\t});\n\t\t},\n\n\t\t_mceShortcuts : function() {\n\t\t\tvar ed = this.editor;\n\t\t\ted.windowManager.open({\n\t\t\t\turl: this.url + '/shortcuts.htm',\n\t\t\t\twidth: 480,\n\t\t\t\theight: 380,\n\t\t\t\tinline: true\n\t\t\t}, {\n\t\t\t\ttheme_url: this.url\n\t\t\t});\n\t\t},\n\n\t\t_mceColorPicker : function(u, v) {\n\t\t\tvar ed = this.editor;\n\n\t\t\tv = v || {};\n\n\t\t\ted.windowManager.open({\n\t\t\t\turl : this.url + '/color_picker.htm',\n\t\t\t\twidth : 375 + parseInt(ed.getLang('advanced.colorpicker_delta_width', 0)),\n\t\t\t\theight : 250 + parseInt(ed.getLang('advanced.colorpicker_delta_height', 0)),\n\t\t\t\tclose_previous : false,\n\t\t\t\tinline : true\n\t\t\t}, {\n\t\t\t\tinput_color : v.color,\n\t\t\t\tfunc : v.func,\n\t\t\t\ttheme_url : this.url\n\t\t\t});\n\t\t},\n\n\t\t_mceCodeEditor : function(ui, val) {\n\t\t\tvar ed = this.editor;\n\n\t\t\ted.windowManager.open({\n\t\t\t\turl : this.url + '/source_editor.htm',\n\t\t\t\twidth : parseInt(ed.getParam(\"theme_advanced_source_editor_width\", 720)),\n\t\t\t\theight : parseInt(ed.getParam(\"theme_advanced_source_editor_height\", 580)),\n\t\t\t\tinline : true,\n\t\t\t\tresizable : true,\n\t\t\t\tmaximizable : true\n\t\t\t}, {\n\t\t\t\ttheme_url : this.url\n\t\t\t});\n\t\t},\n\n\t\t_mceImage : function(ui, val) {\n\t\t\tvar ed = this.editor;\n\n\t\t\t// Internal image object like a flash placeholder\n\t\t\tif (ed.dom.getAttrib(ed.selection.getNode(), 'class').indexOf('mceItem') != -1)\n\t\t\t\treturn;\n\n\t\t\ted.windowManager.open({\n\t\t\t\turl : this.url + '/image.htm',\n\t\t\t\twidth : 355 + parseInt(ed.getLang('advanced.image_delta_width', 0)),\n\t\t\t\theight : 275 + parseInt(ed.getLang('advanced.image_delta_height', 0)),\n\t\t\t\tinline : true\n\t\t\t}, {\n\t\t\t\ttheme_url : this.url\n\t\t\t});\n\t\t},\n\n\t\t_mceLink : function(ui, val) {\n\t\t\tvar ed = this.editor;\n\n\t\t\ted.windowManager.open({\n\t\t\t\turl : this.url + '/link.htm',\n\t\t\t\twidth : 310 + parseInt(ed.getLang('advanced.link_delta_width', 0)),\n\t\t\t\theight : 200 + parseInt(ed.getLang('advanced.link_delta_height', 0)),\n\t\t\t\tinline : true\n\t\t\t}, {\n\t\t\t\ttheme_url : this.url\n\t\t\t});\n\t\t},\n\n\t\t_mceNewDocument : function() {\n\t\t\tvar ed = this.editor;\n\n\t\t\ted.windowManager.confirm('advanced.newdocument', function(s) {\n\t\t\t\tif (s)\n\t\t\t\t\ted.execCommand('mceSetContent', false, '');\n\t\t\t});\n\t\t},\n\n\t\t_mceForeColor : function() {\n\t\t\tvar t = this;\n\n\t\t\tthis._mceColorPicker(0, {\n\t\t\t\tcolor: t.fgColor,\n\t\t\t\tfunc : function(co) {\n\t\t\t\t\tt.fgColor = co;\n\t\t\t\t\tt.editor.execCommand('ForeColor', false, co);\n\t\t\t\t}\n\t\t\t});\n\t\t},\n\n\t\t_mceBackColor : function() {\n\t\t\tvar t = this;\n\n\t\t\tthis._mceColorPicker(0, {\n\t\t\t\tcolor: t.bgColor,\n\t\t\t\tfunc : function(co) {\n\t\t\t\t\tt.bgColor = co;\n\t\t\t\t\tt.editor.execCommand('HiliteColor', false, co);\n\t\t\t\t}\n\t\t\t});\n\t\t},\n\n\t\t_ufirst : function(s) {\n\t\t\treturn s.substring(0, 1).toUpperCase() + s.substring(1);\n\t\t}\n\t});\n\n\ttinymce.ThemeManager.add('advanced', tinymce.themes.AdvancedTheme);\n}(tinymce));\n","Potato_Zendesk/js/tiny_mce/themes/advanced/js/about.js":"tinyMCEPopup.requireLangPack();
2\n\nfunction init() {\n\tvar ed, tcont;\n\n\ttinyMCEPopup.resizeToInnerSize();\n\ted = tinyMCEPopup.editor;\n\n\t// Give FF some time\n\twindow.setTimeout(insertHelpIFrame, 10);\n\n\ttcont = document.getElementById('plugintablecontainer');\n\tdocument.getElementById('plugins_tab').style.display = 'none';\n\n\tvar html = \"\";\n\thtml += '<table id=\"plugintable\">';\n\thtml += '<thead>';\n\thtml += '<tr>';\n\thtml += '<td>' + ed.getLang('advanced_dlg.about_plugin') + '</td>';\n\thtml += '<td>' + ed.getLang('advanced_dlg.about_author') + '</td>';\n\thtml += '<td>' + ed.getLang('advanced_dlg.about_version') + '</td>';\n\thtml += '</tr>';\n\thtml += '</thead>';\n\thtml += '<tbody>';\n\n\ttinymce.each(ed.plugins, function(p, n) {\n\t\tvar info;\n\n\t\tif (!p.getInfo)\n\t\t\treturn;\n\n\t\thtml += '<tr>';\n\n\t\tinfo = p.getInfo();\n\n\t\tif (info.infourl != null && info.infourl != '')\n\t\t\thtml += '<td width=\"50%\" title=\"' + n + '\"><a href=\"' + info.infourl + '\" target=\"_blank\">' + info.longname + '</a></td>';\n\t\telse\n\t\t\thtml += '<td width=\"50%\" title=\"' + n + '\">' + info.longname + '</td>';\n\n\t\tif (info.authorurl != null && info.authorurl != '')\n\t\t\thtml += '<td width=\"35%\"><a href=\"' + info.authorurl + '\" target=\"_blank\">' + info.author + '</a></td>';\n\t\telse\n\t\t\thtml += '<td width=\"35%\">' + info.author + '</td>';\n\n\t\thtml += '<td width=\"15%\">' + info.version + '</td>';\n\t\thtml += '</tr>';\n\n\t\tdocument.getElementById('plugins_tab').style.display = '';\n\n\t});\n\n\thtml += '</tbody>';\n\thtml += '</table>';\n\n\ttcont.innerHTML = html;\n\n\ttinyMCEPopup.dom.get('version').innerHTML = tinymce.majorVersion + \".\" + tinymce.minorVersion;\n\ttinyMCEPopup.dom.get('date').innerHTML = tinymce.releaseDate;\n}\n\nfunction insertHelpIFrame() {\n\tvar html;\n\n\tif (tinyMCEPopup.getParam('docs_url')) {\n\t\thtml = '<iframe width=\"100%\" height=\"300\" src=\"' + tinyMCEPopup.editor.baseURI.toAbsolute(tinyMCEPopup.getParam('docs_url')) + '\"></iframe>';\n\t\tdocument.getElementById('iframecontainer').innerHTML = html;\n\t\tdocument.getElementById('help_tab').style.display = 'block';\n\t\tdocument.getElementById('help_tab').setAttribute(\"aria-hidden\", \"false\");\n\t}\n}\n\ntinyMCEPopup.onInit.add(init);\n","Potato_Zendesk/js/tiny_mce/themes/advanced/js/anchor.js":"tinyMCEPopup.requireLangPack();\n\nvar AnchorDialog = {\n\tinit : function(ed) {\n\t\tvar action, elm, f = document.forms[0];\n\n\t\tthis.editor = ed;\n\t\telm = ed.dom.getParent(ed.selection.getNode(), 'A');\n\t\tv = ed.dom.getAttrib(elm, 'name');\n\n\t\tif (v) {\n\t\t\tthis.action = 'update';\n\t\t\tf.anchorName.value = v;\n\t\t}\n\n\t\tf.insert.value = ed.getLang(elm ? 'update' : 'insert');\n\t},\n\n\tupdate : function() {\n\t\tvar ed = this.editor, elm, name = document.forms[0].anchorName.value;\n\n\t\tif (!name || !/^[a-z][a-z0-9\\-\\_:\\.]*$/i.test(name)) {\
2n\t\t\ttinyMCEPopup.alert('advanced_dlg.anchor_invalid');\n\t\t\treturn;\n\t\t}\n\n\t\ttinyMCEPopup.restoreSelection();\n\n\t\tif (this.action != 'update')\n\t\t\ted.selection.collapse(1);\n\n\t\telm = ed.dom.getParent(ed.selection.getNode(), 'A');\n\t\tif (elm) {\n\t\t\telm.setAttribute('name', name);\n\t\t\telm.name = name;\n\t\t} else\n\t\t\ted.execCommand('mceInsertContent', 0, ed.dom.createHTML('a', {name : name, 'class' : 'mceItemAnchor'}, ''));\n\n\t\ttinyMCEPopup.close();\n\t}\n};\n\ntinyMCEPopup.onInit.add(AnchorDialog.init, AnchorDialog);\n","Potato_Zendesk/js/tiny_mce/themes/advanced/js/charmap.js":"/**\n * charmap.js\n *\n * Copyright 2009, Moxiecode Systems AB\n * Released under LGPL License.\n *\n * License: http://tinymce.moxiecode.com/license\n * Contributing: http://tinymce.moxiecode.com/contributing\n */\n\ntinyMCEPopup.requireLangPack();\n\nvar charmap = [\n\t['&nbsp;',    '&#160;',  true, 'no-break space'],\n\t['&amp;',     '&#38;',   true, 'ampersand'],\n\t['&quot;',    '&#34;',   true, 'quotation mark'],\n// finance\n\t['&cent;',    '&#162;',  true, 'cent sign'],\n\t['&euro;',    '&#8364;', true, 'euro sign'],\n\t['&pound;',   '&#163;',  true, 'pound sign'],\n\t['&yen;',     '&#165;',  true, 'yen sign'],\n// signs\n\t['&copy;',    '&#169;',  true, 'copyright sign'],\n\t['&reg;',     '&#174;',  true, 'registered sign'],\n\t['&trade;',   '&#8482;', true, 'trade mark sign'],\n\t['&permil;',  '&#8240;', true, 'per mille sign'],\n\t['&micro;',   '&#181;',  true, 'micro sign'],\n\t['&middot;',  '&#183;',  true, 'middle dot'],\n\t['&bull;',    '&#8226;', true, 'bullet'],\n\t['&hellip;',  '&#8230;', true, 'three dot leader'],\n\t['&prime;',   '&#8242;', true, 'minutes / feet'],\n\t['&Prime;',   '&#8243;', true, 'seconds / inches'],\n\t['&sect;',    '&#167;',  true, 'section sign'],\n\t['&para;',    '&#182;',  true, 'paragraph sign'],\n\t['&szlig;',   '&#223;',  true, 'sharp s / ess-zed'],\n// quotations\n\t['&lsaquo;',  '&#8249;', true, 'single left-pointing angle quotation mark'],\n\t['&rsaquo;',  '&#8250;', true, 'single right-pointing angle quotation mark'],\n\t['&laquo;',   '&#171;',  true, 'left pointing guillemet'],\n\t['&raquo;',   '&#187;',  true, 'right pointing guillemet'],\n\t['&lsquo;',   '&#8216;', true, 'left single quotation mark'],\n\t['&rsquo;',   '&#8217;', true, 'right single quotation mark'],\n\t['&ldquo;',   '&#8220;', true, 'left double quotation mark'],\n\t['&rdquo;',   '&#8221;', true, 'right double quotation mark'],\n\t['&sbquo;',   '&#8218;', true, 'single low-9 quotation mark'],\n\t['&bdquo;',   '&#8222;', true, 'double low-9 quotation mark'],\n\t['&lt;',      '&#60;',   true, 'less-than sign'],\n\t['&gt;',      '&#62;',   true, 'greater-than sign'],\n\t['&le;',      '&#8804;', true, 'less-than or equal to'],\n\t['&ge;',      '&#8805;', true, 'greater-than or equal to'],\n\t['&ndash;',   '&#8211;', true, 'en dash'],\n\t['&mdash;',   '&#8212;', true, 'em dash'],\n\t['&macr;',    '&#175;',  true, 'macron'],\n\t['&oline;',   '&#8254;', true, 'overline'],\n\t['&curren;',  '&#164;',  true, 'currency sign'],\n\t['&brvbar;',  '&#166;',  true, 'broken bar'],\n\t['&uml;',     '&#168;',  true, 'diaeresis'],\n\t['&iexcl;',   '&#161;',  true, 'inverted exclamation mark'],\n\t['&iquest;',  '&#191;',  true, 'turned question mark'],\n\t['&circ;',    '&#710;',  true, 'circumflex accent'],\n\t['&tilde;',   '&#732;',  true, 'small tilde'],\n\t['&deg;',     '&#176;',  true, 'degree sign'],\n\t['&minus;',   '&#8722;', true, 'minus sign'],\n\t['&plusmn;',  '&#177;',  true, 'plus-minus sign'],\n\t['&divide;',  '&#247;',  true, 'division sign'],\n\t['&frasl;',   '&#8260;', true, 'fraction slash'],\n\t['&times;',   '&#215;',  true, 'multiplication sign'],\n\t['&sup1;',    '&#185;',  true, 'superscript one'],\n\t['&sup2;',    '&#178;',  true, 'superscript two'],\n\t['&sup3;',    '&#179;',  true, 'superscript three'],\n\t['&frac14;',  '&#188;',  true, 'fraction one quarter'],\n\t['&frac12;',  '&#189;',  true, 'fraction one half'],\n\t['&frac34;',  '&#190;',  true, 'fraction three quarters'],\n// math / logical\n\t['&fnof;',    '&#402;',  true, 'function / florin'],\n\t['&int;',     '&#8747;', true, 'integral'],\n\t['&sum;',     '&#8721;', true, 'n-ary sumation'],\n\t['&infin;',   '&#8734;', true, 'infinity'],\n\t['&radic;',   '&#8730;', true, 'square root'],\n\t['&sim;',     '&#8764;', false,'similar to'],\n\t['&cong;',    '&#8773;', false,'approximately equal to'],\n\t['&asymp;',   '&#8776;', true, 'almost equal to'],\n\t['&ne;',      '&#8800;', true, 'not equal to'],\n\t['&equiv;',   '&#8801;', true, 'identical to'],\n\t['&isin;',    '&#8712;', false,'element of'],\n\t['&notin;',   '&#8713;', false,'not an element of'],\n\t['&ni;',      '&#8715;', false,'contains as member'],\n\t['&prod;',    '&#8719;', true, 'n-ary product'],\n\t['&and;',     '&#8743;', false,'logical and'],\n\t['&or;',      '&#8744;', false,'logical or'],\n\t['&not;',     '&#172;',  true, 'not sign'],\n\t['&cap;',     '&#8745;', true, 'intersection'],\n\t['&cup;',     '&#8746;', false,'union'],\n\t['&part;',    '&#8706;', true, 'partial differential'],\n\t['&forall;',  '&#8704;', false,'for all'],\n\t['&exist;',   '&#8707;', false,'there exists'],\n\t['&empty;',   '&#8709;', false,'diameter'],\n\t['&nabla;',   '&#8711;', false,'backward difference'],\n\t['&lowast;',  '&#8727;', false,'asterisk operator'],\n\t['&prop;',    '&#8733;', false,'proportional to'],\n\t['&ang;',     '&#8736;', false,'angle'],\n// undefined\n\t['&acute;',   '&#180;',  true, 'acute accent'],\n\t['&cedil;',   '&#184;',  true, 'cedilla'],\n\t['&ordf;',    '&#170;',  true, 'feminine ordinal indicator'],\n\t['&ordm;',    '&#186;',  true, 'masculine ordinal indicator'],\n\t['&dagger;',  '&#8224;', true, 'dagger'],\n\t['&Dagger;',  '&#8225;', true, 'double dagger'],\n// alphabetical special chars\n\t['&Agrave;',  '&#192;',  true, 'A - grave'],\n\t['&Aacute;',  '&#193;',  true, 'A - acute'],\n\t['&Acirc;',   '&#194;',  true, 'A - circumflex'],\n\t['&Atilde;',  '&#195;',  true, 'A - tilde'],\n\t['&Auml;',    '&#196;',  true, 'A - diaeresis'],\n\t['&Aring;',   '&#197;',  true, 'A - ring above'],\n\t['&AElig;',   '&#198;',  true, 'ligature AE'],\n\t['&Ccedil;',  '&#199;',  true, 'C - cedilla'],\n\t['&Egrave;',  '&#200;',  true, 'E - grave'],\n\t['&Eacute;',  '&#201;',  true, 'E - acute'],\n\t['&Ecirc;',   '&#202;',  true, 'E - circumflex'],\n\t['&Euml;',    '&#203;',  true, 'E - diaeresis'],\n\t['&Igrave;',  '&#204;',  true, 'I - grave'],\n\t['&Iacute;',  '&#205;',  true, 'I - acute'],\n\t['&Icirc;',   '&#206;',  true, 'I - circumflex'],\n\t['&Iuml;',    '&#207;',  true, 'I - diaeresis'],\n\t['&ETH;',     '&#208;',  true, 'ETH'],\n\t['&Ntilde;',  '&#209;',  true, 'N - tilde'],\n\t['&Ograve;',  '&#210;',  true, 'O - grave'],\n\t['&Oacute;',  '&#211;',  true, 'O - acute'],\n\t['&Ocirc;',   '&#212;',  true, 'O - circumflex'],\n\t['&Otilde;',  '&#213;',  true, 'O - tilde'],\n\t['&Ouml;',    '&#214;',  true, 'O - diaeresis'],\n\t['&Oslash;',  '&#216;',  true, 'O - slash'],\n\t['&OElig;',   '&#338;',  true, 'ligature OE'],\n\t['&Scaron;',  '&#352;',  true, 'S - caron'],\n\t['&Ugrave;',  '&#217;',  true, 'U - grave'],\n\t['&Uacute;',  '&#218;',  true, 'U - acute'],\n\t['&Ucirc;',   '&#219;',  true, 'U - circumflex'],\n\t['&Uuml;',    '&#220;',  true, 'U - diaeresis'],\n\t['&Yacute;',  '&#221;',  true, 'Y - acute'],\n\t['&Yuml;',    '&#376;',  true, 'Y - diaeresis'],\n\t['&THORN;',   '&#222;',  true, 'THORN'],\n\t['&agrave;',  '&#224;',  true, 'a - grave'],\n\t['&aacute;',  '&#225;',  true, 'a - acute'],\n\t['&acirc;',   '&#226;',  true, 'a - circumflex'],\n\t['&atilde;',  '&#227;',  true, 'a - tilde'],\n\t['&auml;',    '&#228;',  true, 'a - diaeresis'],\n\t['&aring;',   '&#229;',  true, 'a - ring above'],\n\t['&aelig;',   '&#230;',  true, 'ligature ae'],\n\t['&ccedil;',  '&#231;',  true, 'c - cedilla'],\n\t['&egrave;',  '&#232;',  true, 'e - grave'],\n\t['&eacute;',  '&#233;',  true, 'e - acute'],\n\t['&ecirc;',   '&#234;',  true, 'e - circumflex'],\n\t['&euml;',    '&#235;',  true, 'e - diaeresis'],\n\t['&igrave;',  '&#236;',  true, 'i - grave'],\n\t['&iacute;',  '&#237;',  true, 'i - acute'],\n\t['&icirc;',   '&#238;',  true, 'i - circumflex'],\n\t['&iuml;',    '&#239;',  true, 'i - diaeresis'],\n\t['&eth;',     '&#240;',  true, 'eth'],\n\t['&ntilde;',  '&#241;',  true, 'n - tilde'],\n\t['&ograve;',  '&#242;',  true, 'o - grave'],\n\t['&oacute;',  '&#243;',  true, 'o - acute'],\n\t['&ocirc;',   '&#244;',  true, 'o - circumflex'],\n\t['&otilde;',  '&#245;',  true, 'o - tilde'],\n\t['&ouml;',    '&#246;',  true, 'o - diaeresis'],\n\t['&oslash;',  '&#248;',  true, 'o slash'],\n\t['&oelig;',   '&#339;',  true, 'ligature oe'],\n\t['&scaron;',  '&#353;',  true, 's - caron'],\n\t['&ugrave;',  '&#249;',  true, 'u - grave'],\n\t['&uacute;',  '&#250;',  true, 'u - acute'],\n\t['&ucirc;',   '&#251;',  true, 'u - circumflex'],\n\t['&uuml;',    '&#252;',  true, 'u - diaeresis'],\n\t['&yacute;',  '&#253;',  true, 'y - acute'],\n\t['&thorn;',   '&#254;',  true, 'thorn'],\n\t['&yuml;',    '&#255;',  true, 'y - diaeresis'],\n\t['&Alpha;',   '&#913;',  true, 'Alpha'],\n\t['&Beta;',    '&#914;',  true, 'Beta'],\n\t['&Gamma;',   '&#915;',  true, 'Gamma'],\n\t['&Delta;',   '&#916;',  true, 'Delta'],\n\t['&Epsilon;', '&#917;',  true, 'Epsilon'],\n\t['&Zeta;',    '&#918;',  true, 'Zeta'],\n\t['&Eta;',     '&#919;',  true, 'Eta'],\n\t['&Theta;',   '&#920;',  true, 'Theta'],\n\t['&Iota;',    '&#921;',  true, 'Iota'],\n\t['&Kappa;',   '&#922;',  true, 'Kappa'],\n\t['&Lambda;',  '&#923;',  true, 'Lambda'],\n\t['&Mu;',      '&#924;',  true, 'Mu'],\n\t['&Nu;',      '&#925;',  true, 'Nu'],\n\t['&Xi;',      '&#926;',  true, 'Xi'],\n\t['&Omicron;', '&#927;',  true, 'Omicron'],\n\t['&Pi;',      '&#928;',  true, 'Pi'],\n\t['&Rho;',     '&#929;',  true, 'Rho'],\n\t['&Sigma;',   '&#931;',  true, 'Sigma'],\n\t['&Tau;',     '&#932;',  true, 'Tau'],\n\t['&Upsilon;', '&#933;',  true, 'Upsilon'],\n\t['&Phi;',     '&#934;',  true, 'Phi'],\n\t['&Chi;',     '&#935;',  true, 'Chi'],\n\t['&Psi;',     '&#936;',  true, 'Psi'],\n\t['&Omega;',   '&#937;',  true, 'Omega'],\n\t['&alpha;',   '&#945;',  true, 'alpha'],\n\t['&beta;',    '&#946;',  true, 'beta'],\n\t['&gamma;',   '&#947;',  true, 'gamma'],\n\t['&delta;',   '&#948;',  true, 'delta'],\n\t['&epsilon;', '&#949;',  true, 'epsilon'],\n\t['&zeta;',    '&#950;',  true, 'zeta'],\n\t['&eta;',     '&#951;',  true, 'eta'],\n\t['&theta;',   '&#952;',  true, 'theta'],\n\t['&iota;',    '&#953;',  true, 'iota'],\n\t['&kappa;',   '&#954;',  true, 'kappa'],\n\t['&lambda;',  '&#955;',  true, 'lambda'],\n\t['&mu;',      '&#956;',  true, 'mu'],\n\t['&nu;',      '&#957;',  true, 'nu'],\n\t['&xi;',      '&#958;',  true, 'xi'],\n\t['&omicron;', '&#959;',  true, 'omicron'],\n\t['&pi;',      '&#960;',  true, 'pi'],\n\t['&rho;',     '&#961;',  true, 'rho'],\n\t['&sigmaf;',  '&#962;',  true, 'final sigma'],\n\t['&sigma;',   '&#963;',  true, 'sigma'],\n\t['&tau;',     '&#964;',  true, 'tau'],\n\t['&upsilon;', '&#965;',  true, 'upsilon'],\n\t['&phi;',     '&#966;',  true, 'phi'],\n\t['&chi;',     '&#967;',  true, 'chi'],\n\t['&psi;',     '&#968;',  true, 'psi'],\n\t['&omega;',   '&#969;',  true, 'omega'],\n// symbols\n\t['&alefsym;', '&#8501;', false,'alef symbol'],\n\t['&piv;',     '&#982;',  false,'pi symbol'],\n\t['&real;',    '&#8476;', false,'real part symbol'],\n\t['&thetasym;','&#977;',  false,'theta symbol'],\n\t['&upsih;',   '&#978;',  false,'upsilon - hook symbol'],\n\t['&weierp;',  '&#8472;', false,'Weierstrass p'],\n\t['&image;',   '&#8465;', false,'imaginary part'],\n// arrows\n\t['&larr;',    '&#8592;', true, 'leftwards arrow'],\n\t['&uarr;',    '&#8593;', true, 'upwards arrow'],\n\t['&rarr;',    '&#8594;', true, 'rightwards arrow'],\n\t['&darr;',    '&#8595;', true, 'downwards arrow'],\n\t['&harr;',    '&#8596;', true, 'left right arrow'],\n\t['&crarr;',   '&#8629;', false,'carriage return'],\n\t['&lArr;',    '&#8656;', false,'leftwards double arrow'],\n\t['&uArr;',    '&#8657;', false,'upwards double arrow'],\n\t['&rArr;',    '&#8658;', false,'rightwards double arrow'],\n\t['&dArr;',    '&#8659;', false,'downwards double arrow'],\n\t['&hArr;',    '&#8660;', false,'left right double arrow'],\n\t['&there4;',  '&#8756;', false,'therefore'],\n\t['&sub;',     '&#8834;', false,'subset of'],\n\t['&sup;',     '&#8835;', false,'superset of'],\n\t['&nsub;',    '&#8836;', false,'not a subset of'],\n\t['&sube;',    '&#8838;', false,'subset of or equal to'],\n\t['&supe;',    '&#8839;', false,'superset of or equal to'],\n\t['&oplus;',   '&#8853;', false,'circled plus'],\n\t['&otimes;',  '&#8855;', false,'circled times'],\n\t['&perp;',    '&#8869;', false,'perpendicular'],\n\t['&sdot;',    '&#8901;', false,'dot operator'],\n\t['&lceil;',   '&#8968;', false,'left ceiling'],\n\t['&rceil;',   '&#8969;', false,'right ceiling'],\n\t['&lfloor;',  '&#8970;', false,'left floor'],\n\t['&rfloor;',  '&#8971;', false,'right floor'],\n\t['&lang;',    '&#9001;', false,'left-pointing angle bracket'],\n\t['&rang;',    '&#9002;', false,'right-pointing angle bracket'],\n\t['&loz;',     '&#9674;', true, 'lozenge'],\n\t['&spades;',  '&#9824;', true, 'black spade suit'],\n\t['&clubs;',   '&#9827;', true, 'black club suit'],\n\t['&hearts;',  '&#9829;', true, 'black heart suit'],\n\t['&diams;',   '&#9830;', true, 'black diamond suit'],\n\t['&ensp;',    '&#8194;', false,'en space'],\n\t['&emsp;',    '&#8195;', false,'em space'],\n\t['&thinsp;',  '&#8201;
2', false,'thin space'],\n\t['&zwnj;',    '&#8204;', false,'zero width non-joiner'],\n\t['&zwj;',     '&#8205;', false,'zero width joiner'],\n\t['&lrm;',     '&#8206;', false,'left-to-right mark'],\n\t['&rlm;',     '&#8207;', false,'right-to-left mark'],\n\t['&shy;',     '&#173;',  false,'soft hyphen']\n];\n\ntinyMCEPopup.onInit.add(function() {\n\ttinyMCEPopup.dom.setHTML('charmapView', renderCharMapHTML());\n\taddKeyboardNavigation();\n});\n\nfunction addKeyboardNavigation(){\n\tvar tableElm, cells, settings;\n\n\tcells = tinyMCEPopup.dom.select(\"a.charmaplink\", \"charmapgroup\");\n\n\tsettings ={\n\t\troot: \"charmapgroup\",\n\t\titems: cells\n\t};\n\tcells[0].tabindex=0;\n\ttinyMCEPopup.dom.addClass(cells[0], \"mceFocus\");\n\tif (tinymce.isGecko) {\n\t\tcells[0].focus();\t\t\n\t} else {\n\t\tsetTimeout(function(){\n\t\t\tcells[0].focus();\n\t\t}, 100);\n\t}\n\ttinyMCEPopup.editor.windowManager.createInstance('tinymce.ui.KeyboardNavigation', settings, tinyMCEPopup.dom);\n}\n\nfunction renderCharMapHTML() {\n\tvar charsPerRow = 20, tdWidth=20, tdHeight=20, i;\n\tvar html = '<div id=\"charmapgroup\" aria-labelledby=\"charmap_label\" tabindex=\"0\" role=\"listbox\">'+\n\t'<table role=\"presentation\" border=\"0\" cellspacing=\"1\" cellpadding=\"0\" width=\"' + (tdWidth*charsPerRow) + \n\t'\"><tr height=\"' + tdHeight + '\">';\n\tvar cols=-1;\n\n\tfor (i=0; i<charmap.length; i++) {\n\t\tvar previewCharFn;\n\n\t\tif (charmap[i][2]==true) {\n\t\t\tcols++;\n\t\t\tpreviewCharFn = 'previewChar(\\'' + charmap[i][1].substring(1,charmap[i][1].length) + '\\',\\'' + charmap[i][0].substring(1,charmap[i][0].length) + '\\',\\'' + charmap[i][3] + '\\');';\n\t\t\thtml += ''\n\t\t\t\t+ '<td class=\"charmap\">'\n\t\t\t\t+ '<a class=\"charmaplink\" role=\"button\" onmouseover=\"'+previewCharFn+'\" onfocus=\"'+previewCharFn+'\" href=\"javascript:void(0)\" onclick=\"insertChar(\\'' + charmap[i][1].substring(2,charmap[i][1].length-1) + '\\');\" onclick=\"return false;\" onmousedown=\"return false;\" title=\"' + charmap[i][3] + ' '+ tinyMCEPopup.editor.translate(\"advanced_dlg.charmap_usage\")+'\">'\n\t\t\t\t+ charmap[i][1]\n\t\t\t\t+ '</a></td>';\n\t\t\tif ((cols+1) % charsPerRow == 0)\n\t\t\t\thtml += '</tr><tr height=\"' + tdHeight + '\">';\n\t\t}\n\t }\n\n\tif (cols % charsPerRow > 0) {\n\t\tvar padd = charsPerRow - (cols % charsPerRow);\n\t\tfor (var i=0; i<padd-1; i++)\n\t\t\thtml += '<td width=\"' + tdWidth + '\" height=\"' + tdHeight + '\" class=\"charmap\">&nbsp;</td>';\n\t}\n\n\thtml += '</tr></table></div>';\n\thtml = html.replace(/<tr height=\"20\"><\\/tr>/g, '');\n\n\treturn html;\n}\n\nfunction insertChar(chr) {\n\ttinyMCEPopup.execCommand('mceInsertContent', false, '&#' + chr + ';');\n\n\t// Refocus in window\n\tif (tinyMCEPopup.isWindow)\n\t\twindow.focus();\n\n\ttinyMCEPopup.editor.focus();\n\ttinyMCEPopup.close();\n}\n\nfunction previewChar(codeA, codeB, codeN) {\n\tvar elmA = document.getElementById('codeA');\n\tvar elmB = document.getElementById('codeB');\n\tvar elmV = document.getElementById('codeV');\n\tvar elmN = document.getElementById('codeN');\n\n\tif (codeA=='#160;') {\n\t\telmV.innerHTML = '__';\n\t} else {\n\t\telmV.innerHTML = '&' + codeA;\n\t}\n\n\telmB.innerHTML = '&amp;' + codeA;\n\telmA.innerHTML = '&amp;' + codeB;\n\telmN.innerHTML = codeN;\n}\n","Potato_Zendesk/js/tiny_mce/themes/advanced/js/color_picker.js":"tinyMCEPopup.requireLangPack();\n\nvar detail = 50, strhex = \"0123456789abcdef\", i, isMouseDown = false, isMouseOver = false;\n\nvar colors = [\n\t\"#000000\",\"#000033\",\"#000066\",\"#000099\",\"#0000cc\",\"#0000ff\",\"#330000\",\"#330033\",\n\t\"#330066\",\"#330099\",\"#3300cc\",\"#3300ff\",\"#660000\",\"#660033\",\"#660066\",\"#660099\",\n\t\"#6600cc\",\"#6600ff\",\"#990000\",\"#990033\",\"#990066\",\"#990099\",\"#9900cc\",\"#9900ff\",\n\t\"#cc0000\",\"#cc0033\",\"#cc0066\",\"#cc0099\",\"#cc00cc\",\"#cc00ff\",\"#ff0000\",\"#ff0033\",\n\t\"#ff0066\",\"#ff0099\",\"#ff00cc\",\"#ff00ff\",\"#003300\",\"#003333\",\"#003366\",\"#003399\",\n\t\"#0033cc\",\"#0033ff\",\"#333300\",\"#333333\",\"#333366\",\"#333399\",\"#3333cc\",\"#3333ff\",\n\t\"#663300\",\"#663333\",\"#663366\",\"#663399\",\"#6633cc\",\"#6633ff\",\"#993300\",\"#993333\",\n\t\"#993366\",\"#993399\",\"#9933cc\",\"#9933ff\",\"#cc3300\",\"#cc3333\",\"#cc3366\",\"#cc3399\",\n\t\"#cc33cc\",\"#cc33ff\",\"#ff3300\",\"#ff3333\",\"#ff3366\",\"#ff3399\",\"#ff33cc\",\"#ff33ff\",\n\t\"#006600\",\"#006633\",\"#006666\",\"#006699\",\"#0066cc\",\"#0066ff\",\"#336600\",\"#336633\",\n\t\"#336666\",\"#336699\",\"#3366cc\",\"#3366ff\",\"#666600\",\"#666633\",\"#666666\",\"#666699\",\n\t\"#6666cc\",\"#6666ff\",\"#996600\",\"#996633\",\"#996666\",\"#996699\",\"#9966cc\",\"#9966ff\",\n\t\"#cc6600\",\"#cc6633\",\"#cc6666\",\"#cc6699\",\"#cc66cc\",\"#cc66ff\",\"#ff6600\",\"#ff6633\",\n\t\"#ff6666\",\"#ff6699\",\"#ff66cc\",\"#ff66ff\",\"#009900\",\"#009933\",\"#009966\",\"#009999\",\n\t\"#0099cc\",\"#0099ff\",\"#339900\",\"#339933\",\"#339966\",\"#339999\",\"#3399cc\",\"#3399ff\",\n\t\"#669900\",\"#669933\",\"#669966\",\"#669999\",\"#6699cc\",\"#6699ff\",\"#999900\",\"#999933\",\n\t\"#999966\",\"#999999\",\"#9999cc\",\"#9999ff\",\"#cc9900\",\"#cc9933\",\"#cc9966\",\"#cc9999\",\n\t\"#cc99cc\",\"#cc99ff\",\"#ff9900\",\"#ff9933\",\"#ff9966\",\"#ff9999\",\"#ff99cc\",\"#ff99ff\",\n\t\"#00cc00\",\"#00cc33\",\"#00cc66\",\"#00cc99\",\"#00cccc\",\"#00ccff\",\"#33cc00\",\"#33cc33\",\n\t\"#33cc66\",\"#33cc99\",\"#33cccc\",\"#33ccff\",\"#66cc00\",\"#66cc33\",\"#66cc66\",\"#66cc99\",\n\t\"#66cccc\",\"#66ccff\",\"#99cc00\",\"#99cc33\",\"#99cc66\",\"#99cc99\",\"#99cccc\",\"#99ccff\",\n\t\"#cccc00\",\"#cccc33\",\"#cccc66\",\"#cccc99\",\"#cccccc\",\"#ccccff\",\"#ffcc00\",\"#ffcc33\",\n\t\"#ffcc66\",\"#ffcc99\",\"#ffcccc\",\"#ffccff\",\"#00ff00\",\"#00ff33\",\"#00ff66\",\"#00ff99\",\n\t\"#00ffcc\",\"#00ffff\",\"#33ff00\",\"#33ff33\",\"#33ff66\",\"#33ff99\",\"#33ffcc\",\"#33ffff\",\n\t\"#66ff00\",\"#66ff33\",\"#66ff66\",\"#66ff99\",\"#66ffcc\",\"#66ffff\",\"#99ff00\",\"#99ff33\",\n\t\"#99ff66\",\"#99ff99\",\"#99ffcc\",\"#99ffff\",\"#ccff00\",\"#ccff33\",\"#ccff66\",\"#ccff99\",\n\t\"#ccffcc\",\"#ccffff\",\"#ffff00\",\"#ffff33\",\"#ffff66\",\"#ffff99\",\"#ffffcc\",\"#ffffff\"\n];\n\nvar named = {\n\t'#F0F8FF':'Alice Blue','#FAEBD7':'Antique White','#00FFFF':'Aqua','#7FFFD4':'Aquamarine','#F0FFFF':'Azure','#F5F5DC':'Beige',\n\t'#FFE4C4':'Bisque','#000000':'Black','#FFEBCD':'Blanched Almond','#0000FF':'Blue','#8A2BE2':'Blue Violet','#A52A2A':'Brown',\n\t'#DEB887':'Burly Wood','#5F9
2EA0':'Cadet Blue','#7FFF00':'Chartreuse','#D2691E':'Chocolate','#FF7F50':'Coral','#6495ED':'Cornflower Blue',\n\t'#FFF8DC':'Cornsilk','#DC143C':'Crimson','#00FFFF':'Cyan','#00008B':'Dark Blue','#008B8B':'Dark Cyan','#B8860B':'Dark Golden Rod',\n\t'#A9A9A9':'Dark Gray','#A9A9A9':'Dark Grey','#006400':'Dark Green','#BDB76B':'Dark Khaki','#8B008B':'Dark Magenta','#556B2F':'Dark Olive Green',\n\t'#FF8C00':'Darkorange','#9932CC':'Dark Orchid','#8B0000':'Dark Red','#E9967A':'Dark Salmon','#8FBC8F':'Dark Sea Green','#483D8B':'Dark Slate Blue',\n\t'#2F4F4F':'Dark Slate Gray','#2F4F4F':'Dark Slate Grey','#00CED1':'Dark Turquoise','#9400D3':'Dark Violet','#FF1493':'Deep Pink','#00BFFF':'Deep Sky Blue',\n\t'#696969':'Dim Gray','#696969':'Dim Grey','#1E90FF':'Dodger Blue','#B22222':'Fire Brick','#FFFAF0':'Floral White','#228B22':'Forest Green',\n\t'#FF00FF':'Fuchsia','#DCDCDC':'Gainsboro','#F8F8FF':'Ghost White','#FFD700':'Gold','#DAA520':'Golden Rod','#808080':'Gray','#808080':'Grey',\n\t'#008000':'Green','#ADFF2F':'Green Yellow','#F0FFF0':'Honey Dew','#FF69B4':'Hot Pink','#CD5C5C':'Indian Red','#4B0082':'Indigo','#FFFFF0':'Ivory',\n\t'#F0E68C':'Khaki','#E6E6FA':'Lavender','#FFF0F5':'Lavender Blush','#7CFC00':'Lawn Green','#FFFACD':'Lemon Chiffon','#ADD8E6':'Light Blue',\n\t'#F08080':'Light Coral','#E0FFFF':'Light Cyan','#FAFAD2':'Light Golden Rod Yellow','#D3D3D3':'Light Gray','#D3D3D3':'Light Grey','#90EE90':'Light Green',\n\t'#FFB6C1':'Light Pink','#FFA07A':'Light Salmon','#20B2AA':'Light Sea Green','#87CEFA':'Light Sky Blue','#778899':'Light Slate Gray','#778899':'Light Slate Grey',\n\t'#B0C4DE':'Light Steel Blue','#FFFFE0':'Light Yellow','#00FF00':'Lime','#32CD32':'Lime Green','#FAF0E6':'Linen','#FF00FF':'Magenta','#800000':'Maroon',\n\t'#66CDAA':'Medium Aqua Marine','#0000CD':'Medium Blue','#BA55D3':'Medium Orchid','#9370D8':'Medium Purple','#3CB371':'Medium Sea Green','#7B68EE':'Medium Slate Blue',\n\t'#00FA9A':'Medium Spring Green','#48D1CC':'Medium Turquoise','#C71585':'Medium Violet Red','#191970':'Midnight Blue','#F5FFFA':'Mint Cream','#FFE4E1':'Misty Rose','#FFE4B5':'Moccasin',\n\t'#FFDEAD':'Navajo White','#000080':'Navy','#FDF5E6':'Old Lace','#808000':'Olive','#6B8E23':'Olive Drab','#FFA500':'Orange','#FF4500':'Orange Red','#DA70D6':'Orchid',\n\t'#EEE8AA':'Pale Golden Rod','#98FB98':'Pale Green','#AFEEEE':'Pale Turquoise','#D87093':'Pale Violet Red','#FFEFD5':'Papaya Whip','#FFDAB9':'Peach Puff',\n\t'#CD853F':'Peru','#FFC0CB':'Pink','#DDA0DD':'Plum','#B0E0E6':'Powder Blue','#800080':'Purple','#FF0000':'Red','#BC8F8F':'Rosy Brown','#4169E1':'Royal Blue',\n\t'#8B4513':'Saddle Brown','#FA8072':'Salmon','#F4A460':'Sandy Brown','#2E8B57':'Sea Green','#FFF5EE':'Sea Shell','#A0522D':'Sienna','#C0C0C0':'Silver',\n\t'#87CEEB':'Sky Blue','#6A5ACD':'Slate Blue','#708090':'Slate Gray','#708090':'Slate Grey','#FFFAFA':'Snow','#00FF7F':'Spring Green',\n\t'#4682B4':'Steel Blue','#D2B48C':'Tan','#008080':'Teal','#D8BFD8':'Thistle','#FF6347':'Tomato','#40E0D0':'Turquoise','#EE82EE':'Violet',\n\t'#F5DEB3':'Wheat','#FFFFFF':'White','#F5F5F5':'White Smoke','#FFFF00':'Yellow','#9ACD32':'Yellow Green'\n};\n\nvar namedLookup = {};\n\nfunction init() {\n\tvar inputColor = convertRGBToHex(tinyMCEPopup.getWindowArg('input_color')), key, value;\n\n\ttinyMCEPopup.resizeToInnerSize();\n\n\tgeneratePicker();\n\tgenerateWebColors();\n\tgenerateNamedColors();\n\n\tif (inputColor) {\n\t\tchangeFinalColor(inputColor);\n\n\t\tcol = convertHexToRGB(inputColor);\n\n\t\tif (col)\n\t\t\tupdateLight(col.r, col.g, col.b);\n\t}\n\t\n\tfor (key in named) {\n\t\tvalue = named[key];\n\t\tnamedLookup[value.replace(/\\s+/, '').toLowerCase()] = key.replace(/#/, '').toLowerCase();\n\t}\n}\n\nfunction toHexColor(color) {\n\tvar matches, red, green, blue, toInt = parseInt;\n\n\tfunction hex(value) {\n\t\tvalue = parseInt(value).toString(16);\n\n\t\treturn value.length > 1 ? value : '0' + value; // Padd with leading zero\n\t};\n\n\tcolor = color.replace(/[\\s#]+/g, '').toLowerCase();\n\tcolor = namedLookup[color] || color;\n\tmatches = /^rgb\\((\\d{1,3}),(\\d{1,3}),(\\d{1,3})\\)|([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})|([a-f0-9])([a-f0-9])([a-f0-9])$/.exec(color);\n\n\tif (matches) {\n\t\tif (matches[1]) {\n\t\t\tred = toInt(matches[1]);\n\t\t\tgreen = toInt(matches[2]);\n\t\t\tblue = toInt(matches[3]);\n\t\t} else if (matches[4]) {\n\t\t\tred = toInt(matches[4], 16);\n\t\t\tgreen = toInt(matches[5], 16);\n\t\t\tblue = toInt(matches[6], 16);\n\t\t} else if (matches[7]) {\n\t\t\tred = toInt(matches[7] + matches[7], 16);\n\t\t\tgreen = toInt(matches[8] + matches[8], 16);\n\t\t\tblue = toInt(matches[9] + matches[9], 16);\n\t\t}\n\n\t\treturn '#' + hex(red) + hex(green) + hex(blue);\n\t}\n\n\treturn '';\n}
2\n\nfunction insertAction() {\n\tvar color = document.getElementById(\"color\").value, f = tinyMCEPopup.getWindowArg('func');\n\n\ttinyMCEPopup.restoreSelection();\n\n\tif (f)\n\t\tf(toHexColor(color));\n\n\ttinyMCEPopup.close();\n}\n\nfunction showColor(color, name) {\n\tif (name)\n\t\tdocument.getElementById(\"colorname\").innerHTML = name;\n\n\tdocument.getElementById(\"preview\").style.backgroundColor = color;\n\tdocument.getElementById(\"color\").value = color.toUpperCase();\n}\n\nfunction convertRGBToHex(col) {\n\tvar re = new RegExp(\"rgb\\\\s*\\\\(\\\\s*([0-9]+).*,\\\\s*([0-9]+).*,\\\\s*([0-9]+).*\\\\)\", \"gi\");\n\n\tif (!col)\n\t\treturn col;\n\n\tvar rgb = col.replace(re, \"$1,$2,$3\").split(',');\n\tif (rgb.length == 3) {\n\t\tr = parseInt(rgb[0]).toString(16);\n\t\tg = parseInt(rgb[1]).toString(16);\n\t\tb = parseInt(rgb[2]).toString(16);\n\n\t\tr = r.length == 1 ? '0' + r : r;\n\t\tg = g.length == 1 ? '0' + g : g;\n\t\tb = b.length == 1 ? '0' + b : b;\n\n\t\treturn \"#\" + r + g + b;\n\t}\n\n\treturn col;\n}\n\nfunction convertHexToRGB(col) {\n\tif (col.indexOf('#') != -1) {\n\t\tcol = col.replace(new RegExp('[^0-9A-F]', 'gi'), '');\n\n\t\tr = parseInt(col.substring(0, 2), 16);\n\t\tg = parseInt(col.substring(2, 4), 16);\n\t\tb = parseInt(col.substring(4, 6), 16);\n\n\t\treturn {r : r, g : g, b : b};\n\t}\n\n\treturn null;\n}\n\nfunction generatePicker() {\n\tvar el = document.getElementById('light'), h = '', i;\n\n\tfor (i = 0; i < detail; i++){\n\t\th += '<div id=\"gs'+i+'\" style=\"background-color:#000000; width:15px; height:3px; border-style:none; border-width:0px;\"'\n\t\t+ ' onclick=\"changeFinalColor(this.style.backgroundColor)\"'\n\t\t+ ' onmousedown=\"isMouseDown = true; return false;\"'\n\t\t+ ' onmouseup=\"isMouseDown = false;\"'\n\t\t+ ' onmousemove=\"if (isMouseDown && isMouseOver) changeFinalColor(this.style.backgroundColor); return false;\"'\n\t\t+ ' onmouseover=\"isMouseOver = true;\"'\n\t\t+ ' onmouseout=\"isMouseOver = false;\"'\n\t\t+ '></div>';\n\t}\n\n\tel.innerHTML = h;\n}\n\nfunction generateWebColors() {\n\tvar el = document.getElementById('webcolors'), h = '', i;\n\n\tif (el.className == 'generated')\n\t\treturn;\n\n\t// TODO: VoiceOver doesn't seem to support legend as a label referenced by labelledby.\n\th += '<div role=\"listbox\" aria-labelledby=\"webcolors_title\" tabindex=\"0\"><table role=\"presentation\" border=\"0\" cellspacing=\"1\" cellpadding=\"0\">'\n\t\t+ '<tr>';\n\n\tfor (i=0; i<colors.length; i++) {\n\t\th += '<td bgcolor=\"' + colors[i] + '\" width=\"10\" height=\"10\">'\n\t\t\t+ '<a href=\"javascript:insertAction();\" role=\"option\" tabindex=\"-1\" aria-labelledby=\"web_colors_' + i + '\" onfocus=\"showColor(\\'' + colors[i] + '\\');\" onmouseover=\"showColor(\\'' + colors[i] + '\\');\" style=\"display:block;width:10px;height:10px;overflow:hidden;\">';\n\t\tif (tinyMCEPopup.editor.forcedHighContrastMode) {\n\t\t\th += '<canvas class=\"mceColorSwatch\" height=\"10\" width=\"10\" data-color=\"' + colors[i] + '\"></canvas>';\n\t\t}\n\t\th += '<span class=\"mceVoiceLabel\" style=\"display:none;\" id=\"web_colors_' + i + '\">' + colors[i].toUpperCase() + '</span>';\n\t\th += '</a></td>';\n\t\tif ((i+1) % 18 == 0)\n\t\t\th += '</tr><tr>';\n\t}\n\n\th += '</table></div>';\n\n\tel.innerHTML = h;\n\tel.className = 'generated';\n\n\tpaintCanvas(el);\n\tenableKeyboardNavigation(el.firstChild);\n}\n\nfunction paintCanvas(el) {\n\ttinyMCEPopup.getWin().tinymce.each(tinyMCEPopup.dom.select('canvas.mceColorSwatch', el), function(canvas) {\n\t\tvar context;\n\t\tif (canvas.getContext && (context = canvas.getContext(\"2d\"))) {\n\t\t\tcontext.fillStyle = canvas.getAttribute('data-color');\n\t\t\tcontext.fillRect(0, 0, 10, 10);\n\t\t}\n\t});\n}\nfunction generateNamedColors() {\n\tvar el = document.getElementById('namedcolors'), h = '', n, v, i = 0;\n\n\tif (el.className == 'generated')\n\t\treturn;\n\n\tfor (n in named) {\n\t\tv = named[n];\n\t\th += '<a href=\"javascript:insertAction();\" role=\"option\" tabindex=\"-1\" aria-labelledby=\"named_colors_' + i + '\" onfocus=\"showColor(\\'' + n + '\\',\\'' + v + '\\');\" onmouseover=\"showColor(\\'' + n + '\\',\\'' + v + '\\');\" style=\"background-color: ' + n + '\">';\n\t\tif (tinyMCEPopup.editor.forcedHighContrastMode) {\n\t\t\th += '<canvas class=\"mceColorSwatch\" height=\"10\" width=\"10\" data-color=\"' + colors[i] + '\"></canvas>';\n\t\t}\n\t\th += '<span class=\"mceVoiceLabel\" style=\"display:none;\" id=\"named_colors_' + i + '\">' + v + '</span>';\n\t\th += '</a>';\n\t\ti++;\n\t}\n\n\tel.innerHTML = h;\n\tel.className = 'generated';\n\n\tpaintCanvas(el);\n\tenableKeyboardNavigation(el);\n}\n\nfunction enableKeyboardNavigation(el) {\n\ttinyMCEPopup.editor.windowManager.createInstance('tinymce.ui.KeyboardNavigation', {\n\t\troot: el,\n\t\titems: t
2inyMCEPopup.dom.select('a', el)\n\t}, tinyMCEPopup.dom);\n}\n\nfunction dechex(n) {\n\treturn strhex.charAt(Math.floor(n / 16)) + strhex.charAt(n % 16);\n}\n\nfunction computeColor(e) {\n\tvar x, y, partWidth, partDetail, imHeight, r, g, b, coef, i, finalCoef, finalR, finalG, finalB, pos = tinyMCEPopup.dom.getPos(e.target);\n\n\tx = e.offsetX ? e.offsetX : (e.target ? e.clientX - pos.x : 0);\n\ty = e.offsetY ? e.offsetY : (e.target ? e.clientY - pos.y : 0);\n\n\tpartWidth = document.getElementById('colors').width / 6;\n\tpartDetail = detail / 2;\n\timHeight = document.getElementById('colors').height;\n\n\tr = (x >= 0)*(x < partWidth)*255 + (x >= partWidth)*(x < 2*partWidth)*(2*255 - x * 255 / partWidth) + (x >= 4*partWidth)*(x < 5*partWidth)*(-4*255 + x * 255 / partWidth) + (x >= 5*partWidth)*(x < 6*partWidth)*255;\n\tg = (x >= 0)*(x < partWidth)*(x * 255 / partWidth) + (x >= partWidth)*(x < 3*partWidth)*255\t+ (x >= 3*partWidth)*(x < 4*partWidth)*(4*255 - x * 255 / partWidth);\n\tb = (x >= 2*partWidth)*(x < 3*partWidth)*(-2*255 + x * 255 / partWidth) + (x >= 3*partWidth)*(x < 5*partWidth)*255 + (x >= 5*partWidth)*(x < 6*partWidth)*(6*255 - x * 255 / partWidth);\n\n\tcoef = (imHeight - y) / imHeight;\n\tr = 128 + (r - 128) * coef;\n\tg = 128 + (g - 128) * coef;\n\tb = 128 + (b - 128) * coef;\n\n\tchangeFinalColor('#' + dechex(r) + dechex(g) + dechex(b));\n\tupdateLight(r, g, b);\n}\n\nfunction updateLight(r, g, b) {\n\tvar i, partDetail = detail / 2, finalCoef, finalR, finalG, finalB, color;\n\n\tfor (i=0; i<detail;
2 i++) {\n\t\tif ((i>=0) && (i<partDetail)) {\n\t\t\tfinalCoef = i / partDetail;\n\t\t\tfinalR = dechex(255 - (255 - r) * finalCoef);\n\t\t\tfinalG = dechex(255 - (255 - g) * finalCoef);\n\t\t\tfinalB = dechex(255 - (255 - b) * finalCoef);\n\t\t} else {\n\t\t\tfinalCoef = 2 - i / partDetail;\n\t\t\tfinalR = dechex(r * finalCoef);\n\t\t\tfinalG = dechex(g * finalCoef);\n\t\t\tfinalB = dechex(b * finalCoef);\n\t\t}\n\n\t\tcolor = finalR + finalG + finalB;\n\n\t\tsetCol('gs' + i, '#'+color);\n\t}\n}\n\nfunction changeFinalColor(color) {\n\tif (color.indexOf('#') == -1)\n\t\tcolor = convertRGBToHex(color);\n\n\tsetCol('preview', color);\n\tdocument.getElementById('color').value = color;\n}\n\nfunction setCol(e, c) {\n\ttry {\n\t\tdocument.getElementById(e).style.backgroundColor = c;\n\t} catch (ex) {\n\t\t// Ignore IE warning\n\t}\n}\n\ntinyMCEPopup.onInit.add(init);\n","Potato_Zendesk/js/tiny_mce/themes/advanced/js/image.js":"var ImageDialog = {\n\tpreInit : function() {\n\t\tvar url;\n\n\t\ttinyMCEPopup.requireLangPack();\n\n\t\tif (url = tinyMCEPopup.getParam(\"external_image_list_url\"))\n\t\t\tdocument.write('
2<script language=\"javascript\" type=\"text/javascript\" src=\"' + tinyMCEPopup.editor.documentBaseURI.toAbsolute(url) + '\"></script>');\n\t},\n\n\tinit : function() {\n\t\tvar f = document.forms[0], ed = tinyMCEPopup.editor;\n\n\t\t// Setup browse button\n\t\tdocument.getElementById('srcbrowsercontainer').innerHTML = getBrowserHTML('srcbrowser','src','image','theme_advanced_image');\n\t\tif (isVisible('srcbrowser'))\n\t\t\tdocument.getElementById('src').style.width = '180px';\n\n\t\te = ed.selection.getNode();\n\n\t\tthis.fillFileList('image_list', tinyMCEPopup.getParam('external_image_list', 'tinyMCEImageList'));\n\n\t\tif (e.nodeName == 'IMG') {\n\t\t\tf.src.value = ed.dom.getAttrib(e, 'src');\n\t\t\tf.alt.value = ed.dom.getAttrib(e, 'alt');\n\t\t\tf.border.value = this.getAttrib(e, 'border');\n\t\t\tf.vspace.value = this.getAttrib(e, 'vspace');\n\t\t\tf.hspace.value = this.getAttrib(e, 'hspace');\n\t\t\tf.width.value = ed.dom.getAttrib(e, 'width');\n\t\t\tf.height.value = ed.dom.getAttrib(e, 'height');\n\t\t\tf.insert.value = ed.getLang('update');\n\t\t\tthis.styleVal = ed.dom.getAttrib(e, 'style');\n\t\t\tselectByValue(f, 'image_list', f.src.value);\n\t\t\tselectByValue(f, 'align', this.getAttrib(e, 'align'));\n\t\t\tthis.updateStyle();\n\t\t}\n\t},\n\n\tfillFileList : function(id, l) {\n\t\tvar dom = tinyMCEPopup.dom, lst = dom.get(id), v, cl;\n\n\t\tl = typeof(l) === 'function' ? l() : window[l];\n\n\t\tif (l && l.length > 0) {\n\t\t\tlst.options[lst.options.length] = new Option('', '');\n\n\t\t\ttinymce.each(l, function(o) {\n\t\t\t\tlst.options[lst.options.length] = new Option(o[0], o[1]);\n\t\t\t});\n\t\t} else\n\t\t\tdom.remove(dom.getParent(id, 'tr'));\n\t},\n\n\tupdate : function() {\n\t\tvar f = document.forms[0], nl = f.elements, ed = tinyMCEPopup.editor, args = {}, el;\n\n\t\ttinyMCEPopup.restoreSelection();\n\n\t\tif (f.src.value === '') {\n\t\t\tif (ed.selection.getNode().nodeName == 'IMG') {\n\t\t\t\ted.dom.remove(ed.selection.getNode());\n\t\t\t\ted.execCommand('mceRepaint');\n\t\t\t}\n\n\t\t\ttinyMCEPopup.close();\n\t\t\treturn;\n\t\t}\n\n\t\tif (!ed.settings.inline_styles) {\n\t\t\targs = tinymce.extend(args, {\n\t\t\t\tvspace : nl.vspace.value,\n\t\t\t\thspace : nl.hspace.value,\n\t\t\t\tborder : nl.border.value,\n\t\t\t\talign : getSelectValue(f, 'align')\n\t\t\t});\n\t\t} else\n\t\t\targs.style = this.styleVal;\n\n\t\ttinymce.extend(args, {\n\t\t\tsrc : f.src.value.replace(/ /g, '%20'),\n\t\t\talt : f.alt.value,\n\t\t\twidth : f.width.value,\n\t\t\theight : f.height.value\n\t\t});\n\n\t\tel = ed.selection.getNode();\n\n\t\tif (el && el.nodeName == 'IMG') {\n\t\t\ted.dom.setAttribs(el, args);\n\t\t\ttinyMCEPopup.editor.execCommand('mceRepaint');\n\t\t\ttinyMCEPopup.editor.focus();\n\t\t} else {\n\t\t\ttinymce.each(args, function(value, name) {\n\t\t\t\tif (value === \"\") {\n\t\t\t\t\tdelete args[name];\n\t\t\t\t}\n\t\t\t});\n\n\t\t\ted.execCommand('mceInsertContent', false, tinyMCEPopup.editor.dom.createHTML('img', args), {skip_undo : 1});\n\t\t\ted.undoManager.add();\n\t\t}\n\n\t\ttinyMCEPopup.close();\n\t},\n\n\tupdateStyle : function() {\n\t\tvar dom = tinyMCEPopup.dom, st, v, f = document.forms[0];\n\n\t\tif (tinyMCEPopup.editor.settings.inline_styles) {\n\t\t\tst = tinyMCEPopup.dom.parseStyle(this.styleVal);\n\n\t\t\t// Handle align\n\t\t\tv = getSelectValue(f, 'align');\n\t\t\tif (v) {\n\t\t\t\tif (v == 'left' || v == 'right') {\n\t\t\t\t\tst['float'] = v;\n\t\t\t\t\tdelete st['vertical-align'];\n\t\t\t\t} else {\n\t\t\t\t\tst['vertical-align'] = v;\n\t\t\t\t\tdelete st['float'];\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tdelete st['float'];\n\t\t\t\tdelete st['vertical-align'];\n\t\t\t}\n\n\t\t\t// Handle border\n\t\t\tv = f.border.value;\n\t\t\tif (v || v == '0') {\n\t\t\t\tif (v == '0')\n\t\t\t\t\tst['border'] = '0';\n\t\t\t\telse\n\t\t\t\t\tst['border'] = v + 'px solid black';\n\t\t\t} else\n\t\t\t\tdelete st['border'];\n\n\t\t\t// Handle hspace\n\t\t\tv = f.hspace.value;\n\t\t\tif (v) {\n\t\t\t\tdelete st['margin'];\n\t\t\t\tst['margin-left'] = v + 'px';\n\t\t\t\tst['margin-right'] = v + 'px';\n\t\t\t} else {\n\t\t\t\tdelete st['margin-left'];\n\t\t\t\tdelete st['margin-right'];\n\t\t\t}\n\n\t\t\t// Handle vspace\n\t\t\tv = f.vspace.value;\n\t\t\tif (v) {\n\t\t\t\tdelete st['margin'];\n\t\t\t\tst['margin-top'] = v + 'px';\n\t\t\t\tst['margin-bottom'] = v + 'px';\n\t\t\t} else {\n\t\t\t\tdelete st['margin-top'];\n\t\t\t\tdelete st['margin-bottom'];\n\t\t\t}\n\n\t\t\t// Merge\n\t\t\tst = tinyMCEPopup.dom.parseStyle(dom.serializeStyle(st), 'img');\n\t\t\tthis.styleVal = dom.serializeStyle(st, 'img');\n\t\t}\n\t},\n\n\tgetAttrib : function(e, at) {\n\t\tvar ed = tinyMCEPopup.editor, dom = ed.dom, v, v2;\n\n\t\tif (ed.settings.inline_styles) {\n\t\t\tswitch (at) {\n\t\t\t\tcase 'align':\n\t\t\t\t\tif (v = dom.getStyle(e, 'float'))\n\t\t\t\t\t\treturn v;
2\n\n\t\t\t\t\tif (v = dom.getStyle(e, 'vertical-align'))\n\t\t\t\t\t\treturn v;\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'hspace':\n\t\t\t\t\tv = dom.getStyle(e, 'margin-left')\n\t\t\t\t\tv2 = dom.getStyle(e, 'margin-right');\n\t\t\t\t\tif (v && v == v2)\n\t\t\t\t\t\treturn parseInt(v.replace(/[^0-9]/g, ''));\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'vspace':\n\t\t\t\t\tv = dom.getStyle(e, 'margin-top')\n\t\t\t\t\tv2 = dom.getStyle(e, 'margin-bottom');\n\t\t\t\t\tif (v && v == v2)\n\t\t\t\t\t\treturn parseInt(v.replace(/[^0-9]/g, ''));\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'border':\n\t\t\t\t\tv = 0;\n\n\t\t\t\t\ttinymce.each(['top', 'right', 'bottom', 'left'], function(sv) {\n\t\t\t\t\t\tsv = dom.getStyle(e, 'border-' + sv + '-width');\n\n\t\t\t\t\t\t// False or not the same as prev\n\t\t\t\t\t\tif (!sv || (sv != v && v !== 0)) {\n\t\t\t\t\t\t\tv = 0;\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (sv)\n\t\t\t\t\t\t\tv = sv;\n\t\t\t\t\t});\n\n\t\t\t\t\tif (v)\n\t\t\t\t\t\treturn parseInt(v.replace(/[^0-9]/g, ''));\n\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tif (v = dom.getAttrib(e, at))\n\t\t\treturn v;
2\n\n\t\treturn '';\n\t},\n\n\tresetImageData : function() {\n\t\tvar f = document.forms[0];\n\n\t\tf.width.value = f.height.value = \"\";\t\n\t},\n\n\tupdateImageData : function() {\n\t\tvar f = document.forms[0], t = ImageDialog;\n\n\t\tif (f.width.value == \"\")\n\t\t\tf.width.value = t.preloadImg.width;\n\n\t\tif (f.height.value == \"\")\n\t\t\tf.height.value = t.preloadImg.height;\n\t},\n\n\tgetImageData : function() {\n\t\tvar f = document.forms[0];\n\n\t\tthis.preloadImg = new Image();\n\t\tthis.preloadImg.onload = this.updateImageData;\n\t\tthis.preloadImg.onerror = this.resetImageData;\n\t\tthis.preloadImg.src = tinyMCEPopup.editor.documentBaseURI.toAbsolute(f.src.value);\n\t}\n};\n\nImageDialog.preInit();\ntinyMCEPopup.onInit.add(ImageDialog.init, ImageDialog);\n","Potato_Zendesk/js/tiny_mce/themes/advanced/js/link.js":"tinyMCEPopup.requireLangPack();\n\nvar LinkDialog = {\n\tpreInit : function() {\n\t\tvar url;\n\n\t\tif (url = tinyMCEPopup.getParam(\"external_link_list_url\"))\n\t\t\tdocument.write('<script language=\"javascript\" type=\"text/javascript\" src=\"' + tinyMCEPopup.editor.documentBaseURI.toAbsolute(url) + '\"></script>');\n\t},\n\n\tinit : function() {\n\t\tvar f = document.forms[0], ed = tinyMCEPopup.editor;\n\n\t\t// Setup browse button\n\t\tdocument.getElementById('hrefbrowsercontainer').innerHTML = getBrowserHTML('hrefbrowser', 'href', 'file', 'theme_advanced_link');\n\t\tif (isVisible('hrefbrowser'))\n\t\t\tdocument.getElementById('href').style.width = '180px';\n\n\t\tthis.fillClassList('class_list');\n\t\tthis.fillFileList('link_list', 'tinyMCELinkList');\n\t\tthis.fillTargetList('target_list');\n\n\t\tif (e = ed.dom.getParent(ed.selection.getNode(), 'A')) {\n\t\t\tf.href.value = ed.dom.getAttrib(e, 'href');\n\t\t\tf.linktitle.value = ed.dom.getAttrib(e, 'title');\n\t\t\tf.insert.value = ed.getLang('update');\n\t\t\tselectByValue(f, 'link_list', f.href.value);\n\t\t\tselectByValue(f, 'target_list', ed.dom.getAttrib(e, 'target'));\n\t\t\tselectByValue(f, 'class_list', ed.dom.getAttrib(e, 'class'));\n\t\t}\n\t},\n\n\tupdate : function() {\n\t\tvar f = document.forms[0], ed = tinyMCEPopup.editor, e, b, href = f.href.value.replace(/ /g, '%20');\n\n\t\ttinyMCEPopup.restoreSelection();\n\t\te = ed.dom.getParent(ed.selection.getNode(), 'A');\n\n\t\t// Remove element if there is no href\n\t\tif (!f.href.value) {\n\t\t\tif (e) {\n\t\t\t\tb = ed.selection.getBookmark();\n\t\t\t\ted.dom.remove(e, 1);\n\t\t\t\ted.selection.moveToBookmark(b);\n\t\t\t\ttinyMCEPopup.execCommand(\"mceEndUndoLevel\");\n\t\t\t\ttinyMCEPopup.close();\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\t// Create new anchor elements\n\t\tif (e == null) {\n\t\t\ted.getDoc().execCommand(\"unlink\", false, null);\n\t\t\ttinyMCEPopup.execCommand(\"mceInsertLink\", false, \"#mce_temp_url#\", {skip_undo : 1});\n\n\t\t\ttinymce.each(ed.dom.select(\"a\"), function(n) {\n\t\t\t\tif (ed.dom.getAttrib(n, 'href') == '#mce_temp_url#') {\n\t\t\t\t\te = n;\n\n\t\t\t\t\ted.dom.setAttribs(e, {\n\t\t\t\t\t\thref : href,\n\t\t\t\t\t\ttitle : f.linktitle.value,\n\t\t\t\t\t\ttarget : f.target_list ? getSelectValue(f, \"target_list\") : null,\n\t\t\t\t\t\t'class' : f.class_list ? getSelectValue(f, \"class_list\") : null\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t});\n\t\t} else {\n\t\t\ted.dom.setAttribs(e, {\n\t\t\t\thref : href,\n\t\t\t\ttitle : f.linktitle.value,\n\t\t\t\ttarget : f.target_list ? getSelectValue(f, \"target_list\") : null,\n\t\t\t\t'class' : f.class_list ? getSelectValue(f, \"class_list\") : null\n\t\t\t});\n\t\t}\n\n\t\t// Don't move caret if selection was image\n\t\tif (e.childNodes.length != 1 || e.firstChild.nodeName != 'IMG') {\n\t\t\ted.focus();\n\t\t\ted.selection.select(e);\n\t\t\ted.selection.collapse(0);\n\t\t\ttinyMCEPopup.storeSelection();\n\t\t}\n\n\t\ttinyMCEPopup.execCommand(\"mceEndUndoLevel\");\n\t\ttinyMCEPopup.close();\n\t},\n\n\tcheckPrefix : function(n) {\n\t\tif (n.value && Validator.isEmail(n) && !/^\\s*mailto:/i.test(n.value) && confirm(tinyMCEPopup.getLang('advanced_dlg.link_is_email')))\n\t\t\tn.value = 'mailto:' + n.value;\n\n\t\tif (/^\\s*www\\./i.test(n.value) && confirm(tinyMCEPopup.getLang('advanced_dlg.link_is_external')))\n\t\t\tn.value = 'http://' + n.value;\n\t},\n\n\tfillFileList : function(id, l) {\n\t\tvar dom = tinyMCEPopup.dom, lst = dom.get(id), v, cl;\n\n\t\tl = window[l];\n\n\t\tif (l && l.length > 0) {\n\t\t\tlst.options[lst.options.length] = new Option('', '');\n\n\t\t\ttinymce.each(l, function(o) {\n\t\t\t\tlst.options[lst.options.length] = new Option(o[0], o[1]);\n\t\t\t});\n\t\t} else\n\t\t\tdom.remove(dom.getParent(id, 'tr'));\n\t},\n\n\tfillClassList : function(id) {\n\t\tvar dom = tinyMCEPopup.dom, lst = dom.get(id), v, cl;\n\n\t\tif (v = tinyMCEPopup.getParam('theme_advanced_styles')) {\n\t\t\tcl = [];\n\n\t\t\ttinymce.each(v.split(';
2'), function(v) {\n\t\t\t\tvar p = v.split('=');\n\n\t\t\t\tcl.push({'title' : p[0], 'class' : p[1]});\n\t\t\t});\n\t\t} else\n\t\t\tcl = tinyMCEPopup.editor.dom.getClasses();\n\n\t\tif (cl.length > 0) {\n\t\t\tlst.options[lst.options.length] = new Option(tinyMCEPopup.getLang('not_set'), '');\n\n\t\t\ttinymce.each(cl, function(o) {\n\t\t\t\tlst.options[lst.options.length] = new Option(o.title || o['class'], o['class']);\n\t\t\t});\n\t\t} else\n\t\t\tdom.remove(dom.getParent(id, 'tr'));\n\t},\n\n\tfillTargetList : function(id) {\n\t\tvar dom = tinyMCEPopup.dom, lst = dom.get(id), v;\n\n\t\tlst.options[lst.options.length] = new Option(tinyMCEPopup.getLang('not_set'), '');\n\t\tlst.options[lst.options.length] = new Option(tinyMCEPopup.getLang('advanced_dlg.link_target_same'), '_self');\n\t\tlst.options[lst.options.length] = new Option(tinyMCEPopup.getLang('advanced_dlg.link_target_blank'), '_blank');\n\n\t\tif (v = tinyMCEPopup.getParam('theme_advanced_link_targets')) {\n\t\t\ttinymce.each(v.split(','), function(v) {\n\t\t\t\tv = v.split('=');\n\t\t\t\tlst.options[lst.options.length] = new Option(v[0], v[1]);\n\t\t\t});\n\t\t}\n\t}\n};\n\nLinkDialog.preInit();\ntinyMCEPopup.onInit.add(LinkDialog.init, LinkDialog);\n","Potato_Zendesk/js/tiny_mce/themes/advanced/js/source_editor.js":"tinyMCEPopup.requireLangPack();\ntinyMCEPopup.onInit.add(onLoadInit);\n\nfunction saveContent() {\n\ttinyMCEPopup.editor.setContent(document.getElementById('htmlSource').value, {source_view : true});\n\ttinyMCEPopup.close();\n}\n\nfunction onLoadInit() {\n\ttinyMCEPopup.resizeToInnerSize();\n\n\t// Remove Gecko spellchecking\n\tif (tinymce.isGecko)\n\t\tdocument.body.spellcheck = tinyMCEPopup.editor.getParam(\"gecko_spellcheck\");\n\n\tdocument.getElementById('htmlSource').value = tinyMCEPopup.editor.getContent({source_view : true});\n\n\tif (tinyMCEPopup.editor.getParam(\"theme_advanced_source_editor_wrap\", true)) {\n\t\tsetWrap('soft');\n\t\tdocument.getElementById('wraped').checked = true;\n\t}\n\n\tresizeInputs();\n}\n\nfunction setWrap(val) {\n\tvar v, n, s = document.getElementById('htmlSource');\n\n\ts.wrap = val;\n\n\tif (!tinymce.isIE) {\n\t\tv = s.value;\n\t\tn = s.cloneNode(false);\n\t\tn.setAttribute(\"wrap\", val);\n\t\ts.parentNode.replaceChild(n, s);\n\t\tn.value = v;\n\t}\n}\n\nfunction toggleWordWrap(elm) {\n\tif (elm.checked)\n\t\tsetWrap('soft');\n\telse\n\t\tsetWrap('off');\n}\n\nfunction resizeInputs() {\n\tvar vp = tinyMCEPopup.dom.getViewPort(window), el;\n\n\tel = document.getElementById('htmlSource');\n\n\tif (el) {\n\t\tel.style.width = (vp.w - 20) + 'px';\n\t\tel.style.height = (vp.h - 65) + 'px';\n\t}\n}\n","Potato_Zendesk/js/tiny_mce/themes/advanced/langs/en.js":"tinyMCE.addI18n('en.advanced',{\"underline_desc\":\"Underline (Ctrl+U)\",\"italic_desc\":\"Italic (Ctrl+I)\",\"bold_desc\":\"Bold (Ctrl+B)\",dd:\"Definition Description\",dt:\"Definition Term \",samp:\"Code Sample\",code:\"Code\",blockquote:\"Block Quote\",h6:\"Heading 6\",h5:\"Heading 5\",h4:\"Heading 4\",h3:\"Heading 3\",h2:\"Heading 2\",h1:\"Heading 1\",pre:\"Preformatted\",address:\"Address\",div:\"DIV\",paragraph:\"Paragraph\",block:\"Format\",fontdefault:\"Font Family\",\"font_size\":\"Font Size\",\"style_select\":\"Styles\",\"anchor_delta_height\":\"\",\"anchor_delta_width\":\"\",\"charmap_delta_height\":\"\",\"charmap_delta_width\":\"\",\"colorpicker_delta_height\":\"\",\"colorpicker_delta_width\":\"\",\"link_delta_height\":\"\",\"link_delta_width\":\"\",\"image_delta_height\":\"\",\"image_delta_width\":\"\",\"more_colors\":\"More Colors...\",\"toolbar_focus\":\"Jump to tool buttons - Alt+Q, Jump to editor - Alt-Z, Jump to element path - Alt-X\",newdocument:\"Are you sure you want clear all contents?\",path:\"Path\",\"clipboard_msg\":\"Copy/Cut/Paste is not available in Mozilla and Firefox.\\nDo you want more information about this issue?\",\"blockquote_desc\":\"Block Quote\",\"help_desc\":\"Help\",\"newdocument_desc\":\"New Document\",\"image_props_desc\":\"Image Properties\",\"paste_desc\":\"Paste (Ctrl+V)\",\"copy_desc\":\"Copy (Ctrl+C)\",\"cut_desc\":\"Cut (Ctrl+X)\",\"anchor_desc\":\"Insert/Edit Anchor\",\"visualaid_desc\":\"show/Hide Guidelines/Invisible Elements\",\"charmap_desc\":\"Insert Special Character\",\"backcolor_desc\":\"Select Backgroun
2d Color\",\"forecolor_desc\":\"Select Text Color\",\"custom1_desc\":\"Your Custom Description Here\",\"removeformat_desc\":\"Remove Formatting\",\"hr_desc\":\"Insert Horizontal Line\",\"sup_desc\":\"Superscript\",\"sub_desc\":\"Subscript\",\"code_desc\":\"Edit HTML Source\",\"cleanup_desc\":\"Cleanup Messy Code\",\"image_desc\":\"Insert/Edit Image\",\"unlink_desc\":\"Unlink\",\"link_desc\":\"Insert/Edit Link\",\"redo_desc\":\"Redo (Ctrl+Y)\",\"undo_desc\":\"Undo (Ctrl+Z)\",\"indent_desc\":\"Increase Indent\",\"outdent_desc\":\"Decrease Indent\",\"numlist_desc\":\"Insert/Remove Numbered List\",\"bullist_desc\":\"Insert/Remove Bulleted List\",\"justifyfull_desc\":\"Align Full\",\"justifyright_desc\":\"Align Right\",\"justifycenter_desc\":\"Align Center\",\"justifyleft_desc\":\"Align Left\",\"striketrough_desc\":\"Strikethrough\",\"help_shortcut\":\"Press ALT-F10 for toolbar. Press ALT-0 for help\",\"rich_text_area\":\"Rich Text Area\",\"shortcuts_desc\":\"Accessability Help\",toolbar:\"Toolbar\"});","Potato_Zendesk/js/tiny_mce/themes/advanced/langs/en_dlg.js":"tinyMCE.addI18n('en.advanced_dlg', {\"link_list\":\"Link List\",\"link_is_external\":\"The URL you entered seems to be an external link. Do you want to add the required http:// prefix?\",\"link_is_email\":\"The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?\",\"link_titlefield\":\"Title\",\"link_target_blank\":\"Open Link in a New Window\",\"link_target_same\":\"Open Link in the Same Window\",\"link_target\":\"Target\",\"link_url\":\"Link URL\",\"link_title\":\"Insert/Edit Link\",\"image_align_right\":\"Right\",\"image_align_left\":\"Left\",\"image_align_textbottom\":\"Text Bottom\",\"image_align_texttop\":\"Text Top\",\"image_align_bottom\":\"Bottom\",\"image_align_middle\":\"Middle\",\"image_align_top\":\"Top\",\"image_align_baseline\":\"Baseline\",\"image_align\":\"Alignment\",\"image_hspace\":\"Horizontal Space\",\"image_vspace\":\"Vertical Space\",\"image_dimensions\":\"Dimensions\",\"image_alt\":\"Image Description\",\"image_list\":\"Image List\",\"image_border\":\"Border\",\"image_src\":\"Image URL\",\"image_title\":\"Insert/Edit Image\",\"charmap_title\":\"Select Special Character\", \"charmap_usage\":\"Use left and right arrows to 
2navigate.\",\"colorpicker_name\":\"Name:\",\"colorpicker_color\":\"Color:\",\"colorpicker_named_title\":\"Named Colors\",\"colorpicker_named_tab\":\"Named\",\"colorpicker_palette_title\":\"Palette Colors\",\"colorpicker_palette_tab\":\"Palette\",\"colorpicker_picker_title\":\"Color Picker\",\"colorpicker_picker_tab\":\"Picker\",\"colorpicker_title\":\"Select a Color\",\"code_wordwrap\":\"Word Wrap\",\"code_title\":\"HTML Source Editor\",\"anchor_name\":\"Anchor Name\",\"anchor_title\":\"Insert/Edit Anchor\",\"about_loaded\":\"Loaded Plugins\",\"about_version\":\"Version\",\"about_author\":\"Author\",\"about_plugin\":\"Plugin\",\"about_plugins\":\"Plugins\",\"about_license\":\"License\",\"about_help\":\"Help\",\"about_general\":\"About\",\"about_title\":\"About TinyMCE\",\"anchor_invalid\":\"Please specify a valid anchor name.\",\"accessibility_help\":\"Accessibility Help\",\"accessibility_usage_title\":\"General Usage\",\"\":\"\"});\n","Potato_Zendesk/js/tiny_mce/themes/simple/editor_template.js":"(function(){var a=tinymce.DOM;tinymce.ThemeManager.requireLangPack(\"simple\");tinymce.create(\"tinymce.themes.SimpleTheme\",{init:function(c,d){var e=this,b=[\"Bold\",\"Italic\",\"Underline\",\"Strikethrough\",\"InsertUnorderedList\",\"InsertOrderedList\"],f=c.settings;e.editor=c;c.contentCSS.push(d+\"/skins/\"+f.skin+\"/content.css\");c.onInit.add(function(){c.onNodeChange.add(function(h,g){tinymce.each(b,function(i){g.get(i.toLowerCase()).setActive(h.queryCommandState(i))})})});a.loadCSS((f.editor_css?c.documentBaseURI.toAbsolute(f.editor_css):\"\")||d+\"/skins/\"+f.skin+\"/ui.css\")},renderUI:function(h){var e=this,i=h.targetNode,b,c,d=e.editor,f=d.controlManager,g;i=a.insertAfter(a.create(\"span\",{id:d.id+\"_container\",\"class\":\"mceEditor \"+d.settings.skin+\"SimpleSkin\"}),i);i=g=a.add(i,\"table\",{cellPadding:0,cellSpacing:0,\"class\":\"mceLayout\"});i=c=a.add(i,\"tbody\");i=a.add(c,\"tr\");i=b=a.add(a.add(i,\"td\"),\"div\",{\"class\":\"mceIframeContainer\"});i=a.add(a.add(c,\"tr\",{\"class\":\"last\"}),\"td\",{\"class\":\"mceToolbar mceLast\",align:\"center\"});c=e.toolbar=f.createToolbar(\"tools1\");c.add(f.createButton(\"bold\",{title:\"simple.bold_desc\",cmd:\"Bold\"}));c.add(f.createButton(\"italic\",{title:\"simple.italic_desc\",cmd:\"Italic\"}));c.add(f.createButton(\"underline\",{title:\"simple.underline_desc\",cmd:\"Underline\"}));c.add(f.createButton(\"strikethrough\",{title:\"simple.striketrough_desc\",cmd:\"Strikethrough\"}));c.add(f.createSeparator());c.add(f.createButton(\"undo\",{title:\"simple.undo_desc\",cmd:\"Undo\"}));c.add(f.createButton(\"redo\",{title:\"simple.redo_desc\",cmd:\"Redo\"}));c.add(f.createSeparator());c.add(f.createButton(\"cleanup\",{title:\"simple.cleanup_desc\",cmd:\"mceCleanup\"}));c.add(f.createSeparator());c.add(f.createButton(\"insertunorderedlist\",{title:\"simple.bullist_desc\",cmd:\"InsertUnorderedList\"}));c.add(f.createButton(\"insertorderedlist\",{title:\"simple.numlist_desc\",cmd:\"InsertOrderedList\"}));c.renderTo(i);return{iframeContainer:b,editorContainer:d.id+\"_container\",sizeContainer:g,deltaHeight:-20}},getInfo:function(){return{longname:\"Simple theme\",author:\"Moxiecode Systems AB\",authorurl:\"http://tinymce.moxiecode.com\",version:tinymce.majorVersion+\".\"+tinymce.minorVersion}}});tinymce.ThemeManager.add(\"simple\",tinymce.themes.SimpleTheme)})();","Potato_Zendesk/js/tiny_mce/themes/simple/editor_template_src.js":"/**\n * editor_template_src.js\n *\n * Copyright 2009, Moxiecode Systems AB\n * Released under LGPL License.\n *\n * License: http://tinymce.moxiecode.com/license\n * Contributing: http://tinymce.moxiecode.com/contributing\n */\n\n(function() {\n\tvar DOM = tinymce.DOM;\n\n\t// Tell it to load theme specific language pack(s)\n\ttinymce.ThemeManager.requireLangPack('simple');\n\n\ttinymce.create('tinymce.themes.SimpleTheme', {\n\t\tinit : function(ed, url) {\n\t\t\tvar t = this, states = ['Bold', 'Italic', 'Underline', 'Strikethrough', 'InsertUnorderedList', 'InsertOrderedList'], s = ed.settings;\n\n\t\t\tt.editor = ed;\n\t\t\ted.contentCSS.push(url + \"/skins/\" + s.skin + \"/content.css\");
2\n\n\t\t\ted.onInit.add(function() {\n\t\t\t\ted.onNodeChange.add(function(ed, cm) {\n\t\t\t\t\ttinymce.each(states, function(c) {\n\t\t\t\t\t\tcm.get(c.toLowerCase()).setActive(ed.queryCommandState(c));\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t});\n\n\t\t\tDOM.loadCSS((s.editor_css ? ed.documentBaseURI.toAbsolute(s.editor_css) : '') || url + \"/skins/\" + s.skin + \"/ui.css\");\n\t\t},\n\n\t\trenderUI : function(o) {\n\t\t\tvar t = this, n = o.targetNode, ic, tb, ed = t.editor, cf = ed.controlManager, sc;\n\n\t\t\tn = DOM.insertAfter(DOM.create('span', {id : ed.id + '_container', 'class' : 'mceEditor ' + ed.settings.skin + 'SimpleSkin'}), n);\n\t\t\tn = sc = DOM.add(n, 'table', {cellPadding : 0, cellSpacing : 0, 'class' : 'mceLayout'});\n\t\t\tn = tb = DOM.add(n, 'tbody');\n\n\t\t\t// Create iframe container\n\t\t\tn = DOM.add(tb, 'tr');\n\t\t\tn = ic = DOM.add(DOM.add(n, 'td'), 'div', {'class' : 'mceIframeContainer'});\n\n\t\t\t// Create toolbar container\n\t\t\tn = DOM.add(DOM.add(tb, 'tr', {'class' : 'last'}), 'td', {'class' : 'mceToolbar mceLast', align : 'center'});\n\n\t\t\t// Create toolbar\n\t\t\ttb = t.toolbar = cf.createToolbar(\"tools1\");\n\t\t\ttb.add(cf.createButton('bold', {title : 'simple.bold_desc', cmd : 'Bold'}));\n\t\t\ttb.add(cf.createButton('italic', {title : 'simple.italic_desc', cmd : 'Italic'}));\n\t\t\ttb.add(cf.createButton('underline', {title : 'simple.underline_desc', cmd : 'Underline'}));\n\t\t\ttb.add(cf.createButton('strikethrough', {title : 'simple.striketrough_desc', cmd : 'Strikethrough'}));\n\t\t\ttb.add(cf.createSeparator());\n\t\t\ttb.add(cf.createButton('undo', {title : 'simple.undo_desc', cmd : 'Undo'}));\n\t\t\ttb.add(cf.createButton('redo', {title : 'simple.redo_desc', cmd : 'Redo'}));\n\t\t\ttb.add(cf.createSeparator());\n\t\t\ttb.add(cf.createButton('cleanup', {title : 'simple.cleanup_desc', cmd : 'mceCleanup'}));\n\t\t\ttb.add(cf.createSeparator());\n\t\t\ttb.add(cf.createButton('insertunorderedlist', {title : 'simple.bullist_desc', cmd : 'InsertUnorderedList'}));\n\t\t\ttb.add(cf.createButton('insertorderedlist', {title : 'simple.numlist_desc', cmd : 'InsertOrderedList'}));\n\t\t\ttb.renderTo(n);\n\n\t\t\treturn {\n\t\t\t\tiframeContainer : ic,\n\t\t\t\teditorContainer : ed.id + '_container',\n\t\t\t\tsizeContainer : sc,\n\t\t\t\tdeltaHeight : -20\n\t\t\t};\n\t\t},\n\n\t\tgetInfo : function() {\n\t\t\treturn {\n\t\t\t\tlongname : 'Simple theme',\n\t\t\t\tauthor : 'Moxiecode Systems AB',\n\t\t\t\tauthorurl : 'http://tinymce.moxiecode.com',\n\t\t\t\tversion : tinymce.majorVersion + \".\" + tinymce.minorVersion\n\t\t\t}\n\t\t}\n\t});\n\n\ttinymce.ThemeManager.add('simple', tinymce.themes.SimpleTheme);\n})();","Potato_Zendesk/js/tiny_mce/themes/simple/langs/en.js":"tinyMCE.addI18n('en.simple',{\"cleanup_desc\":\"Cleanup Messy Code\",\"redo_desc\":\"Redo (Ctrl+Y)\",\"undo_desc\":\"Undo (Ctrl+Z)\",\"numlist_desc\":\"Insert/Remove Numbered List\",\"bullist_desc\":\"Insert/Remove Bulleted List\",\"striketrough_desc\":\"Strikethrough\",\"underline_desc\":\"Underline (Ctrl+U)\",\"italic_desc\":\"Italic (Ctrl+I)\",\"bold_desc\":\"Bold (Ctrl+B)\"});","Potato_Zendesk/js/tiny_mce/utils/editable_selects.js":"/**\n * editable_selects.js\n *\n * Copyright 2009, Moxiecode Systems AB\n * Released under LGPL License.\n *\n * License: http://tinymce.moxiecode.com/license\n * Contributing: http://tinymce.moxiecode.com/contributing\n */\n\nvar TinyMCE_EditableSelects = {\n\teditSelectElm : null,\n\n\tinit : function() {\n\t\tvar nl = document.getElementsByTagName(\"select\"), i, d = document, o;\n\n\t\tfor (i=0; i<nl.length; i++) {\n\t\t\tif (nl[i].className.indexOf('mceEditableSelect') != -1) {\n\t\t\t\to = new Option(tinyMCEPopup.editor.translate('value'), '__mce_add_custom__');\n\n\t\t\t\to.className = 'mceAddSelectValue';\n\n\t\t\t\tnl[i].options[nl[i].options.length] = o;\n\t\t\t\tnl[i].onchange = TinyMCE_EditableSelects.onChangeEditableSelect;\n\t\t\t}\n\t\t}\n\t},\n\n\tonChangeEditableSelect : function(e) {\n\t\tvar d = document, ne, se = window.event ? window.event.srcElement : e.target;\n\n\t\tif (se.options[se.selectedIndex].value == '__mce_add_custom__') {\n\t\t\tne = d.createElement(\"input\");\n\t\t\tne.id = se.id + \"_custom\";\n\t\t\tne.name = se.name + \"_custom\";\n\t\t\tne.type = \"text\";\n\n\t\t\tne.style.width = se.offsetWidth + 'px';\n\t\t\tse.parentNode.insertBefore(ne, se);\n\t\t\tse.style.display = 'none';\n\t\t\tne.focus();\n\t\t\tne.onblur = TinyMCE_EditableSelects.onBlurEditableSelectInput;\n\t\t\tne.onkeydown = TinyMCE_EditableSelects.onKeyDown;\n\t\t\tTinyMCE_EditableSelects.editSelectElm = se;\n\t\t}\n\t}
2,\n\n\tonBlurEditableSelectInput : function() {\n\t\tvar se = TinyMCE_EditableSelects.editSelectElm;\n\n\t\tif (se) {\n\t\t\tif (se.previousSibling.value != '') {\n\t\t\t\taddSelectValue(document.forms[0], se.id, se.previousSibling.value, se.previousSibling.value);\n\t\t\t\tselectByValue(document.forms[0], se.id, se.previousSibling.value);\n\t\t\t} else\n\t\t\t\tselectByValue(document.forms[0], se.id, '');\n\n\t\t\tse.style.display = 'inline';\n\t\t\tse.parentNode.removeChild(se.previousSibling);\n\t\t\tTinyMCE_EditableSelects.editSelectElm = null;\n\t\t}\n\t},\n\n\tonKeyDown : function(e) {\n\t\te = e || window.event;\n\n\t\tif (e.keyCode == 13)\n\t\t\tTinyMCE_EditableSelects.onBlurEditableSelectInput();\n\t}\n};\n","Potato_Zendesk/js/tiny_mce/utils/form_utils.js":"/**\n * form_utils.js\n *\n * Copyright 2009, Moxiecode Systems AB\n * Released under LGPL License.\n *\n * License: http://tinymce.moxiecode.com/license\n * Contributing: http://tinymce.moxiecode.com/contributing\n */\n\nvar themeBaseURL = tinyMCEPopup.editor.baseURI.toAbsolute('themes/' + tinyMCEPopup.getParam(\"theme\"));\n\nfunction getColorPickerHTML(id, target_form_element) {\n\tvar h = \"\", dom = tinyMCEPopup.dom;\n\n\tif (label = dom.select('label[for=' + target_form_element + ']')[0]) {\n\t\tlabel.id = label.id || dom.uniqueId();\n\t}\n\n\th += '<a role=\"button\" aria-labelledby=\"' + id + '_label\" id=\"' + id + '_link\" href=\"javascript:;\" onclick=\"tinyMCEPopup.pickColor(event,\\'' + target_form_element +'\\');\" onmousedown=\"return false;\" class=\"pickcolor\">';\n\th += '<span id=\"' + id + '\" title=\"' + tinyMCEPopup.getLang('browse') + '\">&nbsp;<span id=\"' + id + '_label\" class=\"mceVoiceLabel mceIconOnly\" style=\"display:none;\">' + tinyMCEPopup.getLang('browse') + '</span></span></a>';\n\n\treturn h;\n}\n\nfunction updateColor(img_id, form_element_id) {\n\tdocument.getElementById(img_id).style.backgroundColor = document.forms[0].elements[form_element_id].value;\n}\n\nfunction setBrowserDisabled(id, state) {\n\tvar img = document.getElementById(id);\n\tvar lnk = document.getElementById(id + \"_link\");\n\n\tif (lnk) {\n\t\tif (state) {\n\t\t\tlnk.setAttribute(\"realhref\", lnk.getAttribute(\"href\"));\n\t\t\tlnk.removeAttribute(\"href\");\n\t\t\ttinyMCEPopup.dom.addClass(img, 'disabled');\n\t\t} else {\n\t\t\tif (lnk.getAttribute(\"realhref\"))\n\t\t\t\tlnk.setAttribute(\"href\", lnk.getAttribute(\"realhref\"));\n\n\t\t\ttinyMCEPopup.dom.removeClass(img, 'disabled');\n\t\t}\n\t}\n}\n\nfunction getBrowserHTML(id, target_form_element, type, prefix) {\n\tvar option = prefix + \"_\" + type + \"_browser_callback\", cb, html;\n\n\tcb = tinyMCEPopup.getParam(option, tinyMCEPopup.getParam(\"file_browser_callback\"));\n\n\tif (!cb)\n\t\treturn \"\";\n\n\thtml = \"\";\n\thtml += '<a id=\"' + id + '_link\" href=\"javascript:openBrowser(\\'' + id + '\\',\\'' + target_form_element + '\\', \\'' + type + '\\',\\'' + option + '\\');\" onmousedown=\"return false;\" class=\"browse\">';\n\thtml += '<span id=\"' + id + '\" title=\"' + tinyMCEPopup.getLang('browse') + '\">&nbsp;</span></a>';\n\n\treturn html;\n}\n\nfunction openBrowser(img_id, target_form_element, type, option) {\n\tvar img = document.getElementById(img_id);
2\n\n\tif (img.className != \"mceButtonDisabled\")\n\t\ttinyMCEPopup.openBrowser(target_form_element, type, option);\n}\n\nfunction selectByValue(form_obj, field_name, value, add_custom, ignore_case) {\n\tif (!form_obj || !form_obj.elements[field_name])\n\t\treturn;\n\n\tif (!value)\n\t\tvalue = \"\";\n\n\tvar sel = form_obj.elements[field_name];\n\n\tvar found = false;\n\tfor (var i=0; i<sel.options.length; i++) {\n\t\tvar option = sel.options[i];\n\n\t\tif (option.value == value || (ignore_case && option.value.toLowerCase() == value.toLowerCase())) {\n\t\t\toption.selected = true;\n\t\t\tfound = true;\n\t\t} else\n\t\t\toption.selected = false;\n\t}\n\n\tif (!found && add_custom && value != '') {\n\t\tvar option = new Option(value, value);\n\t\toption.selected = true;\n\t\tsel.options[sel.options.length] = option;\n\t\tsel.selectedIndex = sel.options.length - 1;\n\t}\n\n\treturn found;\n}\n\nfunction getSelectValue(form_obj, field_name) {\n\tvar elm = form_obj.elements[field_name];\n\n\tif (elm == null || elm.options == null || elm.selectedIndex === -1)\n\t\treturn \"\";\n\n\treturn elm.options[elm.selectedIndex].value;\n}\n\nfunction addSelectValue(form_obj, field_name, name, value) {\n\tvar s = form_obj.elements[field_name];\n\tvar o = new Option(name, value);\n\ts.options[s.options.length] = o;\n}\n\nfunction addClassesToList(list_id, specific_option) {\n\t// Setup class droplist\n\tvar styleSelectElm = document.getElementById(list_id);\n\tvar styles = tinyMCEPopup.getParam('theme_advanced_styles', false);\n\tstyles = tinyMCEPopup.getParam(specific_option, styles);\n\n\tif (styles) {\n\t\tvar stylesAr = styles.split(';');\n\n\t\tfor (var i=0; i<stylesAr.length; i++) {\n\t\t\tif (stylesAr != \"\") {\n\t\t\t\tvar key, value;\n\n\t\t\t\tkey = stylesAr[i].split('=')[0];\n\t\t\t\tvalue = stylesAr[i].split('=')[1];\n\n\t\t\t\tstyleSelectElm.options[styleSelectElm.length] = new Option(key, value);\n\t\t\t}\n\t\t}\n\t} else {\n\t\ttinymce.each(tinyMCEPopup.editor.dom.getClasses(), function(o) {\n\t\t\tstyleSelectElm.options[styleSelectElm.length] = new Option(o.title || o['class'], o['class']);\n\t\t});\n\t}\n}\n\nfunction isVisible(element_id) {\n\tvar elm = document.getElementById(element_id);\n\n\treturn elm && elm.style.display != \"none\";\n}\n\nfunction convertRGBToHex(col) {\n\tvar re = new RegExp(\"rgb\\\\s*\\\\(\\\\s*([0-9]+).*,\\\\s*([0-9]+).*,\\\\s*([0-9]+).*\\\\)\", \"gi\");\n\n\tvar rgb = col.replace(re, \"$1,$2,$3\").split(',');\n\tif (rgb.length == 3) {\n\t\tr = parseInt(rgb[0]).toString(16);\n\t\tg = parseInt(rgb[1]).toString(16);\n\t\tb = parseInt(rgb[2]).toString(16);\n\n\t\tr = r.length == 1 ? '0' + r : r;\n\t\tg = g.length == 1 ? '0' + g : g;\n\t\tb = b.length == 1 ? '0' + b : b;\n\n\t\treturn \"#\" + r + g + b;\n\t}\n\n\treturn col;\n}\n\nfunction convertHexToRGB(col) {\n\tif (col.indexOf('#') != -1) {\n\t\tcol = col.replace(new RegExp('[^0-9A-F]', 'gi'), '');\n\n\t\tr = parseInt(col.substring(0, 2), 16);\n\t\tg = parseInt(col.substring(2, 4), 16);\n\t\tb = parseInt(col.substring(4, 6), 16);\n\n\t\treturn \"rgb(\" + r + \",\" + g + \",\" + b + \")\";\n\t}\n\n\treturn col;\n}\n\nfunction trimSize(size) {\n\treturn size.replace(/([0-9\\.]+)(px|%|in|cm|mm|em|ex|pt|pc)/i, '$1$2');\n}\n\nfunction getCSSSize(size) {\n\tsize = trimSize(size);\n\n\tif (size == \"\")\n\t\treturn \"\";\n\n\t// Add px\n\tif (/^[0-9]+$/.test(size))\n\t\tsize += 'px';\n\t// Sanity check, IE doesn't like broken values\n\telse if (!(/^[0-9\\.]+(px|%|in|cm|mm|em|ex|pt|pc)$/i.test(size)))\n\t\treturn \"\";\n\n\treturn size;\n}\n\nfunction getStyle(elm, attrib, style) {\n\tvar val = tinyMCEPopup.dom.getAttrib(elm, attrib);\n\n\tif (val != '')\n\t\treturn '' + val;\n\n\tif (typeof(style) == 'undefined')\n\t\tstyle = attrib;\n\n\treturn tinyMCEPopup.dom.getStyle(elm, style);\n}\n","Potato_Zendesk/js/tiny_mce/utils/mctabs.js":"/**\n * mctabs.js\n *\n * Copyright 2009, Moxiecode Systems AB\n * Released under LGPL License.\n *\n * License: http://tinymce.moxiecode.com/license\n * Contributing: http://tinymce.moxiecode.com/contributing\n */\n\nfunction MCTabs() {\n\tthis.settings = [];\n\tthis.onChange = tinyMCEPopup.editor.windowManager.createInstance('tinymce.util.Dispatcher');\n};\n\nMCTabs.prototype.init = function(settings) {\n\tthis.settings = settings;\n};\n\nMCTabs.prototype.getParam = function(name, default_value) {\n\tvar value = null;\n\n\tvalue = (typeof(this.settings[name]) == \"undefined\") ? default_value : this.settings[name];\n\n\t// Fix bool values\n\tif (value == \"true\" || value == \"false\")\n\t\treturn (value == \"true\");\n\n\treturn value;\n};\n\nMCTabs.prototype.showTab =function(tab){\n\ttab.className = 'current';\n\ttab.setAttribute(\"aria-selected\", true);\n\ttab.setAttribute(\"aria-expanded\", true);\n\ttab.tabIndex = 0;\n};\n\nMCTabs.prototype.hideTab =function(tab){\n\tvar t=this;\n\n\ttab.className = '';\n\ttab.setAttribute(\"aria-selected\", false);\n\ttab.setAttribute(\"aria-expanded\", false);\n\ttab.tabIndex = -1;\n};\n\nMCTabs.prototype.showPanel = function(panel) {\n\tpanel.className = 'current'; \n\tpanel.setAttribute(\"aria-hidden\", false);\n};\n\nMCTabs.prototype.hidePanel = function(panel) {\n\tpanel.className = 'panel';\n\tpanel.setAttribute(\"aria-hidden\", true);\n}; \n\nMCTabs.prototype.getPanelForTab = function(tabElm) {\n\treturn tinyMCEPopup.dom.getAttrib(tabElm, \"aria-controls\");\n};\n\nMCTabs.prototype.displayTab = function(tab_id, panel_id, avoid_focus) {\n\tvar panelElm, panelContainerElm, tabElm, tabContainerElm, selectionClass, nodes, i, t = this;\n\n\ttabElm = document.getElementById(tab_id);\n\n\tif (panel_id === undefined) {\n\t\tpanel_id = t.getPanelForTab(tabElm);\n\t}\n\n\tpanelElm= document.getElementById(panel_id);\n\tpanelContainerElm = panelElm ? panelElm.parentNode : null;\n\ttabContainerElm = tabElm ? tabElm.parentNode : null;\n\tselectionClass = t.getParam('selection_class', 'current');\n\n\tif (tabElm && tabContainerElm) {\n\t\tnodes = tabContainerElm.childNodes;\n\n\t\t// Hide all other tabs\n\t\tfor (i = 0; i < nodes.length;
2 i++) {\n\t\t\tif (nodes[i].nodeName == \"LI\") {\n\t\t\t\tt.hideTab(nodes[i]);\n\t\t\t}\n\t\t}\n\n\t\t// Show selected tab\n\t\tt.showTab(tabElm);\n\t}\n\n\tif (panelElm && panelContainerElm) {\n\t\tnodes = panelContainerElm.childNodes;\n\n\t\t// Hide all other panels\n\t\tfor (i = 0; i < nodes.length; i++) {\n\t\t\tif (nodes[i].nodeName == \"DIV\")\n\t\t\t\tt.hidePanel(nodes[i]);\n\t\t}\n\n\t\tif (!avoid_focus) { \n\t\t\ttabElm.focus();\n\t\t}\n\n\t\t// Show selected panel\n\t\tt.showPanel(panelElm);\n\t}\n};\n\nMCTabs.prototype.getAnchor = function() {\n\tvar pos, url = document.location.href;\n\n\tif ((pos = url.lastIndexOf('#')) != -1)\n\t\treturn url.substring(pos + 1);\n\n\treturn \"\";\n};\n\n\n//Global instance\nvar mcTabs = new MCTabs();\n\ntinyMCEPopup.onInit.add(function() {\n\tvar tinymce = tinyMCEPopup.getWin().tinymce, dom = tinyMCEPopup.dom, each = tinymce.each;\n\n\teach(dom.select('div.tabs'), function(tabContainerElm) {\n\t\tvar keyNav;\n\n\t\tdom.setAttrib(tabContainerElm, \"role\", \"tablist\"); \n\n\t\tvar items = tinyMCEPopup.dom.select('li', tabContainerElm);\n\t\tvar action = function(id) {\n\t\t\tmcTabs.displayTab(id, mcTabs.getPanelForTab(id));\n\t\t\tmcTabs.onChange.dispatch(id);\n\t\t};\n\n\t\teach(items, function(item) {\n\t\t\tdom.setAttrib(item, 'role', 'tab');\n\t\t\tdom.bind(item, 'click', function(evt) {\n\t\t\t\taction(item.id);\n\t\t\t});\n\t\t});\n\n\t\tdom.bind(dom.getRoot(), 'keydown', function(evt) {\n\t\t\tif (evt.keyCode === 9 && evt.ctrlKey && !evt.altKey) { // Tab\n\t\t\t\tkeyNav.moveFocus(evt.shiftKey ? -1 : 1);\n\t\t\t\ttinymce.dom.Event.cancel(evt);\n\t\t\t}\n\t\t});\n\n\t\teach(dom.select('a', tabContainerElm), function(a) {\n\t\t\tdom.setAttrib(a, 'tabindex', '-1');\n\t\t});\n\n\t\tkeyNav = tinyMCEPopup.editor.windowManager.createInstance('tinymce.ui.KeyboardNavigation', {\n\t\t\troot: tabContainerElm,\n\t\t\titems: items,\n\t\t\tonAction: action,\n\t\t\tactOnFocus: true,\n\t\t\tenableLeftRight: true,\n\t\t\tenableUpDown: true\n\t\t}, tinyMCEPopup.dom);\n\t});\n});","Potato_Zendesk/js/tiny_mce/utils/validate.js":"/**\n * validate.js\n *\n * Copyright 2009, Moxiecode Systems AB\n * Released under LGPL License.\n *\n * License: http://tinymce.moxiecode.com/license\n * Contributing: http://tinymce.moxiecode.com/contributing\n */\n\n/**\n\t// String validation:\n\n\tif (!Validator.isEmail('myemail'))\n\t\talert('Invalid email.');\n\n\t// Form validation:\n\n\tvar f = document.forms['myform'];\n\n\tif (!Validator.isEmail(f.myemail))\n\t\talert('Invalid email.');\n*/\n\nvar Validator = {\n\tisEmail : function(s) {\n\t\treturn this.test(s, '^[-!#$%&\\'*+\\\\./0-9=?A-Z^_`a-z{|}~]+@[-!#$%&\\'*+\\\\/0-9=?A-Z^_`a-z{|}~]+\\.[-!#$%&\\'*+\\\\./0-9=?A-Z^_`a-z{|}~]+$');\n\t},\n\n\tisAbsUrl : function(s) {\n\t\treturn this.test(s, '^(news|telnet|nttp|file|http|ftp|https)://[-A-Za-z0-9\\\\.]+\\\\/?.*$');\n\t},\n\n\tisSize : function(s) {\n\t\treturn this.test(s, '^[0-9.]+(%|in|cm|mm|em|ex|pt|pc|px)?$');\n\t},\n\n\tisId : function(s) {\n\t\treturn this.test(s, '^[A-Za-z_]([A-Za-z0-9_])*$');\n\t},\n\n\tisEmpty : function(s) {\n\t\tvar nl, i;\n\n\t\tif (s.nodeName == 'SELECT' && s.selectedIndex < 1)\n\t\t\treturn true;\n\n\t\tif (s.type == 'checkbox' && !s.checked)\n\t\t\treturn true;\n\n\t\tif (s.type == 'radio') {\n\t\t\tfor (i=0, nl = s.form.elements; i<nl.length; i++) {\n\t\t\t\tif (nl[i].type == \"radio\" && nl[i].name == s.name && nl[i].checked)\n\t\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}\n\n\t\treturn new RegExp('^\\\\s*$').test(s.nodeType == 1 ? s.value : s);\n\t},\n\n\tisNumber : function(s, d) {\n\t\treturn !isNaN(s.nodeType == 1 ? s.value : s) && (!d || !this.test(s, '^-?[0-9]*\\\\.[0-9]*$'));\n\t},\n\n\ttest : function(s, p) {\n\t\ts = s.nodeType == 1 ? s.value : s;\n\n\t\treturn s == '' || new RegExp(p).test(s);\n\t}\n};\n\nvar AutoValidator = {\n\tsettings : {\n\t\tid_cls : 'id',\n\t\tint_cls : 'int',\n\t\turl_cls : 'url',\n\t\tnumber_cls : 'number',\n\t\temail_cls : 'email',\n\t\tsize_cls : 'size',\n\t\trequired_cls : 'required',\n\t\tinvalid_cls : 'invalid',\n\t\tmin_cls : 'min',\n\t\tmax_cls : 'max'\n\t},\n\n\tinit : function(s) {\n\t\tvar n;\n\n\t\tfor (n in s)\n\t\t\tthis.settings[n] = s[n];\n\t},\n\n\tvalidate : function(f) {\n\t\tvar i, nl, s = this.settings, c = 0;\n\n\t\tnl = this.tags(f, 'label');\n\t\tfor (i=0; i<nl.length;
2 i++) {\n\t\t\tthis.removeClass(nl[i], s.invalid_cls);\n\t\t\tnl[i].setAttribute('aria-invalid', false);\n\t\t}\n\n\t\tc += this.validateElms(f, 'input');\n\t\tc += this.validateElms(f, 'select');\n\t\tc += this.validateElms(f, 'textarea');\n\n\t\treturn c == 3;\n\t},\n\n\tinvalidate : function(n) {\n\t\tthis.mark(n.form, n);\n\t},\n\t\n\tgetErrorMessages : function(f) {\n\t\tvar nl, i, s = this.settings, field, msg, values, messages = [], ed = tinyMCEPopup.editor;\n\t\tnl = this.tags(f, \"label\");\n\t\tfor (i=0; i<nl.length; i++) {\n\t\t\tif (this.hasClass(nl[i], s.invalid_cls)) {\n\t\t\t\tfield = document.getElementById(nl[i].getAttribute(\"for\"));\n\t\t\t\tvalues = { field: nl[i].textContent };\n\t\t\t\tif (this.hasClass(field, s.min_cls, true)) {\n\t\t\t\t\tmessage = ed.getLang('invalid_data_min');\n\t\t\t\t\tvalues.min = this.getNum(field, s.min_cls);\n\t\t\t\t} else if (this.hasClass(field, s.number_cls)) {\n\t\t\t\t\tmessage = ed.getLang('invalid_data_number');\n\t\t\t\t} else if (this.hasClass(field, s.size_cls)) {\n\t\t\t\t\tmessage = ed.getLang('invalid_data_size');\n\t\t\t\t} else {\n\t\t\t\t\tmessage = ed.getLang('invalid_data');\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tmessage = message.replace(/{\\#([^}]+)\\}/g, function(a, b) {\n\t\t\t\t\treturn values[b] || '{#' + b + '}';\n\t\t\t\t});\n\t\t\t\tmessages.push(message);\n\t\t\t}\n\t\t}\n\t\treturn messages;\n\t},\n\n\treset : function(e) {\n\t\tvar t = ['label', 'input', 'select', 'textarea'];\n\t\tvar i, j, nl, s = this.settings;\n\n\t\tif (e == null)\n\t\t\treturn;\n\n\t\tfor (i=0; i<t.length; i++) {\n\t\t\tnl = this.tags(e.form ? e.form : e, t[i]);\n\t\t\tfor (j=0; j<nl.length; j++) {\n\t\t\t\tthis.removeClass(nl[j], s.invalid_cls);\n\t\t\t\tnl[j].setAttribute('aria-invalid', false);\n\t\t\t}\n\t\t}\n\t},\n\n\tvalidateElms : function(f, e) {\n\t\tvar nl, i, n, s = this.settings, st = true, va = Validator, v;\n\n\t\tnl = this.tags(f, e);\n\t\tfor (i=0; i<nl.length; i++) {\n\t\t\tn = nl[i];\n\n\t\t\tthis.removeClass(n, s.invalid_cls);\n\n\t\t\tif (this.hasClass(n, s.required_cls) && va.isEmpty(n))\n\t\t\t\tst = this.mark(f, n);\n\n\t\t\tif (this.hasClass(n, s.number_cls) && !va.isNumber(n))\n\t\t\t\tst = this.mark(f, n);\n\n\t\t\tif (this.hasClass(n, s.int_cls) && !va.isNumber(n, true))\n\t\t\t\tst = this.mark(f, n);\n\n\t\t\tif (this.hasClass(n, s.url_cls) && !va.isAbsUrl(n))\n\t\t\t\tst = this.mark(f, n);\n\n\t\t\tif (this.hasClass(n, s.email_cls) && !va.isEmail(n))\n\t\t\t\tst = this.mark(f, n);\n\n\t\t\tif (this.hasClass(n, s.size_cls) && !va.isSize(n))\n\t\t\t\tst = this.mark(f, n);\n\n\t\t\tif (this.hasClass(n, s.id_cls) && !va.isId(n))\n\t\t\t\tst = this.mark(f, n);\n\n\t\t\tif (this.hasClass(n, s.min_cls, true)) {\n\t\t\t\tv = this.getNum(n, s.min_cls);\n\n\t\t\t\tif (isNaN(v) || parseInt(n.value) < parseInt(v))\n\t\t\t\t\tst = this.mark(f, n);\n\t\t\t}\n\n\t\t\tif (this.hasClass(n, s.max_cls, true)) {\n\t\t\t\tv = this.getNum(n, s.max_cls);\n\n\t\t\t\tif (isNaN(v) || parseInt(n.value) > parseInt(v))\n\t\t\t\t\tst = this.mark(f, n);\n\t\t\t}\n\t\t}\n\n\t\treturn st;\n\t},\n\n\thasClass : function(n, c, d) {\n\t\treturn new RegExp('\\\\b' + c + (d ? '[0-9]+' : '') + '\\\\b', 'g').test(n.className);\n\t},\n\n\tgetNum : function(n, c) {\n\t\tc = n.className.match(new RegExp('\\\\b' + c + '([0-9]+)\\\\b', 'g'))[0];\n\t\tc = c.replace(/[^0-9]/g, '');\n\n\t\treturn c;\n\t},\n\n\taddClass : function(n, c, b) {\n\t\tvar o = this.removeClass(n, c);\n\t\tn.className = b ? c + (o != '' ? (' ' + o) : '') : (o != '' ? (o + ' ') : '') + c;\n\t},\n\n\tremoveClass : function(n, c) {\n\t\tc = n.className.replace(new RegExp(\"(^|\\\\s+)\" + c + \"(\\\\s+|$)\"), ' ');\n\t\treturn n.className = c != ' ' ? c : '';\n\t},\n\n\ttags : function(f, s) {\n\t\treturn f.getElementsByTagName(s);\n\t},\n\n\tmark : function(f, n) {\n\t\tvar s = this.settings;\n\n\t\tthis.addClass(n, s.invalid_cls);\n\t\tn.setAttribute('aria-invalid', 'true');\n\t\tthis.markLabels(f, n, s.invalid_cls);\n\n\t\treturn false;\n\t},\n\n\tmarkLabels : function(f, n, ic) {\n\t\tvar nl, i;\n\n\t\tnl = this.tags(f, \"label\");\n\t\tfor (i=0; i<nl.length;
2 i++) {\n\t\t\tif (nl[i].getAttribute(\"for\") == n.id || nl[i].htmlFor == n.id)\n\t\t\t\tthis.addClass(nl[i], ic);\n\t\t}\n\n\t\treturn null;\n\t}\n};\n","Magento_Customer/js/address.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\ndefine([\n    'jquery',\n    'Magento_Ui/js/modal/confirm',\n    'jquery/ui',\n    'mage/translate'\n], function ($, confirm) {\n    'use strict';\n\n    $.widget('mage.address', {\n        /**\n         * Options common to all instances of this widget.\n         * @type {Object}\n         */\n        options: {\n            deleteConfirmMessage: $.mage.__('Are you sure you want to delete this address?')\n        },\n\n        /**\n         * Bind event handlers for adding and deleting addresses.\n         * @private\n         */\n        _create: function () {\n            var options         = this.options,\n                addAddress      = options.addAddress,\n                deleteAddress   = options.deleteAddress;\n\n            if (addAddress) {\n                $(document).on('click', addAddress, this._addAddress.bind(this));\n            }\n\n            if (deleteAddress) {\n                $(document).on('click', deleteAddress, this._deleteAddress.bind(this));\n            }\n        },\n\n        /**\n         * Add a new address.\n         * @private\n         */\n        _addAddress: function () {\n            window.location = this.options.addAddressLocation;\n        },\n\n        /**\n         * Delete the address whose id is specified in a data attribute after confirmation from the user.\n         * @private\n         * @param {jQuery.Event} e\n         * @return {Boolean}\n         */\n        _deleteAddress: function (e) {\n            var self = this;\n\n            confirm({\n                content: this.options.deleteConfirmMessage,\n                actions: {\n\n                    /** @inheritdoc */\n                    confirm: function () {\n                        if (typeof $(e.target).parent().data('address') !== 'undefined') {\n                            window.location = self.options.deleteUrlPrefix + $(e.target).parent().data('address') +\n                                '/form_key/' + $.mage.cookies.get('form_key');\n                        } else {\n                            window.location = self.options.deleteUrlPrefix + $(e.target).data('address') +\n                                '/form_key/' + $.mage.cookies.get('form_key');\n                        }\n                    }\n                }\n            });\n\n            return false;\n        }\n    });\n\n    return $.mage.address;\n});\n","Magento_Customer/js/addressValidation.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\ndefine([\n    'jquery',\n    'jquery/ui',\n    'validation'\n], function ($) {\n    'use strict';\n\n    $.widget('mage.addressValidation', {\n        options: {\n            selectors: {\n                button: '[data-action=save-address]'\n            }\n        },\n\n        /**\n         * Validation creation\n         * @protected\n         */\n        _create: function () {\n            var button = $(this.options.selectors.button, this.element);\n\n            this.element.validation({\n\n                /**\n                 * Submit Handler\n                 * @param {Element} form - address form\n                 */\n                submitHandler: function (form) {\n\n                    button.attr('disabled', true);\n                    form.submit();\n                }\n            });\n        }\n    });\n\n    return $.mage.addressValidation;\n});\n","Magento_Customer/js/change-email-password.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\ndefine([\n    'jquery',\n    'jquery/ui'\n], function ($) {\n    'use strict';\n\n    $.widget('mage.changeEmailPassword', {\n        options: {\n            changeEmailSelector: '[data-role=change-email]',\n            changePasswordSelector: '[data-role=change-password]',\n            mainContainerSelector: '[data-container=change-email-password]',\n            titleSelector: '[data-title=change-email-password]',\n            emailContainerSelector: '[data-container=change-email]',\n            newPasswordContainerSelector: '[data-container=new-password]',\n            confirmPasswordContainerSelector: '[data-container=confirm-password]',\n            currentPasswordSelector: '[data-input=current-password]',\n            emailSelector: '[data-input=change-email]',\n            newPasswordSelector: '[data-input=new-password]',\n            confirmPasswordSelector: '[data-input=confirm-password]'\n        },\n\n        /**\n         * Create widget\n         * @private\n         */\n        _create: function () {\n            this.element.on('change', $.proxy(function () {\n                this._checkChoice();\n            }, this));\n\n            this._checkChoice();\n            this._bind();\n        },\n\n        /**\n         * Event binding, will monitor change, keyup and paste events.\n         * @private\n         */\n        _bind: function () {\n            this._on($(this.options.emailSelector), {\n                'change': this._updatePasswordFieldWithEmailValue,\n                'keyup': this._updatePasswordFieldWithEmailValue,\n                'paste': this._updatePasswordFieldWithEmailValue\n            });\n        },\n\n        /**\n         * Check choice\n         * @private\n         */\n        _checkChoice: function () {\n            if ($(this.options.changeEmailSelector).is(':checked') &&\n                $(this.options.changePasswordSelector).is(':checked')) {\n                this._showAll();\n            } else if ($(this.options.changeEmailSelector).is(':checked')) {\n                this._showEmail();\n            } else if ($(this.options.changePasswordSelector).is(':checked')) {\n                this._showPassword();\n            } else {\n                this._hideAll();\n            }\n        },\n\n        /**\n         * Show email and password input fields\n         * @private\n         */\n        _showAll: function () {\n            $(this.options.titleSelector).html(this.options.titleChangeEmailAndPassword);\n\n            $(this.options.mainContainerSelector).show();\n            $(this.options.emailContainerSelector).show();\n            $(this.options.newPasswordContainerSelector).show();\n            $(this.options.confirmPasswordContainerSelector).show();\n\n            $(this.options.currentPasswordSelector).attr('data-validate', '{required:true}').prop('disabled', false);\n            $(this.options.emailSelector).attr('data-validate', '{required:true}').prop('disabled', false);\n            this._updatePasswordFieldWithEmailValue();\n            $(this.options.confirmPasswordSelector).attr(\n                'data-validate',\n                '{required:true, equalTo:\"' + this.options.newPasswordSelector + '\"}'\n            ).prop('disabled', false);\n        },\n\n        /**\n         * Hide email and password input fields\n         * @private\n         */\n        _hideAll: function () {\n            $(this.options.mainContainerSelector).hide();\n            $(this.options.emailContainerSelector).hide();\n            $(this.options.newPasswordContainerSelector).hide();\n            $(this.options.confirmPasswordContainerSelector).hide();\n\n            $(this.options.currentPasswordSelector).removeAttr('data-validate').prop('disabled', true);\n            $(this.options.emailSelector).removeAttr('data-validate').prop('disabled', true);\n            $(this.options.newPasswordSelector).removeAttr('data-validate').prop('disabled', true);\n            $(this.options.confirmPasswordSelector).removeAttr('data-validate').prop('disabled', true);\n        },\n\n        /**\n         * Show email input fields\n         * @private\n         */\n        _showEmail
2: function () {\n            this._showAll();\n            $(this.options.titleSelector).html(this.options.titleChangeEmail);\n\n            $(this.options.newPasswordContainerSelector).hide();\n            $(this.options.confirmPasswordContainerSelector).hide();\n\n            $(this.options.newPasswordSelector).removeAttr('data-validate').prop('disabled', true);\n            $(this.options.confirmPasswordSelector).removeAttr('data-validate').prop('disabled', true);\n        },\n\n        /**\n         * Show password input fields\n         * @private\n         */\n        _showPassword: function () {\n            this._showAll();\n            $(this.options.titleSelector).html(this.options.titleChangePassword);\n\n            $(this.options.emailContainerSelector).hide();\n\n            $(this.options.emailSelector).removeAttr('data-validate').prop('disabled', true);\n        },\n\n        /**\n         * Update password validation rules with email input field value\n         * @private\n         */\n        _updatePasswordFieldWithEmailValue: function () {\n            $(this.options.newPasswordSelector).attr(\n                'data-validate',\n                '{required:true, ' +\n                '\\'validate-customer-password\\':true, ' +\n                '\\'password-not-equal-to-user-name\\':\\'' + $(this.options.emailSelector).val() + '\\'}'\n            ).prop('disabled', false);\n        }\n    });\n\n    return $.mage.changeEmailPassword;\n});\n","Magento_Customer/js/checkout-balance.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\ndefine([\n    'jquery',\n    'jquery/ui'\n], function ($) {\n    'use strict';\n\n    $.widget('mage.checkoutBalance', {\n        /**\n         * Initialize store credit events\n         * @private\n         */\n        _create: function () {\n            this.eventData = {\n                price: this.options.balance,\n                totalPrice: 0\n            };\n            this.element.on('change', $.proxy(function (e) {\n                if ($(e.target).is(':checked')) {\n                    this.eventData.price = -1 * this.options.balance;\n                } else {\n                    if (this.options.amountSubstracted) { //eslint-disable-line no-lonely-if\n                        this.eventData.price = parseFloat(this.options.usedAmount);\n                        this.options.amountSubstracted = false;\n                    } else {\n                        this.eventData.price = parseFloat(this.options.balance);\n                    }\n                }\n                this.element.trigger('updateCheckoutPrice', this.eventData);\n            }, this));\n        }\n    });\n\n    return $.mage.checkoutBalance;\n});\n","Magento_Customer/js/customer-data.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    'ko',\n    'Magento_Customer/js/section-config',\n    'mage/storage',\n    'jquery/jquery-storageapi'\n], function ($, _, ko, sectionConfig) {\n    'use strict';\n\n    var options,\n        storage,\n        storageInvalidation,\n        invalidateCacheBySessionTimeOut,\n        invalidateCacheByCloseCookieSession,\n        dataProvider,\n        buffer,\n        customerData;\n\n    //TODO: remove global change, in this case made for initNamespaceStorage\n    $.cookieStorage.setConf({\n        path: '/',\n        expires: 1\n    });\n\n    storage = $.initNamespaceStorage('mage-cache-storage').localStorage;\n    storageInvalidation = $.initNamespaceStorage('mage-cache-storage-section-invalidation').localStorage;\n\n    /**\n     * @param {Object} invalidateOptions\n     */\n    invalidateCacheBySessionTimeOut = function (invalidateOptions) {\n        var date;\n\n        if (new Date($.localStorage.get('mage-cache-timeout')) < new Date()) {\n            storage.removeAll();\n            date = new Date(Date.now() + parseInt(invalidateOptions.cookieLifeTime, 10) * 1000);\n            $.localStorage.set('mage-cache-timeout', date);\n        }\n    };\n\n    /**\n     * Invalidate Cache By Close Cookie Session\n     */\n    invalidateCacheByCloseCo
2okieSession = function () {\n        if (!$.cookieStorage.isSet('mage-cache-sessid')) {\n            $.cookieStorage.set('mage-cache-sessid', true);\n            storage.removeAll();\n        }\n    };\n\n    dataProvider = {\n\n        /**\n         * @param {Object} sectionNames\n         * @return {Object}\n         */\n        getFromStorage: function (sectionNames) {\n            var result = {};\n\n            _.each(sectionNames, function (sectionName) {\n                result[sectionName] = storage.get(sectionName);\n            });\n\n            return result;\n        },\n\n        /**\n         * @param {Object} sectionNames\n         * @param {Number} updateSectionId\n         * @return {*}\n         */\n        getFromServer: function (sectionNames, updateSectionId) {\n            var parameters;\n\n            sectionNames = sectionConfig.filterClientSideSections(sectionNames);\n            parameters = _.isArray(sectionNames) ? {\n                sections: sectionNames.join(',')\n            } : [];\n            parameters['update_section_id'] = updateSectionId;\n\n            return $.getJSON(options.sectionLoadUrl, parameters).fail(function (jqXHR) {\n                throw new Error(jqXHR);\n            });\n        }\n    };\n\n    /**\n     * @param {Function} target\n     * @param {String} sectionName\n     * @return {*}\n     */\n    ko.extenders.disposableCustomerData = function (target, sectionName) {\n        var sectionDataIds, newSectionDataIds = {};\n\n        target.subscribe(function () {\n            setTimeout(function () {\n                storage.remove(sectionName);\n                sectionDataIds = $.cookieStorage.get('section_data_ids') || {};\n                _.each(sectionDataIds, function (data, name) {\n                    if (name != sectionName) { //eslint-disable-line eqeqeq\n                        newSectionDataIds[name] = data;\n                    }\n                });\n                $.cookieStorage.set('section_data_ids', newSectionDataIds);\n            }, 3000);\n        });\n\n        return target;\n    };\n\n    buffer = {\n        data: {},\n\n        /**\n         * @param {String} sectionName\n         */\n        bind: function (sectionName) {\n            this.data[sectionName] = ko.observable({});\n        },\n\n        /**\n         * @param {String} sectionName\n         * @return {Object}\n         */\n        get: function (sectionName) {\n            if (!this.data[sectionName]) {\n                this.bind(sectionName);\n            }\n\n            return this.data[sectionName];\n        },\n\n        /**\n         * @return {Array}\n         */\n        keys: function () {\n            return _.keys(this.data);\n        },\n\n        /**\n         * @param {String} sectionName\n         * @param {Object} sectionData\n         */\n        notify: function (sectionName, sectionData) {\n            if (!this.data[sectionName]) {\n                this.bind(sectionName);\n            }\n            this.data[sectionName](sectionData);\n        },\n\n        /**\n         * @param {Object} sections\n         */\n        update: function (sections) {\n            var sectionId = 0,\n                sectionDataIds = $.cookieStorage.get('section_data_ids') || {};\n\n            _.each(sections, function (sectionData, sectionName) {\n                sectionId = sectionData['data_id'];\n                sectionDataIds[sectionName] = sectionId;\n                storage.set(sectionName, sectionData);\n                storageInvalidation.remove(sectionName);\n                buffer.notify(sectionName, sectionData);\n            });\n            $.cookieStorage.set('section_data_ids', sectionDataIds);\n        },\n\n        /**\n         * @param {Object} sections\n         */\n        remove: function (sections) {\n            _.each(sections, function (sectionName) {\n                storage.remove(sectionName);\n\n                if (!sectionConfig.isClientSideSection(sectionName)) {\n                    storageInvalidation.set(sectionName, true);\n                }\n            });\n        }\n    };\n\n    customerData = {\n\n        /**\n         * Customer data initialization\n         */\n        init: function () {\n            var countryData,\n                privateContentVersion = 'private_content_version',\n                privateContent = $.cookieStorage.get(privateContentVersion),\n                localPrivateContent = $.localStorage.get(privateContentVersion),\n                needVersion = 'need_version',\n                expiredSectionNames = this.getExpiredSectionNames(),\n                isLoading = false;\n\n            if (privateContent &&\n                !$.cookieStorage.isSet(privateContentVersion) &&\n                !$.localStorage.isSet(privateContentVersion)\n            ) {\n                $.cookieStorage.set(privateContentVersion, needVersion);\n                $.localStorage.set(privateContentVersion, needVersion);\n                this.reload([], false);\n                isLoading = true;\n            } else if (localPrivateContent !== privateContent) {\n                if (!$.cookieStorage.isSet(privateContentVersion)) {\n                    privateContent = needVersion;\n                    $.cookieStorage.set(privateContentVersion, privateContent);\n                }\n                $.localStorage.set(privateContentVersion, privateContent);\n                this.reload([], false);\n                isLoading = true;\n            } else if (expiredSectionNames.length > 0) {\n                _.each(dataProvider.getFromStorage(storage.keys()), function (sectionData, sectionName) {\n                    buffer.notify(sectionName, sectionData);\n                });\n                this.reload(expiredSectionNames, false);\n            } else {\n                _.each(dataProvider.getFromStorage(storage.keys()), function (sectionData, sectionName) {\n                    buffer.notify(sectionName, sectionData);\n                });\n\n                if (!_.isEmpty(storageInvalidation.keys())) {\n                    this.reload(storageInvalidation.keys(), false);\n                }\n            }\n\n            if (!_.isEmpty(privateContent)) {\n                countryData = this.get('directory-data');\n\n                if (_.isEmpty(countryData()) && !isLoading) {\n                    customerData.reload(['directory-data'], false);\n                }\n            }\n        },\n\n        /**\n         * Retrieve the list of sections that has expired since last page reload.\n         *\n         * Sections can expire due to lifetime constraints or due to inconsistent storage information\n         * (validated by cookie data).\n         *\n         * @return {Array}\n         */\n        getExpiredSectionNames: function () {\n            var expiredSectionNames = [],\n                cookieSectionTimestamps = $.cookieStorage.get('section_data_ids') || {},\n                sectionLifetime = options.expirableSectionLifetime * 60,\n                currentTimestamp = Math.floor(Date.now() / 1000),\n                sectionData;\n\n            // process sections that can expire due to lifetime constraints\n            _.each(options.expirableSectionNames, function (sectionName) {\n                sectionData = storage.get(sectionName);\n\n                if (typeof sectionData === 'object' && sectionData['data_id'] + sectionLifetime <= currentTimestamp) {\
2n                    expiredSectionNames.push(sectionName);\n                }\n            });\n\n            // process sections that can expire due to storage information inconsistency\n            _.each(cookieSectionTimestamps, function (cookieSectionTimestamp, sectionName) {\n                sectionData = storage.get(sectionName);\n\n                if (typeof sectionData === 'undefined' ||\n                    typeof sectionData === 'object' &&\n                    cookieSectionTimestamp != sectionData['data_id'] //eslint-disable-line\n                ) {\n                    expiredSectionNames.push(sectionName);\n                }\n            });\n\n            return _.uniq(expiredSectionNames);\n        },\n\n        /**\n         * Check if some sections have to be reloaded.\n         *\n         * @deprecated Use getExpiredSectionNames instead.\n         *\n         * @return {Boolean}\n         */\n        needReload: function () {\n            var expiredSectionNames = this.getExpiredSectionNames();\n\n            return expiredSectionNames.length > 0;\n        },\n\n        /**\n         * Retrieve the list of expired keys.\n         *\n         * @deprecated Use getExpiredSectionNames instead.\n         *\n         * @return {Array}\n         */\n        getExpiredKeys: function () {\n            return this.getExpiredSectionNames();\n        },\n\n        /**\n         * @param {String} sectionName\n         * @return {*}\n         */\n        get: function (sectionName) {\n            return buffer.get(sectionName);\n        },\n\n        /**\n         * @param {String} sectionName\n         * @param {Object} sectionData\n         */\n        set: function (sectionName, sectionData) {\n            var data = {};\n\n            data[sectionName] = sectionData;\n            buffer.update(data);\n        },\n\n        /**\n         * @param {Array} sectionNames\n         * @param {Number} updateSectionId\n         * @return {*}\n         */\n        reload: function (sectionNames, updateSectionId) {\n            return dataProvider.getFromServer(sectionNames, updateSectionId).done(function (sections) {\n                $(document).trigger('customer-data-reload', [sectionNames]);\n                buffer.update(sections);\n            });\n        },\n\n        /**\n         * @param {Array} sectionNames\n         */\n        invalidate: function (sectionNames) {\n            var sectionDataIds,\n                sectionsNamesForInvalidation;\n\n            sectionsNamesForInvalidation = _.contains(sectionNames, '*') ? buffer.keys() : sectionNames;\n            $(document).trigger('customer-data-invalidate', [sectionsNamesForInvalidation]);\n            buffer.remove(sectionsNamesForInvalidation);\n            sectionDataIds = $.cookieStorage.get('section_data_ids') || {};\n\n            // Invalidate section in cookie (increase version of section with 1000)\n            _.each(sectionsNamesForInvalidation, function (sectionName) {\n                if (!sectionConfig.isClientSideSection(sectionName)) {\n                    sectionDataIds[sectionName] += 1000;\n                }\n            });\n            $.cookieStorage.set('section_data_ids', sectionDataIds);\n        },\n\n        /**\n         * @param {Object} settings\n         * @constructor\n         */\n        'Magento_Customer/js/customer-data': function (settings) {\n            options = settings;\n            invalidateCacheBySessionTimeOut(settings);\n            invalidateCacheByCloseCookieSession();\n            customerData.init();\n        }\n    };\n\n    /**\n     * Events listener\n     */\n    $(document).on('ajaxComplete', function (event, xhr, settings) {\n        var sections,\n            redirects;\n\n        if (settings.type.match(/post|put|delete/i)) {\n            sections = sectionConfig.getAffectedSections(settings.url);\n\n            if (sections) {\n                customerData.invalidate(sections);\n                redirects = ['redirect', 'backUrl'];\n\n                if (_.isObject(xhr.responseJSON) && !_.isEmpty(_.pick(xhr.responseJSON, redirects))) { //eslint-disable-line\n                    return;\n                }\n                customerData.reload(sections, true);\n            }\n        }\n    });\n\n    /**\n     * Events listener\n     */\n    $(document).on('submit', function (event) {\n        var sections;\n\n        if (event.target.method.match(/post|put|delete/i)) {\n            sections = sectionConfig.getAffectedSections(event.target.action);\n\n            if (sections) {\n                customerData.invalidate(sections);\n            }\n        }\n    });\n\n    return customerData;\n});\n","Magento_Customer/js/invalidation-processor.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\ndefine([\n    'underscore',\n    'uiElement',\n    'Magento_Customer/js/customer-data'\n], function (_, Element, customerData) {\n    'use strict';\n\n    return Element.extend({\n        /**\n         * Initialize object\n         */\n        initialize: function () {\n            this._super();\n            this.process(customerData);\n        },\n\n        /**\n         * Process all rules in loop, each rule can invali
2date some sections in customer data\n         *\n         * @param {Object} customerDataObject\n         */\n        process: function (customerDataObject) {\n            _.each(this.invalidationRules, function (rule, ruleName) {\n                _.each(rule, function (ruleArgs, rulePath) {\n                    require([rulePath], function (Rule) {\n                        var currentRule = new Rule(ruleArgs);\n\n                        if (!_.isFunction(currentRule.process)) {\n                            throw new Error('Rule ' + ruleName + ' should implement invalidationProcessor interface');\n                        }\n                        currentRule.process(customerDataObject);\n                    });\n                });\n            });\n        }\n    });\n});\n","Magento_Customer/js/logout-redirect.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 (data) {\
2n        $($.mage.redirect(data.url, 'assign', 5000));\n    };\n});\n","Magento_Customer/js/password-strength-indicator.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/zxcvbn',\n    'mage/translate',\n    'mage/validation'\n], function ($, zxcvbn, $t) {\n    'use strict';\n\n    $.widget('mage.passwordStrengthIndicator', {\n        options: {\n            cache: {},\n            passwordSelector: '[type=password]',\n            passwordStrengthMeterSelector: '[data-role=password-strength-meter]',\n            passwordStrengthMeterLabelSelector: '[data-role=password-strength-meter-label]',\n            formSelector: 'form',\n            emailSelector: 'input[type=\"email\"]'\n        },\n\n        /**\n         * Widget initialization\n         * @private\n         */\n        _create: function () {\n            this.options.cache.input = $(this.options.passwordSelector, this.element);\n            this.options.cache.meter = $(this.options.passwordStrengthMeterSelector, this.element);\n            this.options.cache.label = $(this.options.passwordStrengthMeterLabelSelector, this.element);\n\n            // We need to look outside the module for backward compatibility, since someone can already use the module.\n            // @todo Narrow this selector in 2.3 so it doesn't accidentally finds the email field from the\n            // newsletter email field or any other \"email\" field.\n            this.options.cache.email = $(this.options.formSelector).find(this.options.emailSelector);\n            this._bind();\n        },\n\n        /**\n         * Event binding, will monitor change, keyup and paste events.\n         * @private\n         */\n        _bind: function () {\n            this._on(this.options.cache.input, {\n                'change': this._calculateStrength,\n                'keyup': this._calculateStrength,\n                'paste': this._calculateStrength\n            });\n\n            if (this.options.cache.email.length) {\n                this._on(this.options.cache.email, {\n                    'change': this._calculateStrength,\n                    'keyup': this._calculateStrength,\n                    'paste': this._calculateStrength\n                });\n            }\n        },\n\n        /**\n         * Calculate password strength\n         * @private\n         */\n        _calculateStrength: function () {\n            var password = this._getPassword(),\n                isEmpty = password.length === 0,\n                zxcvbnScore,\n                displayScore,\n                isValid;\n\n            // Display score is based on combination of whether password is empty, valid, and zxcvbn strength\n            if (isEmpty) {\n                displayScore = 0;\n            } else {\n                this.options.cache.input.rules('add', {\n                    'password-not-equal-to-user-name': this.options.cache.email.val()\n                });\n\n                // We should only perform this check in case there is an email field on screen\n                if (this.options.cache.email.length &&\n                    password.toLowerCase() === this.options.cache.email.val().toLowerCase()) {\n                    displayScore = 1;\n                } else {\n                    isValid = $.validator.validateSingleElement(this.options.cache.input);\n                    zxcvbnScore = zxcvbn(password).score;\n                    displayScore = isValid ? zxcvbnScore : 1;\n                }\n            }\n\n            // Update label\n            this._displayStrength(displayScore);\n        },\n\n        /**\n         * Display strength\n         * @param {Number} displayScore\n         * @private\n         */\n        _displayStrength: function (displayScore) {\n            var strengthLabel = '',\n                className;\n\n            switch (displayScore) {\n                case 0:\n                    strengthLabel = $t('No Password');\n                    className = 'password-none';\n                    break;\n\n                case 1:\n                    strengthLabel = $t('Weak');\n                    className = 'password-weak';\n                    break;\n\n                case 2:\n                    strengthLabel = $t('Medium');\n                    className = 'password-medium';\n                    break;\n\n                case 3:\n                    strengthLabel = $t('Strong');\n                    className = 'password-strong';\n                    break;\n\n                case 4:\n                    strengthLabel = $t('Ver
2y Strong');\n                    className = 'password-very-strong';\n                    break;\n            }\n\n            this.options.cache.meter\n                .removeClass()\n                .addClass(className);\n            this.options.cache.label.text(strengthLabel);\n        },\n\n        /**\n         * Get password value\n         * @returns {*}\n         * @private\n         */\n        _getPassword: function () {\n            return this.options.cache.input.val();\n        }\n    });\n\n    return $.mage.passwordStrengthIndicator;\n});\n","Magento_Customer/js/section-config.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\ndefine(['underscore'], function (_) {\n    'use strict';\n\n    var baseUrls, sections, clientSideSections, canonize;\n\n    /**\n     * @param {String} url\n     * @return {String}\n     */\n    canonize = function (url) {\n        var route = url,\n            key;\n\n        for (key in baseUrls) { //eslint-disable-line guard-for-in\n            route = url.replace(baseUrls[key], '');\n\n            if (route != url) { //eslint-disable-line eqeqeq\n                break;\n            }\n        }\n\n        return route.replace(/^\\/?index.php\\/?/, '').toLowerCase();\n    };\n\n    return {\n        /**\n         * @param {String} url\n         * @return {Array}\n         */\n        getAffectedSections: function (url) {\n            var route = canonize(url),\n                actions = _.find(sections, function (val, section) {\n                    var matched;\n\n                    if (section.indexOf('*') >= 0) {\n                        section = section.replace(/\\*/g, '[^/]+') + '$';\n                        matched = route.match(section);\n\n                        return matched && matched[0] == route; //eslint-disable-line eqeqeq\n                    }\n\n                    return route.indexOf(section) === 0;\n                });\n\n            return _.union(_.toArray(actions), _.toArray(sections['*']));\n        },\n\n        /**\n         * @param {*} allSections\n         * @return {*}\n         */\n        filterClientSideSections: function (allSections) {\n            if (Array.isArray(allSections)) {\n                return _.difference(allSections, clientSideSections);\n            }\n\n            return allSections;\n        },\n\n        /**\n         * @param {String} sectionName\n         * @return {Boolean}\n         */\n        isClientSideSection: function (sectionName) {\n            return _.contains(clientSideSections, sectionName);\n        },\n\n        /**\n         * @param {Object} options\n         * @constructor\n         */\n        'Magento_Customer/js/section-config': function (options) {\n            baseUrls = options.baseUrls;\n            sections = options.sections;\n            clientSideSections = options.clientSideSections;\n        }\n    };\n});\n","Magento_Customer/js/action/check-email-availability.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\ndefine([\n    'mage/storage',\n    'Magento_Checkout/js/model/url-builder'\n], function (storage, urlBuilder) {\n    'use strict';\n\n    return function (deferred, email) {\n        return storage.post(\n            urlBuilder.createUrl('/customers/isEmailAvailable', {}),\n            JSON.stringify({\n                customerEmail: email\n            }),\n            false\n        ).done(function (isEmailAvailable) {\n            if (isEmailAvailable) {\n                deferred.resolve();\n            } else {\n                deferred.reject();\n            }\n        }).fail(function () {\n            deferred.reject();\n        });\n    };\n});\n","Magento_Customer/js/action/login.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\ndefine([\n    'jquery',\n    'mage/storage',\n    'Magento_Ui/js/model/messageList',\n    'Magento_Customer/js/customer-data',\n    'mage/translate'\n], function ($, storage, globalMessageList, customerData, $t) {\n    'use strict';\n\n    var callbacks = [],\n\n        /**\n         * @param {Object} loginData\n         * @param {String} redirectUrl\n         * @param {*} isGlobal\n         * @param {Object} messageContainer\n         */\n        action = function (loginData, redirectUrl, isGlobal, messageContainer) {\n            messageContainer = messageContainer || globalMessageList;\n\n            return storage.post(\n                'customer/ajax/login',\n                JSON.stringify(loginData),\n                isGlobal\n            ).done(function (response) {\n                if (response.errors) {\n                    messageContainer.addErrorMessage(response);\n                    callbacks.forEach(function (callback) {\n                        callback(loginData);\n                    });\n                } else {\n                    callbacks.forEach(function (callback) {\n                        callback(loginData);\n                    });\n                    customerData.invalidate(['customer']);\n\n                    if (response.redirectUrl) {\n                        window.location.href = response.redirectUrl;\n                    } else if (redirectUrl) {\n                        window.location.href = redirectUrl;\n                    } else {\n                        location.reload();\n                    }\n                }\n            }).fail(function () {\n                messageContainer.addErrorMessage({\n                    'message': $t('Could not authenticate. Please try again later')\n                });\n                callbacks.forEach(function (callback) {\n                    callback(loginData);\n                });\n            });\n        };\n\n    /**\n     * @param {Function} callback\n     */\n    action.registerLoginCallback = function (callback) {\n        callbacks.push(callback);\n    };\n\n    return action;\n});\n","Magento_Customer/js/invalidation-rules/website-rule.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\ndefine([\n    'uiClass'\n], function (Element) {\n    'use strict';\n\n    return Element.extend({\n\n        defaults: {\n            scopeConfig: {}\n        },\n\n        /**\n         * Takes website id from current customer data and compare it with current website id\n         * If customer belongs to another scope, we need to invali
2date current section\n         *\n         * @param {Object} customerData\n         */\n        process: function (customerData) {\n            var customer = customerData.get('customer');\n\n            if (this.scopeConfig && customer() &&\n                ~~customer().websiteId !== ~~this.scopeConfig.websiteId && ~~customer().websiteId !== 0) {\n                customerData.reload(['customer']);\n            }\n        }\n    });\n});\n","Magento_Customer/js/model/address-list.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\n/**\n * @api\n */\ndefine([\n    'ko',\n    './customer-addresses'\n], function (ko, defaultProvider) {\n    'use strict';\n\n    return ko.observableArray(defaultProvider.getAddressItems());\n});\n","Magento_Customer/js/model/authentication-popup.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\ndefine([\n    'jquery',\n    'Magento_Ui/js/modal/modal'\n], function ($, modal) {\n    'use strict';\n\n    return {\n        modalWindow: null,\n\n        /**\n         * Create popUp window for provided element\n         *\n         * @param {HTMLElement} element\n         */\n        createPopUp: function (element) {\n            var options = {\n                'type': 'popup',\n                'modalClass': 'popup-authentication',\n                'focus': '[name=username]',\n                'responsive': true,\n                'innerScroll': true,\n                'trigger': '.proceed-to-checkout',\n                'buttons': []\n            };\n\n            this.modalWindow = element;\n            modal(options, $(this.modalWindow));\n        },\n\n        /** Show login popup window */\n        showModal: function () {\n            $(this.modalWindow).modal('openModal').trigger('contentUpdated');\n        }\n    };\n});\n","Magento_Customer/js/model/customer-addresses.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    'ko',\n    './customer/address'\n], function ($, ko, Address) {\n    'use strict';\n\n    var isLoggedIn = ko.observable(window.isCustomerLoggedIn);\n\n    return {\n        /**\n         * @return {Array}\n         */\n        getAddressItems: function () {\n            var items = [],\n                customerData = window.customerData;\n\n            if (isLoggedIn()) {\n                if (Object.keys(customerData).length) {\n                    $.each(customerData.addresses, function (key, item) {\n                        items.push(new Address(item));\n                    });\n                }\n            }\n\n            return items;\n        }\n    };\n});\n","Magento_Customer/js/model/customer.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    'ko',\n    'underscore',\n    './address-list'\n], function ($, ko, _, addressList) {\n    'use strict';\n\n    var isLoggedIn = ko.observable(window.isCustomerLoggedIn),\n        customerData = {};\n\n    if (isLoggedIn()) {\n        customerData = window.customerData;\n    } else {\n        customerData = {};\n    }\n\n    return {\n        customerData: customerData,\n        customerDetails: {},\n        isLoggedIn: isLoggedIn,\n\n        /**\n         * @param {Boolean} flag\n         */\n        setIsLoggedIn: function (flag) {\n            isLoggedIn(flag);\n        },\n\n        /**\n         * @return {Array}\n         */\n        getBillingAddressList: function () {\n            return addressList();\n        },\n\n        /**\n         * @return {Array}\n         */\n        getShippingAddressList: function () {\n            return addressList();\n        },\n\n        /**\n         * @param {String} fieldName\n         * @param {*} value\n         */\n        setDetails: function (fieldName, value) {\n            if (fieldName) {\n                this.customerDetails[fieldName] = value;\n            }\n        },\n\n        /**\n         * @param {String} fieldName\n         * @return {*}\n         */\n        getDetails: function (fieldName) {\n            if (fieldName) {\n                if (this.customerDetails.hasOwnProperty(fieldName)) {\
2n                    return this.customerDetails[fieldName];\n                }\n\n                return undefined;\n            }\n\n            return this.customerDetails;\n        },\n\n        /**\n         * @param {Array} address\n         * @return {Number}\n         */\n        addCustomerAddress: function (address) {\n            var fields = [\n                    'customer_id', 'country_id', 'street', 'company', 'telephone', 'fax', 'postcode', 'city',\n                    'firstname', 'lastname', 'middlename', 'prefix', 'suffix', 'vat_id', 'default_billing',\n                    'default_shipping'\n                ],\n                customerAddress = {},\n                hasAddress = 0,\n                existingAddress;\n\n            if (!this.customerData.addresses) {\n                this.customerData.addresses = [];\n            }\n\n            customerAddress = _.pick(address, fields);\n\n            if (address.hasOwnProperty('region_id')) {\n                customerAddress.region = {\n                    'region_id': address['region_id'],\n                    region: address.region\n                };\n            }\n\n            for (existingAddress in this.customerData.addresses) {\n                if (this.customerData.addresses.hasOwnProperty(existingAddress)) {\n                    if (_.isEqual(this.customerData.addresses[existingAddress], customerAddress)) { //eslint-disable-line\n                        hasAddress = existingAddress;\n                        break;\n                    }\n                }\n            }\n\n            if (hasAddress === 0) {\n                return this.customerData.addresses.push(customerAddress) - 1;\n            }\n\n            return hasAddress;\n        },\n\n        /**\n         * @param {*} addressId\n         * @return {Boolean}\n         */\n        setAddressAsDefaultBilling: function (addressId) {\n            if (this.customerData.addresses[addressId]) {\n                this.customerData.addresses[addressId]['default_billing'] = 1;\n\n                return true;\n            }\n\n            return false;\n        },\n\n        /**\n         * @param {*} addressId\n         * @return {Boolean}\n         */\n        setAddressAsDefaultShipping: function (addressId) {\n            if (this.customerData.addresses[addressId]) {\n                this.customerData.addresses[addressId]['default_shipping'] = 1;\n\n                return true;\n            }\n\n            return false;\n        }\n    };\n});\n","Magento_Customer/js/model/customer/address.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\n/**\n * @api\n */\ndefine([], function () {\n    'use strict';\n\n    /**\n     * Returns new address object.\n     *\n     * @param {Object} addressData\n     * @return {Object}\n     */\n    return function (addressData) {\n        var regionId;\n\n        if (addressData.region['region_id'] && addressData.region['region_id'] !== '0') {\n            regionId = addressData.region['region_id'] + '';\n        }\n\n        return {\n            customerAddressId: addressData.id,\n            email: addressData.email,\n            countryId: addressData['country_id'],\n            regionId: regionId,\n            regionCode: addressData.region['region_code'],\n            region: addressData.region.region,\n            customerId: addressData['customer_id'],\n            street: addressData.street,\n            company: addressData.company,\n            telephone: addressData.telephone,\n            fax: addressData.fax,\n            postcode: addressData.postcode,\n            city: addressData.city,\n            firstname: addressData.firstname,\n            lastname: addressData.lastname,\n            middlename: addressData.middlename,\n            prefix: addressData.prefix,\n            suffix: addressData.suffix,\n            vatId: addressData['vat_id'],\n            sameAsBilling: addressData['same_as_billing'],\n            saveInAddressBook: addressData['save_in_address_book'],\n            customAttributes: addressData['custom_attributes'],\n\n            /**\n             * @return {*}\n             */\n            isDefaultShipping: function () {\n                return addressData['default_shipping'];\n            },\n\n            /**\n             * @return {*}\n             */\n            isDefaultBilling: function () {\n                return addressData['default_billing'];\n            },\n\n            /**\n             * @return {*}\n             */\n            getAddressInline: function () {\n                return addressData.inline;\n            },\n\n            /**\n             * @return {String}\n             */\n            getType: function () {\n                return 'customer-address';\n            },\n\n            /**\n             * @return {String}\n             */\n            getKey: function () {\n                return this.getType() + this.customerAddressId;\n            },\n\n            /**\n             * @return {String}\n             */\n            getCacheKey: function () {\n                return this.getKey();\n            },\n\n            /**\n             * @return {Boolean}\n             */\n            isEditable: function () {\n                return false;\n            },\n\n            /**\n             * @return {Boolean}\n             */\n            canUseForBilling: function () {\n                return true;\n            }\n        };\n    };\n});\n","Magento_Customer/js/view/authentication-popup.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\ndefine([\n    'jquery',\n    'ko',\n    'Magento_Ui/js/form/form',\n    'Magento_Customer/js/action/login',\n    'Magento_Customer/js/customer-data',\n    'Magento_Customer/js/model/authentication-popup',\n    'mage/translate',\n    'mage/url',\n    'Magento_Ui/js/modal/alert',\n    'mage/validation'\n], function ($, ko, Component, loginAction, customerData, authenticationPopup, $t, url, alert) {\n    'use strict';\n\n    return Component.extend({\n        registerUrl: window.authenticationPopup.customerRegisterUrl,\n        forgotPasswordUrl: window.authenticationPopup.customerForgotPasswordUrl,\n        autocomplete: window.authenticationPopup.autocomplete,\n        modalWindow: null,\n        isLoading: ko.observable(false),\n\n        defaults: {\n            template: 'Magento_Customer/authentication-popup'\n        },\n\n        /**\n         * Init\n         */\n        initialize: function () {\n            var self = this;\n\n            this._super();\n            url.setBaseUrl(window.authenticationPopup.baseUrl);\n            loginAction.registerLoginCallback(function () {\n                self.isLoading(false);\n            });\n        },\n\n        /** Init popup login window */\n        setModalElement: function (element) {\n            if (authenticationPopup.modalWindow == null) {\n                authenticationPopup.createPopUp(element);\n            }\n        },\n\n        /** Is login form enabled for current customer */\n        isActive: function () {\n            var customer = customerData.get('customer');\n\n            return customer() == false; //eslint-disable-line eqeqeq\n        },\n\n        /** Show login popup window */\n        showModal: function () {\n            if (this.modalWindow) {\
2n                $(this.modalWindow).modal('openModal');\n            } else {\n                alert({\n                    content: $t('Guest checkout is disabled.')\n                });\n            }\n        },\n\n        /**\n         * Provide login action\n         *\n         * @return {Boolean}\n         */\n        login: function (formUiElement, event) {\n            var loginData = {},\n                formElement = $(event.currentTarget),\n                formDataArray = formElement.serializeArray();\n\n            event.stopPropagation();\n            formDataArray.forEach(function (entry) {\n                loginData[entry.name] = entry.value;\n            });\n\n            if (formElement.validation() &&\n                formElement.validation('isValid')\n            ) {\n                this.isLoading(true);\n                loginAction(loginData);\n            }\n\n            return false;\n        }\n    });\n});\n","Magento_Customer/js/view/customer.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], function (Component, customerData) {\n    'use strict';\n\n    return Component.extend({\n        /** @inheritdoc */\n        initialize: function () {\n            this._super();\n\n            this.customer = customerData.get('customer');\n        }\n    });\n});\n","Magento_Sales/js/gift-message.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\ndefine([\n    'jquery',\n    'jquery/ui'\n], function ($) {\n    'use strict';\n\n    $.widget('mage.giftMessage', {\n        options: {\n            rowPrefix: '#order-item-row-', // Selector prefix for item's row in the table.\n            linkPrefix: '#order-item-gift-message-link-', // Selector prefix for the 'Gift Message' link.\n            duration: 100, // Toggle duration.\n            expandedClass: 'expanded', // Class added/removed to/from the 'Gift Message' link.\n            expandedContentClass: 'expanded-content', // Class added/removed to/from the 'Gift Message' content.\n            lastClass: 'last' // Class added/removed to/from the last item's row in the products table.\n        },\n\n        /**\n         * Bind a click handler on the widget's element to toggle the gift message.\n         * @private\n         */\n        _create: function () {\n            this.element.on('click', $.proxy(this._toggleGiftMessage, this));\n        },\n\n        /**\n         * Toggle the display of the item's corresponding gift message.\n         * @private\n         * @param {jQuery.Event} event - Click event.\n         */\n        _toggleGiftMessage: function (event) {\n            var element = $(event.target), // Click target. The 'Gift Message' link or 'Close' button.\n                options = this.options, // Cached widget options.\n                itemId = element.data('item-id'), // The individual item's numeric id.\n                link = $(options.linkPrefix + itemId), // The 'Gift Message' expandable link.\n                row = $(options.rowPrefix + itemId), // The item's row in the products table.\n                region = $('#' + element.attr('aria-controls')); // The gift message container region.\n\n            region.toggleClass(options.expandedContentClass, options.duration, function () {\n                if (region.attr('aria-expanded') === 'true') {\n                    region.attr('aria-expanded', 'false');\n\n                    if (region.hasClass(options.lastClass)) {\n                        row.addClass(options.lastClass);\n                    }\n                } else {\n                    region.attr('aria-expanded', 'true');\n\n                    if (region.hasClass(options.lastClass)) {\n                        row.removeClass(options.lastClass);\n                    }\n                }\n                link.toggleClass(options.expandedClass);\n            });\n            event.preventDefault(); // Prevent event propagation and avoid going to the link's href.\n        }\n    });\n\n    return $.mage.giftMessage;\n});\n","Magento_Sales/js/orders-returns.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\ndefine([\n    'jquery',\n    'jquery/ui'\n], function ($) {\n    'use strict';\n\n    $.widget('mage.ordersReturns', {\n        options: {\n            zipCode: '#oar-zip', // Search by zip code.\n            emailAddress: '#oar-email', // Search by email address.\n            searchType: '#quick-search-type-id' // Search element used for choosing between the two.\n        },\n\n        /** @inheritdoc */\n        _create: function () {\n            $(this.options.searchType).on('change', $.proxy(this._showIdentifyBlock, this)).trigger('change');\n        },\n\n        /**\n         * Show either the search by zip code option or the search by email address option.\n         * @private\n         * @param {jQuery.Event}
2 e - Change event. Event target value is either 'zip' or 'email'.\n         */\n        _showIdentifyBlock: function (e) {\n            var value = $(e.target).val();\n\n            $(this.options.zipCode).toggle(value === 'zip');\n            $(this.options.emailAddress).toggle(value === 'email');\n        }\n    });\n\n    return $.mage.ordersReturns;\n});\n","Magento_Sales/js/view/last-ordered-items.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], function (Component, customerData) {\n    'use strict';\n\n    return Component.extend({\n        /** @inheritdoc */\n        initialize: function () {\n            var isShowAddToCart = false,\n                item;\n\n            this._super();\n            this.lastOrderedItems = customerData.get('last-ordered-items');\n\n            for (item in this.lastOrderedItems.items) {\n                if (item['is_saleable']) {\n                    isShowAddToCart = true;\n                    break;\n                }\n            }\n\n            this.lastOrderedItems.isShowAddToCart = isShowAddToCart;\n        }\n    });\n});\n","Magento_Theme/menu.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n/**\n * Simple Navigation with replacing old handlers.\n *\n * @param {String} id - id of ul element with navigation lists\n * @param {Object} settings - object with settings\n */\n/**\n * global mainNav\n *\n * @deprecated\n * @see lib/web/mage/menu.js\n */\ndefine([\n    'prototype'\n], function () {\n    'use strict';\n\n    /**\n     * Main nav.\n     */\n    window.mainNav = function () {\n        var main = {\n            'obj_nav':   $(arguments[0]) || $('nav'),\n            settings:  {\n                'show_delay': 0,\n                'hide_delay': 0,\n                _ie6: /MSIE 6.+Win/.test(navigator.userAgent),\n                _ie7: /MSIE 7.+Win/.test(navigator.userAgent)\n            },\n\n            /**\n             * @param {Object} obj\n             * @param {*} level\n             */\n            init: function (obj, level) {\n                obj.lists = obj.childElements();\n                obj.lists.each(function (el, ind) {\n                    main.handlNavElement(el);\n\n                    if ((main.settings._ie6 || main.settings._ie7) && level) {\n                        main.ieFixZIndex(el, ind, obj.lists.size());\n                    }\n                });\n\n                if (main.settings._ie6 && !level) {\n                    document.execCommand('Backgroun
2dImageCache', false, true);\n                }\n            },\n\n            /**\n             * @param {Object} list\n             */\n            handlNavElement: function (list) {\n                if (list !== undefined) {\n\n                    /**\n                     * On mouse over.\n                     */\n                    list.onmouseover = function () {\n                        main.fireNavEvent(this, true);\n                    };\n\n                    /**\n                     * On mouse out.\n                     */\n                    list.onmouseout = function () {\n                        main.fireNavEvent(this, false);\n                    };\n\n                    if (list.down('ul')) {\n                        main.init(list.down('ul'), true);\n                    }\n                }\n            },\n\n            /**\n             * @param {HTMLElement} el\n             * @param {*} i\n             * @param {*} l\n             */\n            ieFixZIndex: function (el, i, l) {\n                if (el.tagName.toString().toLowerCase().indexOf('iframe') == -1) { //eslint-disable-line eqeqeq\n                    el.style.zIndex = l - i;\n                } else {\n                    el.onmouseover = 'null';\n                    el.onmouseout = 'null';\n                }\n            },\n\n            /**\n             * @param {Object} elm\n             * @param {*} ev\n             */\n            fireNavEvent: function (elm, ev) {\n                if (ev) {\n                    elm.addClassName('over');\n                    elm.down('a').addClassName('over');\n\n                    if (elm.childElements()[1]) {\n                        main.show(elm.childElements()[1]);\n                    }\n                } else {\n                    elm.removeClassName('over');\n                    elm.down('a').removeClassName('over');\n\n                    if (elm.childElements()[1]) {\n                        main.hide(elm.childElements()[1]);\n                    }\n                }\n            },\n\n            /**\n             * @param {Object} subElm\n             */\n            show: function (subElm) {\n                if (subElm['hide_time_id']) {\n                    clearTimeout(subElm['hide_time_id']);\n                }\n                subElm['show_time_id'] = setTimeout(function () {\n                    if (!subElm.hasClassName('shown-sub')) {\n                        subElm.addClassName('shown-sub');\n                    }\n                }, main.settings['show_delay']);\n            },\n\n            /**\n             * @param {Object} subElm\n             */\n            hide: function (subElm) {\n                if (subElm['show_time_id']) {\n                    clearTimeout(subElm['show_time_id']);\n                }\n                subElm['hide_time_id'] = setTimeout(function () {\n                    if (subElm.hasClassName('shown-sub')) {\n                        subElm.removeClassName('shown-sub');\n                    }\n                }, main.settings['hide_delay']);\n            }\n\n        };\n\n        if (arguments[1]) {\n            main.settings = Object.extend(main.settings, arguments[1]);\n        }\n\n        if (main['obj_nav']) {\n            main.init(main['obj_nav'], false);\n        }\n    };\n\n    document.observe('dom:loaded', function () {\n        //run navigation without delays and with default id=\"#nav\"\n        //mainNav();\n\n        //run navigation with delays\n        window.mainNav('nav', {\n            'show_delay': '100',\n            'hide_delay': '100'\n        });\n    });\n});\n","Magento_Theme/js/row-builder.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\n/**\n * JQuery UI Widget declaration: 'mage.rowBuilder'\n *\n * @api\n */\ndefine([\n    'jquery',\n    'mage/template',\n    'jquery/ui'\n], function ($, mageTemplate) {\n    'use strict';\n\n    $.widget('mage.rowBuilder', {\n\n        /**\n         * options with default values for setting up the template\n         */\n        options: {\n            //Default template options\n            rowTemplate: '#template-registrant',\n            rowContainer: '#registrant-container',\n            //Row index used by the template rows.\n            rowIndex: 0,\n            //Row count: Should not be set externally\n            rowCount: 0,\n            rowParentElem: '<li></li>',\n            rowContainerClass: 'fields',\n            addRowBtn: '#add-registrant-button',\n            btnRemoveIdPrefix: 'btn-remove',\n            btnRemoveSelector: '.btn-remove',\n            rowIdPrefix: 'row',\n            //This class is added to rows added after the first one. Adds the dotted separator\n            additionalRowClass: 'add-row',\n\n            /*\n             This is provided during widget instantiation. eg :\n             formDataPost : {\"formData\":formData,\"templateFields\":['f
2ield1-name','field2-name'] }\n             -\"formData\" is the multi-dimensional array of form field values : [['a','b'],['c','b']]\n             received from the server and encoded\n             -\"templateFields\" are the input fields in the template with index suffixed after the field name\n             eg field1-name{index}\n             */\n            formDataPost: null,\n            //Default selectors for add element of a template\n            addEventSelector: 'button',\n            //Default selectors for remove markup elements of a template\n            remEventSelector: 'a',\n            //This option allows adding first row delete option and a row separator\n            hideFirstRowAddSeparator: true,\n            //Max rows - This option should be set when instantiating the widget\n            maxRows: 1000,\n            maxRowsMsg: '#max-registrant-message'\n        },\n\n        /**\n         * Initialize create\n         * @private\n         */\n        _create: function () {\n            this.rowTemplate = mageTemplate(this.options.rowTemplate);\n\n            this.options.rowCount = this.options.rowIndex = 0;\n\n            //On document ready related tasks\n            $($.proxy(this.ready, this));\n\n            //Binding template-wide events handlers for adding and removing rows\n            this.element.on(\n                'click',\n                this.options.addEventSelector + this.options.addRowBtn,\n                $.proxy(this.handleAdd, this)\n            );\n            this.element.on(\n                'click',\n                this.options.remEventSelector + this.options.btnRemoveSelector,\n                $.proxy(this.handleRemove, this)\n            );\n        },\n\n        /**\n         * Initialize template\n         * @public\n         */\n        ready: function () {\n            if (this.options.formDataPost &&\n                this.options.formDataPost.formData &&\n                this.options.formDataPost.formData.length\n            ) {\n                this.processFormDataArr(this.options.formDataPost);\n            } else if (this.options.rowIndex === 0 && this.options.maxRows !== 0) {\n                //If no form data , then add default row\n                this.addRow(0);\n            }\n        },\n\n        /**\n         * Process and loop through all row data to create preselected values. This is used for any error on submit.\n         * For complex implementations the inheriting widget can override this behavior\n         * @public\n         * @param {Object} formDataArr\n         */\n        processFormDataArr: function (formDataArr) {\n            var formData = formDataArr.formData,\n                templateFields = formDataArr.templateFields,\n                formRow,\n                i, j;\n\n            for (i = this.options.rowIndex = 0; i < formData.length; this.options.rowIndex = i++) {\n                this.addRow(i);\n\n                formRow = formData[i];\n\n                for (j = 0; j < formRow.length; j++) {\n                    this.setFieldById(templateFields[j] + i, formRow[j]);\n                }\n            }\n\n        },\n\n        /**\n         * Initialize and create markup for template row. Add it to the parent container.\n         * The template processing will substitute row index at all places marked with _index_ in the template\n         * using the template\n         * @public\n         * @param {Number} index - current index/count of the created template. This will be used as the id\n         * @return {*}\n         */\n        addRow: function (index) {\n            var row = $(this.options.rowParentElem),\n                tmpl;\n\n            row.addClass(this.options.rowContainerClass).attr('id', this.options.rowIdPrefix + index);\n\n            tmpl = this.rowTemplate({\n                data: {\n                    _index_: index\n                }\n            });\n\n            $(tmpl).appendTo(row);\n\n            $(this.options.rowContainer).append(row).trigger('contentUpdated');\n\n            row.addClass(this.options.additionalRowClass);\n\n            //Remove 'delete' link and additionalRowClass for first row\n            if (this.options.rowIndex === 0 && this.options.hideFirstRowAddSeparator) {\n                $('#' + this._esc(this.options.btnRemoveIdPrefix) + '0').remove();\n                $('#' + this._esc(this.options.rowIdPrefix) + '0').removeClass(this.options.additionalRowClass);\n            }\n\n            this.maxRowCheck(++this.options.rowCount);\n\n            return row;\n        },\n\n        /**\n         * Remove return item information row\n         * @public\n         * @param {*} rowIndex - return item information row index\n         * @return {Boolean}\n         */\n        removeRow: function (rowIndex) {\n            $('#' + this._esc(this.options.rowIdPrefix) + rowIndex).remove();\n            this.maxRowCheck(--this.options.rowCount);\n\n            return false;\n        },\n\n        /**\n         * Function to check if maximum rows are exceeded and render/hide maxMsg and Add btn\n         * @public\n         * @param {Number} rowIndex\n         */\n        maxRowCheck: function (rowIndex) {\n            var addRowBtn = $(this.options.addRowBtn),\n                maxRowMsg = $(this.options.maxRowsMsg);\n\n            //liIndex starts from 0\n            if (rowIndex >= this.options.maxRows) {\n                addRowBtn.hide();\n                maxRowMsg.show();\n            }
2 else if (addRowBtn.is(':hidden')) {\n                addRowBtn.show();\n                maxRowMsg.hide();\n            }\n        },\n\n        /**\n         * Set the value on given element\n         * @public\n         * @param {String} domId\n         * @param {String} value\n         */\n        setFieldById: function (domId, value) {\n            var x = $('#' + this._esc(domId));\n\n            if (x.length) {\n\n                if (x.is(':checkbox')) {\n                    x.attr('checked', true);\n                } else if (x.is('option')) {\n                    x.attr('selected', 'selected');\n                } else {\n                    x.val(value);\n                }\n            }\n        },\n\n        /**\n         * Delegated handler for adding a row\n         * @public\n         * @return {Boolean}\n         */\n        handleAdd: function () {\n            this.addRow(++this.options.rowIndex);\n\n            return false;\n        },\n\n        /**\n         * Delegated handler for removing a selected row\n         * @public\n         * @param {Object} e - Native event object\n         * @return {Boolean}\n         */\n        handleRemove: function (e) {\n            this.removeRow($(e.currentTarget).closest('[id^=\"' + this.options.btnRemoveIdPrefix + '\"]')\n                .attr('id').replace(this.options.btnRemoveIdPrefix, ''));\n\n            return false;\n        },\n\n        /**\n         * Utility function to add escape chars for jquery selector strings\n         * @private\n         * @param {String} str - String to be processed\n         * @return {String}\n         */\n        _esc: function (str) {\n            return str ? str.replace(/([ ;&,.+*~\\':\"!\\^$\\[\\]()=>|\\/@])/g, '\\\\$1') : str;\n        }\n    });\n\n    return $.mage.rowBuilder;\n});\n","Magento_Theme/js/truncate.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\n/**\n * JQuery UI Widget declaration: 'mage.truncateOptions'\n *\n * @deprecated since version 2.2.0\n */\ndefine([\n    'jquery',\n    'jquery/ui'\n], function ($) {\n    'use strict';\n\n    $.widget('mage.truncateOptions', {\n        options: {\n            detailsLink: 'a.details',\n            mouseEvents: 'mouseover mouseout',\n            truncatedFullValue: 'div.truncated.full.value'\n        },\n\n        /**\n         * Establish the event handler for mouse events on the appropriate elements.\n         *\n         * @private\n         */\n        _create: function () {\n            this.element.on(this.options.mouseEvents, $.proxy(this._toggleShow, this))\n                .find(this.options.detailsLink).on(this.options.mouseEvents, $.proxy(this._toggleShow, this));\n        },\n\n        /**\n         * Toggle the \"show\" class on the associated element.\n         *\n         * @private\n         * @param {jQuery.Event} event - Mouse over/out event.\n         */\n        _toggleShow: function (event) {\n            $(event.currentTarget).find(this.options.truncatedFullValue).toggleClass('show');\n        }\n    });\n});\n","Magento_Theme/js/responsive.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\ndefine([\n    'jquery',\n    'matchMedia',\n    'mage/tabs',\n    'domReady!'\n], function ($, mediaCheck) {\n    'use strict';\n\n    mediaCheck({\n        media: '(min-width: 768px)',\n\n        /**\n         * Switch to Desktop Version.\n         */\n        entry: function () {\n            var galleryElement;\n\n            (function () {\n\n                var productInfoMain = $('.product-info-main'),\n                    productInfoAdditional = $('#product-info-additional');\n\n                if (productInfoAdditional.length) {\n                    productInfoAdditional.addClass('hidden');\n                    productInfoMain.removeClass('responsive');\n                }\n\n            })();\n\n            galleryElement = $('[data-role=media-gallery]');\n\n            if (galleryElement.length && galleryElement.data('mageZoom')) {\n                galleryElement.zoom('enable');\n            }\n\n            if (galleryElement.length && galleryElement.data('mageGallery')) {\
2n                galleryElement.gallery('option', 'disableLinks', true);\n                galleryElement.gallery('option', 'showNav', false);\n                galleryElement.gallery('option', 'showThumbs', true);\n            }\n        },\n\n        /**\n         * Switch to Mobile Version.\n         */\n        exit: function () {\n            var galleryElement;\n\n            $('.action.toggle.checkout.progress').on('click.gotoCheckoutProgress', function () {\n                var myWrapper = '#checkout-progress-wrapper';\n\n                scrollTo(myWrapper + ' .title');\n                $(myWrapper + ' .title').addClass('active');\n                $(myWrapper + ' .content').show();\n            });\n\n            $('body').on('click.checkoutProgress', '#checkout-progress-wrapper .title', function () {\n                $(this).toggleClass('active');\n                $('#checkout-progress-wrapper .content').toggle();\n            });\n\n            galleryElement = $('[data-role=media-gallery]');\n\n            setTimeout(function () {\n                if (galleryElement.length && galleryElement.data('mageZoom')) {\n                    galleryElement.zoom('disable');\n                }\n\n                if (galleryElement.length && galleryElement.data('mageGallery')) {\n                    galleryElement.gallery('option', 'disableLinks', false);\n                    galleryElement.gallery('option', 'showNav', true);\n                    galleryElement.gallery('option', 'showThumbs', false);\n                }\n            }, 2000);\n        }\n    });\n});\n","Magento_Theme/js/theme.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\ndefine([\n    'jquery',\n    'mage/smart-keyboard-handler',\n    'mage/mage',\n    'mage/ie-class-fixer',\n    'domReady!'\n], function ($, keyboardHandler) {\n    'use strict';\n\n    if ($('body').hasClass('checkout-cart-index')) {\n        if ($('#co-shipping-method-form .fieldset.rates').length > 0 &&\n            $('#co-shipping-method-form .fieldset.rates :checked').length === 0\n        ) {\n            $('#block-shipping').on('collapsiblecreate', function () {\n                $('#block-shipping').collapsible('forceActivate');\n            });\n        }\n    }\n\n    $('.cart-summary').mage('sticky', {\n        container: '#maincontent'\n    });\n\n    $('.panel.header > .header.links').clone().appendTo('#store\\\\.links');\n\n    keyboardHandler.apply();\n});\n","Magento_Theme/js/model/breadcrumb-list.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","Magento_Theme/js/view/add-home-breadcrumb.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n/* eslint-disable max-nested-callbacks, no-undef */\ndefine([\n    'jquery',\n    'Magento_Theme/js/model/breadcrumb-list',\n    'mage/translate'\n], function ($, breadcrumbList) {\n    'use strict';\n\n    /**\n     * @return {Object}\n     */\n    var homeCrumb = function () {\n        return {\n            name: 'home',\n            label: $.mage.__('Home'),\n            title: $.mage.__('Go to Home Page'),\n            link: BASE_URL || ''\n        };\n    };\n\n    return function (breadcrumb) {\n\n        breadcrumbList.unshift(homeCrumb());\n\n        return breadcrumb;\n    };\n});\n","Magento_Theme/js/view/breadcrumbs.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_Theme/js/model/breadcrumb-list',\n    'text!Magento_Theme/templates/breadcrumbs.html',\n    'jquery/ui'\n], function ($, mageTemplate, breadcrumbList, tpl) {\n    'use strict';\n\n    /**\n     * Breadcrumb Widget.\n     */\n    $.widget('mage.breadcrumbs', {\n\n        /** @inheritdoc */\n        _init: function () {\n            this._super();\n            this._render();\n        }
2,\n\n        /**\n         * Render breadcrumb.\n         *\n         * @private\n         */\n        _render: function () {\n            var html,\n                crumbs = breadcrumbList,\n                template = mageTemplate(tpl);\n\n            this._decorate(crumbs);\n\n            html = template({\n                'breadcrumbs': crumbs\n            });\n\n            if (html.length) {\n                $(this.element).html(html);\n            }\n        },\n\n        /**\n         * Decorate list.\n         *\n         * @param {Array} list\n         * @private\n         */\n        _decorate: function (list) {\n\n            if (list.length) {\n                list[0].first = true;\n            }\n\n            if (list.length > 1) {\n                list[list.length - 1].last = true;\n            }\n        }\n    });\n\n    return $.mage.breadcrumbs;\n});\n","Magento_Theme/js/view/messages.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    'uiComponent',\n    'Magento_Customer/js/customer-data',\n    'underscore',\n    'jquery/jquery-storageapi'\n], function ($, Component, customerData, _) {\n    'use strict';\n\n    return Component.extend({\n        defaults: {\n            cookieMessages: [],\n            messages: []\n        },\n\n        /**\n         * Extends Component object by storage observable messages.\n         */\n        initialize: function () {\n            this._super();\n\n            this.cookieMessages = _.unique($.cookieStorage.get('mage-messages'), 'text');\n            this.messages = customerData.get('messages').extend({\n                disposableCustomerData: 'messages'\n            });\n\n            // Force to clean obsolete messages\n            if (!_.isEmpty(this.messages().messages)) {\n                customerData.set('messages', {});\n            }\n\n            $.cookieStorage.set('mage-messages', '');\n        },\n\n        /**\n         * Display alerts && init close button\n         */\n        afterRender: function () {\n            this.displayAlert();\n            this.initCloseButton();\n        },\n\n        displayAlert: function () {\n            if (this.cookieMessages.length > 0 || (this.messages().messages && this.messages().messages.length > 0)) {\n                $('.messages').addClass('messages--visible');\n            }\n        },\n\n        initCloseButton: function() {\n            $(document).on('click', '.message-close', function () {\n                const $message = $(this).closest('.message').addClass('message--hidden');\n                setTimeout(function() {\n                    $message.remove();\n                }, 300);\n            })\n        }\n    });\n});\n","Magento_Downloadable/js/downloadable.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n/**\n * @api\n */\ndefine([\n    'jquery',\n    'jquery/ui',\n    'Magento_Catalog/js/price-box'\n], function ($) {\n    'use strict';\n\n    $.widget('mage.downloadable', {\n        options: {\n            priceHolderSelector: '.price-box'\n        },\n\n        /** @inheritdoc */\n        _create: function () {\n            var self = this;\n\n            this.element.find(this.options.linkElement).on('change', $.proxy(function () {\n                this._reloadPrice();\n            }, this));\n\n            this.element.find(this.options.allElements).on('change', function () {\n                if (this.checked) {\n                    $('label[for=\"' + this.id + '\"] > span').text($(this).attr('data-checked'));\n                    self.element.find(self.options.linkElement + ':not(:checked)').each(function () {\n                        $(this).trigger('click');\n                    });\n                } else {\n                    $('[for=\"' + this.id + '\"] > span').text($(this).attr('data-notchecked'));\n                    self.element.find(self.options.linkElement + ':checked').each(function () {\n                        $(this).trigger('click');\n                    });\n                }\n            });\n        },\n\n        /**\n         * Reload product price with selected link price included\n         * @private\n         */\n        _reloadPrice: function () {\n            var finalPrice = 0,\n                basePrice = 0;\n\n            this.element.find(this.options.linkElement + ':checked').each($.proxy(function (index, element) {\n                finalPrice += this.options.config.links[$(element).val()].finalPrice;\n                basePrice += this.options.config.links[$(element).val()].basePrice;\n            }, this));\n\n            $(this.options.priceHolderSelector).trigger('updatePrice', {\n                'prices': {\
2n                    'finalPrice': {\n                        'amount': finalPrice\n                    },\n                    'basePrice': {\n                        'amount': basePrice\n                    }\n                }\n            });\n        }\n    });\n\n    return $.mage.downloadable;\n});\n","Magento_Wishlist/js/add-to-wishlist.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\ndefine([\n    'jquery',\n    'jquery/ui'\n], function ($) {\n    'use strict';\n\n    $.widget('mage.addToWishlist', {\n        options: {\n            bundleInfo: 'div.control [name^=bundle_option]',\n            configurableInfo: '.super-attribute-select',\n            groupedInfo: '#super-product-table input',\n            downloadableInfo: '#downloadable-links-list input',\n            customOptionsInfo: '.product-custom-option',\n            qtyInfo: '#qty'\n        },\n\n        /** @inheritdoc */\n        _create: function () {\n            this._bind();\n        },\n\n        /**\n         * @private\n         */\n        _bind: function () {\n            var options = this.options,\n                dataUpdateFunc = '_updateWishlistData',\n                changeCustomOption = 'change ' + options.customOptionsInfo,\n                changeQty = 'change ' + options.qtyInfo,\n                events = {},\n                key;\n\n            if ('productType' in options) {\n                if (typeof options.productType === 'string') {\n                    options.productType = [options.productType];\n                }\n            } else {\n                options.productType = [];\n            }\n\n            events[changeCustomOption] = dataUpdateFunc;\n            events[changeQty] = dataUpdateFunc;\n\n            for (key in options.productType) {\n                if (options.productType.hasOwnProperty(key) && options.productType[key] + 'Info' in options) {\n                    events['change ' + options[options.productType[key] + 'Info']] = dataUpdateFunc;\n                }\n            }\n            this._on(events);\n        },\n\n        /**\n         * @param {jQuery.Event} event\n         * @private\n         */\n        _updateWishlistData: function (event) {\n            var dataToAdd = {},\n                isFileUploaded = false,\n                self = this;\n\n            if (event.handleObj.selector == this.options.qtyInfo) { //eslint-disable-line eqeqeq\n                this._updateAddToWishlistButton({});\n                event.stopPropagation();\n\n                return;\n            }\n            $(event.handleObj.selector).each(function (index, element) {\n                if ($(element).is('input[type=text]') ||\n                    $(element).is('input[type=email]') ||\n                    $(element).is('input[type=number]') ||\n                    $(element).is('input[type=hidden]') ||\n                    $(element).is('input[type=checkbox]:checked') ||\n                    $(element).is('input[type=radio]:checked') ||\n                    $(element).is('textarea') ||\n                    $('#' + element.id + ' option:selected').length\n                ) {\n                    dataToAdd = $.extend({}, dataToAdd, self._getElementData(element));\n\n                    return;\n                }\n\n                if ($(element).is('input[type=file]') && $(element).val()) {\n                    isFileUploaded = true;\n                }\n            });\n\n            if (isFileUploaded) {\n                this.bindFormSubmit();\n            }\n            this._updateAddToWishlistButton(dataToAdd);\n            event.stopPropagation();\n        },\n\n        /**\n         * @param {Object} dataToAdd\n         * @private\n         */\n        _updateAddToWishlistButton: function (dataToAdd) {\n            var self = this;\n\n            $('[data-action=\"add-to-wishlist\"]').each(function (index, element) {\n                var params = $(element).data('post');\n\n                if (!params) {\n                    params = {\n                        'data': {}\n                    };\n                }\n\n                params.data = $.extend({}, params.data, dataToAdd, {\n                    'qty': $(self.options.qtyInfo).val()\n                });\n                $(element).data('post', params);\n            });\n        },\n\n        /**\n         * @param {Object} array1\n         * @param {Object} array2\n         * @return {Object}\n         * @private\n         * @deprecated\n         */\n        _arrayDiffByKeys: function (array1, array2) {\n            var result = {};\n\n            $.each(array1, function (key, value) {\n                if (key.indexOf('option') === -1) {\n                    return;\n                }\n\n                if (!array2[key]) {\n                    result[key] = value;\n                }\n            });\n\n            return result;\n        },\n\n        /**\n         * @param {HTMLElement} element\n         * @return {Object}\n         * @private\n         */\n        _getElementData: function (element) {\n            var data, elementName, elementValue;\n\n            element = $(element);\n            data = {};\n            elementName = element.data('selector') ? element.data('selector') : element.attr('name');\n            elementValue = element.val();\n\n            if (element.is('select[multiple]') && elementValue !== null) {\n                if (elementName.substr(elementName.length - 2) == '[]') { //eslint-disable-line eqeqeq\n                    elementName = elementName.substring(0, elementName.length - 2);\n                }\n                $.each(elementValue, function (key, option) {\n                    data[elementName + '[' + option + ']'] = option;\n                });\n            } else {\n                if (elementValue) { //eslint-disable-line no-lonely-if\n                    if (elementName.substr(elementName.length - 2) == '[]') { //eslint-disable-line eqeqeq, max-depth\n                        elementName = elementName.substring(0, elementName.length - 2);\n\n                        if (elementValue) { //eslint-disable-line max-depth\n                            data[elementName + '[' + elementValue + ']'] = elementValue;\n                        }\n                    } else {\n                        data[elementName] = elementValue;\n                    }\n                }\n            }\n\n            return data;\n        },\n\n        /**\n         * @param {Object} params\n         * @param {Object} dataToAdd\n         * @private\n         * @deprecated\n         */\n        _removeExcessiveData: function (params, dataToAdd) {\n            var dataToRemove = this._arrayDiffByKeys(params.data, dataToAdd);\n\n            $.each(dataToRemove, function (key) {\n                delete params.data[key];\n            });\n        },\n\n        /**\n         * Bind form submit.\n         */\n        bindFormSubmit: function () {\n            var self = this;
2\n\n            $('[data-action=\"add-to-wishlist\"]').on('click', function (event) {\n                var element, params, form, action;\n\n                event.stopPropagation();\n                event.preventDefault();\n\n                element = $('input[type=file]' + self.options.customOptionsInfo);\n                params = $(event.currentTarget).data('post');\n                form = $(element).closest('form');\n                action = params.action;\n\n                if (params.data.id) {\n                    $('<input>', {\n                        type: 'hidden',\n                        name: 'id',\n                        value: params.data.id\n                    }).appendTo(form);\n                }\n\n                if (params.data.uenc) {\n                    action += 'uenc/' + params.data.uenc;\n                }\n\n                $(form).attr('action', action).submit();\n            });\n        }\n    });\n\n    return $.mage.addToWishlist;\n});\n","Magento_Wishlist/js/search.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\ndefine([\n    'jquery',\n    'jquery/ui'\n], function ($) {\n    'use strict';\n\n    $.widget('mage.wishlistSearch', {\n\n        /**\n         * Bind handlers to events\n         */\n        _create: function () {\n            this.element.on('change', $.proxy(this._toggleForm, this));\n        },\n\n        /**\n         * Toggle Form\n         * @private\n         */\n        _toggleForm: function () {\n            switch (this.element.val()) {\n                case 'name':\n                    $(this.options.emailFormSelector).hide();\n                    $(this.options.nameFormSelector).show();\n                    break;\n\n                case 'email':\n                    $(this.options.nameFormSelector).hide();\n                    $(this.options.emailFormSelector).show();\n                    break;\n                default:\n                    $(this.options.emailFormSelector).add(this.options.nameFormSelector).hide();\n            }\n        }\n    });\n\n    return $.mage.wishlistSearch;\n});\n","Magento_Wishlist/js/wishlist.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    'mage/template',\n    'Magento_Ui/js/modal/alert',\n    'jquery/ui',\n    'mage/validation/validation',\n    'mage/dataPost'\n], function ($, mageTemplate, alert) {\n    'use strict';\n\n    $.widget('mage.wishlist', {\n        options: {\n            dataAttribute: 'item-id',\n            nameFormat: 'qty[{0}]',\n            btnRemoveSelector: '[data-role=remove]',\n            qtySelector: '[data-role=qty]',\n            addToCartSelector: '[data-role=tocart]',\n            addAllToCartSelector: '[data-role=all-tocart]',\n            commentInputType: 'textarea',\n            infoList: false\n        },\n\n        /**\n         * Bind handlers to events.\n         */\n        _create: function () {\n            var _this = this;\n\n            if (!this.options.infoList) {\n                this.element\n                    .on('addToCart', function (event, context) {\n                        var urlParams;\n\n                        event.stopPropagation(event);\n                        $(context).data('stop-processing', true);\n                        urlParams = _this._getItemsToCartParams(\n                            $(context).parents('[data-row=product-item]').find(_this.options.addToCartSelector)\n                        );\n                        $.mage.dataPost().postData(urlParams);\n\n                        return false;\n                    })\n                    .on('click', this.options.btnRemoveSelector, $.proxy(function (event) {\n                        event.preventDefault();\n                        $.mage.dataPost().postData($(event.currentTarget).data('post-remove'));\n                    }, this))\n                    .on('click', this.options.addToCartSelector, $.proxy(this._beforeAddToCart, this))\n                    .on('click', this.options.addAllToCartSelector, $.proxy(this._addAllWItemsToCart, this))\n                    .on('focusin focusout', this.options.commentInputType, $.proxy(this._focusComment, this));\n            }\n\n            // Setup validation for the form\n            this.element.mage('validation', {\n                /** @inheritdoc */\n                errorPlacement: function (error, element) {\n                    error.insertAfter(element.next());\n                }\n            });\n        },\n\n        /**\n         * Process data before add to cart\n         *\n         * - update item's qty value.\n         *\n         * @param {Event} event\n         * @private\n         */\n        _beforeAddToCart: function (event) {\n            var elem = $(event.currentTarget),\n                itemId = elem.data(this.options.dataAttribute),\n                qtyName = $.validator.format(this.options.nameFormat, itemId),\n                qtyValue = elem.parents().find('[name=\"' + qtyName + '\"]').val(),\n                params = elem.data('post');\n\n            if (params) {\n                params.data = $.extend({}, params.data, {\n                    'qty': qtyValue\n                });\n                elem.data('post', params);\n            }\n        },\n\n        /**\n         * Add wish list items to cart.\n         * @private\n         * @param {jQuery} elem - clicked 'add to cart' button\n         */\n        _getItemsToCartParams: function (elem) {\n            var itemId, url, qtyName, qtyValue;
2\n\n            if (elem.data(this.options.dataAttribute)) {\n                itemId = elem.data(this.options.dataAttribute);\n                url = this.options.addToCartUrl;\n                qtyName = $.validator.format(this.options.nameFormat, itemId);\n                qtyValue = elem.parents().find('[name=\"' + qtyName + '\"]').val();\n                url.data.item = itemId;\n                url.data.qty = qtyValue;\n\n                return url;\n            }\n        },\n\n        /**\n         * Add all wish list items to cart\n         * @private\n         */\n        _addAllWItemsToCart: function () {\n            var urlParams = this.options.addAllToCartUrl,\n                separator = urlParams.action.indexOf('?') >= 0 ? '&' : '?';\n\n            this.element.find(this.options.qtySelector).each(function (index, element) {\n                urlParams.action += separator + $(element).prop('name') + '=' + encodeURIComponent($(element).val());\n                separator = '&';\n            });\n            $.mage.dataPost().postData(urlParams);\n        },\n\n        /**\n         * Toggle comment string.\n         * @private\n         * @param {Event} e\n         */\n        _focusComment: function (e) {\n            var commentInput = e.currentTarget;\n\n            if (commentInput.value === '' || commentInput.value === this.options.commentString) {\n                commentInput.value = commentInput.value === this.options.commentString ?\n                    '' : this.options.commentString;\n            }\n        }\n    });\n\n    // Extension for mage.wishlist - Select All checkbox\n    $.widget('mage.wishlist', $.mage.wishlist, {\n        options: {\n            selectAllCheckbox: '#select-all',\n            parentContainer: '#wishlist-table'\n        },\n\n        /** @inheritdoc */\n        _create: function () {\n            var selectAllCheckboxParent, checkboxCount;\n\n            this._super();\n            selectAllCheckboxParent = $(this.options.selectAllCheckbox).parents(this.options.parentContainer);\n            checkboxCount = selectAllCheckboxParent\n                .find('input:checkbox:not(' + this.options.selectAllCheckbox + ')').length;\n            // If Select all checkbox is checked, check all item checkboxes, if unchecked, uncheck all item checkboxes\n            $(this.options.selectAllCheckbox).on('click', function () {\n                selectAllCheckboxParent.find('input:checkbox').attr('checked', $(this).is(':checked'));\n            });\n            // If all item checkboxes are checked, check select all checkbox,\n            // if not all item checkboxes are checked, uncheck select all checkbox\n            selectAllCheckboxParent.on(\n                'click',\n                'input:checkbox:not(' + this.options.selectAllCheckbox + ')',\n                $.proxy(function () {\n                    var checkedCount = selectAllCheckboxParent\n                        .find('input:checkbox:checked:not(' + this.options.selectAllCheckbox + ')').length;\n\n                    $(this.options.selectAllCheckbox).attr('checked', checkboxCount === checkedCount);\n                }, this)\n            );\n        }\n    });\n    // Extension for mage.wishlist info add to cart\n    $.widget('mage.wishlist', $.mage.wishlist, {\n        /** @inheritdoc */\n        _create: function () {\n            this._super();\n\n            if (this.options.infoList) {\n                this.element.on('addToCart', $.proxy(function (event, context) {\n                    this.element.find('input:checkbox').attr('checked', false);\n                    $(context).closest('tr').find('input:checkbox').attr('checked', true);\n                    this.element.submit();\n                }, this));\n                this._checkBoxValidate();\n            }\n        },\n\n        /**\n         * validate checkbox selection.\n         * @private\n         */\n        _checkBoxValidate: function () {\n            this.element.validation({\n                submitHandler: $.proxy(function (form) {\n                    if ($(form).find('input
2:checkbox:checked').length) {\n                        form.submit();\n                    } else {\n                        alert({\n                            content: this.options.checkBoxValidationMessage\n                        });\n                    }\n                }, this)\n            });\n        }\n    });\n\n    // Extension for mage.wishlist - Add Wishlist item to Gift Registry\n    $.widget('mage.wishlist', $.mage.wishlist, {\n        options: {\n            formTmplSelector: '#form-tmpl',\n            formTmplId: '#wishlist-hidden-form'\n        },\n\n        /** @inheritdoc */\n        _create: function () {\n            var _this = this;\n\n            this._super();\n            this.element.on('click', '[data-wishlist-to-giftregistry]', function () {\n                var json = $(this).data('wishlist-to-giftregistry'),\n                    tmplJson = {\n                        item: json.itemId,\n                        entity: json.entity,\n                        url: json.url\n                    },\n                    html = mageTemplate(_this.options.formTmplSelector, {\n                        data: tmplJson\n                    });\n\n                $(html).appendTo('body');\n                $(_this.options.formTmplId).submit();\n            });\n        }\n    });\n\n    return $.mage.wishlist;\n});\n","Magento_Wishlist/js/product/addtowishlist-button.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\ndefine([\n    'Magento_Ui/js/grid/columns/column',\n    'Magento_Catalog/js/product/uenc-processor',\n    'Magento_Catalog/js/product/list/column-status-validator'\n], function (Element, uencProcessor, columnStatusValidator) {\n    'use strict';\n\n    return Element.extend({\n        defaults: {\n            label: ''\n        },\n\n        /**\n         * Get request POST data.\n         *\n         * @param {Object} row\n         * @return {String}\n         */\n        getDataPost: function (row) {\n            return uencProcessor(row['extension_attributes']['wishlist_button'].url);\n        },\n\n        /**\n         * Check if component must be shown.\n         *\n         * @return {Boolean}\n         */\n        isAllowed: function () {\n            return columnStatusValidator.isValid(this.source(), 'add_to_wishlist', 'show_buttons');\n        },\n\n        /**\n         * Get button label.\n         *\n         * @return {String}\n         */\n        getLabel: function () {\n            return this.label;\n        }\n    });\n});\n","Magento_Wishlist/js/view/wishlist.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], function (Component, customerData) {\n    'use strict';\n\n    return Component.extend({\n        /** @inheritdoc */\n        initialize: function () {\n            this._super();\n\n            this.wishlist = customerData.get('wishlist');\n        }\n    });\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/process-reviews.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    /**\n     * @param {String} url\n     * @param {*} fromPages\n     */\n    function processReviews(url, fromPages) {\n        $.ajax({\n            url: url,\n            cache: true,\n            dataType: 'html',\n            showLoader: false,\n            loaderContext: $('.product.data.items')\n        }
2).done(function (data) {\n            $('#product-review-container').html(data);\n            $('[data-role=\"product-review\"] .pages a').each(function (index, element) {\n                $(element).click(function (event) { //eslint-disable-line max-nested-callbacks\n                    processReviews($(element).attr('href'), true);\n                    event.preventDefault();\n                });\n            });\n        }).complete(function () {\n            if (fromPages == true) { //eslint-disable-line eqeqeq\n                $('html, body').animate({\n                    scrollTop: $('#reviews').offset().top - 50\n                }, 300);\n            }\n        });\n    }\n\n    return function (config) {\n        var reviewTab = $(config.reviewsTabSelector),\n            requiredReviewTabRole = 'tab';\n\n        if (reviewTab.attr('role') === requiredReviewTabRole && reviewTab.hasClass('active')) {\n            processReviews(config.productReviewUrl);\n        } else {\n            reviewTab.one('beforeOpen', function () {\n                processReviews(config.productReviewUrl);\n            });\n        }\n\n        $(function () {\n            $('.product-info-main .reviews-actions a').click(function (event) {\n                var anchor;\n\n                event.preventDefault();\n                anchor = $(this).attr('href').replace(/^.*?(#|$)/, '');\n                $('.product.data.items [data-role=\"content\"]').each(function (index) { //eslint-disable-line\n                    if (this.id == 'reviews') { //eslint-disable-line eqeqeq\n                        $('.product.data.items').tabs('activate', index);\n                        $('html, body').animate({\n                            scrollTop: $('#' + anchor).offset().top - 50\n                        }, 300);\n                    }\n                });\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/ui',\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/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_Reports/js/recently-viewed.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'\n], function ($) {\n    'use strict';\n\n    $.widget('mage.recentlyViewedProducts', {\n        options: {\n            localStorageKey: 'recently-viewed-products',\n            productBlock: '#widget_viewed_item',\n            viewedContainer: 'ol'\n        },\n\n        /**\n         * Bind events to the appropriate handlers.\n         * @private\n         */\n        _create: function () {\n            var productHtml = $(this.options.productBlock).html(),\n                productSku = $(this.options.productBlock).data('sku'),\n                products = JSON.parse(window.localStorage.getItem(this.options.localStorageKey)),\n                productsLength, maximum, showed, index;\n\n            if (products) {\n                productsLength = products.sku.length;\n                maximum = $(this.element).data('count');\n                showed = 0;\n\n                for (index = 0; index <= productsLength; index++) {\n                    if (products.sku[index] == productSku || showed >= maximum) { //eslint-disable-line\n                        products.sku.splice(index, 1);\n                        products.html.splice(index, 1);\n                    } else {\n                        $(this.element).find(this.options.viewedContainer).append(products.html[index]);\n                        $(this.element).show();\n                        showed++;\n                    }\n                }\n                $(this.element).find(this.options.productBlock).show();\n            } else {\n                products = {};\n                products.sku = [];\n                products.html = [];\n            }\n            products.sku.unshift(productSku);\n            products.html.unshift(productHtml);\n            window.localStorage.setItem(this.options.localStorageKey, JSON.stringify(products));\n        }\n    });\n\n    return $.mage.recentlyViewedProducts;\n});\n","Magento_PageCache/js/page-cache.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\ndefine([\n    'jquery',\n    'domReady',\n    'jquery/ui',\n    'mage/cookies'\n], function ($, domReady) {\
2n    'use strict';\n\n    /**\n     * Helper. Generate random string\n     * TODO: Merge with mage/utils\n     * @param {String} chars - list of symbols\n     * @param {Number} length - length for need string\n     * @returns {String}\n     */\n    function generateRandomString(chars, length) {\n        var result = '';\n\n        length = length > 0 ? length : 1;\n\n        while (length--) {\n            result += chars[Math.round(Math.random() * (chars.length - 1))];\n        }\n\n        return result;\n    }\n\n    /**\n     * Nodes tree to flat list converter\n     * @returns {Array}\n     */\n    $.fn.comments = function () {\n        var elements = [];\n\n        /**\n         * @param {jQuery} element - Comment holder\n         */\n        (function lookup(element) {\n            var iframeHostName;\n\n            // prevent cross origin iframe content reading\n            if ($(element).prop('tagName') === 'IFRAME') {\n                iframeHostName = $('<a>').prop('href', $(element).prop('src'))\n                                             .prop('hostname');\n\n                if (window.location.hostname !== iframeHostName) {\n                    return [];\n                }\n            }\n\n            $(element).contents().each(function (index, el) {\n                switch (el.nodeType) {\n                    case 1: // ELEMENT_NODE\n                        lookup(el);\n                        break;\n\n                    case 8: // COMMENT_NODE\n                        elements.push(el);\n                        break;\n\n                    case 9: // DOCUMENT_NODE\n                        lookup($(el).find('body'));\n                        break;\n                }\n            });\n        })(this);\n\n        return elements;\n    };\n\n    /**\n     * FormKey Widget - this widget is generating from key, saves it to cookie and\n     */\n    $.widget('mage.formKey', {\n        options: {\n            inputSelector: 'input[name=\"form_key\"]',\n            allowedCharacters: '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ',\n            length: 16\n        },\n\n        /**\n         * Creates widget 'mage.formKey'\n         * @private\n         */\n        _create: function () {\n            var formKey = $.mage.cookies.get('form_key');\n\n            if (!formKey) {\n                formKey = generateRandomString(this.options.allowedCharacters, this.options.length);\n                $.mage.cookies.set('form_key', formKey);\n            }\n            $(this.options.inputSelector).val(formKey);\n        }\n    });\n\n    /**\n     * PageCache Widget\n     * Handles additional ajax request for rendering user private content.\n     */\n    $.widget('mage.pageCache', {\n        options: {\n            url: '/',\n            patternPlaceholderOpen: /^ BLOCK (.+) $/,\n            patternPlaceholderClose: /^ \\/BLOCK (.+) $/,\n            versionCookieName: 'private_content_version',\n            handles: []\n        },\n\n        /**\n         * Creates widget 'mage.pageCache'\n         * @private\n         */\n        _create: function () {\n            var placeholders,\n                version = $.mage.cookies.get(this.options.versionCookieName);\n\n            if (!version) {\n                return;\n            }\n            placeholders = this._searchPlaceholders(this.element.comments());\n\n            if (placeholders && placeholders.length) {\n                this._ajax(placeholders, version);\n            }\n        },\n\n        /**\n         * Parse page for placeholders.\n         * @param {Array} elements\n         * @returns {Array}\n         * @private\n         */\n        _searchPlaceholders: function (elements) {\n            var placeholders = [],\n                tmp = {},\n                ii,\n                len,\n                el, matches, name;\n\n            if (!(elements && elements.length)) {\n                return placeholders;\n            }\n\n            for (ii = 0, len = elements.length; ii < len; ii++) {\n                el = elements[ii];\n                matches = this.options.patternPlaceholderOpen.exec(el.nodeValue);\n                name = null;\n\n                if (matches) {\n                    name = matches[1];\n                    tmp[name] = {\n                        name: name,\n                        openElement: el\n                    };\n                } else {\n                    matches = this.options.patternPlaceholderClose.exec(el.nodeValue);\n\n                    if (matches) { //eslint-disable-line max-depth\n                        name = matches[1];\n\n                        if (tmp[name]) { //eslint-disable-line max-depth\n                            tmp[name].closeElement = el;\n                            placeholders.push(tmp[name]);\n                            delete tmp[name];\n                        }\n                    }\n                }\n            }\n\n            return placeholders;\n        },\n\n        /**\n         * Parse for page and replace placeholders\n         * @param {Object} placeholder\n         * @param {Object} html\n         * @protected\n         */\n        _replacePlaceholder: function (placeholder, html) {\n            var startReplacing = false,\n                prevSibling = null,\n                parent, contents, yy, len, element;\n\n            if (!placeholder || !html) {\n                return;\n            }\n\n            parent = $(placeholder.openElement).parent();\n            contents = parent.contents();\n\n            for (yy = 0, len = contents.length; yy < len; yy++) {\n                element = contents[yy];\n\n                if (element == placeholder.openElement) { //eslint-disable-line eqeqeq\n                    startReplacing = true;\n                }\n\n                if (startReplacing) {\n                    $(element).remove();\n                } else if (element.nodeType != 8) { //eslint-disable-line eqeqeq\n                    //due to comment tag doesn't have siblings we try to find it manually\n                    prevSibling = element;\n                }\n\n                if (element == placeholder.closeElement) { //eslint-disable-line eqeqeq\n                    break;\n                }\n            }\n\n            if (prevSibling) {\n                $(prevSibling).after(html);\n            } else {\n                $(parent).prepend(html);\n            }\n\n            // trigger event to use mage-data-init attribute\n            $(parent).trigger('contentUpdated');\n        },\n\n        /**\n         * AJAX helper\n         * @param {Object} placeholders\n         * @param {String} version\n         * @private\n         */\n        _ajax: function (placeholders, version) {\n            var ii,\n                data = {\n                    blocks: [],\n                    handles: this.options.handles,\n                    originalRequest: this.options.originalRequest,\n                    version: version\n                };\n\n            for (ii = 0; ii < placeholders.length; ii++) {\n                data.blocks.push(placeholders[ii].name);\n            }\n            data.blocks = JSON.stringify(data.blocks.sort());\n            data.handles = JSON.stringify(data.handles);\n            data.originalRequest = JSON.stringify(data.originalRequest);\n            $.ajax({\n                url: this.options.url,\n                data: data,\n                type: 'GET',\n                cache: true,\n                dataType: 'json',\n                context: this,\n\n                /**\n                 * Response handler\n                 * @param {Object} response\n                 */\n                success: function (response) {\n                    var placeholder, i;\n\n                    for (i = 0; i < placeholders.length;
2 i++) {\n                        placeholder = placeholders[i];\n\n                        if (response.hasOwnProperty(placeholder.name)) {\n                            this._replacePlaceholder(placeholder, response[placeholder.name]);\n                        }\n                    }\n                }\n            });\n        }\n    });\n\n    domReady(function () {\n        $('body')\n            .formKey();\n    });\n\n    return {\n        'pageCache': $.mage.pageCache,\n        'formKey': $.mage.formKey\n    };\n});\n","Magento_Shipping/js/model/config.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 function () {\n        return window.checkoutConfig.shippingPolicy;\n    };\n});\n","Magento_Shipping/js/view/checkout/shipping/shipping-policy.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\ndefine([\n    'uiComponent',\n    'Magento_Shipping/js/model/config'\n\n], function (Component, config) {\n    'use strict';\n\n    return Component.extend({\n        defaults: {\n            template: 'Magento_Shipping/checkout/shipping/shipping-policy'\n        },\n        config: config()\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).submit();\n                }\n            }\n        ];\n\n        modalToggle(config, deleteButton);\n    };\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             * @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_CatalogSearch/js/search-terms-log.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\ndefine([\n    'jquery',\n    'mageUtils'\n], function ($, utils) {\n    'use strict';
2\n\n    return function (data) {\n        $.ajax({\n            method: 'GET',\n            url: data.url,\n            data: {\n                'q': utils.getUrlParameters(window.location.href).q\n            }\n        });\n    };\n});\n","Magento_ConfigurableProduct/js/catalog-add-to-cart.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\nrequire([\n    'jquery'\n], function ($) {\n    'use strict';\n\n    /**\n     * Add selected configurable attributes to redirect url\n     *\n     * @see Magento_Catalog/js/catalog-add-to-cart\n     */\n    $('body').on('catalogCategoryAddToCartRedirect', function (event, data) {\n        $(data.form).find('select[name*=\"super\"]').each(function (index, item) {\n            data.redirectParameters.push(item.config.id + '=' + $(item).val());\n        });\n    });\n});\n","Magento_ConfigurableProduct/js/configurable-customer-data.js":"require([\n    'jquery',\n    'Magento_ConfigurableProduct/js/options-updater'\n], function ($, Updater) {\n    'use strict';\n\n    var selectors = {\n            formSelector: '#product_addtocart_form'\n        },\n        configurableWidgetName = 'mageConfigurable',\n        widgetInitEvent = 'configurable.initialized',\n\n    /**\n    * Sets all configurable attribute's selected values\n    */\n    updateConfigurableOptions = function () {\n        var configurableWidget = $(selectors.formSelector).data(configurableWidgetName);\n\n        if (!configurableWidget) {\n            return;\n        }\n        configurableWidget.options.values = this.productOptions || {};\n        configurableWidget._configureForValues();\n    },\n    updater = new Updater(widgetInitEvent, updateConfigurableOptions);\n\n    updater.listen();\n});\n","Magento_ConfigurableProduct/js/configurable.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n/**\n * @api\n */\ndefine([\n    'jquery',\n    'underscore',\n    'mage/template',\n    'mage/translate',\n    'priceUtils',\n    'priceBox',\n    'jquery/ui',\n    'jquery/jquery.parsequery'\n], function ($, _, mageTemplate, $t, priceUtils) {\n    'use strict';\n\n    $.widget('mage.configurable', {\n        options: {\n            superSelector: '.super-attribute-select',\n            selectSimpleProduct: '[name=\"selected_configurable_option\"]',\n            priceHolderSelector: '.price-box',\n            spConfig: {},\n            state: {},\n            priceFormat: {},\n            optionTemplate: '<%- data.label %>' +\n            '<% if (typeof data.finalPrice.value !== \"undefined\") { %>' +\n            ' <%- data.finalPrice.formatted %>' +\n            '<% } %>',\n            mediaGallerySelector: '[data-gallery-role=gallery-placeholder]',\n            mediaGalleryInitial: null,\n            slyOldPriceSelector: '.sly-old-price',\n            normalPriceLabelSelector: '.normal-price .price-label',\n\n            /**\n             * Defines the mechanism of how images of a gallery should be\n             * updated when user switches between configurations of a product.\n             *\n             * As for now value of this option can be either 'replace' or 'prepend'.\n             *\n             * @type {String}\n             */\n            gallerySwitchStrategy: 'replace',\n            tierPriceTemplateSelector: '#tier-prices-template',\n            tierPriceBlockSelector: '[data-role=\"tier-price-block\"]',\n            tierPriceTemplate: ''\n        },\n\n        /**\n         * Creates widget\n         * @private\n         */\n        _create: function () {\n            // Initial setting of various option values\n            this._initializeOptions();\n\n            // Override defaults with URL query parameters and/or inputs values\n            this._overrideDefaults();\n\n            // Change events to check select reloads\n            this._setupChangeEvents();\n\n            // Fill state\n            this._fillState();\n\n            // Setup child and prev/next settings\n            this._setChildSettings();\n\n            // Setup/configure values to inputs\n            this._configureForValues();\n\n            $(this.element).trigger('configurable.initialized');\n        },\n\n        /**\n         * Initialize tax configuration, initial settings, and options values.\
2n         * @private\n         */\n        _initializeOptions: function () {\n            var options = this.options,\n                gallery = $(options.mediaGallerySelector),\n                priceBoxOptions = $(this.options.priceHolderSelector).priceBox('option').priceConfig || null;\n\n            if (priceBoxOptions && priceBoxOptions.optionTemplate) {\n                options.optionTemplate = priceBoxOptions.optionTemplate;\n            }\n\n            if (priceBoxOptions && priceBoxOptions.priceFormat) {\n                options.priceFormat = priceBoxOptions.priceFormat;\n            }\n            options.optionTemplate = mageTemplate(options.optionTemplate);\n            options.tierPriceTemplate = $(this.options.tierPriceTemplateSelector).html();\n\n            options.settings = options.spConfig.containerId ?\n                $(options.spConfig.containerId).find(options.superSelector) :\n                $(options.superSelector);\n\n            options.values = options.spConfig.defaultValues || {};\n            options.parentImage = $('[data-role=base-image-container] img').attr('src');\n\n            this.inputSimpleProduct = this.element.find(options.selectSimpleProduct);\n\n            gallery.data('gallery') ?\n                this._onGalleryLoaded(gallery) :\n                gallery.on('gallery:loaded', this._onGalleryLoaded.bind(this, gallery));\n\n        },\n\n        /**\n         * Override default options values settings with either URL query parameters or\n         * initialized inputs values.\n         * @private\n         */\n        _overrideDefaults: function () {\n            var hashIndex = window.location.href.indexOf('#');\n\n            if (hashIndex !== -1) {\n                this._parseQueryParams(window.location.href.substr(hashIndex + 1));\n            }\n\n            if (this.options.spConfig.inputsInitialized) {\n                this._setValuesByAttribute();\n            }\n        },\n\n        /**\n         * Parse query parameters from a query string and set options values based on the\n         * key value pairs of the parameters.\n         * @param {*} queryString - URL query string containing query parameters.\n         * @private\n         */\n        _parseQueryParams: function (queryString) {\n            var queryParams = $.parseQuery({\n                query: queryString\n            });\n\n            $.each(queryParams, $.proxy(function (key, value) {\n                this.options.values[key] = value;\n            }, this));\n        },\n\n        /**\n         * Override default options values with values based on each element's attribute\n         * identifier.\n         * @private\n         */\n        _setValuesByAttribute: function () {\n            this.options.values = {};\n            $.each(this.options.settings, $.proxy(function (index, element) {\n                var attributeId;\n\n                if (element.value) {\n                    attributeId = element.id.replace(/[a-z]*/, '');\n                    this.options.values[attributeId] = element.value;\n                }\n            }, this));\n        },\n\n        /**\n         * Set up .on('change') events for each option element to configure the option.\n         * @private\n         */\n        _setupChangeEvents: function () {\n            $.each(this.options.settings, $.proxy(function (index, element) {\n                $(element).on('change', this, this._configure);\n            }, this));\n        },\n\n        /**\n         * Iterate through the option settings and set each option's element configuration,\n         * attribute identifier. Set the state based on the attribute identifier.\n         * @private\n         */\n        _fillState: function () {\n            $.each(this.options.settings, $.proxy(function (index, element) {\n                var attributeId = element.id.replace(/[a-z]*/, '');\n\n                if (attributeId && this.options.spConfig.attributes[attributeId]) {\n                    element.config = this.options.spConfig.attributes[attributeId];\n                    element.attributeId = attributeId;\n                    this.options.state[attributeId] = false;\n                }\n            }, this));\n        },\n\n        /**\n         * Set each option's child settings, and next/prev option setting. Fill (initialize)\n         * an option's list of selections as 
2needed or disable an option's setting.\n         * @private\n         */\n        _setChildSettings: function () {\n            var childSettings = [],\n                settings = this.options.settings,\n                index = settings.length,\n                option;\n\n            while (index--) {\n                option = settings[index];\n\n                if (index) {\n                    option.disabled = true;\n                } else {\n                    this._fillSelect(option);\n                }\n\n                _.extend(option, {\n                    childSettings: childSettings.slice(),\n                    prevSetting: settings[index - 1],\n                    nextSetting: settings[index + 1]\n                });\n\n                childSettings.push(option);\n            }\n        },\n\n        /**\n         * Setup for all configurable option settings. Set the value of the option and configure\n         * the option, which sets its state, and initializes the option's choices, etc.\n         * @private\n         */\n        _configureForValues: function () {\n            if (this.options.values) {\n                this.options.settings.each($.proxy(function (index, element) {\n                    var attributeId = element.attributeId;\n\n                    element.value = this.options.values[attributeId] || '';\n                    this._configureElement(element);\n                }, this));\n            }\n        },\n\n        /**\n         * Event handler for configuring an option.\n         * @private\n         * @param {Object} event - Event triggered to configure an option.\n         */\n        _configure: function (event) {\n            event.data._configureElement(this);\n        },\n\n        /**\n         * Configure an option, initializing it's state and enabling related options, which\n         * populates the related option's selection and resets child option selections.\n         * @private\n         * @param {*} element - The element associated with a configurable option.\n         */\n        _configureElement: function (element) {\n            this.simpleProduct = this._getSimpleProductId(element);\n\n            if (element.value) {\n                this.options.state[element.config.id] = element.value;\n\n                if (element.nextSetting) {\n                    element.nextSetting.disabled = false;\n                    this._fillSelect(element.nextSetting);\n                    this._resetChildren(element.nextSetting);\n                } else {\n                    if (!!document.documentMode) { //eslint-disable-line\n                        this.inputSimpleProduct.val(element.options[element.selectedIndex].config.allowedProducts[0]);\n                    } else {\n                        this.inputSimpleProduct.val(element.selectedOptions[0].config.allowedProducts[0]);\n                    }\n                }\n            } else {\n                this._resetChildren(element);\n            }\n\n            this._reloadPrice();\n            this._displayRegularPriceBlock(this.simpleProduct);\n            this._displayTierPriceBlock(this.simpleProduct);\n            this._displayNormalPriceLabel();\n            this._changeProductImage();\n        },\n\n        /**\n         * Change displayed product image according to chosen options of configurable product\n         *\n         * @private\n         */\n        _changeProductImage: function () {\n            var images,\n                initialImages = this.options.mediaGalleryInitial,\n                galleryObject = $(this.options.mediaGallerySelector).data('gallery');\n\n            if (!galleryObject) {\n                return;\n            }\n\n            images = this.options.spConfig.images[this.simpleProduct];\n\n            if (images) {\n                if (this.options.gallerySwitchStrategy === 'prepend') {\n                    images = images.concat(initialImages);\n                }\n\n                images = $.extend(true, [], images);\n                images = this._setImageIndex(images);\n\n                galleryObject.updateData(images);\n\n                $(this.options.mediaGallerySelector).AddFotoramaVideoEvents({\n                    selectedOption: this.simpleProduct,\n                    dataMergeStrategy: this.options.gallerySwitchStrategy\n                });\n            } else {\n                galleryObject.updateData(initialImages);\n                $(this.options.mediaGallerySelector).AddFotoramaVideoEvents();\n            }\n\n            galleryObject.first();\n        },\n\n        /**\n         * Set correct indexes for image set.\n         *\n         * @param {Array} images\n         * @private\n         */\n        _setImageIndex: function (images) {\n            var length = images.length,\n                i;\n\n            for (i = 0; length > i;
2 i++) {\n                images[i].i = i + 1;\n            }\n\n            return images;\n        },\n\n        /**\n         * For a given option element, reset all of its selectable options. Clear any selected\n         * index, disable the option choice, and reset the option's state if necessary.\n         * @private\n         * @param {*} element - The element associated with a configurable option.\n         */\n        _resetChildren: function (element) {\n            if (element.childSettings) {\n                _.each(element.childSettings, function (set) {\n                    set.selectedIndex = 0;\n                    set.disabled = true;\n                });\n\n                if (element.config) {\n                    this.options.state[element.config.id] = false;\n                }\n            }\n        },\n\n        /**\n         * Populates an option's selectable choices.\n         * @private\n         * @param {*} element - Element associated with a configurable option.\n         */\n        _fillSelect: function (element) {\n            var attributeId = element.id.replace(/[a-z]*/, ''),\n                options = this._getAttributeOptions(attributeId),\n                prevConfig,\n                index = 1,\n                allowedProducts,\n                i,\n                j;\n\n            this._clearSelect(element);\n            element.options[0] = new Option('', '');\n            element.options[0].innerHTML = this.options.spConfig.chooseText;\n            prevConfig = false;\n\n            if (element.prevSetting) {\n                prevConfig = element.prevSetting.options[element.prevSetting.selectedIndex];\n            }\n\n            if (options) {\n                for (i = 0; i < options.length; i++) {\n                    allowedProducts = [];\n\n                    /* eslint-disable max-depth */\n                    if (prevConfig) {\n                        for (j = 0; j < options[i].products.length; j++) {\n                            // prevConfig.config can be undefined\n                            if (prevConfig.config &&\n                                prevConfig.config.allowedProducts &&\n                                prevConfig.config.allowedProducts.indexOf(options[i].products[j]) > -1) {\n                                allowedProducts.push(options[i].products[j]);\n                            }\n                        }\n                    } else {\n                        allowedProducts = options[i].products.slice(0);\n                    }\n\n                    if (allowedProducts.length > 0) {\n                        options[i].allowedProducts = allowedProducts;\n                        element.options[index] = new Option(this._getOptionLabel(options[i]), options[i].id);\n\n                        if (typeof options[i].price !== 'undefined') {\n                            element.options[index].setAttribute('price', options[i].prices);\n                        }\n\n                        element.options[index].config = options[i];\n                        index++;\n                    }\n\n                    /* eslint-enable max-depth */\n                }\n            }\n        },\n\n        /**\n         * Generate the label associated with a configurable option. This includes the option's\n         * label or value and the option's price.\n         * @private\n         * @param {*} option - A single choice among a group of choices for a configurable option.\n         * @return {String} The option label with option value and price (e.g. Black +1.99)\n         */\n        _getOptionLabel: function (option) {\n            return option.label;\n        },\n\n        /**\n         * Removes an option's selections.\n         * @private\n         * @param {*} element - The element associated with a configurable option.\n         */\n        _clearSelect: function (element) {\n            var i;\n\n            for (i = element.options.length - 1; i >= 0; i--) {\n                element.remove(i);\n            }\n        },\n\n        /**\n         * Retrieve the attribute options associated with a specific attribute Id.\n         * @private\n         * @param {Number} attributeId - The id of the attribute whose configurable options are sought.\n         * @return {Object} Object containing the attribute options.\n         */\n        _getAttributeOptions: function (attributeId) {\n            if (this.options.spConfig.attributes[attributeId]) {\n                return this.options.spConfig.attributes[attributeId].options;\n            }\n        },\n\n        /**\n         * Reload the price of the configurable product incorporating the prices of all of the\n         * configurable product's option selections.\n         */\n        _reloadPrice: function () {\n            $(this.options.priceHolderSelector).trigger('updatePrice', this._getPrices());\n        },\n\n        /**\n         * Get product various prices\n         * @returns {{}}\n         * @private\n         */\n        _getPrices: function () {\n            var prices = {},\n                elements = _.toArray(this.options.settings),\n                hasProductPrice = false;\n\n            _.each(elements, function (element) {\n                var selected = element.options[element.selectedIndex],\n                    config = selected && selected.config,\n                    priceValue = {};\n\n                if (config && config.allowedProducts.length === 1 && !hasProductPrice) {\n                    priceValue = this._calculatePrice(config);\n                    hasProductPrice = true;\n                }\n\n                prices[element.attributeId] = priceValue;\n            }, this);\n\n            return prices;\n        },\n\n        /**\n         * Returns prices for configured products\n         *\n         * @param {*} config - Products configuration\n         * @returns {*}\n         * @private\n         */\n        _calculatePrice: function (config) {\n            var displayPrices = $(this.options.priceHolderSelector).priceBox('option').prices,\n                newPrices = this.options.spConfig.optionPrices[_.first(config.allowedProducts)];\n\n            _.each(displayPrices, function (price, code) {\n                if (newPrices[code]) {\n                    displayPrices[code].amount = newPrices[code].amount - displayPrices[code].amount;
2\n                }\n            });\n\n            return displayPrices;\n        },\n\n        /**\n         * Returns Simple product Id\n         *  depending on current selected option.\n         *\n         * @private\n         * @param {HTMLElement} element\n         * @returns {String|undefined}\n         */\n        _getSimpleProductId: function (element) {\n            // TODO: Rewrite algorithm. It should return ID of\n            //        simple product based on selected options.\n            var allOptions = element.config.options,\n                value = element.value,\n                config;\n\n            config = _.filter(allOptions, function (option) {\n                return option.id === value;\n            });\n            config = _.first(config);\n\n            return _.isEmpty(config) ?\n                undefined :\n                _.first(config.allowedProducts);\n\n        },\n\n        /**\n         * Show or hide regular price block\n         *\n         * @param {*} optionId\n         * @private\n         */\n        _displayRegularPriceBlock: function (optionId) {\n            var shouldBeShown = true;\n\n            _.each(this.options.settings, function (element) {\n                if (element.value === '') {\n                    shouldBeShown = false;\n                }\n            });\n\n            if (shouldBeShown &&\n                this.options.spConfig.optionPrices[optionId].oldPrice.amount !==\n                this.options.spConfig.optionPrices[optionId].finalPrice.amount\n            ) {\n                $(this.options.slyOldPriceSelector).show();\n            } else {\n                $(this.options.slyOldPriceSelector).hide();\n            }\n        },\n\n        /**\n         * Show or hide normal price label\n         *\n         * @private\n         */\n        _displayNormalPriceLabel: function () {\n            var shouldBeShown = false;\n\n            _.each(this.options.settings, function (element) {\n                if (element.value === '') {\n                    shouldBeShown = true;\n                }\n            });\n\n            if (shouldBeShown) {\n                $(this.options.normalPriceLabelSelector).show();\n            } else {\n                $(this.options.normalPriceLabelSelector).hide();\n            }\n        },\n\n        /**\n         * Callback which fired after gallery gets initialized.\n         *\n         * @param {HTMLElement} element - DOM element associated with gallery.\n         */\n        _onGalleryLoaded: function (element) {\n            var galleryObject = element.data('gallery');\n\n            this.options.mediaGalleryInitial = galleryObject.returnCurrentImages();\n        },\n\n        /**\n         * Show or hide tier price block\n         *\n         * @param {*} optionId\n         * @private\n         */\n        _displayTierPriceBlock: function (optionId) {\n            var options, tierPriceHtml;\n\n            if (typeof optionId != 'undefined' &&\n                this.options.spConfig.optionPrices[optionId].tierPrices != [] // eslint-disable-line eqeqeq\n            ) {\n                options = this.options.spConfig.optionPrices[optionId];\n\n                if (this.options.tierPriceTemplate) {\n                    tierPriceHtml = mageTemplate(this.options.tierPriceTemplate, {\n                        'tierPrices': options.tierPrices,\n                        '$t': $t,\n                        'currencyFormat': this.options.spConfig.currencyFormat,\n                        'priceUtils': priceUtils\n                    });\n                    $(this.options.tierPriceBlockSelector).html(tierPriceHtml).show();\n                }\n            } else {\n                $(this.options.tierPriceBlockSelector).hide();\n            }\n        }\n    });\n\n    return $.mage.configurable;\n});\n","Magento_ConfigurableProduct/js/options-updater.js":"define([\n    'jquery',\n    'underscore',\n    'Magento_Customer/js/customer-data'\n], function ($, _, customerData) {\n    'use strict';\n\n    var selectors = {\n        formSelector: '#product_addtocart_form',\n        productIdSelector: '#product_addtocart_form [name=\"product\"]',\n        itemIdSelector: '#product_addtocart_form [name=\"item\"]'\n    },\n    cartData = customerData.get('cart'),\n    productId = $(selectors.productIdSelector).val(),\n    itemId = $(selectors.itemIdSelector).val(),\n\n    /**\n    * set productOptions according to cart data from customer-data\n    *\n    * @param {Object} data - cart data from customer-data\n    * @returns {Boolean} - whether the new options differ from previous\n    */\n    setProductOptions = function (data) {\
2n        var changedProductOptions;\n\n        if (!(data && data.items && data.items.length && productId)) {\n            return false;\n        }\n        changedProductOptions = _.find(data.items, function (item) {\n            if (item['item_id'] === itemId) {\n                return item['product_id'] === productId;\n            }\n        });\n        changedProductOptions = changedProductOptions && changedProductOptions.options &&\n            changedProductOptions.options.reduce(function (obj, val) {\n                obj[val['option_id']] = val['option_value'];\n\n                return obj;\n            }, {});\n\n        if (JSON.stringify(this.productOptions || {}) === JSON.stringify(changedProductOptions || {})) {\n            return false;\n        }\n\n        this.productOptions = changedProductOptions;\n\n        return true;\n    },\n\n    /**\n    * Listens to update of cart data or options initialization and update selected option according to customer data\n    *\n    */\n    listen = function () {\n        cartData.subscribe(function (updateCartData) {\n            if (this.setProductOptions(updateCartData)) {\n                this.updateOptions();\n            }\n        }.bind(this));\n        $(selectors.formSelector).on(this.eventName, function () {\n            this.setProductOptions(cartData());\n            this.updateOptions();\n        }.bind(this));\n    },\n\n    /**\n    * Updater constructor function\n    *\n    */\n    Updater = function (eventName, updateOptionsCallback) {\n        if (this instanceof Updater) {\n            this.eventName = eventName;\n            this.updateOptions = updateOptionsCallback;\n            this.productOptions = {};\n        }\n    };\n\n    Updater.prototype.setProductOptions = setProductOptions;\n    Updater.prototype.listen = listen;\n\n    return Updater;\n});\n","Magento_InstantPurchase/js/view/instant-purchase.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\ndefine([\n    'ko',\n    'jquery',\n    'underscore',\n    'uiComponent',\n    'Magento_Ui/js/modal/confirm',\n    'Magento_Customer/js/customer-data',\n    'mage/url',\n    'mage/template',\n    'mage/translate',\n    'text!Magento_InstantPurchase/template/confirmation.html',\n    'mage/validation'\n], function (ko, $, _, Component, confirm, customerData, urlBuilder, mageTemplate, $t, confirmationTemplate) {\n    'use strict';\n\n    return Component.extend({\n        defaults: {\n            template: 'Magento_InstantPurchase/instant-purchase',\n            buttonText: $t('Instant Purchase'),\n            purchaseUrl: urlBuilder.build('instantpurchase/button/placeOrder'),\n            showButton: false,\n            paymentToken: null,\n            shippingAddress: null,\n            billingAddress: null,\n            shippingMethod: null,\n            productFormSelector: '#product_addtocart_form',\n            confirmationTitle: $t('Instant Purchase Confirmation'),\n            confirmationData: {\n                message: $t('Are you sure you want to place order and pay?'),\n                shippingAddressTitle: $t('Shipping Address'),\n                billingAddressTitle: $t('Billing Address'),\n                paymentMethodTitle: $t('Payment Method'),\n                shippingMethodTitle: $t('Shipping Method')\n            }\n        },\n\n        /** @inheritdoc */\n        initialize: function () {\n            var instantPurchase = customerData.get('instant-purchase');\n\n            this._super();\n\n            this.setPurchaseData(instantPurchase());\n            instantPurchase.subscribe(this.setPurchaseData, this);\n        },\n\n        /** @inheritdoc */\n        initObservable: function () {\n            this._super()\n                .observe('showButton paymentToken shippingAddress billingAddress shippingMethod');\n\n            return this;\n        },\n\n        /**\n         * Set data from customerData.\n         *\n         * @param {Object}
2 data\n         */\n        setPurchaseData: function (data) {\n            this.showButton(data.available);\n            this.paymentToken(data.paymentToken);\n            this.shippingAddress(data.shippingAddress);\n            this.billingAddress(data.billingAddress);\n            this.shippingMethod(data.shippingMethod);\n        },\n\n        /**\n         * Confirmation method\n         */\n        instantPurchase: function () {\n            var form = $(this.productFormSelector),\n                confirmTemplate = mageTemplate(confirmationTemplate),\n                confirmData = _.extend({}, this.confirmationData, {\n                    paymentToken: this.paymentToken().summary,\n                    shippingAddress: this.shippingAddress().summary,\n                    billingAddress: this.billingAddress().summary,\n                    shippingMethod: this.shippingMethod().summary\n                });\n\n            if (!(form.validation() && form.validation('isValid'))) {\n                return;\n            }\n\n            confirm({\n                title: this.confirmationTitle,\n                content: confirmTemplate({\n                    data: confirmData\n                }),\n                actions: {\n                    /** @inheritdoc */\n                    confirm: function () {\n                        $.ajax({\n                            url: this.purchaseUrl,\n                            data: form.serialize(),\n                            type: 'post',\n                            dataType: 'json',\n\n                            /** Show loader before send */\n                            beforeSend: function () {\n                                $('body').trigger('processStart');\n                            }\n                        }).always(function () {\n                            $('body').trigger('processStop');\n                        });\n                    }.bind(this)\n                }\n            });\n        }\n    });\n});\n","Magento_Paypal/js/order-review.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\ndefine([\n    'jquery',\n    'Magento_Ui/js/modal/alert',\n    'jquery/ui',\n    'mage/translate',\n    'mage/mage',\n    'mage/validation'\n], function ($, alert) {\n    'use strict';\n\n    $.widget('mage.orderReview', {\n        options: {\n            orderReviewSubmitSelector: '#review-button',\n            shippingSelector: '#shipping_method',\n            shippingSubmitFormSelector: null,\n            updateOrderSelector: '#update-order',\n            billingAsShippingSelector: '#billing\\\\:as_shipping',\n            updateContainerSelector: '#details-reload',\n            waitLoadingContainer: '#review-please-wait',\n            shippingMethodContainer: '#shipping-method-container',\n            agreementSelector: 'div.checkout-agreements input',\n            isAjax: false,\n            updateShippingMethodSubmitSelector: '#update-shipping-method-submit',\n            reviewSubmitSelector: '#review-submit',\n            shippingMethodUpdateUrl: null,\n            updateOrderSubmitUrl: null,\n            canEditShippingMethod: false\n        },\n\n        /**\n         * Widget instance properties\n         */\n        triggerPropertyChange: true,\n        isShippingSubmitForm: false,\n\n        /** @inheritdoc */\n        _create: function () {\n            var isDisable;\n\n            //change handler for ajaxEnabled\n            if (this.options.isAjax) {\n                this._submitOrder = this._ajaxSubmitOrder;\n            }\n\n            this.element.on('click', this.options.orderReviewSubmitSelector, $.proxy(this._submitOrder, this))\n                .on('click', this.options.billingAsShippingSelector, $.proxy(this._shippingTobilling, this))\n                .on('change',\n                    this.options.shippingSelector,\n                    $.proxy(this._submitUpdateOrder,\n                        this,\n                        this.options.updateOrderSubmitUrl,\n                        this.options.updateContainerSelector\n                    )\n                ).find(this.options.updateOrderSelector).on('click', $.proxy(this._updateOrderHandler, this)).end()\n                .find(this.options.updateShippingMethodSubmitSelector).hide().end()\n                .find(this.options.reviewSubmitSelector).hide();\n            this._shippingTobilling();\n\n            if ($(this.options.shippingSubmitFormSelector).length && this.options.canEditShippingMethod) {\n                this.isShippingSubmitForm = true;\n                $(this.options.shippingSubmitFormSelector)\n                    .find(this.options.updateShippingMethodSubmitSelector).hide().end()\n                    .on('change',\n                        this.options.shippingSelector,\n                        $.proxy(\n                            this._submitUpdateOrder,\n                            this,\n                            $(this.options.shippingSubmitFormSelector).prop('action'),\n                            this.options.updateContainerSelector\n                        )\n                    );\n                this._updateOrderSubmit(!$(this.options.shippingSubmitFormSelector)\n                    .find(this.options.shippingSelector).val());\n            } else {\n                isDisable = this.isShippingSubmitForm && this.element.find(this.options.shippingSelector).val();\n                this.element\n                    .on('input propertychange', ':input[name]',\n                        $.proxy(this._updateOrderSubmit, this, isDisable, this._onShippingChange)\n                    ).find('select').not(this.options.shippingSelector).on('change', this._propertyChange);\n                this._updateOrderSubmit(isDisable);\n            }\n        },\n\n        /**\n         * show ajax loader\n         */\n        _ajaxBeforeSend: function () {\n            this.element.find(this.options.waitLoadingContainer).show();\n        },\n\n        /**\n         * hide ajax loader\n         */\n        _ajaxComplete: function () {\n            this.element.find(this.options.waitLoadingContainer).hide();\n        },\n\n        /**\n         * trigger propertychange for input type select\n         */\n        _propertyChange: function () {\n            $(this).trigger('propertychange');\n        },\n\n        /**\n         * trigger change for the update of shipping methods from server\n         */\n        _updateOrderHandler: function () {\n            $(this.options.shippingSelector).trigger('change');\n        },\n\n        /**\n         * Attempt to submit order\n         */\n        _submitOrder: function () {\n            if (this._val
2idateForm()) {\n                this.element.find(this.options.updateOrderSelector).fadeTo(0, 0.5)\n                    .end().find(this.options.waitLoadingContainer).show()\n                    .end().submit();\n                this._updateOrderSubmit(true);\n            }\n        },\n\n        /**\n         * Attempt to ajax submit order\n         */\n        _ajaxSubmitOrder: function () {\n            if (this.element.find(this.options.waitLoadingContainer).is(':visible')) {\n                return false;\n            }\n            $.ajax({\n                url: this.element.prop('action'),\n                type: 'post',\n                context: this,\n                data: {\n                    isAjax: 1\n                },\n                dataType: 'json',\n                beforeSend: this._ajaxBeforeSend,\n                complete: this._ajaxComplete,\n\n                /** @inheritdoc */\n                success: function (response) {\n                    var msg;\n\n                    if ($.type(response) === 'object' && !$.isEmptyObject(response)) {\n                        if (response['error_messages']) {\n                            this._ajaxComplete();\n                            msg = response['error_messages'];\n\n                            /* eslint-disable max-depth */\n                            if (msg) {\n                                if ($.type(msg) === 'array') {\n                                    msg = msg.join('\\n');\n                                }\n                            }\n\n                            /* eslint-enablemax-depth */\n                            alert({\n                                content: msg\n                            });\n\n                            return false;\n                        }\n\n                        if (response.redirect) {\n                            $.mage.redirect(response.redirect);\n\n                            return false;\n                        } else if (response.success) {\n                            $.mage.redirect(this.options.successUrl);\n\n                            return false;\n                        }\n                        this._ajaxComplete();\n                        alert({\n                            content: $.mage.__('Sorry, something went wrong.')\n                        });\n                    }\n                },\n\n                /** @inheritdoc */\n                error: function () {\n                    alert({\n                        content: $.mage.__('Sorry, something went wrong. Please try again later.')\n                    });\n                    this._ajaxComplete();\n                }\n            });\n        },\n\n        /**\n         * Validate Order form\n         */\n        _validateForm: function () {\n            this.element.find(this.options.agreementSelector).off('change').on('change', $.proxy(function () {\n                var isValid = this._validateForm();\n\n                this._updateOrderSubmit(!isValid);\n            }, this));\n\n            if (this.element.data('mageValidation')) {\n                return this.element.validation().valid();\n            }\n\n            return true;\n        },\n\n        /**\n         * Check/Set whether order can be submitted\n         * Also disables form submission element, if any\n         * @param {*} shouldDisable - whether should prevent order submission explicitly\n         * @param {Function} [fn] - function for shipping change handler\n         * @param {*} [*] - if true the property change will be set to true\n         */\n        _updateOrderSubmit: function (shouldDisable, fn) {\n            this._toggleButton(this.options.orderReviewSubmitSelector, shouldDisable);\n\n            if ($.type(fn) === 'function') {\n                fn.call(this);\n            }\n        },\n\n        /**\n         * Enable/Disable button\n         * @param {jQuery} button - button selector to be toggled\n         * @param {*} disable - boolean for toggling\n         */\n        _toggleButton: function (button, disable) {\n            $(button).prop({\n                'disabled': disable\n            }).toggleClass('no-checkout', disable).fadeTo(0, disable ? 0.5 : 1);\n        },\n\n        /**\n         * Copy element value from shipping to billing address\n         * @param {jQuery.Event} e - optional\n         */\n        _shippingTobilling: function (e) {\n            var isChecked, opacity;\n\n            if (this.options.shippingSubmitFormSelector) {\n                return false;\n            }\n            isChecked = $(this.options.billingAsShippingSelector).is(':checked');\n            opacity = isChecked ? 0.5 : 1;\n\n            if (isChecked) {\n                this.element.validation('clearError', ':input[name^=\"billing\"]');\n            }\n            $(':input[name^=\"shipping\"]', this.element).each($.proxy(function (key, value) {\n                var fieldObj = $(value.id.replace('shipping:', '#billing\\\\:'));\n\n                if (isChecked) {\n                    fieldObj = fieldObj.val($(value).val());\n                }\n                fieldObj.prop({\n                    'readonly': isChecked,\n                    'disabled': isChecked\n                }).fadeTo(0, opacity);\n\n                if (fieldObj.is('select')) {\n                    this.triggerPropertyChange = false;\n                    fieldObj.trigger('change');\n                }\n            }, this));\n\n            if (isChecked || e) {\n                this._updateOrderSubmit(true);\n            }\n            this.triggerPropertyChange = true;\n        }
2,\n\n        /**\n         * Dispatch an ajax request of Update Order submission\n         * @param {*} url - url where to submit shipping method\n         * @param {*} resultId - id of element to be updated\n         */\n        _submitUpdateOrder: function (url, resultId) {\n            var isChecked, formData, callBackResponseHandler, shippingMethod;\n\n            if (this.element.find(this.options.waitLoadingContainer).is(':visible')) {\n                return false;\n            }\n            isChecked = $(this.options.billingAsShippingSelector).is(':checked');\n            formData = null;\n            callBackResponseHandler = null;\n            shippingMethod = $.trim($(this.options.shippingSelector).val());\n            this._shippingTobilling();\n\n            if (url && resultId && shippingMethod) {\n                this._updateOrderSubmit(true);\n                this._toggleButton(this.options.updateOrderSelector, true);\n\n                // form data and callBack updated based on the shipping Form element\n                if (this.isShippingSubmitForm) {\n                    formData = $(this.options.shippingSubmitFormSelector).serialize() + '&isAjax=true';\n\n                    /**\n                     * @param {Object} response\n                     */\n                    callBackResponseHandler = function (response) {\n                        $(resultId).html(response);\n                        this._updateOrderSubmit(false);\n                        this._ajaxComplete();\n                    };\n                } else {\n                    formData = this.element.serialize() + '&isAjax=true';\n\n                    /**\n                     * @param {Object} response\n                     */\n                    callBackResponseHandler = function (response) {\n                        $(resultId).html(response);\n                        this._ajaxShippingUpdate(shippingMethod);\n                    };\n                }\n\n                if (isChecked) {\n                    $(this.options.shippingSelect).prop('disabled', true);\n                }\n                $.ajax({\n                    url: url,\n                    type: 'post',\n                    context: this,\n                    beforeSend: this._ajaxBeforeSend,\n                    data: formData,\n                    success: callBackResponseHandler\n                });\n            }\n        },\n\n        /**\n         * Update Shipping Methods Element from server\n         * @param {*} shippingMethod\n         */\n        _ajaxShippingUpdate: function (shippingMethod) {\n            $.ajax({\n                url: this.options.shippingMethodUpdateUrl,\n                data: {\n                    isAjax: true,\n                    'shipping_method': shippingMethod\n                },\n                type: 'post',\n                context: this,\n\n                /** @inheritdoc */\n                success: function (response) {\n                    $(this.options.shippingMethodContainer).parent().html(response);\n                    this._toggleButton(this.options.updateOrderSelector, false);\n                    this._updateOrderSubmit(false);\n                },\n                complete: this._ajaxComplete\n            });\n        },\n\n        /**\n         * Actions on change Shipping Address data\n         */\n        _onShippingChange: function () {\n            if (this.triggerPropertyChange && $.trim($(this.options.shippingSelector).val())) {\n                this.element.find(this.options.shippingSelector).hide().end()\n                    .find(this.options.shippingSelector + '_update').show();\n            }\n        }\n    });\n\n    return $.mage.orderReview;\n});\n","Magento_Paypal/js/paypal-checkout.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\ndefine([\n    'jquery',\n    'Magento_Ui/js/modal/confirm',\n    'Magento_Customer/js/customer-data',\n    'jquery/ui',\n    'mage/mage'\n], function ($, confirm, customerData) {\n    'use strict';\n\n    $.widget('mage.paypalCheckout', {\n        options: {\n            originalForm:\n                'form:not(#product_addtocart_form_from_popup):has(input[name=\"product\"][value=%1]
2)',\n            productId: 'input[type=\"hidden\"][name=\"product\"]',\n            ppCheckoutSelector: '[data-role=pp-checkout-url]',\n            ppCheckoutInput: '<input type=\"hidden\" data-role=\"pp-checkout-url\" name=\"return_url\" value=\"\"/>'\n        },\n\n        /**\n         * Initialize store credit events\n         * @private\n         */\n        _create: function () {\n            this.element.on('click', '[data-action=\"checkout-form-submit\"]', $.proxy(function (e) {\n                var $target = $(e.target),\n                    returnUrl = $target.data('checkout-url'),\n                    productId = $target.closest('form').find(this.options.productId).val(),\n                    originalForm = this.options.originalForm.replace('%1', productId),\n                    self = this,\n                    billingAgreement = customerData.get('paypal-billing-agreement');\n\n                e.preventDefault();\n\n                if (billingAgreement().askToCreate) {\n                    confirm({\n                        content: billingAgreement().confirmMessage,\n                        actions: {\n\n                            /**\n                             * Confirmation handler\n                             *\n                             */\n                            confirm: function () {\n                                returnUrl = billingAgreement().confirmUrl;\n                                self._redirect(returnUrl, originalForm);\n                            },\n\n                            /**\n                             * Cancel confirmation handler\n                             *\n                             */\n                            cancel: function (event) {\n                                if (event && !$(event.target).hasClass('action-close')) {\n                                    self._redirect(returnUrl);\n                                }\n                            }\n                        }\n                    });\n                } else {\n                    this._redirect(returnUrl, originalForm);\n                }\n            }, this));\n        },\n\n        /**\n         * Redirect to certain url, with optional form\n         * @param {String} returnUrl\n         * @param {HTMLElement} originalForm\n         *\n         */\n        _redirect: function (returnUrl, originalForm) {\n            var $form,\n                ppCheckoutInput;\n\n            if (this.options.isCatalogProduct) {\n                // find the form from which the button was clicked\n                $form = originalForm ? $(originalForm) : $($(this.options.shortcutContainerClass).closest('form'));\n\n                ppCheckoutInput = $form.find(this.options.ppCheckoutSelector)[0];\n\n                if (!ppCheckoutInput) {\n                    ppCheckoutInput = $(this.options.ppCheckoutInput);\n                    ppCheckoutInput.appendTo($form);\n                }\n                $(ppCheckoutInput).val(returnUrl);\n\n                $form.submit();\n            } else {\n                $.mage.redirect(returnUrl);\n            }\n        }\n    });\n\n    return $.mage.paypalCheckout;\n});\n","Magento_Paypal/js/action/set-payment-method.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\ndefine([\n    'Magento_Checkout/js/model/quote',\n    'Magento_Checkout/js/action/set-payment-information'\n], function (quote, setPaymentInformation) {\n    'use strict';\n\n    return function (messageContainer) {\n        return setPaymentInformation(messageContainer, quote.paymentMethod());\n    };\n});\n","Magento_Paypal/js/in-context/billing-agreement.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/confirm',\n    'Magento_Customer/js/customer-data'\n], function ($, confirm, customerData) {\n    'use strict';\n\n    $.widget('mage.billingAgreement', {\n        options: {\n            invalidateOnLoad: false,\n            cancelButtonSelector: '.block-billing-agreements-view button.cancel',\n            cancelMessage: '',\n            cancelUrl: ''\n        },\n\n        /**\n         * Initialize billing agreements events\n         * @private\n         */\n        _create: function () {\n            var self = this;\n\n            if (this.options.invalidateOnLoad) {\n                this.invalidate();\n            }\n            $(this.options.cancelButtonSelector).on('click', function () {\n                confirm({\n                    content: self.options.cancelMessage,\n                    actions: {\n                        /**\n                         * 'Confirm' action handler.\n                         */\n                        confirm: function () {\n                            self.invalidate();\n                            window.location.href = self.options.cancelUrl;\n                        }\n                    }\n                });\n\n                return false;\n            });\n        },\n\n        /**\n         * clear paypal billing agreement customer data\n         * @returns void\n         */\n        invalidate: function () {\n            customerData.invalidate(['paypal-billing-agreement']);\n        }\n    });\n\n    return $.mage.billingAgreement;\n});\n","Magento_Paypal/js/in-context/button.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\ndefine(\n    [\n        'uiComponent',\n        'jquery',\n        'domReady!'\n    ],\n    function (\n        Component,\n        $\n    ) {\n        'use strict';\n\n        return Component.extend({\n\n            defaults: {},\n\n            /**\n             * @returns {Object}\n             */\n            initialize: function () {\n                this._super();\n\n                return this.initEvents();\n            },\n\n            /**\n             * @returns {Object}\n             */\n            initEvents: function () {\n                $('a[data-action=\"' + this.linkDataAction + '\"]').off('click.' + this.id)\n                    .on('click.' + this.id, this.click.bind(this));\n\n                return this;\n            },\n\n            /**\n             * @param {Object} event\n             * @returns void\n             */\n            click: function (event) {\n                event.preventDefault();\n\n                $('#' + this.paypalButton).click();\n            }\n        });\n    }\n);\n","Magento_Paypal/js/in-context/express-checkout.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\ndefine([\n    'underscore',\n    'jquery',\n    'uiComponent',\n    'paypalInContextExpressCheckout',\n    'Magento_Customer/js/customer-data',\n    'domReady!'\n], function (_, $, Component, paypalExpressCheckout, customerData) {\n    'use strict';\n\n    return Component.extend({\n\n        defaults: {\n            clientConfig: {\
2n\n                checkoutInited: false,\n\n                /**\n                 * @param {Object} event\n                 */\n                click: function (event) {\n                    $('body').trigger('processStart');\n\n                    event.preventDefault();\n\n                    if (!this.clientConfig.checkoutInited) {\n                        paypalExpressCheckout.checkout.initXO();\n                        this.clientConfig.checkoutInited = true;\n                    } else {\n                        paypalExpressCheckout.checkout.closeFlow();\n                    }\n\n                    $.getJSON(this.path, {\n                        button: 1\n                    }).done(function (response) {\n                        var message = response && response.message;\n\n                        if (message) {\n                            customerData.set('messages', {\n                                messages: [message]\n                            });\n                        }\n\n                        if (response && response.url) {\n                            paypalExpressCheckout.checkout.startFlow(response.url);\n\n                            return;\n                        }\n\n                        paypalExpressCheckout.checkout.closeFlow();\n                    }).fail(function () {\n                        paypalExpressCheckout.checkout.closeFlow();\n                    }).always(function () {\n                        $('body').trigger('processStop');\n                        customerData.invalidate(['cart']);\n                    });\n                }\n            }\n        },\n\n        /**\n         * @returns {Object}\n         */\n        initialize: function () {\n            this._super();\n\n            return this.initClient();\n        },\n\n        /**\n         * @returns {Object}\n         */\n        initClient: function () {\n            _.each(this.clientConfig, function (fn, name) {\n                if (typeof fn === 'function') {\n                    this.clientConfig[name] = fn.bind(this);\n                }\n            }, this);\n\n            paypalExpressCheckout.checkout.setup(this.merchantId, this.clientConfig);\n\n            return this;\n        }\n    });\n});\n","Magento_Paypal/js/model/iframe-redirect.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\ndefine([\n    'ko',\n    'Magento_Paypal/js/model/iframe',\n    'Magento_Ui/js/model/messageList'\n],\nfunction (ko, iframe, messageList) {\n    'use strict';\n\n    return function (cartUrl, errorMessage, goToSuccessPage, successUrl) {\n        if (this === window.self) {\n            window.location = cartUrl;\n        }\n\n        if (!!errorMessage.message) { //eslint-disable-line no-extra-boolean-cast\n            document.removeEventListener('click', iframe.stopEventPropagation, true);\n            iframe.isInAction(false);\n            messageList.addErrorMessage(errorMessage);\n        } else if (!!goToSuccessPage) { //eslint-disable-line no-extra-boolean-cast\n            window.location = successUrl;\n        } else {\n            window.location = cartUrl;\n        }\n    };\n});\n","Magento_Paypal/js/model/iframe.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\ndefine(['ko'], function (ko) {\n    'use strict';\n\n    var isInAction = ko.observable(false);\n\n    return {\n        isInAction: isInAction,\n\n        /**\n         * @param {jQuery.Event} event\n         */\n        stopEventPropagation: function (event) {\n            event.stopImmediatePropagation();\n            event.preventDefault();\n        }\n    };\n});\n","Magento_Paypal/js/view/payment/paypal-payments.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/payment/renderer-list'\n], function (Component, rendererList) {\n    'use strict';\n\n    var isContextCheckout = window.checkoutConfig.payment.paypalExpress.isContextCheckout,\n        paypalExpress = 'Magento_Paypal/js/view/payment/method-renderer' +\n            (isContextCheckout ? '/in-context/checkout-express' : '/paypal-express');\n\n    rendererList.push(\n        {\n            type: 'paypal_express',\n            component: paypalExpress,\n            config: window.checkoutConfig.payment.paypalExpress.inContextConfig\n        },\n        {\n            type: 'paypal_express_bml',\n            component: 'Magento_Paypal/js/view/payment/method-renderer/paypal-express-bml'\n        },\n        {\n            type: 'payflow_express',\n            component: 'Magento_Paypal/js/view/payment/method-renderer/payflow-express'\n        },\n        {\n            type: 'payflow_express_bml',\n            component: 'Magento_Paypal/js/view/payment/method-renderer/payflow-express-bml'\n        },\n        {\n            type: 'payflowpro',\n            component: 'Magento_Paypal/js/view/payment/method-renderer/payflowpro-method'\n        },\n        {\n            type: 'payflow_link',\n            component: 'Magento_Paypal/js/view/payment/method-renderer/iframe-methods'\n        },\n        {\n            type: 'payflow_advanced',\n            component: 'Magento_Paypal/js/view/payment/method-renderer/iframe-methods'\n        },\n        {\n            type: 'hosted_pro',\n            component: 'Magento_Paypal/js/view/payment/method-renderer/iframe-methods'\n        },\n        {\n            type: 'paypal_billing_agreement',\n            component: 'Magento_Paypal/js/view/payment/method-renderer/paypal-billing-agreement'\n        }\n    );\n\n    /**\n     * Add view logic here if needed\n     **/\n    return Component.extend({});\n});\n","Magento_Paypal/js/view/payment/method-renderer/iframe-methods.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\ndefine([\n    'Magento_Checkout/js/view/payment/default',\n    'ko',\n    'Magento_Paypal/js/model/iframe',\n    'Magento_Checkout/js/model/full-screen-loader'\n], function (Component, ko, iframe, fullScreenLoader) {\n    'use strict';\n\n    return Component.extend({\n        defaults: {\n            template: 'Magento_Paypal/payment/iframe-methods',\n            paymentReady: false\n        },\n        redirectAfterPlaceOrder: false,\n        isInAction: iframe.isInAction,\n\n        /**\n         * @return {exports}
2\n         */\n        initObservable: function () {\n            this._super()\n                .observe('paymentReady');\n\n            return this;\n        },\n\n        /**\n         * @return {*}\n         */\n        isPaymentReady: function () {\n            return this.paymentReady();\n        },\n\n        /**\n         * Get action url for payment method iframe.\n         * @returns {String}\n         */\n        getActionUrl: function () {\n            return this.isInAction() ? window.checkoutConfig.payment.paypalIframe.actionUrl[this.getCode()] : '';\n        },\n\n        /**\n         * Places order in pending payment status.\n         */\n        placePendingPaymentOrder: function () {\n            if (this.placeOrder()) {\n                fullScreenLoader.startLoader();\n                this.isInAction(true);\n                // capture all click events\n                document.addEventListener('click', iframe.stopEventPropagation, true);\n            }\n        },\n\n        /**\n         * @return {*}\n         */\n        getPlaceOrderDeferredObject: function () {\n            var self = this;\n\n            return this._super().fail(function () {\n                fullScreenLoader.stopLoader();\n                self.isInAction(false);\n                document.removeEventListener('click', iframe.stopEventPropagation, true);\n            });\n        },\n\n        /**\n         * After place order callback\n         */\n        afterPlaceOrder: function () {\n            if (this.iframeIsLoaded) {\n                document.getElementById(this.getCode() + '-iframe')\n                    .contentWindow.location.reload();\n            }\n\n            this.paymentReady(true);\n            this.iframeIsLoaded = true;\n            this.isPlaceOrderActionAllowed(true);\n            fullScreenLoader.stopLoader();\n        },\n\n        /**\n         * Hide loader when iframe is fully loaded.\n         */\n        iframeLoaded: function () {\n            fullScreenLoader.stopLoader();\n        }\n    });\n});\n","Magento_Paypal/js/view/payment/method-renderer/payflow-express-bml.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\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/payflow-express-bml'\n        }\n    });\n});\n","Magento_Paypal/js/view/payment/method-renderer/payflow-express.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\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/payflow-express'\n        }\n    });\n});\n","Magento_Paypal/js/view/payment/method-renderer/payflowpro-method.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\ndefine([\n    'jquery',\n    'Magento_Payment/js/view/payment/iframe',\n    'Magento_Checkout/js/model/payment/additional-validators',\n    'Magento_Checkout/js/action/set-payment-information',\n    'Magento_Checkout/js/model/full-screen-loader',\n    'Magento_Vault/js/view/payment/vault-enabler'\n], function ($, Component, additionalValidators, setPaymentInformationAction, fullScreenLoader, VaultEnabler) {\n    'use strict';\n\n    return Component.extend({\n        defaults: {\n            template: 'Magento_Paypal/payment/payflowpro-form'\n        },\n        placeOrderHandler: null,\n        validateHandler: null,\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         * @param {Function} handler\n         */\n        setPlaceOrderHandler: function (handler) {\n            this.placeOrderHandler = handler;\n        },\n\n        /**\n         * @param {Function} handler\n         */\n        setValidateHandler: function (handler) {\n            this.validateHandler = handler;\n        },\n\n        /**\n         * @returns {Object}\n         */\n        context: function () {\n            return this;\n        },\n\n        /**\n         * @returns {Boolean}\n         */\n        isShowLegend: function () {\n            return true;\n        },\n\n        /**\n         * @returns {String}\n         */\n        getCode: function () {\n            return 'payflowpro';\n        },\n\n        /**\n         * @returns {Boolean}\n         */\n        isActive: function () {\n            return true;\n        },\n\n        /**\n         * @override\n         */\n        placeOrder: function () {\n            var self = this;\n\n            if (this.validateHandler() && additionalValidators.validate()) {\n                this.isPlaceOrderActionAllowed(false);\n                fullScreenLoader.startLoader();\n                $.when(\n                    setPaymentInformationAction(this.messageContainer, self.getData())\n                ).done(\n                    function () {\n                        self.placeOrderHandler().fail(\n                            function () {\n                                fullScreenLoader.stopLoader();\n                            }\n                        );\n                    }\n                ).always(\n                    function () {\n                        self.isPlaceOrderActionAllowed(true);\n                        fullScreenLoader.stopLoader();\n                    }\n                );\n            }\n        },\n\n        /**\n         * @returns {Object}\n         */\n        getData: function () {\n            var data = {\n                'method': this.getCode(),\n                'additional_data': {\n                    'cc_type': this.creditCardType(),\n                    'cc_exp_year': this.creditCardExpYear(),\n                    'cc_exp_month': this.creditCardExpMonth(),\n                    'cc_last_4': this.creditCardNumber().substr(-4)\n                }\n            };\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         * @returns {String}\n         */\n        getVaultCode: function () {\n            return 'payflowpro_cc_vault';\n        }\n    });\n});\n","Magento_Paypal/js/view/payment/method-renderer/paypal-billing-agreement.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/view/payment/default',\n    'mage/validation'\n], function ($, Component) {\n    'use strict';\n\n    return Component.extend({\n        defaults: {\n            template: 'Magento_Paypal/payment/paypal_billing_agreement-form',\n            selectedBillingAgreement: ''\n        }
2,\n\n        /** @inheritdoc */\n        initObservable: function () {\n            this._super()\n                .observe('selectedBillingAgreement');\n\n            return this;\n        },\n\n        /**\n         * @return {*}\n         */\n        getTransportName: function () {\n            return window.checkoutConfig.payment.paypalBillingAgreement.transportName;\n        },\n\n        /**\n         * @return {*}\n         */\n        getBillingAgreements: function () {\n            return window.checkoutConfig.payment.paypalBillingAgreement.agreements;\n        },\n\n        /**\n         * @return {Object}\n         */\n        getData: function () {\n            var additionalData = null;\n\n            if (this.getTransportName()) {\n                additionalData = {};\n                additionalData[this.getTransportName()] = this.selectedBillingAgreement();\n            }\n\n            return {\n                'method': this.item.method,\n                'additional_data': additionalData\n            };\n        },\n\n        /**\n         * @return {jQuery}\n         */\n        validate: function () {\n            var form = '#billing-agreement-form';\n\n            return $(form).validation() && $(form).validation('isValid');\n        }\n    });\n});\n","Magento_Paypal/js/view/payment/method-renderer/paypal-express-abstract.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/view/payment/default',\n    'Magento_Paypal/js/action/set-payment-method',\n    'Magento_Checkout/js/model/payment/additional-validators',\n    'Magento_Checkout/js/model/quote',\n    'Magento_Customer/js/customer-data'\n], function ($, Component, setPaymentMethodAction, additionalValidators, quote, customerData) {\n    'use strict';\n\n    return Component.extend({\n        defaults: {\n            template: 'Magento_Paypal/payment/paypal-express-bml',\n            billingAgreement: ''\n        },\n\n        /** Init observable variables */\n        initObservable: function () {\n            this._super()\n                .observe('billingAgreement');\n\n            return this;\n        },\n\n        /** Open window with  */\n        showAcceptanceWindow: function (data, event) {\n            window.open(\n                $(event.currentTarget).attr('href'),\n                'olcwhatispaypal',\n                'toolbar=no, location=no,' +\n                ' directories=no, status=no,' +\n                ' menubar=no, scrollbars=yes,' +\n                ' resizable=yes, ,left=0,' +\n                ' top=0, width=400, height=350'\n            );\n\n            return false;\n        },\n\n        /** Returns payment acceptance mark link path */\n        getPaymentAcceptanceMarkHref: function () {\n            return window.checkoutConfig.payment.paypalExpress.paymentAcceptanceMarkHref;\n        },\n\n        /** Returns payment acceptance mark image path */\n        getPaymentAcceptanceMarkSrc: function () {\n            return window.checkoutConfig.payment.paypalExpress.paymentAcceptanceMarkSrc;\n        },\n\n        /** Returns billing agreement data */\n        getBillingAgreementCode: function () {\n            return window.checkoutConfig.payment.paypalExpress.billingAgreementCode[this.item.method];\n        },\n\n        /** Returns payment information data */\n        getData: function () {\n            var parent = this._super(),\n                additionalData = null;\n\n            if (this.getBillingAgreementCode()) {\n                additionalData = {};\n                additionalData[this.getBillingAgreementCode()] = this.billingAgreement();\n            }\n\n            return $.extend(true, parent, {\n                'additional_data': additionalData\n            });\n        },\n\n        /** Redirect to paypal */\n        continueToPayPal: function () {\n            if (additionalValidators.validate()) {\n                //update payment method information if additional data was changed\n                this.selectPaymentMethod();\n                setPaymentMethodAction(this.messageContainer).done(\n                    function () {\n                        customerData.invalidate(['cart']);\n                        $.mage.redirect(\n                            window.checkoutConfig.payment.paypalExpress.redirectUrl[quote.paymentMethod().method]\n                        );\n                    }\n                );\n\n                return false;\n            }\n        }\n    });\n});\n","Magento_Paypal/js/view/payment/method-renderer/paypal-express-bml.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\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-bml'\n        }\n    });\n});\n","Magento_Paypal/js/view/payment/method-renderer/paypal-express.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\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","Magento_Paypal/js/view/payment/method-renderer/in-context/checkout-express.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\ndefine(\n    [\n        'underscore',\n        'jquery',\n        'Magento_Paypal/js/view/payment/method-renderer/paypal-express-abstract',\n        'Magento_Paypal/js/action/set-payment-method',\n        'Magento_Checkout/js/model/payment/additional-validators',\n        'Magento_Ui/js/lib/view/utils/dom-observer',\n        'paypalInContextExpressCheckout',\n        'Magento_Customer/js/customer-data',\n        'Magento_Ui/js/model/messageList'\n    ],\n    function (\n        _,\n        $,\n        Component,\n        setPaymentMethodAction,\n        additionalValidators,\n        domObserver,\n        paypalExpressCheckout,\n        customerData,\n        messageList\n    ) {\n        'use strict';\n\n        // State of PayPal module initialization\n        var clientInit = false;\n\n        return Component.extend({\n\n            defaults: {\n                template: 'Magento_Paypal/payment/paypal-express-in-context',\n                clientConfig: {\
2n                    /**\n                     * @param {Object} event\n                     */\n                    click: function (event) {\n                        event.preventDefault();\n\n                        if (additionalValidators.validate()) {\n                            paypalExpressCheckout.checkout.initXO();\n\n                            this.selectPaymentMethod();\n                            setPaymentMethodAction(this.messageContainer).done(function () {\n                                $('body').trigger('processStart');\n\n                                $.getJSON(this.path, {\n                                    button: 0\n                                }).done(function (response) {\n                                    var message = response && response.message;\n\n                                    if (message) {\n                                        if (message.type === 'error') {\n                                            messageList.addErrorMessage({\n                                                message: message.text\n                                            });\n                                        } else {\n                                            messageList.addSuccessMessage({\n                                                message: message.text\n                                            });\n                                        }\n                                    }\n\n                                    if (response && response.url) {\n                                        paypalExpressCheckout.checkout.startFlow(response.url);\n\n                                        return;\n                                    }\n\n                                    paypalExpressCheckout.checkout.closeFlow();\n                                }).fail(function () {\n                                    paypalExpressCheckout.checkout.closeFlow();\n                                }).always(function () {\n                                    $('body').trigger('processStop');\n                                    customerData.invalidate(['cart']);\n                                });\n                            }.bind(this)).fail(function () {\n                                paypalExpressCheckout.checkout.closeFlow();\n                            });\n                        }\n                    }\n                }\n            },\n\n            /**\n             * @returns {Object}\n             */\n            initialize: function () {\n                this._super();\n                this.initClient();\n\n                return this;\n            },\n\n            /**\n             * @returns {Object}\n             */\n            initClient: function () {\n                var selector = '#' + this.getButtonId();\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                if (!clientInit) {\n                    domObserver.get(selector, function () {\n                        paypalExpressCheckout.checkout.setup(this.merchantId, this.clientConfig);\n                        clientInit = true;\n                        domObserver.off(selector);\n                    }.bind(this));\n                } else {\n                    domObserver.get(selector, function () {\n                        $(selector).on('click', this.clientConfig.click);\n                        domObserver.off(selector);\n                    }.bind(this));\n                }\n\n                return this;\n            },\n\n            /**\n             * @returns {String}\n             */\n            getButtonId: function () {\n                return this.inContextId;\n            }\n        });\n    }\n);\n","Magento_Paypal/js/view/payment/method-renderer/payflowpro/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    'jquery',\n    'Magento_Vault/js/view/payment/method-renderer/vault'\n], function ($, VaultComponent) {\n    'use strict';\n\n    return VaultComponent.extend({\n        defaults: {\n            template: 'Magento_Vault/payment/form'\n        },\n\n        /**\n         * @returns {String}\n         */\n        getToken: function () {\n            return this.publicHash;\n        },\n\n        /**\n         * Get last 4 digits of card\n         * @returns {String}\n         */\n        getMaskedCard: function () {\n            return this.details['cc_last_4'];\n        },\n\n        /**\n         * Get expiration date\n         * @returns {String}\n         */\n        getExpirationDate: function () {\n            return this.details['cc_exp_month'] + '/' + this.details['cc_exp_year'];\n        },\n\n        /**\n         * Get card type\n         * @returns {String}\n         */\n        getCardType: function () {\n            return this.details['cc_type'];\n        }\n    });\n});\n","Magento_Paypal/js/view/review/actions/iframe.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\n/**\n * @deprecated since version 2.2.0\n */\ndefine([\n    'uiComponent',\n    'ko',\n    'Magento_Paypal/js/model/iframe'\n], function (Component, ko, iframe) {\n    'use strict';\n\n    return Component.extend({\n        defaults: {\n            template: 'Magento_Paypal/review/actions/iframe'\n        },\n\n        /**\n         * @return {*}\n         */\n        getCode: function () {\n            return this.index;\n        },\n\n        /**\n         * @return {String}\n         */\n        getActionUrl: function () {\n            return this.isInAction() ? window.checkoutConfig.payment.paypalIframe.actionUrl[this.getCode()] : '';\n        },\n\n        /**\n         * @return {Boolean}\n         */\n        afterSave: function () {\n            iframe.setIsInAction(true);\n\n            return false;\n        },\n\n        /**\n         * @return {*}\n         */\n        isInAction: function () {\n            return iframe.getIsInAction()();\n        },\n\n        /**\n         * @param {Object} context\n         * @return {Function}\n         */\n        placeOrder: function (context) {\n            return context.placeOrder.bind(context, this.afterSave);\n        }\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',\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: 2,\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        },\n\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 = false;\n                    this.element.removeAttr('aria-expanded');\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}
2 isActive\n         */\n        setActiveState: function (isActive) {\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            }\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                    this.searchForm.trigger('submit');\n                    e.preventDefault();\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                    }\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                    }\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 = isEmpty(value);\n\n            if (value.length >= parseInt(this.options.minSearchLength, 10)) {\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.responseList.indexList = this.autoComplete.html(dropdown)\n                            .css(clonePosition)\n                            .show()\n                            .find(this.options.responseFieldElements + ':visible');\n\n                        this._resetResponseList(false);\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                    }\n                }, this));\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","Magento_CheckoutAgreements/js/model/agreement-validator.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\ndefine([\n    'jquery',\n    'mage/validation'\n], function ($) {\n    'use strict';\n\n    var checkoutConfig = window.checkoutConfig,\n        agreementsConfig = checkoutConfig ? checkoutConfig.checkoutAgreements : {},\n        agreementsInputPath = '.payment-method._active div.checkout-agreements input';\n\n    return {\n        /**\n         * Validate checkout agreements\n         *\n         * @returns {Boolean}\n         */\n        validate: function () {\n            var isValid = true;\n\n            if (!agreementsConfig.isEnabled || $(agreementsInputPath).length === 0) {\n                return true;\n            }\n\n            $(agreementsInputPath).each(function (index, element) {\n                if (!$.validator.validateSingleElement(element, {\n                    errorElement: 'div'\n                })) {\n                    isValid = false;\n                }\n            });\n\n            return isValid;\n        }\n    };\n});\n","Magento_CheckoutAgreements/js/model/agreements-assigner.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\n/*global alert*/\ndefine([\n    'jquery'\n], function ($) {\n    'use strict';\n\n    var agreementsConfig = window.checkoutConfig.checkoutAgreements;\n\n    /** Override default place order action and add agreement_ids to request */\n    return function (paymentData) {\n        var agreementForm,\n            agreementData,\n            agreementIds;\n\n        if (!agreementsConfig.isEnabled) {\n            return;\n        }\n\n        agreementForm = $('.payment-method._active div[data-role=checkout-agreements] input');\n        agreementData = agreementForm.serializeArray();\n        agreementIds = [];\n\n        agreementData.forEach(function (item) {\n            agreementIds.push(item.value);\n        });\n\n        if (paymentData['extension_attributes'] === undefined) {\n            paymentData['extension_attributes'] = {};\n        }\n\n        paymentData['extension_attributes']['agreement_ids'] = agreementIds;\n    };\n});\n","Magento_CheckoutAgreements/js/model/agreements-modal.js":"define([\n    'jquery',\n    'Magento_Ui/js/modal/modal',\n    'mage/translate'\n], function ($, modal, $t) {\n    'use strict';\n\n    return {\n        modalWindow: null,\n\n        /**\n         * Create popUp window for provided element.\n         *\n         * @param {HTMLElement} element\n         */\n        createModal: function (element) {\n            var options;\n\n            this.modalWindow = element;\n            options = {\n                'type': 'popup',\n                'modalClass': 'agreements-modal',\n                'responsive': true,\n                'innerScroll': true,\n                'trigger': '.show-modal',\n                'buttons': [\n                    {\n                        text: $t('Close'),\n                        class: 'action secondary action-hide-popup button button--primary icon-arrow-right-after',\n\n                        /** @inheritdoc */\n                        click: function () {\n                            this.closeModal();\n                        }\n                    }\n                ]\n            };\n            modal(options, $(this.modalWindow));\n        },\n\n        /** Show login popup window */\n        showModal: function () {\n            $(this.modalWindow).modal('openM
2odal');\n        }\n    };\n});\n","Magento_CheckoutAgreements/js/model/place-order-mixin.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\ndefine([\n    'jquery',\n    'mage/utils/wrapper',\n    'Magento_CheckoutAgreements/js/model/agreements-assigner'\n], function ($, wrapper, agreementsAssigner) {\n    'use strict';\n\n    return function (placeOrderAction) {\n\n        /** Override default place order action and add agreement_ids to request */\n        return wrapper.wrap(placeOrderAction, function (originalAction, paymentData, messageContainer) {\n            agreementsAssigner(paymentData);\n\n            return originalAction(paymentData, messageContainer);\n        });\n    };\n});\n","Magento_CheckoutAgreements/js/model/set-payment-information-mixin.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n/*global alert*/\ndefine([\n    'jquery',\n    'mage/utils/wrapper',\n    'Magento_CheckoutAgreements/js/model/agreements-assigner'\n], function ($, wrapper, agreementsAssigner) {\n    'use strict';\n\n    return function (placeOrderAction) {\n\n        /** Override place-order-mixin for set-payment-information action as they differs only by method signature */\n        return wrapper.wrap(placeOrderAction, function (originalAction, messageContainer, paymentData) {\n            agreementsAssigner(paymentData);\n\n            return originalAction(messageContainer, paymentData);\n        });\n    };\n});\n","Magento_CheckoutAgreements/js/view/agreement-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/payment/additional-validators',\n    'Magento_CheckoutAgreements/js/model/agreement-validator'\n], function (Component, additionalValidators, agreementValidator) {\n    'use strict';\n\n    additionalValidators.registerValidator(agreementValidator);\n\n    return Component.extend({});\n});\n","Magento_CheckoutAgreements/js/view/checkout-agreements.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\ndefine([\n    'ko',\n    'jquery',\n    'uiComponent',\n    'Magento_CheckoutAgreements/js/model/agreements-modal'\n], function (ko, $, Component, agreementsModal) {\n    'use strict';\n\n    var checkoutConfig = window.checkoutConfig,\n        agreementManualMode = 1,\n        agreementsConfig = checkoutConfig ? checkoutConfig.checkoutAgreements : {};\n\n    return Component.extend({\n        defaults: {\n            template: 'Magento_CheckoutAgreements/checkout/checkout-agreements'\n        },\n        isVisible: agreementsConfig.isEnabled,\n        agreements: agreementsConfig.agreements,\n        modalTitle: ko.observable(null),\n        modalContent: ko.observable(null),\n        modalWindow: null,\n\n        /**\n         * Checks if agreement required\n         *\n         * @param {Object} element\n         */\n        isAgreementRequired: function (element) {\n            return element.mode == agreementManualMode; //eslint-disable-line eqeqeq\n        },\n\n        /**\n         * Show agreement content in modal\n         *\n         * @param {Object} element\n         */\n        showContent: function (element) {\n            this.modalTitle(element.checkboxText);\n            this.modalContent(element.content);\n            agreementsModal.showModal();\n        },\n\n        /**\n         * build a unique id for the term checkbox\n         *\n         * @param {Object} context - the ko context\n         * @param {Number} agreementId\n         */\n        getCheckboxId: function (context, agreementId) {\n            var paymentMethodName = '',\n                paymentMethodRenderer = context.$parents[1];\n\n            // corresponding payment method fetched from parent context\n            if (paymentMethodRenderer) {\n                // item looks like this: {title: \"Check / Money order\", method: \"checkmo\"}\n                paymentMethodName = paymentMethodRenderer.item ?\n                  paymentMethodRenderer.item.method : '';\n            }\n\n            return 'agreement_' + paymentMethodName + '_' + agreementId;\n        },\n\n        /**\n         * Init modal window for rendered element\n         *\n         * @param {Object} element\n         */\n        initModal: function (element) {\n            agreementsModal.createModal(element);\n        }\n    });\n});\n","Amazon_Login/js/amazon-csrf.js":"/**\n * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * 
2Licensed under the Apache License, Version 2.0 (the \"License\").\n * You may not use this file except in compliance with the License.\n * A copy of the License is located at\n *\n *  http://aws.amazon.com/apache2.0\n *\n * or in the \"license\" file accompanying this file. This file is distributed\n * on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either\n * express or implied. See the License for the specific language governing\n * permissions and limitations under the License.\n */\n\ndefine([\n    'sjcl',\n    'jquery',\n    'mage/cookies'\n], function (sjcl, $) {\n    'use strict';\n\n    return {\n        options: {\n            wordsLength: 8,\n            cookieName: 'amazon-csrf-state'\n        },\n\n        /**\n         * Create random string for Amazon CSRF cookie\n         */\n        generateNewValue: function () {\n            var randomString = sjcl.codec.base64.fromBits(sjcl.random.randomWords(this.options.wordsLength));\n\n            $.mage.cookies.set(this.options.cookieName, randomString);\n\n            return randomString;\n        },\n\n        /**\n         * Check if Amazon CSRF cookie is valid and clear cookie\n         * @param {String} stateString\n         * @returns {Boolean}\n         */\n        isValid: function (stateString) {\n            var isValid = $.mage.cookies.get(this.options.cookieName) === stateString;\n\n            this.clear(); // always clear nonce when validating\n\n            return isValid;\n        },\n\n        /**\n         * Clear Amazon CSRF cookie\n         */\n        clear: function () {\n            $.mage.cookies.clear(this.options.cookieName);\n        }\n    };\n});\n","Amazon_Login/js/amazon-logout.js":"/**\n * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\").\n * You may not use this file except in compliance with the License.\n * A copy of the License is located at\n *\n *  http://aws.amazon.com/apache2.0\n *\n * or in the \"license\" file accompanying this file. This file is distributed\n * on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either\n * express or implied. See the License for the specific language governing\n * permissions and limitations under the License.\n */\n\ndefine([\n    'jquery',\n    'amazonCore',\n    'jquery/ui',\n    'mage/cookies'\n], function ($, core) {\n    'use strict';\n\n    $.widget('amazon.AmazonLogout', {\n        options: {\n            onInit: false\n        },\n\n        /**\n         * Create Amazon Logout Widget\n         * @private\n         */\n        _create: function () {\n            if (this.options.onInit) {\n                core.AmazonLogout(); //logout amazon user on init\n                $.mage.cookies.clear('amazon_Login_accessToken');\n            }\n        },\n\n        /**\n         * Logs out a user if called directly\n         * @private\n         */\n        _logoutAmazonUser: function () {\n            core.AmazonLogout();\n            $.mage.cookies.clear('amazon_Login_accessToken');\n        }\n    });\n\n    return $.amazon.AmazonLogout;\n});\n","Amazon_Login/js/amazon-redirect.js":"/**\n * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\").\n * You may not use this file except in compliance with the License.\n * A copy of the License is located at\n *\n *  http://aws.amazon.com/apache2.0\n *\n * or in the \"license\" file accompanying this file. This file is distributed\n * on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either\n * express or implied. See the License for the specific language governing\n * permissions and limitations under the License.\n */\n\ndefine([\n    'jquery',\n    'amazonCore',\n    'amazonPaymentConfig',\n    'amazonCsrf',\n    'mage/loader',\n    'jquery/ui',\n    'mage/cookies'\n], function ($, amazonCore, amazonPaymentConfig, amazonCsrf) {\n    'use strict';\n\n    var self;\n\n    $.widget('amazon.AmazonRedirect', {\n\n        /**\n         * @private\n         */\n        _create: function () {\n\n            self = this;\n            // start the loading animation. WIll en on redirect, no explicit stop here\n            $('body').trigger('processStart');\n\n            //verify nonce first\n            this.redirectOnInvalidState();\n\n            // we don't have the customer's consent or invalid request\n            this.redirectOnRequestWithError();\n            this.setAuthStateCookies();\n            amazonCore.amazonDefined.subscribe(function () {\n                //only set this on the redirect page\n                amazon.Login.setUseCookie(true); //eslint-disable-line no-undef\n                amazonCore.verifyAmazonLoggedIn().then(function (loggedIn) {\n                    if (loggedIn) {\n                        self.redirect();\n                    }\n                }, 0);\n            }, this);\n        },\n\n        /**\n         * getURLParamater from URL for access OAuth Token\n         * @param {String} name\n         * @param {String} source\n         * @returns {String|Null}\n         */\n        getURLParameter: function (name, source) {\n            return decodeURIComponent((new RegExp('[?|&|#]' + name + '=' +\n                    '([^&]+?)(&|#|;|$)').exec(source) || [,''])[1].replace(\n                        /\\+/g,\n                        '%20'\n                    )) || null;\n        },\n\n        /**\n         * Set State Cache Auth Cookies if they aren't already set\n         * @returns {Boolean}\n         */\n        setAuthStateCookies: function () {\n            var token = this.getURLParameter('access_token', location.hash);\n\n            if (typeof token === 'string' && token.match(/^Atza/)) {\n                $.mage.cookies.set('amazon_Login_accessToken', token);\n            }\n\n            return true;\n        },\n\n        /**\n         * Redirect user to correct controller which logs them into M2 via Amazon hash\n         */\n        redirect: function () {\n            window.location = amazonPaymentConfig.getValue('redirectUrl') + '?access_token=' 
2+\n                this.getURLParameter('access_token', location.hash);\n        },\n\n        /**\n         * Redirect user on invalid state\n         */\n        redirectOnInvalidState: function () {\n            var state = this.getURLParameter('state', location.hash);\n\n            if (!state || !amazonCsrf.isValid(state)) {\n                window.location = amazonPaymentConfig.getValue('customerLoginPageUrl');\n            }\n        },\n\n        /**\n         * Redirect user on request error\n         */\n        redirectOnRequestWithError: function () {\n            if (this.getURLParameter('error', window.location)) {\n                window.location = amazonPaymentConfig.getValue('customerLoginPageUrl');\n            }\n        }\n    });\n\n    return $.amazon.AmazonRedirect;\n});\n","Amazon_Login/js/view/login-button-wrapper.js":"/**\n * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\").\n * You may not use this file except in compliance with the License.\n * A copy of the License is located at\n *\n *  http://aws.amazon.com/apache2.0\n *\n * or in the \"license\" file accompanying this file. This file is distributed\n * on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either\n * express or implied. See the License for the specific language governing\n * permissions and limitations under the License.\n */\n\nvar registry = require('uiRegistry'),\n    amazonPayment = registry.get('amazonPayment');\n\nif (amazonPayment !== undefined && amazonPayment.allowAmLoginLoading === true) {\n    define(['require', 'Amazon_Login/js/view/login-button'], function (require) {\n        'use strict';\n\n        return require('Amazon_Login/js/view/login-button');\n    });\n} else {\n    define(['require', 'uiComponent'], function (require) {\n        'use strict';\n\n        return require('uiComponent');\n    });\n}\n\n","Amazon_Login/js/view/login-button.js":"/**\n * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\").\n * You may not use this file except in compliance with the License.\n * A copy of the License is located at\n *\n *  http://aws.amazon.com/apache2.0\n *\n * or in the \"license\" file accompanying this file. This file is distributed\n * on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either\n * express or implied. See the License for the specific language governing\n * permissions and limitations under the License.\n */\n\ndefine(\n    [\n        'jquery',\n        'uiComponent',\n        'ko',\n        'Magento_Customer/js/model/customer',\n        'Amazon_Payment/js/model/storage',\n        'amazonPaymentConfig'\n    ],\n    function (\n        $,\n        Component,\n        ko,\n        customer,\n        amazonStorage,\n        amazonPaymentConfig\n    ) {\n        'use strict';\n\n        return Component.extend({\n            defaults: {\n                template: 'Amazon_Login/login-button'\n            },\n            isCustomerLoggedIn: customer.isLoggedIn,\n            isAmazonAccountLoggedIn: amazonStorage.
2isAmazonAccountLoggedIn,\n            isLwaVisible: ko.observable(amazonPaymentConfig.getValue('isLwaEnabled')),\n\n            /**\n             * Initialize login button\n             */\n            initialize: function () {\n                this._super();\n            }\n        });\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',\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                } 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    'jquery/ui'\n], function ($) {\n    'use strict';\n\n    $.widget('mage.requireCookie', {\n        options: {\n            event: 'click',\n            noCookieUrl: 'enable-cookies',\n            triggers: ['.action.login', '.action.submit']\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            event.preventDefault();\n            window.location = this.options.noCookieUrl;\n        }\n    });\n\n    return $.mage.requireCookie;\n});\n","Magento_GiftMessage/js/extra-options.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\n/**\n * @deprecated since version 2.2.0\n */\ndefine([\n    'jquery',\n    'jquery/ui'\n], function ($) {\n    'use strict';\n\n    $.widget('mage.extraOptions', {\n        options: {\n            events: 'billingSave shippingSave',\n            additionalContainer: '#onepage-checkout-shipping-method-additional-load'\n        },\n\n        /**\n         * Set up event handler for requesting any additional extra options from the backend.\n         * @private\n         */\n        _create: function () {\n            this.element.on(this.options.events, $.proxy(this._addExtraOptions, this));\n        },\n\n        /**\n         * Fetch the extra options using an Ajax call. Extra options include Gift Receipt and\n         * Printed Card.\n         * @private\n         */\n        _addExtraOptions: function () {\n            $.ajax({\n                url: this.options.additionalUrl,\n                context: this,\n                type: 'post',\n                async: false,\n\n                /** @inheritdoc */\n                success: function (response) {\n                    $(this.options.additionalContainer).html(response).trigger('contentUpdated');\n                }\n            });\n        }\n    });\n\n    return $.mage.extraOptions;\n});
2\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'\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).change();\n                            container.find('a').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).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});\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/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} 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=' 
2+ 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/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;
2\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/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            giftOptions.addOption(model);\n            this.model = 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            this.isResultBlockVisible();\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","Magento_GoogleAnalytics/js/google-analytics.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n/* jscs:disable */\n/* eslint-disable */\ndefine([\n    'jquery',\n    'mage/cookies'\n], function ($) {\n    'use strict';\n\n    /**\n     * @param {Object} config\n     */\n    return function (config) {\n        var allowServices = false,\n            allowedCookies,\
2n            allowedWebsites;\n\n        if (config.isCookieRestrictionModeEnabled) {\n            allowedCookies = $.mage.cookies.get(config.cookieName);\n\n            if (allowedCookies !== null) {\n                allowedWebsites = JSON.parse(allowedCookies);\n\n                if (allowedWebsites[config.currentWebsite] === 1) {\n                    allowServices = true;\n                }\n            }\n        } else {\n            allowServices = true;\n        }\n\n        if (allowServices) {\n            (function (i, s, o, g, r, a, m) {\n                i.GoogleAnalyticsObject = r;\n                i[r] = i[r] || function () {\n                        (i[r].q = i[r].q || []).push(arguments)\n                    }, i[r].l = 1 * new Date();\n                a = s.createElement(o),\n                    m = s.getElementsByTagName(o)[0];\n                a.async = 1;\n                a.src = g;\n                m.parentNode.insertBefore(a, m)\n            })(window, document, 'script', '//www.google-analytics.com/analytics.js', 'ga');\n\n            // Process page info\n            ga('create', config.pageTrackingData.accountId, 'auto');\n\n            if (config.pageTrackingData.isAnonymizedIpActive) {\n                ga('set', 'anonymizeIp', true);\n            }\n\n            // Process orders data\n            if (config.ordersTrackingData.hasOwnProperty('currency')) {\n                ga('require', 'ec', 'ec.js');\n\n                ga('set', 'currencyCode', config.ordersTrackingData.currency);\n\n                // Collect product data for GA\n                if (config.ordersTrackingData.products) {\n                    $.each(config.ordersTrackingData.products, function (index, value) {\n                        ga('ec:addProduct', value);\n                    });\n                }\n\n                // Collect orders data for GA\n                if (config.ordersTrackingData.orders) {\n                    $.each(config.ordersTrackingData.orders, function (index, value) {\n                        ga('ec:setAction', 'purchase', value);\n                    });\n                }\n\n                ga('send', 'pageview');\n            } else {\n                // Process Data if not orders\n                ga('send', 'pageview' + config.pageTrackingData.optPageUrl);\n            }\n        }\n    }\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    'jquery/ui'\n], function ($) {\n    'use strict';\n\n    $.widget('mage.multiShipping', {\n        options: {\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.options.addNewAddressBtn).on('click', $.proxy(this._addNewAddress, this));\n            $(this.options.canContinueBtn).on('click', $.proxy(this._canContinue, this));\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',\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/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',\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.submit();\n                }\n            }\n        }\n    });\n\n    return $.mage.payment;\n});\n","Magento_SendFriend/js/back-event.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('click', function () {\n            history.back();\n\n            return false;\n        });\n    };\n});\n","Magento_Swatches/js/catalog-add-to-cart.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\nrequire([\n    'jquery'\n], function ($) {\n    'use strict';\n\n    /**\n     * Add selected swatch attributes to redirect url\n     *\n     * @see Magento_Catalog/js/catalog-add-to-cart\n     */\n    $('body').on('catalogCategoryAddToCartRedirect', function (event, data) {\n        $(data.form).find('[name*=\"super\"]').each(function (index, item) {\n            var $item = $(item),\n                attr;\n\n            if ($item.attr('data-attr-name')) {\n                attr = $item.attr('data-attr-name');\n            } else {\n                attr = $item.parent().attr('attribute-code');\n            }\n            data.redirectParameters.push(attr + '=' + $item.val());\n\n        });\n    });\n});\n","Magento_Swatches/js/configurable-customer-data.js":"require([\n    'jquery',\n    'Magento_ConfigurableProduct/js/options-updater'\n], function ($, Updater) {\n    'use strict';\n\n    var selectors = {\n            formSelector: '#product_addtocart_form',\n            swatchSelector: '.swatch-opt'\n        },\n        swatchWidgetName = 'mageSwatchRenderer',\n        widgetInitEvent = 'swatch.initialized',\n\n    /**\n    * Sets all configurable swatch attribute's selected values\n    */\n    updateSwatchOptions = function () {\n        var swatchWidget = $(selectors.swatchSelector).data(swatchWidgetName);\n\n        if (!swatchWidget || !swatchWidget._EmulateSelectedByAttributeId) {\n            return;\n        }\n        swatchWidget._EmulateSelectedByAttributeId(this.productOptions);\n    },\n    updater = new Updater(widgetInitEvent, updateSwatchOptions);\n\n    updater.listen();\n});\n","Magento_Swatches/js/swatch-renderer.js":"/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\ndefine([\n    'jquery',\n    'underscore',\n    'mage/template',\n    'mage/smart-keyboard-handler',\n    'mage/translate',\n    'priceUtils',\n    'jquery/ui',\n    'jquery/jquery.parsequery',\n    'mage/validation/validation'\n], function ($, _, mageTemplate, keyboardHandler, $t, priceUtils) {\n    'use strict';\n\n    /**\n     * Extend form validation to support swatch accessibility\n     */\n    $.widget('mage.validation', $.mage.validation, {\n        /**\n         * Handle form with swatches validation. Focus on first invalid swatch block.\n         *\n         * @param {jQuery.Event} event\n         * @param {Object} validation\n         */\n        listenFormValidateHandler: function (event, validation) {\n            var swatchWra
2pper, firstActive, swatches, swatch, successList, errorList, firstSwatch;\n\n            this._superApply(arguments);\n\n            swatchWrapper = '.swatch-attribute-options';\n            swatches = $(event.target).find(swatchWrapper);\n\n            if (!swatches.length) {\n                return;\n            }\n\n            swatch = '.swatch-attribute';\n            firstActive = $(validation.errorList[0].element || []);\n            successList = validation.successList;\n            errorList = validation.errorList;\n            firstSwatch = $(firstActive).parent(swatch).find(swatchWrapper);\n\n            keyboardHandler.focus(swatches);\n\n            $.each(successList, function (index, item) {\n                $(item).parent(swatch).find(swatchWrapper).attr('aria-invalid', false);\n            });\n\n            $.each(errorList, function (index, item) {\n                $(item.element).parent(swatch).find(swatchWrapper).attr('aria-invalid', true);\n            });\n\n            if (firstSwatch.length) {\n                $(firstSwatch).focus();\n            }\n        }\n    });\n\n    /**\n     * Render tooltips by attributes (only to up).\n     * Required element attributes:\n     *  - option-type (integer, 0-3)\n     *  - option-label (string)\n     *  - option-tooltip-thumb\n     *  - option-tooltip-value\n     *  - thumb
2-width\n     *  - thumb-height\n     */\n    $.widget('mage.SwatchRendererTooltip', {\n        options: {\n            delay: 200,                             //how much ms before tooltip to show\n            tooltipClass: 'swatch-option-tooltip'  //configurable, but remember about css\n        },\n\n        /**\n         * @private\n         */\n        _init: function () {\n            var $widget = this,\n                $this = this.element,\n                $element = $('.' + $widget.options.tooltipClass),\n                timer,\n                type = parseInt($this.attr('option-type'), 10),\n                label = $this.attr('option-label'),\n                thumb = $this.attr('option-tooltip-thumb'),\n                value = $this.attr('option-tooltip-value'),\n                width = $this.attr('thumb-width'),\n                height = $this.attr('thumb-height'),\n                $image,\n                $title,\n                $corner;\n\n            if (!$element.length) {\n                $element = $('<div class=\"' +\n                    $widget.options.tooltipClass +\n                    '\"><div class=\"image\"></div><div class=\"title\"></div><div class=\"corner\"></div></div>'\n                );\n                $('body').append($element);\n            }\n\n            $image = $element.find('.image');\n            $title = $element.find('.title');\n            $corner = $element.find('.corner');\n\n            $this.hover(function () {\n                if (!$this.hasClass('disabled')) {\n                    timer = setTimeout(\n                        function () {\n                            var leftOpt = null,\n                                leftCorner = 0,\n                                left,\n                                $window;\n\n                            if (type === 2) {\n                                // Image\n                                $image.css({\n                                    'background': 'url(\"' + thumb + '\") no-repeat center', //Background case\n                                    'background-size': 'initial',\n                                    'width': width + 'px',\n                                    'height': height + 'px'\n                                });\n                                $image.show();\n                            } else if (type === 1) {\n                                // Color\n                                $image.css({\n                                    background: value\n                                });\n                                $image.show();\n                            } else if (type === 0 || type === 3) {\n                                // Default\n                                $image.hide();\n                            }\n\n                            $title.text(label);\n\n                            leftOpt = $this.offset().left;\n                            left = leftOpt + $this.width() / 2 - $element.width() / 2;\n                            $window = $(window);\n\n                            // the numbers (5 and 5) is magick constants for offset from left or right page\n                            if (left < 0) {\n                                left = 5;\n                            } else if (left + $element.width() > $window.width()) {\n                                left = $window.width() - $element.width() - 5;\n                            }\n\n                            // the numbers (6,  3 and 18) is magick constants for offset tooltip\n                            leftCorner = 0;\n\n                            if ($element.width() < $this.width()) {\n                                leftCorner = $element.width() / 2 - 3;\n                            } else {\n                                leftCorner = (leftOpt > left ? leftOpt - left : left - leftOpt) + $this.width() / 2 - 6;\n                            }\n\n                            $corner.css({\n                                left: leftCorner\n                            });\n                            $element.css({\n                                left: left,\n                                top: $this.offset().top - $element.height() - $corner.height() - 18\n                            }).show();\n                        },\n                        $widget.options.delay\n                    );\n                }\n            }, function () {\n                $element.hide();\n                clearTimeout(timer);\n            });\n\n            $(document).on('tap', function () {\n                $element.hide();\n                clearTimeout(timer);\n            });\n\n            $this.on('tap', function (event) {\n                event.stopPropagation();\n            });\n        }\n    });
2\n\n    /**\n     * Render swatch controls with options and use tooltips.\n     * Required two json:\n     *  - jsonConfig (magento's option config)\n     *  - jsonSwatchConfig (swatch's option config)\n     *\n     *  Tuning:\n     *  - numberToShow (show \"more\" button if options are more)\n     *  - onlySwatches (hide selectboxes)\n     *  - moreButtonText (text for \"more\" button)\n     *  - selectorProduct (selector for product container)\n     *  - selectorProductPrice (selector for change price)\n     */\n    $.widget('mage.SwatchRenderer', {\n        options: {\n            classes: {\n                attributeClass: 'swatch-attribute',\n                attributeLabelClass: 'swatch-attribute-label',\n                attributeSelectedOptionLabelClass: 'swatch-attribute-selected-option',\n                attributeOptionsWrapper: 'swatch-attribute-options',\n                attributeInput: 'swatch-input',\n                optionClass: 'swatch-option',\n                selectClass: 'swatch-select',\n                moreButton: 'swatch-more',\n                loader: 'swatch-option-loading'\n            },\n            // option's json config\n            jsonConfig: {},\n\n            // swatch's json config\n            jsonSwatchConfig: {},\n\n            // selector of parental block of prices and swatches (need to know where to seek for price block)\n            selectorProduct: '.product-info-main',\n\n            // selector of price wrapper (need to know where set price)\n            selectorProductPrice: '[data-role=priceBox]',\n\n            //selector of product images gallery wrapper\n            mediaGallerySelector: '[data-gallery-role=gallery-placeholder]',\n\n            // selector of category product tile wrapper\n            selectorProductTile: '.product-item',\n\n            // number of controls to show (false or zero = show all)\n            numberToShow: false,\n\n            // show only swatch controls\n            onlySwatches: false,\n\n            // enable label for control\n            enableControlLabel: true,\n\n            // control label id\n            controlLabelId: '',\n\n            // text for more button\n            moreButtonText: $t('More'),\n\n            // Callback url for media\n            mediaCallback: '',\n\n            // Local media cache\n            mediaCache: {},\n\n            // Cache for BaseProduct images. Needed when option unset\n            mediaGalleryInitial: [{}],\n\n            // Use ajax to get image data\n            useAjax: false,\n\n            /**\n             * Defines the mechanism of how images of a gallery should be\n             * updated when user switches between configurations of a product.\n             *\n             * As for now value of this option can be either 'replace' or 'prepend'.\n             *\n             * @type {String}\n             */\n            gallerySwitchStrategy: 'replace',\n\n            // whether swatches are rendered in product list or on product page\n            inProductList: false,\n\n            // sly-old-price block selector\n            slyOldPriceSelector: '.sly-old-price',\n\n            // tier prise selectors start\n            tierPriceTemplateSelector: '#tier-prices-template',\n            tierPriceBlockSelector: '[data-role=\"tier-price-block\"]',\n            tierPriceTemplate: '',\n            // tier prise selectors end\n\n            // A price label selector\n            normalPriceLabelSelector: '.normal-price .price-label'\n        },\n\n        /**\n         * Get chosen product\n         *\n         * @returns int|null\n         */\n        getProduct: function () {\n            var products = this._CalcProducts();\n\n            return _.isArray(products) ? products[0] : null;\n        },\n\n        /**\n         * @private\n         */\n        _init: function () {\n            if (_.isEmpty(this.options.jsonConfig.images)) {\n                this.options.useAjax = true;\n                // creates debounced variant of _LoadProductMedia()\n                // to use it in events handlers instead of _LoadProductMedia()\n                this._debouncedLoadProductMedia = _.debounce(this._LoadProductMedia.bind(this), 500);\n            }\n\n            if (this.options.jsonConfig !== '' && this.options.jsonSwatchConfig !== '') {\n                // store unsorted attributes\n                this.options.jsonConfig.mappedAttributes = _.clone(this.options.jsonConfig.attributes);\n                this._sortAttributes();\n                this._RenderControls();\n                this._setPreSelectedGallery();\n                $(this.element).trigger('swatch.initialized');\n            } else {\n                console.log('SwatchRenderer: No input data received');\n            }\n            this.options.tierPriceTemplate = $(this.options.tierPriceTemplateSelector).html();\n        },\n\n        /**\n         * @private\n         */\n        _sortAttributes: function () {\n            this.options.jsonConfig.attributes = _.sortBy(this.options.jsonConfig.attributes, function (attribute) {\n                return parseInt(attribute.position, 10);\n            });\n        },\n\n        /**\n         * @private\n         */\n        _create: function () {\n            var options = this.options,\n                gallery = $('[data-gallery-role=gallery-placeholder]', '.column.main'),\n                productData = this._determineProductData(),\n                $main 
2= productData.isInProductView ?\n                    this.element.parents('.column.main') :\n                    this.element.parents('.product-item-info');\n\n            if (productData.isInProductView) {\n                gallery.data('gallery') ?\n                    this._onGalleryLoaded(gallery) :\n                    gallery.on('gallery:loaded', this._onGalleryLoaded.bind(this, gallery));\n            } else {\n                options.mediaGalleryInitial = [{\n                    'img': $main.find('.product-image-photo').attr('src')\n                }];\n            }\n\n            this.productForm = this.element.parents(this.options.selectorProductTile).find('form:first');\n            this.inProductList = this.productForm.length > 0;\n        },\n\n        /**\n         * Determine product id and related data\n         *\n         * @returns {{productId: *, isInProductView: bool}}\n         * @private\n         */\n        _determineProductData: function () {\n            // Check if product is in a list of products.\n            var productId,\n                isInProductView = false;\n\n            productId = this.element.parents('.product-item-details')\n                    .find('.price-box.price-final_price').attr('data-product-id');\n\n            if (!productId) {\n                // Check individual product.\n                productId = $('[name=product]').val();\n                isInProductView = productId > 0;\n            }\n\n            return {\n                productId: productId,\n                isInProductView: isInProductView\n            };\n        },\n\n        /**\n         * Render controls\n         *\n         * @private\n         */\n        _RenderControls: function () {\n            var $widget = this,\n                container = this.element,\n                classes = this.options.classes,\n                chooseText = this.options.jsonConfig.chooseText;\n\n            $widget.optionsMap = {};\n\n            $.each(this.options.jsonConfig.attributes, function () {\n                var item = this,\n                    controlLabelId = 'option-label-' + item.code + '-' + item.id,\n                    options = $widget._RenderSwatchOptions(item, controlLabelId),\n                    select = $widget._RenderSwatchSelect(item, chooseText),\n                    input = $widget._RenderFormInput(item),\n                    listLabel = '',\n                    label = '';\n\n                // Show only swatch controls\n                if ($widget.options.onlySwatches && !$widget.options.jsonSwatchConfig.hasOwnProperty(item.id)) {\n                    return;\n                }\n\n                if ($widget.options.enableControlLabel) {\n                    label +=\n                        '<span id=\"' + controlLabelId + '\" class=\"' + classes.attributeLabelClass + '\">' +\n                            item.label +\n                        '</span>' +\n                        '<span class=\"' + classes.attributeSelectedOptionLabelClass + '\"></span>';\n                }\n\n                if ($widget.inProductList) {\n                    $widget.productForm.append(input);\n                    input = '';\n                    listLabel = 'aria-label=\"' + item.label + '\"';\n                } else {\n                    listLabel = 'aria-labelledby=\"' + controlLabelId + '\"';\n                }\n\n                // Create new control\n                container.append(\n                    '<div class=\"' + classes.attributeClass + ' ' + item.code + '\" ' +\n                         'attribute-code=\"' + item.code + '\" ' +\n                         'attribute-id=\"' + item.id + '\">' +\n                        label +\n                        '<div aria-activedescendant=\"\" ' +\n                             'tabindex=\"0\" ' +\n                             'aria-invalid=\"false\" ' +\n                             'aria-required=\"true\" ' +\n                             'role=\"listbox\" ' + listLabel +\n                             'class=\"' + classes.attributeOptionsWrapper + ' clearfix\">' +\n                            options + select +\n                        '</div>' + input +\n                    '</div>'\n                );\n\n                $widget.optionsMap[item.id] = {};\n\n                // Aggregate options array to hash (key => value)\n                $.each(item.options, function () {\n                    if (this.products.length > 0) {\n                        $widget.optionsMap[item.id][this.id] = {\n                            price: parseInt(\n                                $widget.options.jsonConfig.optionPrices[this.products[0]].finalPrice.amount,\n                                10\n                            ),\n                            products: this.products\n                        };\n                    }\n                });\n            });\n\n            // Connect Tooltip\n            container\n                .find('[option-type=\"1\"], [option-type=\"2\"], [option-type=\"0\"], [option-type=\"3\"]')\n                .SwatchRendererTooltip();\n\n            // Hide all elements below more button\n            $('.' + classes.moreButton).nextAll().hide();\n\n            // Handle events like click or change\n            $widget._EventListener();\n\n            // Rewind options\n            $widget._Rewind(container);\n\n            //Emulate click on all swatches from Request\n            $widget._EmulateSelected($.parseQuery());\n            $widget._EmulateSelected($widget._getSelectedAttributes());\n        }
2,\n\n        /**\n         * Render swatch options by part of config\n         *\n         * @param {Object} config\n         * @param {String} controlId\n         * @returns {String}\n         * @private\n         */\n        _RenderSwatchOptions: function (config, controlId) {\n            var optionConfig = this.options.jsonSwatchConfig[config.id],\n                optionClass = this.options.classes.optionClass,\n                sizeConfig = this.options.jsonSwatchImageSizeConfig,\n                moreLimit = parseInt(this.options.numberToShow, 10),\n                moreClass = this.options.classes.moreButton,\n                moreText = this.options.moreButtonText,\n                countAttributes = 0,\n                html = '';\n\n            if (!this.options.jsonSwatchConfig.hasOwnProperty(config.id)) {\n                return '';\n            }\n\n            $.each(config.options, function () {\n                var id,\n                    type,\n                    value,\n                    thumb,\
2n                    label,\n                    width,\n                    height,\n                    attr;\n\n                if (!optionConfig.hasOwnProperty(this.id)) {\n                    return '';\n                }\n\n                // Add more button\n                if (moreLimit === countAttributes++) {\n                    html += '<a href=\"#\" class=\"' + moreClass + '\">' + moreText + '</a>';\n                }\n\n                id = this.id;\n                type = parseInt(optionConfig[id].type, 10);\n                value = optionConfig[id].hasOwnProperty('value') ? optionConfig[id].value : '';\n                thumb = optionConfig[id].hasOwnProperty('thumb') ? optionConfig[id].thumb : '';\n                width = _.has(sizeConfig, 'swatchThumb') ? sizeConfig.swatchThumb.width : 110;\n                height = _.has(sizeConfig, 'swatchThumb') ? sizeConfig.swatchThumb.height : 90;\n                label = this.label ? this.label : '';\n                attr =\n                    ' id=\"' + controlId + '-item-' + id + '\"' +\n                    ' aria-checked=\"false\"' +\n                    ' aria-describedby=\"' + controlId + '\"' +\n                    ' tabindex=\"0\"' +\n                    ' option-type=\"' + type + '\"' +\n                    ' option-id=\"' + id + '\"' +\n                    ' option-label=\"' + label + '\"' +\n                    ' aria-label=\"' + label + '\"' +\n                    ' option-tooltip-thumb=\"' + thumb + '\"' +\n                    ' option-tooltip-value=\"' + value + '\"' +\n                    ' role=\"option\"' +\n                    ' thumb-width=\"' + width + '\"' +\n                    ' thumb-height=\"' + height + '\"';\n\n                if (!this.hasOwnProperty('products') || this.products.length <= 0) {\n                    attr += ' option-empty=\"true\"';\n                }\n\n                if (type === 0) {\n                    // Text\n                    html += '<div class=\"' + optionClass + ' text\" ' + attr + '>' + (value ? value : label) +\n                        '</div>';\n                } else if (type === 1) {\n                    // Color\n                    html += '<div class=\"' + optionClass + ' color\" ' + attr +\n                        ' style=\"background: ' + value +\n                        ' no-repeat center; background-size: initial;\">' + '' +\n                        '</div>';\n                } else if (type === 2) {\n                    // Image\n                    html += '<div class=\"' + optionClass + ' image\" ' + attr +\n                        ' style=\"background: url(' + value + ') no-repeat center; background-size: initial;width:' +\n                        sizeConfig.swatchImage.width + 'px; height:' + sizeConfig.swatchImage.height + 'px\">' + '' +\n                        '</div>';\n                } else if (type === 3) {\n                    // Clear\n                    html += '<div class=\"' + optionClass + '\" ' + attr + '></div>';\n                } else {\n                    // Default\n                    html += '<div class=\"' + optionClass + '\" ' + attr + '>' + label + '</div>';\n                }\n            });\n\n            return html;\n        },\n\n        /**\n         * Render select by part of config\n         *\n         * @param {Object} config\n         * @param {String} chooseText\n         * @returns {String}\n         * @private\n         */\n        _RenderSwatchSelect: function (config, chooseText) {\n            var html;\n\n            if (this.options.jsonSwatchConfig.hasOwnProperty(config.id)) {\n                return '';\n            }\n\n            html =\n                '<select class=\"' + this.options.classes.selectClass + ' ' + config.code + '\">' +\n                '<option value=\"0\" option-id=\"0\">' + chooseText + '</option>';\n\n            $.each(config.options, function () {\n                var label = this.label,\n                    attr = ' value=\"' + this.id + '\" option-id=\"' + this.id + '\"';\n\n                if (!this.hasOwnProperty('products') || this.products.length <= 0) {\n                    attr += ' option-empty=\"true\"';\n                }\n\n                html += '<option ' + attr + '>' + label + '</option>';
2\n            });\n\n            html += '</select>';\n\n            return html;\n        },\n\n        /**\n         * Input for submit form.\n         * This control shouldn't have \"type=hidden\", \"display: none\" for validation work :(\n         *\n         * @param {Object} config\n         * @private\n         */\n        _RenderFormInput: function (config) {\n            return '<input class=\"' + this.options.classes.attributeInput + ' super-attribute-select\" ' +\n                'name=\"super_attribute[' + config.id + ']\" ' +\n                'type=\"text\" ' +\n                'value=\"\" ' +\n                'data-selector=\"super_attribute[' + config.id + ']\" ' +\n                'data-validate=\"{required: true}\" ' +\n                'aria-required=\"true\" ' +\n                'aria-invalid=\"false\">';\n        },\n\n        /**\n         * Event listener\n         *\n         * @private\n         */\n        _EventListener: function () {\n            var $widget = this,\n                options = this.options.classes,\n                target;\n\n            $widget.element.on('click', '.' + options.optionClass, function () {\n                return $widget._OnClick($(this), $widget);\n            });\n\n            $widget.element.on('change', '.' + options.selectClass, function () {\n                return $widget._OnChange($(this), $widget);\n            });\n\n            $widget.element.on('click', '.' + options.moreButton, function (e) {\n                e.preventDefault();\n\n                return $widget._OnMoreClick($(this));\n            });\n\n            $widget.element.on('keydown', function (e) {\n                if (e.which === 13) {\n                    target = $(e.target);\n\n                    if (target.is('.' + options.optionClass)) {\n                        return $widget._OnClick(target, $widget);\n                    } else if (target.is('.' + options.selectClass)) {\n                        return $widget._OnChange(target, $widget);\n                    } else if (target.is('.' + options.moreButton)) {\n                        e.preventDefault();\n\n                        return $widget._OnMoreClick(target);\n                    }\n                }\n            });\n        },\n\n        /**\n         * Load media gallery using ajax or json config.\n         *\n         * @private\n         */\n        _loadMedia: function () {\n            var $main = this.inProductList ?\n                    this.element.parents('.product-item-info') :\n                    this.element.parents('.column.main'),\n                images;\n\n            if (this.options.useAjax) {\n                this._debouncedLoadProductMedia();\n            }  else {\n                images = this.options.jsonConfig.images[this.getProduct()];\n\n                if (!images) {\n                    images = this.options.mediaGalleryInitial;\n                }\n\n                this.updateBaseImage(images, $main, !this.inProductList);\n            }\n        },\n\n        /**\n         * Event for swatch options\n         *\n         * @param {Object} $this\n         * @param {Object} $widget\n         * @private\n         */\n        _OnClick: function ($this, $widget) {\n            var $parent = $this.parents('.' + $widget.options.classes.attributeClass),\n                $wrapper = $this.parents('.' + $widget.options.classes.attributeOptionsWrapper),\n                $label = $parent.find('.' + $widget.options.classes.attributeSelectedOptionLabelClass),\n                attributeId = $parent.attr('attribute-id'),\n                $input = $parent.find('.' + $widget.options.classes.attributeInput);\n\n            if ($widget.inProductList) {\n                $input = $widget.productForm.find(\n                    '.' + $widget.options.classes.attributeInput + '[name=\"super_attribute[' + attributeId + ']\"]'\n                );\n            }\n\n            if ($this.hasClass('disabled')) {\n                return;\n            }\n\n            if ($this.hasClass('selected')) {\n                $parent.removeAttr('option-selected').find('.selected').removeClass('selected');\n                $input.val('');\n                $label.text('');\n                $this.attr('aria-checked', false);\n            } else {\n                $parent.attr('option-selected', $this.attr('option-id')).find('.selected').removeClass('selected');\n                $label.text($this.attr('option-label'));\n                $input.val($this.attr('option-id'));\n                $input.attr('data-attr-name', this._getAttributeCodeById(attributeId));\n                $this.addClass('selected');\n                $widget._toggleCheckedAttributes($this, $wrapper);\n            }\n\n            $widget._Rebuild();\n\n            if ($widget.element.parents($widget.options.selectorProduct)\n                    .find(this.options.selectorProductPrice).is(':data(mage-priceBox)')\n            ) {\n                $widget._UpdatePrice();\n            }\n\n            $widget._loadMedia();\n            $input.trigger('change');\n        },\n\n        /**\n         * Get human readable attribute code (eg. size, color) by it ID from configuration\n         *\n         * @param {Number} attributeId\n         * @returns {*}\n         * @private\n         */\n        _getAttributeCodeById: function (attributeId) {\n            var attribute = this.options.jsonConfig.mappedAttributes[attributeId];\n\n            return attribute ? attribute.code : attributeId;\n        },\n\n        /**\n         * Toggle accessibility attributes\n         *\n         * @param {Object} $this\n         * @param {Object} $wrapper\n         * @private\n         */\n        _toggleCheckedAttributes: function ($this, $wrapper) {\n            $wrapper.attr('aria-activedescendant', $this.attr('id'))\n                    .find('.' + this.options.classes.optionClass).attr('aria-checked', false);\n            $this.attr('aria-checked', true);\n        },\n\n        /**\n         * Event for select\n         *\n         * @param {Object} $this\n         * @param {Object} $widget\n         * @private\n         */\n        _OnChange: function ($this, $widget) {\n            var $parent = $this.parents('.' + $widget.options.classes.attributeClass),\n                attributeId = $parent.attr('attribute-id'),\n                $input = $parent.find('.' + $widget.options.classes.attributeInput);\n\n            if ($widget.productForm.length > 0) {\n                $input = $widget.productForm.find(\n                    '.' + $widget.options.classes.attributeInput + '[name=\"super_attribute[' + attributeId + ']\"]'\n                );\n            }\n\n            if ($this.val() > 0) {\n                $parent.attr('option-selected', $this.val());\n                $input.val($this.val());\n            } else {\n                $parent.removeAttr('option-selected');\n                $input.val('');\n            }\n\n            $widget._Rebuild();\n            $widget._UpdatePrice();\n            $widget._loadMedia();\n            $input.trigger('change');\n        },\n\n        /**\n         * Event for more switcher\n         *\n         * @param {Object} $this\n         * @private\n         */\n        _OnMoreClick: function ($this) {\n            $this.nextAll().show();\n            $this.blur().remove();\n        }
2,\n\n        /**\n         * Rewind options for controls\n         *\n         * @private\n         */\n        _Rewind: function (controls) {\n            controls.find('div[option-id], option[option-id]').removeClass('disabled').removeAttr('disabled');\n            controls.find('div[option-empty], option[option-empty]').attr('disabled', true).addClass('disabled');\n        },\n\n        /**\n         * Rebuild container\n         *\n         * @private\n         */\n        _Rebuild: function () {\n            var $widget = this,\n                controls = $widget.element.find('.' + $widget.options.classes.attributeClass + '[attribute-id]'),\n                selected = controls.filter('[option-selected]');\n\n            // Enable all options\n            $widget._Rewind(controls);\n\n            // done if nothing selected\n            if (selected.length <= 0) {\n                return;\n            }\n\n            // Disable not available options\n            controls.each(function () {\n                var $this = $(this),\n                    id = $this.attr('attribute-id'),\n                    products = $widget._CalcProducts(id);\n\n                if (selected.length === 1 && selected.first().attr('attribute-id') === id) {\n                    return;\n                }\n\n                $this.find('[option-id]').each(function () {\n                    var $element = $(this),\n                        option = $element.attr('option-id');\n\n                    if (!$widget.optionsMap.hasOwnProperty(id) || !$widget.optionsMap[id].hasOwnProperty(option) ||\n                        $element.hasClass('selected') ||\n                        $element.is(':selected')) {\n                        return;\n                    }\n\n                    if (_.intersection(products, $widget.optionsMap[id][option].products).length <= 0) {\n                        $element.attr('disabled', true).addClass('disabled');\n                    }\n                });\n            });\n        },\n\n        /**\n         * Get selected product list\n         *\n         * @returns {Array}\n         * @private\n         */\n        _CalcProducts: function ($skipAttributeId) {\n            var $widget = this,\n                products = [];\n\n            // Generate intersection of products\n            $widget.element.find('.' + $widget.options.classes.attributeClass + '[option-selected]').each(function () {\n                var id = $(this).attr('attribute-id'),\n                    option = $(this).attr('option-selected');\n\n                if ($skipAttributeId !== undefined && $skipAttributeId === id) {\n                    return;\n                }\n\n                if (!$widget.optionsMap.hasOwnProperty(id) || !$widget.optionsMap[id].hasOwnProperty(option)) {\n                    return;\n                }\n\n                if (products.length === 0) {\n                    products = $widget.optionsMap[id][option].products;\n                } else {\n                    products = _.intersection(products, $widget.optionsMap[id][option].products);\n                }\n            });\n\n            return products;\n        },\n\n        /**\n         * Update total price\n         *\n         * @private\n         */\n        _UpdatePrice: function () {\n            var $widget = this,\n                $product = $widget.element.parents($widget.options.selectorProduct),\n                $productPrice = $product.find(this.options.selectorProductPrice),\n                options = _.object(_.keys($widget.optionsMap), {}),\n                result,\n                tierPriceHtml;\n\n            $widget.element.find('.' + $widget.options.classes.attributeClass + '[option-selected]').each(function () {\n                var attributeId = $(this).attr('attribute-id');\n\n                options[attributeId] = $(this).attr('option-selected');\n            });\n\n            result = $widget.options.jsonConfig.optionPrices[_.findKey($widget.options.jsonConfig.index, options)];\n\n            $productPrice.trigger(\n                'updatePrice',\n                {\n                    'prices': $widget._getPrices(result, $productPrice.priceBox('option').prices)\n                }\n            );\n\n            if (typeof result != 'undefined' && result.oldPrice.amount !== result.finalPrice.amount) {\n                $(this.options.slyOldPriceSelector).show();\n            } else {\n                $(this.options.slyOldPriceSelector).hide();\n            }\n\n            if (typeof result != 'undefined' && result.tierPrices.length) {\n                if (this.options.tierPriceTemplate) {\n                    tierPriceHtml = mageTemplate(\n                        this.options.tierPriceTemplate,\n                        {\n                            'tierPrices': result.tierPrices,\
2n                            '$t': $t,\n                            'currencyFormat': this.options.jsonConfig.currencyFormat,\n                            'priceUtils': priceUtils\n                        }\n                    );\n                    $(this.options.tierPriceBlockSelector).html(tierPriceHtml).show();\n                }\n            } else {\n                $(this.options.tierPriceBlockSelector).hide();\n            }\n\n            $(this.options.normalPriceLabelSelector).hide();\n\n            _.each($('.' + this.options.classes.attributeOptionsWrapper), function (attribute) {\n                if ($(attribute).find('.' + this.options.classes.optionClass + '.selected').length === 0) {\n                    if ($(attribute).find('.' + this.options.classes.selectClass).length > 0) {\n                        _.each($(attribute).find('.' + this.options.classes.selectClass), function (dropdown) {\n                            if ($(dropdown).val() === '0') {\n                                $(this.options.normalPriceLabelSelector).show();\n                            }\n                        }.bind(this));\n                    } else {\n                        $(this.options.normalPriceLabelSelector).show();\n                    }\n                }\n            }.bind(this));\n        },\n\n        /**\n         * Get prices\n         *\n         * @param {Object} newPrices\n         * @param {Object} displayPrices\n         * @returns {*}\n         * @private\n         */\n        _getPrices: function (newPrices, displayPrices) {\n            var $widget = this;\n\n            if (_.isEmpty(newPrices)) {\n                newPrices = $widget.options.jsonConfig.prices;\n            }\n\n            _.each(displayPrices, function (price, code) {\n                if (newPrices[code]) {\n                    displayPrices[code].amount = newPrices[code].amount - displayPrices[code].amount;\n                }\n            });\n\n            return displayPrices;\n        },\n\n        /**\n         * Gets all product media and change current to the needed one\n         *\n         * @private\n         */\n        _LoadProductMedia: function () {\n            var $widget = this,\n                $this = $widget.element,\n                productData = this._determineProductData(),\n                mediaCallData,\n                mediaCacheKey,\n\n                /**\n                 * Processes product media data\n                 *\n                 * @param {Object} data\n                 * @returns void\n                 */\n                mediaSuccessCallback = function (data) {\
2n                    if (!(mediaCacheKey in $widget.options.mediaCache)) {\n                        $widget.options.mediaCache[mediaCacheKey] = data;\n                    }\n                    $widget._ProductMediaCallback($this, data, productData.isInProductView);\n                    setTimeout(function () {\n                        $widget._DisableProductMediaLoader($this);\n                    }, 300);\n                };\n\n            if (!$widget.options.mediaCallback) {\n                return;\n            }\n\n            mediaCallData = {\n                'product_id': this.getProduct()\n            };\n\n            mediaCacheKey = JSON.stringify(mediaCallData);\n\n            if (mediaCacheKey in $widget.options.mediaCache) {\n                $widget._XhrKiller();\n                $widget._EnableProductMediaLoader($this);\n                mediaSuccessCallback($widget.options.mediaCache[mediaCacheKey]);\n            } else {\n                mediaCallData.isAjax = true;\n                $widget._XhrKiller();\n                $widget._EnableProductMediaLoader($this);\n                $widget.xhr = $.get(\n                    $widget.options.mediaCallback,\n                    mediaCallData,\n                    mediaSuccessCallback,\n                    'json'\n                ).done(function () {\n                    $widget._XhrKiller();\n                });\n            }\n        },\n\n        /**\n         * Enable loader\n         *\n         * @param {Object} $this\n         * @private\n         */\n        _EnableProductMediaLoader: function ($this) {\n            var $widget = this;\n\n            if ($('body.catalog-product-view').length > 0) {\n                $this.parents('.column.main').find('.photo.image')\n                    .addClass($widget.options.classes.loader);\n            } else {\n                //Category View\n                $this.parents('.product-item-info').find('.product-image-photo')\n                    .addClass($widget.options.classes.loader);\n            }\n        },\n\n        /**\n         * Disable loader\n         *\n         * @param {Object} $this\n         * @private\n         */\n        _DisableProductMediaLoader: function ($this) {\n            var $widget = this;\n\n            if ($('body.catalog-product-view').length > 0) {\n                $this.parents('.column.main').find('.photo.image')\n                    .removeClass($widget.options.classes.loader);\n            } else {\n                //Category View\n                $this.parents('.product-item-info').find('.product-image-photo')\n                    .removeClass($widget.options.classes.loader);\n            }\n        },\n\n        /**\n         * Callback for product media\n         *\n         * @param {Object} $this\n         * @param {String} response\n         * @param {Boolean} isInProductView\n         * @private\n         */\n        _ProductMediaCallback: function ($this, response, isInProductView) {\n            var $main = isInProductView ? $this.parents('.column.main') : $this.parents('.product-item-info'),\n                $widget = this,\n                images = [],\n\n                /**\n                 * Check whether object supported or not\n                 *\n                 * @param {Object} e\n                 * @returns {*|Boolean}\n                 */\n                support = function (e) {\n                    return e.hasOwnProperty('large') && e.hasOwnProperty('medium') && e.hasOwnProperty('small');\n                };\n\n            if (_.size($widget) < 1 || !support(response)) {\n                this.updateBaseImage(this.options.mediaGalleryInitial, $main, isInProductView);\n\n                return;\n            }\n\n            images.push({\n                full: response.large,\n                img: response.medium,\n                thumb: response.small,\n                isMain: true\n            });\n\n            if (response.hasOwnProperty('gallery')) {\n                $.each(response.gallery, function () {\n                    if (!support(this) || response.large === this.large) {\n                        return;\n                    }\n                    images.push({\n                        full: this.large,\n                        img: this.medium,\n                        thumb: this.small\n                    });\n                });\n            }\n\n            this.updateBaseImage(images, $main, isInProductView);\n        },\n\n        /**\n         * Check if images to update are initial and set their type\n         * @param {Array} images\n         */\n        _setImageType: function (images) {\n            var initial = this.options.mediaGalleryInitial[0].img;\n\n            if (images[0].img === initial) {\n                images = $.extend(true, [], this.options.mediaGalleryInitial);\n            } else {\n                images.map(function (img) {\n                    if (!img.type) {\n                        img.type = 'image';\n                    }\n                });\n            }\n\n            return images;\n        },\n\n        /**\n         * Update [gallery-placeholder] or [product-image-photo]\n         * @param {Array} images\n         * @param {jQuery} context\n         * @param {Boolean} isInProductView\n         */\n        updateBaseImage: function (images, context, isInProductView) {\n            var justAnImage = images[0],\n                initialImages = this.options.mediaGalleryInitial,\n                gallery = context.find(this.options.mediaGallerySelector).data('gallery'),\n                imagesToUpdate,\n                isInitial;\n\n            if (isInProductView) {\n                imagesToUpdate = images.length ? this._setImageType($.extend(true, [], images)) : [];\n                isInitial = _.isEqual(imagesToUpdate, initialImages);\n\n                if (this.options.gallerySwitchStrategy === 'prepend' && !isInitial) {\n                    imagesToUpdate = imagesToUpdate.concat(initialImages);\n                }\n\n                imagesToUpdate = this._setImageIndex(imagesToUpdate);\n                gallery.updateData(imagesToUpdate);\n\n                if (isInitial) {\n                    $(this.options.mediaGallerySelector).AddFotoramaVideoEvents();\n                } else {\n                    $(this.options.mediaGallerySelector).AddFotoramaVideoEvents({\n                        selectedOption: this.getProduct(),\n                        dataMergeStrategy: this.options.gallerySwitchStrategy\n                    });\n                }\n\n                gallery.first();\n\n            } else if (justAnImage && justAnImage.img) {\n                context.find('.product-image-photo').attr('src', justAnImage.img);\n            }\n        },\n\n        /**\n         * Set correct indexes for image set.\n         *\n         * @param {Array} images\n         * @private\n         */\n        _setImageIndex: function (images) {\n            var length = images.length,\n                i;\n\n            for (i = 0; length > i;
2 i++) {\n                images[i].i = i + 1;\n            }\n\n            return images;\n        },\n\n        /**\n         * Kill doubled AJAX requests\n         *\n         * @private\n         */\n        _XhrKiller: function () {\n            var $widget = this;\n\n            if ($widget.xhr !== undefined && $widget.xhr !== null) {\n                $widget.xhr.abort();\n                $widget.xhr = null;\n            }\n        },\n\n        /**\n         * Emulate mouse click on all swatches that should be selected\n         * @param {Object} [selectedAttributes]\n         * @private\n         */\n        _EmulateSelected: function (selectedAttributes) {\n            $.each(selectedAttributes, $.proxy(function (attributeCode, optionId) {\n                var elem = this.element.find('.' + this.options.classes.attributeClass +\n                    '[attribute-code=\"' + attributeCode + '\"] [option-id=\"' + optionId + '\"]'),\n                    parentInput = elem.parent();\n\n                if (elem.hasClass('selected')) {\n                    return;\n                }\n\n                if (parentInput.hasClass(this.options.classes.selectClass)) {\n                    parentInput.val(optionId);\n                    parentInput.trigger('change');\n                } else {\n                    elem.trigger('click');\n                }\n            }, this));\n        },\n\n        /**\n         * Emulate mouse click or selection change on all swatches that should be selected\n         * @param {Object} [selectedAttributes]\n         * @private\n         */\n        _EmulateSelectedByAttributeId: function (selectedAttributes) {\n            $.each(selectedAttributes, $.proxy(function (attributeId, optionId) {\n                var elem = this.element.find('.' + this.options.classes.attributeClass +\n                    '[attribute-id=\"' + attributeId + '\"] [option-id=\"' + optionId + '\"]'),\n                    parentInput = elem.parent();\n\n                if (elem.hasClass('selected')) {\n                    return;\n                }\n\n                if (parentInput.hasClass(this.options.classes.selectClass)) {\n                    parentInput.val(optionId);\n                    parentInput.trigger('change');\n                } else {\n                    elem.trigger('click');\n                }\n            }, this));\n        },\n\n        /**\n         * Get default options values settings with either URL query parameters\n         * @private\n         */\n        _getSelectedAttributes: function () {\n            var hashIndex = window.location.href.indexOf('#'),\n                selectedAttributes = {},\n                params;\n\n            if (hashIndex !== -1) {\n                params = $.parseQuery(window.location.href.substr(hashIndex + 1));\n\n                selectedAttributes = _.invert(_.mapObject(_.invert(params), function (attributeId) {\n                    var attribute = this.options.jsonConfig.mappedAttributes[attributeId];\n\n                    return attribute ? attribute.code : attributeId;\n                }.bind(this)));\n            }\n\n            return selectedAttributes;\n        },\n\n        /**\n         * Callback which fired after gallery gets initialized.\n         *\n         * @param {HTMLElement} element - DOM element associated with a gallery.\n         */\n        _onGalleryLoaded: function (element) {\n            var galleryObject = element.data('gallery');\n\n            this.options.mediaGalleryInitial = galleryObject.returnCurrentImages();\n        },\n\n        /**\n         * Sets mediaCache for cases when jsonConfig contains preSelectedGallery on layered navigation result pages\n         *\n         * @private\n         */\n        _setPreSelectedGallery: function () {\n            var mediaCallData;\n\n            if (this.options.jsonConfig.preSelectedGallery) {\n                mediaCallData = {\n                    'product_id': this.getProduct()\n                };\n\n                this.options.mediaCache[JSON.stringify(mediaCallData)] = this.options.jsonConfig.preSelectedGallery;\n            }\n        }\n    });\n\n    return $.mage.SwatchRenderer;\n});\n","Amazon_Payment/js/amazon-button.js":"/**\n * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * 
2Licensed under the Apache License, Version 2.0 (the \"License\").\n * You may not use this file except in compliance with the License.\n * A copy of the License is located at\n *\n *  http://aws.amazon.com/apache2.0\n *\n * or in the \"license\" file accompanying this file. This file is distributed\n * on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either\n * express or implied. See the License for the specific language governing\n * permissions and limitations under the License.\n */\ndefine([\n    'jquery',\n    'Magento_Customer/js/customer-data',\n    'Magento_Customer/js/section-config',\n    'Amazon_Payment/js/model/amazonPaymentConfig',\n    'amazonCsrf',\n    'modernizr/modernizr',\n    'amazonCore',\n    'jquery/ui',\n    'uiRegistry'\n], function ($, customerData, sectionConfig, amazonPaymentConfig, amazonCsrf) {\n    'use strict';\n    var _this, $button;\n\n    if (amazonPaymentConfig.isDefined()) {\n        $.widget('amazon.AmazonButton', {\n            options: {\n                merchantId: null,\n                buttonType: 'LwA',\n                buttonColor: 'Gold',\n                buttonSize: 'medium',\n                redirectUrl: null,\n                loginPostUrl: null\n            },\n\n            /**\n             * Create button\n             */\n            _create: function () {\n                _this = this;\n                $button = this.element;\n                this._verifyAmazonConfig();\n                _this._renderAmazonButton();\n            },\n\n            /**\n             * Verify if checkout config is available\n             * @private\n             */\n            _verifyAmazonConfig: function () {\n                if (amazonPaymentConfig.isDefined()) {\n                    _this.options.merchantId = amazonPaymentConfig.getValue('merchantId');\n                    _this.options.buttonType = _this.options.buttonType === 'LwA' ?\n                        amazonPaymentConfig.getValue('buttonTypeLwa') : amazonPaymentConfig.getValue('buttonTypePwa');\n                    _this.options.buttonColor = amazonPaymentConfig.getValue('buttonColor');\n                    _this.options.buttonSize = amazonPaymentConfig.getValue('buttonSize');\n                    _this.options.redirectUrl = amazonPaymentConfig.getValue('redirectUrl');\n                    _this.options.loginPostUrl = amazonPaymentConfig.getValue('loginPostUrl');\n                    _this.options.loginScope = amazonPaymentConfig.getValue('loginScope');\n                    _this.options.buttonLanguage = amazonPaymentConfig.getValue('displayLanguage');\n                }\n            },\n\n            /**\n             * Validate CSRF cookie and redirect to HTTPS\n             */\n            secureHttpsCallback: function (event) {\n                var sections = sectionConfig.getAffectedSections(_this.options.loginPostUrl);\n\n                if (!event.state || !amazonCsrf.isValid(event.state)) {\n                    window.location = amazonPaymentConfig.getValue('customerLoginPageUrl');\n\n                    return window.location;\n                }\n\n                // jscs:disable requireCamelCaseOrUpperCaseIdentifiers\n                if (!event.access_token || !!event.error) {\n                    window.location = amazonPaymentConfig.getValue('customerLoginPageUrl');\n\n                    return window.location;\n                }\n\n                if (sections) {\n                    customerData.invalidate(sections);\n                }\n                window.location = _this.options.redirectUrl + '?access_token=' 
2+ event.access_token;\n                // jscs:enable requireCamelCaseOrUpperCaseIdentifiers\n            },\n\n            /**\n             * Use popup or redirect URI\n             *\n             * @return {String}\n             */\n            _popupCallback: function () {\n                return _this.usePopUp() ? _this.secureHttpsCallback :\n                    amazonPaymentConfig.getValue('oAuthHashRedirectUrl');\n            },\n\n            /**\n             * Are touch events available\n             * (Supports both v2 and v3 Modernizr)\n             * @returns {Boolean}\n             * @private\n             */\n            _touchSupported: function () {\n                //eslint-disable-next-line no-undef\n                return Modernizr.touch !== undefined ? Modernizr.touch : Modernizr.touchevents;\n            },\n\n            /**\n             * Should we use the pop up login flow?\n             *  - are we on an HTTPS page (required for popup)\n             *  - confirm we are not on the product detail page (items are added asynchronously to the cart,\n             *    hence popups will be blocked)\n             *  - confirm we are not using a touch device (redirect provides a better mobile experience)\n             * @returns {Boolean}\n             * @public\n             */\n            usePopUp: function () {\n                return window.location.protocol === 'https:' && !$('body').hasClass('catalog-product-view') &&\n                    !_this._touchSupported();\n            },\n\n            /**\n             * onAmazonPaymentsReady\n             * @private\n             */\n            _renderAmazonButton: function () {\n                OffAmazonPayments.Button($button.attr('id'), _this.options.merchantId, { //eslint-disable-line no-undef\n                    type: _this.options.buttonType,\n                    color: _this.options.buttonColor,\n                    size: _this.options.buttonSize,\n                    language: _this.options.buttonLanguage,\n\n                    /**\n                     * Authorization callback\n                     */\n                    authorization: function () {\n                        //eslint-disable-next-line no-undef\n                        amazon.Login.authorize(_this._getLoginOptions(), _this._popupCallback());\n                    }\n                });\n                $('.amazon-button-container .field-tooltip').fadeIn();\n            },\n\n            /**\n             * Build login options\n             * @returns {{scope: *, popup: *, state: *}}\n             * @private\n             */\n            _getLoginOptions: function () {\n                return {\n                    scope: _this.options.loginScope,\n                    popup: _this.usePopUp(),\n                    state: amazonCsrf.generateNewValue()\n                };\n            }\n        });\n\n        return $.amazon.AmazonButton;\n    }\n});\n","Amazon_Payment/js/amazon-core.js":"/**\n * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\").\n * You may not use this file except in compliance with the License.\n * A copy of the License is located at\n *\n *  http://aws.amazon.com/apache2.0\n *\n * or in the \"license\" file accompanying this file. This file is distributed\n * on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either\n * express or implied. See the License for the specific language governing\n * permissions and limitations under the License.\n */\n\ndefine([\n    'jquery',\n    'ko',\n    'amazonPaymentConfig',\n    'amazonWidgetsLoader',\n    'bluebird',\n    'jquery/jquery-storageapi'\n], function ($, ko, amazonPaymentConfig) {\n    'use strict';\n\n    var clientId = amazonPaymentConfig.getValue('clientId'),\n        amazonDefined = ko.observable(false),\n        amazonLoginError = ko.observable(false),\n        accessToken = ko.observable(null);\n\n    if (typeof amazon === 'undefined') {\n        /**\n         * Amazon login ready callback\n         */\n        window.onAmazonLoginReady = function () {\n            setClientId(clientId);  //eslint-disable-line no-use-before-define\n            doLogoutOnFlagCookie(); //eslint-disable-line no-use-before-define\n        };\n    } else {\n        setClientId(clientId);  //eslint-disable-line no-use-before-define\n        doLogoutOnFlagCookie(); //eslint-disable-line no-use-before-define\n    }\n\n    /**\n     * Set Client ID\n     * @param {String} cid\n     */\n    function setClientId(cid) {\n        amazon.Login.setClientId(cid); //eslint-disable-line no-undef\n        amazonDefined(true);\n    }\n\n    /**\n     * Log user out of amazon\n     */\n    function amazonLogout() {\n        if (amazonDefined()) {\n            amazon.Login.logout(); //eslint-disable-line no-undef\n        } else {\n            var logout = amazonDefined.subscribe(function (defined) { //eslint-disable-line vars-on-top\n                if (defined) {\n                    amazon.Login.logout(); // eslint-disable-line no-undef\n                    logout.dispose(); //remove subscribe\n                }\n            });\n        }\n    }\n\n    /**\n     * Check if login error / logout cookies are present\n     */\n    function doLogoutOnFlagCookie() {\n        var errorFlagCookie = 'amz_auth_err',\n            amazonLogoutCookie = 'amz_auth_logout';\n\n        //eslint-disable-next-line no-use-before-define\n        $.cookieStorage.isSet(errorFlagCookie) ? amazonLogoutThrowError(errorFlagCookie) : false;\n        //eslint-disable-next-line no-use-before-define\n        $.cookieStorage.isSet(amazonLogoutCookie) ? amazonLogoutThrowError(amazonLogoutCookie) : false;\n    }
2\n\n    /**\n     * Handle deletion of cookie and log user out if present\n     */\n    function amazonLogoutThrowError(cookieToRemove) {\n        amazonLogout();\n        document.cookie = cookieToRemove + '=; Path=/; expires=Thu, 01 Jan 1970 00:00:01 GMT;';\n        amazonLoginError(true);\n    }\n\n    return {\n        /**\n         * Verify a user is logged into amazon\n         */\n        verifyAmazonLoggedIn: function () {\n            var defer  = $.Deferred(),\n                loginOptions = {\n                    scope: amazonPaymentConfig.getValue('loginScope'),\n                    popup: true,\n                    interactive: 'never'\n                };\n\n            // jscs:disable requireCamelCaseOrUpperCaseIdentifiers\n            amazon.Login.authorize(loginOptions, function (response) { //eslint-disable-line no-undef\n                if (response.error) {\n                    defer.reject(response.error);\n                } else {\n                    accessToken(response.access_token);\n                    defer.resolve(!response.error);\n                }\n            });\n            // jscs:enable requireCamelCaseOrUpperCaseIdentifiers\n\n            return defer.promise();\n        },\n\n        /**\n         * Log user out of Amazon\n         */\n        AmazonLogout: amazonLogout,\n        amazonDefined: amazonDefined,\n        accessToken: accessToken,\n        amazonLoginError: amazonLoginError\n    };\n\n});\n","Amazon_Payment/js/amazon-product-add.js":"/**\n * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\").\n * You may not use this file except in compliance with the License.\n * A copy of the License is located at\n *\n *  http://aws.amazon.com/apache2.0\n *\n * or in the \"license\" file accompanying this file. This file is distributed\n * on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either\n * express or implied. See the License for the specific language governing\n * permissions and limitations under the License.\n */\n\ndefine([\n    'jquery',\n    'Magento_Customer/js/customer-data',\n    'amazonCore',\n    'jquery/ui'\n], function ($, customerData) {\n    'use strict';\n\n    var _this,\n        addedViaAmazon = false;\n\n    $.widget('amazon.AmazonProductAdd', {\n        options: {\n            addToCartForm: '#product_addtocart_form'\n        },\n\n        /**\n         * Create triggers\n         */\n        _create: function () {\n            _this = this;\n            this.setupTriggers();\n        },\n\n        /**\n         * Setup triggers when item added to cart if amazon pay button pressed\n         */\n        setupTriggers: function () {\n            this.cart = customerData.get('cart');\n\n            //subscribe to add to cart event\n            this.cart.subscribe(function () {\n                //only trigger the amazon button click if the user has chosen to add to cart via this method\n                if (addedViaAmazon) {\n                    addedViaAmazon = false;\n                    $('.login-with-amazon img').trigger('click');\n                }\n            }, this);\n\n            //setup binds for click\n            $('.amazon-addtoCart').on('click', function () {\n                if ($(_this.options.addToCartForm).valid()) {\n                    addedViaAmazon = true;\n                    $(_this.options.addToCartForm).submit();\n                }\n            });\n        }\n\n    });\n\n    return $.amazon.AmazonProductAdd;\n});\n","Amazon_Payment/js/amazon-widgets-loader.js":"/**\n * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\").\n * You may not use this file except in compliance with the License.\n * A copy of the License is located at\n *\n *  http://aws.amazon.com/apache2.0\n *\n * or in the \"license\" file accompanying this file. This file is distributed\n * on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either\n * express or implied. See the License for the specific language governing\n * permissions and limitations under the License.\n */\n\nvar registry = require('uiRegistry');\n\nif (registry.get('amazonPayment') !== undefined) {\n    var amazonPayment = registry.get('amazonPayment');\n\n    define([amazonPayment.widgetUrl], function () {\n        'use strict';\n\n        //after amazon widgets file as loaded\n\n    });\n}\n","Amazon_Payment/js/action/place-order.js":"/**\n * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * 
2Licensed under the Apache License, Version 2.0 (the \"License\").\n * You may not use this file except in compliance with the License.\n * A copy of the License is located at\n *\n *  http://aws.amazon.com/apache2.0\n *\n * or in the \"license\" file accompanying this file. This file is distributed\n * on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either\n * express or implied. See the License for the specific language governing\n * permissions and limitations under the License.\n */\n\ndefine(\n    [\n        'Magento_Checkout/js/model/quote',\n        'Magento_Checkout/js/model/url-builder',\n        'mage/storage',\n        'mage/url',\n        'Magento_Checkout/js/model/error-processor',\n        'Magento_Customer/js/model/customer',\n        'Magento_Checkout/js/model/full-screen-loader',\n        'Amazon_Payment/js/model/storage'\n    ],\n    function (quote, urlBuilder, storage, url, errorProcessor, customer, fullScreenLoader, amazonStorage) {\n        'use strict';\n\n        return function (paymentData, redirectOnSuccess) {\
2n            var serviceUrl, payload;\n\n            redirectOnSuccess = redirectOnSuccess !== false;\n\n            /** Checkout for guest and registered customer. */\n            if (!customer.isLoggedIn()) {\n                serviceUrl = urlBuilder.createUrl('/guest-carts/:quoteId/payment-information', {\n                    quoteId: quote.getQuoteId()\n                });\n                payload = {\n                    cartId: quote.getQuoteId(),\n                    email: quote.guestEmail,\n                    paymentMethod: paymentData,\n                    billingAddress: quote.billingAddress()\n                };\n            } else {\n                serviceUrl = urlBuilder.createUrl('/carts/mine/payment-information', {});\n                payload = {\n                    cartId: quote.getQuoteId(),\n                    paymentMethod: paymentData,\n                    billingAddress: quote.billingAddress()\n                };\n            }\n\n            fullScreenLoader.startLoader();\n\n            return storage.post(\n                serviceUrl,\n                JSON.stringify(payload)\n            ).done(\n                function () {\n                    if (redirectOnSuccess) {\
2n                        window.location.replace(url.build('checkout/onepage/success/'));\n                    }\n                }\n            ).fail(\n                function (response) {\n                    errorProcessor.process(response);\n                    amazonStorage.amazonDeclineCode(response.responseJSON.code);\n                    fullScreenLoader.stopLoader(true);\n                    if (response.responseJSON.code === 4273) {\n                        var intervalId = setInterval(function () {\n                            clearInterval(intervalId);\n                            window.location.replace(url.build('checkout/cart/'));\n                        }, 5000);\n\n                    }\n                }\n            );\n        };\n    }\n);\n","Amazon_Payment/js/action/populate-shipping-address.js":"/**\n * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\").\n * You may not use this file except in compliance with the License.\n * A copy of the License is located at\n *\n *  http://aws.amazon.com/apache2.0\n *\n * or in the \"license\" file accompanying this file. This file is distributed\n * on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either\n * express or implied. See the License for the specific language governing\n * permissions and limitations under the License.\n */\n\ndefine(\n    [\n        'jquery',\n        'Magento_Checkout/js/model/address-converter',\n        'Magento_Checkout/js/model/quote',\n        'uiRegistry',\n        'Magento_Checkout/js/checkout-data',\n        'Magento_Checkout/js/model/checkout-data-resolver',\n        'Amazon_Payment/js/model/storage'\n    ],\n    function ($, addressConverter, quote, registry, checkoutData, checkoutDataResolver, amazonStorage) {\n        'use strict';\n\n        /**\n         * Populate shipping address form in shipping step from quote model         *\n         */\n        function populateShippingForm() {\n            var shippingAddressData = checkoutData.getShippingAddressFromData();\n\n            registry.async('checkoutProvider')(function (checkoutProvider) {\n                checkoutProvider.set(\n                    'shippingAddress',\n                    $.extend({}, checkoutProvider.get('shippingAddress'), shippingAddressData)\n                );\n            });\n            checkoutDataResolver.resolveShippingAddress();\n        }\n\n        /**\n         * Populate shipping address form in shipping step from quote model\n         * @private\n         */\n        return function () {\n            //check to see if user is logged out of amazon (otherwise shipping form won't be in DOM)\n            if (!amazonStorage.
2isAmazonAccountLoggedIn) {\n                populateShippingForm();\n            }\n            //subscribe to logout and trigger shippingform population when logged out.\n            amazonStorage.isAmazonAccountLoggedIn.subscribe(function (loggedIn) {\n                if (!loggedIn) {\n                    populateShippingForm();\n                }\n            });\n        };\n    }\n);\n","Amazon_Payment/js/lib/bluebird.min.js":"// jscs:disable\n/* @preserve\n * The MIT License (MIT)\n *\n * Copyright (c) 2013-2015 Petka Antonov\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n *\n */\n/**\n * bluebird build version 3.3.4\n * Features enabled: core, race, call_get, generators, map, nodeify, promisify, props, reduce, settle, some, using, timers, filter, any, each\n */\n!function(t){if(\"object\"==typeof exports&&\"undefined\"!=typeof module)module.exports=t();else if(\"function\"==typeof define&&define.amd)define([],t);else{var e;\"undefined\"!=typeof window?e=window:\"undefined\"!=typeof global?e=global:\"undefined\"!=typeof self&&(e=self),e.Promise=t()}}(function(){var t,e,n;return function r(t,e,n){function i(s,a){if(!e[s]){if(!t[s]){var c=\"function\"==typeof _dereq_&&_dereq_;if(!a&&c)return c(s,!0);if(o)return o(s,!0);var l=new Error(\"Cannot find module '\"+s+\"'\");throw l.code=\"MODULE_NOT_FOUND\",l}var u=e[s]={exports:{}};t[s][0].call(u.exports,function(e){var n=t[s][1][e];return i(n?n:e)},u,u.exports,r,t,e,n)}return e[s].exports}for(var o=\"function\"==typeof _dereq_&&_dereq_,s=0;s<n.length;s++)i(n[s]);return i}({1:[function(t,e,n){\"use strict\";e.exports=function(t){function e(t){var e=new n(t),r=e.promise();return e.setHowMany(1),e.setUnwrap(),e.init(),r}var n=t._SomePromiseArray;t.any=function(t){return e(t)},t.prototype.any=function(){return e(this)}}},{}],2:[function(t,e,n){\"use strict\";function r(){this._isTickUsed=!1,this._lateQueue=new u(16),this._normalQueue=new u(16),this._haveDrainedQueues=!1,this._trampolineEnabled=!0;var t=this;this.drainQueues=function(){t._drainQueues()},this._schedule=l}function i(t,e,n){this._lateQueue.push(t,e,n),this._queueTick()}function o(t,e,n){this._normalQueue.push(t,e,n),this._queueTick()}function s(t){this._normalQueue._pushOne(t),this._queueTick()}var a;try{throw new Error}catch(c){a=c}var l=t(\"./schedule\"),u=t(\"./queue\"),p=t(\"./util\");r.prototype.enableTrampoline=function(){this._trampolineEnabled=!0},r.prototype.disableTrampolineIfNecessary=function(){p.hasDevTools&&(this._trampolineEnabled=!1)},r.prototype.haveItemsQueued=function(){return this._isTickUsed||this._haveDrainedQueues},r.prototype.fatalError=function(t,e){e?(process.stderr.write(\"Fatal \"+(t instanceof Error?t.stack:t)+\"\\n\"),process.exit(2)):this.throwLater(t)},r.prototype.throwLater=function(t,e){if(1===arguments.length&&(e=t,t=function(){throw e}),\"undefined\"!=typeof setTimeout)setTimeout(function(){t(e)},0);else try{this._schedule(function(){t(e)})}catch(n){throw new Error(\"No async scheduler available\\n\\n    See http://goo.gl/MqrFmX\\n\")}},p.hasDevTools?(r.prototype.invokeLater=function(t,e,n){this._trampolineEnabled?i.call(this,t,e,n):this._schedule(function(){setTimeout(function(){t.call(e,n)},100)})},r.prototype.invoke=function(t,e,n){this._trampolineEnabled?o.call(this,t,e,n):this._schedule(function(){t.call(e,n)})},r.prototype.settlePromises=function(t){this._trampolineEnabled?s.call(this,t):this._schedule(function(){t._settlePromises()})}):(r.prototype.invokeLater=i,r.prototype.invoke=o,r.prototype.settlePromises=s),r.prototype.invokeFirst=function(t,e,n){this._normalQueue.unshift(t,e,n),this._queueTick()},r.prototype._drainQueue=function(t){for(;t.length()>0;){var e=t.shift();if(\"function\"==typeof e){var n=t.shift(),r=t.shift();e.call(n,r)}else e._settlePromises()}},r.prototype._drainQueues=function(){this._drainQueue(this._normalQueue),this._reset(),this._haveDrainedQueues=!0,this._drainQueue(this._lateQueue)},r.prototype._queueTick=function(){this._isTickUsed||(this._isTickUsed=!0,this._schedule(this.drainQueues))},r.prototype._reset=function(){this._isTickUsed=!1}
2,e.exports=r,e.exports.firstLineError=a},{\"./queue\":26,\"./schedule\":29,\"./util\":36}],3:[function(t,e,n){\"use strict\";e.exports=function(t,e,n,r){var i=!1,o=function(t,e){this._reject(e)},s=function(t,e){e.promiseRejectionQueued=!0,e.bindingPromise._then(o,o,null,this,t)},a=function(t,e){0===(50397184&this._bitField)&&this._resolveCallback(e.target)},c=function(t,e){e.promiseRejectionQueued||this._reject(t)};t.prototype.bind=function(o){i||(i=!0,t.prototype._propagateFrom=r.propagateFromFunction(),t.prototype._boundValue=r.boundValueFunction());var l=n(o),u=new t(e);u._propagateFrom(this,1);var p=this._target();if(u._setBoundTo(l),l instanceof t){var h={promiseRejectionQueued:!1,promise:u,target:p,bindingPromise:l};p._then(e,s,void 0,u,h),l._then(a,c,void 0,u,h),u._setOnCancel(l)}else u._resolveCallback(p);return u},t.prototype._setBoundTo=function(t){void 0!==t?(this._bitField=2097152|this._bitField,this._boundTo=t):this._bitField=-2097153&this._bitField},t.prototype._isBound=function(){return 2097152===(2097152&this._bitField)},t.bind=function(e,n){return t.resolve(n).bind(e)}}},{}],4:[function(t,e,n){\"use strict\";function r(){try{Promise===o&&(Promise=i)}catch(t){}return o}var i;\"undefined\"!=typeof Promise&&(i=Promise);var o=t(\"./promise\")();o.noConflict=r,e.exports=o},{\"./promise\":22}],5:[function(t,e,n){\"use strict\";var r=Object.create;if(r){var i=r(null),o=r(null);i[\" size\"]=o[\" size\"]=0}e.exports=function(e){function n(t,n){var r;if(null!=t&&(r=t[n]),\"function\"!=typeof r){var i=\"Object \"+a.classString(t)+\" has no method '\"+a.toString(n)+\"'\";throw new e.TypeError(i)}return r}function r(t){var e=this.pop(),r=n(t,e);return r.apply(t,this)}function i(t){return t[this]}function o(t){var e=+this;return 0>e&&(e=Math.max(0,e+t.length)),t[e]}var s,a=t(\"./util\"),c=a.canEvaluate;a.isIdentifier;e.prototype.call=function(t){var e=[].slice.call(arguments,1);return e.push(t),this._then(r,void 0,void 0,e,void 0)},e.prototype.get=function(t){var e,n=\"number\"==typeof t;if(n)e=o;else if(c){var r=s(t);e=null!==r?r:i}else e=i;return this._then(e,void 0,void 0,t,void 0)}}},{\"./util\":36}],6:[function(t,e,n){\"use strict\";e.exports=function(e,n,r,i){var o=t(\"./util\"),s=o.tryCatch,a=o.errorObj,c=e._async;e.prototype[\"break\"]=e.prototype.cancel=function(){if(!i.cancellation())return this._warn(\"cancellation is disabled\");for(var t=this,e=t;t.isCancellable();){if(!t._cancelBy(e)){e._isFollowing()?e._followee().cancel():e._cancelBranched();break}var n=t._cancellationParent;if(null==n||!n.isCancellable()){t._isFollowing()?t._followee().cancel():t._cancelBranched();break}t._isFollowing()&&t._followee().cancel(),e=t,t=n}},e.prototype._branchHasCancelled=function(){this._branchesRemainingToCancel--},e.prototype._enoughBranchesHaveCancelled=function(){return void 0===this._branchesRemainingToCancel||this._branchesRemainingToCancel<=0},e.prototype._cancelBy=function(t){return t===this?(this._branchesRemainingToCancel=0,this._invokeOnCancel(),!0):(this._branchHasCancelled(),this._enoughBranchesHaveCancelled()?(this._invokeOnCancel(),!0):!1)},e.prototype._cancelBranched=function(){this._enoughBranchesHaveCancelled()&&this._cancel()},e.prototype._cancel=function(){this.isCancellable()&&(this._setCancelled(),c.invoke(this._cancelPromises,this,void 0))},e.prototype._cancelPromises=function(){this._length()>0&&this._settlePromises()},e.prototype._unsetOnCancel=function(){this._onCancelField=void 0},e.prototype.isCancellable=function(){return this.isPending()&&!this.isCancelled()},e.prototype._doInvokeOnCancel=function(t,e){if(o.isArray(t))for(var n=0;n<t.length;++n)this._doInvokeOnCancel(t[n],e);else if(void 0!==t)if(\"function\"==typeof t){if(!e){var r=s(t).call(this._boundValue());r===a&&(this._attachExtraTrace(r.e),c.throwLater(r.e))}}else t._resultCancelled(this)},e.prototype._invokeOnCancel=function(){var t=this._onCancel();this._unsetOnCancel(),c.invoke(this._doInvokeOnCancel,this,t)},e.prototype._invokeInternalOnCancel=function(){this.isCancellable()&&(this._doInvokeOnCancel(this._onCancel(),!0),this._unsetOnCancel())},e.prototype._resultCancelled=function(){this.cancel()}}},{\"./util\":36}],7:[function(t,e,n){\"use strict\";e.exports=function(e){function n(t,n,a){return function(c){var l=a._boundValue();t:for(var u=0;u<t.length;++u){var p=t[u];
2if(p===Error||null!=p&&p.prototype instanceof Error){if(c instanceof p)return o(n).call(l,c)}else if(\"function\"==typeof p){var h=o(p).call(l,c);if(h===s)return h;if(h)return o(n).call(l,c)}else if(r.isObject(c)){for(var f=i(p),_=0;_<f.length;++_){var d=f[_];if(p[d]!=c[d])continue t}return o(n).call(l,c)}}return e}}var r=t(\"./util\"),i=t(\"./es5\").keys,o=r.tryCatch,s=r.errorObj;return n}},{\"./es5\":13,\"./util\":36}],8:[function(t,e,n){\"use strict\";e.exports=function(t){function e(){this._trace=new e.CapturedTrace(r())}function n(){return i?new e:void 0}function r(){var t=o.length-1;return t>=0?o[t]:void 0}var i=!1,o=[];return t.prototype._promiseCreated=function(){},t.prototype._pushContext=function(){},t.prototype._popContext=function(){return null},t._peekContext=t.prototype._peekContext=function(){},e.prototype._pushContext=function(){void 0!==this._trace&&(this._trace._promiseCreated=null,o.push(this._trace))},e.prototype._popContext=function(){if(void 0!==this._trace){var t=o.pop(),e=t._promiseCreated;return t._promiseCreated=null,e}return null},e.CapturedTrace=null,e.create=n,e.deactivateLongStackTraces=function(){},e.activateLongStackTraces=function(){var n=t.prototype._pushContext,o=t.prototype._popContext,s=t._peekContext,a=t.prototype._peekContext,c=t.prototype._promiseCreated;e.deactivateLongStackTraces=function(){t.prototype._pushContext=n,t.prototype._popContext=o,t._peekContext=s,t.prototype._peekContext=a,t.prototype._promiseCreated=c,i=!1},i=!0,t.prototype._pushContext=e.prototype._pushContext,t.prototype._popContext=e.prototype._popContext,t._peekContext=t.prototype._peekContext=r,t.prototype._promiseCreated=function(){var t=this._peekContext();t&&null==t._promiseCreated&&(t._promiseCreated=this)}},e}},{}],9:[function(t,e,n){\"use strict\";e.exports=function(e,n){function r(t,e){return{promise:e}}function i(){return!1}function o(t,e,n){var r=this;try{t(e,n,function(t){if(\"function\"!=typeof t)throw new TypeError(\"onCancel must be a function, got: \"+H.toString(t));r._attachCancellationCallback(t)})}catch(i){return i}}function s(t){if(!this.isCancellable())return this;var e=this._onCancel();void 0!==e?H.isArray(e)?e.push(t):this._setOnCancel([e,t]):this._setOnCancel(t)}function a(){return this._onCancelField}function c(t){this._onCancelField=t}function l(){this._cancellationParent=void 0,this._onCancelField=void 0}function u(t,e){if(0!==(1&e)){this._cancellationParent=t;var n=t._branchesRemainingToCancel;void 0===n&&(n=0),t._branchesRemainingToCancel=n+1}0!==(2&e)&&t._isBound()&&this._setBoundTo(t._boundTo)}function p(t,e){0!==(2&e)&&t._isBound()&&this._setBoundTo(t._boundTo)}function h(){var t=this._boundTo;return void 0!==t&&t instanceof e?t.isFulfilled()?t.value():void 0:t}function f(){this._trace=new O(this._peekContext())}function _(t,e){if(N(t)){var n=this._trace;if(void 0!==n&&e&&(n=n._parent),void 0!==n)n.attachExtraTrace(t);else if(!t.__stackCleaned__){var r=j(t);H.notEnumerableProp(t,\"stack\",r.message+\"\\n\"+r.stack.join(\"\\n\")),H.notEnumerableProp(t,\"__stackCleaned__\",!0)}}}function d(t,e,n,r,i){if(void 0===t&&null!==e&&z){if(void 0!==i&&i._returnedNonUndefined())return;var o=r._bitField;if(0===(65535&o))return;n&&(n+=\" \");var s=\"a promise was created in a \"+n+\"handler but was not returned from it\";r._warn(s,!0,e)}}function v(t,e){var n=t+\" is deprecated and will be removed in a future version.\";return e&&(n+=\" Use \"+e+\" instead.\"),y(n)}function y(t,n,r){if(rt.warnings){var i,o=new L(t);if(n)r._attachExtraTrace(o);else if(rt.longStackTraces&&(i=e._peekContext()))i.attachExtraTrace(o);else{var s=j(o);o.stack=s.message+\"\\n\"+s.stack.join(\"\\n\")}Y(\"warning\",o)||k(o,\"\",!0)}}function g(t,e){for(var n=0;n<e.length-1;++n)e[n].push(\"From previous event:\"),e[n]=e[n].join(\"\\n\");return n<e.length&&(e[n]=e[n].join(\"\\n\")),t+\"\\n\"+e.join(\"\\n\")}function m(t){for(var e=0;e<t.length;++e)(0===t[e].length||e+1<t.length&&t[e][0]===t[e+1][0])&&(t.splice(e,1),e--)}function b(t){for(var e=t[0],n=1;n<t.length;++n){for(var r=t[n],i=e.length-1,o=e[i],s=-1,a=r.length-1;a>=0;--a)if(r[a]===o){s=a;break}for(var a=s;a>=0;--a){var c=r[a];if(e[i]!==c)break;e.pop(),i--}e=r}}function w(t){for(var e=[],n=0;n<t.length;++n){var r=t[n],i=\"    (No stack trace)\"===r||B.test(r),o=i&&tt(r);i&&!o&&(q&&\" \"!==r.charAt(0)&&(r=\"    \"+r),e.push(r))}return e}function C(t){for(var e=t.stack.replace(/\\s+$/g,\"\").split(\"\\n\"),n=0;n<e.length;++n){var r=e[n];if(\"    (No stack trace)\"===r||B.test(r))break}return n>0&&(e=e.slice(n)),e}function j(t){var e=t.stack,n=t.toString();
2return e=\"string\"==typeof e&&e.length>0?C(t):[\"    (No stack trace)\"],{message:n,stack:w(e)}}function k(t,e,n){if(\"undefined\"!=typeof console){var r;if(H.isObject(t)){var i=t.stack;r=e+M(i,t)}else r=e+String(t);\"function\"==typeof D?D(r,n):(\"function\"==typeof console.log||\"object\"==typeof console.log)&&console.log(r)}}function E(t,e,n,r){var i=!1;try{\"function\"==typeof e&&(i=!0,\"rejectionHandled\"===t?e(r):e(n,r))}catch(o){I.throwLater(o)}\"unhandledRejection\"===t?Y(t,n,r)||i||k(n,\"Unhandled rejection \"):Y(t,r)}function F(t){var e;if(\"function\"==typeof t)e=\"[function \"+(t.name||\"anonymous\")+\"]\";else{e=t&&\"function\"==typeof t.toString?t.toString():H.toString(t);var n=/\\[object [a-zA-Z0-9$_]+\\]/;if(n.test(e))try{var r=JSON.stringify(t);e=r}catch(i){}0===e.length&&(e=\"(empty array)\")}return\"(<\"+x(e)+\">, no stack trace)\"}function x(t){var e=41;return t.length<e?t:t.substr(0,e-3)+\"...\"}function T(){return\"function\"==typeof nt}function R(t){var e=t.match(et);return e?{fileName:e[1],line:parseInt(e[2],10)}:void 0}function P(t,e){if(T()){for(var n,r,i=t.stack.split(\"\\n\"),o=e.stack.split(\"\\n\"),s=-1,a=-1,c=0;c<i.length;++c){var l=R(i[c]);if(l){n=l.fileName,s=l.line;break}}for(var c=0;c<o.length;++c){var l=R(o[c]);if(l){r=l.fileName,a=l.line;break}}0>s||0>a||!n||!r||n!==r||s>=a||(tt=function(t){if(U.test(t))return!0;var e=R(t);return e&&e.fileName===n&&s<=e.line&&e.line<=a?!0:!1})}}function O(t){this._parent=t,this._promisesCreated=0;var e=this._length=1+(void 0===t?0:t._length);nt(this,O),e>32&&this.uncycle()}var S,A,D,V=e._getDomain,I=e._async,L=t(\"./errors\").Warning,H=t(\"./util\"),N=H.canAttachTrace,U=/[\\\\\\/]bluebird[\\\\\\/]js[\\\\\\/](release|debug|instrumented)/,B=null,M=null,q=!1,Q=!(0==H.env(\"BLUEBIRD_DEBUG\")||!H.env(\"BLUEBIRD_DEBUG\")&&\"development\"!==H.env(\"NODE_ENV\")),$=!(0==H.env(\"BLUEBIRD_WARNINGS\")||!Q&&!H.env(\"BLUEBIRD_WARNINGS\")),G=!(0==H.env(\"BLUEBIRD_LONG_STACK_TRACES\")||!Q&&!H.env(\"BLUEBIRD_LONG_STACK_TRACES\")),z=0!=H.env(\"BLUEBIRD_W_FORGOTTEN_RETURN\")&&($||!!H.env(\"BLUEBIRD_W_FORGOTTEN_RETURN\"));e.prototype.suppressUnhandledRejections=function(){var t=this._target();t._bitField=-1048577&t._bitField|524288},e.prototype._ensurePossibleRejectionHandled=function(){0===(524288&this._bitField)&&(this._setRejectionIsUnhandled(),I.invokeLater(this._notifyUnhandledRejection,this,void 0))},e.prototype._notifyUnhandledRejectionIsHandled=function(){E(\"rejectionHandled\",S,void 0,this)},e.prototype._setReturnedNonUndefined=function(){this._bitField=268435456|this._bitField},e.prototype._returnedNonUndefined=function(){return 0!==(268435456&this._bitField)},e.prototype._notifyUnhandledRejection=function(){if(this._isRejectionUnhandled()){var t=this._settledValue();this._setUnhandledRejectionIsNotified(),E(\"unhandledRejection\",A,t,this)}},e.prototype._setUnhandledRejectionIsNotified=function(){this._bitField=262144|this._bitField},e.prototype._unsetUnhandledRejectionIsNotified=function(){this._bitField=-262145&this._bitField},e.prototype._isUnhandledRejectionNotified=function(){return(262144&this._bitField)>0},e.prototype._setRejectionIsUnhandled=function(){this._bitField=1048576|this._bitField},e.prototype._unsetRejectionIsUnhandled=function(){this._bitField=-1048577&this._bitField,this._isUnhandledRejectionNotified()&&(this._unsetUnhandledRejectionIsNotified(),this._notifyUnhandledRejectionIsHandled())},e.prototype._isRejectionUnhandled=function(){return(1048576&this._bitField)>0},e.prototype._warn=function(t,e,n){return y(t,e,n||this)},e.onPossiblyUnhandledRejection=function(t){var e=V();A=\"function\"==typeof t?null===e?t:e.bind(t):void 0},e.onUnhandledRejectionHandled=function(t){var e=V();S=\"function\"==typeof t?null===e?t:e.bind(t):void 0};var X=function(){};e.longStackTraces=function(){if(I.haveItemsQueued()&&!rt.longStackTraces)throw new Error(\"cannot enable long stack traces after promises have been created\\n\\n    See http://goo.gl/MqrFmX\\n\");if(!rt.longStackTraces&&T()){var t=e.prototype._captureStackTrace,r=e.prototype._attachExtraTrace;rt.longStackTraces=!0,X=function(){if(I.haveItemsQueued()&&!rt.longStackTraces)throw new Error(\"cannot enable long stack traces after promises have been created\\n\\n    See http://goo.gl/MqrFmX\\n\");e.prototype._captureStackTrace=t,e.prototype._attachExtraTrace=r,n.deactivateLongStackTraces(),I.enableTrampoline(),rt.longStackTraces=!1},e.prototype._captureStackTrace=f,e.prototype._attachExtraTrace=_,n.activateLongStackTraces(),I.disableTrampolineIfNecessary()}},e.hasLongStackTraces=function(){return rt.longStackTraces&&T()};var W=function(){try{var t=document.createEvent(\"CustomEvent\");return t.initCustomEvent(\"testingtheevent\",!1,!0,{}),H.global.dispatchEvent(t),function(t,e){var n=document.createEvent(\"CustomEvent\");
2return n.initCustomEvent(t.toLowerCase(),!1,!0,e),!H.global.dispatchEvent(n)}}catch(e){}return function(){return!1}}(),K=function(){return H.isNode?function(){return process.emit.apply(process,arguments)}:H.global?function(t){var e=\"on\"+t.toLowerCase(),n=H.global[e];return n?(n.apply(H.global,[].slice.call(arguments,1)),!0):!1}:function(){return!1}}(),J={promiseCreated:r,promiseFulfilled:r,promiseRejected:r,promiseResolved:r,promiseCancelled:r,promiseChained:function(t,e,n){return{promise:e,child:n}},warning:function(t,e){return{warning:e}},unhandledRejection:function(t,e,n){return{reason:e,promise:n}},rejectionHandled:r},Y=function(t){var e=!1;try{e=K.apply(null,arguments)}catch(n){I.throwLater(n),e=!0}var r=!1;try{r=W(t,J[t].apply(null,arguments))}catch(n){I.throwLater(n),r=!0}return r||e};e.config=function(t){if(t=Object(t),\"longStackTraces\"in t&&(t.longStackTraces?e.longStackTraces():!t.longStackTraces&&e.hasLongStackTraces()&&X()),\"warnings\"in t){var n=t.warnings;rt.warnings=!!n,z=rt.warnings,H.isObject(n)&&\"wForgottenReturn\"in n&&(z=!!n.wForgottenReturn)}if(\"cancellation\"in t&&t.cancellation&&!rt.cancellation){if(I.haveItemsQueued())throw new Error(\"cannot enable cancellation after promises are in use\");e.prototype._clearCancellationData=l,e.prototype._propagateFrom=u,e.prototype._onCancel=a,e.prototype._setOnCancel=c,e.prototype._attachCancellationCallback=s,e.prototype._execute=o,Z=u,rt.cancellation=!0}\"monitoring\"in t&&(t.monitoring&&!rt.monitoring?(rt.monitoring=!0,e.prototype._fireEvent=Y):!t.monitoring&&rt.monitoring&&(rt.monitoring=!1,e.prototype._fireEvent=i))},e.prototype._fireEvent=i,e.prototype._execute=function(t,e,n){try{t(e,n)}catch(r){return r}},e.prototype._onCancel=function(){},e.prototype._setOnCancel=function(t){},e.prototype._attachCancellationCallback=function(t){},e.prototype._captureStackTrace=function(){},e.prototype._attachExtraTrace=function(){},e.prototype._clearCancellationData=function(){},e.prototype._propagateFrom=function(t,e){};var Z=p,tt=function(){return!1},et=/[\\/<\\(]([^:\\/]+):(\\d+):(?:\\d+)\\)?\\s*$/;H.inherits(O,Error),n.CapturedTrace=O,O.prototype.uncycle=function(){var t=this._length;if(!(2>t)){for(var e=[],n={},r=0,i=this;void 0!==i;++r)e.push(i),i=i._parent;t=this._length=r;for(var r=t-1;r>=0;--r){var o=e[r].stack;void 0===n[o]&&(n[o]=r)}for(var r=0;t>r;++r){var s=e[r].stack,a=n[s];if(void 0!==a&&a!==r){a>0&&(e[a-1]._parent=void 0,e[a-1]._length=1),e[r]._parent=void 0,e[r]._length=1;var c=r>0?e[r-1]:this;t-1>a?(c._parent=e[a+1],c._parent.uncycle(),c._length=c._parent._length+1):(c._parent=void 0,c._length=1);for(var l=c._length+1,u=r-2;u>=0;--u)e[u]._length=l,l++;return}}}},O.prototype.attachExtraTrace=function(t){if(!t.__stackCleaned__){this.uncycle();for(var e=j(t),n=e.message,r=[e.stack],i=this;void 0!==i;)r.push(w(i.stack.split(\"\\n\"))),i=i._parent;b(r),m(r),H.notEnumerableProp(t,\"stack\",g(n,r)),H.notEnumerableProp(t,\"__stackCleaned__\",!0)}};var nt=function(){var t=/^\\s*at\\s*/,e=function(t,e){return\"string\"==typeof t?t:void 0!==e.name&&void 0!==e.message?e.toString():F(e)};if(\"number\"==typeof Error.stackTraceLimit&&\"function\"==typeof Error.captureStackTrace){Error.stackTraceLimit+=6,B=t,M=e;var n=Error.captureStackTrace;return tt=function(t){return U.test(t)},function(t,e){Error.stackTraceLimit+=6,n(t,e),Error.stackTraceLimit-=6}}var r=new Error;if(\"string\"==typeof r.stack&&r.stack.split(\"\\n\")[0].indexOf(\"stackDetection@\")>=0)return B=/@/,M=e,q=!0,function(t){t.stack=(new Error).stack};var i;try{throw new Error}catch(o){i=\"stack\"in o}return\"stack\"in r||!i||\"number\"!=typeof Error.stackTraceLimit?(M=function(t,e){return\"string\"==typeof t?t:\"object\"!=typeof e&&\"function\"!=typeof e||void 0===e.name||void 0===e.message?F(e):e.toString()},null):(B=t,M=e,function(t){Error.stackTraceLimit+=6;try{throw new Error}catch(e){t.stack=e.stack}Error.stackTraceLimit-=6})}([]);\"undefined\"!=typeof console&&\"undefined\"!=typeof console.warn&&(D=function(t){console.warn(t)},H.isNode&&process.stderr.isTTY?D=function(t,e){var n=e?\"\u001b[33m\":\"\u001b[31m\";console.warn(n+t+\"\u001b[0m\\n\")}:H.isNode||\"string\"!=typeof(new Error).stack||(D=function(t,e){console.warn(\"%c\"+t,e?\"color: darkorange\":\"color: red\")}
2));var rt={warnings:$,longStackTraces:!1,cancellation:!1,monitoring:!1};return G&&e.longStackTraces(),{longStackTraces:function(){return rt.longStackTraces},warnings:function(){return rt.warnings},cancellation:function(){return rt.cancellation},monitoring:function(){return rt.monitoring},propagateFromFunction:function(){return Z},boundValueFunction:function(){return h},checkForgottenReturns:d,setBounds:P,warn:y,deprecated:v,CapturedTrace:O,fireDomEvent:W,fireGlobalEvent:K}}},{\"./errors\":12,\"./util\":36}],10:[function(t,e,n){\"use strict\";e.exports=function(t){function e(){return this.value}function n(){throw this.reason}t.prototype[\"return\"]=t.prototype.thenReturn=function(n){return n instanceof t&&n.suppressUnhandledRejections(),this._then(e,void 0,void 0,{value:n},void 0)},t.prototype[\"throw\"]=t.prototype.thenThrow=function(t){return this._then(n,void 0,void 0,{reason:t},void 0)},t.prototype.catchThrow=function(t){if(arguments.length<=1)return this._then(void 0,n,void 0,{reason:t},void 0);var e=arguments[1],r=function(){throw e};return this.caught(t,r)},t.prototype.catchReturn=function(n){if(arguments.length<=1)return n instanceof t&&n.suppressUnhandledRejections(),this._then(void 0,e,void 0,{value:n},void 0);var r=arguments[1];r instanceof t&&r.suppressUnhandledRejections();var i=function(){return r};return this.caught(n,i)}}},{}],11:[function(t,e,n){\"use strict\";e.exports=function(t,e){function n(){return o(this)}function r(t,n){return i(t,n,e,e)}var i=t.reduce,o=t.all;t.prototype.each=function(t){return this.mapSeries(t)._then(n,void 0,void 0,this,void 0)},t.prototype.mapSeries=function(t){return i(this,t,e,e)},t.each=function(t,e){return r(t,e)._then(n,void 0,void 0,t,void 0)},t.mapSeries=r}},{}],12:[function(t,e,n){\"use strict\";function r(t,e){function n(r){return this instanceof n?(p(this,\"message\",\"string\"==typeof r?r:e),p(this,\"name\",t),void(Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):Error.call(this))):new n(r)}return u(n,Error),n}function i(t){return this instanceof i?(p(this,\"name\",\"OperationalError\"),p(this,\"message\",t),this.cause=t,this.isOperational=!0,void(t instanceof Error?(p(this,\"message\",t.message),p(this,\"stack\",t.stack)):Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor))):new i(t)}var o,s,a=t(\"./es5\"),c=a.freeze,l=t(\"./util\"),u=l.inherits,p=l.notEnumerableProp,h=r(\"Warning\",\"warning\"),f=r(\"CancellationError\",\"cancellation error\"),_=r(\"TimeoutError\",\"timeout error\"),d=r(\"AggregateError\",\"aggregate error\");try{o=TypeError,s=RangeError}catch(v){o=r(\"TypeError\",\"type error\"),s=r(\"RangeError\",\"range error\")}for(var y=\"join pop push shift unshift slice filter forEach some every map indexOf lastIndexOf reduce reduceRight sort reverse\".split(\" \"),g=0;g<y.length;++g)\"function\"==typeof Array.prototype[y[g]]&&(d.prototype[y[g]]=Array.prototype[y[g]]);a.defineProperty(d.prototype,\"length\",{value:0,configurable:!1,writable:!0,enumerable:!0}),d.prototype.isOperational=!0;var m=0;d.prototype.toString=function(){var t=Array(4*m+1).join(\" \"),e=\"\\n\"+t+\"AggregateError of:\\n\";m++,t=Array(4*m+1).join(\" \");for(var n=0;n<this.length;++n){for(var r=this[n]===this?\"[Circular AggregateError]\":this[n]+\"\",i=r.split(\"\\n\"),o=0;o<i.length;++o)i[o]=t+i[o];r=i.join(\"\\n\"),e+=r+\"\\n\"}return m--,e},u(i,Error);var b=Error.__BluebirdErrorTypes__;b||(b=c({CancellationError:f,TimeoutError:_,OperationalError:i,RejectionError:i,AggregateError:d}),a.defineProperty(Error,\"__BluebirdErrorTypes__\",{value:b,writable:!1,enumerable:!1,configurable:!1})),e.exports={Error:Error,TypeError:o,RangeError:s,CancellationError:b.CancellationError,OperationalError:b.OperationalError,TimeoutError:b.TimeoutError,AggregateError:b.AggregateError,Warning:h}},{\"./es5\":13,\"./util\":36}],13:[function(t,e,n){var r=function(){\"use strict\";return void 0===this}();if(r)e.exports={freeze:Object.freeze,defineProperty:Object.defineProperty,getDescriptor:Object.getOwnPropertyDescriptor,keys:Object.keys,names:Object.getOwnPropertyNames,getPrototypeOf:Object.getPrototypeOf,isArray:Array.isArray,isES5:r,propertyIsWritable:function(t,e){var n=Object.getOwnPropertyDescriptor(t,e);return!(n&&!n.writable&&!n.set)}};else{var i={}.hasOwnProperty,o={}.toString,s={}.constructor.prototype,a=function(t){var e=[];for(var n in t)i.call(t,n)&&e.push(n);return e},c=function(t,e){return{value:t[e]}},l=function(t,e,n){return t[e]=n.value,t},u=function(t){return t},p=function(t){try{return Object(t).constructor.prototype}catch(e){return s}},h=function(t){try{return\"[object Array]\"===o.call(t)}catch(e){return!1}};e.exports={isArray:h,keys:a,names:a,defineProperty:l,getDescriptor:c,freeze:u,getPrototypeOf:p,isES5:r,propertyIsWritable:function(){return!0}}}},{}],14:[function(t,e,n){\"use strict\";e.exports=function(t,e){var n=t.map;t.prototype.filter=function(t,r){return n(this,t,r,e)},t.filter=function(t,r,i){return n(t,r,i,e)}}},{}],15:[function(t,e,n){\"use strict\";e.exports=function(e,n){function r(t,e,n){this.promise=t,this.type=e,this.handler=n,this.called=!1,this.cancelPromise=null}function i(t){this.finallyHandler=t}function o(t,e){return null!=t.cancelPromise?(arguments.length>1?t.cancelPromise._reject(e):t.cancelPromise._cancel(),t.cancelPromise=null,!0):!1}function s(){return c.call(this,this.promise._target()._settledValue())}function a(t){return o(this,t)?void 0:(p.e=t,p)}function c(t){var r=this.promise,c=this.handler;if(!this.called){this.called=!0;var l=this.isFinallyHandler()?c.call(r._boundValue()):c.call(r._boundValue(),t);if(void 0!==l){r._setReturnedNonUndefined();var h=n(l,r);if(h instanceof e){if(null!=this.cancelPromise){if(h.isCancelled()){var f=new u(\"late cancellation observer\");return r._attachExtraTrace(f),p.e=f,p}h.isPending()&&h._attachCancellationCallback(new i(this))}return h._then(s,a,void 0,this,void 0)}}}return r.isRejected()?(o(this),p.e=t,p):(o(this),t)}var l=t(\"./util\"),u=e.CancellationError,p=l.errorObj;return r.prototype.isFinallyHandler=function(){return 0===this.type},i.prototype._resultCancelled=function(){o(this.finallyHandler)},e.prototype._passThrough=function(t,e,n,i){return\"function\"!=typeof t?this.then():this._then(n,i,void 0,new r(this,e,t),void 0)},e.prototype.lastly=e.prototype[\"finally\"]=function(t){return this._passThrough(t,0,c,c)},e.prototype.tap=function(t){return this._passThrough(t,1,c)},r}},{\"./util\":36}],16:[function(t,e,n){\"use strict\";e.exports=function(e,n,r,i,o,s){function a(t,n,r){for(var o=0;o<n.length;++o){r._pushContext();var s=f(n[o])(t);if(r._popContext(),s===h){r._pushContext();var a=e.reject(h.e);return r._popContext(),a}var c=i(s,r);if(c instanceof e)return c}return null}function c(t,n,i,o){var s=this._promise=new e(r);
2s._captureStackTrace(),s._setOnCancel(this),this._stack=o,this._generatorFunction=t,this._receiver=n,this._generator=void 0,this._yieldHandlers=\"function\"==typeof i?[i].concat(_):_,this._yieldedPromise=null}var l=t(\"./errors\"),u=l.TypeError,p=t(\"./util\"),h=p.errorObj,f=p.tryCatch,_=[];p.inherits(c,o),c.prototype._isResolved=function(){return null===this._promise},c.prototype._cleanup=function(){this._promise=this._generator=null},c.prototype._promiseCancelled=function(){if(!this._isResolved()){var t,n=\"undefined\"!=typeof this._generator[\"return\"];if(n)this._promise._pushContext(),t=f(this._generator[\"return\"]).call(this._generator,void 0),this._promise._popContext();else{var r=new e.CancellationError(\"generator .return() sentinel\");e.coroutine.returnSentinel=r,this._promise._attachExtraTrace(r),this._promise._pushContext(),t=f(this._generator[\"throw\"]).call(this._generator,r),this._promise._popContext(),t===h&&t.e===r&&(t=null)}var i=this._promise;this._cleanup(),t===h?i._rejectCallback(t.e,!1):i.cancel()}},c.prototype._promiseFulfilled=function(t){this._yieldedPromise=null,this._promise._pushContext();var e=f(this._generator.next).call(this._generator,t);this._promise._popContext(),this._continue(e)}
2,c.prototype._promiseRejected=function(t){this._yieldedPromise=null,this._promise._attachExtraTrace(t),this._promise._pushContext();var e=f(this._generator[\"throw\"]).call(this._generator,t);this._promise._popContext(),this._continue(e)},c.prototype._resultCancelled=function(){if(this._yieldedPromise instanceof e){var t=this._yieldedPromise;this._yieldedPromise=null,this._promiseCancelled(),t.cancel()}},c.prototype.promise=function(){return this._promise},c.prototype._run=function(){this._generator=this._generatorFunction.call(this._receiver),this._receiver=this._generatorFunction=void 0,this._promiseFulfilled(void 0)},c.prototype._continue=function(t){var n=this._promise;if(t===h)return this._cleanup(),n._rejectCallback(t.e,!1);var r=t.value;if(t.done===!0)return this._cleanup(),n._resolveCallback(r);var o=i(r,this._promise);if(!(o instanceof e)&&(o=a(o,this._yieldHandlers,this._promise),null===o))return void this._promiseRejected(new u(\"A value %s was yielded that could not be treated as a promise\\n\\n    See http://goo.gl/MqrFmX\\n\\n\".replace(\"%s\",r)+\"From coroutine:\\n\"+this._stack.split(\"\\n\").slice(1,-7).join(\"\\n\")));o=o._target();var s=o._bitField;0===(50397184&s)?(this._yieldedPromise=o,o._proxy(this,null)):0!==(33554432&s)?this._promiseFulfilled(o._value(
2)):0!==(16777216&s)?this._promiseRejected(o._reason()):this._promiseCancelled()},e.coroutine=function(t,e){if(\"function\"!=typeof t)throw new u(\"generatorFunction must be a function\\n\\n    See http://goo.gl/MqrFmX\\n\");var n=Object(e).yieldHandler,r=c,i=(new Error).stack;return function(){var e=t.apply(this,arguments),o=new r(void 0,void 0,n,i),s=o.promise();return o._generator=e,o._promiseFulfilled(void 0),s}},e.coroutine.addYieldHandler=function(t){if(\"function\"!=typeof t)throw new u(\"expecting a function but got \"+p.classString(t));_.push(t)},e.spawn=function(t){if(s.deprecated(\"Promise.spawn()\",\"Promise.coroutine()\"),\"function\"!=typeof t)return n(\"generatorFunction must be a function\\n\\n    See http://goo.gl/MqrFmX\\n\");var r=new c(t,this),i=r.promise();return r._run(e.spawn),i}}},{\"./errors\":12,\"./util\":36}],17:[function(t,e,n){\"use strict\";e.exports=function(e,n,r,i){var o=t(\"./util\");o.canEvaluate,o.tryCatch,o.errorObj;e.join=function(){var t,e=arguments.length-1;if(e>0&&\"function\"==typeof arguments[e]){t=arguments[e];var r}var i=[].slice.call(arguments);t&&i.pop();var r=new n(i).promise();return void 0!==t?r.spread(t):r}}},{\"./util\":36}],18:[function(t,e,n){\"use strict\";e.exports=function(e,n,r,i,o,s){function a(t,e,n,r){this.constructor$(t),this._promise._captureStackTrace();var i=l();this._callback=null===i?e:i.bind(e),this._preservedValues=r===o?new Array(this.length()):null,this._limit=n,this._inFlight=0,this._queue=n>=1?[]:f,this._init$(void 0,-2)}function c(t,e,n,i){if(\"function\"!=typeof e)return r(\"expecting a function but got \"+u.classString(e));var o=\"object\"==typeof n&&null!==n?n.concurrency:0;return o=\"number\"==typeof o&&isFinite(o)&&o>=1?o:0,new a(t,e,o,i).promise()}var l=e._getDomain,u=t(\"./util\"),p=u.tryCatch,h=u.errorObj,f=[];u.inherits(a,n),a.prototype._init=function(){},a.prototype._promiseFulfilled=function(t,n){\n    var r=this._values,o=this.length(),a=this._preservedValues,c=this._limit;if(0>n){if(n=-1*n-1,r[n]=t,c>=1&&(this._inFlight--,this._drainQueue(),this._isResolved()))return!0}else{if(c>=1&&this._inFlight>=c)return r[n]=t,this._queue.push(n),!1;null!==a&&(a[n]=t);var l=this._promise,u=this._callback,f=l._boundValue();l._pushContext();var _=p(u).call(f,t,n,o),d=l._popContext();if(s.checkForgottenReturns(_,d,null!==a?\"Promise.filter\":\"Promise.map\",l),_===h)return this._reject(_.e),!0;var v=i(_,this._promise);if(v instanceof e){v=v._target();var y=v._bitField;if(0===(50397184&y))return c>=1&&this._inFlight++,r[n]=v,v._proxy(this,-1*(n+1)),!1;if(0===(33554432&y))return 0!==(16777216&y)?(this._reject(v._reason()),!0):(this._cancel(),!0);_=v._value()}r[n]=_}var g=++this._totalResolved;return g>=o?(null!==a?this._filter(r,a):this._resolve(r),!0):!1},a.prototype._drainQueue=function(){for(var t=this._queue,e=this._limit,n=this._values;t.length>0&&this._inFlight<e;){if(this._isResolved())return;var r=t.pop();this._promiseFulfilled(n[r],r)}},a.prototype._filter=function(t,e){for(var n=e.length,r=new Array(n),i=0,o=0;n>o;++o)t[o]&&(r[i++]=e[o]);r.length=i,this._resolve(r)},a.prototype.preservedValues=function(){return this._preservedValues},e.prototype.map=function(t,e){return c(this,t,e,null)},e.map=function(t,e,n,r){return c(t,e,n,r)}}},{\"./util\":36}],19:[function(t,e,n){\"use strict\";e.exports=function(e,n,r,i,o){var s=t(\"./util\"),a=s.tryCatch;e.method=function(t){if(\"function\"!=typeof t)throw new e.TypeError(\"expecting a function but got \"+s.classString(t));return function(){var r=new e(n);r._captureStackTrace(),r._pushContext();var i=a(t).apply(this,arguments),s=r._popContext();return o.checkForgottenReturns(i,s,\"Promise.method\",r),r._resolveFromSyncValue(i),r}},e.attempt=e[\"try\"]=function(t){if(\"function\"!=typeof t)return i(\"expecting a function but got \"+s.classString(t));var r=new e(n);r._captureStackTrace(),r._pushContext();var c;if(arguments.length>1){o.deprecated(\"calling Promise.try with more than 1 argument\");var l=arguments[1],u=arguments[2];c=s.isArray(l)?a(t).apply(u,l):a(t).call(u,l)}else c=a(t)();var p=r._popContext();return o.checkForgottenReturns(c,p,\"Promise.try\",r),r._resolveFromSyncValue(c),r},e.prototype._resolveFromSyncValue=function(t){t===s.errorObj?this._rejectCallback(t.e,!1):this._resolveCallback(t,!0)}}},{\"./util\":36}],20:[function(t,e,n){\"use strict\";function r(t){return t instanceof Error&&u.getPrototypeOf(t)===Error.prototype}function i(t){var e;if(r(t)){e=new l(t),e.name=t.name,e.message=t.message,e.stack=t.stack;for(var n=u.keys(t),i=0;i<n.length;++i){var o=n[i];p.test(o)||(e[o]=t[o])}return e}return s.markAsOriginatingFromRejection(t),t}function o(t,e){return function(n,r){if(null!==t){if(n){var o=i(a(n));t._attachExtraTrace(o),t._reject(o)}
2else if(e){var s=[].slice.call(arguments,1);t._fulfill(s)}else t._fulfill(r);t=null}}}var s=t(\"./util\"),a=s.maybeWrapAsError,c=t(\"./errors\"),l=c.OperationalError,u=t(\"./es5\"),p=/^(?:name|message|stack|cause)$/;e.exports=o},{\"./errors\":12,\"./es5\":13,\"./util\":36}],21:[function(t,e,n){\"use strict\";e.exports=function(e){function n(t,e){var n=this;if(!o.isArray(t))return r.call(n,t,e);var i=a(e).apply(n._boundValue(),[null].concat(t));i===c&&s.throwLater(i.e)}function r(t,e){var n=this,r=n._boundValue(),i=void 0===t?a(e).call(r,null):a(e).call(r,null,t);i===c&&s.throwLater(i.e)}function i(t,e){var n=this;if(!t){var r=new Error(t+\"\");r.cause=t,t=r}var i=a(e).call(n._boundValue(),t);i===c&&s.throwLater(i.e)}var o=t(\"./util\"),s=e._async,a=o.tryCatch,c=o.errorObj;e.prototype.asCallback=e.prototype.nodeify=function(t,e){if(\"function\"==typeof t){var o=r;void 0!==e&&Object(e).spread&&(o=n),this._then(o,i,void 0,this,t)}return this}}},{\"./util\":36}],22:[function(t,e,n){\"use strict\";e.exports=function(){function e(){}function n(t,e){if(\"function\"!=typeof e)throw new y(\"expecting a function but got \"+h.classString(e));if(t.constructor!==r)throw new y(\"the promise constructor cannot be invoked directly\\n\\n    See http://goo.gl/MqrFmX\\n\")}function r(t){this._bitField=0,this._fulfillmentHandler0=void 0,this._rejectionHandler0=void 0,this._promise0=void 0,this._receiver0=void 0,t!==m&&(n(this,t),this._resolveFromExecutor(t)),this._promiseCreated(),this._fireEvent(\"promiseCreated\",this)}function i(t){this.promise._resolveCallback(t)}function o(t){this.promise._rejectCallback(t,!1)}function s(t){var e=new r(m);e._fulfillmentHandler0=t,e._rejectionHandler0=t,e._promise0=t,e._receiver0=t}var a,c=function(){return new y(\"circular promise resolution chain\\n\\n    See http://goo.gl/MqrFmX\\n\")},l=function(){return new r.PromiseInspection(this._target())},u=function(t){return r.reject(new y(t))},p={},h=t(\"./util\");a=h.isNode?function(){var t=process.domain;return void 0===t&&(t=null),t}:function(){return null},h.notEnumerableProp(r,\"_getDomain\",a);var f=t(\"./es5\"),_=t(\"./async\"),d=new _;f.defineProperty(r,\"_async\",{value:d});var v=t(\"./errors\"),y=r.TypeError=v.TypeError;r.RangeError=v.RangeError;var g=r.CancellationError=v.CancellationError;r.TimeoutError=v.TimeoutError,r.OperationalError=v.OperationalError,r.RejectionError=v.OperationalError,r.AggregateError=v.AggregateError;var m=function(){},b={},w={},C=t(\"./thenables\")(r,m),j=t(\"./promise_array\")(r,m,C,u,e),k=t(\"./context\")(r),E=k.create,F=t(\"./debuggability\")(r,k),x=(F.CapturedTrace,t(\"./finally\")(r,C)),T=t(\"./catch_filter\")(w),R=t(\"./nodeback\"),P=h.errorObj,O=h.tryCatch;return r.prototype.toString=function(){return\"[object Promise]\"},r.prototype.caught=r.prototype[\"catch\"]=function(t){var e=arguments.length;if(e>1){var n,r=new Array(e-1),i=0;for(n=0;e-1>n;++n){var o=arguments[n];if(!h.isObject(o))return u(\"expecting an object but got \"+h.classString(o));r[i++]=o}return r.length=i,t=arguments[n],this.then(void 0,T(r,t,this))}return this.then(void 0,t)},r.prototype.reflect=function(){return this._then(l,l,void 0,this,void 0)},r.prototype.then=function(t,e){if(F.warnings()&&arguments.length>0&&\"function\"!=typeof t&&\"function\"!=typeof e){var n=\".then() only accepts functions but was passed: \"+h.classString(t);arguments.length>1&&(n+=\", \"+h.classString(e)),this._warn(n)}return this._then(t,e,void 0,void 0,void 0)},r.prototype.done=function(t,e){var n=this._then(t,e,void 0,void 0,void 0);n._setIsFinal()},r.prototype.spread=function(t){return\"function\"!=typeof t?u(\"expecting a function but got \"+h.classString(t)):this.all()._then(t,void 0,void 0,b,void 0)},r.prototype.toJSON=function(){var t={isFulfilled:!1,isRejected:!1,fulfillmentValue:void 0,rejectionReason:void 0};return this.isFulfilled()?(t.fulfillmentValue=this.value(),t.isFulfilled=!0):this.isRejected()&&(t.rejectionReason=this.reason(),t.isRejected=!0),t},r.prototype.all=function(){return arguments.length>0&&this._warn(\".all() was passed arguments but it does not take any\"),new j(this).promise()},r.prototype.error=function(t){return this.caught(h.originatesFromRejection,t)},r.is=function(t){return t instanceof r},r.fromNode=r.fromCallback=function(t){var e=new r(m);e._captureStackTrace();var n=arguments.length>1?!!Object(arguments[1]).multiArgs:!1,i=O(t)(R(e,n));return i===P&&e._rejectCallback(i.e,!0),e._isFateSealed()||e._setAsyncGuaranteed(),e},r.all=function(t){return new j(t).promise()},r.cast=function(t){var e=C(t);return e instanceof r||(e=new r(m),e._captureStackTrace(),e._setFulfilled(),e._rejectionHandler0=t),e},r.resolve=r.fulfilled=r.cast,r.reject=r.rejected=function(t){var e=new r(m);return e._captureStackTrace(),e._rejectCallback(t,!0),e}
2,r.setScheduler=function(t){if(\"function\"!=typeof t)throw new y(\"expecting a function but got \"+h.classString(t));var e=d._schedule;return d._schedule=t,e},r.prototype._then=function(t,e,n,i,o){var s=void 0!==o,c=s?o:new r(m),l=this._target(),u=l._bitField;s||(c._propagateFrom(this,3),c._captureStackTrace(),void 0===i&&0!==(2097152&this._bitField)&&(i=0!==(50397184&u)?this._boundValue():l===this?void 0:this._boundTo),this._fireEvent(\"promiseChained\",this,c));var p=a();if(0!==(50397184&u)){var h,f,_=l._settlePromiseCtx;0!==(33554432&u)?(f=l._rejectionHandler0,h=t):0!==(16777216&u)?(f=l._fulfillmentHandler0,h=e,l._unsetRejectionIsUnhandled()):(_=l._settlePromiseLateCancellationObserver,f=new g(\"late cancellation observer\"),l._attachExtraTrace(f),h=e),d.invoke(_,l,{handler:null===p?h:\"function\"==typeof h&&p.bind(h),promise:c,receiver:i,value:f})}else l._addCallbacks(t,e,c,i,p);return c},r.prototype._length=function(){return 65535&this._bitField},r.prototype._isFateSealed=function(){return 0!==(117506048&this._bitField)},r.prototype._isFollowing=function(){return 67108864===(67108864&this._bitField)},r.prototype._setLength=function(t){this._bitField=-65536&this._bitField|65535&t},r.prototype._setFulfilled=function(){this._bitField=33554432|this._bitField,this._fireEvent(\"promiseFulfilled\",this)},r.prototype._setRejected=function(){this._bitField=16777216|this._bitField,this._fireEvent(\"promiseRejected\",this)},r.prototype._setFollowing=function(){this._bitField=67108864|this._bitField,this._fireEvent(\"promiseResolved\",this)},r.prototype._setIsFinal=function(){this._bitField=4194304|this._bitField},r.prototype._isFinal=function(){return(4194304&this._bitField)>0},r.prototype._unsetCancelled=function(){this._bitField=-65537&this._bitField},r.prototype._setCancelled=function(){this._bitField=65536|this._bitField,this._fireEvent(\"promiseCancelled\",this)},r.prototype._setAsyncGuaranteed=function(){this._bitField=134217728|this._bitField},r.prototype._receiverAt=function(t){var e=0===t?this._receiver0:this[4*t-4+3];return e===p?void 0:void 0===e&&this._isBound()?this._boundValue():e},r.prototype._promiseAt=function(t){return this[4*t-4+2]},r.prototype._fulfillmentHandlerAt=function(t){return this[4*t-4+0]},r.prototype._rejectionHandlerAt=function(t){return this[4*t-4+1]},r.prototype._boundValue=function(){},r.prototype._migrateCallback0=function(t){var e=(t._bitField,t._fulfillmentHandler0),n=t._rejectionHandler0,r=t._promise0,i=t._receiverAt(0);void 0===i&&(i=p),this._addCallbacks(e,n,r,i,null)},r.prototype._migrateCallbackAt=function(t,e){var n=t._fulfillmentHandlerAt(e),r=t._rejectionHandlerAt(e),i=t._promiseAt(e),o=t._receiverAt(e);void 0===o&&(o=p),this._addCallbacks(n,r,i,o,null)},r.prototype._addCallbacks=function(t,e,n,r,i){var o=this._length();if(o>=65531&&(o=0,this._setLength(0)),0===o)this._promise0=n,this._receiver0=r,\"function\"==typeof t&&(this._fulfillmentHandler0=null===i?t:i.bind(t)),\"function\"==typeof e&&(this._rejectionHandler0=null===i?e:i.bind(e));else{var s=4*o-4;this[s+2]=n,this[s+3]=r,\"function\"==typeof t&&(this[s+0]=null===i?t:i.bind(t)),\"function\"==typeof e&&(this[s+1]=null===i?e:i.bind(e))}return this._setLength(o+1),o},r.prototype._proxy=function(t,e){this._addCallbacks(void 0,void 0,e,t,null)},r.prototype._resolveCallback=function(t,e){if(0===(117506048&this._bitField)){if(t===this)return this._rejectCallback(c(),!1);var n=C(t,this);if(!(n instanceof r))return this._fulfill(t);e&&this._propagateFrom(n,2);var i=n._target();if(i===this)return void this._reject(c());var o=i._bitField;if(0===(50397184&o)){var s=this._length();s>0&&i._migrateCallback0(this);for(var a=1;s>a;++a)i._migrateCallbackAt(this,a);this._setFollowing(),this._setLength(0),this._setFollowee(i)}else if(0!==(33554432&o))this._fulfill(i._value());else if(0!==(16777216&o))this._reject(i._reason());else{var l=new g(\"late cancellation observer\");i._attachExtraTrace(l),this._reject(l)}}},r.prototype._rejectCallback=function(t,e,n){var r=h.ensureErrorObject(t),i=r===t;if(!i&&!n&&F.warnings()){var o=\"a promise was rejected with a non-error: \"+h.classString(t);this._warn(o,!0)}this._attachExtraTrace(r,e?i:!1),this._reject(t)},r.prototype._resolveFromExecutor=function(t){var e=this;this._captureStackTrace(),this._pushContext();var n=!0,r=this._execute(t,function(t){e._resolveCallback(t)},function(t){e._rejectCallback(t,n)});n=!1,this._popContext(),void 0!==r&&e._rejectCallback(r,!0)},r.prototype._settlePromiseFromHandler=function(t,e,n,r){var i=r._bitField;if(0===(65536&i)){r._pushContext();var o;e===b?n&&\"number\"==typeof n.length?o=O(t).apply(this._boundValue(),n):(o=P,o.e=new y(\"cannot .spread() a non-array: \"+h.classString(n))):o=O(t).call(e,n);var s=r._popContext();i=r._bitField,0===(65536&i)&&(o===w?r._reject(n):o===P?r._rejectCallback(o.e,!1):(F.checkForgottenReturns(o,s,\"\",r,this),r._resolveCallback(o)))}},r.prototype._target=function(){for(var t=this;t._isFollowing();)t=t._followee();return t},r.prototype._followee=function(){return this._rejectionHandler0},r.prototype._setFollowee=function(t){this._rejectionHandler0=t},r.prototype._settlePromise=function(t,n,i,o){var s=t instanceof r,a=this._bitField,c=0!==(134217728&a);0!==(65536&a)?(s&&t._invokeInternalOnCancel(),i instanceof x&&i.isFinallyHandler()?(i.cancelPromise=t,O(n).call(i,o)===P&&t._reject(P.e)):n===l?t._fulfill(l.call(i)):i instanceof e?i._promiseCancelled(t):s||t instanceof j?t._cancel():i.cancel()):\"function\"==typeof n?s?(c&&t._setAsyncGuaranteed(),this._settlePromiseFromHandler(n,i,o,t)):n.call(i,o,t):i instanceof e?i._isResolved()||(0!==(33554432&a)?i._promiseFulfilled(o,t):i._promiseRe
2jected(o,t)):s&&(c&&t._setAsyncGuaranteed(),0!==(33554432&a)?t._fulfill(o):t._reject(o))},r.prototype._settlePromiseLateCancellationObserver=function(t){var e=t.handler,n=t.promise,i=t.receiver,o=t.value;\"function\"==typeof e?n instanceof r?this._settlePromiseFromHandler(e,i,o,n):e.call(i,o,n):n instanceof r&&n._reject(o)},r.prototype._settlePromiseCtx=function(t){this._settlePromise(t.promise,t.handler,t.receiver,t.value)},r.prototype._settlePromise0=function(t,e,n){var r=this._promise0,i=this._receiverAt(0);this._promise0=void 0,this._receiver0=void 0,this._settlePromise(r,t,i,e)},r.prototype._clearCallbackDataAtIndex=function(t){var e=4*t-4;this[e+2]=this[e+3]=this[e+0]=this[e+1]=void 0},r.prototype._fulfill=function(t){var e=this._bitField;if(!((117506048&e)>>>16)){if(t===this){var n=c();return this._attachExtraTrace(n),this._reject(n)}this._setFulfilled(),this._rejectionHandler0=t,(65535&e)>0&&(0!==(134217728&e)?this._settlePromises():d.settlePromises(this))}},r.prototype._reject=function(t){var e=this._bitField;if(!((117506048&e)>>>16))return this._setRejected(),this._fulfillmentHandler0=t,this._isFinal()?d.fatalError(t,h.isNode):void((65535&e)>0?d.settlePromises(this):this._ensurePossibleRejectionHandled())},r.prototype._fulfillPromises=function(t,e){for(var n=1;t>n;n++){var r=this._fulfillmentHandlerAt(n),i=this._promiseAt(n),o=this._receiverAt(n);this._clearCallbackDataAtIndex(n),this._settlePromise(i,r,o,e)}},r.prototype._rejectPromises=function(t,e){for(var n=1;t>n;n++){var r=this._rejectionHandlerAt(n),i=this._promiseAt(n),o=this._receiverAt(n);this._clearCallbackDataAtIndex(n),this._settlePromise(i,r,o,e)}},r.prototype._settlePromises=function(){var t=this._bitField,e=65535&t;if(e>0){if(0!==(16842752&t)){var n=this._fulfillmentHandler0;this._settlePromise0(this._rejectionHandler0,n,t),this._rejectPromises(e,n)}else{var r=this._rejectionHandler0;this._settlePromise0(this._fulfillmentHandler0,r,t),this._fulfillPromises(e,r)}this._setLength(0)}this._clearCancellationData()},r.prototype._settledValue=function(){var t=this._bitField;return 0!==(33554432&t)?this._rejectionHandler0:0!==(16777216&t)?this._fulfillmentHandler0:void 0},r.defer=r.pending=function(){F.deprecated(\"Promise.defer\",\"new Promise\");var t=new r(m);return{promise:t,resolve:i,reject:o}},h.notEnumerableProp(r,\"_makeSelfResolutionError\",c),t(\"./method\")(r,m,C,u,F),t(\"./bind\")(r,m,C,F),t(\"./cancel\")(r,j,u,F),t(\"./direct_resolve\")(r),t(\"./synchronous_inspection\")(r),t(\"./join\")(r,j,C,m,F),r.Promise=r,t(\"./map.js\")(r,j,u,C,m,F),t(\"./using.js\")(r,u,C,E,m,F),t(\"./timers.js\")(r,m,F),t(\"./generators.js\")(r,u,m,C,e,F),t(\"./nodeify.js\")(r),t(\"./call_get.js\")(r),t(\"./props.js\")(r,j,C,u),t(\"./race.js\")(r,m,C,u),t(\"./reduce.js\")(r,j,u,C,m,F),t(\"./settle.js\")(r,j,F),t(\"./some.js\")(r,j,u),t(\"./promisify.js\")(r,m),t(\"./any.js\")(r),t(\"./each.js\")(r,m),t(\"./filter.js\")(r,m),h.toFastProperties(r),h.toFastProperties(r.prototype),s({a:1}),s({b:2}),s({c:3}),s(1),s(function(){}),s(void 0),s(!1),s(new r(m)),F.setBounds(_.firstLineError,h.lastLineError),r}},{\"./any.js\":1,\"./async\":2,\"./bind\":3,\"./call_get.js\":5,\"./cancel\":6,\"./catch_filter\":7,\"./context\":8,\"./debuggability\":9,\"./direct_resolve\":10,\"./each.js\":11,\"./errors\":12,\"./es5\":13,\"./filter.js\":14,\"./finally\":15,\"./generators.js\":16,\"./join\":17,\"./map.js\":18,\"./method\":19,\"./nodeback\":20,\"./nodeify.js\":21,\"./promise_array\":23,\"./promisify.js\":24,\"./props.js\":25,\"./race.js\":27,\"./reduce.js\":28,\"./settle.js\":30,\"./some.js\":31,\"./synchronous_inspection\":32,\"./thenables\":33,\"./timers.js\":34,\"./using.js\":35,\"./util\":36}],23:[function(t,e,n){\"use strict\";e.exports=function(e,n,r,i,o){function s(t){switch(t){case-2:return[];case-3:return{}}}function a(t){var r=this._promise=new e(n);t instanceof e&&r._propagateFrom(t,3),r._setOnCancel(this),this._values=t,this._length=0,this._totalResolved=0,this._init(void 0,-2)}var c=t(\"./util\");c.isArray;return c.inherits(a,o),a.prototype.length=function(){return this._length},a.prototype.promise=function(){return this._promise},a.prototype._init=function l(t,n){var o=r(this._values,this._promise);if(o instanceof e){o=o._target();var a=o._bitField;if(this._values=o,0===(50397184&a))return this._promise._setAsyncGuaranteed(),o._then(l,this._reject,void 0,this,n);if(0===(33554432&a))return 0!==(16777216&a)?this._reject(o._reason()):this._cancel();
2o=o._value()}if(o=c.asArray(o),null===o){var u=i(\"expecting an array or an iterable object but got \"+c.classString(o)).reason();return void this._promise._rejectCallback(u,!1)}return 0===o.length?void(-5===n?this._resolveEmptyArray():this._resolve(s(n))):void this._iterate(o)},a.prototype._iterate=function(t){var n=this.getActualLength(t.length);this._length=n,this._values=this.shouldCopyValues()?new Array(n):this._values;for(var i=this._promise,o=!1,s=null,a=0;n>a;++a){var c=r(t[a],i);c instanceof e?(c=c._target(),s=c._bitField):s=null,o?null!==s&&c.suppressUnhandledRejections():null!==s?0===(50397184&s)?(c._proxy(this,a),this._values[a]=c):o=0!==(33554432&s)?this._promiseFulfilled(c._value(),a):0!==(16777216&s)?this._promiseRejected(c._reason(),a):this._promiseCancelled(a):o=this._promiseFulfilled(c,a)}o||i._setAsyncGuaranteed()},a.prototype._isResolved=function(){return null===this._values},a.prototype._resolve=function(t){this._values=null,this._promise._fulfill(t)},a.prototype._cancel=function(){!this._isResolved()&&this._promise.isCancellable()&&(this._values=null,this._promise._cancel())},a.prototype._reject=function(t){this._values=null,this._promise._rejectCallback(t,!1)},a.prototype._promiseFulfilled=function(t,e){this._values[e]=t;var n=++this._totalResolved;return n>=this._length?(this._resolve(this._values),!0):!1},a.prototype._promiseCancelled=function(){return this._cancel(),!0}
2,a.prototype._promiseRejected=function(t){return this._totalResolved++,this._reject(t),!0},a.prototype._resultCancelled=function(){if(!this._isResolved()){var t=this._values;if(this._cancel(),t instanceof e)t.cancel();else for(var n=0;n<t.length;++n)t[n]instanceof e&&t[n].cancel()}},a.prototype.shouldCopyValues=function(){return!0},a.prototype.getActualLength=function(t){return t},a}},{\"./util\":36}],24:[function(t,e,n){\"use strict\";e.exports=function(e,n){function r(t){return!C.test(t)}function i(t){try{return t.__isPromisified__===!0}catch(e){return!1}}function o(t,e,n){var r=f.getDataPropertyOrDefault(t,e+n,b);return r?i(r):!1}function s(t,e,n){for(var r=0;r<t.length;r+=2){var i=t[r];if(n.test(i))for(var o=i.replace(n,\"\"),s=0;s<t.length;s+=2)if(t[s]===o)throw new g(\"Cannot promisify an API that has normal methods with '%s'-suffix\\n\\n    See http://goo.gl/MqrFmX\\n\".replace(\"%s\",e))}}function a(t,e,n,r){for(var a=f.inheritedDataKeys(t),c=[],l=0;l<a.length;++l){var u=a[l],p=t[u],h=r===j?!0:j(u,p,t);\"function\"!=typeof p||i(p)||o(t,u,e)||!r(u,p,t,h)||c.push(u,p)}return s(c,e,n),c}function c(t,r,i,o,s,a){function c(){var i=r;r===h&&(i=this);var o=new e(n);o._captureStackTrace();var s=\"string\"==typeof u&&this!==l?this[u]:t,c=_(o,a);try{s.apply(i,d(arguments,c))}catch(p){o._rejectCallback(v(p),!0,!0)}return o._isFateSealed()||o._setAsyncGuaranteed(),o}var l=function(){return this}(),u=t;return\"string\"==typeof u&&(t=o),f.notEnumerableProp(c,\"__isPromisified__\",!0),c}function l(t,e,n,r,i){for(var o=new RegExp(k(e)+\"$\"),s=a(t,e,o,n),c=0,l=s.length;l>c;c+=2){var u=s[c],p=s[c+1],_=u+e;if(r===E)t[_]=E(u,h,u,p,e,i);else{var d=r(p,function(){return E(u,h,u,p,e,i)});f.notEnumerableProp(d,\"__isPromisified__\",!0),t[_]=d}}return f.toFastProperties(t),t}function u(t,e,n){return E(t,e,void 0,t,null,n)}var p,h={},f=t(\"./util\"),_=t(\"./nodeback\"),d=f.withAppended,v=f.maybeWrapAsError,y=f.canEvaluate,g=t(\"./errors\").TypeError,m=\"Async\",b={__isPromisified__:!0},w=[\"arity\",\"length\",\"name\",\"arguments\",\"caller\",\"callee\",\"prototype\",\"__isPromisified__\"],C=new RegExp(\"^(?:\"+w.join(\"|\")+\")$\"),j=function(t){return f.isIdentifier(t)&&\"_\"!==t.charAt(0)&&\"constructor\"!==t},k=function(t){return t.replace(/([$])/,\"\\\\$\")},E=y?p:c;e.promisify=function(t,e){if(\"function\"!=typeof t)throw new g(\"expecting a function but got \"+f.classString(t));if(i(t))return t;e=Object(e);var n=void 0===e.context?h:e.context,o=!!e.multiArgs,s=u(t,n,o);return f.copyDescriptors(t,s,r),s},e.promisifyAll=function(t,e){if(\"function\"!=typeof t&&\"object\"!=typeof t)throw new g(\"the target of promisifyAll must be an object or a function\\n\\n    See http://goo.gl/MqrFmX\\n\");e=Object(e);var n=!!e.multiArgs,r=e.suffix;\"string\"!=typeof r&&(r=m);var i=e.filter;\"function\"!=typeof i&&(i=j);var o=e.promisifier;if(\"function\"!=typeof o&&(o=E),!f.isIdentifier(r))throw new RangeError(\"suffix must be a valid identifier\\n\\n    See http://goo.gl/MqrFmX\\n\");for(var s=f.inheritedDataKeys(t),a=0;a<s.length;++a){var c=t[s[a]];\"constructor\"!==s[a]&&f.isClass(c)&&(l(c.prototype,r,i,o,n),l(c,r,i,o,n))}return l(t,r,i,o,n)}}},{\"./errors\":12,\"./nodeback\":20,\"./util\":36}],25:[function(t,e,n){\"use strict\";e.exports=function(e,n,r,i){function o(t){var e,n=!1;if(void 0!==a&&t instanceof a)e=p(t),n=!0;else{var r=u.keys(t),i=r.length;e=new Array(2*i);for(var o=0;i>o;++o){var s=r[o];e[o]=t[s],e[o+i]=s}}this.constructor$(e),this._isMap=n,this._init$(void 0,-3)}function s(t){var n,s=r(t);return l(s)?(n=s instanceof e?s._then(e.props,void 0,void 0,void 0,void 0):new o(s).promise(),s instanceof e&&n._propagateFrom(s,2),n):i(\"cannot await properties of a non-object\\n\\n    See http://goo.gl/MqrFmX\\n\")}var a,c=t(\"./util\"),l=c.isObject,u=t(\"./es5\");\"function\"==typeof Map&&(a=Map);var p=function(){function t(t,r){this[e]=t,this[e+n]=r,e++}var e=0,n=0;return function(r){n=r.size,e=0;var i=new Array(2*r.size);return r.forEach(t,i),i}}(),h=function(t){for(var e=new a,n=t.length/2|0,r=0;n>r;++r){var i=t[n+r],o=t[r];e.set(i,o)}return e};c.inherits(o,n),o.prototype._init=function(){},o.prototype._promiseFulfilled=function(t,e){this._values[e]=t;var n=++this._totalResolved;if(n>=this._length){var r;if(this._isMap)r=h(this._values);else{r={};for(var i=this.length(),o=0,s=this.length();s>o;++o)r[this._values[o+i]]=this._values[o]}return this._resolve(r),!0}return!1},o.prototype.shouldCopyValues=function(){return!1},o.prototype.getActualLength=function(t){return t>>1},e.prototype.props=function(){return s(this)},e.props=function(t){return s(t)}}},{\"./es5\":13,\"./util\":36}],26:[function(t,e,n){\"use strict\";function r(t,e,n,r,i){for(var o=0;i>o;++o)n[o+r]=t[o+e],t[o+e]=void 0}function i(t){this._capacity=t,this._length=0,this._front=0}i.prototype._willBeOverCapacity=function(t){return this._capacity<t},i.prototype._pushOne=function(t){var e=this.length();this._checkCapacity(e+1);var n=this._front+e&this._capacity-1;this[n]=t,this._length=e+1},i.prototype._unshiftOne=function(t){var e=this._capacity;this._checkCapacity(this.length()+1);var n=this._front,r=(n-1&e-1^e)-e;this[r]=t,this._front=r,this._length=this.length()+1},i.prototype.unshift=function(t,e,n){this._unshiftOne(n),this._unshiftOne(e),this._unshiftOne(t)},i.prototype.push=function(t,e,n){var r=this.length()+3;if(this._willBeOverCapacity(r))return this._pushOne(t),this._pushOne(e),void this._pushOne(n);var i=this._front+r-3;this._checkCapacity(r);var o=this._capacity-1;this[i+0&o]=t,this[i+1&o]=e,this[i+2&o]=n,this._length=r},i.prototype.shift=function(){var t=this._front,e=this[t];return this[t]=void 0,this._front=t+1&this._capacity-1,this._length--,e},i.prototype.length=function(){return this._length},i.prototype._checkCapacity=function(t){this._capacity<t&&this._resizeTo(this._capacity<<1)},i.prototype._resizeTo=function(t){var e=this._capacity;this._capacity=t;var n=this._front,i=this._length,o=n+i&e-1;r(this,0,this,e,o)},e.exports=i},{}],27:[function(t,e,n){\"use strict\";e.exports=function(e,n,r,i){function o(t,o){var c=r(t);if(c instanceof e)return a(c);if(t=s.asArray(t),null===t)return i(\"expecting an array or an iterable object but got \"+s.classString(t));var l=new e(n);void 0!==o&&l._propagateFrom(o,3);for(var u=l._fulfill,p=l._reject,h=0,f=t.length;f>h;++h){var _=t[h];(void 0!==_||h in t)&&e.cast(_)._then(u,p,void 0,l,null)}return l}var s=t(\"./util\"),a=function(t){return t.then(function(e){return o(e,t)})};e.race=function(t){return o(t,void 0)},e.prototype.race=function(){return o(this,void 0)}}},{\"./util\":36}],28:[function(t,e,n){\"use strict\";e.exports=function(e,n,r,i,o,s){function a(t,n,r,i){this.constructor$(t);var s=h();this._fn=null===s?n:s.bind(n),void 0!==r&&(r=e.resolve(r),r._attachCancellationCallback(this)),this._initialValue=r,this._currentCancellable=null,this._eachValues=i===o?[]:void 0,this._promise._captureStackTrace(),this._init$(void 0,-5)}function c(t,e){this.isFulfilled()?e._resolve(t):e._reject(t)}function l(t,e,n,i){if(\"function\"!=typeof e)return r(\"expecting a function but got \"+f.classString(e));var o=new a(t,e,n,i);return o.promise()}function u(t){this.accum=t,this.array._gotAccum(t);var n=i(this.value,this.array._promise);return n instanceof e?(this.array._currentCancellable=n,n._then(p,void 0,void 0,this,void 0)):p.call(this,n)}function p(t){var n=this.array,r=n._promise,i=_(n._fn);r._pushContext();var o;o=void 0!==n._eachValues?i.call(r._boundValue(),t,this.index,this.length):i.call(r._boundValue(),this.accum,t,this.index,this.length),o instanceof e&&(n._currentCancellable=o);var a=r._popContext();return s.checkForgottenReturns(o,a,void 0!==n._eachValues?\"Promise.each\":\"Promise.reduce\",r),o}var h=e._getDomain,f=t(\"./util\"),_=f.tryCatch;f.inherits(a,n),a.prototype._gotAccum=function(t){void 0!==this._eachValues&&t!==o&&this._eachValues.push(t)},a.prototype._eachComplete=function(t){return this._eachValues.push(t),this._eachValues},a.prototype._init=function(){},a.prototype._resolveEmptyArray=function(){this._resolve(void 0!==this._eachValues?this._eachValues:this._initialValue)},a.prototype.shouldCopyValues=function(){return!1},a.prototype._resolve=function(t){this._promise._resolveCallback(t),this._values=null},a.prototype._resultCancelled=function(t){return t===this._initialValue?this._cancel():void(this._isResolved()||(this._resultCancelled$(),this._currentCancellable instanceof e&&this._currentCancellable.cancel(),this._initialValue instanceof e&&this._initialValue.cancel()))},a.prototype._iterate=function(t){this._values=t;var n,r,i=t.length;if(void 0!==this._initialValue?(n=this._initialValue,r=0):(n=e.resolve(t[0]),r=1),this._currentCancellable=n,!n.isRejected())for(;i>r;++r){var o={accum:null,value:t[r],index:r,length:i,array:this};n=n._then(u,void 0,void 0,o,void 0)}void 0!==this._eachValues&&(n=n._then(this._eachComplete,void 0,void 0,this,void 0)),n._then(c,c,void 0,n,this)},e.prototype.reduce=function(t,e){return l(this,t,e,null)},e.reduce=function(t,e,n,r){return l(t,e,n,r)}}},{\"./util\":36}],29:[function(t,e,n){\"use strict\";var r,i=t(\"./util\"),o=function(){throw new Error(\"No async scheduler available\\n\\n    See http://goo.gl/MqrFmX\\n\")};if(i.isNode&&\"undefined\"==typeof MutationObserver){var s=global.setImmediate,a=process.nextTick;r=i.isRecentNode?function(t){s.call(global,t)}:function(t){a.call(process,t)}}else r=\"undefined\"==typeof MutationObserver||\"undefined\"!=typeof window&&window.navigator&&window.navigator.standalone?\"undefined\"!=typeof setImmediate?function(t){setImmediate(t)}:\"undefined\"!=typeof setTimeout?function(t){setTimeout(t,0)}:o:function(){var t=document.createElement(\"div\"),e={attributes:!0},n=!1,r=document.createElement(\"div\"),i=new MutationObserver(function(){t.classList.toggle(\"foo\"),n=!1});i.observe(r,e);var o=function(){n||(n=!0,r.classList.toggle(\"foo\"))};return function(n){var r=new MutationObserver(function(){r.disconnect(),n()});r.observe(t,e),o()}}();e.exports=r},{\"./util\":36}],30:[function(t,e,n){\"use strict\";e.exports=function(e,n,r){function i(t){this.constructor$(t)}var o=e.PromiseInspection,s=t(\"./util\");s.inherits(i,n),i.prototype._promiseResolved=function(t,e){this._values[t]=e;var n=++this._totalResolved;return n>=this._length?(this._resolve(this._values),!0):!1},i.prototype._promiseFulfilled=function(t,e){var n=new o;return n._bitField=33554432,n._settledValueField=t,this._promiseResolved(e,n)}
2,i.prototype._promiseRejected=function(t,e){var n=new o;return n._bitField=16777216,n._settledValueField=t,this._promiseResolved(e,n)},e.settle=function(t){return r.deprecated(\".settle()\",\".reflect()\"),new i(t).promise()},e.prototype.settle=function(){return e.settle(this)}}},{\"./util\":36}],31:[function(t,e,n){\"use strict\";e.exports=function(e,n,r){function i(t){this.constructor$(t),this._howMany=0,this._unwrap=!1,this._initialized=!1}function o(t,e){if((0|e)!==e||0>e)return r(\"expecting a positive integer\\n\\n    See http://goo.gl/MqrFmX\\n\");var n=new i(t),o=n.promise();return n.setHowMany(e),n.init(),o}var s=t(\"./util\"),a=t(\"./errors\").RangeError,c=t(\"./errors\").AggregateError,l=s.isArray,u={};s.inherits(i,n),i.prototype._init=function(){if(this._initialized){if(0===this._howMany)return void this._resolve([]);this._init$(void 0,-5);var t=l(this._values);!this._isResolved()&&t&&this._howMany>this._canPossiblyFulfill()&&this._reject(this._getRangeError(this.length()))}},i.prototype.init=function(){this._initialized=!0,this._init()},i.prototype.setUnwrap=function(){this._unwrap=!0},i.prototype.howMany=function(){return this._howMany},i.prototype.setHowMany=function(t){this._howMany=t},i.prototype._promiseFulfilled=function(t){return this._addFulfilled(t),this._fulfilled()===this.howMany()?(this._values.length=this.howMany(),1===this.howMany()&&this._unwrap?this._resolve(this._values[0]):this._resolve(this._values),!0):!1}
vendor: 9,677 bytes, line 2
2,i.prototype._promiseRejected=function(t){return this._addRejected(t),this._checkOutcome()},i.prototype._promiseCancelled=function(){return this._values instanceof e||null==this._values?this._cancel():(this._addRejected(u),this._checkOutcome())},i.prototype._checkOutcome=function(){if(this.howMany()>this._canPossiblyFulfill()){for(var t=new c,e=this.length();e<this._values.length;++e)this._values[e]!==u&&t.push(this._values[e]);return t.length>0?this._reject(t):this._cancel(),!0}return!1},i.prototype._fulfilled=function(){return this._totalResolved},i.prototype._rejected=function(){return this._values.length-this.length()},i.prototype._addRejected=function(t){this._values.push(t)},i.prototype._addFulfilled=function(t){this._values[this._totalResolved++]=t},i.prototype._canPossiblyFulfill=function(){return this.length()-this._rejected()},i.prototype._getRangeError=function(t){var e=\"Input array must contain at least \"+this._howMany+\" items but contains only \"+t+\" items\";return new a(e)},i.prototype._resolveEmptyArray=function(){this._reject(this._getRangeError(0))},e.some=function(t,e){return o(t,e)},e.prototype.some=function(t){return o(this,t)},e._SomePromiseArray=i}},{\"./errors\":12,\"./util\":36}],32:[function(t,e,n){\"use strict\";e.exports=function(t){function e(t){void 0!==t?(t=t._target(),\n    this._bitField=t._bitField,this._settledValueField=t._isFateSealed()?t._settledValue():void 0):(this._bitField=0,this._settledValueField=void 0)}e.prototype._settledValue=function(){return this._settledValueField};var n=e.prototype.value=function(){if(!this.isFulfilled())throw new TypeError(\"cannot get fulfillment value of a non-fulfilled promise\\n\\n    See http://goo.gl/MqrFmX\\n\");return this._settledValue()},r=e.prototype.error=e.prototype.reason=function(){if(!this.isRejected())throw new TypeError(\"cannot get rejection reason of a non-rejected promise\\n\\n    See http://goo.gl/MqrFmX\\n\");return this._settledValue()},i=e.prototype.isFulfilled=function(){return 0!==(33554432&this._bitField)},o=e.prototype.isRejected=function(){return 0!==(16777216&this._bitField)},s=e.prototype.isPending=function(){return 0===(50397184&this._bitField)},a=e.prototype.isResolved=function(){return 0!==(50331648&this._bitField)};e.prototype.isCancelled=t.prototype._isCancelled=function(){return 65536===(65536&this._bitField)},t.prototype.isCancelled=function(){return this._target()._isCancelled()},t.prototype.isPending=function(){return s.call(this._target())},t.prototype.isRejected=function(){return o.call(this._target())},t.prototype.isFulfilled=function(){return i.call(this._target())},t.prototype.isResolved=function(){return a.call(this._target())},t.prototype.value=function(){return n.call(this._target())},t.prototype.reason=function(){var t=this._target();return t._unsetRejectionIsUnhandled(),r.call(t)},t.prototype._value=function(){return this._settledValue()},t.prototype._reason=function(){return this._unsetRejectionIsUnhandled(),this._settledValue()},t.PromiseInspection=e}},{}],33:[function(t,e,n){\"use strict\";e.exports=function(e,n){function r(t,r){if(u(t)){if(t instanceof e)return t;var i=o(t);if(i===l){r&&r._pushContext();var c=e.reject(i.e);return r&&r._popContext(),c}if(\"function\"==typeof i){if(s(t)){var c=new e(n);return t._then(c._fulfill,c._reject,void 0,c,null),c}return a(t,i,r)}}return t}function i(t){return t.then}function o(t){try{return i(t)}catch(e){return l.e=e,l}}function s(t){return p.call(t,\"_promise0\")}function a(t,r,i){function o(t){a&&(a._resolveCallback(t),a=null)}function s(t){a&&(a._rejectCallback(t,p,!0),a=null)}var a=new e(n),u=a;i&&i._pushContext(),a._captureStackTrace(),i&&i._popContext();var p=!0,h=c.tryCatch(r).call(t,o,s);return p=!1,a&&h===l&&(a._rejectCallback(h.e,!0,!0),a=null),u}var c=t(\"./util\"),l=c.errorObj,u=c.isObject,p={}.hasOwnProperty;return r}},{\"./util\":36}],34:[function(t,e,n){\"use strict\";e.exports=function(e,n,r){function i(t){this.handle=t}function o(t){return clearTimeout(this.handle),t}function s(t){throw clearTimeout(this.handle),t}var a=t(\"./util\"),c=e.TimeoutError;i.prototype._resultCancelled=function(){clearTimeout(this.handle)};var l=function(t){return u(+this).thenReturn(t)},u=e.delay=function(t,o){var s,a;return void 0!==o?(s=e.resolve(o)._then(l,null,null,t,void 0),r.cancellation()&&o instanceof e&&s._setOnCancel(o)):(s=new e(n),a=setTimeout(function(){s._fulfill()},+t),r.cancellation()&&s._setOnCancel(new i(a))),s._setAsyncGuaranteed(),s};e.prototype.delay=function(t){return u(t,this)};var p=function(t,e,n){var r;r=\"string\"!=typeof e?e instanceof Error?e:new c(\"operation timed out\"):new c(e),a.markAsOriginatingFromRejection(r),t._attachExtraTrace(r),t._reject(r),null!=n&&n.cancel()};e.prototype.timeout=function(t,e){t=+t;var n,a,c=new i(setTimeout(function(){n.isPending()&&p(n,e,a)},t));return r.cancellation()?(a=this.then(),n=a._then(o,s,void 0,c,void 0),n._setOnCancel(c)):n=this._then(o,s,void 0,c,void 0),n}}},{\"./util\":36}],35:[function(t,e,n){\"use strict\";e.exports=function(e,n,r,i,o,s){function a(t){setTimeout(function(){throw t},0)}function c(t){var e=r(t);return e!==t&&\"function\"==typeof t._isDisposable&&\"function\"==typeof t._getDisposer&&t._isDisposable()&&e._setDisposable(t._getDisposer()),e}function l(t,n){function i(){if(s>=l)return u._fulfill();var o=c(t[s++]);if(o instanceof e&&o._isDisposable()){try{o=r(o._getDisposer().tryDispose(n),t.promise)}catch(p){return a(p)}if(o instanceof e)return o._then(i,a,null,null,null)}i()}var s=0,l=t.length,u=new e(o);return i(),u}function u(t,e,n){this._data=t,this._promise=e,this._context=n}function p(t,e,n){this.constructor$(t,e,n)}function h(t){return u.isDisposer(t)?(this.resources[this.index]._setDisposable(t),t.promise()):t}function f(t){this.length=t,this.promise=null,this[t-1]=null}var _=t(\"./util\"),d=t(\"./errors\").TypeError,v=t(\"./util\").inherits,y=_.errorObj,g=_.tryCatch;u.prototype.data=function(){return this._data},u.prototype.promise=function(){return this._promise},u.prototype.resource=function(){return this.promise().isFulfilled()?this.promise().value():null},u.prototype.tryDispose=function(t){var e=this.resource(),n=this._context;void 0!==n&&n._pushContext();var r=null!==e?this.doDispose(e,t):null;return void 0!==n&&n._popContext(),this._promise._unsetDisposable(),this._data=null,r},u.isDisposer=function(t){return null!=t&&\"function\"==typeof t.resource&&\"function\"==typeof t.tryDispose},v(p,u),p.prototype.doDispose=function(t,e){var n=this.data();return n.call(t,t,e)},f.prototype._resultCancelled=function(){for(var t=this.length,n=0;t>n;++n){var r=this[n];r instanceof e&&r.cancel()}},e.using=function(){var t=arguments.length;if(2>t)return n(\"you must pass at least 2 arguments to Promise.using\");var i=arguments[t-1];if(\"function\"!=typeof i)return n(\"expecting a function but got \"+_.classString(i));var o,a=!0;2===t&&Array.isArray(arguments[0])?(o=arguments[0],t=o.length,a=!1):(o=arguments,t--);for(var c=new f(t),p=0;t>p;++p){var d=o[p];if(u.isDisposer(d)){var v=d;d=d.promise(),d._setDisposable(v)}else{var m=r(d);m instanceof e&&(d=m._then(h,null,null,{resources:c,index:p},void 0))}c[p]=d}for(var b=new Array(c.length),p=0;p<b.length;++p)b[p]=e.resolve(c[p]).reflect();var w=e.all(b).then(function(t){for(var e=0;e<t.length;++e){var n=t[e];if(n.isRejected())return y.e=n.error(),y;if(!n.isFulfilled())return void w.cancel();t[e]=n.value()}C._pushContext(),i=g(i);var r=a?i.apply(void 0,t):i(t),o=C._popContext();return s.checkForgottenReturns(r,o,\"Promise.using\",C),r}),C=w.lastly(function(){var t=new e.PromiseInspection(w);return l(c,t)});return c.promise=C,C._setOnCancel(c),C},e.prototype._setDisposable=function(t){this._bitField=131072|this._bitField,this._disposer=t},e.prototype._isDisposable=function(){return(131072&this._bitField)>0},e.prototype._getDisposer=function(){return this._disposer},e.prototype._unsetDisposable=function(){this._bitField=-131073&this._bitField,this._disposer=void 0},e.prototype.disposer=function(t){if(\"function\"==typeof t)return new p(t,this,i());throw new d}}},{\"./errors\":12,\"./util\":36}],36:[function(t,e,n){\"use strict\";function r(){try{var t=x;return x=null,t.apply(this,arguments)}catch(e){return F.e=e,F}}function i(t){return x=t,r}function o(t){return null==t||t===!0||t===!1||\"string\"==typeof t||\"number\"==typeof t}function s(t){return\"function\"==typeof t||\"object\"==typeof t&&null!==t}function a(t){return o(t)?new Error(v(t)):t}function c(t,e){var n,r=t.length,i=new Array(r+1);for(n=0;r>n;++n)i[n]=t[n];return i[n]=e,i}function l(t,e,n){if(!k.isES5)return{}.hasOwnProperty.call(t,e)?t[e]:void 0;var r=Object.getOwnPropertyDescriptor(t,e);return null!=r?null==r.get&&null==r.set?r.value:n:void 0}function u(t,e,n){if(o(t))return t;var r={value:n,configurable:!0,enumerable:!1,writable:!0};return k.defineProperty(t,e,r),t}function p(t){throw t}function h(t){try{if(\"function\"==typeof t){var e=k.names(t.prototype),n=k.isES5&&e.length>1,r=e.length>0&&!(1===e.length&&\"constructor\"===e[0]),i=O.test(t+\"\")&&k.names(t).length>0;if(n||r||i)return!0}return!1}catch(o){return!1}}function f(t){function e(){}e.prototype=t;for(var n=8;n--;)new e;return t}function _(t){return S.test(t)}function d(t,e,n){for(var r=new Array(t),i=0;t>i;++i)r[i]=e+i+n;return r}function v(t){try{return t+\"\"}catch(e){return\"[no string representation]\"}}function y(t){return null!==t&&\"object\"==typeof t&&\"string\"==typeof t.message&&\"string\"==typeof t.name}function g(t){try{u(t,\"isOperational\",!0)}catch(e){}}function m(t){return null==t?!1:t instanceof Error.__BluebirdErrorTypes__.OperationalError||t.isOperational===!0}
2function b(t){return y(t)&&k.propertyIsWritable(t,\"stack\")}function w(t){return{}.toString.call(t)}function C(t,e,n){for(var r=k.names(t),i=0;i<r.length;++i){var o=r[i];if(n(o))try{k.defineProperty(e,o,k.getDescriptor(t,o))}catch(s){}}}function j(t,e){return I?process.env[t]:e}var k=t(\"./es5\"),E=\"undefined\"==typeof navigator,F={e:{}},x,T=\"undefined\"!=typeof self?self:\"undefined\"!=typeof window?window:\"undefined\"!=typeof global?global:void 0!==this?this:null,R=function(t,e){function n(){this.constructor=t,this.constructor$=e;for(var n in e.prototype)r.call(e.prototype,n)&&\"$\"!==n.charAt(n.length-1)&&(this[n+\"$\"]=e.prototype[n])}var r={}.hasOwnProperty;return n.prototype=e.prototype,t.prototype=new n,t.prototype},P=function(){var t=[Array.prototype,Object.prototype,Function.prototype],e=function(e){for(var n=0;n<t.length;++n)if(t[n]===e)return!0;return!1};if(k.isES5){var n=Object.getOwnPropertyNames;return function(t){for(var r=[],i=Object.create(null);null!=t&&!e(t);){var o;try{o=n(t)}catch(s){return r}for(var a=0;a<o.length;++a){var c=o[a];if(!i[c]){i[c]=!0;var l=Object.getOwnPropertyDescriptor(t,c);null!=l&&null==l.get&&null==l.set&&r.push(c)}}t=k.getPrototypeOf(t)}return r}}var r={}.hasOwnProperty;return function(n){if(e(n))return[];var i=[];t:for(var o in n)if(r.call(n,o))i.push(o);else{for(var s=0;s<t.length;++s)if(r.call(t[s],o))continue t;i.push(o)}return i}}(),O=/this\\s*\\.\\s*\\S+\\s*=/,S=/^[a-z$_][a-z$_0-9]*$/i,A=function(){return\"stack\"in new Error?function(t){return b(t)?t:new Error(v(t))}:function(t){if(b(t))return t;try{throw new Error(v(t))}catch(e){return e}}}(),D=function(t){return k.isArray(t)?t:null};if(\"undefined\"!=typeof Symbol&&Symbol.iterator){var V=\"function\"==typeof Array.from?function(t){return Array.from(t)}:function(t){for(var e,n=[],r=t[Symbol.iterator]();!(e=r.next()).done;)n.push(e.value);return n};D=function(t){return k.isArray(t)?t:null!=t&&\"function\"==typeof t[Symbol.iterator]?V(t):null}}var I=\"undefined\"!=typeof process&&\"[object process]\"===w(process).toLowerCase(),L={isClass:h,isIdentifier:_,inheritedDataKeys:P,getDataPropertyOrDefault:l,thrower:p,isArray:k.isArray,asArray:D,notEnumerableProp:u,isPrimitive:o,isObject:s,isError:y,canEvaluate:E,errorObj:F,tryCatch:i,inherits:R,withAppended:c,maybeWrapAsError:a,toFastProperties:f,filledRange:d,toString:v,canAttachTrace:b,ensureErrorObject:A,originatesFromRejection:m,markAsOriginatingFromRejection:g,classString:w,copyDescriptors:C,hasDevTools:\"undefined\"!=typeof chrome&&chrome&&\"function\"==typeof chrome.loadTimes,isNode:I,env:j,global:T};L.isRecentNode=L.isNode&&function(){var t=process.versions.node.split(\".\").map(Number);return 0===t[0]&&t[1]>10||t[0]>0}(),L.isNode&&L.toFastProperties(process);try{throw new Error}catch(H){L.lastLineError=H}e.exports=L},{\"./es5\":13}]},{},[4])(4)}),\"undefined\"!=typeof window&&null!==window?window.P=window.Promise:\"undefined\"!=typeof self&&null!==self&&(self.P=self.Promise);","Amazon_Payment/js/lib/sjcl.min.js":"// jscs:disable\n\"use strict\";var sjcl={cipher:{},hash:{},keyexchange:{},mode:{},misc:{},codec:{},exception:{corrupt:function(a){this.toString=function(){return\"CORRUPT: \"+this.message};this.message=a},invalid:function(a){this.toString=function(){return\"INVALID: \"+this.message};this.message=a},bug:function(a){this.toString=function(){return\"BUG: \"+this.message};this.message=a},notReady:function(a){this.toString=function(){return\"NOT READY: \"+this.message};this.message=a}}};\n\"undefined\"!==typeof module&&module.exports&&(module.exports=sjcl);\"function\"===typeof define&&define([],function(){return sjcl});\nsjcl.cipher.aes=function(a){this.s[0][0][0]||this.O();var b,c,d,e,g=this.s[0][4],f=this.s[1];b=a.length;var h=1;if(4!==b&&6!==b&&8!==b)throw new sjcl.exception.invalid(\"invalid aes key size\");this.b=[d=a.slice(0),e=[]];for(a=b;a<4*b+28;a++){c=d[a-1];if(0===a%b||8===b&&4===a%b)c=g[c>>>24]<<24^g[c>>16&255]<<16^g[c>>8&255]<<8^g[c&255],0===a%b&&(c=c<<8^c>>>24^h<<24,h=h<<1^283*(h>>7));d[a]=d[a-b]^c}for(b=0;a;b++,a--)c=d[b&3?a:a-4],e[b]=4>=a||4>b?c:f[0][g[c>>>24]]^f[1][g[c>>16&255]]^f[2][g[c>>8&255]]^f[3][g[c&\n255]]};\nsjcl.cipher.aes.prototype={encrypt:function(a){return u(this,a,0)},decrypt:function(a){return u(this,a,1)}
vendor: 4,530 bytes, line 2
2,s:[[[],[],[],[],[]],[[],[],[],[],[]]],O:function(){var a=this.s[0],b=this.s[1],c=a[4],d=b[4],e,g,f,h=[],l=[],k,m,n,p;for(e=0;0x100>e;e++)l[(h[e]=e<<1^283*(e>>7))^e]=e;for(g=f=0;!c[g];g^=k||1,f=l[f]||1)for(n=f^f<<1^f<<2^f<<3^f<<4,n=n>>8^n&255^99,c[g]=n,d[n]=g,m=h[e=h[k=h[g]]],p=0x1010101*m^0x10001*e^0x101*k^0x1010100*g,m=0x101*h[n]^0x1010100*n,e=0;4>e;e++)a[e][g]=m=m<<24^m>>>8,b[e][n]=p=p<<24^p>>>8;for(e=\n0;5>e;e++)a[e]=a[e].slice(0),b[e]=b[e].slice(0)}};\nfunction u(a,b,c){if(4!==b.length)throw new sjcl.exception.invalid(\"invalid aes block size\");var d=a.b[c],e=b[0]^d[0],g=b[c?3:1]^d[1],f=b[2]^d[2];b=b[c?1:3]^d[3];var h,l,k,m=d.length/4-2,n,p=4,r=[0,0,0,0];h=a.s[c];a=h[0];var q=h[1],t=h[2],w=h[3],x=h[4];for(n=0;n<m;n++)h=a[e>>>24]^q[g>>16&255]^t[f>>8&255]^w[b&255]^d[p],l=a[g>>>24]^q[f>>16&255]^t[b>>8&255]^w[e&255]^d[p+1],k=a[f>>>24]^q[b>>16&255]^t[e>>8&255]^w[g&255]^d[p+2],b=a[b>>>24]^q[e>>16&255]^t[g>>8&255]^w[f&255]^d[p+3],p+=4,e=h,g=l,f=k;for(n=\n0;4>n;n++)r[c?3&-n:n]=x[e>>>24]<<24^x[g>>16&255]<<16^x[f>>8&255]<<8^x[b&255]^d[p++],h=e,e=g,g=f,f=b,b=h;return r}\nsjcl.bitArray={bitSlice:function(a,b,c){a=sjcl.bitArray.$(a.slice(b/32),32-(b&31)).slice(1);return void 0===c?a:sjcl.bitArray.clamp(a,c-b)},extract:function(a,b,c){var d=Math.floor(-b-c&31);return((b+c-1^b)&-32?a[b/32|0]<<32-d^a[b/32+1|0]>>>d:a[b/32|0]>>>d)&(1<<c)-1},concat:function(a,b){if(0===a.length||0===b.length)return a.concat(b);var c=a[a.length-1],d=sjcl.bitArray.getPartial(c);return 32===d?a.concat(b):sjcl.bitArray.$(b,d,c|0,a.slice(0,a.length-1))},bitLength:function(a){var b=a.length;return 0===\nb?0:32*(b-1)+sjcl.bitArray.getPartial(a[b-1])},clamp:function(a,b){if(32*a.length<b)return a;a=a.slice(0,Math.ceil(b/32));var c=a.length;b=b&31;0<c&&b&&(a[c-1]=sjcl.bitArray.partial(b,a[c-1]&2147483648>>b-1,1));return a},partial:function(a,b,c){return 32===a?b:(c?b|0:b<<32-a)+0x10000000000*a},getPartial:function(a){return Math.round(a/0x10000000000)||32},equal:function(a,b){if(sjcl.bitArray.bitLength(a)!==sjcl.bitArray.bitLength(b))return!1;var c=0,d;for(d=0;d<a.length;d++)c|=a[d]^b[d];return 0===\nc},$:function(a,b,c,d){var e;e=0;for(void 0===d&&(d=[]);32<=b;b-=32)d.push(c),c=0;if(0===b)return d.concat(a);for(e=0;e<a.length;e++)d.push(c|a[e]>>>b),c=a[e]<<32-b;e=a.length?a[a.length-1]:0;a=sjcl.bitArray.getPartial(e);d.push(sjcl.bitArray.partial(b+a&31,32<b+a?c:d.pop(),1));return d},i:function(a,b){return[a[0]^b[0],a[1]^b[1],a[2]^b[2],a[3]^b[3]]},byteswapM:function(a){var b,c;for(b=0;b<a.length;++b)c=a[b],a[b]=c>>>24|c>>>8&0xff00|(c&0xff00)<<8|c<<24;return a}};\nsjcl.codec.utf8String={fromBits:function(a){var b=\"\",c=sjcl.bitArray.bitLength(a),d,e;for(d=0;d<c/8;d++)0===(d&3)&&(e=a[d/4]),b+=String.fromCharCode(e>>>24),e<<=8;return decodeURIComponent(escape(b))},toBits:function(a){a=unescape(encodeURIComponent(a));var b=[],c,d=0;for(c=0;c<a.length;c++)d=d<<8|a.charCodeAt(c),3===(c&3)&&(b.push(d),d=0);c&3&&b.push(sjcl.bitArray.partial(8*(c&3),d));return b}};\nsjcl.codec.hex={fromBits:function(a){var b=\"\",c;for(c=0;c<a.length;c++)b+=((a[c]|0)+0xf00000000000).toString(16).substr(4);return b.substr(0,sjcl.bitArray.bitLength(a)/4)},toBits:function(a){var b,c=[],d;a=a.replace(/\\s|0x/g,\"\");d=a.length;a=a+\"00000000\";for(b=0;b<a.length;b+=8)c.push(parseInt(a.substr(b,8),16)^0);return sjcl.bitArray.clamp(c,4*d)}};\nsjcl.codec.base32={B:\"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567\",X:\"0123456789ABCDEFGHIJKLMNOPQRSTUV\",BITS:32,BASE:5,REMAINING:27,fromBits:function(a,b,c){var d=sjcl.codec.base32.BASE,e=sjcl.codec.base32.REMAINING,g=\"\",f=0,h=sjcl.codec.base32.B,l=0,k=sjcl.bitArray.bitLength(a);c&&(h=sjcl.codec.base32.X);for(c=0;g.length*d<k;)g+=h.charAt((l^a[c]>>>f)>>>e),f<d?(l=a[c]<<d-f,f+=e,c++):(l<<=d,f-=d);for(;g.length&7&&!b;)g+=\"=\";return g},toBits:function(a,b){a=a.replace(/\\s|=/g,\"\").toUpperCase();var c=sjcl.codec.base32.BITS,\nd=sjcl.codec.base32.BASE,e=sjcl.codec.base32.REMAINING,g=[],f,h=0,l=sjcl.codec.base32.B,k=0,m,n=\"base32\";b&&(l=sjcl.codec.base32.X,n=\"base32hex\");for(f=0;f<a.length;f++){m=l.indexOf(a.charAt(f));if(0>m){if(!b)try{return sjcl.codec.base32hex.toBits(a)}catch(p){}throw new sjcl.exception.invalid(\"this isn't \"+n+\"!\");}h>e?(h-=e,g.push(k^m>>>h),k=m<<c-h):(h+=d,k^=m<<c-h)}h&56&&g.push(sjcl.bitArray.partial(h&56,k,1));return g}};\nsjcl.codec.base32hex={fromBits:function(a,b){return sjcl.codec.base32.fromBits(a,b,1)},toBits:function(a){return sjcl.codec.base32.toBits(a,1)}};\nsjcl.codec.base64={B:\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789
2+/\",fromBits:function(a,b,c){var d=\"\",e=0,g=sjcl.codec.base64.B,f=0,h=sjcl.bitArray.bitLength(a);c&&(g=g.substr(0,62)+\"-_\");for(c=0;6*d.length<h;)d+=g.charAt((f^a[c]>>>e)>>>26),6>e?(f=a[c]<<6-e,e+=26,c++):(f<<=6,e-=6);for(;d.length&3&&!b;)d+=\"=\";return d},toBits:function(a,b){a=a.replace(/\\s|=/g,\"\");var c=[],d,e=0,g=sjcl.codec.base64.B,f=0,h;b&&(g=g.substr(0,62)+\"-_\");for(d=0;d<a.length;d++){h=g.indexOf(a.charAt(d));\nif(0>h)throw new sjcl.exception.invalid(\"this isn't base64!\");26<e?(e-=26,c.push(f^h>>>e),f=h<<32-e):(e+=6,f^=h<<32-e)}e&56&&c.push(sjcl.bitArray.partial(e&56,f,1));return c}};sjcl.codec.base64url={fromBits:function(a){return sjcl.codec.base64.fromBits(a,1,1)},toBits:function(a){return sjcl.codec.base64.toBits(a,1)}};sjcl.hash.sha256=function(a){this.b[0]||this.O();a?(this.F=a.F.slice(0),this.A=a.A.slice(0),this.l=a.l):this.reset()};sjcl.hash.sha256.hash=function(a){return(new sjcl.hash.sha256).update(a).finalize()};\nsjcl.hash.sha256.prototype={blockSize:512,reset:function(){this.F=this.Y.slice(0);this.A=[];this.l=0;return this},update:function(a){\"string\"===typeof a&&(a=sjcl.codec.utf8String.toBits(a));var b,c=this.A=sjcl.bitArray.concat(this.A,a);b=this.l;a=this.l=b+sjcl.bitArray.bitLength(a);for(b=512+b&-512;b<=a;b+=512)v(this,c.splice(0,16));return this},finalize:function(){var a,b=this.A,c=this.F,b=sjcl.bitArray.concat(b,[sjcl.bitArray.partial(1,1)]);for(a=b.length+2;a&15;a++)b.push(0);b.push(Math.floor(this.l/\n4294967296));for(b.push(this.l|0);b.length;)v(this,b.splice(0,16));this.reset();return c},Y:[],b:[],O:function(){function a(a){return 0x100000000*(a-Math.floor(a))|0}var b=0,c=2,d;a:for(;64>b;c++){for(d=2;d*d<=c;d++)if(0===c%d)continue a;8>b&&(this.Y[b]=a(Math.pow(c,.5)));this.b[b]=a(Math.pow(c,1/3));b++}}};\nfunction v(a,b){var c,d,e,g=b.slice(0),f=a.F,h=a.b,l=f[0],k=f[1],m=f[2],n=f[3],p=f[4],r=f[5],q=f[6],t=f[7];for(c=0;64>c;c++)16>c?d=g[c]:(d=g[c+1&15],e=g[c+14&15],d=g[c&15]=(d>>>7^d>>>18^d>>>3^d<<25^d<<14)+(e>>>17^e>>>19^e>>>10^e<<15^e<<13)+g[c&15]+g[c+9&15]|0),d=d+t+(p>>>6^p>>>11^p>>>25^p<<26^p<<21^p<<7)+(q^p&(r^q))+h[c],t=q,q=r,r=p,p=n+d|0,n=m,m=k,k=l,l=d+(k&m^n&(k^m))+(k>>>2^k>>>13^k>>>22^k<<30^k<<19^k<<10)|0;f[0]=f[0]+l|0;f[1]=f[1]+k|0;f[2]=f[2]+m|0;f[3]=f[3]+n|0;f[4]=f[4]+p|0;f[5]=f[5]+r|0;f[6]=\nf[6]+q|0;f[7]=f[7]+t|0}\nsjcl.mode.ccm={name:\"ccm\",G:[],listenProgress:function(a){sjcl.mode.ccm.G.push(a)},unListenProgress:function(a){a=sjcl.mode.ccm.G.indexOf(a);-1<a&&sjcl.mode.ccm.G.splice(a,1)},fa:function(a){var b=sjcl.mode.ccm.G.slice(),c;for(c=0;c<b.length;c+=1)b[c](a)},encrypt:function(a,b,c,d,e){var g,f=b.slice(0),h=sjcl.bitArray,l=h.bitLength(c)/8,k=h.bitLength(f)/8;e=e||64;d=d||[];if(7>l)throw new sjcl.exception.invalid(\"ccm: iv must be at least 7 bytes\");for(g=2;4>g&&k>>>8*g;g++);g<15-l&&(g=15-l);c=h.clamp(c,\n8*(15-g));b=sjcl.mode.ccm.V(a,b,c,d,e,g);f=sjcl.mode.ccm.C(a,f,c,b,e,g);return h.concat(f.data,f.tag)},decrypt:function(a,b,c,d,e){e=e||64;d=d||[];var g=sjcl.bitArray,f=g.bitLength(c)/8,h=g.bitLength(b),l=g.clamp(b,h-e),k=g.bitSlice(b,h-e),h=(h-e)/8;if(7>f)throw new sjcl.exception.invalid(\"ccm: iv must be at least 7 bytes\");for(b=2;4>b&&h>>>8*b;b++);b<15-f&&(b=15-f);c=g.clamp(c,8*(15-b));l=sjcl.mode.ccm.C(a,l,c,k,e,b);a=sjcl.mode.ccm.V(a,l.data,c,d,e,b);if(!g.equal(l.tag,a))throw new sjcl.exception.corrupt(\"ccm: tag doesn't match\");\nreturn l.data},na:function(a,b,c,d,e,g){var f=[],h=sjcl.bitArray,l=h.i;d=[h.partial(8,(b.length?64:0)|d-2<<2|g-1)];d=h.concat(d,c);d[3]|=e;d=a.encrypt(d);if(b.length)for(c=h.bitLength(b)/8,65279>=c?f=[h.partial(16,c)]:0xffffffff>=c&&(f=h.concat([h.partial(16,65534)],[c])),f=h.concat(f,b),b=0;b<f.length;b+=4)d=a.encrypt(l(d,f.slice(b,b+4).concat([0,0,0])));return d},V:function(a,b,c,d,e,g){var f=sjcl.bitArray,h=f.i;e/=8;if(e%2||4>e||16<e)throw new sjcl.exception.invalid(\"ccm: invalid tag length\");\nif(0xffffffff<d.length||0xffffffff<b.length)throw new sjcl.exception.bug(\"ccm: can't deal with 4GiB or more data\");c=sjcl.mode.ccm.na(a,d,c,e,f.bitLength(b)/8,g);for(d=0;d<b.length;d+=4)c=a.encrypt(h(c,b.slice(d,d+4).concat([0,0,0])));return f.clamp(c,8*e)},C:function(a,b,c,d,e,g){var f,h=sjcl.bitArray;
2f=h.i;var l=b.length,k=h.bitLength(b),m=l/50,n=m;c=h.concat([h.partial(8,g-1)],c).concat([0,0,0]).slice(0,4);d=h.bitSlice(f(d,a.encrypt(c)),0,e);if(!l)return{tag:d,data:[]};for(f=0;f<l;f+=4)f>m&&(sjcl.mode.ccm.fa(f/\nl),m+=n),c[3]++,e=a.encrypt(c),b[f]^=e[0],b[f+1]^=e[1],b[f+2]^=e[2],b[f+3]^=e[3];return{tag:d,data:h.clamp(b,k)}}};\nsjcl.mode.ocb2={name:\"ocb2\",encrypt:function(a,b,c,d,e,g){if(128!==sjcl.bitArray.bitLength(c))throw new sjcl.exception.invalid(\"ocb iv must be 128 bits\");var f,h=sjcl.mode.ocb2.S,l=sjcl.bitArray,k=l.i,m=[0,0,0,0];c=h(a.encrypt(c));var n,p=[];d=d||[];e=e||64;for(f=0;f+4<b.length;f+=4)n=b.slice(f,f+4),m=k(m,n),p=p.concat(k(c,a.encrypt(k(c,n)))),c=h(c);n=b.slice(f);b=l.bitLength(n);f=a.encrypt(k(c,[0,0,0,b]));n=l.clamp(k(n.concat([0,0,0]),f),b);m=k(m,k(n.concat([0,0,0]),f));m=a.encrypt(k(m,k(c,h(c))));\nd.length&&(m=k(m,g?d:sjcl.mode.ocb2.pmac(a,d)));return p.concat(l.concat(n,l.clamp(m,e)))},decrypt:function(a,b,c,d,e,g){if(128!==sjcl.bitArray.bitLength(c))throw new sjcl.exception.invalid(\"ocb iv must be 128 bits\");e=e||64;var f=sjcl.mode.ocb2.S,h=sjcl.bitArray,l=h.i,k=[0,0,0,0],m=f(a.encrypt(c)),n,p,r=sjcl.bitArray.bitLength(b)-e,q=[];d=d||[];for(c=0;c+4<r/32;c+=4)n=l(m,a.decrypt(l(m,b.slice(c,c+4)))),k=l(k,n),q=q.concat(n),m=f(m);p=r-32*c;n=a.encrypt(l(m,[0,0,0,p]));n=l(n,h.clamp(b.slice(c),p).concat([0,\n0,0]));k=l(k,n);k=a.encrypt(l(k,l(m,f(m))));d.length&&(k=l(k,g?d:sjcl.mode.ocb2.pmac(a,d)));if(!h.equal(h.clamp(k,e),h.bitSlice(b,r)))throw new sjcl.exception.corrupt(\"ocb: tag doesn't match\");return q.concat(h.clamp(n,p))},pmac:function(a,b){var c,d=sjcl.mode.ocb2.S,e=sjcl.bitArray,g=e.i,f=[0,0,0,0],h=a.encrypt([0,0,0,0]),h=g(h,d(d(h)));for(c=0;c+4<b.length;c+=4)h=d(h),f=g(f,a.encrypt(g(h,b.slice(c,c+4))));c=b.slice(c);128>e.bitLength(c)&&(h=g(h,d(h)),c=e.concat(c,[-2147483648,0,0,0]));f=g(f,c);\nreturn a.encrypt(g(d(g(h,d(h))),f))},S:function(a){return[a[0]<<1^a[1]>>>31,a[1]<<1^a[2]>>>31,a[2]<<1^a[3]>>>31,a[3]<<1^135*(a[0]>>>31)]}};\nsjcl.mode.gcm={name:\"gcm\",encrypt:function(a,b,c,d,e){var g=b.slice(0);b=sjcl.bitArray;d=d||[];a=sjcl.mode.gcm.C(!0,a,g,d,c,e||128);return b.concat(a.data,a.tag)},decrypt:function(a,b,c,d,e){var g=b.slice(0),f=sjcl.bitArray,h=f.bitLength(g);e=e||128;d=d||[];e<=h?(b=f.bitSlice(g,h-e),g=f.bitSlice(g,0,h-e)):(b=g,g=[]);a=sjcl.mode.gcm.C(!1,a,g,d,c,e);if(!f.equal(a.tag,b))throw new sjcl.exception.corrupt(\"gcm: tag doesn't match\");return a.data},ka:function(a,b){var c,d,e,g,f,h=sjcl.bitArray.i;e=[0,0,\n0,0];g=b.slice(0);for(c=0;128>c;c++){(d=0!==(a[Math.floor(c/32)]&1<<31-c%32))&&(e=h(e,g));f=0!==(g[3]&1);for(d=3;0<d;d--)g[d]=g[d]>>>1|(g[d-1]&1)<<31;g[0]>>>=1;f&&(g[0]^=-0x1f000000)}return e},j:function(a,b,c){var d,e=c.length;b=b.slice(0);for(d=0;d<e;d+=4)b[0]^=0xffffffff&c[d],b[1]^=0xffffffff&c[d+1],b[2]^=0xffffffff&c[d+2],b[3]^=0xffffffff&c[d+3],b=sjcl.mode.gcm.ka(b,a);return b},C:function(a,b,c,d,e,g){var f,h,l,k,m,n,p,r,q=sjcl.bitArray;n=c.length;p=q.bitLength(c);r=q.bitLength(d);h=q.bitLength(e);\nf=b.encrypt([0,0,0,0]);96===h?(e=e.slice(0),e=q.concat(e,[1])):(e=sjcl.mode.gcm.j(f,[0,0,0,0],e),e=sjcl.mode.gcm.j(f,e,[0,0,Math.floor(h/0x100000000),h&0xffffffff]));h=sjcl.mode.gcm.j(f,[0,0,0,0],d);m=e.slice(0);d=h.slice(0);a||(d=sjcl.mode.gcm.j(f,h,c));for(k=0;k<n;k+=4)m[3]++,l=b.encrypt(m),c[k]^=l[0],c[k+1]^=l[1],c[k+2]^=l[2],c[k+3]^=l[3];c=q.clamp(c,p);a&&(d=sjcl.mode.gcm.j(f,h,c));a=[Math.floor(r/0x100000000),r&0xffffffff,Math.floor(p/0x100000000),p&0xffffffff];d=sjcl.mode.gcm.j(f,d,a);l=b.encrypt(e);\nd[0]^=l[0];d[1]^=l[1];d[2]^=l[2];d[3]^=l[3];return{tag:q.bitSlice(d,0,g),data:c}}};sjcl.misc.hmac=function(a,b){this.W=b=b||sjcl.hash.sha256;var c=[[],[]],d,e=b.prototype.blockSize/32;this.w=[new b,new b];a.length>e&&(a=b.hash(a));for(d=0;d<e;d++)c[0][d]=a[d]^909522486,c[1][d]=a[d]^1549556828;this.w[0].update(c[0]);this.w[1].update(c[1]);this.R=new b(this.w[0])};\nsjcl.misc.hmac.prototype.encrypt=sjcl.misc.hmac.prototype.mac=function(a){if(this.aa)throw new sjcl.exception.invalid(\"encrypt on already updated hmac called!\");this.update(a);return this.digest(a)};sjcl.misc.hmac.prototype.reset=function(){this.R=new this.W(this.w[0]);this.aa=!1};sjcl.misc.hmac.prototype.update=function(a){this.aa=!0;this.R.update(a)};sjcl.misc.hmac.prototype.digest=function(){var a=this.R.finalize(),a=(new this.W(this.w[1])).update(a).finalize();this.reset();return a};\nsjcl.misc.pbkdf2=function(a,b,c,d,e){c=c||1E3;if(0>d||0>c)throw sjcl.exception.invalid(\"invalid params to pbkdf2\");
2\"string\"===typeof a&&(a=sjcl.codec.utf8String.toBits(a));\"string\"===typeof b&&(b=sjcl.codec.utf8String.toBits(b));e=e||sjcl.misc.hmac;a=new e(a);var g,f,h,l,k=[],m=sjcl.bitArray;for(l=1;32*k.length<(d||1);l++){e=g=a.encrypt(m.concat(b,[l]));for(f=1;f<c;f++)for(g=a.encrypt(g),h=0;h<g.length;h++)e[h]^=g[h];k=k.concat(e)}d&&(k=m.clamp(k,d));return k};\nsjcl.prng=function(a){this.c=[new sjcl.hash.sha256];this.m=[0];this.P=0;this.H={};this.N=0;this.U={};this.Z=this.f=this.o=this.ha=0;this.b=[0,0,0,0,0,0,0,0];this.h=[0,0,0,0];this.L=void 0;this.M=a;this.D=!1;this.K={progress:{},seeded:{}};this.u=this.ga=0;this.I=1;this.J=2;this.ca=0x10000;this.T=[0,48,64,96,128,192,0x100,384,512,768,1024];this.da=3E4;this.ba=80};\nsjcl.prng.prototype={randomWords:function(a,b){var c=[],d;d=this.isReady(b);var e;if(d===this.u)throw new sjcl.exception.notReady(\"generator isn't seeded\");if(d&this.J){d=!(d&this.I);e=[];var g=0,f;this.Z=e[0]=(new Date).valueOf()+this.da;for(f=0;16>f;f++)e.push(0x100000000*Math.random()|0);for(f=0;f<this.c.length&&(e=e.concat(this.c[f].finalize()),g+=this.m[f],this.m[f]=0,d||!(this.P&1<<f));f++);this.P>=1<<this.c.length&&(this.c.push(new sjcl.hash.sha256),this.m.push(0));this.f-=g;g>this.o&&(this.o=\ng);this.P++;this.b=sjcl.hash.sha256.hash(this.b.concat(e));this.L=new sjcl.cipher.aes(this.b);for(d=0;4>d&&(this.h[d]=this.h[d]+1|0,!this.h[d]);d++);}for(d=0;d<a;d+=4)0===(d+1)%this.ca&&y(this),e=z(this),c.push(e[0],e[1],e[2],e[3]);y(this);return c.slice(0,a)},setDefaultParanoia:function(a,b){if(0===a&&\"Setting paranoia=0 will ruin your security; use it only for testing\"!==b)throw\"Setting paranoia=0 will ruin your security; use it only for testing\";this.M=a},addEntropy:function(a,b,c){c=c||\"user\";\nvar d,e,g=(new Date).valueOf(),f=this.H[c],h=this.isReady(),l=0;d=this.U[c];void 0===d&&(d=this.U[c]=this.ha++);void 0===f&&(f=this.H[c]=0);this.H[c]=(this.H[c]+1)%this.c.length;switch(typeof a){case \"number\":void 0===b&&(b=1);this.c[f].update([d,this.N++,1,b,g,1,a|0]);break;case \"object\":c=Object.prototype.toString.call(a);if(\"[object Uint32Array]\"===c){e=[];for(c=0;c<a.length;c++)e.push(a[c]);a=e}else for(\"[object Array]\"!==c&&(l=1),c=0;c<a.length&&!l;c++)\"number\"!==typeof a[c]&&(l=1);if(!l){if(void 0===\nb)for(c=b=0;c<a.length;c++)for(e=a[c];0<e;)b++,e=e>>>1;this.c[f].update([d,this.N++,2,b,g,a.length].concat(a))}break;case \"string\":void 0===b&&(b=a.length);this.c[f].update([d,this.N++,3,b,g,a.length]);this.c[f].update(a);break;default:l=1}if(l)throw new sjcl.exception.bug(\"random: addEntropy only supports number, array of numbers or string\");this.m[f]+=b;this.f+=b;h===this.u&&(this.isReady()!==this.u&&A(\"seeded\",Math.max(this.o,this.f)),A(\"progress\",this.getProgress()))},isReady:function(a){a=this.T[void 0!==\na?a:this.M];return this.o&&this.o>=a?this.m[0]>this.ba&&(new Date).valueOf()>this.Z?this.J|this.I:this.I:this.f>=a?this.J|this.u:this.u},getProgress:function(a){a=this.T[a?a:this.M];return this.o>=a?1:this.f>a?1:this.f/a},startCollectors:function(){if(!this.D){this.a={loadTimeCollector:B(this,this.ma),mouseCollector:B(this,this.oa),keyboardCollector:B(this,this.la),accelerometerCollector:B(this,this.ea),touchCollector:B(this,this.qa)};if(window.addEventListener)window.addEventListener(\"load\",this.a.loadTimeCollector,\n!1),window.addEventListener(\"mousemove\",this.a.mouseCollector,!1),window.addEventListener(\"keypress\",this.a.keyboardCollector,!1),window.addEventListener(\"devicemotion\",this.a.accelerometerCollector,!1),window.addEventListener(\"touchmove\",this.a.touchCollector,!1);else if(document.attachEvent)document.attachEvent(\"onload\",this.a.loadTimeCollector),document.attachEvent(\"onmousemove\",this.a.mouseCollector),document.attachEvent(\"keypress\",this.a.keyboardCollector);else throw new sjcl.exception.bug(\"can't attach event\");\nthis.D=!0}},stopCollectors:function(){this.D&&(window.removeEventListener?(window.removeEventListener(\"load\",this.a.loadTimeCollector,!1),window.removeEventListener(\"mousemove\",this.a.mouseCollector,!1),window.removeEventListener(\"keypress\",this.a.keyboardCollector,!1),window.removeEventListener(\"devicemotion\",this.a.accelerometerCollector,!1),window.removeEventListener(\"touchmove\",this.a.touchCollector,!1)):document.detachEvent&&(document.detachEvent(\"onload\",this.a.loadTimeCollector),document.detachEvent(\"onmousemove\",\nthis.a.mouseCollector),document.detachEvent(\"keypress\",this.a.keyboardCollector)),this.D=!1)},addEventListener:function(a,b){this.K[a][this.ga++]=b},removeEventListener:function(a,b){var c,d,e=this.K[a],g=[];for(d in e)e.hasOwnProperty(d)&&e[d]===b&&g.push(d);for(c=0;c<g.length;c++)d=g[c],delete e[d]},la:function(){C(1)},oa:function(a){var b,c;try{b=a.x||a.clientX||a.offsetX||0,c=a.y||a.clientY||a.offsetY||0}catch(d){c=b=0}0!=b&&0!=c&&sjcl.random.addEntropy([b,c],2,\"mouse\");C(0)},qa:function(a){a=\na.touches[0]||a.changedTouches[0];sjcl.random.addEntropy([a.pageX||a.clientX,a.pageY||a.clientY],1,\"touch\");C(0)},ma:function(){C(2)},ea:function(a){a=a.accelerationIncludingGravity.x||a.accelerationIncludingGravity.y||a.accelerationIncludingGravity.z;if(window.orientation){var b=window.orientation;\"number\"===typeof b&&sjcl.random.addEntropy(b,1,\"accelerometer\")}a&&sjcl.random.addEntropy(a,2,\"accelerometer\");C(0)}};
2\nfunction A(a,b){var c,d=sjcl.random.K[a],e=[];for(c in d)d.hasOwnProperty(c)&&e.push(d[c]);for(c=0;c<e.length;c++)e[c](b)}function C(a){\"undefined\"!==typeof window&&window.performance&&\"function\"===typeof window.performance.now?sjcl.random.addEntropy(window.performance.now(),a,\"loadtime\"):sjcl.random.addEntropy((new Date).valueOf(),a,\"loadtime\")}function y(a){a.b=z(a).concat(z(a));a.L=new sjcl.cipher.aes(a.b)}\nfunction z(a){for(var b=0;4>b&&(a.h[b]=a.h[b]+1|0,!a.h[b]);b++);return a.L.encrypt(a.h)}function B(a,b){return function(){b.apply(a,arguments)}}sjcl.random=new sjcl.prng(6);\na:try{var D,E,F,G;if(G=\"undefined\"!==typeof module&&module.exports){var H;try{H=require(\"crypto\")}catch(a){H=null}G=E=H}if(G&&E.randomBytes)D=E.randomBytes(128),D=new Uint32Array((new Uint8Array(D)).buffer),sjcl.random.addEntropy(D,1024,\"crypto['randomBytes']\");else if(\"undefined\"!==typeof window&&\"undefined\"!==typeof Uint32Array){F=new Uint32Array(32);if(window.crypto&&window.crypto.getRandomValues)window.crypto.getRandomValues(F);else if(window.msCrypto&&window.msCrypto.getRandomValues)window.msCrypto.getRandomValues(F);\nelse break a;sjcl.random.addEntropy(F,1024,\"crypto['getRandomValues']\")}}catch(a){\"undefined\"!==typeof window&&window.console&&(console.log(\"There was an error collecting entropy from the browser:\"),console.log(a))}\nsjcl.json={defaults:{v:1,iter:1E3,ks:128,ts:64,mode:\"ccm\",adata:\"\",cipher:\"aes\"},ja:function(a,b,c,d){c=c||{};d=d||{};var e=sjcl.json,g=e.g({iv:sjcl.random.randomWords(4,0)},e.defaults),f;e.g(g,c);c=g.adata;\"string\"===typeof g.salt&&(g.salt=sjcl.codec.base64.toBits(g.salt));\"string\"===typeof g.iv&&(g.iv=sjcl.codec.base64.toBits(g.iv));if(!sjcl.mode[g.mode]||!sjcl.cipher[g.cipher]||\"string\"===typeof a&&100>=g.iter||64!==g.ts&&96!==g.ts&&128!==g.ts||128!==g.ks&&192!==g.ks&&0x100!==g.ks||2>g.iv.length||\n4<g.iv.length)throw new sjcl.exception.invalid(\"json encrypt: invalid parameters\");\"string\"===typeof a?(f=sjcl.misc.cachedPbkdf2(a,g),a=f.key.slice(0,g.ks/32),g.salt=f.salt):sjcl.ecc&&a instanceof sjcl.ecc.elGamal.publicKey&&(f=a.kem(),g.kemtag=f.tag,a=f.key.slice(0,g.ks/32));\"string\"===typeof b&&(b=sjcl.codec.utf8String.toBits(b));\"string\"===typeof c&&(g.adata=c=sjcl.codec.utf8String.toBits(c));f=new sjcl.cipher[g.cipher](a);e.g(d,g);d.key=a;g.ct=\"ccm\"===g.mode&&sjcl.arrayBuffer&&sjcl.arrayBuffer.ccm&&\nb instanceof ArrayBuffer?sjcl.arrayBuffer.ccm.encrypt(f,b,g.iv,c,g.ts):sjcl.mode[g.mode].encrypt(f,b,g.iv,c,g.ts);return g},encrypt:function(a,b,c,d){var e=sjcl.json,g=e.ja.apply(e,arguments);return e.encode(g)},ia:function(a,b,c,d){c=c||{};d=d||{};var e=sjcl.json;b=e.g(e.g(e.g({},e.defaults),b),c,!0);var g,f;g=b.adata;\"string\"===typeof b.salt&&(b.salt=sjcl.codec.base64.toBits(b.salt));\"string\"===typeof b.iv&&(b.iv=sjcl.codec.base64.toBits(b.iv));if(!sjcl.mode[b.mode]||!sjcl.cipher[b.cipher]||\"string\"===\ntypeof a&&100>=b.iter||64!==b.ts&&96!==b.ts&&128!==b.ts||128!==b.ks&&192!==b.ks&&0x100!==b.ks||!b.iv||2>b.iv.length||4<b.iv.length)throw new sjcl.exception.invalid(\"json decrypt: invalid parameters\");\"string\"===typeof a?(f=sjcl.misc.cachedPbkdf2(a,b),a=f.key.slice(0,b.ks/32),b.salt=f.salt):sjcl.ecc&&a instanceof sjcl.ecc.elGamal.secretKey&&(a=a.unkem(sjcl.codec.base64.toBits(b.kemtag)).slice(0,b.ks/32));\"string\"===typeof g&&(g=sjcl.codec.utf8String.toBits(g));f=new sjcl.cipher[b.cipher](a);g=\"ccm\"===\nb.mode&&sjcl.arrayBuffer&&sjcl.arrayBuffer.ccm&&b.ct instanceof ArrayBuffer?sjcl.arrayBuffer.ccm.decrypt(f,b.ct,b.iv,b.tag,g,b.ts):sjcl.mode[b.mode].decrypt(f,b.ct,b.iv,g,b.ts);e.g(d,b);d.key=a;return 1===c.raw?g:sjcl.codec.utf8String.fromBits(g)},decrypt:function(a,b,c,d){var e=sjcl.json;return e.ia(a,e.decode(b),c,d)},encode:function(a){var b,c=\"{\",d=\"\";for(b in a)if(a.hasOwnProperty(b)){if(!b.match(/^[a-z0-9]+$/i))throw new sjcl.exception.invalid(\"json encode: invalid property name\");c+=d+'\"'+\nb+'\":';d=\",\";switch(typeof a[b]){case \"number\":case \"boolean\":c+=a[b];break;case \"string\":c+='\"'+escape(a[b])+'\"';break;case \"object\":c+='\"'+sjcl.codec.base64.fromBits(a[b],0)+'\"';break;default:throw new sjcl.exception.bug(\"json encode: unsupported type\");}}return c+\"}\"},decode:function(a){a=a.replace(/\\s/g,\"\");if(!a.match(/^\\{.*\\}$/))throw new sjcl.exception.invalid(\"json decode: this isn't json!\");a=a.replace(/^\\{|\\}$/g,\"\").split(/,/);var b={},c,d;for(c=0;c<a.length;
2c++){if(!(d=a[c].match(/^\\s*(?:([\"']?)([a-z][a-z0-9]*)\\1)\\s*:\\s*(?:(-?\\d+)|\"([a-z0-9+\\/%*_.@=\\-]*)\"|(true|false))$/i)))throw new sjcl.exception.invalid(\"json decode: this isn't json!\");\nnull!=d[3]?b[d[2]]=parseInt(d[3],10):null!=d[4]?b[d[2]]=d[2].match(/^(ct|adata|salt|iv)$/)?sjcl.codec.base64.toBits(d[4]):unescape(d[4]):null!=d[5]&&(b[d[2]]=\"true\"===d[5])}return b},g:function(a,b,c){void 0===a&&(a={});if(void 0===b)return a;for(var d in b)if(b.hasOwnProperty(d)){if(c&&void 0!==a[d]&&a[d]!==b[d])throw new sjcl.exception.invalid(\"required parameter overridden\");a[d]=b[d]}return a},sa:function(a,b){var c={},d;for(d in a)a.hasOwnProperty(d)&&a[d]!==b[d]&&(c[d]=a[d]);return c},ra:function(a,\nb){var c={},d;for(d=0;d<b.length;d++)void 0!==a[b[d]]&&(c[b[d]]=a[b[d]]);return c}};sjcl.encrypt=sjcl.json.encrypt;sjcl.decrypt=sjcl.json.decrypt;sjcl.misc.pa={};sjcl.misc.cachedPbkdf2=function(a,b){var c=sjcl.misc.pa,d;b=b||{};d=b.iter||1E3;c=c[a]=c[a]||{};d=c[d]=c[d]||{firstSalt:b.salt&&b.salt.length?b.salt.slice(0):sjcl.random.randomWords(2,0)};c=void 0===b.salt?d.firstSalt:b.salt;d[c]=d[c]||sjcl.misc.pbkdf2(a,c,b.iter);return{key:d[c].slice(0),salt:c.slice(0)}};\n","Amazon_Payment/js/model/amazonPaymentConfig.js":"/**\n * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\").\n * You may not use this file except in compliance with the License.\n * A copy of the License is located at\n *\n *  http://aws.amazon.com/apache2.0\n *\n * or in the \"license\" file accompanying this file. This file is distributed\n * on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either\n * express or implied. See the License for the specific language governing\n * permissions and limitations under the License.\n */\ndefine(\n    ['uiRegistry'],\n    function (registry) {\n        'use strict';\n\n        var config = registry.get('amazonPayment') || {};\n\n        return {\n            /**\n             * Get config value\n             */\n            getValue: function (key, defaultValue) {\n                if (config.hasOwnProperty(key)) {\n                    return config[key];\n                } else if (defaultValue !== undefined) {\n                    return defaultValue;\n                }\n            },\n\n            /**\n             * Is amazonPayment defined?\n             */\n            isDefined: function () {\n                return registry.get('amazonPayment') !== undefined;\n            }\n        };\n    }\n);\n","Amazon_Payment/js/model/place-order-mixin.js":"/**\n * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\").\n * You may not use this file except in compliance with the License.\n * A copy of the License is located at\n *\n * http://aws.amazon.com/apache2.0\n *\n * or in the \"license\" file accompanying this file. This file is distributed\n * on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either\n * express or implied. See the License for the specific language governing\n * permissions and limitations under the License.\n */\n/*jshint browser:true jquery:true*/\n/*global alert*/\ndefine([\n    'jquery',\n    'mage/utils/wrapper',\n    'Magento_CheckoutAgreements/js/model/agreements-assigner'\n], function ($, wrapper, agreementsAssigner) {\n    'use strict';\n\n    return function (placeOrderAction) {\n\n        /** Override default place order action and add agreement_ids to request */\n        return wrapper.wrap(placeOrderAction, function (originalAction, paymentData,\n            redirectOnSuccess, messageContainer) {\n\n            agreementsAssigner(paymentData);\n\n            return originalAction(paymentData, redirectOnSuccess, messageContainer);\n        });\n    };\n});\n","Amazon_Payment/js/model/storage.js":"/**\n * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\").\n * You may not use this file except in compliance with the License.\n * A copy of the License is located at\n *\n *  http://aws.amazon.com/apache2.0\n *\n * or in the \"license\" file accompanying this file. This file is distributed\n * on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either\n * express or implied. See the License for the specific language governing\n * permissions and limitations under the License.\n */\n\ndefine(\n    [\n        'jquery',\n        'ko',\n        'amazonCore',\n        'amazonPaymentConfig'\n    ],\n    function (\n        $,\n        ko,\n        amazonCore,\n        amazonPaymentConfig\n    ) {\n        'use strict';\n\n        var isAmazonAccountLoggedIn = ko.observable(false),\n            isAmazonEnabled = ko.observable(amazonPaymentConfig.getValue('isPwaEnabled')),\n            orderReference,\n            addressConsentToken = amazonCore.accessToken,\n            //eslint-disable-next-line no-use-before-define\n            isAmazonDefined = amazonCore.amazonDefined.subscribe(checkAmazonDefined),\n            //eslint-disable-next-line no-use-before-define\n            amazonLoginError = amazonCore.amazonLoginError.
2subscribe(setAmazonLoggedOutIfLoginError),\n            amazonDeclineCode = ko.observable(false),\n            sandboxSimulationReference = ko.observable('default'),\n            isPlaceOrderDisabled = ko.observable(false),\n            isShippingMethodsLoading = ko.observable(false),\n            isAmazonShippingAddressSelected = ko.observable(false),\n            isQuoteDirty = ko.observable(amazonPaymentConfig.getValue('isQuoteDirty')),\n            isPwaVisible = ko.computed(function () {\n                return isAmazonEnabled() && !isQuoteDirty();\n            }),\n            isAmazonCartInValid = ko.computed(function () {\n                return isAmazonAccountLoggedIn() && isQuoteDirty();\n            }),\n            isLoginRedirectPage = $('body').hasClass('amazon-login-login-processauthhash');\n\n        /**\n         * Subscribes to amazonDefined observable which runs when amazon object becomes available\n         * @param {String} amazonDefined\n         */\n        function checkAmazonDefined(amazonDefined) {\n            if (amazonDefined && !isLoginRedirectPage) {\n                verifyAmazonLoggedIn(); //eslint-disable-line no-use-before-define\n                //remove subscription to amazonDefined once loaded\n                isAmazonDefined.dispose();\n            }\n        }\n\n        /**\n         * Log out amazon user\n         */\n        function amazonLogOut() {\n            if (amazonCore.amazonDefined()) {\n                amazon.Login.logout(); // eslint-disable-line no-undef\n            }\n            this.isAmazonAccountLoggedIn(false);\n        }\n\n        /**\n         * Set login error if logged out\n         */\n        function setAmazonLoggedOutIfLoginError(isLoggedOut) {\n            if (isLoggedOut === true) {\n                isAmazonAccountLoggedIn(false);\n                amazonLoginError.dispose();\n            }\n        }\n\n        /** if Amazon cart contents are invalid log user out **/\n        isAmazonCartInValid.subscribe(function (isCartInValid) {\n            if (isCartInValid) {\n                amazonLogOut();\n            }\n        });\n\n        //run this on loading storage model. If not defined subscribe will trigger when true\n        checkAmazonDefined(amazonCore.amazonDefined());\n        setAmazonLoggedOutIfLoginError(amazonCore.amazonLoginError());\n\n        /**\n         * Verifies amazon user is logged in\n         */\n        function verifyAmazonLoggedIn() {\n            amazonCore.verifyAmazonLoggedIn().then(function (response) {\n                if (!amazonCore.amazonLoginError()) {\n                    isAmazonAccountLoggedIn(response);\n                }\n            });\n        }\n\n        return {\n            isAmazonAccountLoggedIn: isAmazonAccountLoggedIn,\n            isAmazonEnabled: isAmazonEnabled,\n            amazonDeclineCode: amazonDeclineCode,\n            sandboxSimulationReference: sandboxSimulationReference,\n            isPlaceOrderDisabled: isPlaceOrderDisabled,\n            isShippingMethodsLoading: isShippingMethodsLoading,\n            isAmazonShippingAddressSelected: isAmazonShippingAddressSelected,\n            isQuoteDirty: isQuoteDirty,\n            isPwaVisible: isPwaVisible,\n            amazonlogOut: amazonLogOut,\n\n            /**\n             * Set order reference\n             */\n            setOrderReference: function (or) {\n                orderReference = or;\n            },\n\n            /**\n             * Get order reference\n             */\n            getOrderReference: function () {\n                return orderReference;\n            },\n\n            /**\n             * Get address consent token\n             */\n            getAddressConsentToken: function () {\n                return addressConsentToken();\n            }\n        };\n    }\n);\n","Amazon_Payment/js/view/checkout-button.js":"/*global define*/\n\ndefine(\n    [\n        'jquery',\n        'uiComponent',\n        'ko',\n        'Magento_Customer/js/model/customer',\n        'Amazon_Payment/js/model/storage'\n    ],\n    function (\n        $,\n        Component,\n        ko,\n        customer,\n        amazonStorage\n    ) {\n        'use strict';\n\n        return Component.extend(\n            {\n                defaults: {\n                    template: 'Amazon_Payment/checkout-button'\n                },\n                isCustomerLoggedIn: customer.isLoggedIn,\n                isAmazonAccountLoggedIn: amazonStorage.
2isAmazonAccountLoggedIn,\n                isPwaVisible: amazonStorage.isPwaVisible,\n\n                /**\n                 * Init\n                 */\n                initialize: function () {\n                    this._super();\n                }\n            }\n        );\n    }\n);\n\n","Amazon_Payment/js/view/checkout-revert.js":"/*global define*/\ndefine(\n    [\n        'jquery',\n        'underscore',\n        'ko',\n        'uiComponent',\n        'Amazon_Payment/js/model/storage',\n        'mage/storage',\n        'Magento_Checkout/js/model/error-processor',\n        'Magento_Checkout/js/model/url-builder',\n        'Magento_Checkout/js/model/full-screen-loader',\n        'uiRegistry'\n    ],\n    function (\n        $,\n        _,\n        ko,\n        Component,\n        amazonStorage,\n        storage,\n        errorProcessor,\n        urlBuilder,\n        fullScreenLoader,\n        registry\n    ) {\n        'use strict';\n\n        return Component.extend({\n            defaults: {\n                template: 'Amazon_Payment/checkout-revert'\n            }
2,\n            isAmazonAccountLoggedIn: amazonStorage.isAmazonAccountLoggedIn,\n            isAmazonEnabled: ko.observable(registry.get('amazonPayment').isPwaEnabled),\n\n            /**\n             * Init\n             */\n            initialize: function () {\n                this._super();\n            },\n\n            /**\n             * Revert checkout\n             */\n            revertCheckout: function () {\n                var serviceUrl = urlBuilder.createUrl('/amazon/order-ref', {});\n\n                fullScreenLoader.startLoader();\n                storage.delete(\n                    serviceUrl\n                ).done(\n                    function () {\n                        amazonStorage.amazonlogOut();\n                        window.location.reload();\n                    }\n                ).fail(\n                    function (response) {\n                        fullScreenLoader.stopLoader();\n                        errorProcessor.process(response);\n                    }\n                );\n            }\n        });\n    }\n);\n","Amazon_Payment/js/view/checkout-sandbox-simulator.js":"/*global define*/\n\ndefine(\n    [\n        'jquery',\n        'uiComponent',\n        'ko',\n        'Amazon_Payment/js/model/storage',\n        'uiRegistry'\n    ],\n    function (\n        $,\n        Component,\n        ko,\n        amazonStorage,\n        registry\n    ) {\n        'use strict';\n\n        return Component.extend({\n            defaults: {\n                template: 'Amazon_Payment/checkout-sandbox-simulator'\n            }
2,\n            isAmazonAccountLoggedIn: amazonStorage.isAmazonAccountLoggedIn,\n            isSandboxEnabled: ko.observable(registry.get('amazonPayment').isSandboxEnabled),\n            sandboxSimulationReference: amazonStorage.sandboxSimulationReference,\n            sandboxSimulationOptions: ko.observableArray(registry.get('amazonPayment').sandboxSimulationOptions),\n\n            /**\n             * Init\n             */\n            initialize: function () {\n                this._super();\n            }\n        });\n    }\n);\n","Amazon_Payment/js/view/checkout-widget-address.js":"/*global define*/\n\ndefine(\n    [\n        'jquery',\n        'uiComponent',\n        'ko',\n        'Magento_Customer/js/model/customer',\n        'Magento_Checkout/js/model/quote',\n        'Magento_Checkout/js/action/select-shipping-address',\n        'Magento_Checkout/js/model/shipping-rate-processor/new-address',\n        'Magento_Checkout/js/action/set-shipping-information',\n        'Amazon_Payment/js/model/storage',\n        'Magento_Checkout/js/model/shipping-service',\n        'Magento_Checkout/js/model/address-converter',\n        'mage/storage',\n        'Magento_Checkout/js/model/full-screen-loader',\n        'Magento_Checkout/js/model/error-processor',\n        'Magento_Checkout/js/model/url-builder',\n        'Magento_Checkout/js/checkout-data',\n        'Magento_Checkout/js/model/checkout-data-resolver',\n        'uiRegistry'\n    ],\n    function (\n        $,\n        Component,\n        ko,\n        customer,\n        quote,\n        selectShippingAddress,\n        shippingProcessor,\n        setShippingInformationAction,\n        amazonStorage,\n        shippingService,\n        addressConverter,\n        storage,\n        fullScreenLoader,\n        errorProcessor,\n        urlBuilder,\n        checkoutData,\n        checkoutDataResolver,\n        registry\n    ) {\n        'use strict';\n\n        var self;\n\n        return Component.extend({\n            defaults: {\n                template: 'Amazon_Payment/checkout-widget-address'\n            },\n            options: {\n                sellerId: registry.get('amazonPayment').merchantId,\n                addressWidgetDOMId: 'addressBookWidgetDiv',\n                widgetScope: registry.get('amazonPayment').loginScope\n            },\n            isCustomerLoggedIn: customer.isLoggedIn,\n            isAmazonAccountLoggedIn: amazonStorage.
2isAmazonAccountLoggedIn,\n            isAmazonEnabled: ko.observable(registry.get('amazonPayment').isPwaEnabled),\n            rates: shippingService.getShippingRates(),\n\n            /**\n             * Init\n             */\n            initialize: function () {\n                self = this;\n                this._super();\n            },\n\n            /**\n             * Call when component template is rendered\n             */\n            initAddressWidget: function () {\n                self.renderAddressWidget();\n            },\n\n            /**\n             * render Amazon address Widget\n             */\n            renderAddressWidget: function () {\n                new OffAmazonPayments.Widgets.AddressBook({ // eslint-disable-line no-undef\n                    sellerId: self.options.sellerId,\n                    scope: self.options.widgetScope,\n\n                    /**\n                     * Order reference creation callback\n                     */\n                    onOrderReferenceCreate: function (orderReference) {\n                        var orderid = orderReference.getAmazonOrderReferenceId();\n\n                        amazonStorage.setOrderReference(orderid);\n                    },\n\n                    /**\n                     * Address select callback\n                     */\n                    onAddressSelect: function () { // orderReference\n                        self.getShippingAddressFromAmazon();\n                    },\n                    design: {\n                        designMode: 'responsive'\n                    },\n\n                    /**\n                     * Error callback\n                     */\n                    onError: function (error) {\n                        console.log(error);\n                    }\n                }).bind(self.options.addressWidgetDOMId);\n            },\n\n            /**\n             * Get shipping address from Amazon API\n             */\n            getShippingAddressFromAmazon: function () {\n                var serviceUrl, payload;
2\n\n                amazonStorage.isShippingMethodsLoading(true);\n                shippingService.isLoading(true);\n                serviceUrl = urlBuilder.createUrl('/amazon-shipping-address/:amazonOrderReference', {\n                    amazonOrderReference: amazonStorage.getOrderReference()\n                }),\n                    payload = {\n                        addressConsentToken: amazonStorage.getAddressConsentToken()\n                    };\n\n                storage.put(\n                    serviceUrl,\n                    JSON.stringify(payload)\n                ).done(\n                    function (data) {\n                        var amazonAddress = data.shift(),\n                            addressData = addressConverter.formAddressDataToQuoteAddress(amazonAddress),\n                            i;\n\n                        //if telephone is blank set it to 00000000 so it passes the required validation\n                        addressData.telephone = !addressData.telephone ? '0000000000' : addressData.telephone;\n\n                        //fill in blank street fields\n                        if ($.isArray(addressData.street)) {\n                            for (i = addressData.street.length; i <= 2; i++) {\n                                addressData.street[i] = '';\n                            }\n                        }\n                        checkoutData.setShippingAddressFromData(\n                            addressConverter.quoteAddressToFormAddressData(addressData)\n                        );\n                        checkoutDataResolver.resolveEstimationAddress();\n                    }\n                ).fail(\n                    function (response) {\n                        errorProcessor.process(response);\n                        //remove shipping loader and set shipping rates to 0 on a fail\n                        shippingService.setShippingRates([]);
2\n                        amazonStorage.isShippingMethodsLoading(false);\n                    }\n                );\n            },\n\n            /**\n             * Get Amazon Order Reference ID\n             */\n            getAmazonOrderReference: function () {\n                return amazonStorage.getOrderReference();\n            },\n\n            /**\n             * Get Amazon Address Consent Token\n             */\n            getAddressConsentToken: function () {\n                return amazonStorage.getAddressConsentToken();\n            }\n        });\n    }\n);\n","Amazon_Payment/js/view/notification.js":"/*global define*/\ndefine(\n    [\n        'jquery',\n        'underscore',\n        'ko',\n        'uiComponent',\n        'Amazon_Payment/js/model/storage',\n        'uiRegistry'\n    ],\n    function (\n        $,\n        _,\n        ko,\n        Component,\n        amazonStorage,\n        registry\n    ) {\n        'use strict';\n\n        return Component.extend(\n            {\n                defaults: {\n                    template: 'Amazon_Payment/notification'\n                }
2,\n                isAmazonAccountLoggedIn: amazonStorage.isAmazonAccountLoggedIn,\n                chargeOnOrder: ko.observable(registry.get('amazonPayment').chargeOnOrder),\n                isEuPaymentRegion: ko.observable(registry.get('amazonPayment').isEuPaymentRegion),\n\n                /**\n                 * Init\n                 */\n                initialize: function () {\n                    this._super();\n                }\n            }\n        );\n    }\n);\n","Amazon_Payment/js/view/shipping.js":"/*global define*/\ndefine(\n    [\n        'jquery',\n        'underscore',\n        'ko',\n        'Magento_Checkout/js/view/shipping',\n        'Magento_Customer/js/model/customer',\n        'Magento_Checkout/js/action/set-shipping-information',\n        'Magento_Checkout/js/model/step-navigator',\n        'Amazon_Payment/js/model/storage'\n    ],\n    function (\n        $,\n        _,\n        ko,\n        Component,\n        customer,\n        setShippingInformationAction,\n        stepNavigator,\n        amazonStorage\n    ) {\n        'use strict';\n\n        return Component.extend({\n\n            /**\n             * Initialize shipping\n             */\n            initialize: function () {\n                this._super();
2\n                this.isNewAddressAdded(amazonStorage.isAmazonAccountLoggedIn());\n                amazonStorage.isAmazonAccountLoggedIn.subscribe(function (value) {\n                    this.isNewAddressAdded(value);\n                }, this);\n\n                return this;\n            },\n\n            /**\n             * Validate guest email\n             */\n            validateGuestEmail: function () {\n                var loginFormSelector = 'form[data-role=email-with-possible-login]';\n\n                $(loginFormSelector).validation();\n\n                return $(loginFormSelector + ' input[type=email]').valid();\n            },\n\n            /**\n             * New setShipping Action for Amazon Pay to bypass validation\n             */\n            setShippingInformation: function () {\n\n                /**\n                 * Set Amazon shipping info\n                 */\n                function setShippingInformationAmazon() {\n                    setShippingInformationAction().done(\n                        function () {\n                            stepNavigator.next();\n                        }\n                    );\n                }
2\n\n                if (amazonStorage.isAmazonAccountLoggedIn() && customer.isLoggedIn()) {\n                    setShippingInformationAmazon();\n                } else if (amazonStorage.isAmazonAccountLoggedIn() && !customer.isLoggedIn()) {\n\n                    if (this.validateGuestEmail()) {\n                        setShippingInformationAmazon();\n                    }\n                    //if using guest checkout or guest checkout with amazon pay we need to use the main validation\n                } else if (this.validateShippingInformation()) {\n                    setShippingInformationAmazon();\n                }\n            }\n        });\n    }\n);\n","Amazon_Payment/js/view/form/element/email.js":"define([\n    'jquery',\n    'Magento_Checkout/js/view/form/element/email',\n    'Magento_Customer/js/customer-data',\n    'Magento_Checkout/js/model/quote',\n    'Magento_Checkout/js/checkout-data',\n    'mage/validation'\n], function ($, Component, customerData, quote, checkoutData) {\n    'use strict';\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: 'Amazon_Payment/form/element/email'\n        },\n\n        /**\n         * Init email validator\n         */\n        initialize: function () {\n            this._super();\n\n            if (this.email()) {\n\n                if ($.validator.methods['validate-email'].call(this, this.email())) {\n                    quote.guestEmail = this.email();\n                    checkoutData.setValidatedEmailValue(this.email());\n                }\n                checkoutData.setInputFieldEmailValue(this.email());\n            }\n\n            return this;\n        }\n    });\n});\n","Amazon_Payment/js/view/payment/amazon-pay.js":"define([\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: 'amazon_payment',\n            component: 'Amazon_Payment/js/view/payment/method-renderer/amazon-payment-widget'\n        }\n    );\n\n    /** Add view logic here if needed */\n    return Component.extend({});\n});\n","Amazon_Payment/js/view/payment/amazonlogin.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: 'amazonlogin',\n                component: 'Amazon_Payment/js/view/payment/method-renderer/amazonlogin'\n            }\n        );\n\n    // Add view logic here if needed\n\n        return Component.extend({});\n    }\n);\n","Amazon_Payment/js/view/payment/list.js":"define([\n    'jquery',\n    'underscore',\n    'ko',\n    'Magento_Checkout/js/view/payment/list',\n    'Magento_Checkout/js/model/payment/method-list',\n    'Magento_Checkout/js/model/checkout-data-resolver',\n    'Magento_Checkout/js/model/address-converter',\n    'Magento_Checkout/js/model/quote',\n    'Amazon_Payment/js/action/populate-shipping-address',\n    'Amazon_Payment/js/model/storage'\n\n], function (\n    $,\n    _,\n    ko,\n    Component,\n    paymentMethods,\n    checkoutDataResolver,\n    addressConverter,\n    quote,\n    populateShippingAddress,\n    amazonStorage\n) {\n    'use strict';\n\n    var self;\n\n    return Component.extend({\n        /**\n         * Initialize view.\n         *\n         * @returns {Component} Chainable.\n         */\n        initialize: function () {\n\n            self = this;\n            this._hidePaymentMethodsOnLoad(); //hide methods on load\n\n            //subscribe to payment methods to remove other payment methods from render list\n            paymentMethods.subscribe(function (changes) {\n                checkoutDataResolver.resolvePaymentMethod();\n                //remove renderer for \"deleted\" payment methods\n                _.each(changes, function (change) {\n                    if (this._shouldRemovePaymentMethod(change.value.method)) {\n                        this.removeRenderer(change.value.method);\n                        change.status = 'deleted';\n                    }\n                }, this);\n            }, this, 'arrayChange');\n\n            this._setupDeclineHandler();\n            this._super();\n\n            return this;\n        }
2,\n\n        /**\n         * Check if a payment method is applicable with Amazon Pay\n         * @param {String} method\n         * @returns {Boolean}\n         * @private\n         */\n        _shouldRemovePaymentMethod: function (method) {\n            return amazonStorage.isAmazonAccountLoggedIn() && method !== 'amazon_payment' && method !== 'free';\n        },\n\n        /**\n         * handle decline codes\n         * @private\n         */\n        _setupDeclineHandler: function () {\n            amazonStorage.amazonDeclineCode.subscribe(function (declined) {\n                switch (declined) {\n                    //hard decline\n                    case 4273:\n                        //populate shipping form\n                        populateShippingAddress();\n                        amazonStorage.amazonlogOut();\n                        this._reloadPaymentMethods();\n                        amazonStorage.amazonDeclineCode(false);\n                        break;\n                    //soft decline\n                    case 7638:\n                        amazonStorage.
2isPlaceOrderDisabled(true);\n                        this._reInitializeAmazonWalletWidget();\n                        this._hideEditableOptions();\n                        amazonStorage.amazonDeclineCode(false);\n                        break;\n                    default:\n                        amazonStorage.amazonDeclineCode(false);\n                        break;\n                }\n            }, this);\n        },\n\n        /**\n         * When payment methods exist on load hook into widget render to remove when widget has rendered\n         * @private\n         */\n        _hidePaymentMethodsOnLoad: function () {\n            if (paymentMethods().length > 0) {\n                //if the payment methods are already set\n                $(document).on('rendered', '#amazon_payment', function () {\n                    _.each(paymentMethods(), function (payment) {\n                        if (this._shouldRemovePaymentMethod(payment.method)) {\n                            this.removeRenderer(payment.method);\n                        }\n                    }, self);\n                });\n            }\n        },\n\n        /**\n         * reload payment methods on decline\n         * @private\n         */\n        _reloadPaymentMethods: function () {\n            _.each(paymentMethods(), function (paymentMethodData) {\n                if (paymentMethodData.method === 'amazon_payment' && !amazonStorage.
2isAmazonAccountLoggedIn()) {\n                    this.removeRenderer(paymentMethodData.method);\n                } else {\n                    this.createRenderer(paymentMethodData);\n                }\n            }, this);\n        },\n\n        /**\n         * re-intialises Amazon wallet widget\n         * @private\n         */\n        _reInitializeAmazonWalletWidget: function () {\n            var child = this.getChild('amazon_payment');\n\n            if (child) {\n                child.renderPaymentWidget();\n            }\n        },\n\n        /**\n         * hides editable content and links to prevent unexptect behaviour\n         * @private\n         */\n        _hideEditableOptions: function () {\n            $('.payment-option.discount-code', '#payment').remove();\n            $('.action-edit', '.shipping-information').remove();\n            $('.opc-progress-bar-item._complete', '.opc-progress-bar').addClass('lock-step');\n        }\n    });\n});\n","Amazon_Payment/js/view/payment/method-renderer/amazon-payment-widget.js":"define(\n    [\n        'jquery',\n        'Magento_Checkout/js/view/payment/default',\n        'ko',\n        'Magento_Customer/js/model/customer',\n        'Magento_Customer/js/customer-data',\n        'Magento_Checkout/js/model/quote',\n        'Amazon_Payment/js/model/storage',\n        'mage/storage',\n        'Magento_Checkout/js/model/full-screen-loader',\n        'Amazon_Payment/js/action/place-order',\n        'Magento_Checkout/js/action/get-totals',\n        'Magento_Checkout/js/model/error-processor',\n        'Magento_Checkout/js/model/address-converter',\n        'Magento_Checkout/js/action/select-billing-address',\n        'Magento_Checkout/js/model/payment/additional-validators',\n        'Magento_Checkout/js/model/url-builder',\n        'amazonPaymentConfig',\n        'uiRegistry'\n    ],\n    function (\n        $,\n        Component,\n        ko,\n        customer,\n        customerData,\n        quote,\n        amazonStorage,\n        storage,\n        fullScreenLoader,\n        placeOrderAction,\n        getTotalsAction,\n        errorProcessor,\n        addressConverter,\n        selectBillingAddress,\n        additionalValidators,\n        urlBuilder,\n        amazonPaymentConfig,\n        registry\n    ) {\n        'use strict';\n\n        var self,\n            countryData = customerData.get('directory-data');\n\n        return Component.extend({\n            defaults: {\n                template: 'Amazon_Payment/payment/amazon-payment-widget'\n            },\n            options: {\n                sellerId: registry.get('amazonPayment').merchantId,\n                paymentWidgetDOMId: 'walletWidgetDiv',\n                widgetScope: registry.get('amazonPayment').loginScope\n            },\n            isCustomerLoggedIn: customer.isLoggedIn,\n            isAmazonAccountLoggedIn: amazonStorage.
2isAmazonAccountLoggedIn,\n            isPwaVisible: amazonStorage.isPwaVisible,\n            shippingAddress: quote.shippingAddress,\n            billingAddress: quote.billingAddress,\n            isPlaceOrderDisabled: amazonStorage.isPlaceOrderDisabled,\n\n            /**\n             * Inits\n             */\n            initialize: function () {\n                self = this;\n                this._super();\n            },\n\n            /**\n             * Init payment widget\n             */\n            initPaymentWidget: function () {\n                var $amazonPayment = $('#amazon_payment');\n\n                self.renderPaymentWidget();\n                $amazonPayment.trigger('click'); //activate Amazon Pay method on render\n                $amazonPayment.trigger('rendered');\n            },\n\n            /**\n             * render Amazon Pay Widget\n             */\n            renderPaymentWidget: function () {\n                new OffAmazonPayments.Widgets.Wallet({ // eslint-disable-line no-undef\n                    sellerId: self.options.sellerId,\n                    scope: self.options.widgetScope,\n                    amazonOrderReferenceId: amazonStorage.getOrderReference(),\n\n                    /**\n                     * Payment select callback\n                     */\n                    onPaymentSelect: function () { // orderReference\n                        amazonStorage.
2isPlaceOrderDisabled(true);\n                        self.setBillingAddressFromAmazon();\n                    },\n                    design: {\n                        designMode: 'responsive'\n                    },\n\n                    /**\n                     * Error callback\n                     */\n                    onError: function (error) {\n                        errorProcessor.process(error);\n                    }\n                }).bind(self.options.paymentWidgetDOMId);\n            },\n\n            /**\n             * Return payment code\n             */\n            getCode: function () {\n                return 'amazon_payment';\n            },\n\n            /**\n             * Is widget active?\n             */\n            isActive: function () {\n                return true;\n            },\n\n            /**\n             * Return country name\n             */\n            getCountryName: function (countryId) {\n                return countryData()[countryId] !== undefined ? countryData()[countryId].name : '';\n            },\n\n            /**\n             * Check if country name set\n             */\n            checkCountryName: function (countryId) {\n                return countryData()[countryId] !== undefined;\n            },\n\n            /**\n             * Save billing address\n             */\n            setBillingAddressFromAmazon: function () {\n                var serviceUrl = urlBuilder.createUrl('/amazon-billing-address/:amazonOrderReference', {\n                        amazonOrderReference: amazonStorage.getOrderReference()\n                    }),\n                    payload = {\n                        addressConsentToken: amazonStorage.getAddressConsentToken()\n                    };\n\n                fullScreenLoader.startLoader();\n\n                storage.put(\n                    serviceUrl,\n                    JSON.stringify(payload)\n                ).done(\n                    function (data) {\
2n                        var amazonAddress = data.shift(), addressData;\n\n                        addressData = addressConverter.formAddressDataToQuoteAddress(amazonAddress);\n                        addressData.telephone = !addressData.telephone ? '0000000000' : addressData.telephone;\n\n                        selectBillingAddress(addressData);\n                        amazonStorage.isPlaceOrderDisabled(false);\n\n                        if(window.checkoutConfig.amazonLogin.amazon_customer_email) {\n                            var customerField = $('#customer-email').val();\n\n                            if (!customerField) {\n                                $('#customer-email').val(window.checkoutConfig.amazonLogin.amazon_customer_email);\n                            }\n                        }\n                    }\n                ).fail(\n                    function (response) {\n                        errorProcessor.process(response);\n                    }\n                ).always(\n                    function () {\n                        fullScreenLoader.stopLoader();\n                    }\n                );\n            },\n\n            /**\n             * Return Magento billing object\n             */\n            getData: function () {\n                return {\n                    'method': this.item.method,\n                    'additional_data': {\n                        'sandbox_simulation_reference': amazonStorage.sandboxSimulationReference()\n                    }\n                };\n            },\n\n            /**\n             * Save order\n             */\n            placeOrder: function (data, event) {\n                var placeOrder;\n\n                self = this;\n\n                if (event) {\n                    event.preventDefault();\n                }\n\n                if (this.validate() && additionalValidators.validate()) {\n                    this.isPlaceOrderActionAllowed(false);\n                    placeOrder = placeOrderAction(this.getData(), this.redirectAfterPlaceOrder);\n\n                    $.when(placeOrder).fail(function () {\n                        self.isPlaceOrderActionAllowed(true);\n                    }).done(this.afterPlaceOrder.bind(this));\n\n                    return true;\n                }\n\n                return false;\n            }\n        });\n    }\n);\n","Amazon_Payment/js/view/payment/method-renderer/amazonlogin.js":"define(\n    [\n        'jquery',\n        'Magento_Checkout/js/view/payment/default',\n        'ko',\n        'Amazon_Payment/js/model/storage',\n        'mage/storage',\n        'amazonPaymentConfig',\n        'uiRegistry',\n        'Amazon_Login/js/view/login-button'\n    ],\n    function (\n        $,\n        Component,\n        ko,\n        amazonStorage,\n        storage,\n        amazonPaymentConfig,\n        registry,\n        loginButton\n    ) {\n        'use strict';\n\n        var self;\n\n        return Component.extend(\n            {\n                defaults: {\n                    template: 'Amazon_Payment/payment/amazonlogin'\n                },\n                getCode: function () {\n                    return 'amazonlogin';\n                },\n                isActive: function () {\n                    return true;\n                },\n                isPwaVisible: function () {\n                    return amazonStorage.
2isPwaVisible && amazonStorage.isAmazonEnabled;\n                }\n            }\n        );\n    }\n);\n","Amazon_Payment/js/view/shipping-address/inline-form.js":"define([\n    'uiComponent',\n    'ko',\n    'Amazon_Payment/js/model/storage'\n], function (Component, ko, amazonStorage) {\n    'use strict';\n\n    return Component.extend({\n        defaults: {\n            template: 'Amazon_Payment/shipping-address/inline-form',\n            formSelector: 'co-shipping-form'\n        },\n\n        /**\n         * Init inline form\n         */\n        initObservable: function () {\n            this._super();\n            amazonStorage.isAmazonAccountLoggedIn.subscribe(function (value) {\n                var elem = document.getElementById(this.formSelector);\n\n                if (elem && value === false) {\n                    document.getElementById(this.formSelector).style.display = 'block';\n                }\n            }, this);\n\n            return this;\n        },\n\n        /**\n         * Show/hide inline form\n         */\n        manipulateInlineForm: function () {\n            var elem;
2\n\n            if (amazonStorage.isAmazonAccountLoggedIn()) {\n                elem = document.getElementById(this.formSelector);\n\n                if (elem) {\n                    document.getElementById(this.formSelector).style.display = 'none';\n                }\n            }\n        }\n    });\n});\n","Amazon_Payment/js/view/shipping-address/list.js":"define([\n    'Magento_Checkout/js/view/shipping-address/list',\n    'Magento_Customer/js/model/address-list',\n    'Amazon_Payment/js/model/storage',\n    'ko'\n], function (Component, addressList, amazonStorage, ko) {\n    'use strict';\n\n    return Component.extend({\n        /**\n         * Init address list\n         */\n        initObservable: function () {\n            this._super();\n            this.visible = ko.computed(function () {\n                return addressList().length > 0 && !amazonStorage.isAmazonAccountLoggedIn();\n            });\n\n            return this;\n        }\n    });\n});\n","Klarna_Kp/js/action/override.js":"/**\n * This file is part of the Klarna KP module\n *\n * (c) Klarna Bank AB (publ)\n *\n * For the full copyright and license information, please view the NOTICE\n * and LICENSE files that were distributed with this source code.\n */\n/*jshint browser:true jquery:true*/\n/*global alert*/\ndefine([\n  'mage/utils/wrapper',\n  'Klarna_Kp/js/model/config',\n  'Magento_Checkout/js/model/full-screen-loader'\n], function (wrapper, config, loader) {\n  'use strict';\n\n  /**\n   * This is needed to prevent the customer from a race condition between 'Place Order' and adding/removing a coupon,\n   * giftcard, rewards points, etc.. as it affects order totals\n   */\n  return function (overriddenFunction) {\n    return wrapper.wrap(overriddenFunction, function (originalAction) {\n      if (!config.enabled) {\n        return originalAction();\n      }\n      if (config.hasErrors()) {\n        return originalAction();\n      }\n      loader.startLoader();\n      return originalAction().then(function () {\n        loader.stopLoader();\n      });\n    });\n  };\n});\n","Klarna_Kp/js/model/config.js":"/**\n * This file is part of the Klarna KP module\n *\n * (c) Klarna Bank AB (publ)\n *\n * For the full copyright and license information, please view the NOTICE\n * and LICENSE files that were distributed with this source code.\n */\ndefine(\n  [\n    'ko'\n  ],\n  function (ko) {\n    'use strict';\n    var client_token = window.checkoutConfig.payment.klarna_kp.client_token,\n      message = window.checkoutConfig.payment.klarna_kp.message,\n      authorization_token = ko.observable(window.checkoutConfig.payment.klarna_kp.authorization_token),\n      debug = window.checkoutConfig.payment.klarna_kp.debug,\n      enabled = window.checkoutConfig.payment.klarna_kp.enabled,\n      success = window.checkoutConfig.payment.klarna_kp.success,\n      hasErrors = ko.observable(false),\n      available_methods = window.checkoutConfig.payment.klarna_kp.available_methods;\n\n    return {\n      hasErrors: hasErrors,\n      debug: debug,\n      enabled: enabled,\n      client_token: client_token,\n      message: message,\n      success: success,\n      authorization_token: authorization_token,\n      available_methods: available_methods,\n      getTitle: function (code) {\n        if (window.checkoutConfig.payment.klarna_kp[code]) {\n          return window.checkoutConfig.payment.klarna_kp[code].title;\n        }\n        return 'Klarna Payments';\n      },\n      getLogo: function (code) {\n        if (window.checkoutConfig.payment.klarna_kp[code]) {\n          return window.checkoutConfig.payment.klarna_kp[code].logo;\n        }\n        return '';\n      }\n    };\n  }\n);\n","Klarna_Kp/js/model/debug.js":"/**\n * This file is part of the Klarna KP module\n *\n * (c) Klarna Bank AB (publ)\n *\n * For the full copyright and license information, please view the NOTICE\n * and LICENSE files that were distributed with this source code.\n */\ndefine(\n  [\n    'Klarna_Kp/js/model/config'\n  ],\n  function (config) {\n    'use strict';\n    return {\n      log: function (message) {\n        if (config.debug) {\n          console.trace();\n          console.log(message);\n        }\n      },\n      group: function (groupid) {\n        if (config.debug) {\n          console.group(groupid);\n        }\n      },\n      groupEnd: function () {\n        if (config.debug) {\n          console.groupEnd();\n        }\n      },\n      table: function (tabularData, properties) {\n        if (config.debug) {\n          console.trace();\n          console.table(tabularData, properties);\n        }\n      }\n    };\n  }\n);\n","Klarna_Kp/js/model/klarna.js":"/* global Klarna */\n/**\n * This file is part of the Klarna KP module\n *\n * (c) Klarna Bank AB (publ)\n *\n * For the full copyright and license information, please view the NOTICE\n * and LICENSE files that were distributed with this source code.\n */\ndefine(\n  [\n    'jquery',\n    'Magento_Checkout/js/model/quote',\n    'Magento_Customer/js/model/customer',\n    'Klarna_Kp/js/model/config',\n    'Klarna_Kp/js/model/debug',\n    'klarnapi'\n  ],\n  function ($, quote, customer, config, debug) {\n    'use strict';\n    return {\n      buildAddress: function (address, email) {\n        var addr = {\n          'given_name': '',\n          'family_name': '',\n          'street_address': '',\n          'city': '',\n          'postal_code': '',\n          'country': '',\n          'phone': '',\n          'email': email\n        };\n\n        if (!address) { // Somehow we got a null passed in\n          return addr;\n        }\n        if (address.prefix) {\n          addr['title'] = address.prefix;\n        }\n        if (address.firstname) {\n          addr['given_name'] = address.firstname;\n        }\n        if (address.lastname) {\n          addr['family_name'] = address.lastname;\n        }\n        if (address.street) {\n          if (address.street.length >
2 0) {\n            addr['street_address'] = address.street[0];\n          }\n          if (address.street.length > 1) {\n            addr['street_address2'] = address.street[1];\n          }\n        }\n        if (address.city) {\n          addr['city'] = address.city;\n        }\n        if (address.regionCode) {\n          addr['region'] = address.regionCode;\n        }\n        if (address.postcode) {\n          addr['postal_code'] = address.postcode;\n        }\n        if (address.countryId) {\n          addr['country'] = address.countryId;\n        }\n        if (address.telephone) {\n          addr['phone'] = address.telephone;\n        }\n        debug.log(addr);\n        return addr;\n      },\n      getUpdateData: function () {\n        var email = '',\n          shippingAddress = quote.shippingAddress(),\n          data = {\n            'billing_address': {},\n            'shipping_address': {}\n          };\n\n        if (customer.isLoggedIn()) {\n          email = customer.customerData.email;\n        } else {\n          email = quote.guestEmail;\n        }\n        if (quote.isVirtual()) {\n          shippingAddress = quote.billingAddress();\n        }\n        data.billing_address = this.buildAddress(quote.billingAddress(), email);\n        data.shipping_address = this.buildAddress(shippingAddress, email);\n        debug.log(data);\n        return data;\n      },\n      load: function (payment_method, container_id, callback) {\n        var data = null;\n\n        debug.log('Loading container ' + container_id);\n        if ($('#' + container_id).length) {\n          debug.log('Loading method ' + payment_method);\n          data = this.getUpdateData();\n          Klarna.Payments.load(\n            {\n              payment_method_category: payment_method,\n              container: \"#\" + container_id\n            },\n            data,\n            function (res) {\n              var errors = false;\n\n              debug.log(res);\n              if (res.errors) {\n                errors = true;\n              }\n              config.hasErrors(errors);\n              if (callback) {\n                callback(res);\n              }\n            }\n          );\n        }\n      },\n      init: function () {\n        Klarna.Payments.init({\n          client_token: config.client_token\n        });\n      },\n      authorize: function (payment_method, data, callback) {\n        Klarna.Payments.authorize(\n          {\n            payment_method_category: payment_method\n          },\n          data,\n          function (res) {\n            var errors = false;\n\n            debug.log(res);\n            if (true === res.approved) {\n              config.authorization_token(res.authorization_token);\n            }\n            if (res.errors) {\n              errors = true;\n            }\n            config.hasErrors(errors);\n            callback(res);\n          }\n        );\n      },\n      finalize: function (payment_method, data, callback) {\n        Klarna.Payments.finalize(\n          {\n            payment_method_category: payment_method\n          },\n          data,\n          function (res) {\n            var errors = false;\n\n            debug.log(res);\n            if (true === res.approved) {\n              config.authorization_token(res.authorization_token);\n            }\n            if (res.errors) {\n              errors = true;\n            }\n            config.hasErrors(errors);\n            callback(res);\n          }\n        );\n      }\n    };\n  }\n);\n","Klarna_Kp/js/view/payments.js":"/**\n * This file is part of the Klarna KP module\n *\n * (c) Klarna Bank AB (publ)\n *\n * For the full copyright and license information, please view the NOTICE\n * and LICENSE files that were distributed with this source code.\n */\ndefine(\n  [\n    'underscore',\n    'uiComponent',\n    'Magento_Checkout/js/model/payment/renderer-list',\n    'Klarna_Kp/js/model/config'\n  ],\n  function (_,\n            Component,\n            rendererList,\n            config) {\n    'use strict';\n    if (config.available_methods && _.isArray(config.available_methods)) {\n      config.available_methods.forEach(function (value) {\n        rendererList.push(value);\n      });\n    }\n    // Add view logic here if needed\n    return Component.extend({});\n  }\n);\n","Klarna_Kp/js/view/payments/kp.js":"/**\n * This file is part of the Klarna KP module\n *\n * (c) Klarna Bank AB (publ)\n *\n * For the full copyright and license information, please view the NOTICE\n * and LICENSE files that were distributed with this source code.\n */\ndefine(\n  [\n    'ko',\n    'jquery',\n    'mage/translate',\n    'Magento_Checkout/js/view/payment/default',\n    'Magento_Checkout/js/model/full-screen-loader',\n    'Magento_Checkout/js/action/set-payment-information',\n    'Klarna_Kp/js/model/config',\n    'Klarna_Kp/js/model/klarna',\n    'Magento_Checkout/js/model/quote',\n    'Klarna_Kp/js/view/payments',\n    'Klarna_Kp/js/model/debug'\n  ],\n  function (ko,\n            $,\n            $t,\n            Component,\n            fullScreenLoader,\n            setPaymentInformationAction,\n            config,\n            klarna,\n            quote,\n            kp,\n            debug) {\n    'use strict';\n\n    return Component.extend({\n      defaults: {\n        template: 'Klarna_Kp/payments/kp',\n        timeoutMessage: 'Sorry, but something went wrong. Please contact the seller.'\n      },\n      placeOrderHandler: null,\n      validateHandler: null,\n\n      isVisible: ko.observable(true),\n      isLoading: false,\n      showButton: ko.observable(false),\n\n      checkPreSelect: function() {\
2n        if (this.getCode() === this.isChecked()) {\n          this.isLoading = false;\n          this.loadKlarna();\n        }\n      },\n\n      getLogoUrl: function() {\n        return config.getLogo(this.getCategoryId());\n      },\n\n      /**\n       * @param {Object} handler\n       */\n      setPlaceOrderHandler: function (handler) {\n        this.placeOrderHandler = handler;\n      },\n\n      /**\n       * @param {Object} handler\n       */\n      setValidateHandler: function (handler) {\n        this.validateHandler = handler;\n      },\n\n      /**\n       * @returns {Object}\n       */\n      context: function () {\n        return this;\n      },\n\n      /**\n       * @returns {Boolean}\n       */\n      isShowLegend: function () {\n        return true;\n      },\n\n      getTitle: function () {\n        return config.getTitle(this.getCategoryId());\n      },\n\n      /**\n       * Get data\n       * @returns {Object}\n       */\n      getData: function () {\n        return {\n          'method': this.item.method,\n          'additional_data': {\n            'method_title': this.getTitle(),\n            'logo': this.getLogoUrl(),\n            'authorization_token': config.authorization_token()\n          }\n        };\n      },\n\n      getCategoryId: function () {\n        // Strip off \"klarna_\"\n        return this.getCode().substr(7);\n      },\n\n      hasMessage: function () {\n        return config.message !== null || config.client_token === null || config.client_token === '';\n      },\n\n      getMessage: function () {\n        if (config.message !== null) {\n          return config.message;\n        }\n        return $t('An unknown error occurred. Please try another payment method');\n      },\n\n      getClientToken: function () {\n        return config.client_token;\n      },\n\n      getAuthorizationToken: function () {\n        return config.authorization_token();\n      },\n      initialize: function () {\n        var self = this;\n\n        this._super();\n\n        this.showButton(false);\n        if (this.hasMessage()) {\n          // Don't try to initialize Klarna\n          return;\n        }\n        klarna.init();\n        quote.paymentMethod.subscribe(function (value) {\n          self.isLoading = false;\n          if (value && value.method === self.getCode()) {\n            self.loadKlarna();\n          }\n        });\n        config.hasErrors.subscribe(function (value) {\n          self.showButton(value);\n        });\n\n        quote.shippingAddress.subscribe(function () {\n          if (self.getCode() === self.isChecked()) {\n            self.loadKlarna();\n          }\n        });\n        quote.billingAddress.subscribe(function () {\n          if (self.getCode() === self.isChecked()) {\n            self.loadKlarna();\n          }\n        });\n      },\n      getContainerId: function () {\n        return this.getCode().replace(new RegExp('_', 'g'), '-') + '-container';\n      },\n      selectPaymentMethod: function () {\n        this.isLoading = false;\n        this.loadKlarna();\n        return this._super();\n      },\n      loadKlarna: function () {\n        var self = this;\n\n        if (self.isLoading) {\n          return false;\n        }\n        self.isLoading = true;\n        try {\n          klarna.load(self.getCategoryId(), self.getContainerId(), function (res) {\n            debug.log(res);\n            self.showButton(res.show_form);\n            self.isLoading = false;\n          });\n          return true;\n        } catch (e) {\n          debug.log(e);\n          self.isLoading = false;\n          return false;\n        }\n      },\n      authorize: function () {\n        var self = this;\n\n        self.showButton(false);\n        if (this.hasMessage()) {\n          return;\n        }\n        klarna.authorize(self.getCategoryId(), klarna.getUpdateData(), function (res) {\n          debug.log(res);\n          if (res.approved) {\n            if (res.finalize_required) {\n              self.finalize();\n              return;\n            }\n            self.placeOrder();\n          }\n\n          if (res.show_form === false) {\n            self.showButton(false);\n          } else {\n            self.showButton(true);\n          }\n\n        });\n      },\n      finalize: function () {\n        var self = this;\n\n        if (this.hasMessage()) {\n          self.showButton(false);\n          return;\n        }
2\n        klarna.finalize(self.getCategoryId(), klarna.getUpdateData(), function (res) {\n          debug.log(res);\n          if (res.approved) {\n            self.placeOrder();\n          }\n          self.showButton(true);\n        });\n\n      }\n    });\n  }\n);\n","Vertex_Tax/js/model/set-checkout-messages.js":"/**\n * @copyright  Vertex. All rights reserved.  https://www.vertexinc.com/\n * @author     Mediotype                     https://www.mediotype.com/\n */\n\ndefine(\n    [\n        'underscore',\n        'Magento_Customer/js/customer-data',\n        'Magento_Ui/js/model/messageList'\n    ],\n    function(_, customerData, messageContainer) {\n        /**\n         * A utility for observing message updates in session storage. It is designed to subscribe to\n         * customer data updates and forward messages to the appropriate messageList model.\n         */\n        return function() {\n            var typeMap = {\n                'success'   : 'addSuccessMessage',\n                'warning'   : 'addErrorMessage',\n                'error'     : 'addErrorMessage'\n            };\n\n            /**\n             * Observe message section data changes and forward to the error processor.\n             * @param Object data The observable payload.\n             * @return void\n             */\n            var messageSubscriptionCallback = function(data) {\n                if ('messages' in data) {\n                    _.each(data.messages, function(message) {\n                        if (message.type in typeMap) {\n                            messageContainer[typeMap[message.type]]({\n                                'message': message.text\n                            });\n                        }\n                    });\n                }\n            };\n\n            customerData.get('messages').subscribe(messageSubscriptionCallback);\n        };\n    }\n);\n","Dotdigitalgroup_Email/js/emailCapture.js":"define(['jquery', 'domReady!'], function ($) {\n    'use strict';\n\n    /**\n     * Email validation\n     * @param {String} sEmail\n     * @returns {Boolean}\n     */\n    function validateEmail(sEmail) {\n        var filter\n            = /^([\\w-\\.]+)@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.)|(([\\w-]+\\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\\]?)$/;\n\n        return filter.test(sEmail);\n    }\n\n    /**\n     * Email capture for checkout\n     * @param {String} url\n     *\n     */\n    function emailCaptureCheckout(url) {\n        var previousEmail = '';\n        \n        $('body').on('blur', 'input[id=customer-email]', function () {\n            var email = $(this).val();\n\n            if (email === previousEmail) {\n                return false;\n            }\n\n            if (email && validateEmail(email)) {\n                previousEmail = email;\n                $.post(url, {\n                    email: email\n                });\n            }\n        });\n    }\n\n    /**\n     * Email capture for newsletter field\n     * @param {String} url\n     */\n    function emailCaptureNewsletter(url) {\n        $('input[id=newsletter]').each(function (index, element) {\n            // Observe onblur event on element\n            $(element).on('blur', function () {\n                var email = $(element).val();\n\n                if (email && validateEmail(email)) {\n                    $.post(url, {\n                        email: email\n                    });\n                }\n            });\n        });\n    }\n\n    /**\n     * Exported/return email capture\n     * @param {Object} emailCapture\n     */\n    return function (emailCapture) {\n        if (emailCapture.type === 'checkout') {\n            emailCaptureCheckout(emailCapture.url);\n        }\n\n        if (emailCapture.type === 'newsletter') {\n            emailCaptureNewsletter(emailCapture.url);\n        }\n    };\n});\n","Dotdigitalgroup_Email/js/newsletterPreferences.js":"require([\n    'jquery',\n    'mage/calendar',\n    'domReady!'\n    ], function ($) {\n    'use strict';\n\n    $('.date-field').each(function () {\n        $(this).calendar({\n            showTime: false\n        });\n    });\n});\n","Dotdigitalgroup_Email/js/roiCode.js":"define(['dmmpt', 'domReady!'], function () {\n    'use strict';\n\n    /**\n     * ROI\n     * @param {Array} items\n     * @param {Float} total\n     */\n    function init(items, total) {\n        var fLen = items.length,\n            i = 0;\n\n        for (i; i < fLen;
2 i++) {\n            window._dmTrack('product', items[i]);\n        }\n        window._dmTrack('CheckOutAmount', total);\n        window._dmCallHandler();\n    }\n\n    /**\n     * Export/return tracking code init\n     * @param {Object} roiCode\n     */\n    return function (roiCode) {\n        init(roiCode.items, roiCode.total);\n    };\n});\n\n"}
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.