what the Framers of the Constitution thought about “balls and strikes.”

dian zico
A woman in a red sweater speaking into a microphone sits behind a nameplate that says, "Hon. Amy Coney Barrett."
Supreme Court nominee Judge Amy Coney Barrett speaks during her confirmation hearing in Washington on Tuesday.
Demetrius Freeman/Getty Images

Judge Amy Coney Barrett’s prepared remarks for her Senate Judiciary Committee hearing included a familiar refrain. She told the senators and Americans watching at home: “The policy decisions and value judgments of government must be made by the political branches elected by and accountable to the People.”  This is similar to something that Justice Neil Gorsuch said in his own confirmation hearing a few years ago.  He said it was Congress’s job to make the law, while it was the job of the courts only to make sure that individual cases were fairly decided. Judges “would make pretty rotten legislators,” he added.  He said this in response to a question about the separation of powers, and he strongly suggested that the people who wrote our Constitution didn’t want judges to make laws.

These statements may seem like no big deal.  After all, most government and civics classes teach school kids that legislatures are supposed to make laws, while courts are just supposed to interpret them.  But that isn’t true.

For more than half of our country’s history, judges played a central role in deciding what the law would be.  They did this in criminal law, property law, torts, contracts, and essentially every other area of law in early America.  Judges’ role in creating substantive law was not an American invention.  The colonists brought the concept of common law with them from England, and English and American judges helped develop most of the basic legal principles that underlie modern American law.

It’s now in fashion for people to say that judges should not make policy decisions.  Conservative politicians and commentators will often complain about “legislating from the bench,” saying that judges have no business telling people how to live their lives.  Instead, these people argue, judges should limit themselves to merely judging whether laws are constitutional, and they should limit their interpretation of the Constitution to what it meant when this country was first created.

The people who make this argument will often point to the text of the Constitution.  The Constitution assigns “[a]ll legislative powers” in Congress, and it assigns the “judicial power of the United States” in the Supreme Court and lower federal courts.  There is no doubt that “legislative powers” includes the power to set policy—after all, it includes the power to write laws.  But what about the “judicial power”?  It obviously includes the power to interpret laws and to enter judgments in particular cases.  But what else does it include?

When the Constitution was written, the meaning of the term “judicial power” was relatively unsettled.  But there is very convincing historical evidence indicating that those who drafted and ratified the Constitution understood that term to include the power to make policy—especially in the area of criminal law. In the years immediately following ratification of the Constitution, there were a number of federal prosecutions brought for crimes that were not mentioned in any federal laws. Written laws were considered unnecessary because certain actions were understood to be illegal as a matter of “common law”—the rules that had developed over time in the course of individual cases. And so common law prosecutions were brought in federal courts for bribery, counterfeiting, and piracy.

As law professor Stewart Jay explains in his comprehensive history on the topic, those prosecutions were accepted as a matter of course.  All of the Justices on the Supreme Court (except Justice Chase) accepted the validity of prosecuting common law crimes in the federal courts.  So did major political figures of the time, including Thomas Jefferson, Alexander Hamilton, and John Jay.

The general consensus that the federal courts could convict someone for these judge-made crimes began to fracture when these prosecutions became a weapon in the partisan battles between the Federalists and the Democratic-Republicans.  Federalist judges used their common law authority to convict Democratic-Republicans in federal courts, and Democratic-Republican state judges used their common law authority to convict Federalists in the state courts.

As a result of these political prosecutions, the authority of federal judges to convict for common law crimes became inextricably bound up with those partisan positions.  Limiting the common law authority of federal judges became a Democratic-Republican cause, and Thomas Jefferson turned against it.   Democratic-Republicans eventually gained control of federal offices, including the Supreme Court.  And as a result of that political victory, in 1812 the Supreme Court declared that federal courts had no criminal common law authority in United States v. Hudson & Goodwin.

Importantly, the Supreme Court opinion in Hudson & Goodwin didn’t endorse the “judicial policy decisions are bad” position that Judge Barrett and Justice Gorsuch have offered.  The opinion was largely written in terms of the limited power of the federal government, not the appropriateness of entrusting judges with the power to set policy.  Indeed, for many decades after, the federal courts continued to set policy by creating common law in other, non-criminal areas of the law.  Criminal common law persisted in the states much longer.  Right now, more than a dozen states explicitly retain a role for common law crimes in their written statutes.

