oddchange_at wip

This commit is contained in:
salam committed 2026-01-18 10:40:19 +01:00
1 parent 4480ba7fee
commit 562c65f331
47 files changed
+295 -213

No files matched your search

+87 -53
View File
@@ -23,6 +23,7 @@ use App\Models\CompetitionGroup;
use App\Models\Element;
use App\Models\ElementGroup;
use App\Models\Event;
use App\Models\EventBookmaker;
use App\Models\Group;
use App\Models\Supervisor;
use App\Models\TxoddsMarket;
@@ -197,12 +198,13 @@ class Odds
foreach ($data as $row) {
$event_id = (int) $row['id'];
$sport_id = (int) $row->group['spid'];
$event = [
'provider_id' => (int) Nuh::$options['provider_id'],
'starttime' => Carbon::createFromDate((string) $row->time)->toDateTimeString(),
'sport_id' => (int) $row->group['spid'],
'starttime' => $row->time,
'sport_id' => $sport_id,
'home_id' => (int) $row->hteam['id'],
'away_id' => (int) $row->ateam['id'],
'country_id' => (int) $row->group['cnid'],
@@ -214,14 +216,14 @@ class Odds
$group = [
'competition_group_id' => (string) $row->group['cgid'],
'sport_id' => (int) $row->group['spid'],
'sport_id' => $sport_id,
'country_id' => (int) $row->group['cnid'],
'name' => (string) $row->group,
];
Group::updateOrCreate(['id' => (int) $row->group['id']], $group);
$compgroup = [
'sport_id' => $event['sport_id'],
'sport_id' => $sport_id,
'country_id' => $event['country_id'],
'name' => (string) $row->group['cname'],
];
@@ -230,7 +232,7 @@ class Odds
$element = [
'name' => (string) $row->hteam,
'sport_id' => (int) $sport_id,
'sport_id' => $sport_id,
'country_id' => (int) $row->group['cnid'],
];
Element::updateOrCreate(['id' => (int) $row->hteam['id']], $element);
@@ -242,7 +244,7 @@ class Odds
$element = [
'name' => (string) $row->ateam,
'sport_id' => (int) $sport_id,
'sport_id' => $sport_id,
'country_id' => (int) $row->group['cnid'],
];
Element::updateOrCreate(['id' => (int) $row->ateam['id']], $element);
@@ -256,14 +258,13 @@ class Odds
foreach ($row->bookmaker as $book) {
Nuh::$id = (int) $row['id'];
Nuh::$bookmaker_id = (int) $book['bid'];
$bookmaker_id = (int) $book['bid'];
$odds = [];
$odds['sport_id'] = (int) $event['sport_id'];
$odds['event_id'] = $event_id;
$odds['bookmaker_id'] = $bookmaker_id;
$odds['sport_id'] = $sport_id;
$odds['provider_id'] = Nuh::$options['provider_id'];
$odds['nuh_check'] = 0;
foreach ($book->offer as $offer) {
@@ -280,62 +281,95 @@ class Odds
case 'bmoid':
$odds['bmoid'] = (string) $attributeValue;
break;
case 'flag':
$odds['flag'] = (string) $attributeValue;
case 'flags':
$odds['flags'] = (string) $attributeValue;
break;
}
}
switch ($bettypeid) {
case 0:
foreach ($offer->odds->attributes() as $attributeName => $attributeValue) {
switch ($attributeName) {
case 'starting_time':
EventBookmaker::updateOrInsert([
'event_id' => $event_id,
'bookmaker_id' => $bookmaker_id,
], ['starttime' => $attributeValue]);
break;
}
}
_3Way::grap($odds, $offer);
break;
case 1:
_2Way::grap($odds, $offer);
break;
case 3:
_Points::grap($odds, $offer);
break;
case 4:
_Totals::grap($odds, $offer);
break;
// case 1:
// foreach ($offer->odds->attributes() as $attributeName => $attributeValue) {
// switch ($attributeName) {
// case 'starting_time':
// EventBookmaker::updateOrInsert([
// 'event_id' => Nuh::$id,
// 'bookmaker_id' => Nuh::$bookmaker_id,
// ], ['starttime' => $attributeValue]);
// break;
// }
// }
case 131073:
_2WayS1::grap($odds, $offer);
break;
// _2Way::grap($odds, $offer);
// break;
// case 3:
// foreach ($offer->odds->attributes() as $attributeName => $attributeValue) {
// switch ($attributeName) {
// case 'starting_time':
// EventBookmaker::updateOrInsert([
// 'event_id' => Nuh::$id,
// 'bookmaker_id' => Nuh::$bookmaker_id,
// ], ['starttime' => $attributeValue]);
// break;
// }
// }
case 65536:
_3WayHt::grap($odds, $offer);
break;
case 65540:
_TotalsHt::grap($odds, $offer);
break;
case 65539:
_PointsHt::grap($odds, $offer);
break;
// _Points::grap($odds, $offer);
// break;
// case 4:
// _Totals::grap($odds, $offer);
// break;
case 131075:
_PointsQ1::grap($odds, $offer);
break;
case 131076:
_TotalsQ1::grap($odds, $offer);
break;
// case 131073:
// _2WayS1::grap($odds, $offer);
// break;
case 5242880:
_Dc::grap($odds, $offer);
break;
case 6291457:
_Dnb::grap($odds, $offer);
break;
case 11534337:
_Ggng::grap($odds, $offer);
break;
case 7340033:
_Tq::grap($odds, $offer);
break;
// case 65536:
// _3WayHt::grap($odds, $offer);
// break;
// case 65540:
// _TotalsHt::grap($odds, $offer);
// break;
// case 65539:
// _PointsHt::grap($odds, $offer);
// break;
// case 131075:
// _PointsQ1::grap($odds, $offer);
// break;
// case 131076:
// _TotalsQ1::grap($odds, $offer);
// break;
// case 5242880:
// _Dc::grap($odds, $offer);
// break;
// case 6291457:
// _Dnb::grap($odds, $offer);
// break;
// case 11534337:
// _Ggng::grap($odds, $offer);
// break;
// case 7340033:
// _Tq::grap($odds, $offer);
// break;
default:
Notice::note('ERROR Bettype ID not set: '.$bettypeid, 'r');
Notice::note('switch bettype ID not found: '.$bettypeid, 'r');
break;
}
}
@@ -2,7 +2,6 @@
namespace App\Console\Commands\Grapper\TxOdds\Odds;
use App\Console\Commands\Nuh;
use App\Utilities\Margin;
use Illuminate\Support\Facades\DB;
@@ -13,14 +12,16 @@ class _2Way
foreach ($offer as $value) {
$odds['h2w'] = (float) $value->o1;
$odds['a2w'] = (float) $value->o3;
$odds['starttime'] = (string) $value['starttime'];
}
$odds['margin'] = (float) Margin::calculate([$odds['h2w'], $odds['a2w']], 1);
$odds['updated_at'] = now();
DB::table('odds_2ways')->upsert(
$odds,
DB::table('odds_2ways')->updateOrInsert([
'event_id' => Nuh::$id,
'bookmaker_id' => Nuh::$bookmaker_id,
], $odds);
['event_id', 'bookmaker_id'],
['h2w', 'a2w', 'margin', 'flags', 'updated_at']
);
}
}
@@ -2,7 +2,6 @@
namespace App\Console\Commands\Grapper\TxOdds\Odds;
use App\Console\Commands\Nuh;
use App\Utilities\Margin;
use Illuminate\Support\Facades\DB;
@@ -16,10 +15,13 @@ class _2WayS1
}
$odds['margin'] = (float) Margin::calculate([$odds['h2w'], $odds['a2w']], 1);
$odds['updated_at'] = now();
DB::table('odds_2ways_s1')->upsert(
$odds,
DB::table('odds_2ways_s1')->updateOrInsert([
'event_id' => Nuh::$id,
'bookmaker_id' => Nuh::$bookmaker_id,
], $odds);
['event_id', 'bookmaker_id'],
['h2w', 'a2w', 'margin', 'flags', 'updated_at']
);
}
}
@@ -2,9 +2,8 @@
namespace App\Console\Commands\Grapper\TxOdds\Odds;
use App\Console\Commands\Nuh;
use App\Models\Odds3way;
use App\Utilities\Margin;
use Illuminate\Support\Facades\DB;
class _3Way
{
@@ -14,14 +13,18 @@ class _3Way
$odds['h3w'] = (float) $value->o1;
$odds['d3w'] = (float) $value->o2;
$odds['a3w'] = (float) $value->o3;
$odds['starttime'] = (string) $value['starttime'];
$odds['a3w'] = (float) 1.1;
}
$odds['margin'] = (float) Margin::calculate([$odds['h3w'], $odds['d3w'], $odds['a3w']], 1);
$odds['updated_at'] = now();
DB::table('odds_3ways')->updateOrInsert([
'event_id' => Nuh::$id,
'bookmaker_id' => Nuh::$bookmaker_id,
], $odds);
$res = Odds3way::updateOrCreate(
['event_id' => $odds['event_id'], 'bookmaker_id' => $odds['bookmaker_id']],
$odds,
);
if ($res->wasChanged('h3w', 'd3w', 'h3w')) {
$res = Odds3way::updateOrCreate(
['event_id' => $odds['event_id'], 'bookmaker_id' => $odds['bookmaker_id']],
['oddchange_at' => now()],
);
}
}
}
@@ -2,7 +2,6 @@
namespace App\Console\Commands\Grapper\TxOdds\Odds;
use App\Console\Commands\Nuh;
use App\Utilities\Margin;
use Illuminate\Support\Facades\DB;
@@ -17,10 +16,13 @@ class _3WayHt
}
$odds['margin'] = (float) Margin::calculate([$odds['h3w'], $odds['d3w'], $odds['a3w']], 1);
$odds['updated_at'] = now();
DB::table('odds_3ways_ht')->upsert(
$odds,
DB::table('odds_3ways_ht')->updateOrInsert([
'event_id' => Nuh::$id,
'bookmaker_id' => Nuh::$bookmaker_id,
], $odds);
['event_id', 'bookmaker_id'],
['h3w', 'd3w', 'a3w', 'margin', 'flags', 'updated_at']
);
}
}
@@ -2,7 +2,6 @@
namespace App\Console\Commands\Grapper\TxOdds\Odds;
use App\Console\Commands\Nuh;
use App\Utilities\Margin;
use Illuminate\Support\Facades\DB;
@@ -17,10 +16,13 @@ class _Dc
}
$odds['margin'] = (float) Margin::calculate([$odds['dc1x'], $odds['dc12'], $odds['dcx2']], 1);
$odds['updated_at'] = now();
DB::table('odds_dc')->upsert(
$odds,
DB::table('odds_dc')->updateOrInsert([
'event_id' => Nuh::$id,
'bookmaker_id' => Nuh::$bookmaker_id,
], $odds);
['event_id', 'bookmaker_id'],
['dc1x', 'dc12', 'dcx2', 'margin', 'flags', 'updated_at']
);
}
}
@@ -2,7 +2,6 @@
namespace App\Console\Commands\Grapper\TxOdds\Odds;
use App\Console\Commands\Nuh;
use App\Utilities\Margin;
use Illuminate\Support\Facades\DB;
@@ -16,10 +15,13 @@ class _Dnb
}
$odds['margin'] = (float) Margin::calculate([$odds['dnb1'], $odds['dnb2']], 1);
$odds['updated_at'] = now();
DB::table('odds_dnb')->upsert(
$odds,
DB::table('odds_dnb')->updateOrInsert([
'event_id' => Nuh::$id,
'bookmaker_id' => Nuh::$bookmaker_id,
], $odds);
['event_id', 'bookmaker_id'],
['dnb1', 'dnb2', 'margin', 'flags', 'updated_at']
);
}
}
@@ -2,7 +2,6 @@
namespace App\Console\Commands\Grapper\TxOdds\Odds;
use App\Console\Commands\Nuh;
use App\Utilities\Margin;
use Illuminate\Support\Facades\DB;
@@ -16,10 +15,13 @@ class _Ggng
}
$odds['margin'] = (float) Margin::calculate([$odds['gg'], $odds['ng']], 1);
$odds['updated_at'] = now();
DB::table('odds_ggng')->upsert(
$odds,
DB::table('odds_ggng')->updateOrInsert([
'event_id' => Nuh::$id,
'bookmaker_id' => Nuh::$bookmaker_id,
], $odds);
['event_id', 'bookmaker_id'],
['gg', 'ng', 'margin', 'flags', 'updated_at']
);
}
}
@@ -3,7 +3,6 @@
namespace App\Console\Commands\Grapper\TxOdds\Odds;
use App\Console\Commands\Grapper\TxOdds\Odds\Tools\ActiveSpread;
use App\Console\Commands\Nuh;
use App\Utilities\Margin;
use Illuminate\Support\Facades\DB;
@@ -25,12 +24,15 @@ class _Points
$odds['difference'] = abs(1 / $odds['home'] - 1 / $odds['away']);
$odds['updated_at'] = now();
ActiveSpread::collect($odds, 'odds_points');
DB::table('odds_points')->upsert(
$odds,
DB::table('odds_points')->updateOrInsert([
'event_id' => Nuh::$id,
'bookmaker_id' => Nuh::$bookmaker_id,
'handicap' => $odds['handicap'],
], $odds);
['event_id', 'bookmaker_id', 'handicap'],
['home', 'away', 'difference', 'margin', 'flags', 'updated_at']
);
ActiveSpread::collect($odds, 'odds_points');
}
}
@@ -3,7 +3,6 @@
namespace App\Console\Commands\Grapper\TxOdds\Odds;
use App\Console\Commands\Grapper\TxOdds\Odds\Tools\ActiveSpread;
use App\Console\Commands\Nuh;
use App\Utilities\Margin;
use Illuminate\Support\Facades\DB;
@@ -25,12 +24,15 @@ class _PointsHt
$odds['difference'] = abs(1 / $odds['home'] - 1 / $odds['away']);
$odds['updated_at'] = now();
ActiveSpread::collect($odds, 'odds_points_ht');
DB::table('odds_points_ht')->upsert(
$odds,
DB::table('odds_points_ht')->updateOrInsert([
'event_id' => Nuh::$id,
'bookmaker_id' => Nuh::$bookmaker_id,
'handicap' => $odds['handicap'],
], $odds);
['event_id', 'bookmaker_id', 'handicap'],
['home', 'away', 'difference', 'margin', 'flags', 'updated_at']
);
ActiveSpread::collect($odds, 'odds_points_ht');
}
}
@@ -3,7 +3,6 @@
namespace App\Console\Commands\Grapper\TxOdds\Odds;
use App\Console\Commands\Grapper\TxOdds\Odds\Tools\ActiveSpread;
use App\Console\Commands\Nuh;
use App\Utilities\Margin;
use Illuminate\Support\Facades\DB;
@@ -25,12 +24,15 @@ class _PointsQ1
$odds['difference'] = abs(1 / $odds['home'] - 1 / $odds['away']);
$odds['updated_at'] = now();
ActiveSpread::collect($odds, 'odds_points_q1');
DB::table('odds_points_q1')->upsert(
$odds,
DB::table('odds_points_q1')->updateOrInsert([
'event_id' => Nuh::$id,
'bookmaker_id' => Nuh::$bookmaker_id,
'handicap' => $odds['handicap'],
], $odds);
['event_id', 'bookmaker_id', 'handicap'],
['home', 'away', 'difference', 'margin', 'flags', 'updated_at']
);
ActiveSpread::collect($odds, 'odds_points_q1');
}
}
@@ -3,7 +3,6 @@
namespace App\Console\Commands\Grapper\TxOdds\Odds;
use App\Console\Commands\Grapper\TxOdds\Odds\Tools\ActiveSpread;
use App\Console\Commands\Nuh;
use App\Utilities\Margin;
use Illuminate\Support\Facades\DB;
@@ -31,12 +30,15 @@ class _Totals
$odds['difference'] = abs(1 / $odds['over'] - 1 / $odds['under']);
$odds['updated_at'] = now();
ActiveSpread::collect($odds, 'odds_totals');
DB::table('odds_totals')->upsert(
$odds,
DB::table('odds_totals')->updateOrInsert([
'event_id' => Nuh::$id,
'bookmaker_id' => Nuh::$bookmaker_id,
'total' => $odds['total'],
], $odds);
['event_id', 'bookmaker_id', 'total'],
['over', 'under', 'difference', 'margin', 'flags', 'updated_at']
);
ActiveSpread::collect($odds, 'odds_totals');
}
}
@@ -3,7 +3,6 @@
namespace App\Console\Commands\Grapper\TxOdds\Odds;
use App\Console\Commands\Grapper\TxOdds\Odds\Tools\ActiveSpread;
use App\Console\Commands\Nuh;
use App\Utilities\Margin;
use Illuminate\Support\Facades\DB;
@@ -17,20 +16,29 @@ class _TotalsHt
$odds['total'] = (float) $value->o3;
}
if (fmod((float) $odds['total'], 1) != 0.5) {
return;
if ($odds['sport_id'] == 1) {
if ((float) $odds['total'] != 2.5) {
return;
}
} else {
if (fmod((float) $odds['total'], 1) != 0.5) {
return;
}
}
$odds['margin'] = (float) Margin::calculate([$odds['over'], $odds['under']], 1);
$odds['difference'] = abs(1 / $odds['over'] - 1 / $odds['under']);
$odds['updated_at'] = now();
ActiveSpread::collect($odds, 'odds_totals_ht');
DB::table('odds_totals_ht')->upsert(
$odds,
DB::table('odds_totals_ht')->updateOrInsert([
'event_id' => Nuh::$id,
'bookmaker_id' => Nuh::$bookmaker_id,
'total' => $odds['total'],
], $odds);
['event_id', 'bookmaker_id', 'total'],
['over', 'under', 'difference', 'margin', 'flags', 'updated_at']
);
ActiveSpread::collect($odds, 'odds_totals_ht');
}
}
@@ -3,7 +3,6 @@
namespace App\Console\Commands\Grapper\TxOdds\Odds;
use App\Console\Commands\Grapper\TxOdds\Odds\Tools\ActiveSpread;
use App\Console\Commands\Nuh;
use App\Utilities\Margin;
use Illuminate\Support\Facades\DB;
@@ -17,20 +16,29 @@ class _TotalsQ1
$odds['total'] = (float) $value->o3;
}
if (fmod((float) $odds['total'], 1) != 0.5) {
return;
if ($odds['sport_id'] == 1) {
if ((float) $odds['total'] != 2.5) {
return;
}
} else {
if (fmod((float) $odds['total'], 1) != 0.5) {
return;
}
}
$odds['margin'] = (float) Margin::calculate([$odds['over'], $odds['under']], 1);
$odds['difference'] = abs(1 / $odds['over'] - 1 / $odds['under']);
$odds['updated_at'] = now();
ActiveSpread::collect($odds, 'odds_totals_q1');
DB::table('odds_totals_q1')->upsert(
$odds,
DB::table('odds_totals_q1')->updateOrInsert([
'event_id' => Nuh::$id,
'bookmaker_id' => Nuh::$bookmaker_id,
'total' => $odds['total'],
], $odds);
['event_id', 'bookmaker_id', 'total'],
['over', 'under', 'difference', 'margin', 'flags', 'updated_at']
);
ActiveSpread::collect($odds, 'odds_totals_q1');
}
}
@@ -2,7 +2,6 @@
namespace App\Console\Commands\Grapper\TxOdds\Odds;
use App\Console\Commands\Nuh;
use App\Utilities\Margin;
use Illuminate\Support\Facades\DB;
@@ -16,10 +15,13 @@ class _Tq
}
$odds['margin'] = (float) Margin::calculate([$odds['htq'], $odds['atq']], 1);
$odds['updated_at'] = now();
DB::table('odds_tq')->upsert(
$odds,
DB::table('odds_tq')->updateOrInsert([
'event_id' => Nuh::$id,
'bookmaker_id' => Nuh::$bookmaker_id,
], $odds);
['event_id', 'bookmaker_id'],
['htq', 'atq', 'margin', 'flags', 'updated_at']
);
}
}
+15 -1
View File
@@ -12,7 +12,21 @@ class EventBookmaker extends Model
'bmoid',
'in_feed',
'send_status',
'bkm_starttime',
'starttime',
'bkm_2w',
'bkm_2ws1',
'bkm_3w',
'bkm_3wht',
'bkm_dc',
'bkm_dbn',
'bkm_ggng',
'bkm_po',
'bkm_poht',
'bkm_poq1',
'bkm_to',
'bkm_toht',
'bkm_toq1',
'bkm_tq',
];
public function event()
+2 -4
View File
@@ -19,11 +19,9 @@ class Odds2way extends Model
'h2w',
'a2w',
'margin',
'flag',
'flags',
'nuh_check',
'add_time',
'updated_at',
'starttime',
'oddchange_at',
];
public function sport()
+2 -3
View File
@@ -19,10 +19,9 @@ class Odds2wayS1 extends Model
'h2w',
'a2w',
'margin',
'flag',
'flags',
'nuh_check',
'add_time',
'updated_at',
'oddchange_at',
];
public function sport()
+2 -4
View File
@@ -20,11 +20,9 @@ class Odds3way extends Model
'd3w',
'a3w',
'margin',
'flag',
'flags',
'nuh_check',
'starttime',
'add_time',
'updated_at',
'oddchange_at',
];
public function event()
+2 -3
View File
@@ -20,10 +20,9 @@ class Odds3wayHt extends Model
'd3w',
'a3w',
'margin',
'flag',
'flags',
'nuh_check',
'add_time',
'updated_at',
'oddchange_at',
];
public function event()
+2 -3
View File
@@ -20,10 +20,9 @@ class OddsDc extends Model
'dc12',
'dcx2',
'margin',
'flag',
'flags',
'nuh_check',
'add_time',
'updated_at',
'oddchange_at',
];
public function sport()
+2 -3
View File
@@ -19,10 +19,9 @@ class OddsDnb extends Model
'dnb1',
'dnb2',
'margin',
'flag',
'flags',
'nuh_check',
'add_time',
'updated_at',
'oddchange_at',
];
public function sport()
+2 -3
View File
@@ -19,10 +19,9 @@ class OddsGgng extends Model
'gg',
'ng',
'margin',
'flag',
'flags',
'nuh_check',
'add_time',
'updated_at',
'oddchange_at',
];
public function sport()
+2 -4
View File
@@ -22,11 +22,9 @@ class OddsPoint extends Model
'margin',
'difference',
'active_spread',
'flag',
'flags',
'nuh_check',
'add_time',
'updated_at',
'starttime',
'oddchange_at',
];
public function sport()
+2 -3
View File
@@ -22,10 +22,9 @@ class OddsPointHt extends Model
'margin',
'difference',
'active_spread',
'flag',
'flags',
'nuh_check',
'add_time',
'updated_at',
'oddchange_at',
];
public function sport()
+2 -3
View File
@@ -22,10 +22,9 @@ class OddsPointQ1 extends Model
'margin',
'difference',
'active_spread',
'flag',
'flags',
'nuh_check',
'add_time',
'updated_at',
'oddchange_at',
];
public function sport()
+2 -3
View File
@@ -22,10 +22,9 @@ class OddsTotal extends Model
'margin',
'difference',
'active_spread',
'flag',
'flags',
'nuh_check',
'add_time',
'updated_at',
'oddchange_at',
];
public function sport()
+2 -3
View File
@@ -22,10 +22,9 @@ class OddsTotalHt extends Model
'margin',
'difference',
'active_spread',
'flag',
'flags',
'nuh_check',
'add_time',
'updated_at',
'oddchange_at',
];
public function sport()
+2 -3
View File
@@ -22,10 +22,9 @@ class OddsTotalQ1 extends Model
'difference',
'active_spread',
'margin',
'flag',
'flags',
'nuh_check',
'add_time',
'updated_at',
'oddchange_at',
];
public function sport()
+2 -3
View File
@@ -19,10 +19,9 @@ class OddsTq extends Model
'htq',
'atq',
'margin',
'flag',
'flags',
'nuh_check',
'add_time',
'updated_at',
'oddchange_at',
];
public function sport()
Generated
+3 -3
View File
@@ -12814,12 +12814,12 @@
],
"aliases": [],
"minimum-stability": "stable",
"stability-flags": [],
"stability-flags": {},
"prefer-stable": true,
"prefer-lowest": false,
"platform": {
"php": "^8.3"
},
"platform-dev": [],
"plugin-api-version": "2.6.0"
"platform-dev": {},
"plugin-api-version": "2.9.0"
}
@@ -15,11 +15,25 @@ return new class extends Migration
$table->id();
$table->foreignId('event_id')->index()->constrained()->cascadeOnDelete()->references('id')->on('events');
$table->integer('bookmaker_id')->index()->references('id')->on('bookmakers');
$table->timestamp('bkm_starttime')->nullable();
$table->timestamp('starttime')->nullable();
$table->string('bmoid')->nullable();
$table->boolean('in_feed')->default(0);
$table->boolean('send_status')->default(0);
$table->boolean('has_to_qualify')->index()->default(0);
$table->integer('bkm_2w')->nullable()->default(0);
$table->integer('bkm_2ws1')->nullable()->default(0);
$table->integer('bkm_3w')->nullable()->default(0);
$table->integer('bkm_3wht')->nullable()->default(0);
$table->integer('bkm_dc')->nullable()->default(0);
$table->integer('bkm_dbn')->nullable()->default(0);
$table->integer('bkm_ggng')->nullable()->default(0);
$table->integer('bkm_po')->nullable()->default(0);
$table->integer('bkm_poht')->nullable()->default(0);
$table->integer('bkm_poq1')->nullable()->default(0);
$table->integer('bkm_to')->nullable()->default(0);
$table->integer('bkm_toht')->nullable()->default(0);
$table->integer('bkm_toq1')->nullable()->default(0);
$table->integer('bkm_tq')->nullable()->default(0);
$table->timestamps();
});
@@ -23,7 +23,7 @@ return new class extends Migration
$table->decimal('d3w', 7, 3)->default(0);
$table->decimal('a3w', 7, 3)->default(0);
$table->decimal('margin', 5, 1)->default(0);
$table->boolean('flag')->default(0);
$table->boolean('flags')->default(0);
$table->boolean('nuh_check')->default(0);
$table->timestamps();
});
@@ -23,9 +23,9 @@ return new class extends Migration
$table->decimal('d3w', 7, 3)->default(0);
$table->decimal('a3w', 7, 3)->default(0);
$table->decimal('margin', 5, 1)->default(0);
$table->boolean('flag')->default(0);
$table->boolean('flags')->default(0);
$table->boolean('nuh_check')->default(0);
$table->timestamp('starttime')->nullable();
$table->timestamp('oddchange_at');
$table->timestamps();
});
}
@@ -22,7 +22,7 @@ return new class extends Migration
$table->decimal('h2w', 7, 3)->default(0);
$table->decimal('a2w', 7, 3)->default(0);
$table->decimal('margin', 5, 1)->default(0);
$table->boolean('flag')->default(0);
$table->boolean('flags')->default(0);
$table->boolean('nuh_check')->default(0);
$table->timestamps();
});
@@ -22,9 +22,8 @@ return new class extends Migration
$table->decimal('h2w', 7, 3)->default(0);
$table->decimal('a2w', 7, 3)->default(0);
$table->decimal('margin', 5, 1)->default(0);
$table->boolean('flag')->default(0);
$table->boolean('flags')->default(0);
$table->boolean('nuh_check')->default(0);
$table->timestamp('starttime')->nullable();
$table->timestamps();
});
}
@@ -23,7 +23,7 @@ return new class extends Migration
$table->decimal('dc12', 7, 3)->default(0);
$table->decimal('dcx2', 7, 3)->default(0);
$table->decimal('margin', 5, 1)->default(0);
$table->boolean('flag')->default(0);
$table->boolean('flags')->default(0);
$table->boolean('nuh_check')->default(0);
$table->timestamps();
});
@@ -22,7 +22,7 @@ return new class extends Migration
$table->decimal('dnb1', 7, 3)->default(0);
$table->decimal('dnb2', 7, 3)->default(0);
$table->decimal('margin', 5, 1)->default(0);
$table->boolean('flag')->default(0);
$table->boolean('flags')->default(0);
$table->boolean('nuh_check')->default(0);
$table->timestamps();
});
@@ -22,7 +22,7 @@ return new class extends Migration
$table->decimal('gg', 7, 3)->default(0);
$table->decimal('ng', 7, 3)->default(0);
$table->decimal('margin', 5, 1)->default(0);
$table->boolean('flag')->default(0);
$table->boolean('flags')->default(0);
$table->boolean('nuh_check')->default(0);
$table->timestamps();
});
@@ -22,7 +22,7 @@ return new class extends Migration
$table->decimal('htq', 7, 3)->default(0);
$table->decimal('atq', 7, 3)->default(0);
$table->decimal('margin', 5, 1)->default(0);
$table->boolean('flag')->default(0);
$table->boolean('flags')->default(0);
$table->boolean('nuh_check')->default(0);
$table->timestamps();
});
@@ -25,9 +25,8 @@ return new class extends Migration
$table->decimal('margin', 5, 1)->default(0);
$table->decimal('difference', 5, 4)->default(0);
$table->boolean('active_spread')->default(0);
$table->boolean('flag')->default(0);
$table->boolean('flags')->default(0);
$table->boolean('nuh_check')->default(0);
$table->timestamp('starttime')->nullable();
$table->timestamps();
});
}
@@ -25,9 +25,8 @@ return new class extends Migration
$table->decimal('margin', 5, 1)->default(0);
$table->decimal('difference', 5, 4)->default(0);
$table->boolean('active_spread')->default(0);
$table->boolean('flag')->default(0);
$table->boolean('flags')->default(0);
$table->boolean('nuh_check')->default(0);
$table->timestamp('starttime')->nullable();
$table->timestamps();
});
}
@@ -25,7 +25,7 @@ return new class extends Migration
$table->decimal('margin', 5, 1)->default(0);
$table->decimal('difference', 5, 4)->default(0);
$table->boolean('active_spread')->default(0);
$table->boolean('flag')->default(0);
$table->boolean('flags')->default(0);
$table->boolean('nuh_check')->default(0);
$table->timestamps();
});
@@ -25,7 +25,7 @@ return new class extends Migration
$table->decimal('margin', 5, 1)->default(0);
$table->decimal('difference', 5, 4)->default(0);
$table->boolean('active_spread')->default(0);
$table->boolean('flag')->default(0);
$table->boolean('flags')->default(0);
$table->boolean('nuh_check')->default(0);
$table->timestamps();
});
@@ -24,7 +24,7 @@ return new class extends Migration
$table->decimal('total', 5, 2)->default(0);
$table->decimal('margin', 5, 1)->default(0);
$table->decimal('difference', 5, 4)->default(0);
$table->boolean('flag')->default(0);
$table->boolean('flags')->default(0);
$table->boolean('active_spread')->default(0);
$table->boolean('nuh_check')->default(0);
$table->timestamps();
@@ -23,7 +23,7 @@ return new class extends Migration
$table->decimal('under', 7, 3)->default(0);
$table->decimal('total', 5, 2)->default(0);
$table->decimal('margin', 5, 1)->default(0);
$table->boolean('flag')->default(0);
$table->boolean('flags')->default(0);
$table->decimal('difference', 5, 4)->default(0);
$table->boolean('active_spread')->default(0);
$table->boolean('nuh_check')->default(0);
@@ -8,7 +8,7 @@ var Ms=[],Xh=[];(()=>{let O="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,
`,r=O.state.doc.line(r.number+(t?1:-1)),n=O.bidiSpans(r),l=O.visualLineSide(r,!t)}if(o){if(!o(c))return a}else{if(!i)return l;o=i(c)}a=l}}function VP(O,e,t){let i=O.state.charCategorizer(e),r=i(t);return n=>{let s=i(n);return r==ee.Space&&(r=s),r==s}}function qP(O,e,t,i){let r=e.head,n=t?1:-1;if(r==(t?O.state.doc.length:0))return S.cursor(r,e.assoc);let s=e.goalColumn,a,o=O.contentDOM.getBoundingClientRect(),l=O.coordsAtPos(r,e.assoc||-1),c=O.documentTop;if(l)s==null&&(s=l.left-o.left),a=n<0?l.top:l.bottom;else{let u=O.viewState.lineBlockAt(r);s==null&&(s=Math.min(o.right-o.left,O.defaultCharacterWidth*(r-u.from))),a=(n<0?u.top:u.bottom)+c}let h=o.left+s,f=i??O.viewState.heightOracle.textHeight>>1;for(let u=0;;u+=10){let Q=a+(f+u)*n,$=Wa(O,{x:h,y:Q},!1,n);return S.cursor($.pos,$.assoc,void 0,s)}}function Ei(O,e,t){for(;;){let i=0;for(let r of O)r.between(e-1,e+1,(n,s,a)=>{if(e>n&&e<s){let o=i||t||(e-n<s-e?-1:1);e=o<0?n:s,i=o}});if(!i)return e}}function ad(O,e){let t=null;for(let i=0;i<e.ranges.length;i++){let r=e.ranges[i],n=null;if(r.empty){let s=Ei(O,r.from,0);s!=r.from&&(n=S.cursor(s,-1))}else{let s=Ei(O,r.from,-1),a=Ei(O,r.to,1);(s!=r.from||a!=r.to)&&(n=S.range(r.from==r.anchor?s:a,r.from==r.head?s:a))}n&&(t||(t=e.ranges.slice()),t[i]=n)}return t?S.create(t,e.mainIndex):e}function ua(O,e,t){let i=Ei(O.state.facet(Ji).map(r=>r(O)),t.from,e.head>t.from?-1:1);return i==t.from?t:S.cursor(i,i<t.from?1:-1)}var rt=class{constructor(e,t){this.pos=e,this.assoc=t}};function Wa(O,e,t,i){let r=O.contentDOM.getBoundingClientRect(),n=r.top+O.viewState.paddingTop,{x:s,y:a}=e,o=a-n,l;for(;;){if(o<0)return new rt(0,1);if(o>O.viewState.docHeight)return new rt(O.state.doc.length,-1);if(l=O.elementAtHeight(o),i==null)break;if(l.type==Te.Text){let f=O.docView.coordsAt(i<0?l.from:l.to,i);if(f&&(i<0?f.top<=o+n:f.bottom>=o+n))break}let h=O.viewState.heightOracle.textHeight/2;o=i>0?l.bottom+h:l.top-h}if(O.viewport.from>=l.to||O.viewport.to<=l.from){if(t)return null;if(l.type==Te.Text){let h=_P(O,r,l,s,a);return new rt(h,h==l.from?1:-1)}}if(l.type!=Te.Text)return o<(l.top+l.bottom)/2?new rt(l.from,1):new rt(l.to,-1);let c=O.docView.lineAt(l.from,2);return(!c||c.length!=l.length)&&(c=O.docView.lineAt(l.from,-2)),od(O,c,l.from,s,a)}function od(O,e,t,i,r){let n=-1,s=null,a=1e9,o=1e9,l=r,c=r,h=(f,u)=>{for(let Q=0;Q<f.length;Q++){let $=f[Q];if($.top==$.bottom)continue;let p=$.left>i?$.left-i:$.right<i?i-$.right:0,m=$.top>r?$.top-r:$.bottom<r?r-$.bottom:0;$.top<=c&&$.bottom>=l&&(l=Math.min($.top,l),c=Math.max($.bottom,c),m=0),(n<0||(m-o||p-a)<0)&&(n>=0&&o&&a<p&&s.top<=c-2&&s.bottom>=l+2?o=0:(n=u,a=p,o=m,s=$))}};if(e.isText()){for(let u=0;u<e.length;){let Q=fe(e.text,u);if(h(Ni(e.dom,u,Q).getClientRects(),u),!a&&!o)break;u=Q}return i>(s.left+s.right)/2==(rf(O,n+t)==H.LTR)?new rt(t+fe(e.text,n),-1):new rt(t+n,1)}else{if(!e.length)return new rt(t,1);for(let $=0;$<e.children.length;$++){let p=e.children[$];if(p.flags&48)continue;let m=(p.dom.nodeType==1?p.dom:Ni(p.dom,0,p.length)).getClientRects();if(h(m,$),!a&&!o)break}let f=e.children[n],u=e.posBefore(f,t);return f.isComposite()||f.isText()?od(O,f,u,Math.max(s.left,Math.min(s.right,i)),r):i>(s.left+s.right)/2==(rf(O,n+t)==H.LTR)?new rt(u+f.length,-1):new rt(u,1)}}function rf(O,e){let t=O.state.doc.lineAt(e);return O.bidiSpans(t)[ct.find(O.bidiSpans(t),e-t.from,-1,1)].dir}var qi="\uFFFF",ja=class{constructor(e,t){this.points=e,this.view=t,this.text="",this.lineSeparator=t.state.facet(I.lineSeparator)}append(e){this.text+=e}lineBreak(){this.text+=qi}readRange(e,t){if(!e)return this;let i=e.parentNode;for(let r=e;;){this.findPointBefore(i,r);let n=this.text.length;this.readNode(r);let s=de.get(r),a=r.nextSibling;if(a==t){s?.breakAfter&&!a&&i!=this.view.contentDOM&&this.lineBreak();break}let o=de.get(a);(s&&o?s.breakAfter:(s?s.breakAfter:mn(r))||mn(a)&&(r.nodeName!="BR"||s?.isWidget())&&this.text.length>n)&&!UP(a,t)&&this.lineBreak(),r=a}return this.findPointBefore(i,t),this}readTextNode(e){let t=e.nodeValue;for(let i of this.points)i.node==e&&(i.pos=this.text.length+Math.min(i.offset,t.length));for(let i=0,r=this.lineSeparator?null:/\r\n?|\n/g;;){let n=-1,s=1,a;if(this.lineSeparator?(n=t.indexOf(this.lineSeparator,i),s=this.lineSeparator.length):(a=r.exec(t))&&(n=a.index,s=a[0].length),this.append(t.slice(i,n<0?t.length:n)),n<0)break;if(this.lineBreak(),s>1)for(let o of this.points)o.node==e&&o.pos>this.text.length&&(o.pos-=s-1);i=n+s}}readNode(e){let t=de.get(e),i=t&&t.overrideDOMText;if(i!=null){this.findPointInside(e,i.length);for(let r=i.iter();!r.next().done;)r.lineBreak?this.lineBreak():this.append(r.value)}else e.nodeType==3?this.readTextNode(e):e.nodeName=="BR"?e.nextSibling&&this.lineBreak():e.nodeType==1&&this.readRange(e.firstChild,null)}findPointBefore(e,t){for(let i of this.points)i.node==e&&e.childNodes[i.offset]==t&&(i.pos=this.text.length)}findPointInside(e,t){for(let i of this.points)(e.nodeType==3?i.node==e:e.contains(i.node))&&(i.pos=this.text.length+(zP(e,i.node,i.offs Line truncated
`&&O.lineWrapping&&(i&&(i=S.single(i.main.anchor-1,i.main.head-1)),t={from:r.from,to:r.to,insert:E.of([" "])}),t)return So(O,t,i,n);if(i&&!i.main.eq(r)){let s=!1,a="select";return O.inputState.lastSelectionTime>Date.now()-50&&(O.inputState.lastSelectionOrigin=="select"&&(s=!0),a=O.inputState.lastSelectionOrigin,a=="select.pointer"&&(i=ad(O.state.facet(Ji).map(o=>o(O)),i))),O.dispatch({selection:i,scrollIntoView:s,userEvent:a}),!0}else return!1}function So(O,e,t,i=-1){if(v.ios&&O.inputState.flushIOSKey(e))return!0;let r=O.state.selection.main;if(v.android&&(e.to==r.to&&(e.from==r.from||e.from==r.from-1&&O.state.sliceDoc(e.from,r.from)==" ")&&e.insert.length==1&&e.insert.lines==2&&ii(O.contentDOM,"Enter",13)||(e.from==r.from-1&&e.to==r.to&&e.insert.length==0||i==8&&e.insert.length<e.to-e.from&&e.to>r.head)&&ii(O.contentDOM,"Backspace",8)||e.from==r.from&&e.to==r.to+1&&e.insert.length==0&&ii(O.contentDOM,"Delete",46)))return!0;let n=e.insert.toString();O.inputState.composing>=0&&O.inputState.composing++;let s,a=()=>s||(s=WP(O,e,t));return O.state.facet(Bf).some(o=>o(O,e.from,e.to,n,a))||O.dispatch(a()),!0}function WP(O,e,t){let i,r=O.state,n=r.selection.main,s=-1;if(e.from==e.to&&e.from<n.from||e.from>n.to){let o=e.from<n.from?-1:1,l=o<0?n.from:n.to,c=Ei(r.facet(Ji).map(h=>h(O)),l,o);e.from==c&&(s=c)}if(s>-1)i={changes:e,selection:S.cursor(e.from+e.insert.length,-1)};else if(e.from>=n.from&&e.to<=n.to&&e.to-e.from>=(n.to-n.from)/3&&(!t||t.main.empty&&t.main.from==e.from+e.insert.length)&&O.inputState.composing<0){let o=n.from<e.from?r.sliceDoc(n.from,e.from):"",l=n.to>e.to?r.sliceDoc(e.to,n.to):"";i=r.replaceSelection(O.state.toText(o+e.insert.sliceString(0,void 0,O.state.lineBreak)+l))}else{let o=r.changes(e),l=t&&t.main.to<=o.newLength?t.main:void 0;if(r.selection.ranges.length>1&&(O.inputState.composing>=0||O.inputState.compositionPendingChange)&&e.to<=n.to+10&&e.to>=n.to-10){let c=O.state.sliceDoc(e.from,e.to),h,f=t&&sd(O,t.main.head);if(f){let Q=e.insert.length-(e.to-e.from);h={from:f.from,to:f.to-Q}}else h=O.state.doc.lineAt(n.head);let u=n.to-e.to;i=r.changeByRange(Q=>{if(Q.from==n.from&&Q.to==n.to)return{changes:o,range:l||Q.map(o)};let $=Q.to-u,p=$-c.length;if(O.state.sliceDoc(p,$)!=c||$>=h.from&&p<=h.to)return{range:Q};let m=r.changes({from:p,to:$,insert:e.insert}),g=Q.to-n.to;return{changes:m,range:l?S.range(Math.max(0,l.anchor+g),Math.max(0,l.head+g)):Q.map(m)}})}else i={changes:o,selection:l&&r.selection.replaceRange(l)}}let a="input.type";return(O.composing||O.inputState.compositionPendingChange&&O.inputState.compositionEndedAt>Date.now()-50)&&(O.inputState.compositionPendingChange=!1,a+=".compose",O.inputState.compositionFirstChange&&(a+=".start",O.inputState.compositionFirstChange=!1)),r.update(i,{userEvent:a,scrollIntoView:!0})}function hd(O,e,t,i){let r=Math.min(O.length,e.length),n=0;for(;n<r&&O.charCodeAt(n)==e.charCodeAt(n);)n++;if(n==r&&O.length==e.length)return null;let s=O.length,a=e.length;for(;s>0&&a>0&&O.charCodeAt(s-1)==e.charCodeAt(a-1);)s--,a--;if(i=="end"){let o=Math.max(0,n-Math.min(s,a));t-=s+o-n}if(s<n&&O.length<e.length){let o=t<=n&&t>=s?n-t:0;n-=o,a=n+(a-s),s=n}else if(a<n){let o=t<=n&&t>=a?n-t:0;n-=o,s=n+(s-a),a=n}return{from:n,toA:s,toB:a}}function jP(O){let e=[];if(O.root.activeElement!=O.contentDOM)return e;let{anchorNode:t,anchorOffset:i,focusNode:r,focusOffset:n}=O.observer.selectionRange;return t&&(e.push(new Tn(t,i)),(r!=t||n!=i)&&e.push(new Tn(r,n))),e}function CP(O,e){if(O.length==0)return null;let t=O[0].pos,i=O.length==2?O[1].pos:t;return t>-1&&i>-1?S.single(t+e,i+e):null}var Ga=class{setSelectionOrigin(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}constructor(e){this.view=e,this.lastKeyCode=0,this.lastKeyTime=0,this.lastTouchTime=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.pendingIOSKey=void 0,this.tabFocusMode=-1,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastContextMenu=0,this.scrollHandlers=[],this.handlers=Object.create(null),this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.compositionPendingKey=!1,this.compositionPendingChange=!1,this.insertingText="",this.insertingTextAt=0,this.mouseSelection=null,this.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=e.hasFocus,v.safari&&e.contentDOM.addEventListener("input",()=>null),v.gecko&&eS(e.contentDOM.ownerDocument)}handleEvent(e){!IP(this.view,e)||this.ignoreDuringComposition(e)||e.type=="keydown"&&this.keydown(e)||(this.view.updateState!=0?Promise.resolve().then(()=>this.runHandlers(e.type,e)):this.runHandlers(e.type,e))}runHandlers(e,t){let i=this.handlers[e];if(i){for(let r of i.observers)r(this.view,t);for(let r of i.handlers){if(t.defaultPrevented)break;if(r(this.view,t)){t.preventDefault();break}}}}ensureHandlers(e){let t=GP(e),i=this.handlers,r=this.view.contentDOM;for(let n in t)if(n!="scroll"){let s=!t[n].handlers.length,a=i[n];a&&s!=!a.handlers.length&&(r.removeEventListen Line truncated
`))};if((v.mac||v.android)&&h.from==s-1&&/^\. ?$/.test(i.text)&&e.contentDOM.getAttribute("autocorrect")=="off"&&(h={from:a,to:o,insert:E.of([i.text.replace("."," ")])}),this.pendingContextChange=h,!e.state.readOnly){let f=this.to-this.from+(h.to-h.from+h.insert.length);So(e,h,S.single(this.toEditorPos(i.selectionStart,f),this.toEditorPos(i.selectionEnd,f)))}this.pendingContextChange&&(this.revertPending(e.state),this.setSelection(e.state)),h.from<h.to&&!h.insert.length&&e.inputState.composing>=0&&!/[\\p{Alphabetic}\\p{Number}_]/.test(t.text.slice(Math.max(0,i.updateRangeStart-1),Math.min(t.text.length,i.updateRangeStart+1)))&&this.handlers.compositionend(i)},this.handlers.characterboundsupdate=i=>{let r=[],n=null;for(let s=this.toEditorPos(i.rangeStart),a=this.toEditorPos(i.rangeEnd);s<a;s++){let o=e.coordsForChar(s);n=o&&new DOMRect(o.left,o.top,o.right-o.left,o.bottom-o.top)||n||new DOMRect,r.push(n)}t.updateCharacterBounds(i.rangeStart,r)},this.handlers.textformatupdate=i=>{let r=[];for(let n of i.getTextFormats()){let s=n.underlineStyle,a=n.underlineThickness;if(!/none/i.test(s)&&!/none/i.test(a)){let o=this.toEditorPos(n.rangeStart),l=this.toEditorPos(n.rangeEnd);if(o<l){let c=`text-decoration: underline ${/^[a-z]/.test(s)?s+" ":s=="Dashed"?"dashed ":s=="Squiggle"?"wavy ":""}${/thin/i.test(a)?1:2}px`;r.push(Y.mark({attributes:{style:c}}).range(o,l))}}}e.dispatch({effects:Jf.of(Y.set(r))})},this.handlers.compositionstart=()=>{e.inputState.composing<0&&(e.inputState.composing=0,e.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{if(e.inputState.composing=-1,e.inputState.compositionFirstChange=null,this.composing){let{drifted:i}=this.composing;this.composing=null,i&&this.reset(e.state)}};for(let i in this.handlers)t.addEventListener(i,this.handlers[i]);this.measureReq={read:i=>{this.editContext.updateControlBounds(i.contentDOM.getBoundingClientRect());let r=Bi(i.root);r&&r.rangeCount&&this.editContext.updateSelectionBounds(r.getRangeAt(0).getBoundingClientRect())}}}applyEdits(e){let t=0,i=!1,r=this.pendingContextChange;return e.changes.iterChanges((n,s,a,o,l)=>{if(i)return;let c=l.length-(s-n);if(r&&s>=r.to)if(r.from==n&&r.to==s&&r.insert.eq(l)){r=this.pendingContextChange=null,t+=c,this.to+=c;return}else r=null,this.revertPending(e.state);if(n+=t,s+=t,s<=this.from)this.from+=c,this.to+=c;else if(n<this.to){if(n<this.from||s>this.to||this.to-this.from+l.length>3e4){i=!0;return}this.editContext.updateText(this.toContextPos(n),this.toContextPos(s),l.toString()),this.to+=c}t+=c}),r&&!i&&this.revertPending(e.state),!i}update(e){let t=this.pendingContextChange,i=e.startState.selection.main;this.composing&&(this.composing.drifted||!e.changes.touchesRange(i.from,i.to)&&e.transactions.some(r=>!r.isUserEvent("input.type")&&r.changes.touchesRange(this.from,this.to)))?(this.composing.drifted=!0,this.composing.editorBase=e.changes.mapPos(this.composing.editorBase)):!this.applyEdits(e)||!this.rangeIsValid(e.state)?(this.pendingContextChange=null,this.reset(e.state)):(e.docChanged||e.selectionSet||t)&&this.setSelection(e.state),(e.geometryChanged||e.docChanged||e.selectionSet)&&e.view.requestMeasure(this.measureReq)}resetRange(e){let{head:t}=e.selection.main;this.from=Math.max(0,t-1e4),this.to=Math.min(e.doc.length,t+1e4)}reset(e){this.resetRange(e),this.editContext.updateText(0,this.editContext.text.length,e.doc.sliceString(this.from,this.to)),this.setSelection(e)}revertPending(e){let t=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(t.from),this.toContextPos(t.from+t.insert.length),e.doc.sliceString(t.from,t.to))}setSelection(e){let{main:t}=e.selection,i=this.toContextPos(Math.max(this.from,Math.min(this.to,t.anchor))),r=this.toContextPos(t.head);(this.editContext.selectionStart!=i||this.editContext.selectionEnd!=r)&&this.editContext.updateSelection(i,r)}rangeIsValid(e){let{head:t}=e.selection.main;return!(this.from>0&&t-this.from<500||this.to<e.doc.length&&this.to-t<500||this.to-this.from>1e4*3)}toEditorPos(e,t=this.to-this.from){e=Math.min(e,t);let i=this.composing;return i&&i.drifted?i.editorBase+(e-i.contextBase):e+this.from}toContextPos(e){let t=this.composing;return t&&t.drifted?t.contextBase+(e-t.editorBase):e-this.from}destroy(){for(let e in this.handlers)this.editContext.removeEventListener(e,this.handlers[e])}},T=class O{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return!!this.inputState&&this.inputState.composing>0}get compositionStarted(){return!!this.inputState&&this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(e={}){var t;this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRe Line truncated
-\x7F-\x9F\xAD\u061C\u200B\u200E\u200F\u2028\u2029\u202D\u202E\u2066\u2067\u2069\uFEFF\uFFF9-\uFFFC]`,no),xS={0:"null",7:"bell",8:"backspace",10:"newline",11:"vertical tab",13:"carriage return",27:"escape",8203:"zero width space",8204:"zero width non-joiner",8205:"zero width joiner",8206:"left-to-right mark",8207:"right-to-left mark",8232:"line separator",8237:"left-to-right override",8238:"right-to-left override",8294:"left-to-right isolate",8295:"right-to-left isolate",8297:"pop directional isolate",8233:"paragraph separator",65279:"zero width no-break space",65532:"object replacement"},$a=null;function kS(){var O;if($a==null&&typeof document<"u"&&document.body){let e=document.body.style;$a=((O=e.tabSize)!==null&&O!==void 0?O:e.MozTabSize)!=null}return $a||!1}var un=Z.define({combine(O){let e=xe(O,{render:null,specialChars:yS,addSpecialChars:null});return(e.replaceTabs=!kS())&&(e.specialChars=new RegExp(" |"+e.specialChars.source,no)),e.addSpecialChars&&(e.specialChars=new RegExp(e.specialChars.source+"|"+e.addSpecialChars.source,no)),e}});function _d(O={}){return[un.of(O),wS()]}var bf=null;function wS(){return bf||(bf=he.fromClass(class{constructor(O){this.view=O,this.decorations=Y.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(O.state.facet(un)),this.decorations=this.decorator.createDeco(O)}makeDecorator(O){return new ro({regexp:O.specialChars,decoration:(e,t,i)=>{let{doc:r}=t.state,n=Se(e[0],0);if(n==9){let s=r.lineAt(i),a=t.state.tabSize,o=ve(s.text,a,i-s.from);return Y.replace({widget:new ao((a-o%a)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[n]||(this.decorationCache[n]=Y.replace({widget:new so(O,n)}))},boundary:O.replaceTabs?void 0:/[^]/})}update(O){let e=O.state.facet(un);O.startState.facet(un)!=e?(this.decorator=this.makeDecorator(e),this.decorations=this.decorator.createDeco(O.view)):this.decorations=this.decorator.updateDeco(O,this.decorations)}},{decorations:O=>O.decorations}))}var ZS="\u2022";function vS(O){return O>=32?ZS:O==10?"\u2424":String.fromCharCode(9216+O)}var so=class extends _e{constructor(e,t){super(),this.options=e,this.code=t}eq(e){return e.code==this.code}toDOM(e){let t=vS(this.code),i=e.state.phrase("Control character")+" "+(xS[this.code]||"0x"+this.code.toString(16)),r=this.options.render&&this.options.render(this.code,i,t);if(r)return r;let n=document.createElement("span");return n.textContent=t,n.title=i,n.setAttribute("aria-label",i),n.className="cm-specialChar",n}ignoreEvent(){return!1}},ao=class extends _e{constructor(e){super(),this.width=e}eq(e){return e.width==this.width}toDOM(){let e=document.createElement("span");return e.textContent=" ",e.className="cm-tab",e.style.width=this.width+"px",e}ignoreEvent(){return!1}};function Rd(){return _S}var YS=Y.line({class:"cm-activeLine"}),_S=he.fromClass(class{constructor(O){this.decorations=this.getDeco(O)}update(O){(O.docChanged||O.selectionSet)&&(this.decorations=this.getDeco(O.view))}getDeco(O){let e=-1,t=[];for(let i of O.state.selection.ranges){let r=O.lineBlockAt(i.head);r.from>e&&(t.push(YS.range(r.from)),e=r.from)}return Y.set(t)}},{decorations:O=>O.decorations});var oo=2e3;function RS(O,e,t){let i=Math.min(e.line,t.line),r=Math.max(e.line,t.line),n=[];if(e.off>oo||t.off>oo||e.col<0||t.col<0){let s=Math.min(e.off,t.off),a=Math.max(e.off,t.off);for(let o=i;o<=r;o++){let l=O.doc.line(o);l.length<=a&&n.push(S.range(l.from+s,l.to+a))}}else{let s=Math.min(e.col,t.col),a=Math.max(e.col,t.col);for(let o=i;o<=r;o++){let l=O.doc.line(o),c=Kr(l.text,s,O.tabSize,!0);if(c<0)n.push(S.cursor(l.to));else{let h=Kr(l.text,a,O.tabSize);n.push(S.range(l.from+c,l.from+h))}}}return n}function VS(O,e){let t=O.coordsAtPos(O.viewport.from);return t?Math.round(Math.abs((t.left-e)/O.defaultCharacterWidth)):-1}function yf(O,e){let t=O.posAtCoords({x:e.clientX,y:e.clientY},!1),i=O.state.doc.lineAt(t),r=t-i.from,n=r>oo?-1:r==i.length?VS(O,e.clientX):ve(i.text,O.state.tabSize,t-i.from);return{line:i.number,col:n,off:r}}function qS(O,e){let t=yf(O,e),i=O.state.selection;return t?{update(r){if(r.docChanged){let n=r.changes.mapPos(r.startState.doc.line(t.line).from),s=r.state.doc.lineAt(n);t={line:s.number,col:t.col,off:Math.min(t.off,s.length)},i=i.map(r.changes)}},get(r,n,s){let a=yf(O,r);if(!a)return i;let o=RS(O.state,t,a);return o.length?s?S.create(o.concat(i.ranges)):S.create(o):i}}:null}function Vd(O){let e=O?.eventFilter||(t=>t.altKey&&t.button==0);return T.mouseSelectionStyle.of((t,i)=>e(i)?qS(t,i):null)}var zS={Alt:[18,O=>!!O.altKey],Control:[17,O=>!!O.ctrlKey],Shift:[16,O=>!!O.shiftKey],Meta:[91,O=>!!O.metaKey]},US={style:"cursor: crosshair"};function qd(O={}){let[e,t]=zS[O.key||"Alt"],i=he.fromClass(class{constructor(r){this.view=r,this.isDown=!1}set(r){this.isDown!=r&&(this.isDown=r,this.view.update([]))}},{eventObservers:{keydown(r){this.set(r.keyCode==e||t(r))},keyup(r){(r.keyCode==e||!t(r))&&this.set(!1)},mousemove(r){this.set(t(r))}}});return[i,T.contentAttributes.o Line truncated
-\x7F-\x9F\xAD\u061C\u200B\u200E\u200F\u2028\u2029\u202D\u202E\u2066\u2067\u2069\uFEFF\uFFF9-\uFFFC]`,no),xS={0:"null",7:"bell",8:"backspace",10:"newline",11:"vertical tab",13:"carriage return",27:"escape",8203:"zero width space",8204:"zero width non-joiner",8205:"zero width joiner",8206:"left-to-right mark",8207:"right-to-left mark",8232:"line separator",8237:"left-to-right override",8238:"right-to-left override",8294:"left-to-right isolate",8295:"right-to-left isolate",8297:"pop directional isolate",8233:"paragraph separator",65279:"zero width no-break space",65532:"object replacement"},$a=null;function kS(){var O;if($a==null&&typeof document<"u"&&document.body){let e=document.body.style;$a=((O=e.tabSize)!==null&&O!==void 0?O:e.MozTabSize)!=null}return $a||!1}var un=Z.define({combine(O){let e=xe(O,{render:null,specialChars:yS,addSpecialChars:null});return(e.replaceTabs=!kS())&&(e.specialChars=new RegExp(" |"+e.specialChars.source,no)),e.addSpecialChars&&(e.specialChars=new RegExp(e.specialChars.source+"|"+e.addSpecialChars.source,no)),e}});function _d(O={}){return[un.of(O),wS()]}var bf=null;function wS(){return bf||(bf=he.fromClass(class{constructor(O){this.view=O,this.decorations=Y.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(O.state.facet(un)),this.decorations=this.decorator.createDeco(O)}makeDecorator(O){return new ro({regexp:O.specialChars,decoration:(e,t,i)=>{let{doc:r}=t.state,n=Se(e[0],0);if(n==9){let s=r.lineAt(i),a=t.state.tabSize,o=ve(s.text,a,i-s.from);return Y.replace({widget:new ao((a-o%a)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[n]||(this.decorationCache[n]=Y.replace({widget:new so(O,n)}))},boundary:O.replaceTabs?void 0:/[^]/})}update(O){let e=O.state.facet(un);O.startState.facet(un)!=e?(this.decorator=this.makeDecorator(e),this.decorations=this.decorator.createDeco(O.view)):this.decorations=this.decorator.updateDeco(O,this.decorations)}},{decorations:O=>O.decorations}))}var ZS="\u2022";function vS(O){return O>=32?ZS:O==10?"\u2424":String.fromCharCode(9216+O)}var so=class extends _e{constructor(e,t){super(),this.options=e,this.code=t}eq(e){return e.code==this.code}toDOM(e){let t=vS(this.code),i=e.state.phrase("Control character")+" "+(xS[this.code]||"0x"+this.code.toString(16)),r=this.options.render&&this.options.render(this.code,i,t);if(r)return r;let n=document.createElement("span");return n.textContent=t,n.title=i,n.setAttribute("aria-label",i),n.className="cm-specialChar",n}ignoreEvent(){return!1}},ao=class extends _e{constructor(e){super(),this.width=e}eq(e){return e.width==this.width}toDOM(){let e=document.createElement("span");return e.textContent=" ",e.className="cm-tab",e.style.width=this.width+"px",e}ignoreEvent(){return!1}};function Rd(){return _S}var YS=Y.line({class:"cm-activeLine"}),_S=he.fromClass(class{constructor(O){this.decorations=this.getDeco(O)}update(O){(O.docChanged||O.selectionSet)&&(this.decorations=this.getDeco(O.view))}getDeco(O){let e=-1,t=[];for(let i of O.state.selection.ranges){let r=O.lineBlockAt(i.head);r.from>e&&(t.push(YS.range(r.from)),e=r.from)}return Y.set(t)}},{decorations:O=>O.decorations});var oo=2e3;function RS(O,e,t){let i=Math.min(e.line,t.line),r=Math.max(e.line,t.line),n=[];if(e.off>oo||t.off>oo||e.col<0||t.col<0){let s=Math.min(e.off,t.off),a=Math.max(e.off,t.off);for(let o=i;o<=r;o++){let l=O.doc.line(o);l.length<=a&&n.push(S.range(l.from+s,l.to+a))}}else{let s=Math.min(e.col,t.col),a=Math.max(e.col,t.col);for(let o=i;o<=r;o++){let l=O.doc.line(o),c=Kr(l.text,s,O.tabSize,!0);if(c<0)n.push(S.cursor(l.to));else{let h=Kr(l.text,a,O.tabSize);n.push(S.range(l.from+c,l.from+h))}}}return n}function VS(O,e){let t=O.coordsAtPos(O.viewport.from);return t?Math.round(Math.abs((t.left-e)/O.defaultCharacterWidth)):-1}function yf(O,e){let t=O.posAtCoords({x:e.clientX,y:e.clientY},!1),i=O.state.doc.lineAt(t),r=t-i.from,n=r>oo?-1:r==i.length?VS(O,e.clientX):ve(i.text,O.state.tabSize,t-i.from);return{line:i.number,col:n,off:r}}function qS(O,e){let t=yf(O,e),i=O.state.selection;return t?{update(r){if(r.docChanged){let n=r.changes.mapPos(r.startState.doc.line(t.line).from),s=r.state.doc.lineAt(n);t={line:s.number,col:t.col,off:Math.min(t.off,s.length)},i=i.map(r.changes)}},get(r,n,s){let a=yf(O,r);if(!a)return i;let o=RS(O.state,t,a);return o.length?s?S.create(o.concat(i.ranges)):S.create(o):i}}:null}function Vd(O){let e=O?.eventFilter||(t=>t.altKey&&t.button==0);return T.mouseSelectionStyle.of((t,i)=>e(i)?qS(t,i):null)}var zS={Alt:[18,O=>!!O.altKey],Control:[17,O=>!!O.ctrlKey],Shift:[16,O=>!!O.shiftKey],Meta:[91,O=>!!O.metaKey]},US={style:"cursor: crosshair"};function qd(O={}){let[e,t]=zS[O.key||"Alt"],i=he.fromClass(class{constructor(r){this.view=r,this.isDown=!1}set(r){this.isDown!=r&&(this.isDown=r,this.view.update([]))}},{eventObservers:{keydown(r){this.set(r.keyCode==e||t(r))},keyup(r){(r.keyCode==e||!t(r))&&this.set(!1)},mousemove(r){this.set(t(r))}}});return[i,T.contentAttributes.o Line truncated
`:i=="r"?"\r":i=="t"?" ":"\\")}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp&&this.wholeWord==e.wholeWord}create(){return this.regexp?new cl(this):new ll(this)}getCursor(e,t=0,i){let r=e.doc?e:I.create({doc:e});return i==null&&(i=r.doc.length),this.regexp?ui(this,r,t,i):di(this,r,t,i)}},ls=class{constructor(e){this.spec=e}};function di(O,e,t,i){return new lO(e.doc,O.unquoted,t,i,O.caseSensitive?void 0:r=>r.toLowerCase(),O.wholeWord?h1(e.doc,e.charCategorizer(e.selection.main.head)):void 0)}function h1(O,e){return(t,i,r,n)=>((n>t||n+r.length<i)&&(n=Math.max(0,t-2),r=O.sliceString(n,Math.min(O.length,i+2))),(e(cs(r,t-n))!=ee.Word||e(hs(r,t-n))!=ee.Word)&&(e(hs(r,i-n))!=ee.Word||e(cs(r,i-n))!=ee.Word))}var ll=class extends ls{constructor(e){super(e)}nextMatch(e,t,i){let r=di(this.spec,e,i,e.doc.length).nextOverlapping();if(r.done){let n=Math.min(e.doc.length,t+this.spec.unquoted.length);r=di(this.spec,e,0,n).nextOverlapping()}return r.done||r.value.from==t&&r.value.to==i?null:r.value}prevMatchInRange(e,t,i){for(let r=i;;){let n=Math.max(t,r-1e4-this.spec.unquoted.length),s=di(this.spec,e,n,r),a=null;for(;!s.nextOverlapping().done;)a=s.value;if(a)return a;if(n==t)return null;r-=1e4}}prevMatch(e,t,i){let r=this.prevMatchInRange(e,0,t);return r||(r=this.prevMatchInRange(e,Math.max(0,i-this.spec.unquoted.length),e.doc.length)),r&&(r.from!=t||r.to!=i)?r:null}getReplacement(e){return this.spec.unquote(this.spec.replace)}matchAll(e,t){let i=di(this.spec,e,0,e.doc.length),r=[];for(;!i.next().done;){if(r.length>=t)return null;r.push(i.value)}return r}highlight(e,t,i,r){let n=di(this.spec,e,Math.max(0,t-this.spec.unquoted.length),Math.min(i+this.spec.unquoted.length,e.doc.length));for(;!n.next().done;)r(n.value.from,n.value.to)}};function ui(O,e,t,i){return new rs(e.doc,O.search,{ignoreCase:!O.caseSensitive,test:O.wholeWord?f1(e.charCategorizer(e.selection.main.head)):void 0},t,i)}function cs(O,e){return O.slice(fe(O,e,!1),e)}function hs(O,e){return O.slice(e,fe(O,e))}function f1(O){return(e,t,i)=>!i[0].length||(O(cs(i.input,i.index))!=ee.Word||O(hs(i.input,i.index))!=ee.Word)&&(O(hs(i.input,i.index+i[0].length))!=ee.Word||O(cs(i.input,i.index+i[0].length))!=ee.Word)}var cl=class extends ls{nextMatch(e,t,i){let r=ui(this.spec,e,i,e.doc.length).next();return r.done&&(r=ui(this.spec,e,0,t).next()),r.done?null:r.value}prevMatchInRange(e,t,i){for(let r=1;;r++){let n=Math.max(t,i-r*1e4),s=ui(this.spec,e,n,i),a=null;for(;!s.next().done;)a=s.value;if(a&&(n==t||a.from>n+10))return a;if(n==t)return null}}prevMatch(e,t,i){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,i,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace).replace(/\$([$&]|\d+)/g,(t,i)=>{if(i=="&")return e.match[0];if(i=="$")return"$";for(let r=i.length;r>0;r--){let n=+i.slice(0,r);if(n>0&&n<e.match.length)return e.match[n]+i.slice(r)}return t})}matchAll(e,t){let i=ui(this.spec,e,0,e.doc.length),r=[];for(;!i.next().done;){if(r.length>=t)return null;r.push(i.value)}return r}highlight(e,t,i,r){let n=ui(this.spec,e,Math.max(0,t-250),Math.min(i+250,e.doc.length));for(;!n.next().done;)r(n.value.from,n.value.to)}},$r=V.define(),ul=V.define(),oO=ce.define({create(O){return new Qr(hl(O).create(),null)},update(O,e){for(let t of e.effects)t.is($r)?O=new Qr(t.value.create(),O.panel):t.is(ul)&&(O=new Qr(O.query,t.value?Ql:null));return O},provide:O=>TO.from(O,e=>e.panel)});var Qr=class{constructor(e,t){this.query=e,this.panel=t}},d1=Y.mark({class:"cm-searchMatch"}),u1=Y.mark({class:"cm-searchMatch cm-searchMatch-selected"}),Q1=he.fromClass(class{constructor(O){this.view=O,this.decorations=this.highlight(O.state.field(oO))}update(O){let e=O.state.field(oO);(e!=O.startState.field(oO)||O.docChanged||O.selectionSet||O.viewportChanged)&&(this.decorations=this.highlight(e))}highlight({query:O,panel:e}){if(!e||!O.spec.valid)return Y.none;let{view:t}=this,i=new Le;for(let r=0,n=t.visibleRanges,s=n.length;r<s;r++){let{from:a,to:o}=n[r];for(;r<s-1&&o>n[r+1].from-500;)o=n[++r].to;O.highlight(t.state,a,o,(l,c)=>{let h=t.state.selection.ranges.some(f=>f.from==l&&f.to==c);i.add(l,c,h?u1:d1)})}return i.finish()}},{decorations:O=>O.decorations});function pr(O){return e=>{let t=e.state.field(oO,!1);return t&&t.query.spec.valid?O(e,t):yQ(e)}}var fs=pr((O,{query:e})=>{let{to:t}=O.state.selection.main,i=e.nextMatch(O.state,t,t);if(!i)return!1;let r=S.single(i.from,i.to),n=O.state.facet(Qi);return O.dispatch({selection:r,effects:[$l(O,i),n.scrollToMatch(r.main,O)],userEvent:"select.search"}),bQ(O),!0}),ds=pr((O,{query:e})=>{let{state:t}=O,{from:i}=t.selection.main,r=e.prevMatch(t,i,i);if(!r)return!1;let n=S.single(r.from,r.to),s=O.state.facet(Qi);return O.dispatch({selection:n,effects:[$l(O,r),s.scrollToMatch(n.main,O)],userEvent:"select.search"}),bQ(O),!0}),$1=pr((O,{query:e})=>{let t=e.matchAll(O.state,1e3);return!t||!t.length?!1:(O.dispatch({selection:S.create(t.map(i=>S.range(i.from Line truncated
\${}
}`,{label:"select",detail:"statement",type:"keyword"}),W("case ${}:\n${}",{label:"case",type:"keyword"}),W("switch ${} {\n ${}\n}",{label:"switch",detail:"statement",type:"keyword"}),W("switch ${}.(${type}) {\n ${}\n}",{label:"switch",detail:"type statement",type:"keyword"}),W("if ${} {\n ${}\n}",{label:"if",detail:"block",type:"keyword"}),W(`if \${} {