PageSourceSearch

https://www.cm-pesoregua.pt/assets/wm-smile/javascripts/frontoffice/widgets-common-38bb6c60a0.min.js

js cm-pesoregua.pt collected 2026-09-24 21:17:51 UTC 69,632 bytes, 56 lines download raw bytes

vendor: 11,568 bytes, lines 1-9
1/*!
2* tabbable 6.4.0
3* @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
4*/(function(o,e){typeof exports=="object"&&typeof module<"u"?e(exports):typeof define=="function"&&define.amd?define(["exports"],e):(o=typeof globalThis<"u"?globalThis:o||self,(function(){var t=o.tabbable,n=o.tabbable={};e(n),n.noConflict=function(){return o.tabbable=t,n}})())})(this,(function(o){"use strict";var e=["input:not([inert]):not([inert] *)","select:not([inert]):not([inert] *)","textarea:not([inert]):not([inert] *)","a[href]:not([inert]):not([inert] *)","button:not([inert]):not([inert] *)","[tabindex]:not(slot):not([inert]):not([inert] *)","audio[controls]:not([inert]):not([inert] *)","video[controls]:not([inert]):not([inert] *)",'[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)',"details>summary:first-of-type:not([inert]):not([inert] *)","details:not([inert]):not([inert] *)"],t=e.join(","),n=typeof Element>"u",i=n?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,s=!n&&Element.prototype.getRootNode?function(N){var a;return N==null||(a=N.getRootNode)===null||a===void 0?void 0:a.call(N)}:function(N){return N?.ownerDocument},l=function(a,r){var c;r===void 0&&(r=!0);var m=a==null||(c=a.getAttribute)===null||c===void 0?void 0:c.call(a,"inert"),A=m===""||m==="true",I=A||r&&a&&(typeof a.closest=="function"?a.closest("[inert]"):l(a.parentNode));return I},h=function(a){var r,c=a==null||(r=a.getAttribute)===null||r===void 0?void 0:r.call(a,"contenteditable");return c===""||c==="true"},v=function(a,r,c){if(l(a))return[];var m=Array.prototype.slice.apply(a.querySelectorAll(t));return r&&i.call(a,t)&&m.unshift(a),m=m.filter(c),m},f=function(a,r,c){for(var m=[],A=Array.from(a);A.length;){var I=A.shift();if(!l(I,!1))if(I.tagName==="SLOT"){var G=I.assignedElements(),H=G.length?G:I.children,U=f(H,!0,c);c.flatten?m.push.apply(m,U):m.push({scopeParent:I,candidates:U})}else{var ie=i.call(I,t);ie&&c.filter(I)&&(r||!a.includes(I))&&m.push(I);var Z=I.shadowRoot||typeof c.getShadowRoot=="function"&&c.getShadowRoot(I),ce=!l(Z,!1)&&(!c.shadowRootFilter||c.shadowRootFilter(I));if(Z&&ce){var le=f(Z===!0?I.children:Z.children,!0,c);c.flatten?m.push.apply(m,le):m.push({scopeParent:I,candidates:le})}else A.unshift.apply(A,I.children)}}return m},x=function(a){return!isNaN(parseInt(a.getAttribute("tabindex"),10))},T=function(a){if(!a)throw new Error("No node provided");return a.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(a.tagName)||h(a))&&!x(a)?0:a.tabIndex},y=function(a,r){var c=T(a);return c<0&&r&&!x(a)?0:c},u=function(a,r){return a.tabIndex===r.tabIndex?a.documentOrder-r.documentOrder:a.tabIndex-r.tabIndex},k=function(a){return a.tagName==="INPUT"},O=function(a){return k(a)&&a.type==="hidden"},F=function(a){var r=a.tagName==="DETAILS"&&Array.prototype.slice.apply(a.children).some(function(c){return c.tagName==="SUMMARY"});return r},K=function(a,r){for(var c=0;c<a.length;c++)if(a[c].checked&&a[c].form===r)return a[c]},z=function(a){if(!a.name)return!0;var r=a.form||s(a),c=function(G){return r.querySelectorAll('input[type="radio"][name="'+G+'"]')},m;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")m=c(window.CSS.escape(a.name));else try{m=c(a.name)}catch(I){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",I.message),!1}var A=K(m,a.form);return!A||A===a},te=function(a){return k(a)&&a.type==="radio"},J=function(a){return te(a)&&!z(a)},Q=function(a){var r,c=a&&s(a),m=(r=c)===null||r===void 0?void 0:r.host,A=!1;if(c&&c!==a){var I,G,H;for(A=!!((I=m)!==null&&I!==void 0&&(G=I.ownerDocument)!==null&&G!==void 0&&G.contains(m)||a!=null&&(H=a.ownerDocument)!==null&&H!==void 0&&H.contains(a));!A&&m;){var U,ie,Z;c=s(m),m=(U=c)===null||U===void 0?void 0:U.host,A=!!((ie=m)!==null&&ie!==void 0&&(Z=ie.ownerDocument)!==null&&Z!==void 0&&Z.contains(m))}}return A},ae=function(a){var r=a.getBoundingClientRect(),c=r.width,m=r.height;return c===0&&m===0},se=function(a,r){var c=r.displayCheck,m=r.getShadowRoot;if(c==="full-native"&&"checkVisibility"in a){var A=a.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});return!A}if(getComputedStyle(a).visibility==="hidden")return!0;var I=i.call(a,"details>summary:first-of-type"),G=I?a.parentElement:a;if(i.call(G,"details:not([open]) *"))return!0;if(!c||c==="full"||c==="full-native"||c==="legacy-full"){if(typeof m=="function"){for(var H=a;a;){var U=a.parentElement,ie=s(a);if(U&&!U.shadowRoot&&m(U)===!0)return ae(a);a.assignedSlot?a=a.assignedSlot:!U&&ie!==a.ownerDocument?a=ie.host:a=U}a=H}if(Q(a))return!a.getClientRects().length;if(c!=="legacy-full")return!0}else if(c==="non-zero-area")return ae(a);return!1},X=function(a){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(a.tagName))for(var r=a.parentElement;r;){if(r.tagName==="FIELDSET"&&r.disabled){for(var c=0;c<r.children.length;c++){var m=r.children.item(c);if(m.tagName==="LEGEND")return i.call(r,"fieldset[disabled] *")?!0:!m.contains(a)}return!0}r=r.parentElement}return!1},w=function(a,r){return!(r.disabled||O(r)||se(r,a)||F(r)||X(r))},b=function(a,r){return!(J(r)||T(r)<0||!w(a,r))},D=function(a){var r=parseInt(a.getAttribute("tabindex"),10);return!!(isNaN(r)||r>=0)},E=function(a){var r=[],c=[];return a.forEach(function(m,A){var I=!!m.scopeParent,G=I?m.scopeParent:m,H=y(G,I),U=I?E(m.candidates):G;H===0?I?r.push.apply(r,U):r.push(G):c.push({documentOrder:A,tabIndex:H,item:m,isScope:I,content:U})}),c.sort(u).reduce(function(m,A){return A.isScope?m.push.apply(m,A.content):m.push(A.content),m},[]).concat(r)},Y=function(a,r){r=r||{};var c;return r.getShadowRoot?c=f([a],r.includeContainer,{filter:b.bind(null,r),flatten:!1,getShadowRoot:r.getShadowRoot,shadowRootFilter:D}):c=v(a,r.includeContainer,b.bind(null,r)),E(c)},C=function(a,r){r=r||{};var c;return r.getShadowRoot?c=f([a],r.includeContainer,{filter:w.bind(null,r),flatten:!0,getShadowRoot:r.getShadowRoot}):c=v(a,r.includeContainer,w.bind(null,r)),c},g=function(a,r){if(r=r||{},!a)throw new Error("No node provided");return i.call(a,t)===!1?!1:b(r,a)},q=e.concat("iframe:not([inert]):not([inert] *)").join(","),W=function(a,r){if(r=r||{},!a)throw new Error("No node provided");return i.call(a,q)===!1?!1:w(r,a)};o.focusable=C,o.getTabIndex=T,o.isFocusable=W,o.isTabbable=g,o.tabbable=Y}));/*!
5* focus-trap 7.8.0
6* @license MIT, https://github.com/focus-trap/focus-trap/blob/master/LICENSE
7*/(function(o,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("tabbable")):typeof define=="function"&&define.amd?define(["exports","tabbable"],e):(o=typeof globalThis<"u"?globalThis:o||self,(function(){var t=o.focusTrap,n=o.focusTrap={};e(n,o.tabbable),n.noConflict=function(){return o.focusTrap=t,n}})())})(this,(function(o,e){"use strict";function t(w,b){(b==null||b>w.length)&&(b=w.length);for(var D=0,E=Array(b);D<b;D++)E[D]=w[D];return E}function n(w){if(Array.isArray(w))return t(w)}function i(w,b){var D=typeof Symbol<"u"&&w[Symbol.iterator]||w["@@iterator"];if(!D){if(Array.isArray(w)||(D=u(w))||b){D&&(w=D);var E=0,Y=function(){};return{s:Y,n:function(){return E>=w.length?{done:!0}:{done:!1,value:w[E++]}},e:function(W){throw W},f:Y}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
8In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var C,g=!0,q=!1;return{s:function(){D=D.call(w)},n:function(){var W=D.next();return g=W.done,W},e:function(W){q=!0,C=W},f:function(){try{g||D.return==null||D.return()}finally{if(q)throw C}}}}function s(w,b,D){return(b=y(b))in w?Object.defineProperty(w,b,{value:D,enumerable:!0,configurable:!0,writable:!0}):w[b]=D,w}function l(w){if(typeof Symbol<"u"&&w[Symbol.iterator]!=null||w["@@iterator"]!=null)return Array.from(w)}function h(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
9In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function v(w,b){var D=Object.keys(w);if(Object.getOwnPropertySymbols){var E=Object.getOwnPropertySymbols(w);b&&(E=E.filter(function(Y){return Object.getOwnPropertyDescriptor(w,Y).enumerable})),D.push.apply(D,E)}return D}function f(w){for(var b=1;b<arguments.length;b++){var D=arguments[b]!=null?arguments[b]:{};b%2?v(Object(D),!0).forEach(function(E){s(w,E,D[E])}):Object.getOwnPropertyDescriptors?Object.defineProperties(w,Object.getOwnPropertyDescriptors(D)):v(Object(D)).forEach(function(E){Object.defineProperty(w,E,Object.getOwnPropertyDescriptor(D,E))})}return w}function x(w){return n(w)||l(w)||u(w)||h()}function T(w,b){if(typeof w!="object"||!w)return w;var D=w[Symbol.toPrimitive];if(D!==void 0){var E=D.call(w,b);if(typeof E!="object")return E;throw new TypeError("@@toPrimitive must return a primitive value.")}return(b==="string"?String:Number)(w)}function y(w){var b=T(w,"string");return typeof b=="symbol"?b:b+""}function u(w,b){if(w){if(typeof w=="string")return t(w,b);var D={}.toString.call(w).slice(8,-1);return D==="Object"&&w.constructor&&(D=w.constructor.name),D==="Map"||D==="Set"?Array.from(w):D==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(D)?t(w,b):void 0}}var k={getActiveTrap:function(b){return b?.length>0?b[b.length-1]:null},activateTrap:function(b,D){var E=k.getActiveTrap(b);D!==E&&k.pauseTrap(b);var Y=b.indexOf(D);Y===-1||b.splice(Y,1),b.push(D)},deactivateTrap:function(b,D){var E=b.indexOf(D);E!==-1&&b.splice(E,1),k.unpauseTrap(b)},pauseTrap:function(b){var D=k.getActiveTrap(b);D?._setPausedState(!0)},unpauseTrap:function(b){var D=k.getActiveTrap(b);D&&!D._isManuallyPaused()&&D._setPausedState(!1)}},O=function(b){return b.tagName&&b.tagName.toLowerCase()==="input"&&typeof b.select=="function"},F=function(b){return b?.key==="Escape"||b?.key==="Esc"||b?.keyCode===27},K=function(b){return b?.key==="Tab"||b?.keyCode===9},z=function(b){return K(b)&&!b.shiftKey},te=function(b){return K(b)&&b.shiftKey},J=function(b){return setTimeout(b,0)},Q=function(b){for(var D=arguments.length,E=new Array(D>1?D-1:0),Y=1;Y<D;Y++)E[Y-1]=arguments[Y];return typeof b=="function"?b.apply(void 0,E):b},ae=function(b){return b.target.shadowRoot&&typeof b.composedPath=="function"?b.composedPath()[0]:b.target},se=[],X=function(b,D){var E=D?.document||document,Y=D?.trapStack||se,C=f({returnFocusOnDeactivate:!0,escapeDeactivates:!0,delayInitialFocus:!0,isolateSubtrees:!1,isKeyForward:z,isKeyBackward:te},D),g={containers:[],containerGroups:[],tabbableGroups:[],adjacentElements:new Set,alreadySilent:new Set,nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:!1,paused:!1,manuallyPaused:!1,delayInitialFocusTimer:void 0,recentNavEvent:void 0},q,W=function(d,p,S){return d&&d[p]!==void 0?d[p]:C[S||p]},N=function(d,p){var S=typeof p?.composedPath=="function"?p.composedPath():void 0;return g.containerGroups.findIndex(function(P){var L=P.container,M=P.tabbableNodes;return L.contains(d)||S?.includes(L)||M.find(function(_){return _===d})})},a=function(d){var p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},S=p.hasFallback,P=S===void 0?!1:S,L=p.params,M=L===void 0?[]:L,_=C[d];if(typeof _=="function"&&(_=_.apply(void 0,x(M))),_===!0&&(_=void 0),!_){if(_===void 0||_===!1)return _;throw new Error("`".concat(d,"` was specified but was not a node, or did not return a node"))}var R=_;if(typeof _=="string"){try{R=E.querySelector(_)}catch(j){throw new Error("`".concat(d,'` appears to be an invali
9d selector; error="').concat(j.message,'"'))}if(!R&&!P)throw new Error("`".concat(d,"` as selector refers to no known node"))}return R},r=function(){var d=a("initialFocus",{hasFallback:!0});if(d===!1)return!1;if(d===void 0||d&&!e.isFocusable(d,C.tabbableOptions))if(N(E.activeElement)>=0)d=E.activeElement;else{var p=g.tabbableGroups[0],S=p&&p.firstTabbableNode;d=S||a("fallbackFocus")}else d===null&&(d=a("fallbackFocus"));if(!d)throw new Error("Your focus-trap needs to have at least one focusable element");return d},c=function(){if(g.containerGroups=g.containers.map(function(d){var p=e.tabbable(d,C.tabbableOptions),S=e.focusable(d,C.tabbableOptions),P=p.length>0?p[0]:void 0,L=p.length>0?p[p.length-1]:void 0,M=S.find(function(j){return e.isTabbable(j)}),_=S.slice().reverse().find(function(j){return e.isTabbable(j)}),R=!!p.find(function(j){return e.getTabIndex(j)>0});return{container:d,tabbableNodes:p,focusableNodes:S,posTabIndexesFound:R,firstTabbableNode:P,lastTabbableNode:L,firstDomTabbableNode:M,lastDomTabbableNode:_,nextTabbableNode:function(V){var ne=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,ee=p.indexOf(V);return ee<0?ne?S.slice(S.indexOf(V)+1).find(function(oe){return e.isTabbable(oe)}):S.slice(0,S.indexOf(V)).reverse().find(function(oe){return e.isTabbable(oe)}):p[ee+(ne?1:-1)]}}}),g.tabbableGroups=g.containerGroups.filter(function(d){return d.tabbableNodes.length>0}),g.tabbableGroups.length<=0&&!a("fallbackFocus"))throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times");if(g.containerGroups.find(function(d){return d.posTabIndexesFound})&&g.containerGroups.length>1)throw new Error("At least one node with a positive tabindex was found in one of your focus-trap's multiple containers. Positive tabindexes are only supported in single-container focus-traps.")},m=function(d){var p=d.activeElement;if(p)return p.shadowRoot&&p.shadowRoot.activeElement!==null?m(p.shadowRoot):p},A=function(d){if(d!==!1&&d!==m(document)){if(!d||!d.focus){A(r());return}d.focus({preventScroll:!!C.preventScroll}),g.mostRecentlyFocusedNode=d,O(d)&&d.select()}},I=function(d){var p=a("setReturnFocus",{params:[d]});return p||(p===!1?!1:d)},G=function(d){var p=d.target,S=d.event,P=d.isBackward,L=P===void 0?!1:P;p=p||ae(S),c();var M=null;if(g.tabbableGroups.length>0){var _=N(p,S),R=_>=0?g.containerGroups[_]:void 0;if(_<0)L?M=g.tabbableGroups[g.tabbableGroups.length-1].lastTabbableNode:M=g.tabbableGroups[0].firstTabbableNode;else if(L){var j=g.tabbableGroups.findIndex(function(fe){var he=fe.firstTabbableNode;return p===he});if(j<0&&(R.container===p||e.isFocusable(p,C.tabbableOptions)&&!e.isTabbable(p,C.tabbableOptions)&&!R.nextTabbableNode(p,!1))&&(j=_),j>=0){var V=j===0?g.tabbableGroups.length-1:j-1,ne=g.tabbableGroups[V];M=e.getTabIndex(p)>=0?ne.lastTabbableNode:ne.lastDomTabbableNode}else K(S)||(M=R.nextTabbableNode(p,!1))}else{var ee=g.tabbableGroups.findIndex(function(fe){var he=fe.lastTabbableNode;return p===he});if(ee<0&&(R.container===p||e.isFocusable(p,C.tabbableOptions)&&!e.isTabbable(p,C.tabbableOptions)&&!R.nextTabbableNode(p))&&(ee=_),ee>=0){var oe=ee===g.tabbableGroups.length-1?0:ee+1,re=g.tabbableGroups[oe];M=e.getTabIndex(p)>=0?re.firstTabbableNode:re.firstDomTabbableNode}else K(S)||(M=R.nextTabbableNode(p))}}else M=a("fallbackFocus");return M},H=function(d){var p=ae(d);if(!(N(p,d)>=0)){if(Q(C.clickOutsideDeactivates,d)){q.deactivate({returnFocus:C.returnFocusOnDeactivate});return}Q(C.allowOutsideClick,d)||d.preventDefault()}},U=function(d){var p=ae(d),S=N(p,d)>=0;if(S||p instanceof Document)S&&(g.mostRecentlyFocusedNode=p);else{d.stopImmediatePropagation();var P,L=!0;if(g.mostRecentlyFocusedNode)if(e.getTabIndex(g.mostRecentlyFocusedNode)>0){var M=N(g.mostRecentlyFocusedNode),_=g.containerGroups[M].tabbableNodes;if(_.length>0){var R=_.findIndex(function(j){return j===g.mostRecentlyFocusedNode});R>=0&&(C.isKeyForward(g.recentNavEvent)?R+1<_.length&&(P=_[R+1],L=!1):R-1>=0&&(P=_[R-1],L=!1))}}else g.containerGroups.some(function(j){return j.tabbableNodes.some(function(V){return e.getTabIndex(V)>0})})||(L=!1);else L=!1;L&&(P=G({target:g.mostRecentlyFocusedNode,isBackward:C.isKeyBackward(g.recentNavEvent)})),A(P||g.mostRecentlyFocusedNode||r())}g.recentNavEvent=void 0},ie=function(d){var p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;g.recentNavEvent=d;var S=G({event:d,isBackward:p});
vendor: 1,246 bytes, line 9
9S&&(K(d)&&d.preventDefault(),A(S))},Z=function(d){(C.isKeyForward(d)||C.isKeyBackward(d))&&ie(d,C.isKeyBackward(d))},ce=function(d){F(d)&&Q(C.escapeDeactivates,d)!==!1&&(d.preventDefault(),q.deactivate())},le=function(d){var p=ae(d);N(p,d)>=0||Q(C.clickOutsideDeactivates,d)||Q(C.allowOutsideClick,d)||(d.preventDefault(),d.stopImmediatePropagation())},be=function(){if(g.active)return k.activateTrap(Y,q),g.delayInitialFocusTimer=C.delayInitialFocus?J(function(){A(r())}):A(r()),E.addEventListener("focusin",U,!0),E.addEventListener("mousedown",H,{capture:!0,passive:!1}),E.addEventListener("touchstart",H,{capture:!0,passive:!1}),E.addEventListener("click",le,{capture:!0,passive:!1}),E.addEventListener("keydown",Z,{capture:!0,passive:!1}),E.addEventListener("keydown",ce),q},ve=function(d){g.active&&!g.paused&&q._setSubtreeIsolation(!1),g.adjacentElements.clear(),g.alreadySilent.clear();var p=new Set,S=new Set,P=i(d),L;try{for(P.s();!(L=P.n()).done;){var M=L.value;p.add(M);for(var _=typeof ShadowRoot<"u"&&M.getRootNode()instanceof ShadowRoot,R=M;R;){p.add(R);var j=R.parentElement,V=[];j?V=j.children:!j&&_&&(V=R.getRootNode().children,j=R.getRootNode().host,_=typeof ShadowRoot<"u"&&j.getRootNode()instanceof ShadowRoot);var ne=i(V),ee;
9try{for(ne.s();!(ee=ne.n()).done;){var oe=ee.value;S.add(oe)}}catch(re){ne.e(re)}finally{ne.f()}R=j}}}catch(re){P.e(re)}finally{P.f()}p.forEach(function(re){S.delete(re)}),g.adjacentElements=S},pe=function(){if(g.active)return E.removeEventListener("focusin",U,!0),E.removeEventListener("mousedown",H,!0),E.removeEventListener("touchstart",H,!0),E.removeEventListener("click",le,!0),E.removeEventListener("keydown",Z,!0),E.removeEventListener("keydown",ce),q},ge=function(d){var p=d.some(function(S){var P=Array.from(S.removedNodes);return P.some(function(L){return L===g.mostRecentlyFocusedNode})});p&&A(r())},de=typeof window<"u"&&"MutationObserver"in window?new MutationObserver(ge):void 0,ue=function(){de&&(de.disconnect(),g.active&&!g.paused&&g.containers.map(function(d){de.observe(d,{subtree:!0,childList:!0})}))};return q={get active(){return g.active},get paused(){return g.paused},activate:function(d){if(g.active)return this;var p=W(d,"onActivate"),S=W(d,"onPostActivate"),P=W(d,"checkCanFocusTrap"),L=k.getActiveTrap(Y),M=!1;if(L&&!L.paused){var _;(_=L._setSubtreeIsolation)===null||_===void 0||_.call(L,!1),M=!0}try{P||c(),g.active=!0,g.paused=!1,g.nodeFocusedBeforeActivation=m(E),p?.();var R=function(){P&&c(),be(),ue(),C.isolateSubtrees&&q._setSubtreeIsolation(!0),S?.()};if(P)return P(g.containers.concat()).then(R,R),this;R()}catch(V){if(L===k.getActiveTrap(Y)&&M){var j;(j=L._setSubtreeIsolation)===null||j===void 0||j.call(L,!0)}throw V}return this},deactivate:function(d){if(!g.active)return this;var p=f({onDeactivate:C.onDeactivate,onPostDeactivate:C.onPostDeactivate,checkCanReturnFocus:C.checkCanReturnFocus},d);clearTimeout(g.delayInitialFocusTimer),g.delayInitialFocusTimer=void 0,g.paused||q._setSubtreeIsolation(!1),g.alreadySilent.clear(),pe(),g.active=!1,g.paused=!1,ue(),k.deactivateTrap(Y,q);var S=W(p,"onDeactivate"),P=W(p,"onPostDeactivate"),L=W(p,"checkCanReturnFocus"),M=W(p,"returnFocus","returnFocusOnDeactivate");S?.();var _=function(){J(function(){M&&A(I(g.nodeFocusedBeforeActivation)),P?.()})};return M&&L?(L(I(g.nodeFocusedBeforeActivation)).then(_,_),this):(_(),this)},pause:function(d){return g.active?(g.manuallyPaused=!0,this._setPausedState(!0,d)):this},unpause:function(d){return g.active?(g.manuallyPaused=!1,Y[Y.length-1]!==this?this:this._setPausedState(!1,d)):this},updateContainerElements:function(d){var p=[].concat(d).filter(Boolean);return g.containers=p.map(function(S){return typeof S=="string"?E.querySelector(S):S}),C.isolateSubtrees&&ve(g.containers),g.active&&(c(),C.isolateSubtrees&&!g.paused&&q._setSubtreeIsolation(!0)),ue(),this}},Object.defineProperties(q,{_isManuallyPaused:{value:function(){return g.manuallyPaused}},_setPausedState:{value:function(d,p){if(g.paused===d)return this;if(g.paused=d,d){var S=W(p,"onPause"),P=W(p,"onPostPause");S?.(),pe(),ue(),q._setSubtreeIsolation(!1),P?.()}else{var L=W(p,"onUnpause"),M=W(p,"onPostUnpause");L?.(),q._setSubtreeIsolation(!0),c(),be(),ue(),M?.()}return this}},_setSubtreeIsolation:{value:function(d){C.isolateSubtrees&&g.adjacentElements.forEach(function(p){var S;if(d)switch(C.isolateSubtrees){case"aria-hidden":(p.ariaHidden==="true"||((S=p.getAttribute("aria-hidden"))===null||S===void 0?void 0:S.toLowerCase())==="true")&&g.alreadySilent.add(p),p.setAttribute("aria-hidden","true");break;default:(p.inert||p.hasAttribute("inert"))&&g.alreadySilent.add(p),p.setAttribute("inert",!0);break}else if(!g.alreadySilent.has(p))switch(C.isolateSubtrees){case"aria-hidden":p.removeAttribute("aria-hidden");break;default:p.removeAttribute("inert");break}})}}}),q.updateContainerElements(b),q};o.createFocusTrap=X}));class AccessibleDatePicker{static VERSION="1.0";static DATEPICKERS=[];#e=[];#t={};static buildFrom(e){if(!e)throw new Error("AccessibleDatePicker requer um objeto de configura\xE7\xE3o com a propriedade alvo.");e.targets.forEach(t=>{let n=e.options||{};typeof t=="string"?t=document.querySelector(t):typeof t=="object"&&(t instanceof HTMLElement||(t.options&&(n=t.options),t=document.querySelector(t.target)));try{this.DATEPICKERS.push(new AccessibleDatePicker({target:t,options:n,id:t?.id||t}))}catch{}})}static buildGlobal(){document.querySelectorAll(".accessible-date-picker").forEach(t=>{t.getAttribute("data-skip-callendar-init")!=="true"&&this.DATEPICKERS.push(new AccessibleDatePicker({target:t,id:t.
9id||t}))})}static getDatePickerById(e){return this.DATEPICKERS.find(t=>t.id===e)}constructor(e){let t=e.target,n=e.options||{};this.id=e.id,this.#e=n.availableDates||[],this.buttonLabelChoose=n.buttonLabelChoose||"Escolher Data",this.buttonLabelChange=n.buttonLabelChange||"Alterar Data",this.buttonLabelCancel=n.buttonLabelCancel||"Cancelar",this.captionLabel=n.captionLabel||"Calend\xE1rio de sele\xE7\xE3o de data",this.previousYearLabel=n.previousYearLabel||"Ano Anterior",this.nextYearLabel=n.nextYearLabel||"Pr\xF3ximo Ano",this.previousMonthLabel=n.previousMonthLabel||"M\xEAs Anterior",this.nextMonthLabel=n.nextMonthLabel||"Pr\xF3ximo M\xEAs",this.dayLabels=n.dayLabels||["domingo","segunda-feira","ter\xE7a-feira","quarta-feira","quinta-feira","sexta-feira","s\xE1bado"],this.monthLabels=n.monthLabels||["janeiro","fevereiro","mar\xE7o","abril","maio","junho","julho","agosto","setembro","outubro","novembro","dezembro"],this.locales=n.locales||{available:"Dispon\xEDvel",unavailable:"Indispon\xEDvel",ariaLabelText:"{{weekday}}, {{day}} de {{month}} de {{year}}"},this.messageCursorKeys=n.messageCursorKeys||"As setinhas s\xE3o usadas para navegar",this.lastMessage="",this.textboxNode=t.querySelector('input[type="text"'),this.appendDatepicker.call(this,this.id,this.textboxNode.id),this.textboxNode.addEventListener("keydown",function(i){[8,9,13,27,46,37,38,39,40].includes(i.keyCode)||(i.ctrlKey||i.metaKey)&&["a","c","v","x"].includes(i.key.toLowerCase())||/[0-9\/]/.test(i.key)||i.preventDefault()}),this.buttonNode=t.querySelector(".group button"),this.dialogNode=t.querySelector('[role="dialog"]'),this.messageNode=this.dialogNode.querySelector(".dialog-message"),this.monthYearNode=this.dialogNode.querySelector(".month-year"),this.prevYearNode=this.dialogNode.querySelector(".prev-year"),this.prevMonthNode=this.dialogNode.querySelector(".prev-month"),this.nextMonthNode=this.dialogNode.querySelector(".next-month"),this.nextYearNode=this.dialogNode.querySelector(".next-year"),this.okButtonNode=this.dialogNode.querySelector('button[value="ok"]'),this.cancelButtonNode=this.dialogNode.querySelector('button[value="cancel"]'),this.tbodyNode=this.dialogNode.querySelector("table.dates tbody"),this.lastRowNode=null,this.days=[],this.focusDay=new Date,this.selectedDay=new Date(0,0,1),this.lastDate=-1,this.isMouseDownOnBackground=!1,this.textboxNode.addEventListener("blur",this.setDateForButtonLabel.bind(this)),this.buttonNode.addEventListener("keydown",this.handleButtonKeydown.bind(this)),this.buttonNode.addEventListener("click",this.handleButtonClick.bind(this)),this.okButtonNode.addEventListener("click",this.handleOkButton.bind(this)),this.okButtonNode.addEventListener("keydown",this.handleOkButton.bind(this)),this.cancelButtonNode.addEventListener("click",this.handleCancelButton.bind(this)),this.cancelButtonNode.addEventListener("keydown",this.handleCancelButton.bind(this)),this.prevMonthNode.addEventListener("click",this.handlePreviousMonthButton.bind(this)),this.nextMonthNode.addEventListener("click",this.handleNextMonthButton.bind(this)),this.prevYearNode.addEventListener("click",this.handlePreviousYearButton.bind(this)),this.nextYearNode.addEventListener("click",this.handleNextYearButton.bind(this)),this.prevMonthNode.addEventListener("keydown",this.handlePreviousMonthButton.bind(this)),this.nextMonthNode.addEventListener("keydown",this.handleNextMonthButton.bind(this)),this.prevYearNode.addEventListener("keydown",this.handlePreviousYearButton.bind(this)),this.nextYearNode.addEventListener("keydown",this.handleNextYearButton.bind(this)),document.body.addEventListener("pointerup",this.handleBackgroundMouseUp.bind(this),!0),this.tbodyNode.innerHTML="";for(let i=0;i<6;i++){const s=this.tbodyNode.insertRow(i);this.lastRowNode=s;for(let l=0;l<7;l++){const h=document.createElement("td");h.tabIndex=-1,h.addEventListener("click",this.handleDayClick.bind(this)),h.addEventListener("keydown",this.handleDayKeyDown.bind(this)),h.addEventListener("focus",this.handleDayFocus.bind(this)),h.textContent="-1",h.role="gridcell",s.appendChild(h),this.days.push(h)}}this.updateGrid(),this.close(!1),this.setDateForButtonLabel(),typeof n.onSelect=="function"&&this.addEventListener("select",n.onSelect),this.textboxNode.value.length>0&&this.triggerEvent("select")}appendDatepicker(e,t=null){const n=document.getElementById(e);if(!n){console.error(`Element with id "${e}" not found.`);return}const s=`
10      <div id="id-datepicker-${t||e}" class="datepicker-dialog" role="dialog" aria-modal="true" aria-label="${this.captionLabel}">
11        <div class="header">
12          <button type="button" class="prev-year" aria-label="${this.previousYearLabel}">
13            <span class="fa-solid fa-angles-left"></span>
14          </button>
15          <button type="button" class="prev-month" aria-label="${this.previousMonthLabel}">
16            <span class="fa-solid fa-angle-left"></span>
17          </button>
18          <h2 id="id-grid-label" class="month-year" aria-live="polite">February 2020</h2>
19          <button type="button" class="next-month" aria-label="${this.nextMonthLabel}">
20            <span class="fa-solid fa-angle-right"></span>
21          </button>
22          <button type="button" class="next-year" aria-label="${this.nextYearLabel}">
23            <span class="fa-solid fa-angles-right"></span>
24          </button>
25        </div>
26
27        <div class="dialog-message" aria-live="polite"></div>
28
29        <div class="table-wrap">
30          <table class="dates calendar" role="grid" aria-labelledby="id-grid-label">
31            <thead>
32              <tr>
33                <th scope="col" abbr="Domingo">D</th>
34                <th scope="col" abbr="Segunda">S</th>
35                <th scope="col" abbr="Ter\xE7a">T</th>
36                <th scope="col" abbr="Quarta">Q</th>
37                <th scope="col" abbr="Quinta">Q</th>
38                <th scope="col" abbr="Sexta">S</th>
39                <th scope="col" abbr="S\xE1bado">Sa</th>
40              </tr>
41            </thead>
42            <tbody>
43              <!-- table rows here -->
44            </tbody>
45            <caption class="sr-only">
46              ${this.captionLabel}
47            </caption>
48          </table>
49        </div>
50
51        <div class="dialog-ok-cancel-group">
52          <button class="dialog-button" value="cancel">${this.buttonLabelCancel}</button>
53          <button class="dialog-button" value="ok">${this.buttonLabelChoose}</button>
54        </div>
55      </div>
56    `;n.insertAdjacentHTML("beforeend",s)}triggerEvent(e){let t=this;(this.#t[e]||[]).forEach(i=>{i(t)})}addEventListener(e,t){this.#t[e]||(this.#t[e]=[]),this.#t[e].push(t)}isSameDay(e,t){return e.getFullYear()==t.getFullYear()&&e.getMonth()==t.getMonth()&&e.getDate()==t.getDate()}isNotSameMonth(e,t){return e.getFullYear()!=t.getFullYear()||e.getMonth()!=t.getMonth()}setAvailableDates(e){this.#e=e,this.updateGrid()}updateGrid(){const e=this.focusDay;this.monthYearNode.textContent=this.monthLabels[e.getMonth()]+" "+e.getFullYear();let t=new Date(e.getFullYear(),e.getMonth(),1),n=t.getDay();t.setDate(t.getDate()-n);const i=new Date(t);for(let s=0;s<this.days.length;s++){const l=i.getMonth()!=e.getMonth();this.updateDate(this.days[s],l,i,this.isSameDay(i,this.selectedDay)),i.setDate(i.getDate()+1),s===35&&(l?this.lastRowNode.style.display="none":this.lastRowNode.style.display="table-row")}}updateDate(e,t,n,i){let s=n.getDate().toString();n.getDate()<=9&&(s="0"+s);let l=n.getMonth()+1;n.getMonth()<9&&(l="0"+l),e.tabIndex=-1,e.removeAttribute("aria-selected"),e.setAttribute("data-date",n.getFullYear()+"-"+l+"-"+s);let h=this.locales.ariaLabelText;h=h.replace("{{weekday}}",this.dayLabels[n.getDay()]),h=h.replace("{{day}}",n.getDate()),h=h.replace("{{month}}",this.monthLabels[n.getMonth()]),h=h.replace("{{year}}",n.getFullYear()),this.#e&&this.#e.includes(e.getAttribute("data-date"))&&(h+=`, ${this.locales.available}`),e.setAttribute("aria-label",h),t?(e.classList.add("disabled"),e.textContent="",e.removeAttribute("aria-disabled")):(this.#e.length>0?this.#e.includes(e.getAttribute("data-date"))?(e.classList.remove("disabled"),e.removeAttribute("aria-disabled")):(e.classList.add("disabled"),e.setAttribute("aria-disabled","true")):(e.classList.remove("disabled"),e.removeAttribute("aria-disabled")),e.textContent=n.getDate(),this.isSameDay(n,new Date)&&e.setAttribute("aria-current","date"),i&&(e.setAttribute("aria-selected","true"),e.tabIndex=0))}moveFocusToDay(e){const t=this.focusDay;this.focusDay=e,(t.getMonth()!=this.focusDay.getMonth()||t.getFullYear()!=this.focusDay.getFullYear())&&this.updateGrid(),this.setFocusDay()}setFocusDay(e){typeof e!="boolean"&&(e=!0);for(let t=0;t<this.days.length;t++){const n=this.days[t],i=this.getDayFromDataDateAttribute(n);n.tabIndex=-1,this.isSameDay(i,this.focusDay)&&(n.tabIndex=0,e&&n.focus())}}open(){this.dialogNode.style.display="block",this.dialogNode.style.zIndex=2,this.getDateFromTextbox(),this.updateGrid(),this.lastDate=this.focusDay.getDate()}isOpen(){return window.getComputedStyle(this.dialogNode).display!=="none"}close(e){typeof e!="boolean"&&(e=!0),this.setMessage(""),this.dialogNode.style.display="none",e&&this.buttonNode.focus()}changeMonth(e,t){const n=(x,T)=>new Date(x,T,0).getDate(),i=t<0,s=Math.trunc(Math.abs(t)/12);t=Math.abs(t)%12;const l=i?e.getFullYear()-s:e.getFullYear()+s,h=i?e.getMonth()-t:e.getMonth()+t,v=new Date(l,h,1),f=n(v.getFullYear(),v.getMonth()+1);return this.lastDate=this.lastDate?this.lastDate:e.getDate(),this.lastDate>f?v.setDate(f):v.setDate(this.lastDate),v}moveToNextYear(){this.focusDay=this.changeMonth(this.focusDay,12),this.updateGrid()}moveToPreviousYear(){this.focusDay=this.changeMonth(this.focusDay,-12),this.updateGrid()}moveToNextMonth(){this.focusDay=this.changeMonth(this.focusDay,1),this.updateGrid()}moveToPreviousMonth(){this.focusDay=this.changeMonth(this.focusDay,-1),this.updateGrid()}moveFocusToNextDay(){const e=new Date(this.focusDay);e.setDate(e.getDate()+1),this.lastDate=e.getDate(),this.moveFocusToDay(e)}moveFocusToNextWeek(){const e=new Date(this.focusDay);e.setDate(e.getDate()+7),this.lastDate=e.getDate(),this.moveFocusToDay(e)}moveFocusToPreviousDay(){const e=new Date(this.focusDay);e.setDate(e.getDate()-1),this.lastDate=e.getDate(),this.moveFocusToDay(e)}moveFocusToPreviousWeek(){const e=new Date(this.focusDay);e.setDate(e.getDate()-7),this.lastDate=e.getDate(),this.moveFocusToDay(e)}moveFocusToFirstDayOfWeek(){const e=new Date(this.focusDay);e.setDate(e.getDate()-e.getDay()),this.lastDate=e.getDate(),this.moveFocusToDay(e)}moveFocusToLastDayOfWeek(){const e=new Date(this.focusDay);e.setDate(e.getDate()+(6-e.getDay())),this.lastDate=e.getDate(),this.moveFocusToDay(e)}isDayDisabled(e){return e.classList.contains("disabled")}getDayFromDataDateAttribute(e){const t=e.getAttribute("data-date").split("-");return new Date(t[0],parseInt(t[1])-1,t[2])}setTextboxDate(e){let t=this.focusDay;this.#e.length>0&&e&&this.isDayDisabled(e)||(e&&(t=this.getDayFromDataDateAttribute(e),this.days.forEach(n=>n===e?n.setAttribute("aria-selected","true"):n.removeAttribute("aria-selected"))),this.textboxNode.value=(t.getDate()<10?"0":"")+t.getDate()+"/"+(t.getMonth()+1<10?"0":"")+(t.getMonth()+1)+"/"+t.getFullYear(),this.setDateForButtonLabel(),this.triggerEvent("select"))}getDateFromTextbox(){const e=this.textboxNode.value.split("/"),t=parseInt(e[0]),n=parseInt(e[1]);let i=parseInt(e[2]);e.length===3&&Number.isInteger(n)&&Number.isInteger(t)&&Number.isInteger(i)?(i<100&&(i=2e3+i),this.focusDay=new Date(i,n-1,t),this.selectedDay=new Date(this.focusDay)):(this.focusDay=new Date,this.selectedDay=new Date(0,0,1))}setDateForButtonLabel(){const e=this.textboxNode.value.split("/");if(e.length===3&&Number.isInteger(parseInt(e[0]))&&Number.isInteger(parseInt(e[1]))&&Number.isInteger(parseInt(e[2]))){const t=new Date(parseInt(e[2]),parseInt(e[0])-1,parseInt(e[1]));let n=this.buttonLabelChange;this.buttonNode.setAttribute("aria-label",n)}else this.buttonNode.setAttribute("aria-label",this.buttonLabelChoose)}setMessage(e){function t(){this.messageNode.textContent=e}e!==this.lastMessage&&(setTimeout(t.bind(this),200),this.lastMessage=e)}handleOkButton(e){let t=!1;switch(e.type){case"keydown":switch(e.key){case"Tab":e.shiftKey||(this.prevYearNode.focus(),t=!0);break;case"Esc":case"Escape":this.close(),t=!0;break;default:break}break;case"click":this.setTextboxDate(),this.close(),t=!0;break;default:break}t&&(e.stopPropagation(),e.preventDefault())}handleCancelButton(e){let t=!1;switch(e.type){case"keydown":switch(e.key){case"Esc":case"Escape":this.close(),t=!0;break;default:break}break;case"click":this.close(),t=!0;break;default:break}t&&(e.stopPropagation(),e.preventDefault())}handleNextYearButton(e){let t=!1;switch(e.type){case"keydown":switch(e.key){case"Esc":case"Escape":this.close(),t=!0;break;case"Enter":this.moveToNextYear(),this.setFocusDay(!1),t=!0;break}break;case"click":this.moveToNextYear(),this.setFocusDay(!1);break;default:break}t&&(e.stopPropagation(),e.preventDefault())}handlePreviousYearButton(e){let t=!1;switch(e.type){case"keydown":switch(e.key){case"Enter":this.moveToPreviousYear(),this.setFocusDay(!1),t=!0;break;case"Tab":e.shiftKey&&(this.okButtonNode.focus(),t=!0);break;case"Esc":case"Escape":this.close(),t=!0;break;default:break}break;case"click":this.moveToPreviousYear(),this.setFocusDay(!1);break;default:break}t&&(e.stopPropagation(),e.preventDefault())}handleNextMonthButton(e){let t=!1;switch(e.type){case"keydown":switch(e.key){case"Esc":case"Escape":this.close(),t=!0;break;case"Enter":this.moveToNextMonth(),this.setFocusDay(!1),t=!0;break}break;case"click":this.moveToNextMonth(),this.setFocusDay(!1);break;default:break}t&&(e.stopPropagation(),e.preventDefault())}handlePreviousMonthButton(e){let t=!1;switch(e.type){case"keydown":switch(e.key){case"Esc":case"Escape":this.close(),t=!0;break;case"Enter":this.moveToPreviousMonth(),this.setFocusDay(!1),t=!0;break}break;case"click":this.moveToPreviousMonth(),this.setFocusDay(!1),t=!0;break;default:break}t&&(e.stopPropagation(),e.preventDefault())}handleDayKeyDown(e){let t=!1;switch(e.key){case"Esc":case"Escape":this.close();break;case" ":this.setTextboxDate(e.currentTarget),t=!0;break;case"Enter":this.setTextboxDate(e.currentTarget),this.close(),t=!0;break;case"Tab":this.cancelButtonNode.focus(),e.shiftKey&&this.nextYearNode.focus(),this.setMessage(""),t=!0;break;case"Right":case"ArrowRight":this.moveFocusToNextDay(),t=!0;break;case"Left":case"ArrowLeft":this.moveFocusToPreviousDay(),t=!0;break;case"Down":case"ArrowDown":this.moveFocusToNextWeek(),t=!0;break;case"Up":case"ArrowUp":this.moveFocusToPreviousWeek(),t=!0;break;case"PageUp":e.shiftKey?this.moveToPreviousYear():this.moveToPreviousMonth(),this.setFocusDay(),t=!0;break;case"PageDown":e.shiftKey?this.moveToNextYear():this.moveToNextMonth(),this.setFocusDay(),t=!0;break;case"Home":this.moveFocusToFirstDayOfWeek(),t=!0;break;case"End":this.moveFocusToLastDayOfWeek(),t=!0;break}t&&(e.stopPropagation(),e.preventDefault())}handleDayClick(e){!this.isDayDisabled(e.currentTarget)&&e.which!==3&&(this.setTextboxDate(e.currentTarget),this.close()),e.stopPropagation(),e.preventDefault()}handleDayFocus(){this.setMessage(this.messageCursorKeys)}handleButtonKeydown(e){(e.key==="Enter"||e.key===" ")&&(this.open(),this.setFocusDay(),e.stopPropagation(),e.preventDefault())}handleButtonClick(e){this.isOpen()?this.close():(this.open(),this.setFocusDay()),e.stopPropagation(),e.preventDefault()}
56handleBackgroundMouseUp(e){!this.buttonNode.contains(e.target)&&!this.dialogNode.contains(e.target)&&this.isOpen()&&(this.close(!1),e.stopPropagation(),e.preventDefault())}}$(function(){AccessibleDatePicker.buildGlobal()}),$(function(){setTimeout(()=>{var u=$(".auto-focus:visible, .FormAlert")[0];u&&u.focus()},500);var o=typeof Storage<"u";$(".google_search_button").length>0&&$(".google_search_button").click(function(u){u.stopPropagation(),u.preventDefault();var k=$(this),O=k.data("url")+"?search="+k.prev().val();k.data("search_domain")+""!=""&&(O+="&search_domain="+k.data("search_domain")),window.location=O}),$(".slideshow").length>0&&$(".slideshow").css("display","block").cycle({fx:"fade",random:0,speed:3500}),typeof Galleria<"u"&&(Galleria.loadTheme("/assets/wm-smile/javascripts/frontoffice/galleria/themes/azur/galleria.azur.min.js"),Galleria.run(".galleria",{autoplay:5e3,thumbCrop:!1,imageCrop:!1,maxScaleRatio:1,fullscreenCrop:!1,extend:function(u){this.bind("image",function(k){$(k.imageTarget).click(this.proxy(function(){}))})}}),Galleria.ready(function(){this.getDataLength()==1&&(this.$("image-nav").hide(),this.$("thumbnails-container").hide()),this.bind("image",function(u){u.scope._data.forEach(function(){u.imageTarget.alt=u.galleriaData.original.alt})}),this.bind("thumbnail",function(u){u.scope._data.forEach(function(){u.thumbTarget.alt=u.galleriaData.original.alt})})}));var e=$(".light-gallery");e.length>0&&e.each(function(u,k){$gallery=$(k),$gallery.data("thumbs")?$gallery.lightGallery({thumbnails:!0}):$gallery.lightGallery()});var t=$(".video-light-gallery");if(t.length>0){try{for(const u of t){if(u.getAttribute("skip-gallery")==="true")continue;u.setAttribute("aria-hidden","true");const k=document.createElement("ul");k.setAttribute("class","sr-only");for(const[O,F]of u.querySelectorAll("a").entries().toArray()){F.setAttribute("aria-hidden","true"),F.setAttribute("tabindex","-1");const K=document.createElement("li"),z=document.createElement("a");z.setAttribute("href",F.href.replace("youtube-nocookie","youtube")),z.setAttribute("target","_blank"),z.innerText=`Abrir v\xEDdeo ${O+1} com titulo ${F.querySelector(".title").innerText} num novo separador`,K.append(z),k.append(K)}u.after(k)}}catch(u){console.error(u)}var n=t.filter(function(){return $(this).attr("skip-gallery")!=="true"});n.lightGallery({loadYoutubeThumbnail:!0,youtubeThumbSize:"default",loadVimeoThumbnail:!0,vimeoThumbSize:"thumbnail_medium"})}var i=$(".subscribe-me");if(i.length>0){var s=function(u){return u.subscribeBetter({trigger:u.data("trigger")||"onload",animation:u.data("animation")||"fade",delay:u.data("delay")?parseInt(u.data("delay")):0,showOnce:u.data("showOnce")=="true",autoClose:u.data("autoClose")=="true",scrollableModal:u.data("scrollableModal")=="true"})};i.each(function(){var u=$(this),k=u.attr("id"),O=u.hasClass("keep-closed");if(!o||!O)return s(u);sessionStorage.getItem(k)===null?(s(u),sessionStorage.setItem(k,!0)):u.hide()})}$.piroBox_ext&&$(".video_preview, .image_preview").length>0&&($.piroBox_ext({piro_speed:700,bg_alpha:.5,piro_scroll:!0,piro_drag:!1,piro_nav_pos:"bottom"}),$(".video_preview").each(function(){if($(this).closest("ul:not([data-acessible=true])").length>0)try{const u=$(this).closest("ul:not([data-acessible=true])")[0];u.setAttribute("data-acessible","true"),u.setAttribute("aria-hidden","true");const k=document.createElement("ul");k.setAttribute("class","sr-only");for(const[O,F]of u.querySelectorAll("a").entries().toArray()){F.setAttribute("aria-hidden","true"),F.setAttribute("tabindex","-1");const K=document.createElement("li"),z=document.createElement("a");z.setAttribute("href",F.href.replace("youtube-nocookie","youtube")),z.setAttribute("target","_blank"),z.innerText=`Abrir v\xEDdeo ${O+1} com titulo ${F.querySelector(".title").innerText} num novo separador`,K.append(z),k.append(K)}u.after(k)}catch(u){console.error(u)}})),$(".widget_form").length>0&&(process_form_buttons(),process_error_focus_links()),$(".showcase-holder").length>0&&$(".showcase-holder").each(function(){process_showcase_holder($(this))});var l=function(u,k){var O=u.data("pagination-prefix");O&&k.controlNav!=="thumbnails"&&(k.start=function(F){F.controlNav.each(function(){$(this).prepend($('
56<span class="sr-only"></span>').text(O+" "))})})};if($("div").flexslider&&$(".flexslider").length>0&&($(".flexslider[data-type=fader]").each(function(){var u=$(this),k={prevText:"Anterior",nextText:"Pr\xF3ximo"};u.data("has-thumbs")==="yes"&&(k.controlNav="thumbnails"),l(u,k),u.flexslider(k)}),$(".flexslider[data-type=slider]").each(function(){var u=$(this),k={prevText:"Anterior",nextText:"Pr\xF3ximo",animation:"slide"};u.data("has-thumbs")==="yes"&&(k.controlNav="thumbnails"),l(u,k),u.flexslider(k)}),$(".flexslider[data-type=carousel]").each(function(){var u=$(this),k={prevText:"Anterior",nextText:"Pr\xF3ximo",animation:"slide",animationLoop:!1,itemWidth:u.data("item-with"),itemMargin:u.data("item-margin")};u.data("has-thumbs")==="yes"&&(k.controlNav="thumbnails"),u.flexslider(k)})),jQuery.gritter&&$(".gritter-message").length>0&&$(".gritter-message").each(function(){var u=$(this);jQuery.gritter.add({title:$(".title",u).html(),text:$(".text",u).html()})}),$('form[action="/email_form"]').length>0&&testIfLocalStorageIsAvailable()){var h=$('form[action="/email_form"]');if(h.on("submit",function(u){var k=h.find("*[type='submit']");if(k.length!==0){if(k.data("is-submitted")===!0)return u.preventDefault();k.unbind("click"),k.addClass("disabled"),k.data("is-submitted",!0)}}),h.submit(function(){localStorage.setItem("formContents",JSON.stringify(h.serializeArray()))}),window.has_form_error)for(var v=JSON.parse(localStorage.getItem("formContents")),f=0;f<v.length;f++){var x=v[f].name.indexOf("g-recaptcha-response")>-1;if(x){if(v[f].value==""){var T=h.find("input[name='captcha_error']"),y="Por favor preencha o captcha";T.length>0&&(y=T.val()),h.prepend("<div class='widget_warning'>"+y+"</div>")}continue}$("input[name='"+v[f].name+"'],textarea[name='"+v[f].name+"']").val(v[f].value)}else localStorage.removeItem("formContents")}});var testIfLocalStorageIsAvailable=function(){var o="test";try{return localStorage.setItem(o,o),localStorage.removeItem(o),!0}catch{return!1}},get_default_showcase_options=function(){return{fit_to_parent:!0,auto:!0,interval:1e4,continuous:!0,loading:!0,tooltip_width:200,tooltip_icon_width:32,tooltip_icon_height:32,tooltip_offsetx:18,tooltip_offsety:0,arrows:!1,buttons:!0,btn_numbers:!0,keybord_keys:!0,mousetrace:!1,pauseonover:!0,stoponclick:!0,transition:"fade",transition_delay:300,transition_speed:500,show_caption:"show",thumbnails:!1,thumbnails_position:"outside-last",thumbnails_direction:"horizontal",thumbnails_slidex:0,dynamic_height:!1,speed_change:!0,viewline:!1}},get_options_for_fader=function(){return get_default_showcase_options()},get_options_for_mosaic_fader=function(){var o=get_default_showcase_options();return o.fit_to_parent=!1,o.buttons=!1,o.btn_numbers=!1,o.pauseonover=!0,o.thumbnails=!0,o.thumbnails_position="inside-last",o},get_options_for_slider=function(){var o=get_default_showcase_options();return o.transition="hslide",o},get_options_for_innerslider=function(){var o=get_default_showcase_options();return o.fit_to_parent=!1,o.buttons=!1,o.btn_numbers=!1,o.transition="hslide",o.thumbnails=!0,o},get_options_for_highlights_slider=function(){var o=get_default_showcase_options();return o.arrows=!0,o.fit_to_parent=!1,o.buttons=!1,o.btn_numbers=!1,o.transition="hslide",o.thumbnails=!1,o},option_functions={fader:get_options_for_fader,mosaic_fader:get_options_for_mosaic_fader,slider:get_options_for_slider,innerslider:get_options_for_innerslider,highlights_slider:get_options_for_highlights_slider},process_showcase_holder=function(o){if(!(o.find(".showcase-content-container").length>0))try{var e=o.data("showcase-type"),t=option_functions[e]();t.content_width=o.data("max_image_width"),t.content_height=o.data("max_image_height"),o.awShowcase(t),setTimeout(function(){$.piroBox_ext&&$.piroBox_ext()},50)}catch{}},process_form_buttons=function(){$(document).on("keypress","input[type=text]",function(o){if(o.keyCode!==13)return!0;o.preventDefault(),do_form_submit($(this))}),$(".submit_button_link").click(function(o){o.preventDefault(),debounce?do_form_submit_debounce($(this)):do_form_submit($(this))}
56),$("form").on("submit",function(o){if($form=$(this),$form.find(".submit_button_link.submit-with-partial-form").length>0){$button=$form.find(".submit_button_link.submit-with-partial-form");let e=()=>{debounce?do_form_submit_debounce($button):do_form_submit($button)};if($button.attr("disabled"))return o.preventDefault(),o.stopPropagation(),!1;if($button.data("validated")=="true")return!0;let t=$("input[name='partial_form_id']");if(t.length==0||t.val()=="0"||!t.closest(".widget_extra_fields").is(":visible"))return e(),!0;o.preventDefault(),o.stopPropagation();let n=+$button.parents("div.widget").data("id"),i=s=>{Object.keys(s).length==0?($button.data("validated","true"),e($button)):$button.data("validated","false")};document.dispatchEvent(new CustomEvent("React.CheckIfPartialFormIsValid",{bubbles:!0,detail:{widgetId:n,callback:i}}))}})},process_error_focus_links=function(){$("[data-focus]").on("click",function(o){o.preventDefault();let e=$(this).attr("data-focus"),t=$('.RenderFormElem[data-focus-on-error="'+e+'"]');if(t.length){$("html, body").animate({scrollTop:t.offset().top},600);let n=t.find("input:not([type=hidden])");if(!n.length&&t.find("select").length&&(console.log("Focando select",t.find("select")),n=t.find("select")),!n.length&&t.find("textarea").length&&(console.log("Focando textarea",t.find("textarea")),n=t.find("textarea")),!n.length)return;n.focus()}})},do_form_submit=function(o){var e=o.closest("form").find(".FormViewer-StatusLive");e.length>0&&e.data("submitting-text")&&e.text(e.data("submitting-text"));var t=o.prev("input[type=submit]");if(t.length==0&&(t=o.parent().find("input[type=submit],input.search_button")),t.length==0&&(t=o.closest(".widget").find("input[type=submit],input.search_button")),$(o).closest(".ajax-submit-form").length>0)$(o).closest(".ajax-submit-form").find(".input-ajax-submit-form").keyup();else if(t.length>0)t.click();else{var n=o.closest("form");n.length>0&&n.submit()}},do_form_submit_debounce=debounce?debounce(do_form_submit,500):void 0;function pickAjaxTargetWidget(o,e){if(!e||!e.length)return null;var t=o?e.filter(function(i){return o.compareDocumentPosition(i)&Node.DOCUMENT_POSITION_FOLLOWING}):[],n=t.length?t:e;return n.filter(function(i){return i.querySelector("form")})[0]||n[0]||null}typeof module<"u"&&(module.exports=pickAjaxTargetWidget),$(function(){function o(n){n.preventDefault();var i=window.location.href.indexOf("admin/editor")>-1;if(!(this.dataset.ignore||i)){var s=$(this),l=s.closest("form"),h=s.closest(".widget"),v=parseInt($("#is-same-page",h).val()),f=$("#secondary-widget",h).val(),x=$("#secondary-widget-selectors",h).val(),T="",y=null,u=null;if(v&&f&&!x){var k=$(".widget[data-content_type='"+f+"']").toArray();u=$(pickAjaxTargetWidget(h[0],k)),y=$("form",u),y.length===0&&(y=l),T=y.attr("action")}else v&&f&&x?(u=$(x).filter(".widget[data-content_type='"+f+"']"),y=$("form",u),y.length===0&&(y=l),T=y.attr("action")):(u=s.closest(".widget"),y=s.closest("form"),T=y.attr("action"));u.each(function(O){url_anchor="",T.indexOf("#")>=0&&(url_anchor=T.split("#")[1],T=T.split("#")[0]),T.indexOf("?")<0?T+="?":T+="&",T+="widget_id="+u.data("id"),T+="&widget_type="+u.data("content_type"),url_anchor&&(T+="#"+url_anchor),T+="&"+$("input[name!=widget_id][name!=widget_type][name!=widget_action][name!=return_to],select",l).serialize();var F=null,K=l.attr("aria-controls");K&&(F=$("#"+K),F.length>0&&F.attr("aria-busy","true")),$.getScript(T).done(function(){F&&F.length>0&&F.removeAttr("aria-busy")}).fail(function(){F&&F.length>0&&F.removeAttr("aria-busy")})}),setTimeout(t,550)}}var e=!1;$(document).on("keyup dp.change",".input-ajax-submit-form:not([data-skip-real-time])",debounce(o,550)),$(document).on("submit","form.generic_search",function(n){var i=$(".input-ajax-submit-form",this);i.length?o.call(i[0],n):n.preventDefault()}),$(document).on("change",".select-ajax-submit-form",debounce(o,550)),$(document).ready(function(){$(document).on("click",".wm-ajax-links a:not(.widget_field a)",function(n){var i=window.location.href.indexOf("admin/editor")>-1;if(!(this.dataset.ignore||i)){n.preventDefault();var s=$(this);url=s.prop("href"),url_anchor="",url.indexOf("#")>=0&&(url_anchor=url.split("#")[1],url=url.split("#")[0]),url.indexOf("?")<0?url+="?":url+="&";var l=s.closest(".widget");url+="widget_id="+l.data("id"),url+="&widget_type="+l.data("content_type"),url_anchor&&(url+="#"+url_anchor),$.getScript(url),setTimeout(t,550),history.pushState({},"",s.attr("href"))}})}),$(document).on("click",".pagination a",function(n){n.stopPropagation();var i=$(this),s=$("form.generic_search",i.closest(".widget"));s.length!=0&&(n.preventDefault(),$.post(i.prop("href"),s.serialize()),setTimeout(()=>history.pushState({},"",i.attr("href")),0),setTimeout(t,550))});function t(){$galleries=$(".light-gallery"),$galleries.length>0&&$galleries.lightGallery(),typeof setup_swiper_widgets=="function"&&setup_swiper_widgets()}document.addEventListener("usedforajaxwidgetsScriptLoaded",function(n){t()}),document.addEventListener("usedforajaxwidgetsUrlChanged",function(n){e&&(e=!1)}),document.addEventListener("usedforajaxwidgetsUrlWillChange",function(n){e||(e=!0)}),window.addEventListener("popstate",function(n){if(!e){var i=document.createEvent("HTMLEvents");i.initEvent("usedforajaxwidgetsUrlWillChange",!1,!0),document.dispatchEvent(i),e=!0,window.location.replace(window.location.href),i=document.createEvent("HTMLEvents"),i.initEvent("usedforajaxwidgetsUrlChanged",!1,!0),document.dispatchEvent(i)}})}
56),(function(o,e){var t="_wm_cookiebar_status",n="cookie_prefs",i="_wm_cookie_cfg",s="accepted",l="declined",h="custom",v=365;function f(a,r,c){var m="";if(c){var A=new Date;A.setTime(A.getTime()+c*24*60*60*1e3),m="; expires="+A.toUTCString()}e.cookie=encodeURIComponent(a)+"="+encodeURIComponent(r)+m+"; path=/"}function x(a){for(var r=encodeURIComponent(a)+"=",c=e.cookie.split(";"),m=0;m<c.length;m++){for(var A=c[m];A.charAt(0)===" ";)A=A.substring(1,A.length);if(A.indexOf(r)===0)return decodeURIComponent(A.substring(r.length,A.length))}return null}function T(a){if(!a)return null;var r=a.toString().toLowerCase();return r===s||r===l||r===h?r:null}function y(a){if(a===!0||a===!1)return a;if(typeof a=="string"){var r=a.trim().toLowerCase();if(r==="1"||r==="true")return!0;if(r==="0"||r==="false")return!1}return!1}function u(a){return(a||"").toString().trim()}function k(a){return(a||"").toString().trim()}function O(){try{var a=e.querySelector(".cookie-bar[data-config-digest]");if(a){var r=a.getAttribute("data-config-digest");if(r)return r.toString()}}catch{}return null}function F(){f(t,"",-1),f(n,"",-1),f(i,"",-1)}function K(){var a=O();if(!a)return!1;var r=x(i);return!r||r!==a}function z(){var a=O();a&&f(i,a,v)}function te(a){var r={categories:{},cookies:{}};return!a||typeof a!="object"||(a.categories&&typeof a.categories=="object"&&Object.keys(a.categories).forEach(function(c){var m=u(c);m&&(r.categories[m]=y(a.categories[c]))}),a.cookies&&typeof a.cookies=="object"&&Object.keys(a.cookies).forEach(function(c){var m=k(c);m&&(r.cookies[m]=y(a.cookies[c]))})),r}function J(){var a=X();if(!a)return te();var r=x(n);if(!r)return te();try{return te(JSON.parse(r))}catch{return te()}}function Q(a){return u(a).toLowerCase()==="essential"}function ae(a){var r=X();if(!r)return Q(a);if(r===s)return!0;if(r===l)return Q(a);var c=J(),m=u(a);return m?Q(m)?!0:Object.prototype.hasOwnProperty.call(c.categories,m)?!!c.categories[m]:!1:!1}function se(a,r){var c=X();if(!c)return Q(r);if(c===s)return!0;if(c===l)return Q(r);var m=J(),A=k(a);return A&&Object.prototype.hasOwnProperty.call(m.cookies,A)?!!m.cookies[A]:ae(r)}function X(){return K()?(F(),null):T(x(t))}function w(){return X()===s}function b(a){f(t,a,v),z()}function D(){for(var a=e.querySelectorAll(".cookie-bar"),r=0;r<a.length;r++)a[r].setAttribute("aria-hidden","true"),a[r].style.display="none"}function E(a){a.removeAttribute("aria-hidden"),a.style.display=""}function Y(a){try{o.dispatchEvent(new CustomEvent(a))}catch{var r=e.createEvent("Event");r.initEvent(a,!0,!0),o.dispatchEvent(r)}}function C(a){a===s?Y("wm:cookie:accepted"):a===l?Y("wm:cookie:declined"):a===h&&Y("wm:cookie:custom"),Y("wm:cookie:updated")}function g(a,r){var c=r||{};b(a),D(),C(a),c.reload===!0&&setTimeout(function(){o.location.reload()},30)}function q(a,r){for(var c=a.target;c&&c!==r;){if(c.getAttribute&&c.getAttribute("data-cookie-choice"))return c;c=c.parentNode}return null}function W(a){var r=a.getAttribute("data-cookie-reload"),c=r===null||r==="true",m=X();if(m===s||m===l||m===h){D();return}else E(a);a.addEventListener("click",function(A){var I=q(A,a);if(I){var G=I.getAttribute("data-cookie-choice");G===s?g(s,{reload:c}):G===l&&g(l,{reload:c})}})}function N(){for(var a=e.querySelectorAll(".cookie-bar"),r=0;r<a.length;r++)W(a[r]);var c=X();c&&C(c);let m=e.querySelectorAll(".cookie-bar button");m&&m.length>0&&m[0].focus()}e.addEventListener("DOMContentLoaded",N),o.WMCookieConsent={status:X,hasConsent:w,getPreferences:J,isCategoryAllowed:ae,isCookieAllowed:se,acceptAll:function(a){g(s,a)},declineAll:function(a){g(l,a)}}})(window,document),document.addEventListener("DOMContentLoaded",function(){var o=document.querySelector("[data-cookie-manager]");if(!o)return;var e=o.querySelector(".cookie-manager__form");if(!e)return;function t(){return Array.prototype.slice.call(e.querySelectorAll("[data-cookie-toggle]"))}function n(v){v.preventDefault(),v.stopPropagation(),typeof v.stopImmediatePropagation=="function"&&v.stopImmediatePropagation()}function i(v){var f=v.closest("[data-cookie-row]")||v.closest(".cookie-card"),x=f&&f.querySelector("[data-cookie-toggle-label]");if(x){var T=v.dataset.labelOn||x.textContent,y=v.dataset.labelOff||x.textContent;x.textContent=v.checked?T:y}}
56function s(){t().forEach(function(v){i(v)})}function l(v){var f=e.querySelector('input[name="widget_action"]');f&&(f.value=v)}function h(v){var f=v&&v.previousElementSibling;if(f&&f.tagName==="INPUT"&&f.type==="submit"){f.click();return}var x=e.querySelector('input[type="submit"]');if(x){x.click();return}typeof e.requestSubmit=="function"?e.requestSubmit():e.submit()}e.addEventListener("change",function(v){var f=v.target;f.matches("[data-cookie-toggle]")&&i(f)}),e.querySelectorAll("[data-cookie-action]").forEach(function(v){v.addEventListener("click",function(f){n(f);var x=v.getAttribute("data-cookie-action");if(x==="accept"){l("accept_all"),h(v);return}else if(x==="reject"){l("reject_all"),h(v);return}else x==="defaults"&&t().forEach(function(T){if(!T.disabled){var y=T.dataset.defaultEnabled==="true";T.checked=y,i(T)}})})}),e.querySelectorAll(".submit_button_link").forEach(function(v){v.hasAttribute("data-cookie-action")||v.addEventListener("click",function(f){f.defaultPrevented||(n(f),l("update"),h(v))})}),s()}),(function(o,e){"use strict";o.ajaxPrefilter(function(t,n,i){if(t.iframe)return"iframe"}),o.ajaxTransport("iframe",function(t,n,i){var s=null,l=null,h="iframe-"+o.now(),v=o(t.files).filter(":file:enabled"),f=null,x;function T(){f.each(function(y){o(this).replaceWith(v[y]),f.splice(y,1)}),s.remove(),l.bind("load",function(){l.remove()}),l.attr("src","about:blank")}if(t.dataTypes.shift(),v.length)return s=o("<form enctype='multipart/form-data' method='post'></form>").hide().attr({action:t.url,target:h}),typeof t.data=="string"&&t.data.length>0&&o.error("data must not be serialized"),o.each(t.data||{},function(y,u){o.isPlainObject(u)&&(y=u.name,u=u.value),o("<input type='hidden' />").attr({name:y,value:u}).appendTo(s)}),o("<input type='hidden' value='IFrame' name='X-Requested-With' />").appendTo(s),x=t.dataTypes[0]&&t.accepts[t.dataTypes[0]]?t.accepts[t.dataTypes[0]]+(t.dataTypes[0]!=="*"?", */*; q=0.01":""):t.accepts["*"],o("<input type='hidden' name='X-Http-Accept'>").attr("value",x).appendTo(s),f=v.after(function(y){return o(this).clone().prop("disabled",!0)}).next(),v.appendTo(s),{send:function(y,u){l=o("<iframe src='about:blank' name='"+h+"' id='"+h+"' style='display:none'></iframe>"),l.bind("load",function(){l.unbind("load").bind("load",function(){var k=this.contentWindow?this.contentWindow.document:this.contentDocument?this.contentDocument:this.document,O=k.documentElement?k.documentElement:k.body,F=O.getElementsByTagName("textarea")[0],K=F&&F.getAttribute("data-type")||null,z=F&&F.getAttribute("data-status")||200,te=F&&F.getAttribute("data-statusText")||"OK",J={html:O.innerHTML,text:K?F.value:O?O.textContent||O.innerText:null};T(),i.responseText||(i.responseText=J.text),u(z,te,J,K?"Content-Type: "+K:null)}),s[0].submit()}),o("body").append(s,l)},abort:function(){l!==null&&(l.unbind("load").attr("src","javascript:false;"),T())}}})})(jQuery),(function(o){var e;o.remotipart=e={setup:function(t){var n=t.data("ujs:submit-button"),i=o('meta[name="csrf-param"]').attr("content"),s=o('meta[name="csrf-token"]').attr("content"),l=t.find('input[name="'+i+'"]').length;t.one("ajax:beforeSend.remotipart",function(h,v,f){return delete f.beforeSend,f.iframe=!0,f.files=o(o.rails.fileInputSelector,t),f.data=t.serializeArray(),n&&f.data.push(n),f.files.each(function(x,T){for(var y=f.data.length-1;y>=0;y--)f.data[y].name==T.name&&f.data.splice(y,1)}),f.processData=!1,f.dataType===void 0&&(f.dataType="script *"),f.data.push({name:"remotipart_submitted",value:!0}),s&&i&&!l&&f.data.push({name:i,value:s}),o.rails.fire(t,"ajax:remotipartSubmit",[v,f])&&(o.rails.ajax(f).always(function(x){o.rails.fire(t,"ajax:remotipartComplete",[x])}),setTimeout(function(){o.rails.disableFormElements(t)},20)),e.teardown(t),!1}).data("remotipartSubmitted",!0)},teardown:function(t){t.unbind("ajax:beforeSend.remotipart").removeData("remotipartSubmitted")}},o(document).on("ajax:aborted:file","form",function(){var t=o(this);return e.setup(t),o.rails.handleRemote(t),!1})})(jQuery),(function(){var o=this;(function(){(function(){var t=[].slice;this.ActionCable={INTERNAL:{message_types:{welcome:"welcome",ping:"ping",confirmation:"confirm_subscription",rejection:"reject_subscription"},default_mount_path:"/cable",protocols:["actioncable-v1-json","actioncable-unsupported"]},WebSocket:window.WebSocket,logger:window.console,createConsumer:function(n){var i;return n==null&&(n=(i=this.getConfig("url"))!=null?i:this.INTERNAL.default_mount_path),new e.Consumer(this.createWebSocketURL(n))},getConfig:function(n){var i;return i=document.head.querySelector("meta[name='action-cable-"+n+"']"),i?.getAttribute("content")},createWebSocketURL:function(n){var i;return n&&!/^wss?:/i.test(n)?(i=document.createElement("a"),i.href=n,i.href=i.href,i.protocol=i.protocol.replace("http","ws"),i.href):n},startDebugging:function(){return this.debugging=!0},stopDebugging:function(){return this.debugging=null},log:function(){var n,i;if(n=1<=arguments.length?t.call(arguments,0):[],this.debugging)return n.push(Date.now()),(i=this.logger).log.apply(i,["[ActionCable]"].concat(t.call(n)))}}}).call(this)}).call(o);var e=o.ActionCable;(function(){(function(){var t=function(n,i){return function(){return n.apply(i,arguments)}};e.ConnectionMonitor=(function(){var n,i,s;l.pollInterval={min:3,max:30},l.staleThreshold=6;function l(h){this.connection=h,this.visibilityDidChange=t(this.visibilityDidChange,this),this.reconnectAttempts=0}return l.prototype.start=function(){if(!this.isRunning())return this.startedAt=i(),delete this.stoppedAt,this.startPolling(),document.addEventListener("visibilitychange",this.visibilityDidChange),e.log("ConnectionMonitor started. pollInterval = "+this.getPollInterval()+" ms")},l.prototype.stop=function(){if(this.isRunning())return this.stoppedAt=i(),this.stopPolling(),document.removeEventListener("visibilitychange",this.visibilityDidChange),e.log("ConnectionMonitor stopped")},l.prototype.isRunning=function(){return this.startedAt!=null&&this.stoppedAt==null},l.prototype.recordPing=function(){return this.pingedAt=i()},l.prototype.recordConnect=function(){return this.reconnectAttempts=0,this.recordPing(),delete this.disconnectedAt,e.log("ConnectionMonitor recorded connect")},l.prototype.recordDisconnect=function(){return this.disconnectedAt=i(),e.log("ConnectionMonitor recorded disconnect")},l.prototype.startPolling=function(){return this.stopPolling(),this.poll()},l.prototype.stopPolling=function(){return clearTimeout(this.pollTimeout)},l.prototype.poll=function(){return this.pollTimeout=setTimeout((function(h){return function(){return h.reconnectIfStale(),h.poll()}})(this),this.getPollInterval())},l.prototype.getPollInterval=function(){var h,v,f,x;return x=this.constructor.pollInterval,f=x.min,v=x.max,h=5*Math.log(this.reconnectAttempts+1),Math.round(n(h,f,v)*1e3)},l.prototype.reconnectIfStale=function(){if(this.connectionIsStale())return e.log("ConnectionMonitor detected stale c
56onnection. reconnectAttempts = "+this.reconnectAttempts+", pollInterval = "+this.getPollInterval()+" ms, time disconnected = "+s(this.disconnectedAt)+" s, stale threshold = "+this.constructor.staleThreshold+" s"),this.reconnectAttempts++,this.disconnectedRecently()?e.log("ConnectionMonitor skipping reopening recent disconnect"):(e.log("ConnectionMonitor reopening"),this.connection.reopen())},l.prototype.connectionIsStale=function(){var h;return s((h=this.pingedAt)!=null?h:this.startedAt)>this.constructor.staleThreshold},l.prototype.disconnectedRecently=function(){return this.disconnectedAt&&s(this.disconnectedAt)<this.constructor.staleThreshold},l.prototype.visibilityDidChange=function(){if(document.visibilityState==="visible")return setTimeout((function(h){return function(){if(h.connectionIsStale()||!h.connection.isOpen())return e.log("ConnectionMonitor reopening stale connection on visibilitychange. visbilityState = "+document.visibilityState),h.connection.reopen()}})(this),200)},i=function(){return new Date().getTime()},s=function(h){return(i()-h)/1e3},n=function(h,v,f){return Math.max(v,Math.min(f,h))},l})()}).call(this),(function(){var t,n,i,s,l,h,v=[].slice,f=function(T,y){return function(){return T.apply(y,arguments)}},x=[].indexOf||function(T){for(var y=0,u=this.length;y<u;y++)if(y in this&&this[y]===T)return y;return-1};s=e.INTERNAL,n=s.message_types,i=s.protocols,l=2<=i.length?v.call(i,0,t=i.length-1):(t=0,[]),h=i[t++],e.Connection=(function(){T.reopenDelay=500;function T(y){this.consumer=y,this.open=f(this.open,this),this.subscriptions=this.consumer.subscriptions,this.monitor=new e.ConnectionMonitor(this),this.disconnected=!0}return T.prototype.send=function(y){return this.isOpen()?(this.webSocket.send(JSON.stringify(y)),!0):!1},T.prototype.open=function(){return this.isActive()?(e.log("Attempted to open WebSocket, but existing socket is "+this.getState()),!1):(e.log("Opening WebSocket, current state is "+this.getState()+", subprotocols: "+i),this.webSocket!=null&&this.uninstallEventHandlers(),this.webSocket=new e.WebSocket(this.consumer.url,i),this.installEventHandlers(),this.monitor.start(),!0)},T.prototype.close=function(y){var u,k;if(u=(y??{allowReconnect:!0}).allowReconnect,u||this.monitor.stop(),this.isActive())return(k=this.webSocket)!=null?k.close():void 0},T.prototype.reopen=function(){var y;if(e.log("Reopening WebSocket, current state is "+this.getState()),this.isActive())try{return this.close()}catch(u){return y=u,e.log("Failed to reopen WebSocket",y)}finally{e.log("Reopening WebSocket in "+this.constructor.reopenDelay+"ms"),setTimeout(this.open,this.constructor.reopenDelay)}else return this.open()},T.prototype.getProtocol=function(){var y;return(y=this.webSocket)!=null?y.protocol:void 0},T.prototype.isOpen=function(){return this.isState("open")},T.prototype.isActive=function(){return this.isState("open","connecting")},T.prototype.isProtocolSupported=function(){var y;return y=this.getProtocol(),x.call(l,y)>=0},T.prototype.isState=function(){var y,u;return u=1<=arguments.length?v.call(arguments,0):[],y=this.getState(),x.call(u,y)>=0},T.prototype.getState=function(){var y,u,k;for(u in WebSocket)if(k=WebSocket[u],k===((y=this.webSocket)!=null?y.readyState:void 0))return u.toLowerCase();return null},T.prototype.installEventHandlers=function(){var y,u;for(y in this.events)u=this.events[y].bind(this),this.webSocket["on"+y]=u},T.prototype.uninstallEventHandlers=function(){var y;for(y in this.events)this.webSocket["on"+y]=function(){}},T.prototype.events={message:function(y){var u,k,O,F;if(this.isProtocolSupported())switch(O=JSON.parse(y.data),u=O.identifier,k=O.message,F=O.type,F){case n.welcome:return this.monitor.recordConnect(),this.subscriptions.reload();case n.ping:return this.monitor.recordPing();case n.confirmation:return this.subscriptions.notify(u,"connected");case n.rejection:return this.subscriptions.reject(u);default:return this.subscriptions.notify(u,"received",k)}},open:function(){if(e.log("WebSocket onopen event, using '"+this.getProtocol()+"' subprotocol"),this.disconnected=!1,!this.isProtocolSupp
56orted())return e.log("Protocol is unsupported. Stopping monitor and disconnecting."),this.close({allowReconnect:!1})},close:function(y){if(e.log("WebSocket onclose event"),!this.disconnected)return this.disconnected=!0,this.monitor.recordDisconnect(),this.subscriptions.notifyAll("disconnected",{willAttemptReconnect:this.monitor.isRunning()})},error:function(){return e.log("WebSocket onerror event")}},T})()}).call(this),(function(){var t=[].slice;e.Subscriptions=(function(){function n(i){this.consumer=i,this.subscriptions=[]}return n.prototype.create=function(i,s){var l,h,v;return l=i,h=typeof l=="object"?l:{channel:l},v=new e.Subscription(this.consumer,h,s),this.add(v)},n.prototype.add=function(i){return this.subscriptions.push(i),this.consumer.ensureActiveConnection(),this.notify(i,"initialized"),this.sendCommand(i,"subscribe"),i},n.prototype.remove=function(i){return this.forget(i),this.findAll(i.identifier).length||this.sendCommand(i,"unsubscribe"),i},n.prototype.reject=function(i){var s,l,h,v,f;for(h=this.findAll(i),v=[],s=0,l=h.length;s<l;s++)f=h[s],this.forget(f),this.notify(f,"rejected"),v.push(f);return v},n.prototype.forget=function(i){var s;return this.subscriptions=(function(){var l,h,v,f;for(v=this.subscriptions,f=[],l=0,h=v.length;l<h;l++)s=v[l],s!==i&&f.push(s);return f}).call(this),i},n.prototype.findAll=function(i){var s,l,h,v,f;for(h=this.subscriptions,v=[],s=0,l=h.length;s<l;s++)f=h[s],f.identifier===i&&v.push(f);return v},n.prototype.reload=function(){var i,s,l,h,v;for(l=this.subscriptions,h=[],i=0,s=l.length;i<s;i++)v=l[i],h.push(this.sendCommand(v,"subscribe"));return h},n.prototype.notifyAll=function(){var i,s,l,h,v,f,x;for(s=arguments[0],i=2<=arguments.length?t.call(arguments,1):[],v=this.subscriptions,f=[],l=0,h=v.length;l<h;l++)x=v[l],f.push(this.notify.apply(this,[x,s].concat(t.call(i))));return f},n.prototype.notify=function(){var i,s,l,h,v,f,x;for(f=arguments[0],s=arguments[1],i=3<=arguments.length?t.call(arguments,2):[],typeof f=="string"?x=this.findAll(f):x=[f],v=[],l=0,h=x.length;l<h;l++)f=x[l],v.push(typeof f[s]=="function"?f[s].apply(f,i):void 0);return v},n.prototype.sendCommand=function(i,s){var l;return l=i.identifier,this.consumer.send({command:s,identifier:l})},n})()}).call(this),(function(){e.Subscription=(function(){var t;function n(i,s,l){this.consumer=i,s==null&&(s={}),this.identifier=JSON.stringify(s),t(this,l)}return n.prototype.perform=function(i,s){return s==null&&(s={}),s.action=i,this.send(s)},n.prototype.send=function(i){return this.consumer.send({command:"message",identifier:this.identifier,data:JSON.stringify(i)})},n.prototype.unsubscribe=function(){return this.consumer.subscriptions.remove(this)},t=function(i,s){var l,h;if(s!=null)for(l in s)h=s[l],i[l]=h;return i},n})()}).call(this),(function(){e.Consumer=(function(){function t(n){this.url=n,this.subscriptions=new e.Subscriptions(this),this.connection=new e.Connection(this)}return t.prototype.send=function(n){return this.connection.send(n)},t.prototype.connect=function(){return this.connection.open()},t.prototype.disconnect=function(){return this.connection.close({allowReconnect:!1})},t.prototype.ensureActiveConnection=function(){if(!this.connection.isActive())return this.connection.open()},t})()}).call(this)}).call(this),typeof module=="object"&&module.exports?module.exports=e:typeof define=="function"&&define.amd&&define(e)}).call(this);

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.