@inertiajs/core
Advanced tools
Comparing version 1.3.0-beta.2 to 1.3.0
@@ -1,2 +0,2 @@ | ||
import{default as Q}from"axios";function T(t,e){let i;return function(...r){clearTimeout(i),i=setTimeout(()=>t.apply(this,r),e)}}function f(t,e){return document.dispatchEvent(new CustomEvent(`inertia:${t}`,e))}var H=t=>f("before",{cancelable:!0,detail:{visit:t}}),q=t=>f("error",{detail:{errors:t}}),$=t=>f("exception",{cancelable:!0,detail:{exception:t}}),N=t=>f("finish",{detail:{visit:t}}),W=t=>f("invalid",{cancelable:!0,detail:{response:t}}),x=t=>f("navigate",{detail:{page:t}}),X=t=>f("progress",{detail:{progress:t}}),K=t=>f("start",{detail:{visit:t}}),B=t=>f("success",{detail:{page:t}});function I(t){return t instanceof File||t instanceof Blob||t instanceof FileList&&t.length>0||t instanceof FormData&&Array.from(t.values()).some(e=>I(e))||typeof t=="object"&&t!==null&&Object.values(t).some(e=>I(e))}function k(t,e=new FormData,i=null){t=t||{};for(let r in t)Object.prototype.hasOwnProperty.call(t,r)&&z(e,J(i,r),t[r]);return e}function J(t,e){return t?t+"["+e+"]":e}function z(t,e,i){if(Array.isArray(i))return Array.from(i.keys()).forEach(r=>z(t,J(e,r.toString()),i[r]));if(i instanceof Date)return t.append(e,i.toISOString());if(i instanceof File)return t.append(e,i,i.name);if(i instanceof Blob)return t.append(e,i);if(typeof i=="boolean")return t.append(e,i?"1":"0");if(typeof i=="string")return t.append(e,i);if(typeof i=="number")return t.append(e,`${i}`);if(i==null)return t.append(e,"");k(i,t,e)}var _={modal:null,listener:null,show(t){typeof t=="object"&&(t=`All Inertia requests must receive a valid Inertia response, however a plain JSON response was received.<hr>${JSON.stringify(t)}`);let e=document.createElement("html");e.innerHTML=t,e.querySelectorAll("a").forEach(r=>r.setAttribute("target","_top")),this.modal=document.createElement("div"),this.modal.style.position="fixed",this.modal.style.width="100vw",this.modal.style.height="100vh",this.modal.style.padding="50px",this.modal.style.boxSizing="border-box",this.modal.style.backgroundColor="rgba(0, 0, 0, .6)",this.modal.style.zIndex=2e5,this.modal.addEventListener("click",()=>this.hide());let i=document.createElement("iframe");if(i.style.backgroundColor="white",i.style.borderRadius="5px",i.style.width="100%",i.style.height="100%",this.modal.appendChild(i),document.body.prepend(this.modal),document.body.style.overflow="hidden",!i.contentWindow)throw new Error("iframe not yet ready.");i.contentWindow.document.open(),i.contentWindow.document.write(e.outerHTML),i.contentWindow.document.close(),this.listener=this.hideOnEscape.bind(this),document.addEventListener("keydown",this.listener)},hide(){this.modal.outerHTML="",this.modal=null,document.body.style.overflow="visible",document.removeEventListener("keydown",this.listener)},hideOnEscape(t){t.keyCode===27&&this.hide()}};import oe from"deepmerge";import*as O from"qs";function b(t){return new URL(t.toString(),window.location.toString())}function D(t,e,i,r="brackets"){let s=/^https?:\/\//.test(e.toString()),l=s||e.toString().startsWith("/"),h=!l&&!e.toString().startsWith("#")&&!e.toString().startsWith("?"),g=e.toString().includes("?")||t==="get"&&Object.keys(i).length,m=e.toString().includes("#"),c=new URL(e.toString(),"http://localhost");return t==="get"&&Object.keys(i).length&&(c.search=O.stringify(oe(O.parse(c.search,{ignoreQueryPrefix:!0}),i),{encodeValuesOnly:!0,arrayFormat:r}),i={}),[[s?`${c.protocol}//${c.host}`:"",l?c.pathname:"",h?c.pathname.substring(1):"",g?c.search:"",m?c.hash:""].join(""),i]}function E(t){return t=new URL(t.href),t.hash="",t}var C=typeof window>"u",Y=!C&&/CriOS/.test(window.navigator.userAgent),Z=t=>{requestAnimationFrame(()=>{requestAnimationFrame(t)})},F=class{constructor(){this.visitId=null}init({initialPage:e,resolveComponent:i,swapComponent:r}){this.page=e,this.resolveComponent=i,this.swapComponent=r,this.setNavigationType(),this.clearRememberedStateOnReload(),this.isBackForwardVisit()?this.handleBackForwardVisit(this.page):this.isLocationVisit()?this.handleLocationVisit(this.page):this.handleInitialPageVisit(this.page),this.setupEventListeners()}setNavigationType(){this.navigationType=window.performance&&window.performance.getEntriesByType&&window.performance.getEntriesByType("navigation").length>0?window.performance.getEntriesByType("navigation")[0].type:"navigate"}clearRememberedStateOnReload(){this.navigationType==="reload"&&window.history.state?.rememberedState&&delete window.history.state.rememberedState}handleInitialPageVisit(e){let i=window.location.hash;this.page.url.includes(i)||(this.page.url+=i),this.setPage(e,{preserveScroll:!0,preserveState:!0}).then(()=>x(e))}setupEventListeners(){window.addEventListener("popstate",this.handlePopstateEvent.bind(this)),document.addEventListener("scroll",T(this.handleScrollEvent.bind(this),100),!0)}scrollRegions(){return document.querySelectorAll("[scroll-region]")}handleScrollEvent(e){typeof e.target.hasAttribute=="function"&&e.target.hasAttribute("scroll-region")&&this.saveScrollPositions()}saveScrollPositions(){this.replaceState({...this.page,scrollRegions:Array.from(this.scrollRegions()).map(e=>({top:e.scrollTop,left:e.scrollLeft}))})}resetScrollPositions(){Z(()=>{window.scrollTo(0,0),this.scrollRegions().forEach(e=>{typeof e.scrollTo=="function"?e.scrollTo(0,0):(e.scrollTop=0,e.scrollLeft=0)}),this.saveScrollPositions(),window.location.hash&&document.getElementById(window.location.hash.slice(1))?.scrollIntoView()})}restoreScrollPositions(){Z(()=>{this.page.scrollRegions&&this.scrollRegions().forEach((e,i)=>{let r=this.page.scrollRegions[i];if(r)typeof e.scrollTo=="function"?e.scrollTo(r.left,r.top):(e.scrollTop=r.top,e.scrollLeft=r.left);else return})})}isBackForwardVisit(){return window.history.state&&this.navigationType==="back_forward"}handleBackForwardVisit(e){window.history.state.version=e.version,this.setPage(window.history.state,{preserveScroll:!0,preserveState:!0}).then(()=>{this.restoreScrollPositions(),x(e)})}locationVisit(e,i){try{let r={preserveScroll:i};window.sessionStorage.setItem("inertiaLocationVisit",JSON.stringify(r)),window.location.href=e.href,E(window.location).href===E(e).href&&window.location.reload()}catch{return!1}}isLocationVisit(){try{return window.sessionStorage.getItem("inertiaLocationVisit")!==null}catch{return!1}}handleLocationVisit(e){let i=JSON.parse(window.sessionStorage.getItem("inertiaLocationVisit")||"");window.sessionStorage.removeItem("inertiaLocationVisit"),e.url+=window.location.hash,e.rememberedState=window.history.state?.rememberedState??{},e.scrollRegions=window.history.state?.scrollRegions??[],this.setPage(e,{preserveScroll:i.preserveScroll,preserveState:!0}).then(()=>{i.preserveScroll&&this.restoreScrollPositions(),x(e)})}isLocationVisitResponse(e){return!!(e&&e.status===409&&e.headers["x-inertia-location"])}isInertiaResponse(e){return!!e?.headers["x-inertia"]}createVisitId(){return this.visitId={},this.visitId}cancelVisit(e,{cancelled:i=!1,interrupted:r=!1}){e&&!e.completed&&!e.cancelled&&!e.interrupted&&(e.cancelToken.abort(),e.onCancel(),e.completed=!1,e.cancelled=i,e.interrupted=r,N(e),e.onFinish(e))}finishVisit(e){!e.cancelled&&!e.interrupted&&(e.completed=!0,e.cancelled=!1,e.interrupted=!1,N(e),e.onFinish(e))}resolvePreserveOption(e,i){return typeof e=="function"?e(i):e==="errors"?Object.keys(i.props.errors||{}).length>0:e}cancel(){this.activeVisit&&this.cancelVisit(this.activeVisit,{cancelled:!0})}visit(e,{method:i="get",data:r={},replace:s=!1,preserveScroll:l=!1,preserveState:h=!1,only:g=[],except:m=[],headers:c={},errorBag:o="",forceFormData:v=!1,onCancelToken:L=()=>{},onBefore:d=()=>{},onStart:p=()=>{},onProgress:P=()=>{},onFinish:y=()=>{},onCancel:ne=()=>{},onSuccess:U=()=>{},onError:G=()=>{},queryStringArrayFormat:A="brackets"}={}){let S=typeof e=="string"?b(e):e;if((I(r)||v)&&!(r instanceof FormData)&&(r=k(r)),!(r instanceof FormData)){let[n,a]=D(i,S,r,A);S=b(n),r=a}let R={url:S,method:i,data:r,replace:s,preserveScroll:l,preserveState:h,only:g,except:m,headers:c,errorBag:o,forceFormData:v,queryStringArrayFormat:A,cancelled:!1,completed:!1,interrupted:!1};if(d(R)===!1||!H(R))return;this.activeVisit&&this.cancelVisit(this.activeVisit,{interrupted:!0}),this.saveScrollPositions();let M=this.createVisitId();this.activeVisit={...R,onCancelToken:L,onBefore:d,onStart:p,onProgress:P,onFinish:y,onCancel:ne,onSuccess:U,onError:G,queryStringArrayFormat:A,cancelToken:new AbortController},L({cancel:()=>{this.activeVisit&&this.cancelVisit(this.activeVisit,{cancelled:!0})}}),K(R),p(R);let j=!!(g.length||m.length);Q({method:i,url:E(S).href,data:i==="get"?{}:r,params:i==="get"?r:{},signal:this.activeVisit.cancelToken.signal,headers:{...c,Accept:"text/html, application/xhtml+xml","X-Requested-With":"XMLHttpRequest","X-Inertia":!0,...j?{"X-Inertia-Partial-Component":this.page.component}:{},...g.length?{"X-Inertia-Partial-Data":g.join(",")}:{},...m.length?{"X-Inertia-Partial-Except":m.join(",")}:{},...o&&o.length?{"X-Inertia-Error-Bag":o}:{},...this.page.version?{"X-Inertia-Version":this.page.version}:{}},onUploadProgress:n=>{r instanceof FormData&&(n.percentage=n.progress?Math.round(n.progress*100):0,X(n),P(n))}}).then(n=>{if(!this.isInertiaResponse(n))return Promise.reject({response:n});let a=n.data;j&&a.component===this.page.component&&(a.props={...this.page.props,...a.props}),l=this.resolvePreserveOption(l,a),h=this.resolvePreserveOption(h,a),h&&window.history.state?.rememberedState&&a.component===this.page.component&&(a.rememberedState=window.history.state.rememberedState);let w=S,V=b(a.url);return w.hash&&!V.hash&&E(w).href===V.href&&(V.hash=w.hash,a.url=V.href),this.setPage(a,{visitId:M,replace:s,preserveScroll:l,preserveState:h})}).then(()=>{let n=this.page.props.errors||{};if(Object.keys(n).length>0){let a=o?n[o]?n[o]:{}:n;return q(a),G(a)}return B(this.page),U(this.page)}).catch(n=>{if(this.isInertiaResponse(n.response))return this.setPage(n.response.data,{visitId:M});if(this.isLocationVisitResponse(n.response)){let a=b(n.response.headers["x-inertia-location"]),w=S;w.hash&&!a.hash&&E(w).href===a.href&&(a.hash=w.hash),this.locationVisit(a,l===!0)}else if(n.response)W(n.response)&&_.show(n.response.data);else return Promise.reject(n)}).then(()=>{this.activeVisit&&this.finishVisit(this.activeVisit)}).catch(n=>{if(!Q.isCancel(n)){let a=$(n);if(this.activeVisit&&this.finishVisit(this.activeVisit),a)return Promise.reject(n)}})}setPage(e,{visitId:i=this.createVisitId(),replace:r=!1,preserveScroll:s=!1,preserveState:l=!1}={}){return Promise.resolve(this.resolveComponent(e.component)).then(h=>{i===this.visitId&&(e.scrollRegions=this.page.scrollRegions||[],e.rememberedState=e.rememberedState||{},r=r||b(e.url).href===window.location.href,r?this.replaceState(e):this.pushState(e),this.swapComponent({component:h,page:e,preserveState:l}).then(()=>{s?this.restoreScrollPositions():this.resetScrollPositions(),r||x(e)}))})}pushState(e){this.page=e,Y?setTimeout(()=>window.history.pushState(e,"",e.url)):window.history.pushState(e,"",e.url)}replaceState(e){this.page=e,Y?setTimeout(()=>window.history.replaceState(e,"",e.url)):window.history.replaceState(e,"",e.url)}handlePopstateEvent(e){if(e.state!==null){let i=e.state,r=this.createVisitId();Promise.resolve(this.resolveComponent(i.component)).then(s=>{r===this.visitId&&(this.page=i,this.swapComponent({component:s,page:i,preserveState:!1}).then(()=>{this.restoreScrollPositions(),x(i)}))})}else{let i=b(this.page.url);i.hash=window.location.hash,this.replaceState({...this.page,url:i.href}),this.resetScrollPositions()}}get(e,i={},r={}){return this.visit(e,{...r,method:"get",data:i})}reload(e={}){return this.visit(window.location.href,{...e,preserveScroll:!0,preserveState:!0})}replace(e,i={}){return console.warn(`Inertia.replace() has been deprecated and will be removed in a future release. Please use Inertia.${i.method??"get"}() instead.`),this.visit(e,{preserveState:!0,...i,replace:!0})}post(e,i={},r={}){return this.visit(e,{preserveState:!0,...r,method:"post",data:i})}put(e,i={},r={}){return this.visit(e,{preserveState:!0,...r,method:"put",data:i})}patch(e,i={},r={}){return this.visit(e,{preserveState:!0,...r,method:"patch",data:i})}delete(e,i={}){return this.visit(e,{preserveState:!0,...i,method:"delete"})}remember(e,i="default"){C||this.replaceState({...this.page,rememberedState:{...this.page?.rememberedState,[i]:e}})}restore(e="default"){if(!C)return window.history.state?.rememberedState?.[e]}on(e,i){if(C)return()=>{};let r=s=>{let l=i(s);s.cancelable&&!s.defaultPrevented&&l===!1&&s.preventDefault()};return document.addEventListener(`inertia:${e}`,r),()=>document.removeEventListener(`inertia:${e}`,r)}};var se={buildDOMElement(t){let e=document.createElement("template");e.innerHTML=t;let i=e.content.firstChild;if(!t.startsWith("<script "))return i;let r=document.createElement("script");return r.innerHTML=i.innerHTML,i.getAttributeNames().forEach(s=>{r.setAttribute(s,i.getAttribute(s)||"")}),r},isInertiaManagedElement(t){return t.nodeType===Node.ELEMENT_NODE&&t.getAttribute("inertia")!==null},findMatchingElementIndex(t,e){let i=t.getAttribute("inertia");return i!==null?e.findIndex(r=>r.getAttribute("inertia")===i):-1},update:T(function(t){let e=t.map(r=>this.buildDOMElement(r));Array.from(document.head.childNodes).filter(r=>this.isInertiaManagedElement(r)).forEach(r=>{let s=this.findMatchingElementIndex(r,e);if(s===-1){r?.parentNode?.removeChild(r);return}let l=e.splice(s,1)[0];l&&!r.isEqualNode(l)&&r?.parentNode?.replaceChild(l,r)}),e.forEach(r=>document.head.appendChild(r))},1)};function ee(t,e,i){let r={},s=0;function l(){let o=s+=1;return r[o]=[],o.toString()}function h(o){o===null||Object.keys(r).indexOf(o)===-1||(delete r[o],c())}function g(o,v=[]){o!==null&&Object.keys(r).indexOf(o)>-1&&(r[o]=v),c()}function m(){let o=e(""),v={...o?{title:`<title inertia="">${o}</title>`}:{}},L=Object.values(r).reduce((d,p)=>d.concat(p),[]).reduce((d,p)=>{if(p.indexOf("<")===-1)return d;if(p.indexOf("<title ")===0){let y=p.match(/(<title [^>]+>)(.*?)(<\/title>)/);return d.title=y?`${y[1]}${e(y[2])}${y[3]}`:p,d}let P=p.match(/ inertia="[^"]+"/);return P?d[P[0]]=p:d[Object.keys(d).length]=p,d},v);return Object.values(L)}function c(){t?i(m()):se.update(m())}return c(),{forceUpdate:c,createProvider:function(){let o=l();return{update:v=>g(o,v),disconnect:()=>h(o)}}}}import u from"nprogress";var te=null;function ae(t){document.addEventListener("inertia:start",le.bind(null,t)),document.addEventListener("inertia:progress",ce),document.addEventListener("inertia:finish",de)}function le(t){te=setTimeout(()=>u.start(),t)}function ce(t){u.isStarted()&&t.detail.progress?.percentage&&u.set(Math.max(u.status,t.detail.progress.percentage/100*.9))}function de(t){if(clearTimeout(te),u.isStarted())t.detail.visit.completed?u.done():t.detail.visit.interrupted?u.set(0):t.detail.visit.cancelled&&(u.done(),u.remove());else return}function pe(t){let e=document.createElement("style");e.type="text/css",e.textContent=` | ||
import{default as Q}from"axios";function T(t,e){let i;return function(...r){clearTimeout(i),i=setTimeout(()=>t.apply(this,r),e)}}function f(t,e){return document.dispatchEvent(new CustomEvent(`inertia:${t}`,e))}var H=t=>f("before",{cancelable:!0,detail:{visit:t}}),q=t=>f("error",{detail:{errors:t}}),$=t=>f("exception",{cancelable:!0,detail:{exception:t}}),N=t=>f("finish",{detail:{visit:t}}),W=t=>f("invalid",{cancelable:!0,detail:{response:t}}),P=t=>f("navigate",{detail:{page:t}}),K=t=>f("progress",{detail:{progress:t}}),X=t=>f("start",{detail:{visit:t}}),B=t=>f("success",{detail:{page:t}});function I(t){return t instanceof File||t instanceof Blob||t instanceof FileList&&t.length>0||t instanceof FormData&&Array.from(t.values()).some(e=>I(e))||typeof t=="object"&&t!==null&&Object.values(t).some(e=>I(e))}function k(t,e=new FormData,i=null){t=t||{};for(let r in t)Object.prototype.hasOwnProperty.call(t,r)&&z(e,J(i,r),t[r]);return e}function J(t,e){return t?t+"["+e+"]":e}function z(t,e,i){if(Array.isArray(i))return Array.from(i.keys()).forEach(r=>z(t,J(e,r.toString()),i[r]));if(i instanceof Date)return t.append(e,i.toISOString());if(i instanceof File)return t.append(e,i,i.name);if(i instanceof Blob)return t.append(e,i);if(typeof i=="boolean")return t.append(e,i?"1":"0");if(typeof i=="string")return t.append(e,i);if(typeof i=="number")return t.append(e,`${i}`);if(i==null)return t.append(e,"");k(i,t,e)}var _={modal:null,listener:null,show(t){typeof t=="object"&&(t=`All Inertia requests must receive a valid Inertia response, however a plain JSON response was received.<hr>${JSON.stringify(t)}`);let e=document.createElement("html");e.innerHTML=t,e.querySelectorAll("a").forEach(r=>r.setAttribute("target","_top")),this.modal=document.createElement("div"),this.modal.style.position="fixed",this.modal.style.width="100vw",this.modal.style.height="100vh",this.modal.style.padding="50px",this.modal.style.boxSizing="border-box",this.modal.style.backgroundColor="rgba(0, 0, 0, .6)",this.modal.style.zIndex=2e5,this.modal.addEventListener("click",()=>this.hide());let i=document.createElement("iframe");if(i.style.backgroundColor="white",i.style.borderRadius="5px",i.style.width="100%",i.style.height="100%",this.modal.appendChild(i),document.body.prepend(this.modal),document.body.style.overflow="hidden",!i.contentWindow)throw new Error("iframe not yet ready.");i.contentWindow.document.open(),i.contentWindow.document.write(e.outerHTML),i.contentWindow.document.close(),this.listener=this.hideOnEscape.bind(this),document.addEventListener("keydown",this.listener)},hide(){this.modal.outerHTML="",this.modal=null,document.body.style.overflow="visible",document.removeEventListener("keydown",this.listener)},hideOnEscape(t){t.keyCode===27&&this.hide()}};import oe from"deepmerge";import*as O from"qs";function b(t){return new URL(t.toString(),window.location.toString())}function D(t,e,i,r="brackets"){let s=/^https?:\/\//.test(e.toString()),l=s||e.toString().startsWith("/"),h=!l&&!e.toString().startsWith("#")&&!e.toString().startsWith("?"),g=e.toString().includes("?")||t==="get"&&Object.keys(i).length,m=e.toString().includes("#"),c=new URL(e.toString(),"http://localhost");return t==="get"&&Object.keys(i).length&&(c.search=O.stringify(oe(O.parse(c.search,{ignoreQueryPrefix:!0}),i),{encodeValuesOnly:!0,arrayFormat:r}),i={}),[[s?`${c.protocol}//${c.host}`:"",l?c.pathname:"",h?c.pathname.substring(1):"",g?c.search:"",m?c.hash:""].join(""),i]}function E(t){return t=new URL(t.href),t.hash="",t}var C=typeof window>"u",Y=!C&&/CriOS/.test(window.navigator.userAgent),Z=t=>{requestAnimationFrame(()=>{requestAnimationFrame(t)})},F=class{constructor(){this.visitId=null}init({initialPage:e,resolveComponent:i,swapComponent:r}){this.page=e,this.resolveComponent=i,this.swapComponent=r,this.setNavigationType(),this.clearRememberedStateOnReload(),this.isBackForwardVisit()?this.handleBackForwardVisit(this.page):this.isLocationVisit()?this.handleLocationVisit(this.page):this.handleInitialPageVisit(this.page),this.setupEventListeners()}setNavigationType(){this.navigationType=window.performance&&window.performance.getEntriesByType&&window.performance.getEntriesByType("navigation").length>0?window.performance.getEntriesByType("navigation")[0].type:"navigate"}clearRememberedStateOnReload(){this.navigationType==="reload"&&window.history.state?.rememberedState&&delete window.history.state.rememberedState}handleInitialPageVisit(e){let i=window.location.hash;this.page.url.includes(i)||(this.page.url+=i),this.setPage(e,{preserveScroll:!0,preserveState:!0}).then(()=>P(e))}setupEventListeners(){window.addEventListener("popstate",this.handlePopstateEvent.bind(this)),document.addEventListener("scroll",T(this.handleScrollEvent.bind(this),100),!0)}scrollRegions(){return document.querySelectorAll("[scroll-region]")}handleScrollEvent(e){typeof e.target.hasAttribute=="function"&&e.target.hasAttribute("scroll-region")&&this.saveScrollPositions()}saveScrollPositions(){this.replaceState({...this.page,scrollRegions:Array.from(this.scrollRegions()).map(e=>({top:e.scrollTop,left:e.scrollLeft}))})}resetScrollPositions(){Z(()=>{window.scrollTo(0,0),this.scrollRegions().forEach(e=>{typeof e.scrollTo=="function"?e.scrollTo(0,0):(e.scrollTop=0,e.scrollLeft=0)}),this.saveScrollPositions(),window.location.hash&&document.getElementById(window.location.hash.slice(1))?.scrollIntoView()})}restoreScrollPositions(){Z(()=>{this.page.scrollRegions&&this.scrollRegions().forEach((e,i)=>{let r=this.page.scrollRegions[i];if(r)typeof e.scrollTo=="function"?e.scrollTo(r.left,r.top):(e.scrollTop=r.top,e.scrollLeft=r.left);else return})})}isBackForwardVisit(){return window.history.state&&this.navigationType==="back_forward"}handleBackForwardVisit(e){window.history.state.version=e.version,this.setPage(window.history.state,{preserveScroll:!0,preserveState:!0}).then(()=>{this.restoreScrollPositions(),P(e)})}locationVisit(e,i){try{let r={preserveScroll:i};window.sessionStorage.setItem("inertiaLocationVisit",JSON.stringify(r)),window.location.href=e.href,E(window.location).href===E(e).href&&window.location.reload()}catch{return!1}}isLocationVisit(){try{return window.sessionStorage.getItem("inertiaLocationVisit")!==null}catch{return!1}}handleLocationVisit(e){let i=JSON.parse(window.sessionStorage.getItem("inertiaLocationVisit")||"");window.sessionStorage.removeItem("inertiaLocationVisit"),e.url+=window.location.hash,e.rememberedState=window.history.state?.rememberedState??{},e.scrollRegions=window.history.state?.scrollRegions??[],this.setPage(e,{preserveScroll:i.preserveScroll,preserveState:!0}).then(()=>{i.preserveScroll&&this.restoreScrollPositions(),P(e)})}isLocationVisitResponse(e){return!!(e&&e.status===409&&e.headers["x-inertia-location"])}isInertiaResponse(e){return!!e?.headers["x-inertia"]}createVisitId(){return this.visitId={},this.visitId}cancelVisit(e,{cancelled:i=!1,interrupted:r=!1}){e&&!e.completed&&!e.cancelled&&!e.interrupted&&(e.cancelToken.abort(),e.onCancel(),e.completed=!1,e.cancelled=i,e.interrupted=r,N(e),e.onFinish(e))}finishVisit(e){!e.cancelled&&!e.interrupted&&(e.completed=!0,e.cancelled=!1,e.interrupted=!1,N(e),e.onFinish(e))}resolvePreserveOption(e,i){return typeof e=="function"?e(i):e==="errors"?Object.keys(i.props.errors||{}).length>0:e}cancel(){this.activeVisit&&this.cancelVisit(this.activeVisit,{cancelled:!0})}visit(e,{method:i="get",data:r={},replace:s=!1,preserveScroll:l=!1,preserveState:h=!1,only:g=[],except:m=[],headers:c={},errorBag:o="",forceFormData:v=!1,onCancelToken:L=()=>{},onBefore:d=()=>{},onStart:p=()=>{},onProgress:x=()=>{},onFinish:y=()=>{},onCancel:ne=()=>{},onSuccess:U=()=>{},onError:G=()=>{},queryStringArrayFormat:A="brackets"}={}){let S=typeof e=="string"?b(e):e;if((I(r)||v)&&!(r instanceof FormData)&&(r=k(r)),!(r instanceof FormData)){let[n,a]=D(i,S,r,A);S=b(n),r=a}let R={url:S,method:i,data:r,replace:s,preserveScroll:l,preserveState:h,only:g,except:m,headers:c,errorBag:o,forceFormData:v,queryStringArrayFormat:A,cancelled:!1,completed:!1,interrupted:!1};if(d(R)===!1||!H(R))return;this.activeVisit&&this.cancelVisit(this.activeVisit,{interrupted:!0}),this.saveScrollPositions();let M=this.createVisitId();this.activeVisit={...R,onCancelToken:L,onBefore:d,onStart:p,onProgress:x,onFinish:y,onCancel:ne,onSuccess:U,onError:G,queryStringArrayFormat:A,cancelToken:new AbortController},L({cancel:()=>{this.activeVisit&&this.cancelVisit(this.activeVisit,{cancelled:!0})}}),X(R),p(R);let j=!!(g.length||m.length);Q({method:i,url:E(S).href,data:i==="get"?{}:r,params:i==="get"?r:{},signal:this.activeVisit.cancelToken.signal,headers:{...c,Accept:"text/html, application/xhtml+xml","X-Requested-With":"XMLHttpRequest","X-Inertia":!0,...j?{"X-Inertia-Partial-Component":this.page.component}:{},...g.length?{"X-Inertia-Partial-Data":g.join(",")}:{},...m.length?{"X-Inertia-Partial-Except":m.join(",")}:{},...o&&o.length?{"X-Inertia-Error-Bag":o}:{},...this.page.version?{"X-Inertia-Version":this.page.version}:{}},onUploadProgress:n=>{r instanceof FormData&&(n.percentage=n.progress?Math.round(n.progress*100):0,K(n),x(n))}}).then(n=>{if(!this.isInertiaResponse(n))return Promise.reject({response:n});let a=n.data;j&&a.component===this.page.component&&(a.props={...this.page.props,...a.props}),l=this.resolvePreserveOption(l,a),h=this.resolvePreserveOption(h,a),h&&window.history.state?.rememberedState&&a.component===this.page.component&&(a.rememberedState=window.history.state.rememberedState);let w=S,V=b(a.url);return w.hash&&!V.hash&&E(w).href===V.href&&(V.hash=w.hash,a.url=V.href),this.setPage(a,{visitId:M,replace:s,preserveScroll:l,preserveState:h})}).then(()=>{let n=this.page.props.errors||{};if(Object.keys(n).length>0){let a=o?n[o]?n[o]:{}:n;return q(a),G(a)}return B(this.page),U(this.page)}).catch(n=>{if(this.isInertiaResponse(n.response))return this.setPage(n.response.data,{visitId:M});if(this.isLocationVisitResponse(n.response)){let a=b(n.response.headers["x-inertia-location"]),w=S;w.hash&&!a.hash&&E(w).href===a.href&&(a.hash=w.hash),this.locationVisit(a,l===!0)}else if(n.response)W(n.response)&&_.show(n.response.data);else return Promise.reject(n)}).then(()=>{this.activeVisit&&this.finishVisit(this.activeVisit)}).catch(n=>{if(!Q.isCancel(n)){let a=$(n);if(this.activeVisit&&this.finishVisit(this.activeVisit),a)return Promise.reject(n)}})}setPage(e,{visitId:i=this.createVisitId(),replace:r=!1,preserveScroll:s=!1,preserveState:l=!1}={}){return Promise.resolve(this.resolveComponent(e.component)).then(h=>{i===this.visitId&&(e.scrollRegions=this.page.scrollRegions||[],e.rememberedState=e.rememberedState||{},r=r||b(e.url).href===window.location.href,r?this.replaceState(e):this.pushState(e),this.swapComponent({component:h,page:e,preserveState:l}).then(()=>{s?this.restoreScrollPositions():this.resetScrollPositions(),r||P(e)}))})}pushState(e){this.page=e,Y?setTimeout(()=>window.history.pushState(e,"",e.url)):window.history.pushState(e,"",e.url)}replaceState(e){this.page=e,Y?setTimeout(()=>window.history.replaceState(e,"",e.url)):window.history.replaceState(e,"",e.url)}handlePopstateEvent(e){if(e.state!==null){let i=e.state,r=this.createVisitId();Promise.resolve(this.resolveComponent(i.component)).then(s=>{r===this.visitId&&(this.page=i,this.swapComponent({component:s,page:i,preserveState:!1}).then(()=>{this.restoreScrollPositions(),P(i)}))})}else{let i=b(this.page.url);i.hash=window.location.hash,this.replaceState({...this.page,url:i.href}),this.resetScrollPositions()}}get(e,i={},r={}){return this.visit(e,{...r,method:"get",data:i})}reload(e={}){return this.visit(window.location.href,{...e,preserveScroll:!0,preserveState:!0})}replace(e,i={}){return console.warn(`Inertia.replace() has been deprecated and will be removed in a future release. Please use Inertia.${i.method??"get"}() instead.`),this.visit(e,{preserveState:!0,...i,replace:!0})}post(e,i={},r={}){return this.visit(e,{preserveState:!0,...r,method:"post",data:i})}put(e,i={},r={}){return this.visit(e,{preserveState:!0,...r,method:"put",data:i})}patch(e,i={},r={}){return this.visit(e,{preserveState:!0,...r,method:"patch",data:i})}delete(e,i={}){return this.visit(e,{preserveState:!0,...i,method:"delete"})}remember(e,i="default"){C||this.replaceState({...this.page,rememberedState:{...this.page?.rememberedState,[i]:e}})}restore(e="default"){if(!C)return window.history.state?.rememberedState?.[e]}on(e,i){if(C)return()=>{};let r=s=>{let l=i(s);s.cancelable&&!s.defaultPrevented&&l===!1&&s.preventDefault()};return document.addEventListener(`inertia:${e}`,r),()=>document.removeEventListener(`inertia:${e}`,r)}};var se={buildDOMElement(t){let e=document.createElement("template");e.innerHTML=t;let i=e.content.firstChild;if(!t.startsWith("<script "))return i;let r=document.createElement("script");return r.innerHTML=i.innerHTML,i.getAttributeNames().forEach(s=>{r.setAttribute(s,i.getAttribute(s)||"")}),r},isInertiaManagedElement(t){return t.nodeType===Node.ELEMENT_NODE&&t.getAttribute("inertia")!==null},findMatchingElementIndex(t,e){let i=t.getAttribute("inertia");return i!==null?e.findIndex(r=>r.getAttribute("inertia")===i):-1},update:T(function(t){let e=t.map(r=>this.buildDOMElement(r));Array.from(document.head.childNodes).filter(r=>this.isInertiaManagedElement(r)).forEach(r=>{let s=this.findMatchingElementIndex(r,e);if(s===-1){r?.parentNode?.removeChild(r);return}let l=e.splice(s,1)[0];l&&!r.isEqualNode(l)&&r?.parentNode?.replaceChild(l,r)}),e.forEach(r=>document.head.appendChild(r))},1)};function ee(t,e,i){let r={},s=0;function l(){let o=s+=1;return r[o]=[],o.toString()}function h(o){o===null||Object.keys(r).indexOf(o)===-1||(delete r[o],c())}function g(o,v=[]){o!==null&&Object.keys(r).indexOf(o)>-1&&(r[o]=v),c()}function m(){let o=e(""),v={...o?{title:`<title inertia="">${o}</title>`}:{}},L=Object.values(r).reduce((d,p)=>d.concat(p),[]).reduce((d,p)=>{if(p.indexOf("<")===-1)return d;if(p.indexOf("<title ")===0){let y=p.match(/(<title [^>]+>)(.*?)(<\/title>)/);return d.title=y?`${y[1]}${e(y[2])}${y[3]}`:p,d}let x=p.match(/ inertia="[^"]+"/);return x?d[x[0]]=p:d[Object.keys(d).length]=p,d},v);return Object.values(L)}function c(){t?i(m()):se.update(m())}return c(),{forceUpdate:c,createProvider:function(){let o=l();return{update:v=>g(o,v),disconnect:()=>h(o)}}}}import u from"nprogress";var te=null;function ae(t){document.addEventListener("inertia:start",le.bind(null,t)),document.addEventListener("inertia:progress",ce),document.addEventListener("inertia:finish",de)}function le(t){te=setTimeout(()=>u.start(),t)}function ce(t){u.isStarted()&&t.detail.progress?.percentage&&u.set(Math.max(u.status,t.detail.progress.percentage/100*.9))}function de(t){if(clearTimeout(te),u.isStarted())t.detail.visit.completed?u.done():t.detail.visit.interrupted?u.set(0):t.detail.visit.cancelled&&(u.done(),u.remove());else return}function pe(t){let e=document.createElement("style");e.type="text/css",e.textContent=` | ||
#nprogress { | ||
@@ -3,0 +3,0 @@ pointer-events: none; |
@@ -1,2 +0,2 @@ | ||
"use strict";var ce=Object.create;var I=Object.defineProperty;var de=Object.getOwnPropertyDescriptor;var pe=Object.getOwnPropertyNames;var he=Object.getPrototypeOf,ue=Object.prototype.hasOwnProperty;var me=(t,e)=>{for(var i in e)I(t,i,{get:e[i],enumerable:!0})},B=(t,e,i,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of pe(e))!ue.call(t,o)&&o!==i&&I(t,o,{get:()=>e[o],enumerable:!(r=de(e,o))||r.enumerable});return t};var O=(t,e,i)=>(i=t!=null?ce(he(t)):{},B(e||!t||!t.__esModule?I(i,"default",{value:t,enumerable:!0}):i,t)),fe=t=>B(I({},"__esModule",{value:!0}),t);var xe={};me(xe,{createHeadManager:()=>j,hrefToUrl:()=>g,mergeDataIntoQueryString:()=>A,router:()=>Se,setupProgress:()=>H,shouldIntercept:()=>q,urlWithoutHash:()=>w});module.exports=fe(xe);var M=O(require("axios"),1);function T(t,e){let i;return function(...r){clearTimeout(i),i=setTimeout(()=>t.apply(this,r),e)}}function f(t,e){return document.dispatchEvent(new CustomEvent(`inertia:${t}`,e))}var J=t=>f("before",{cancelable:!0,detail:{visit:t}}),z=t=>f("error",{detail:{errors:t}}),_=t=>f("exception",{cancelable:!0,detail:{exception:t}}),U=t=>f("finish",{detail:{visit:t}}),Q=t=>f("invalid",{cancelable:!0,detail:{response:t}}),x=t=>f("navigate",{detail:{page:t}}),Y=t=>f("progress",{detail:{progress:t}}),Z=t=>f("start",{detail:{visit:t}}),ee=t=>f("success",{detail:{page:t}});function C(t){return t instanceof File||t instanceof Blob||t instanceof FileList&&t.length>0||t instanceof FormData&&Array.from(t.values()).some(e=>C(e))||typeof t=="object"&&t!==null&&Object.values(t).some(e=>C(e))}function G(t,e=new FormData,i=null){t=t||{};for(let r in t)Object.prototype.hasOwnProperty.call(t,r)&&ie(e,te(i,r),t[r]);return e}function te(t,e){return t?t+"["+e+"]":e}function ie(t,e,i){if(Array.isArray(i))return Array.from(i.keys()).forEach(r=>ie(t,te(e,r.toString()),i[r]));if(i instanceof Date)return t.append(e,i.toISOString());if(i instanceof File)return t.append(e,i,i.name);if(i instanceof Blob)return t.append(e,i);if(typeof i=="boolean")return t.append(e,i?"1":"0");if(typeof i=="string")return t.append(e,i);if(typeof i=="number")return t.append(e,`${i}`);if(i==null)return t.append(e,"");G(i,t,e)}var re={modal:null,listener:null,show(t){typeof t=="object"&&(t=`All Inertia requests must receive a valid Inertia response, however a plain JSON response was received.<hr>${JSON.stringify(t)}`);let e=document.createElement("html");e.innerHTML=t,e.querySelectorAll("a").forEach(r=>r.setAttribute("target","_top")),this.modal=document.createElement("div"),this.modal.style.position="fixed",this.modal.style.width="100vw",this.modal.style.height="100vh",this.modal.style.padding="50px",this.modal.style.boxSizing="border-box",this.modal.style.backgroundColor="rgba(0, 0, 0, .6)",this.modal.style.zIndex=2e5,this.modal.addEventListener("click",()=>this.hide());let i=document.createElement("iframe");if(i.style.backgroundColor="white",i.style.borderRadius="5px",i.style.width="100%",i.style.height="100%",this.modal.appendChild(i),document.body.prepend(this.modal),document.body.style.overflow="hidden",!i.contentWindow)throw new Error("iframe not yet ready.");i.contentWindow.document.open(),i.contentWindow.document.write(e.outerHTML),i.contentWindow.document.close(),this.listener=this.hideOnEscape.bind(this),document.addEventListener("keydown",this.listener)},hide(){this.modal.outerHTML="",this.modal=null,document.body.style.overflow="visible",document.removeEventListener("keydown",this.listener)},hideOnEscape(t){t.keyCode===27&&this.hide()}};var ne=O(require("deepmerge"),1),F=O(require("qs"),1);function g(t){return new URL(t.toString(),window.location.toString())}function A(t,e,i,r="brackets"){let o=/^https?:\/\//.test(e.toString()),l=o||e.toString().startsWith("/"),h=!l&&!e.toString().startsWith("#")&&!e.toString().startsWith("?"),v=e.toString().includes("?")||t==="get"&&Object.keys(i).length,m=e.toString().includes("#"),c=new URL(e.toString(),"http://localhost");return t==="get"&&Object.keys(i).length&&(c.search=F.stringify((0,ne.default)(F.parse(c.search,{ignoreQueryPrefix:!0}),i),{encodeValuesOnly:!0,arrayFormat:r}),i={}),[[o?`${c.protocol}//${c.host}`:"",l?c.pathname:"",h?c.pathname.substring(1):"",v?c.search:"",m?c.hash:""].join(""),i]}function w(t){return t=new URL(t.href),t.hash="",t}var N=typeof window>"u",oe=!N&&/CriOS/.test(window.navigator.userAgent),se=t=>{requestAnimationFrame(()=>{requestAnimationFrame(t)})},k=class{constructor(){this.visitId=null}init({initialPage:e,resolveComponent:i,swapComponent:r}){this.page=e,this.resolveComponent=i,this.swapComponent=r,this.setNavigationType(),this.clearRememberedStateOnReload(),this.isBackForwardVisit()?this.handleBackForwardVisit(this.page):this.isLocationVisit()?this.handleLocationVisit(this.page):this.handleInitialPageVisit(this.page),this.setupEventListeners()}setNavigationType(){this.navigationType=window.performance&&window.performance.getEntriesByType&&window.performance.getEntriesByType("navigation").length>0?window.performance.getEntriesByType("navigation")[0].type:"navigate"}clearRememberedStateOnReload(){this.navigationType==="reload"&&window.history.state?.rememberedState&&delete window.history.state.rememberedState}handleInitialPageVisit(e){let i=window.location.hash;this.page.url.includes(i)||(this.page.url+=i),this.setPage(e,{preserveScroll:!0,preserveState:!0}).then(()=>x(e))}setupEventListeners(){window.addEventListener("popstate",this.handlePopstateEvent.bind(this)),document.addEventListener("scroll",T(this.handleScrollEvent.bind(this),100),!0)}scrollRegions(){return document.querySelectorAll("[scroll-region]")}handleScrollEvent(e){typeof e.target.hasAttribute=="function"&&e.target.hasAttribute("scroll-region")&&this.saveScrollPositions()}saveScrollPositions(){this.replaceState({...this.page,scrollRegions:Array.from(this.scrollRegions()).map(e=>({top:e.scrollTop,left:e.scrollLeft}))})}resetScrollPositions(){se(()=>{window.scrollTo(0,0),this.scrollRegions().forEach(e=>{typeof e.scrollTo=="function"?e.scrollTo(0,0):(e.scrollTop=0,e.scrollLeft=0)}),this.saveScrollPositions(),window.location.hash&&document.getElementById(window.location.hash.slice(1))?.scrollIntoView()})}restoreScrollPositions(){se(()=>{this.page.scrollRegions&&this.scrollRegions().forEach((e,i)=>{let r=this.page.scrollRegions[i];if(r)typeof e.scrollTo=="function"?e.scrollTo(r.left,r.top):(e.scrollTop=r.top,e.scrollLeft=r.left);else return})})}isBackForwardVisit(){return window.history.state&&this.navigationType==="back_forward"}handleBackForwardVisit(e){window.history.state.version=e.version,this.setPage(window.history.state,{preserveScroll:!0,preserveState:!0}).then(()=>{this.restoreScrollPositions(),x(e)})}locationVisit(e,i){try{let r={preserveScroll:i};window.sessionStorage.setItem("inertiaLocationVisit",JSON.stringify(r)),window.location.href=e.href,w(window.location).href===w(e).href&&window.location.reload()}catch{return!1}}isLocationVisit(){try{return window.sessionStorage.getItem("inertiaLocationVisit")!==null}catch{return!1}}handleLocationVisit(e){let i=JSON.parse(window.sessionStorage.getItem("inertiaLocationVisit")||"");window.sessionStorage.removeItem("inertiaLocationVisit"),e.url+=window.location.hash,e.rememberedState=window.history.state?.rememberedState??{},e.scrollRegions=window.history.state?.scrollRegions??[],this.setPage(e,{preserveScroll:i.preserveScroll,preserveState:!0}).then(()=>{i.preserveScroll&&this.restoreScrollPositions(),x(e)})}isLocationVisitResponse(e){return!!(e&&e.status===409&&e.headers["x-inertia-location"])}isInertiaResponse(e){return!!e?.headers["x-inertia"]}createVisitId(){return this.visitId={},this.visitId}cancelVisit(e,{cancelled:i=!1,interrupted:r=!1}){e&&!e.completed&&!e.cancelled&&!e.interrupted&&(e.cancelToken.abort(),e.onCancel(),e.completed=!1,e.cancelled=i,e.interrupted=r,U(e),e.onFinish(e))}finishVisit(e){!e.cancelled&&!e.interrupted&&(e.completed=!0,e.cancelled=!1,e.interrupted=!1,U(e),e.onFinish(e))}resolvePreserveOption(e,i){return typeof e=="function"?e(i):e==="errors"?Object.keys(i.props.errors||{}).length>0:e}cancel(){this.activeVisit&&this.cancelVisit(this.activeVisit,{cancelled:!0})}visit(e,{method:i="get",data:r={},replace:o=!1,preserveScroll:l=!1,preserveState:h=!1,only:v=[],except:m=[],headers:c={},errorBag:s="",forceFormData:b=!1,onCancelToken:L=()=>{},onBefore:d=()=>{},onStart:p=()=>{},onProgress:P=()=>{},onFinish:y=()=>{},onCancel:le=()=>{},onSuccess:$=()=>{},onError:W=()=>{},queryStringArrayFormat:D="brackets"}={}){let S=typeof e=="string"?g(e):e;if((C(r)||b)&&!(r instanceof FormData)&&(r=G(r)),!(r instanceof FormData)){let[n,a]=A(i,S,r,D);S=g(n),r=a}let R={url:S,method:i,data:r,replace:o,preserveScroll:l,preserveState:h,only:v,except:m,headers:c,errorBag:s,forceFormData:b,queryStringArrayFormat:D,cancelled:!1,completed:!1,interrupted:!1};if(d(R)===!1||!J(R))return;this.activeVisit&&this.cancelVisit(this.activeVisit,{interrupted:!0}),this.saveScrollPositions();let X=this.createVisitId();this.activeVisit={...R,onCancelToken:L,onBefore:d,onStart:p,onProgress:P,onFinish:y,onCancel:le,onSuccess:$,onError:W,queryStringArrayFormat:D,cancelToken:new AbortController},L({cancel:()=>{this.activeVisit&&this.cancelVisit(this.activeVisit,{cancelled:!0})}}),Z(R),p(R);let K=!!(v.length||m.length);(0,M.default)({method:i,url:w(S).href,data:i==="get"?{}:r,params:i==="get"?r:{},signal:this.activeVisit.cancelToken.signal,headers:{...c,Accept:"text/html, application/xhtml+xml","X-Requested-With":"XMLHttpRequest","X-Inertia":!0,...K?{"X-Inertia-Partial-Component":this.page.component}:{},...v.length?{"X-Inertia-Partial-Data":v.join(",")}:{},...m.length?{"X-Inertia-Partial-Except":m.join(",")}:{},...s&&s.length?{"X-Inertia-Error-Bag":s}:{},...this.page.version?{"X-Inertia-Version":this.page.version}:{}},onUploadProgress:n=>{r instanceof FormData&&(n.percentage=n.progress?Math.round(n.progress*100):0,Y(n),P(n))}}).then(n=>{if(!this.isInertiaResponse(n))return Promise.reject({response:n});let a=n.data;K&&a.component===this.page.component&&(a.props={...this.page.props,...a.props}),l=this.resolvePreserveOption(l,a),h=this.resolvePreserveOption(h,a),h&&window.history.state?.rememberedState&&a.component===this.page.component&&(a.rememberedState=window.history.state.rememberedState);let E=S,V=g(a.url);return E.hash&&!V.hash&&w(E).href===V.href&&(V.hash=E.hash,a.url=V.href),this.setPage(a,{visitId:X,replace:o,preserveScroll:l,preserveState:h})}).then(()=>{let n=this.page.props.errors||{};if(Object.keys(n).length>0){let a=s?n[s]?n[s]:{}:n;return z(a),W(a)}return ee(this.page),$(this.page)}).catch(n=>{if(this.isInertiaResponse(n.response))return this.setPage(n.response.data,{visitId:X});if(this.isLocationVisitResponse(n.response)){let a=g(n.response.headers["x-inertia-location"]),E=S;E.hash&&!a.hash&&w(E).href===a.href&&(a.hash=E.hash),this.locationVisit(a,l===!0)}else if(n.response)Q(n.response)&&re.show(n.response.data);else return Promise.reject(n)}).then(()=>{this.activeVisit&&this.finishVisit(this.activeVisit)}).catch(n=>{if(!M.default.isCancel(n)){let a=_(n);if(this.activeVisit&&this.finishVisit(this.activeVisit),a)return Promise.reject(n)}})}setPage(e,{visitId:i=this.createVisitId(),replace:r=!1,preserveScroll:o=!1,preserveState:l=!1}={}){return Promise.resolve(this.resolveComponent(e.component)).then(h=>{i===this.visitId&&(e.scrollRegions=this.page.scrollRegions||[],e.rememberedState=e.rememberedState||{},r=r||g(e.url).href===window.location.href,r?this.replaceState(e):this.pushState(e),this.swapComponent({component:h,page:e,preserveState:l}).then(()=>{o?this.restoreScrollPositions():this.resetScrollPositions(),r||x(e)}))})}pushState(e){this.page=e,oe?setTimeout(()=>window.history.pushState(e,"",e.url)):window.history.pushState(e,"",e.url)}replaceState(e){this.page=e,oe?setTimeout(()=>window.history.replaceState(e,"",e.url)):window.history.replaceState(e,"",e.url)}handlePopstateEvent(e){if(e.state!==null){let i=e.state,r=this.createVisitId();Promise.resolve(this.resolveComponent(i.component)).then(o=>{r===this.visitId&&(this.page=i,this.swapComponent({component:o,page:i,preserveState:!1}).then(()=>{this.restoreScrollPositions(),x(i)}))})}else{let i=g(this.page.url);i.hash=window.location.hash,this.replaceState({...this.page,url:i.href}),this.resetScrollPositions()}}get(e,i={},r={}){return this.visit(e,{...r,method:"get",data:i})}reload(e={}){return this.visit(window.location.href,{...e,preserveScroll:!0,preserveState:!0})}replace(e,i={}){return console.warn(`Inertia.replace() has been deprecated and will be removed in a future release. Please use Inertia.${i.method??"get"}() instead.`),this.visit(e,{preserveState:!0,...i,replace:!0})}post(e,i={},r={}){return this.visit(e,{preserveState:!0,...r,method:"post",data:i})}put(e,i={},r={}){return this.visit(e,{preserveState:!0,...r,method:"put",data:i})}patch(e,i={},r={}){return this.visit(e,{preserveState:!0,...r,method:"patch",data:i})}delete(e,i={}){return this.visit(e,{preserveState:!0,...i,method:"delete"})}remember(e,i="default"){N||this.replaceState({...this.page,rememberedState:{...this.page?.rememberedState,[i]:e}})}restore(e="default"){if(!N)return window.history.state?.rememberedState?.[e]}on(e,i){if(N)return()=>{};let r=o=>{let l=i(o);o.cancelable&&!o.defaultPrevented&&l===!1&&o.preventDefault()};return document.addEventListener(`inertia:${e}`,r),()=>document.removeEventListener(`inertia:${e}`,r)}};var ge={buildDOMElement(t){let e=document.createElement("template");e.innerHTML=t;let i=e.content.firstChild;if(!t.startsWith("<script "))return i;let r=document.createElement("script");return r.innerHTML=i.innerHTML,i.getAttributeNames().forEach(o=>{r.setAttribute(o,i.getAttribute(o)||"")}),r},isInertiaManagedElement(t){return t.nodeType===Node.ELEMENT_NODE&&t.getAttribute("inertia")!==null},findMatchingElementIndex(t,e){let i=t.getAttribute("inertia");return i!==null?e.findIndex(r=>r.getAttribute("inertia")===i):-1},update:T(function(t){let e=t.map(r=>this.buildDOMElement(r));Array.from(document.head.childNodes).filter(r=>this.isInertiaManagedElement(r)).forEach(r=>{let o=this.findMatchingElementIndex(r,e);if(o===-1){r?.parentNode?.removeChild(r);return}let l=e.splice(o,1)[0];l&&!r.isEqualNode(l)&&r?.parentNode?.replaceChild(l,r)}),e.forEach(r=>document.head.appendChild(r))},1)};function j(t,e,i){let r={},o=0;function l(){let s=o+=1;return r[s]=[],s.toString()}function h(s){s===null||Object.keys(r).indexOf(s)===-1||(delete r[s],c())}function v(s,b=[]){s!==null&&Object.keys(r).indexOf(s)>-1&&(r[s]=b),c()}function m(){let s=e(""),b={...s?{title:`<title inertia="">${s}</title>`}:{}},L=Object.values(r).reduce((d,p)=>d.concat(p),[]).reduce((d,p)=>{if(p.indexOf("<")===-1)return d;if(p.indexOf("<title ")===0){let y=p.match(/(<title [^>]+>)(.*?)(<\/title>)/);return d.title=y?`${y[1]}${e(y[2])}${y[3]}`:p,d}let P=p.match(/ inertia="[^"]+"/);return P?d[P[0]]=p:d[Object.keys(d).length]=p,d},b);return Object.values(L)}function c(){t?i(m()):ge.update(m())}return c(),{forceUpdate:c,createProvider:function(){let s=l();return{update:b=>v(s,b),disconnect:()=>h(s)}}}}var u=O(require("nprogress"),1),ae=null;function ve(t){document.addEventListener("inertia:start",be.bind(null,t)),document.addEventListener("inertia:progress",we),document.addEventListener("inertia:finish",Ee)}function be(t){ae=setTimeout(()=>u.default.start(),t)}function we(t){u.default.isStarted()&&t.detail.progress?.percentage&&u.default.set(Math.max(u.default.status,t.detail.progress.percentage/100*.9))}function Ee(t){if(clearTimeout(ae),u.default.isStarted())t.detail.visit.completed?u.default.done():t.detail.visit.interrupted?u.default.set(0):t.detail.visit.cancelled&&(u.default.done(),u.default.remove());else return}function ye(t){let e=document.createElement("style");e.type="text/css",e.textContent=` | ||
"use strict";var ce=Object.create;var I=Object.defineProperty;var de=Object.getOwnPropertyDescriptor;var pe=Object.getOwnPropertyNames;var he=Object.getPrototypeOf,ue=Object.prototype.hasOwnProperty;var me=(t,e)=>{for(var i in e)I(t,i,{get:e[i],enumerable:!0})},B=(t,e,i,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of pe(e))!ue.call(t,o)&&o!==i&&I(t,o,{get:()=>e[o],enumerable:!(r=de(e,o))||r.enumerable});return t};var O=(t,e,i)=>(i=t!=null?ce(he(t)):{},B(e||!t||!t.__esModule?I(i,"default",{value:t,enumerable:!0}):i,t)),fe=t=>B(I({},"__esModule",{value:!0}),t);var Pe={};me(Pe,{createHeadManager:()=>j,hrefToUrl:()=>g,mergeDataIntoQueryString:()=>A,router:()=>Se,setupProgress:()=>H,shouldIntercept:()=>q,urlWithoutHash:()=>w});module.exports=fe(Pe);var M=O(require("axios"),1);function T(t,e){let i;return function(...r){clearTimeout(i),i=setTimeout(()=>t.apply(this,r),e)}}function f(t,e){return document.dispatchEvent(new CustomEvent(`inertia:${t}`,e))}var J=t=>f("before",{cancelable:!0,detail:{visit:t}}),z=t=>f("error",{detail:{errors:t}}),_=t=>f("exception",{cancelable:!0,detail:{exception:t}}),U=t=>f("finish",{detail:{visit:t}}),Q=t=>f("invalid",{cancelable:!0,detail:{response:t}}),P=t=>f("navigate",{detail:{page:t}}),Y=t=>f("progress",{detail:{progress:t}}),Z=t=>f("start",{detail:{visit:t}}),ee=t=>f("success",{detail:{page:t}});function C(t){return t instanceof File||t instanceof Blob||t instanceof FileList&&t.length>0||t instanceof FormData&&Array.from(t.values()).some(e=>C(e))||typeof t=="object"&&t!==null&&Object.values(t).some(e=>C(e))}function G(t,e=new FormData,i=null){t=t||{};for(let r in t)Object.prototype.hasOwnProperty.call(t,r)&&ie(e,te(i,r),t[r]);return e}function te(t,e){return t?t+"["+e+"]":e}function ie(t,e,i){if(Array.isArray(i))return Array.from(i.keys()).forEach(r=>ie(t,te(e,r.toString()),i[r]));if(i instanceof Date)return t.append(e,i.toISOString());if(i instanceof File)return t.append(e,i,i.name);if(i instanceof Blob)return t.append(e,i);if(typeof i=="boolean")return t.append(e,i?"1":"0");if(typeof i=="string")return t.append(e,i);if(typeof i=="number")return t.append(e,`${i}`);if(i==null)return t.append(e,"");G(i,t,e)}var re={modal:null,listener:null,show(t){typeof t=="object"&&(t=`All Inertia requests must receive a valid Inertia response, however a plain JSON response was received.<hr>${JSON.stringify(t)}`);let e=document.createElement("html");e.innerHTML=t,e.querySelectorAll("a").forEach(r=>r.setAttribute("target","_top")),this.modal=document.createElement("div"),this.modal.style.position="fixed",this.modal.style.width="100vw",this.modal.style.height="100vh",this.modal.style.padding="50px",this.modal.style.boxSizing="border-box",this.modal.style.backgroundColor="rgba(0, 0, 0, .6)",this.modal.style.zIndex=2e5,this.modal.addEventListener("click",()=>this.hide());let i=document.createElement("iframe");if(i.style.backgroundColor="white",i.style.borderRadius="5px",i.style.width="100%",i.style.height="100%",this.modal.appendChild(i),document.body.prepend(this.modal),document.body.style.overflow="hidden",!i.contentWindow)throw new Error("iframe not yet ready.");i.contentWindow.document.open(),i.contentWindow.document.write(e.outerHTML),i.contentWindow.document.close(),this.listener=this.hideOnEscape.bind(this),document.addEventListener("keydown",this.listener)},hide(){this.modal.outerHTML="",this.modal=null,document.body.style.overflow="visible",document.removeEventListener("keydown",this.listener)},hideOnEscape(t){t.keyCode===27&&this.hide()}};var ne=O(require("deepmerge"),1),F=O(require("qs"),1);function g(t){return new URL(t.toString(),window.location.toString())}function A(t,e,i,r="brackets"){let o=/^https?:\/\//.test(e.toString()),l=o||e.toString().startsWith("/"),h=!l&&!e.toString().startsWith("#")&&!e.toString().startsWith("?"),v=e.toString().includes("?")||t==="get"&&Object.keys(i).length,m=e.toString().includes("#"),c=new URL(e.toString(),"http://localhost");return t==="get"&&Object.keys(i).length&&(c.search=F.stringify((0,ne.default)(F.parse(c.search,{ignoreQueryPrefix:!0}),i),{encodeValuesOnly:!0,arrayFormat:r}),i={}),[[o?`${c.protocol}//${c.host}`:"",l?c.pathname:"",h?c.pathname.substring(1):"",v?c.search:"",m?c.hash:""].join(""),i]}function w(t){return t=new URL(t.href),t.hash="",t}var N=typeof window>"u",oe=!N&&/CriOS/.test(window.navigator.userAgent),se=t=>{requestAnimationFrame(()=>{requestAnimationFrame(t)})},k=class{constructor(){this.visitId=null}init({initialPage:e,resolveComponent:i,swapComponent:r}){this.page=e,this.resolveComponent=i,this.swapComponent=r,this.setNavigationType(),this.clearRememberedStateOnReload(),this.isBackForwardVisit()?this.handleBackForwardVisit(this.page):this.isLocationVisit()?this.handleLocationVisit(this.page):this.handleInitialPageVisit(this.page),this.setupEventListeners()}setNavigationType(){this.navigationType=window.performance&&window.performance.getEntriesByType&&window.performance.getEntriesByType("navigation").length>0?window.performance.getEntriesByType("navigation")[0].type:"navigate"}clearRememberedStateOnReload(){this.navigationType==="reload"&&window.history.state?.rememberedState&&delete window.history.state.rememberedState}handleInitialPageVisit(e){let i=window.location.hash;this.page.url.includes(i)||(this.page.url+=i),this.setPage(e,{preserveScroll:!0,preserveState:!0}).then(()=>P(e))}setupEventListeners(){window.addEventListener("popstate",this.handlePopstateEvent.bind(this)),document.addEventListener("scroll",T(this.handleScrollEvent.bind(this),100),!0)}scrollRegions(){return document.querySelectorAll("[scroll-region]")}handleScrollEvent(e){typeof e.target.hasAttribute=="function"&&e.target.hasAttribute("scroll-region")&&this.saveScrollPositions()}saveScrollPositions(){this.replaceState({...this.page,scrollRegions:Array.from(this.scrollRegions()).map(e=>({top:e.scrollTop,left:e.scrollLeft}))})}resetScrollPositions(){se(()=>{window.scrollTo(0,0),this.scrollRegions().forEach(e=>{typeof e.scrollTo=="function"?e.scrollTo(0,0):(e.scrollTop=0,e.scrollLeft=0)}),this.saveScrollPositions(),window.location.hash&&document.getElementById(window.location.hash.slice(1))?.scrollIntoView()})}restoreScrollPositions(){se(()=>{this.page.scrollRegions&&this.scrollRegions().forEach((e,i)=>{let r=this.page.scrollRegions[i];if(r)typeof e.scrollTo=="function"?e.scrollTo(r.left,r.top):(e.scrollTop=r.top,e.scrollLeft=r.left);else return})})}isBackForwardVisit(){return window.history.state&&this.navigationType==="back_forward"}handleBackForwardVisit(e){window.history.state.version=e.version,this.setPage(window.history.state,{preserveScroll:!0,preserveState:!0}).then(()=>{this.restoreScrollPositions(),P(e)})}locationVisit(e,i){try{let r={preserveScroll:i};window.sessionStorage.setItem("inertiaLocationVisit",JSON.stringify(r)),window.location.href=e.href,w(window.location).href===w(e).href&&window.location.reload()}catch{return!1}}isLocationVisit(){try{return window.sessionStorage.getItem("inertiaLocationVisit")!==null}catch{return!1}}handleLocationVisit(e){let i=JSON.parse(window.sessionStorage.getItem("inertiaLocationVisit")||"");window.sessionStorage.removeItem("inertiaLocationVisit"),e.url+=window.location.hash,e.rememberedState=window.history.state?.rememberedState??{},e.scrollRegions=window.history.state?.scrollRegions??[],this.setPage(e,{preserveScroll:i.preserveScroll,preserveState:!0}).then(()=>{i.preserveScroll&&this.restoreScrollPositions(),P(e)})}isLocationVisitResponse(e){return!!(e&&e.status===409&&e.headers["x-inertia-location"])}isInertiaResponse(e){return!!e?.headers["x-inertia"]}createVisitId(){return this.visitId={},this.visitId}cancelVisit(e,{cancelled:i=!1,interrupted:r=!1}){e&&!e.completed&&!e.cancelled&&!e.interrupted&&(e.cancelToken.abort(),e.onCancel(),e.completed=!1,e.cancelled=i,e.interrupted=r,U(e),e.onFinish(e))}finishVisit(e){!e.cancelled&&!e.interrupted&&(e.completed=!0,e.cancelled=!1,e.interrupted=!1,U(e),e.onFinish(e))}resolvePreserveOption(e,i){return typeof e=="function"?e(i):e==="errors"?Object.keys(i.props.errors||{}).length>0:e}cancel(){this.activeVisit&&this.cancelVisit(this.activeVisit,{cancelled:!0})}visit(e,{method:i="get",data:r={},replace:o=!1,preserveScroll:l=!1,preserveState:h=!1,only:v=[],except:m=[],headers:c={},errorBag:s="",forceFormData:b=!1,onCancelToken:L=()=>{},onBefore:d=()=>{},onStart:p=()=>{},onProgress:x=()=>{},onFinish:y=()=>{},onCancel:le=()=>{},onSuccess:$=()=>{},onError:W=()=>{},queryStringArrayFormat:D="brackets"}={}){let S=typeof e=="string"?g(e):e;if((C(r)||b)&&!(r instanceof FormData)&&(r=G(r)),!(r instanceof FormData)){let[n,a]=A(i,S,r,D);S=g(n),r=a}let R={url:S,method:i,data:r,replace:o,preserveScroll:l,preserveState:h,only:v,except:m,headers:c,errorBag:s,forceFormData:b,queryStringArrayFormat:D,cancelled:!1,completed:!1,interrupted:!1};if(d(R)===!1||!J(R))return;this.activeVisit&&this.cancelVisit(this.activeVisit,{interrupted:!0}),this.saveScrollPositions();let K=this.createVisitId();this.activeVisit={...R,onCancelToken:L,onBefore:d,onStart:p,onProgress:x,onFinish:y,onCancel:le,onSuccess:$,onError:W,queryStringArrayFormat:D,cancelToken:new AbortController},L({cancel:()=>{this.activeVisit&&this.cancelVisit(this.activeVisit,{cancelled:!0})}}),Z(R),p(R);let X=!!(v.length||m.length);(0,M.default)({method:i,url:w(S).href,data:i==="get"?{}:r,params:i==="get"?r:{},signal:this.activeVisit.cancelToken.signal,headers:{...c,Accept:"text/html, application/xhtml+xml","X-Requested-With":"XMLHttpRequest","X-Inertia":!0,...X?{"X-Inertia-Partial-Component":this.page.component}:{},...v.length?{"X-Inertia-Partial-Data":v.join(",")}:{},...m.length?{"X-Inertia-Partial-Except":m.join(",")}:{},...s&&s.length?{"X-Inertia-Error-Bag":s}:{},...this.page.version?{"X-Inertia-Version":this.page.version}:{}},onUploadProgress:n=>{r instanceof FormData&&(n.percentage=n.progress?Math.round(n.progress*100):0,Y(n),x(n))}}).then(n=>{if(!this.isInertiaResponse(n))return Promise.reject({response:n});let a=n.data;X&&a.component===this.page.component&&(a.props={...this.page.props,...a.props}),l=this.resolvePreserveOption(l,a),h=this.resolvePreserveOption(h,a),h&&window.history.state?.rememberedState&&a.component===this.page.component&&(a.rememberedState=window.history.state.rememberedState);let E=S,V=g(a.url);return E.hash&&!V.hash&&w(E).href===V.href&&(V.hash=E.hash,a.url=V.href),this.setPage(a,{visitId:K,replace:o,preserveScroll:l,preserveState:h})}).then(()=>{let n=this.page.props.errors||{};if(Object.keys(n).length>0){let a=s?n[s]?n[s]:{}:n;return z(a),W(a)}return ee(this.page),$(this.page)}).catch(n=>{if(this.isInertiaResponse(n.response))return this.setPage(n.response.data,{visitId:K});if(this.isLocationVisitResponse(n.response)){let a=g(n.response.headers["x-inertia-location"]),E=S;E.hash&&!a.hash&&w(E).href===a.href&&(a.hash=E.hash),this.locationVisit(a,l===!0)}else if(n.response)Q(n.response)&&re.show(n.response.data);else return Promise.reject(n)}).then(()=>{this.activeVisit&&this.finishVisit(this.activeVisit)}).catch(n=>{if(!M.default.isCancel(n)){let a=_(n);if(this.activeVisit&&this.finishVisit(this.activeVisit),a)return Promise.reject(n)}})}setPage(e,{visitId:i=this.createVisitId(),replace:r=!1,preserveScroll:o=!1,preserveState:l=!1}={}){return Promise.resolve(this.resolveComponent(e.component)).then(h=>{i===this.visitId&&(e.scrollRegions=this.page.scrollRegions||[],e.rememberedState=e.rememberedState||{},r=r||g(e.url).href===window.location.href,r?this.replaceState(e):this.pushState(e),this.swapComponent({component:h,page:e,preserveState:l}).then(()=>{o?this.restoreScrollPositions():this.resetScrollPositions(),r||P(e)}))})}pushState(e){this.page=e,oe?setTimeout(()=>window.history.pushState(e,"",e.url)):window.history.pushState(e,"",e.url)}replaceState(e){this.page=e,oe?setTimeout(()=>window.history.replaceState(e,"",e.url)):window.history.replaceState(e,"",e.url)}handlePopstateEvent(e){if(e.state!==null){let i=e.state,r=this.createVisitId();Promise.resolve(this.resolveComponent(i.component)).then(o=>{r===this.visitId&&(this.page=i,this.swapComponent({component:o,page:i,preserveState:!1}).then(()=>{this.restoreScrollPositions(),P(i)}))})}else{let i=g(this.page.url);i.hash=window.location.hash,this.replaceState({...this.page,url:i.href}),this.resetScrollPositions()}}get(e,i={},r={}){return this.visit(e,{...r,method:"get",data:i})}reload(e={}){return this.visit(window.location.href,{...e,preserveScroll:!0,preserveState:!0})}replace(e,i={}){return console.warn(`Inertia.replace() has been deprecated and will be removed in a future release. Please use Inertia.${i.method??"get"}() instead.`),this.visit(e,{preserveState:!0,...i,replace:!0})}post(e,i={},r={}){return this.visit(e,{preserveState:!0,...r,method:"post",data:i})}put(e,i={},r={}){return this.visit(e,{preserveState:!0,...r,method:"put",data:i})}patch(e,i={},r={}){return this.visit(e,{preserveState:!0,...r,method:"patch",data:i})}delete(e,i={}){return this.visit(e,{preserveState:!0,...i,method:"delete"})}remember(e,i="default"){N||this.replaceState({...this.page,rememberedState:{...this.page?.rememberedState,[i]:e}})}restore(e="default"){if(!N)return window.history.state?.rememberedState?.[e]}on(e,i){if(N)return()=>{};let r=o=>{let l=i(o);o.cancelable&&!o.defaultPrevented&&l===!1&&o.preventDefault()};return document.addEventListener(`inertia:${e}`,r),()=>document.removeEventListener(`inertia:${e}`,r)}};var ge={buildDOMElement(t){let e=document.createElement("template");e.innerHTML=t;let i=e.content.firstChild;if(!t.startsWith("<script "))return i;let r=document.createElement("script");return r.innerHTML=i.innerHTML,i.getAttributeNames().forEach(o=>{r.setAttribute(o,i.getAttribute(o)||"")}),r},isInertiaManagedElement(t){return t.nodeType===Node.ELEMENT_NODE&&t.getAttribute("inertia")!==null},findMatchingElementIndex(t,e){let i=t.getAttribute("inertia");return i!==null?e.findIndex(r=>r.getAttribute("inertia")===i):-1},update:T(function(t){let e=t.map(r=>this.buildDOMElement(r));Array.from(document.head.childNodes).filter(r=>this.isInertiaManagedElement(r)).forEach(r=>{let o=this.findMatchingElementIndex(r,e);if(o===-1){r?.parentNode?.removeChild(r);return}let l=e.splice(o,1)[0];l&&!r.isEqualNode(l)&&r?.parentNode?.replaceChild(l,r)}),e.forEach(r=>document.head.appendChild(r))},1)};function j(t,e,i){let r={},o=0;function l(){let s=o+=1;return r[s]=[],s.toString()}function h(s){s===null||Object.keys(r).indexOf(s)===-1||(delete r[s],c())}function v(s,b=[]){s!==null&&Object.keys(r).indexOf(s)>-1&&(r[s]=b),c()}function m(){let s=e(""),b={...s?{title:`<title inertia="">${s}</title>`}:{}},L=Object.values(r).reduce((d,p)=>d.concat(p),[]).reduce((d,p)=>{if(p.indexOf("<")===-1)return d;if(p.indexOf("<title ")===0){let y=p.match(/(<title [^>]+>)(.*?)(<\/title>)/);return d.title=y?`${y[1]}${e(y[2])}${y[3]}`:p,d}let x=p.match(/ inertia="[^"]+"/);return x?d[x[0]]=p:d[Object.keys(d).length]=p,d},b);return Object.values(L)}function c(){t?i(m()):ge.update(m())}return c(),{forceUpdate:c,createProvider:function(){let s=l();return{update:b=>v(s,b),disconnect:()=>h(s)}}}}var u=O(require("nprogress"),1),ae=null;function ve(t){document.addEventListener("inertia:start",be.bind(null,t)),document.addEventListener("inertia:progress",we),document.addEventListener("inertia:finish",Ee)}function be(t){ae=setTimeout(()=>u.default.start(),t)}function we(t){u.default.isStarted()&&t.detail.progress?.percentage&&u.default.set(Math.max(u.default.status,t.detail.progress.percentage/100*.9))}function Ee(t){if(clearTimeout(ae),u.default.isStarted())t.detail.visit.completed?u.default.done():t.detail.visit.interrupted?u.default.set(0):t.detail.visit.cancelled&&(u.default.done(),u.default.remove());else return}function ye(t){let e=document.createElement("style");e.type="text/css",e.textContent=` | ||
#nprogress { | ||
@@ -3,0 +3,0 @@ pointer-events: none; |
{ | ||
"name": "@inertiajs/core", | ||
"version": "1.3.0-beta.2", | ||
"version": "1.3.0", | ||
"license": "MIT", | ||
@@ -5,0 +5,0 @@ "description": "A framework for creating server-driven single page apps.", |
@@ -1,1 +0,1 @@ | ||
export default function shouldIntercept(event: MouseEvent | KeyboardEvent): boolean; | ||
export default function shouldIntercept(event: Pick<MouseEvent, 'altKey' | 'ctrlKey' | 'defaultPrevented' | 'target' | 'currentTarget' | 'metaKey' | 'shiftKey' | 'button'>): boolean; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
169984
2
33
0
3
0
11