PageSourceSearch

https://www.mountain-news.com/shared-content/art/tncms/subscription.js

js mountain-news.com collected 2026-09-25 23:55:22 UTC 3,874 bytes, 2 lines download raw bytes

1window.TNCMS=window.TNCMS||{},window.TNCMS.Subscription=(function(){"use strict";var _=null,w=null,T=null,g=null,h=null,a=null,o=null,y=null,B=null,f=null,v=null,d=null,l=null,G=null,I=null,N="Failed to initialize",u=[],r=null,R=",",E="%2C",O={isRestricted:function(){return y},accessByIpError:function(){return N},accessByIp:function(){return!!w},allowAccess:function(){return!!_},userHasService:function(){return g}};function S(e){console&&console.debug&&console.debug(e)}function C(e,n,i){var t,c;for(t=0,c=e.length;t<c;t++)n.call(i,t,e[t])}function D(e){for(var n=e+"=",i=document.cookie.split(";"),t=0,c=i.length;t<c;t++){for(var s=i[t];s.charAt(0)==" ";)s=s.substring(1,s.length);if(s.indexOf(n)==0)return s.substring(n.length,s.length)}return null}function m(e){return e&&!e.propertyIsEnumerable("length")&&typeof e=="object"&&typeof e.length=="number"}function L(e){if(!m(e)&&e&&typeof e=="string"&&e.indexOf(E)!==-1&&(e=e.split(E).join(R)),!m(e)&&e&&typeof e=="string"&&(e=e.split(R)),m(e))return e}function A(){return y===null&&(y=!!v),y}function H(){return!!w}function M(){return h===null&&(TNCMS.User.isLoggedIn()&&(d=L(D("tncms-services"))),h=!!d,h===!1&&(a=!1,o=!1,l=[],d=[])),h}function b(){if(T===null){if(M()===!0){l=[];for(var e=0,n=0,i=d.length;n<i;n++){var t=d[n];if(t==e){a===null&&(a=!0);continue}for(var c=0,s=v.length;c<s;c++)t==v[c]&&(l=l.concat(t))}a===null&&(a=!1)}a?(o=!1,l.length=0):o===null&&(o=m(l)&&l.length>0),T=a||o}return T}function k(){return o===null&&b(),o}function z(){return a===null&&b(),a}function U(){return k()?l.slice(0,1):[]}function P(){return _===null&&(_=A()?H()||b()||!1:!0),_}function q(){return g===null&&(g=A()?k():!1),g}function X(){return f===null&&(B?f=M()||!1:f=q()||!1,f&&TNCMS&&TNCMS.Tracking&&TNCMS.Tracking.addData&&TNCMS.Tracking.addEvent&&(I=document.querySelectorAll('meta[name^="x-tncms-aam-"]'),I&&C(I,function(e,n){
1n&&n.content&&n.name&&n.name.length&&n.name.length>=12&&TNCMS.Tracking.addData({name:n.name.substring(12,n.name.length),value:n.content})}),TNCMS.Tracking.addEvent({app:"subscription",metric:"view",id:U()}))),f}function p(){var e;if(u!==null){for(A(),M(),b(),k(),z(),P(),q(),X();u.length>0;)e=u.shift(),e[0].call(e[1]||null,O);u=null}}function F(e,n){u===null?e.call(n||null,O):u.push([e,n])}function j(e){var n;if(e=e||{},!e.service_id){console.warn&&console.warn("Missing required config: service_id");return}if(v=L(e.service_id),!m(v)){console.warn&&console.warn("Invalid config: service_id");return}n=e.prefix||"",B=!!e.unrestricted;try{r=new XMLHttpRequest}catch{}if(!r){p();return}r.addEventListener("timeout",p),r.addEventListener("error",p),r.addEventListener("load",function(){var i,t;if(r.status==200||r.status==304){if(i=r?r.getResponseHeader("Content-Type"):null,i&&i.replace(/;.*/,"").toLowerCase()==="application/json")try{t=JSON.parse(r.responseText)}catch{t=void 0}w=!!t.whitelist,N=t.error||null}p()}),r.open("GET",n+"/tncms/subscription/check_ip/",!0),r.setRequestHeader("X-Requested-With","XMLHttpRequest"),r.timeout=1e3;try{r.send(null)}catch{p()}document&&window.fetch&&localStorage&&(localStorage.getItem("tncms:subscription:cp")||localStorage.setItem("tncms:subscription:cp",new Date),document.addEventListener("visibilitychange",function(){if(TNCMS.User.isLoggedIn()){var i=new Date;try{if(document.cookie.indexOf("tncms-services")!=-1){var t=new Date(localStorage.getItem("tncms:subscription:cp"));if(i-t<144e5){S("Subscription verification check skipped: check under 4 hours");return}}else S("Subscription service cookie missing - checking for update")}catch(c){S("Subscription verification check failed: "+c.message)}S("Subscription verification check initiated"),localStorage.setItem("tncms:subscription:cp",i),fetch(n+"/tncms/subscription/activate/?interactive=no",{method:"POST"})}}))}return{initialize:j,onReady:F}})();
2//# sourceMappingURL=subscription.js.map

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.