From 7d1acd3d798693ae65522e37a58c636f1108a093 Mon Sep 17 00:00:00 2001 From: Marcus Moore Date: Wed, 29 May 2024 12:04:06 -0700 Subject: [PATCH 01/36] Update Livewire via composer --- composer.json | 2 +- composer.lock | 37 +- public/vendor/livewire/livewire.esm.js | 10783 +++++++++++++++++++ public/vendor/livewire/livewire.js | 9919 ++++++++++++++++- public/vendor/livewire/livewire.min.js | 103 + public/vendor/livewire/livewire.min.js.map | 7 + public/vendor/livewire/manifest.json | 3 +- 7 files changed, 20821 insertions(+), 33 deletions(-) create mode 100644 public/vendor/livewire/livewire.esm.js create mode 100644 public/vendor/livewire/livewire.min.js create mode 100644 public/vendor/livewire/livewire.min.js.map diff --git a/composer.json b/composer.json index 5c2606fb8d..54bb817a76 100644 --- a/composer.json +++ b/composer.json @@ -49,7 +49,7 @@ "laravelcollective/html": "^6.2", "league/csv": "^9.7", "league/flysystem-aws-s3-v3": "^3.0", - "livewire/livewire": "^2.4", + "livewire/livewire": "^3.0", "neitanod/forceutf8": "^2.0", "nesbot/carbon": "^2.32", "nunomaduro/collision": "^6.1", diff --git a/composer.lock b/composer.lock index 9640a69e0a..107225d088 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "09b576ccf0db4a09af74bc9f95593c20", + "content-hash": "bcdb962e3d330d88894f0431689158ae", "packages": [ { "name": "alek13/slack", @@ -4475,34 +4475,37 @@ }, { "name": "livewire/livewire", - "version": "v2.12.6", + "version": "v3.5.0", "source": { "type": "git", "url": "https://github.com/livewire/livewire.git", - "reference": "7d3a57b3193299cf1a0639a3935c696f4da2cf92" + "reference": "72e900825c560f0e4e620185b26c5441a8914435" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/livewire/livewire/zipball/7d3a57b3193299cf1a0639a3935c696f4da2cf92", - "reference": "7d3a57b3193299cf1a0639a3935c696f4da2cf92", + "url": "https://api.github.com/repos/livewire/livewire/zipball/72e900825c560f0e4e620185b26c5441a8914435", + "reference": "72e900825c560f0e4e620185b26c5441a8914435", "shasum": "" }, "require": { - "illuminate/database": "^7.0|^8.0|^9.0|^10.0", - "illuminate/support": "^7.0|^8.0|^9.0|^10.0", - "illuminate/validation": "^7.0|^8.0|^9.0|^10.0", + "illuminate/database": "^10.0|^11.0", + "illuminate/routing": "^10.0|^11.0", + "illuminate/support": "^10.0|^11.0", + "illuminate/validation": "^10.0|^11.0", "league/mime-type-detection": "^1.9", - "php": "^7.2.5|^8.0", - "symfony/http-kernel": "^5.0|^6.0" + "php": "^8.1", + "symfony/console": "^6.0|^7.0", + "symfony/http-kernel": "^6.2|^7.0" }, "require-dev": { "calebporzio/sushi": "^2.1", - "laravel/framework": "^7.0|^8.0|^9.0|^10.0", + "laravel/framework": "^10.15.0|^11.0", + "laravel/prompts": "^0.1.6", "mockery/mockery": "^1.3.1", - "orchestra/testbench": "^5.0|^6.0|^7.0|^8.0", - "orchestra/testbench-dusk": "^5.2|^6.0|^7.0|^8.0", - "phpunit/phpunit": "^8.4|^9.0", - "psy/psysh": "@stable" + "orchestra/testbench": "^8.21.0|^9.0", + "orchestra/testbench-dusk": "^8.24|^9.1", + "phpunit/phpunit": "^10.4", + "psy/psysh": "^0.11.22|^0.12" }, "type": "library", "extra": { @@ -4536,7 +4539,7 @@ "description": "A front-end framework for Laravel.", "support": { "issues": "https://github.com/livewire/livewire/issues", - "source": "https://github.com/livewire/livewire/tree/v2.12.6" + "source": "https://github.com/livewire/livewire/tree/v3.5.0" }, "funding": [ { @@ -4544,7 +4547,7 @@ "type": "github" } ], - "time": "2023-08-11T04:02:34+00:00" + "time": "2024-05-21T13:39:04+00:00" }, { "name": "masterminds/html5", diff --git a/public/vendor/livewire/livewire.esm.js b/public/vendor/livewire/livewire.esm.js new file mode 100644 index 0000000000..2f0f08cdff --- /dev/null +++ b/public/vendor/livewire/livewire.esm.js @@ -0,0 +1,10783 @@ +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __commonJS = (cb, mod) => function __require() { + return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod)); + +// ../alpine/packages/alpinejs/dist/module.cjs.js +var require_module_cjs = __commonJS({ + "../alpine/packages/alpinejs/dist/module.cjs.js"(exports, module) { + var __create2 = Object.create; + var __defProp2 = Object.defineProperty; + var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor; + var __getOwnPropNames2 = Object.getOwnPropertyNames; + var __getProtoOf2 = Object.getPrototypeOf; + var __hasOwnProp2 = Object.prototype.hasOwnProperty; + var __commonJS2 = (cb, mod) => function __require() { + return mod || (0, cb[__getOwnPropNames2(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; + }; + var __export = (target, all2) => { + for (var name in all2) + __defProp2(target, name, { get: all2[name], enumerable: true }); + }; + var __copyProps2 = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames2(from)) + if (!__hasOwnProp2.call(to, key) && key !== except) + __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable }); + } + return to; + }; + var __toESM2 = (mod, isNodeMode, target) => (target = mod != null ? __create2(__getProtoOf2(mod)) : {}, __copyProps2(isNodeMode || !mod || !mod.__esModule ? __defProp2(target, "default", { value: mod, enumerable: true }) : target, mod)); + var __toCommonJS = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod); + var require_shared_cjs = __commonJS2({ + "node_modules/@vue/shared/dist/shared.cjs.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + function makeMap(str, expectsLowerCase) { + const map = /* @__PURE__ */ Object.create(null); + const list = str.split(","); + for (let i = 0; i < list.length; i++) { + map[list[i]] = true; + } + return expectsLowerCase ? (val) => !!map[val.toLowerCase()] : (val) => !!map[val]; + } + var PatchFlagNames = { + [1]: `TEXT`, + [2]: `CLASS`, + [4]: `STYLE`, + [8]: `PROPS`, + [16]: `FULL_PROPS`, + [32]: `HYDRATE_EVENTS`, + [64]: `STABLE_FRAGMENT`, + [128]: `KEYED_FRAGMENT`, + [256]: `UNKEYED_FRAGMENT`, + [512]: `NEED_PATCH`, + [1024]: `DYNAMIC_SLOTS`, + [2048]: `DEV_ROOT_FRAGMENT`, + [-1]: `HOISTED`, + [-2]: `BAIL` + }; + var slotFlagsText = { + [1]: "STABLE", + [2]: "DYNAMIC", + [3]: "FORWARDED" + }; + var GLOBALS_WHITE_LISTED = "Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt"; + var isGloballyWhitelisted = /* @__PURE__ */ makeMap(GLOBALS_WHITE_LISTED); + var range = 2; + function generateCodeFrame(source, start22 = 0, end = source.length) { + let lines = source.split(/(\r?\n)/); + const newlineSequences = lines.filter((_, idx) => idx % 2 === 1); + lines = lines.filter((_, idx) => idx % 2 === 0); + let count = 0; + const res = []; + for (let i = 0; i < lines.length; i++) { + count += lines[i].length + (newlineSequences[i] && newlineSequences[i].length || 0); + if (count >= start22) { + for (let j = i - range; j <= i + range || end > count; j++) { + if (j < 0 || j >= lines.length) + continue; + const line = j + 1; + res.push(`${line}${" ".repeat(Math.max(3 - String(line).length, 0))}| ${lines[j]}`); + const lineLength = lines[j].length; + const newLineSeqLength = newlineSequences[j] && newlineSequences[j].length || 0; + if (j === i) { + const pad = start22 - (count - (lineLength + newLineSeqLength)); + const length = Math.max(1, end > count ? lineLength - pad : end - start22); + res.push(` | ` + " ".repeat(pad) + "^".repeat(length)); + } else if (j > i) { + if (end > count) { + const length = Math.max(Math.min(end - count, lineLength), 1); + res.push(` | ` + "^".repeat(length)); + } + count += lineLength + newLineSeqLength; + } + } + break; + } + } + return res.join("\n"); + } + var specialBooleanAttrs = `itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`; + var isSpecialBooleanAttr = /* @__PURE__ */ makeMap(specialBooleanAttrs); + var isBooleanAttr2 = /* @__PURE__ */ makeMap(specialBooleanAttrs + `,async,autofocus,autoplay,controls,default,defer,disabled,hidden,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected`); + var unsafeAttrCharRE = /[>/="'\u0009\u000a\u000c\u0020]/; + var attrValidationCache = {}; + function isSSRSafeAttrName(name) { + if (attrValidationCache.hasOwnProperty(name)) { + return attrValidationCache[name]; + } + const isUnsafe = unsafeAttrCharRE.test(name); + if (isUnsafe) { + console.error(`unsafe attribute name: ${name}`); + } + return attrValidationCache[name] = !isUnsafe; + } + var propsToAttrMap = { + acceptCharset: "accept-charset", + className: "class", + htmlFor: "for", + httpEquiv: "http-equiv" + }; + var isNoUnitNumericStyleProp = /* @__PURE__ */ makeMap(`animation-iteration-count,border-image-outset,border-image-slice,border-image-width,box-flex,box-flex-group,box-ordinal-group,column-count,columns,flex,flex-grow,flex-positive,flex-shrink,flex-negative,flex-order,grid-row,grid-row-end,grid-row-span,grid-row-start,grid-column,grid-column-end,grid-column-span,grid-column-start,font-weight,line-clamp,line-height,opacity,order,orphans,tab-size,widows,z-index,zoom,fill-opacity,flood-opacity,stop-opacity,stroke-dasharray,stroke-dashoffset,stroke-miterlimit,stroke-opacity,stroke-width`); + var isKnownAttr = /* @__PURE__ */ makeMap(`accept,accept-charset,accesskey,action,align,allow,alt,async,autocapitalize,autocomplete,autofocus,autoplay,background,bgcolor,border,buffered,capture,challenge,charset,checked,cite,class,code,codebase,color,cols,colspan,content,contenteditable,contextmenu,controls,coords,crossorigin,csp,data,datetime,decoding,default,defer,dir,dirname,disabled,download,draggable,dropzone,enctype,enterkeyhint,for,form,formaction,formenctype,formmethod,formnovalidate,formtarget,headers,height,hidden,high,href,hreflang,http-equiv,icon,id,importance,integrity,ismap,itemprop,keytype,kind,label,lang,language,loading,list,loop,low,manifest,max,maxlength,minlength,media,min,multiple,muted,name,novalidate,open,optimum,pattern,ping,placeholder,poster,preload,radiogroup,readonly,referrerpolicy,rel,required,reversed,rows,rowspan,sandbox,scope,scoped,selected,shape,size,sizes,slot,span,spellcheck,src,srcdoc,srclang,srcset,start,step,style,summary,tabindex,target,title,translate,type,usemap,value,width,wrap`); + function normalizeStyle(value) { + if (isArray2(value)) { + const res = {}; + for (let i = 0; i < value.length; i++) { + const item = value[i]; + const normalized = normalizeStyle(isString(item) ? parseStringStyle(item) : item); + if (normalized) { + for (const key in normalized) { + res[key] = normalized[key]; + } + } + } + return res; + } else if (isObject2(value)) { + return value; + } + } + var listDelimiterRE = /;(?![^(]*\))/g; + var propertyDelimiterRE = /:(.+)/; + function parseStringStyle(cssText) { + const ret = {}; + cssText.split(listDelimiterRE).forEach((item) => { + if (item) { + const tmp = item.split(propertyDelimiterRE); + tmp.length > 1 && (ret[tmp[0].trim()] = tmp[1].trim()); + } + }); + return ret; + } + function stringifyStyle(styles) { + let ret = ""; + if (!styles) { + return ret; + } + for (const key in styles) { + const value = styles[key]; + const normalizedKey = key.startsWith(`--`) ? key : hyphenate(key); + if (isString(value) || typeof value === "number" && isNoUnitNumericStyleProp(normalizedKey)) { + ret += `${normalizedKey}:${value};`; + } + } + return ret; + } + function normalizeClass(value) { + let res = ""; + if (isString(value)) { + res = value; + } else if (isArray2(value)) { + for (let i = 0; i < value.length; i++) { + const normalized = normalizeClass(value[i]); + if (normalized) { + res += normalized + " "; + } + } + } else if (isObject2(value)) { + for (const name in value) { + if (value[name]) { + res += name + " "; + } + } + } + return res.trim(); + } + var HTML_TAGS = "html,body,base,head,link,meta,style,title,address,article,aside,footer,header,h1,h2,h3,h4,h5,h6,hgroup,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,rtc,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"; + var SVG_TAGS = "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"; + var VOID_TAGS = "area,base,br,col,embed,hr,img,input,link,meta,param,source,track,wbr"; + var isHTMLTag = /* @__PURE__ */ makeMap(HTML_TAGS); + var isSVGTag = /* @__PURE__ */ makeMap(SVG_TAGS); + var isVoidTag = /* @__PURE__ */ makeMap(VOID_TAGS); + var escapeRE = /["'&<>]/; + function escapeHtml(string) { + const str = "" + string; + const match = escapeRE.exec(str); + if (!match) { + return str; + } + let html = ""; + let escaped; + let index; + let lastIndex = 0; + for (index = match.index; index < str.length; index++) { + switch (str.charCodeAt(index)) { + case 34: + escaped = """; + break; + case 38: + escaped = "&"; + break; + case 39: + escaped = "'"; + break; + case 60: + escaped = "<"; + break; + case 62: + escaped = ">"; + break; + default: + continue; + } + if (lastIndex !== index) { + html += str.substring(lastIndex, index); + } + lastIndex = index + 1; + html += escaped; + } + return lastIndex !== index ? html + str.substring(lastIndex, index) : html; + } + var commentStripRE = /^-?>||--!>| looseEqual(item, val)); + } + var toDisplayString = (val) => { + return val == null ? "" : isObject2(val) ? JSON.stringify(val, replacer, 2) : String(val); + }; + var replacer = (_key, val) => { + if (isMap(val)) { + return { + [`Map(${val.size})`]: [...val.entries()].reduce((entries, [key, val2]) => { + entries[`${key} =>`] = val2; + return entries; + }, {}) + }; + } else if (isSet(val)) { + return { + [`Set(${val.size})`]: [...val.values()] + }; + } else if (isObject2(val) && !isArray2(val) && !isPlainObject(val)) { + return String(val); + } + return val; + }; + var babelParserDefaultPlugins = [ + "bigInt", + "optionalChaining", + "nullishCoalescingOperator" + ]; + var EMPTY_OBJ = Object.freeze({}); + var EMPTY_ARR = Object.freeze([]); + var NOOP = () => { + }; + var NO = () => false; + var onRE = /^on[^a-z]/; + var isOn = (key) => onRE.test(key); + var isModelListener = (key) => key.startsWith("onUpdate:"); + var extend = Object.assign; + var remove = (arr, el) => { + const i = arr.indexOf(el); + if (i > -1) { + arr.splice(i, 1); + } + }; + var hasOwnProperty = Object.prototype.hasOwnProperty; + var hasOwn = (val, key) => hasOwnProperty.call(val, key); + var isArray2 = Array.isArray; + var isMap = (val) => toTypeString(val) === "[object Map]"; + var isSet = (val) => toTypeString(val) === "[object Set]"; + var isDate = (val) => val instanceof Date; + var isFunction2 = (val) => typeof val === "function"; + var isString = (val) => typeof val === "string"; + var isSymbol = (val) => typeof val === "symbol"; + var isObject2 = (val) => val !== null && typeof val === "object"; + var isPromise = (val) => { + return isObject2(val) && isFunction2(val.then) && isFunction2(val.catch); + }; + var objectToString = Object.prototype.toString; + var toTypeString = (value) => objectToString.call(value); + var toRawType = (value) => { + return toTypeString(value).slice(8, -1); + }; + var isPlainObject = (val) => toTypeString(val) === "[object Object]"; + var isIntegerKey = (key) => isString(key) && key !== "NaN" && key[0] !== "-" && "" + parseInt(key, 10) === key; + var isReservedProp = /* @__PURE__ */ makeMap(",key,ref,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"); + var cacheStringFunction = (fn) => { + const cache = /* @__PURE__ */ Object.create(null); + return (str) => { + const hit = cache[str]; + return hit || (cache[str] = fn(str)); + }; + }; + var camelizeRE = /-(\w)/g; + var camelize = cacheStringFunction((str) => { + return str.replace(camelizeRE, (_, c) => c ? c.toUpperCase() : ""); + }); + var hyphenateRE = /\B([A-Z])/g; + var hyphenate = cacheStringFunction((str) => str.replace(hyphenateRE, "-$1").toLowerCase()); + var capitalize = cacheStringFunction((str) => str.charAt(0).toUpperCase() + str.slice(1)); + var toHandlerKey = cacheStringFunction((str) => str ? `on${capitalize(str)}` : ``); + var hasChanged = (value, oldValue) => value !== oldValue && (value === value || oldValue === oldValue); + var invokeArrayFns = (fns, arg) => { + for (let i = 0; i < fns.length; i++) { + fns[i](arg); + } + }; + var def = (obj, key, value) => { + Object.defineProperty(obj, key, { + configurable: true, + enumerable: false, + value + }); + }; + var toNumber = (val) => { + const n = parseFloat(val); + return isNaN(n) ? val : n; + }; + var _globalThis; + var getGlobalThis = () => { + return _globalThis || (_globalThis = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : {}); + }; + exports2.EMPTY_ARR = EMPTY_ARR; + exports2.EMPTY_OBJ = EMPTY_OBJ; + exports2.NO = NO; + exports2.NOOP = NOOP; + exports2.PatchFlagNames = PatchFlagNames; + exports2.babelParserDefaultPlugins = babelParserDefaultPlugins; + exports2.camelize = camelize; + exports2.capitalize = capitalize; + exports2.def = def; + exports2.escapeHtml = escapeHtml; + exports2.escapeHtmlComment = escapeHtmlComment; + exports2.extend = extend; + exports2.generateCodeFrame = generateCodeFrame; + exports2.getGlobalThis = getGlobalThis; + exports2.hasChanged = hasChanged; + exports2.hasOwn = hasOwn; + exports2.hyphenate = hyphenate; + exports2.invokeArrayFns = invokeArrayFns; + exports2.isArray = isArray2; + exports2.isBooleanAttr = isBooleanAttr2; + exports2.isDate = isDate; + exports2.isFunction = isFunction2; + exports2.isGloballyWhitelisted = isGloballyWhitelisted; + exports2.isHTMLTag = isHTMLTag; + exports2.isIntegerKey = isIntegerKey; + exports2.isKnownAttr = isKnownAttr; + exports2.isMap = isMap; + exports2.isModelListener = isModelListener; + exports2.isNoUnitNumericStyleProp = isNoUnitNumericStyleProp; + exports2.isObject = isObject2; + exports2.isOn = isOn; + exports2.isPlainObject = isPlainObject; + exports2.isPromise = isPromise; + exports2.isReservedProp = isReservedProp; + exports2.isSSRSafeAttrName = isSSRSafeAttrName; + exports2.isSVGTag = isSVGTag; + exports2.isSet = isSet; + exports2.isSpecialBooleanAttr = isSpecialBooleanAttr; + exports2.isString = isString; + exports2.isSymbol = isSymbol; + exports2.isVoidTag = isVoidTag; + exports2.looseEqual = looseEqual; + exports2.looseIndexOf = looseIndexOf; + exports2.makeMap = makeMap; + exports2.normalizeClass = normalizeClass; + exports2.normalizeStyle = normalizeStyle; + exports2.objectToString = objectToString; + exports2.parseStringStyle = parseStringStyle; + exports2.propsToAttrMap = propsToAttrMap; + exports2.remove = remove; + exports2.slotFlagsText = slotFlagsText; + exports2.stringifyStyle = stringifyStyle; + exports2.toDisplayString = toDisplayString; + exports2.toHandlerKey = toHandlerKey; + exports2.toNumber = toNumber; + exports2.toRawType = toRawType; + exports2.toTypeString = toTypeString; + } + }); + var require_shared = __commonJS2({ + "node_modules/@vue/shared/index.js"(exports2, module2) { + "use strict"; + if (false) { + module2.exports = null; + } else { + module2.exports = require_shared_cjs(); + } + } + }); + var require_reactivity_cjs = __commonJS2({ + "node_modules/@vue/reactivity/dist/reactivity.cjs.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + var shared = require_shared(); + var targetMap = /* @__PURE__ */ new WeakMap(); + var effectStack = []; + var activeEffect; + var ITERATE_KEY = Symbol("iterate"); + var MAP_KEY_ITERATE_KEY = Symbol("Map key iterate"); + function isEffect(fn) { + return fn && fn._isEffect === true; + } + function effect3(fn, options = shared.EMPTY_OBJ) { + if (isEffect(fn)) { + fn = fn.raw; + } + const effect4 = createReactiveEffect(fn, options); + if (!options.lazy) { + effect4(); + } + return effect4; + } + function stop2(effect4) { + if (effect4.active) { + cleanup(effect4); + if (effect4.options.onStop) { + effect4.options.onStop(); + } + effect4.active = false; + } + } + var uid = 0; + function createReactiveEffect(fn, options) { + const effect4 = function reactiveEffect() { + if (!effect4.active) { + return fn(); + } + if (!effectStack.includes(effect4)) { + cleanup(effect4); + try { + enableTracking(); + effectStack.push(effect4); + activeEffect = effect4; + return fn(); + } finally { + effectStack.pop(); + resetTracking(); + activeEffect = effectStack[effectStack.length - 1]; + } + } + }; + effect4.id = uid++; + effect4.allowRecurse = !!options.allowRecurse; + effect4._isEffect = true; + effect4.active = true; + effect4.raw = fn; + effect4.deps = []; + effect4.options = options; + return effect4; + } + function cleanup(effect4) { + const { deps } = effect4; + if (deps.length) { + for (let i = 0; i < deps.length; i++) { + deps[i].delete(effect4); + } + deps.length = 0; + } + } + var shouldTrack = true; + var trackStack = []; + function pauseTracking() { + trackStack.push(shouldTrack); + shouldTrack = false; + } + function enableTracking() { + trackStack.push(shouldTrack); + shouldTrack = true; + } + function resetTracking() { + const last = trackStack.pop(); + shouldTrack = last === void 0 ? true : last; + } + function track2(target, type, key) { + if (!shouldTrack || activeEffect === void 0) { + return; + } + let depsMap = targetMap.get(target); + if (!depsMap) { + targetMap.set(target, depsMap = /* @__PURE__ */ new Map()); + } + let dep = depsMap.get(key); + if (!dep) { + depsMap.set(key, dep = /* @__PURE__ */ new Set()); + } + if (!dep.has(activeEffect)) { + dep.add(activeEffect); + activeEffect.deps.push(dep); + if (activeEffect.options.onTrack) { + activeEffect.options.onTrack({ + effect: activeEffect, + target, + type, + key + }); + } + } + } + function trigger2(target, type, key, newValue, oldValue, oldTarget) { + const depsMap = targetMap.get(target); + if (!depsMap) { + return; + } + const effects = /* @__PURE__ */ new Set(); + const add2 = (effectsToAdd) => { + if (effectsToAdd) { + effectsToAdd.forEach((effect4) => { + if (effect4 !== activeEffect || effect4.allowRecurse) { + effects.add(effect4); + } + }); + } + }; + if (type === "clear") { + depsMap.forEach(add2); + } else if (key === "length" && shared.isArray(target)) { + depsMap.forEach((dep, key2) => { + if (key2 === "length" || key2 >= newValue) { + add2(dep); + } + }); + } else { + if (key !== void 0) { + add2(depsMap.get(key)); + } + switch (type) { + case "add": + if (!shared.isArray(target)) { + add2(depsMap.get(ITERATE_KEY)); + if (shared.isMap(target)) { + add2(depsMap.get(MAP_KEY_ITERATE_KEY)); + } + } else if (shared.isIntegerKey(key)) { + add2(depsMap.get("length")); + } + break; + case "delete": + if (!shared.isArray(target)) { + add2(depsMap.get(ITERATE_KEY)); + if (shared.isMap(target)) { + add2(depsMap.get(MAP_KEY_ITERATE_KEY)); + } + } + break; + case "set": + if (shared.isMap(target)) { + add2(depsMap.get(ITERATE_KEY)); + } + break; + } + } + const run = (effect4) => { + if (effect4.options.onTrigger) { + effect4.options.onTrigger({ + effect: effect4, + target, + key, + type, + newValue, + oldValue, + oldTarget + }); + } + if (effect4.options.scheduler) { + effect4.options.scheduler(effect4); + } else { + effect4(); + } + }; + effects.forEach(run); + } + var isNonTrackableKeys = /* @__PURE__ */ shared.makeMap(`__proto__,__v_isRef,__isVue`); + var builtInSymbols = new Set(Object.getOwnPropertyNames(Symbol).map((key) => Symbol[key]).filter(shared.isSymbol)); + var get2 = /* @__PURE__ */ createGetter(); + var shallowGet = /* @__PURE__ */ createGetter(false, true); + var readonlyGet = /* @__PURE__ */ createGetter(true); + var shallowReadonlyGet = /* @__PURE__ */ createGetter(true, true); + var arrayInstrumentations = /* @__PURE__ */ createArrayInstrumentations(); + function createArrayInstrumentations() { + const instrumentations = {}; + ["includes", "indexOf", "lastIndexOf"].forEach((key) => { + instrumentations[key] = function(...args) { + const arr = toRaw2(this); + for (let i = 0, l = this.length; i < l; i++) { + track2(arr, "get", i + ""); + } + const res = arr[key](...args); + if (res === -1 || res === false) { + return arr[key](...args.map(toRaw2)); + } else { + return res; + } + }; + }); + ["push", "pop", "shift", "unshift", "splice"].forEach((key) => { + instrumentations[key] = function(...args) { + pauseTracking(); + const res = toRaw2(this)[key].apply(this, args); + resetTracking(); + return res; + }; + }); + return instrumentations; + } + function createGetter(isReadonly2 = false, shallow = false) { + return function get3(target, key, receiver) { + if (key === "__v_isReactive") { + return !isReadonly2; + } else if (key === "__v_isReadonly") { + return isReadonly2; + } else if (key === "__v_raw" && receiver === (isReadonly2 ? shallow ? shallowReadonlyMap : readonlyMap : shallow ? shallowReactiveMap : reactiveMap).get(target)) { + return target; + } + const targetIsArray = shared.isArray(target); + if (!isReadonly2 && targetIsArray && shared.hasOwn(arrayInstrumentations, key)) { + return Reflect.get(arrayInstrumentations, key, receiver); + } + const res = Reflect.get(target, key, receiver); + if (shared.isSymbol(key) ? builtInSymbols.has(key) : isNonTrackableKeys(key)) { + return res; + } + if (!isReadonly2) { + track2(target, "get", key); + } + if (shallow) { + return res; + } + if (isRef(res)) { + const shouldUnwrap = !targetIsArray || !shared.isIntegerKey(key); + return shouldUnwrap ? res.value : res; + } + if (shared.isObject(res)) { + return isReadonly2 ? readonly(res) : reactive3(res); + } + return res; + }; + } + var set2 = /* @__PURE__ */ createSetter(); + var shallowSet = /* @__PURE__ */ createSetter(true); + function createSetter(shallow = false) { + return function set3(target, key, value, receiver) { + let oldValue = target[key]; + if (!shallow) { + value = toRaw2(value); + oldValue = toRaw2(oldValue); + if (!shared.isArray(target) && isRef(oldValue) && !isRef(value)) { + oldValue.value = value; + return true; + } + } + const hadKey = shared.isArray(target) && shared.isIntegerKey(key) ? Number(key) < target.length : shared.hasOwn(target, key); + const result = Reflect.set(target, key, value, receiver); + if (target === toRaw2(receiver)) { + if (!hadKey) { + trigger2(target, "add", key, value); + } else if (shared.hasChanged(value, oldValue)) { + trigger2(target, "set", key, value, oldValue); + } + } + return result; + }; + } + function deleteProperty(target, key) { + const hadKey = shared.hasOwn(target, key); + const oldValue = target[key]; + const result = Reflect.deleteProperty(target, key); + if (result && hadKey) { + trigger2(target, "delete", key, void 0, oldValue); + } + return result; + } + function has(target, key) { + const result = Reflect.has(target, key); + if (!shared.isSymbol(key) || !builtInSymbols.has(key)) { + track2(target, "has", key); + } + return result; + } + function ownKeys(target) { + track2(target, "iterate", shared.isArray(target) ? "length" : ITERATE_KEY); + return Reflect.ownKeys(target); + } + var mutableHandlers = { + get: get2, + set: set2, + deleteProperty, + has, + ownKeys + }; + var readonlyHandlers = { + get: readonlyGet, + set(target, key) { + { + console.warn(`Set operation on key "${String(key)}" failed: target is readonly.`, target); + } + return true; + }, + deleteProperty(target, key) { + { + console.warn(`Delete operation on key "${String(key)}" failed: target is readonly.`, target); + } + return true; + } + }; + var shallowReactiveHandlers = /* @__PURE__ */ shared.extend({}, mutableHandlers, { + get: shallowGet, + set: shallowSet + }); + var shallowReadonlyHandlers = /* @__PURE__ */ shared.extend({}, readonlyHandlers, { + get: shallowReadonlyGet + }); + var toReactive = (value) => shared.isObject(value) ? reactive3(value) : value; + var toReadonly = (value) => shared.isObject(value) ? readonly(value) : value; + var toShallow = (value) => value; + var getProto = (v) => Reflect.getPrototypeOf(v); + function get$1(target, key, isReadonly2 = false, isShallow = false) { + target = target["__v_raw"]; + const rawTarget = toRaw2(target); + const rawKey = toRaw2(key); + if (key !== rawKey) { + !isReadonly2 && track2(rawTarget, "get", key); + } + !isReadonly2 && track2(rawTarget, "get", rawKey); + const { has: has2 } = getProto(rawTarget); + const wrap = isShallow ? toShallow : isReadonly2 ? toReadonly : toReactive; + if (has2.call(rawTarget, key)) { + return wrap(target.get(key)); + } else if (has2.call(rawTarget, rawKey)) { + return wrap(target.get(rawKey)); + } else if (target !== rawTarget) { + target.get(key); + } + } + function has$1(key, isReadonly2 = false) { + const target = this["__v_raw"]; + const rawTarget = toRaw2(target); + const rawKey = toRaw2(key); + if (key !== rawKey) { + !isReadonly2 && track2(rawTarget, "has", key); + } + !isReadonly2 && track2(rawTarget, "has", rawKey); + return key === rawKey ? target.has(key) : target.has(key) || target.has(rawKey); + } + function size(target, isReadonly2 = false) { + target = target["__v_raw"]; + !isReadonly2 && track2(toRaw2(target), "iterate", ITERATE_KEY); + return Reflect.get(target, "size", target); + } + function add(value) { + value = toRaw2(value); + const target = toRaw2(this); + const proto = getProto(target); + const hadKey = proto.has.call(target, value); + if (!hadKey) { + target.add(value); + trigger2(target, "add", value, value); + } + return this; + } + function set$1(key, value) { + value = toRaw2(value); + const target = toRaw2(this); + const { has: has2, get: get3 } = getProto(target); + let hadKey = has2.call(target, key); + if (!hadKey) { + key = toRaw2(key); + hadKey = has2.call(target, key); + } else { + checkIdentityKeys(target, has2, key); + } + const oldValue = get3.call(target, key); + target.set(key, value); + if (!hadKey) { + trigger2(target, "add", key, value); + } else if (shared.hasChanged(value, oldValue)) { + trigger2(target, "set", key, value, oldValue); + } + return this; + } + function deleteEntry(key) { + const target = toRaw2(this); + const { has: has2, get: get3 } = getProto(target); + let hadKey = has2.call(target, key); + if (!hadKey) { + key = toRaw2(key); + hadKey = has2.call(target, key); + } else { + checkIdentityKeys(target, has2, key); + } + const oldValue = get3 ? get3.call(target, key) : void 0; + const result = target.delete(key); + if (hadKey) { + trigger2(target, "delete", key, void 0, oldValue); + } + return result; + } + function clear() { + const target = toRaw2(this); + const hadItems = target.size !== 0; + const oldTarget = shared.isMap(target) ? new Map(target) : new Set(target); + const result = target.clear(); + if (hadItems) { + trigger2(target, "clear", void 0, void 0, oldTarget); + } + return result; + } + function createForEach(isReadonly2, isShallow) { + return function forEach(callback, thisArg) { + const observed = this; + const target = observed["__v_raw"]; + const rawTarget = toRaw2(target); + const wrap = isShallow ? toShallow : isReadonly2 ? toReadonly : toReactive; + !isReadonly2 && track2(rawTarget, "iterate", ITERATE_KEY); + return target.forEach((value, key) => { + return callback.call(thisArg, wrap(value), wrap(key), observed); + }); + }; + } + function createIterableMethod(method, isReadonly2, isShallow) { + return function(...args) { + const target = this["__v_raw"]; + const rawTarget = toRaw2(target); + const targetIsMap = shared.isMap(rawTarget); + const isPair = method === "entries" || method === Symbol.iterator && targetIsMap; + const isKeyOnly = method === "keys" && targetIsMap; + const innerIterator = target[method](...args); + const wrap = isShallow ? toShallow : isReadonly2 ? toReadonly : toReactive; + !isReadonly2 && track2(rawTarget, "iterate", isKeyOnly ? MAP_KEY_ITERATE_KEY : ITERATE_KEY); + return { + next() { + const { value, done } = innerIterator.next(); + return done ? { value, done } : { + value: isPair ? [wrap(value[0]), wrap(value[1])] : wrap(value), + done + }; + }, + [Symbol.iterator]() { + return this; + } + }; + }; + } + function createReadonlyMethod(type) { + return function(...args) { + { + const key = args[0] ? `on key "${args[0]}" ` : ``; + console.warn(`${shared.capitalize(type)} operation ${key}failed: target is readonly.`, toRaw2(this)); + } + return type === "delete" ? false : this; + }; + } + function createInstrumentations() { + const mutableInstrumentations2 = { + get(key) { + return get$1(this, key); + }, + get size() { + return size(this); + }, + has: has$1, + add, + set: set$1, + delete: deleteEntry, + clear, + forEach: createForEach(false, false) + }; + const shallowInstrumentations2 = { + get(key) { + return get$1(this, key, false, true); + }, + get size() { + return size(this); + }, + has: has$1, + add, + set: set$1, + delete: deleteEntry, + clear, + forEach: createForEach(false, true) + }; + const readonlyInstrumentations2 = { + get(key) { + return get$1(this, key, true); + }, + get size() { + return size(this, true); + }, + has(key) { + return has$1.call(this, key, true); + }, + add: createReadonlyMethod("add"), + set: createReadonlyMethod("set"), + delete: createReadonlyMethod("delete"), + clear: createReadonlyMethod("clear"), + forEach: createForEach(true, false) + }; + const shallowReadonlyInstrumentations2 = { + get(key) { + return get$1(this, key, true, true); + }, + get size() { + return size(this, true); + }, + has(key) { + return has$1.call(this, key, true); + }, + add: createReadonlyMethod("add"), + set: createReadonlyMethod("set"), + delete: createReadonlyMethod("delete"), + clear: createReadonlyMethod("clear"), + forEach: createForEach(true, true) + }; + const iteratorMethods = ["keys", "values", "entries", Symbol.iterator]; + iteratorMethods.forEach((method) => { + mutableInstrumentations2[method] = createIterableMethod(method, false, false); + readonlyInstrumentations2[method] = createIterableMethod(method, true, false); + shallowInstrumentations2[method] = createIterableMethod(method, false, true); + shallowReadonlyInstrumentations2[method] = createIterableMethod(method, true, true); + }); + return [ + mutableInstrumentations2, + readonlyInstrumentations2, + shallowInstrumentations2, + shallowReadonlyInstrumentations2 + ]; + } + var [mutableInstrumentations, readonlyInstrumentations, shallowInstrumentations, shallowReadonlyInstrumentations] = /* @__PURE__ */ createInstrumentations(); + function createInstrumentationGetter(isReadonly2, shallow) { + const instrumentations = shallow ? isReadonly2 ? shallowReadonlyInstrumentations : shallowInstrumentations : isReadonly2 ? readonlyInstrumentations : mutableInstrumentations; + return (target, key, receiver) => { + if (key === "__v_isReactive") { + return !isReadonly2; + } else if (key === "__v_isReadonly") { + return isReadonly2; + } else if (key === "__v_raw") { + return target; + } + return Reflect.get(shared.hasOwn(instrumentations, key) && key in target ? instrumentations : target, key, receiver); + }; + } + var mutableCollectionHandlers = { + get: /* @__PURE__ */ createInstrumentationGetter(false, false) + }; + var shallowCollectionHandlers = { + get: /* @__PURE__ */ createInstrumentationGetter(false, true) + }; + var readonlyCollectionHandlers = { + get: /* @__PURE__ */ createInstrumentationGetter(true, false) + }; + var shallowReadonlyCollectionHandlers = { + get: /* @__PURE__ */ createInstrumentationGetter(true, true) + }; + function checkIdentityKeys(target, has2, key) { + const rawKey = toRaw2(key); + if (rawKey !== key && has2.call(target, rawKey)) { + const type = shared.toRawType(target); + console.warn(`Reactive ${type} contains both the raw and reactive versions of the same object${type === `Map` ? ` as keys` : ``}, which can lead to inconsistencies. Avoid differentiating between the raw and reactive versions of an object and only use the reactive version if possible.`); + } + } + var reactiveMap = /* @__PURE__ */ new WeakMap(); + var shallowReactiveMap = /* @__PURE__ */ new WeakMap(); + var readonlyMap = /* @__PURE__ */ new WeakMap(); + var shallowReadonlyMap = /* @__PURE__ */ new WeakMap(); + function targetTypeMap(rawType) { + switch (rawType) { + case "Object": + case "Array": + return 1; + case "Map": + case "Set": + case "WeakMap": + case "WeakSet": + return 2; + default: + return 0; + } + } + function getTargetType(value) { + return value["__v_skip"] || !Object.isExtensible(value) ? 0 : targetTypeMap(shared.toRawType(value)); + } + function reactive3(target) { + if (target && target["__v_isReadonly"]) { + return target; + } + return createReactiveObject(target, false, mutableHandlers, mutableCollectionHandlers, reactiveMap); + } + function shallowReactive(target) { + return createReactiveObject(target, false, shallowReactiveHandlers, shallowCollectionHandlers, shallowReactiveMap); + } + function readonly(target) { + return createReactiveObject(target, true, readonlyHandlers, readonlyCollectionHandlers, readonlyMap); + } + function shallowReadonly(target) { + return createReactiveObject(target, true, shallowReadonlyHandlers, shallowReadonlyCollectionHandlers, shallowReadonlyMap); + } + function createReactiveObject(target, isReadonly2, baseHandlers, collectionHandlers, proxyMap) { + if (!shared.isObject(target)) { + { + console.warn(`value cannot be made reactive: ${String(target)}`); + } + return target; + } + if (target["__v_raw"] && !(isReadonly2 && target["__v_isReactive"])) { + return target; + } + const existingProxy = proxyMap.get(target); + if (existingProxy) { + return existingProxy; + } + const targetType = getTargetType(target); + if (targetType === 0) { + return target; + } + const proxy = new Proxy(target, targetType === 2 ? collectionHandlers : baseHandlers); + proxyMap.set(target, proxy); + return proxy; + } + function isReactive2(value) { + if (isReadonly(value)) { + return isReactive2(value["__v_raw"]); + } + return !!(value && value["__v_isReactive"]); + } + function isReadonly(value) { + return !!(value && value["__v_isReadonly"]); + } + function isProxy(value) { + return isReactive2(value) || isReadonly(value); + } + function toRaw2(observed) { + return observed && toRaw2(observed["__v_raw"]) || observed; + } + function markRaw(value) { + shared.def(value, "__v_skip", true); + return value; + } + var convert = (val) => shared.isObject(val) ? reactive3(val) : val; + function isRef(r) { + return Boolean(r && r.__v_isRef === true); + } + function ref(value) { + return createRef(value); + } + function shallowRef(value) { + return createRef(value, true); + } + var RefImpl = class { + constructor(value, _shallow = false) { + this._shallow = _shallow; + this.__v_isRef = true; + this._rawValue = _shallow ? value : toRaw2(value); + this._value = _shallow ? value : convert(value); + } + get value() { + track2(toRaw2(this), "get", "value"); + return this._value; + } + set value(newVal) { + newVal = this._shallow ? newVal : toRaw2(newVal); + if (shared.hasChanged(newVal, this._rawValue)) { + this._rawValue = newVal; + this._value = this._shallow ? newVal : convert(newVal); + trigger2(toRaw2(this), "set", "value", newVal); + } + } + }; + function createRef(rawValue, shallow = false) { + if (isRef(rawValue)) { + return rawValue; + } + return new RefImpl(rawValue, shallow); + } + function triggerRef(ref2) { + trigger2(toRaw2(ref2), "set", "value", ref2.value); + } + function unref(ref2) { + return isRef(ref2) ? ref2.value : ref2; + } + var shallowUnwrapHandlers = { + get: (target, key, receiver) => unref(Reflect.get(target, key, receiver)), + set: (target, key, value, receiver) => { + const oldValue = target[key]; + if (isRef(oldValue) && !isRef(value)) { + oldValue.value = value; + return true; + } else { + return Reflect.set(target, key, value, receiver); + } + } + }; + function proxyRefs(objectWithRefs) { + return isReactive2(objectWithRefs) ? objectWithRefs : new Proxy(objectWithRefs, shallowUnwrapHandlers); + } + var CustomRefImpl = class { + constructor(factory) { + this.__v_isRef = true; + const { get: get3, set: set3 } = factory(() => track2(this, "get", "value"), () => trigger2(this, "set", "value")); + this._get = get3; + this._set = set3; + } + get value() { + return this._get(); + } + set value(newVal) { + this._set(newVal); + } + }; + function customRef(factory) { + return new CustomRefImpl(factory); + } + function toRefs(object) { + if (!isProxy(object)) { + console.warn(`toRefs() expects a reactive object but received a plain one.`); + } + const ret = shared.isArray(object) ? new Array(object.length) : {}; + for (const key in object) { + ret[key] = toRef(object, key); + } + return ret; + } + var ObjectRefImpl = class { + constructor(_object, _key) { + this._object = _object; + this._key = _key; + this.__v_isRef = true; + } + get value() { + return this._object[this._key]; + } + set value(newVal) { + this._object[this._key] = newVal; + } + }; + function toRef(object, key) { + return isRef(object[key]) ? object[key] : new ObjectRefImpl(object, key); + } + var ComputedRefImpl = class { + constructor(getter, _setter, isReadonly2) { + this._setter = _setter; + this._dirty = true; + this.__v_isRef = true; + this.effect = effect3(getter, { + lazy: true, + scheduler: () => { + if (!this._dirty) { + this._dirty = true; + trigger2(toRaw2(this), "set", "value"); + } + } + }); + this["__v_isReadonly"] = isReadonly2; + } + get value() { + const self2 = toRaw2(this); + if (self2._dirty) { + self2._value = this.effect(); + self2._dirty = false; + } + track2(self2, "get", "value"); + return self2._value; + } + set value(newValue) { + this._setter(newValue); + } + }; + function computed(getterOrOptions) { + let getter; + let setter; + if (shared.isFunction(getterOrOptions)) { + getter = getterOrOptions; + setter = () => { + console.warn("Write operation failed: computed value is readonly"); + }; + } else { + getter = getterOrOptions.get; + setter = getterOrOptions.set; + } + return new ComputedRefImpl(getter, setter, shared.isFunction(getterOrOptions) || !getterOrOptions.set); + } + exports2.ITERATE_KEY = ITERATE_KEY; + exports2.computed = computed; + exports2.customRef = customRef; + exports2.effect = effect3; + exports2.enableTracking = enableTracking; + exports2.isProxy = isProxy; + exports2.isReactive = isReactive2; + exports2.isReadonly = isReadonly; + exports2.isRef = isRef; + exports2.markRaw = markRaw; + exports2.pauseTracking = pauseTracking; + exports2.proxyRefs = proxyRefs; + exports2.reactive = reactive3; + exports2.readonly = readonly; + exports2.ref = ref; + exports2.resetTracking = resetTracking; + exports2.shallowReactive = shallowReactive; + exports2.shallowReadonly = shallowReadonly; + exports2.shallowRef = shallowRef; + exports2.stop = stop2; + exports2.toRaw = toRaw2; + exports2.toRef = toRef; + exports2.toRefs = toRefs; + exports2.track = track2; + exports2.trigger = trigger2; + exports2.triggerRef = triggerRef; + exports2.unref = unref; + } + }); + var require_reactivity = __commonJS2({ + "node_modules/@vue/reactivity/index.js"(exports2, module2) { + "use strict"; + if (false) { + module2.exports = null; + } else { + module2.exports = require_reactivity_cjs(); + } + } + }); + var module_exports = {}; + __export(module_exports, { + Alpine: () => src_default, + default: () => module_default + }); + module.exports = __toCommonJS(module_exports); + var flushPending = false; + var flushing = false; + var queue = []; + var lastFlushedIndex = -1; + function scheduler(callback) { + queueJob(callback); + } + function queueJob(job) { + if (!queue.includes(job)) + queue.push(job); + queueFlush(); + } + function dequeueJob(job) { + let index = queue.indexOf(job); + if (index !== -1 && index > lastFlushedIndex) + queue.splice(index, 1); + } + function queueFlush() { + if (!flushing && !flushPending) { + flushPending = true; + queueMicrotask(flushJobs); + } + } + function flushJobs() { + flushPending = false; + flushing = true; + for (let i = 0; i < queue.length; i++) { + queue[i](); + lastFlushedIndex = i; + } + queue.length = 0; + lastFlushedIndex = -1; + flushing = false; + } + var reactive; + var effect; + var release; + var raw; + var shouldSchedule = true; + function disableEffectScheduling(callback) { + shouldSchedule = false; + callback(); + shouldSchedule = true; + } + function setReactivityEngine(engine) { + reactive = engine.reactive; + release = engine.release; + effect = (callback) => engine.effect(callback, { scheduler: (task) => { + if (shouldSchedule) { + scheduler(task); + } else { + task(); + } + } }); + raw = engine.raw; + } + function overrideEffect(override) { + effect = override; + } + function elementBoundEffect(el) { + let cleanup = () => { + }; + let wrappedEffect = (callback) => { + let effectReference = effect(callback); + if (!el._x_effects) { + el._x_effects = /* @__PURE__ */ new Set(); + el._x_runEffects = () => { + el._x_effects.forEach((i) => i()); + }; + } + el._x_effects.add(effectReference); + cleanup = () => { + if (effectReference === void 0) + return; + el._x_effects.delete(effectReference); + release(effectReference); + }; + return effectReference; + }; + return [wrappedEffect, () => { + cleanup(); + }]; + } + function watch(getter, callback) { + let firstTime = true; + let oldValue; + let effectReference = effect(() => { + let value = getter(); + JSON.stringify(value); + if (!firstTime) { + queueMicrotask(() => { + callback(value, oldValue); + oldValue = value; + }); + } else { + oldValue = value; + } + firstTime = false; + }); + return () => release(effectReference); + } + var onAttributeAddeds = []; + var onElRemoveds = []; + var onElAddeds = []; + function onElAdded(callback) { + onElAddeds.push(callback); + } + function onElRemoved(el, callback) { + if (typeof callback === "function") { + if (!el._x_cleanups) + el._x_cleanups = []; + el._x_cleanups.push(callback); + } else { + callback = el; + onElRemoveds.push(callback); + } + } + function onAttributesAdded(callback) { + onAttributeAddeds.push(callback); + } + function onAttributeRemoved(el, name, callback) { + if (!el._x_attributeCleanups) + el._x_attributeCleanups = {}; + if (!el._x_attributeCleanups[name]) + el._x_attributeCleanups[name] = []; + el._x_attributeCleanups[name].push(callback); + } + function cleanupAttributes(el, names) { + if (!el._x_attributeCleanups) + return; + Object.entries(el._x_attributeCleanups).forEach(([name, value]) => { + if (names === void 0 || names.includes(name)) { + value.forEach((i) => i()); + delete el._x_attributeCleanups[name]; + } + }); + } + function cleanupElement(el) { + if (el._x_cleanups) { + while (el._x_cleanups.length) + el._x_cleanups.pop()(); + } + } + var observer = new MutationObserver(onMutate); + var currentlyObserving = false; + function startObservingMutations() { + observer.observe(document, { subtree: true, childList: true, attributes: true, attributeOldValue: true }); + currentlyObserving = true; + } + function stopObservingMutations() { + flushObserver(); + observer.disconnect(); + currentlyObserving = false; + } + var queuedMutations = []; + function flushObserver() { + let records = observer.takeRecords(); + queuedMutations.push(() => records.length > 0 && onMutate(records)); + let queueLengthWhenTriggered = queuedMutations.length; + queueMicrotask(() => { + if (queuedMutations.length === queueLengthWhenTriggered) { + while (queuedMutations.length > 0) + queuedMutations.shift()(); + } + }); + } + function mutateDom(callback) { + if (!currentlyObserving) + return callback(); + stopObservingMutations(); + let result = callback(); + startObservingMutations(); + return result; + } + var isCollecting = false; + var deferredMutations = []; + function deferMutations() { + isCollecting = true; + } + function flushAndStopDeferringMutations() { + isCollecting = false; + onMutate(deferredMutations); + deferredMutations = []; + } + function onMutate(mutations) { + if (isCollecting) { + deferredMutations = deferredMutations.concat(mutations); + return; + } + let addedNodes = /* @__PURE__ */ new Set(); + let removedNodes = /* @__PURE__ */ new Set(); + let addedAttributes = /* @__PURE__ */ new Map(); + let removedAttributes = /* @__PURE__ */ new Map(); + for (let i = 0; i < mutations.length; i++) { + if (mutations[i].target._x_ignoreMutationObserver) + continue; + if (mutations[i].type === "childList") { + mutations[i].addedNodes.forEach((node) => node.nodeType === 1 && addedNodes.add(node)); + mutations[i].removedNodes.forEach((node) => node.nodeType === 1 && removedNodes.add(node)); + } + if (mutations[i].type === "attributes") { + let el = mutations[i].target; + let name = mutations[i].attributeName; + let oldValue = mutations[i].oldValue; + let add = () => { + if (!addedAttributes.has(el)) + addedAttributes.set(el, []); + addedAttributes.get(el).push({ name, value: el.getAttribute(name) }); + }; + let remove = () => { + if (!removedAttributes.has(el)) + removedAttributes.set(el, []); + removedAttributes.get(el).push(name); + }; + if (el.hasAttribute(name) && oldValue === null) { + add(); + } else if (el.hasAttribute(name)) { + remove(); + add(); + } else { + remove(); + } + } + } + removedAttributes.forEach((attrs, el) => { + cleanupAttributes(el, attrs); + }); + addedAttributes.forEach((attrs, el) => { + onAttributeAddeds.forEach((i) => i(el, attrs)); + }); + for (let node of removedNodes) { + if (addedNodes.has(node)) + continue; + onElRemoveds.forEach((i) => i(node)); + } + addedNodes.forEach((node) => { + node._x_ignoreSelf = true; + node._x_ignore = true; + }); + for (let node of addedNodes) { + if (removedNodes.has(node)) + continue; + if (!node.isConnected) + continue; + delete node._x_ignoreSelf; + delete node._x_ignore; + onElAddeds.forEach((i) => i(node)); + node._x_ignore = true; + node._x_ignoreSelf = true; + } + addedNodes.forEach((node) => { + delete node._x_ignoreSelf; + delete node._x_ignore; + }); + addedNodes = null; + removedNodes = null; + addedAttributes = null; + removedAttributes = null; + } + function scope(node) { + return mergeProxies(closestDataStack(node)); + } + function addScopeToNode(node, data2, referenceNode) { + node._x_dataStack = [data2, ...closestDataStack(referenceNode || node)]; + return () => { + node._x_dataStack = node._x_dataStack.filter((i) => i !== data2); + }; + } + function closestDataStack(node) { + if (node._x_dataStack) + return node._x_dataStack; + if (typeof ShadowRoot === "function" && node instanceof ShadowRoot) { + return closestDataStack(node.host); + } + if (!node.parentNode) { + return []; + } + return closestDataStack(node.parentNode); + } + function mergeProxies(objects) { + return new Proxy({ objects }, mergeProxyTrap); + } + var mergeProxyTrap = { + ownKeys({ objects }) { + return Array.from(new Set(objects.flatMap((i) => Object.keys(i)))); + }, + has({ objects }, name) { + if (name == Symbol.unscopables) + return false; + return objects.some((obj) => Object.prototype.hasOwnProperty.call(obj, name) || Reflect.has(obj, name)); + }, + get({ objects }, name, thisProxy) { + if (name == "toJSON") + return collapseProxies; + return Reflect.get(objects.find((obj) => Reflect.has(obj, name)) || {}, name, thisProxy); + }, + set({ objects }, name, value, thisProxy) { + const target = objects.find((obj) => Object.prototype.hasOwnProperty.call(obj, name)) || objects[objects.length - 1]; + const descriptor = Object.getOwnPropertyDescriptor(target, name); + if ((descriptor == null ? void 0 : descriptor.set) && (descriptor == null ? void 0 : descriptor.get)) + return Reflect.set(target, name, value, thisProxy); + return Reflect.set(target, name, value); + } + }; + function collapseProxies() { + let keys = Reflect.ownKeys(this); + return keys.reduce((acc, key) => { + acc[key] = Reflect.get(this, key); + return acc; + }, {}); + } + function initInterceptors(data2) { + let isObject2 = (val) => typeof val === "object" && !Array.isArray(val) && val !== null; + let recurse = (obj, basePath = "") => { + Object.entries(Object.getOwnPropertyDescriptors(obj)).forEach(([key, { value, enumerable }]) => { + if (enumerable === false || value === void 0) + return; + if (typeof value === "object" && value !== null && value.__v_skip) + return; + let path = basePath === "" ? key : `${basePath}.${key}`; + if (typeof value === "object" && value !== null && value._x_interceptor) { + obj[key] = value.initialize(data2, path, key); + } else { + if (isObject2(value) && value !== obj && !(value instanceof Element)) { + recurse(value, path); + } + } + }); + }; + return recurse(data2); + } + function interceptor(callback, mutateObj = () => { + }) { + let obj = { + initialValue: void 0, + _x_interceptor: true, + initialize(data2, path, key) { + return callback(this.initialValue, () => get(data2, path), (value) => set(data2, path, value), path, key); + } + }; + mutateObj(obj); + return (initialValue) => { + if (typeof initialValue === "object" && initialValue !== null && initialValue._x_interceptor) { + let initialize = obj.initialize.bind(obj); + obj.initialize = (data2, path, key) => { + let innerValue = initialValue.initialize(data2, path, key); + obj.initialValue = innerValue; + return initialize(data2, path, key); + }; + } else { + obj.initialValue = initialValue; + } + return obj; + }; + } + function get(obj, path) { + return path.split(".").reduce((carry, segment) => carry[segment], obj); + } + function set(obj, path, value) { + if (typeof path === "string") + path = path.split("."); + if (path.length === 1) + obj[path[0]] = value; + else if (path.length === 0) + throw error; + else { + if (obj[path[0]]) + return set(obj[path[0]], path.slice(1), value); + else { + obj[path[0]] = {}; + return set(obj[path[0]], path.slice(1), value); + } + } + } + var magics = {}; + function magic(name, callback) { + magics[name] = callback; + } + function injectMagics(obj, el) { + Object.entries(magics).forEach(([name, callback]) => { + let memoizedUtilities = null; + function getUtilities() { + if (memoizedUtilities) { + return memoizedUtilities; + } else { + let [utilities, cleanup] = getElementBoundUtilities(el); + memoizedUtilities = { interceptor, ...utilities }; + onElRemoved(el, cleanup); + return memoizedUtilities; + } + } + Object.defineProperty(obj, `$${name}`, { + get() { + return callback(el, getUtilities()); + }, + enumerable: false + }); + }); + return obj; + } + function tryCatch(el, expression, callback, ...args) { + try { + return callback(...args); + } catch (e) { + handleError(e, el, expression); + } + } + function handleError(error2, el, expression = void 0) { + error2 = Object.assign(error2 != null ? error2 : { message: "No error message given." }, { el, expression }); + console.warn(`Alpine Expression Error: ${error2.message} + +${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el); + setTimeout(() => { + throw error2; + }, 0); + } + var shouldAutoEvaluateFunctions = true; + function dontAutoEvaluateFunctions(callback) { + let cache = shouldAutoEvaluateFunctions; + shouldAutoEvaluateFunctions = false; + let result = callback(); + shouldAutoEvaluateFunctions = cache; + return result; + } + function evaluate(el, expression, extras = {}) { + let result; + evaluateLater(el, expression)((value) => result = value, extras); + return result; + } + function evaluateLater(...args) { + return theEvaluatorFunction(...args); + } + var theEvaluatorFunction = normalEvaluator; + function setEvaluator(newEvaluator) { + theEvaluatorFunction = newEvaluator; + } + function normalEvaluator(el, expression) { + let overriddenMagics = {}; + injectMagics(overriddenMagics, el); + let dataStack = [overriddenMagics, ...closestDataStack(el)]; + let evaluator = typeof expression === "function" ? generateEvaluatorFromFunction(dataStack, expression) : generateEvaluatorFromString(dataStack, expression, el); + return tryCatch.bind(null, el, expression, evaluator); + } + function generateEvaluatorFromFunction(dataStack, func) { + return (receiver = () => { + }, { scope: scope2 = {}, params = [] } = {}) => { + let result = func.apply(mergeProxies([scope2, ...dataStack]), params); + runIfTypeOfFunction(receiver, result); + }; + } + var evaluatorMemo = {}; + function generateFunctionFromString(expression, el) { + if (evaluatorMemo[expression]) { + return evaluatorMemo[expression]; + } + let AsyncFunction = Object.getPrototypeOf(async function() { + }).constructor; + let rightSideSafeExpression = /^[\n\s]*if.*\(.*\)/.test(expression.trim()) || /^(let|const)\s/.test(expression.trim()) ? `(async()=>{ ${expression} })()` : expression; + const safeAsyncFunction = () => { + try { + let func2 = new AsyncFunction(["__self", "scope"], `with (scope) { __self.result = ${rightSideSafeExpression} }; __self.finished = true; return __self.result;`); + Object.defineProperty(func2, "name", { + value: `[Alpine] ${expression}` + }); + return func2; + } catch (error2) { + handleError(error2, el, expression); + return Promise.resolve(); + } + }; + let func = safeAsyncFunction(); + evaluatorMemo[expression] = func; + return func; + } + function generateEvaluatorFromString(dataStack, expression, el) { + let func = generateFunctionFromString(expression, el); + return (receiver = () => { + }, { scope: scope2 = {}, params = [] } = {}) => { + func.result = void 0; + func.finished = false; + let completeScope = mergeProxies([scope2, ...dataStack]); + if (typeof func === "function") { + let promise = func(func, completeScope).catch((error2) => handleError(error2, el, expression)); + if (func.finished) { + runIfTypeOfFunction(receiver, func.result, completeScope, params, el); + func.result = void 0; + } else { + promise.then((result) => { + runIfTypeOfFunction(receiver, result, completeScope, params, el); + }).catch((error2) => handleError(error2, el, expression)).finally(() => func.result = void 0); + } + } + }; + } + function runIfTypeOfFunction(receiver, value, scope2, params, el) { + if (shouldAutoEvaluateFunctions && typeof value === "function") { + let result = value.apply(scope2, params); + if (result instanceof Promise) { + result.then((i) => runIfTypeOfFunction(receiver, i, scope2, params)).catch((error2) => handleError(error2, el, value)); + } else { + receiver(result); + } + } else if (typeof value === "object" && value instanceof Promise) { + value.then((i) => receiver(i)); + } else { + receiver(value); + } + } + var prefixAsString = "x-"; + function prefix(subject = "") { + return prefixAsString + subject; + } + function setPrefix(newPrefix) { + prefixAsString = newPrefix; + } + var directiveHandlers = {}; + function directive2(name, callback) { + directiveHandlers[name] = callback; + return { + before(directive22) { + if (!directiveHandlers[directive22]) { + console.warn(String.raw`Cannot find directive \`${directive22}\`. \`${name}\` will use the default order of execution`); + return; + } + const pos = directiveOrder.indexOf(directive22); + directiveOrder.splice(pos >= 0 ? pos : directiveOrder.indexOf("DEFAULT"), 0, name); + } + }; + } + function directiveExists(name) { + return Object.keys(directiveHandlers).includes(name); + } + function directives(el, attributes, originalAttributeOverride) { + attributes = Array.from(attributes); + if (el._x_virtualDirectives) { + let vAttributes = Object.entries(el._x_virtualDirectives).map(([name, value]) => ({ name, value })); + let staticAttributes = attributesOnly(vAttributes); + vAttributes = vAttributes.map((attribute) => { + if (staticAttributes.find((attr) => attr.name === attribute.name)) { + return { + name: `x-bind:${attribute.name}`, + value: `"${attribute.value}"` + }; + } + return attribute; + }); + attributes = attributes.concat(vAttributes); + } + let transformedAttributeMap = {}; + let directives2 = attributes.map(toTransformedAttributes((newName, oldName) => transformedAttributeMap[newName] = oldName)).filter(outNonAlpineAttributes).map(toParsedDirectives(transformedAttributeMap, originalAttributeOverride)).sort(byPriority); + return directives2.map((directive22) => { + return getDirectiveHandler(el, directive22); + }); + } + function attributesOnly(attributes) { + return Array.from(attributes).map(toTransformedAttributes()).filter((attr) => !outNonAlpineAttributes(attr)); + } + var isDeferringHandlers = false; + var directiveHandlerStacks = /* @__PURE__ */ new Map(); + var currentHandlerStackKey = Symbol(); + function deferHandlingDirectives(callback) { + isDeferringHandlers = true; + let key = Symbol(); + currentHandlerStackKey = key; + directiveHandlerStacks.set(key, []); + let flushHandlers = () => { + while (directiveHandlerStacks.get(key).length) + directiveHandlerStacks.get(key).shift()(); + directiveHandlerStacks.delete(key); + }; + let stopDeferring = () => { + isDeferringHandlers = false; + flushHandlers(); + }; + callback(flushHandlers); + stopDeferring(); + } + function getElementBoundUtilities(el) { + let cleanups2 = []; + let cleanup = (callback) => cleanups2.push(callback); + let [effect3, cleanupEffect] = elementBoundEffect(el); + cleanups2.push(cleanupEffect); + let utilities = { + Alpine: alpine_default, + effect: effect3, + cleanup, + evaluateLater: evaluateLater.bind(evaluateLater, el), + evaluate: evaluate.bind(evaluate, el) + }; + let doCleanup = () => cleanups2.forEach((i) => i()); + return [utilities, doCleanup]; + } + function getDirectiveHandler(el, directive22) { + let noop = () => { + }; + let handler4 = directiveHandlers[directive22.type] || noop; + let [utilities, cleanup] = getElementBoundUtilities(el); + onAttributeRemoved(el, directive22.original, cleanup); + let fullHandler = () => { + if (el._x_ignore || el._x_ignoreSelf) + return; + handler4.inline && handler4.inline(el, directive22, utilities); + handler4 = handler4.bind(handler4, el, directive22, utilities); + isDeferringHandlers ? directiveHandlerStacks.get(currentHandlerStackKey).push(handler4) : handler4(); + }; + fullHandler.runCleanups = cleanup; + return fullHandler; + } + var startingWith = (subject, replacement) => ({ name, value }) => { + if (name.startsWith(subject)) + name = name.replace(subject, replacement); + return { name, value }; + }; + var into = (i) => i; + function toTransformedAttributes(callback = () => { + }) { + return ({ name, value }) => { + let { name: newName, value: newValue } = attributeTransformers.reduce((carry, transform) => { + return transform(carry); + }, { name, value }); + if (newName !== name) + callback(newName, name); + return { name: newName, value: newValue }; + }; + } + var attributeTransformers = []; + function mapAttributes(callback) { + attributeTransformers.push(callback); + } + function outNonAlpineAttributes({ name }) { + return alpineAttributeRegex().test(name); + } + var alpineAttributeRegex = () => new RegExp(`^${prefixAsString}([^:^.]+)\\b`); + function toParsedDirectives(transformedAttributeMap, originalAttributeOverride) { + return ({ name, value }) => { + let typeMatch = name.match(alpineAttributeRegex()); + let valueMatch = name.match(/:([a-zA-Z0-9\-_:]+)/); + let modifiers = name.match(/\.[^.\]]+(?=[^\]]*$)/g) || []; + let original = originalAttributeOverride || transformedAttributeMap[name] || name; + return { + type: typeMatch ? typeMatch[1] : null, + value: valueMatch ? valueMatch[1] : null, + modifiers: modifiers.map((i) => i.replace(".", "")), + expression: value, + original + }; + }; + } + var DEFAULT = "DEFAULT"; + var directiveOrder = [ + "ignore", + "ref", + "data", + "id", + "anchor", + "bind", + "init", + "for", + "model", + "modelable", + "transition", + "show", + "if", + DEFAULT, + "teleport" + ]; + function byPriority(a, b) { + let typeA = directiveOrder.indexOf(a.type) === -1 ? DEFAULT : a.type; + let typeB = directiveOrder.indexOf(b.type) === -1 ? DEFAULT : b.type; + return directiveOrder.indexOf(typeA) - directiveOrder.indexOf(typeB); + } + function dispatch3(el, name, detail = {}) { + el.dispatchEvent(new CustomEvent(name, { + detail, + bubbles: true, + composed: true, + cancelable: true + })); + } + function walk(el, callback) { + if (typeof ShadowRoot === "function" && el instanceof ShadowRoot) { + Array.from(el.children).forEach((el2) => walk(el2, callback)); + return; + } + let skip = false; + callback(el, () => skip = true); + if (skip) + return; + let node = el.firstElementChild; + while (node) { + walk(node, callback, false); + node = node.nextElementSibling; + } + } + function warn(message, ...args) { + console.warn(`Alpine Warning: ${message}`, ...args); + } + var started = false; + function start2() { + if (started) + warn("Alpine has already been initialized on this page. Calling Alpine.start() more than once can cause problems."); + started = true; + if (!document.body) + warn("Unable to initialize. Trying to load Alpine before `` is available. Did you forget to add `defer` in Alpine's ` - + {{----}} diff --git a/resources/views/users/print.blade.php b/resources/views/users/print.blade.php index 4bbec7980b..c7ab189fa2 100644 --- a/resources/views/users/print.blade.php +++ b/resources/views/users/print.blade.php @@ -384,7 +384,7 @@ {{-- Javascript files --}} - +{{----}} @push('css') diff --git a/webpack.mix.js b/webpack.mix.js index f930feeb66..469e26e584 100644 --- a/webpack.mix.js +++ b/webpack.mix.js @@ -189,13 +189,6 @@ mix ) .version(); -mix - .combine( - ['./node_modules/alpinejs/dist/cdn.js'], - './public/js/dist/all-defer.js' - ) - .version(); - /** * Copy, minify and version skins */ From 17f0ac1eaebcbc7fbf07d4d749f4a8396bc44719 Mon Sep 17 00:00:00 2001 From: Marcus Moore Date: Wed, 29 May 2024 12:57:43 -0700 Subject: [PATCH 12/36] Set view correctly --- app/Livewire/Importer.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Livewire/Importer.php b/app/Livewire/Importer.php index f4d85bb5e1..b948ea75ef 100644 --- a/app/Livewire/Importer.php +++ b/app/Livewire/Importer.php @@ -548,7 +548,7 @@ class Importer extends Component public function render() { $this->files = Import::orderBy('id','desc')->get(); //HACK - slows down renders. - return view('') + return view('livewire.importer') ->extends('layouts.default') ->section('content'); } From 093c6652a8f670c1a326bccee8fabc3ed77ffd40 Mon Sep 17 00:00:00 2001 From: Marcus Moore Date: Wed, 29 May 2024 12:58:24 -0700 Subject: [PATCH 13/36] Update select2 snippet for Livewire 3 --- resources/assets/js/snipeit.js | 41 +++++++++++++++++++++++++--------- 1 file changed, 31 insertions(+), 10 deletions(-) diff --git a/resources/assets/js/snipeit.js b/resources/assets/js/snipeit.js index a7d669da83..4e4690663a 100755 --- a/resources/assets/js/snipeit.js +++ b/resources/assets/js/snipeit.js @@ -610,24 +610,45 @@ function htmlEntities(str) { * * 1. Set the class of your select2 elements to 'livewire-select2'). * 2. Name your element to match a property in your Livewire component - * 3. Add an attribute called 'data-livewire-component' that points to $_instance->id (via `{{ }}` if you're in a blade, - * or just $_instance->id if not). + * 3. Add an attribute called 'data-livewire-component' that points to $this->getId() (via `{{ }}` if you're in a blade, + * or just $this->getId() if not). */ -$(function () { +// $(function () { +// $('.livewire-select2').select2() +// +// $(document).on('select2:select', '.livewire-select2', function (event) { +// var target = $(event.target) +// if(!event.target.name || !target.data('livewire-component')) { +// console.error("You need to set both name (which should match a Livewire property) and data-livewire-component on your Livewire-ed select2 elements!") +// console.error("For data-livewire-component, you probably want to use $_instance->id or {{ $_instance->id }}, as appropriate") +// return false +// } +// window.livewire.find(target.data('livewire-component')).set(event.target.name, this.options[this.selectedIndex].value) +// }) +// +// window.livewire.hook('message.processed', function (el,component) { +// $('.livewire-select2').select2(); +// }); +// +// }) +document.addEventListener('livewire:init', () => { $('.livewire-select2').select2() $(document).on('select2:select', '.livewire-select2', function (event) { var target = $(event.target) if(!event.target.name || !target.data('livewire-component')) { console.error("You need to set both name (which should match a Livewire property) and data-livewire-component on your Livewire-ed select2 elements!") - console.error("For data-livewire-component, you probably want to use $_instance->id or {{ $_instance->id }}, as appropriate") + console.error("For data-livewire-component, you probably want to use $this->getId() or {{ $this->getId() }}, as appropriate") return false } - window.livewire.find(target.data('livewire-component')).set(event.target.name, this.options[this.selectedIndex].value) - }) - - window.livewire.hook('message.processed', function (el,component) { - $('.livewire-select2').select2(); + Livewire.find(target.data('livewire-component')).set(event.target.name, this.options[this.selectedIndex].value) }); -}) \ No newline at end of file + Livewire.hook('commit', function ({succeed}) { + succeed(({snapshot, effect}) => { + queueMicrotask(() => { + $('.livewire-select2').select2(); + }); + }); + }); +}); From 638ae9bdd52c9dac8a427c49eced2845d74f690f Mon Sep 17 00:00:00 2001 From: Marcus Moore Date: Wed, 29 May 2024 13:15:59 -0700 Subject: [PATCH 14/36] Use new id method --- resources/views/livewire/importer.blade.php | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/resources/views/livewire/importer.blade.php b/resources/views/livewire/importer.blade.php index f3cb13554c..fec01748ce 100644 --- a/resources/views/livewire/importer.blade.php +++ b/resources/views/livewire/importer.blade.php @@ -158,7 +158,7 @@ 'data-placeholder' => trans('general.select_var', ['thing' => trans('general.import_type')]), 'placeholder' => '', //needed so that the form-helper will put an empty option first 'data-minimum-results-for-search' => '-1', // Remove this if the list gets long enough that we need to search - 'data-livewire-component' => $_instance->id + 'data-livewire-component' => $this->getId() ]) }} @if ($activeFile->import_type === 'asset' && $snipeSettings->auto_increment_assets == 0)

@@ -170,7 +170,9 @@

@if ($activeFile->import_type === 'asset' && $snipeSettings->auto_increment_assets == 1 && $update) @@ -180,12 +182,16 @@ @endif @@ -231,7 +237,7 @@ 'class' => 'mappings livewire-select2', 'placeholder' => trans('general.importer.do_not_import'), 'style' => 'min-width: 100%', - 'data-livewire-component' => $_instance->id + 'data-livewire-component' => $this->getId() ],[ '-' => ['disabled' => true] // this makes the "-----" line unclickable ]) From 34595c266d68eb975d5d2fadae2ff6e80d965ec9 Mon Sep 17 00:00:00 2001 From: Marcus Moore Date: Wed, 29 May 2024 13:16:30 -0700 Subject: [PATCH 15/36] Update script tag --- resources/views/livewire/importer.blade.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/views/livewire/importer.blade.php b/resources/views/livewire/importer.blade.php index fec01748ce..be04d4442b 100644 --- a/resources/views/livewire/importer.blade.php +++ b/resources/views/livewire/importer.blade.php @@ -300,7 +300,7 @@
-@push('js') +@script -@endpush +@endscript From 8d924b60d74a9d056c59145a374c12b45594fe2e Mon Sep 17 00:00:00 2001 From: Marcus Moore Date: Wed, 29 May 2024 13:51:57 -0700 Subject: [PATCH 16/36] Replace references to @this in importer --- resources/views/livewire/importer.blade.php | 64 ++++++++++----------- 1 file changed, 32 insertions(+), 32 deletions(-) diff --git a/resources/views/livewire/importer.blade.php b/resources/views/livewire/importer.blade.php index be04d4442b..c0485ad8a0 100644 --- a/resources/views/livewire/importer.blade.php +++ b/resources/views/livewire/importer.blade.php @@ -307,9 +307,9 @@ $('#fileupload').fileupload({ dataType: 'json', done: function(e, data) { - @this.progress_bar_class = 'progress-bar-success'; - @this.progress_message = ' {{ trans('general.notification_success') }}'; - @this.progress = 100; + $wire.$set('progress_bar_class', 'progress-bar-success'); + $wire.$set('progress_message', ' {{ trans('general.notification_success') }}'); + $wire.$set('progress', 100); }, add: function(e, data) { data.headers = { @@ -317,17 +317,17 @@ "X-CSRF-TOKEN": $('meta[name="csrf-token"]').attr('content') }; data.process().done( function () {data.submit();}); - @this.progress = 0; - @this.clearMessage(); + $wire.$set('progress', 0); + $wire.clearMessage(); }, progress: function(e, data) { - @this.progress = parseInt((data.loaded / data.total * 100, 10)); - @this.progress_message = '{{ trans('general.uploading') }}'; + $wire.$set('progress', parseInt((data.loaded / data.total * 100, 10))); + $wire.$set('progress_message', '{{ trans('general.uploading') }}'); }, fail: function() { - @this.progress_bar_class = "progress-bar-danger"; - @this.progress = 100; - @this.progress_message = ' {{ trans('general.upload_error') }}'; + $wire.$set('progress_bar_class', "progress-bar-danger"); + $wire.$set('progress', 100); + $wire.$set('progress_message', ' {{ trans('general.upload_error') }}'); } }) @@ -338,28 +338,28 @@ // we have to hook up to the `` at the root of this display, // because the #import button isn't visible until you click an import_type $('#upload-table').on('click', '#import', function () { - if(!@this.activeFile.import_type) { - @this.statusType='error'; - @this.statusText= "An import type is required... "; //TODO: translate? + if (!$wire.$get('activeFile.import_type')) { + $wire.$set('statusType', 'error'); + $wire.$set('statusText', "An import type is required... "); //TODO: translate? return; } - @this.statusType ='pending'; - @this.statusText = ' {{ trans('admin/hardware/form.processing_spinner') }}'; - @this.generate_field_map().then(function (mappings_raw) { + $wire.$set('statusType', 'pending'); + $wire.$set('statusText', ' {{ trans('admin/hardware/form.processing_spinner') }}'); + $wire.generate_field_map().then(function (mappings_raw) { var mappings = JSON.parse(mappings_raw) // console.warn("Here is the mappings:") // console.dir(mappings) - // console.warn("Uh, active file id is, I guess: "+@this.activeFile.id) - var this_file = @this.file_id; // okay, I actually don't know what I'm doing here. + // console.warn("Uh, active file id is, I guess: "+$wire.$set('activeFile.id')) + var this_file = $wire.$get('file_id'); // okay, I actually don't know what I'm doing here. $.post({ {{-- I want to do something like: route('api.imports.importFile', $activeFile->id) }} --}} url: "api/v1/imports/process/"+this_file, // maybe? Good a guess as any..FIXME. HARDCODED DUMB FILE contentType: 'application/json', data: JSON.stringify({ - 'import-update': !!@this.update, - 'send-welcome': !!@this.send_welcome, - 'import-type': @this.activeFile.import_type, - 'run-backup': !!@this.run_backup, + 'import-update': !!$wire.$set('update'), + 'send-welcome': !!$wire.$set('send_welcome'), + 'import-type': $wire.$set('activeFile.import_type'), + 'run-backup': !!$wire.$set('run_backup'), 'column-mappings': mappings }), headers: { @@ -367,19 +367,19 @@ } }).done( function (body) { // Success - @this.statusType="success"; - @this.statusText = "{{ trans('general.success_redirecting') }}"; + $wire.$set('statusType', "success"); + $wire.$set('statusText', "{{ trans('general.success_redirecting') }}"); // console.dir(body) window.location.href = body.messages.redirect_url; }).fail( function (jqXHR, textStatus, error) { // Failure var body = jqXHR.responseJSON if((body) && (body.status) && body.status == 'import-errors') { - @this.emit('importError', body.messages); - @this.import_errors = body.messages + $wire.$dispatch('importError', body.messages); + $wire.$set('import_errors', body.messages); - @this.statusType='error'; - @this.statusText = "Error"; + $wire.$set('statusType', 'error'); + $wire.$set('statusText', "Error"); // If Slack/notifications hits API thresholds, we *do* 500, but we never // actually surface that info. @@ -390,15 +390,15 @@ // notifications could be sent". } else { console.warn("Not import-errors, just regular errors - maybe API limits") - @this.message_type="warning" + $wire.$set('message_type', "warning"); if ((body) && (error in body)) { - @this.message = body.error ? body.error:"Unknown error - might just be throttling by notifications." + $wire.$set('message', body.error ? body.error : "Unknown error - might just be throttling by notifications."); } else { - @this.message = "{{ trans('general.importer_generic_error') }}" + $wire.$set('message', "{{ trans('general.importer_generic_error') }}"); } } - @this.activeFile = null; //@this.set('hideDetails') + $wire.$set('activeFile', null); //$wire.$set('hideDetails') }); }) return false; From ee75b30683a9d71009f901c2e757abfc01961e44 Mon Sep 17 00:00:00 2001 From: Marcus Moore Date: Wed, 29 May 2024 14:06:27 -0700 Subject: [PATCH 17/36] Enable legacy_model_binding --- config/livewire.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/livewire.php b/config/livewire.php index 6c6d3ba8e1..8cc482183b 100644 --- a/config/livewire.php +++ b/config/livewire.php @@ -101,7 +101,7 @@ return [ | */ - 'legacy_model_binding' => false, + 'legacy_model_binding' => true, /* |--------------------------------------------------------------------------- From 7d95e7765d77e6b02b386f679b3d976e489ad84c Mon Sep 17 00:00:00 2001 From: Marcus Moore Date: Wed, 29 May 2024 14:13:29 -0700 Subject: [PATCH 18/36] Add a few .prevents --- resources/views/livewire/importer.blade.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/resources/views/livewire/importer.blade.php b/resources/views/livewire/importer.blade.php index c0485ad8a0..6d0e30d539 100644 --- a/resources/views/livewire/importer.blade.php +++ b/resources/views/livewire/importer.blade.php @@ -133,7 +133,7 @@ {{ trans('general.import') }} - + @@ -261,7 +261,7 @@
@@ -277,7 +277,7 @@ @else @endif {{-- end of if ... activeFile->import_type --}} From 9e354412815d995e83d28e1b2358ae38cf4b0421 Mon Sep 17 00:00:00 2001 From: Marcus Moore Date: Wed, 29 May 2024 15:50:42 -0700 Subject: [PATCH 19/36] Importer fixes --- resources/views/livewire/importer.blade.php | 29 ++++++++------------- 1 file changed, 11 insertions(+), 18 deletions(-) diff --git a/resources/views/livewire/importer.blade.php b/resources/views/livewire/importer.blade.php index 6d0e30d539..f006573c8e 100644 --- a/resources/views/livewire/importer.blade.php +++ b/resources/views/livewire/importer.blade.php @@ -150,10 +150,9 @@ {{ trans('general.import_type') }} -
+
{{ Form::select('activeFile.import_type', $importTypes, $activeFile->import_type, [ 'id' => 'import_type', - 'class' => 'livewire-select2', 'style' => 'min-width: 350px', 'data-placeholder' => trans('general.select_var', ['thing' => trans('general.import_type')]), 'placeholder' => '', //needed so that the form-helper will put an empty option first @@ -170,9 +169,7 @@
@if ($activeFile->import_type === 'asset' && $snipeSettings->auto_increment_assets == 1 && $update) @@ -182,16 +179,12 @@ @endif @@ -230,11 +223,11 @@
-
+
{{ Form::select('field_map.'.$index, $columnOptions[$activeFile->import_type], @$field_map[$index], [ - 'class' => 'mappings livewire-select2', + 'class' => 'mappings', 'placeholder' => trans('general.importer.do_not_import'), 'style' => 'min-width: 100%', 'data-livewire-component' => $this->getId() @@ -349,17 +342,17 @@ var mappings = JSON.parse(mappings_raw) // console.warn("Here is the mappings:") // console.dir(mappings) - // console.warn("Uh, active file id is, I guess: "+$wire.$set('activeFile.id')) + // console.warn("Uh, active file id is, I guess: "+$wire.$get('activeFile.id')) var this_file = $wire.$get('file_id'); // okay, I actually don't know what I'm doing here. $.post({ {{-- I want to do something like: route('api.imports.importFile', $activeFile->id) }} --}} url: "api/v1/imports/process/"+this_file, // maybe? Good a guess as any..FIXME. HARDCODED DUMB FILE contentType: 'application/json', data: JSON.stringify({ - 'import-update': !!$wire.$set('update'), - 'send-welcome': !!$wire.$set('send_welcome'), - 'import-type': $wire.$set('activeFile.import_type'), - 'run-backup': !!$wire.$set('run_backup'), + 'import-update': !!$wire.$get('update'), + 'send-welcome': !!$wire.$get('send_welcome'), + 'import-type': $wire.$get('activeFile.import_type'), + 'run-backup': !!$wire.$get('run_backup'), 'column-mappings': mappings }), headers: { From e80b80f5d185c5506f4f2793deddd8f450f41b20 Mon Sep 17 00:00:00 2001 From: Marcus Moore Date: Wed, 29 May 2024 16:04:05 -0700 Subject: [PATCH 20/36] Remove manual livewire tags --- resources/views/layouts/basic.blade.php | 2 -- resources/views/layouts/default.blade.php | 3 +-- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/resources/views/layouts/basic.blade.php b/resources/views/layouts/basic.blade.php index 759ffd52a8..db9e60e5de 100644 --- a/resources/views/layouts/basic.blade.php +++ b/resources/views/layouts/basic.blade.php @@ -19,7 +19,6 @@ } }; - @livewireStyles @if (($snipeSettings) && ($snipeSettings->header_color)) @@ -74,7 +73,6 @@ @stack('js') - @livewireScripts diff --git a/resources/views/layouts/default.blade.php b/resources/views/layouts/default.blade.php index 2790d2b192..1495d9e8db 100644 --- a/resources/views/layouts/default.blade.php +++ b/resources/views/layouts/default.blade.php @@ -83,7 +83,7 @@ dir="{{ in_array(app()->getLocale(),['ar-SA','fa-IR', 'he-IL']) ? 'rtl' : 'ltr' - @livewireStyles + @@ -1125,7 +1125,6 @@ dir="{{ in_array(app()->getLocale(),['ar-SA','fa-IR', 'he-IL']) ? 'rtl' : 'ltr' @include('partials.bpay') - @livewireScripts From f03249898a57c6148a5ccfb4653eb2f949b2f473 Mon Sep 17 00:00:00 2001 From: Marcus Moore Date: Thu, 30 May 2024 16:12:52 -0700 Subject: [PATCH 21/36] Update id syntax in custom fields component --- .../custom-field-set-default-values-for-model.blade.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/views/livewire/custom-field-set-default-values-for-model.blade.php b/resources/views/livewire/custom-field-set-default-values-for-model.blade.php index 27754707ae..7f61db8cea 100644 --- a/resources/views/livewire/custom-field-set-default-values-for-model.blade.php +++ b/resources/views/livewire/custom-field-set-default-values-for-model.blade.php @@ -5,12 +5,12 @@ {{ trans('admin/models/general.fieldset') }}
- {{ Form::select('fieldset_id', Helper::customFieldsetList(), old('fieldset_id', $fieldset_id), array('class'=>'select2 js-fieldset-field livewire-select2', 'style'=>'width:100%; min-width:350px', 'aria-label'=>'custom_fieldset', 'data-livewire-component' => $_instance->id)) }} + {{ Form::select('fieldset_id', Helper::customFieldsetList(), old('fieldset_id', $fieldset_id), array('class'=>'select2 js-fieldset-field livewire-select2', 'style'=>'width:100%; min-width:350px', 'aria-label'=>'custom_fieldset', 'data-livewire-component' => $this->getId())) }} {!! $errors->first('custom_fieldset', '') !!}
From 2eaac3d381461d5b68266722f4f73f4506be3c44 Mon Sep 17 00:00:00 2001 From: Marcus Moore Date: Thu, 30 May 2024 16:20:04 -0700 Subject: [PATCH 22/36] Fix select2 re-renders --- resources/assets/js/snipeit.js | 4 ++-- resources/views/livewire/importer.blade.php | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/resources/assets/js/snipeit.js b/resources/assets/js/snipeit.js index 4e4690663a..4d825268ae 100755 --- a/resources/assets/js/snipeit.js +++ b/resources/assets/js/snipeit.js @@ -644,8 +644,8 @@ document.addEventListener('livewire:init', () => { Livewire.find(target.data('livewire-component')).set(event.target.name, this.options[this.selectedIndex].value) }); - Livewire.hook('commit', function ({succeed}) { - succeed(({snapshot, effect}) => { + Livewire.hook('request', ({succeed}) => { + succeed(() => { queueMicrotask(() => { $('.livewire-select2').select2(); }); diff --git a/resources/views/livewire/importer.blade.php b/resources/views/livewire/importer.blade.php index f006573c8e..5541b43f39 100644 --- a/resources/views/livewire/importer.blade.php +++ b/resources/views/livewire/importer.blade.php @@ -153,6 +153,7 @@
{{ Form::select('activeFile.import_type', $importTypes, $activeFile->import_type, [ 'id' => 'import_type', + 'class' => 'livewire-select2', 'style' => 'min-width: 350px', 'data-placeholder' => trans('general.select_var', ['thing' => trans('general.import_type')]), 'placeholder' => '', //needed so that the form-helper will put an empty option first @@ -227,7 +228,7 @@ {{ Form::select('field_map.'.$index, $columnOptions[$activeFile->import_type], @$field_map[$index], [ - 'class' => 'mappings', + 'class' => 'mappings livewire-select2', 'placeholder' => trans('general.importer.do_not_import'), 'style' => 'min-width: 100%', 'data-livewire-component' => $this->getId() From 5a9a2313599548c976721a100ea4e311f8e1b435 Mon Sep 17 00:00:00 2001 From: Marcus Moore Date: Thu, 30 May 2024 16:57:20 -0700 Subject: [PATCH 23/36] Remove alpinejs --- package.json | 1 - 1 file changed, 1 deletion(-) diff --git a/package.json b/package.json index 9b826c5964..2e2c998d67 100644 --- a/package.json +++ b/package.json @@ -30,7 +30,6 @@ "acorn-import-assertions": "^1.9.0", "admin-lte": "^2.4.18", "ajv": "^6.12.6", - "alpinejs": "^3.13.10", "blueimp-file-upload": "^9.34.0", "bootstrap": "^3.4.1", "bootstrap-colorpicker": "^2.5.3", From 296cf3e34bcc26d53a184b80caaa35e407170408 Mon Sep 17 00:00:00 2001 From: Marcus Moore Date: Tue, 4 Jun 2024 15:37:41 -0700 Subject: [PATCH 24/36] Update OauthClients component --- app/Livewire/OauthClients.php | 24 ++++++------------- .../views/livewire/oauth-clients.blade.php | 4 ++-- 2 files changed, 9 insertions(+), 19 deletions(-) diff --git a/app/Livewire/OauthClients.php b/app/Livewire/OauthClients.php index d3803a7b28..f621e8ed9c 100644 --- a/app/Livewire/OauthClients.php +++ b/app/Livewire/OauthClients.php @@ -19,21 +19,11 @@ class OauthClients extends Component public $authorizationError; - protected $clientRepository; - protected $tokenRepository; - - public function __construct() - { - $this->clientRepository = app(ClientRepository::class); - $this->tokenRepository = app(TokenRepository::class); - parent::__construct(); - } - public function render() { return view('livewire.oauth-clients', [ - 'clients' => $this->clientRepository->activeForUser(auth()->user()->id), - 'authorized_tokens' => $this->tokenRepository->forUser(auth()->user()->id)->where('revoked', false), + 'clients' => app(ClientRepository::class)->activeForUser(auth()->user()->id), + 'authorized_tokens' => app(TokenRepository::class)->forUser(auth()->user()->id)->where('revoked', false), ]); } @@ -44,7 +34,7 @@ class OauthClients extends Component 'redirect' => 'required|url|max:255', ]); - $newClient = $this->clientRepository->create( + $newClient = app(ClientRepository::class)->create( auth()->user()->id, $this->name, $this->redirect, @@ -58,7 +48,7 @@ class OauthClients extends Component // test for safety // ->delete must be of type Client - thus the model binding if ($clientId->user_id == auth()->user()->id) { - $this->clientRepository->delete($clientId); + app(ClientRepository::class)->delete($clientId); } else { Log::warning('User ' . auth()->user()->id . ' attempted to delete client ' . $clientId->id . ' which belongs to user ' . $clientId->user_id); $this->authorizationError = 'You are not authorized to delete this client.'; @@ -67,9 +57,9 @@ class OauthClients extends Component public function deleteToken($tokenId): void { - $token = $this->tokenRepository->find($tokenId); + $token = app(TokenRepository::class)->find($tokenId); if ($token->user_id == auth()->user()->id) { - $this->tokenRepository->revokeAccessToken($tokenId); + app(TokenRepository::class)->revokeAccessToken($tokenId); } else { Log::warning('User ' . auth()->user()->id . ' attempted to delete token ' . $tokenId . ' which belongs to user ' . $token->user_id); $this->authorizationError = 'You are not authorized to delete this token.'; @@ -93,7 +83,7 @@ class OauthClients extends Component 'editRedirect' => 'required|url|max:255', ]); - $client = $this->clientRepository->find($editClientId->id); + $client = app(ClientRepository::class)->find($editClientId->id); if ($client->user_id == auth()->user()->id) { $client->name = $this->editName; $client->redirect = $this->editRedirect; diff --git a/resources/views/livewire/oauth-clients.blade.php b/resources/views/livewire/oauth-clients.blade.php index 5b789d0e0e..ed6b2ae272 100644 --- a/resources/views/livewire/oauth-clients.blade.php +++ b/resources/views/livewire/oauth-clients.blade.php @@ -311,7 +311,7 @@
-
\ No newline at end of file +
From 5eb5742b3d962cf5530c78d8e540bbcfe1d193d0 Mon Sep 17 00:00:00 2001 From: Marcus Moore Date: Tue, 4 Jun 2024 15:49:39 -0700 Subject: [PATCH 25/36] Define property --- app/Livewire/SlackSettingsForm.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/Livewire/SlackSettingsForm.php b/app/Livewire/SlackSettingsForm.php index f5908f798c..0ebabb28fc 100644 --- a/app/Livewire/SlackSettingsForm.php +++ b/app/Livewire/SlackSettingsForm.php @@ -23,6 +23,8 @@ class SlackSettingsForm extends Component public Setting $setting; + public $save_button; + public $webhook_endpoint_rules; From ef91c8123e759a0b93de9e71b57e47414b2d2c58 Mon Sep 17 00:00:00 2001 From: Marcus Moore Date: Tue, 4 Jun 2024 15:49:57 -0700 Subject: [PATCH 26/36] Remove unneeded re-render of select2 --- resources/views/livewire/slack-settings-form.blade.php | 5 ----- 1 file changed, 5 deletions(-) diff --git a/resources/views/livewire/slack-settings-form.blade.php b/resources/views/livewire/slack-settings-form.blade.php index e6a603b6f8..a5de8585e3 100644 --- a/resources/views/livewire/slack-settings-form.blade.php +++ b/resources/views/livewire/slack-settings-form.blade.php @@ -175,11 +175,6 @@ var data = $('#select2').select2("val"); @this.set('webhook_selected', data); }); - - // Re-render select2 - window.livewire.hook('message.processed', function (el, component) { - $('.select2').select2(); - }); }); From 99439f0a5cac42a1a30b2fea1d16b7e3b852538f Mon Sep 17 00:00:00 2001 From: Marcus Moore Date: Tue, 4 Jun 2024 16:14:07 -0700 Subject: [PATCH 27/36] Define property --- app/Livewire/SlackSettingsForm.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/Livewire/SlackSettingsForm.php b/app/Livewire/SlackSettingsForm.php index 0ebabb28fc..45b8b7b41e 100644 --- a/app/Livewire/SlackSettingsForm.php +++ b/app/Livewire/SlackSettingsForm.php @@ -25,15 +25,15 @@ class SlackSettingsForm extends Component public $save_button; + public $webhook_test; + public $webhook_endpoint_rules; - - protected $rules = [ 'webhook_endpoint' => 'required_with:webhook_channel|starts_with:http://,https://,ftp://,irc://,https://hooks.slack.com/services/|url|nullable', 'webhook_channel' => 'required_with:webhook_endpoint|starts_with:#|nullable', 'webhook_botname' => 'string|nullable', ]; - + public function mount() { $this->webhook_text= [ From b2a0e7958b04cf189b4431618031e6eb6765e0e4 Mon Sep 17 00:00:00 2001 From: Marcus Moore Date: Tue, 4 Jun 2024 17:03:36 -0700 Subject: [PATCH 28/36] Inject alpine on label engine page --- resources/views/settings/labels.blade.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/resources/views/settings/labels.blade.php b/resources/views/settings/labels.blade.php index 6f3694caff..4fcfcddc29 100644 --- a/resources/views/settings/labels.blade.php +++ b/resources/views/settings/labels.blade.php @@ -426,3 +426,8 @@ {{Form::close()}} @stop + +@push('js') + {{-- Can't use @script here because we're not in a livewire component so let's manually load --}} + @livewireScripts +@endpush From 48fc6ca60ee4b84fe3f563e25d67f9209b44ad4b Mon Sep 17 00:00:00 2001 From: Marcus Moore Date: Wed, 5 Jun 2024 11:46:57 -0700 Subject: [PATCH 29/36] Remove commented code --- resources/assets/js/snipeit.js | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/resources/assets/js/snipeit.js b/resources/assets/js/snipeit.js index 4d825268ae..bd03690ca7 100755 --- a/resources/assets/js/snipeit.js +++ b/resources/assets/js/snipeit.js @@ -613,24 +613,6 @@ function htmlEntities(str) { * 3. Add an attribute called 'data-livewire-component' that points to $this->getId() (via `{{ }}` if you're in a blade, * or just $this->getId() if not). */ -// $(function () { -// $('.livewire-select2').select2() -// -// $(document).on('select2:select', '.livewire-select2', function (event) { -// var target = $(event.target) -// if(!event.target.name || !target.data('livewire-component')) { -// console.error("You need to set both name (which should match a Livewire property) and data-livewire-component on your Livewire-ed select2 elements!") -// console.error("For data-livewire-component, you probably want to use $_instance->id or {{ $_instance->id }}, as appropriate") -// return false -// } -// window.livewire.find(target.data('livewire-component')).set(event.target.name, this.options[this.selectedIndex].value) -// }) -// -// window.livewire.hook('message.processed', function (el,component) { -// $('.livewire-select2').select2(); -// }); -// -// }) document.addEventListener('livewire:init', () => { $('.livewire-select2').select2() From 60c7efae3c7320d118d3031b293427bb91fbb81c Mon Sep 17 00:00:00 2001 From: Marcus Moore Date: Wed, 5 Jun 2024 11:48:10 -0700 Subject: [PATCH 30/36] Remove commented code --- resources/views/layouts/default.blade.php | 1 - resources/views/users/print.blade.php | 1 - 2 files changed, 2 deletions(-) diff --git a/resources/views/layouts/default.blade.php b/resources/views/layouts/default.blade.php index 1495d9e8db..f08800a112 100644 --- a/resources/views/layouts/default.blade.php +++ b/resources/views/layouts/default.blade.php @@ -946,7 +946,6 @@ dir="{{ in_array(app()->getLocale(),['ar-SA','fa-IR', 'he-IL']) ? 'rtl' : 'ltr' {{-- Javascript files --}} - {{----}} diff --git a/resources/views/users/print.blade.php b/resources/views/users/print.blade.php index c7ab189fa2..4835ae1075 100644 --- a/resources/views/users/print.blade.php +++ b/resources/views/users/print.blade.php @@ -384,7 +384,6 @@ {{-- Javascript files --}} -{{----}} @push('css') From 9044aa4ed96e0e95a1c016f8741eae1a8a59bedf Mon Sep 17 00:00:00 2001 From: Marcus Moore Date: Wed, 5 Jun 2024 11:48:47 -0700 Subject: [PATCH 31/36] Import class --- routes/web.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/routes/web.php b/routes/web.php index b96d32d811..f2534c5062 100644 --- a/routes/web.php +++ b/routes/web.php @@ -23,6 +23,7 @@ use App\Http\Controllers\ViewAssetsController; use App\Http\Controllers\Auth\LoginController; use App\Http\Controllers\Auth\ForgotPasswordController; use App\Http\Controllers\Auth\ResetPasswordController; +use App\Livewire\Importer; use Illuminate\Support\Facades\Route; use Illuminate\Support\Facades\Auth; @@ -262,7 +263,7 @@ Route::group(['prefix' => 'admin', 'middleware' => ['auth', 'authorize:superuser */ Route::get('/import', - \App\Livewire\Importer::class + Importer::class )->middleware('auth')->name('imports.index'); /* From c51b7d7104caead4a495ec8735be0a11b190d16b Mon Sep 17 00:00:00 2001 From: Marcus Moore Date: Mon, 10 Jun 2024 12:22:23 -0700 Subject: [PATCH 32/36] Inline variable --- app/Livewire/OauthClients.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Livewire/OauthClients.php b/app/Livewire/OauthClients.php index f621e8ed9c..02fc77848b 100644 --- a/app/Livewire/OauthClients.php +++ b/app/Livewire/OauthClients.php @@ -34,7 +34,7 @@ class OauthClients extends Component 'redirect' => 'required|url|max:255', ]); - $newClient = app(ClientRepository::class)->create( + app(ClientRepository::class)->create( auth()->user()->id, $this->name, $this->redirect, From fc351a189611ee67de8a31698cffaa1ad9520a02 Mon Sep 17 00:00:00 2001 From: Marcus Moore Date: Mon, 17 Jun 2024 13:03:27 -0700 Subject: [PATCH 33/36] Remove .live from oauth clients --- resources/views/livewire/oauth-clients.blade.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/resources/views/livewire/oauth-clients.blade.php b/resources/views/livewire/oauth-clients.blade.php index 9521eaf5c5..27a76b623f 100644 --- a/resources/views/livewire/oauth-clients.blade.php +++ b/resources/views/livewire/oauth-clients.blade.php @@ -195,7 +195,7 @@ type="text" aria-label="create-client-name" class="form-control" - wire:model.live="name" + wire:model="name" wire:keydown.enter="createClient" autofocus> @@ -214,7 +214,7 @@ class="form-control" aria-label="redirect" name="redirect" - wire:model.live="redirect" + wire:model="redirect" wire:keydown.enter="createClient" > @@ -305,7 +305,7 @@ class="form-control" name="redirect" aria-label="redirect" - wire:model.live="editRedirect" + wire:model="editRedirect" wire:keydown.enter="updateClient('{{ $editClientId }}')" > From a3dea99bbbe3c9762a06840911a9c8a8f639d449 Mon Sep 17 00:00:00 2001 From: Marcus Moore Date: Mon, 17 Jun 2024 14:24:16 -0700 Subject: [PATCH 34/36] Fix category edit form component --- resources/views/livewire/category-edit-form.blade.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/resources/views/livewire/category-edit-form.blade.php b/resources/views/livewire/category-edit-form.blade.php index 433ba0d5d9..cb80eb45d3 100644 --- a/resources/views/livewire/category-edit-form.blade.php +++ b/resources/views/livewire/category-edit-form.blade.php @@ -18,12 +18,12 @@
@if ($defaultEulaText!='') @else @endif @@ -34,7 +34,7 @@
@@ -44,7 +44,7 @@
@if ($this->shouldDisplayEmailMessage) From 30dd8bcf2bde24217aa9f9e385b11ca29dedfaf6 Mon Sep 17 00:00:00 2001 From: Marcus Moore Date: Tue, 18 Jun 2024 15:10:59 -0700 Subject: [PATCH 35/36] Update Livewire --- composer.json | 2 +- public/vendor/livewire/livewire.esm.js | 19 ++++++++++++++----- public/vendor/livewire/livewire.js | 19 ++++++++++++++----- public/vendor/livewire/livewire.min.js | 12 ++++++------ public/vendor/livewire/livewire.min.js.map | 4 ++-- public/vendor/livewire/manifest.json | 2 +- 6 files changed, 38 insertions(+), 20 deletions(-) diff --git a/composer.json b/composer.json index 0aa544316b..ecaadb596f 100644 --- a/composer.json +++ b/composer.json @@ -49,7 +49,7 @@ "laravelcollective/html": "^6.2", "league/csv": "^9.7", "league/flysystem-aws-s3-v3": "^3.0", - "livewire/livewire": "^3.0", + "livewire/livewire": "^3.5", "neitanod/forceutf8": "^2.0", "nesbot/carbon": "^2.32", "nunomaduro/collision": "^6.1", diff --git a/public/vendor/livewire/livewire.esm.js b/public/vendor/livewire/livewire.esm.js index 2f0f08cdff..0f6daa54ec 100644 --- a/public/vendor/livewire/livewire.esm.js +++ b/public/vendor/livewire/livewire.esm.js @@ -1594,7 +1594,7 @@ var require_module_cjs = __commonJS({ const target = objects.find((obj) => Object.prototype.hasOwnProperty.call(obj, name)) || objects[objects.length - 1]; const descriptor = Object.getOwnPropertyDescriptor(target, name); if ((descriptor == null ? void 0 : descriptor.set) && (descriptor == null ? void 0 : descriptor.get)) - return Reflect.set(target, name, value, thisProxy); + return descriptor.set.call(thisProxy, value) || true; return Reflect.set(target, name, value); } }; @@ -2861,7 +2861,7 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el); get raw() { return raw; }, - version: "3.14.0", + version: "3.14.1", flushAndStopDeferringMutations, dontAutoEvaluateFunctions, disableEffectScheduling, @@ -7539,7 +7539,9 @@ var UploadManager = class { unsetUploadLoading(this.component); let uploadItem = this.uploadBag.first(name); if (uploadItem) { - uploadItem.request.abort(); + if (uploadItem.request) { + uploadItem.request.abort(); + } this.uploadBag.shift(name).cancelledCallback(); if (cancelledCallback) cancelledCallback(); @@ -8309,6 +8311,9 @@ var Component = class { if (this.originalEffects.url) { effects.url = this.originalEffects.url; } + if (this.originalEffects.scripts) { + effects.scripts = this.originalEffects.scripts; + } el.setAttribute("wire:effects", JSON.stringify(effects)); } addCleanup(cleanup) { @@ -9271,13 +9276,15 @@ function history2(Alpine19) { }); Alpine19.history = { track }; } -function track(name, initialSeedValue, alwaysShow = false) { +function track(name, initialSeedValue, alwaysShow = false, except = null) { let { has, get, set, remove } = queryStringUtils(); let url = new URL(window.location.href); let isInitiallyPresentInUrl = has(url, name); let initialValue = isInitiallyPresentInUrl ? get(url, name) : initialSeedValue; let initialValueMemo = JSON.stringify(initialValue); + let exceptValueMemo = [false, null, void 0].includes(except) ? initialSeedValue : JSON.stringify(except); let hasReturnedToInitialValue = (newValue) => JSON.stringify(newValue) === initialValueMemo; + let hasReturnedToExceptValue = (newValue) => JSON.stringify(newValue) === exceptValueMemo; if (alwaysShow) url = set(url, name, initialValue); replace(url, name, { value: initialValue }); @@ -9290,6 +9297,8 @@ function track(name, initialSeedValue, alwaysShow = false) { url2 = remove(url2, name); } else if (newValue === void 0) { url2 = remove(url2, name); + } else if (!alwaysShow && hasReturnedToExceptValue(newValue)) { + url2 = remove(url2, name); } else { url2 = set(url2, name, newValue); } @@ -9950,7 +9959,7 @@ on("effect", ({ component, effects, cleanup }) => { if (!as) as = name; let initialValue = [false, null, void 0].includes(except) ? dataGet(component.ephemeral, name) : except; - let { replace: replace2, push: push2, pop } = track(as, initialValue, alwaysShow); + let { replace: replace2, push: push2, pop } = track(as, initialValue, alwaysShow, except); if (use === "replace") { let effectReference = import_alpinejs10.default.effect(() => { replace2(dataGet(component.reactive, name)); diff --git a/public/vendor/livewire/livewire.js b/public/vendor/livewire/livewire.js index 110eef86c8..8eef48fadf 100644 --- a/public/vendor/livewire/livewire.js +++ b/public/vendor/livewire/livewire.js @@ -635,7 +635,9 @@ unsetUploadLoading(this.component); let uploadItem = this.uploadBag.first(name); if (uploadItem) { - uploadItem.request.abort(); + if (uploadItem.request) { + uploadItem.request.abort(); + } this.uploadBag.shift(name).cancelledCallback(); if (cancelledCallback) cancelledCallback(); @@ -1011,7 +1013,7 @@ const target = objects.find((obj) => Object.prototype.hasOwnProperty.call(obj, name)) || objects[objects.length - 1]; const descriptor = Object.getOwnPropertyDescriptor(target, name); if (descriptor?.set && descriptor?.get) - return Reflect.set(target, name, value, thisProxy); + return descriptor.set.call(thisProxy, value) || true; return Reflect.set(target, name, value); } }; @@ -2278,7 +2280,7 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el); get raw() { return raw; }, - version: "3.14.0", + version: "3.14.1", flushAndStopDeferringMutations, dontAutoEvaluateFunctions, disableEffectScheduling, @@ -4567,6 +4569,9 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el); if (this.originalEffects.url) { effects.url = this.originalEffects.url; } + if (this.originalEffects.scripts) { + effects.scripts = this.originalEffects.scripts; + } el.setAttribute("wire:effects", JSON.stringify(effects)); } addCleanup(cleanup2) { @@ -7914,13 +7919,15 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el); }); Alpine3.history = { track: track2 }; } - function track2(name, initialSeedValue, alwaysShow = false) { + function track2(name, initialSeedValue, alwaysShow = false, except = null) { let { has: has2, get: get3, set: set3, remove } = queryStringUtils(); let url = new URL(window.location.href); let isInitiallyPresentInUrl = has2(url, name); let initialValue = isInitiallyPresentInUrl ? get3(url, name) : initialSeedValue; let initialValueMemo = JSON.stringify(initialValue); + let exceptValueMemo = [false, null, void 0].includes(except) ? initialSeedValue : JSON.stringify(except); let hasReturnedToInitialValue = (newValue) => JSON.stringify(newValue) === initialValueMemo; + let hasReturnedToExceptValue = (newValue) => JSON.stringify(newValue) === exceptValueMemo; if (alwaysShow) url = set3(url, name, initialValue); replace(url, name, { value: initialValue }); @@ -7933,6 +7940,8 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el); url2 = remove(url2, name); } else if (newValue === void 0) { url2 = remove(url2, name); + } else if (!alwaysShow && hasReturnedToExceptValue(newValue)) { + url2 = remove(url2, name); } else { url2 = set3(url2, name, newValue); } @@ -9082,7 +9091,7 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el); if (!as) as = name; let initialValue = [false, null, void 0].includes(except) ? dataGet(component.ephemeral, name) : except; - let { replace: replace2, push: push2, pop } = track2(as, initialValue, alwaysShow); + let { replace: replace2, push: push2, pop } = track2(as, initialValue, alwaysShow, except); if (use === "replace") { let effectReference = module_default.effect(() => { replace2(dataGet(component.reactive, name)); diff --git a/public/vendor/livewire/livewire.min.js b/public/vendor/livewire/livewire.min.js index 5872dbf510..36c4171c37 100644 --- a/public/vendor/livewire/livewire.min.js +++ b/public/vendor/livewire/livewire.min.js @@ -1,14 +1,14 @@ -(()=>{var el=Object.create;var ti=Object.defineProperty;var tl=Object.getOwnPropertyDescriptor;var rl=Object.getOwnPropertyNames;var nl=Object.getPrototypeOf,il=Object.prototype.hasOwnProperty;var ol=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var sl=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of rl(t))!il.call(e,i)&&i!==r&&ti(e,i,{get:()=>t[i],enumerable:!(n=tl(t,i))||n.enumerable});return e};var al=(e,t,r)=>(r=e!=null?el(nl(e)):{},sl(t||!e||!e.__esModule?ti(r,"default",{value:e,enumerable:!0}):r,e));var ua=ol((Dn,la)=>{(function(e,t){typeof define=="function"&&define.amd?define(t):typeof Dn=="object"?la.exports=t():e.NProgress=t()})(Dn,function(){var e={};e.version="0.2.0";var t=e.settings={minimum:.08,easing:"ease",positionUsing:"",speed:200,trickle:!0,trickleRate:.02,trickleSpeed:800,showSpinner:!0,barSelector:'[role="bar"]',spinnerSelector:'[role="spinner"]',parent:"body",template:'
'};e.configure=function(c){var f,m;for(f in c)m=c[f],m!==void 0&&c.hasOwnProperty(f)&&(t[f]=m);return this},e.status=null,e.set=function(c){var f=e.isStarted();c=r(c,t.minimum,1),e.status=c===1?null:c;var m=e.render(!f),v=m.querySelector(t.barSelector),g=t.speed,x=t.easing;return m.offsetWidth,o(function(b){t.positionUsing===""&&(t.positionUsing=e.getPositioningCSS()),s(v,i(c,g,x)),c===1?(s(m,{transition:"none",opacity:1}),m.offsetWidth,setTimeout(function(){s(m,{transition:"all "+g+"ms linear",opacity:0}),setTimeout(function(){e.remove(),b()},g)},g)):setTimeout(b,g)}),this},e.isStarted=function(){return typeof e.status=="number"},e.start=function(){e.status||e.set(0);var c=function(){setTimeout(function(){!e.status||(e.trickle(),c())},t.trickleSpeed)};return t.trickle&&c(),this},e.done=function(c){return!c&&!e.status?this:e.inc(.3+.5*Math.random()).set(1)},e.inc=function(c){var f=e.status;return f?(typeof c!="number"&&(c=(1-f)*r(Math.random()*f,.1,.95)),f=r(f+c,0,.994),e.set(f)):e.start()},e.trickle=function(){return e.inc(Math.random()*t.trickleRate)},function(){var c=0,f=0;e.promise=function(m){return!m||m.state()==="resolved"?this:(f===0&&e.start(),c++,f++,m.always(function(){f--,f===0?(c=0,e.done()):e.set((c-f)/c)}),this)}}(),e.render=function(c){if(e.isRendered())return document.getElementById("nprogress");l(document.documentElement,"nprogress-busy");var f=document.createElement("div");f.id="nprogress",f.innerHTML=t.template;var m=f.querySelector(t.barSelector),v=c?"-100":n(e.status||0),g=document.querySelector(t.parent),x;return s(m,{transition:"all 0 linear",transform:"translate3d("+v+"%,0,0)"}),t.showSpinner||(x=f.querySelector(t.spinnerSelector),x&&p(x)),g!=document.body&&l(g,"nprogress-custom-parent"),g.appendChild(f),f},e.remove=function(){u(document.documentElement,"nprogress-busy"),u(document.querySelector(t.parent),"nprogress-custom-parent");var c=document.getElementById("nprogress");c&&p(c)},e.isRendered=function(){return!!document.getElementById("nprogress")},e.getPositioningCSS=function(){var c=document.body.style,f="WebkitTransform"in c?"Webkit":"MozTransform"in c?"Moz":"msTransform"in c?"ms":"OTransform"in c?"O":"";return f+"Perspective"in c?"translate3d":f+"Transform"in c?"translate":"margin"};function r(c,f,m){return cm?m:c}function n(c){return(-1+c)*100}function i(c,f,m){var v;return t.positionUsing==="translate3d"?v={transform:"translate3d("+n(c)+"%,0,0)"}:t.positionUsing==="translate"?v={transform:"translate("+n(c)+"%,0)"}:v={"margin-left":n(c)+"%"},v.transition="all "+f+"ms "+m,v}var o=function(){var c=[];function f(){var m=c.shift();m&&m(f)}return function(m){c.push(m),c.length==1&&f()}}(),s=function(){var c=["Webkit","O","Moz","ms"],f={};function m(b){return b.replace(/^-ms-/,"ms-").replace(/-([\da-z])/gi,function(_,T){return T.toUpperCase()})}function v(b){var _=document.body.style;if(b in _)return b;for(var T=c.length,O=b.charAt(0).toUpperCase()+b.slice(1),w;T--;)if(w=c[T]+O,w in _)return w;return b}function g(b){return b=m(b),f[b]||(f[b]=v(b))}function x(b,_,T){_=g(_),b.style[_]=T}return function(b,_){var T=arguments,O,w;if(T.length==2)for(O in _)w=_[O],w!==void 0&&_.hasOwnProperty(O)&&x(b,O,w);else x(b,T[1],T[2])}}();function a(c,f){var m=typeof c=="string"?c:d(c);return m.indexOf(" "+f+" ")>=0}function l(c,f){var m=d(c),v=m+f;a(m,f)||(c.className=v.substring(1))}function u(c,f){var m=d(c),v;!a(c,f)||(v=m.replace(" "+f+" "," "),c.className=v.substring(1,v.length-1))}function d(c){return(" "+(c.className||"")+" ").replace(/\s+/gi," ")}function p(c){c&&c.parentNode&&c.parentNode.removeChild(c)}return e})});var wt=class{constructor(){this.arrays={}}add(t,r){this.arrays[t]||(this.arrays[t]=[]),this.arrays[t].push(r)}remove(t){this.arrays[t]&&delete this.arrays[t]}get(t){return this.arrays[t]||[]}each(t,r){return this.get(t).forEach(r)}},Fe=class{constructor(){this.arrays=new WeakMap}add(t,r){this.arrays.has(t)||this.arrays.set(t,[]),this.arrays.get(t).push(r)}remove(t){this.arrays.has(t)&&this.arrays.delete(t,[])}get(t){return this.arrays.has(t)?this.arrays.get(t):[]}each(t,r){return this.get(t).forEach(r)}};function yt(e,t,r={},n=!0){e.dispatchEvent(new CustomEvent(t,{detail:r,bubbles:n,composed:!0,cancelable:!0}))}function xt(e,t,r){return e.addEventListener(t,r),()=>e.removeEventListener(t,r)}function _t(e){return typeof e=="object"&&e!==null}function ri(e){return _t(e)&&!vr(e)}function vr(e){return Array.isArray(e)}function br(e){return typeof e=="function"}function ni(e){return typeof e!="object"||e===null}function ce(e){return JSON.parse(JSON.stringify(e))}function W(e,t){return t===""?e:t.split(".").reduce((r,n)=>{if(r!==void 0)return r[n]},e)}function ye(e,t,r){let n=t.split(".");if(n.length===1)return e[t]=r;let i=n.shift(),o=n.join(".");e[i]===void 0&&(e[i]={}),ye(e[i],o,r)}function Qe(e,t,r={},n=""){if(e===t)return r;if(typeof e!=typeof t||ri(e)&&vr(t)||vr(e)&&ri(t)||ni(e)||ni(t))return r[n]=t,r;let i=Object.keys(e);return Object.entries(t).forEach(([o,s])=>{r={...r,...Qe(e[o],t[o],r,n===""?o:`${n}.${o}`)},i=i.filter(a=>a!==o)}),i.forEach(o=>{r[`${n}.${o}`]="__rm__"}),r}function xe(e){let t=ii(e)?e[0]:e,r=ii(e)?e[1]:void 0;return _t(t)&&Object.entries(t).forEach(([n,i])=>{t[n]=xe(i)}),t}function ii(e){return Array.isArray(e)&&e.length===2&&typeof e[1]=="object"&&Object.keys(e[1]).includes("s")}function St(){if(document.querySelector('meta[name="csrf-token"]'))return document.querySelector('meta[name="csrf-token"]').getAttribute("content");if(document.querySelector("[data-csrf]"))return document.querySelector("[data-csrf]").getAttribute("data-csrf");if(window.livewireScriptConfig.csrf??!1)return window.livewireScriptConfig.csrf;throw"Livewire: No CSRF token detected"}var Ie;function oi(){if(Ie)return Ie;if(window.livewireScriptConfig&&(window.livewireScriptConfig.nonce??!1))return Ie=window.livewireScriptConfig.nonce,Ie;let e=document.querySelector("style[data-livewire-style][nonce]");return e?(Ie=e.nonce,Ie):null}function si(){return document.querySelector("[data-update-uri]")?.getAttribute("data-update-uri")??window.livewireScriptConfig.uri??null}function Et(e){return!!e.match(/