1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00
Files
netbox-community-netbox/netbox/project-static/dist/netbox.js

68 lines
305 KiB
JavaScript
Raw Normal View History

(()=>{var iv=Object.create;var Un=Object.defineProperty,rv=Object.defineProperties,ov=Object.getOwnPropertyDescriptor,sv=Object.getOwnPropertyDescriptors,av=Object.getOwnPropertyNames,Cl=Object.getOwnPropertySymbols,lv=Object.getPrototypeOf,Ll=Object.prototype.hasOwnProperty,cv=Object.prototype.propertyIsEnumerable;var ko=(t,e,n)=>e in t?Un(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,V=(t,e)=>{for(var n in e||(e={}))Ll.call(e,n)&&ko(t,n,e[n]);if(Cl)for(var n of Cl(e))cv.call(e,n)&&ko(t,n,e[n]);return t},Vi=(t,e)=>rv(t,sv(e)),Dl=t=>Un(t,"__esModule",{value:!0});var C=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),uv=(t,e)=>{Dl(t);for(var n in e)Un(t,n,{get:e[n],enumerable:!0})},fv=(t,e,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of av(e))!Ll.call(t,i)&&i!=="default"&&Un(t,i,{get:()=>e[i],enumerable:!(n=ov(e,i))||n.enumerable});return t},Me=t=>fv(Dl(Un(t!=null?iv(lv(t)):{},"default",t&&t.__esModule&&"default"in t?{get:()=>t.default,enumerable:!0}:{value:t,enumerable:!0})),t);var X=(t,e,n)=>(ko(t,typeof e!="symbol"?e+"":e,n),n);var Ue=(t,e,n)=>new Promise((i,o)=>{var s=f=>{try{c(n.next(f))}catch(u){o(u)}},a=f=>{try{c(n.throw(f))}catch(u){o(u)}},c=f=>f.done?i(f.value):Promise.resolve(f.value).then(s,a);c((n=n.apply(t,e)).next())});var pe=C((rk,fu)=>{var vr=function(t){return t&&t.Math==Math&&t};fu.exports=vr(typeof globalThis=="object"&&globalThis)||vr(typeof window=="object"&&window)||vr(typeof self=="object"&&self)||vr(typeof global=="object"&&global)||function(){return this}()||Function("return this")()});var me=C((ok,du)=>{du.exports=function(t){try{return!!t()}catch(e){return!0}}});var Mt=C((sk,hu)=>{var c_=me();hu.exports=!c_(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!=7})});var ps=C(gu=>{"use strict";var pu={}.propertyIsEnumerable,mu=Object.getOwnPropertyDescriptor,u_=mu&&!pu.call({1:2},1);gu.f=u_?function(e){var n=mu(this,e);return!!n&&n.enumerable}:pu});var br=C((lk,vu)=>{vu.exports=function(t,e){return{enumerable:!(t&1),configurable:!(t&2),writable:!(t&4),value:e}}});var Dn=C((ck,bu)=>{var f_={}.toString;bu.exports=function(t){return f_.call(t).slice(8,-1)}});var vi=C((uk,yu)=>{var d_=me(),h_=Dn(),p_="".split;yu.exports=d_(function(){return!Object("z").propertyIsEnumerable(0)})?function(t){return h_(t)=="String"?p_.call(t,""):Object(t)}:Object});var rn=C((fk,Eu)=>{Eu.exports=function(t){if(t==null)throw TypeError("Can't call method on "+t);return t}});var bi=C((dk,_u)=>{var m_=vi(),g_=rn();_u.exports=function(t){return m_(g_(t))}});var qe=C((hk,Su)=>{Su.exports=function(t){return typeof t=="object"?t!==null:typeof t=="function"}});var ms=C((pk,wu)=>{var yr=qe();wu.exports=function(t,e){if(!yr(t))return t;var n,i;if(e&&typeof(n=t.toString)=="function"&&!yr(i=n.call(t))||typeof(n=t.valueOf)=="function"&&!yr(i=n.call(t))||!e&&typeof(n=t.toString)=="function"&&!yr(i=n.call(t)))return i;throw TypeError("Can't convert object to primitive value")}});var on=C((mk,Tu)=>{var v_=rn();Tu.exports=function(t){return Object(v_(t))}});var $e=C((gk,xu)=>{var b_=on(),y_={}.hasOwnProperty;xu.exports=Object.hasOwn||function(e,n){return y_.call(b_(e),n)}});var vs=C((vk,Au)=>{var E_=pe(),Ou=qe(),gs=E_.document,__=Ou(gs)&&Ou(gs.createElement);Au.exports=function(t){return __?gs.createElement(t):{}}});var bs=C((bk,Cu)=>{var S_=Mt(),w_=me(),T_=vs();Cu.exports=!S_&&!w_(function(){return Object.defineProperty(T_("div"),"a",{get:function(){return 7}}).a!=7})});var ys=C(Du=>{var x_=Mt(),O_=ps(),A_=br(),C_=bi(),L_=ms(),D_=$e(),M_=bs(),Lu=Object.getOwnPropertyDescriptor;Du.f=x_?Lu:function(e,n){if(e=C_(e),n=L_(n,!0),M_)try{return Lu(e,n)}catch(i){}if(D_(e,n))return A_(!O_.f.call(e,n),e[n])}});var Fe=C((Ek,Mu)=>{var I_=qe();Mu.exports=function(t){if(!I_(t))throw TypeError(String(t)+" is not an object");return t}});var It=C(Nu=>{var k_=Mt(),N_=bs(),Iu=Fe(),P_=ms(),ku=Object.defineProperty;Nu.f=k_?ku:function(e,n,i){if(Iu(e),n=P_(n,!0),Iu(i),N_)try{return ku(e,n,i)}catch(o){}if("get"in i||"set"in i)throw TypeError("Accessors not supported");return"value"in i&&(e[n]=i.v
\v\f\r \xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF`});var nh=C((NN,th)=>{var KT=rn(),GT=la(),$r="["+GT+"]",XT=RegExp("^"+$r+$r+"*"),QT=RegExp($r+$r+"*$"),ca=function(t){return function(e){var n=String(KT(e));return t&1&&(n=n.replace(XT,"")),t&2&&(n=n.replace(QT,"")),n}};th.exports={start:ca(1),end:ca(2),trim:ca(3)}});var oh=C((PN,rh)=>{var JT=pe(),ZT=nh().trim,ih=la(),Fr=JT.parseInt,ex=/^[+-]?0[Xx]/,tx=Fr(ih+"08")!==8||Fr(ih+"0x16")!==22;rh.exports=tx?function(e,n){var i=ZT(String(e));return Fr(i,n>>>0||(ex.test(i)?16:10))}:Fr});var ua=C((jN,lh)=>{var ix=_i(),rx=rn(),ah=function(t){return function(e,n){var i=String(rx(e)),o=ix(n),s=i.length,a,c;return o<0||o>=s?t?"":void 0:(a=i.charCodeAt(o),a<55296||a>56319||o+1===s||(c=i.charCodeAt(o+1))<56320||c>57343?t?i.charAt(o):a:t?i.slice(o,o+2):(a-55296<<10)+(c-56320)+65536)}};lh.exports={codeAt:ah(!1),charAt:ah(!0)}});var fa=C((qN,fh)=>{var cx=ln();fh.exports=function(t,e,n){for(var i in e)cx(t,i,e[i],n);return t}});var hh=C(($N,dh)=>{var ux=me();dh.exports=!ux(function(){return Object.isExtensible(Object.preventExtensions({}))})});var Br=C((FN,ph)=>{var fx=yi(),dx=qe(),da=$e(),hx=It().f,px=Tr(),mx=hh(),fn=px("meta"),gx=0,ha=Object.isExtensible||function(){return!0},pa=function(t){hx(t,fn,{value:{objectID:"O"+ ++gx,weakData:{}}})},vx=function(t,e){if(!dx(t))return typeof t=="symbol"?t:(typeof t=="string"?"S":"P")+t;if(!da(t,fn)){if(!ha(t))return"F";if(!e)return"E";pa(t)}return t[fn].objectID},bx=function(t,e){if(!da(t,fn)){if(!ha(t))return!0;if(!e)return!1;pa(t)}return t[fn].weakData},yx=function(t){return mx&&Ex.REQUIRED&&ha(t)&&!da(t,fn)&&pa(t),t},Ex=ph.exports={REQUIRED:!1,fastKey:vx,getWeakData:bx,onFreeze:yx};fx[fn]=!0});var gh=C((BN,mh)=>{var _x=Te(),Sx=Mn(),wx=_x("iterator"),Tx=Array.prototype;mh.exports=function(t){return t!==void 0&&(Sx.Array===t||Tx[wx]===t)}});var bh=C((zN,vh)=>{var xx=aa(),Ox=Mn(),Ax=Te(),Cx=Ax("iterator");vh.exports=function(t){if(t!=null)return t[Cx]||t["@@iterator"]||Ox[xx(t)]}});var Eh=C((WN,yh)=>{var Lx=Fe();yh.exports=function(t){var e=t.return;if(e!==void 0)return Lx(e.call(t)).value}});var ma=C((VN,Sh)=>{var Dx=Fe(),Mx=gh(),Ix=cn(),kx=Ns(),Nx=bh(),_h=Eh(),Ai=function(t,e){this.stopped=t,this.result=e};Sh.exports=function(t,e,n){var i=n&&n.that,o=!!(n&&n.AS_ENTRIES),s=!!(n&&n.IS_ITERATOR),a=!!(n&&n.INTERRUPTED),c=kx(e,i,1+o+a),f,u,l,m,d,p,v,y=function(b){return f&&_h(f),new Ai(!0,b)},h=function(b){return o?(Dx(b),a?c(b[0],b[1],y):c(b[0],b[1])):a?c(b,y):c(b)};if(s)f=t;else{if(u=Nx(t),typeof u!="function")throw TypeError("Target is not iterable");if(Mx(u)){for(l=0,m=Ix(t.length);m>l;l++)if(d=h(t[l]),d&&d instanceof Ai)return d;return new Ai(!1)}f=u.call(t)}for(p=f.next;!(v=p.call(f)).done;){try{d=h(v.value)}catch(b){throw _h(f),b}if(typeof d=="object"&&d&&d instanceof Ai)return d}return new Ai(!1)}});var ga=C((YN,wh)=>{wh.exports=function(t,e,n){if(!(t instanceof e))throw TypeError("Incorrect "+(n?n+" ":"")+"invocation");return t}});var Ch=C((UN,Ah)=>{var Px=Te(),Th=Px("iterator"),xh=!1;try{Oh=0,va={next:function(){return{done:!!Oh++}},return:function(){xh=!0}},va[Th]=function(){return this},Array.from(va,function(){throw 2})}catch(t){}var Oh,va;Ah.exports=function(t,e){if(!e&&!xh)return!1;var n=!1;try{var i={};i[Th]=function(){return{next:function(){return{done:n=!0}}}},t(i)}catch(o){}return n}});var Mh=C((KN,Dh)=>{var Rx=qe(),Lh=ea();Dh.exports=function(t,e,n){var i,o;return Lh&&typeof(i=e.constructor)=="function"&&i!==n&&Rx(o=i.prototype)&&o!==n.prototype&&Lh(t,o),t}});var Nh=C((GN,kh)=>{"use strict";var jx=yt(),Hx=pe(),Ih=Ms(),qx=ln(),$x=Br(),Fx=ma(),Bx=ga(),ba=qe(),ya=me(),zx=Ch(),Wx=Pr(),Vx=Mh();kh.exports=function(t,e,n){var i=t.indexOf("Map")!==-1,o=t.indexOf("Weak")!==-1,s=i?"set":"add",a=Hx[t],c=a&&a.prototype,f=a,u={},l=function(b){var S=c[b];qx(c,b,b=="add"?function(O){return S.call(this,O===0?0:O),this}:b=="delete"?function(A){return o&&!ba(A)?!1:S.call(this,A===0?0:A)}:b=="get"?function(O){return o&&!ba(O)?void 0:S.call(this,O===0?0:O)}:b=="has"?function(O){retu
`)&&t.flags==="s")})});var Yp=C((yR,Vp)=>{var G0=me();Vp.exports=G0(function(){var t=RegExp("(?<a>b)","string".charAt(5));return t.exec("b").groups.a!=="b"||"b".replace(t,"$<a>c")!=="bc"})});var oo=C((ER,Gp)=>{"use strict";var X0=qp(),Up=Bp(),Q0=wr(),J0=Nr(),Z0=an().get,eA=Wp(),tA=Yp(),ro=RegExp.prototype.exec,nA=Q0("native-string-replace",String.prototype.replace),Ka=ro,Ga=function(){var t=/a/,e=/b*/g;return ro.call(t,"a"),ro.call(e,"a"),t.lastIndex!==0||e.lastIndex!==0}(),Kp=Up.UNSUPPORTED_Y||Up.BROKEN_CARET,Xa=/()??/.exec("")[1]!==void 0,iA=Ga||Xa||Kp||eA||tA;iA&&(Ka=function(e){var n=this,i=Z0(n),o=i.raw,s,a,c,f,u,l,m;if(o)return o.lastIndex=n.lastIndex,s=Ka.call(o,e),n.lastIndex=o.lastIndex,s;var d=i.groups,p=Kp&&n.sticky,v=X0.call(n),y=n.source,h=0,b=e;if(p&&(v=v.replace("y",""),v.indexOf("g")===-1&&(v+="g"),b=String(e).slice(n.lastIndex),n.lastIndex>0&&(!n.multiline||n.multiline&&e[n.lastIndex-1]!==`
`)&&(y="(?: "+y+")",b=" "+b,h++),a=new RegExp("^(?:"+y+")",v)),Xa&&(a=new RegExp("^"+y+"$(?!\\s)",v)),Ga&&(c=n.lastIndex),f=ro.call(p?a:n,b),p?f?(f.input=f.input.slice(h),f[0]=f[0].slice(h),f.index=n.lastIndex,n.lastIndex+=f[0].length):n.lastIndex=0:Ga&&f&&(n.lastIndex=n.global?f.index+f[0].length:c),Xa&&f&&f.length>1&&nA.call(f[0],a,function(){for(u=1;u<arguments.length-2;u++)arguments[u]===void 0&&(f[u]=void 0)}),f&&d)for(f.groups=l=J0(null),u=0;u<d.length;u++)m=d[u],l[m[0]]=f[m[1]];return f});Gp.exports=Ka});var Qa=C(()=>{"use strict";var rA=yt(),Xp=oo();rA({target:"RegExp",proto:!0,forced:/./.exec!==Xp},{exec:Xp})});var Za=C((wR,em)=>{"use strict";Qa();var Qp=ln(),oA=oo(),Jp=me(),Zp=Te(),sA=et(),aA=Zp("species"),Ja=RegExp.prototype;em.exports=function(t,e,n,i){var o=Zp(t),s=!Jp(function(){var u={};return u[o]=function(){return 7},""[t](u)!=7}),a=s&&!Jp(function(){var u=!1,l=/a/;return t==="split"&&(l={},l.constructor={},l.constructor[aA]=function(){return l},l.flags="",l[o]=/./[o]),l.exec=function(){return u=!0,null},l[o](""),!u});if(!s||!a||n){var c=/./[o],f=e(o,""[t],function(u,l,m,d,p){var v=l.exec;return v===oA||v===Ja.exec?s&&!p?{done:!0,value:c.call(l,m,d)}:{done:!0,value:u.call(m,l,d)}:{done:!1}});Qp(String.prototype,t,f[0]),Qp(Ja,o,f[1])}i&&sA(Ja[o],"sham",!0)}});var el=C((TR,tm)=>{"use strict";var lA=ua().charAt;tm.exports=function(t,e,n){return e+(n?lA(t,e).length:1)}});var tl=C((xR,nm)=>{var cA=Dn(),uA=oo();nm.exports=function(t,e){var n=t.exec;if(typeof n=="function"){var i=n.call(t,e);if(typeof i!="object")throw TypeError("RegExp exec method returned something other than an Object or null");return i}if(cA(t)!=="RegExp")throw TypeError("RegExp#exec called on incompatible receiver");return uA.call(t,e)}});var om=C((AR,rm)=>{var gA=on(),vA=Math.floor,bA="".replace,yA=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,EA=/\$([$&'`]|\d{1,2})/g;rm.exports=function(t,e,n,i,o,s){var a=n+t.length,c=i.length,f=EA;return o!==void 0&&(o=gA(o),f=yA),bA.call(s,f,function(u,l){var m;switch(l.charAt(0)){case"$":return"$";case"&":return t;case"`":return e.slice(0,n);case"'":return e.slice(a);case"<":m=o[l.slice(1,-1)];break;default:var d=+l;if(d===0)return u;if(d>c){var p=vA(d/10);return p===0?u:p<=c?i[p-1]===void 0?l.charAt(1):i[p-1]+l.charAt(1):u}m=i[d-1]}return m===void 0?"":m})}});var um=C(ol=>{"use strict";ol.parse=qA;ol.serialize=$A;var RA=decodeURIComponent,jA=encodeURIComponent,HA=/; */,co=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;function qA(t,e){if(typeof t!="string")throw new TypeError("argument str must be a string");for(var n={},i=e||{},o=t.split(HA),s=i.decode||RA,a=0;a<o.length;a++){var c=o[a],f=c.indexOf("=");if(!(f<0)){var u=c.substr(0,f).trim(),l=c.substr(++f,c.length).trim();l[0]=='"'&&(l=l.slice(1,-1)),n[u]==null&&(n[u]=FA(l,s))}}return n}function $A(t,e,n){var i=n||{},o=i.encode||jA;if(typeof o!="function")throw new TypeError("option encode is invalid");if(!co.test(t))throw new TypeError("argument name is invalid");var s=o(e);if(s&&!co.test(s))throw new TypeError("argument val is invalid");var a=t+"="+s;if(i.maxAge!=null){var c=i.maxAge-0;if(isNaN(c)||!isFinite(c))throw new TypeError("option maxAge is invalid");a+="; Max-Age="+Math.floor(c)}if(i.domain){if(!co.test(i.domain))throw new TypeError("option domain is invalid");a+="; Domain="+i.domain}if(i.path){if(!co.test(i.path))throw new TypeError("option path is invalid");a+="; Path="+i.path}if(i.expires){if(typeof i.expires.toUTCString!="function")throw new TypeError("option expires is invalid");a+="; Expires="+i.expires.toUTCString()}if(i.httpOnly&&(a+="; HttpOnly"),i.secure&&(a+="; Secure"),i.sameSite){var f=typeof i.sameSite=="string"?i.sameSite.toLowerCase():i.sameSite;switch(f){case!0:a+="; SameSite=Strict";break;case"lax":a+="; SameSite=Lax";break;case"strict":a+="; SameSite=Strict";break;case"none":a+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}}return a}function FA(t,e){try{return e(t)}catch(n){return t}}});var cl=C((Em,fo)=>{(function(t,e){typeof define=="function"&&define.amd?define(e):typeof fo=="object"&&fo.exports?fo.expo
<span class='flatpickr-weekday'>
`+E.join("</span><span class='flatpickr-weekday'>")+`
</span>
`}}function jg(){r.calendarContainer.classList.add("hasWeeks");var g=u("div","flatpickr-weekwrapper");g.appendChild(u("span","flatpickr-weekday",r.l10n.weekAbbreviation));var E=u("div","flatpickr-weeks");return g.appendChild(E),{weekWrapper:g,weekNumbers:E}}function xo(g,E){E===void 0&&(E=!0);var w=E?g:g-r.currentMonth;w<0&&r._hidePrevMonthArrow===!0||w>0&&r._hideNextMonthArrow===!0||(r.currentMonth+=w,(r.currentMonth<0||r.currentMonth>11)&&(r.currentYear+=r.currentMonth>11?1:-1,r.currentMonth=(r.currentMonth+12)%12,Z("onYearChange"),Bn()),Hi(),Z("onMonthChange"),Bi())}function Hg(g,E){g===void 0&&(g=!0),E===void 0&&(E=!0),r.input.value="",r.altInput!==void 0&&(r.altInput.value=""),r.mobileInput!==void 0&&(r.mobileInput.value=""),r.selectedDates=[],r.latestSelectedDateObj=void 0,E===!0&&(r.currentYear=r._initialDate.getFullYear(),r.currentMonth=r._initialDate.getMonth()),r.showTimeInput=!1,r.config.enableTime===!0&&ye(),r.redraw(),g&&Z("onChange")}function qg(){r.isOpen=!1,r.isMobile||(r.calendarContainer!==void 0&&r.calendarContainer.classList.remove("open"),r._input!==void 0&&r._input.classList.remove("active")),Z("onClose")}function $g(){r.config!==void 0&&Z("onDestroy");for(var g=r._handlers.length;g--;){var E=r._handlers[g];E.element.removeEventListener(E.event,E.handler,E.options)}if(r._handlers=[],r.mobileInput)r.mobileInput.parentNode&&r.mobileInput.parentNode.removeChild(r.mobileInput),r.mobileInput=void 0;else if(r.calendarContainer&&r.calendarContainer.parentNode)if(r.config.static&&r.calendarContainer.parentNode){var w=r.calendarContainer.parentNode;if(w.lastChild&&w.removeChild(w.lastChild),w.parentNode){for(;w.firstChild;)w.parentNode.insertBefore(w.firstChild,w);w.parentNode.removeChild(w)}}else r.calendarContainer.parentNode.removeChild(r.calendarContainer);r.altInput&&(r.input.type="text",r.altInput.parentNode&&r.altInput.parentNode.removeChild(r.altInput),delete r.altInput),r.input&&(r.input.type=r.input._type,r.input.classList.remove("flatpickr-input"),r.input.removeAttribute("readonly"),r.input.value=""),["_showTimeInput","latestSelectedDateObj","_hideNextMonthArrow","_hidePrevMonthArrow","__hideNextMonthArrow","__hidePrevMonthArrow","isMobile","isOpen","selectedDateElem","minDateHasTime","maxDateHasTime","days","daysContainer","_input","_positionElement","innerContainer","rContainer","monthNav","todayDateElem","calendarContainer","weekdayContainer","prevMonthNav","nextMonthNav","monthsDropdownContainer","currentMonthElement","currentYearElement","navigationCurrentMonth","selectedDateElem","config"].forEach(function(I){try{delete r[I]}catch(R){}})}function zn(g){return r.config.appendTo&&r.config.appendTo.contains(g)?!0:r.calendarContainer.contains(g)}function Oo(g){if(r.isOpen&&!r.config.inline){var E=p(g),w=zn(E),I=E===r.input||E===r.altInput||r.element.contains(E)||g.path&&g.path.indexOf&&(~g.path.indexOf(r.input)||~g.path.indexOf(r.altInput)),R=g.type==="blur"?I&&g.relatedTarget&&!zn(g.relatedTarget):!I&&!w&&!zn(g.relatedTarget),P=!r.config.ignoredFocusElements.some(function(q){return q.contains(E)});R&&P&&(r.timeContainer!==void 0&&r.minuteElement!==void 0&&r.hourElement!==void 0&&ee(),r.close(),r.config.mode==="range"&&r.selectedDates.length===1&&(r.clear(!1),r.redraw()))}}function qi(g){if(!(!g||r.config.minDate&&g<r.config.minDate.getFullYear()||r.config.maxDate&&g>r.config.maxDate.getFullYear())){var E=g,w=r.currentYear!==E;r.currentYear=E||r.currentYear,r.config.maxDate&&r.currentYear===r.config.maxDate.getFullYear()?r.currentMonth=Math.min(r.config.maxDate.getMonth(),r.currentMonth):r.config.minDate&&r.currentYear===r.config.minDate.getFullYear()&&(r.currentMonth=Math.max(r.config.minDate.getMonth(),r.currentMonth)),w&&(r.redraw(),Z("onYearChange"),Bn())}}function jt(g,E){E===void 0&&(E=!0);var w=r.parseDate(g,void 0,E);if(r.config.minDate&&w&&k(w,r.config.minDate,E!==void 0?E:!r.minDateHasTime)<0||r.config.maxDate&&w&&k(w,r.config.maxDate,E!==void 0?E:!r.maxDateHasTime)>0)return!1;if(r.config.enable.length===0&&r.config.disable.length===0)return!0;if(w===void 0)return!1;for(var I=r.
`)}:!a.ok&&"detail"in f?{error:f.detail}:f})}function uo(t,e){return Ue(this,null,function*(){return yield hm(t,"PATCH",e)})}function zA(t){return Ue(this,null,function*(){return yield hm(t,"GET")})}function pm(t){return Ue(this,null,function*(){return yield zA(t)})}function*H(...t){for(let e of t)for(let n of document.querySelectorAll(e))n!==null&&(yield n)}function vn(t){return document.getElementById(t)}function mm(t,e=0){let n=e,i=document.getElementById("content-title");i!==null&&(n+=i.getBoundingClientRect().bottom);let o=t.getBoundingClientRect().top+window.pageYOffset+n;window.scrollTo({top:o,behavior:"smooth"})}function gm(t){let e=[];for(let n of t.querySelectorAll("select"))if(n!==null){let i={name:n.name,options:[]};for(let o of n.options)o.selected&&i.options.push(o.value);e=[...e,i]}return e}function*vm(t){for(let e of t.querySelectorAll("td"))e!==null&&se(e.innerText)&&e.innerText!=="\u2014"&&(yield e.innerText.replaceAll(/[\n\r]/g,"").trim())}function Ae(t,e,n){function i(s){return!!(typeof n=="string"&&s!==null&&s.matches(n))}function o(s){if(s!==null&&s.parentElement!==null&&!i(s)){for(let a of s.parentElement.querySelectorAll(e))if(a!==null)return a;return o(s.parentElement.parentElement)}return null}return o(t)}function WA(t){t.preventDefault();let e=t.currentTarget;if(e!==null){let n=Ae(e,"form"),i=e.getAttribute("href");n!==null&&se(i)&&(n.setAttribute("action",i),n.submit())}}function VA(){for(let t of H("a.formaction"))t.addEventListener("click",WA)}function YA(){for(let t of H("a.set_speed"))if(t!==null){let e=function(n){n.preventDefault();let i=t.getAttribute("data"),o=document.getElementById(t.target);o!==null&&i!==null&&(o.value=i)};t.addEventListener("click",e)}}function UA(t,e){let n=new Set;for(let i of e.querySelectorAll("*[name]"))i.validity.valid?(i.classList.contains("is-invalid")&&i.classList.remove("is-invalid"),i.classList.contains("is-valid")||i.classList.add("is-valid")):(n.add(i.name),i.classList.contains("is-valid")&&i.classList.remove("is-valid"),i.classList.contains("is-invalid")||i.classList.add("is-invalid"));if(n.size!==0){let i=e.elements.namedItem(Array.from(n)[0]);mm(i),t.preventDefault()}}function KA(){for(let t of H("form")){let e=t.querySelectorAll("button[type=submit]");for(let n of e)n.addEventListener("click",i=>UA(i,t))}}function GA(t){let e=Array.from(t.options);for(let n=1;n<e.length;n++){let i=e[n];i.selected&&(t.removeChild(i),t.insertBefore(i,t.options[n-1]))}}function XA(t){let e=Array.from(t.options);for(let n=e.length-2;n>=0;n--){let i=e[n];if(i.selected){let o=t.options[n+1];i=t.removeChild(i),o=t.replaceChild(i,o),t.insertBefore(o,i)}}}function QA(){for(let t of H("#move-option-up")){let e=t.getAttribute("data-target");if(e!==null)for(let n of H(`#${e}`))t.addEventListener("click",()=>GA(n))}for(let t of H("#move-option-down")){let e=t.getAttribute("data-target");if(e!==null)for(let n of H(`#${e}`))t.addEventListener("click",()=>XA(n))}}var bm={region:{hide:["id_sitegroup","id_site","id_location","id_rack","id_clustergroup","id_cluster"],show:["id_region"]},"site group":{hide:["id_region","id_site","id_location","id_rack","id_clustergroup","id_cluster"],show:["id_sitegroup"]},site:{hide:["id_location","id_rack","id_clustergroup","id_cluster"],show:["id_region","id_sitegroup","id_site"]},location:{hide:["id_rack","id_clustergroup","id_cluster"],show:["id_region","id_sitegroup","id_site","id_location"]},rack:{hide:["id_clustergroup","id_cluster"],show:["id_region","id_sitegroup","id_site","id_location","id_rack"]},"cluster group":{hide:["id_region","id_sitegroup","id_site","id_location","id_rack","id_cluster"],show:["id_clustergroup"]},cluster:{hide:["id_region","id_sitegroup","id_site","id_location","id_rack"],show:["id_clustergroup","id_cluster"]},default:{hide:["id_region","id_sitegroup","id_site","id_location","id_rack","id_clustergroup","id_cluster"],show:[]}};function ll(t,e){var n,i;for(let o of H(t))e==="show"?(n=o.parentElement)==null||n.classList.remove("d-none","invisible"):(i=o.parentElement)==null||i.classList.add("d-none","invisible")}functi
div.ss-values div.ss-value[data-id="${n}"],
div.ss-list div.ss-option:not(.ss-disabled)[data-id="${n}"]
{
background-color: ${s} !important;
color: ${a} !important;
}
`.replaceAll(`
`,"").trim(),document.head.appendChild(o)}}resetClasses(){let e=this.slim.slim;if(e)for(let n of this.base.classList)e.container.classList.remove(n)}initResetButton(){let e=Ae(this.base,"button[data-reset-select");e!==null&&e.addEventListener("click",()=>{this.base.value="",this.base.multiple?this.slim.setSelected([]):this.slim.setSelected("")})}};function rg(){for(let t of H(".netbox-api-select"))new ig(t)}function og(t){return typeof t.value=="string"&&t.value!==""}function sg(){for(let t of H("select.netbox-color-select")){let n=function(i){if(e.slim.singleSelected!==null)if(og(i)){let o=`#${i.value}`,s=Pi(o);e.slim.singleSelected.container.style.backgroundColor=o,e.slim.singleSelected.container.style.color=s}else e.slim.singleSelected.container.removeAttribute("style")};for(let i of t.options)if(og(i)){let o=`#${i.value}`,s=Pi(o);i.style.backgroundColor=o,i.style.color=s}let e=new $n({select:t,allowDeselect:!0,deselectLabel:'<i class="mdi mdi-close-circle" style="color: currentColor;"></i>'});for(let i of e.data.data)if("selected"in i&&i.selected){n(i);break}for(let i of t.classList)e.slim.container.classList.remove(i);e.onChange=n}}function ag(){for(let t of H(".netbox-static-select"))if(t!==null){let e=document.querySelector(`label[for=${t.id}]`),n;e!==null&&(n=`Select ${e.innerText.trim()}`);let i=new $n({select:t,allowDeselect:!0,deselectLabel:'<i class="mdi mdi-close-circle"></i>',placeholder:n});for(let o of t.classList)i.slim.container.classList.remove(o)}}function lg(){for(let t of[rg,sg,ag])t()}var Fn="netbox-color-mode",DC="Light Mode",MC="Dark Mode",cg="mdi-lightbulb-on",ug="mdi-lightbulb";function IC(t){return t==="dark"||t==="light"}function kC(t){return localStorage.setItem(Fn,t)}function NC(t){var e,n;document.documentElement.setAttribute(`data-${Fn}`,t);for(let i of H("span.color-mode-text"))t==="light"?i.innerText=MC:t==="dark"&&(i.innerText=DC);for(let i of H("i.color-mode-icon","span.color-mode-icon"))t==="light"?(i.classList.remove(cg),i.classList.add(ug)):t==="dark"&&(i.classList.remove(ug),i.classList.add(cg));for(let i of H(".rack_elevation")){let o=(n=(e=i.contentDocument)==null?void 0:e.querySelector("svg"))!=null?n:null;o!==null&&o.setAttribute(`data-${Fn}`,t)}}function Ve(t){for(let e of[kC,NC])e(t)}function PC(){let t=localStorage.getItem(Fn);t==="light"?Ve("dark"):t==="dark"?Ve("light"):console.warn("Unable to determine the current color mode")}function RC(){let t=localStorage.getItem(Fn),e=document.documentElement.getAttribute(`data-${Fn}`);if(se(e)&&se(t))return Ve(t);let n="none";for(let i of["dark","light"])if(window.matchMedia(`(prefers-color-scheme: ${i})`).matches){n=i;break}if(se(t)&&!se(e)&&IC(t))return Ve(t);switch(n){case"dark":return Ve("dark");case"light":return Ve("light");case"none":return Ve("light");default:return Ve("light")}}function jC(){for(let t of H("button.color-mode-toggle"))t.addEventListener("click",PC)}function fg(){window.addEventListener("load",RC);for(let t of[jC])t()}function HC(t){let e=t.getAttribute("data"),n=t.classList.contains("connected"),i=n?"planned":"connected";se(e)&&uo(`/api/dcim/cables/${e}/`,{status:i}).then(o=>{var s;if(jn(o)){Hn("danger","Error",o.error).show();return}else{let a=(s=t.parentElement)==null?void 0:s.parentElement,c=t.querySelector("i.mdi, span.mdi");n?(a.classList.remove("success"),a.classList.add("info"),t.classList.remove("connected","btn-warning"),t.classList.add("btn-info"),t.title="Mark Installed",c.classList.remove("mdi-lan-disconnect"),c.classList.add("mdi-lan-connect")):(a.classList.remove("info"),a.classList.add("success"),t.classList.remove("btn-success"),t.classList.add("connected","btn-warning"),t.title="Mark Installed",c.classList.remove("mdi-lan-connect"),c.classList.add("mdi-lan-disconnect"))}})}function qC(){for(let t of H("button.cable-toggle"))t.addEventListener("click",()=>HC(t))}function $C(){let t=document.getElementById("id_slug"),e=document.getElementById("reslug");if(t===null||e===null)return;let n=t.getAttribute("slug-source"),i=document.getElementById(`id_${n}`);if(i===null){console.error("Unable to f
/* flatpickr v4.6.3, @license MIT */
/*!
* Bootstrap v5.0.2 (https://getbootstrap.com/)
* Copyright 2011-2021 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
*/
/*!
* Masonry v4.2.2
* Cascading grid layout library
* https://masonry.desandro.com
* MIT License
* by David DeSandro
*/
/*!
* Outlayer v2.1.1
* the brains and guts of a layout library
* MIT license
*/
/*!
* clipboard.js v2.0.6
* https://clipboardjs.com/
*
* Licensed MIT © Zeno Rocha
*/
/*!
* cookie
* Copyright(c) 2012-2014 Roman Shtylman
* Copyright(c) 2015 Douglas Christopher Wilson
* MIT Licensed
*/
/*!
* getSize v2.0.3
* measure size of elements
* MIT license
*/
/*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */
//# sourceMappingURL=/static/netbox.js.map