Reasonable people can, of course, disagree about how much policy power judges should have in our country.  While many state judges are elected, federal judges are not.  And there are persuasive arguments for having policy set by the elected branches of government.

But for those who consider themselves to be originalists—and both Judge Barrett and Justice Gorsuch identify themselves with that label—the argument that judges should not set policy is not consistent with their views that the Constitution should be interpreted according to its original public meaning.

The people who wrote the Constitution expected judges to play a very large role in setting legal policy in this country.  If we are going to reject that original understanding of the Constitution, why shouldn’t we reject others?

nnx3c!-- Rubicon Project Ad Tag --x3en

nn

nn")), n = j(p[r.size_id].split("x").map(function (e)
return Number(e);
), 2), i.width = n[0], i.height = n[1]), i.rubiconTargeting = (Array.isArray(r.targeting) ? r.targeting : []).reduce(function (e, r)
return e[r.key] = r.values[0], e;
,
rpfl_elemid: s.adUnitCode
), e.push(i)) : S.logError("Rubicon: bidRequest undefined at index position:".concat(t), d, c), e;
, []).sort(function (e, r) 0);
);
},
getUserSyncs: function getUserSyncs(e, r, t, i)
if (!y && e.iframeEnabled)
var n = "";
return t && "string" == typeof t.consentString && ("boolean" == typeof t.gdprApplies ? n += "?gdpr=".concat(Number(t.gdprApplies), "&gdpr_consent=").concat(t.consentString) : n += "?gdpr_consent=".concat(t.consentString)), i && (n += "".concat(n ? "&" : "?"https://slate.com/news-and-politics/2020/10/,"us_privacy=").concat(encodeURIComponent(i))), y = !0, "eus"https://slate.com/news-and-politics/2020/10/,".rubiconproject.com/usync.html") + n
;

,
transformBidParams: function transformBidParams(e)
return S.convertTypes(
accountId: "number",
siteId: "number",
zoneId: "number"
, e);

};

function R(e, r) r.refererInfo.referer;
return e.params.secure ? t.replace(/^http:/i, "https:") : t;

function O(e, r)
var t = e.params;

if ("video" === r)
var i = [];
return t.video && t.video.playerWidth && t.video.playerHeight ? i = [t.video.playerWidth, t.video.playerHeight] : Array.isArray(S.deepAccess(e, "mediaTypes.video.playerSize")) && 1 === e.mediaTypes.video.playerSize.length ? i = e.mediaTypes.video.playerSize[0] : Array.isArray(e.sizes) && 0 < e.sizes.length && Array.isArray(e.sizes[0]) && 1 < e.sizes[0].length && (i = e.sizes[0]), i; var n = []; return Array.isArray(t.sizes) ? n = t.sizes : void 0 !== S.deepAccess(e, "mediaTypes.banner.sizes") ? n = a(e.mediaTypes.banner.sizes) : Array.isArray(e.sizes) && 0 < e.sizes.length ? n = a(e.sizes) : S.logWarn("Rubicon: no sizes are setup or found"), d(n); function a(e) return S.parseSizesInput(e).reduce(function (e, r) var t = parseInt(p[r], 10); return t && e.push(t), e; , []); function s(e) return "object" === E(S.deepAccess(e, "params.video")) && void 0 !== S.deepAccess(e, "mediaTypes.".concat(u.d)); function m(e, r) var t = 1 < arguments.length && void 0 !== r && r; return s(e) ? -1 === ["outstream"https://slate.com/news-and-politics/2020/10/,"instream"].indexOf(S.deepAccess(e, "mediaTypes.".concat(u.d, ".context"))) ? void (t && S.logError("Rubicon: mediaTypes.video.context must be outstream or instream")) : O(e, "video").length < 2 ? void (t && S.logError("Rubicon: could not determine the playerSize of the video")) : (t && S.logMessage("Rubicon: making video request for adUnit", e.adUnitCode), "video") : 0 === O(e, "banner").length ? void (t && S.logError("Rubicon: could not determine the sizes for banner request")) : (t && S.logMessage("Rubicon: making banner request for adUnit", e.adUnitCode), "banner"); var c = function c() return w = ; ; function d(e) var n = [15, 2, 9]; return e.sort(function (e, r) ); function g(e) var r = parseInt(S.deepAccess(e, "params.video.size_id")); return isNaN(r) ? "outstream" === S.deepAccess(e, "mediaTypes.".concat(u.d, ".context")) ? 203 : 201 : r; function v(e) return ranges: low: [ max: 5, increment: .5 ], medium: [ max: 20, increment: .1 ], high: [ max: 20, increment: .01 ], auto: [ max: 5, increment: .05 , min: 5, max: 10, increment: .1 , min: 10, max: 20, increment: .5 ], dense: [ max: 3, increment: .01 , min: 3, max: 8, increment: .05 , min: 8, max: 20, increment: .5 ], custom: e.getConfig("customPriceBucket") && e.getConfig("customPriceBucket").buckets [e.getConfig("priceGranularity")] ; function l(r) var t = !0, e = Object.prototype.toString.call([]), i = Object.prototype.toString.call(0), n = mimes: e, protocols: e, maxduration: i, linearity: i, api: e ; return Object.keys(n).forEach(function (e) Object.prototype.toString.call(S.deepAccess(r, "mediaTypes.video." + e)) !== n[e] && (t = !1, S.logError("Rubicon: mediaTypes.video." + e + " is required and must be of type: " + n[e])); ), t; function T(e) S.logError("Rubicon: required schain params missing")), r; function b(e, r) return "rp_schain" === e ? "rp_schain=".concat(r) : "".concat(e, "=").concat(encodeURIComponent(r)); var y = !1; Object(i.registerBidder)(z); } }, [720]); pbjsChunk([105], { 770: function _(e, t, r) e.exports = r(771); , 771: function _(e, t, r) { "use strict"; Object.defineProperty(t, "__esModule", value: !0 ), r.d(t, "spec", function () return a; ), r.d(t, "_isInbounds", function () return m; ), t._getPlatform = v; var n = r(1), y = r(0), i = r(2), o = r(3), g = r(11), c = r(43); function h(e, t) function s(e, t) (null == t function d() function (e) for (var t = 1; t < arguments.length; t++) var r = arguments[t]; for (var n in r) Object.prototype.hasOwnProperty.call(r, n) && (e[n] = r[n]); return e; ).apply(this, arguments); function u(e, t, r) return t in e ? Object.defineProperty(e, t, value: r, enumerable: !0, configurable: !0, writable: !0 ) : e[t] = r, e; var p = "sonobi", b = Object(y.generateUUID)(), a = { code: p, supportedMediaTypes: [i.b, i.d], isBidRequestValid: function isBidRequestValid(e) if (!e.params) return !1; if (!e.params.ad_unit && !e.params.placement_id) return !1; if (!Object(y.deepAccess)(e, "mediaTypes.banner") && !Object(y.deepAccess)(e, "mediaTypes.video")) return !1; if (Object(y.deepAccess)(e, "mediaTypes.banner")) if (!Object(y.deepAccess)(e, "mediaTypes.banner.sizes") && !e.params.sizes) return !1; else if (Object(y.deepAccess)(e, "mediaTypes.video")) if ("outstream" === Object(y.deepAccess)(e, "mediaTypes.video.context") && !e.params.sizes) return !1; if ("instream" === Object(y.deepAccess)(e, "mediaTypes.video.context") && !Object(y.deepAccess)(e, "mediaTypes.video.playerSize")) return !1; return !0; , buildRequests: function buildRequests(e, t) var r = e.map(function (e) ").concat(e.bidId), "".concat(l(e)).concat(f(e)))) : /^[0-9a-fA-F]20$/.test(t) && 20 === t.length ? u(, e.bidId, "".concat(t, "), n = ; r.forEach(function (e) d(n, e); ); var i = key_maker: JSON.stringify(n), ref: t.refererInfo.referer, s: Object(y.generateUUID)(), pv: b, vp: v(), lib_name: "prebid", lib_v: "4.13.0", us: 0 ; o.b.getConfig("userSync") && o.b.getConfig("userSync").syncsPerBidder && (i.us = o.b.getConfig("userSync").syncsPerBidder), c.a.canBidderRegisterSync("iframe", p) ? i.ius = 1 : i.ius = 0, Object(y.deepAccess)(e[0], "params.hfa") && (i.hfa = Object(y.deepAccess)(e[0], "params.hfa")), e[0].params.referrer && (i.ref = e[0].params.referrer), t && t.gdprConsent && (i.gdpr = t.gdprConsent.gdprApplies ? "true" : "false", t.gdprConsent.consentString && (i.consent_string = t.gdprConsent.consentString)), e[0].schain && (i.schain = JSON.stringify(e[0].schain)), Object(y.deepAccess)(e[0], "userId") && 0 < Object.keys(e[0].userId).length && (i.userid = JSON.stringify(e[0].userId)); var s = e[0].params.keywords; if (s && (i.kw = s), t && t.uspConsent && (i.us_privacy = t.uspConsent), Object(y.isEmpty)(n)) return null; var a = "https://apex.go.sonobi.com/trinity.json"; return Object(y.deepAccess)(e[0], "params.bid_request_url") && (a = Object(y.deepAccess)(e[0], "params.bid_request_url")), method: "GET", url: a, withCredentials: !0, data: i, bidderRequests: e ; , interpretResponse: function interpretResponse(e, l) { var f = e.body, m = [], v = l.data.ref; return 0 === Object.keys(f.slots).length || Object.keys(f.slots).forEach(function (e) var t = f.slots[e], r = e.split("), m; }, getUserSyncs: function getUserSyncs(e, t) var r = []; try e.pixelEnabled && t[0].body.sbi_px.forEach(function (e) r.push( type: e.type, url: e.url ); ); catch (e) return r; }; function l(e) return Object(y.deepAccess)(e, "mediaTypes.video") ? "" : e.params.sizes ? Object(y.parseSizesInput)(e.params.sizes).join(",") : Object(y.deepAccess)(e, "mediaTypes.banner.sizes") ? Object(y.parseSizesInput)(Object(y.deepAccess)(e, "mediaTypes.banner.sizes")).join(",") : e.sizes ? Object(y.parseSizesInput)(e.sizes).join(",") : void 0; function f(e) f=".concat(e.params.floor) : ""; var j = function j(i, s) return function (e, t) ; ; var m = function m(e) var r = 0 < arguments.length && void 0 !== e ? e : window; return function () var e = 0 < arguments.length && void 0 !== arguments[0] ? arguments[0] : 0, t = 1 < arguments.length && void 0 !== arguments[1] ? arguments[1] : Number.MAX_SAFE_INTEGER; return r.innerWidth >= e && r.innerWidth < t; ; ; function v() var e = 0 < arguments.length && void 0 !== arguments[0] ? arguments[0] : window, t = m(e), r = 992, n = 768; return t(0, 768) ? "mobile" : t(n, r) ? "tablet" : "desktop"; function O(i) i.renderer.push(function () var e = h(i.getSize().split("x"), 2), t = e[0], r = e[1], n = new window.SbiOutstreamRenderer(); n.init( vastUrl: i.vastUrl, height: r, width: t ), n.setRootElement(i.adUnitCode); ); Object(n.registerBidder)(a); } }, [770]); pbjsChunk([96], { 796: function _(e, t, r) e.exports = r(797); , 797: function _(e, t, r) { "use strict"; Object.defineProperty(t, "__esModule", value: !0 ), r.d(t, "spec", function () return i; ); var n = r(1), a = r(0), p = 12, c = 11, u = 0, g = 22, i = code: "teads", supportedMediaTypes: ["video"https://slate.com/news-and-politics/2020/10/,"banner"], isBidRequestValid: function isBidRequestValid(e) a.logError("Teads placementId and pageId parameters are required. Bid aborted."), n; , buildRequests: function buildRequests(e, t) var r, n = e.map(f), i = referrer: function (e) var t = ""; e && e.refererInfo && e.refererInfo.referer && (t = e.refererInfo.referer); return t; (t), pageReferrer: document.referrer, networkBandwidth: (r = window.navigator) && r.connection && 0 <= r.connection.downlink ? r.connection.downlink.toString() : "", timeToFirstByte: function (e) var t = e.performance (window), data: n, deviceWidth: screen.width, hb_version: "4.13.0" ; e[0].schain && (i.schain = e[0].schain); var a, s, o, d = t.gdprConsent; return t && d && (a = "boolean" == typeof d.gdprApplies, s = "string" == typeof d.consentString, o = a ? function (e, t, r) var n = p; e ? function (e, t) return e && 1 === t ? e.hasGlobalScope (t, r) && (n = c) : n = u; return n; (d.gdprApplies, d.vendorData, d.apiVersion) : g, i.gdpr_iab = consent: s ? d.consentString : "", status: o, apiVersion: d.apiVersion ), t && t.uspConsent && (i.us_privacy = t.uspConsent), method: "POST", url: "https://a.teads.tv/hb/bid-request", data: JSON.stringify(i) ; , interpretResponse: function interpretResponse(e) var r = []; return (e = e.body).responses && e.responses.forEach(function (e) var t = cpm: e.cpm, width: e.width, height: e.height, currency: e.currency, netRevenue: !0, ttl: e.ttl, ad: e.ad, requestId: e.bidId, creativeId: e.creativeId, placementId: e.placementId ; e.dealId && (t.dealId = e.dealId), r.push(t); ), r; ; function f(e) var t, r = , n = a.getValue(e.params, "placementId"), i = a.getValue(e.params, "pageId"); return r.sizes = (t = e, a.parseSizesInput(function (e) a.isArray(r) ? [n, r, t].reduce(function (t, e) return a.isArray(e) && (a.isArray(e[0]) ? e.forEach(function (e) t.push(e); ) : t.push(e)), t; , []) : e.sizes; (t))), r.bidId = a.getBidIdParameter("bidId", e), r.bidderRequestId = a.getBidIdParameter("bidderRequestId", e), r.placementId = parseInt(n, 10), r.pageId = parseInt(i, 10), r.adUnitCode = a.getBidIdParameter("adUnitCode", e), r.auctionId = a.getBidIdParameter("auctionId", e), r.transactionId = a.getBidIdParameter("transactionId", e), r; function s(e) return 0 < parseInt(e); Object(n.registerBidder)(i); } }, [796]); pbjsChunk([87], { 816: function _(e, r, t) e.exports = t(817); , 817: function _(e, r, t) { "use strict"; Object.defineProperty(r, "__esModule", value: !0 ), t.d(r, "tripleliftAdapterSpec", function () return m; ); var n = t(2), i = t(1), u = t(0), a = t(3); function p() function c(e) return (c = "function" == typeof Symbol && "symbol" == _typeof(Symbol.iterator) ? function (e) return _typeof(e); : function (e) return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : _typeof(e); )(e); function d(r, e) var t, n = Object.keys(r); return Object.getOwnPropertySymbols && (t = Object.getOwnPropertySymbols(r), e && (t = t.filter(function (e) return Object.getOwnPropertyDescriptor(r, e).enumerable; )), n.push.apply(n, t)), n; function s(i) for (var e = 1; e < arguments.length; e++) var o = null != arguments[e] ? arguments[e] : ; e % 2 ? d(Object(o), !0).forEach(function (e) var r, t, n; r = i, n = o[t = e], t in r ? Object.defineProperty(r, t, value: n, enumerable: !0, configurable: !0, writable: !0 ) : r[t] = n; ) : Object.getOwnPropertyDescriptors ? Object.defineProperties(i, Object.getOwnPropertyDescriptors(o)) : d(Object(o)).forEach(function (e) Object.defineProperty(i, e, Object.getOwnPropertyDescriptor(o, e)); ); return i; function f(e) return function (e) if (Array.isArray(e)) return o(e); (e) function o(e, r) (null == r var y = !0, l = null, m = { code: "triplelift", supportedMediaTypes: [n.b, n.d], isBidRequestValid: function isBidRequestValid(e) if (e.mediaTypes.video) !r.h) return !1; return void 0 !== e.params.inventoryCode; , buildRequests: function buildRequests(e, r) { var t, n = "https://tlx.3lift.com/header/auction?", i = function (e) { var r = , t = e[0].schain, n = function () var e = , r = p(, a.b.getConfig("fpd.context")), t = p(, a.b.getConfig("fpd.user")); return g(e, r), g(e, t), e; (); r.imp = e.map(function (e, r) { var t = id: r, tagid: e.params.inventoryCode, floor: function (e) var r = null; return null !== r ? r : e.params.floor; (e) ; return !function (e) if (!e.mediaTypes.video) return !1; if (!e.mediaTypes.video.context) return !1; return "instream" === e.mediaTypes.video.context.toLowerCase(); (e) ? e.mediaTypes.banner && (t.banner = format: S(e.sizes) ) : t.video = b(e), t; }); var i = [].concat(f(function (e) return v(e, "tdid"https://slate.com/news-and-politics/2020/10/,"adserver.org"https://slate.com/news-and-politics/2020/10/,"TDID"); (e)), f(function (e) return v(e, "idl_env"https://slate.com/news-and-politics/2020/10/,"liveramp.com"https://slate.com/news-and-politics/2020/10/,"idl"); (e)), f(function (e) return v(e, "criteoId"https://slate.com/news-and-politics/2020/10/,"criteo.com"https://slate.com/news-and-politics/2020/10/,"criteoId"); (e))); 0 < i.length && (r.user = ext: eids: i ); var o = function (e, r) (t.fpd = s(, r)); return t; (t, n); u.isEmpty(o) || (r.ext = o); return r; }(e); return n = u.tryAppendQueryString(n, "lib"https://slate.com/news-and-politics/2020/10/,"prebid"), n = u.tryAppendQueryString(n, "v"https://slate.com/news-and-politics/2020/10/,"4.13.0"), r && r.refererInfo && (t = r.refererInfo.referer, n = u.tryAppendQueryString(n, "referrer", t)), r && r.timeout && (n = u.tryAppendQueryString(n, "tmax", r.timeout)), r && r.gdprConsent && (void 0 !== r.gdprConsent.gdprApplies && (y = r.gdprConsent.gdprApplies, n = u.tryAppendQueryString(n, "gdpr", y.toString())), void 0 !== r.gdprConsent.consentString && (l = r.gdprConsent.consentString, n = u.tryAppendQueryString(n, "cmp_cs", l))), r && r.uspConsent && (n = u.tryAppendQueryString(n, "us_privacy", r.uspConsent)), !0 === a.b.getConfig("coppa") && (n = u.tryAppendQueryString(n, "coppa", !0)), n.lastIndexOf("&") === n.length - 1 && (n = n.substring(0, n.length - 1)), u.logMessage("tlCall request built: " + n), method: "POST", url: n, data: i, bidderRequest: r ; }, interpretResponse: function interpretResponse(e, r) { var t = r.bidderRequest; return (e.body.bids || []).map(function (e) return function (e, r) "", a = e.bids[r.imp_id]; 0 != r.cpm && r.ad && (t = requestId: a.bidId, cpm: r.cpm, width: n, height: i, netRevenue: !0, ad: r.ad, creativeId: u, dealId: o, currency: "USD", ttl: 300, tl_source: r.tl_source, meta: , a.mediaTypes.video && (t.vastXml = r.ad, t.mediaType = "video"), r.advertiser_name && (t.meta.advertiserName = r.advertiser_name)); return t; (t, e); ); }, getUserSyncs: function getUserSyncs(e, r, t, n) var i = function (e) if (!e) return; if (e.iframeEnabled) return "iframe"; if (e.pixelEnabled) return "image"; (e); if (i) var o = "https://eb2.3lift.com/sync?"; return "image" === i && (o = u.tryAppendQueryString(o, "px", 1), o = u.tryAppendQueryString(o, "src"https://slate.com/news-and-politics/2020/10/,"prebid")), null !== l && (o = u.tryAppendQueryString(o, "gdpr", y), o = u.tryAppendQueryString(o, "cmp_cs", l)), n && (o = u.tryAppendQueryString(o, "us_privacy", n)), [ type: i, url: o ]; }; function b(e) var r = s(s(, e.params.video), e.mediaTypes.video); return r.w function g(r, t) function v(e, r, t, n) { return e.map((u = r, function (e) return e && e.userId && e.userId[u]; )).filter(function (e) return !!e; ).map((i = t, o = n, function (e) return source: i, uids: [ id: e, ext: rtiPartner: o ] ; )); var i, o, u; } function S(e) return e.filter(h).map(function (e) return w: e[0], h: e[1] ; ); function h(e) return 2 === e.length && "number" == typeof e[0] && "number" == typeof e[1]; Object(i.registerBidder)(m); } }, [816]); pbjs.processQueue(); }, ]; window.modules["via.legacy"] = [function(require,module,exports){"use strict"; DS.service("via", function () { "use strict"; // remove `via` from url, to be used after amplitude logs it to prevent users from sharing such urls function removeFromLocation() var url = new URL(location.href); url.searchParams.delete("via"); history.replaceState(null, "", url.toString()); // and add `via` param to any outbound links function addViaToUrl(href, via) // keys correspond to "page_types" in editable_components.yml var PREFIXES = article: "article", homepage: "homepage", "vertical front": "section", "rubric front": "rubric" ; var pageType; function setPageType(amplitudePageType) pageType = PREFIXES[amplitudePageType]; var DELIMITER = "_"; function concatVia(node, via) var tag = node.dataset && node.dataset.via; if (tag) via = (via.length ? tag + DELIMITER : tag) + via; return via; function addToClickedLinks() document.documentElement.addEventListener("click", function (e) var a; var via = ""; // detect link nodes and collect via directives to append to the href var node = e.target; // the element where this event originated may have been removed from the dom, e.g. in the case of the OIL CMP which disappears after you interact with it while (node && node !== e.currentTarget) if (node.tagName === "A") a = node; via = concatVia(node, via); node = node.parentNode; if (a && via) if (pageType) via = pageType + DELIMITER + via; a.href = addViaToUrl(a.href, via); ); function addToSubmittedForms() document.documentElement.addEventListener("submit", function (e) var form = e.target; // collect via directives var via = ""; var node = e.target; while (node !== e.currentTarget) via = concatVia(node, via); node = node.parentNode; if (via) if (pageType) via = pageType + DELIMITER + via; // dynamically create a hidden input for the form url var input = document.createElement("input"); input.type = "hidden"; input.name = "via"; input.value = via; form.appendChild(input); ); // start listening only once, when first injected addToClickedLinks(); addToSubmittedForms(); return setPageType: setPageType, removeFromLocation: removeFromLocation ; }); }, ]; window.modules["visibility.legacy"] = [function(require,module,exports){"use strict"; DS.service("$visibility", ["$document"https://slate.com/news-and-politics/2020/10/,"$window"https://slate.com/news-and-politics/2020/10/,"_throttle"https://slate.com/news-and-politics/2020/10/,"Eventify", function ($document, $window, _throttle, Eventify) var list = [], Visible, VisibleEvent; /** * @param number a * @param number b * @returns * * @see http://jsperf.com/math-min-vs-if-condition-vs/8 */ function min(a, b) return a < b ? a : b; /** * @param number a * @param number b * @returns * * @see http://jsperf.com/math-min-vs-if-condition-vs/8 */ function max(a, b) return a > b ? a : b;

/**
* Fast loop through watched elements
*/

function onScroll()
list.forEach(updateVisibility);

/**
* updates seen property
* @param Visble item
* @param evt
* @fires Visible#shown
* @fires Visible#hidden
*/

function updateSeen(item, evt)
var px = evt.visiblePx,
percent = evt.visiblePercent; // if some pixels are visible and we're greater/equal to threshold

if (px && percent >= item.shownThreshold && !item.seen)
item.seen = true;
setTimeout(function ()
item.trigger("shown", new VisibleEvent("shown", evt));
, 15); // if no pixels or percent is less than threshold
else if ((!px
/**
* sets preload property
* @param Visible item
* @param evt
* @param Number innerHeight
* @fires Visible#preload
*/

function updatePreload(item, evt, innerHeight)
if (!item.preload && item.preloadThreshhold && shouldBePreloaded(evt.target, evt.rect, item.preloadThreshhold, innerHeight))
item.preload = true;
setTimeout(function ()
item.trigger("preload", new VisibleEvent("preload", evt));
, 15);

/**
* Trigger events
* @param Visible item
*/

function updateVisibility(item)
/**
* Return normalized viewport height
* @return number
*/

function getViewportHeight()
/**
* Return normalized viewport width
* @return number
*/

function getViewportWidth()
/**
* make sure an element isn't hidden by styles or etc
* @param Element el
* @return Boolean
*/

function isElementNotHidden(el)
return el && el.offsetParent !== null && !el.getAttribute("hidden") && getComputedStyle(el).display !== "none" && getComputedStyle(el).visibility !== "hidden";

/**
* Apparently the fastest way...
* @param Element el
* @returns boolean
* @example if (!$visibility.isElementInViewport(el)) ...
*/

function isElementInViewport(el)
/**
* @param Element el
* @param ClientRect rect
* @param Number preloadThreshhold
* @param Number innerHeight
* @return Boolean
*/

function shouldBePreloaded(el, rect, preloadThreshhold, innerHeight)
return rect.top <= innerHeight + preloadThreshhold && isElementNotHidden(el); /** * Create a one-dimensional spacial hash of x * @param number x * @param number stepSize * @param number optimalK * @param number base * @return number */ function getLinearSpacialHash(x, stepSize, optimalK, base) 1)), remainder = x % stepSize, result = index.toString(base); if (optimalK > 1)
result += getLinearSpacialHash(remainder, Math.floor(stepSize / base), optimalK - 1, base);

return result;

/**
* @param ClientRect rect
* @param number innerHeight
* @returns number
*/

function getVerticallyVisiblePixels(rect, innerHeight)
return min(innerHeight, max(rect.bottom, 0)) - min(max(rect.top, 0), innerHeight);

/**
* Get offset of element relative to entire page
*
* @param Element el
* @returns left: number, top: number
* @see http://jsperf.com/offset-vs-getboundingclientrect/7
*/

function getPageOffset(el)
var offsetLeft = el.offsetLeft,
offsetTop = el.offsetTop;

while (el = el.offsetParent)
offsetLeft += el.offsetLeft;
offsetTop += el.offsetTop;

return
left: offsetLeft,
top: offsetTop
;

/**
* Create a new Visible class to observe when elements enter and leave the viewport
*
* Call destroy function to stop listening (this is until we have better support for watching for Node Removal)
* @param Element el
* @param shownThreshold: number, hiddenThreshold: number [options]
* @class
* @example this.visible = new $visibility.Visible(el);
*/

Visible = function Visible(el, options)
options = options ;

Visible.prototype =
/**
* Stop triggering.
*/
destroy: function destroy()
// remove from list
list.splice(list.indexOf(this), 1);

/**
* @name Visible#on
* @function
* @param 'hidden' e EventName
* @param function cb Callback
*/

/**
* @name Visible#trigger
* @function
* @param 'shown' e
* @param
*/

;
Eventify.enable(Visible.prototype);

VisibleEvent = function VisibleEvent(type, options)
var _this = this;

this.type = type;
Object.keys(options).forEach(function (key)
_this[key] = options[key];
);
; // listen for scroll events (throttled)

$document.addEventListener("scroll", _throttle(onScroll, 200)); // public

this.getPageOffset = getPageOffset;
this.getLinearSpacialHash = getLinearSpacialHash;
this.getVerticallyVisiblePixels = getVerticallyVisiblePixels;
this.getViewportHeight = getViewportHeight;
this.getViewportWidth = getViewportWidth;
this.isElementNotHidden = isElementNotHidden;
this.isElementInViewport = isElementInViewport;
this.Visible = Visible;
]);
}, ];
require=(function e(t,n,r){function s(o,u){if(!n[o])if(!t[o])var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",fvar l=n[o]=exports:;t[o][0].call(l.exports,function(e)var n=t[o][1][e];return s(n?n:e),l,l.exports,e,t,n,r)return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o

Next Post

Donald Trump's solution sauce for not paying his debts

This, from The New York Situations about a Chicago skyscraper crafted by Trump that led to him to incur $287 million in unpaid personal debt by 2010, is extraordinary: “When the task encountered complications, he attempted to stroll absent from his enormous debts. For most individuals or companies, that would […]