mirror of
https://github.com/thepaperpilot/Advent-Incremental.git
synced 2024-11-29 19:35:19 +00:00
8 lines
133 KiB
JavaScript
8 lines
133 KiB
JavaScript
|
function Oe(e,t){const n=Object.create(null),s=e.split(",");for(let r=0;r<s.length;r++)n[s[r]]=!0;return t?r=>!!n[r.toLowerCase()]:r=>!!n[r]}const _f="Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt",Ef=Oe(_f);function Hn(e){if(U(e)){const t={};for(let n=0;n<e.length;n++){const s=e[n],r=z(s)?Zo(s):Hn(s);if(r)for(const i in r)t[i]=r[i]}return t}else{if(z(e))return e;if(ie(e))return e}}const Cf=/;(?![^(]*\))/g,vf=/:([^]+)/,Tf=/\/\*.*?\*\//gs;function Zo(e){const t={};return e.replace(Tf,"").split(Cf).forEach(n=>{if(n){const s=n.split(vf);s.length>1&&(t[s[0].trim()]=s[1].trim())}}),t}function Vn(e){let t="";if(z(e))t=e;else if(U(e))for(let n=0;n<e.length;n++){const s=Vn(e[n]);s&&(t+=s+" ")}else if(ie(e))for(const n in e)e[n]&&(t+=n+" ");return t.trim()}function Sf(e){if(!e)return null;let{class:t,style:n}=e;return t&&!z(t)&&(e.class=Vn(t)),n&&(e.style=Hn(n)),e}const wf="html,body,base,head,link,meta,style,title,address,article,aside,footer,header,h1,h2,h3,h4,h5,h6,nav,section,div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,summary,template,blockquote,iframe,tfoot",Nf="svg,animate,animateMotion,animateTransform,circle,clipPath,color-profile,defs,desc,discard,ellipse,feBlend,feColorMatrix,feComponentTransfer,feComposite,feConvolveMatrix,feDiffuseLighting,feDisplacementMap,feDistanceLight,feDropShadow,feFlood,feFuncA,feFuncB,feFuncG,feFuncR,feGaussianBlur,feImage,feMerge,feMergeNode,feMorphology,feOffset,fePointLight,feSpecularLighting,feSpotLight,feTile,feTurbulence,filter,foreignObject,g,hatch,hatchpath,image,line,linearGradient,marker,mask,mesh,meshgradient,meshpatch,meshrow,metadata,mpath,path,pattern,polygon,polyline,radialGradient,rect,set,solidcolor,stop,switch,symbol,text,textPath,title,tspan,unknown,use,view",Pf="area,base,br,col,embed,hr,img,input,link,meta,param,source,track,wbr",Of=Oe(wf),Rf=Oe(Nf),Af=Oe(Pf),If="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",Mf=Oe(If);function Xo(e){return!!e||e===""}function kf(e,t){if(e.length!==t.length)return!1;let n=!0;for(let s=0;n&&s<e.length;s++)n=gt(e[s],t[s]);return n}function gt(e,t){if(e===t)return!0;let n=Ji(e),s=Ji(t);if(n||s)return n&&s?e.getTime()===t.getTime():!1;if(n=mt(e),s=mt(t),n||s)return e===t;if(n=U(e),s=U(t),n||s)return n&&s?kf(e,t):!1;if(n=ie(e),s=ie(t),n||s){if(!n||!s)return!1;const r=Object.keys(e).length,i=Object.keys(t).length;if(r!==i)return!1;for(const o in e){const l=e.hasOwnProperty(o),c=t.hasOwnProperty(o);if(l&&!c||!l&&c||!gt(e[o],t[o]))return!1}}return String(e)===String(t)}function Fs(e,t){return e.findIndex(n=>gt(n,t))}const Ff=e=>z(e)?e:e==null?"":U(e)||ie(e)&&(e.toString===Go||!W(e.toString))?JSON.stringify(e,Qo,2):String(e),Qo=(e,t)=>t&&t.__v_isRef?Qo(e,t.value):Xt(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[s,r])=>(n[`${s} =>`]=r,n),{})}:Kt(t)?{[`Set(${t.size})`]:[...t.values()]}:ie(t)&&!U(t)&&!el(t)?String(t):t,se={},Zt=[],ke=()=>{},ps=()=>!1,Lf=/^on[^a-z]/,Ut=e=>Lf.test(e),xr=e=>e.startsWith("onUpdate:"),te=Object.assign,Wr=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},Bf=Object.prototype.hasOwnProperty,X=(e,t)=>Bf.call(e,t),U=Array.isArray,Xt=e=>Un(e)==="[object Map]",Kt=e=>Un(e)==="[object Set]",Ji=e=>Un(e)==="[object Date]",W=e=>typeof e=="function",z=e=>typeof e=="string",mt=e=>typeof e=="symbol",ie=e=>e!==null&&typeof e=="object",qr=e=>ie(e)&&W(e.then)&&W(e.catch),Go=Object.prototype.toString,Un=e=>Go.call(e),Df=e=>Un(e).slice(8,-1),el=e=>Un(e)==="[object Object]",zr=e=>z(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,At=Oe(",key,ref,ref_for,ref_key,onVnodeBeforeMount
|
||
|
`);else if(/[^\t\r\n\f ]/.test(f.content))l&&(f.content=f.content.replace(/[\t\r\n\f ]+/g," "));else{const u=i[c-1],a=i[c+1];!u||!a||l&&(u.type===3&&a.type===3||u.type===3&&a.type===1||u.type===1&&a.type===3||u.type===1&&a.type===1&&/[\r\n]/.test(f.content))?(o=!0,i[c]=null):f.content=" "}else f.type===3&&!e.options.comments&&(o=!0,i[c]=null)}if(e.inPre&&s&&e.options.isPreTag(s.tag)){const c=i[0];c&&c.type===2&&(c.content=c.content.replace(/^\r?\n/,""))}}return o?i.filter(Boolean):i}function Lo(e,t){if(t.type===2){const n=nr(e);if(n&&n.type===2&&n.loc.end.offset===t.loc.start.offset){n.content+=t.content,n.loc.end=t.loc.end,n.loc.source+=t.loc.source;return}}e.push(t)}function pd(e,t){he(e,9);const n=Ui(e,3,t);return e.source.length===0?ne(e,6):he(e,3),n}function dd(e){const t=Le(e);let n;const s=/--(\!)?>/.exec(e.source);if(!s)n=e.source.slice(4),he(e,e.source.length),ne(e,7);else{s.index<=3&&ne(e,0),s[1]&&ne(e,10),n=e.source.slice(4,s.index);const r=e.source.slice(0,s.index);let i=1,o=0;for(;(o=r.indexOf("<!--",i))!==-1;)he(e,o-i+1),o+4<r.length&&ne(e,16),i=o+1;he(e,s.index+s[0].length-i+1)}return{type:3,content:n,loc:Ke(e,t)}}function mn(e){const t=Le(e),n=e.source[1]==="?"?1:2;let s;const r=e.source.indexOf(">");return r===-1?(s=e.source.slice(n),he(e,e.source.length)):(s=e.source.slice(n,r),he(e,r+1)),{type:3,content:s,loc:Ke(e,t)}}function hd(e,t){const n=e.inPre,s=e.inVPre,r=nr(t),i=Hr(e,0,r),o=e.inPre&&!n,l=e.inVPre&&!s;if(i.isSelfClosing||e.options.isVoidTag(i.tag))return o&&(e.inPre=!1),l&&(e.inVPre=!1),i;t.push(i);const c=e.options.getTextMode(i,r),f=Ui(e,c,t);t.pop();{const u=i.props.find(a=>a.type===6&&a.name==="inline-template");if(u&&Dn("COMPILER_INLINE_TEMPLATE",e,u.loc)){const a=Ke(e,i.loc.end);u.value={type:2,content:a.source,loc:a}}}if(i.children=f,Vr(e.source,i.tag))Hr(e,1,r);else if(ne(e,24,0,i.loc.start),e.source.length===0&&i.tag.toLowerCase()==="script"){const u=f[0];u&&Ce(u.loc.source,"<!--")&&ne(e,8)}return i.loc=Ke(e,i.loc.start),o&&(e.inPre=!1),l&&(e.inVPre=!1),i}const xc=Oe("if,else,else-if,for,slot");function Hr(e,t,n){const s=Le(e),r=/^<\/?([a-z][^\t\r\n\f />]*)/i.exec(e.source),i=r[1],o=e.options.getNamespace(i,n);he(e,r[0].length),$n(e);const l=Le(e),c=e.source;e.options.isPreTag(i)&&(e.inPre=!0);let f=Bo(e,t);t===0&&!e.inVPre&&f.some(d=>d.type===7&&d.name==="pre")&&(e.inVPre=!0,te(e,l),e.source=c,f=Bo(e,t).filter(d=>d.name!=="v-pre"));let u=!1;if(e.source.length===0?ne(e,9):(u=Ce(e.source,"/>"),t===1&&u&&ne(e,4),he(e,u?2:1)),t===1)return;let a=0;return e.inVPre||(i==="slot"?a=2:i==="template"?f.some(d=>d.type===7&&xc(d.name))&&(a=3):gd(i,f,e)&&(a=1)),{type:1,ns:o,tag:i,tagType:a,props:f,isSelfClosing:u,children:[],loc:Ke(e,s),codegenNode:void 0}}function gd(e,t,n){const s=n.options;if(s.isCustomElement(e))return!1;if(e==="component"||/^[A-Z]/.test(e)||Vc(e)||s.isBuiltInComponent&&s.isBuiltInComponent(e)||s.isNativeTag&&!s.isNativeTag(e))return!0;for(let r=0;r<t.length;r++){const i=t[r];if(i.type===6){if(i.name==="is"&&i.value){if(i.value.content.startsWith("vue:"))return!0;if(Dn("COMPILER_IS_ON_ELEMENT",n,i.loc))return!0}}else{if(i.name==="is")return!0;if(i.name==="bind"&&Rt(i.arg,"is")&&!0&&Dn("COMPILER_IS_ON_ELEMENT",n,i.loc))return!0}}}function Bo(e,t){const n=[],s=new Set;for(;e.source.length>0&&!Ce(e.source,">")&&!Ce(e.source,"/>");){if(Ce(e.source,"/")){ne(e,22),he(e,1),$n(e);continue}t===1&&ne(e,3);const r=md(e,s);r.type===6&&r.value&&r.name==="class"&&(r.value.content=r.value.content.replace(/\s+/g," ").trim()),t===0&&n.push(r),/^[^\t\r\n\f />]/.test(e.source)&&ne(e,15),$n(e)}return n}function md(e,t){const n=Le(e),r=/^[^\t\r\n\f />][^\t\r\n\f />=]*/.exec(e.source)[0];t.has(r)&&ne(e,2),t.add(r),r[0]==="="&&ne(e,19);{const l=/["'<]/g;let c;for(;c=l.exec(r);)ne(e,17,c.index)}he(e,r.length);let i;/^[\t\r\n\f ]*=/.test(e.source)&&($n(e),he(e,1),$n(e),i=yd(e),i||ne(e,13));const o=Ke(e,n);if(!e.inVPre&&/^(v-[A-Za-z0-9-]|:|\.|@|#)/.test(r)){const l=/(?:^v-([a-z0-9-]+))?(?:(?::|^\.|^@|^#)(\[[^\]]+\]|[^\.]+))?(.+)?$/i.exec(r);let c=Ce(r,"."),f=l[1]||(c||Ce(r,":")?"bind":Ce(r,"@")?"on":"s
|
||
|
`+" ".repeat(v))}return m}function Od(e,t={}){const n=Pd(e,t);t.onContextCreated&&t.onContextCreated(n);const{mode:s,push:r,prefixIdentifiers:i,indent:o,deindent:l,newline:c,scopeId:f,ssr:u}=n,a=e.helpers.length>0,d=!i&&s!=="module";Rd(e,n);const E=u?"ssrRender":"render",A=(u?["_ctx","_push","_parent","_attrs"]:["_ctx","_cache"]).join(", ");if(r(`function ${E}(${A}) {`),o(),d&&(r("with (_ctx) {"),o(),a&&(r(`const { ${e.helpers.map(Xc).join(", ")} } = _Vue`),r(`
|
||
|
`),c())),e.components.length&&(mr(e.components,"component",n),(e.directives.length||e.temps>0)&&c()),e.directives.length&&(mr(e.directives,"directive",n),e.temps>0&&c()),e.filters&&e.filters.length&&(c(),mr(e.filters,"filter",n),c()),e.temps>0){r("let ");for(let y=0;y<e.temps;y++)r(`${y>0?", ":""}_temp${y}`)}return(e.components.length||e.directives.length||e.temps)&&(r(`
|
||
|
`),c()),u||r("return "),e.codegenNode?Te(e.codegenNode,n):r("null"),d&&(l(),r("}")),l(),r("}"),{ast:e,code:n.code,preamble:"",map:n.map?n.map.toJSON():void 0}}function Rd(e,t){const{ssr:n,prefixIdentifiers:s,push:r,newline:i,runtimeModuleName:o,runtimeGlobalName:l,ssrRuntimeModuleName:c}=t,f=l;if(e.helpers.length>0&&(r(`const _Vue = ${f}
|
||
|
`),e.hoists.length)){const u=[Ni,Pi,qn,Oi,Bc].filter(a=>e.helpers.includes(a)).map(Xc).join(", ");r(`const { ${u} } = _Vue
|
||
|
`)}Ad(e.hoists,t),i(),r("return ")}function mr(e,t,{helper:n,push:s,newline:r,isTS:i}){const o=n(t==="filter"?Ii:t==="component"?Ri:Ai);for(let l=0;l<e.length;l++){let c=e[l];const f=c.endsWith("__self");f&&(c=c.slice(0,-6)),s(`const ${Bn(c,t)} = ${o}(${JSON.stringify(c)}${f?", true":""})${i?"!":""}`),l<e.length-1&&r()}}function Ad(e,t){if(!e.length)return;t.pure=!0;const{push:n,newline:s,helper:r,scopeId:i,mode:o}=t;s();for(let l=0;l<e.length;l++){const c=e[l];c&&(n(`const _hoisted_${l+1} = `),Te(c,t),s())}t.pure=!1}function Ki(e,t){const n=e.length>3||!1;t.push("["),n&&t.indent(),Yn(e,t,n),n&&t.deindent(),t.push("]")}function Yn(e,t,n=!1,s=!0){const{push:r,newline:i}=t;for(let o=0;o<e.length;o++){const l=e[o];z(l)?r(l):U(l)?Ki(l,t):Te(l,t),o<e.length-1&&(n?(s&&r(","),i()):s&&r(", "))}}function Te(e,t){if(z(e)){t.push(e);return}if(mt(e)){t.push(t.helper(e));return}switch(e.type){case 1:case 9:case 11:Te(e.codegenNode,t);break;case 2:Id(e,t);break;case 4:Qc(e,t);break;case 5:Md(e,t);break;case 12:Te(e.codegenNode,t);break;case 8:Gc(e,t);break;case 3:Fd(e,t);break;case 13:Ld(e,t);break;case 14:Dd(e,t);break;case 15:$d(e,t);break;case 17:Hd(e,t);break;case 18:Vd(e,t);break;case 19:Ud(e,t);break;case 20:Kd(e,t);break;case 21:Yn(e.body,t,!0,!1);break}}function Id(e,t){t.push(JSON.stringify(e.content),e)}function Qc(e,t){const{content:n,isStatic:s}=e;t.push(s?JSON.stringify(n):n,e)}function Md(e,t){const{push:n,helper:s,pure:r}=t;r&&n(rr),n(`${s(er)}(`),Te(e.content,t),n(")")}function Gc(e,t){for(let n=0;n<e.children.length;n++){const s=e.children[n];z(s)?t.push(s):Te(s,t)}}function kd(e,t){const{push:n}=t;if(e.type===8)n("["),Gc(e,t),n("]");else if(e.isStatic){const s=Hi(e.content)?e.content:JSON.stringify(e.content);n(s,e)}else n(`[${e.content}]`,e)}function Fd(e,t){const{push:n,helper:s,pure:r}=t;r&&n(rr),n(`${s(qn)}(${JSON.stringify(e.content)})`,e)}function Ld(e,t){const{push:n,helper:s,pure:r}=t,{tag:i,props:o,children:l,patchFlag:c,dynamicProps:f,directives:u,isBlock:a,disableTracking:d,isComponent:m}=e;u&&n(s(Mi)+"("),a&&n(`(${s(Vt)}(${d?"true":""}), `),r&&n(rr);const E=a?an(t.inSSR,m):fn(t.inSSR,m);n(s(E)+"(",e),Yn(Bd([i,o,l,c,f]),t),n(")"),a&&n(")"),u&&(n(", "),Te(u,t),n(")"))}function Bd(e){let t=e.length;for(;t--&&e[t]==null;);return e.slice(0,t+1).map(n=>n||"null")}function Dd(e,t){const{push:n,helper:s,pure:r}=t,i=z(e.callee)?e.callee:s(e.callee);r&&n(rr),n(i+"(",e),Yn(e.arguments,t),n(")")}function $d(e,t){const{push:n,indent:s,deindent:r,newline:i}=t,{properties:o}=e;if(!o.length){n("{}",e);return}const l=o.length>1||!1;n(l?"{":"{ "),l&&s();for(let c=0;c<o.length;c++){const{key:f,value:u}=o[c];kd(f,t),n(": "),Te(u,t),c<o.length-1&&(n(","),i())}l&&r(),n(l?"}":" }")}function Hd(e,t){Ki(e.elements,t)}function Vd(e,t){const{push:n,indent:s,deindent:r}=t,{params:i,returns:o,body:l,newline:c,isSlot:f}=e;f&&n(`_${ln[Di]}(`),n("(",e),U(i)?Yn(i,t):i&&Te(i,t),n(") => "),(c||l)&&(n("{"),s()),o?(c&&n("return "),U(o)?Ki(o,t):Te(o,t)):l&&Te(l,t),(c||l)&&(r(),n("}")),f&&(e.isNonScopedSlot&&n(", undefined, true"),n(")"))}function Ud(e,t){const{test:n,consequent:s,alternate:r,newline:i}=e,{push:o,indent:l,deindent:c,newline:f}=t;if(n.type===4){const a=!Hi(n.content);a&&o("("),Qc(n,t),a&&o(")")}else o("("),Te(n,t),o(")");i&&l(),t.indentLevel++,i||o(" "),o("? "),Te(s,t),t.indentLevel--,i&&f(),i||o(" "),o(": ");const u=r.type===19;u||t.indentLevel++,Te(r,t),u||t.indentLevel--,i&&c(!0)}function Kd(e,t){const{push:n,helper:s,indent:r,deindent:i,newline:o}=t;n(`_cache[${e.index}] || (`),e.isVNode&&(r(),n(`${s(Ps)}(-1),`),o()),n(`_cache[${e.index}] = `),Te(e.value,t),e.isVNode&&(n(","),o(),n(`${s(Ps)}(1),`),o(),n(`_cache[${e.index}]`),i()),n(")")}new RegExp("\\b"+"do,if,for,let,new,try,var,case,else,with,await,break,catch,class,const,super,throw,while,yield,delete,export,import,return,switch,default,extends,finally,continue,debugger,function,arguments,typeof,void".split(",").join("\\b|\\b")+"\\b");const jd=Zc(/^(if|else|else-if)$/,(e,t,n)=>xd(e,t,n,(s,r,i)=>{const o=n.parent.children;let l=o.indexOf(s),c=0;for(;l-->=0;){const f=o[l]
|